@g1cloud/page-builder-editor 1.0.0-alpha.17 → 1.0.0-alpha.18
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.scss +1 -2
- package/dist/PageBuilderEditor.vue.d.ts +0 -2
- package/dist/{PbPropertyEditorColor-DEVkcUND.js → PbPropertyEditorColor-B6_DIy47.js} +1 -1
- package/dist/{PbPropertyEditorHtml-CxPlqBYx.js → PbPropertyEditorHtml-BiMjuW0k.js} +1 -1
- package/dist/{PbPropertyEditorImage-DAEVOkpl.js → PbPropertyEditorImage-BwHm3YZo.js} +2 -2
- package/dist/{PbPropertyEditorMultilineText-zmUCXJQZ.js → PbPropertyEditorMultilineText-JyXSHgdX.js} +1 -1
- package/dist/{PbPropertyEditorText-CleInrev.js → PbPropertyEditorText-dMHwoG4V.js} +1 -1
- package/dist/{PbWidgetAddModal-DoR8HJUd.js → PbWidgetAddModal-eGdqZyZu.js} +1 -1
- package/dist/{index-rPBXWjSz.js → index-C8Vb2KOj.js} +498 -687
- package/dist/model/command.d.ts +10 -13
- package/dist/model/context.d.ts +0 -12
- package/dist/model/event.d.ts +0 -56
- package/dist/model/model.d.ts +7 -2
- package/dist/model/page-builder-editor.d.ts +9 -5
- package/dist/model/part-definintion.d.ts +2 -3
- package/dist/page-builder-editor.js +17 -18
- package/dist/page-builder-editor.umd.cjs +548 -786
- package/package.json +2 -2
- package/dist/PbPartAddModal-DuLpnV4E.js +0 -50
- package/dist/components/sidebar/property/PbPropertyLocalMarketingPart.vue.d.ts +0 -23
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";
|
|
@@ -72,18 +64,18 @@ export declare class AddBlockCommand implements Command {
|
|
|
72
64
|
export declare class AddSectionAboveCommand implements Command {
|
|
73
65
|
private modal;
|
|
74
66
|
static readonly COMMAND_ID = "AddSectionAbove";
|
|
75
|
-
static readonly CAPTION = "Add
|
|
67
|
+
static readonly CAPTION = "Add Section Above";
|
|
76
68
|
readonly commandId = "AddSectionAbove";
|
|
77
|
-
readonly caption = "Add
|
|
69
|
+
readonly caption = "Add Section Above";
|
|
78
70
|
constructor(modal: BSModal);
|
|
79
71
|
execute(pageBuilder: PageBuilderEditor, args?: any): void;
|
|
80
72
|
}
|
|
81
73
|
export declare class AddSectionBelowCommand implements Command {
|
|
82
74
|
private modal;
|
|
83
75
|
static readonly COMMAND_ID = "AddSectionBelow";
|
|
84
|
-
static readonly CAPTION = "Add
|
|
76
|
+
static readonly CAPTION = "Add Section Below";
|
|
85
77
|
readonly commandId = "AddSectionBelow";
|
|
86
|
-
readonly caption = "Add
|
|
78
|
+
readonly caption = "Add Section Below";
|
|
87
79
|
constructor(modal: BSModal);
|
|
88
80
|
execute(pageBuilder: PageBuilderEditor, args?: any): void;
|
|
89
81
|
}
|
|
@@ -177,6 +169,11 @@ export declare class DeletePartCommand implements Command {
|
|
|
177
169
|
readonly caption = "Delete";
|
|
178
170
|
execute(pageBuilder: PageBuilderEditor): void;
|
|
179
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
|
+
}
|
|
180
177
|
export declare class CopyPartCommand implements Command {
|
|
181
178
|
static readonly COMMAND_ID = "CopyPart";
|
|
182
179
|
readonly commandId = "CopyPart";
|
|
@@ -197,7 +194,7 @@ export declare class SelectAllPartsCommand implements Command {
|
|
|
197
194
|
readonly commandId = "SelectAllParts";
|
|
198
195
|
execute(pageBuilder: PageBuilderEditor): void;
|
|
199
196
|
}
|
|
200
|
-
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)[];
|
|
201
198
|
export declare const menuItemForCommand: (pageBuilder: PageBuilderEditor, commandId: string, caption?: string) => MenuItem;
|
|
202
199
|
export declare const createDefaultContextMenus: () => ContextMenu[];
|
|
203
200
|
export declare const createDefaultKeyHandlers: () => KeyHandler[];
|
package/dist/model/context.d.ts
CHANGED
|
@@ -48,10 +48,6 @@ export declare class PageBuilderContextImpl implements PageBuilderContext {
|
|
|
48
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
|
-
isGlobalDesignPart: () => boolean;
|
|
53
|
-
isLocalDesignPart: () => boolean;
|
|
54
|
-
isLocalMarketingPart: () => boolean;
|
|
55
51
|
} | undefined;
|
|
56
52
|
getSingleSelectedBlock(): {
|
|
57
53
|
partType: string;
|
|
@@ -70,10 +66,6 @@ export declare class PageBuilderContextImpl implements PageBuilderContext {
|
|
|
70
66
|
getProperty: (propertyName: string) => import('@g1cloud/page-builder-viewer').MultiLangText | undefined;
|
|
71
67
|
getClassNames: () => string;
|
|
72
68
|
getStyles: () => Record<string, string>;
|
|
73
|
-
getPageBuilderId: () => string | undefined;
|
|
74
|
-
isGlobalDesignPart: () => boolean;
|
|
75
|
-
isLocalDesignPart: () => boolean;
|
|
76
|
-
isLocalMarketingPart: () => boolean;
|
|
77
69
|
} | undefined;
|
|
78
70
|
getSingleSelectedSection(): {
|
|
79
71
|
partType: string;
|
|
@@ -92,10 +84,6 @@ export declare class PageBuilderContextImpl implements PageBuilderContext {
|
|
|
92
84
|
getProperty: (propertyName: string) => import('@g1cloud/page-builder-viewer').MultiLangText | undefined;
|
|
93
85
|
getClassNames: () => string;
|
|
94
86
|
getStyles: () => Record<string, string>;
|
|
95
|
-
getPageBuilderId: () => string | undefined;
|
|
96
|
-
isGlobalDesignPart: () => boolean;
|
|
97
|
-
isLocalDesignPart: () => boolean;
|
|
98
|
-
isLocalMarketingPart: () => boolean;
|
|
99
87
|
} | undefined;
|
|
100
88
|
}
|
|
101
89
|
export type ContextMenu = {
|
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,8 +21,10 @@ 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
|
+
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;
|
|
24
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;
|
|
@@ -66,3 +70,4 @@ export type ModelUpdateResult = {
|
|
|
66
70
|
updated?: PartUpdateResult[];
|
|
67
71
|
deleted?: PartDeleteResult[];
|
|
68
72
|
};
|
|
73
|
+
export {};
|
|
@@ -8,7 +8,6 @@ import { PartManager } from './part-manager';
|
|
|
8
8
|
import { Model } from './model';
|
|
9
9
|
import { Component, Ref } from 'vue';
|
|
10
10
|
|
|
11
|
-
export type PageBuilderEditMode = 'template' | 'global' | 'local' | 'free';
|
|
12
11
|
export declare const createPageBuilderEditor: () => PageBuilderEditor;
|
|
13
12
|
export declare const providePageBuilder: (pageBuilder: PageBuilder) => void;
|
|
14
13
|
export declare const providePageBuilderEditor: (pageBuilderEditor: PageBuilderEditor) => void;
|
|
@@ -24,12 +23,11 @@ export interface PageBuilderEditor extends PageBuilder {
|
|
|
24
23
|
keyHandlers: KeyHandlers;
|
|
25
24
|
toolButtonRegistry: ToolButtonRegistry;
|
|
26
25
|
title?: string;
|
|
27
|
-
editMode: PageBuilderEditMode;
|
|
28
26
|
scale: Ref<number>;
|
|
29
27
|
locales: Ref<string[]>;
|
|
30
28
|
registerPlugin(plugin: PageBuilderPlugin): void;
|
|
31
29
|
registerCustomPlugin(plugin: any): void;
|
|
32
|
-
initData(
|
|
30
|
+
initData(data?: Record<string, unknown>): void;
|
|
33
31
|
undo(): void;
|
|
34
32
|
redo(): void;
|
|
35
33
|
zoom(scale: number): void;
|
|
@@ -39,6 +37,8 @@ export interface PageBuilderEditor extends PageBuilder {
|
|
|
39
37
|
makeMultipleScreen(): void;
|
|
40
38
|
getCustomWidgets(): PartDefinition[];
|
|
41
39
|
getProvider(name: string): (args?: any, callback?: (result?: any) => void) => unknown;
|
|
40
|
+
extractMedia(part: IPart): string[];
|
|
41
|
+
extractProvider(part: Record<string, unknown>): void;
|
|
42
42
|
}
|
|
43
43
|
export declare class PageBuilderEditorImpl implements PageBuilderEditor {
|
|
44
44
|
instanceId?: string;
|
|
@@ -50,11 +50,11 @@ export declare class PageBuilderEditorImpl implements PageBuilderEditor {
|
|
|
50
50
|
keyHandlers: KeyHandlers;
|
|
51
51
|
toolButtonRegistry: ToolButtonRegistry;
|
|
52
52
|
title?: string;
|
|
53
|
-
editMode: PageBuilderEditMode;
|
|
54
53
|
scale: Ref<number>;
|
|
55
54
|
locale: Ref<string>;
|
|
56
55
|
locales: Ref<string[]>;
|
|
57
56
|
customWidgets: PartDefinition[];
|
|
57
|
+
watchers: Record<string, unknown>;
|
|
58
58
|
providers: Record<string, unknown>;
|
|
59
59
|
constructor();
|
|
60
60
|
getLocale(): string;
|
|
@@ -67,13 +67,17 @@ export declare class PageBuilderEditorImpl implements PageBuilderEditor {
|
|
|
67
67
|
provideCustomWidgetData(part: IPart): Promise<unknown>;
|
|
68
68
|
registerPlugin(plugin: PageBuilderPlugin): void;
|
|
69
69
|
registerCustomPlugin(plugin: any): void;
|
|
70
|
-
initData(
|
|
70
|
+
initData(data?: Record<string, unknown>): void;
|
|
71
71
|
undo(): void;
|
|
72
72
|
redo(): void;
|
|
73
73
|
zoom(scale: number): void;
|
|
74
74
|
makeSingleScreen(screenToKeep: number): void;
|
|
75
75
|
makeMultipleScreen(): void;
|
|
76
76
|
getCustomWidgets(): PartDefinition[];
|
|
77
|
+
extractMedia(part: IPart): string[];
|
|
78
|
+
extractProvider(part: Record<string, unknown>): void;
|
|
79
|
+
private extractMediaFromPart;
|
|
80
|
+
private extractMediaFromHtml;
|
|
77
81
|
private getEmptyPageContent;
|
|
78
82
|
private initPlugins;
|
|
79
83
|
}
|
|
@@ -14,8 +14,8 @@ export type PartDefinition = {
|
|
|
14
14
|
allowsChild: (partOrName?: IPart | string | undefined) => boolean;
|
|
15
15
|
creator: PartCreator;
|
|
16
16
|
component?: Component;
|
|
17
|
-
dataWatcher?:
|
|
18
|
-
dataProvider?:
|
|
17
|
+
dataWatcher?: string;
|
|
18
|
+
dataProvider?: string;
|
|
19
19
|
};
|
|
20
20
|
export type PartDefinitionGroup = {
|
|
21
21
|
groupName: string;
|
|
@@ -24,7 +24,6 @@ export type PartDefinitionGroup = {
|
|
|
24
24
|
};
|
|
25
25
|
declare const partDefinitions: Record<string, PartDefinition>;
|
|
26
26
|
export { partDefinitions };
|
|
27
|
-
export declare const designPartDefinitions: PartDefinitionGroup[];
|
|
28
27
|
export declare const layoutPartDefinitions: PartDefinitionGroup[];
|
|
29
28
|
export declare const widgetPartDefinitions: PartDefinitionGroup[];
|
|
30
29
|
export declare const blockWidgetPartDefinitions: PartDefinitionGroup[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B, b, M, c, d, e, _, a, f, g, h, i, j, k, l, m,
|
|
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-C8Vb2KOj.js";
|
|
2
2
|
export {
|
|
3
3
|
B as BLOCK_TYPE,
|
|
4
4
|
b as Block,
|
|
@@ -9,24 +9,23 @@ export {
|
|
|
9
9
|
_ as PageBuilderEditor,
|
|
10
10
|
a as PageBuilderEditorEvent,
|
|
11
11
|
f as PageBuilderViewer,
|
|
12
|
-
g as
|
|
13
|
-
h as
|
|
14
|
-
i as
|
|
15
|
-
j as
|
|
16
|
-
k as
|
|
17
|
-
l as
|
|
18
|
-
m as PbTextWidget,
|
|
12
|
+
g as Part,
|
|
13
|
+
h as PbCustomWidget,
|
|
14
|
+
i as PbHtmlWidget,
|
|
15
|
+
j as PbIframeWidget,
|
|
16
|
+
k as PbImageWidget,
|
|
17
|
+
l as PbTextWidget,
|
|
19
18
|
R as ROOT_TYPE,
|
|
20
|
-
|
|
19
|
+
m as RootPart,
|
|
21
20
|
S as SECTION_TYPE,
|
|
22
|
-
|
|
21
|
+
n as Section,
|
|
23
22
|
W as WIDGET_TYPE,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
|
32
31
|
};
|