@g1cloud/page-builder-editor 1.0.0-alpha.1 → 1.0.0-alpha.2

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/README.md CHANGED
@@ -1,8 +1,21 @@
1
1
  # Page Builder
2
2
 
3
- ## Editor
3
+ ## Viewer
4
+
5
+ Install packages
6
+
7
+ ```bash
8
+ $ cd packages/viewer
9
+ $ pnpm install
10
+ ```
11
+
12
+ Build
13
+
14
+ ```bash
15
+ $ pnpm build --watch
16
+ ```
4
17
 
5
- ### Setup
18
+ ## Editor
6
19
 
7
20
  Install packages
8
21
 
@@ -11,13 +24,25 @@ $ cd packages/editor
11
24
  $ pnpm install
12
25
  ```
13
26
 
14
- ### Run
27
+ Build
15
28
 
16
- Start server
29
+ ```bash
30
+ $ pnpm build --watch
31
+ ```
32
+
33
+ ## Demo
34
+
35
+ Install packages
17
36
 
18
37
  ```bash
19
- $ cd packages/editor
20
- $ pnpm run dev
38
+ $ cd packages/demo
39
+ $ pnpm install
40
+ ```
41
+
42
+ Run
43
+
44
+ ```bash
45
+ $ pnpm dev
21
46
  ```
22
47
 
23
48
  Open browser : http://localhost:5173/
package/css/canvas.scss CHANGED
@@ -18,6 +18,7 @@ html, body {
18
18
  body {
19
19
  background-color: white;
20
20
  height: 100%;
21
+ margin: 0;
21
22
  }
22
23
 
23
24
  .pb-canvas-wrapper {
@@ -14,9 +14,7 @@
14
14
  width: 100%;
15
15
 
16
16
  .pb-toolbar {
17
- padding: 0 8px;
18
- margin: 6px 0;
19
-
17
+ margin: 0 -8px;
20
18
 
21
19
  .pb-tool-button-group {
22
20
  &::after {
@@ -41,17 +39,40 @@
41
39
  }
42
40
  }
43
41
 
42
+ .editor-wrapper {
43
+ height: 100%;
44
+ }
45
+
46
+ .pb-editor {
47
+ height: 100%;
48
+ }
49
+
50
+ .pb-editor-body {
51
+ padding: 8px 0 0;
52
+ gap: 8px;
53
+ height: 1px;
54
+
55
+ .bs-tab-sheet {
56
+ .tab-bar {
57
+ .tabs {
58
+ padding-top: 0;
59
+ }
60
+ }
61
+ }
62
+ }
63
+
44
64
  .pb-navigator {
45
65
  width: 200px;
46
- height: 100%;
47
- overflow: auto;
48
- border-right: 1px solid $color-border-light;
66
+ height: 1px;
67
+ overflow-y: auto;
68
+ padding: 8px 0;
69
+ flex-grow: 1;
49
70
  }
50
71
 
51
72
  .pb-sidebar {
52
73
  width: 300px;
53
74
  overflow: auto;
54
- border-left: 1px solid $color-border-light;
75
+ border: 1px solid $color-border-light;
55
76
 
56
77
  .pb-sidebar-properties {
57
78
  padding: 4px 0;
@@ -3,7 +3,9 @@ declare const _default: import('vue').DefineComponent<__VLS_TypePropsToRuntimePr
3
3
  title?: string | undefined;
4
4
  editMode?: string | undefined;
5
5
  pageContent?: any;
6
- }>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
6
+ }>, {
7
+ getLocalDesignPartContent: () => any[] | undefined;
8
+ }, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
7
9
  instanceId?: string | undefined;
8
10
  title?: string | undefined;
9
11
  editMode?: string | undefined;
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, openBlock, createElementBlock, createElementVNode, toDisplayString } from "vue";
2
2
  import { useModal } from "@g1cloud/bluesea";
3
- import { u as usePageBuilderEditor, P as PageBuilderEditorEvent } from "./index-BtILenNo.js";
3
+ import { u as usePageBuilderEditor, P as PageBuilderEditorEvent } from "./index-Dwk2ffWe.js";
4
4
  const _hoisted_1 = { class: "property-editor property-editor-image flex-align-center" };
5
5
  const _hoisted_2 = { class: "label" };
6
6
  const _hoisted_3 = ["textContent"];
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, openBlock, createElementBlock, createElementVNode, toDisplayString } from "vue";
2
2
  import { useModal } from "@g1cloud/bluesea";
3
- import { u as usePageBuilderEditor, P as PageBuilderEditorEvent } from "./index-BtILenNo.js";
3
+ import { u as usePageBuilderEditor, P as PageBuilderEditorEvent } from "./index-Dwk2ffWe.js";
4
4
  const _hoisted_1 = { class: "property-editor property-editor-product flex-align-center" };
5
5
  const _hoisted_2 = { class: "label" };
6
6
  const _hoisted_3 = ["textContent"];
@@ -6628,8 +6628,8 @@ const PageBuilderEditorEvent = {
6628
6628
  requestProducts: (listener) => {
6629
6629
  emitter$1.on("requestProducts", listener);
6630
6630
  },
6631
- requestLocalPartContentSchedule: (listener) => {
6632
- emitter$1.on("requestLocalPartContentSchedule", listener);
6631
+ requestLocalMarketingPartSchedule: (listener) => {
6632
+ emitter$1.on("requestLocalMarketingPartSchedule", listener);
6633
6633
  }
6634
6634
  },
6635
6635
  off: {
@@ -6645,8 +6645,8 @@ const PageBuilderEditorEvent = {
6645
6645
  requestProducts: (listener) => {
6646
6646
  emitter$1.off("requestProducts", listener);
6647
6647
  },
6648
- requestLocalPartContentSchedule: (listener) => {
6649
- emitter$1.off("requestLocalPartContentSchedule", listener);
6648
+ requestLocalMarketingPartSchedule: (listener) => {
6649
+ emitter$1.off("requestLocalMarketingPartSchedule", listener);
6650
6650
  }
6651
6651
  },
6652
6652
  emit: {
@@ -6662,8 +6662,8 @@ const PageBuilderEditorEvent = {
6662
6662
  requestProducts: (param) => {
6663
6663
  emitter$1.emit("requestProducts", param);
6664
6664
  },
6665
- requestLocalPartContentSchedule: (param) => {
6666
- emitter$1.emit("requestLocalPartContentSchedule", param);
6665
+ requestLocalMarketingPartSchedule: (param) => {
6666
+ emitter$1.emit("requestLocalMarketingPartSchedule", param);
6667
6667
  }
6668
6668
  }
6669
6669
  };
@@ -7268,6 +7268,11 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
7268
7268
  pageBuilderViewer.instanceId = props.instanceId;
7269
7269
  providePageBuilderViewer(pageBuilderViewer);
7270
7270
  const page = computed(() => pageBuilderViewer.model.rootPart.value.children && pageBuilderViewer.model.rootPart.value.children[0]);
7271
+ onMounted(() => {
7272
+ if (props.pageContent) {
7273
+ pageBuilderViewer.render(props.pageContent);
7274
+ }
7275
+ });
7271
7276
  watch(
7272
7277
  () => props.pageContent,
7273
7278
  (pageContent) => {
@@ -7342,12 +7347,12 @@ const partToJsonObject = (part) => {
7342
7347
  }
7343
7348
  return object;
7344
7349
  };
7345
- const partsFromJsonString = (jsonString) => {
7350
+ const partsFromJsonString = (jsonString, keepPartId = false) => {
7346
7351
  const objects = JSON.parse(jsonString);
7347
7352
  const parts = [];
7348
7353
  if (objects && objects instanceof Array) {
7349
7354
  objects.forEach((object) => {
7350
- const part = partFromJsonObject(object);
7355
+ const part = partFromJsonObject(object, keepPartId);
7351
7356
  if (part) {
7352
7357
  parts.push(part);
7353
7358
  }
@@ -7355,10 +7360,13 @@ const partsFromJsonString = (jsonString) => {
7355
7360
  }
7356
7361
  return parts;
7357
7362
  };
7358
- const partFromJsonObject = (object) => {
7363
+ const partFromJsonObject = (object, keepPartId = false) => {
7359
7364
  const part = createPart(object.partType, object.partName);
7360
7365
  if (!part)
7361
7366
  return;
7367
+ if (keepPartId && object.partId) {
7368
+ part.partId = object.partId;
7369
+ }
7362
7370
  if (object.properties) {
7363
7371
  part.properties = {};
7364
7372
  for (const name in object.properties) {
@@ -7369,7 +7377,7 @@ const partFromJsonObject = (object) => {
7369
7377
  part.children = [];
7370
7378
  object.children.forEach((childJson) => {
7371
7379
  var _a;
7372
- const childPart = partFromJsonObject(childJson);
7380
+ const childPart = partFromJsonObject(childJson, keepPartId);
7373
7381
  if (childPart) {
7374
7382
  childPart.parent = part;
7375
7383
  (_a = part.children) == null ? void 0 : _a.push(childPart);
@@ -7564,8 +7572,8 @@ class Model2 {
7564
7572
  });
7565
7573
  return parts;
7566
7574
  }
7567
- parsePageModel(json, removePartId) {
7568
- return partsFromJsonString(json);
7575
+ parsePageModel(json, keepPartId = false) {
7576
+ return partsFromJsonString(json, keepPartId);
7569
7577
  }
7570
7578
  moveElements(partId, destPartId, destIndex, update) {
7571
7579
  var _a;
@@ -7677,7 +7685,7 @@ class Model2 {
7677
7685
  }
7678
7686
  }
7679
7687
  node.setAttribute(PART_NAME_KEY, part.partName);
7680
- node.setAttribute(PART_ID_KEY, getNewPartId());
7688
+ node.setAttribute(PART_ID_KEY, part.partId || getNewPartId());
7681
7689
  if (part.children) {
7682
7690
  const childNodes = part.children.map((child) => this.createElement(child));
7683
7691
  node.insert(0, childNodes);
@@ -7761,6 +7769,20 @@ class PartManager {
7761
7769
  }
7762
7770
  }
7763
7771
  }
7772
+ getLocalDesignPartPropertyDefinitions(partName) {
7773
+ let properties;
7774
+ const partDef = this.getPartDefinition(partName);
7775
+ if (!partDef || !partDef.propertyGroups)
7776
+ return;
7777
+ for (const group of partDef.propertyGroups) {
7778
+ for (const property of group.properties) {
7779
+ if (property.localized) {
7780
+ properties = [...properties || [], property];
7781
+ }
7782
+ }
7783
+ }
7784
+ return properties;
7785
+ }
7764
7786
  createPartComponent(part) {
7765
7787
  if (part) {
7766
7788
  const def = this.getPartDefinition(part.partName);
@@ -7842,8 +7864,8 @@ const defaultPartPropertyEditors = () => {
7842
7864
  "text": () => defineAsyncComponent(() => import("./PbPropertyEditorText-DNdXl-Tr.js")),
7843
7865
  "multiline-text": () => defineAsyncComponent(() => import("./PbPropertyEditorMultilineText-BMeNUGm8.js")),
7844
7866
  "select": () => defineAsyncComponent(() => import("./PbPropertyEditorSelect-BJovN1su.js")),
7845
- "image": () => defineAsyncComponent(() => import("./PbPropertyEditorImage-BFIqG-bL.js")),
7846
- "product": () => defineAsyncComponent(() => import("./PbPropertyEditorProduct--cf9LI2Z.js"))
7867
+ "image": () => defineAsyncComponent(() => import("./PbPropertyEditorImage-DA92v7AE.js")),
7868
+ "product": () => defineAsyncComponent(() => import("./PbPropertyEditorProduct-CkydxTwD.js"))
7847
7869
  };
7848
7870
  };
7849
7871
  const getPropertyValueOfParts = (parts, propertyName) => {
@@ -8835,9 +8857,9 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
8835
8857
  var _a, _b, _c;
8836
8858
  if (["static"].includes(((_a = props.part.properties) == null ? void 0 : _a.sectionType) || ""))
8837
8859
  return true;
8838
- if (pageBuilder.editMode === "local" && ["globalPart"].includes(((_b = props.part.properties) == null ? void 0 : _b.sectionType) || ""))
8860
+ if (pageBuilder.editMode === "local" && ["GlobalDesignPart"].includes(((_b = props.part.properties) == null ? void 0 : _b.sectionType) || ""))
8839
8861
  return true;
8840
- if (pageBuilder.editMode === "global" && ["localPart", "scheduledLocalPart"].includes(((_c = props.part.properties) == null ? void 0 : _c.sectionType) || ""))
8862
+ if (pageBuilder.editMode === "global" && ["LocalDesignPart", "LocalMarketingPart"].includes(((_c = props.part.properties) == null ? void 0 : _c.sectionType) || ""))
8841
8863
  return true;
8842
8864
  return false;
8843
8865
  });
@@ -12482,7 +12504,7 @@ const _PastePartCommand = class _PastePartCommand {
12482
12504
  const { target, index = 0 } = findInsertTargetAndIndex(pageBuilder);
12483
12505
  if (target) {
12484
12506
  const json = await navigator.clipboard.readText();
12485
- const parts = pageBuilder.model.parsePageModel(json, true);
12507
+ const parts = pageBuilder.model.parsePageModel(json);
12486
12508
  if (parts) {
12487
12509
  insertParts(pageBuilder, target.partId, index, parts, false);
12488
12510
  }
@@ -13047,9 +13069,13 @@ class PageBuilderEditorImpl {
13047
13069
  this.model.rootPart.pageBuilderId = this.instanceId;
13048
13070
  let parts;
13049
13071
  if (content) {
13050
- const page = partFromJsonObject(content);
13051
- if (page) {
13052
- parts = [page, page];
13072
+ for (const p of content) {
13073
+ const page = partFromJsonObject(p, true);
13074
+ if (page) {
13075
+ if (!parts)
13076
+ parts = [];
13077
+ parts.push(page);
13078
+ }
13053
13079
  }
13054
13080
  }
13055
13081
  if (!parts) {
@@ -13213,7 +13239,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
13213
13239
  };
13214
13240
  }
13215
13241
  });
13216
- const canvasStyle = '.pb-page {\n margin: 0 auto;\n margin-top: 20px;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n}\n.pb-page .pb-page-content.selected {\n outline: 2px solid #4998f8;\n outline-offset: 5px;\n}\n.pb-page * {\n box-sizing: border-box;\n}\n.pb-add-widget-button {\n width: 100%;\n height: 100%;\n min-height: 200px;\n position: relative;\n}\n.pb-add-widget-button button {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n padding: 8px;\n background: none;\n border: none;\n cursor: pointer;\n}\n.pb-add-widget-button button:hover {\n background-color: #eeeeee;\n}\n.pb-add-widget-button .icon {\n font-size: 1rem;\n vertical-align: middle;\n}\n.pb-add-widget-button .text {\n font-size: 1rem;\n vertical-align: middle;\n margin-left: 0.4rem;\n}\n.pb-section {\n position: relative;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n outline: 1px dashed #ccc;\n background-color: #fff;\n}\n.pb-section:hover:not(:has(.pb-block:hover)) {\n background-color: #f0f0f0;\n}\n.pb-section.selected {\n outline: 1px solid #e67e22;\n outline-offset: 1px;\n z-index: 999;\n}\n.pb-section.pb-section-static {\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n}\n.pb-section.pb-section-static:after {\n content: "";\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n background-color: rgba(0, 0, 0, 0.2);\n}\n.pb-section-static .pb-widget {\n outline: none;\n}\n.pb-block {\n display: flex;\n min-width: 1px;\n position: relative;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n width: 100%;\n outline: 1px dashed #ccc;\n}\n.pb-block:hover:not(:has(.pb-widget:hover)) {\n background-color: #f0f0f0;\n}\n.pb-block.selected {\n outline: 1px solid #8e44ad;\n outline-offset: 1px;\n z-index: 999;\n}\n.pb-widget {\n position: relative;\n outline: 1px dashed #ccc;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n}\n.pb-widget.selected {\n outline: 2px solid #27ae60;\n outline-offset: 1px;\n z-index: 999;\n}\n.pb-widget .children {\n position: absolute;\n width: 100%;\n height: 100%;\n}\n.pb-widget .pan-handle {\n position: absolute;\n left: -6px;\n top: -6px;\n width: 12px;\n height: 12px;\n background-color: #27ae60;\n cursor: move;\n}\n.pb-widget .resize-handle {\n position: absolute;\n right: -6px;\n bottom: -6px;\n width: 12px;\n height: 12px;\n background-color: #27ae60;\n cursor: nwse-resize;\n}\n.pb-widget {\n position: relative;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n width: 100%;\n}\n.pb-widget .children {\n position: absolute;\n width: 100%;\n height: 100%;\n}\n.pb-text-widget {\n width: 100%;\n height: fit-content;\n}\n.pb-text-widget .text {\n color: #333;\n}\n.pb-text-widget.empty .text {\n color: #999;\n}\n.pb-image-widget {\n width: 100%;\n}\n.pb-image-widget .image {\n width: 100%;\n}\n.pb-image-widget .empty {\n height: 100px;\n background-color: #eee;\n text-align: center;\n}\n.pb-image-widget .empty span {\n font-size: 40px;\n color: #999;\n line-height: 100px;\n vertical-align: middle;\n}\n.pb-product-list-widget {\n width: 100%;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n justify-content: flex-start;\n align-items: center;\n}\n.pb-product-list-widget .product {\n width: 95%;\n margin: 0 auto;\n padding-top: 8px;\n padding-bottom: 8px;\n}\n.pb-product-list-widget img {\n width: 100%;\n}\n.pb-product-list-widget .name {\n margin-top: 8px;\n font-size: 14px;\n}\n.pb-product-list-widget .price {\n margin-top: 8px;\n font-size: 14px;\n font-weight: bold;\n}\n.pb-product-list-widget .empty {\n height: 200px;\n background-color: #eee;\n text-align: center;\n}\n.pb-product-list-widget .empty span {\n font-size: 40px;\n color: #999;\n line-height: 200px;\n vertical-align: middle;\n}\n.pb-page .mobile .pb-product-list-widget .product-wrapper {\n width: 50%;\n}\n.pb-page .pc .pb-product-list-widget .product-wrapper {\n width: 25%;\n}\n.pb-login-widget {\n height: 200px;\n text-align: center;\n}\n.pb-login-widget h3 {\n font-size: 32px;\n font-weight: bold;\n color: #ccc;\n line-height: 200px;\n vertical-align: middle;\n}\n.font-icon {\n font-family: Material Symbols Outlined, monospace;\n font-size: 1rem;\n max-width: 1em;\n}\nhtml, body {\n font-family: Noto Sans, Noto Sans KR, Noto Sans JP, Arial, sans-serif;\n font-size: 12px;\n}\nbody {\n background-color: white;\n height: 100%;\n}\n.pb-canvas-wrapper {\n padding: 32px 40px 56px 40px;\n height: 100%;\n background-color: #aaa;\n overflow: auto;\n}\n.pb-canvas-wrapper .pb-canvas {\n display: flex;\n flex-direction: row;\n transform-origin: top left;\n width: fit-content;\n min-width: 40px;\n min-height: 40px;\n margin: 0 auto;\n}\n.pb-position-mark {\n background-color: #ff3333;\n opacity: 0.5;\n border-radius: 2px;\n}\n.pb-add-section-handle {\n position: relative;\n text-align: center;\n cursor: pointer;\n z-index: 5;\n height: 0;\n}\n.pb-add-section-handle.top::before, .pb-add-section-handle.bottom::before, .pb-add-section-handle.middle::before {\n content: "";\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n opacity: 0;\n pointer-events: none;\n}\n.pb-add-section-handle.bottom {\n left: 50%;\n bottom: -32px;\n}\n.pb-add-section-handle:hover.top::before, .pb-add-section-handle:hover.bottom::before, .pb-add-section-handle:hover.middle::before,\n.pb-add-section-handle:hover > i {\n opacity: 1;\n}\n.pb-add-section-handle > i {\n vertical-align: middle;\n position: absolute;\n top: 50%;\n left: -20px;\n font-size: 2rem;\n transform: translate(-50%, -50%);\n opacity: 0.2;\n}\n.pb-button {\n background: none;\n border: none;\n cursor: pointer;\n vertical-align: middle;\n}\n.pb-guideline {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n}\n.pb-guideline.selected {\n z-index: 3;\n}\n.pb-guideline.preselect {\n z-index: 4;\n}';
13242
+ const canvasStyle = '.pb-page {\n margin: 0 auto;\n margin-top: 20px;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n}\n.pb-page .pb-page-content.selected {\n outline: 2px solid #4998f8;\n outline-offset: 5px;\n}\n.pb-page * {\n box-sizing: border-box;\n}\n.pb-add-widget-button {\n width: 100%;\n height: 100%;\n min-height: 200px;\n position: relative;\n}\n.pb-add-widget-button button {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n padding: 8px;\n background: none;\n border: none;\n cursor: pointer;\n}\n.pb-add-widget-button button:hover {\n background-color: #eeeeee;\n}\n.pb-add-widget-button .icon {\n font-size: 1rem;\n vertical-align: middle;\n}\n.pb-add-widget-button .text {\n font-size: 1rem;\n vertical-align: middle;\n margin-left: 0.4rem;\n}\n.pb-section {\n position: relative;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n outline: 1px dashed #ccc;\n background-color: #fff;\n}\n.pb-section:hover:not(:has(.pb-block:hover)) {\n background-color: #f0f0f0;\n}\n.pb-section.selected {\n outline: 1px solid #e67e22;\n outline-offset: 1px;\n z-index: 999;\n}\n.pb-section.pb-section-static {\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n}\n.pb-section.pb-section-static:after {\n content: "";\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n background-color: rgba(0, 0, 0, 0.2);\n}\n.pb-section-static .pb-widget {\n outline: none;\n}\n.pb-block {\n display: flex;\n min-width: 1px;\n position: relative;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n width: 100%;\n outline: 1px dashed #ccc;\n}\n.pb-block:hover:not(:has(.pb-widget:hover)) {\n background-color: #f0f0f0;\n}\n.pb-block.selected {\n outline: 1px solid #8e44ad;\n outline-offset: 1px;\n z-index: 999;\n}\n.pb-widget {\n position: relative;\n outline: 1px dashed #ccc;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n}\n.pb-widget.selected {\n outline: 2px solid #27ae60;\n outline-offset: 1px;\n z-index: 999;\n}\n.pb-widget .children {\n position: absolute;\n width: 100%;\n height: 100%;\n}\n.pb-widget .pan-handle {\n position: absolute;\n left: -6px;\n top: -6px;\n width: 12px;\n height: 12px;\n background-color: #27ae60;\n cursor: move;\n}\n.pb-widget .resize-handle {\n position: absolute;\n right: -6px;\n bottom: -6px;\n width: 12px;\n height: 12px;\n background-color: #27ae60;\n cursor: nwse-resize;\n}\n.pb-widget {\n position: relative;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n width: 100%;\n}\n.pb-widget .children {\n position: absolute;\n width: 100%;\n height: 100%;\n}\n.pb-text-widget {\n width: 100%;\n height: fit-content;\n}\n.pb-text-widget .text {\n color: #333;\n}\n.pb-text-widget.empty .text {\n color: #999;\n}\n.pb-image-widget {\n width: 100%;\n}\n.pb-image-widget .image {\n width: 100%;\n}\n.pb-image-widget .empty {\n height: 100px;\n background-color: #eee;\n text-align: center;\n}\n.pb-image-widget .empty span {\n font-size: 40px;\n color: #999;\n line-height: 100px;\n vertical-align: middle;\n}\n.pb-product-list-widget {\n width: 100%;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n justify-content: flex-start;\n align-items: center;\n}\n.pb-product-list-widget .product-wrapper {\n width: 25%;\n}\n.pb-product-list-widget .product-wrapper .product {\n width: 95%;\n margin: 0 auto;\n padding-top: 8px;\n padding-bottom: 8px;\n}\n.pb-product-list-widget .product-wrapper img {\n width: 100%;\n}\n.pb-product-list-widget .product-wrapper .name {\n margin-top: 8px;\n font-size: 14px;\n}\n.pb-product-list-widget .product-wrapper .price {\n margin-top: 8px;\n font-size: 14px;\n font-weight: bold;\n}\n.pb-product-list-widget .product-wrapper .empty {\n height: 200px;\n background-color: #eee;\n text-align: center;\n}\n.pb-product-list-widget .product-wrapper .empty span {\n font-size: 40px;\n color: #999;\n line-height: 200px;\n vertical-align: middle;\n}\n@media (max-width: 768px) {\n .pb-product-list-widget .product-wrapper {\n width: 50%;\n }\n}\n.mobile .pb-product-list-widget .product-wrapper {\n width: 50%;\n}\n.pb-login-widget {\n height: 200px;\n text-align: center;\n}\n.pb-login-widget h3 {\n font-size: 32px;\n font-weight: bold;\n color: #ccc;\n line-height: 200px;\n vertical-align: middle;\n}\n.font-icon {\n font-family: Material Symbols Outlined, monospace;\n font-size: 1rem;\n max-width: 1em;\n}\nhtml, body {\n font-family: Noto Sans, Noto Sans KR, Noto Sans JP, Arial, sans-serif;\n font-size: 12px;\n}\nbody {\n background-color: white;\n height: 100%;\n margin: 0;\n}\n.pb-canvas-wrapper {\n padding: 32px 40px 56px 40px;\n height: 100%;\n background-color: #aaa;\n overflow: auto;\n}\n.pb-canvas-wrapper .pb-canvas {\n display: flex;\n flex-direction: row;\n transform-origin: top left;\n width: fit-content;\n min-width: 40px;\n min-height: 40px;\n margin: 0 auto;\n}\n.pb-position-mark {\n background-color: #ff3333;\n opacity: 0.5;\n border-radius: 2px;\n}\n.pb-add-section-handle {\n position: relative;\n text-align: center;\n cursor: pointer;\n z-index: 5;\n height: 0;\n}\n.pb-add-section-handle.top::before, .pb-add-section-handle.bottom::before, .pb-add-section-handle.middle::before {\n content: "";\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n opacity: 0;\n pointer-events: none;\n}\n.pb-add-section-handle.bottom {\n left: 50%;\n bottom: -32px;\n}\n.pb-add-section-handle:hover.top::before, .pb-add-section-handle:hover.bottom::before, .pb-add-section-handle:hover.middle::before,\n.pb-add-section-handle:hover > i {\n opacity: 1;\n}\n.pb-add-section-handle > i {\n vertical-align: middle;\n position: absolute;\n top: 50%;\n left: -20px;\n font-size: 2rem;\n transform: translate(-50%, -50%);\n opacity: 0.2;\n}\n.pb-button {\n background: none;\n border: none;\n cursor: pointer;\n vertical-align: middle;\n}\n.pb-guideline {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n}\n.pb-guideline.selected {\n z-index: 3;\n}\n.pb-guideline.preselect {\n z-index: 4;\n}';
13217
13243
  const _hoisted_1$a = { class: "pb-canvas-frame" };
13218
13244
  const _sfc_main$b = /* @__PURE__ */ defineComponent({
13219
13245
  __name: "PbCanvasFrame",
@@ -13575,10 +13601,10 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
13575
13601
  var _a, _b, _c, _d;
13576
13602
  if (pageBuilder.editMode === "local" && props.selectedParts.length > 0) {
13577
13603
  const section = pageBuilder.partManager.findNearestSection(props.selectedParts[0]);
13578
- if (section && ["globalPart"].includes(((_a = section.properties) == null ? void 0 : _a.sectionType) || "")) {
13604
+ if (section && ["GlobalDesignPart"].includes(((_a = section.properties) == null ? void 0 : _a.sectionType) || "")) {
13579
13605
  return;
13580
13606
  }
13581
- if (section && ["localPart", "scheduledLocalPart"].includes(((_b = section.properties) == null ? void 0 : _b.sectionType) || "")) {
13607
+ if (section && ["LocalDesignPart", "LocalMarketingPart"].includes(((_b = section.properties) == null ? void 0 : _b.sectionType) || "")) {
13582
13608
  if (!props.property.localized) {
13583
13609
  return;
13584
13610
  }
@@ -13586,7 +13612,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
13586
13612
  }
13587
13613
  if (pageBuilder.editMode === "template" && props.selectedParts.length > 0) {
13588
13614
  const section = pageBuilder.partManager.findNearestSection(props.selectedParts[0]);
13589
- if (section && ["localPart", "scheduledLocalPart"].includes(((_c = section.properties) == null ? void 0 : _c.sectionType) || "")) {
13615
+ if (section && ["LocalDesignPart", "LocalMarketingPart"].includes(((_c = section.properties) == null ? void 0 : _c.sectionType) || "")) {
13590
13616
  if (props.property.localized) {
13591
13617
  return;
13592
13618
  }
@@ -13633,10 +13659,10 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
13633
13659
  var _a, _b, _c, _d, _e;
13634
13660
  if (pageBuilder.editMode === "local" && props.selectedParts.length > 0) {
13635
13661
  const section = pageBuilder.partManager.findNearestSection(props.selectedParts[0]);
13636
- if (section && ["globalPart"].includes(((_a = section.properties) == null ? void 0 : _a.sectionType) || "")) {
13662
+ if (section && ["GlobalDesignPart"].includes(((_a = section.properties) == null ? void 0 : _a.sectionType) || "")) {
13637
13663
  return;
13638
13664
  }
13639
- if (section && ["localPart", "scheduledLocalPart"].includes(((_b = section.properties) == null ? void 0 : _b.sectionType) || "")) {
13665
+ if (section && ["LocalDesignPart", "LocalMarketingPart"].includes(((_b = section.properties) == null ? void 0 : _b.sectionType) || "")) {
13640
13666
  if (!props.group.localized) {
13641
13667
  return;
13642
13668
  }
@@ -13644,7 +13670,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
13644
13670
  }
13645
13671
  if (pageBuilder.editMode === "template" && props.selectedParts.length > 0) {
13646
13672
  const section = pageBuilder.partManager.findNearestSection(props.selectedParts[0]);
13647
- if (section && ["localPart", "scheduledLocalPart"].includes(((_c = section.properties) == null ? void 0 : _c.sectionType) || "")) {
13673
+ if (section && ["LocalDesignPart", "LocalMarketingPart"].includes(((_c = section.properties) == null ? void 0 : _c.sectionType) || "")) {
13648
13674
  if (props.group.localized) {
13649
13675
  return;
13650
13676
  }
@@ -13685,7 +13711,7 @@ const _hoisted_6 = [
13685
13711
  _hoisted_5
13686
13712
  ];
13687
13713
  const _sfc_main$3 = /* @__PURE__ */ defineComponent({
13688
- __name: "PbPropertyLocalPart",
13714
+ __name: "PbPropertyLocalMarketingPart",
13689
13715
  props: {
13690
13716
  selectedPart: {}
13691
13717
  },
@@ -13697,18 +13723,19 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
13697
13723
  const endDt = ref("");
13698
13724
  const pageBuilder = usePageBuilderEditor();
13699
13725
  const selectSchedule = () => {
13700
- PageBuilderEditorEvent.emit.requestLocalPartContentSchedule({
13726
+ PageBuilderEditorEvent.emit.requestLocalMarketingPartSchedule({
13701
13727
  pageBuilderId: pageBuilder.instanceId,
13728
+ partId: props.selectedPart.partId,
13702
13729
  callback: (schedule) => {
13703
13730
  startDt.value = schedule.startDt;
13704
13731
  endDt.value = schedule.endDt;
13705
13732
  if (props.selectedPart && props.selectedPart.isSection()) {
13706
13733
  clearContents(props.selectedPart);
13707
- if (schedule.content) {
13708
- for (const id in schedule.content) {
13709
- const part = findWidget(props.selectedPart, id);
13734
+ if (schedule.data) {
13735
+ for (const partId in schedule.data) {
13736
+ const part = findWidget(props.selectedPart, partId);
13710
13737
  if (part) {
13711
- Object.entries(schedule.content[id]).forEach(([key, value]) => {
13738
+ Object.entries(schedule.data[partId]).forEach(([key, value]) => {
13712
13739
  if (!value)
13713
13740
  return;
13714
13741
  part.properties = part.properties || {};
@@ -13721,15 +13748,14 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
13721
13748
  }
13722
13749
  });
13723
13750
  };
13724
- const findWidget = (part, id) => {
13725
- var _a;
13751
+ const findWidget = (part, partId) => {
13726
13752
  if (!part)
13727
13753
  return;
13728
- if (((_a = part.properties) == null ? void 0 : _a.id) === id)
13754
+ if (part.partId === partId)
13729
13755
  return part;
13730
13756
  if (part.children) {
13731
13757
  for (const child of part.children) {
13732
- const found = findWidget(child, id);
13758
+ const found = findWidget(child, partId);
13733
13759
  if (found)
13734
13760
  return found;
13735
13761
  }
@@ -13790,21 +13816,21 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
13790
13816
  return [];
13791
13817
  }
13792
13818
  });
13793
- const showScheduledLocalPart = computed(() => {
13819
+ const showLocalMarketingPart = computed(() => {
13794
13820
  var _a;
13795
13821
  if (pageBuilder.editMode === "template")
13796
13822
  return false;
13797
13823
  if (!selectedParts.length || selectedParts.length !== 1)
13798
13824
  return false;
13799
13825
  const part = selectedParts[0];
13800
- if (part.isSection() && ((_a = part.properties) == null ? void 0 : _a.sectionType) === "scheduledLocalPart") {
13826
+ if (part.isSection() && ((_a = part.properties) == null ? void 0 : _a.sectionType) === "LocalMarketingPart") {
13801
13827
  return true;
13802
13828
  }
13803
13829
  return false;
13804
13830
  });
13805
13831
  return (_ctx, _cache) => {
13806
13832
  return openBlock(), createElementBlock("div", _hoisted_1$2, [
13807
- showScheduledLocalPart.value ? (openBlock(), createBlock$1(_sfc_main$3, {
13833
+ showLocalMarketingPart.value ? (openBlock(), createBlock$1(_sfc_main$3, {
13808
13834
  key: 0,
13809
13835
  "selected-part": unref(selectedParts)[0]
13810
13836
  }, null, 8, ["selected-part"])) : createCommentVNode("", true),
@@ -13844,7 +13870,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
13844
13870
  editMode: {},
13845
13871
  pageContent: {}
13846
13872
  },
13847
- setup(__props) {
13873
+ setup(__props, { expose: __expose }) {
13848
13874
  const props = __props;
13849
13875
  const modal = useModal();
13850
13876
  const pageBuilderEditor = createPageBuilderEditor();
@@ -13861,6 +13887,59 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
13861
13887
  watch(() => props.pageContent, (pageContent) => pageContent && pageBuilderEditor.initData(pageContent));
13862
13888
  const colorHistory = ref([]);
13863
13889
  provide("colorHistory", colorHistory);
13890
+ const getLocalDesignPartContent = () => {
13891
+ let content;
13892
+ if (pageBuilderEditor.model.rootPart) {
13893
+ content = doGetLocalDesignPartContent(pageBuilderEditor.model.rootPart);
13894
+ }
13895
+ return content;
13896
+ };
13897
+ const doGetLocalDesignPartContent = (part) => {
13898
+ var _a;
13899
+ let content;
13900
+ if (((_a = part.properties) == null ? void 0 : _a.sectionType) && ["LocalDesignPart", "LocalMarketingPart"].includes(part.properties.sectionType)) {
13901
+ const properties = getLocalDesignPartProperties(part);
13902
+ if (properties) {
13903
+ if (!content)
13904
+ content = [];
13905
+ content.push({ partId: part.partId, data: properties });
13906
+ }
13907
+ }
13908
+ if (part.children) {
13909
+ for (const child of part.children) {
13910
+ const childContent = doGetLocalDesignPartContent(child);
13911
+ if (childContent)
13912
+ content = [...content || [], ...childContent];
13913
+ }
13914
+ }
13915
+ return content;
13916
+ };
13917
+ const getLocalDesignPartProperties = (part) => {
13918
+ let properties;
13919
+ if (part.isWidget()) {
13920
+ const defs = pageBuilderEditor.partManager.getLocalDesignPartPropertyDefinitions(part.partName);
13921
+ if (defs) {
13922
+ const data = {};
13923
+ for (const def of defs) {
13924
+ if (part.properties)
13925
+ data[def.propertyName] = part.properties[def.propertyName];
13926
+ }
13927
+ properties = { [part.partId]: data };
13928
+ }
13929
+ }
13930
+ if (part.children) {
13931
+ for (const child of part.children) {
13932
+ const childProperties = getLocalDesignPartProperties(child);
13933
+ if (childProperties) {
13934
+ properties = { ...properties, ...childProperties };
13935
+ }
13936
+ }
13937
+ }
13938
+ return properties;
13939
+ };
13940
+ __expose({
13941
+ getLocalDesignPartContent
13942
+ });
13864
13943
  return (_ctx, _cache) => {
13865
13944
  return openBlock(), createElementBlock("div", _hoisted_1, [
13866
13945
  createVNode(_sfc_main$7),
@@ -12,8 +12,9 @@ export type PageBuilderEditorEventType = {
12
12
  itemCodes: string;
13
13
  callback: (products: any[]) => void;
14
14
  };
15
- requestLocalPartContentSchedule: {
15
+ requestLocalMarketingPartSchedule: {
16
16
  pageBuilderId?: string;
17
+ partId: string;
17
18
  callback: (schedule: any) => void;
18
19
  };
19
20
  };
@@ -30,8 +31,9 @@ export declare const PageBuilderEditorEvent: {
30
31
  itemCodes: string;
31
32
  callback: (products: any[]) => void;
32
33
  }) => void) => void;
33
- requestLocalPartContentSchedule: (listener: (param: {
34
+ requestLocalMarketingPartSchedule: (listener: (param: {
34
35
  pageBuilderId?: string;
36
+ partId: string;
35
37
  callback: (schedule: any) => void;
36
38
  }) => void) => void;
37
39
  };
@@ -47,7 +49,9 @@ export declare const PageBuilderEditorEvent: {
47
49
  itemCodes: string;
48
50
  callback: (products: any[]) => void;
49
51
  }) => void) => void;
50
- requestLocalPartContentSchedule: (listener: (param: {
52
+ requestLocalMarketingPartSchedule: (listener: (param: {
53
+ pageBuilderId?: string;
54
+ partId: string;
51
55
  callback: (schedule: any) => void;
52
56
  }) => void) => void;
53
57
  };
@@ -63,8 +67,9 @@ export declare const PageBuilderEditorEvent: {
63
67
  itemCodes: string;
64
68
  callback: (products: any[]) => void;
65
69
  }) => void;
66
- requestLocalPartContentSchedule: (param: {
70
+ requestLocalMarketingPartSchedule: (param: {
67
71
  pageBuilderId?: string;
72
+ partId: string;
68
73
  callback: (schedule: any) => void;
69
74
  }) => void;
70
75
  };
@@ -7,7 +7,7 @@ export declare const BLOCK_TYPE = "Block";
7
7
  export declare const WIDGET_TYPE = "Widget";
8
8
  export declare const getNewPartId: () => string;
9
9
  export declare const partsToJsonString: (parts: IPart[]) => string;
10
- export declare const partFromJsonObject: (object: any) => IPart | undefined;
10
+ export declare const partFromJsonObject: (object: any, keepPartId?: boolean) => IPart | undefined;
11
11
  export declare const createPart: (partType: string, partName: string, properties?: Record<string, string>) => IPart | undefined;
12
12
  export declare class Model {
13
13
  yjsDoc: Y.Doc;
@@ -20,7 +20,7 @@ export declare class Model {
20
20
  findPartById(partId?: string): IPart | undefined;
21
21
  findPartsByIds(partIds: string[]): IPart[];
22
22
  serializePageModel: (partIds: string[]) => string;
23
- parsePageModel(json: string, removePartId: boolean): IPart[] | undefined;
23
+ parsePageModel(json: string, keepPartId?: boolean): IPart[] | undefined;
24
24
  moveElements(partId: string, destPartId: string, destIndex: number, update?: PartUpdateParam[]): void;
25
25
  isMobilePart(part: IPart): boolean;
26
26
  isPcPart(part: IPart): boolean;
@@ -42,7 +42,7 @@ export declare class PageBuilderEditorImpl implements PageBuilderEditor {
42
42
  scale: Ref<number>;
43
43
  constructor();
44
44
  registerPlugin(plugin: PageBuilderPlugin): void;
45
- initData(content?: any): void;
45
+ initData(content?: any[]): void;
46
46
  undo(): void;
47
47
  redo(): void;
48
48
  zoom(scale: number): void;
@@ -15,6 +15,7 @@ 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;
18
19
  createPartComponent(part?: IPart): Component | undefined;
19
20
  createPartComponents(parts?: IPart[]): PartComponent[];
20
21
  registerPartPropertyGroupEditors(editors: Record<string, PartPropertyGroupEditor>): void;
@@ -1,4 +1,4 @@
1
- import { B, a, M, b, c, _, P, d, e, f, g, h, i, R, j, S, k, W, l, m, n, o, p, q } from "./index-BtILenNo.js";
1
+ import { B, a, M, b, c, _, P, d, e, f, g, h, i, R, j, S, k, W, l, m, n, o, p, q } from "./index-Dwk2ffWe.js";
2
2
  export {
3
3
  B as BLOCK_TYPE,
4
4
  a as Block,
@@ -6630,8 +6630,8 @@ var __publicField = (obj, key, value) => {
6630
6630
  requestProducts: (listener) => {
6631
6631
  emitter$1.on("requestProducts", listener);
6632
6632
  },
6633
- requestLocalPartContentSchedule: (listener) => {
6634
- emitter$1.on("requestLocalPartContentSchedule", listener);
6633
+ requestLocalMarketingPartSchedule: (listener) => {
6634
+ emitter$1.on("requestLocalMarketingPartSchedule", listener);
6635
6635
  }
6636
6636
  },
6637
6637
  off: {
@@ -6647,8 +6647,8 @@ var __publicField = (obj, key, value) => {
6647
6647
  requestProducts: (listener) => {
6648
6648
  emitter$1.off("requestProducts", listener);
6649
6649
  },
6650
- requestLocalPartContentSchedule: (listener) => {
6651
- emitter$1.off("requestLocalPartContentSchedule", listener);
6650
+ requestLocalMarketingPartSchedule: (listener) => {
6651
+ emitter$1.off("requestLocalMarketingPartSchedule", listener);
6652
6652
  }
6653
6653
  },
6654
6654
  emit: {
@@ -6664,8 +6664,8 @@ var __publicField = (obj, key, value) => {
6664
6664
  requestProducts: (param) => {
6665
6665
  emitter$1.emit("requestProducts", param);
6666
6666
  },
6667
- requestLocalPartContentSchedule: (param) => {
6668
- emitter$1.emit("requestLocalPartContentSchedule", param);
6667
+ requestLocalMarketingPartSchedule: (param) => {
6668
+ emitter$1.emit("requestLocalMarketingPartSchedule", param);
6669
6669
  }
6670
6670
  }
6671
6671
  };
@@ -7270,6 +7270,11 @@ var __publicField = (obj, key, value) => {
7270
7270
  pageBuilderViewer.instanceId = props.instanceId;
7271
7271
  providePageBuilderViewer(pageBuilderViewer);
7272
7272
  const page = vue.computed(() => pageBuilderViewer.model.rootPart.value.children && pageBuilderViewer.model.rootPart.value.children[0]);
7273
+ vue.onMounted(() => {
7274
+ if (props.pageContent) {
7275
+ pageBuilderViewer.render(props.pageContent);
7276
+ }
7277
+ });
7273
7278
  vue.watch(
7274
7279
  () => props.pageContent,
7275
7280
  (pageContent) => {
@@ -7344,12 +7349,12 @@ var __publicField = (obj, key, value) => {
7344
7349
  }
7345
7350
  return object;
7346
7351
  };
7347
- const partsFromJsonString = (jsonString) => {
7352
+ const partsFromJsonString = (jsonString, keepPartId = false) => {
7348
7353
  const objects = JSON.parse(jsonString);
7349
7354
  const parts = [];
7350
7355
  if (objects && objects instanceof Array) {
7351
7356
  objects.forEach((object) => {
7352
- const part = partFromJsonObject(object);
7357
+ const part = partFromJsonObject(object, keepPartId);
7353
7358
  if (part) {
7354
7359
  parts.push(part);
7355
7360
  }
@@ -7357,10 +7362,13 @@ var __publicField = (obj, key, value) => {
7357
7362
  }
7358
7363
  return parts;
7359
7364
  };
7360
- const partFromJsonObject = (object) => {
7365
+ const partFromJsonObject = (object, keepPartId = false) => {
7361
7366
  const part = createPart(object.partType, object.partName);
7362
7367
  if (!part)
7363
7368
  return;
7369
+ if (keepPartId && object.partId) {
7370
+ part.partId = object.partId;
7371
+ }
7364
7372
  if (object.properties) {
7365
7373
  part.properties = {};
7366
7374
  for (const name in object.properties) {
@@ -7371,7 +7379,7 @@ var __publicField = (obj, key, value) => {
7371
7379
  part.children = [];
7372
7380
  object.children.forEach((childJson) => {
7373
7381
  var _a;
7374
- const childPart = partFromJsonObject(childJson);
7382
+ const childPart = partFromJsonObject(childJson, keepPartId);
7375
7383
  if (childPart) {
7376
7384
  childPart.parent = part;
7377
7385
  (_a = part.children) == null ? void 0 : _a.push(childPart);
@@ -7566,8 +7574,8 @@ var __publicField = (obj, key, value) => {
7566
7574
  });
7567
7575
  return parts;
7568
7576
  }
7569
- parsePageModel(json, removePartId) {
7570
- return partsFromJsonString(json);
7577
+ parsePageModel(json, keepPartId = false) {
7578
+ return partsFromJsonString(json, keepPartId);
7571
7579
  }
7572
7580
  moveElements(partId, destPartId, destIndex, update) {
7573
7581
  var _a;
@@ -7679,7 +7687,7 @@ var __publicField = (obj, key, value) => {
7679
7687
  }
7680
7688
  }
7681
7689
  node.setAttribute(PART_NAME_KEY, part.partName);
7682
- node.setAttribute(PART_ID_KEY, getNewPartId());
7690
+ node.setAttribute(PART_ID_KEY, part.partId || getNewPartId());
7683
7691
  if (part.children) {
7684
7692
  const childNodes = part.children.map((child) => this.createElement(child));
7685
7693
  node.insert(0, childNodes);
@@ -7763,6 +7771,20 @@ var __publicField = (obj, key, value) => {
7763
7771
  }
7764
7772
  }
7765
7773
  }
7774
+ getLocalDesignPartPropertyDefinitions(partName) {
7775
+ let properties;
7776
+ const partDef = this.getPartDefinition(partName);
7777
+ if (!partDef || !partDef.propertyGroups)
7778
+ return;
7779
+ for (const group of partDef.propertyGroups) {
7780
+ for (const property of group.properties) {
7781
+ if (property.localized) {
7782
+ properties = [...properties || [], property];
7783
+ }
7784
+ }
7785
+ }
7786
+ return properties;
7787
+ }
7766
7788
  createPartComponent(part) {
7767
7789
  if (part) {
7768
7790
  const def = this.getPartDefinition(part.partName);
@@ -8837,9 +8859,9 @@ var __publicField = (obj, key, value) => {
8837
8859
  var _a, _b, _c;
8838
8860
  if (["static"].includes(((_a = props.part.properties) == null ? void 0 : _a.sectionType) || ""))
8839
8861
  return true;
8840
- if (pageBuilder.editMode === "local" && ["globalPart"].includes(((_b = props.part.properties) == null ? void 0 : _b.sectionType) || ""))
8862
+ if (pageBuilder.editMode === "local" && ["GlobalDesignPart"].includes(((_b = props.part.properties) == null ? void 0 : _b.sectionType) || ""))
8841
8863
  return true;
8842
- if (pageBuilder.editMode === "global" && ["localPart", "scheduledLocalPart"].includes(((_c = props.part.properties) == null ? void 0 : _c.sectionType) || ""))
8864
+ if (pageBuilder.editMode === "global" && ["LocalDesignPart", "LocalMarketingPart"].includes(((_c = props.part.properties) == null ? void 0 : _c.sectionType) || ""))
8843
8865
  return true;
8844
8866
  return false;
8845
8867
  });
@@ -12484,7 +12506,7 @@ var __publicField = (obj, key, value) => {
12484
12506
  const { target, index = 0 } = findInsertTargetAndIndex(pageBuilder);
12485
12507
  if (target) {
12486
12508
  const json = await navigator.clipboard.readText();
12487
- const parts = pageBuilder.model.parsePageModel(json, true);
12509
+ const parts = pageBuilder.model.parsePageModel(json);
12488
12510
  if (parts) {
12489
12511
  insertParts(pageBuilder, target.partId, index, parts, false);
12490
12512
  }
@@ -13049,9 +13071,13 @@ var __publicField = (obj, key, value) => {
13049
13071
  this.model.rootPart.pageBuilderId = this.instanceId;
13050
13072
  let parts;
13051
13073
  if (content) {
13052
- const page = partFromJsonObject(content);
13053
- if (page) {
13054
- parts = [page, page];
13074
+ for (const p of content) {
13075
+ const page = partFromJsonObject(p, true);
13076
+ if (page) {
13077
+ if (!parts)
13078
+ parts = [];
13079
+ parts.push(page);
13080
+ }
13055
13081
  }
13056
13082
  }
13057
13083
  if (!parts) {
@@ -13215,7 +13241,7 @@ var __publicField = (obj, key, value) => {
13215
13241
  };
13216
13242
  }
13217
13243
  });
13218
- const canvasStyle = '.pb-page {\n margin: 0 auto;\n margin-top: 20px;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n}\n.pb-page .pb-page-content.selected {\n outline: 2px solid #4998f8;\n outline-offset: 5px;\n}\n.pb-page * {\n box-sizing: border-box;\n}\n.pb-add-widget-button {\n width: 100%;\n height: 100%;\n min-height: 200px;\n position: relative;\n}\n.pb-add-widget-button button {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n padding: 8px;\n background: none;\n border: none;\n cursor: pointer;\n}\n.pb-add-widget-button button:hover {\n background-color: #eeeeee;\n}\n.pb-add-widget-button .icon {\n font-size: 1rem;\n vertical-align: middle;\n}\n.pb-add-widget-button .text {\n font-size: 1rem;\n vertical-align: middle;\n margin-left: 0.4rem;\n}\n.pb-section {\n position: relative;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n outline: 1px dashed #ccc;\n background-color: #fff;\n}\n.pb-section:hover:not(:has(.pb-block:hover)) {\n background-color: #f0f0f0;\n}\n.pb-section.selected {\n outline: 1px solid #e67e22;\n outline-offset: 1px;\n z-index: 999;\n}\n.pb-section.pb-section-static {\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n}\n.pb-section.pb-section-static:after {\n content: "";\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n background-color: rgba(0, 0, 0, 0.2);\n}\n.pb-section-static .pb-widget {\n outline: none;\n}\n.pb-block {\n display: flex;\n min-width: 1px;\n position: relative;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n width: 100%;\n outline: 1px dashed #ccc;\n}\n.pb-block:hover:not(:has(.pb-widget:hover)) {\n background-color: #f0f0f0;\n}\n.pb-block.selected {\n outline: 1px solid #8e44ad;\n outline-offset: 1px;\n z-index: 999;\n}\n.pb-widget {\n position: relative;\n outline: 1px dashed #ccc;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n}\n.pb-widget.selected {\n outline: 2px solid #27ae60;\n outline-offset: 1px;\n z-index: 999;\n}\n.pb-widget .children {\n position: absolute;\n width: 100%;\n height: 100%;\n}\n.pb-widget .pan-handle {\n position: absolute;\n left: -6px;\n top: -6px;\n width: 12px;\n height: 12px;\n background-color: #27ae60;\n cursor: move;\n}\n.pb-widget .resize-handle {\n position: absolute;\n right: -6px;\n bottom: -6px;\n width: 12px;\n height: 12px;\n background-color: #27ae60;\n cursor: nwse-resize;\n}\n.pb-widget {\n position: relative;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n width: 100%;\n}\n.pb-widget .children {\n position: absolute;\n width: 100%;\n height: 100%;\n}\n.pb-text-widget {\n width: 100%;\n height: fit-content;\n}\n.pb-text-widget .text {\n color: #333;\n}\n.pb-text-widget.empty .text {\n color: #999;\n}\n.pb-image-widget {\n width: 100%;\n}\n.pb-image-widget .image {\n width: 100%;\n}\n.pb-image-widget .empty {\n height: 100px;\n background-color: #eee;\n text-align: center;\n}\n.pb-image-widget .empty span {\n font-size: 40px;\n color: #999;\n line-height: 100px;\n vertical-align: middle;\n}\n.pb-product-list-widget {\n width: 100%;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n justify-content: flex-start;\n align-items: center;\n}\n.pb-product-list-widget .product {\n width: 95%;\n margin: 0 auto;\n padding-top: 8px;\n padding-bottom: 8px;\n}\n.pb-product-list-widget img {\n width: 100%;\n}\n.pb-product-list-widget .name {\n margin-top: 8px;\n font-size: 14px;\n}\n.pb-product-list-widget .price {\n margin-top: 8px;\n font-size: 14px;\n font-weight: bold;\n}\n.pb-product-list-widget .empty {\n height: 200px;\n background-color: #eee;\n text-align: center;\n}\n.pb-product-list-widget .empty span {\n font-size: 40px;\n color: #999;\n line-height: 200px;\n vertical-align: middle;\n}\n.pb-page .mobile .pb-product-list-widget .product-wrapper {\n width: 50%;\n}\n.pb-page .pc .pb-product-list-widget .product-wrapper {\n width: 25%;\n}\n.pb-login-widget {\n height: 200px;\n text-align: center;\n}\n.pb-login-widget h3 {\n font-size: 32px;\n font-weight: bold;\n color: #ccc;\n line-height: 200px;\n vertical-align: middle;\n}\n.font-icon {\n font-family: Material Symbols Outlined, monospace;\n font-size: 1rem;\n max-width: 1em;\n}\nhtml, body {\n font-family: Noto Sans, Noto Sans KR, Noto Sans JP, Arial, sans-serif;\n font-size: 12px;\n}\nbody {\n background-color: white;\n height: 100%;\n}\n.pb-canvas-wrapper {\n padding: 32px 40px 56px 40px;\n height: 100%;\n background-color: #aaa;\n overflow: auto;\n}\n.pb-canvas-wrapper .pb-canvas {\n display: flex;\n flex-direction: row;\n transform-origin: top left;\n width: fit-content;\n min-width: 40px;\n min-height: 40px;\n margin: 0 auto;\n}\n.pb-position-mark {\n background-color: #ff3333;\n opacity: 0.5;\n border-radius: 2px;\n}\n.pb-add-section-handle {\n position: relative;\n text-align: center;\n cursor: pointer;\n z-index: 5;\n height: 0;\n}\n.pb-add-section-handle.top::before, .pb-add-section-handle.bottom::before, .pb-add-section-handle.middle::before {\n content: "";\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n opacity: 0;\n pointer-events: none;\n}\n.pb-add-section-handle.bottom {\n left: 50%;\n bottom: -32px;\n}\n.pb-add-section-handle:hover.top::before, .pb-add-section-handle:hover.bottom::before, .pb-add-section-handle:hover.middle::before,\n.pb-add-section-handle:hover > i {\n opacity: 1;\n}\n.pb-add-section-handle > i {\n vertical-align: middle;\n position: absolute;\n top: 50%;\n left: -20px;\n font-size: 2rem;\n transform: translate(-50%, -50%);\n opacity: 0.2;\n}\n.pb-button {\n background: none;\n border: none;\n cursor: pointer;\n vertical-align: middle;\n}\n.pb-guideline {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n}\n.pb-guideline.selected {\n z-index: 3;\n}\n.pb-guideline.preselect {\n z-index: 4;\n}';
13244
+ const canvasStyle = '.pb-page {\n margin: 0 auto;\n margin-top: 20px;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n}\n.pb-page .pb-page-content.selected {\n outline: 2px solid #4998f8;\n outline-offset: 5px;\n}\n.pb-page * {\n box-sizing: border-box;\n}\n.pb-add-widget-button {\n width: 100%;\n height: 100%;\n min-height: 200px;\n position: relative;\n}\n.pb-add-widget-button button {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n padding: 8px;\n background: none;\n border: none;\n cursor: pointer;\n}\n.pb-add-widget-button button:hover {\n background-color: #eeeeee;\n}\n.pb-add-widget-button .icon {\n font-size: 1rem;\n vertical-align: middle;\n}\n.pb-add-widget-button .text {\n font-size: 1rem;\n vertical-align: middle;\n margin-left: 0.4rem;\n}\n.pb-section {\n position: relative;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n outline: 1px dashed #ccc;\n background-color: #fff;\n}\n.pb-section:hover:not(:has(.pb-block:hover)) {\n background-color: #f0f0f0;\n}\n.pb-section.selected {\n outline: 1px solid #e67e22;\n outline-offset: 1px;\n z-index: 999;\n}\n.pb-section.pb-section-static {\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n}\n.pb-section.pb-section-static:after {\n content: "";\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n background-color: rgba(0, 0, 0, 0.2);\n}\n.pb-section-static .pb-widget {\n outline: none;\n}\n.pb-block {\n display: flex;\n min-width: 1px;\n position: relative;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n width: 100%;\n outline: 1px dashed #ccc;\n}\n.pb-block:hover:not(:has(.pb-widget:hover)) {\n background-color: #f0f0f0;\n}\n.pb-block.selected {\n outline: 1px solid #8e44ad;\n outline-offset: 1px;\n z-index: 999;\n}\n.pb-widget {\n position: relative;\n outline: 1px dashed #ccc;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n}\n.pb-widget.selected {\n outline: 2px solid #27ae60;\n outline-offset: 1px;\n z-index: 999;\n}\n.pb-widget .children {\n position: absolute;\n width: 100%;\n height: 100%;\n}\n.pb-widget .pan-handle {\n position: absolute;\n left: -6px;\n top: -6px;\n width: 12px;\n height: 12px;\n background-color: #27ae60;\n cursor: move;\n}\n.pb-widget .resize-handle {\n position: absolute;\n right: -6px;\n bottom: -6px;\n width: 12px;\n height: 12px;\n background-color: #27ae60;\n cursor: nwse-resize;\n}\n.pb-widget {\n position: relative;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n width: 100%;\n}\n.pb-widget .children {\n position: absolute;\n width: 100%;\n height: 100%;\n}\n.pb-text-widget {\n width: 100%;\n height: fit-content;\n}\n.pb-text-widget .text {\n color: #333;\n}\n.pb-text-widget.empty .text {\n color: #999;\n}\n.pb-image-widget {\n width: 100%;\n}\n.pb-image-widget .image {\n width: 100%;\n}\n.pb-image-widget .empty {\n height: 100px;\n background-color: #eee;\n text-align: center;\n}\n.pb-image-widget .empty span {\n font-size: 40px;\n color: #999;\n line-height: 100px;\n vertical-align: middle;\n}\n.pb-product-list-widget {\n width: 100%;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n justify-content: flex-start;\n align-items: center;\n}\n.pb-product-list-widget .product-wrapper {\n width: 25%;\n}\n.pb-product-list-widget .product-wrapper .product {\n width: 95%;\n margin: 0 auto;\n padding-top: 8px;\n padding-bottom: 8px;\n}\n.pb-product-list-widget .product-wrapper img {\n width: 100%;\n}\n.pb-product-list-widget .product-wrapper .name {\n margin-top: 8px;\n font-size: 14px;\n}\n.pb-product-list-widget .product-wrapper .price {\n margin-top: 8px;\n font-size: 14px;\n font-weight: bold;\n}\n.pb-product-list-widget .product-wrapper .empty {\n height: 200px;\n background-color: #eee;\n text-align: center;\n}\n.pb-product-list-widget .product-wrapper .empty span {\n font-size: 40px;\n color: #999;\n line-height: 200px;\n vertical-align: middle;\n}\n@media (max-width: 768px) {\n .pb-product-list-widget .product-wrapper {\n width: 50%;\n }\n}\n.mobile .pb-product-list-widget .product-wrapper {\n width: 50%;\n}\n.pb-login-widget {\n height: 200px;\n text-align: center;\n}\n.pb-login-widget h3 {\n font-size: 32px;\n font-weight: bold;\n color: #ccc;\n line-height: 200px;\n vertical-align: middle;\n}\n.font-icon {\n font-family: Material Symbols Outlined, monospace;\n font-size: 1rem;\n max-width: 1em;\n}\nhtml, body {\n font-family: Noto Sans, Noto Sans KR, Noto Sans JP, Arial, sans-serif;\n font-size: 12px;\n}\nbody {\n background-color: white;\n height: 100%;\n margin: 0;\n}\n.pb-canvas-wrapper {\n padding: 32px 40px 56px 40px;\n height: 100%;\n background-color: #aaa;\n overflow: auto;\n}\n.pb-canvas-wrapper .pb-canvas {\n display: flex;\n flex-direction: row;\n transform-origin: top left;\n width: fit-content;\n min-width: 40px;\n min-height: 40px;\n margin: 0 auto;\n}\n.pb-position-mark {\n background-color: #ff3333;\n opacity: 0.5;\n border-radius: 2px;\n}\n.pb-add-section-handle {\n position: relative;\n text-align: center;\n cursor: pointer;\n z-index: 5;\n height: 0;\n}\n.pb-add-section-handle.top::before, .pb-add-section-handle.bottom::before, .pb-add-section-handle.middle::before {\n content: "";\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n opacity: 0;\n pointer-events: none;\n}\n.pb-add-section-handle.bottom {\n left: 50%;\n bottom: -32px;\n}\n.pb-add-section-handle:hover.top::before, .pb-add-section-handle:hover.bottom::before, .pb-add-section-handle:hover.middle::before,\n.pb-add-section-handle:hover > i {\n opacity: 1;\n}\n.pb-add-section-handle > i {\n vertical-align: middle;\n position: absolute;\n top: 50%;\n left: -20px;\n font-size: 2rem;\n transform: translate(-50%, -50%);\n opacity: 0.2;\n}\n.pb-button {\n background: none;\n border: none;\n cursor: pointer;\n vertical-align: middle;\n}\n.pb-guideline {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n}\n.pb-guideline.selected {\n z-index: 3;\n}\n.pb-guideline.preselect {\n z-index: 4;\n}';
13219
13245
  const _hoisted_1$i = { class: "pb-canvas-frame" };
13220
13246
  const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
13221
13247
  __name: "PbCanvasFrame",
@@ -13577,10 +13603,10 @@ var __publicField = (obj, key, value) => {
13577
13603
  var _a, _b, _c, _d;
13578
13604
  if (pageBuilder.editMode === "local" && props.selectedParts.length > 0) {
13579
13605
  const section = pageBuilder.partManager.findNearestSection(props.selectedParts[0]);
13580
- if (section && ["globalPart"].includes(((_a = section.properties) == null ? void 0 : _a.sectionType) || "")) {
13606
+ if (section && ["GlobalDesignPart"].includes(((_a = section.properties) == null ? void 0 : _a.sectionType) || "")) {
13581
13607
  return;
13582
13608
  }
13583
- if (section && ["localPart", "scheduledLocalPart"].includes(((_b = section.properties) == null ? void 0 : _b.sectionType) || "")) {
13609
+ if (section && ["LocalDesignPart", "LocalMarketingPart"].includes(((_b = section.properties) == null ? void 0 : _b.sectionType) || "")) {
13584
13610
  if (!props.property.localized) {
13585
13611
  return;
13586
13612
  }
@@ -13588,7 +13614,7 @@ var __publicField = (obj, key, value) => {
13588
13614
  }
13589
13615
  if (pageBuilder.editMode === "template" && props.selectedParts.length > 0) {
13590
13616
  const section = pageBuilder.partManager.findNearestSection(props.selectedParts[0]);
13591
- if (section && ["localPart", "scheduledLocalPart"].includes(((_c = section.properties) == null ? void 0 : _c.sectionType) || "")) {
13617
+ if (section && ["LocalDesignPart", "LocalMarketingPart"].includes(((_c = section.properties) == null ? void 0 : _c.sectionType) || "")) {
13592
13618
  if (props.property.localized) {
13593
13619
  return;
13594
13620
  }
@@ -13635,10 +13661,10 @@ var __publicField = (obj, key, value) => {
13635
13661
  var _a, _b, _c, _d, _e;
13636
13662
  if (pageBuilder.editMode === "local" && props.selectedParts.length > 0) {
13637
13663
  const section = pageBuilder.partManager.findNearestSection(props.selectedParts[0]);
13638
- if (section && ["globalPart"].includes(((_a = section.properties) == null ? void 0 : _a.sectionType) || "")) {
13664
+ if (section && ["GlobalDesignPart"].includes(((_a = section.properties) == null ? void 0 : _a.sectionType) || "")) {
13639
13665
  return;
13640
13666
  }
13641
- if (section && ["localPart", "scheduledLocalPart"].includes(((_b = section.properties) == null ? void 0 : _b.sectionType) || "")) {
13667
+ if (section && ["LocalDesignPart", "LocalMarketingPart"].includes(((_b = section.properties) == null ? void 0 : _b.sectionType) || "")) {
13642
13668
  if (!props.group.localized) {
13643
13669
  return;
13644
13670
  }
@@ -13646,7 +13672,7 @@ var __publicField = (obj, key, value) => {
13646
13672
  }
13647
13673
  if (pageBuilder.editMode === "template" && props.selectedParts.length > 0) {
13648
13674
  const section = pageBuilder.partManager.findNearestSection(props.selectedParts[0]);
13649
- if (section && ["localPart", "scheduledLocalPart"].includes(((_c = section.properties) == null ? void 0 : _c.sectionType) || "")) {
13675
+ if (section && ["LocalDesignPart", "LocalMarketingPart"].includes(((_c = section.properties) == null ? void 0 : _c.sectionType) || "")) {
13650
13676
  if (props.group.localized) {
13651
13677
  return;
13652
13678
  }
@@ -13687,7 +13713,7 @@ var __publicField = (obj, key, value) => {
13687
13713
  _hoisted_5
13688
13714
  ];
13689
13715
  const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
13690
- __name: "PbPropertyLocalPart",
13716
+ __name: "PbPropertyLocalMarketingPart",
13691
13717
  props: {
13692
13718
  selectedPart: {}
13693
13719
  },
@@ -13699,18 +13725,19 @@ var __publicField = (obj, key, value) => {
13699
13725
  const endDt = vue.ref("");
13700
13726
  const pageBuilder = usePageBuilderEditor();
13701
13727
  const selectSchedule = () => {
13702
- PageBuilderEditorEvent.emit.requestLocalPartContentSchedule({
13728
+ PageBuilderEditorEvent.emit.requestLocalMarketingPartSchedule({
13703
13729
  pageBuilderId: pageBuilder.instanceId,
13730
+ partId: props.selectedPart.partId,
13704
13731
  callback: (schedule) => {
13705
13732
  startDt.value = schedule.startDt;
13706
13733
  endDt.value = schedule.endDt;
13707
13734
  if (props.selectedPart && props.selectedPart.isSection()) {
13708
13735
  clearContents(props.selectedPart);
13709
- if (schedule.content) {
13710
- for (const id in schedule.content) {
13711
- const part = findWidget(props.selectedPart, id);
13736
+ if (schedule.data) {
13737
+ for (const partId in schedule.data) {
13738
+ const part = findWidget(props.selectedPart, partId);
13712
13739
  if (part) {
13713
- Object.entries(schedule.content[id]).forEach(([key, value]) => {
13740
+ Object.entries(schedule.data[partId]).forEach(([key, value]) => {
13714
13741
  if (!value)
13715
13742
  return;
13716
13743
  part.properties = part.properties || {};
@@ -13723,15 +13750,14 @@ var __publicField = (obj, key, value) => {
13723
13750
  }
13724
13751
  });
13725
13752
  };
13726
- const findWidget = (part, id) => {
13727
- var _a;
13753
+ const findWidget = (part, partId) => {
13728
13754
  if (!part)
13729
13755
  return;
13730
- if (((_a = part.properties) == null ? void 0 : _a.id) === id)
13756
+ if (part.partId === partId)
13731
13757
  return part;
13732
13758
  if (part.children) {
13733
13759
  for (const child of part.children) {
13734
- const found = findWidget(child, id);
13760
+ const found = findWidget(child, partId);
13735
13761
  if (found)
13736
13762
  return found;
13737
13763
  }
@@ -13792,21 +13818,21 @@ var __publicField = (obj, key, value) => {
13792
13818
  return [];
13793
13819
  }
13794
13820
  });
13795
- const showScheduledLocalPart = vue.computed(() => {
13821
+ const showLocalMarketingPart = vue.computed(() => {
13796
13822
  var _a;
13797
13823
  if (pageBuilder.editMode === "template")
13798
13824
  return false;
13799
13825
  if (!selectedParts.length || selectedParts.length !== 1)
13800
13826
  return false;
13801
13827
  const part = selectedParts[0];
13802
- if (part.isSection() && ((_a = part.properties) == null ? void 0 : _a.sectionType) === "scheduledLocalPart") {
13828
+ if (part.isSection() && ((_a = part.properties) == null ? void 0 : _a.sectionType) === "LocalMarketingPart") {
13803
13829
  return true;
13804
13830
  }
13805
13831
  return false;
13806
13832
  });
13807
13833
  return (_ctx, _cache) => {
13808
13834
  return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$a, [
13809
- showScheduledLocalPart.value ? (vue.openBlock(), vue.createBlock(_sfc_main$b, {
13835
+ showLocalMarketingPart.value ? (vue.openBlock(), vue.createBlock(_sfc_main$b, {
13810
13836
  key: 0,
13811
13837
  "selected-part": vue.unref(selectedParts)[0]
13812
13838
  }, null, 8, ["selected-part"])) : vue.createCommentVNode("", true),
@@ -13846,7 +13872,7 @@ var __publicField = (obj, key, value) => {
13846
13872
  editMode: {},
13847
13873
  pageContent: {}
13848
13874
  },
13849
- setup(__props) {
13875
+ setup(__props, { expose: __expose }) {
13850
13876
  const props = __props;
13851
13877
  const modal = bluesea.useModal();
13852
13878
  const pageBuilderEditor = createPageBuilderEditor();
@@ -13863,6 +13889,59 @@ var __publicField = (obj, key, value) => {
13863
13889
  vue.watch(() => props.pageContent, (pageContent) => pageContent && pageBuilderEditor.initData(pageContent));
13864
13890
  const colorHistory = vue.ref([]);
13865
13891
  vue.provide("colorHistory", colorHistory);
13892
+ const getLocalDesignPartContent = () => {
13893
+ let content;
13894
+ if (pageBuilderEditor.model.rootPart) {
13895
+ content = doGetLocalDesignPartContent(pageBuilderEditor.model.rootPart);
13896
+ }
13897
+ return content;
13898
+ };
13899
+ const doGetLocalDesignPartContent = (part) => {
13900
+ var _a;
13901
+ let content;
13902
+ if (((_a = part.properties) == null ? void 0 : _a.sectionType) && ["LocalDesignPart", "LocalMarketingPart"].includes(part.properties.sectionType)) {
13903
+ const properties = getLocalDesignPartProperties(part);
13904
+ if (properties) {
13905
+ if (!content)
13906
+ content = [];
13907
+ content.push({ partId: part.partId, data: properties });
13908
+ }
13909
+ }
13910
+ if (part.children) {
13911
+ for (const child of part.children) {
13912
+ const childContent = doGetLocalDesignPartContent(child);
13913
+ if (childContent)
13914
+ content = [...content || [], ...childContent];
13915
+ }
13916
+ }
13917
+ return content;
13918
+ };
13919
+ const getLocalDesignPartProperties = (part) => {
13920
+ let properties;
13921
+ if (part.isWidget()) {
13922
+ const defs = pageBuilderEditor.partManager.getLocalDesignPartPropertyDefinitions(part.partName);
13923
+ if (defs) {
13924
+ const data = {};
13925
+ for (const def of defs) {
13926
+ if (part.properties)
13927
+ data[def.propertyName] = part.properties[def.propertyName];
13928
+ }
13929
+ properties = { [part.partId]: data };
13930
+ }
13931
+ }
13932
+ if (part.children) {
13933
+ for (const child of part.children) {
13934
+ const childProperties = getLocalDesignPartProperties(child);
13935
+ if (childProperties) {
13936
+ properties = { ...properties, ...childProperties };
13937
+ }
13938
+ }
13939
+ }
13940
+ return properties;
13941
+ };
13942
+ __expose({
13943
+ getLocalDesignPartContent
13944
+ });
13866
13945
  return (_ctx, _cache) => {
13867
13946
  return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$8, [
13868
13947
  vue.createVNode(_sfc_main$f),
package/dist/style.css CHANGED
@@ -1,170 +1,3 @@
1
- .pb-page {
2
- margin: 0 auto;
3
- margin-top: 20px;
4
- background-position: 50% 50%;
5
- background-repeat: no-repeat;
6
- background-size: cover;
7
- }
8
- .pb-page .pb-section {
9
- position: relative;
10
- background-position: 50% 50%;
11
- background-repeat: no-repeat;
12
- background-size: cover;
13
- background-color: #fff;
14
- }
15
- .pb-page .pb-section .pb-block {
16
- display: flex;
17
- min-width: 1px;
18
- position: relative;
19
- background-position: 50% 50%;
20
- background-repeat: no-repeat;
21
- background-size: cover;
22
- width: 100%;
23
- }
24
- .pb-page .pb-section .pb-block .pb-widget {
25
- position: relative;
26
- background-position: 50% 50%;
27
- background-repeat: no-repeat;
28
- background-size: cover;
29
- width: 100%;
30
- }
31
- .pb-page .pb-section .pb-block .pb-widget .children {
32
- position: absolute;
33
- width: 100%;
34
- height: 100%;
35
- }
36
- .pb-page .pb-section .pb-block .pb-text-widget {
37
- width: 100%;
38
- height: fit-content;
39
- }
40
- .pb-page .pb-section .pb-block .pb-text-widget .text {
41
- color: #333;
42
- }
43
- .pb-page .pb-section .pb-block .pb-text-widget.empty .text {
44
- color: #999;
45
- }
46
- .pb-page .pb-section .pb-block .pb-image-widget {
47
- width: 100%;
48
- }
49
- .pb-page .pb-section .pb-block .pb-image-widget .image {
50
- width: 100%;
51
- }
52
- .pb-page .pb-section .pb-block .pb-image-widget .empty {
53
- height: 100px;
54
- background-color: #eee;
55
- text-align: center;
56
- }
57
- .pb-page .pb-section .pb-block .pb-image-widget .empty span {
58
- font-size: 40px;
59
- color: #999;
60
- line-height: 100px;
61
- vertical-align: middle;
62
- }
63
- .pb-page .pb-section .pb-block .pb-product-list-widget {
64
- width: 100%;
65
- display: flex;
66
- flex-direction: row;
67
- flex-wrap: wrap;
68
- justify-content: flex-start;
69
- align-items: center;
70
- }
71
- .pb-page .pb-section .pb-block .pb-product-list-widget .product {
72
- width: 95%;
73
- margin: 0 auto;
74
- padding-top: 8px;
75
- padding-bottom: 8px;
76
- }
77
- .pb-page .pb-section .pb-block .pb-product-list-widget img {
78
- width: 100%;
79
- }
80
- .pb-page .pb-section .pb-block .pb-product-list-widget .name {
81
- margin-top: 8px;
82
- font-size: 14px;
83
- }
84
- .pb-page .pb-section .pb-block .pb-product-list-widget .price {
85
- margin-top: 8px;
86
- font-size: 14px;
87
- font-weight: bold;
88
- }
89
- .pb-page .pb-section .pb-block .pb-product-list-widget .empty {
90
- height: 200px;
91
- background-color: #eee;
92
- text-align: center;
93
- }
94
- .pb-page .pb-section .pb-block .pb-product-list-widget .empty span {
95
- font-size: 40px;
96
- color: #999;
97
- line-height: 200px;
98
- vertical-align: middle;
99
- }
100
- .pb-page .pb-section .pb-block .pb-page .mobile .pb-product-list-widget .product-wrapper {
101
- width: 50%;
102
- }
103
- .pb-page .pb-section .pb-block .pb-page .pc .pb-product-list-widget .product-wrapper {
104
- width: 25%;
105
- }
106
- .pb-page .pb-section .pb-block .pb-login-widget {
107
- height: 200px;
108
- text-align: center;
109
- }
110
- .pb-page .pb-section .pb-block .pb-login-widget h3 {
111
- font-size: 32px;
112
- font-weight: bold;
113
- color: #ccc;
114
- line-height: 200px;
115
- vertical-align: middle;
116
- }
117
- .pb-page .pb-section .pb-block .pb-editor {
118
- outline: 1px dashed #ccc;
119
- }
120
- .pb-page .pb-section .pb-block:hover:not(:has(.pb-widget:hover)) {
121
- background-color: #f0f0f0;
122
- }
123
- .pb-page .pb-section .pb-block.selected {
124
- outline: 1px solid #8e44ad;
125
- outline-offset: 1px;
126
- z-index: 999;
127
- }
128
- .pb-page .pb-section .pb-editor {
129
- outline: 1px dashed #ccc;
130
- }
131
- .pb-page .pb-section:hover:not(:has(.pb-block:hover)) {
132
- background-color: #f0f0f0;
133
- }
134
- .pb-page .pb-section.selected {
135
- outline: 1px solid #e67e22;
136
- outline-offset: 1px;
137
- z-index: 999;
138
- }
139
- .pb-page .pb-section.pb-section-static {
140
- width: 100%;
141
- display: flex;
142
- justify-content: center;
143
- align-items: center;
144
- pointer-events: none;
145
- }
146
- .pb-page .pb-section.pb-section-static:after {
147
- content: "";
148
- position: absolute;
149
- left: 0;
150
- right: 0;
151
- top: 0;
152
- bottom: 0;
153
- background-color: rgba(0, 0, 0, 0.2);
154
- }
155
- .pb-page .pb-section-static .pb-widget {
156
- outline: none;
157
- }
158
- .pb-page .pb-page-content.selected {
159
- outline: 2px solid #4998f8;
160
- outline-offset: 5px;
161
- }
162
- .pb-page * {
163
- box-sizing: border-box;
164
- }
165
- .pb-viewer {
166
- width: 100%;
167
- }
168
1
  .pb-editor .pb-editor-body {
169
2
  height: 100%;
170
3
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@g1cloud/page-builder-editor",
3
3
  "private": false,
4
- "version": "1.0.0-alpha.1",
4
+ "version": "1.0.0-alpha.2",
5
5
  "engins": {
6
6
  "node": ">= 20.0.0"
7
7
  },
@@ -27,7 +27,7 @@
27
27
  "vue-router": "^4.3.2",
28
28
  "vue3-click-away": "^1.2.4",
29
29
  "yjs": "^13.6.14",
30
- "@g1cloud/page-builder-viewer": "1.0.0-alpha.1"
30
+ "@g1cloud/page-builder-viewer": "1.0.0-alpha.2"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/node": "^20.12.7",