@g1cloud/page-builder-editor 1.0.0-alpha.2 → 1.0.0-alpha.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/canvas-block.scss +1 -1
- package/css/canvas-section.scss +1 -1
- package/css/canvas-widget.scss +1 -1
- package/css/canvas.scss +1 -2
- package/css/page-builder-editor.scss +84 -12
- package/css/property-editor-color.scss +5 -0
- package/css/property-editor-html.scss +16 -0
- package/css/property-editor-image.scss +1 -1
- package/css/property-group-editor-background.scss +1 -13
- package/css/property-group-editor-border.scss +6 -12
- package/css/property-group-editor-margin.scss +0 -11
- package/css/property-group-editor-padding.scss +0 -11
- package/css/property-group-editor-position.scss +0 -11
- package/css/property-group-editor-size.scss +0 -11
- package/css/property-localpart.scss +2 -2
- package/dist/PageBuilderEditor.vue.d.ts +13 -5
- package/dist/PbHtmlEditorModal-aaecwH7V.js +131 -0
- package/dist/PbPropertyEditorColor-BFMkFOYX.js +57 -0
- package/dist/PbPropertyEditorHtml-DZw8qbJH.js +58 -0
- package/dist/{PbPropertyEditorImage-DA92v7AE.js → PbPropertyEditorImage-BQhiQyNM.js} +8 -8
- package/dist/PbPropertyEditorMultilineText-CT3vTbYY.js +67 -0
- package/dist/{PbPropertyEditorReadonlyText-Bk0WJxA0.js → PbPropertyEditorReadonlyText-Dgp_AVOD.js} +1 -1
- package/dist/{PbPropertyEditorSelect-BJovN1su.js → PbPropertyEditorSelect-CWedbXJI.js} +1 -1
- package/dist/{PbPropertyEditorText-DNdXl-Tr.js → PbPropertyEditorText-DmM_LMjC.js} +15 -5
- package/dist/PbScreenSelectModal-DDATc9n1.js +67 -0
- package/dist/{PbWidgetAddModal-CQvFYzfU.js → PbWidgetAddModal-BoYfb0dm.js} +32 -8
- package/dist/components/menu/PbMenu.vue.d.ts +16 -1
- package/dist/components/menu/PbToolbar.vue.d.ts +16 -1
- package/dist/components/modal/PbHtmlEditorModal.vue.d.ts +25 -0
- package/dist/components/modal/PbScreenSelectModal.vue.d.ts +6 -0
- package/dist/components/sidebar/property/{PbPropertyLocalMarketingPart.vue.d.ts → PbPropertyEditorHtml.vue.d.ts} +7 -7
- package/dist/components/sidebar/property/PbPropertyEditorMultilineText.vue.d.ts +6 -4
- package/dist/components/sidebar/property/PbPropertyEditorText.vue.d.ts +5 -4
- package/dist/components/ui/PbColorPicker.vue.d.ts +2 -2
- package/dist/{index-Dwk2ffWe.js → index-Cr-_-n9T.js} +1502 -1167
- package/dist/index.d.ts +1 -0
- package/dist/model/command.d.ts +26 -13
- package/dist/model/context.d.ts +10 -13
- package/dist/model/event.d.ts +0 -56
- package/dist/model/model.d.ts +11 -4
- package/dist/model/page-builder-editor.d.ts +39 -7
- package/dist/model/page-builder-util.d.ts +2 -2
- package/dist/model/part-definintion.d.ts +4 -1
- package/dist/model/part-manager.d.ts +0 -1
- package/dist/model/part-property.d.ts +1 -0
- package/dist/model/plugin.d.ts +10 -0
- package/dist/page-builder-editor.js +23 -19
- package/dist/page-builder-editor.umd.cjs +1910 -1310
- package/package.json +4 -3
- package/dist/PbPartAddModal-DuLpnV4E.js +0 -50
- package/dist/PbPropertyEditorMultilineText-BMeNUGm8.js +0 -42
- package/dist/PbPropertyEditorProduct-CkydxTwD.js +0 -49
- /package/dist/components/sidebar/property/{PbPropertyEditorProduct.vue.d.ts → PbPropertyEditorColor.vue.d.ts} +0 -0
package/dist/index.d.ts
CHANGED
package/dist/model/command.d.ts
CHANGED
|
@@ -26,14 +26,6 @@ export declare class CommandRegistryImpl implements CommandRegistry {
|
|
|
26
26
|
getCommand(commandId: string): Command | undefined;
|
|
27
27
|
executeCommand(commandId: string, args?: any): boolean;
|
|
28
28
|
}
|
|
29
|
-
export declare class OpenAddPartModalCommand implements Command {
|
|
30
|
-
private modal;
|
|
31
|
-
static readonly COMMAND_ID = "OpenAddPartModal";
|
|
32
|
-
readonly commandId = "OpenAddPartModal";
|
|
33
|
-
readonly caption = "Add Part";
|
|
34
|
-
constructor(modal: BSModal);
|
|
35
|
-
execute(pageBuilder: PageBuilderEditor, args?: any): void;
|
|
36
|
-
}
|
|
37
29
|
export declare class OpenAddWidgetModalCommand implements Command {
|
|
38
30
|
private modal;
|
|
39
31
|
static readonly COMMAND_ID = "OpenAddWidgetModal";
|
|
@@ -53,21 +45,37 @@ export declare class AddPartCommand implements Command {
|
|
|
53
45
|
constructor(modal: BSModal);
|
|
54
46
|
execute(pageBuilder: PageBuilderEditor, args?: any): void;
|
|
55
47
|
}
|
|
48
|
+
export declare class AddSectionCommand implements Command {
|
|
49
|
+
private modal;
|
|
50
|
+
static readonly COMMAND_ID = "AddSection";
|
|
51
|
+
readonly commandId = "AddSection";
|
|
52
|
+
readonly caption = "Add Section";
|
|
53
|
+
constructor(modal: BSModal);
|
|
54
|
+
execute(pageBuilder: PageBuilderEditor, args?: any): void;
|
|
55
|
+
}
|
|
56
|
+
export declare class AddBlockCommand implements Command {
|
|
57
|
+
private modal;
|
|
58
|
+
static readonly COMMAND_ID = "AddBlock";
|
|
59
|
+
readonly commandId = "AddBlock";
|
|
60
|
+
readonly caption = "Add Block";
|
|
61
|
+
constructor(modal: BSModal);
|
|
62
|
+
execute(pageBuilder: PageBuilderEditor, args?: any): void;
|
|
63
|
+
}
|
|
56
64
|
export declare class AddSectionAboveCommand implements Command {
|
|
57
65
|
private modal;
|
|
58
66
|
static readonly COMMAND_ID = "AddSectionAbove";
|
|
59
|
-
static readonly CAPTION = "Add
|
|
67
|
+
static readonly CAPTION = "Add Section Above";
|
|
60
68
|
readonly commandId = "AddSectionAbove";
|
|
61
|
-
readonly caption = "Add
|
|
69
|
+
readonly caption = "Add Section Above";
|
|
62
70
|
constructor(modal: BSModal);
|
|
63
71
|
execute(pageBuilder: PageBuilderEditor, args?: any): void;
|
|
64
72
|
}
|
|
65
73
|
export declare class AddSectionBelowCommand implements Command {
|
|
66
74
|
private modal;
|
|
67
75
|
static readonly COMMAND_ID = "AddSectionBelow";
|
|
68
|
-
static readonly CAPTION = "Add
|
|
76
|
+
static readonly CAPTION = "Add Section Below";
|
|
69
77
|
readonly commandId = "AddSectionBelow";
|
|
70
|
-
readonly caption = "Add
|
|
78
|
+
readonly caption = "Add Section Below";
|
|
71
79
|
constructor(modal: BSModal);
|
|
72
80
|
execute(pageBuilder: PageBuilderEditor, args?: any): void;
|
|
73
81
|
}
|
|
@@ -161,6 +169,11 @@ export declare class DeletePartCommand implements Command {
|
|
|
161
169
|
readonly caption = "Delete";
|
|
162
170
|
execute(pageBuilder: PageBuilderEditor): void;
|
|
163
171
|
}
|
|
172
|
+
export declare class CopyAllCommand implements Command {
|
|
173
|
+
static readonly COMMAND_ID = "CopyAll";
|
|
174
|
+
readonly commandId = "CopyAll";
|
|
175
|
+
execute(pageBuilder: PageBuilderEditor): Promise<void>;
|
|
176
|
+
}
|
|
164
177
|
export declare class CopyPartCommand implements Command {
|
|
165
178
|
static readonly COMMAND_ID = "CopyPart";
|
|
166
179
|
readonly commandId = "CopyPart";
|
|
@@ -181,7 +194,7 @@ export declare class SelectAllPartsCommand implements Command {
|
|
|
181
194
|
readonly commandId = "SelectAllParts";
|
|
182
195
|
execute(pageBuilder: PageBuilderEditor): void;
|
|
183
196
|
}
|
|
184
|
-
export declare const createDefaultCommands: (modal: BSModal) => (
|
|
197
|
+
export declare const createDefaultCommands: (modal: BSModal) => (OpenAddWidgetModalCommand | AddPartCommand | AddSectionCommand | AddBlockCommand | AddSectionAboveCommand | AddSectionBelowCommand | AddBlockLeftCommand | AddBlockRightCommand | AddBlockAboveCommand | AddBlockBelowCommand | AddWidgetLeftCommand | AddWidgetRightCommand | AddWidgetAboveCommand | AddWidgetBelowCommand | AddWidgetInsideCommand | ChangePropertyCommand | DeletePartCommand | CopyAllCommand | CopyPartCommand | CutPartCommand | PastePartCommand | SelectAllPartsCommand)[];
|
|
185
198
|
export declare const menuItemForCommand: (pageBuilder: PageBuilderEditor, commandId: string, caption?: string) => MenuItem;
|
|
186
199
|
export declare const createDefaultContextMenus: () => ContextMenu[];
|
|
187
200
|
export declare const createDefaultKeyHandlers: () => KeyHandler[];
|
package/dist/model/context.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ export declare class PageBuilderContextImpl implements PageBuilderContext {
|
|
|
35
35
|
partType: string;
|
|
36
36
|
partName: string;
|
|
37
37
|
partId: string;
|
|
38
|
-
properties?: Record<string,
|
|
38
|
+
properties?: Record<string, unknown> | undefined;
|
|
39
39
|
children?: any[] | undefined;
|
|
40
40
|
parent?: any | undefined;
|
|
41
41
|
isRoot: () => boolean;
|
|
@@ -45,16 +45,15 @@ export declare class PageBuilderContextImpl implements PageBuilderContext {
|
|
|
45
45
|
isWidget: () => boolean;
|
|
46
46
|
isNestedWidget: () => boolean;
|
|
47
47
|
getName: () => string | undefined;
|
|
48
|
-
getProperty: (propertyName: string) =>
|
|
48
|
+
getProperty: (propertyName: string) => import('@g1cloud/page-builder-viewer').MultiLangText | undefined;
|
|
49
49
|
getClassNames: () => string;
|
|
50
50
|
getStyles: () => Record<string, string>;
|
|
51
|
-
getPageBuilderId: () => string | undefined;
|
|
52
51
|
} | undefined;
|
|
53
52
|
getSingleSelectedBlock(): {
|
|
54
53
|
partType: string;
|
|
55
54
|
partName: string;
|
|
56
55
|
partId: string;
|
|
57
|
-
properties?: Record<string,
|
|
56
|
+
properties?: Record<string, unknown> | undefined;
|
|
58
57
|
children?: any[] | undefined;
|
|
59
58
|
parent?: any | undefined;
|
|
60
59
|
isRoot: () => boolean;
|
|
@@ -64,16 +63,15 @@ export declare class PageBuilderContextImpl implements PageBuilderContext {
|
|
|
64
63
|
isWidget: () => boolean;
|
|
65
64
|
isNestedWidget: () => boolean;
|
|
66
65
|
getName: () => string | undefined;
|
|
67
|
-
getProperty: (propertyName: string) =>
|
|
66
|
+
getProperty: (propertyName: string) => import('@g1cloud/page-builder-viewer').MultiLangText | undefined;
|
|
68
67
|
getClassNames: () => string;
|
|
69
68
|
getStyles: () => Record<string, string>;
|
|
70
|
-
getPageBuilderId: () => string | undefined;
|
|
71
69
|
} | undefined;
|
|
72
70
|
getSingleSelectedSection(): {
|
|
73
71
|
partType: string;
|
|
74
72
|
partName: string;
|
|
75
73
|
partId: string;
|
|
76
|
-
properties?: Record<string,
|
|
74
|
+
properties?: Record<string, unknown> | undefined;
|
|
77
75
|
children?: any[] | undefined;
|
|
78
76
|
parent?: any | undefined;
|
|
79
77
|
isRoot: () => boolean;
|
|
@@ -83,10 +81,9 @@ export declare class PageBuilderContextImpl implements PageBuilderContext {
|
|
|
83
81
|
isWidget: () => boolean;
|
|
84
82
|
isNestedWidget: () => boolean;
|
|
85
83
|
getName: () => string | undefined;
|
|
86
|
-
getProperty: (propertyName: string) =>
|
|
84
|
+
getProperty: (propertyName: string) => import('@g1cloud/page-builder-viewer').MultiLangText | undefined;
|
|
87
85
|
getClassNames: () => string;
|
|
88
86
|
getStyles: () => Record<string, string>;
|
|
89
|
-
getPageBuilderId: () => string | undefined;
|
|
90
87
|
} | undefined;
|
|
91
88
|
}
|
|
92
89
|
export type ContextMenu = {
|
|
@@ -112,8 +109,8 @@ export interface KeyHandlers {
|
|
|
112
109
|
appendKeyHandler(handler: KeyHandler): void;
|
|
113
110
|
removeKeyHandler(handler: KeyHandler): void;
|
|
114
111
|
handleKeyDownEvent(event: KeyboardEvent): void;
|
|
115
|
-
addDocumentKeyEventListener(
|
|
116
|
-
removeDocumentKeyEventListener(
|
|
112
|
+
addDocumentKeyEventListener(element: HTMLElement): void;
|
|
113
|
+
removeDocumentKeyEventListener(element: HTMLElement): void;
|
|
117
114
|
}
|
|
118
115
|
export declare class ContextMenuRegistryImpl implements ContextMenuRegistry {
|
|
119
116
|
readonly groups: ContextMenuGroup[];
|
|
@@ -131,6 +128,6 @@ export declare class KeyHandlersImpl implements KeyHandlers {
|
|
|
131
128
|
appendKeyHandler(handler: KeyHandler): void;
|
|
132
129
|
removeKeyHandler(handler: KeyHandler): void;
|
|
133
130
|
handleKeyDownEvent(event: KeyboardEvent): void;
|
|
134
|
-
addDocumentKeyEventListener(
|
|
135
|
-
removeDocumentKeyEventListener(
|
|
131
|
+
addDocumentKeyEventListener(element: HTMLElement): void;
|
|
132
|
+
removeDocumentKeyEventListener(element: HTMLElement): void;
|
|
136
133
|
}
|
package/dist/model/event.d.ts
CHANGED
|
@@ -3,74 +3,18 @@ import { ModelUpdateResult } from './model';
|
|
|
3
3
|
export type PageBuilderEditorEventType = {
|
|
4
4
|
modelUpdatedByUI: ModelUpdateResult;
|
|
5
5
|
modelUpdated: ModelUpdateResult;
|
|
6
|
-
requestImage: {
|
|
7
|
-
pageBuilderId?: string;
|
|
8
|
-
callback: (url: string) => void;
|
|
9
|
-
};
|
|
10
|
-
requestProducts: {
|
|
11
|
-
pageBuilderId?: string;
|
|
12
|
-
itemCodes: string;
|
|
13
|
-
callback: (products: any[]) => void;
|
|
14
|
-
};
|
|
15
|
-
requestLocalMarketingPartSchedule: {
|
|
16
|
-
pageBuilderId?: string;
|
|
17
|
-
partId: string;
|
|
18
|
-
callback: (schedule: any) => void;
|
|
19
|
-
};
|
|
20
6
|
};
|
|
21
7
|
export declare const PageBuilderEditorEvent: {
|
|
22
8
|
on: {
|
|
23
9
|
modelUpdated: (listener: (changes: ModelUpdateResult) => void) => void;
|
|
24
10
|
modelUpdatedByUI: (listener: (changes: ModelUpdateResult) => void) => void;
|
|
25
|
-
requestImage: (listener: (param: {
|
|
26
|
-
pageBuilderId?: string;
|
|
27
|
-
callback: (url: string) => void;
|
|
28
|
-
}) => void) => void;
|
|
29
|
-
requestProducts: (listener: (param: {
|
|
30
|
-
pageBuilderId?: string;
|
|
31
|
-
itemCodes: string;
|
|
32
|
-
callback: (products: any[]) => void;
|
|
33
|
-
}) => void) => void;
|
|
34
|
-
requestLocalMarketingPartSchedule: (listener: (param: {
|
|
35
|
-
pageBuilderId?: string;
|
|
36
|
-
partId: string;
|
|
37
|
-
callback: (schedule: any) => void;
|
|
38
|
-
}) => void) => void;
|
|
39
11
|
};
|
|
40
12
|
off: {
|
|
41
13
|
modelUpdated: (listener: (changes: ModelUpdateResult) => void) => void;
|
|
42
14
|
modelUpdatedByUI: (listener: (changes: ModelUpdateResult) => void) => void;
|
|
43
|
-
requestImage: (listener: (param: {
|
|
44
|
-
pageBuilderId?: string;
|
|
45
|
-
callback: (url: string) => void;
|
|
46
|
-
}) => void) => void;
|
|
47
|
-
requestProducts: (listener: (param: {
|
|
48
|
-
pageBuilderId?: string;
|
|
49
|
-
itemCodes: string;
|
|
50
|
-
callback: (products: any[]) => void;
|
|
51
|
-
}) => void) => void;
|
|
52
|
-
requestLocalMarketingPartSchedule: (listener: (param: {
|
|
53
|
-
pageBuilderId?: string;
|
|
54
|
-
partId: string;
|
|
55
|
-
callback: (schedule: any) => void;
|
|
56
|
-
}) => void) => void;
|
|
57
15
|
};
|
|
58
16
|
emit: {
|
|
59
17
|
modelUpdated: (changes: ModelUpdateResult) => void;
|
|
60
18
|
modelUpdatedByUI: (changes: ModelUpdateResult) => void;
|
|
61
|
-
requestImage: (param: {
|
|
62
|
-
pageBuilderId?: string;
|
|
63
|
-
callback: (url: string) => void;
|
|
64
|
-
}) => void;
|
|
65
|
-
requestProducts: (param: {
|
|
66
|
-
pageBuilderId?: string;
|
|
67
|
-
itemCodes: string;
|
|
68
|
-
callback: (products: any[]) => void;
|
|
69
|
-
}) => void;
|
|
70
|
-
requestLocalMarketingPartSchedule: (param: {
|
|
71
|
-
pageBuilderId?: string;
|
|
72
|
-
partId: string;
|
|
73
|
-
callback: (schedule: any) => void;
|
|
74
|
-
}) => void;
|
|
75
19
|
};
|
|
76
20
|
};
|
package/dist/model/model.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export declare const PAGE_TYPE = "Page";
|
|
|
5
5
|
export declare const SECTION_TYPE = "Section";
|
|
6
6
|
export declare const BLOCK_TYPE = "Block";
|
|
7
7
|
export declare const WIDGET_TYPE = "Widget";
|
|
8
|
+
type MediaExtractor = (part: IPart) => string[];
|
|
9
|
+
type ProviderExtractor = (partObject: Record<string, unknown>) => void;
|
|
8
10
|
export declare const getNewPartId: () => string;
|
|
9
11
|
export declare const partsToJsonString: (parts: IPart[]) => string;
|
|
10
12
|
export declare const partFromJsonObject: (object: any, keepPartId?: boolean) => IPart | undefined;
|
|
@@ -19,15 +21,19 @@ export declare class Model {
|
|
|
19
21
|
updateModel(param: ModelUpdateParam): ModelUpdateResult;
|
|
20
22
|
findPartById(partId?: string): IPart | undefined;
|
|
21
23
|
findPartsByIds(partIds: string[]): IPart[];
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
serializeModel(mediaExtractor?: MediaExtractor, providerExtractor?: ProviderExtractor): string;
|
|
25
|
+
parseModel(json: string, keepPartId?: boolean): IPart;
|
|
26
|
+
serializeParts(partIds: string[]): string;
|
|
27
|
+
parseParts(json: string, keepPartId?: boolean): IPart[] | undefined;
|
|
28
|
+
moveElements(partId: string, destPartId: string, destIndex: number, update?: PartUpdateParam[], doNotChangeIndex?: boolean): void;
|
|
25
29
|
isMobilePart(part: IPart): boolean;
|
|
26
30
|
isPcPart(part: IPart): boolean;
|
|
27
31
|
private insertParts;
|
|
28
32
|
private updateParts;
|
|
29
33
|
private deleteParts;
|
|
30
34
|
private createElement;
|
|
35
|
+
private setElementAttribute;
|
|
36
|
+
private getElementAttribute;
|
|
31
37
|
private getIndexOfElement;
|
|
32
38
|
private emitUpdateModelEvent;
|
|
33
39
|
}
|
|
@@ -47,7 +53,7 @@ export type PartInsertResult = {
|
|
|
47
53
|
};
|
|
48
54
|
export type PartUpdateResult = {
|
|
49
55
|
element: Y.XmlElement;
|
|
50
|
-
properties: Record<string,
|
|
56
|
+
properties: Record<string, unknown>;
|
|
51
57
|
removeOtherProperties?: boolean;
|
|
52
58
|
};
|
|
53
59
|
export type PartDeleteResult = {
|
|
@@ -64,3 +70,4 @@ export type ModelUpdateResult = {
|
|
|
64
70
|
updated?: PartUpdateResult[];
|
|
65
71
|
deleted?: PartDeleteResult[];
|
|
66
72
|
};
|
|
73
|
+
export {};
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
+
import { PartDefinition } from './part-definintion.ts';
|
|
1
2
|
import { ContextMenuRegistry, ContextMenuRegistryImpl, KeyHandlers, PageBuilderContext, PageBuilderContextImpl } from './context.ts';
|
|
2
3
|
import { ToolButtonRegistry } from './toolbar.ts';
|
|
3
4
|
import { PageBuilderPlugin } from './plugin.ts';
|
|
5
|
+
import { IPart, PageBuilder } from '@g1cloud/page-builder-viewer';
|
|
4
6
|
import { CommandRegistry, CommandRegistryImpl } from './command';
|
|
5
7
|
import { PartManager } from './part-manager';
|
|
6
8
|
import { Model } from './model';
|
|
7
|
-
import { Ref } from 'vue';
|
|
9
|
+
import { Component, Ref } from 'vue';
|
|
8
10
|
|
|
9
|
-
export type PageBuilderEditMode = 'template' | 'global' | 'local' | 'free';
|
|
10
11
|
export declare const createPageBuilderEditor: () => PageBuilderEditor;
|
|
12
|
+
export declare const providePageBuilder: (pageBuilder: PageBuilder) => void;
|
|
11
13
|
export declare const providePageBuilderEditor: (pageBuilderEditor: PageBuilderEditor) => void;
|
|
14
|
+
export declare const usePageBuilder: () => PageBuilder;
|
|
12
15
|
export declare const usePageBuilderEditor: () => PageBuilderEditor;
|
|
13
|
-
export interface PageBuilderEditor {
|
|
16
|
+
export interface PageBuilderEditor extends PageBuilder {
|
|
14
17
|
instanceId?: string;
|
|
15
18
|
partManager: PartManager;
|
|
16
19
|
model: Model;
|
|
@@ -20,13 +23,22 @@ export interface PageBuilderEditor {
|
|
|
20
23
|
keyHandlers: KeyHandlers;
|
|
21
24
|
toolButtonRegistry: ToolButtonRegistry;
|
|
22
25
|
title?: string;
|
|
23
|
-
editMode: PageBuilderEditMode;
|
|
24
26
|
scale: Ref<number>;
|
|
27
|
+
locales: Ref<string[]>;
|
|
25
28
|
registerPlugin(plugin: PageBuilderPlugin): void;
|
|
26
|
-
|
|
29
|
+
registerCustomPlugin(plugin: any): void;
|
|
30
|
+
initData(data?: string): void;
|
|
27
31
|
undo(): void;
|
|
28
32
|
redo(): void;
|
|
29
33
|
zoom(scale: number): void;
|
|
34
|
+
getLocales(): string[];
|
|
35
|
+
setLocales(locales?: string[]): void;
|
|
36
|
+
makeSingleScreen(screenToKeep: number): void;
|
|
37
|
+
makeMultipleScreen(): void;
|
|
38
|
+
getCustomWidgets(): PartDefinition[];
|
|
39
|
+
getProvider(name: string): (args?: any, callback?: (result?: any) => void) => unknown;
|
|
40
|
+
extractMedia(part: IPart): string[];
|
|
41
|
+
extractProvider(part: Record<string, unknown>): void;
|
|
30
42
|
}
|
|
31
43
|
export declare class PageBuilderEditorImpl implements PageBuilderEditor {
|
|
32
44
|
instanceId?: string;
|
|
@@ -38,14 +50,34 @@ export declare class PageBuilderEditorImpl implements PageBuilderEditor {
|
|
|
38
50
|
keyHandlers: KeyHandlers;
|
|
39
51
|
toolButtonRegistry: ToolButtonRegistry;
|
|
40
52
|
title?: string;
|
|
41
|
-
editMode: PageBuilderEditMode;
|
|
42
53
|
scale: Ref<number>;
|
|
54
|
+
locale: Ref<string>;
|
|
55
|
+
locales: Ref<string[]>;
|
|
56
|
+
customWidgets: PartDefinition[];
|
|
57
|
+
watchers: Record<string, unknown>;
|
|
58
|
+
providers: Record<string, unknown>;
|
|
43
59
|
constructor();
|
|
60
|
+
getLocale(): string;
|
|
61
|
+
setLocale(locale?: string): void;
|
|
62
|
+
getLocales(): string[];
|
|
63
|
+
setLocales(locales?: string[]): void;
|
|
64
|
+
getCustomWidgetComponent(part: IPart): Component | undefined;
|
|
65
|
+
getProvider(name: string): (args?: any, callback?: (result?: any) => void) => unknown;
|
|
66
|
+
watchCustomWidgetData(part: IPart): unknown;
|
|
67
|
+
provideCustomWidgetData(part: IPart): Promise<unknown>;
|
|
44
68
|
registerPlugin(plugin: PageBuilderPlugin): void;
|
|
45
|
-
|
|
69
|
+
registerCustomPlugin(plugin: any): void;
|
|
70
|
+
initData(data?: string): void;
|
|
46
71
|
undo(): void;
|
|
47
72
|
redo(): void;
|
|
48
73
|
zoom(scale: number): void;
|
|
74
|
+
makeSingleScreen(screenToKeep: number): void;
|
|
75
|
+
makeMultipleScreen(): void;
|
|
76
|
+
getCustomWidgets(): PartDefinition[];
|
|
77
|
+
extractMedia(part: IPart): string[];
|
|
78
|
+
extractProvider(part: Record<string, unknown>): void;
|
|
79
|
+
private extractMediaFromPart;
|
|
80
|
+
private extractMediaFromHtml;
|
|
49
81
|
private getEmptyPageContent;
|
|
50
82
|
private initPlugins;
|
|
51
83
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IPart } from '@g1cloud/page-builder-viewer';
|
|
1
|
+
import { IPart, MultiLangText } from '@g1cloud/page-builder-viewer';
|
|
2
2
|
|
|
3
|
-
export declare const getPropertyValueOfParts: (parts: IPart[], propertyName: string) =>
|
|
3
|
+
export declare const getPropertyValueOfParts: (parts: IPart[], propertyName: string) => MultiLangText | undefined;
|
|
4
4
|
export declare const isCursorInElement: (event: MouseEvent, element: Element) => boolean;
|
|
5
5
|
export declare const extractCommonStylesFromProperties: (properties: Record<string, string>) => Record<string, unknown>;
|
|
@@ -7,11 +7,15 @@ export type PartDefinition = {
|
|
|
7
7
|
partType: string;
|
|
8
8
|
partName: string;
|
|
9
9
|
caption: string;
|
|
10
|
+
icon: string;
|
|
10
11
|
propertyGroups: PartPropertyGroup[];
|
|
11
12
|
initialProperties: Record<string, string>;
|
|
12
13
|
localized: boolean;
|
|
13
14
|
allowsChild: (partOrName?: IPart | string | undefined) => boolean;
|
|
14
15
|
creator: PartCreator;
|
|
16
|
+
component?: Component;
|
|
17
|
+
dataWatcher?: string;
|
|
18
|
+
dataProvider?: string;
|
|
15
19
|
};
|
|
16
20
|
export type PartDefinitionGroup = {
|
|
17
21
|
groupName: string;
|
|
@@ -20,7 +24,6 @@ export type PartDefinitionGroup = {
|
|
|
20
24
|
};
|
|
21
25
|
declare const partDefinitions: Record<string, PartDefinition>;
|
|
22
26
|
export { partDefinitions };
|
|
23
|
-
export declare const designPartDefinitions: PartDefinitionGroup[];
|
|
24
27
|
export declare const layoutPartDefinitions: PartDefinitionGroup[];
|
|
25
28
|
export declare const widgetPartDefinitions: PartDefinitionGroup[];
|
|
26
29
|
export declare const blockWidgetPartDefinitions: PartDefinitionGroup[];
|
|
@@ -15,7 +15,6 @@ export declare class PartManager {
|
|
|
15
15
|
registerPartDefinitions(partDefinitions: Record<string, PartDefinition>): void;
|
|
16
16
|
getPartDefinition(partName: string): PartDefinition | undefined;
|
|
17
17
|
getPropertyDefinition(partName: string, propertyName: string): PartProperty | undefined;
|
|
18
|
-
getLocalDesignPartPropertyDefinitions(partName: string): PartProperty[] | undefined;
|
|
19
18
|
createPartComponent(part?: IPart): Component | undefined;
|
|
20
19
|
createPartComponents(parts?: IPart[]): PartComponent[];
|
|
21
20
|
registerPartPropertyGroupEditors(editors: Record<string, PartPropertyGroupEditor>): void;
|
|
@@ -10,6 +10,7 @@ export type PartProperty = {
|
|
|
10
10
|
params?: any;
|
|
11
11
|
propertyEditor?: PartPropertyEditor;
|
|
12
12
|
localized?: boolean;
|
|
13
|
+
multiLang?: boolean;
|
|
13
14
|
};
|
|
14
15
|
export type PartPropertyGroupEditor = (group: PartPropertyGroup, parts: IPart[]) => Component | undefined;
|
|
15
16
|
export type PartPropertyGroup = {
|
package/dist/model/plugin.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
1
2
|
import { PartPropertyEditor, PartPropertyGroupEditor, PartPropertyType } from './part-property.ts';
|
|
2
3
|
import { PartDefinition } from './part-definintion.ts';
|
|
3
4
|
import { ToolButtonGroup } from './toolbar.ts';
|
|
@@ -13,3 +14,12 @@ export type PageBuilderPlugin = {
|
|
|
13
14
|
keyHandlers?: KeyHandler[];
|
|
14
15
|
toolButtonGroups?: ToolButtonGroup[];
|
|
15
16
|
};
|
|
17
|
+
export type PageBuilderToolbarPlugin = {
|
|
18
|
+
component: Component;
|
|
19
|
+
bind?: {
|
|
20
|
+
[key: string]: any;
|
|
21
|
+
};
|
|
22
|
+
on?: {
|
|
23
|
+
[key: string]: Function | Function[];
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -1,27 +1,31 @@
|
|
|
1
|
-
import { B,
|
|
1
|
+
import { B, b, M, c, d, e, _, a, f, g, h, i, j, k, l, R, m, S, n, W, o, p, q, r, s, t, v, x } from "./index-Cr-_-n9T.js";
|
|
2
2
|
export {
|
|
3
3
|
B as BLOCK_TYPE,
|
|
4
|
-
|
|
4
|
+
b as Block,
|
|
5
5
|
M as Model,
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
c as PAGE_BUILDER_KEY,
|
|
7
|
+
d as PAGE_TYPE,
|
|
8
|
+
e as Page,
|
|
8
9
|
_ as PageBuilderEditor,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
a as PageBuilderEditorEvent,
|
|
11
|
+
f as PageBuilderViewer,
|
|
12
|
+
g as Part,
|
|
13
|
+
h as PbCustomWidget,
|
|
14
|
+
i as PbHtmlWidget,
|
|
15
|
+
j as PbIframeWidget,
|
|
16
|
+
k as PbImageWidget,
|
|
17
|
+
l as PbTextWidget,
|
|
16
18
|
R as ROOT_TYPE,
|
|
17
|
-
|
|
19
|
+
m as RootPart,
|
|
18
20
|
S as SECTION_TYPE,
|
|
19
|
-
|
|
21
|
+
n as Section,
|
|
20
22
|
W as WIDGET_TYPE,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
o as Widget,
|
|
24
|
+
p as createPageBuilderViewer,
|
|
25
|
+
q as createPartComponent,
|
|
26
|
+
r as createPartComponents,
|
|
27
|
+
s as providePageBuilder,
|
|
28
|
+
t as providePageBuilderViewer,
|
|
29
|
+
v as usePageBuilder,
|
|
30
|
+
x as usePageBuilderViewer
|
|
27
31
|
};
|