@g1cloud/page-builder-editor 1.0.0-alpha.7 → 1.0.0-alpha.70

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.
Files changed (93) hide show
  1. package/css/canvas.scss +16 -137
  2. package/css/{canvas-block.scss → page-block.scss} +15 -3
  3. package/css/page-builder-editor.scss +43 -15
  4. package/css/{canvas-page.scss → page-page.scss} +24 -16
  5. package/css/{canvas-section.scss → page-section.scss} +17 -3
  6. package/css/{canvas-widget.scss → page-widget.scss} +28 -3
  7. package/css/page.scss +74 -0
  8. package/css/property-editor-image.scss +2 -2
  9. package/css/property-editor-number.scss +10 -0
  10. package/css/property-editor-youtube.scss +16 -0
  11. package/css/property-group-editor-background.scss +1 -1
  12. package/css/property-group-editor-media.scss +16 -0
  13. package/dist/PageBuilderEditor.vue.d.ts +22 -11
  14. package/dist/PbHtmlEditorModal-C0MLYY66.js +193 -0
  15. package/dist/PbPropertyEditorBoolean-c5CNiTpt.js +38 -0
  16. package/dist/{PbPropertyEditorColor-y7y6ZUQs.js → PbPropertyEditorColor-BNKJfa-T.js} +8 -9
  17. package/dist/PbPropertyEditorHtml-CQaImN-U.js +62 -0
  18. package/dist/PbPropertyEditorImage-3icZAidw.js +106 -0
  19. package/dist/{PbPropertyEditorMultilineText-sb-oS_gz.js → PbPropertyEditorMultilineText-B9-aaBcF.js} +28 -27
  20. package/dist/PbPropertyEditorNumber-B76ArSb5.js +47 -0
  21. package/dist/{PbPropertyEditorReadonlyText-Dgp_AVOD.js → PbPropertyEditorReadonlyText-BJ5qx69O.js} +6 -6
  22. package/dist/{PbPropertyEditorSelect-CWedbXJI.js → PbPropertyEditorSelect-B5sfulvx.js} +5 -6
  23. package/dist/{PbPropertyEditorText-BWOKvwD9.js → PbPropertyEditorText-BgQ4kpmo.js} +17 -8
  24. package/dist/PbPropertyEditorYoutube-DoRAsJTL.js +40 -0
  25. package/dist/PbScreenSelectModal-57LXAzjs.js +69 -0
  26. package/dist/PbWidgetAddModal-ChIMw44P.js +79 -0
  27. package/dist/PbYoutubeModal-CU8sClMD.js +73 -0
  28. package/dist/components/canvas/PbCanvas.vue.d.ts +1 -1
  29. package/dist/components/depart/PbLoginDepart.vue.d.ts +3 -3
  30. package/dist/components/menu/PbMenu.vue.d.ts +16 -1
  31. package/dist/components/menu/PbToolbar.vue.d.ts +16 -1
  32. package/dist/components/menu/PbToolbarButton.vue.d.ts +3 -3
  33. package/dist/components/menu/PbToolbarButtonGroup.vue.d.ts +3 -3
  34. package/dist/components/modal/PbHtmlEditorModal.vue.d.ts +28 -0
  35. package/dist/components/modal/PbPartAddModal.vue.d.ts +4 -4
  36. package/dist/components/modal/PbScreenSelectModal.vue.d.ts +6 -0
  37. package/dist/components/modal/PbWidgetAddModal.vue.d.ts +4 -4
  38. package/dist/components/modal/PbYoutubeModal.vue.d.ts +19 -0
  39. package/dist/components/navigator/PbNavigator.vue.d.ts +1 -1
  40. package/dist/components/part/PbAddWidgetButton.vue.d.ts +1 -1
  41. package/dist/components/part/PbBlock.vue.d.ts +7 -3
  42. package/dist/components/part/PbPage.vue.d.ts +5 -5
  43. package/dist/components/part/PbPageFrame.vue.d.ts +19 -0
  44. package/dist/components/part/PbSection.vue.d.ts +7 -3
  45. package/dist/components/part/PbWidget.vue.d.ts +5 -3
  46. package/dist/components/sidebar/PbSidebar.vue.d.ts +1 -1
  47. package/dist/components/sidebar/PbSidebarProperties.vue.d.ts +1 -1
  48. package/dist/components/sidebar/PbSidebarPropertyEditor.vue.d.ts +3 -3
  49. package/dist/components/sidebar/PbSidebarPropertyGroupEditor.vue.d.ts +3 -3
  50. package/dist/components/sidebar/property/{PbPropertyEditorProduct.vue.d.ts → PbPropertyEditorBoolean.vue.d.ts} +4 -4
  51. package/dist/components/sidebar/property/PbPropertyEditorColor.vue.d.ts +4 -4
  52. package/dist/components/sidebar/property/PbPropertyEditorHtml.vue.d.ts +4 -4
  53. package/dist/components/sidebar/property/PbPropertyEditorImage.vue.d.ts +5 -9
  54. package/dist/components/sidebar/property/PbPropertyEditorMultilineText.vue.d.ts +7 -6
  55. package/dist/components/sidebar/property/PbPropertyEditorNumber.vue.d.ts +23 -0
  56. package/dist/components/sidebar/property/PbPropertyEditorReadonlyText.vue.d.ts +3 -3
  57. package/dist/components/sidebar/property/PbPropertyEditorSelect.vue.d.ts +4 -4
  58. package/dist/components/sidebar/property/PbPropertyEditorText.vue.d.ts +9 -8
  59. package/dist/components/sidebar/property/{PbPropertyLocalMarketingPart.vue.d.ts → PbPropertyEditorYoutube.vue.d.ts} +9 -9
  60. package/dist/components/sidebar/property/PbPropertyGroupEditorBackground.vue.d.ts +3 -3
  61. package/dist/components/sidebar/property/PbPropertyGroupEditorBorder.vue.d.ts +3 -3
  62. package/dist/components/sidebar/property/PbPropertyGroupEditorMargin.vue.d.ts +3 -3
  63. package/dist/components/sidebar/property/PbPropertyGroupEditorMedia.vue.d.ts +20 -0
  64. package/dist/components/sidebar/property/PbPropertyGroupEditorPadding.vue.d.ts +3 -3
  65. package/dist/components/sidebar/property/PbPropertyGroupEditorPosition.vue.d.ts +3 -3
  66. package/dist/components/sidebar/property/PbPropertyGroupEditorSize.vue.d.ts +3 -3
  67. package/dist/components/ui/PbColorPicker.vue.d.ts +16 -7
  68. package/dist/directives/vPartHandler.d.ts +1 -0
  69. package/dist/{index-BTlwA7HP.js → index-BPFPSrrb.js} +4215 -2078
  70. package/dist/index.d.ts +6 -0
  71. package/dist/model/command.d.ts +47 -34
  72. package/dist/model/context.d.ts +19 -19
  73. package/dist/model/default-part-property-group.d.ts +4 -0
  74. package/dist/model/event.d.ts +0 -56
  75. package/dist/model/model.d.ts +8 -4
  76. package/dist/model/page-builder-editor.d.ts +39 -10
  77. package/dist/model/page-builder-util.d.ts +2 -0
  78. package/dist/model/part-definintion.d.ts +2 -2
  79. package/dist/model/part-manager.d.ts +2 -1
  80. package/dist/model/part-property.d.ts +4 -3
  81. package/dist/model/plugin.d.ts +23 -0
  82. package/dist/page-builder-editor.js +20 -17
  83. package/dist/page-builder-editor.umd.cjs +4941 -2453
  84. package/dist/text/text.d.ts +1 -0
  85. package/package.json +8 -6
  86. package/dist/HtmlEditorModal-BV5E6G70.js +0 -90
  87. package/dist/PbPartAddModal-DuLpnV4E.js +0 -50
  88. package/dist/PbPropertyEditorHtml-CbQR_BzH.js +0 -67
  89. package/dist/PbPropertyEditorImage-BXEXm2Px.js +0 -42
  90. package/dist/PbPropertyEditorProduct-p0zOCA9R.js +0 -49
  91. package/dist/PbWidgetAddModal-CQvFYzfU.js +0 -55
  92. package/dist/components/canvas/PbCanvasFrame.vue.d.ts +0 -2
  93. package/dist/components/modal/HtmlEditorModal.vue.d.ts +0 -23
package/dist/index.d.ts CHANGED
@@ -1,3 +1,9 @@
1
+ import { Model as PageBuilderEditorModel } from './model/model.ts';
2
+ import { PartDefinition, PartDefinitionGroup } from './model/part-definintion.ts';
3
+ import { PartProperty } from './model/part-property.ts';
4
+
1
5
  export { default as PageBuilderEditor } from './PageBuilderEditor.vue';
6
+ export type { PartProperty, PartDefinitionGroup, PartDefinition, PageBuilderEditorModel };
2
7
  export * from './model/event';
8
+ export * from './model/plugin';
3
9
  export * from '@g1cloud/page-builder-viewer';
@@ -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";
@@ -45,6 +37,7 @@ export declare class OpenAddWidgetModalCommand implements Command {
45
37
  export declare const createSection: (pageBuilder: PageBuilderEditor) => IPart | undefined;
46
38
  export declare const createBlock: (pageBuilder: PageBuilderEditor) => IPart | undefined;
47
39
  export declare const findLeafPart: (part: IPart | undefined) => IPart | undefined;
40
+ export declare const pasteContentJson: (pageBuilder: PageBuilderEditor, json: string) => void;
48
41
  export declare class AddPartCommand implements Command {
49
42
  private modal;
50
43
  static readonly COMMAND_ID = "AddPart";
@@ -53,114 +46,134 @@ export declare class AddPartCommand implements Command {
53
46
  constructor(modal: BSModal);
54
47
  execute(pageBuilder: PageBuilderEditor, args?: any): void;
55
48
  }
49
+ export declare class AddSectionCommand implements Command {
50
+ private modal;
51
+ static readonly COMMAND_ID = "AddSection";
52
+ readonly commandId = "AddSection";
53
+ readonly caption = "Add Section";
54
+ constructor(modal: BSModal);
55
+ execute(pageBuilder: PageBuilderEditor, args?: any): void;
56
+ }
57
+ export declare class AddBlockCommand implements Command {
58
+ private modal;
59
+ static readonly COMMAND_ID = "AddBlock";
60
+ readonly commandId = "AddBlock";
61
+ readonly caption = "Add Block";
62
+ constructor(modal: BSModal);
63
+ execute(pageBuilder: PageBuilderEditor, args?: any): void;
64
+ }
56
65
  export declare class AddSectionAboveCommand implements Command {
57
66
  private modal;
58
67
  static readonly COMMAND_ID = "AddSectionAbove";
59
- static readonly CAPTION = "Add Part Above";
68
+ static readonly CAPTION = "pb.menu.addSectionAbove";
60
69
  readonly commandId = "AddSectionAbove";
61
- readonly caption = "Add Part Above";
70
+ readonly caption = "pb.menu.addSectionAbove";
62
71
  constructor(modal: BSModal);
63
72
  execute(pageBuilder: PageBuilderEditor, args?: any): void;
64
73
  }
65
74
  export declare class AddSectionBelowCommand implements Command {
66
75
  private modal;
67
76
  static readonly COMMAND_ID = "AddSectionBelow";
68
- static readonly CAPTION = "Add Part Below";
77
+ static readonly CAPTION = "pb.menu.addSectionBelow";
69
78
  readonly commandId = "AddSectionBelow";
70
- readonly caption = "Add Part Below";
79
+ readonly caption = "pb.menu.addSectionBelow";
71
80
  constructor(modal: BSModal);
72
81
  execute(pageBuilder: PageBuilderEditor, args?: any): void;
73
82
  }
74
83
  export declare class AddBlockLeftCommand implements Command {
75
84
  static readonly COMMAND_ID = "AddBlockLeft";
76
- static readonly CAPTION = "Add Block Left";
85
+ static readonly CAPTION = "pb.menu.addBlockLeft";
77
86
  readonly commandId = "AddBlockLeft";
78
- readonly caption = "Add Block Left";
87
+ readonly caption = "pb.menu.addBlockLeft";
79
88
  constructor();
80
89
  execute(pageBuilder: PageBuilderEditor, args?: any): void;
81
90
  }
82
91
  export declare class AddBlockRightCommand implements Command {
83
92
  static readonly COMMAND_ID = "AddBlockRight";
84
- static readonly CAPTION = "Add Block Right";
93
+ static readonly CAPTION = "pb.menu.addBlockRight";
85
94
  readonly commandId = "AddBlockRight";
86
- readonly caption = "Add Block Right";
95
+ readonly caption = "pb.menu.addBlockRight";
87
96
  constructor();
88
97
  execute(pageBuilder: PageBuilderEditor, args?: any): void;
89
98
  }
90
99
  export declare class AddBlockAboveCommand implements Command {
91
100
  static readonly COMMAND_ID = "AddBlockAbove";
92
- static readonly CAPTION = "Add Block Above";
101
+ static readonly CAPTION = "pb.menu.addBlockAbove";
93
102
  readonly commandId = "AddBlockAbove";
94
- readonly caption = "Add Block Above";
103
+ readonly caption = "pb.menu.addBlockAbove";
95
104
  constructor();
96
105
  execute(pageBuilder: PageBuilderEditor, args?: any): void;
97
106
  }
98
107
  export declare class AddBlockBelowCommand implements Command {
99
108
  static readonly COMMAND_ID = "AddBlockBelow";
100
- static readonly CAPTION = "Add Block Below";
109
+ static readonly CAPTION = "pb.menu.addBlockBelow";
101
110
  readonly commandId = "AddBlockBelow";
102
- readonly caption = "Add Block Below";
111
+ readonly caption = "pb.menu.addBlockBelow";
103
112
  constructor();
104
113
  execute(pageBuilder: PageBuilderEditor, args?: any): void;
105
114
  }
106
115
  export declare class AddWidgetLeftCommand implements Command {
107
116
  private modal;
108
117
  static readonly COMMAND_ID = "AddWidgetLeft";
109
- static readonly CAPTION = "Add Widget Left";
118
+ static readonly CAPTION = "pb.menu.addWidgetLeft";
110
119
  readonly commandId = "AddWidgetLeft";
111
- readonly caption = "Add Widget Left";
120
+ readonly caption = "pb.menu.addWidgetLeft";
112
121
  constructor(modal: BSModal);
113
122
  execute(pageBuilder: PageBuilderEditor, args?: any): void;
114
123
  }
115
124
  export declare class AddWidgetRightCommand implements Command {
116
125
  private modal;
117
126
  static readonly COMMAND_ID = "AddWidgetRight";
118
- static readonly CAPTION = "Add Widget Right";
127
+ static readonly CAPTION = "pb.menu.addWidgetRight";
119
128
  readonly commandId = "AddWidgetRight";
120
- readonly caption = "Add Widget Right";
129
+ readonly caption = "pb.menu.addWidgetRight";
121
130
  constructor(modal: BSModal);
122
131
  execute(pageBuilder: PageBuilderEditor, args?: any): void;
123
132
  }
124
133
  export declare class AddWidgetAboveCommand implements Command {
125
134
  private modal;
126
135
  static readonly COMMAND_ID = "AddWidgetAbove";
127
- static readonly CAPTION = "Add Widget Above";
136
+ static readonly CAPTION = "pb.menu.addWidgetAbove";
128
137
  readonly commandId = "AddWidgetAbove";
129
- readonly caption = "Add Widget Above";
138
+ readonly caption = "pb.menu.addWidgetAbove";
130
139
  constructor(modal: BSModal);
131
140
  execute(pageBuilder: PageBuilderEditor, args?: any): void;
132
141
  }
133
142
  export declare class AddWidgetBelowCommand implements Command {
134
143
  private modal;
135
144
  static readonly COMMAND_ID = "AddWidgetBelow";
136
- static readonly CAPTION = "Add Widget Below";
145
+ static readonly CAPTION = "pb.menu.addWidgetBelow";
137
146
  readonly commandId = "AddWidgetBelow";
138
- readonly caption = "Add Widget Below";
147
+ readonly caption = "pb.menu.addWidgetBelow";
139
148
  constructor(modal: BSModal);
140
149
  execute(pageBuilder: PageBuilderEditor, args?: any): void;
141
150
  }
142
151
  export declare class AddWidgetInsideCommand implements Command {
143
152
  private modal;
144
153
  static readonly COMMAND_ID = "AddWidgetInside";
145
- static readonly CAPTION = "Add Widget Inside";
154
+ static readonly CAPTION = "pb.menu.addWidgetInside";
146
155
  readonly commandId = "AddWidgetInside";
147
- readonly caption = "Add Widget Inside";
156
+ readonly caption = "pb.menu.addWidgetInside";
148
157
  constructor(modal: BSModal);
149
158
  execute(pageBuilder: PageBuilderEditor, args?: any): void;
150
159
  }
151
160
  export declare class ChangePropertyCommand implements Command {
152
161
  static readonly COMMAND_ID = "ChangeProperty";
153
162
  readonly commandId = "ChangeProperty";
154
- readonly caption = "Change Property";
155
163
  execute(pageBuilder: PageBuilderEditor, args?: any): void;
156
164
  }
157
165
  export declare class DeletePartCommand implements Command {
158
166
  static readonly COMMAND_ID = "DeletePart";
159
- static readonly CAPTION = "Delete";
167
+ static readonly CAPTION = "pb.menu.deletePart";
160
168
  readonly commandId = "DeletePart";
161
- readonly caption = "Delete";
169
+ readonly caption = "pb.menu.deletePart";
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) => (OpenAddPartModalCommand | OpenAddWidgetModalCommand | AddPartCommand | AddSectionAboveCommand | AddSectionBelowCommand | AddBlockLeftCommand | AddBlockRightCommand | AddBlockAboveCommand | AddBlockBelowCommand | AddWidgetLeftCommand | AddWidgetRightCommand | AddWidgetAboveCommand | AddWidgetBelowCommand | AddWidgetInsideCommand | ChangePropertyCommand | DeletePartCommand | CopyPartCommand | CutPartCommand | PastePartCommand | SelectAllPartsCommand)[];
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[];
@@ -44,14 +44,14 @@ export declare class PageBuilderContextImpl implements PageBuilderContext {
44
44
  isBlock: () => boolean;
45
45
  isWidget: () => boolean;
46
46
  isNestedWidget: () => boolean;
47
+ isParentOf: (part: IPart | undefined) => boolean;
48
+ isChildOf: (part: IPart | undefined) => boolean;
47
49
  getName: () => string | undefined;
48
50
  getProperty: (propertyName: string) => import('@g1cloud/page-builder-viewer').MultiLangText | undefined;
49
51
  getClassNames: () => string;
50
- getStyles: () => Record<string, string>;
51
- getPageBuilderId: () => string | undefined;
52
- isGlobalDesignPart: () => boolean;
53
- isLocalDesignPart: () => boolean;
54
- isLocalMarketingPart: () => boolean;
52
+ getStyles: (isMobilePage?: boolean | undefined) => Record<string, string>;
53
+ getInlineStyles: () => Record<string, string>;
54
+ getStyleTag: () => string;
55
55
  } | undefined;
56
56
  getSingleSelectedBlock(): {
57
57
  partType: string;
@@ -66,14 +66,14 @@ export declare class PageBuilderContextImpl implements PageBuilderContext {
66
66
  isBlock: () => boolean;
67
67
  isWidget: () => boolean;
68
68
  isNestedWidget: () => boolean;
69
+ isParentOf: (part: IPart | undefined) => boolean;
70
+ isChildOf: (part: IPart | undefined) => boolean;
69
71
  getName: () => string | undefined;
70
72
  getProperty: (propertyName: string) => import('@g1cloud/page-builder-viewer').MultiLangText | undefined;
71
73
  getClassNames: () => string;
72
- getStyles: () => Record<string, string>;
73
- getPageBuilderId: () => string | undefined;
74
- isGlobalDesignPart: () => boolean;
75
- isLocalDesignPart: () => boolean;
76
- isLocalMarketingPart: () => boolean;
74
+ getStyles: (isMobilePage?: boolean | undefined) => Record<string, string>;
75
+ getInlineStyles: () => Record<string, string>;
76
+ getStyleTag: () => string;
77
77
  } | undefined;
78
78
  getSingleSelectedSection(): {
79
79
  partType: string;
@@ -88,14 +88,14 @@ export declare class PageBuilderContextImpl implements PageBuilderContext {
88
88
  isBlock: () => boolean;
89
89
  isWidget: () => boolean;
90
90
  isNestedWidget: () => boolean;
91
+ isParentOf: (part: IPart | undefined) => boolean;
92
+ isChildOf: (part: IPart | undefined) => boolean;
91
93
  getName: () => string | undefined;
92
94
  getProperty: (propertyName: string) => import('@g1cloud/page-builder-viewer').MultiLangText | undefined;
93
95
  getClassNames: () => string;
94
- getStyles: () => Record<string, string>;
95
- getPageBuilderId: () => string | undefined;
96
- isGlobalDesignPart: () => boolean;
97
- isLocalDesignPart: () => boolean;
98
- isLocalMarketingPart: () => boolean;
96
+ getStyles: (isMobilePage?: boolean | undefined) => Record<string, string>;
97
+ getInlineStyles: () => Record<string, string>;
98
+ getStyleTag: () => string;
99
99
  } | undefined;
100
100
  }
101
101
  export type ContextMenu = {
@@ -121,8 +121,8 @@ export interface KeyHandlers {
121
121
  appendKeyHandler(handler: KeyHandler): void;
122
122
  removeKeyHandler(handler: KeyHandler): void;
123
123
  handleKeyDownEvent(event: KeyboardEvent): void;
124
- addDocumentKeyEventListener(document: Document): void;
125
- removeDocumentKeyEventListener(document: Document): void;
124
+ addDocumentKeyEventListener(element: HTMLElement): void;
125
+ removeDocumentKeyEventListener(element: HTMLElement): void;
126
126
  }
127
127
  export declare class ContextMenuRegistryImpl implements ContextMenuRegistry {
128
128
  readonly groups: ContextMenuGroup[];
@@ -140,6 +140,6 @@ export declare class KeyHandlersImpl implements KeyHandlers {
140
140
  appendKeyHandler(handler: KeyHandler): void;
141
141
  removeKeyHandler(handler: KeyHandler): void;
142
142
  handleKeyDownEvent(event: KeyboardEvent): void;
143
- addDocumentKeyEventListener(document: Document): void;
144
- removeDocumentKeyEventListener(document: Document): void;
143
+ addDocumentKeyEventListener(element: HTMLElement): void;
144
+ removeDocumentKeyEventListener(element: HTMLElement): void;
145
145
  }
@@ -6,7 +6,11 @@ export declare const marginGroup: () => PartPropertyGroup;
6
6
  export declare const paddingGroup: () => PartPropertyGroup;
7
7
  export declare const commonGroup: () => PartPropertyGroup;
8
8
  export declare const layoutGroup: () => PartPropertyGroup;
9
+ export declare const alignGroup: () => PartPropertyGroup;
10
+ export declare const alignItemsGroup: () => PartPropertyGroup;
11
+ export declare const alignSelfGroup: () => PartPropertyGroup;
9
12
  export declare const backgroundGroup: () => PartPropertyGroup;
10
13
  export declare const borderGroup: () => PartPropertyGroup;
14
+ export declare const hideParentGroup: () => PartPropertyGroup;
11
15
  export declare const defaultPropertyGroups: () => PartPropertyGroup[];
12
16
  export declare const defaultWidgetPropertyGroups: () => PartPropertyGroup[];
@@ -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
  };
@@ -1,10 +1,11 @@
1
- import { IPart, MultiLangText } from '@g1cloud/page-builder-viewer';
1
+ import { IPart } from '@g1cloud/page-builder-viewer';
2
2
  import * as Y from 'yjs';
3
3
  export declare const ROOT_TYPE = "Root";
4
4
  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[];
8
9
  export declare const getNewPartId: () => string;
9
10
  export declare const partsToJsonString: (parts: IPart[]) => string;
10
11
  export declare const partFromJsonObject: (object: any, keepPartId?: boolean) => IPart | undefined;
@@ -19,8 +20,10 @@ export declare class Model {
19
20
  updateModel(param: ModelUpdateParam): ModelUpdateResult;
20
21
  findPartById(partId?: string): IPart | undefined;
21
22
  findPartsByIds(partIds: string[]): IPart[];
22
- serializePageModel: (partIds: string[]) => string;
23
- parsePageModel(json: string, keepPartId?: boolean): IPart[] | undefined;
23
+ serializeModel(mediaExtractor?: MediaExtractor): string;
24
+ parseModel(json: string, keepPartId?: boolean): IPart;
25
+ serializeParts(partIds: string[]): string;
26
+ parseParts(json: string, keepPartId?: boolean): IPart[] | undefined;
24
27
  moveElements(partId: string, destPartId: string, destIndex: number, update?: PartUpdateParam[], doNotChangeIndex?: boolean): void;
25
28
  isMobilePart(part: IPart): boolean;
26
29
  isPcPart(part: IPart): boolean;
@@ -49,7 +52,7 @@ export type PartInsertResult = {
49
52
  };
50
53
  export type PartUpdateResult = {
51
54
  element: Y.XmlElement;
52
- properties: Record<string, MultiLangText>;
55
+ properties: Record<string, unknown>;
53
56
  removeOtherProperties?: boolean;
54
57
  };
55
58
  export type PartDeleteResult = {
@@ -66,3 +69,4 @@ export type ModelUpdateResult = {
66
69
  updated?: PartUpdateResult[];
67
70
  deleted?: PartDeleteResult[];
68
71
  };
72
+ export {};
@@ -1,13 +1,14 @@
1
+ import { BSModal } from '@g1cloud/bluesea';
2
+ import { PartDefinitionGroup } from './part-definintion.ts';
1
3
  import { ContextMenuRegistry, ContextMenuRegistryImpl, KeyHandlers, PageBuilderContext, PageBuilderContextImpl } from './context.ts';
2
4
  import { ToolButtonRegistry } from './toolbar.ts';
3
5
  import { PageBuilderPlugin } from './plugin.ts';
4
- import { PageBuilder } from '@g1cloud/page-builder-viewer';
6
+ import { IPart, PageBuilder } from '@g1cloud/page-builder-viewer';
5
7
  import { CommandRegistry, CommandRegistryImpl } from './command';
6
8
  import { PartManager } from './part-manager';
7
9
  import { Model } from './model';
8
- import { Ref } from 'vue';
10
+ import { Component, Ref } from 'vue';
9
11
 
10
- export type PageBuilderEditMode = 'template' | 'global' | 'local' | 'free';
11
12
  export declare const createPageBuilderEditor: () => PageBuilderEditor;
12
13
  export declare const providePageBuilder: (pageBuilder: PageBuilder) => void;
13
14
  export declare const providePageBuilderEditor: (pageBuilderEditor: PageBuilderEditor) => void;
@@ -23,13 +24,23 @@ export interface PageBuilderEditor extends PageBuilder {
23
24
  keyHandlers: KeyHandlers;
24
25
  toolButtonRegistry: ToolButtonRegistry;
25
26
  title?: string;
26
- editMode: PageBuilderEditMode;
27
27
  scale: Ref<number>;
28
+ locale: Ref<string>;
29
+ locales: Ref<string[]>;
30
+ onModelUpdated?: (modified: boolean) => void;
28
31
  registerPlugin(plugin: PageBuilderPlugin): void;
29
- initData(content?: any): void;
32
+ registerCustomPlugin(plugin: any, modal: BSModal): void;
33
+ initData(data?: string): void;
30
34
  undo(): void;
31
35
  redo(): void;
32
36
  zoom(scale: number): void;
37
+ getLocales(): string[];
38
+ setLocales(locales?: string[]): void;
39
+ makeSingleScreen(screenToKeep: number): void;
40
+ makeMultipleScreen(): void;
41
+ getCustomWidgets(): PartDefinitionGroup[];
42
+ getProvider(name: string): (args?: any, callback?: (result?: any) => void) => unknown;
43
+ extractMedia(part: IPart): string[];
33
44
  }
34
45
  export declare class PageBuilderEditorImpl implements PageBuilderEditor {
35
46
  instanceId?: string;
@@ -41,17 +52,35 @@ export declare class PageBuilderEditorImpl implements PageBuilderEditor {
41
52
  keyHandlers: KeyHandlers;
42
53
  toolButtonRegistry: ToolButtonRegistry;
43
54
  title?: string;
44
- editMode: PageBuilderEditMode;
45
55
  scale: Ref<number>;
46
- language: Ref<string>;
56
+ locale: Ref<string>;
57
+ locales: Ref<string[]>;
58
+ customWidgets: PartDefinitionGroup[];
59
+ providers: Record<string, unknown>;
60
+ externalCssLinks: string[];
61
+ externalCssContent: string;
62
+ initialized: boolean;
63
+ onModelUpdated?: (modified: boolean) => void;
47
64
  constructor();
48
- getLanguage(): string;
49
- setLanguage(language?: string): void;
65
+ getLocale(): string;
66
+ setLocale(locale?: string): void;
67
+ getLocales(): string[];
68
+ setLocales(locales?: string[]): void;
69
+ getCustomWidgetComponent(part: IPart): Component | undefined;
70
+ getProvider(name: string): (args?: any, callback?: (result?: any) => void) => unknown;
50
71
  registerPlugin(plugin: PageBuilderPlugin): void;
51
- initData(content?: any[]): void;
72
+ registerCustomPlugin(plugin: any, modal: BSModal): void;
73
+ initData(data?: string): void;
52
74
  undo(): void;
53
75
  redo(): void;
54
76
  zoom(scale: number): void;
77
+ makeSingleScreen(screenToKeep: number): void;
78
+ makeMultipleScreen(): void;
79
+ getCustomWidgets(): PartDefinitionGroup[];
80
+ extractMedia(part: IPart): string[];
81
+ getExternalCss(): string;
82
+ private extractMediaFromPart;
83
+ private extractMediaFromHtml;
55
84
  private getEmptyPageContent;
56
85
  private initPlugins;
57
86
  }
@@ -1,5 +1,7 @@
1
+ import { BSModal } from '@g1cloud/bluesea';
1
2
  import { IPart, MultiLangText } from '@g1cloud/page-builder-viewer';
2
3
 
3
4
  export declare const getPropertyValueOfParts: (parts: IPart[], propertyName: string) => MultiLangText | undefined;
4
5
  export declare const isCursorInElement: (event: MouseEvent, element: Element) => boolean;
5
6
  export declare const extractCommonStylesFromProperties: (properties: Record<string, string>) => Record<string, unknown>;
7
+ export declare const selectYoutubeVideo: (modal: BSModal, url?: string, callback?: (url?: string) => void) => void;
@@ -8,11 +8,12 @@ export type PartDefinition = {
8
8
  partName: string;
9
9
  caption: string;
10
10
  icon: string;
11
+ className: string;
11
12
  propertyGroups: PartPropertyGroup[];
12
13
  initialProperties: Record<string, string>;
13
- localized: boolean;
14
14
  allowsChild: (partOrName?: IPart | string | undefined) => boolean;
15
15
  creator: PartCreator;
16
+ component?: Component;
16
17
  };
17
18
  export type PartDefinitionGroup = {
18
19
  groupName: string;
@@ -21,7 +22,6 @@ export type PartDefinitionGroup = {
21
22
  };
22
23
  declare const partDefinitions: Record<string, PartDefinition>;
23
24
  export { partDefinitions };
24
- export declare const designPartDefinitions: PartDefinitionGroup[];
25
25
  export declare const layoutPartDefinitions: PartDefinitionGroup[];
26
26
  export declare const widgetPartDefinitions: PartDefinitionGroup[];
27
27
  export declare const blockWidgetPartDefinitions: PartDefinitionGroup[];
@@ -15,9 +15,10 @@ 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[];
20
+ getPartClassName(part?: IPart): string | undefined;
21
+ isChildAllowed(part?: IPart): boolean;
21
22
  registerPartPropertyGroupEditors(editors: Record<string, PartPropertyGroupEditor>): void;
22
23
  getPartPropertyGroupEditor(groupName: string): PartPropertyGroupEditor | undefined;
23
24
  registerPartPropertyEditors(editors: Record<PartPropertyType, PartPropertyEditor>): void;
@@ -1,7 +1,7 @@
1
1
  import { IPart } from '@g1cloud/page-builder-viewer';
2
2
  import { Component } from 'vue';
3
3
 
4
- export type PartPropertyType = 'readonly-text' | 'text' | 'number' | 'multiline-text' | 'select' | string;
4
+ export type PartPropertyType = 'readonly-text' | 'text' | 'number' | 'boolean' | 'multiline-text' | 'select' | string;
5
5
  export type PartPropertyEditor = (property: PartProperty, parts: IPart[]) => Component | undefined;
6
6
  export type PartProperty = {
7
7
  propertyName: string;
@@ -9,7 +9,9 @@ export type PartProperty = {
9
9
  caption: string;
10
10
  params?: any;
11
11
  propertyEditor?: PartPropertyEditor;
12
- localized?: boolean;
12
+ readonly?: boolean;
13
+ multiLang?: boolean;
14
+ propertyConstraint?: Record<string, unknown>;
13
15
  };
14
16
  export type PartPropertyGroupEditor = (group: PartPropertyGroup, parts: IPart[]) => Component | undefined;
15
17
  export type PartPropertyGroup = {
@@ -18,5 +20,4 @@ export type PartPropertyGroup = {
18
20
  caption: string;
19
21
  showGroupName?: boolean;
20
22
  propertyGroupEditor?: PartPropertyGroupEditor;
21
- localized?: boolean;
22
23
  };
@@ -1,3 +1,7 @@
1
+ import { Model } from './model.ts';
2
+ import { IPart } from '@g1cloud/page-builder-viewer';
3
+ import { BSModal, MultiLangText } from '@g1cloud/bluesea';
4
+ import { Component } from 'vue';
1
5
  import { PartPropertyEditor, PartPropertyGroupEditor, PartPropertyType } from './part-property.ts';
2
6
  import { PartDefinition } from './part-definintion.ts';
3
7
  import { ToolButtonGroup } from './toolbar.ts';
@@ -13,3 +17,22 @@ export type PageBuilderPlugin = {
13
17
  keyHandlers?: KeyHandler[];
14
18
  toolButtonGroups?: ToolButtonGroup[];
15
19
  };
20
+ export type PageBuilderToolbarPlugin = {
21
+ component: Component;
22
+ bind?: {
23
+ [key: string]: any;
24
+ };
25
+ on?: {
26
+ [key: string]: Function | Function[];
27
+ };
28
+ };
29
+ export type PageBuilderContextMenu = {
30
+ menuId: string;
31
+ caption: MultiLangText;
32
+ visible: (selected: IPart[]) => boolean;
33
+ handler: (selected: IPart[], model: Model, modal: BSModal) => void;
34
+ };
35
+ export type ImageProviderArg = {
36
+ modal: BSModal;
37
+ mediaTypes: string[];
38
+ };
@@ -1,4 +1,4 @@
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, w } from "./index-BTlwA7HP.js";
1
+ import { B, b, M, c, d, e, _, a, f, g, h, i, j, k, l, m, n, R, o, S, p, W, q, r, t, v, x, y, z, A, D } from "./index-BPFPSrrb.js";
2
2
  export {
3
3
  B as BLOCK_TYPE,
4
4
  b as Block,
@@ -9,23 +9,26 @@ export {
9
9
  _ as PageBuilderEditor,
10
10
  a as PageBuilderEditorEvent,
11
11
  f as PageBuilderViewer,
12
- g as PageBuilderViewerEvent,
13
- h as Part,
14
- i as PbHtmlWidget,
15
- j as PbImageWidget,
16
- k as PbProductListWidget,
17
- l as PbTextWidget,
12
+ g as Part,
13
+ h as PbContainerWidget,
14
+ i as PbCustomWidget,
15
+ j as PbHtmlWidget,
16
+ k as PbIframeWidget,
17
+ l as PbMediaWidget,
18
+ m as PbTextWidget,
19
+ n as PbYoutubeWidget,
18
20
  R as ROOT_TYPE,
19
- m as RootPart,
21
+ o as RootPart,
20
22
  S as SECTION_TYPE,
21
- n as Section,
23
+ p as Section,
22
24
  W as WIDGET_TYPE,
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
- w as usePageBuilderViewer
25
+ q as Widget,
26
+ r as createPageBuilderViewer,
27
+ t as createPartComponent,
28
+ v as createPartComponents,
29
+ x as getPartClassName,
30
+ y as providePageBuilder,
31
+ z as providePageBuilderViewer,
32
+ A as usePageBuilder,
33
+ D as usePageBuilderViewer
31
34
  };