Plugins
pb-editor-page-element
export type PbEditorPageElementPlugin = Plugin & {
type: "pb-editor-page-element";
elementType: string;
toolbar?: {
title?: string | PbEditorPageElementTitle;
group?: string;
preview?: ({ theme: PbTheme }) => ReactNode;
};
help?: string;
target?: string[];
settings?: Array<string | Array<string | any>>;
create: (
options: { [key: string]: any },
parent?: PbEditorElement
) => Omit<PbEditorElement, "id">;
render: (params: { theme?: PbTheme; element: PbEditorElement; isActive: boolean }) => ReactNode;
canDelete?: (params: { element: PbEditorElement }) => boolean;
onReceived?: (params: {
state?: EventActionHandlerCallableState;
meta: EventActionHandlerMeta;
source: PbEditorElement | DragObjectWithTypeWithTarget;
target: PbEditorElement;
position: number | null;
}) => EventActionHandlerActionCallableResponse;
onChildDeleted?: (params: {
element: PbEditorElement;
child: PbEditorElement;
}) => PbEditorElement | undefined;
onCreate?: string;
renderElementPreview?: (params: {
element: PbEditorElement;
width: number;
height: number;
}) => ReactElement;
};
pb-render-page-element
export type PbRenderElementPlugin = Plugin & {
type: "pb-render-page-element";
elementType: string;
render: (params: { theme: PbTheme; element: PbElement }) => React.ReactNode;
};
pb-editor-page-element-advanced-settings
export type PbEditorPageElementAdvancedSettingsPlugin = Plugin & {
type: "pb-editor-page-element-advanced-settings";
elementType: string;
render(params?: { Bind: BindComponent; data: any; submit: () => void }): ReactElement;
onSave?: (data: FormData) => FormData;
};
pb-editor-page-element-style-settings
export type PbEditorPageElementStyleSettingsPlugin = Plugin & {
type: "pb-editor-page-element-style-settings";
render(params: { options?: any }): ReactElement;
elements?: boolean | string[];
};
pb-theme
export type PbTheme = {
colors: { [key: string]: string };
elements: { [key: string]: any };
typography: {
[key: string]: {
label: string;
component: string | React.ComponentType<any>;
className: string;
};
};
};
pb-page-layout
export type PbPageLayoutPlugin = Plugin & {
layout: PbPageLayout;
};