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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/css/canvas-block.scss +1 -1
  2. package/css/canvas-section.scss +1 -1
  3. package/css/canvas-widget.scss +1 -1
  4. package/css/canvas.scss +1 -2
  5. package/css/page-builder-editor.scss +84 -12
  6. package/css/property-editor-color.scss +5 -0
  7. package/css/property-editor-html.scss +16 -0
  8. package/css/property-editor-image.scss +1 -1
  9. package/css/property-group-editor-background.scss +1 -13
  10. package/css/property-group-editor-border.scss +6 -12
  11. package/css/property-group-editor-margin.scss +0 -11
  12. package/css/property-group-editor-padding.scss +0 -11
  13. package/css/property-group-editor-position.scss +0 -11
  14. package/css/property-group-editor-size.scss +0 -11
  15. package/css/property-localpart.scss +2 -2
  16. package/dist/PageBuilderEditor.vue.d.ts +13 -5
  17. package/dist/PbHtmlEditorModal-aaecwH7V.js +131 -0
  18. package/dist/PbPropertyEditorColor-BFMkFOYX.js +57 -0
  19. package/dist/PbPropertyEditorHtml-DZw8qbJH.js +58 -0
  20. package/dist/{PbPropertyEditorImage-DA92v7AE.js → PbPropertyEditorImage-BQhiQyNM.js} +8 -8
  21. package/dist/PbPropertyEditorMultilineText-CT3vTbYY.js +67 -0
  22. package/dist/{PbPropertyEditorReadonlyText-Bk0WJxA0.js → PbPropertyEditorReadonlyText-Dgp_AVOD.js} +1 -1
  23. package/dist/{PbPropertyEditorSelect-BJovN1su.js → PbPropertyEditorSelect-CWedbXJI.js} +1 -1
  24. package/dist/{PbPropertyEditorText-DNdXl-Tr.js → PbPropertyEditorText-DmM_LMjC.js} +15 -5
  25. package/dist/PbScreenSelectModal-DDATc9n1.js +67 -0
  26. package/dist/{PbWidgetAddModal-CQvFYzfU.js → PbWidgetAddModal-BoYfb0dm.js} +32 -8
  27. package/dist/components/menu/PbMenu.vue.d.ts +16 -1
  28. package/dist/components/menu/PbToolbar.vue.d.ts +16 -1
  29. package/dist/components/modal/PbHtmlEditorModal.vue.d.ts +25 -0
  30. package/dist/components/modal/PbScreenSelectModal.vue.d.ts +6 -0
  31. package/dist/components/sidebar/property/{PbPropertyLocalMarketingPart.vue.d.ts → PbPropertyEditorHtml.vue.d.ts} +7 -7
  32. package/dist/components/sidebar/property/PbPropertyEditorMultilineText.vue.d.ts +6 -4
  33. package/dist/components/sidebar/property/PbPropertyEditorText.vue.d.ts +5 -4
  34. package/dist/components/ui/PbColorPicker.vue.d.ts +2 -2
  35. package/dist/{index-Dwk2ffWe.js → index-Cr-_-n9T.js} +1502 -1167
  36. package/dist/index.d.ts +1 -0
  37. package/dist/model/command.d.ts +26 -13
  38. package/dist/model/context.d.ts +10 -13
  39. package/dist/model/event.d.ts +0 -56
  40. package/dist/model/model.d.ts +11 -4
  41. package/dist/model/page-builder-editor.d.ts +39 -7
  42. package/dist/model/page-builder-util.d.ts +2 -2
  43. package/dist/model/part-definintion.d.ts +4 -1
  44. package/dist/model/part-manager.d.ts +0 -1
  45. package/dist/model/part-property.d.ts +1 -0
  46. package/dist/model/plugin.d.ts +10 -0
  47. package/dist/page-builder-editor.js +23 -19
  48. package/dist/page-builder-editor.umd.cjs +1910 -1310
  49. package/package.json +4 -3
  50. package/dist/PbPartAddModal-DuLpnV4E.js +0 -50
  51. package/dist/PbPropertyEditorMultilineText-BMeNUGm8.js +0 -42
  52. package/dist/PbPropertyEditorProduct-CkydxTwD.js +0 -49
  53. /package/dist/components/sidebar/property/{PbPropertyEditorProduct.vue.d.ts → PbPropertyEditorColor.vue.d.ts} +0 -0
@@ -4,8 +4,8 @@ var __publicField = (obj, key, value) => {
4
4
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
5
  return value;
6
6
  };
7
- import { ref, defineComponent, openBlock, createElementBlock, createCommentVNode, computed, normalizeClass, createElementVNode, mergeProps, toDisplayString, onMounted, watch, Fragment, renderList, provide, inject, createBlock as createBlock$1, resolveDynamicComponent, reactive, defineAsyncComponent, withDirectives, unref, createVNode, normalizeStyle, resolveComponent, vModelText, onBeforeUnmount, resolveDirective, withModifiers, renderSlot, normalizeProps, guardReactiveProps, markRaw, Teleport, withCtx } from "vue";
8
- import { notNull, BSTextInput, vClickOutside, useModal, useContextMenu, BSSelect, BSTabSheet, BSTree, BSDateRange } from "@g1cloud/bluesea";
7
+ import { ref, defineComponent, openBlock, createElementBlock, createCommentVNode, computed, mergeProps, toDisplayString, onMounted, onBeforeUnmount, provide, inject, watch, createBlock as createBlock$1, resolveDynamicComponent, normalizeProps, createElementVNode, normalizeClass, Fragment, renderList, reactive, defineAsyncComponent, withDirectives, unref, createVNode, normalizeStyle, resolveComponent, vModelText, resolveDirective, withModifiers, renderSlot, guardReactiveProps, markRaw, Teleport, toHandlers } from "vue";
8
+ import { notNull, BSTextInput, vClickOutside, useModal, useContextMenu, BSSelect, BSTree } from "@g1cloud/bluesea";
9
9
  const create$5 = () => /* @__PURE__ */ new Map();
10
10
  const copy = (m) => {
11
11
  const r = create$5();
@@ -6597,7 +6597,7 @@ var shortUniqueId$1 = { exports: {} };
6597
6597
  })(shortUniqueId$1);
6598
6598
  var shortUniqueIdExports = shortUniqueId$1.exports;
6599
6599
  const ShortUniqueId = /* @__PURE__ */ getDefaultExportFromCjs(shortUniqueIdExports);
6600
- function mitt$1(n) {
6600
+ function mitt(n) {
6601
6601
  return { all: n = n || /* @__PURE__ */ new Map(), on: function(t, e) {
6602
6602
  var i = n.get(t);
6603
6603
  i ? i.push(e) : n.set(t, [e]);
@@ -6613,57 +6613,30 @@ function mitt$1(n) {
6613
6613
  });
6614
6614
  } };
6615
6615
  }
6616
- const emitter$1 = mitt$1();
6616
+ const emitter = mitt();
6617
6617
  const PageBuilderEditorEvent = {
6618
6618
  on: {
6619
6619
  modelUpdated: (listener) => {
6620
- emitter$1.on("modelUpdated", listener);
6620
+ emitter.on("modelUpdated", listener);
6621
6621
  },
6622
6622
  modelUpdatedByUI: (listener) => {
6623
- emitter$1.on("modelUpdatedByUI", listener);
6624
- },
6625
- requestImage: (listener) => {
6626
- emitter$1.on("requestImage", listener);
6627
- },
6628
- requestProducts: (listener) => {
6629
- emitter$1.on("requestProducts", listener);
6630
- },
6631
- requestLocalMarketingPartSchedule: (listener) => {
6632
- emitter$1.on("requestLocalMarketingPartSchedule", listener);
6623
+ emitter.on("modelUpdatedByUI", listener);
6633
6624
  }
6634
6625
  },
6635
6626
  off: {
6636
6627
  modelUpdated: (listener) => {
6637
- emitter$1.off("modelUpdated", listener);
6628
+ emitter.off("modelUpdated", listener);
6638
6629
  },
6639
6630
  modelUpdatedByUI: (listener) => {
6640
- emitter$1.off("modelUpdatedByUI", listener);
6641
- },
6642
- requestImage: (listener) => {
6643
- emitter$1.off("requestImage", listener);
6644
- },
6645
- requestProducts: (listener) => {
6646
- emitter$1.off("requestProducts", listener);
6647
- },
6648
- requestLocalMarketingPartSchedule: (listener) => {
6649
- emitter$1.off("requestLocalMarketingPartSchedule", listener);
6631
+ emitter.off("modelUpdatedByUI", listener);
6650
6632
  }
6651
6633
  },
6652
6634
  emit: {
6653
6635
  modelUpdated: (changes) => {
6654
- emitter$1.emit("modelUpdated", changes);
6636
+ emitter.emit("modelUpdated", changes);
6655
6637
  },
6656
6638
  modelUpdatedByUI: (changes) => {
6657
- emitter$1.emit("modelUpdatedByUI", changes);
6658
- },
6659
- requestImage: (param) => {
6660
- emitter$1.emit("requestImage", param);
6661
- },
6662
- requestProducts: (param) => {
6663
- emitter$1.emit("requestProducts", param);
6664
- },
6665
- requestLocalMarketingPartSchedule: (param) => {
6666
- emitter$1.emit("requestLocalMarketingPartSchedule", param);
6639
+ emitter.emit("modelUpdatedByUI", changes);
6667
6640
  }
6668
6641
  }
6669
6642
  };
@@ -6721,7 +6694,7 @@ class Part {
6721
6694
  return "";
6722
6695
  }
6723
6696
  getStyles() {
6724
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s;
6697
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J;
6725
6698
  const style = {};
6726
6699
  if (((_a = this.properties) == null ? void 0 : _a.direction) === "horizontal") {
6727
6700
  style.display = "flex";
@@ -6765,20 +6738,46 @@ class Part {
6765
6738
  style.width = this.properties.width;
6766
6739
  if ((_s = this.properties) == null ? void 0 : _s.height)
6767
6740
  style.height = this.properties.height;
6741
+ if ((_t = this.properties) == null ? void 0 : _t.backgroundColor)
6742
+ style.backgroundColor = this.properties.backgroundColor;
6743
+ if ((_u = this.properties) == null ? void 0 : _u.borderLeftWidth)
6744
+ style.borderLeftWidth = this.properties.borderLeftWidth;
6745
+ if ((_v = this.properties) == null ? void 0 : _v.borderRightWidth)
6746
+ style.borderRightWidth = this.properties.borderRightWidth;
6747
+ if ((_w = this.properties) == null ? void 0 : _w.borderTopWidth)
6748
+ style.borderTopWidth = this.properties.borderTopWidth;
6749
+ if ((_x = this.properties) == null ? void 0 : _x.borderBottomWidth)
6750
+ style.borderBottomWidth = this.properties.borderBottomWidth;
6751
+ if ((_y = this.properties) == null ? void 0 : _y.borderTopLeftRadius)
6752
+ style.borderTopLeftRadius = this.properties.borderTopLeftRadius;
6753
+ if ((_z = this.properties) == null ? void 0 : _z.borderTopRightRadius)
6754
+ style.borderTopRightRadius = this.properties.borderTopRightRadius;
6755
+ if ((_A = this.properties) == null ? void 0 : _A.borderBottomLeftRadius)
6756
+ style.borderBottomLeftRadius = this.properties.borderBottomLeftRadius;
6757
+ if ((_B = this.properties) == null ? void 0 : _B.borderBottomRightRadius)
6758
+ style.borderBottomRightRadius = this.properties.borderBottomRightRadius;
6759
+ if (((_C = this.properties) == null ? void 0 : _C.borderColor) && style.borderLeftWidth) {
6760
+ style.borderLeftStyle = "solid";
6761
+ style.borderLeftColor = (_D = this.properties) == null ? void 0 : _D.borderColor;
6762
+ }
6763
+ if (((_E = this.properties) == null ? void 0 : _E.borderColor) && style.borderRightWidth) {
6764
+ style.borderRightStyle = "solid";
6765
+ style.borderRightColor = (_F = this.properties) == null ? void 0 : _F.borderColor;
6766
+ }
6767
+ if (((_G = this.properties) == null ? void 0 : _G.borderColor) && style.borderTopWidth) {
6768
+ style.borderTopStyle = "solid";
6769
+ style.borderTopColor = (_H = this.properties) == null ? void 0 : _H.borderColor;
6770
+ }
6771
+ if (((_I = this.properties) == null ? void 0 : _I.borderColor) && style.borderBottomWidth) {
6772
+ style.borderBottomStyle = "solid";
6773
+ style.borderBottomColor = (_J = this.properties) == null ? void 0 : _J.borderColor;
6774
+ }
6768
6775
  return style;
6769
6776
  }
6770
- getPageBuilderId() {
6771
- if (this.isRoot())
6772
- return this.pageBuilderId;
6773
- if (this.parent)
6774
- return this.parent.getPageBuilderId();
6775
- }
6776
6777
  }
6777
6778
  class RootPart extends Part {
6778
6779
  constructor() {
6779
6780
  super();
6780
- __publicField2(this, "pageBuilderId");
6781
- this.pageBuilderId = "";
6782
6781
  this.partType = ROOT_TYPE$1;
6783
6782
  this.partName = ROOT_TYPE$1;
6784
6783
  }
@@ -6836,11 +6835,11 @@ let Model$1 = class Model {
6836
6835
  }
6837
6836
  };
6838
6837
  const _hoisted_1$8$1 = ["data-model-id"];
6839
- const _hoisted_2$3$1 = {
6838
+ const _hoisted_2$5$1 = {
6840
6839
  key: 1,
6841
6840
  class: "pb-nested-widget"
6842
6841
  };
6843
- const _sfc_main$8$1 = /* @__PURE__ */ defineComponent({
6842
+ const _sfc_main$a$1 = /* @__PURE__ */ defineComponent({
6844
6843
  __name: "PbWidget",
6845
6844
  props: {
6846
6845
  part: {}
@@ -6862,7 +6861,7 @@ const _sfc_main$8$1 = /* @__PURE__ */ defineComponent({
6862
6861
  key: 0,
6863
6862
  part: _ctx.part
6864
6863
  }, null, 8, ["part"])) : createCommentVNode("", true),
6865
- childComponents.value && childComponents.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_2$3$1, [
6864
+ childComponents.value && childComponents.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_2$5$1, [
6866
6865
  (openBlock(true), createElementBlock(Fragment, null, renderList(childComponents.value, (child) => {
6867
6866
  return openBlock(), createBlock$1(resolveDynamicComponent(child.component), {
6868
6867
  key: child.part.partId,
@@ -6875,7 +6874,7 @@ const _sfc_main$8$1 = /* @__PURE__ */ defineComponent({
6875
6874
  }
6876
6875
  });
6877
6876
  const _hoisted_1$7$1 = ["data-model-id"];
6878
- const _sfc_main$7$1 = /* @__PURE__ */ defineComponent({
6877
+ const _sfc_main$9$1 = /* @__PURE__ */ defineComponent({
6879
6878
  __name: "PbBlock",
6880
6879
  props: {
6881
6880
  part: {}
@@ -6893,7 +6892,7 @@ const _sfc_main$7$1 = /* @__PURE__ */ defineComponent({
6893
6892
  style: (_a = _ctx.part.properties) == null ? void 0 : _a.css
6894
6893
  }, properties.value), [
6895
6894
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.part.children, (child) => {
6896
- return openBlock(), createBlock$1(_sfc_main$8$1, {
6895
+ return openBlock(), createBlock$1(_sfc_main$a$1, {
6897
6896
  key: child.partId,
6898
6897
  part: child
6899
6898
  }, null, 8, ["part"]);
@@ -6903,7 +6902,7 @@ const _sfc_main$7$1 = /* @__PURE__ */ defineComponent({
6903
6902
  }
6904
6903
  });
6905
6904
  const _hoisted_1$6$1 = { class: "pb-block" };
6906
- const _hoisted_2$2$1 = /* @__PURE__ */ createElementVNode("div", {
6905
+ const _hoisted_2$4$1 = /* @__PURE__ */ createElementVNode("div", {
6907
6906
  class: "pb-widget",
6908
6907
  style: { "margin": "0 auto" }
6909
6908
  }, [
@@ -6911,22 +6910,22 @@ const _hoisted_2$2$1 = /* @__PURE__ */ createElementVNode("div", {
6911
6910
  /* @__PURE__ */ createElementVNode("h3", null, "Login Design Part")
6912
6911
  ])
6913
6912
  ], -1);
6914
- const _hoisted_3$2$1 = [
6915
- _hoisted_2$2$1
6913
+ const _hoisted_3$4$1 = [
6914
+ _hoisted_2$4$1
6916
6915
  ];
6917
- const _sfc_main$6$1 = /* @__PURE__ */ defineComponent({
6916
+ const _sfc_main$8$1 = /* @__PURE__ */ defineComponent({
6918
6917
  __name: "PbLoginDepart",
6919
6918
  props: {
6920
6919
  part: {}
6921
6920
  },
6922
6921
  setup(__props) {
6923
6922
  return (_ctx, _cache) => {
6924
- return openBlock(), createElementBlock("div", _hoisted_1$6$1, _hoisted_3$2$1);
6923
+ return openBlock(), createElementBlock("div", _hoisted_1$6$1, _hoisted_3$4$1);
6925
6924
  };
6926
6925
  }
6927
6926
  });
6928
6927
  const _hoisted_1$5$1 = ["data-model-id"];
6929
- const _sfc_main$5$1 = /* @__PURE__ */ defineComponent({
6928
+ const _sfc_main$7$1 = /* @__PURE__ */ defineComponent({
6930
6929
  __name: "PbSection",
6931
6930
  props: {
6932
6931
  part: {}
@@ -6942,11 +6941,11 @@ const _sfc_main$5$1 = /* @__PURE__ */ defineComponent({
6942
6941
  "data-model-id": _ctx.part.partId,
6943
6942
  style: (_a = _ctx.part.properties) == null ? void 0 : _a.css
6944
6943
  }, properties.value), [
6945
- ((_b = _ctx.part.properties) == null ? void 0 : _b.name) === "Login Design Part" ? (openBlock(), createBlock$1(_sfc_main$6$1, {
6944
+ ((_b = _ctx.part.properties) == null ? void 0 : _b.name) === "Login Design Part" ? (openBlock(), createBlock$1(_sfc_main$8$1, {
6946
6945
  key: 0,
6947
6946
  part: _ctx.part
6948
6947
  }, null, 8, ["part"])) : _ctx.part.children && _ctx.part.children.length > 0 ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(_ctx.part.children, (block) => {
6949
- return openBlock(), createBlock$1(_sfc_main$7$1, {
6948
+ return openBlock(), createBlock$1(_sfc_main$9$1, {
6950
6949
  key: block.partId,
6951
6950
  part: block
6952
6951
  }, null, 8, ["part"]);
@@ -6956,20 +6955,20 @@ const _sfc_main$5$1 = /* @__PURE__ */ defineComponent({
6956
6955
  }
6957
6956
  });
6958
6957
  const _hoisted_1$4$1 = { class: "pb-image-widget" };
6959
- const _hoisted_2$1$1 = ["src"];
6960
- const _hoisted_3$1$1 = {
6958
+ const _hoisted_2$3$1 = ["src"];
6959
+ const _hoisted_3$3$1 = {
6961
6960
  key: 1,
6962
- class: "empty"
6961
+ class: "placeholder"
6963
6962
  };
6964
- const _hoisted_4$1$1 = /* @__PURE__ */ createElementVNode("span", { class: "font-icon" }, "image", -1);
6965
- const _hoisted_5$1$1 = [
6966
- _hoisted_4$1$1
6963
+ const _hoisted_4$d = /* @__PURE__ */ createElementVNode("span", { class: "font-icon" }, "image", -1);
6964
+ const _hoisted_5$6 = [
6965
+ _hoisted_4$d
6967
6966
  ];
6968
- const _sfc_main$4$1 = /* @__PURE__ */ defineComponent({
6967
+ const _sfc_main$6$1 = /* @__PURE__ */ defineComponent({
6969
6968
  __name: "PbImageWidget",
6970
6969
  props: {
6971
6970
  part: {},
6972
- viewMode: { type: Boolean, default: false }
6971
+ placeholder: { type: Boolean }
6973
6972
  },
6974
6973
  setup(__props) {
6975
6974
  return (_ctx, _cache) => {
@@ -6980,199 +6979,257 @@ const _sfc_main$4$1 = /* @__PURE__ */ defineComponent({
6980
6979
  src: (_b = _ctx.part.properties) == null ? void 0 : _b.image,
6981
6980
  alt: "",
6982
6981
  class: "image"
6983
- }, null, 8, _hoisted_2$1$1)) : !_ctx.viewMode ? (openBlock(), createElementBlock("div", _hoisted_3$1$1, _hoisted_5$1$1)) : createCommentVNode("", true)
6982
+ }, null, 8, _hoisted_2$3$1)) : _ctx.placeholder ? (openBlock(), createElementBlock("div", _hoisted_3$3$1, _hoisted_5$6)) : createCommentVNode("", true)
6984
6983
  ]);
6985
6984
  };
6986
6985
  }
6987
6986
  });
6988
- const _hoisted_1$3$1 = ["textContent"];
6989
- const _sfc_main$3$1 = /* @__PURE__ */ defineComponent({
6987
+ const _hoisted_1$3$1 = { class: "pb-text-widget" };
6988
+ const _hoisted_2$2$1 = ["textContent"];
6989
+ const _hoisted_3$2$1 = {
6990
+ key: 1,
6991
+ class: "placeholder",
6992
+ textContent: "Empty Text"
6993
+ };
6994
+ const _sfc_main$5$1 = /* @__PURE__ */ defineComponent({
6990
6995
  __name: "PbTextWidget",
6991
6996
  props: {
6992
6997
  part: {},
6993
- viewMode: { type: Boolean, default: false }
6998
+ placeholder: { type: Boolean }
6994
6999
  },
6995
7000
  setup(__props) {
6996
7001
  const props = __props;
6997
- const style = computed(() => {
7002
+ const pageBuilder = usePageBuilder();
7003
+ const text = computed(() => {
6998
7004
  var _a;
7005
+ if ((_a = props.part.properties) == null ? void 0 : _a.text) {
7006
+ if (typeof props.part.properties.text === "string") {
7007
+ return props.part.properties.text;
7008
+ } else {
7009
+ const locale = pageBuilder.getLocale();
7010
+ return props.part.properties.text[locale] || "";
7011
+ }
7012
+ }
7013
+ });
7014
+ const style = computed(() => {
7015
+ var _a, _b;
6999
7016
  return {
7000
7017
  style: {
7001
- fontSize: (_a = props.part.properties) == null ? void 0 : _a.fontSize
7018
+ fontSize: (_a = props.part.properties) == null ? void 0 : _a.fontSize,
7019
+ color: (_b = props.part.properties) == null ? void 0 : _b.color
7002
7020
  }
7003
7021
  };
7004
7022
  });
7005
7023
  return (_ctx, _cache) => {
7006
- var _a, _b;
7007
- return openBlock(), createElementBlock("div", {
7008
- class: normalizeClass([[_ctx.viewMode && !((_a = _ctx.part.properties) == null ? void 0 : _a.text) ? "empty" : ""], "pb-text-widget"])
7009
- }, [
7010
- createElementVNode("div", mergeProps({ class: "text" }, style.value, {
7011
- textContent: toDisplayString(((_b = _ctx.part.properties) == null ? void 0 : _b.text) || (!_ctx.viewMode ? "Empty text" : " "))
7012
- }), null, 16, _hoisted_1$3$1)
7013
- ], 2);
7024
+ return openBlock(), createElementBlock("div", _hoisted_1$3$1, [
7025
+ text.value ? (openBlock(), createElementBlock("div", mergeProps({
7026
+ key: 0,
7027
+ class: "text"
7028
+ }, style.value, {
7029
+ textContent: toDisplayString(text.value)
7030
+ }), null, 16, _hoisted_2$2$1)) : _ctx.placeholder ? (openBlock(), createElementBlock("div", _hoisted_3$2$1)) : createCommentVNode("", true)
7031
+ ]);
7014
7032
  };
7015
7033
  }
7016
7034
  });
7017
- function mitt(n) {
7018
- return { all: n = n || /* @__PURE__ */ new Map(), on: function(t, e) {
7019
- var i = n.get(t);
7020
- i ? i.push(e) : n.set(t, [e]);
7021
- }, off: function(t, e) {
7022
- var i = n.get(t);
7023
- i && (e ? i.splice(i.indexOf(e) >>> 0, 1) : n.set(t, []));
7024
- }, emit: function(t, e) {
7025
- var i = n.get(t);
7026
- i && i.slice().map(function(n2) {
7027
- n2(e);
7028
- }), (i = n.get("*")) && i.slice().map(function(n2) {
7029
- n2(t, e);
7030
- });
7031
- } };
7032
- }
7033
- const emitter = mitt();
7034
- const PageBuilderViewerEvent = {
7035
- on: {
7036
- requestProductMapping: (listener) => {
7037
- emitter.on("requestProductMapping", listener);
7038
- }
7039
- },
7040
- off: {
7041
- requestProductMapping: (listener) => {
7042
- emitter.off("requestProductMapping", listener);
7043
- }
7044
- },
7045
- emit: {
7046
- requestProductMapping: (param) => {
7047
- emitter.emit("requestProductMapping", param);
7048
- }
7049
- }
7050
- };
7051
- const _hoisted_1$2$1 = { class: "pb-product-list-widget" };
7052
- const _hoisted_2$l = { class: "product" };
7053
- const _hoisted_3$g = { class: "image" };
7054
- const _hoisted_4$d = ["src"];
7055
- const _hoisted_5$8 = { class: "name" };
7056
- const _hoisted_6$7 = { class: "price" };
7057
- const _hoisted_7$5 = {
7035
+ const _hoisted_1$2$1 = { class: "pb-html-widget" };
7036
+ const _hoisted_2$1$1 = ["innerHTML"];
7037
+ const _hoisted_3$1$1 = {
7058
7038
  key: 1,
7059
- class: "empty"
7039
+ class: "placeholder",
7040
+ textContent: "Empty HTML"
7060
7041
  };
7061
- const _hoisted_8$5 = /* @__PURE__ */ createElementVNode("span", { class: "font-icon" }, "image", -1);
7062
- const _hoisted_9$2 = [
7063
- _hoisted_8$5
7064
- ];
7065
- const _sfc_main$2$1 = /* @__PURE__ */ defineComponent({
7066
- __name: "PbProductListWidget",
7042
+ const _sfc_main$4$1 = /* @__PURE__ */ defineComponent({
7043
+ __name: "PbHtmlWidget",
7067
7044
  props: {
7068
7045
  part: {},
7069
- viewMode: { type: Boolean, default: false }
7046
+ placeholder: { type: Boolean }
7070
7047
  },
7071
7048
  setup(__props) {
7072
7049
  const props = __props;
7073
- const products = ref([]);
7074
- const productCount = computed(() => props.viewMode ? products.value.length : Math.max(4, products.value.length));
7075
- const updateProducts = () => {
7076
- var _a, _b;
7077
- if ((_a = props.part.properties) == null ? void 0 : _a.products) {
7078
- PageBuilderViewerEvent.emit.requestProductMapping({
7079
- pageBuilderId: props.part.getPageBuilderId(),
7080
- itemCodes: (_b = props.part.properties) == null ? void 0 : _b.products,
7081
- callback: (_products) => {
7082
- products.value = _products;
7083
- }
7084
- });
7050
+ const pageBuilder = usePageBuilder();
7051
+ const getHtml = (html2) => {
7052
+ if (!html2)
7053
+ return;
7054
+ if (typeof html2 !== "object")
7055
+ return;
7056
+ const locale = pageBuilder.locale.value;
7057
+ let _html = html2[locale];
7058
+ if (!_html && html2.tags) {
7059
+ _html = html2;
7085
7060
  }
7061
+ if (!_html) {
7062
+ return "";
7063
+ }
7064
+ return `${_html.tags}
7065
+ <style>
7066
+ ${_html.style}
7067
+ </style>`;
7086
7068
  };
7087
- onMounted(() => updateProducts());
7088
- watch(() => {
7069
+ const html = computed(() => {
7089
7070
  var _a;
7090
- return (_a = props.part.properties) == null ? void 0 : _a.products;
7091
- }, () => updateProducts());
7071
+ return getHtml((_a = props.part.properties) == null ? void 0 : _a.html);
7072
+ });
7073
+ computed(() => props.placeholder ? !html.value : false);
7092
7074
  return (_ctx, _cache) => {
7093
7075
  return openBlock(), createElementBlock("div", _hoisted_1$2$1, [
7094
- products.value ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(productCount.value, (index) => {
7095
- return openBlock(), createElementBlock("div", {
7096
- key: index,
7097
- class: "product-wrapper"
7098
- }, [
7099
- createElementVNode("div", _hoisted_2$l, [
7100
- products.value[index - 1] ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
7101
- createElementVNode("div", _hoisted_3$g, [
7102
- createElementVNode("img", {
7103
- src: products.value[index - 1].image,
7104
- alt: ""
7105
- }, null, 8, _hoisted_4$d)
7106
- ]),
7107
- createElementVNode("div", _hoisted_5$8, toDisplayString(products.value[index - 1].itemName), 1),
7108
- createElementVNode("div", _hoisted_6$7, toDisplayString(products.value[index - 1].price), 1)
7109
- ], 64)) : (openBlock(), createElementBlock("div", _hoisted_7$5, _hoisted_9$2))
7110
- ])
7111
- ]);
7112
- }), 128)) : createCommentVNode("", true)
7076
+ html.value ? (openBlock(), createElementBlock("div", {
7077
+ key: 0,
7078
+ class: "html",
7079
+ innerHTML: html.value
7080
+ }, null, 8, _hoisted_2$1$1)) : _ctx.placeholder ? (openBlock(), createElementBlock("div", _hoisted_3$1$1)) : createCommentVNode("", true)
7081
+ ]);
7082
+ };
7083
+ }
7084
+ });
7085
+ const _hoisted_1$1$1 = { class: "pb-iframe-widget" };
7086
+ const _hoisted_2$j = ["src"];
7087
+ const _hoisted_3$g = {
7088
+ key: 1,
7089
+ class: "placeholder",
7090
+ textContent: "Empty URL"
7091
+ };
7092
+ const _sfc_main$3$1 = /* @__PURE__ */ defineComponent({
7093
+ __name: "PbIframeWidget",
7094
+ props: {
7095
+ part: {},
7096
+ placeholder: { type: Boolean }
7097
+ },
7098
+ setup(__props) {
7099
+ const props = __props;
7100
+ const pageBuilder = usePageBuilder();
7101
+ const url = computed(() => {
7102
+ var _a;
7103
+ const url2 = (_a = props.part.properties) == null ? void 0 : _a.url;
7104
+ if (!url2)
7105
+ return;
7106
+ if (typeof url2 !== "object")
7107
+ return;
7108
+ const locale = pageBuilder.getLocale();
7109
+ return url2[locale];
7110
+ });
7111
+ const style = computed(() => ({
7112
+ style: {
7113
+ width: "100%",
7114
+ height: `${height.value}px`
7115
+ }
7116
+ }));
7117
+ const height = ref(200);
7118
+ const updateHeight = (event) => {
7119
+ if (event.data && event.data.height) {
7120
+ height.value = event.data.height;
7121
+ }
7122
+ };
7123
+ onMounted(() => {
7124
+ window.addEventListener("message", updateHeight);
7125
+ });
7126
+ onBeforeUnmount(() => {
7127
+ window.removeEventListener("message", updateHeight);
7128
+ });
7129
+ return (_ctx, _cache) => {
7130
+ return openBlock(), createElementBlock("div", _hoisted_1$1$1, [
7131
+ url.value ? (openBlock(), createElementBlock("iframe", mergeProps({
7132
+ key: 0,
7133
+ src: url.value
7134
+ }, style.value), null, 16, _hoisted_2$j)) : _ctx.placeholder ? (openBlock(), createElementBlock("div", _hoisted_3$g)) : createCommentVNode("", true)
7113
7135
  ]);
7114
7136
  };
7115
7137
  }
7116
7138
  });
7117
- const partDefinitions$1 = {
7139
+ const defaultPartDefinitions = {
7118
7140
  "Section": {
7119
7141
  partType: "Section",
7120
7142
  partName: "Section",
7121
- creator: () => _sfc_main$5$1
7122
- },
7123
- "GlobalDesignPart": {
7124
- partType: "Section",
7125
- partName: "GlobalDesignPart",
7126
- creator: () => _sfc_main$5$1
7127
- },
7128
- "LocalDesignPart": {
7129
- partType: "Section",
7130
- partName: "LocalDesignPart",
7131
- creator: () => _sfc_main$5$1
7132
- },
7133
- "LocalMarketingPart": {
7134
- partType: "Section",
7135
- partName: "LocalMarketingPart",
7136
- creator: () => _sfc_main$5$1
7143
+ creator: () => _sfc_main$7$1
7137
7144
  },
7138
7145
  "Block": {
7139
7146
  partType: "Block",
7140
7147
  partName: "Block",
7141
- creator: () => _sfc_main$7$1
7148
+ creator: () => _sfc_main$9$1
7142
7149
  },
7143
7150
  "TextWidget": {
7144
7151
  partType: "Widget",
7145
7152
  partName: "TextWidget",
7146
- creator: () => _sfc_main$3$1
7153
+ creator: () => _sfc_main$5$1
7147
7154
  },
7148
7155
  "ImageWidget": {
7149
7156
  partType: "Widget",
7150
7157
  partName: "ImageWidget",
7158
+ creator: () => _sfc_main$6$1
7159
+ },
7160
+ "HtmlWidget": {
7161
+ partType: "Widget",
7162
+ partName: "HtmlWidget",
7151
7163
  creator: () => _sfc_main$4$1
7152
7164
  },
7153
- "ProductListWidget": {
7165
+ "IframeWidget": {
7154
7166
  partType: "Widget",
7155
- partName: "ProductListWidget",
7156
- creator: () => _sfc_main$2$1
7167
+ partName: "IframeWidget",
7168
+ creator: () => _sfc_main$3$1
7157
7169
  }
7158
7170
  };
7171
+ const PAGE_BUILDER_KEY = "PageBuilder";
7159
7172
  const PAGE_BUILDER_VIEWER_KEY = "PageBuilderViewer";
7173
+ let partDefinitions$1 = { ...defaultPartDefinitions };
7160
7174
  class PageBuilderViewerImpl {
7161
7175
  constructor() {
7162
- __publicField2(this, "instanceId");
7163
7176
  __publicField2(this, "model");
7177
+ __publicField2(this, "locale", ref("en"));
7178
+ __publicField2(this, "watchers", {});
7179
+ __publicField2(this, "providers", {});
7164
7180
  this.model = new Model$1();
7165
7181
  }
7166
- render(pageContent) {
7167
- const rootPart = new RootPart();
7168
- rootPart.pageBuilderId = this.instanceId;
7169
- rootPart.children = this.parsePageContent(pageContent);
7170
- if (rootPart.children) {
7171
- for (let page of rootPart.children) {
7172
- page.parent = rootPart;
7182
+ getLocale() {
7183
+ return this.locale.value;
7184
+ }
7185
+ setLocale(locale) {
7186
+ this.locale.value = locale || "en";
7187
+ }
7188
+ registerCustomPlugin(plugin) {
7189
+ if (plugin.widgets) {
7190
+ plugin.widgets.forEach((v) => {
7191
+ const w = { ...v };
7192
+ w.partType = "Widget";
7193
+ w.creator = () => _sfc_main$p;
7194
+ partDefinitions$1[v.partName] = w;
7195
+ });
7196
+ }
7197
+ if (plugin.watchers) {
7198
+ this.watchers = { ...this.watchers, ...plugin.watchers };
7199
+ }
7200
+ if (plugin.providers) {
7201
+ this.providers = { ...this.providers, ...plugin.providers };
7202
+ }
7203
+ }
7204
+ watchCustomWidgetData(part) {
7205
+ const def = partDefinitions$1[part.partName];
7206
+ if (!def || !def.dataWatcher)
7207
+ return false;
7208
+ const watcher = this.watchers[def.dataWatcher];
7209
+ if (!watcher)
7210
+ return false;
7211
+ return watcher(part.properties);
7212
+ }
7213
+ provideCustomWidgetData(part) {
7214
+ const def = partDefinitions$1[part.partName];
7215
+ if (!def || !def.dataProvider)
7216
+ return Promise.resolve();
7217
+ const provider = this.providers[def.dataProvider];
7218
+ if (!provider)
7219
+ return Promise.resolve();
7220
+ return provider(part.properties);
7221
+ }
7222
+ render(data) {
7223
+ const _data = JSON.parse(data || "{}") || {};
7224
+ const rootPart = this.parsePartContent(_data);
7225
+ if (rootPart) {
7226
+ if (rootPart.children) {
7227
+ for (let page of rootPart.children) {
7228
+ page.parent = rootPart;
7229
+ }
7173
7230
  }
7231
+ this.model.rootPart.value = rootPart;
7174
7232
  }
7175
- this.model.rootPart.value = rootPart;
7176
7233
  }
7177
7234
  parsePageContent(pageContent) {
7178
7235
  return pageContent.map((partContent) => this.parsePartContent(partContent)).filter((part) => !!part);
@@ -7184,11 +7241,18 @@ class PageBuilderViewerImpl {
7184
7241
  part.partType = partContent.partType;
7185
7242
  part.partName = partContent.partName;
7186
7243
  part.properties = partContent.properties ? JSON.parse(JSON.stringify(partContent.properties)) : null;
7187
- part.children = (partContent.children || []).map((child) => this.parsePartContent(child)).filter((part2) => !!part2);
7244
+ part.children = (partContent.children || []).map((child) => {
7245
+ const childPart = this.parsePartContent(child);
7246
+ if (childPart)
7247
+ childPart.parent = part;
7248
+ return childPart;
7249
+ }).filter((part2) => !!part2);
7188
7250
  return part;
7189
7251
  }
7190
7252
  createPart(partType) {
7191
7253
  switch (partType) {
7254
+ case "Root":
7255
+ return new RootPart();
7192
7256
  case "Page":
7193
7257
  return new Page();
7194
7258
  case "Section":
@@ -7199,18 +7263,33 @@ class PageBuilderViewerImpl {
7199
7263
  return new Widget();
7200
7264
  }
7201
7265
  }
7266
+ getCustomWidgetComponent(part) {
7267
+ const def = getPartDefinition(part.partName);
7268
+ if (def) {
7269
+ return def.component;
7270
+ }
7271
+ }
7202
7272
  }
7203
7273
  const createPageBuilderViewer = () => {
7204
7274
  const viewer = new PageBuilderViewerImpl();
7205
7275
  return viewer;
7206
7276
  };
7277
+ const providePageBuilder = (pageBuilder) => {
7278
+ provide(PAGE_BUILDER_KEY, pageBuilder);
7279
+ };
7207
7280
  const providePageBuilderViewer = (pageBuilderViewer) => {
7208
7281
  provide(PAGE_BUILDER_VIEWER_KEY, pageBuilderViewer);
7209
7282
  };
7283
+ const usePageBuilder = () => {
7284
+ const pageBuilder = inject(PAGE_BUILDER_KEY);
7285
+ if (!pageBuilder)
7286
+ throw Error("PageBuilder not found");
7287
+ return pageBuilder;
7288
+ };
7210
7289
  const usePageBuilderViewer = () => {
7211
7290
  const pageBuilderViewer = inject(PAGE_BUILDER_VIEWER_KEY);
7212
7291
  if (!pageBuilderViewer)
7213
- throw Error("PageBuilder not found");
7292
+ throw Error("PageBuilderViewer not found");
7214
7293
  return pageBuilderViewer;
7215
7294
  };
7216
7295
  const createPartComponents = (parts) => {
@@ -7228,11 +7307,11 @@ const createPartComponent = (part) => {
7228
7307
  }
7229
7308
  };
7230
7309
  const getPartDefinition = (partName) => partDefinitions$1[partName];
7231
- const _hoisted_1$1$1 = { class: "pb-page-content" };
7232
- const _sfc_main$1$1 = /* @__PURE__ */ defineComponent({
7310
+ const _sfc_main$2$1 = /* @__PURE__ */ defineComponent({
7233
7311
  __name: "PbPage",
7234
7312
  props: {
7235
- page: {}
7313
+ page: {},
7314
+ isMobilePage: { type: Boolean }
7236
7315
  },
7237
7316
  setup(__props) {
7238
7317
  const properties = computed(() => ({
@@ -7243,31 +7322,43 @@ const _sfc_main$1$1 = /* @__PURE__ */ defineComponent({
7243
7322
  return (_ctx, _cache) => {
7244
7323
  var _a;
7245
7324
  return openBlock(), createElementBlock("div", mergeProps({ class: "pb-page" }, properties.value), [
7246
- createElementVNode("div", _hoisted_1$1$1, [
7325
+ createElementVNode("div", {
7326
+ class: normalizeClass([[_ctx.isMobilePage ? "mobile" : "pc"], "pb-page-content"])
7327
+ }, [
7247
7328
  (openBlock(true), createElementBlock(Fragment, null, renderList((_a = _ctx.page) == null ? void 0 : _a.children, (section) => {
7248
- return openBlock(), createBlock$1(_sfc_main$5$1, {
7329
+ return openBlock(), createBlock$1(_sfc_main$7$1, {
7249
7330
  key: section.partId,
7250
7331
  part: section
7251
7332
  }, null, 8, ["part"]);
7252
7333
  }), 128))
7253
- ])
7334
+ ], 2)
7254
7335
  ], 16);
7255
7336
  };
7256
7337
  }
7257
7338
  });
7258
- const _hoisted_1$u = { class: "pb-viewer" };
7259
- const _sfc_main$q = /* @__PURE__ */ defineComponent({
7339
+ const _hoisted_1$t = { class: "pb-viewer" };
7340
+ const _sfc_main$1$1 = /* @__PURE__ */ defineComponent({
7260
7341
  __name: "PageBuilderViewer",
7261
7342
  props: {
7262
- instanceId: {},
7263
- pageContent: {}
7343
+ pageContent: {},
7344
+ isMobilePage: { type: Boolean },
7345
+ locale: {},
7346
+ plugin: {}
7264
7347
  },
7265
7348
  setup(__props) {
7266
7349
  const props = __props;
7267
7350
  const pageBuilderViewer = createPageBuilderViewer();
7268
- pageBuilderViewer.instanceId = props.instanceId;
7351
+ pageBuilderViewer.setLocale(props.locale);
7352
+ if (props.plugin)
7353
+ pageBuilderViewer.registerCustomPlugin(props.plugin);
7269
7354
  providePageBuilderViewer(pageBuilderViewer);
7270
- const page = computed(() => pageBuilderViewer.model.rootPart.value.children && pageBuilderViewer.model.rootPart.value.children[0]);
7355
+ providePageBuilder(pageBuilderViewer);
7356
+ const page = computed(() => {
7357
+ const pages = pageBuilderViewer.model.rootPart.value.children;
7358
+ if (!pages || !pages.length)
7359
+ return;
7360
+ return pages[pages.length === 1 || props.isMobilePage ? 0 : 1];
7361
+ });
7271
7362
  onMounted(() => {
7272
7363
  if (props.pageContent) {
7273
7364
  pageBuilderViewer.render(props.pageContent);
@@ -7282,15 +7373,46 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
7282
7373
  }
7283
7374
  );
7284
7375
  return (_ctx, _cache) => {
7285
- return openBlock(), createElementBlock("div", _hoisted_1$u, [
7286
- page.value ? (openBlock(), createBlock$1(_sfc_main$1$1, {
7376
+ return openBlock(), createElementBlock("div", _hoisted_1$t, [
7377
+ page.value ? (openBlock(), createBlock$1(_sfc_main$2$1, {
7287
7378
  key: 0,
7379
+ "is-mobile-page": _ctx.isMobilePage,
7288
7380
  page: page.value
7289
- }, null, 8, ["page"])) : createCommentVNode("", true)
7381
+ }, null, 8, ["is-mobile-page", "page"])) : createCommentVNode("", true)
7290
7382
  ]);
7291
7383
  };
7292
7384
  }
7293
7385
  });
7386
+ const _sfc_main$p = /* @__PURE__ */ defineComponent({
7387
+ __name: "PbCustomWidget",
7388
+ props: {
7389
+ part: {},
7390
+ dataWatcher: { type: Function },
7391
+ dataProvider: { type: Function }
7392
+ },
7393
+ setup(__props) {
7394
+ const props = __props;
7395
+ const pageBuilder = usePageBuilder();
7396
+ const comp = computed(() => pageBuilder.getCustomWidgetComponent(props.part));
7397
+ const data = ref({});
7398
+ const bind = computed(() => ({
7399
+ ...props.part.properties || {},
7400
+ placeholder: true,
7401
+ ...data.value || {}
7402
+ }));
7403
+ const updateData = async () => {
7404
+ data.value = await pageBuilder.provideCustomWidgetData(props.part);
7405
+ };
7406
+ onMounted(updateData);
7407
+ watch(
7408
+ () => pageBuilder.watchCustomWidgetData(props.part),
7409
+ () => updateData()
7410
+ );
7411
+ return (_ctx, _cache) => {
7412
+ return comp.value ? (openBlock(), createBlock$1(resolveDynamicComponent(comp.value), normalizeProps(mergeProps({ key: 0 }, bind.value)), null, 16)) : createCommentVNode("", true);
7413
+ };
7414
+ }
7415
+ });
7294
7416
  const PART_ID_KEY = "partId";
7295
7417
  const PART_NAME_KEY = "partName";
7296
7418
  const RESERVED_ATTRIBUTES = [PART_ID_KEY, PART_NAME_KEY];
@@ -7338,8 +7460,9 @@ const partToJsonObject = (part) => {
7338
7460
  object.partName = part.partName;
7339
7461
  object.partId = part.partId;
7340
7462
  if (part.properties) {
7463
+ object.properties = {};
7341
7464
  for (const name in part.properties) {
7342
- object[name] = part.properties[name];
7465
+ object.properties[name] = part.properties[name];
7343
7466
  }
7344
7467
  }
7345
7468
  if (part.children) {
@@ -7409,14 +7532,20 @@ const syncProperties = (part, element) => {
7409
7532
  for (const name in attrs) {
7410
7533
  if (!RESERVED_ATTRIBUTES.includes(name)) {
7411
7534
  const value = attrs[name];
7412
- if (value)
7413
- part.properties[name] = value;
7414
- else
7535
+ if (value) {
7536
+ if (name.indexOf(".object") > 0) {
7537
+ const _name = name.substring(0, name.length - ".object".length);
7538
+ part.properties[_name] = JSON.parse(value);
7539
+ } else {
7540
+ part.properties[name] = value;
7541
+ }
7542
+ } else {
7415
7543
  delete part.properties[name];
7544
+ }
7416
7545
  }
7417
7546
  }
7418
7547
  for (const name in part.properties) {
7419
- if (!attrs[name])
7548
+ if (!attrs[name] && !attrs[`${name}.object`])
7420
7549
  delete part.properties[name];
7421
7550
  }
7422
7551
  if (Object.keys(part.properties).length === 0) {
@@ -7454,6 +7583,9 @@ const findChildById = (part, partId) => {
7454
7583
  const createPart = (partType, partName, properties) => {
7455
7584
  let part;
7456
7585
  switch (partType) {
7586
+ case ROOT_TYPE:
7587
+ part = new RootPart();
7588
+ break;
7457
7589
  case PAGE_TYPE:
7458
7590
  part = new Page();
7459
7591
  break;
@@ -7511,28 +7643,15 @@ class Model2 {
7511
7643
  __publicField(this, "yjsRoot");
7512
7644
  __publicField(this, "undoManager");
7513
7645
  __publicField(this, "rootPart");
7514
- __publicField(this, "serializePageModel", (partIds) => {
7515
- const parts = this.findPartsByIds(partIds);
7516
- return partsToJsonString(parts);
7517
- });
7518
7646
  this.yjsDoc = new Doc();
7519
7647
  this.yjsRoot = this.yjsDoc.get("root", YXmlElement);
7520
7648
  const rootPartId = getNewPartId();
7521
- const pages = [];
7522
7649
  this.yjsDoc.transact(() => {
7523
7650
  this.yjsRoot.nodeName = ROOT_TYPE;
7524
7651
  this.yjsRoot.setAttribute(PART_ID_KEY, rootPartId);
7525
- for (let i = 0; i < 3; ++i) {
7526
- const pageElement = new YXmlElement(PAGE_TYPE);
7527
- pageElement.setAttribute(PART_NAME_KEY, PAGE_TYPE);
7528
- pageElement.setAttribute(PART_ID_KEY, getNewPartId());
7529
- this.yjsRoot.push([pageElement]);
7530
- pages.push(new Page());
7531
- }
7532
7652
  });
7533
7653
  this.rootPart = reactive(new RootPart());
7534
7654
  this.rootPart.partId = rootPartId;
7535
- this.rootPart.children = pages;
7536
7655
  this.yjsRoot.observeDeep((events, _) => {
7537
7656
  applyChangeEvents(this.rootPart, events);
7538
7657
  this.emitUpdateModelEvent(events);
@@ -7572,10 +7691,33 @@ class Model2 {
7572
7691
  });
7573
7692
  return parts;
7574
7693
  }
7575
- parsePageModel(json, keepPartId = false) {
7694
+ serializeModel(mediaExtractor, providerExtractor) {
7695
+ const root = partToJsonObject(this.rootPart);
7696
+ if (mediaExtractor) {
7697
+ root.media = mediaExtractor(this.rootPart);
7698
+ }
7699
+ if (providerExtractor) {
7700
+ providerExtractor(root);
7701
+ }
7702
+ return JSON.stringify(root);
7703
+ }
7704
+ parseModel(json, keepPartId = false) {
7705
+ const root = JSON.parse(json);
7706
+ if (root.partType !== ROOT_TYPE)
7707
+ throw Error("Invalid data format");
7708
+ const rootPart = partFromJsonObject(root, keepPartId);
7709
+ if (!rootPart)
7710
+ throw new Error("Invalid data format");
7711
+ return rootPart;
7712
+ }
7713
+ serializeParts(partIds) {
7714
+ const parts = this.findPartsByIds(partIds);
7715
+ return partsToJsonString(parts);
7716
+ }
7717
+ parseParts(json, keepPartId = false) {
7576
7718
  return partsFromJsonString(json, keepPartId);
7577
7719
  }
7578
- moveElements(partId, destPartId, destIndex, update) {
7720
+ moveElements(partId, destPartId, destIndex, update, doNotChangeIndex) {
7579
7721
  var _a;
7580
7722
  if (partId === destPartId)
7581
7723
  return;
@@ -7583,7 +7725,7 @@ class Model2 {
7583
7725
  if (element) {
7584
7726
  if (((_a = element.parent) == null ? void 0 : _a.getAttribute(PART_ID_KEY)) === destPartId) {
7585
7727
  const index = this.getIndexOfElement(element);
7586
- if (index !== void 0 && index < destIndex)
7728
+ if (!doNotChangeIndex && index !== void 0 && index < destIndex)
7587
7729
  destIndex--;
7588
7730
  }
7589
7731
  const parts = this.findPartsByIds([partId]);
@@ -7641,13 +7783,14 @@ class Model2 {
7641
7783
  if (element) {
7642
7784
  for (const name in param.properties) {
7643
7785
  if (!RESERVED_ATTRIBUTES.includes(name)) {
7644
- element.setAttribute(name, param.properties[name]);
7786
+ this.setElementAttribute(element, name, param.properties[name]);
7645
7787
  }
7646
7788
  }
7647
7789
  if (param.removeOtherAttributes) {
7648
7790
  const allAttributes = element.getAttributes();
7649
7791
  for (const name in allAttributes) {
7650
- if (!RESERVED_ATTRIBUTES.includes(name) && !param.properties.hasOwnProperty(name)) {
7792
+ const _name = name.indexOf(".object") > 0 ? name.substring(0, name.length - ".object".length) : name;
7793
+ if (!RESERVED_ATTRIBUTES.includes(name) && !param.properties.hasOwnProperty(_name)) {
7651
7794
  element.removeAttribute(name);
7652
7795
  }
7653
7796
  }
@@ -7680,7 +7823,7 @@ class Model2 {
7680
7823
  if (part.properties) {
7681
7824
  for (const name in part.properties) {
7682
7825
  if (!RESERVED_ATTRIBUTES.includes(name)) {
7683
- node.setAttribute(name, part.properties[name]);
7826
+ this.setElementAttribute(node, name, part.properties[name]);
7684
7827
  }
7685
7828
  }
7686
7829
  }
@@ -7692,6 +7835,21 @@ class Model2 {
7692
7835
  }
7693
7836
  return node;
7694
7837
  }
7838
+ setElementAttribute(node, name, value) {
7839
+ if (!value || typeof value === "string") {
7840
+ node.setAttribute(name, value ? value : "");
7841
+ } else if (typeof value === "object") {
7842
+ node.setAttribute(`${name}.object`, JSON.stringify(value));
7843
+ }
7844
+ }
7845
+ getElementAttribute(node, name) {
7846
+ let value = node.getAttribute(name);
7847
+ if (value)
7848
+ return value;
7849
+ value = node.getAttribute(`${name}.object`);
7850
+ if (value)
7851
+ return JSON.parse(value);
7852
+ }
7695
7853
  getIndexOfElement(element) {
7696
7854
  if (element.parent instanceof YXmlElement) {
7697
7855
  let index = 0;
@@ -7733,7 +7891,7 @@ class Model2 {
7733
7891
  const properties = {};
7734
7892
  event.changes.keys.forEach((_, key) => {
7735
7893
  if (!RESERVED_ATTRIBUTES.includes(key)) {
7736
- properties[key] = element.getAttribute(key) || "";
7894
+ properties[key] = this.getElementAttribute(element, key) || "";
7737
7895
  }
7738
7896
  });
7739
7897
  (_a = result.updated) == null ? void 0 : _a.push({ element, properties });
@@ -7769,20 +7927,6 @@ class PartManager {
7769
7927
  }
7770
7928
  }
7771
7929
  }
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
- }
7786
7930
  createPartComponent(part) {
7787
7931
  if (part) {
7788
7932
  const def = this.getPartDefinition(part.partName);
@@ -7860,16 +8004,23 @@ class PartManager {
7860
8004
  }
7861
8005
  const defaultPartPropertyEditors = () => {
7862
8006
  return {
7863
- "readonly-text": () => defineAsyncComponent(() => import("./PbPropertyEditorReadonlyText-Bk0WJxA0.js")),
7864
- "text": () => defineAsyncComponent(() => import("./PbPropertyEditorText-DNdXl-Tr.js")),
7865
- "multiline-text": () => defineAsyncComponent(() => import("./PbPropertyEditorMultilineText-BMeNUGm8.js")),
7866
- "select": () => defineAsyncComponent(() => import("./PbPropertyEditorSelect-BJovN1su.js")),
7867
- "image": () => defineAsyncComponent(() => import("./PbPropertyEditorImage-DA92v7AE.js")),
7868
- "product": () => defineAsyncComponent(() => import("./PbPropertyEditorProduct-CkydxTwD.js"))
8007
+ "readonly-text": () => defineAsyncComponent(() => import("./PbPropertyEditorReadonlyText-Dgp_AVOD.js")),
8008
+ "text": () => defineAsyncComponent(() => import("./PbPropertyEditorText-DmM_LMjC.js")),
8009
+ "multiline-text": () => defineAsyncComponent(() => import("./PbPropertyEditorMultilineText-CT3vTbYY.js")),
8010
+ "select": () => defineAsyncComponent(() => import("./PbPropertyEditorSelect-CWedbXJI.js")),
8011
+ "color": () => defineAsyncComponent(() => import("./PbPropertyEditorColor-BFMkFOYX.js")),
8012
+ "image": () => defineAsyncComponent(() => import("./PbPropertyEditorImage-BQhiQyNM.js")),
8013
+ "html": () => defineAsyncComponent(() => import("./PbPropertyEditorHtml-DZw8qbJH.js"))
7869
8014
  };
7870
8015
  };
7871
8016
  const getPropertyValueOfParts = (parts, propertyName) => {
7872
- const values = parts.map((part) => part.getProperty(propertyName) || "");
8017
+ if (parts.length === 1) {
8018
+ return parts[0].getProperty(propertyName);
8019
+ }
8020
+ const values = parts.map((part) => {
8021
+ const val = part.getProperty(propertyName);
8022
+ return val && typeof val === "string" ? val : "";
8023
+ });
7873
8024
  const unique = values.filter((val, index) => values.indexOf(val) === index);
7874
8025
  return unique.length === 1 ? unique[0] : void 0;
7875
8026
  };
@@ -8089,22 +8240,22 @@ const _export_sfc = (sfc, props) => {
8089
8240
  }
8090
8241
  return target;
8091
8242
  };
8092
- const _sfc_main$p = {};
8093
- const _hoisted_1$t = { class: "pb-add-widget-button" };
8094
- const _hoisted_2$k = /* @__PURE__ */ createElementVNode("span", { class: "icon material-icons-outlined" }, "add_box", -1);
8243
+ const _sfc_main$o = {};
8244
+ const _hoisted_1$s = { class: "pb-add-widget-button" };
8245
+ const _hoisted_2$i = /* @__PURE__ */ createElementVNode("span", { class: "icon material-icons-outlined" }, "add_box", -1);
8095
8246
  const _hoisted_3$f = /* @__PURE__ */ createElementVNode("span", { class: "text" }, "Add Widget", -1);
8096
8247
  const _hoisted_4$c = [
8097
- _hoisted_2$k,
8248
+ _hoisted_2$i,
8098
8249
  _hoisted_3$f
8099
8250
  ];
8100
8251
  function _sfc_render$1(_ctx, _cache) {
8101
- return openBlock(), createElementBlock("div", _hoisted_1$t, [
8252
+ return openBlock(), createElementBlock("div", _hoisted_1$s, [
8102
8253
  createElementVNode("button", {
8103
8254
  onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("add-widget", $event))
8104
8255
  }, _hoisted_4$c)
8105
8256
  ]);
8106
8257
  }
8107
- const PbAddWidgetButton = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$1]]);
8258
+ const PbAddWidgetButton = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$1]]);
8108
8259
  const MOUSE_TRACKER_KEY = "mouseTracker";
8109
8260
  const MOUSE_TRACKER_NOT_FOUND = "MouseTracker not found";
8110
8261
  class MouseTracker {
@@ -8135,12 +8286,12 @@ const useMouseTracker = () => {
8135
8286
  throw Error(MOUSE_TRACKER_NOT_FOUND);
8136
8287
  return mouseTracker;
8137
8288
  };
8138
- const _hoisted_1$s = ["data-model-id", "draggable"];
8139
- const _hoisted_2$j = {
8289
+ const _hoisted_1$r = ["data-model-id", "draggable"];
8290
+ const _hoisted_2$h = {
8140
8291
  key: 1,
8141
8292
  class: "children"
8142
8293
  };
8143
- const _sfc_main$o = /* @__PURE__ */ defineComponent({
8294
+ const _sfc_main$n = /* @__PURE__ */ defineComponent({
8144
8295
  __name: "PbWidget",
8145
8296
  props: {
8146
8297
  part: {}
@@ -8584,13 +8735,15 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
8584
8735
  }, properties.value), [
8585
8736
  thisComponent.value ? (openBlock(), createBlock$1(resolveDynamicComponent(thisComponent.value), {
8586
8737
  key: 0,
8587
- part: _ctx.part
8738
+ part: _ctx.part,
8739
+ placeholder: true
8588
8740
  }, null, 8, ["part"])) : createCommentVNode("", true),
8589
- childComponents.value && childComponents.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_2$j, [
8741
+ childComponents.value && childComponents.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_2$h, [
8590
8742
  (openBlock(true), createElementBlock(Fragment, null, renderList(childComponents.value, (child) => {
8591
8743
  return openBlock(), createBlock$1(resolveDynamicComponent(child.component), {
8592
8744
  key: child.part.partId,
8593
- part: child.part
8745
+ part: child.part,
8746
+ placeholder: true
8594
8747
  }, null, 8, ["part"]);
8595
8748
  }), 128))
8596
8749
  ])) : createCommentVNode("", true),
@@ -8604,14 +8757,14 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
8604
8757
  class: "resize-handle",
8605
8758
  onMousedown: _resize_mousedown
8606
8759
  }, null, 32)) : createCommentVNode("", true)
8607
- ], 16, _hoisted_1$s)), [
8760
+ ], 16, _hoisted_1$r)), [
8608
8761
  [unref(vPartHandler), { pageBuilder: unref(pageBuilder), part: _ctx.part, droppable: true, locatePositionMark, calculateDropIndex, acceptChildPart }]
8609
8762
  ]);
8610
8763
  };
8611
8764
  }
8612
8765
  });
8613
- const _hoisted_1$r = ["data-model-id"];
8614
- const _sfc_main$n = /* @__PURE__ */ defineComponent({
8766
+ const _hoisted_1$q = ["data-model-id"];
8767
+ const _sfc_main$m = /* @__PURE__ */ defineComponent({
8615
8768
  __name: "PbBlock",
8616
8769
  props: {
8617
8770
  part: {}
@@ -8801,19 +8954,19 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
8801
8954
  onAddWidget: addWidget
8802
8955
  })) : createCommentVNode("", true),
8803
8956
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.part.children, (child) => {
8804
- return openBlock(), createBlock$1(_sfc_main$o, {
8957
+ return openBlock(), createBlock$1(_sfc_main$n, {
8805
8958
  key: child.partId,
8806
8959
  part: child
8807
8960
  }, null, 8, ["part"]);
8808
8961
  }), 128))
8809
- ], 16, _hoisted_1$r)), [
8962
+ ], 16, _hoisted_1$q)), [
8810
8963
  [unref(vPartHandler), { pageBuilder: unref(pageBuilder), part: _ctx.part, droppable: true, locatePositionMark, calculateDropIndex, acceptChildPart }]
8811
8964
  ]);
8812
8965
  };
8813
8966
  }
8814
8967
  });
8815
- const _hoisted_1$q = { class: "pb-block" };
8816
- const _hoisted_2$i = /* @__PURE__ */ createElementVNode("div", {
8968
+ const _hoisted_1$p = { class: "pb-block" };
8969
+ const _hoisted_2$g = /* @__PURE__ */ createElementVNode("div", {
8817
8970
  class: "pb-widget",
8818
8971
  style: { "margin": "0 auto" }
8819
8972
  }, [
@@ -8822,21 +8975,21 @@ const _hoisted_2$i = /* @__PURE__ */ createElementVNode("div", {
8822
8975
  ])
8823
8976
  ], -1);
8824
8977
  const _hoisted_3$e = [
8825
- _hoisted_2$i
8978
+ _hoisted_2$g
8826
8979
  ];
8827
- const _sfc_main$m = /* @__PURE__ */ defineComponent({
8980
+ const _sfc_main$l = /* @__PURE__ */ defineComponent({
8828
8981
  __name: "PbLoginDepart",
8829
8982
  props: {
8830
8983
  part: {}
8831
8984
  },
8832
8985
  setup(__props) {
8833
8986
  return (_ctx, _cache) => {
8834
- return openBlock(), createElementBlock("div", _hoisted_1$q, _hoisted_3$e);
8987
+ return openBlock(), createElementBlock("div", _hoisted_1$p, _hoisted_3$e);
8835
8988
  };
8836
8989
  }
8837
8990
  });
8838
- const _hoisted_1$p = ["data-model-id"];
8839
- const _sfc_main$l = /* @__PURE__ */ defineComponent({
8991
+ const _hoisted_1$o = ["data-model-id"];
8992
+ const _sfc_main$k = /* @__PURE__ */ defineComponent({
8840
8993
  __name: "PbSection",
8841
8994
  props: {
8842
8995
  part: {}
@@ -8854,14 +9007,8 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
8854
9007
  });
8855
9008
  const properties = computed(() => ({ style: props.part.getStyles() }));
8856
9009
  const disabled = computed(() => {
8857
- var _a, _b, _c;
8858
- if (["static"].includes(((_a = props.part.properties) == null ? void 0 : _a.sectionType) || ""))
8859
- return true;
8860
- if (pageBuilder.editMode === "local" && ["GlobalDesignPart"].includes(((_b = props.part.properties) == null ? void 0 : _b.sectionType) || ""))
8861
- return true;
8862
- if (pageBuilder.editMode === "global" && ["LocalDesignPart", "LocalMarketingPart"].includes(((_c = props.part.properties) == null ? void 0 : _c.sectionType) || ""))
8863
- return true;
8864
- return false;
9010
+ var _a;
9011
+ return ["static"].includes(((_a = props.part.properties) == null ? void 0 : _a.sectionType) || "");
8865
9012
  });
8866
9013
  const addWidget = () => {
8867
9014
  pageBuilder.commandRegistry.executeCommand(OpenAddWidgetModalCommand.COMMAND_ID);
@@ -8947,13 +9094,13 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
8947
9094
  style: (_a = _ctx.part.properties) == null ? void 0 : _a.css
8948
9095
  }, properties.value), [
8949
9096
  ((_b = _ctx.part.properties) == null ? void 0 : _b.sectionType) === "static" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
8950
- ((_c = _ctx.part.properties) == null ? void 0 : _c.name) === "Login Design Part" ? (openBlock(), createBlock$1(_sfc_main$m, {
9097
+ ((_c = _ctx.part.properties) == null ? void 0 : _c.name) === "Login Design Part" ? (openBlock(), createBlock$1(_sfc_main$l, {
8951
9098
  key: 0,
8952
9099
  part: _ctx.part
8953
9100
  }, null, 8, ["part"])) : createCommentVNode("", true)
8954
9101
  ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
8955
9102
  _ctx.part.children && _ctx.part.children.length > 0 ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_ctx.part.children, (block) => {
8956
- return openBlock(), createBlock$1(_sfc_main$n, {
9103
+ return openBlock(), createBlock$1(_sfc_main$m, {
8957
9104
  key: block.partId,
8958
9105
  part: block
8959
9106
  }, null, 8, ["part"]);
@@ -8962,23 +9109,29 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
8962
9109
  onAddWidget: addWidget
8963
9110
  }))
8964
9111
  ], 64))
8965
- ], 16, _hoisted_1$p)), [
9112
+ ], 16, _hoisted_1$o)), [
8966
9113
  [unref(vPartHandler), { pageBuilder: unref(pageBuilder), part: _ctx.part, droppable: true, locatePositionMark, calculateDropIndex, acceptChildPart }]
8967
9114
  ]);
8968
9115
  };
8969
9116
  }
8970
9117
  });
8971
- const _hoisted_1$o = { class: "group-editor group-editor-position" };
8972
- const _hoisted_2$h = { class: "flex-align-center" };
8973
- const _hoisted_3$d = /* @__PURE__ */ createElementVNode("div", { class: "label" }, [
8974
- /* @__PURE__ */ createElementVNode("label", null, "Position")
9118
+ const _hoisted_1$n = { class: "group-editor group-editor-position" };
9119
+ const _hoisted_2$f = { class: "flex-align-center" };
9120
+ const _hoisted_3$d = /* @__PURE__ */ createElementVNode("div", { class: "title" }, [
9121
+ /* @__PURE__ */ createElementVNode("label", { textContent: "Position" })
8975
9122
  ], -1);
8976
9123
  const _hoisted_4$b = { class: "flex-grow-1" };
8977
- const _hoisted_5$7 = /* @__PURE__ */ createElementVNode("span", null, "L", -1);
8978
- const _hoisted_6$6 = /* @__PURE__ */ createElementVNode("span", { class: "ml-8" }, "R", -1);
8979
- const _hoisted_7$4 = /* @__PURE__ */ createElementVNode("span", { class: "ml-8" }, "T", -1);
8980
- const _hoisted_8$4 = /* @__PURE__ */ createElementVNode("span", { class: "ml-8" }, "B", -1);
8981
- const _sfc_main$k = /* @__PURE__ */ defineComponent({
9124
+ const _hoisted_5$5 = { class: "bg-gray-100 py-5 rounded-8" };
9125
+ const _hoisted_6$4 = { class: "text-center" };
9126
+ const _hoisted_7$4 = { class: "bs-layout-horizontal justify-content-center align-items-center" };
9127
+ const _hoisted_8$4 = /* @__PURE__ */ createElementVNode("div", {
9128
+ class: "d-inline-block text-center text-gray-300",
9129
+ style: { "width": "30%", "font-size": "12px" }
9130
+ }, [
9131
+ /* @__PURE__ */ createElementVNode("span", { class: "font-icon" }, "add")
9132
+ ], -1);
9133
+ const _hoisted_9$4 = { class: "text-center" };
9134
+ const _sfc_main$j = /* @__PURE__ */ defineComponent({
8982
9135
  __name: "PbPropertyGroupEditorPosition",
8983
9136
  props: {
8984
9137
  group: {},
@@ -9002,39 +9155,46 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
9002
9155
  const updateTop = (value) => updatePropertyValue({ top: value });
9003
9156
  const updateBottom = (value) => updatePropertyValue({ bottom: value });
9004
9157
  return (_ctx, _cache) => {
9005
- return openBlock(), createElementBlock("div", _hoisted_1$o, [
9006
- createElementVNode("div", _hoisted_2$h, [
9158
+ return openBlock(), createElementBlock("div", _hoisted_1$n, [
9159
+ createElementVNode("div", _hoisted_2$f, [
9007
9160
  _hoisted_3$d,
9008
9161
  createElementVNode("div", _hoisted_4$b, [
9009
- createElementVNode("div", null, [
9010
- _hoisted_5$7,
9011
- createVNode(unref(BSTextInput), {
9012
- "model-value": left.value,
9013
- class: "ml-4",
9014
- width: "4em",
9015
- "onUpdate:modelValue": updateLeft
9016
- }, null, 8, ["model-value"]),
9017
- _hoisted_6$6,
9018
- createVNode(unref(BSTextInput), {
9019
- "model-value": right.value,
9020
- class: "ml-4",
9021
- width: "4em",
9022
- "onUpdate:modelValue": updateRight
9023
- }, null, 8, ["model-value"]),
9024
- _hoisted_7$4,
9025
- createVNode(unref(BSTextInput), {
9026
- "model-value": top.value,
9027
- class: "ml-4",
9028
- width: "4em",
9029
- "onUpdate:modelValue": updateTop
9030
- }, null, 8, ["model-value"]),
9031
- _hoisted_8$4,
9032
- createVNode(unref(BSTextInput), {
9033
- "model-value": bottom.value,
9034
- class: "ml-4",
9035
- width: "4em",
9036
- "onUpdate:modelValue": updateBottom
9037
- }, null, 8, ["model-value"])
9162
+ createElementVNode("div", _hoisted_5$5, [
9163
+ createElementVNode("div", _hoisted_6$4, [
9164
+ createVNode(unref(BSTextInput), {
9165
+ "model-value": top.value,
9166
+ class: "ml-4",
9167
+ prefix: "T",
9168
+ width: "30%",
9169
+ "onUpdate:modelValue": updateTop
9170
+ }, null, 8, ["model-value"])
9171
+ ]),
9172
+ createElementVNode("div", _hoisted_7$4, [
9173
+ createVNode(unref(BSTextInput), {
9174
+ "model-value": left.value,
9175
+ class: "ml-4",
9176
+ prefix: "L",
9177
+ width: "30%",
9178
+ "onUpdate:modelValue": updateLeft
9179
+ }, null, 8, ["model-value"]),
9180
+ _hoisted_8$4,
9181
+ createVNode(unref(BSTextInput), {
9182
+ "model-value": right.value,
9183
+ class: "ml-4",
9184
+ prefix: "R",
9185
+ width: "30%",
9186
+ "onUpdate:modelValue": updateRight
9187
+ }, null, 8, ["model-value"])
9188
+ ]),
9189
+ createElementVNode("div", _hoisted_9$4, [
9190
+ createVNode(unref(BSTextInput), {
9191
+ "model-value": bottom.value,
9192
+ class: "ml-4",
9193
+ prefix: "B",
9194
+ width: "30%",
9195
+ "onUpdate:modelValue": updateBottom
9196
+ }, null, 8, ["model-value"])
9197
+ ])
9038
9198
  ])
9039
9199
  ])
9040
9200
  ])
@@ -9042,15 +9202,13 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
9042
9202
  };
9043
9203
  }
9044
9204
  });
9045
- const _hoisted_1$n = { class: "group-editor group-editor-size" };
9046
- const _hoisted_2$g = { class: "flex-align-center" };
9047
- const _hoisted_3$c = /* @__PURE__ */ createElementVNode("div", { class: "label" }, [
9048
- /* @__PURE__ */ createElementVNode("label", null, "Size")
9205
+ const _hoisted_1$m = { class: "group-editor group-editor-size" };
9206
+ const _hoisted_2$e = { class: "flex-align-center" };
9207
+ const _hoisted_3$c = /* @__PURE__ */ createElementVNode("div", { class: "title" }, [
9208
+ /* @__PURE__ */ createElementVNode("label", { textContent: "Size" })
9049
9209
  ], -1);
9050
- const _hoisted_4$a = { class: "flex-grow-1" };
9051
- const _hoisted_5$6 = /* @__PURE__ */ createElementVNode("span", null, "W", -1);
9052
- const _hoisted_6$5 = /* @__PURE__ */ createElementVNode("span", { class: "ml-16" }, "H", -1);
9053
- const _sfc_main$j = /* @__PURE__ */ defineComponent({
9210
+ const _hoisted_4$a = { class: "flex-grow-1 bs-layout-horizontal" };
9211
+ const _sfc_main$i = /* @__PURE__ */ defineComponent({
9054
9212
  __name: "PbPropertyGroupEditorSize",
9055
9213
  props: {
9056
9214
  group: {},
@@ -9070,22 +9228,20 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
9070
9228
  const updateWidth = (value) => updatePropertyValue({ width: value });
9071
9229
  const updateHeight = (value) => updatePropertyValue({ height: value });
9072
9230
  return (_ctx, _cache) => {
9073
- return openBlock(), createElementBlock("div", _hoisted_1$n, [
9074
- createElementVNode("div", _hoisted_2$g, [
9231
+ return openBlock(), createElementBlock("div", _hoisted_1$m, [
9232
+ createElementVNode("div", _hoisted_2$e, [
9075
9233
  _hoisted_3$c,
9076
9234
  createElementVNode("div", _hoisted_4$a, [
9077
- _hoisted_5$6,
9078
9235
  createVNode(unref(BSTextInput), {
9079
9236
  "model-value": width.value,
9080
- class: "ml-4",
9081
- width: "5em",
9237
+ class: "flex-grow-1 mr-2",
9238
+ prefix: "W",
9082
9239
  "onUpdate:modelValue": updateWidth
9083
9240
  }, null, 8, ["model-value"]),
9084
- _hoisted_6$5,
9085
9241
  createVNode(unref(BSTextInput), {
9086
9242
  "model-value": height.value,
9087
- class: "ml-4",
9088
- width: "5em",
9243
+ class: "flex-grow-1 ml-2",
9244
+ prefix: "H",
9089
9245
  "onUpdate:modelValue": updateHeight
9090
9246
  }, null, 8, ["model-value"])
9091
9247
  ])
@@ -9251,8 +9407,8 @@ var script$4 = {
9251
9407
  }
9252
9408
  }
9253
9409
  };
9254
- const _hoisted_1$m = { class: "vc-alpha" };
9255
- const _hoisted_2$f = { class: "vc-alpha-checkboard-wrap" };
9410
+ const _hoisted_1$l = { class: "vc-alpha" };
9411
+ const _hoisted_2$d = { class: "vc-alpha-checkboard-wrap" };
9256
9412
  const _hoisted_3$b = /* @__PURE__ */ createElementVNode(
9257
9413
  "div",
9258
9414
  { class: "vc-alpha-picker" },
@@ -9265,8 +9421,8 @@ const _hoisted_4$9 = [
9265
9421
  ];
9266
9422
  function render$4(_ctx, _cache, $props, $setup, $data, $options) {
9267
9423
  const _component_Checkboard = resolveComponent("Checkboard");
9268
- return openBlock(), createElementBlock("div", _hoisted_1$m, [
9269
- createElementVNode("div", _hoisted_2$f, [
9424
+ return openBlock(), createElementBlock("div", _hoisted_1$l, [
9425
+ createElementVNode("div", _hoisted_2$d, [
9270
9426
  createVNode(_component_Checkboard)
9271
9427
  ]),
9272
9428
  createElementVNode(
@@ -10369,12 +10525,12 @@ var script$3 = {
10369
10525
  // }
10370
10526
  }
10371
10527
  };
10372
- const _hoisted_1$l = { class: "vc-editable-input" };
10373
- const _hoisted_2$e = ["aria-labelledby"];
10528
+ const _hoisted_1$k = { class: "vc-editable-input" };
10529
+ const _hoisted_2$c = ["aria-labelledby"];
10374
10530
  const _hoisted_3$a = ["id", "for"];
10375
10531
  const _hoisted_4$8 = { class: "vc-input__desc" };
10376
10532
  function render$3(_ctx, _cache, $props, $setup, $data, $options) {
10377
- return openBlock(), createElementBlock("div", _hoisted_1$l, [
10533
+ return openBlock(), createElementBlock("div", _hoisted_1$k, [
10378
10534
  withDirectives(createElementVNode("input", {
10379
10535
  ref: "input",
10380
10536
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $options.val = $event),
@@ -10382,7 +10538,7 @@ function render$3(_ctx, _cache, $props, $setup, $data, $options) {
10382
10538
  class: "vc-input__input",
10383
10539
  onKeydown: _cache[1] || (_cache[1] = (...args) => $options.handleKeyDown && $options.handleKeyDown(...args)),
10384
10540
  onInput: _cache[2] || (_cache[2] = (...args) => $options.update && $options.update(...args))
10385
- }, null, 40, _hoisted_2$e), [
10541
+ }, null, 40, _hoisted_2$c), [
10386
10542
  [vModelText, $options.val]
10387
10543
  ]),
10388
10544
  createElementVNode("span", {
@@ -10469,14 +10625,14 @@ var script$2 = {
10469
10625
  }
10470
10626
  }
10471
10627
  };
10472
- const _hoisted_1$k = /* @__PURE__ */ createElementVNode(
10628
+ const _hoisted_1$j = /* @__PURE__ */ createElementVNode(
10473
10629
  "div",
10474
10630
  { class: "vc-saturation--white" },
10475
10631
  null,
10476
10632
  -1
10477
10633
  /* HOISTED */
10478
10634
  );
10479
- const _hoisted_2$d = /* @__PURE__ */ createElementVNode(
10635
+ const _hoisted_2$b = /* @__PURE__ */ createElementVNode(
10480
10636
  "div",
10481
10637
  { class: "vc-saturation--black" },
10482
10638
  null,
@@ -10505,8 +10661,8 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
10505
10661
  onTouchstart: _cache[2] || (_cache[2] = (...args) => $options.handleChange && $options.handleChange(...args))
10506
10662
  },
10507
10663
  [
10508
- _hoisted_1$k,
10509
- _hoisted_2$d,
10664
+ _hoisted_1$j,
10665
+ _hoisted_2$b,
10510
10666
  createElementVNode(
10511
10667
  "div",
10512
10668
  {
@@ -10654,8 +10810,8 @@ var script$1 = {
10654
10810
  }
10655
10811
  }
10656
10812
  };
10657
- const _hoisted_1$j = ["aria-valuenow"];
10658
- const _hoisted_2$c = /* @__PURE__ */ createElementVNode(
10813
+ const _hoisted_1$i = ["aria-valuenow"];
10814
+ const _hoisted_2$a = /* @__PURE__ */ createElementVNode(
10659
10815
  "div",
10660
10816
  { class: "vc-hue-picker" },
10661
10817
  null,
@@ -10663,7 +10819,7 @@ const _hoisted_2$c = /* @__PURE__ */ createElementVNode(
10663
10819
  /* HOISTED */
10664
10820
  );
10665
10821
  const _hoisted_3$8 = [
10666
- _hoisted_2$c
10822
+ _hoisted_2$a
10667
10823
  ];
10668
10824
  function render$1(_ctx, _cache, $props, $setup, $data, $options) {
10669
10825
  return openBlock(), createElementBlock(
@@ -10694,7 +10850,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
10694
10850
  4
10695
10851
  /* STYLE */
10696
10852
  )
10697
- ], 40, _hoisted_1$j)
10853
+ ], 40, _hoisted_1$i)
10698
10854
  ],
10699
10855
  2
10700
10856
  /* CLASS */
@@ -10790,21 +10946,21 @@ var script = {
10790
10946
  }
10791
10947
  }
10792
10948
  };
10793
- const _hoisted_1$i = { class: "vc-sketch-saturation-wrap" };
10794
- const _hoisted_2$b = { class: "vc-sketch-controls" };
10949
+ const _hoisted_1$h = { class: "vc-sketch-saturation-wrap" };
10950
+ const _hoisted_2$9 = { class: "vc-sketch-controls" };
10795
10951
  const _hoisted_3$7 = { class: "vc-sketch-sliders" };
10796
10952
  const _hoisted_4$6 = { class: "vc-sketch-hue-wrap" };
10797
- const _hoisted_5$5 = {
10953
+ const _hoisted_5$4 = {
10798
10954
  key: 0,
10799
10955
  class: "vc-sketch-alpha-wrap"
10800
10956
  };
10801
- const _hoisted_6$4 = { class: "vc-sketch-color-wrap" };
10957
+ const _hoisted_6$3 = { class: "vc-sketch-color-wrap" };
10802
10958
  const _hoisted_7$3 = ["aria-label"];
10803
10959
  const _hoisted_8$3 = {
10804
10960
  key: 0,
10805
10961
  class: "vc-sketch-field"
10806
10962
  };
10807
- const _hoisted_9$1 = { class: "vc-sketch-field--double" };
10963
+ const _hoisted_9$3 = { class: "vc-sketch-field--double" };
10808
10964
  const _hoisted_10$1 = { class: "vc-sketch-field--single" };
10809
10965
  const _hoisted_11$1 = { class: "vc-sketch-field--single" };
10810
10966
  const _hoisted_12$1 = { class: "vc-sketch-field--single" };
@@ -10817,8 +10973,8 @@ const _hoisted_14$1 = {
10817
10973
  role: "group",
10818
10974
  "aria-label": "A color preset, pick one to set as current color"
10819
10975
  };
10820
- const _hoisted_15 = ["aria-label", "onClick"];
10821
- const _hoisted_16 = ["aria-label", "onClick"];
10976
+ const _hoisted_15$1 = ["aria-label", "onClick"];
10977
+ const _hoisted_16$1 = ["aria-label", "onClick"];
10822
10978
  function render(_ctx, _cache, $props, $setup, $data, $options) {
10823
10979
  const _component_Saturation = resolveComponent("Saturation");
10824
10980
  const _component_Hue = resolveComponent("Hue");
@@ -10833,13 +10989,13 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
10833
10989
  class: normalizeClass(["vc-sketch", [$props.disableAlpha ? "vc-sketch__disable-alpha" : ""]])
10834
10990
  },
10835
10991
  [
10836
- createElementVNode("div", _hoisted_1$i, [
10992
+ createElementVNode("div", _hoisted_1$h, [
10837
10993
  createVNode(_component_Saturation, {
10838
10994
  value: _ctx.colors,
10839
10995
  onChange: $options.childChange
10840
10996
  }, null, 8, ["value", "onChange"])
10841
10997
  ]),
10842
- createElementVNode("div", _hoisted_2$b, [
10998
+ createElementVNode("div", _hoisted_2$9, [
10843
10999
  createElementVNode("div", _hoisted_3$7, [
10844
11000
  createElementVNode("div", _hoisted_4$6, [
10845
11001
  createVNode(_component_Hue, {
@@ -10847,14 +11003,14 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
10847
11003
  onChange: $options.childChange
10848
11004
  }, null, 8, ["value", "onChange"])
10849
11005
  ]),
10850
- !$props.disableAlpha ? (openBlock(), createElementBlock("div", _hoisted_5$5, [
11006
+ !$props.disableAlpha ? (openBlock(), createElementBlock("div", _hoisted_5$4, [
10851
11007
  createVNode(_component_Alpha, {
10852
11008
  value: _ctx.colors,
10853
11009
  onChange: $options.childChange
10854
11010
  }, null, 8, ["value", "onChange"])
10855
11011
  ])) : createCommentVNode("v-if", true)
10856
11012
  ]),
10857
- createElementVNode("div", _hoisted_6$4, [
11013
+ createElementVNode("div", _hoisted_6$3, [
10858
11014
  createElementVNode("div", {
10859
11015
  "aria-label": `Current color is ${$options.activeColor}`,
10860
11016
  class: "vc-sketch-active-color",
@@ -10865,7 +11021,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
10865
11021
  ]),
10866
11022
  !$props.disableFields ? (openBlock(), createElementBlock("div", _hoisted_8$3, [
10867
11023
  createCommentVNode(" rgba "),
10868
- createElementVNode("div", _hoisted_9$1, [
11024
+ createElementVNode("div", _hoisted_9$3, [
10869
11025
  createVNode(_component_EdIn, {
10870
11026
  label: "hex",
10871
11027
  value: $options.hex,
@@ -10918,14 +11074,14 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
10918
11074
  "aria-label": `Color:${c}`,
10919
11075
  style: normalizeStyle({ background: c }),
10920
11076
  onClick: ($event) => $options.handlePreset(c)
10921
- }, null, 12, _hoisted_15)) : (openBlock(), createElementBlock("div", {
11077
+ }, null, 12, _hoisted_15$1)) : (openBlock(), createElementBlock("div", {
10922
11078
  key: c,
10923
11079
  "aria-label": `Color:${c}`,
10924
11080
  class: "vc-sketch-presets-color",
10925
11081
  onClick: ($event) => $options.handlePreset(c)
10926
11082
  }, [
10927
11083
  createVNode(_component_Checkboard)
10928
- ], 8, _hoisted_16))
11084
+ ], 8, _hoisted_16$1))
10929
11085
  ],
10930
11086
  64
10931
11087
  /* STABLE_FRAGMENT */
@@ -10945,7 +11101,7 @@ styleInject(css_248z);
10945
11101
  script.render = render;
10946
11102
  script.__file = "src/components/sketch/sketch.vue";
10947
11103
  script.install = install;
10948
- const _sfc_main$i = defineComponent({
11104
+ const _sfc_main$h = defineComponent({
10949
11105
  name: "PbColorPicker",
10950
11106
  components: {
10951
11107
  Sketch: script
@@ -10962,7 +11118,14 @@ const _sfc_main$i = defineComponent({
10962
11118
  },
10963
11119
  setup(props, { emit }) {
10964
11120
  const color = ref(props.value);
10965
- const appliedColor = computed(() => color.value);
11121
+ const appliedColor = computed(() => {
11122
+ if (typeof color.value === "string")
11123
+ return color.value;
11124
+ else if (typeof color.value === "object" && color.value.hasOwnProperty("hex"))
11125
+ return color.value.hex;
11126
+ else
11127
+ return;
11128
+ });
10966
11129
  const isShowColorPicker = ref(false);
10967
11130
  const toggle = (value) => {
10968
11131
  isShowColorPicker.value = value !== void 0 ? value : !isShowColorPicker.value;
@@ -10975,18 +11138,17 @@ const _sfc_main$i = defineComponent({
10975
11138
  }
10976
11139
  );
10977
11140
  watch(
10978
- color,
11141
+ () => color.value,
10979
11142
  () => setTimeout(() => {
10980
11143
  if (appliedColor.value)
10981
11144
  emit("change-color", appliedColor.value);
10982
- }),
11145
+ }, 100),
10983
11146
  { deep: true }
10984
11147
  );
10985
11148
  watch(
10986
11149
  () => props.value,
10987
11150
  (value) => {
10988
- if (typeof value === "string")
10989
- color.value = value;
11151
+ color.value = value;
10990
11152
  },
10991
11153
  { deep: true }
10992
11154
  );
@@ -11003,10 +11165,10 @@ const _sfc_main$i = defineComponent({
11003
11165
  };
11004
11166
  }
11005
11167
  });
11006
- const _hoisted_1$h = { class: "buttons" };
11007
- const _hoisted_2$a = /* @__PURE__ */ createElementVNode("i", { class: "material-icons-outlined" }, "delete", -1);
11168
+ const _hoisted_1$g = { class: "buttons" };
11169
+ const _hoisted_2$8 = /* @__PURE__ */ createElementVNode("i", { class: "material-icons-outlined" }, "delete", -1);
11008
11170
  const _hoisted_3$6 = [
11009
- _hoisted_2$a
11171
+ _hoisted_2$8
11010
11172
  ];
11011
11173
  const _hoisted_4$5 = { class: "sketch-wrap" };
11012
11174
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
@@ -11017,7 +11179,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
11017
11179
  onKeydown: _cache[3] || (_cache[3] = withModifiers(() => {
11018
11180
  }, ["stop"]))
11019
11181
  }, [
11020
- createElementVNode("div", _hoisted_1$h, [
11182
+ createElementVNode("div", _hoisted_1$g, [
11021
11183
  renderSlot(_ctx.$slots, "button", normalizeProps(guardReactiveProps({ toggle: _ctx.toggle, color: _ctx.color })), () => [
11022
11184
  createElementVNode("button", {
11023
11185
  class: normalizeClass([{ none: !_ctx.color }, "pb-button picker-button"]),
@@ -11043,15 +11205,15 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
11043
11205
  [_directive_click_outside, () => _ctx.toggle(false)]
11044
11206
  ]);
11045
11207
  }
11046
- const PbColorPicker = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render]]);
11047
- const _hoisted_1$g = { class: "group-editor group-editor-background" };
11048
- const _hoisted_2$9 = { class: "flex-align-center" };
11049
- const _hoisted_3$5 = /* @__PURE__ */ createElementVNode("div", { class: "label" }, [
11050
- /* @__PURE__ */ createElementVNode("label", null, "Background")
11208
+ const PbColorPicker = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render]]);
11209
+ const _hoisted_1$f = { class: "group-editor group-editor-background" };
11210
+ const _hoisted_2$7 = { class: "flex-align-center" };
11211
+ const _hoisted_3$5 = /* @__PURE__ */ createElementVNode("div", { class: "title" }, [
11212
+ /* @__PURE__ */ createElementVNode("label", { textContent: "Background" })
11051
11213
  ], -1);
11052
11214
  const _hoisted_4$4 = { class: "bs-layout-horizontal" };
11053
- const _hoisted_5$4 = { class: "color" };
11054
- const _sfc_main$h = /* @__PURE__ */ defineComponent({
11215
+ const _hoisted_5$3 = { class: "color" };
11216
+ const _sfc_main$g = /* @__PURE__ */ defineComponent({
11055
11217
  __name: "PbPropertyGroupEditorBackground",
11056
11218
  props: {
11057
11219
  group: {},
@@ -11060,7 +11222,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
11060
11222
  setup(__props) {
11061
11223
  const props = __props;
11062
11224
  const pageBuilder = usePageBuilderEditor();
11063
- useModal();
11225
+ const modal = useModal();
11064
11226
  const color = computed(() => getPropertyValueOfParts(props.selectedParts, "backgroundColor"));
11065
11227
  const emptyColor = () => {
11066
11228
  };
@@ -11074,19 +11236,19 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
11074
11236
  };
11075
11237
  const updateColor = (value) => updatePropertyValue({ backgroundColor: value });
11076
11238
  const selectImage = () => {
11077
- PageBuilderEditorEvent.emit.requestImage({
11078
- pageBuilderId: pageBuilder.instanceId,
11079
- callback: (url) => {
11239
+ const imageProvider = pageBuilder.getProvider("imageProvider");
11240
+ if (imageProvider) {
11241
+ imageProvider({ modal }, (url) => {
11080
11242
  updatePropertyValue({ backgroundImage: url });
11081
- }
11082
- });
11243
+ });
11244
+ }
11083
11245
  };
11084
11246
  return (_ctx, _cache) => {
11085
- return openBlock(), createElementBlock("div", _hoisted_1$g, [
11086
- createElementVNode("div", _hoisted_2$9, [
11247
+ return openBlock(), createElementBlock("div", _hoisted_1$f, [
11248
+ createElementVNode("div", _hoisted_2$7, [
11087
11249
  _hoisted_3$5,
11088
11250
  createElementVNode("div", _hoisted_4$4, [
11089
- createElementVNode("div", _hoisted_5$4, [
11251
+ createElementVNode("div", _hoisted_5$3, [
11090
11252
  createVNode(PbColorPicker, {
11091
11253
  value: color.value,
11092
11254
  "hide-delete": "",
@@ -11111,23 +11273,44 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
11111
11273
  };
11112
11274
  }
11113
11275
  });
11114
- const _hoisted_1$f = { class: "group-editor group-editor-border" };
11115
- const _hoisted_2$8 = { class: "flex-align-center" };
11116
- const _hoisted_3$4 = /* @__PURE__ */ createElementVNode("div", { class: "label" }, [
11117
- /* @__PURE__ */ createElementVNode("label", null, "Border")
11276
+ const TopLeftCornerIcon = "data:image/svg+xml,%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Transformed%20by:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20width='800px'%20height='800px'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23000000'%20transform='rotate(270)'%3e%3cg%20id='SVGRepo_bgCarrier'%20stroke-width='0'/%3e%3cg%20id='SVGRepo_tracerCarrier'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cg%20id='SVGRepo_iconCarrier'%3e%3cg%3e%3cpath%20fill='none'%20d='M0%200H24V24H0z'/%3e%3cpath%20d='M21%2019v2h-2v-2h2zm-4%200v2h-2v-2h2zm-4%200v2h-2v-2h2zm-4%200v2H7v-2h2zm-4%200v2H3v-2h2zm16-4v2h-2v-2h2zM5%2015v2H3v-2h2zm0-4v2H3v-2h2zm11-8c2.687%200%204.882%202.124%204.995%204.783L21%208v5h-2V8c0-1.591-1.255-2.903-2.824-2.995L16%205h-5V3h5zM5%207v2H3V7h2zm0-4v2H3V3h2zm4%200v2H7V3h2z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e";
11277
+ const TopRightCornerIcon = "data:image/svg+xml,%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Transformed%20by:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20width='800px'%20height='800px'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23000000'%3e%3cg%20id='SVGRepo_bgCarrier'%20stroke-width='0'/%3e%3cg%20id='SVGRepo_tracerCarrier'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cg%20id='SVGRepo_iconCarrier'%3e%3cg%3e%3cpath%20fill='none'%20d='M0%200H24V24H0z'/%3e%3cpath%20d='M21%2019v2h-2v-2h2zm-4%200v2h-2v-2h2zm-4%200v2h-2v-2h2zm-4%200v2H7v-2h2zm-4%200v2H3v-2h2zm16-4v2h-2v-2h2zM5%2015v2H3v-2h2zm0-4v2H3v-2h2zm11-8c2.687%200%204.882%202.124%204.995%204.783L21%208v5h-2V8c0-1.591-1.255-2.903-2.824-2.995L16%205h-5V3h5zM5%207v2H3V7h2zm0-4v2H3V3h2zm4%200v2H7V3h2z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e";
11278
+ const BottomLeftCornerIcon = "data:image/svg+xml,%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Transformed%20by:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20width='800px'%20height='800px'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23000000'%20transform='rotate(180)'%3e%3cg%20id='SVGRepo_bgCarrier'%20stroke-width='0'/%3e%3cg%20id='SVGRepo_tracerCarrier'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cg%20id='SVGRepo_iconCarrier'%3e%3cg%3e%3cpath%20fill='none'%20d='M0%200H24V24H0z'/%3e%3cpath%20d='M21%2019v2h-2v-2h2zm-4%200v2h-2v-2h2zm-4%200v2h-2v-2h2zm-4%200v2H7v-2h2zm-4%200v2H3v-2h2zm16-4v2h-2v-2h2zM5%2015v2H3v-2h2zm0-4v2H3v-2h2zm11-8c2.687%200%204.882%202.124%204.995%204.783L21%208v5h-2V8c0-1.591-1.255-2.903-2.824-2.995L16%205h-5V3h5zM5%207v2H3V7h2zm0-4v2H3V3h2zm4%200v2H7V3h2z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e";
11279
+ const BottomRightCornerIcon = "data:image/svg+xml,%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Transformed%20by:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20width='800px'%20height='800px'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23000000'%20transform='rotate(90)'%3e%3cg%20id='SVGRepo_bgCarrier'%20stroke-width='0'/%3e%3cg%20id='SVGRepo_tracerCarrier'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cg%20id='SVGRepo_iconCarrier'%3e%3cg%3e%3cpath%20fill='none'%20d='M0%200H24V24H0z'/%3e%3cpath%20d='M21%2019v2h-2v-2h2zm-4%200v2h-2v-2h2zm-4%200v2h-2v-2h2zm-4%200v2H7v-2h2zm-4%200v2H3v-2h2zm16-4v2h-2v-2h2zM5%2015v2H3v-2h2zm0-4v2H3v-2h2zm11-8c2.687%200%204.882%202.124%204.995%204.783L21%208v5h-2V8c0-1.591-1.255-2.903-2.824-2.995L16%205h-5V3h5zM5%207v2H3V7h2zm0-4v2H3V3h2zm4%200v2H7V3h2z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e";
11280
+ const _hoisted_1$e = { class: "group-editor group-editor-border" };
11281
+ const _hoisted_2$6 = { class: "flex-align-center" };
11282
+ const _hoisted_3$4 = /* @__PURE__ */ createElementVNode("div", { class: "title" }, [
11283
+ /* @__PURE__ */ createElementVNode("label", { textContent: "Border" })
11118
11284
  ], -1);
11119
- const _hoisted_4$3 = { class: "color" };
11120
- const _hoisted_5$3 = { class: "bs-layout-horizontal mt-8" };
11121
- const _hoisted_6$3 = /* @__PURE__ */ createElementVNode("span", null, "WL", -1);
11122
- const _hoisted_7$2 = /* @__PURE__ */ createElementVNode("span", { class: "ml-8" }, "WR", -1);
11123
- const _hoisted_8$2 = /* @__PURE__ */ createElementVNode("span", { class: "ml-8" }, "WT", -1);
11124
- const _hoisted_9 = /* @__PURE__ */ createElementVNode("span", { class: "ml-8" }, "WB", -1);
11125
- const _hoisted_10 = { class: "bs-layout-horizontal mt-8" };
11126
- const _hoisted_11 = /* @__PURE__ */ createElementVNode("span", null, "RTL", -1);
11127
- const _hoisted_12 = /* @__PURE__ */ createElementVNode("span", { class: "ml-8" }, "RTR", -1);
11128
- const _hoisted_13 = /* @__PURE__ */ createElementVNode("span", { class: "ml-8" }, "RBL", -1);
11129
- const _hoisted_14 = /* @__PURE__ */ createElementVNode("span", { class: "ml-8" }, "RBR", -1);
11130
- const _sfc_main$g = /* @__PURE__ */ defineComponent({
11285
+ const _hoisted_4$3 = { class: "" };
11286
+ const _hoisted_5$2 = /* @__PURE__ */ createElementVNode("div", { class: "sub-title" }, [
11287
+ /* @__PURE__ */ createElementVNode("label", { textContent: "Color" })
11288
+ ], -1);
11289
+ const _hoisted_6$2 = { class: "color" };
11290
+ const _hoisted_7$2 = { class: "mt-8" };
11291
+ const _hoisted_8$2 = /* @__PURE__ */ createElementVNode("div", { class: "sub-title" }, [
11292
+ /* @__PURE__ */ createElementVNode("label", { textContent: "Border Width" })
11293
+ ], -1);
11294
+ const _hoisted_9$2 = { class: "flex-grow-1 mt-4" };
11295
+ const _hoisted_10 = { class: "bg-gray-100 py-5 rounded-8" };
11296
+ const _hoisted_11 = { class: "text-center" };
11297
+ const _hoisted_12 = { class: "bs-layout-horizontal justify-content-center align-items-center" };
11298
+ const _hoisted_13 = /* @__PURE__ */ createElementVNode("div", {
11299
+ class: "d-inline-block text-center text-gray-300",
11300
+ style: { "width": "30%", "font-size": "12px" }
11301
+ }, [
11302
+ /* @__PURE__ */ createElementVNode("span", { class: "font-icon" }, "add")
11303
+ ], -1);
11304
+ const _hoisted_14 = { class: "text-center" };
11305
+ const _hoisted_15 = { class: "mt-8" };
11306
+ const _hoisted_16 = /* @__PURE__ */ createElementVNode("div", { class: "sub-title" }, [
11307
+ /* @__PURE__ */ createElementVNode("label", { textContent: "Border Radius" })
11308
+ ], -1);
11309
+ const _hoisted_17 = { class: "flex-grow-1 mt-4" };
11310
+ const _hoisted_18 = { class: "bg-gray-100 py-5 rounded-8" };
11311
+ const _hoisted_19 = { class: "" };
11312
+ const _hoisted_20 = { class: "mt-2" };
11313
+ const _sfc_main$f = /* @__PURE__ */ defineComponent({
11131
11314
  __name: "PbPropertyGroupEditorBorder",
11132
11315
  props: {
11133
11316
  group: {},
@@ -11140,7 +11323,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
11140
11323
  const emptyColor = () => {
11141
11324
  };
11142
11325
  const borderLeftWidth = computed(() => getPropertyValueOfParts(props.selectedParts, "borderLeftWidth"));
11143
- const borderRightWidth = computed(() => getPropertyValueOfParts(props.selectedParts, "borderRigthWidth"));
11326
+ const borderRightWidth = computed(() => getPropertyValueOfParts(props.selectedParts, "borderRightWidth"));
11144
11327
  const borderTopWidth = computed(() => getPropertyValueOfParts(props.selectedParts, "borderTopWidth"));
11145
11328
  const borderBottomWidth = computed(() => getPropertyValueOfParts(props.selectedParts, "borderBottomWidth"));
11146
11329
  const borderTopLeftRadius = computed(() => getPropertyValueOfParts(props.selectedParts, "borderTopLeftRadius"));
@@ -11165,87 +11348,108 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
11165
11348
  const updateBorderBottomLeftRadius = (value) => updatePropertyValue({ borderBottomLeftRadius: value });
11166
11349
  const updateBorderBottomRightRadius = (value) => updatePropertyValue({ borderBottomRightRadius: value });
11167
11350
  return (_ctx, _cache) => {
11168
- return openBlock(), createElementBlock("div", _hoisted_1$f, [
11169
- createElementVNode("div", _hoisted_2$8, [
11351
+ return openBlock(), createElementBlock("div", _hoisted_1$e, [
11352
+ createElementVNode("div", _hoisted_2$6, [
11170
11353
  _hoisted_3$4,
11171
11354
  createElementVNode("div", _hoisted_4$3, [
11172
- createVNode(PbColorPicker, {
11173
- value: color.value,
11174
- "hide-delete": "",
11175
- onEmpty: _cache[0] || (_cache[0] = ($event) => emptyColor()),
11176
- onHide: _cache[1] || (_cache[1] = ($event) => updateColor($event)),
11177
- onShow: saveOriginalColor,
11178
- onChangeColor: _cache[2] || (_cache[2] = ($event) => updateColor($event))
11179
- }, null, 8, ["value"]),
11180
- createVNode(unref(BSTextInput), {
11181
- "model-value": color.value,
11182
- class: "ml-4",
11183
- width: "",
11184
- "onUpdate:modelValue": updateColor
11185
- }, null, 8, ["model-value"])
11186
- ]),
11187
- createElementVNode("div", _hoisted_5$3, [
11188
- createElementVNode("div", null, [
11189
- _hoisted_6$3,
11190
- createVNode(unref(BSTextInput), {
11191
- "model-value": borderLeftWidth.value,
11192
- class: "ml-4",
11193
- width: "3em",
11194
- "onUpdate:modelValue": updateBorderLeftWidth
11195
- }, null, 8, ["model-value"]),
11196
- _hoisted_7$2,
11197
- createVNode(unref(BSTextInput), {
11198
- "model-value": borderRightWidth.value,
11199
- class: "ml-4",
11200
- width: "3em",
11201
- "onUpdate:modelValue": updateBorderRightWidth
11202
- }, null, 8, ["model-value"]),
11203
- _hoisted_8$2,
11204
- createVNode(unref(BSTextInput), {
11205
- "model-value": borderTopWidth.value,
11206
- class: "ml-4",
11207
- width: "3em",
11208
- "onUpdate:modelValue": updateBorderTopWidth
11209
- }, null, 8, ["model-value"]),
11210
- _hoisted_9,
11355
+ _hoisted_5$2,
11356
+ createElementVNode("div", _hoisted_6$2, [
11357
+ createVNode(PbColorPicker, {
11358
+ value: color.value,
11359
+ "hide-delete": "",
11360
+ onEmpty: _cache[0] || (_cache[0] = ($event) => emptyColor()),
11361
+ onHide: _cache[1] || (_cache[1] = ($event) => updateColor($event)),
11362
+ onShow: saveOriginalColor,
11363
+ onChangeColor: _cache[2] || (_cache[2] = ($event) => updateColor($event))
11364
+ }, null, 8, ["value"]),
11211
11365
  createVNode(unref(BSTextInput), {
11212
- "model-value": borderBottomWidth.value,
11366
+ "model-value": color.value,
11367
+ prefix: { type: "font-icon", value: "palette" },
11213
11368
  class: "ml-4",
11214
- width: "3em",
11215
- "onUpdate:modelValue": updateBorderBottomWidth
11369
+ width: "",
11370
+ "onUpdate:modelValue": updateColor
11216
11371
  }, null, 8, ["model-value"])
11217
11372
  ])
11218
11373
  ]),
11219
- createElementVNode("div", _hoisted_10, [
11220
- createElementVNode("div", null, [
11221
- _hoisted_11,
11222
- createVNode(unref(BSTextInput), {
11223
- "model-value": borderTopLeftRadius.value,
11224
- class: "ml-4",
11225
- width: "3em",
11226
- "onUpdate:modelValue": updateBorderTopLeftRadius
11227
- }, null, 8, ["model-value"]),
11228
- _hoisted_12,
11229
- createVNode(unref(BSTextInput), {
11230
- "model-value": borderTopRightRadius.value,
11231
- class: "ml-4",
11232
- width: "3em",
11233
- "onUpdate:modelValue": updateBorderTopRightRadius
11234
- }, null, 8, ["model-value"]),
11235
- _hoisted_13,
11236
- createVNode(unref(BSTextInput), {
11237
- "model-value": borderBottomLeftRadius.value,
11238
- class: "ml-4",
11239
- width: "3em",
11240
- "onUpdate:modelValue": updateBorderBottomLeftRadius
11241
- }, null, 8, ["model-value"]),
11242
- _hoisted_14,
11243
- createVNode(unref(BSTextInput), {
11244
- "model-value": borderBottomRightRadius.value,
11245
- class: "ml-4",
11246
- width: "3em",
11247
- "onUpdate:modelValue": updateBorderBottomRightRadius
11248
- }, null, 8, ["model-value"])
11374
+ createElementVNode("div", _hoisted_7$2, [
11375
+ _hoisted_8$2,
11376
+ createElementVNode("div", _hoisted_9$2, [
11377
+ createElementVNode("div", _hoisted_10, [
11378
+ createElementVNode("div", _hoisted_11, [
11379
+ createVNode(unref(BSTextInput), {
11380
+ "model-value": borderTopWidth.value,
11381
+ class: "ml-4",
11382
+ prefix: "T",
11383
+ width: "30%",
11384
+ "onUpdate:modelValue": updateBorderTopWidth
11385
+ }, null, 8, ["model-value"])
11386
+ ]),
11387
+ createElementVNode("div", _hoisted_12, [
11388
+ createVNode(unref(BSTextInput), {
11389
+ "model-value": borderLeftWidth.value,
11390
+ class: "ml-4",
11391
+ prefix: "L",
11392
+ width: "30%",
11393
+ "onUpdate:modelValue": updateBorderLeftWidth
11394
+ }, null, 8, ["model-value"]),
11395
+ _hoisted_13,
11396
+ createVNode(unref(BSTextInput), {
11397
+ "model-value": borderRightWidth.value,
11398
+ class: "ml-4",
11399
+ prefix: "R",
11400
+ width: "30%",
11401
+ "onUpdate:modelValue": updateBorderRightWidth
11402
+ }, null, 8, ["model-value"])
11403
+ ]),
11404
+ createElementVNode("div", _hoisted_14, [
11405
+ createVNode(unref(BSTextInput), {
11406
+ "model-value": borderBottomWidth.value,
11407
+ class: "ml-4",
11408
+ prefix: "B",
11409
+ width: "30%",
11410
+ "onUpdate:modelValue": updateBorderBottomWidth
11411
+ }, null, 8, ["model-value"])
11412
+ ])
11413
+ ])
11414
+ ])
11415
+ ]),
11416
+ createElementVNode("div", _hoisted_15, [
11417
+ _hoisted_16,
11418
+ createElementVNode("div", _hoisted_17, [
11419
+ createElementVNode("div", _hoisted_18, [
11420
+ createElementVNode("div", _hoisted_19, [
11421
+ createVNode(unref(BSTextInput), {
11422
+ "model-value": borderTopLeftRadius.value,
11423
+ prefix: { type: "image-url", value: unref(TopLeftCornerIcon) },
11424
+ class: "ml-4",
11425
+ width: "48%",
11426
+ "onUpdate:modelValue": updateBorderTopLeftRadius
11427
+ }, null, 8, ["model-value", "prefix"]),
11428
+ createVNode(unref(BSTextInput), {
11429
+ "model-value": borderTopRightRadius.value,
11430
+ prefix: { type: "image-url", value: unref(TopRightCornerIcon) },
11431
+ class: "ml-4",
11432
+ width: "48%",
11433
+ "onUpdate:modelValue": updateBorderTopRightRadius
11434
+ }, null, 8, ["model-value", "prefix"])
11435
+ ]),
11436
+ createElementVNode("div", _hoisted_20, [
11437
+ createVNode(unref(BSTextInput), {
11438
+ "model-value": borderBottomLeftRadius.value,
11439
+ prefix: { type: "image-url", value: unref(BottomLeftCornerIcon) },
11440
+ class: "ml-4",
11441
+ width: "48%",
11442
+ "onUpdate:modelValue": updateBorderBottomLeftRadius
11443
+ }, null, 8, ["model-value", "prefix"]),
11444
+ createVNode(unref(BSTextInput), {
11445
+ "model-value": borderBottomRightRadius.value,
11446
+ prefix: { type: "image-url", value: unref(BottomRightCornerIcon) },
11447
+ class: "ml-4",
11448
+ width: "48%",
11449
+ "onUpdate:modelValue": updateBorderBottomRightRadius
11450
+ }, null, 8, ["model-value", "prefix"])
11451
+ ])
11452
+ ])
11249
11453
  ])
11250
11454
  ])
11251
11455
  ])
@@ -11253,17 +11457,23 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
11253
11457
  };
11254
11458
  }
11255
11459
  });
11256
- const _hoisted_1$e = { class: "group-editor group-editor-margin" };
11257
- const _hoisted_2$7 = { class: "flex-align-center" };
11258
- const _hoisted_3$3 = /* @__PURE__ */ createElementVNode("div", { class: "label" }, [
11259
- /* @__PURE__ */ createElementVNode("label", null, "Margin")
11460
+ const _hoisted_1$d = { class: "group-editor group-editor-margin" };
11461
+ const _hoisted_2$5 = { class: "flex-align-center" };
11462
+ const _hoisted_3$3 = /* @__PURE__ */ createElementVNode("div", { class: "title" }, [
11463
+ /* @__PURE__ */ createElementVNode("label", { textContent: "Margin" })
11260
11464
  ], -1);
11261
11465
  const _hoisted_4$2 = { class: "flex-grow-1" };
11262
- const _hoisted_5$2 = /* @__PURE__ */ createElementVNode("span", null, "L", -1);
11263
- const _hoisted_6$2 = /* @__PURE__ */ createElementVNode("span", { class: "ml-8" }, "R", -1);
11264
- const _hoisted_7$1 = /* @__PURE__ */ createElementVNode("span", { class: "ml-8" }, "T", -1);
11265
- const _hoisted_8$1 = /* @__PURE__ */ createElementVNode("span", { class: "ml-8" }, "B", -1);
11266
- const _sfc_main$f = /* @__PURE__ */ defineComponent({
11466
+ const _hoisted_5$1 = { class: "bg-gray-100 py-5 rounded-8" };
11467
+ const _hoisted_6$1 = { class: "text-center" };
11468
+ const _hoisted_7$1 = { class: "bs-layout-horizontal justify-content-center align-items-center" };
11469
+ const _hoisted_8$1 = /* @__PURE__ */ createElementVNode("div", {
11470
+ class: "d-inline-block text-center text-gray-300",
11471
+ style: { "width": "30%", "font-size": "12px" }
11472
+ }, [
11473
+ /* @__PURE__ */ createElementVNode("span", { class: "font-icon" }, "add")
11474
+ ], -1);
11475
+ const _hoisted_9$1 = { class: "text-center" };
11476
+ const _sfc_main$e = /* @__PURE__ */ defineComponent({
11267
11477
  __name: "PbPropertyGroupEditorMargin",
11268
11478
  props: {
11269
11479
  group: {},
@@ -11287,39 +11497,46 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
11287
11497
  const updateTop = (value) => updatePropertyValue({ marginTop: value });
11288
11498
  const updateBottom = (value) => updatePropertyValue({ marginBottom: value });
11289
11499
  return (_ctx, _cache) => {
11290
- return openBlock(), createElementBlock("div", _hoisted_1$e, [
11291
- createElementVNode("div", _hoisted_2$7, [
11500
+ return openBlock(), createElementBlock("div", _hoisted_1$d, [
11501
+ createElementVNode("div", _hoisted_2$5, [
11292
11502
  _hoisted_3$3,
11293
11503
  createElementVNode("div", _hoisted_4$2, [
11294
- createElementVNode("div", null, [
11295
- _hoisted_5$2,
11296
- createVNode(unref(BSTextInput), {
11297
- "model-value": left.value,
11298
- class: "ml-4",
11299
- width: "4em",
11300
- "onUpdate:modelValue": updateLeft
11301
- }, null, 8, ["model-value"]),
11302
- _hoisted_6$2,
11303
- createVNode(unref(BSTextInput), {
11304
- "model-value": right.value,
11305
- class: "ml-4",
11306
- width: "4em",
11307
- "onUpdate:modelValue": updateRight
11308
- }, null, 8, ["model-value"]),
11309
- _hoisted_7$1,
11310
- createVNode(unref(BSTextInput), {
11311
- "model-value": top.value,
11312
- class: "ml-4",
11313
- width: "4em",
11314
- "onUpdate:modelValue": updateTop
11315
- }, null, 8, ["model-value"]),
11316
- _hoisted_8$1,
11317
- createVNode(unref(BSTextInput), {
11318
- "model-value": bottom.value,
11319
- class: "ml-4",
11320
- width: "4em",
11321
- "onUpdate:modelValue": updateBottom
11322
- }, null, 8, ["model-value"])
11504
+ createElementVNode("div", _hoisted_5$1, [
11505
+ createElementVNode("div", _hoisted_6$1, [
11506
+ createVNode(unref(BSTextInput), {
11507
+ "model-value": top.value,
11508
+ class: "ml-4",
11509
+ prefix: "T",
11510
+ width: "30%",
11511
+ "onUpdate:modelValue": updateTop
11512
+ }, null, 8, ["model-value"])
11513
+ ]),
11514
+ createElementVNode("div", _hoisted_7$1, [
11515
+ createVNode(unref(BSTextInput), {
11516
+ "model-value": left.value,
11517
+ class: "ml-4",
11518
+ prefix: "L",
11519
+ width: "30%",
11520
+ "onUpdate:modelValue": updateLeft
11521
+ }, null, 8, ["model-value"]),
11522
+ _hoisted_8$1,
11523
+ createVNode(unref(BSTextInput), {
11524
+ "model-value": right.value,
11525
+ class: "ml-4",
11526
+ prefix: "R",
11527
+ width: "30%",
11528
+ "onUpdate:modelValue": updateRight
11529
+ }, null, 8, ["model-value"])
11530
+ ]),
11531
+ createElementVNode("div", _hoisted_9$1, [
11532
+ createVNode(unref(BSTextInput), {
11533
+ "model-value": bottom.value,
11534
+ class: "ml-4",
11535
+ prefix: "B",
11536
+ width: "30%",
11537
+ "onUpdate:modelValue": updateBottom
11538
+ }, null, 8, ["model-value"])
11539
+ ])
11323
11540
  ])
11324
11541
  ])
11325
11542
  ])
@@ -11327,17 +11544,23 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
11327
11544
  };
11328
11545
  }
11329
11546
  });
11330
- const _hoisted_1$d = { class: "group-editor group-editor-margin" };
11331
- const _hoisted_2$6 = { class: "flex-align-center" };
11332
- const _hoisted_3$2 = /* @__PURE__ */ createElementVNode("div", { class: "label" }, [
11333
- /* @__PURE__ */ createElementVNode("label", null, "Padding")
11547
+ const _hoisted_1$c = { class: "group-editor group-editor-padding" };
11548
+ const _hoisted_2$4 = { class: "flex-align-center" };
11549
+ const _hoisted_3$2 = /* @__PURE__ */ createElementVNode("div", { class: "title" }, [
11550
+ /* @__PURE__ */ createElementVNode("label", { textContent: "Padding" })
11334
11551
  ], -1);
11335
11552
  const _hoisted_4$1 = { class: "flex-grow-1" };
11336
- const _hoisted_5$1 = /* @__PURE__ */ createElementVNode("span", null, "L", -1);
11337
- const _hoisted_6$1 = /* @__PURE__ */ createElementVNode("span", { class: "ml-8" }, "R", -1);
11338
- const _hoisted_7 = /* @__PURE__ */ createElementVNode("span", { class: "ml-8" }, "T", -1);
11339
- const _hoisted_8 = /* @__PURE__ */ createElementVNode("span", { class: "ml-8" }, "B", -1);
11340
- const _sfc_main$e = /* @__PURE__ */ defineComponent({
11553
+ const _hoisted_5 = { class: "bg-gray-100 py-5 rounded-8" };
11554
+ const _hoisted_6 = { class: "text-center" };
11555
+ const _hoisted_7 = { class: "bs-layout-horizontal justify-content-center align-items-center" };
11556
+ const _hoisted_8 = /* @__PURE__ */ createElementVNode("div", {
11557
+ class: "d-inline-block text-center text-gray-300",
11558
+ style: { "width": "30%", "font-size": "12px" }
11559
+ }, [
11560
+ /* @__PURE__ */ createElementVNode("span", { class: "font-icon" }, "add")
11561
+ ], -1);
11562
+ const _hoisted_9 = { class: "text-center" };
11563
+ const _sfc_main$d = /* @__PURE__ */ defineComponent({
11341
11564
  __name: "PbPropertyGroupEditorPadding",
11342
11565
  props: {
11343
11566
  group: {},
@@ -11361,39 +11584,46 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
11361
11584
  const updateTop = (value) => updatePropertyValue({ paddingTop: value });
11362
11585
  const updateBottom = (value) => updatePropertyValue({ paddingBottom: value });
11363
11586
  return (_ctx, _cache) => {
11364
- return openBlock(), createElementBlock("div", _hoisted_1$d, [
11365
- createElementVNode("div", _hoisted_2$6, [
11587
+ return openBlock(), createElementBlock("div", _hoisted_1$c, [
11588
+ createElementVNode("div", _hoisted_2$4, [
11366
11589
  _hoisted_3$2,
11367
11590
  createElementVNode("div", _hoisted_4$1, [
11368
- createElementVNode("div", null, [
11369
- _hoisted_5$1,
11370
- createVNode(unref(BSTextInput), {
11371
- "model-value": left.value,
11372
- class: "ml-4",
11373
- width: "4em",
11374
- "onUpdate:modelValue": updateLeft
11375
- }, null, 8, ["model-value"]),
11376
- _hoisted_6$1,
11377
- createVNode(unref(BSTextInput), {
11378
- "model-value": right.value,
11379
- class: "ml-4",
11380
- width: "4em",
11381
- "onUpdate:modelValue": updateRight
11382
- }, null, 8, ["model-value"]),
11383
- _hoisted_7,
11384
- createVNode(unref(BSTextInput), {
11385
- "model-value": top.value,
11386
- class: "ml-4",
11387
- width: "4em",
11388
- "onUpdate:modelValue": updateTop
11389
- }, null, 8, ["model-value"]),
11390
- _hoisted_8,
11391
- createVNode(unref(BSTextInput), {
11392
- "model-value": bottom.value,
11393
- class: "ml-4",
11394
- width: "4em",
11395
- "onUpdate:modelValue": updateBottom
11396
- }, null, 8, ["model-value"])
11591
+ createElementVNode("div", _hoisted_5, [
11592
+ createElementVNode("div", _hoisted_6, [
11593
+ createVNode(unref(BSTextInput), {
11594
+ "model-value": top.value,
11595
+ class: "ml-4",
11596
+ prefix: "T",
11597
+ width: "30%",
11598
+ "onUpdate:modelValue": updateTop
11599
+ }, null, 8, ["model-value"])
11600
+ ]),
11601
+ createElementVNode("div", _hoisted_7, [
11602
+ createVNode(unref(BSTextInput), {
11603
+ "model-value": left.value,
11604
+ class: "ml-4",
11605
+ prefix: "L",
11606
+ width: "30%",
11607
+ "onUpdate:modelValue": updateLeft
11608
+ }, null, 8, ["model-value"]),
11609
+ _hoisted_8,
11610
+ createVNode(unref(BSTextInput), {
11611
+ "model-value": right.value,
11612
+ class: "ml-4",
11613
+ prefix: "R",
11614
+ width: "30%",
11615
+ "onUpdate:modelValue": updateRight
11616
+ }, null, 8, ["model-value"])
11617
+ ]),
11618
+ createElementVNode("div", _hoisted_9, [
11619
+ createVNode(unref(BSTextInput), {
11620
+ "model-value": bottom.value,
11621
+ class: "ml-4",
11622
+ prefix: "B",
11623
+ width: "30%",
11624
+ "onUpdate:modelValue": updateBottom
11625
+ }, null, 8, ["model-value"])
11626
+ ])
11397
11627
  ])
11398
11628
  ])
11399
11629
  ])
@@ -11427,7 +11657,7 @@ const positionGroup = () => {
11427
11657
  propertyType: "text"
11428
11658
  }
11429
11659
  ],
11430
- propertyGroupEditor: () => _sfc_main$k
11660
+ propertyGroupEditor: () => _sfc_main$j
11431
11661
  };
11432
11662
  };
11433
11663
  const sizeGroup = () => {
@@ -11466,7 +11696,7 @@ const sizeGroup = () => {
11466
11696
  propertyType: "text"
11467
11697
  }
11468
11698
  ],
11469
- propertyGroupEditor: () => _sfc_main$j
11699
+ propertyGroupEditor: () => _sfc_main$i
11470
11700
  };
11471
11701
  };
11472
11702
  const marginGroup = () => {
@@ -11495,7 +11725,7 @@ const marginGroup = () => {
11495
11725
  propertyType: "text"
11496
11726
  }
11497
11727
  ],
11498
- propertyGroupEditor: () => _sfc_main$f
11728
+ propertyGroupEditor: () => _sfc_main$e
11499
11729
  };
11500
11730
  };
11501
11731
  const paddingGroup = () => {
@@ -11524,7 +11754,7 @@ const paddingGroup = () => {
11524
11754
  propertyType: "text"
11525
11755
  }
11526
11756
  ],
11527
- propertyGroupEditor: () => _sfc_main$e
11757
+ propertyGroupEditor: () => _sfc_main$d
11528
11758
  };
11529
11759
  };
11530
11760
  const commonGroup = () => {
@@ -11591,7 +11821,7 @@ const backgroundGroup = () => {
11591
11821
  propertyType: "image"
11592
11822
  }
11593
11823
  ],
11594
- propertyGroupEditor: () => _sfc_main$h
11824
+ propertyGroupEditor: () => _sfc_main$g
11595
11825
  };
11596
11826
  };
11597
11827
  const borderGroup = () => {
@@ -11645,7 +11875,7 @@ const borderGroup = () => {
11645
11875
  propertyType: "text"
11646
11876
  }
11647
11877
  ],
11648
- propertyGroupEditor: () => _sfc_main$g
11878
+ propertyGroupEditor: () => _sfc_main$f
11649
11879
  };
11650
11880
  };
11651
11881
  const defaultPropertyGroups = () => {
@@ -11654,51 +11884,21 @@ const defaultPropertyGroups = () => {
11654
11884
  const defaultWidgetPropertyGroups = () => {
11655
11885
  return [positionGroup(), sizeGroup(), marginGroup(), paddingGroup(), borderGroup(), backgroundGroup(), commonGroup()];
11656
11886
  };
11657
- const designParts = [
11887
+ const pageParts = [
11658
11888
  {
11659
- partType: "Section",
11660
- partName: "GlobalDesignPart",
11661
- caption: "Global Design Part",
11889
+ partType: "Page",
11890
+ partName: "Page",
11891
+ caption: "Page",
11892
+ icon: "draft",
11662
11893
  propertyGroups: [
11663
- ...defaultPropertyGroups()
11894
+ paddingGroup(),
11895
+ backgroundGroup(),
11896
+ commonGroup()
11664
11897
  ],
11665
- initialProperties: {
11666
- sectionType: "globalDesignPart",
11667
- direction: "horizontal"
11668
- },
11898
+ initialProperties: {},
11669
11899
  localized: false,
11670
11900
  allowsChild: () => true,
11671
- creator: () => _sfc_main$l
11672
- },
11673
- {
11674
- partType: "Section",
11675
- partName: "LocalDesignPart",
11676
- caption: "Local Design Part",
11677
- propertyGroups: [
11678
- ...defaultPropertyGroups()
11679
- ],
11680
- initialProperties: {
11681
- sectionType: "localDesignPart",
11682
- direction: "horizontal"
11683
- },
11684
- localized: true,
11685
- allowsChild: () => true,
11686
- creator: () => _sfc_main$l
11687
- },
11688
- {
11689
- partType: "Section",
11690
- partName: "LocalMarketingPart",
11691
- caption: "Local Marketing Part",
11692
- propertyGroups: [
11693
- ...defaultPropertyGroups()
11694
- ],
11695
- initialProperties: {
11696
- sectionType: "localMarketingPart",
11697
- direction: "horizontal"
11698
- },
11699
- localized: true,
11700
- allowsChild: () => true,
11701
- creator: () => _sfc_main$l
11901
+ creator: () => _sfc_main$k
11702
11902
  }
11703
11903
  ];
11704
11904
  const sectionParts = [
@@ -11706,6 +11906,7 @@ const sectionParts = [
11706
11906
  partType: "Section",
11707
11907
  partName: "Section",
11708
11908
  caption: "Section",
11909
+ icon: "rectangle",
11709
11910
  propertyGroups: [
11710
11911
  ...defaultPropertyGroups()
11711
11912
  ],
@@ -11714,7 +11915,7 @@ const sectionParts = [
11714
11915
  },
11715
11916
  localized: false,
11716
11917
  allowsChild: () => true,
11717
- creator: () => _sfc_main$l
11918
+ creator: () => _sfc_main$k
11718
11919
  }
11719
11920
  ];
11720
11921
  const blockParts = [
@@ -11722,20 +11923,22 @@ const blockParts = [
11722
11923
  partType: "Block",
11723
11924
  partName: "Block",
11724
11925
  caption: "Block",
11926
+ icon: "space_dashboard",
11725
11927
  propertyGroups: [
11726
11928
  ...defaultPropertyGroups()
11727
11929
  ],
11728
11930
  initialProperties: {},
11729
11931
  localized: false,
11730
11932
  allowsChild: () => true,
11731
- creator: () => _sfc_main$n
11933
+ creator: () => _sfc_main$m
11732
11934
  }
11733
11935
  ];
11734
11936
  const widgets = [
11735
11937
  {
11736
11938
  partType: "Widget",
11737
11939
  partName: "TextWidget",
11738
- caption: "Text Widget",
11940
+ caption: "Text",
11941
+ icon: "insert_text",
11739
11942
  propertyGroups: [
11740
11943
  {
11741
11944
  groupName: "text",
@@ -11746,13 +11949,20 @@ const widgets = [
11746
11949
  caption: "Text",
11747
11950
  propertyType: "multiline-text",
11748
11951
  params: "",
11749
- localized: true
11952
+ localized: true,
11953
+ multiLang: true
11750
11954
  },
11751
11955
  {
11752
11956
  propertyName: "fontSize",
11753
11957
  caption: "Font Size",
11754
11958
  propertyType: "text",
11755
11959
  params: ""
11960
+ },
11961
+ {
11962
+ propertyName: "color",
11963
+ caption: "Font Color",
11964
+ propertyType: "color",
11965
+ params: ""
11756
11966
  }
11757
11967
  ]
11758
11968
  },
@@ -11765,12 +11975,13 @@ const widgets = [
11765
11975
  },
11766
11976
  localized: true,
11767
11977
  allowsChild: () => false,
11768
- creator: () => _sfc_main$3$1
11978
+ creator: () => _sfc_main$5$1
11769
11979
  },
11770
11980
  {
11771
11981
  partType: "Widget",
11772
11982
  partName: "ImageWidget",
11773
- caption: "Image Widget",
11983
+ caption: "Image",
11984
+ icon: "imagesmode",
11774
11985
  propertyGroups: [
11775
11986
  {
11776
11987
  groupName: "image",
@@ -11790,23 +12001,52 @@ const widgets = [
11790
12001
  initialProperties: {},
11791
12002
  localized: true,
11792
12003
  allowsChild: () => false,
12004
+ creator: () => _sfc_main$6$1
12005
+ },
12006
+ {
12007
+ partType: "Widget",
12008
+ partName: "HtmlWidget",
12009
+ caption: "HTML",
12010
+ icon: "code",
12011
+ propertyGroups: [
12012
+ {
12013
+ groupName: "html",
12014
+ caption: "HTML",
12015
+ properties: [
12016
+ {
12017
+ propertyName: "html",
12018
+ caption: "HTML",
12019
+ propertyType: "html",
12020
+ params: "",
12021
+ localized: true,
12022
+ multiLang: true
12023
+ }
12024
+ ]
12025
+ },
12026
+ ...defaultWidgetPropertyGroups()
12027
+ ],
12028
+ initialProperties: {},
12029
+ localized: true,
12030
+ allowsChild: () => false,
11793
12031
  creator: () => _sfc_main$4$1
11794
12032
  },
11795
12033
  {
11796
12034
  partType: "Widget",
11797
- partName: "ProductListWidget",
11798
- caption: "Product List Widget",
12035
+ partName: "IframeWidget",
12036
+ caption: "IFrame",
12037
+ icon: "code",
11799
12038
  propertyGroups: [
11800
12039
  {
11801
- groupName: "productList",
11802
- caption: "Product List",
12040
+ groupName: "iframe",
12041
+ caption: "Iframe",
11803
12042
  properties: [
11804
12043
  {
11805
- propertyName: "product",
11806
- caption: "Product",
11807
- propertyType: "product",
12044
+ propertyName: "url",
12045
+ caption: "URL",
12046
+ propertyType: "text",
11808
12047
  params: "",
11809
- localized: true
12048
+ localized: true,
12049
+ multiLang: true
11810
12050
  }
11811
12051
  ]
11812
12052
  },
@@ -11815,29 +12055,22 @@ const widgets = [
11815
12055
  initialProperties: {},
11816
12056
  localized: true,
11817
12057
  allowsChild: () => false,
11818
- creator: () => _sfc_main$2$1
12058
+ creator: () => _sfc_main$3$1
11819
12059
  }
11820
12060
  ];
11821
12061
  const partDefinitions = {};
11822
- for (let part of designParts) {
12062
+ for (const part of pageParts) {
11823
12063
  partDefinitions[part.partName] = part;
11824
12064
  }
11825
- for (let part of sectionParts) {
12065
+ for (const part of sectionParts) {
11826
12066
  partDefinitions[part.partName] = part;
11827
12067
  }
11828
- for (let part of blockParts) {
12068
+ for (const part of blockParts) {
11829
12069
  partDefinitions[part.partName] = part;
11830
12070
  }
11831
- for (let part of widgets) {
12071
+ for (const part of widgets) {
11832
12072
  partDefinitions[part.partName] = part;
11833
12073
  }
11834
- const designPartDefinitions = [
11835
- {
11836
- groupName: "DesignParts",
11837
- caption: "Design Parts",
11838
- partDefinitions: designParts
11839
- }
11840
- ];
11841
12074
  [
11842
12075
  {
11843
12076
  groupName: "Layout",
@@ -11848,6 +12081,13 @@ const designPartDefinitions = [
11848
12081
  ]
11849
12082
  }
11850
12083
  ];
12084
+ const widgetPartDefinitions = [
12085
+ {
12086
+ groupName: "Widget",
12087
+ caption: "Widget",
12088
+ partDefinitions: widgets
12089
+ }
12090
+ ];
11851
12091
  const blockWidgetPartDefinitions = [
11852
12092
  {
11853
12093
  groupName: "Block",
@@ -11887,19 +12127,6 @@ class CommandRegistryImpl {
11887
12127
  }
11888
12128
  }
11889
12129
  }
11890
- const _OpenAddPartModalCommand = class _OpenAddPartModalCommand {
11891
- constructor(modal) {
11892
- __publicField(this, "commandId", _OpenAddPartModalCommand.COMMAND_ID);
11893
- __publicField(this, "caption", "Add Part");
11894
- this.modal = modal;
11895
- }
11896
- execute(pageBuilder, args) {
11897
- let partDefinitionGroups = designPartDefinitions;
11898
- openPartAddModal(this.modal, { pageBuilder, partDefinitionGroups, ...args || {} });
11899
- }
11900
- };
11901
- __publicField(_OpenAddPartModalCommand, "COMMAND_ID", "OpenAddPartModal");
11902
- let OpenAddPartModalCommand = _OpenAddPartModalCommand;
11903
12130
  const _OpenAddWidgetModalCommand = class _OpenAddWidgetModalCommand {
11904
12131
  constructor(modal) {
11905
12132
  __publicField(this, "commandId", _OpenAddWidgetModalCommand.COMMAND_ID);
@@ -11913,31 +12140,9 @@ const _OpenAddWidgetModalCommand = class _OpenAddWidgetModalCommand {
11913
12140
  };
11914
12141
  __publicField(_OpenAddWidgetModalCommand, "COMMAND_ID", "OpenAddWidgetModal");
11915
12142
  let OpenAddWidgetModalCommand = _OpenAddWidgetModalCommand;
11916
- const openPartAddModal = (modal, args, callback) => {
11917
- modal.openModal({
11918
- component: defineAsyncComponent(() => import("./PbPartAddModal-DuLpnV4E.js")),
11919
- style: {
11920
- width: "80%",
11921
- height: "80%",
11922
- maxWidth: "800px",
11923
- minWidth: "500px",
11924
- maxHeight: "800px"
11925
- },
11926
- bind: args,
11927
- on: {
11928
- selectHandler: (part) => {
11929
- if (callback) {
11930
- callback(part);
11931
- } else {
11932
- addPart(args.pageBuilder, part);
11933
- }
11934
- }
11935
- }
11936
- });
11937
- };
11938
12143
  const openWidgetAddModal = (modal, args, callback) => {
11939
12144
  modal.openModal({
11940
- component: defineAsyncComponent(() => import("./PbWidgetAddModal-CQvFYzfU.js")),
12145
+ component: defineAsyncComponent(() => import("./PbWidgetAddModal-BoYfb0dm.js")),
11941
12146
  style: {
11942
12147
  width: "80%",
11943
12148
  height: "80%",
@@ -11949,12 +12154,12 @@ const openWidgetAddModal = (modal, args, callback) => {
11949
12154
  on: {
11950
12155
  selectHandler: (part) => {
11951
12156
  if (["ImageWidget"].includes(part.partName)) {
11952
- PageBuilderEditorEvent.emit.requestImage({
11953
- pageBuilderId: args.pageBuilder.instanceId,
11954
- callback: (url) => {
12157
+ const imageProvider = args.pageBuilder.getProvider("imageProvider");
12158
+ if (imageProvider) {
12159
+ imageProvider({ modal }, (url) => {
11955
12160
  addPart(args.pageBuilder, part, { image: url });
11956
- }
11957
- });
12161
+ });
12162
+ }
11958
12163
  } else {
11959
12164
  if (callback) {
11960
12165
  callback(part);
@@ -12041,6 +12246,36 @@ const _AddPartCommand = class _AddPartCommand {
12041
12246
  };
12042
12247
  __publicField(_AddPartCommand, "COMMAND_ID", "AddPart");
12043
12248
  let AddPartCommand = _AddPartCommand;
12249
+ const _AddSectionCommand = class _AddSectionCommand {
12250
+ constructor(modal) {
12251
+ __publicField(this, "commandId", _AddSectionCommand.COMMAND_ID);
12252
+ __publicField(this, "caption", "Add Section");
12253
+ this.modal = modal;
12254
+ }
12255
+ execute(pageBuilder, args) {
12256
+ const def = pageBuilder.partManager.getSectionDefinition();
12257
+ if (!def)
12258
+ return;
12259
+ addPart(pageBuilder, def);
12260
+ }
12261
+ };
12262
+ __publicField(_AddSectionCommand, "COMMAND_ID", "AddSection");
12263
+ let AddSectionCommand = _AddSectionCommand;
12264
+ const _AddBlockCommand = class _AddBlockCommand {
12265
+ constructor(modal) {
12266
+ __publicField(this, "commandId", _AddBlockCommand.COMMAND_ID);
12267
+ __publicField(this, "caption", "Add Block");
12268
+ this.modal = modal;
12269
+ }
12270
+ execute(pageBuilder, args) {
12271
+ const def = pageBuilder.partManager.getBlockDefinition();
12272
+ if (!def)
12273
+ return;
12274
+ addPart(pageBuilder, def);
12275
+ }
12276
+ };
12277
+ __publicField(_AddBlockCommand, "COMMAND_ID", "AddBlock");
12278
+ let AddBlockCommand = _AddBlockCommand;
12044
12279
  const addPart = (pageBuilder, def, attrs) => {
12045
12280
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
12046
12281
  const selected = pageBuilder.context.getSelectedParts()[0];
@@ -12129,29 +12364,13 @@ const addPart = (pageBuilder, def, attrs) => {
12129
12364
  }
12130
12365
  };
12131
12366
  const addSectionBefore = (pageBuilder, modal, args) => {
12132
- const def = args && args.partDefinition;
12133
- if (!def) {
12134
- const partDefinitionGroups = designPartDefinitions;
12135
- openPartAddModal(modal, {
12136
- ...args || {},
12137
- pageBuilder,
12138
- partDefinitionGroups
12139
- }, (part, attrs) => {
12140
- addSectionBefore(pageBuilder, modal, {
12141
- ...args || {},
12142
- partDefinition: part,
12143
- ...attrs || {}
12144
- });
12145
- });
12146
- return;
12147
- }
12148
12367
  const selected = pageBuilder.context.getSelectedParts()[0];
12149
12368
  if (!selected)
12150
12369
  return;
12151
12370
  const section = pageBuilder.partManager.findNearestSection(selected);
12152
12371
  if (!section || !section.parent || !section.parent.children)
12153
12372
  return;
12154
- const newSection = createPartWithDefinition(def);
12373
+ const newSection = createSection(pageBuilder);
12155
12374
  if (!newSection)
12156
12375
  return;
12157
12376
  const child = createBlock(pageBuilder);
@@ -12160,29 +12379,13 @@ const addSectionBefore = (pageBuilder, modal, args) => {
12160
12379
  insertParts(pageBuilder, section.parent.partId, index, [newSection], true);
12161
12380
  };
12162
12381
  const addSectionAfter = (pageBuilder, modal, args) => {
12163
- const def = args && args.partDefinition;
12164
- if (!def) {
12165
- const partDefinitionGroups = designPartDefinitions;
12166
- openPartAddModal(modal, {
12167
- ...args || {},
12168
- pageBuilder,
12169
- partDefinitionGroups
12170
- }, (part, attrs) => {
12171
- addSectionAfter(pageBuilder, modal, {
12172
- ...args || {},
12173
- partDefinition: part,
12174
- ...attrs || {}
12175
- });
12176
- });
12177
- return;
12178
- }
12179
12382
  const selected = pageBuilder.context.getSelectedParts()[0];
12180
12383
  if (!selected)
12181
12384
  return;
12182
12385
  const section = pageBuilder.partManager.findNearestSection(selected);
12183
12386
  if (!section || !section.parent || !section.parent.children)
12184
12387
  return;
12185
- const newSection = createPartWithDefinition(def);
12388
+ const newSection = createSection(pageBuilder);
12186
12389
  if (!newSection)
12187
12390
  return;
12188
12391
  const child = createBlock(pageBuilder);
@@ -12305,11 +12508,11 @@ const _AddSectionAboveCommand = class _AddSectionAboveCommand {
12305
12508
  this.modal = modal;
12306
12509
  }
12307
12510
  execute(pageBuilder, args) {
12308
- addSectionBefore(pageBuilder, this.modal, args);
12511
+ addSectionBefore(pageBuilder, this.modal);
12309
12512
  }
12310
12513
  };
12311
12514
  __publicField(_AddSectionAboveCommand, "COMMAND_ID", "AddSectionAbove");
12312
- __publicField(_AddSectionAboveCommand, "CAPTION", "Add Part Above");
12515
+ __publicField(_AddSectionAboveCommand, "CAPTION", "Add Section Above");
12313
12516
  let AddSectionAboveCommand = _AddSectionAboveCommand;
12314
12517
  const _AddSectionBelowCommand = class _AddSectionBelowCommand {
12315
12518
  constructor(modal) {
@@ -12318,11 +12521,11 @@ const _AddSectionBelowCommand = class _AddSectionBelowCommand {
12318
12521
  this.modal = modal;
12319
12522
  }
12320
12523
  execute(pageBuilder, args) {
12321
- addSectionAfter(pageBuilder, this.modal, args);
12524
+ addSectionAfter(pageBuilder, this.modal);
12322
12525
  }
12323
12526
  };
12324
12527
  __publicField(_AddSectionBelowCommand, "COMMAND_ID", "AddSectionBelow");
12325
- __publicField(_AddSectionBelowCommand, "CAPTION", "Add Part Below");
12528
+ __publicField(_AddSectionBelowCommand, "CAPTION", "Add Section Below");
12326
12529
  let AddSectionBelowCommand = _AddSectionBelowCommand;
12327
12530
  const _AddBlockLeftCommand = class _AddBlockLeftCommand {
12328
12531
  constructor() {
@@ -12471,6 +12674,20 @@ const _DeletePartCommand = class _DeletePartCommand {
12471
12674
  __publicField(_DeletePartCommand, "COMMAND_ID", "DeletePart");
12472
12675
  __publicField(_DeletePartCommand, "CAPTION", "Delete");
12473
12676
  let DeletePartCommand = _DeletePartCommand;
12677
+ const _CopyAllCommand = class _CopyAllCommand {
12678
+ constructor() {
12679
+ __publicField(this, "commandId", _CopyAllCommand.COMMAND_ID);
12680
+ }
12681
+ async execute(pageBuilder) {
12682
+ const json = pageBuilder.model.serializeModel(
12683
+ (part) => pageBuilder.extractMedia(part),
12684
+ (partObject) => pageBuilder.extractProvider(partObject)
12685
+ );
12686
+ await navigator.clipboard.writeText(json);
12687
+ }
12688
+ };
12689
+ __publicField(_CopyAllCommand, "COMMAND_ID", "CopyAll");
12690
+ let CopyAllCommand = _CopyAllCommand;
12474
12691
  const _CopyPartCommand = class _CopyPartCommand {
12475
12692
  constructor() {
12476
12693
  __publicField(this, "commandId", _CopyPartCommand.COMMAND_ID);
@@ -12478,7 +12695,7 @@ const _CopyPartCommand = class _CopyPartCommand {
12478
12695
  async execute(pageBuilder) {
12479
12696
  const partIds = pageBuilder.context.getSelectedParts().map((part) => part.partId);
12480
12697
  if (partIds.length > 0) {
12481
- const json = pageBuilder.model.serializePageModel(partIds);
12698
+ const json = pageBuilder.model.serializeParts(partIds);
12482
12699
  await navigator.clipboard.writeText(json);
12483
12700
  }
12484
12701
  }
@@ -12501,12 +12718,34 @@ const _PastePartCommand = class _PastePartCommand {
12501
12718
  __publicField(this, "commandId", _PastePartCommand.COMMAND_ID);
12502
12719
  }
12503
12720
  async execute(pageBuilder) {
12504
- const { target, index = 0 } = findInsertTargetAndIndex(pageBuilder);
12505
- if (target) {
12506
- const json = await navigator.clipboard.readText();
12507
- const parts = pageBuilder.model.parsePageModel(json);
12508
- if (parts) {
12509
- insertParts(pageBuilder, target.partId, index, parts, false);
12721
+ const json = await navigator.clipboard.readText();
12722
+ const object = JSON.parse(json);
12723
+ if (object.partType === ROOT_TYPE) {
12724
+ const rootPart = partFromJsonObject(object, true);
12725
+ if (!rootPart)
12726
+ throw new Error("Invalid data format");
12727
+ let partIdsToDelete = void 0;
12728
+ if (pageBuilder.model.rootPart.children && pageBuilder.model.rootPart.children.length) {
12729
+ partIdsToDelete = pageBuilder.model.rootPart.children.map((v) => v.partId);
12730
+ }
12731
+ const param = {
12732
+ delete: partIdsToDelete,
12733
+ insert: [
12734
+ {
12735
+ partId: pageBuilder.model.getRootPartId(),
12736
+ index: 0,
12737
+ parts: rootPart.children || []
12738
+ }
12739
+ ]
12740
+ };
12741
+ pageBuilder.model.updateModel(param);
12742
+ } else {
12743
+ const { target, index = 0 } = findInsertTargetAndIndex(pageBuilder);
12744
+ if (target) {
12745
+ const parts = pageBuilder.model.parseParts(json);
12746
+ if (parts) {
12747
+ insertParts(pageBuilder, target.partId, index, parts, false);
12748
+ }
12510
12749
  }
12511
12750
  }
12512
12751
  }
@@ -12527,9 +12766,10 @@ __publicField(_SelectAllPartsCommand, "COMMAND_ID", "SelectAllParts");
12527
12766
  let SelectAllPartsCommand = _SelectAllPartsCommand;
12528
12767
  const createDefaultCommands = (modal) => {
12529
12768
  return [
12530
- new OpenAddPartModalCommand(modal),
12531
12769
  new OpenAddWidgetModalCommand(modal),
12532
12770
  new AddPartCommand(modal),
12771
+ new AddSectionCommand(modal),
12772
+ new AddBlockCommand(modal),
12533
12773
  new AddSectionAboveCommand(modal),
12534
12774
  new AddSectionBelowCommand(modal),
12535
12775
  new AddBlockLeftCommand(),
@@ -12543,6 +12783,7 @@ const createDefaultCommands = (modal) => {
12543
12783
  new AddWidgetInsideCommand(modal),
12544
12784
  new ChangePropertyCommand(),
12545
12785
  new DeletePartCommand(),
12786
+ new CopyAllCommand(),
12546
12787
  new CopyPartCommand(),
12547
12788
  new CutPartCommand(),
12548
12789
  new PastePartCommand(),
@@ -12709,15 +12950,6 @@ const createDefaultContextMenus = () => {
12709
12950
  return enableAddWidgetMenu(pageBuilder, "", AddWidgetInsideCommand.COMMAND_ID, AddWidgetInsideCommand.CAPTION);
12710
12951
  }
12711
12952
  },
12712
- {
12713
- groupId: "core:add",
12714
- commandId: OpenAddPartModalCommand.COMMAND_ID,
12715
- precedence: 10,
12716
- getMenuItem(pageBuilder) {
12717
- if (pageBuilder.context.getSelectionCount() <= 1)
12718
- return menuItemForCommand(pageBuilder, OpenAddPartModalCommand.COMMAND_ID);
12719
- }
12720
- },
12721
12953
  {
12722
12954
  groupId: "core:edit",
12723
12955
  commandId: DeletePartCommand.COMMAND_ID,
@@ -12777,16 +13009,6 @@ const createDefaultKeyHandlers = () => {
12777
13009
  };
12778
13010
  const createDefaultToolButtonGroups = () => {
12779
13011
  const groups = [
12780
- {
12781
- groupId: "file",
12782
- buttons: [
12783
- {
12784
- buttonId: "core:template",
12785
- caption: "Load Template",
12786
- icon: "account_balance"
12787
- }
12788
- ]
12789
- },
12790
13012
  {
12791
13013
  groupId: "edit",
12792
13014
  buttons: [
@@ -12802,6 +13024,12 @@ const createDefaultToolButtonGroups = () => {
12802
13024
  icon: "redo",
12803
13025
  handler: (modeler) => modeler.redo()
12804
13026
  },
13027
+ {
13028
+ buttonId: "core:copyAll",
13029
+ caption: "Copy All",
13030
+ icon: "copy_all",
13031
+ handler: (modeler) => modeler.commandRegistry.executeCommand(CopyAllCommand.COMMAND_ID)
13032
+ },
12805
13033
  {
12806
13034
  buttonId: "core:copy",
12807
13035
  caption: "Copy",
@@ -12832,15 +13060,21 @@ const createDefaultToolButtonGroups = () => {
12832
13060
  groupId: "add",
12833
13061
  buttons: [
12834
13062
  {
12835
- buttonId: "core:openAddPartLayer",
12836
- caption: "Add Design Part...",
12837
- icon: "box_add",
12838
- handler: (modeler) => modeler.commandRegistry.executeCommand(OpenAddPartModalCommand.COMMAND_ID)
13063
+ buttonId: "core:addSection",
13064
+ caption: "Add Section",
13065
+ icon: "add_row_below",
13066
+ handler: (modeler) => modeler.commandRegistry.executeCommand(AddSectionCommand.COMMAND_ID)
12839
13067
  },
12840
13068
  {
12841
- buttonId: "core:openAddWidgetLayer",
12842
- caption: "Add Widget...",
12843
- icon: "add_box",
13069
+ buttonId: "core:addBlock",
13070
+ caption: "Add Block",
13071
+ icon: "add_column_right",
13072
+ handler: (modeler) => modeler.commandRegistry.executeCommand(AddBlockCommand.COMMAND_ID)
13073
+ },
13074
+ {
13075
+ buttonId: "core:addWidget",
13076
+ caption: "Add Widget",
13077
+ icon: "desktop_landscape_add",
12844
13078
  handler: (modeler) => modeler.commandRegistry.executeCommand(OpenAddWidgetModalCommand.COMMAND_ID)
12845
13079
  }
12846
13080
  ]
@@ -12885,7 +13119,11 @@ class PageBuilderContextImpl {
12885
13119
  }
12886
13120
  setSelection(parts) {
12887
13121
  this.selection.splice(0, this.selection.length);
12888
- parts.forEach((part) => this.selection.push(part));
13122
+ if (parts && parts.length) {
13123
+ parts.forEach((part) => this.selection.push(part));
13124
+ } else if (this.model.rootPart.children && this.model.rootPart.children.length) {
13125
+ this.selection.push(this.model.rootPart.children[0]);
13126
+ }
12889
13127
  }
12890
13128
  addSelection(parts) {
12891
13129
  parts.forEach((part) => this.selection.push(part));
@@ -13010,11 +13248,11 @@ class KeyHandlersImpl {
13010
13248
  }
13011
13249
  }
13012
13250
  }
13013
- addDocumentKeyEventListener(document2) {
13014
- document2.addEventListener("keydown", this.handleKeyDownEvent.bind(this));
13251
+ addDocumentKeyEventListener(element) {
13252
+ element.addEventListener("keydown", this.handleKeyDownEvent.bind(this));
13015
13253
  }
13016
- removeDocumentKeyEventListener(document2) {
13017
- document2.removeEventListener("keydown", this.handleKeyDownEvent.bind(this));
13254
+ removeDocumentKeyEventListener(element) {
13255
+ element.removeEventListener("keydown", this.handleKeyDownEvent.bind(this));
13018
13256
  }
13019
13257
  }
13020
13258
  const PAGE_BUILDER_EDITOR_KEY = "PageBuilderEditor";
@@ -13041,14 +13279,56 @@ class PageBuilderEditorImpl {
13041
13279
  __publicField(this, "keyHandlers", new KeyHandlersImpl(this));
13042
13280
  __publicField(this, "toolButtonRegistry", new ToolButtonRegistryImpl());
13043
13281
  __publicField(this, "title");
13044
- __publicField(this, "editMode");
13045
13282
  __publicField(this, "scale", ref(1));
13283
+ __publicField(this, "locale", ref("en"));
13284
+ __publicField(this, "locales", ref(["en"]));
13285
+ __publicField(this, "customWidgets", []);
13286
+ __publicField(this, "watchers", {});
13287
+ __publicField(this, "providers", {});
13046
13288
  this.model = new Model2();
13047
13289
  this.context = new PageBuilderContextImpl(this);
13048
- this.editMode = "free";
13049
13290
  this.scale.value = 1;
13050
13291
  this.initPlugins();
13051
13292
  }
13293
+ getLocale() {
13294
+ return this.locale.value;
13295
+ }
13296
+ setLocale(locale) {
13297
+ this.locale.value = locale || "en";
13298
+ }
13299
+ getLocales() {
13300
+ return this.locales.value;
13301
+ }
13302
+ setLocales(locales) {
13303
+ this.locales.value = locales || ["en"];
13304
+ }
13305
+ getCustomWidgetComponent(part) {
13306
+ const def = this.partManager.getPartDefinition(part.partName);
13307
+ if (def) {
13308
+ return def.component;
13309
+ }
13310
+ }
13311
+ getProvider(name) {
13312
+ return this.providers[name];
13313
+ }
13314
+ watchCustomWidgetData(part) {
13315
+ const def = this.partManager.getPartDefinition(part.partName);
13316
+ if (!def || !def.dataWatcher)
13317
+ return false;
13318
+ const watcher = this.watchers[def.dataWatcher];
13319
+ if (!watcher)
13320
+ return false;
13321
+ return watcher(part.properties);
13322
+ }
13323
+ provideCustomWidgetData(part) {
13324
+ const def = this.partManager.getPartDefinition(part.partName);
13325
+ if (!def || !def.dataProvider)
13326
+ return Promise.resolve();
13327
+ const provider = this.providers[def.dataProvider];
13328
+ if (!provider)
13329
+ return Promise.resolve();
13330
+ return provider(part.properties);
13331
+ }
13052
13332
  registerPlugin(plugin) {
13053
13333
  if (plugin.partDefinitions)
13054
13334
  this.partManager.registerPartDefinitions(plugin.partDefinitions);
@@ -13065,23 +13345,61 @@ class PageBuilderEditorImpl {
13065
13345
  if (plugin.toolButtonGroups)
13066
13346
  this.toolButtonRegistry.registerToolButtonGroups(plugin.toolButtonGroups);
13067
13347
  }
13068
- initData(content) {
13069
- this.model.rootPart.pageBuilderId = this.instanceId;
13070
- let parts;
13071
- if (content) {
13072
- for (const p of content) {
13073
- const page = partFromJsonObject(p, true);
13074
- if (page) {
13075
- if (!parts)
13076
- parts = [];
13077
- parts.push(page);
13348
+ registerCustomPlugin(plugin) {
13349
+ if (plugin.widgets) {
13350
+ const partDefinitions2 = {};
13351
+ plugin.widgets.forEach((v) => {
13352
+ const w = { ...v };
13353
+ w.partType = "Widget";
13354
+ w.creator = () => _sfc_main$p;
13355
+ w.propertyGroups = [...w.propertyGroups, ...defaultWidgetPropertyGroups()];
13356
+ partDefinitions2[v.partName] = w;
13357
+ const found = this.customWidgets.find((x) => x.partName === v.partName);
13358
+ if (!found) {
13359
+ this.customWidgets.push(w);
13078
13360
  }
13079
- }
13361
+ });
13362
+ this.partManager.registerPartDefinitions(partDefinitions2);
13363
+ }
13364
+ if (plugin.watchers) {
13365
+ this.watchers = { ...this.providers, ...plugin.watchers };
13366
+ }
13367
+ if (plugin.providers) {
13368
+ this.providers = { ...this.providers, ...plugin.providers };
13080
13369
  }
13081
- if (!parts) {
13370
+ if (plugin.propertyEditors) {
13371
+ this.partManager.registerPartPropertyEditors(plugin.propertyEditors);
13372
+ }
13373
+ }
13374
+ initData(data) {
13375
+ const _data = JSON.parse(data || "{}") || {};
13376
+ let rootPart = partFromJsonObject(_data, true);
13377
+ if (!rootPart)
13378
+ rootPart = new RootPart();
13379
+ let parts = rootPart.children;
13380
+ if (!parts)
13082
13381
  parts = [this.getEmptyPageContent(), this.getEmptyPageContent()];
13382
+ if (parts.length === 1) {
13383
+ parts[0].properties = {
13384
+ ...parts[0].properties || {},
13385
+ name: "Page"
13386
+ };
13387
+ } else if (parts.length === 2) {
13388
+ parts[0].properties = {
13389
+ ...parts[0].properties || {},
13390
+ name: "Page (Mobile)"
13391
+ };
13392
+ parts[1].properties = {
13393
+ ...parts[0].properties || {},
13394
+ name: "Page (PC)"
13395
+ };
13396
+ }
13397
+ let partIdsToDelete = void 0;
13398
+ if (this.model.rootPart.children && this.model.rootPart.children.length) {
13399
+ partIdsToDelete = this.model.rootPart.children.map((v) => v.partId);
13083
13400
  }
13084
13401
  const param = {
13402
+ delete: partIdsToDelete,
13085
13403
  insert: [
13086
13404
  {
13087
13405
  partId: this.model.getRootPartId(),
@@ -13101,6 +13419,158 @@ class PageBuilderEditorImpl {
13101
13419
  zoom(scale) {
13102
13420
  this.scale.value = scale;
13103
13421
  }
13422
+ makeSingleScreen(screenToKeep) {
13423
+ var _a;
13424
+ if (!this.model.rootPart.children)
13425
+ return;
13426
+ const screenCount = ((_a = this.model.rootPart.children) == null ? void 0 : _a.length) || 0;
13427
+ if (screenCount !== 2)
13428
+ return;
13429
+ const remaining = this.model.rootPart.children[screenToKeep === 0 ? 0 : 1];
13430
+ const deleting = this.model.rootPart.children[screenToKeep === 0 ? 1 : 0];
13431
+ this.model.updateModel({
13432
+ delete: [deleting.partId],
13433
+ update: [
13434
+ {
13435
+ partId: remaining.partId,
13436
+ properties: {
13437
+ name: "Page"
13438
+ }
13439
+ }
13440
+ ]
13441
+ });
13442
+ }
13443
+ makeMultipleScreen() {
13444
+ var _a;
13445
+ if (!this.model.rootPart.children)
13446
+ return;
13447
+ const screenCount = ((_a = this.model.rootPart.children) == null ? void 0 : _a.length) || 0;
13448
+ if (screenCount !== 1)
13449
+ return;
13450
+ const part = this.model.rootPart.children[0];
13451
+ const json = this.model.serializeParts([part.partId]);
13452
+ const copied = this.model.parseParts(json);
13453
+ if (!copied)
13454
+ return;
13455
+ copied[0].properties = {
13456
+ ...copied[0].properties || {},
13457
+ name: "Page (PC)"
13458
+ };
13459
+ this.model.updateModel({
13460
+ insert: [
13461
+ {
13462
+ partId: this.model.rootPart.partId,
13463
+ index: 1,
13464
+ parts: copied
13465
+ }
13466
+ ],
13467
+ update: [
13468
+ {
13469
+ partId: part.partId,
13470
+ properties: {
13471
+ name: "Page (Mobile)"
13472
+ }
13473
+ }
13474
+ ]
13475
+ });
13476
+ }
13477
+ getCustomWidgets() {
13478
+ return this.customWidgets;
13479
+ }
13480
+ extractMedia(part) {
13481
+ const urls = /* @__PURE__ */ new Set();
13482
+ this.extractMediaFromPart(part, urls);
13483
+ return Array.from(urls);
13484
+ }
13485
+ extractProvider(part) {
13486
+ const def = this.partManager.getPartDefinition(part.partName);
13487
+ if (def && (def == null ? void 0 : def.dataProvider)) {
13488
+ part.dataProvider = def.dataProvider;
13489
+ }
13490
+ if (part.children && part.children.length) {
13491
+ for (const child of part.children) {
13492
+ this.extractProvider(child);
13493
+ }
13494
+ }
13495
+ }
13496
+ extractMediaFromPart(part, urls) {
13497
+ if (part.properties) {
13498
+ for (const name in part.properties) {
13499
+ const def = this.partManager.getPropertyDefinition(part.partName, name);
13500
+ if (def && def.propertyType === "image") {
13501
+ const value = part.properties[name];
13502
+ if (value) {
13503
+ urls.add(value);
13504
+ }
13505
+ }
13506
+ }
13507
+ if (part.properties.css) {
13508
+ this.extractMediaFromHtml(part.properties.css, urls);
13509
+ }
13510
+ if (part.partName === "HtmlWidget" && part.properties.html) {
13511
+ for (const locale in part.properties.html) {
13512
+ const html = part.properties.html[locale];
13513
+ if (html.tags)
13514
+ this.extractMediaFromHtml(html.tags, urls);
13515
+ if (html.style)
13516
+ this.extractMediaFromHtml(html.style, urls);
13517
+ }
13518
+ }
13519
+ }
13520
+ if (part.children && part.children.length) {
13521
+ for (const child of part.children) {
13522
+ this.extractMediaFromPart(child, urls);
13523
+ }
13524
+ }
13525
+ }
13526
+ extractMediaFromHtml(html, urls) {
13527
+ const imgSrcMatches = html.match(/<img[^>]+src=["']?([^"'\s>]+)["']?[^>]*>/gi);
13528
+ if (imgSrcMatches) {
13529
+ imgSrcMatches.forEach((match) => {
13530
+ const url = match.match(/src=["']?([^"'\s>]+)["']?/i);
13531
+ if (url && url[1]) {
13532
+ urls.add(url[1]);
13533
+ }
13534
+ });
13535
+ }
13536
+ const sourceSrcsetMatches = html.match(/<source[^>]+srcset=["']?([^"'>]+)["']?[^>]*>/gi);
13537
+ if (sourceSrcsetMatches) {
13538
+ sourceSrcsetMatches.forEach((match) => {
13539
+ const srcset = match.match(/srcset=["']?([^"'>]+)["']?/i);
13540
+ if (srcset && srcset[1]) {
13541
+ const _urls = srcset[1].split(",").map((item) => item.trim().split(/\s+/)[0]);
13542
+ _urls.forEach((url) => urls.add(url));
13543
+ }
13544
+ });
13545
+ }
13546
+ const inputImageMatches = html.match(/<input[^>]+type=["']image["'][^>]+src=["']?([^"'\s>]+)["']?[^>]*>/gi);
13547
+ if (inputImageMatches) {
13548
+ inputImageMatches.forEach((match) => {
13549
+ const url = match.match(/src=["']?([^"'\s>]+)["']?/i);
13550
+ if (url && url[1]) {
13551
+ urls.add(url[1]);
13552
+ }
13553
+ });
13554
+ }
13555
+ const styleUrlMatches = html.match(/style=["']?[^"'>]*(background|background-image|border-image|list-style-image|content):\s*url\(["']?([^"'\)]+)["']?\)/gi);
13556
+ if (styleUrlMatches) {
13557
+ styleUrlMatches.forEach((match) => {
13558
+ const url = match.match(/url\(["']?([^"'\)]+)["']?\)/i);
13559
+ if (url && url[1]) {
13560
+ urls.add(url[1]);
13561
+ }
13562
+ });
13563
+ }
13564
+ const styleTagUrlMatches = html.match(/(background|background-image|border-image|list-style-image|content):\s*url\(["']?([^"'\)]+)["']?\)/gi);
13565
+ if (styleTagUrlMatches) {
13566
+ styleTagUrlMatches.forEach((match) => {
13567
+ const url = match.match(/url\(["']?([^"'\)]+)["']?\)/i);
13568
+ if (url && url[1]) {
13569
+ urls.add(url[1]);
13570
+ }
13571
+ });
13572
+ }
13573
+ }
13104
13574
  getEmptyPageContent() {
13105
13575
  const block = new Block();
13106
13576
  const section = new Section();
@@ -13121,11 +13591,11 @@ class PageBuilderEditorImpl {
13121
13591
  });
13122
13592
  }
13123
13593
  }
13124
- const _hoisted_1$c = /* @__PURE__ */ createElementVNode("i", { class: "material-icons-outlined" }, "add_circle_outline", -1);
13125
- const _hoisted_2$5 = [
13126
- _hoisted_1$c
13594
+ const _hoisted_1$b = /* @__PURE__ */ createElementVNode("i", { class: "material-icons-outlined" }, "add_circle_outline", -1);
13595
+ const _hoisted_2$3 = [
13596
+ _hoisted_1$b
13127
13597
  ];
13128
- const _sfc_main$d = /* @__PURE__ */ defineComponent({
13598
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
13129
13599
  __name: "PbPage",
13130
13600
  props: {
13131
13601
  page: {},
@@ -13142,11 +13612,15 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
13142
13612
  minHeight: ((_b = (_a = props.page) == null ? void 0 : _a.children) == null ? void 0 : _b.length) ? void 0 : "200px"
13143
13613
  };
13144
13614
  });
13145
- const selected = computed(() => editor.context.getSelectedPage() === props.page);
13615
+ const properties = computed(() => {
13616
+ var _a;
13617
+ return { style: ((_a = props.page) == null ? void 0 : _a.getStyles()) || {} };
13618
+ });
13619
+ const selected = computed(() => !!props.page && editor.context.isSelected(props.page));
13146
13620
  const insertSection = (index) => {
13147
13621
  if (!props.page)
13148
13622
  return;
13149
- editor.commandRegistry.executeCommand(OpenAddPartModalCommand.COMMAND_ID);
13623
+ editor.commandRegistry.executeCommand(AddSectionCommand.COMMAND_ID);
13150
13624
  };
13151
13625
  return (_ctx, _cache) => {
13152
13626
  var _a;
@@ -13154,29 +13628,29 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
13154
13628
  style: normalizeStyle(style.value),
13155
13629
  class: "pb-page"
13156
13630
  }, [
13157
- createElementVNode("div", {
13158
- class: normalizeClass([selected.value && "selected", _ctx.isMobilePage ? "mobile" : "pc", "pb-page-content"])
13159
- }, [
13631
+ createElementVNode("div", mergeProps({
13632
+ class: [selected.value && "selected", _ctx.isMobilePage ? "mobile" : "pc", "pb-page-content"]
13633
+ }, properties.value), [
13160
13634
  (openBlock(true), createElementBlock(Fragment, null, renderList((_a = _ctx.page) == null ? void 0 : _a.children, (section, index) => {
13161
- return openBlock(), createBlock$1(_sfc_main$l, {
13635
+ return openBlock(), createBlock$1(_sfc_main$k, {
13162
13636
  key: section.partId,
13163
13637
  part: section
13164
13638
  }, null, 8, ["part"]);
13165
13639
  }), 128))
13166
- ], 2),
13640
+ ], 16),
13167
13641
  createElementVNode("div", {
13168
13642
  class: "pb-add-section-handle bottom",
13169
13643
  onClick: _cache[0] || (_cache[0] = ($event) => {
13170
13644
  var _a2, _b;
13171
13645
  return insertSection(((_b = (_a2 = _ctx.page) == null ? void 0 : _a2.children) == null ? void 0 : _b.length) || 0);
13172
13646
  })
13173
- }, _hoisted_2$5)
13647
+ }, _hoisted_2$3)
13174
13648
  ], 4);
13175
13649
  };
13176
13650
  }
13177
13651
  });
13178
- const _hoisted_1$b = /* @__PURE__ */ createElementVNode("div", { style: { "width": "20px" } }, null, -1);
13179
- const _sfc_main$c = /* @__PURE__ */ defineComponent({
13652
+ const _hoisted_1$a = /* @__PURE__ */ createElementVNode("div", { style: { "width": "20px" } }, null, -1);
13653
+ const _sfc_main$b = /* @__PURE__ */ defineComponent({
13180
13654
  __name: "PbCanvas",
13181
13655
  setup(__props) {
13182
13656
  const pageBuilder = usePageBuilderEditor();
@@ -13223,13 +13697,13 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
13223
13697
  style: normalizeStyle(style.value),
13224
13698
  class: "pb-canvas"
13225
13699
  }, [
13226
- createVNode(_sfc_main$d, {
13700
+ createVNode(_sfc_main$c, {
13227
13701
  "is-mobile-page": true,
13228
13702
  page: pageS.value,
13229
13703
  width: 420
13230
13704
  }, null, 8, ["page"]),
13231
- _hoisted_1$b,
13232
- createVNode(_sfc_main$d, {
13705
+ _hoisted_1$a,
13706
+ createVNode(_sfc_main$c, {
13233
13707
  "is-mobile-page": false,
13234
13708
  page: pageL.value,
13235
13709
  width: 1024
@@ -13239,9 +13713,9 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
13239
13713
  };
13240
13714
  }
13241
13715
  });
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}';
13243
- const _hoisted_1$a = { class: "pb-canvas-frame" };
13244
- const _sfc_main$b = /* @__PURE__ */ defineComponent({
13716
+ 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: 2px solid #4998f8;\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: 2px solid #4998f8;\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 #4998f8;\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 .placeholder {\n padding: 4px 0;\n font-size: 18px;\n text-align: center;\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-html-widget {\n width: 100%;\n height: fit-content;\n}\n.pb-html-widget .placeholder {\n padding: 4px 0;\n font-size: 18px;\n text-align: center;\n color: #999;\n}\n.pb-iframe-widget {\n width: 100%;\n height: fit-content;\n}\n.pb-iframe-widget .placeholder {\n padding: 4px 0;\n font-size: 18px;\n text-align: center;\n color: #999;\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 padding: 0;\n margin: 0;\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: 0;\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}';
13717
+ const _hoisted_1$9 = { class: "pb-canvas-frame" };
13718
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
13245
13719
  __name: "PbCanvasFrame",
13246
13720
  setup(__props) {
13247
13721
  const pageBuilderEditor = usePageBuilderEditor();
@@ -13253,7 +13727,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
13253
13727
  return (_b = (_a = iframeRef.value) == null ? void 0 : _a.contentWindow) == null ? void 0 : _b.document;
13254
13728
  },
13255
13729
  () => {
13256
- var _a, _b, _c, _d, _e;
13730
+ var _a, _b, _c, _d, _e, _f, _g, _h;
13257
13731
  if ((_c = (_b = (_a = iframeRef.value) == null ? void 0 : _a.contentWindow) == null ? void 0 : _b.document) == null ? void 0 : _c.head) {
13258
13732
  const head = (_e = (_d = iframeRef.value) == null ? void 0 : _d.contentWindow) == null ? void 0 : _e.document.head;
13259
13733
  head.innerHTML = `
@@ -13276,14 +13750,24 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
13276
13750
  <link href="https://fonts.googleapis.com/css2?family=Material+Icons+Outlined" rel="stylesheet" />
13277
13751
  <style>${canvasStyle}</style>
13278
13752
  `;
13279
- pageBuilderEditor.keyHandlers.addDocumentKeyEventListener(iframeRef.value.contentWindow.document);
13753
+ const script2 = (_g = (_f = iframeRef.value) == null ? void 0 : _f.contentWindow) == null ? void 0 : _g.document.createElement("script");
13754
+ script2.innerHTML = `
13755
+ function forwardPostMessage(event) {
13756
+ if (event.data) {
13757
+ window.parent.postMessage(event.data, '*');
13758
+ }
13759
+ }
13760
+ window.addEventListener('message', forwardPostMessage);
13761
+ `;
13762
+ (_h = iframeRef.value) == null ? void 0 : _h.contentWindow.document.head.appendChild(script2);
13763
+ pageBuilderEditor.keyHandlers.addDocumentKeyEventListener(iframeRef.value.contentWindow.document.body);
13280
13764
  stopIframeWatch();
13281
13765
  }
13282
13766
  }
13283
13767
  );
13284
13768
  return (_ctx, _cache) => {
13285
13769
  var _a, _b, _c, _d;
13286
- return openBlock(), createElementBlock("div", _hoisted_1$a, [
13770
+ return openBlock(), createElementBlock("div", _hoisted_1$9, [
13287
13771
  createElementVNode("iframe", {
13288
13772
  ref_key: "iframeRef",
13289
13773
  ref: iframeRef,
@@ -13293,14 +13777,14 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
13293
13777
  key: 0,
13294
13778
  to: (_d = (_c = iframeRef.value) == null ? void 0 : _c.contentWindow) == null ? void 0 : _d.document.body
13295
13779
  }, [
13296
- createVNode(_sfc_main$c)
13780
+ createVNode(_sfc_main$b)
13297
13781
  ], 8, ["to"])) : createCommentVNode("", true)
13298
13782
  ]);
13299
13783
  };
13300
13784
  }
13301
13785
  });
13302
- const _hoisted_1$9 = { class: "pb-tool-button bs-layout-horizontal flex-align-center" };
13303
- const _sfc_main$a = /* @__PURE__ */ defineComponent({
13786
+ const _hoisted_1$8 = { class: "pb-tool-button bs-layout-horizontal flex-align-center" };
13787
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
13304
13788
  __name: "PbToolbarButton",
13305
13789
  props: {
13306
13790
  button: {}
@@ -13313,14 +13797,14 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
13313
13797
  (_b = (_a = props.button).handler) == null ? void 0 : _b.call(_a, pageBuilder);
13314
13798
  };
13315
13799
  return (_ctx, _cache) => {
13316
- return openBlock(), createElementBlock("div", _hoisted_1$9, [
13800
+ return openBlock(), createElementBlock("div", _hoisted_1$8, [
13317
13801
  createElementVNode("div", {
13318
13802
  class: "tool-button bs-clickable",
13319
13803
  onClick: handleClick
13320
13804
  }, [
13321
13805
  _ctx.button.icon ? (openBlock(), createElementBlock("span", {
13322
13806
  key: 0,
13323
- style: normalizeStyle({ fontSize: _ctx.button.iconFontSize || "16px" }),
13807
+ style: normalizeStyle({ fontSize: _ctx.button.iconFontSize || "20px" }),
13324
13808
  class: "font-icon"
13325
13809
  }, toDisplayString(_ctx.button.icon), 5)) : createCommentVNode("", true)
13326
13810
  ])
@@ -13328,17 +13812,17 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
13328
13812
  };
13329
13813
  }
13330
13814
  });
13331
- const _hoisted_1$8 = { class: "pb-tool-button-group bs-layout-horizontal flex-align-center" };
13332
- const _sfc_main$9 = /* @__PURE__ */ defineComponent({
13815
+ const _hoisted_1$7 = { class: "pb-tool-button-group bs-layout-horizontal flex-align-center" };
13816
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
13333
13817
  __name: "PbToolbarButtonGroup",
13334
13818
  props: {
13335
13819
  group: {}
13336
13820
  },
13337
13821
  setup(__props) {
13338
13822
  return (_ctx, _cache) => {
13339
- return openBlock(), createElementBlock("div", _hoisted_1$8, [
13823
+ return openBlock(), createElementBlock("div", _hoisted_1$7, [
13340
13824
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.group.buttons, (button) => {
13341
- return openBlock(), createBlock$1(_sfc_main$a, {
13825
+ return openBlock(), createBlock$1(_sfc_main$9, {
13342
13826
  key: button.buttonId,
13343
13827
  button
13344
13828
  }, null, 8, ["button"]);
@@ -13347,87 +13831,117 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
13347
13831
  };
13348
13832
  }
13349
13833
  });
13350
- const _hoisted_1$7 = { class: "pb-toolbar bs-layout-horizontal align-items-center" };
13351
- const _hoisted_2$4 = { class: "ml-8 w-64" };
13352
- const _hoisted_3$1 = { class: "ml-8 w-80" };
13353
- const _sfc_main$8 = /* @__PURE__ */ defineComponent({
13834
+ const _hoisted_1$6 = { class: "pb-toolbar bs-layout-horizontal align-items-center" };
13835
+ const _hoisted_2$2 = { class: "bs-layout-horizontal align-items-center" };
13836
+ const _hoisted_3$1 = /* @__PURE__ */ createElementVNode("div", { class: "flex-grow-1" }, null, -1);
13837
+ const _hoisted_4 = { class: "mr-8" };
13838
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
13354
13839
  __name: "PbToolbar",
13840
+ props: {
13841
+ plugin: {}
13842
+ },
13355
13843
  setup(__props) {
13356
13844
  const pageBuilder = usePageBuilderEditor();
13357
13845
  const buttonGroups = pageBuilder.toolButtonRegistry.getToolButtonGroups();
13358
- const scale = computed(() => `${Math.round(100 * pageBuilder.scale.value)}%`);
13359
- const zoom = async (scaleString) => {
13360
- if (!scaleString)
13361
- return;
13362
- const scale2 = parseInt(scaleString.replaceAll(/[^0-9]+/g, "")) / 100;
13363
- pageBuilder.zoom(scale2);
13846
+ const modal = useModal();
13847
+ const screenCount = computed({
13848
+ get: () => {
13849
+ var _a;
13850
+ return ((_a = pageBuilder.model.rootPart.children) == null ? void 0 : _a.length) || 2;
13851
+ },
13852
+ set: (count) => {
13853
+ var _a;
13854
+ if (!count)
13855
+ return;
13856
+ console.log(count);
13857
+ if (count === (((_a = pageBuilder.model.rootPart.children) == null ? void 0 : _a.length) || 0))
13858
+ return;
13859
+ if (count >= 2) {
13860
+ makeMultipleScreen();
13861
+ } else {
13862
+ makeSingleScreen();
13863
+ }
13864
+ }
13865
+ });
13866
+ const makeMultipleScreen = () => {
13867
+ pageBuilder.makeMultipleScreen();
13868
+ };
13869
+ const makeSingleScreen = () => {
13870
+ modal.openModal({
13871
+ component: defineAsyncComponent(() => import("./PbScreenSelectModal-DDATc9n1.js")),
13872
+ bind: {},
13873
+ on: {
13874
+ select: (selection) => {
13875
+ pageBuilder.makeSingleScreen(selection);
13876
+ }
13877
+ }
13878
+ });
13364
13879
  };
13365
- const lang = ref("English");
13880
+ const scale = computed({
13881
+ get: () => `${Math.round(100 * pageBuilder.scale.value)}%`,
13882
+ set: (value) => {
13883
+ const scale2 = parseInt(value.replaceAll(/[^0-9]+/g, "")) / 100;
13884
+ pageBuilder.zoom(scale2);
13885
+ }
13886
+ });
13366
13887
  return (_ctx, _cache) => {
13367
- return openBlock(), createElementBlock("div", _hoisted_1$7, [
13368
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(buttonGroups), (group) => {
13369
- return openBlock(), createBlock$1(_sfc_main$9, {
13370
- key: group.groupId,
13371
- group
13372
- }, null, 8, ["group"]);
13373
- }), 128)),
13374
- createElementVNode("div", _hoisted_2$4, [
13888
+ var _a, _b, _c;
13889
+ return openBlock(), createElementBlock("div", _hoisted_1$6, [
13890
+ createElementVNode("div", _hoisted_2$2, [
13891
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(buttonGroups), (group) => {
13892
+ return openBlock(), createBlock$1(_sfc_main$8, {
13893
+ key: group.groupId,
13894
+ group
13895
+ }, null, 8, ["group"]);
13896
+ }), 128)),
13897
+ createVNode(unref(BSSelect), {
13898
+ modelValue: screenCount.value,
13899
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => screenCount.value = $event),
13900
+ items: [{ value: 2, label: "Multiple Screen" }, { value: 1, label: "Single Screen" }],
13901
+ "label-provider": (v) => v.label,
13902
+ "value-provider": (v) => v.value,
13903
+ "view-mode": false
13904
+ }, null, 8, ["modelValue", "label-provider", "value-provider"]),
13375
13905
  createVNode(unref(BSSelect), {
13376
13906
  modelValue: scale.value,
13377
- "onUpdate:modelValue": [
13378
- _cache[0] || (_cache[0] = ($event) => scale.value = $event),
13379
- zoom
13380
- ],
13907
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => scale.value = $event),
13381
13908
  items: ["100%", "75%", "50%", "25%", "10%"],
13382
13909
  "view-mode": false,
13910
+ class: "ml-4",
13383
13911
  placeholder: "Scale"
13384
13912
  }, null, 8, ["modelValue"])
13385
13913
  ]),
13386
- createElementVNode("div", _hoisted_3$1, [
13387
- createVNode(unref(BSSelect), {
13388
- modelValue: lang.value,
13389
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => lang.value = $event),
13390
- items: ["English", "日本語", "한국어"],
13391
- "view-mode": false,
13392
- placeholder: "English"
13393
- }, null, 8, ["modelValue"])
13914
+ _hoisted_3$1,
13915
+ createElementVNode("div", _hoisted_4, [
13916
+ _ctx.plugin ? (openBlock(), createBlock$1(resolveDynamicComponent((_a = _ctx.plugin) == null ? void 0 : _a.component), mergeProps({ key: 0 }, (_b = _ctx.plugin) == null ? void 0 : _b.bind, toHandlers((_c = _ctx.plugin) == null ? void 0 : _c.on)), null, 16)) : createCommentVNode("", true)
13394
13917
  ])
13395
13918
  ]);
13396
13919
  };
13397
13920
  }
13398
13921
  });
13399
- const _hoisted_1$6 = { class: "pb-menu bs-layout-vertical" };
13400
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
13922
+ const _hoisted_1$5 = { class: "pb-menu bs-layout-vertical" };
13923
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
13401
13924
  __name: "PbMenu",
13925
+ props: {
13926
+ toolbarPlugin: {}
13927
+ },
13402
13928
  setup(__props) {
13403
13929
  return (_ctx, _cache) => {
13404
- return openBlock(), createElementBlock("div", _hoisted_1$6, [
13405
- createVNode(_sfc_main$8)
13930
+ return openBlock(), createElementBlock("div", _hoisted_1$5, [
13931
+ createVNode(_sfc_main$7, { plugin: _ctx.toolbarPlugin }, null, 8, ["plugin"])
13406
13932
  ]);
13407
13933
  };
13408
13934
  }
13409
13935
  });
13410
- const _hoisted_1$5 = { class: "pb-navigator" };
13411
- const _hoisted_2$3 = { class: "pb-navigator" };
13412
- const _sfc_main$6 = /* @__PURE__ */ defineComponent({
13936
+ const _hoisted_1$4 = { class: "bs-layout-vertical border" };
13937
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
13413
13938
  __name: "PbNavigator",
13414
13939
  setup(__props) {
13415
13940
  const pageBuilder = usePageBuilderEditor();
13416
- const tabs = [
13417
- { tabId: "pageS", caption: "Mobile" },
13418
- { tabId: "pageL", caption: "PC" }
13419
- ];
13420
- const pageS = computed(() => (pageBuilder.model.rootPart.children || [])[0].children || []);
13421
- const pageL = computed(() => (pageBuilder.model.rootPart.children || [])[1].children || []);
13422
- const tabId = computed({
13423
- get() {
13424
- const page = pageBuilder.context.getSelectedPage();
13425
- return page === (pageBuilder.model.rootPart.children || [])[1] ? "pageL" : "pageS";
13426
- },
13427
- // @ts-ignore
13428
- set(value) {
13429
- }
13430
- });
13941
+ const tree = ref();
13942
+ watch(() => tree.value, () => tree.value && pageBuilder.keyHandlers.addDocumentKeyEventListener(tree.value));
13943
+ const page = computed(() => pageBuilder.model.rootPart.children || []);
13944
+ let savedPartSelection = null;
13431
13945
  const treeDragAndDropPolicy = {
13432
13946
  dropStep: () => 3,
13433
13947
  isDroppable(_srcRow, _srcParentRow, _destRow, _destParentRow) {
@@ -13460,8 +13974,8 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
13460
13974
  };
13461
13975
  const rowMoved = (event) => {
13462
13976
  var _a, _b, _c, _d, _e, _f;
13463
- let page = pageBuilder.context.getSelectedPage();
13464
- const parentPartId = ((_a = event.destParent) == null ? void 0 : _a.partId) || (page == null ? void 0 : page.partId);
13977
+ let page2 = pageBuilder.context.getSelectedPage();
13978
+ const parentPartId = ((_a = event.destParent) == null ? void 0 : _a.partId) || (page2 == null ? void 0 : page2.partId);
13465
13979
  if (!parentPartId)
13466
13980
  return;
13467
13981
  let ok = false;
@@ -13480,7 +13994,8 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
13480
13994
  }
13481
13995
  }
13482
13996
  if (ok) {
13483
- pageBuilder.model.moveElements(event.row.partId, parentPartId, event.destIndex);
13997
+ backupPartSelection();
13998
+ pageBuilder.model.moveElements(event.row.partId, parentPartId, event.destIndex, void 0, true);
13484
13999
  }
13485
14000
  };
13486
14001
  const selectedRows = computed({
@@ -13496,6 +14011,10 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
13496
14011
  const selectedRowsChanged = (rows) => {
13497
14012
  pageBuilder.context.setSelection([...rows]);
13498
14013
  };
14014
+ const iconProvider = (part) => {
14015
+ const def = pageBuilder.partManager.getPartDefinition(part.partName);
14016
+ return (def == null ? void 0 : def.icon) || "";
14017
+ };
13499
14018
  const labelProvider = (part) => {
13500
14019
  var _a;
13501
14020
  return part.getName() || ((_a = pageBuilder.partManager.getPartDefinition(part.partName)) == null ? void 0 : _a.caption) || part.partName;
@@ -13516,6 +14035,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
13516
14035
  const modelUpdateHandler = (event) => {
13517
14036
  var _a;
13518
14037
  (_a = event.inserted) == null ? void 0 : _a.map((target) => findLeafPart(pageBuilder.model.findPartById(target.partId))).filter(notNull).forEach((part) => expandParent(part));
14038
+ if (savedPartSelection) {
14039
+ restorePartSelection();
14040
+ }
13519
14041
  };
13520
14042
  const expandParent = (part) => {
13521
14043
  if (part.parent && part.parent.partName !== PAGE_TYPE) {
@@ -13523,6 +14045,15 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
13523
14045
  expandParent(part.parent);
13524
14046
  }
13525
14047
  };
14048
+ const backupPartSelection = () => {
14049
+ savedPartSelection = [...pageBuilder.context.getSelectedParts()];
14050
+ };
14051
+ const restorePartSelection = () => {
14052
+ if (savedPartSelection) {
14053
+ pageBuilder.context.setSelection(savedPartSelection);
14054
+ savedPartSelection = null;
14055
+ }
14056
+ };
13526
14057
  onMounted(() => {
13527
14058
  PageBuilderEditorEvent.on.modelUpdatedByUI(modelUpdateHandler);
13528
14059
  });
@@ -13530,65 +14061,40 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
13530
14061
  PageBuilderEditorEvent.off.modelUpdatedByUI(modelUpdateHandler);
13531
14062
  });
13532
14063
  return (_ctx, _cache) => {
13533
- return openBlock(), createBlock$1(unref(BSTabSheet), {
13534
- "tab-id": tabId.value,
13535
- "onUpdate:tabId": _cache[4] || (_cache[4] = ($event) => tabId.value = $event),
13536
- tabs
13537
- }, {
13538
- pageS: withCtx(() => [
13539
- createElementVNode("div", _hoisted_1$5, [
13540
- createVNode(unref(BSTree), {
13541
- expandedRows: expandedRows.value,
13542
- "onUpdate:expandedRows": [
13543
- _cache[0] || (_cache[0] = ($event) => expandedRows.value = $event),
13544
- expandedRowsChanged
13545
- ],
13546
- selectedRows: selectedRows.value,
13547
- "onUpdate:selectedRows": [
13548
- _cache[1] || (_cache[1] = ($event) => selectedRows.value = $event),
13549
- selectedRowsChanged
13550
- ],
13551
- data: pageS.value,
13552
- "enable-drag-and-drop": treeDragAndDropPolicy,
13553
- "key-provider": (part) => part.partId,
13554
- "label-provider": labelProvider,
13555
- class: "max-w-320",
13556
- "dont-change-data-when-rowmoved": "",
13557
- "show-move-button": "",
13558
- onRowMoved: rowMoved
13559
- }, null, 8, ["expandedRows", "selectedRows", "data", "key-provider"])
13560
- ])
13561
- ]),
13562
- pageL: withCtx(() => [
13563
- createElementVNode("div", _hoisted_2$3, [
13564
- createVNode(unref(BSTree), {
13565
- expandedRows: expandedRows.value,
13566
- "onUpdate:expandedRows": [
13567
- _cache[2] || (_cache[2] = ($event) => expandedRows.value = $event),
13568
- expandedRowsChanged
13569
- ],
13570
- selectedRows: selectedRows.value,
13571
- "onUpdate:selectedRows": [
13572
- _cache[3] || (_cache[3] = ($event) => selectedRows.value = $event),
13573
- selectedRowsChanged
13574
- ],
13575
- data: pageL.value,
13576
- "enable-drag-and-drop": treeDragAndDropPolicy,
13577
- "key-provider": (part) => part.partId,
13578
- "label-provider": labelProvider,
13579
- class: "max-w-320",
13580
- "dont-change-data-when-rowmoved": "",
13581
- "show-move-button": "",
13582
- onRowMoved: rowMoved
13583
- }, null, 8, ["expandedRows", "selectedRows", "data", "key-provider"])
13584
- ])
13585
- ]),
13586
- _: 1
13587
- }, 8, ["tab-id"]);
14064
+ return openBlock(), createElementBlock("div", _hoisted_1$4, [
14065
+ createElementVNode("div", {
14066
+ ref_key: "tree",
14067
+ ref: tree,
14068
+ class: "pb-navigator",
14069
+ tabindex: "0"
14070
+ }, [
14071
+ createVNode(unref(BSTree), {
14072
+ expandedRows: expandedRows.value,
14073
+ "onUpdate:expandedRows": [
14074
+ _cache[0] || (_cache[0] = ($event) => expandedRows.value = $event),
14075
+ expandedRowsChanged
14076
+ ],
14077
+ selectedRows: selectedRows.value,
14078
+ "onUpdate:selectedRows": [
14079
+ _cache[1] || (_cache[1] = ($event) => selectedRows.value = $event),
14080
+ selectedRowsChanged
14081
+ ],
14082
+ data: page.value,
14083
+ "enable-drag-and-drop": treeDragAndDropPolicy,
14084
+ "icon-provider": iconProvider,
14085
+ "key-provider": (part) => part.partId,
14086
+ "label-provider": labelProvider,
14087
+ class: "max-w-320",
14088
+ "dont-change-data-when-rowmoved": "",
14089
+ "show-move-button": "",
14090
+ onRowMoved: rowMoved
14091
+ }, null, 8, ["expandedRows", "selectedRows", "data", "key-provider"])
14092
+ ], 512)
14093
+ ]);
13588
14094
  };
13589
14095
  }
13590
14096
  });
13591
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
14097
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
13592
14098
  __name: "PbSidebarPropertyEditor",
13593
14099
  props: {
13594
14100
  property: {},
@@ -13598,32 +14104,13 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
13598
14104
  const props = __props;
13599
14105
  const pageBuilder = usePageBuilderEditor();
13600
14106
  const propertyEditor = computed(() => {
13601
- var _a, _b, _c, _d;
13602
- if (pageBuilder.editMode === "local" && props.selectedParts.length > 0) {
13603
- const section = pageBuilder.partManager.findNearestSection(props.selectedParts[0]);
13604
- if (section && ["GlobalDesignPart"].includes(((_a = section.properties) == null ? void 0 : _a.sectionType) || "")) {
13605
- return;
13606
- }
13607
- if (section && ["LocalDesignPart", "LocalMarketingPart"].includes(((_b = section.properties) == null ? void 0 : _b.sectionType) || "")) {
13608
- if (!props.property.localized) {
13609
- return;
13610
- }
13611
- }
13612
- }
13613
- if (pageBuilder.editMode === "template" && props.selectedParts.length > 0) {
13614
- const section = pageBuilder.partManager.findNearestSection(props.selectedParts[0]);
13615
- if (section && ["LocalDesignPart", "LocalMarketingPart"].includes(((_c = section.properties) == null ? void 0 : _c.sectionType) || "")) {
13616
- if (props.property.localized) {
13617
- return;
13618
- }
13619
- }
13620
- }
14107
+ var _a;
13621
14108
  if (props.property.propertyEditor) {
13622
14109
  const editor = props.property.propertyEditor(props.property, props.selectedParts);
13623
14110
  if (editor)
13624
14111
  return editor;
13625
14112
  }
13626
- return (_d = pageBuilder.partManager.getPartPropertyEditor(props.property.propertyType)) == null ? void 0 : _d(props.property, props.selectedParts);
14113
+ return (_a = pageBuilder.partManager.getPartPropertyEditor(props.property.propertyType)) == null ? void 0 : _a(props.property, props.selectedParts);
13627
14114
  });
13628
14115
  const value = computed(() => getPropertyValueOfParts(props.selectedParts, props.property.propertyName));
13629
14116
  const updatePropertyValue = (properties) => {
@@ -13643,9 +14130,13 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
13643
14130
  };
13644
14131
  }
13645
14132
  });
13646
- const _hoisted_1$4 = { class: "pb-sidebar-property-group" };
13647
- const _hoisted_2$2 = ["textContent"];
13648
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
14133
+ const _hoisted_1$3 = { class: "pb-sidebar-property-group" };
14134
+ const _hoisted_2$1 = {
14135
+ key: 0,
14136
+ class: "group-title"
14137
+ };
14138
+ const _hoisted_3 = ["textContent"];
14139
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
13649
14140
  __name: "PbSidebarPropertyGroupEditor",
13650
14141
  props: {
13651
14142
  group: {},
@@ -13654,44 +14145,24 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
13654
14145
  },
13655
14146
  setup(__props) {
13656
14147
  const props = __props;
13657
- const pageBuilder = usePageBuilderEditor();
13658
14148
  const groupEditor = computed(() => {
13659
- var _a, _b, _c, _d, _e;
13660
- if (pageBuilder.editMode === "local" && props.selectedParts.length > 0) {
13661
- const section = pageBuilder.partManager.findNearestSection(props.selectedParts[0]);
13662
- if (section && ["GlobalDesignPart"].includes(((_a = section.properties) == null ? void 0 : _a.sectionType) || "")) {
13663
- return;
13664
- }
13665
- if (section && ["LocalDesignPart", "LocalMarketingPart"].includes(((_b = section.properties) == null ? void 0 : _b.sectionType) || "")) {
13666
- if (!props.group.localized) {
13667
- return;
13668
- }
13669
- }
13670
- }
13671
- if (pageBuilder.editMode === "template" && props.selectedParts.length > 0) {
13672
- const section = pageBuilder.partManager.findNearestSection(props.selectedParts[0]);
13673
- if (section && ["LocalDesignPart", "LocalMarketingPart"].includes(((_c = section.properties) == null ? void 0 : _c.sectionType) || "")) {
13674
- if (props.group.localized) {
13675
- return;
13676
- }
13677
- }
13678
- }
13679
- return (_e = (_d = props.group).propertyGroupEditor) == null ? void 0 : _e.call(_d, props.group, props.selectedParts);
14149
+ var _a, _b;
14150
+ return (_b = (_a = props.group).propertyGroupEditor) == null ? void 0 : _b.call(_a, props.group, props.selectedParts);
13680
14151
  });
13681
14152
  return (_ctx, _cache) => {
13682
- return openBlock(), createElementBlock("div", _hoisted_1$4, [
13683
- _ctx.group.showGroupName ? (openBlock(), createElementBlock("div", {
13684
- key: 0,
13685
- class: "group-title",
13686
- textContent: toDisplayString(_ctx.group.caption)
13687
- }, null, 8, _hoisted_2$2)) : createCommentVNode("", true),
14153
+ return openBlock(), createElementBlock("div", _hoisted_1$3, [
14154
+ _ctx.group.showGroupName ? (openBlock(), createElementBlock("div", _hoisted_2$1, [
14155
+ createElementVNode("label", {
14156
+ textContent: toDisplayString(_ctx.group.caption)
14157
+ }, null, 8, _hoisted_3)
14158
+ ])) : createCommentVNode("", true),
13688
14159
  _ctx.partsKey ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
13689
14160
  groupEditor.value ? (openBlock(), createBlock$1(resolveDynamicComponent(groupEditor.value), {
13690
14161
  key: 0,
13691
14162
  group: _ctx.group,
13692
14163
  "selected-parts": _ctx.selectedParts
13693
14164
  }, null, 8, ["group", "selected-parts"])) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(_ctx.group.properties, (property) => {
13694
- return openBlock(), createBlock$1(_sfc_main$5, {
14165
+ return openBlock(), createBlock$1(_sfc_main$4, {
13695
14166
  key: `${_ctx.partsKey}_${property.propertyName}`,
13696
14167
  property,
13697
14168
  "selected-parts": _ctx.selectedParts
@@ -13702,102 +14173,6 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
13702
14173
  };
13703
14174
  }
13704
14175
  });
13705
- const _hoisted_1$3 = { class: "property-editor property-editor-local-part flex-align-center pt-16" };
13706
- const _hoisted_2$1 = /* @__PURE__ */ createElementVNode("div", { class: "label" }, " Display Schedule ", -1);
13707
- const _hoisted_3 = { class: "bs-layout-horizontal" };
13708
- const _hoisted_4 = { class: "mr-2" };
13709
- const _hoisted_5 = /* @__PURE__ */ createElementVNode("span", { class: "font-icon" }, "more_horiz", -1);
13710
- const _hoisted_6 = [
13711
- _hoisted_5
13712
- ];
13713
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
13714
- __name: "PbPropertyLocalMarketingPart",
13715
- props: {
13716
- selectedPart: {}
13717
- },
13718
- emits: ["select-schedule", "update-property-value"],
13719
- setup(__props, { emit: __emit }) {
13720
- const props = __props;
13721
- useModal();
13722
- const startDt = ref("");
13723
- const endDt = ref("");
13724
- const pageBuilder = usePageBuilderEditor();
13725
- const selectSchedule = () => {
13726
- PageBuilderEditorEvent.emit.requestLocalMarketingPartSchedule({
13727
- pageBuilderId: pageBuilder.instanceId,
13728
- partId: props.selectedPart.partId,
13729
- callback: (schedule) => {
13730
- startDt.value = schedule.startDt;
13731
- endDt.value = schedule.endDt;
13732
- if (props.selectedPart && props.selectedPart.isSection()) {
13733
- clearContents(props.selectedPart);
13734
- if (schedule.data) {
13735
- for (const partId in schedule.data) {
13736
- const part = findWidget(props.selectedPart, partId);
13737
- if (part) {
13738
- Object.entries(schedule.data[partId]).forEach(([key, value]) => {
13739
- if (!value)
13740
- return;
13741
- part.properties = part.properties || {};
13742
- part.properties[key] = value;
13743
- });
13744
- }
13745
- }
13746
- }
13747
- }
13748
- }
13749
- });
13750
- };
13751
- const findWidget = (part, partId) => {
13752
- if (!part)
13753
- return;
13754
- if (part.partId === partId)
13755
- return part;
13756
- if (part.children) {
13757
- for (const child of part.children) {
13758
- const found = findWidget(child, partId);
13759
- if (found)
13760
- return found;
13761
- }
13762
- }
13763
- };
13764
- const clearContents = (part) => {
13765
- if (!part)
13766
- return;
13767
- if (part.properties) {
13768
- for (const name in part.properties) {
13769
- const propertyDef = pageBuilder.partManager.getPropertyDefinition(part.partName, name);
13770
- if (propertyDef && propertyDef.localized) {
13771
- delete part.properties[name];
13772
- }
13773
- }
13774
- }
13775
- if (part.children) {
13776
- for (const child of part.children) {
13777
- clearContents(child);
13778
- }
13779
- }
13780
- };
13781
- return (_ctx, _cache) => {
13782
- return openBlock(), createElementBlock("div", _hoisted_1$3, [
13783
- _hoisted_2$1,
13784
- createElementVNode("div", _hoisted_3, [
13785
- createElementVNode("div", _hoisted_4, [
13786
- createVNode(unref(BSDateRange), {
13787
- "from-value": startDt.value,
13788
- "to-value": endDt.value,
13789
- resolution: "DAY",
13790
- width: "260px"
13791
- }, null, 8, ["from-value", "to-value"])
13792
- ]),
13793
- createElementVNode("div", null, [
13794
- createElementVNode("button", { onClick: selectSchedule }, _hoisted_6)
13795
- ])
13796
- ])
13797
- ]);
13798
- };
13799
- }
13800
- });
13801
14176
  const _hoisted_1$2 = { class: "pb-sidebar-properties" };
13802
14177
  const _sfc_main$2 = /* @__PURE__ */ defineComponent({
13803
14178
  __name: "PbSidebarProperties",
@@ -13816,29 +14191,13 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
13816
14191
  return [];
13817
14192
  }
13818
14193
  });
13819
- const showLocalMarketingPart = computed(() => {
13820
- var _a;
13821
- if (pageBuilder.editMode === "template")
13822
- return false;
13823
- if (!selectedParts.length || selectedParts.length !== 1)
13824
- return false;
13825
- const part = selectedParts[0];
13826
- if (part.isSection() && ((_a = part.properties) == null ? void 0 : _a.sectionType) === "LocalMarketingPart") {
13827
- return true;
13828
- }
13829
- return false;
13830
- });
13831
14194
  return (_ctx, _cache) => {
13832
14195
  return openBlock(), createElementBlock("div", _hoisted_1$2, [
13833
- showLocalMarketingPart.value ? (openBlock(), createBlock$1(_sfc_main$3, {
13834
- key: 0,
13835
- "selected-part": unref(selectedParts)[0]
13836
- }, null, 8, ["selected-part"])) : createCommentVNode("", true),
13837
14196
  (openBlock(true), createElementBlock(Fragment, null, renderList(properties.value, (group) => {
13838
14197
  return openBlock(), createElementBlock("div", {
13839
14198
  key: `${partsKey.value}_${group.groupName}`
13840
14199
  }, [
13841
- createVNode(_sfc_main$4, {
14200
+ createVNode(_sfc_main$3, {
13842
14201
  group,
13843
14202
  partsKey: partsKey.value,
13844
14203
  "selected-parts": unref(selectedParts)
@@ -13867,8 +14226,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
13867
14226
  props: {
13868
14227
  instanceId: {},
13869
14228
  title: {},
13870
- editMode: {},
13871
- pageContent: {}
14229
+ pageContent: {},
14230
+ locales: {},
14231
+ locale: {},
14232
+ toolbarPlugin: {},
14233
+ plugin: {}
13872
14234
  },
13873
14235
  setup(__props, { expose: __expose }) {
13874
14236
  const props = __props;
@@ -13876,76 +14238,43 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
13876
14238
  const pageBuilderEditor = createPageBuilderEditor();
13877
14239
  pageBuilderEditor.instanceId = props.instanceId;
13878
14240
  pageBuilderEditor.title = props.title;
13879
- pageBuilderEditor.editMode = props.editMode || "free";
14241
+ if (props.locales)
14242
+ pageBuilderEditor.setLocales(props.locales);
14243
+ if (props.locale)
14244
+ pageBuilderEditor.setLocale(props.locale);
14245
+ if (props.plugin)
14246
+ pageBuilderEditor.registerCustomPlugin(props.plugin);
13880
14247
  pageBuilderEditor.registerPlugin({
13881
14248
  // TODO
13882
14249
  commands: createDefaultCommands(modal)
13883
14250
  });
13884
- pageBuilderEditor.keyHandlers.addDocumentKeyEventListener(window.document);
13885
14251
  providePageBuilderEditor(pageBuilderEditor);
14252
+ providePageBuilder(pageBuilderEditor);
13886
14253
  onMounted(() => pageBuilderEditor.initData(props.pageContent));
13887
14254
  watch(() => props.pageContent, (pageContent) => pageContent && pageBuilderEditor.initData(pageContent));
14255
+ watch(() => props.locale, (locale) => {
14256
+ pageBuilderEditor.setLocale(locale);
14257
+ });
14258
+ watch(() => props.locales, (locales) => {
14259
+ pageBuilderEditor.setLocales(locales);
14260
+ });
13888
14261
  const colorHistory = ref([]);
13889
14262
  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;
14263
+ const getPageContent = () => {
14264
+ return pageBuilderEditor.model.serializeModel(
14265
+ (part) => pageBuilderEditor.extractMedia(part),
14266
+ (partObject) => pageBuilderEditor.extractProvider(partObject)
14267
+ );
13939
14268
  };
13940
14269
  __expose({
13941
- getLocalDesignPartContent
14270
+ getPageContent
13942
14271
  });
13943
14272
  return (_ctx, _cache) => {
13944
14273
  return openBlock(), createElementBlock("div", _hoisted_1, [
13945
- createVNode(_sfc_main$7),
14274
+ createVNode(_sfc_main$6, { "toolbar-plugin": _ctx.toolbarPlugin }, null, 8, ["toolbar-plugin"]),
13946
14275
  createElementVNode("div", _hoisted_2, [
13947
- createVNode(_sfc_main$6),
13948
- createVNode(_sfc_main$b, { class: "flex-grow-1" }),
14276
+ createVNode(_sfc_main$5),
14277
+ createVNode(_sfc_main$a, { class: "flex-grow-1" }),
13949
14278
  createVNode(_sfc_main$1)
13950
14279
  ])
13951
14280
  ]);
@@ -13955,27 +14284,33 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
13955
14284
  export {
13956
14285
  BLOCK_TYPE$1 as B,
13957
14286
  Model$1 as M,
13958
- PageBuilderEditorEvent as P,
14287
+ PbColorPicker as P,
13959
14288
  ROOT_TYPE$1 as R,
13960
14289
  SECTION_TYPE$1 as S,
13961
14290
  WIDGET_TYPE$1 as W,
13962
14291
  _sfc_main as _,
13963
- Block as a,
13964
- PAGE_TYPE$1 as b,
13965
- Page as c,
13966
- _sfc_main$q as d,
13967
- PageBuilderViewerEvent as e,
13968
- Part as f,
13969
- _sfc_main$4$1 as g,
13970
- _sfc_main$2$1 as h,
13971
- _sfc_main$3$1 as i,
13972
- RootPart as j,
13973
- Section as k,
13974
- Widget as l,
13975
- createPageBuilderViewer as m,
13976
- createPartComponent as n,
13977
- createPartComponents as o,
13978
- providePageBuilderViewer as p,
13979
- usePageBuilderViewer as q,
13980
- usePageBuilderEditor as u
14292
+ PageBuilderEditorEvent as a,
14293
+ Block as b,
14294
+ PAGE_BUILDER_KEY as c,
14295
+ PAGE_TYPE$1 as d,
14296
+ Page as e,
14297
+ _sfc_main$1$1 as f,
14298
+ Part as g,
14299
+ _sfc_main$p as h,
14300
+ _sfc_main$4$1 as i,
14301
+ _sfc_main$3$1 as j,
14302
+ _sfc_main$6$1 as k,
14303
+ _sfc_main$5$1 as l,
14304
+ RootPart as m,
14305
+ Section as n,
14306
+ Widget as o,
14307
+ createPageBuilderViewer as p,
14308
+ createPartComponent as q,
14309
+ createPartComponents as r,
14310
+ providePageBuilder as s,
14311
+ providePageBuilderViewer as t,
14312
+ usePageBuilderEditor as u,
14313
+ usePageBuilder as v,
14314
+ widgetPartDefinitions as w,
14315
+ usePageBuilderViewer as x
13981
14316
  };