@g1cloud/page-builder-editor 1.0.0-alpha.22 → 1.0.0-alpha.23

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 (68) hide show
  1. package/css/canvas.scss +16 -114
  2. package/css/{canvas-block.scss → page-block.scss} +15 -3
  3. package/css/page-builder-editor.scss +1 -11
  4. package/css/{canvas-page.scss → page-page.scss} +18 -4
  5. package/css/{canvas-section.scss → page-section.scss} +15 -3
  6. package/css/{canvas-widget.scss → page-widget.scss} +15 -3
  7. package/css/page.scss +79 -0
  8. package/css/property-editor-youtube.scss +16 -0
  9. package/dist/PageBuilderEditor.vue.d.ts +4 -4
  10. package/dist/{PbHtmlEditorModal-pn7PlMQg.js → PbHtmlEditorModal-dDR38rNy.js} +33 -18
  11. package/dist/{PbPropertyEditorColor-C554e0iO.js → PbPropertyEditorColor-B6yhXmGL.js} +1 -1
  12. package/dist/{PbPropertyEditorHtml-CB99C_DG.js → PbPropertyEditorHtml-fgIO3jaY.js} +2 -2
  13. package/dist/{PbPropertyEditorImage-CMPr66Dx.js → PbPropertyEditorImage-6WNkin_o.js} +3 -3
  14. package/dist/{PbPropertyEditorMultilineText-BR1FNVi6.js → PbPropertyEditorMultilineText-3hJVRryR.js} +1 -1
  15. package/dist/{PbPropertyEditorText-CWmfX2bt.js → PbPropertyEditorText-DZA84Sn1.js} +1 -1
  16. package/dist/PbPropertyEditorYoutube-DtcxO2uZ.js +39 -0
  17. package/dist/{PbScreenSelectModal-DDATc9n1.js → PbScreenSelectModal-CnI1IsvW.js} +3 -4
  18. package/dist/{PbWidgetAddModal-haOQfRIi.js → PbWidgetAddModal-DO1t-xsl.js} +19 -21
  19. package/dist/PbYoutubeModal-DFb6CQyW.js +68 -0
  20. package/dist/components/canvas/PbCanvas.vue.d.ts +1 -1
  21. package/dist/components/depart/PbLoginDepart.vue.d.ts +3 -3
  22. package/dist/components/menu/PbMenu.vue.d.ts +3 -3
  23. package/dist/components/menu/PbToolbar.vue.d.ts +3 -3
  24. package/dist/components/menu/PbToolbarButton.vue.d.ts +3 -3
  25. package/dist/components/menu/PbToolbarButtonGroup.vue.d.ts +3 -3
  26. package/dist/components/modal/PbHtmlEditorModal.vue.d.ts +4 -4
  27. package/dist/components/modal/PbPartAddModal.vue.d.ts +4 -4
  28. package/dist/components/modal/PbScreenSelectModal.vue.d.ts +2 -2
  29. package/dist/components/modal/PbWidgetAddModal.vue.d.ts +4 -4
  30. package/dist/components/modal/PbYoutubeModal.vue.d.ts +19 -0
  31. package/dist/components/navigator/PbNavigator.vue.d.ts +1 -1
  32. package/dist/components/part/PbAddWidgetButton.vue.d.ts +1 -1
  33. package/dist/components/part/PbBlock.vue.d.ts +3 -3
  34. package/dist/components/part/PbContainerWidget.vue.d.ts +19 -0
  35. package/dist/components/part/PbPage.vue.d.ts +3 -3
  36. package/dist/components/part/{PbPageWrapper.vue.d.ts → PbPageFrame.vue.d.ts} +3 -3
  37. package/dist/components/part/PbSection.vue.d.ts +3 -3
  38. package/dist/components/part/PbWidget.vue.d.ts +3 -3
  39. package/dist/components/sidebar/PbSidebar.vue.d.ts +1 -1
  40. package/dist/components/sidebar/PbSidebarProperties.vue.d.ts +1 -1
  41. package/dist/components/sidebar/PbSidebarPropertyEditor.vue.d.ts +3 -3
  42. package/dist/components/sidebar/PbSidebarPropertyGroupEditor.vue.d.ts +3 -3
  43. package/dist/components/sidebar/property/PbPropertyEditorColor.vue.d.ts +4 -4
  44. package/dist/components/sidebar/property/PbPropertyEditorHtml.vue.d.ts +4 -4
  45. package/dist/components/sidebar/property/PbPropertyEditorImage.vue.d.ts +7 -6
  46. package/dist/components/sidebar/property/PbPropertyEditorMultilineText.vue.d.ts +4 -4
  47. package/dist/components/sidebar/property/PbPropertyEditorReadonlyText.vue.d.ts +3 -3
  48. package/dist/components/sidebar/property/PbPropertyEditorSelect.vue.d.ts +4 -4
  49. package/dist/components/sidebar/property/PbPropertyEditorText.vue.d.ts +4 -4
  50. package/dist/components/sidebar/property/PbPropertyEditorYoutube.vue.d.ts +23 -0
  51. package/dist/components/sidebar/property/PbPropertyGroupEditorBackground.vue.d.ts +3 -3
  52. package/dist/components/sidebar/property/PbPropertyGroupEditorBorder.vue.d.ts +3 -3
  53. package/dist/components/sidebar/property/PbPropertyGroupEditorMargin.vue.d.ts +3 -3
  54. package/dist/components/sidebar/property/PbPropertyGroupEditorPadding.vue.d.ts +3 -3
  55. package/dist/components/sidebar/property/PbPropertyGroupEditorPosition.vue.d.ts +3 -3
  56. package/dist/components/sidebar/property/PbPropertyGroupEditorSize.vue.d.ts +3 -3
  57. package/dist/components/ui/PbColorPicker.vue.d.ts +20 -7
  58. package/dist/{index-Bss8IrUk.js → index-JVyoOgGq.js} +1241 -1273
  59. package/dist/model/default-part-property-group.d.ts +1 -0
  60. package/dist/model/page-builder-editor.d.ts +1 -1
  61. package/dist/model/page-builder-util.d.ts +2 -0
  62. package/dist/model/part-definintion.d.ts +1 -1
  63. package/dist/model/part-manager.d.ts +2 -0
  64. package/dist/model/part-property.d.ts +0 -2
  65. package/dist/page-builder-editor.js +19 -16
  66. package/dist/page-builder-editor.umd.cjs +1482 -1401
  67. package/package.json +8 -6
  68. package/dist/components/canvas/PbCanvasFrame.vue.d.ts +0 -2
@@ -1,11 +1,9 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => {
4
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
- return value;
6
- };
7
- import { ref, defineComponent, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, createCommentVNode, mergeProps, toDisplayString, onMounted, onBeforeUnmount, provide, inject, watch, Fragment, unref, createElementVNode, createBlock as createBlock$1, resolveDynamicComponent, normalizeProps, renderList, reactive, defineAsyncComponent, withDirectives, createVNode, resolveComponent, vModelText, resolveDirective, withModifiers, renderSlot, guardReactiveProps, markRaw, Teleport, toHandlers } from "vue";
8
- import { notNull, BSTextInput, vClickOutside, useModal, BSSelect, useContextMenu, BSTree } from "@g1cloud/bluesea";
3
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
+ import { ref, defineComponent, computed, openBlock, createElementBlock, normalizeStyle, createElementVNode, createCommentVNode, toDisplayString, onMounted, onBeforeUnmount, createBlock as createBlock$1, unref, provide, inject, watch, Fragment, renderList, resolveDynamicComponent, normalizeProps, mergeProps, normalizeClass, reactive, defineAsyncComponent, withDirectives, createVNode, resolveComponent, vModelText, resolveDirective, withModifiers, renderSlot, guardReactiveProps, markRaw, toHandlers, Teleport } from "vue";
5
+ import { notNull, BSTextInput, vClickOutside, useModal, BSSelect, BSTree, useContextMenu } from "@g1cloud/bluesea";
6
+ import YouTube from "vue3-youtube";
9
7
  const create$5 = () => /* @__PURE__ */ new Map();
10
8
  const copy = (m) => {
11
9
  const r = create$5();
@@ -635,10 +633,8 @@ const computeNoColorLoggingArgs = (args) => {
635
633
  let i = 0;
636
634
  for (; i < args.length; i++) {
637
635
  const arg = args[i];
638
- if (arg === void 0)
639
- ;
640
- else if (arg.constructor === String || arg.constructor === Number)
641
- ;
636
+ if (arg === void 0) ;
637
+ else if (arg.constructor === String || arg.constructor === Number) ;
642
638
  else if (arg.constructor === Object) {
643
639
  logArgs.push(JSON.stringify(arg));
644
640
  }
@@ -1984,8 +1980,7 @@ class UndoManager extends ObservableV2 {
1984
1980
  ytypes = isArray(ytypes) ? ytypes : [ytypes];
1985
1981
  ytypes.forEach((ytype) => {
1986
1982
  if (this.scope.every((yt) => yt !== ytype)) {
1987
- if (ytype.doc !== this.doc)
1988
- warn("[yjs#509] Not same Y.Doc");
1983
+ if (ytype.doc !== this.doc) warn("[yjs#509] Not same Y.Doc");
1989
1984
  this.scope.push(ytype);
1990
1985
  }
1991
1986
  });
@@ -3460,8 +3455,7 @@ const minimizeAttributeChanges = (currPos, attributes) => {
3460
3455
  ] ?? null,
3461
3456
  /** @type {ContentFormat} */
3462
3457
  currPos.right.content.value
3463
- ))
3464
- ;
3458
+ )) ;
3465
3459
  else {
3466
3460
  break;
3467
3461
  }
@@ -3515,41 +3509,40 @@ const formatText = (transaction, parent, currPos, length2, attributes) => {
3515
3509
  const ownClientId = doc.clientID;
3516
3510
  minimizeAttributeChanges(currPos, attributes);
3517
3511
  const negatedAttributes = insertAttributes(transaction, parent, currPos, attributes);
3518
- iterationLoop:
3519
- while (currPos.right !== null && (length2 > 0 || negatedAttributes.size > 0 && (currPos.right.deleted || currPos.right.content.constructor === ContentFormat))) {
3520
- if (!currPos.right.deleted) {
3521
- switch (currPos.right.content.constructor) {
3522
- case ContentFormat: {
3523
- const { key, value } = (
3524
- /** @type {ContentFormat} */
3525
- currPos.right.content
3526
- );
3527
- const attr = attributes[key];
3528
- if (attr !== void 0) {
3529
- if (equalAttrs(attr, value)) {
3530
- negatedAttributes.delete(key);
3531
- } else {
3532
- if (length2 === 0) {
3533
- break iterationLoop;
3534
- }
3535
- negatedAttributes.set(key, value);
3536
- }
3537
- currPos.right.delete(transaction);
3512
+ iterationLoop: while (currPos.right !== null && (length2 > 0 || negatedAttributes.size > 0 && (currPos.right.deleted || currPos.right.content.constructor === ContentFormat))) {
3513
+ if (!currPos.right.deleted) {
3514
+ switch (currPos.right.content.constructor) {
3515
+ case ContentFormat: {
3516
+ const { key, value } = (
3517
+ /** @type {ContentFormat} */
3518
+ currPos.right.content
3519
+ );
3520
+ const attr = attributes[key];
3521
+ if (attr !== void 0) {
3522
+ if (equalAttrs(attr, value)) {
3523
+ negatedAttributes.delete(key);
3538
3524
  } else {
3539
- currPos.currentAttributes.set(key, value);
3525
+ if (length2 === 0) {
3526
+ break iterationLoop;
3527
+ }
3528
+ negatedAttributes.set(key, value);
3540
3529
  }
3541
- break;
3530
+ currPos.right.delete(transaction);
3531
+ } else {
3532
+ currPos.currentAttributes.set(key, value);
3542
3533
  }
3543
- default:
3544
- if (length2 < currPos.right.length) {
3545
- getItemCleanStart(transaction, createID(currPos.right.id.client, currPos.right.id.clock + length2));
3546
- }
3547
- length2 -= currPos.right.length;
3548
- break;
3534
+ break;
3549
3535
  }
3536
+ default:
3537
+ if (length2 < currPos.right.length) {
3538
+ getItemCleanStart(transaction, createID(currPos.right.id.client, currPos.right.id.clock + length2));
3539
+ }
3540
+ length2 -= currPos.right.length;
3541
+ break;
3550
3542
  }
3551
- currPos.forward();
3552
3543
  }
3544
+ currPos.forward();
3545
+ }
3553
3546
  if (length2 > 0) {
3554
3547
  let newlines = "";
3555
3548
  for (; length2 > 0; length2--) {
@@ -3848,8 +3841,7 @@ class YTextEvent extends YEvent {
3848
3841
  retain = 0;
3849
3842
  break;
3850
3843
  }
3851
- if (op)
3852
- delta.push(op);
3844
+ if (op) delta.push(op);
3853
3845
  action = null;
3854
3846
  }
3855
3847
  };
@@ -5864,8 +5856,7 @@ const redoItem = (transaction, item, redoitems, itemsToDelete, ignoreRemoteMapCh
5864
5856
  left = item;
5865
5857
  while (left !== null && left.right !== null && (left.right.redone || isDeleted(itemsToDelete, left.right.id) || isDeletedByUndoStack(um.undoStack, left.right.id) || isDeletedByUndoStack(um.redoStack, left.right.id))) {
5866
5858
  left = left.right;
5867
- while (left.redone)
5868
- left = getItemCleanStart(transaction, left.redone);
5859
+ while (left.redone) left = getItemCleanStart(transaction, left.redone);
5869
5860
  }
5870
5861
  if (left && left.right !== null) {
5871
5862
  return null;
@@ -6642,10 +6633,7 @@ const PageBuilderEditorEvent = {
6642
6633
  };
6643
6634
  var __defProp2 = Object.defineProperty;
6644
6635
  var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6645
- var __publicField2 = (obj, key, value) => {
6646
- __defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
6647
- return value;
6648
- };
6636
+ var __publicField2 = (obj, key, value) => __defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
6649
6637
  const PART_ID_KEY$1 = "partId";
6650
6638
  const ROOT_TYPE$1 = "Root";
6651
6639
  const PAGE_TYPE$1 = "Page";
@@ -6694,92 +6682,76 @@ class Part {
6694
6682
  var _a;
6695
6683
  return ((_a = this.properties) == null ? void 0 : _a.classNames) || "";
6696
6684
  }
6685
+ getAlignStyleValue(align) {
6686
+ if (align === "left") return "flex-start";
6687
+ if (align === "right") return "flex-end";
6688
+ return "center";
6689
+ }
6697
6690
  getStyles() {
6698
- 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, _K, _L, _M, _N;
6691
+ 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, _K, _L, _M, _N, _O, _P;
6699
6692
  const style = {};
6700
- if (((_a = this.properties) == null ? void 0 : _a.direction) === "horizontal") {
6701
- style.display = "flex";
6702
- style.flexDirection = "row";
6703
- } else if (((_b = this.properties) == null ? void 0 : _b.direction) === "vertical") {
6704
- style.display = "flex";
6705
- style.flexDirection = "column";
6706
- }
6707
- if (((_c = this.properties) == null ? void 0 : _c.wrap) === "wrap") {
6693
+ const align = ((_a = this.properties) == null ? void 0 : _a.align) || "center";
6694
+ if (this.isWidget()) {
6695
+ style.alignSelf = this.getAlignStyleValue(align);
6696
+ } else {
6697
+ if (((_b = this.properties) == null ? void 0 : _b.direction) === "horizontal") {
6698
+ style.display = "flex";
6699
+ style.flexDirection = "row";
6700
+ style.justifyContent = this.getAlignStyleValue(align);
6701
+ } else if (((_c = this.properties) == null ? void 0 : _c.direction) === "vertical") {
6702
+ style.display = "flex";
6703
+ style.flexDirection = "column";
6704
+ style.alignItems = this.getAlignStyleValue(align);
6705
+ }
6706
+ }
6707
+ if (((_d = this.properties) == null ? void 0 : _d.wrap) === "wrap") {
6708
6708
  style.flexWrap = "wrap";
6709
6709
  }
6710
- if ((_d = this.properties) == null ? void 0 : _d.margin)
6711
- style.margin = this.properties.margin;
6712
- if ((_e = this.properties) == null ? void 0 : _e.marginLeft)
6713
- style.marginLeft = this.properties.marginLeft;
6714
- if ((_f = this.properties) == null ? void 0 : _f.marginRight)
6715
- style.marginRight = this.properties.marginRight;
6716
- if ((_g = this.properties) == null ? void 0 : _g.marginTop)
6717
- style.marginTop = this.properties.marginTop;
6718
- if ((_h = this.properties) == null ? void 0 : _h.marginBottom)
6719
- style.marginBottom = this.properties.marginBottom;
6720
- if ((_i = this.properties) == null ? void 0 : _i.padding)
6721
- style.padding = this.properties.padding;
6722
- if ((_j = this.properties) == null ? void 0 : _j.paddingLeft)
6723
- style.paddingLeft = this.properties.paddingLeft;
6724
- if ((_k = this.properties) == null ? void 0 : _k.paddingRight)
6725
- style.paddingRight = this.properties.paddingRight;
6726
- if ((_l = this.properties) == null ? void 0 : _l.paddingTop)
6727
- style.paddingTop = this.properties.paddingTop;
6728
- if ((_m = this.properties) == null ? void 0 : _m.paddingBottom)
6729
- style.paddingBottom = this.properties.paddingBottom;
6730
- if ((_n = this.properties) == null ? void 0 : _n.left)
6731
- style.left = this.properties.left;
6732
- if ((_o = this.properties) == null ? void 0 : _o.right)
6733
- style.right = this.properties.right;
6734
- if ((_p = this.properties) == null ? void 0 : _p.top)
6735
- style.top = this.properties.top;
6736
- if ((_q = this.properties) == null ? void 0 : _q.bottom)
6737
- style.bottom = this.properties.bottom;
6738
- if ((_r = this.properties) == null ? void 0 : _r.width)
6739
- style.width = this.properties.width;
6740
- if ((_s = this.properties) == null ? void 0 : _s.height)
6741
- style.height = this.properties.height;
6742
- if ((_t = this.properties) == null ? void 0 : _t.maxWidth)
6743
- style.width = this.properties.maxWidth;
6744
- if ((_u = this.properties) == null ? void 0 : _u.maxHeight)
6745
- style.height = this.properties.maxHeight;
6746
- if ((_v = this.properties) == null ? void 0 : _v.minWidth)
6747
- style.width = this.properties.minWidth;
6748
- if ((_w = this.properties) == null ? void 0 : _w.minHeight)
6749
- style.height = this.properties.minHeight;
6750
- if ((_x = this.properties) == null ? void 0 : _x.backgroundColor)
6751
- style.backgroundColor = this.properties.backgroundColor;
6752
- if ((_y = this.properties) == null ? void 0 : _y.borderLeftWidth)
6753
- style.borderLeftWidth = this.properties.borderLeftWidth;
6754
- if ((_z = this.properties) == null ? void 0 : _z.borderRightWidth)
6755
- style.borderRightWidth = this.properties.borderRightWidth;
6756
- if ((_A = this.properties) == null ? void 0 : _A.borderTopWidth)
6757
- style.borderTopWidth = this.properties.borderTopWidth;
6758
- if ((_B = this.properties) == null ? void 0 : _B.borderBottomWidth)
6759
- style.borderBottomWidth = this.properties.borderBottomWidth;
6760
- if ((_C = this.properties) == null ? void 0 : _C.borderTopLeftRadius)
6761
- style.borderTopLeftRadius = this.properties.borderTopLeftRadius;
6762
- if ((_D = this.properties) == null ? void 0 : _D.borderTopRightRadius)
6763
- style.borderTopRightRadius = this.properties.borderTopRightRadius;
6764
- if ((_E = this.properties) == null ? void 0 : _E.borderBottomLeftRadius)
6765
- style.borderBottomLeftRadius = this.properties.borderBottomLeftRadius;
6766
- if ((_F = this.properties) == null ? void 0 : _F.borderBottomRightRadius)
6767
- style.borderBottomRightRadius = this.properties.borderBottomRightRadius;
6768
- if (((_G = this.properties) == null ? void 0 : _G.borderColor) && style.borderLeftWidth) {
6710
+ if ((_e = this.properties) == null ? void 0 : _e.margin) style.margin = this.properties.margin;
6711
+ if ((_f = this.properties) == null ? void 0 : _f.marginLeft) style.marginLeft = this.properties.marginLeft;
6712
+ if ((_g = this.properties) == null ? void 0 : _g.marginRight) style.marginRight = this.properties.marginRight;
6713
+ if ((_h = this.properties) == null ? void 0 : _h.marginTop) style.marginTop = this.properties.marginTop;
6714
+ if ((_i = this.properties) == null ? void 0 : _i.marginBottom) style.marginBottom = this.properties.marginBottom;
6715
+ if ((_j = this.properties) == null ? void 0 : _j.padding) style.padding = this.properties.padding;
6716
+ if ((_k = this.properties) == null ? void 0 : _k.paddingLeft) style.paddingLeft = this.properties.paddingLeft;
6717
+ if ((_l = this.properties) == null ? void 0 : _l.paddingRight) style.paddingRight = this.properties.paddingRight;
6718
+ if ((_m = this.properties) == null ? void 0 : _m.paddingTop) style.paddingTop = this.properties.paddingTop;
6719
+ if ((_n = this.properties) == null ? void 0 : _n.paddingBottom) style.paddingBottom = this.properties.paddingBottom;
6720
+ if ((_o = this.properties) == null ? void 0 : _o.left) style.left = this.properties.left;
6721
+ if ((_p = this.properties) == null ? void 0 : _p.right) style.right = this.properties.right;
6722
+ if ((_q = this.properties) == null ? void 0 : _q.top) style.top = this.properties.top;
6723
+ if ((_r = this.properties) == null ? void 0 : _r.bottom) style.bottom = this.properties.bottom;
6724
+ if ((_s = this.properties) == null ? void 0 : _s.width) style.width = this.properties.width;
6725
+ if ((_t = this.properties) == null ? void 0 : _t.height) style.height = this.properties.height;
6726
+ if ((_u = this.properties) == null ? void 0 : _u.maxWidth) style.width = this.properties.maxWidth;
6727
+ if ((_v = this.properties) == null ? void 0 : _v.maxHeight) style.height = this.properties.maxHeight;
6728
+ if ((_w = this.properties) == null ? void 0 : _w.minWidth) style.width = this.properties.minWidth;
6729
+ if ((_x = this.properties) == null ? void 0 : _x.minHeight) style.height = this.properties.minHeight;
6730
+ if ((_y = this.properties) == null ? void 0 : _y.textAlign) style.textAlign = this.properties.textAlign;
6731
+ if ((_z = this.properties) == null ? void 0 : _z.backgroundColor) style.backgroundColor = this.properties.backgroundColor;
6732
+ if ((_A = this.properties) == null ? void 0 : _A.borderLeftWidth) style.borderLeftWidth = this.properties.borderLeftWidth;
6733
+ if ((_B = this.properties) == null ? void 0 : _B.borderRightWidth) style.borderRightWidth = this.properties.borderRightWidth;
6734
+ if ((_C = this.properties) == null ? void 0 : _C.borderTopWidth) style.borderTopWidth = this.properties.borderTopWidth;
6735
+ if ((_D = this.properties) == null ? void 0 : _D.borderBottomWidth) style.borderBottomWidth = this.properties.borderBottomWidth;
6736
+ if ((_E = this.properties) == null ? void 0 : _E.borderTopLeftRadius) style.borderTopLeftRadius = this.properties.borderTopLeftRadius;
6737
+ if ((_F = this.properties) == null ? void 0 : _F.borderTopRightRadius) style.borderTopRightRadius = this.properties.borderTopRightRadius;
6738
+ if ((_G = this.properties) == null ? void 0 : _G.borderBottomLeftRadius) style.borderBottomLeftRadius = this.properties.borderBottomLeftRadius;
6739
+ if ((_H = this.properties) == null ? void 0 : _H.borderBottomRightRadius) style.borderBottomRightRadius = this.properties.borderBottomRightRadius;
6740
+ if (((_I = this.properties) == null ? void 0 : _I.borderColor) && style.borderLeftWidth) {
6769
6741
  style.borderLeftStyle = "solid";
6770
- style.borderLeftColor = (_H = this.properties) == null ? void 0 : _H.borderColor;
6742
+ style.borderLeftColor = (_J = this.properties) == null ? void 0 : _J.borderColor;
6771
6743
  }
6772
- if (((_I = this.properties) == null ? void 0 : _I.borderColor) && style.borderRightWidth) {
6744
+ if (((_K = this.properties) == null ? void 0 : _K.borderColor) && style.borderRightWidth) {
6773
6745
  style.borderRightStyle = "solid";
6774
- style.borderRightColor = (_J = this.properties) == null ? void 0 : _J.borderColor;
6746
+ style.borderRightColor = (_L = this.properties) == null ? void 0 : _L.borderColor;
6775
6747
  }
6776
- if (((_K = this.properties) == null ? void 0 : _K.borderColor) && style.borderTopWidth) {
6748
+ if (((_M = this.properties) == null ? void 0 : _M.borderColor) && style.borderTopWidth) {
6777
6749
  style.borderTopStyle = "solid";
6778
- style.borderTopColor = (_L = this.properties) == null ? void 0 : _L.borderColor;
6750
+ style.borderTopColor = (_N = this.properties) == null ? void 0 : _N.borderColor;
6779
6751
  }
6780
- if (((_M = this.properties) == null ? void 0 : _M.borderColor) && style.borderBottomWidth) {
6752
+ if (((_O = this.properties) == null ? void 0 : _O.borderColor) && style.borderBottomWidth) {
6781
6753
  style.borderBottomStyle = "solid";
6782
- style.borderBottomColor = (_N = this.properties) == null ? void 0 : _N.borderColor;
6754
+ style.borderBottomColor = (_P = this.properties) == null ? void 0 : _P.borderColor;
6783
6755
  }
6784
6756
  return style;
6785
6757
  }
@@ -6787,8 +6759,7 @@ class Part {
6787
6759
  var _a;
6788
6760
  const styleObject = {};
6789
6761
  const inlineStyle = (_a = this.properties) == null ? void 0 : _a.inlineStyle;
6790
- if (!inlineStyle)
6791
- return styleObject;
6762
+ if (!inlineStyle) return styleObject;
6792
6763
  inlineStyle.split(";").forEach((rule) => {
6793
6764
  if (rule.trim()) {
6794
6765
  const [property, value] = rule.split(":").map((part) => part.trim());
@@ -6803,8 +6774,7 @@ class Part {
6803
6774
  getStyleTag() {
6804
6775
  var _a;
6805
6776
  const css = (_a = this.properties) == null ? void 0 : _a.style;
6806
- if (!css)
6807
- return "";
6777
+ if (!css) return "";
6808
6778
  return css.replace(/([^{]+){/g, (match) => {
6809
6779
  if (match.trim().startsWith("@")) {
6810
6780
  return match;
@@ -6874,51 +6844,43 @@ let Model$1 = class Model {
6874
6844
  this.rootPart = ref(new RootPart());
6875
6845
  }
6876
6846
  };
6877
- const _hoisted_1$9$1 = ["data-part-id"];
6878
- const _hoisted_2$6$1 = {
6879
- key: 1,
6880
- class: "pb-nested-widget"
6881
- };
6882
- const _sfc_main$a$1 = /* @__PURE__ */ defineComponent({
6847
+ const _hoisted_1$b$1 = ["data-part-id"];
6848
+ const _sfc_main$c$1 = /* @__PURE__ */ defineComponent({
6883
6849
  __name: "PbWidget",
6884
6850
  props: {
6885
6851
  part: {}
6886
6852
  },
6887
6853
  setup(__props) {
6888
6854
  const props = __props;
6889
- const properties = computed(() => ({ style: props.part.getStyles() }));
6855
+ const className = computed(() => getPartClassName(props.part));
6890
6856
  const styleTag = computed(() => props.part.getStyleTag());
6857
+ const style = computed(() => ({
6858
+ ...props.part.getStyles(),
6859
+ ...props.part.getInlineStyles()
6860
+ }));
6891
6861
  const thisComponent = computed(() => createPartComponent(props.part));
6892
- const childComponents = computed(() => createPartComponents(props.part.children));
6893
6862
  return (_ctx, _cache) => {
6894
6863
  return openBlock(), createElementBlock(Fragment, null, [
6895
6864
  styleTag.value ? (openBlock(), createBlock$1(resolveDynamicComponent("style"), {
6896
6865
  key: 0,
6897
6866
  innerHTML: styleTag.value
6898
6867
  }, null, 8, ["innerHTML"])) : createCommentVNode("", true),
6899
- createElementVNode("div", mergeProps({
6868
+ createElementVNode("div", {
6869
+ class: normalizeClass([className.value, "pb-widget"]),
6900
6870
  "data-part-id": _ctx.part.partId,
6901
- class: "pb-widget"
6902
- }, properties.value), [
6871
+ style: normalizeStyle(style.value)
6872
+ }, [
6903
6873
  thisComponent.value ? (openBlock(), createBlock$1(resolveDynamicComponent(thisComponent.value), {
6904
6874
  key: 0,
6905
6875
  part: _ctx.part
6906
- }, null, 8, ["part"])) : createCommentVNode("", true),
6907
- childComponents.value && childComponents.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_2$6$1, [
6908
- (openBlock(true), createElementBlock(Fragment, null, renderList(childComponents.value, (child) => {
6909
- return openBlock(), createBlock$1(resolveDynamicComponent(child.component), {
6910
- key: child.part.partId,
6911
- part: child.part
6912
- }, null, 8, ["part"]);
6913
- }), 128))
6914
- ])) : createCommentVNode("", true)
6915
- ], 16, _hoisted_1$9$1)
6876
+ }, null, 8, ["part"])) : createCommentVNode("", true)
6877
+ ], 14, _hoisted_1$b$1)
6916
6878
  ], 64);
6917
6879
  };
6918
6880
  }
6919
6881
  });
6920
- const _hoisted_1$8$1 = ["data-part-id"];
6921
- const _sfc_main$9$1 = /* @__PURE__ */ defineComponent({
6882
+ const _hoisted_1$a$1 = ["data-part-id"];
6883
+ const _sfc_main$b$1 = /* @__PURE__ */ defineComponent({
6922
6884
  __name: "PbBlock",
6923
6885
  props: {
6924
6886
  part: {}
@@ -6927,112 +6889,100 @@ const _sfc_main$9$1 = /* @__PURE__ */ defineComponent({
6927
6889
  const props = __props;
6928
6890
  const classNames = computed(() => props.part.getClassNames());
6929
6891
  const styleTag = computed(() => props.part.getStyleTag());
6930
- const properties = computed(() => ({
6931
- style: {
6932
- ...props.part.getStyles(),
6933
- ...props.part.getInlineStyles()
6934
- }
6892
+ const style = computed(() => ({
6893
+ ...props.part.getStyles(),
6894
+ ...props.part.getInlineStyles()
6935
6895
  }));
6936
6896
  computed(() => createPartComponents(props.part.children));
6937
6897
  return (_ctx, _cache) => {
6938
- var _a;
6939
6898
  return openBlock(), createElementBlock(Fragment, null, [
6940
6899
  styleTag.value ? (openBlock(), createBlock$1(resolveDynamicComponent("style"), {
6941
6900
  key: 0,
6942
6901
  innerHTML: styleTag.value
6943
6902
  }, null, 8, ["innerHTML"])) : createCommentVNode("", true),
6944
- createElementVNode("div", mergeProps({
6945
- class: [classNames.value, "pb-block"],
6903
+ createElementVNode("div", {
6904
+ class: normalizeClass([classNames.value, "pb-block"]),
6946
6905
  "data-part-id": _ctx.part.partId,
6947
- style: (_a = _ctx.part.properties) == null ? void 0 : _a.css
6948
- }, properties.value), [
6906
+ style: normalizeStyle(style.value)
6907
+ }, [
6949
6908
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.part.children, (child) => {
6950
- return openBlock(), createBlock$1(_sfc_main$a$1, {
6909
+ return openBlock(), createBlock$1(_sfc_main$c$1, {
6951
6910
  key: child.partId,
6952
6911
  part: child
6953
6912
  }, null, 8, ["part"]);
6954
6913
  }), 128))
6955
- ], 16, _hoisted_1$8$1)
6914
+ ], 14, _hoisted_1$a$1)
6956
6915
  ], 64);
6957
6916
  };
6958
6917
  }
6959
6918
  });
6960
- const _hoisted_1$7$1 = { class: "pb-block" };
6961
- const _hoisted_2$5$1 = /* @__PURE__ */ createElementVNode("div", {
6962
- class: "pb-widget",
6963
- style: { "margin": "0 auto" }
6964
- }, [
6965
- /* @__PURE__ */ createElementVNode("div", { class: "pb-login-widget" }, [
6966
- /* @__PURE__ */ createElementVNode("h3", null, "Login Design Part")
6967
- ])
6968
- ], -1);
6969
- const _hoisted_3$4$1 = [
6970
- _hoisted_2$5$1
6971
- ];
6972
- const _sfc_main$8$1 = /* @__PURE__ */ defineComponent({
6919
+ const _hoisted_1$9$1 = { class: "pb-block" };
6920
+ const _sfc_main$a$1 = /* @__PURE__ */ defineComponent({
6973
6921
  __name: "PbLoginDepart",
6974
6922
  props: {
6975
6923
  part: {}
6976
6924
  },
6977
6925
  setup(__props) {
6978
6926
  return (_ctx, _cache) => {
6979
- return openBlock(), createElementBlock("div", _hoisted_1$7$1, _hoisted_3$4$1);
6927
+ return openBlock(), createElementBlock("div", _hoisted_1$9$1, _cache[0] || (_cache[0] = [
6928
+ createElementVNode("div", {
6929
+ class: "pb-widget",
6930
+ style: { "margin": "0 auto" }
6931
+ }, [
6932
+ createElementVNode("div", { class: "pb-login-widget" }, [
6933
+ createElementVNode("h3", null, "Login Design Part")
6934
+ ])
6935
+ ], -1)
6936
+ ]));
6980
6937
  };
6981
6938
  }
6982
6939
  });
6983
- const _hoisted_1$6$1 = ["data-part-id"];
6984
- const _sfc_main$7$1 = /* @__PURE__ */ defineComponent({
6940
+ const _hoisted_1$8$1 = ["data-part-id"];
6941
+ const _sfc_main$9$1 = /* @__PURE__ */ defineComponent({
6985
6942
  __name: "PbSection",
6986
6943
  props: {
6987
6944
  part: {}
6988
6945
  },
6989
6946
  setup(__props) {
6990
6947
  const props = __props;
6991
- const styleTag = computed(() => props.part.getStyleTag());
6992
6948
  const classNames = computed(() => props.part.getClassNames());
6993
- const properties = computed(() => ({
6994
- style: {
6995
- ...props.part.getStyles(),
6996
- ...props.part.getInlineStyles()
6997
- }
6949
+ const styleTag = computed(() => props.part.getStyleTag());
6950
+ const style = computed(() => ({
6951
+ ...props.part.getStyles(),
6952
+ ...props.part.getInlineStyles()
6998
6953
  }));
6999
6954
  return (_ctx, _cache) => {
7000
- var _a, _b;
6955
+ var _a;
7001
6956
  return openBlock(), createElementBlock(Fragment, null, [
7002
6957
  styleTag.value ? (openBlock(), createBlock$1(resolveDynamicComponent("style"), {
7003
6958
  key: 0,
7004
6959
  innerHTML: styleTag.value
7005
6960
  }, null, 8, ["innerHTML"])) : createCommentVNode("", true),
7006
- createElementVNode("div", mergeProps({
7007
- class: [classNames.value, "pb-section"],
6961
+ createElementVNode("div", {
6962
+ class: normalizeClass([classNames.value, "pb-section"]),
7008
6963
  "data-part-id": _ctx.part.partId,
7009
- style: (_a = _ctx.part.properties) == null ? void 0 : _a.css
7010
- }, properties.value), [
7011
- ((_b = _ctx.part.properties) == null ? void 0 : _b.name) === "Login Design Part" ? (openBlock(), createBlock$1(_sfc_main$8$1, {
6964
+ style: normalizeStyle(style.value)
6965
+ }, [
6966
+ ((_a = _ctx.part.properties) == null ? void 0 : _a.name) === "Login Design Part" ? (openBlock(), createBlock$1(_sfc_main$a$1, {
7012
6967
  key: 0,
7013
6968
  part: _ctx.part
7014
6969
  }, null, 8, ["part"])) : _ctx.part.children && _ctx.part.children.length > 0 ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(_ctx.part.children, (block) => {
7015
- return openBlock(), createBlock$1(_sfc_main$9$1, {
6970
+ return openBlock(), createBlock$1(_sfc_main$b$1, {
7016
6971
  key: block.partId,
7017
6972
  part: block
7018
6973
  }, null, 8, ["part"]);
7019
6974
  }), 128)) : createCommentVNode("", true)
7020
- ], 16, _hoisted_1$6$1)
6975
+ ], 14, _hoisted_1$8$1)
7021
6976
  ], 64);
7022
6977
  };
7023
6978
  }
7024
6979
  });
7025
- const _hoisted_1$5$1 = { class: "pb-image-widget" };
7026
- const _hoisted_2$4$1 = ["src"];
7027
- const _hoisted_3$3$1 = {
6980
+ const _hoisted_1$7$1 = ["alt", "src"];
6981
+ const _hoisted_2$4$1 = {
7028
6982
  key: 1,
7029
6983
  class: "placeholder"
7030
6984
  };
7031
- const _hoisted_4$d = /* @__PURE__ */ createElementVNode("span", { class: "font-icon" }, "image", -1);
7032
- const _hoisted_5$7 = [
7033
- _hoisted_4$d
7034
- ];
7035
- const _sfc_main$6$1 = /* @__PURE__ */ defineComponent({
6985
+ const _sfc_main$8$1 = /* @__PURE__ */ defineComponent({
7036
6986
  __name: "PbImageWidget",
7037
6987
  props: {
7038
6988
  part: {},
@@ -7040,34 +6990,47 @@ const _sfc_main$6$1 = /* @__PURE__ */ defineComponent({
7040
6990
  },
7041
6991
  setup(__props) {
7042
6992
  const props = __props;
7043
- const classNames = computed(() => props.part.getClassNames());
7044
- computed(() => ({
7045
- style: {
7046
- ...props.part.getInlineStyles()
6993
+ const pageBuilder = usePageBuilder();
6994
+ const altText = computed(() => {
6995
+ var _a;
6996
+ const media = (_a = props.part.properties) == null ? void 0 : _a.media;
6997
+ if (media && media.altText) {
6998
+ const locale = pageBuilder.getLocale();
6999
+ return media.altText[locale] || "";
7047
7000
  }
7048
- }));
7001
+ return "";
7002
+ });
7003
+ const style = computed(() => {
7004
+ var _a;
7005
+ const media = (_a = props.part.properties) == null ? void 0 : _a.media;
7006
+ if (media.width && media.height) {
7007
+ return {
7008
+ aspectRatio: media.width / media.height
7009
+ };
7010
+ }
7011
+ return {};
7012
+ });
7049
7013
  return (_ctx, _cache) => {
7050
- var _a, _b, _c;
7051
- return openBlock(), createElementBlock("div", _hoisted_1$5$1, [
7052
- ((_a = _ctx.part.properties) == null ? void 0 : _a.image) ? (openBlock(), createElementBlock("img", {
7053
- key: 0,
7054
- class: normalizeClass([classNames.value, "image"]),
7055
- src: (_b = _ctx.part.properties) == null ? void 0 : _b.image,
7056
- style: normalizeStyle((_c = _ctx.part.properties) == null ? void 0 : _c.inlineStyle),
7057
- alt: ""
7058
- }, null, 14, _hoisted_2$4$1)) : _ctx.placeholder ? (openBlock(), createElementBlock("div", _hoisted_3$3$1, _hoisted_5$7)) : createCommentVNode("", true)
7059
- ]);
7014
+ var _a, _b;
7015
+ return ((_a = _ctx.part.properties) == null ? void 0 : _a.media) ? (openBlock(), createElementBlock("img", {
7016
+ key: 0,
7017
+ alt: altText.value,
7018
+ src: ((_b = _ctx.part.properties) == null ? void 0 : _b.media).url,
7019
+ style: normalizeStyle(style.value),
7020
+ class: "image"
7021
+ }, null, 12, _hoisted_1$7$1)) : _ctx.placeholder ? (openBlock(), createElementBlock("div", _hoisted_2$4$1, _cache[0] || (_cache[0] = [
7022
+ createElementVNode("span", { class: "font-icon" }, "image", -1)
7023
+ ]))) : createCommentVNode("", true);
7060
7024
  };
7061
7025
  }
7062
7026
  });
7063
- const _hoisted_1$4$1 = { class: "pb-text-widget" };
7064
- const _hoisted_2$3$1 = ["textContent"];
7065
- const _hoisted_3$2$1 = {
7027
+ const _hoisted_1$6$1 = ["textContent"];
7028
+ const _hoisted_2$3$1 = {
7066
7029
  key: 1,
7067
7030
  class: "placeholder",
7068
7031
  textContent: "Empty Text"
7069
7032
  };
7070
- const _sfc_main$5$1 = /* @__PURE__ */ defineComponent({
7033
+ const _sfc_main$7$1 = /* @__PURE__ */ defineComponent({
7071
7034
  __name: "PbTextWidget",
7072
7035
  props: {
7073
7036
  part: {},
@@ -7087,39 +7050,32 @@ const _sfc_main$5$1 = /* @__PURE__ */ defineComponent({
7087
7050
  }
7088
7051
  }
7089
7052
  });
7090
- const classNames = computed(() => props.part.getClassNames());
7091
7053
  const style = computed(() => {
7092
7054
  var _a, _b, _c, _d;
7093
7055
  return {
7094
- style: {
7095
- fontSize: (_a = props.part.properties) == null ? void 0 : _a.fontSize,
7096
- fontWeight: (_b = props.part.properties) == null ? void 0 : _b.fontWeight,
7097
- color: (_c = props.part.properties) == null ? void 0 : _c.color,
7098
- textAlign: (_d = props.part.properties) == null ? void 0 : _d.textAlign,
7099
- ...props.part.getInlineStyles()
7100
- }
7056
+ fontSize: (_a = props.part.properties) == null ? void 0 : _a.fontSize,
7057
+ fontWeight: (_b = props.part.properties) == null ? void 0 : _b.fontWeight,
7058
+ textAlign: (_c = props.part.properties) == null ? void 0 : _c.textAlign,
7059
+ color: (_d = props.part.properties) == null ? void 0 : _d.color
7101
7060
  };
7102
7061
  });
7103
7062
  return (_ctx, _cache) => {
7104
- return openBlock(), createElementBlock("div", _hoisted_1$4$1, [
7105
- text.value ? (openBlock(), createElementBlock("div", mergeProps({
7106
- key: 0,
7107
- class: [classNames.value, "text l-header-event__id-text"]
7108
- }, style.value, {
7109
- textContent: toDisplayString(text.value)
7110
- }), null, 16, _hoisted_2$3$1)) : _ctx.placeholder ? (openBlock(), createElementBlock("div", _hoisted_3$2$1)) : createCommentVNode("", true)
7111
- ]);
7063
+ return text.value ? (openBlock(), createElementBlock("div", {
7064
+ key: 0,
7065
+ style: normalizeStyle(style.value),
7066
+ class: "text",
7067
+ textContent: toDisplayString(text.value)
7068
+ }, null, 12, _hoisted_1$6$1)) : _ctx.placeholder ? (openBlock(), createElementBlock("div", _hoisted_2$3$1)) : createCommentVNode("", true);
7112
7069
  };
7113
7070
  }
7114
7071
  });
7115
- const _hoisted_1$3$1 = { class: "pb-html-widget" };
7116
- const _hoisted_2$2$1 = ["innerHTML"];
7117
- const _hoisted_3$1$1 = {
7072
+ const _hoisted_1$5$1 = ["innerHTML"];
7073
+ const _hoisted_2$2$1 = {
7118
7074
  key: 1,
7119
7075
  class: "placeholder",
7120
7076
  textContent: "Empty HTML"
7121
7077
  };
7122
- const _sfc_main$4$1 = /* @__PURE__ */ defineComponent({
7078
+ const _sfc_main$6$1 = /* @__PURE__ */ defineComponent({
7123
7079
  __name: "PbHtmlWidget",
7124
7080
  props: {
7125
7081
  part: {},
@@ -7129,11 +7085,9 @@ const _sfc_main$4$1 = /* @__PURE__ */ defineComponent({
7129
7085
  const props = __props;
7130
7086
  const pageBuilder = usePageBuilder();
7131
7087
  const getHtml = (html2) => {
7132
- if (!html2)
7133
- return;
7134
- if (typeof html2 !== "object")
7135
- return;
7136
- const locale = pageBuilder.locale.value;
7088
+ if (!html2) return;
7089
+ if (typeof html2 !== "object") return;
7090
+ const locale = pageBuilder.getLocale();
7137
7091
  let _html = html2[locale];
7138
7092
  if (!_html && html2.tags) {
7139
7093
  _html = html2;
@@ -7150,33 +7104,22 @@ ${_html.style}
7150
7104
  var _a;
7151
7105
  return getHtml((_a = props.part.properties) == null ? void 0 : _a.html);
7152
7106
  });
7153
- const classNames = computed(() => props.part.getClassNames());
7154
- computed(() => ({
7155
- style: {
7156
- ...props.part.getInlineStyles()
7157
- }
7158
- }));
7159
7107
  return (_ctx, _cache) => {
7160
- var _a;
7161
- return openBlock(), createElementBlock("div", _hoisted_1$3$1, [
7162
- html.value ? (openBlock(), createElementBlock("div", {
7163
- key: 0,
7164
- class: normalizeClass([classNames.value, "html"]),
7165
- style: normalizeStyle((_a = _ctx.part.properties) == null ? void 0 : _a.inlineStyle),
7166
- innerHTML: html.value
7167
- }, null, 14, _hoisted_2$2$1)) : _ctx.placeholder ? (openBlock(), createElementBlock("div", _hoisted_3$1$1)) : createCommentVNode("", true)
7168
- ]);
7108
+ return html.value ? (openBlock(), createElementBlock("div", {
7109
+ key: 0,
7110
+ class: "html",
7111
+ innerHTML: html.value
7112
+ }, null, 8, _hoisted_1$5$1)) : _ctx.placeholder ? (openBlock(), createElementBlock("div", _hoisted_2$2$1)) : createCommentVNode("", true);
7169
7113
  };
7170
7114
  }
7171
7115
  });
7172
- const _hoisted_1$2$1 = { class: "pb-iframe-widget" };
7173
- const _hoisted_2$1$1 = ["src"];
7174
- const _hoisted_3$h = {
7116
+ const _hoisted_1$4$1 = ["src"];
7117
+ const _hoisted_2$1$1 = {
7175
7118
  key: 1,
7176
7119
  class: "placeholder",
7177
7120
  textContent: "Empty URL"
7178
7121
  };
7179
- const _sfc_main$3$1 = /* @__PURE__ */ defineComponent({
7122
+ const _sfc_main$5$1 = /* @__PURE__ */ defineComponent({
7180
7123
  __name: "PbIframeWidget",
7181
7124
  props: {
7182
7125
  part: {},
@@ -7188,23 +7131,18 @@ const _sfc_main$3$1 = /* @__PURE__ */ defineComponent({
7188
7131
  const url = computed(() => {
7189
7132
  var _a;
7190
7133
  const url2 = (_a = props.part.properties) == null ? void 0 : _a.url;
7191
- if (!url2)
7192
- return;
7193
- if (typeof url2 !== "object")
7194
- return;
7134
+ if (!url2) return;
7135
+ if (typeof url2 !== "object") return;
7195
7136
  const locale = pageBuilder.getLocale();
7196
7137
  return url2[locale];
7197
7138
  });
7198
- const classNames = computed(() => props.part.getClassNames());
7199
7139
  const style = computed(() => ({
7200
- style: {
7201
- width: "100%",
7202
- height: `${height.value}px`,
7203
- ...props.part.getInlineStyles()
7204
- }
7140
+ width: "100%",
7141
+ height: `${height.value}px`
7205
7142
  }));
7206
7143
  const height = ref(200);
7207
7144
  const updateHeight = (event) => {
7145
+ console.log(event);
7208
7146
  if (event.data && event.data.height) {
7209
7147
  height.value = event.data.height;
7210
7148
  }
@@ -7216,15 +7154,40 @@ const _sfc_main$3$1 = /* @__PURE__ */ defineComponent({
7216
7154
  window.removeEventListener("message", updateHeight);
7217
7155
  });
7218
7156
  return (_ctx, _cache) => {
7219
- var _a;
7220
- return openBlock(), createElementBlock("div", _hoisted_1$2$1, [
7221
- url.value ? (openBlock(), createElementBlock("iframe", mergeProps({
7222
- key: 0,
7223
- class: classNames.value,
7224
- src: url.value,
7225
- style: (_a = _ctx.part.properties) == null ? void 0 : _a.inlineStyle
7226
- }, style.value), null, 16, _hoisted_2$1$1)) : _ctx.placeholder ? (openBlock(), createElementBlock("div", _hoisted_3$h)) : createCommentVNode("", true)
7227
- ]);
7157
+ return url.value ? (openBlock(), createElementBlock("iframe", {
7158
+ key: 0,
7159
+ src: url.value,
7160
+ style: normalizeStyle(style.value)
7161
+ }, null, 12, _hoisted_1$4$1)) : _ctx.placeholder ? (openBlock(), createElementBlock("div", _hoisted_2$1$1)) : createCommentVNode("", true);
7162
+ };
7163
+ }
7164
+ });
7165
+ const _hoisted_1$3$1 = {
7166
+ key: 1,
7167
+ class: "placeholder"
7168
+ };
7169
+ const _sfc_main$4$1 = /* @__PURE__ */ defineComponent({
7170
+ __name: "PbYoutubeWidget",
7171
+ props: {
7172
+ part: {},
7173
+ placeholder: { type: Boolean }
7174
+ },
7175
+ setup(__props) {
7176
+ const onReady = () => {
7177
+ };
7178
+ return (_ctx, _cache) => {
7179
+ var _a, _b;
7180
+ return ((_a = _ctx.part.properties) == null ? void 0 : _a.url) ? (openBlock(), createBlock$1(unref(YouTube), {
7181
+ key: 0,
7182
+ ref: "youtube",
7183
+ src: ((_b = _ctx.part.properties) == null ? void 0 : _b.url) || "",
7184
+ class: "youtube",
7185
+ height: "100%",
7186
+ width: "100%",
7187
+ onReady
7188
+ }, null, 8, ["src"])) : _ctx.placeholder ? (openBlock(), createElementBlock("div", _hoisted_1$3$1, _cache[0] || (_cache[0] = [
7189
+ createElementVNode("span", { class: "font-icon" }, "live_tv", -1)
7190
+ ]))) : createCommentVNode("", true);
7228
7191
  };
7229
7192
  }
7230
7193
  });
@@ -7232,32 +7195,50 @@ const defaultPartDefinitions = {
7232
7195
  "Section": {
7233
7196
  partType: "Section",
7234
7197
  partName: "Section",
7235
- creator: () => _sfc_main$7$1
7198
+ className: "pb-section",
7199
+ creator: () => _sfc_main$9$1
7236
7200
  },
7237
7201
  "Block": {
7238
7202
  partType: "Block",
7239
7203
  partName: "Block",
7240
- creator: () => _sfc_main$9$1
7204
+ className: "pb-block",
7205
+ creator: () => _sfc_main$b$1
7241
7206
  },
7242
7207
  "TextWidget": {
7243
7208
  partType: "Widget",
7244
7209
  partName: "TextWidget",
7245
- creator: () => _sfc_main$5$1
7210
+ className: "pb-text-widget",
7211
+ creator: () => _sfc_main$7$1
7246
7212
  },
7247
7213
  "ImageWidget": {
7248
7214
  partType: "Widget",
7249
7215
  partName: "ImageWidget",
7250
- creator: () => _sfc_main$6$1
7216
+ className: "pb-image-widget",
7217
+ creator: () => _sfc_main$8$1
7251
7218
  },
7252
7219
  "HtmlWidget": {
7253
7220
  partType: "Widget",
7254
7221
  partName: "HtmlWidget",
7255
- creator: () => _sfc_main$4$1
7222
+ className: "pb-html-widget",
7223
+ creator: () => _sfc_main$6$1
7256
7224
  },
7257
7225
  "IframeWidget": {
7258
7226
  partType: "Widget",
7259
7227
  partName: "IframeWidget",
7260
- creator: () => _sfc_main$3$1
7228
+ className: "pb-iframe-widget",
7229
+ creator: () => _sfc_main$5$1
7230
+ },
7231
+ "YoutubeWidget": {
7232
+ partType: "Widget",
7233
+ partName: "YoutubeWidget",
7234
+ className: "pb-youtube-widget",
7235
+ creator: () => _sfc_main$4$1
7236
+ },
7237
+ "ContainerWidget": {
7238
+ partType: "Widget",
7239
+ partName: "ContainerWidget",
7240
+ className: "pb-container-widget",
7241
+ creator: () => _sfc_main$4$1
7261
7242
  }
7262
7243
  };
7263
7244
  const PAGE_BUILDER_KEY = "PageBuilder";
@@ -7305,20 +7286,16 @@ class PageBuilderViewerImpl {
7305
7286
  }
7306
7287
  watchCustomWidgetData(part) {
7307
7288
  const def = partDefinitions$1[part.partName];
7308
- if (!def || !def.dataWatcher)
7309
- return false;
7289
+ if (!def || !def.dataWatcher) return false;
7310
7290
  const watcher = this.watchers[def.dataWatcher];
7311
- if (!watcher)
7312
- return false;
7291
+ if (!watcher) return false;
7313
7292
  return watcher(part.properties);
7314
7293
  }
7315
7294
  provideCustomWidgetData(part) {
7316
7295
  const def = partDefinitions$1[part.partName];
7317
- if (!def || !def.dataProvider)
7318
- return Promise.resolve();
7296
+ if (!def || !def.dataProvider) return Promise.resolve();
7319
7297
  const provider = this.providers[def.dataProvider];
7320
- if (!provider)
7321
- return Promise.resolve();
7298
+ if (!provider) return Promise.resolve();
7322
7299
  return provider(part.properties);
7323
7300
  }
7324
7301
  render(data) {
@@ -7338,15 +7315,13 @@ class PageBuilderViewerImpl {
7338
7315
  }
7339
7316
  parsePartContent(partContent) {
7340
7317
  const part = this.createPart(partContent.partType);
7341
- if (!part)
7342
- return;
7318
+ if (!part) return;
7343
7319
  part.partType = partContent.partType;
7344
7320
  part.partName = partContent.partName;
7345
7321
  part.properties = partContent.properties ? JSON.parse(JSON.stringify(partContent.properties)) : null;
7346
7322
  part.children = (partContent.children || []).map((child) => {
7347
7323
  const childPart = this.parsePartContent(child);
7348
- if (childPart)
7349
- childPart.parent = part;
7324
+ if (childPart) childPart.parent = part;
7350
7325
  return childPart;
7351
7326
  }).filter((part2) => !!part2);
7352
7327
  return part;
@@ -7388,14 +7363,12 @@ const providePageBuilderViewer = (pageBuilderViewer) => {
7388
7363
  };
7389
7364
  const usePageBuilder = () => {
7390
7365
  const pageBuilder = inject(PAGE_BUILDER_KEY);
7391
- if (!pageBuilder)
7392
- throw Error("PageBuilder not found");
7366
+ if (!pageBuilder) throw Error("PageBuilder not found");
7393
7367
  return pageBuilder;
7394
7368
  };
7395
7369
  const usePageBuilderViewer = () => {
7396
7370
  const pageBuilderViewer = inject(PAGE_BUILDER_VIEWER_KEY);
7397
- if (!pageBuilderViewer)
7398
- throw Error("PageBuilderViewer not found");
7371
+ if (!pageBuilderViewer) throw Error("PageBuilderViewer not found");
7399
7372
  return pageBuilderViewer;
7400
7373
  };
7401
7374
  const createPartComponents = (parts) => {
@@ -7412,9 +7385,17 @@ const createPartComponent = (part) => {
7412
7385
  }
7413
7386
  }
7414
7387
  };
7388
+ const getPartClassName = (part) => {
7389
+ if (part) {
7390
+ const def = getPartDefinition(part.partName);
7391
+ if (def) {
7392
+ return def.className;
7393
+ }
7394
+ }
7395
+ };
7415
7396
  const getPartDefinition = (partName) => partDefinitions$1[partName];
7416
- const _hoisted_1$1$1 = ["data-part-id"];
7417
- const _sfc_main$2$1 = /* @__PURE__ */ defineComponent({
7397
+ const _hoisted_1$2$1 = ["data-part-id"];
7398
+ const _sfc_main$3$1 = /* @__PURE__ */ defineComponent({
7418
7399
  __name: "PbPage",
7419
7400
  props: {
7420
7401
  part: {},
@@ -7427,11 +7408,9 @@ const _sfc_main$2$1 = /* @__PURE__ */ defineComponent({
7427
7408
  return `${(_a = props.part) == null ? void 0 : _a.getClassNames()} ${props.isMobilePage ? "mobile" : "pc"}`;
7428
7409
  });
7429
7410
  const styleTag = computed(() => props.part.getStyleTag());
7430
- const properties = computed(() => ({
7431
- style: {
7432
- ...props.part.getStyles(),
7433
- ...props.part.getInlineStyles()
7434
- }
7411
+ const style = computed(() => ({
7412
+ ...props.part.getStyles(),
7413
+ ...props.part.getInlineStyles()
7435
7414
  }));
7436
7415
  return (_ctx, _cache) => {
7437
7416
  return openBlock(), createElementBlock(Fragment, null, [
@@ -7439,28 +7418,29 @@ const _sfc_main$2$1 = /* @__PURE__ */ defineComponent({
7439
7418
  key: 0,
7440
7419
  innerHTML: styleTag.value
7441
7420
  }, null, 8, ["innerHTML"])) : createCommentVNode("", true),
7442
- createElementVNode("div", mergeProps({
7443
- class: [classNames.value, "pb-page"],
7444
- "data-part-id": _ctx.part.partId
7445
- }, properties.value), [
7421
+ createElementVNode("div", {
7422
+ class: normalizeClass([classNames.value, "pb-page"]),
7423
+ "data-part-id": _ctx.part.partId,
7424
+ style: normalizeStyle(style.value)
7425
+ }, [
7446
7426
  createElementVNode("div", {
7447
7427
  class: normalizeClass([[_ctx.isMobilePage ? "mobile" : "pc"], "pb-page-content"])
7448
7428
  }, [
7449
7429
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.part.children, (section) => {
7450
- return openBlock(), createBlock$1(_sfc_main$7$1, {
7430
+ return openBlock(), createBlock$1(_sfc_main$9$1, {
7451
7431
  key: section.partId,
7452
7432
  part: section
7453
7433
  }, null, 8, ["part"]);
7454
7434
  }), 128))
7455
7435
  ], 2)
7456
- ], 16, _hoisted_1$1$1)
7436
+ ], 14, _hoisted_1$2$1)
7457
7437
  ], 64);
7458
7438
  };
7459
7439
  }
7460
7440
  });
7461
- const _hoisted_1$u = ["innerHTML"];
7462
- const _hoisted_2$j = { class: "pb-viewer" };
7463
- const _sfc_main$1$1 = /* @__PURE__ */ defineComponent({
7441
+ const _hoisted_1$1$1 = ["innerHTML"];
7442
+ const _hoisted_2$g = { class: "pb-viewer" };
7443
+ const _sfc_main$2$1 = /* @__PURE__ */ defineComponent({
7464
7444
  __name: "PageBuilderViewer",
7465
7445
  props: {
7466
7446
  pageContent: {},
@@ -7472,15 +7452,13 @@ const _sfc_main$1$1 = /* @__PURE__ */ defineComponent({
7472
7452
  const props = __props;
7473
7453
  const viewer = createPageBuilderViewer();
7474
7454
  viewer.setLocale(props.locale);
7475
- if (props.plugin)
7476
- viewer.registerCustomPlugin(props.plugin);
7455
+ if (props.plugin) viewer.registerCustomPlugin(props.plugin);
7477
7456
  providePageBuilderViewer(viewer);
7478
7457
  providePageBuilder(viewer);
7479
7458
  const externalCss = viewer.getExternalCss();
7480
7459
  const part = computed(() => {
7481
7460
  const parts = viewer.model.rootPart.value.children;
7482
- if (!parts || !parts.length)
7483
- return;
7461
+ if (!parts || !parts.length) return;
7484
7462
  return parts[parts.length === 1 || props.isMobilePage ? 0 : 1];
7485
7463
  });
7486
7464
  onMounted(() => {
@@ -7501,9 +7479,9 @@ const _sfc_main$1$1 = /* @__PURE__ */ defineComponent({
7501
7479
  unref(externalCss) ? (openBlock(), createElementBlock("div", {
7502
7480
  key: 0,
7503
7481
  innerHTML: unref(externalCss)
7504
- }, null, 8, _hoisted_1$u)) : createCommentVNode("", true),
7505
- createElementVNode("div", _hoisted_2$j, [
7506
- part.value ? (openBlock(), createBlock$1(_sfc_main$2$1, {
7482
+ }, null, 8, _hoisted_1$1$1)) : createCommentVNode("", true),
7483
+ createElementVNode("div", _hoisted_2$g, [
7484
+ part.value ? (openBlock(), createBlock$1(_sfc_main$3$1, {
7507
7485
  key: 0,
7508
7486
  "is-mobile-page": _ctx.isMobilePage,
7509
7487
  part: part.value
@@ -7513,10 +7491,36 @@ const _sfc_main$1$1 = /* @__PURE__ */ defineComponent({
7513
7491
  };
7514
7492
  }
7515
7493
  });
7494
+ const _hoisted_1$t = {
7495
+ key: 1,
7496
+ class: "placeholder",
7497
+ textContent: "Empty Widget"
7498
+ };
7499
+ const _sfc_main$1$1 = /* @__PURE__ */ defineComponent({
7500
+ __name: "PbContainerWidget",
7501
+ props: {
7502
+ part: {},
7503
+ placeholder: { type: Boolean }
7504
+ },
7505
+ setup(__props) {
7506
+ const props = __props;
7507
+ usePageBuilder();
7508
+ const childComponents = computed(() => createPartComponents(props.part.children));
7509
+ return (_ctx, _cache) => {
7510
+ return childComponents.value ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(childComponents.value, (child) => {
7511
+ return openBlock(), createBlock$1(resolveDynamicComponent(child.component), {
7512
+ key: child.part.partId,
7513
+ part: child.part
7514
+ }, null, 8, ["part"]);
7515
+ }), 128)) : _ctx.placeholder ? (openBlock(), createElementBlock("div", _hoisted_1$t)) : createCommentVNode("", true);
7516
+ };
7517
+ }
7518
+ });
7516
7519
  const _sfc_main$q = /* @__PURE__ */ defineComponent({
7517
7520
  __name: "PbCustomWidget",
7518
7521
  props: {
7519
7522
  part: {},
7523
+ placeholder: { type: Boolean },
7520
7524
  dataWatcher: { type: Function },
7521
7525
  dataProvider: { type: Function }
7522
7526
  },
@@ -7527,8 +7531,8 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
7527
7531
  const data = ref({});
7528
7532
  const bind = computed(() => ({
7529
7533
  ...props.part.properties || {},
7530
- placeholder: true,
7531
- ...data.value || {}
7534
+ ...data.value || {},
7535
+ placeholder: props.placeholder
7532
7536
  }));
7533
7537
  const updateData = async () => {
7534
7538
  data.value = await pageBuilder.provideCustomWidgetData(props.part);
@@ -7557,25 +7561,21 @@ const shortUniqueId = new ShortUniqueId({
7557
7561
  });
7558
7562
  const getNewPartId = () => shortUniqueId.rnd();
7559
7563
  const findPartById = (part, partId) => {
7560
- if (part.partId === partId)
7561
- return part;
7564
+ if (part.partId === partId) return part;
7562
7565
  if (part.children) {
7563
7566
  for (const child of part.children) {
7564
7567
  const found = findPartById(child, partId);
7565
- if (found)
7566
- return found;
7568
+ if (found) return found;
7567
7569
  }
7568
7570
  }
7569
7571
  };
7570
7572
  const findElementById = (element, partId) => {
7571
- if (element.getAttribute(PART_ID_KEY) === partId)
7572
- return element;
7573
+ if (element.getAttribute(PART_ID_KEY) === partId) return element;
7573
7574
  let child = element.firstChild;
7574
7575
  while (child) {
7575
7576
  if (child instanceof YXmlElement) {
7576
7577
  const found = findElementById(child, partId);
7577
- if (found)
7578
- return found;
7578
+ if (found) return found;
7579
7579
  }
7580
7580
  child = child.nextSibling;
7581
7581
  }
@@ -7615,8 +7615,7 @@ const partsFromJsonString = (jsonString, keepPartId = false) => {
7615
7615
  };
7616
7616
  const partFromJsonObject = (object, keepPartId = false) => {
7617
7617
  const part = createPart(object.partType, object.partName);
7618
- if (!part)
7619
- return;
7618
+ if (!part) return;
7620
7619
  if (keepPartId && object.partId) {
7621
7620
  part.partId = object.partId;
7622
7621
  }
@@ -7657,8 +7656,7 @@ const syncPart = (part, element) => {
7657
7656
  const syncProperties = (part, element) => {
7658
7657
  const attrs = element.getAttributes();
7659
7658
  if (attrs) {
7660
- if (!part.properties)
7661
- part.properties = {};
7659
+ if (!part.properties) part.properties = {};
7662
7660
  for (const name in attrs) {
7663
7661
  if (!RESERVED_ATTRIBUTES.includes(name)) {
7664
7662
  const value = attrs[name];
@@ -7675,8 +7673,7 @@ const syncProperties = (part, element) => {
7675
7673
  }
7676
7674
  }
7677
7675
  for (const name in part.properties) {
7678
- if (!attrs[name] && !attrs[`${name}.object`])
7679
- delete part.properties[name];
7676
+ if (!attrs[name] && !attrs[`${name}.object`]) delete part.properties[name];
7680
7677
  }
7681
7678
  if (Object.keys(part.properties).length === 0) {
7682
7679
  part.properties = void 0;
@@ -7689,8 +7686,7 @@ const syncChildren = (part, element) => {
7689
7686
  const elementChildren = [];
7690
7687
  let elementChild = element.firstChild;
7691
7688
  while (elementChild) {
7692
- if (elementChild instanceof YXmlElement)
7693
- elementChildren.push(elementChild);
7689
+ if (elementChild instanceof YXmlElement) elementChildren.push(elementChild);
7694
7690
  elementChild = elementChild.nextSibling;
7695
7691
  }
7696
7692
  if (elementChildren.length === 0) {
@@ -7729,11 +7725,9 @@ const createPart = (partType, partName, properties) => {
7729
7725
  part = new Widget();
7730
7726
  break;
7731
7727
  }
7732
- if (!part)
7733
- return;
7728
+ if (!part) return;
7734
7729
  part.partName = partName;
7735
- if (!properties)
7736
- return part;
7730
+ if (!properties) return part;
7737
7731
  part.properties = {};
7738
7732
  for (const name in properties) {
7739
7733
  if (!RESERVED_ATTRIBUTES.includes(name)) {
@@ -7743,15 +7737,12 @@ const createPart = (partType, partName, properties) => {
7743
7737
  return part;
7744
7738
  };
7745
7739
  const createPartWithElement = (element) => {
7746
- if (!element)
7747
- return;
7740
+ if (!element) return;
7748
7741
  const partType = element.nodeName;
7749
7742
  const partName = element.getAttribute(PART_NAME_KEY);
7750
- if (!partName)
7751
- return;
7743
+ if (!partName) return;
7752
7744
  const part = createPart(partType, partName);
7753
- if (!part)
7754
- return;
7745
+ if (!part) return;
7755
7746
  part.partId = element.getAttribute(PART_ID_KEY) || "";
7756
7747
  return part;
7757
7748
  };
@@ -7790,19 +7781,15 @@ class Model2 {
7790
7781
  }
7791
7782
  getRootPartId() {
7792
7783
  const partId = this.yjsRoot.getAttribute(PART_ID_KEY);
7793
- if (!partId)
7794
- throw new Error("root id not found");
7784
+ if (!partId) throw new Error("root id not found");
7795
7785
  return partId;
7796
7786
  }
7797
7787
  updateModel(param) {
7798
7788
  const result = {};
7799
7789
  this.yjsDoc.transact(() => {
7800
- if (param.delete)
7801
- result.deleted = this.deleteParts(param.delete);
7802
- if (param.insert)
7803
- result.inserted = this.insertParts(param.insert);
7804
- if (param.update)
7805
- result.updated = this.updateParts(param.update);
7790
+ if (param.delete) result.deleted = this.deleteParts(param.delete);
7791
+ if (param.insert) result.inserted = this.insertParts(param.insert);
7792
+ if (param.update) result.updated = this.updateParts(param.update);
7806
7793
  });
7807
7794
  this.undoManager.stopCapturing();
7808
7795
  PageBuilderEditorEvent.emit.modelUpdatedByUI(result);
@@ -7833,11 +7820,9 @@ class Model2 {
7833
7820
  }
7834
7821
  parseModel(json, keepPartId = false) {
7835
7822
  const root = JSON.parse(json);
7836
- if (root.partType !== ROOT_TYPE)
7837
- throw Error("Invalid data format");
7823
+ if (root.partType !== ROOT_TYPE) throw Error("Invalid data format");
7838
7824
  const rootPart = partFromJsonObject(root, keepPartId);
7839
- if (!rootPart)
7840
- throw new Error("Invalid data format");
7825
+ if (!rootPart) throw new Error("Invalid data format");
7841
7826
  return rootPart;
7842
7827
  }
7843
7828
  serializeParts(partIds) {
@@ -7849,14 +7834,12 @@ class Model2 {
7849
7834
  }
7850
7835
  moveElements(partId, destPartId, destIndex, update, doNotChangeIndex) {
7851
7836
  var _a;
7852
- if (partId === destPartId)
7853
- return;
7837
+ if (partId === destPartId) return;
7854
7838
  const element = findElementById(this.yjsRoot, partId);
7855
7839
  if (element) {
7856
7840
  if (((_a = element.parent) == null ? void 0 : _a.getAttribute(PART_ID_KEY)) === destPartId) {
7857
7841
  const index = this.getIndexOfElement(element);
7858
- if (!doNotChangeIndex && index !== void 0 && index < destIndex)
7859
- destIndex--;
7842
+ if (!doNotChangeIndex && index !== void 0 && index < destIndex) destIndex--;
7860
7843
  }
7861
7844
  const parts = this.findPartsByIds([partId]);
7862
7845
  const param = {
@@ -7876,8 +7859,7 @@ class Model2 {
7876
7859
  isMobilePart(part) {
7877
7860
  let curPart = part;
7878
7861
  while (curPart) {
7879
- if (curPart.isPage() && this.rootPart.children && this.rootPart.children[0] === curPart)
7880
- return true;
7862
+ if (curPart.isPage() && this.rootPart.children && this.rootPart.children[0] === curPart) return true;
7881
7863
  curPart = curPart.parent;
7882
7864
  }
7883
7865
  return false;
@@ -7885,8 +7867,7 @@ class Model2 {
7885
7867
  isPcPart(part) {
7886
7868
  let curPart = part;
7887
7869
  while (curPart) {
7888
- if (curPart.isPage() && this.rootPart.children && this.rootPart.children[1] === curPart)
7889
- return true;
7870
+ if (curPart.isPage() && this.rootPart.children && this.rootPart.children[1] === curPart) return true;
7890
7871
  curPart = curPart.parent;
7891
7872
  }
7892
7873
  return false;
@@ -7974,19 +7955,16 @@ class Model2 {
7974
7955
  }
7975
7956
  getElementAttribute(node, name) {
7976
7957
  let value = node.getAttribute(name);
7977
- if (value)
7978
- return value;
7958
+ if (value) return value;
7979
7959
  value = node.getAttribute(`${name}.object`);
7980
- if (value)
7981
- return JSON.parse(value);
7960
+ if (value) return JSON.parse(value);
7982
7961
  }
7983
7962
  getIndexOfElement(element) {
7984
7963
  if (element.parent instanceof YXmlElement) {
7985
7964
  let index = 0;
7986
7965
  let child = element.parent.firstChild;
7987
7966
  while (child) {
7988
- if (element === child)
7989
- return index;
7967
+ if (element === child) return index;
7990
7968
  child = child.nextSibling;
7991
7969
  ++index;
7992
7970
  }
@@ -8047,8 +8025,7 @@ class PartManager {
8047
8025
  }
8048
8026
  getPropertyDefinition(partName, propertyName) {
8049
8027
  const partDef = this.getPartDefinition(partName);
8050
- if (!partDef || !partDef.propertyGroups)
8051
- return;
8028
+ if (!partDef || !partDef.propertyGroups) return;
8052
8029
  for (const group of partDef.propertyGroups) {
8053
8030
  for (const property of group.properties) {
8054
8031
  if (property.propertyName === propertyName) {
@@ -8071,6 +8048,23 @@ class PartManager {
8071
8048
  return component ? { part, component } : void 0;
8072
8049
  }).filter(notNull)) || [];
8073
8050
  }
8051
+ getPartClassName(part) {
8052
+ if (part) {
8053
+ const def = this.getPartDefinition(part.partName);
8054
+ if (def) {
8055
+ return def.className;
8056
+ }
8057
+ }
8058
+ }
8059
+ isChildAllowed(part) {
8060
+ if (part) {
8061
+ const def = this.getPartDefinition(part.partName);
8062
+ if (def) {
8063
+ return def.allowsChild();
8064
+ }
8065
+ }
8066
+ return false;
8067
+ }
8074
8068
  registerPartPropertyGroupEditors(editors) {
8075
8069
  for (const name in editors) {
8076
8070
  this.partPropertyGroupEditors.set(name, editors[name]);
@@ -8135,12 +8129,13 @@ class PartManager {
8135
8129
  const defaultPartPropertyEditors = () => {
8136
8130
  return {
8137
8131
  "readonly-text": () => defineAsyncComponent(() => import("./PbPropertyEditorReadonlyText-Dgp_AVOD.js")),
8138
- "text": () => defineAsyncComponent(() => import("./PbPropertyEditorText-CWmfX2bt.js")),
8139
- "multiline-text": () => defineAsyncComponent(() => import("./PbPropertyEditorMultilineText-BR1FNVi6.js")),
8132
+ "text": () => defineAsyncComponent(() => import("./PbPropertyEditorText-DZA84Sn1.js")),
8133
+ "multiline-text": () => defineAsyncComponent(() => import("./PbPropertyEditorMultilineText-3hJVRryR.js")),
8140
8134
  "select": () => defineAsyncComponent(() => import("./PbPropertyEditorSelect-CWedbXJI.js")),
8141
- "color": () => defineAsyncComponent(() => import("./PbPropertyEditorColor-C554e0iO.js")),
8142
- "image": () => defineAsyncComponent(() => import("./PbPropertyEditorImage-CMPr66Dx.js")),
8143
- "html": () => defineAsyncComponent(() => import("./PbPropertyEditorHtml-CB99C_DG.js"))
8135
+ "color": () => defineAsyncComponent(() => import("./PbPropertyEditorColor-B6yhXmGL.js")),
8136
+ "image": () => defineAsyncComponent(() => import("./PbPropertyEditorImage-6WNkin_o.js")),
8137
+ "html": () => defineAsyncComponent(() => import("./PbPropertyEditorHtml-fgIO3jaY.js")),
8138
+ "youtube": () => defineAsyncComponent(() => import("./PbPropertyEditorYoutube-DtcxO2uZ.js"))
8144
8139
  };
8145
8140
  };
8146
8141
  const getPropertyValueOfParts = (parts, propertyName) => {
@@ -8158,6 +8153,25 @@ const isCursorInElement = (event, element) => {
8158
8153
  const rect = element.getBoundingClientRect();
8159
8154
  return event.clientX >= rect.left && event.clientX <= rect.right && event.clientY >= rect.top && event.clientY <= rect.bottom;
8160
8155
  };
8156
+ const selectYoutubeVideo = (modal, url, callback) => {
8157
+ modal.openModal({
8158
+ component: defineAsyncComponent(() => import("./PbYoutubeModal-DFb6CQyW.js")),
8159
+ style: {
8160
+ minWidth: "500px",
8161
+ minHeight: "400px"
8162
+ },
8163
+ bind: {
8164
+ url
8165
+ },
8166
+ on: {
8167
+ selectUrl: (url2) => {
8168
+ if (callback) {
8169
+ callback(url2);
8170
+ }
8171
+ }
8172
+ }
8173
+ });
8174
+ };
8161
8175
  let draggingPart;
8162
8176
  const vPartHandler = {
8163
8177
  mounted: (el, binding) => {
@@ -8186,13 +8200,10 @@ const setContextMenuHandler = (el, binding) => {
8186
8200
  const pageBuilder = binding.value.pageBuilder;
8187
8201
  const part = binding.value.part;
8188
8202
  el.oncontextmenu = (event) => {
8189
- if (event.altKey || event.ctrlKey || event.shiftKey)
8190
- return;
8203
+ if (event.altKey || event.ctrlKey || event.shiftKey) return;
8191
8204
  const eventAny = event;
8192
- if (eventAny._partContextMenuHandled)
8193
- return;
8194
- else
8195
- eventAny._partContextMenuHandled = true;
8205
+ if (eventAny._partContextMenuHandled) return;
8206
+ else eventAny._partContextMenuHandled = true;
8196
8207
  if (!pageBuilder.context.isSelected(part)) {
8197
8208
  pageBuilder.context.setSelection([part]);
8198
8209
  }
@@ -8371,18 +8382,15 @@ const _export_sfc = (sfc, props) => {
8371
8382
  return target;
8372
8383
  };
8373
8384
  const _sfc_main$p = {};
8374
- const _hoisted_1$t = { class: "pb-add-widget-button" };
8375
- const _hoisted_2$i = /* @__PURE__ */ createElementVNode("span", { class: "icon material-icons-outlined" }, "add_box", -1);
8376
- const _hoisted_3$g = /* @__PURE__ */ createElementVNode("span", { class: "text" }, "Add Widget", -1);
8377
- const _hoisted_4$c = [
8378
- _hoisted_2$i,
8379
- _hoisted_3$g
8380
- ];
8385
+ const _hoisted_1$s = { class: "pb-add-widget-button" };
8381
8386
  function _sfc_render$1(_ctx, _cache) {
8382
- return openBlock(), createElementBlock("div", _hoisted_1$t, [
8387
+ return openBlock(), createElementBlock("div", _hoisted_1$s, [
8383
8388
  createElementVNode("button", {
8384
8389
  onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("add-widget", $event))
8385
- }, _hoisted_4$c)
8390
+ }, _cache[1] || (_cache[1] = [
8391
+ createElementVNode("span", { class: "icon material-icons-outlined" }, "add_box", -1),
8392
+ createElementVNode("span", { class: "text" }, "Add Widget", -1)
8393
+ ]))
8386
8394
  ]);
8387
8395
  }
8388
8396
  const PbAddWidgetButton = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$1]]);
@@ -8395,11 +8403,9 @@ class MouseTracker {
8395
8403
  }
8396
8404
  capture(callback) {
8397
8405
  var _a;
8398
- if (!this.iframe.value)
8399
- return;
8406
+ if (!this.iframe.value) return;
8400
8407
  const _document = (_a = this.iframe.value.contentWindow) == null ? void 0 : _a.document;
8401
- if (!_document)
8402
- return;
8408
+ if (!_document) return;
8403
8409
  _document.addEventListener("mousemove", callback);
8404
8410
  _document.addEventListener("mouseup", () => _document.removeEventListener("mousemove", callback), {
8405
8411
  once: true
@@ -8412,15 +8418,10 @@ const provideMouseTracker = (iframe) => {
8412
8418
  };
8413
8419
  const useMouseTracker = () => {
8414
8420
  const mouseTracker = inject(MOUSE_TRACKER_KEY);
8415
- if (!mouseTracker)
8416
- throw Error(MOUSE_TRACKER_NOT_FOUND);
8421
+ if (!mouseTracker) throw Error(MOUSE_TRACKER_NOT_FOUND);
8417
8422
  return mouseTracker;
8418
8423
  };
8419
- const _hoisted_1$s = ["data-part-id", "draggable"];
8420
- const _hoisted_2$h = {
8421
- key: 1,
8422
- class: "children"
8423
- };
8424
+ const _hoisted_1$r = ["data-part-id", "draggable"];
8424
8425
  const _sfc_main$o = /* @__PURE__ */ defineComponent({
8425
8426
  __name: "PbWidget",
8426
8427
  props: {
@@ -8431,12 +8432,11 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
8431
8432
  const widget = ref(null);
8432
8433
  const draggable = ref(true);
8433
8434
  let dragStartX, dragStartY, initX, initY, initWidth, initHeight;
8434
- const _pan_mousedown = (event) => {
8435
+ const panChild = (event) => {
8435
8436
  draggable.value = false;
8436
8437
  event.stopPropagation();
8437
8438
  event.preventDefault();
8438
- if (!widget.value)
8439
- return;
8439
+ if (!widget.value) return;
8440
8440
  dragStartX = event.clientX;
8441
8441
  dragStartY = event.clientY;
8442
8442
  initX = widget.value.offsetLeft;
@@ -8452,12 +8452,11 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
8452
8452
  props.part.properties.left = `${left}px`;
8453
8453
  props.part.properties.top = `${top}px`;
8454
8454
  };
8455
- const _resize_mousedown = (event) => {
8455
+ const resizeChild = (event) => {
8456
8456
  draggable.value = false;
8457
8457
  event.stopPropagation();
8458
8458
  event.preventDefault();
8459
- if (!widget.value)
8460
- return;
8459
+ if (!widget.value) return;
8461
8460
  const rect = widget.value.getBoundingClientRect();
8462
8461
  dragStartX = event.clientX;
8463
8462
  dragStartY = event.clientY;
@@ -8480,14 +8479,21 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
8480
8479
  const props = __props;
8481
8480
  const pageBuilder = usePageBuilderEditor();
8482
8481
  const selected = computed(() => pageBuilder.context.isSelected(props.part));
8483
- const classNames = computed(() => [selected.value ? "selected" : "", props.part.getClassNames()]);
8484
- const styleTag = computed(() => props.part.getStyleTag());
8485
- const properties = computed(() => {
8486
- var _a, _b, _c, _d;
8487
- let style = props.part.getStyles();
8482
+ const classNames = computed(() => [
8483
+ pageBuilder.partManager.getPartClassName(props.part),
8484
+ selected.value ? "selected" : "",
8485
+ props.part.getClassNames()
8486
+ ]);
8487
+ const styleTag = computed(() => props.part.getStyleTag());
8488
+ const style = computed(() => {
8489
+ var _a, _b, _c, _d;
8490
+ let style2 = {
8491
+ ...props.part.getStyles(),
8492
+ ...props.part.getInlineStyles() || {}
8493
+ };
8488
8494
  if (props.part.isNestedWidget()) {
8489
- style = {
8490
- ...style,
8495
+ style2 = {
8496
+ ...style2,
8491
8497
  position: "absolute",
8492
8498
  left: ((_a = props.part.properties) == null ? void 0 : _a.left) || "",
8493
8499
  right: ((_b = props.part.properties) == null ? void 0 : _b.right) || "",
@@ -8495,10 +8501,19 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
8495
8501
  bottom: ((_d = props.part.properties) == null ? void 0 : _d.bottom) || ""
8496
8502
  };
8497
8503
  }
8498
- return { style };
8504
+ return style2;
8505
+ });
8506
+ const bind = computed(() => {
8507
+ return {
8508
+ part: props.part,
8509
+ placeholder: true
8510
+ };
8499
8511
  });
8500
8512
  const thisComponent = computed(() => pageBuilder.partManager.createPartComponent(props.part));
8501
- const childComponents = computed(() => pageBuilder.partManager.createPartComponents(props.part.children));
8513
+ computed(() => pageBuilder.partManager.createPartComponents(props.part.children));
8514
+ const droppable = computed(() => {
8515
+ return pageBuilder.partManager.isChildAllowed(props.part);
8516
+ });
8502
8517
  const locatePositionMark = (mark, target, mouseOffsetX, mouseOffsetY, draggingPart2, event) => {
8503
8518
  if (props.part.isNestedWidget()) {
8504
8519
  if (draggingPart2.isWidget())
@@ -8604,8 +8619,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
8604
8619
  };
8605
8620
  const locateWidget = (mark, target, mouseOffsetX, mouseOffsetY, draggingPart2, event) => {
8606
8621
  var _a, _b, _c;
8607
- if (draggingPart2.partId === props.part.partId && !props.part.isNestedWidget())
8608
- return;
8622
+ if (draggingPart2.partId === props.part.partId && !props.part.isNestedWidget()) return;
8609
8623
  mark.style.background = "#27ae60";
8610
8624
  const isNestedWidget = props.part.isNestedWidget();
8611
8625
  const widget2 = isNestedWidget ? props.part.parent : props.part;
@@ -8646,11 +8660,9 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
8646
8660
  }
8647
8661
  };
8648
8662
  const acceptChildPart = (pageBuilder2, part, target, _index, partId, event) => {
8649
- if (partId === props.part.partId && !props.part.isNestedWidget())
8650
- return;
8663
+ if (partId === props.part.partId && !props.part.isNestedWidget()) return;
8651
8664
  const droppedPart = pageBuilder2.model.findPartById(partId);
8652
- if (!droppedPart)
8653
- return;
8665
+ if (!droppedPart) return;
8654
8666
  const targetRect = target.getBoundingClientRect();
8655
8667
  const mouseOffsetX = event.clientX - targetRect.left;
8656
8668
  const mouseOffsetY = event.clientY - targetRect.top;
@@ -8683,37 +8695,25 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
8683
8695
  let index;
8684
8696
  if (((_a = section.properties) == null ? void 0 : _a.direction) === "vertical") {
8685
8697
  if (((_b = block.properties) == null ? void 0 : _b.direction) === "vertical") {
8686
- if (isFirstBlock && isFirstWidget && mouseOffsetY <= centerY)
8687
- index = blockIndex;
8688
- else if (isLastBlock && isLastWidget && mouseOffsetY > centerY)
8689
- index = blockIndex + 1;
8690
- else
8691
- return;
8698
+ if (isFirstBlock && isFirstWidget && mouseOffsetY <= centerY) index = blockIndex;
8699
+ else if (isLastBlock && isLastWidget && mouseOffsetY > centerY) index = blockIndex + 1;
8700
+ else return;
8692
8701
  } else {
8693
- if (isFirstBlock && mouseOffsetY <= centerY)
8694
- index = blockIndex;
8695
- else if (isLastBlock && mouseOffsetY > centerY)
8696
- index = blockIndex + 1;
8697
- else
8698
- return;
8702
+ if (isFirstBlock && mouseOffsetY <= centerY) index = blockIndex;
8703
+ else if (isLastBlock && mouseOffsetY > centerY) index = blockIndex + 1;
8704
+ else return;
8699
8705
  }
8700
8706
  } else {
8701
8707
  if (((_c = block.properties) == null ? void 0 : _c.direction) === "vertical") {
8702
- if (isFirstWidget && mouseOffsetY <= centerY)
8703
- index = blockIndex;
8704
- else if (isLastWidget && mouseOffsetY > centerY)
8705
- index = blockIndex + 1;
8706
- else
8707
- return;
8708
+ if (isFirstWidget && mouseOffsetY <= centerY) index = blockIndex;
8709
+ else if (isLastWidget && mouseOffsetY > centerY) index = blockIndex + 1;
8710
+ else return;
8708
8711
  } else {
8709
- if (mouseOffsetY <= centerY)
8710
- index = blockIndex;
8711
- else
8712
- index = blockIndex + 1;
8712
+ if (mouseOffsetY <= centerY) index = blockIndex;
8713
+ else index = blockIndex + 1;
8713
8714
  }
8714
8715
  }
8715
- if (((_d = page.children) == null ? void 0 : _d.indexOf(droppedPart)) === index)
8716
- return;
8716
+ if (((_d = page.children) == null ? void 0 : _d.indexOf(droppedPart)) === index) return;
8717
8717
  pageBuilder2.model.moveElements(droppedPart.partId, section.partId, index);
8718
8718
  };
8719
8719
  const acceptBlock = (pageBuilder2, target, droppedPart, mouseOffsetX, mouseOffsetY) => {
@@ -8730,36 +8730,25 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
8730
8730
  if (((_a = section.properties) == null ? void 0 : _a.direction) === "vertical") {
8731
8731
  const centerY = widgetElement.offsetHeight / 2;
8732
8732
  if (((_b = block.properties) == null ? void 0 : _b.direction) === "vertical") {
8733
- if (isFirstWidget && mouseOffsetY <= centerY)
8734
- index = blockIndex;
8735
- else if (isLastWidget && mouseOffsetY > centerY)
8736
- index = blockIndex + 1;
8737
- else
8738
- return;
8733
+ if (isFirstWidget && mouseOffsetY <= centerY) index = blockIndex;
8734
+ else if (isLastWidget && mouseOffsetY > centerY) index = blockIndex + 1;
8735
+ else return;
8739
8736
  } else {
8740
- if (mouseOffsetY <= centerY)
8741
- index = blockIndex;
8742
- else
8743
- index = blockIndex + 1;
8737
+ if (mouseOffsetY <= centerY) index = blockIndex;
8738
+ else index = blockIndex + 1;
8744
8739
  }
8745
8740
  } else {
8746
8741
  const centerX = widgetElement.offsetWidth / 2;
8747
8742
  if (((_c = block.properties) == null ? void 0 : _c.direction) === "vertical") {
8748
- if (mouseOffsetX <= centerX)
8749
- index = blockIndex;
8750
- else
8751
- index = blockIndex + 1;
8743
+ if (mouseOffsetX <= centerX) index = blockIndex;
8744
+ else index = blockIndex + 1;
8752
8745
  } else {
8753
- if (isFirstWidget && mouseOffsetX <= centerX)
8754
- index = blockIndex;
8755
- else if (isLastWidget && mouseOffsetX > centerX)
8756
- index = blockIndex + 1;
8757
- else
8758
- return;
8746
+ if (isFirstWidget && mouseOffsetX <= centerX) index = blockIndex;
8747
+ else if (isLastWidget && mouseOffsetX > centerX) index = blockIndex + 1;
8748
+ else return;
8759
8749
  }
8760
8750
  }
8761
- if (((_d = section.children) == null ? void 0 : _d.indexOf(droppedPart)) === index)
8762
- return;
8751
+ if (((_d = section.children) == null ? void 0 : _d.indexOf(droppedPart)) === index) return;
8763
8752
  pageBuilder2.model.moveElements(droppedPart.partId, section.partId, index);
8764
8753
  };
8765
8754
  const acceptWidget = (pageBuilder2, target, droppedPart, mouseOffsetX, mouseOffsetY) => {
@@ -8781,8 +8770,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
8781
8770
  index = widgetIndex + 1;
8782
8771
  } else {
8783
8772
  index = ((_c = widget2.children) == null ? void 0 : _c.length) || 0;
8784
- if (((_d = widget2.children) == null ? void 0 : _d.indexOf(droppedPart)) === index)
8785
- return;
8773
+ if (((_d = widget2.children) == null ? void 0 : _d.indexOf(droppedPart)) === index) return;
8786
8774
  const update2 = [{
8787
8775
  partId: droppedPart.partId,
8788
8776
  properties: {
@@ -8801,8 +8789,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
8801
8789
  index = widgetIndex + 1;
8802
8790
  } else {
8803
8791
  index = ((_e = widget2.children) == null ? void 0 : _e.length) || 0;
8804
- if (((_f = widget2.children) == null ? void 0 : _f.indexOf(droppedPart)) === index)
8805
- return;
8792
+ if (((_f = widget2.children) == null ? void 0 : _f.indexOf(droppedPart)) === index) return;
8806
8793
  const update2 = [{
8807
8794
  partId: droppedPart.partId,
8808
8795
  properties: {
@@ -8822,8 +8809,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
8822
8809
  index = mouseOffsetX <= centerX ? widgetIndex : widgetIndex + 1;
8823
8810
  }
8824
8811
  }
8825
- if (block.children.indexOf(droppedPart) === index)
8826
- return;
8812
+ if (block.children.indexOf(droppedPart) === index) return;
8827
8813
  const update = [{
8828
8814
  partId: droppedPart.partId,
8829
8815
  properties: {
@@ -8837,20 +8823,17 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
8837
8823
  };
8838
8824
  const calculateDropIndex = (part, target, mouseOffsetX, mouseOffsetY, _event) => {
8839
8825
  var _a;
8840
- if (!part.children || part.children.length === 0)
8841
- return 0;
8826
+ if (!part.children || part.children.length === 0) return 0;
8842
8827
  const children = Array.from(target.children).filter((child) => !isPositionMark(child)).map((child) => child);
8843
8828
  const dir = ((_a = props.part.properties) == null ? void 0 : _a.direction) || "vertical";
8844
8829
  let index = 0;
8845
8830
  for (const child of children) {
8846
8831
  if (dir === "horizontal") {
8847
8832
  const centerX = child.offsetLeft + child.offsetWidth / 2;
8848
- if (mouseOffsetX <= centerX)
8849
- return index;
8833
+ if (mouseOffsetX <= centerX) return index;
8850
8834
  } else {
8851
8835
  const centerY = child.offsetTop + child.offsetHeight / 2;
8852
- if (mouseOffsetY <= centerY)
8853
- return index;
8836
+ if (mouseOffsetY <= centerY) return index;
8854
8837
  }
8855
8838
  ++index;
8856
8839
  }
@@ -8862,45 +8845,33 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
8862
8845
  key: 0,
8863
8846
  innerHTML: styleTag.value
8864
8847
  }, null, 8, ["innerHTML"])) : createCommentVNode("", true),
8865
- withDirectives((openBlock(), createElementBlock("div", mergeProps({
8848
+ withDirectives((openBlock(), createElementBlock("div", {
8866
8849
  ref_key: "widget",
8867
8850
  ref: widget,
8868
- class: [classNames.value, "pb-widget"],
8851
+ class: normalizeClass([classNames.value, "pb-widget"]),
8869
8852
  "data-part-id": _ctx.part.partId,
8870
- draggable: draggable.value
8871
- }, properties.value), [
8872
- thisComponent.value ? (openBlock(), createBlock$1(resolveDynamicComponent(thisComponent.value), {
8873
- key: 0,
8874
- part: _ctx.part,
8875
- placeholder: true
8876
- }, null, 8, ["part"])) : createCommentVNode("", true),
8877
- childComponents.value && childComponents.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_2$h, [
8878
- (openBlock(true), createElementBlock(Fragment, null, renderList(childComponents.value, (child) => {
8879
- return openBlock(), createBlock$1(resolveDynamicComponent(child.component), {
8880
- key: child.part.partId,
8881
- part: child.part,
8882
- placeholder: true
8883
- }, null, 8, ["part"]);
8884
- }), 128))
8885
- ])) : createCommentVNode("", true),
8853
+ draggable: draggable.value,
8854
+ style: normalizeStyle(style.value)
8855
+ }, [
8856
+ thisComponent.value ? (openBlock(), createBlock$1(resolveDynamicComponent(thisComponent.value), normalizeProps(mergeProps({ key: 0 }, bind.value)), null, 16)) : createCommentVNode("", true),
8886
8857
  selected.value && _ctx.part.isNestedWidget() ? (openBlock(), createElementBlock("div", {
8887
- key: 2,
8858
+ key: 1,
8888
8859
  class: "pan-handle",
8889
- onMousedown: _pan_mousedown
8860
+ onMousedown: panChild
8890
8861
  }, null, 32)) : createCommentVNode("", true),
8891
8862
  selected.value && _ctx.part.isNestedWidget() ? (openBlock(), createElementBlock("div", {
8892
- key: 3,
8863
+ key: 2,
8893
8864
  class: "resize-handle",
8894
- onMousedown: _resize_mousedown
8865
+ onMousedown: resizeChild
8895
8866
  }, null, 32)) : createCommentVNode("", true)
8896
- ], 16, _hoisted_1$s)), [
8897
- [unref(vPartHandler), { pageBuilder: unref(pageBuilder), part: _ctx.part, droppable: true, locatePositionMark, calculateDropIndex, acceptChildPart }]
8867
+ ], 14, _hoisted_1$r)), [
8868
+ [unref(vPartHandler), { pageBuilder: unref(pageBuilder), part: _ctx.part, droppable: droppable.value, locatePositionMark, calculateDropIndex, acceptChildPart }]
8898
8869
  ])
8899
8870
  ], 64);
8900
8871
  };
8901
8872
  }
8902
8873
  });
8903
- const _hoisted_1$r = ["data-part-id"];
8874
+ const _hoisted_1$q = ["data-part-id"];
8904
8875
  const _sfc_main$n = /* @__PURE__ */ defineComponent({
8905
8876
  __name: "PbBlock",
8906
8877
  props: {
@@ -8987,11 +8958,9 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
8987
8958
  locateNone(mark.style);
8988
8959
  };
8989
8960
  const acceptChildPart = (pageBuilder2, part, target, _index, partId, event) => {
8990
- if (partId === props.part.partId)
8991
- return;
8961
+ if (partId === props.part.partId) return;
8992
8962
  const droppedPart = pageBuilder2.model.findPartById(partId);
8993
- if (!droppedPart)
8994
- return;
8963
+ if (!droppedPart) return;
8995
8964
  const targetRect = target.getBoundingClientRect();
8996
8965
  const mouseOffsetX = event.clientX - targetRect.left;
8997
8966
  const mouseOffsetY = event.clientY - targetRect.top;
@@ -9015,20 +8984,14 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
9015
8984
  let index;
9016
8985
  const centerY = blockElement.offsetHeight / 2;
9017
8986
  if (((_a = section.properties) == null ? void 0 : _a.direction) === "vertical") {
9018
- if (isFirstBlock && mouseOffsetY <= centerY)
9019
- index = sectionIndex;
9020
- else if (isLastBlock && mouseOffsetY > centerY)
9021
- index = sectionIndex + 1;
9022
- else
9023
- return;
8987
+ if (isFirstBlock && mouseOffsetY <= centerY) index = sectionIndex;
8988
+ else if (isLastBlock && mouseOffsetY > centerY) index = sectionIndex + 1;
8989
+ else return;
9024
8990
  } else {
9025
- if (mouseOffsetY <= centerY)
9026
- index = sectionIndex;
9027
- else
9028
- index = sectionIndex + 1;
8991
+ if (mouseOffsetY <= centerY) index = sectionIndex;
8992
+ else index = sectionIndex + 1;
9029
8993
  }
9030
- if (((_b = page.children) == null ? void 0 : _b.indexOf(droppedPart)) === index)
9031
- return;
8994
+ if (((_b = page.children) == null ? void 0 : _b.indexOf(droppedPart)) === index) return;
9032
8995
  pageBuilder2.model.moveElements(droppedPart.partId, page.partId, index);
9033
8996
  };
9034
8997
  const acceptBlock = (pageBuilder2, target, droppedPart, mouseOffsetX, mouseOffsetY) => {
@@ -9044,8 +9007,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
9044
9007
  const centerX = target.offsetWidth / 2;
9045
9008
  index = mouseOffsetX <= centerX ? blockIndex : blockIndex + 1;
9046
9009
  }
9047
- if (section.children.indexOf(droppedPart) === index)
9048
- return;
9010
+ if (section.children.indexOf(droppedPart) === index) return;
9049
9011
  pageBuilder2.model.moveElements(droppedPart.partId, section.partId, index);
9050
9012
  };
9051
9013
  const acceptWidget = (pageBuilder2, target, droppedPart, mouseOffsetX, mouseOffsetY) => {
@@ -9066,20 +9028,17 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
9066
9028
  };
9067
9029
  const calculateDropIndex = (part, target, mouseOffsetX, mouseOffsetY, _event) => {
9068
9030
  var _a;
9069
- if (!part.children || part.children.length === 0)
9070
- return 0;
9031
+ if (!part.children || part.children.length === 0) return 0;
9071
9032
  const children = Array.from(target.children).filter((child) => !isPositionMark(child)).map((child) => child);
9072
9033
  const dir = ((_a = props.part.properties) == null ? void 0 : _a.direction) || "vertical";
9073
9034
  let index = 0;
9074
9035
  for (const child of children) {
9075
9036
  if (dir === "horizontal") {
9076
9037
  const centerX = child.offsetLeft + child.offsetWidth / 2;
9077
- if (mouseOffsetX <= centerX)
9078
- return index;
9038
+ if (mouseOffsetX <= centerX) return index;
9079
9039
  } else {
9080
9040
  const centerY = child.offsetTop + child.offsetHeight / 2;
9081
- if (mouseOffsetY <= centerY)
9082
- return index;
9041
+ if (mouseOffsetY <= centerY) return index;
9083
9042
  }
9084
9043
  ++index;
9085
9044
  }
@@ -9107,25 +9066,14 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
9107
9066
  part: child
9108
9067
  }, null, 8, ["part"]);
9109
9068
  }), 128))
9110
- ], 16, _hoisted_1$r)), [
9069
+ ], 16, _hoisted_1$q)), [
9111
9070
  [unref(vPartHandler), { pageBuilder: unref(pageBuilder), part: _ctx.part, droppable: true, locatePositionMark, calculateDropIndex, acceptChildPart }]
9112
9071
  ])
9113
9072
  ], 64);
9114
9073
  };
9115
9074
  }
9116
9075
  });
9117
- const _hoisted_1$q = { class: "pb-block" };
9118
- const _hoisted_2$g = /* @__PURE__ */ createElementVNode("div", {
9119
- class: "pb-widget",
9120
- style: { "margin": "0 auto" }
9121
- }, [
9122
- /* @__PURE__ */ createElementVNode("div", { class: "pb-login-widget" }, [
9123
- /* @__PURE__ */ createElementVNode("h3", null, "Login Design Part")
9124
- ])
9125
- ], -1);
9126
- const _hoisted_3$f = [
9127
- _hoisted_2$g
9128
- ];
9076
+ const _hoisted_1$p = { class: "pb-block" };
9129
9077
  const _sfc_main$m = /* @__PURE__ */ defineComponent({
9130
9078
  __name: "PbLoginDepart",
9131
9079
  props: {
@@ -9133,11 +9081,20 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
9133
9081
  },
9134
9082
  setup(__props) {
9135
9083
  return (_ctx, _cache) => {
9136
- return openBlock(), createElementBlock("div", _hoisted_1$q, _hoisted_3$f);
9084
+ return openBlock(), createElementBlock("div", _hoisted_1$p, _cache[0] || (_cache[0] = [
9085
+ createElementVNode("div", {
9086
+ class: "pb-widget",
9087
+ style: { "margin": "0 auto" }
9088
+ }, [
9089
+ createElementVNode("div", { class: "pb-login-widget" }, [
9090
+ createElementVNode("h3", null, "Login Design Part")
9091
+ ])
9092
+ ], -1)
9093
+ ]));
9137
9094
  };
9138
9095
  }
9139
9096
  });
9140
- const _hoisted_1$p = ["data-part-id"];
9097
+ const _hoisted_1$o = ["data-part-id"];
9141
9098
  const _sfc_main$l = /* @__PURE__ */ defineComponent({
9142
9099
  __name: "PbSection",
9143
9100
  props: {
@@ -9192,11 +9149,9 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
9192
9149
  locateNone(mark.style);
9193
9150
  };
9194
9151
  const acceptChildPart = (pageBuilder2, part, target, _index, partId, event) => {
9195
- if (partId === props.part.partId)
9196
- return;
9152
+ if (partId === props.part.partId) return;
9197
9153
  const droppedPart = pageBuilder2.model.findPartById(partId);
9198
- if (!droppedPart)
9199
- return;
9154
+ if (!droppedPart) return;
9200
9155
  const targetRect = target.getBoundingClientRect();
9201
9156
  const mouseOffsetX = event.clientX - targetRect.left;
9202
9157
  const mouseOffsetY = event.clientY - targetRect.top;
@@ -9212,8 +9167,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
9212
9167
  const sectionIndex = page.children.indexOf(section) || 0;
9213
9168
  const centerY = sectionElement.offsetHeight / 2;
9214
9169
  const index = mouseOffsetY <= centerY ? sectionIndex : sectionIndex + 1;
9215
- if (page.children.indexOf(droppedPart) === index)
9216
- return;
9170
+ if (page.children.indexOf(droppedPart) === index) return;
9217
9171
  pageBuilder2.model.moveElements(droppedPart.partId, page.partId, index);
9218
9172
  };
9219
9173
  const acceptBlock = (pageBuilder2, target, droppedPart, mouseOffsetX, mouseOffsetY) => {
@@ -9222,20 +9176,17 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
9222
9176
  };
9223
9177
  const calculateDropIndex = (part, target, mouseOffsetX, mouseOffsetY, _event) => {
9224
9178
  var _a;
9225
- if (!part.children || part.children.length === 0)
9226
- return 0;
9179
+ if (!part.children || part.children.length === 0) return 0;
9227
9180
  const children = Array.from(target.children).filter((child) => !isPositionMark(child)).map((child) => child);
9228
9181
  const dir = ((_a = props.part.properties) == null ? void 0 : _a.direction) || "vertical";
9229
9182
  let index = 0;
9230
9183
  for (const child of children) {
9231
9184
  if (dir === "horizontal") {
9232
9185
  const centerX = child.offsetLeft + child.offsetWidth / 2;
9233
- if (mouseOffsetX <= centerX)
9234
- return index;
9186
+ if (mouseOffsetX <= centerX) return index;
9235
9187
  } else {
9236
9188
  const centerY = child.offsetTop + child.offsetHeight / 2;
9237
- if (mouseOffsetY <= centerY)
9238
- return index;
9189
+ if (mouseOffsetY <= centerY) return index;
9239
9190
  }
9240
9191
  ++index;
9241
9192
  }
@@ -9269,29 +9220,20 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
9269
9220
  onAddWidget: addWidget
9270
9221
  }))
9271
9222
  ], 64))
9272
- ], 16, _hoisted_1$p)), [
9223
+ ], 16, _hoisted_1$o)), [
9273
9224
  [unref(vPartHandler), { pageBuilder: unref(pageBuilder), part: _ctx.part, droppable: true, locatePositionMark, calculateDropIndex, acceptChildPart }]
9274
9225
  ])
9275
9226
  ], 64);
9276
9227
  };
9277
9228
  }
9278
9229
  });
9279
- const _hoisted_1$o = { class: "group-editor group-editor-position" };
9230
+ const _hoisted_1$n = { class: "group-editor group-editor-position" };
9280
9231
  const _hoisted_2$f = { class: "flex-align-center" };
9281
- const _hoisted_3$e = /* @__PURE__ */ createElementVNode("div", { class: "title" }, [
9282
- /* @__PURE__ */ createElementVNode("label", { textContent: "Position" })
9283
- ], -1);
9284
- const _hoisted_4$b = { class: "flex-grow-1" };
9285
- const _hoisted_5$6 = { class: "bg-gray-100 py-5 rounded-8" };
9286
- const _hoisted_6$5 = { class: "text-center" };
9287
- const _hoisted_7$5 = { class: "bs-layout-horizontal justify-content-center align-items-center" };
9288
- const _hoisted_8$5 = /* @__PURE__ */ createElementVNode("div", {
9289
- class: "d-inline-block text-center text-gray-300",
9290
- style: { "width": "30%", "font-size": "12px" }
9291
- }, [
9292
- /* @__PURE__ */ createElementVNode("span", { class: "font-icon" }, "add")
9293
- ], -1);
9294
- const _hoisted_9$5 = { class: "text-center" };
9232
+ const _hoisted_3$c = { class: "flex-grow-1" };
9233
+ const _hoisted_4$9 = { class: "bg-gray-100 py-5 rounded-8" };
9234
+ const _hoisted_5$5 = { class: "text-center" };
9235
+ const _hoisted_6$5 = { class: "bs-layout-horizontal justify-content-center align-items-center" };
9236
+ const _hoisted_7$5 = { class: "text-center" };
9295
9237
  const _sfc_main$k = /* @__PURE__ */ defineComponent({
9296
9238
  __name: "PbPropertyGroupEditorPosition",
9297
9239
  props: {
@@ -9316,12 +9258,14 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
9316
9258
  const updateTop = (value) => updatePropertyValue({ top: value });
9317
9259
  const updateBottom = (value) => updatePropertyValue({ bottom: value });
9318
9260
  return (_ctx, _cache) => {
9319
- return openBlock(), createElementBlock("div", _hoisted_1$o, [
9261
+ return openBlock(), createElementBlock("div", _hoisted_1$n, [
9320
9262
  createElementVNode("div", _hoisted_2$f, [
9321
- _hoisted_3$e,
9322
- createElementVNode("div", _hoisted_4$b, [
9323
- createElementVNode("div", _hoisted_5$6, [
9324
- createElementVNode("div", _hoisted_6$5, [
9263
+ _cache[1] || (_cache[1] = createElementVNode("div", { class: "title" }, [
9264
+ createElementVNode("label", { textContent: "Position" })
9265
+ ], -1)),
9266
+ createElementVNode("div", _hoisted_3$c, [
9267
+ createElementVNode("div", _hoisted_4$9, [
9268
+ createElementVNode("div", _hoisted_5$5, [
9325
9269
  createVNode(unref(BSTextInput), {
9326
9270
  "model-value": top.value,
9327
9271
  class: "ml-4",
@@ -9330,7 +9274,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
9330
9274
  "onUpdate:modelValue": updateTop
9331
9275
  }, null, 8, ["model-value"])
9332
9276
  ]),
9333
- createElementVNode("div", _hoisted_7$5, [
9277
+ createElementVNode("div", _hoisted_6$5, [
9334
9278
  createVNode(unref(BSTextInput), {
9335
9279
  "model-value": left.value,
9336
9280
  class: "ml-4",
@@ -9338,7 +9282,12 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
9338
9282
  width: "30%",
9339
9283
  "onUpdate:modelValue": updateLeft
9340
9284
  }, null, 8, ["model-value"]),
9341
- _hoisted_8$5,
9285
+ _cache[0] || (_cache[0] = createElementVNode("div", {
9286
+ class: "d-inline-block text-center text-gray-300",
9287
+ style: { "width": "30%", "font-size": "12px" }
9288
+ }, [
9289
+ createElementVNode("span", { class: "font-icon" }, "add")
9290
+ ], -1)),
9342
9291
  createVNode(unref(BSTextInput), {
9343
9292
  "model-value": right.value,
9344
9293
  class: "ml-4",
@@ -9347,7 +9296,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
9347
9296
  "onUpdate:modelValue": updateRight
9348
9297
  }, null, 8, ["model-value"])
9349
9298
  ]),
9350
- createElementVNode("div", _hoisted_9$5, [
9299
+ createElementVNode("div", _hoisted_7$5, [
9351
9300
  createVNode(unref(BSTextInput), {
9352
9301
  "model-value": bottom.value,
9353
9302
  class: "ml-4",
@@ -9363,22 +9312,13 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
9363
9312
  };
9364
9313
  }
9365
9314
  });
9366
- const _hoisted_1$n = { class: "group-editor group-editor-size" };
9315
+ const _hoisted_1$m = { class: "group-editor group-editor-size" };
9367
9316
  const _hoisted_2$e = { class: "flex-align-center" };
9368
- const _hoisted_3$d = /* @__PURE__ */ createElementVNode("div", { class: "title" }, [
9369
- /* @__PURE__ */ createElementVNode("label", { textContent: "Size" })
9370
- ], -1);
9371
- const _hoisted_4$a = { class: "flex-grow-1 bs-layout-horizontal" };
9372
- const _hoisted_5$5 = { class: "flex-align-center mt-12" };
9373
- const _hoisted_6$4 = /* @__PURE__ */ createElementVNode("div", { class: "title" }, [
9374
- /* @__PURE__ */ createElementVNode("label", { textContent: "Max Size" })
9375
- ], -1);
9317
+ const _hoisted_3$b = { class: "flex-grow-1 bs-layout-horizontal" };
9318
+ const _hoisted_4$8 = { class: "flex-align-center mt-12" };
9319
+ const _hoisted_5$4 = { class: "flex-grow-1 bs-layout-horizontal" };
9320
+ const _hoisted_6$4 = { class: "flex-align-center mt-12" };
9376
9321
  const _hoisted_7$4 = { class: "flex-grow-1 bs-layout-horizontal" };
9377
- const _hoisted_8$4 = { class: "flex-align-center mt-12" };
9378
- const _hoisted_9$4 = /* @__PURE__ */ createElementVNode("div", { class: "title" }, [
9379
- /* @__PURE__ */ createElementVNode("label", { textContent: "Min Size" })
9380
- ], -1);
9381
- const _hoisted_10$2 = { class: "flex-grow-1 bs-layout-horizontal" };
9382
9322
  const _sfc_main$j = /* @__PURE__ */ defineComponent({
9383
9323
  __name: "PbPropertyGroupEditorSize",
9384
9324
  props: {
@@ -9407,10 +9347,12 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
9407
9347
  const updateMinWidth = (value) => updatePropertyValue({ minWidth: value });
9408
9348
  const updateMinHeight = (value) => updatePropertyValue({ minHeight: value });
9409
9349
  return (_ctx, _cache) => {
9410
- return openBlock(), createElementBlock("div", _hoisted_1$n, [
9350
+ return openBlock(), createElementBlock("div", _hoisted_1$m, [
9411
9351
  createElementVNode("div", _hoisted_2$e, [
9412
- _hoisted_3$d,
9413
- createElementVNode("div", _hoisted_4$a, [
9352
+ _cache[0] || (_cache[0] = createElementVNode("div", { class: "title" }, [
9353
+ createElementVNode("label", { textContent: "Size" })
9354
+ ], -1)),
9355
+ createElementVNode("div", _hoisted_3$b, [
9414
9356
  createVNode(unref(BSTextInput), {
9415
9357
  "model-value": width.value,
9416
9358
  class: "flex-grow-1 mr-2",
@@ -9425,9 +9367,11 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
9425
9367
  }, null, 8, ["model-value"])
9426
9368
  ])
9427
9369
  ]),
9428
- createElementVNode("div", _hoisted_5$5, [
9429
- _hoisted_6$4,
9430
- createElementVNode("div", _hoisted_7$4, [
9370
+ createElementVNode("div", _hoisted_4$8, [
9371
+ _cache[1] || (_cache[1] = createElementVNode("div", { class: "title" }, [
9372
+ createElementVNode("label", { textContent: "Max Size" })
9373
+ ], -1)),
9374
+ createElementVNode("div", _hoisted_5$4, [
9431
9375
  createVNode(unref(BSTextInput), {
9432
9376
  "model-value": maxWidth.value,
9433
9377
  class: "flex-grow-1 mr-2",
@@ -9442,9 +9386,11 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
9442
9386
  }, null, 8, ["model-value"])
9443
9387
  ])
9444
9388
  ]),
9445
- createElementVNode("div", _hoisted_8$4, [
9446
- _hoisted_9$4,
9447
- createElementVNode("div", _hoisted_10$2, [
9389
+ createElementVNode("div", _hoisted_6$4, [
9390
+ _cache[2] || (_cache[2] = createElementVNode("div", { class: "title" }, [
9391
+ createElementVNode("label", { textContent: "Min Size" })
9392
+ ], -1)),
9393
+ createElementVNode("div", _hoisted_7$4, [
9448
9394
  createVNode(unref(BSTextInput), {
9449
9395
  "model-value": minWidth.value,
9450
9396
  class: "flex-grow-1 mr-2",
@@ -9465,8 +9411,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
9465
9411
  });
9466
9412
  const prefix = "";
9467
9413
  function styleInject(css, ref2) {
9468
- if (ref2 === void 0)
9469
- ref2 = {};
9414
+ if (ref2 === void 0) ref2 = {};
9470
9415
  var insertAt = ref2.insertAt;
9471
9416
  if (!css || typeof document === "undefined") {
9472
9417
  return;
@@ -9620,21 +9565,21 @@ var script$4 = {
9620
9565
  }
9621
9566
  }
9622
9567
  };
9623
- const _hoisted_1$m = { class: "vc-alpha" };
9568
+ const _hoisted_1$l = { class: "vc-alpha" };
9624
9569
  const _hoisted_2$d = { class: "vc-alpha-checkboard-wrap" };
9625
- const _hoisted_3$c = /* @__PURE__ */ createElementVNode(
9570
+ const _hoisted_3$a = /* @__PURE__ */ createElementVNode(
9626
9571
  "div",
9627
9572
  { class: "vc-alpha-picker" },
9628
9573
  null,
9629
9574
  -1
9630
9575
  /* HOISTED */
9631
9576
  );
9632
- const _hoisted_4$9 = [
9633
- _hoisted_3$c
9577
+ const _hoisted_4$7 = [
9578
+ _hoisted_3$a
9634
9579
  ];
9635
9580
  function render$4(_ctx, _cache, $props, $setup, $data, $options) {
9636
9581
  const _component_Checkboard = resolveComponent("Checkboard");
9637
- return openBlock(), createElementBlock("div", _hoisted_1$m, [
9582
+ return openBlock(), createElementBlock("div", _hoisted_1$l, [
9638
9583
  createElementVNode("div", _hoisted_2$d, [
9639
9584
  createVNode(_component_Checkboard)
9640
9585
  ]),
@@ -9664,7 +9609,7 @@ function render$4(_ctx, _cache, $props, $setup, $data, $options) {
9664
9609
  class: "vc-alpha-pointer",
9665
9610
  style: normalizeStyle({ left: `${$options.colors.a * 100}%` })
9666
9611
  },
9667
- _hoisted_4$9,
9612
+ _hoisted_4$7,
9668
9613
  4
9669
9614
  /* STYLE */
9670
9615
  )
@@ -10738,12 +10683,12 @@ var script$3 = {
10738
10683
  // }
10739
10684
  }
10740
10685
  };
10741
- const _hoisted_1$l = { class: "vc-editable-input" };
10686
+ const _hoisted_1$k = { class: "vc-editable-input" };
10742
10687
  const _hoisted_2$c = ["aria-labelledby"];
10743
- const _hoisted_3$b = ["id", "for"];
10744
- const _hoisted_4$8 = { class: "vc-input__desc" };
10688
+ const _hoisted_3$9 = ["id", "for"];
10689
+ const _hoisted_4$6 = { class: "vc-input__desc" };
10745
10690
  function render$3(_ctx, _cache, $props, $setup, $data, $options) {
10746
- return openBlock(), createElementBlock("div", _hoisted_1$l, [
10691
+ return openBlock(), createElementBlock("div", _hoisted_1$k, [
10747
10692
  withDirectives(createElementVNode("input", {
10748
10693
  ref: "input",
10749
10694
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $options.val = $event),
@@ -10758,10 +10703,10 @@ function render$3(_ctx, _cache, $props, $setup, $data, $options) {
10758
10703
  id: $options.labelId,
10759
10704
  for: $props.label,
10760
10705
  class: "vc-input__label"
10761
- }, toDisplayString($options.labelSpanText), 9, _hoisted_3$b),
10706
+ }, toDisplayString($options.labelSpanText), 9, _hoisted_3$9),
10762
10707
  createElementVNode(
10763
10708
  "span",
10764
- _hoisted_4$8,
10709
+ _hoisted_4$6,
10765
10710
  toDisplayString($props.desc),
10766
10711
  1
10767
10712
  /* TEXT */
@@ -10838,7 +10783,7 @@ var script$2 = {
10838
10783
  }
10839
10784
  }
10840
10785
  };
10841
- const _hoisted_1$k = /* @__PURE__ */ createElementVNode(
10786
+ const _hoisted_1$j = /* @__PURE__ */ createElementVNode(
10842
10787
  "div",
10843
10788
  { class: "vc-saturation--white" },
10844
10789
  null,
@@ -10852,15 +10797,15 @@ const _hoisted_2$b = /* @__PURE__ */ createElementVNode(
10852
10797
  -1
10853
10798
  /* HOISTED */
10854
10799
  );
10855
- const _hoisted_3$a = /* @__PURE__ */ createElementVNode(
10800
+ const _hoisted_3$8 = /* @__PURE__ */ createElementVNode(
10856
10801
  "div",
10857
10802
  { class: "vc-saturation-circle" },
10858
10803
  null,
10859
10804
  -1
10860
10805
  /* HOISTED */
10861
10806
  );
10862
- const _hoisted_4$7 = [
10863
- _hoisted_3$a
10807
+ const _hoisted_4$5 = [
10808
+ _hoisted_3$8
10864
10809
  ];
10865
10810
  function render$2(_ctx, _cache, $props, $setup, $data, $options) {
10866
10811
  return openBlock(), createElementBlock(
@@ -10874,7 +10819,7 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
10874
10819
  onTouchstart: _cache[2] || (_cache[2] = (...args) => $options.handleChange && $options.handleChange(...args))
10875
10820
  },
10876
10821
  [
10877
- _hoisted_1$k,
10822
+ _hoisted_1$j,
10878
10823
  _hoisted_2$b,
10879
10824
  createElementVNode(
10880
10825
  "div",
@@ -10882,7 +10827,7 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
10882
10827
  class: "vc-saturation-pointer",
10883
10828
  style: normalizeStyle({ top: $options.pointerTop, left: $options.pointerLeft })
10884
10829
  },
10885
- _hoisted_4$7,
10830
+ _hoisted_4$5,
10886
10831
  4
10887
10832
  /* STYLE */
10888
10833
  )
@@ -11023,7 +10968,7 @@ var script$1 = {
11023
10968
  }
11024
10969
  }
11025
10970
  };
11026
- const _hoisted_1$j = ["aria-valuenow"];
10971
+ const _hoisted_1$i = ["aria-valuenow"];
11027
10972
  const _hoisted_2$a = /* @__PURE__ */ createElementVNode(
11028
10973
  "div",
11029
10974
  { class: "vc-hue-picker" },
@@ -11031,7 +10976,7 @@ const _hoisted_2$a = /* @__PURE__ */ createElementVNode(
11031
10976
  -1
11032
10977
  /* HOISTED */
11033
10978
  );
11034
- const _hoisted_3$9 = [
10979
+ const _hoisted_3$7 = [
11035
10980
  _hoisted_2$a
11036
10981
  ];
11037
10982
  function render$1(_ctx, _cache, $props, $setup, $data, $options) {
@@ -11059,11 +11004,11 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
11059
11004
  style: normalizeStyle({ top: $options.pointerTop, left: $options.pointerLeft }),
11060
11005
  role: "presentation"
11061
11006
  },
11062
- _hoisted_3$9,
11007
+ _hoisted_3$7,
11063
11008
  4
11064
11009
  /* STYLE */
11065
11010
  )
11066
- ], 40, _hoisted_1$j)
11011
+ ], 40, _hoisted_1$i)
11067
11012
  ],
11068
11013
  2
11069
11014
  /* CLASS */
@@ -11159,21 +11104,21 @@ var script = {
11159
11104
  }
11160
11105
  }
11161
11106
  };
11162
- const _hoisted_1$i = { class: "vc-sketch-saturation-wrap" };
11107
+ const _hoisted_1$h = { class: "vc-sketch-saturation-wrap" };
11163
11108
  const _hoisted_2$9 = { class: "vc-sketch-controls" };
11164
- const _hoisted_3$8 = { class: "vc-sketch-sliders" };
11165
- const _hoisted_4$6 = { class: "vc-sketch-hue-wrap" };
11166
- const _hoisted_5$4 = {
11109
+ const _hoisted_3$6 = { class: "vc-sketch-sliders" };
11110
+ const _hoisted_4$4 = { class: "vc-sketch-hue-wrap" };
11111
+ const _hoisted_5$3 = {
11167
11112
  key: 0,
11168
11113
  class: "vc-sketch-alpha-wrap"
11169
11114
  };
11170
11115
  const _hoisted_6$3 = { class: "vc-sketch-color-wrap" };
11171
11116
  const _hoisted_7$3 = ["aria-label"];
11172
- const _hoisted_8$3 = {
11117
+ const _hoisted_8$1 = {
11173
11118
  key: 0,
11174
11119
  class: "vc-sketch-field"
11175
11120
  };
11176
- const _hoisted_9$3 = { class: "vc-sketch-field--double" };
11121
+ const _hoisted_9$1 = { class: "vc-sketch-field--double" };
11177
11122
  const _hoisted_10$1 = { class: "vc-sketch-field--single" };
11178
11123
  const _hoisted_11$1 = { class: "vc-sketch-field--single" };
11179
11124
  const _hoisted_12$1 = { class: "vc-sketch-field--single" };
@@ -11187,7 +11132,7 @@ const _hoisted_14$1 = {
11187
11132
  "aria-label": "A color preset, pick one to set as current color"
11188
11133
  };
11189
11134
  const _hoisted_15$1 = ["aria-label", "onClick"];
11190
- const _hoisted_16$1 = ["aria-label", "onClick"];
11135
+ const _hoisted_16 = ["aria-label", "onClick"];
11191
11136
  function render(_ctx, _cache, $props, $setup, $data, $options) {
11192
11137
  const _component_Saturation = resolveComponent("Saturation");
11193
11138
  const _component_Hue = resolveComponent("Hue");
@@ -11202,21 +11147,21 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
11202
11147
  class: normalizeClass(["vc-sketch", [$props.disableAlpha ? "vc-sketch__disable-alpha" : ""]])
11203
11148
  },
11204
11149
  [
11205
- createElementVNode("div", _hoisted_1$i, [
11150
+ createElementVNode("div", _hoisted_1$h, [
11206
11151
  createVNode(_component_Saturation, {
11207
11152
  value: _ctx.colors,
11208
11153
  onChange: $options.childChange
11209
11154
  }, null, 8, ["value", "onChange"])
11210
11155
  ]),
11211
11156
  createElementVNode("div", _hoisted_2$9, [
11212
- createElementVNode("div", _hoisted_3$8, [
11213
- createElementVNode("div", _hoisted_4$6, [
11157
+ createElementVNode("div", _hoisted_3$6, [
11158
+ createElementVNode("div", _hoisted_4$4, [
11214
11159
  createVNode(_component_Hue, {
11215
11160
  value: _ctx.colors,
11216
11161
  onChange: $options.childChange
11217
11162
  }, null, 8, ["value", "onChange"])
11218
11163
  ]),
11219
- !$props.disableAlpha ? (openBlock(), createElementBlock("div", _hoisted_5$4, [
11164
+ !$props.disableAlpha ? (openBlock(), createElementBlock("div", _hoisted_5$3, [
11220
11165
  createVNode(_component_Alpha, {
11221
11166
  value: _ctx.colors,
11222
11167
  onChange: $options.childChange
@@ -11232,9 +11177,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
11232
11177
  createVNode(_component_Checkboard)
11233
11178
  ])
11234
11179
  ]),
11235
- !$props.disableFields ? (openBlock(), createElementBlock("div", _hoisted_8$3, [
11180
+ !$props.disableFields ? (openBlock(), createElementBlock("div", _hoisted_8$1, [
11236
11181
  createCommentVNode(" rgba "),
11237
- createElementVNode("div", _hoisted_9$3, [
11182
+ createElementVNode("div", _hoisted_9$1, [
11238
11183
  createVNode(_component_EdIn, {
11239
11184
  label: "hex",
11240
11185
  value: $options.hex,
@@ -11294,7 +11239,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
11294
11239
  onClick: ($event) => $options.handlePreset(c)
11295
11240
  }, [
11296
11241
  createVNode(_component_Checkboard)
11297
- ], 8, _hoisted_16$1))
11242
+ ], 8, _hoisted_16))
11298
11243
  ],
11299
11244
  64
11300
11245
  /* STABLE_FRAGMENT */
@@ -11332,12 +11277,9 @@ const _sfc_main$i = defineComponent({
11332
11277
  setup(props, { emit }) {
11333
11278
  const color = ref(props.value);
11334
11279
  const appliedColor = computed(() => {
11335
- if (typeof color.value === "string")
11336
- return color.value;
11337
- else if (typeof color.value === "object" && color.value.hasOwnProperty("hex"))
11338
- return color.value.hex;
11339
- else
11340
- return;
11280
+ if (typeof color.value === "string") return color.value;
11281
+ else if (typeof color.value === "object" && color.value.hasOwnProperty("hex")) return color.value.hex;
11282
+ else return;
11341
11283
  });
11342
11284
  const isShowColorPicker = ref(false);
11343
11285
  const toggle = (value) => {
@@ -11353,8 +11295,7 @@ const _sfc_main$i = defineComponent({
11353
11295
  watch(
11354
11296
  () => color.value,
11355
11297
  () => setTimeout(() => {
11356
- if (appliedColor.value)
11357
- emit("change-color", appliedColor.value);
11298
+ if (appliedColor.value) emit("change-color", appliedColor.value);
11358
11299
  }, 100),
11359
11300
  { deep: true }
11360
11301
  );
@@ -11378,12 +11319,8 @@ const _sfc_main$i = defineComponent({
11378
11319
  };
11379
11320
  }
11380
11321
  });
11381
- const _hoisted_1$h = { class: "buttons" };
11382
- const _hoisted_2$8 = /* @__PURE__ */ createElementVNode("i", { class: "material-icons-outlined" }, "delete", -1);
11383
- const _hoisted_3$7 = [
11384
- _hoisted_2$8
11385
- ];
11386
- const _hoisted_4$5 = { class: "sketch-wrap" };
11322
+ const _hoisted_1$g = { class: "buttons" };
11323
+ const _hoisted_2$8 = { class: "sketch-wrap" };
11387
11324
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
11388
11325
  const _component_Sketch = resolveComponent("Sketch");
11389
11326
  const _directive_click_outside = resolveDirective("click-outside");
@@ -11392,21 +11329,22 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
11392
11329
  onKeydown: _cache[3] || (_cache[3] = withModifiers(() => {
11393
11330
  }, ["stop"]))
11394
11331
  }, [
11395
- createElementVNode("div", _hoisted_1$h, [
11332
+ createElementVNode("div", _hoisted_1$g, [
11396
11333
  renderSlot(_ctx.$slots, "button", normalizeProps(guardReactiveProps({ toggle: _ctx.toggle, color: _ctx.color })), () => [
11397
11334
  createElementVNode("button", {
11398
- class: normalizeClass([{ none: !_ctx.color }, "pb-button picker-button"]),
11335
+ class: normalizeClass([{ none: !_ctx.color }, "picker-button"]),
11399
11336
  style: normalizeStyle({ background: _ctx.appliedColor }),
11400
11337
  onClick: _cache[0] || (_cache[0] = ($event) => _ctx.toggle())
11401
11338
  }, null, 6)
11402
11339
  ]),
11403
11340
  !_ctx.hideDelete && _ctx.color ? (openBlock(), createElementBlock("button", {
11404
11341
  key: 0,
11405
- class: "pb-button",
11406
11342
  onClick: _cache[1] || (_cache[1] = (...args) => _ctx.emptyColor && _ctx.emptyColor(...args))
11407
- }, _hoisted_3$7)) : createCommentVNode("", true)
11343
+ }, _cache[4] || (_cache[4] = [
11344
+ createElementVNode("i", { class: "material-icons-outlined" }, "delete", -1)
11345
+ ]))) : createCommentVNode("", true)
11408
11346
  ]),
11409
- createElementVNode("div", _hoisted_4$5, [
11347
+ createElementVNode("div", _hoisted_2$8, [
11410
11348
  _ctx.isShowColorPicker ? (openBlock(), createBlock$1(_component_Sketch, {
11411
11349
  key: 0,
11412
11350
  modelValue: _ctx.color,
@@ -11419,13 +11357,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
11419
11357
  ]);
11420
11358
  }
11421
11359
  const PbColorPicker = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render]]);
11422
- const _hoisted_1$g = { class: "group-editor group-editor-background" };
11360
+ const _hoisted_1$f = { class: "group-editor group-editor-background" };
11423
11361
  const _hoisted_2$7 = { class: "flex-align-center" };
11424
- const _hoisted_3$6 = /* @__PURE__ */ createElementVNode("div", { class: "title" }, [
11425
- /* @__PURE__ */ createElementVNode("label", { textContent: "Background" })
11426
- ], -1);
11427
- const _hoisted_4$4 = { class: "bs-layout-horizontal" };
11428
- const _hoisted_5$3 = { class: "color" };
11362
+ const _hoisted_3$5 = { class: "bs-layout-horizontal" };
11363
+ const _hoisted_4$3 = { class: "color" };
11429
11364
  const _sfc_main$h = /* @__PURE__ */ defineComponent({
11430
11365
  __name: "PbPropertyGroupEditorBackground",
11431
11366
  props: {
@@ -11451,17 +11386,21 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
11451
11386
  const selectImage = () => {
11452
11387
  const imageProvider = pageBuilder.getProvider("imageProvider");
11453
11388
  if (imageProvider) {
11454
- imageProvider({ modal }, (url) => {
11455
- updatePropertyValue({ backgroundImage: url });
11389
+ imageProvider({ modal }, (media) => {
11390
+ if (media.mediaType === "Image") {
11391
+ updatePropertyValue({ backgroundImage: media.url });
11392
+ }
11456
11393
  });
11457
11394
  }
11458
11395
  };
11459
11396
  return (_ctx, _cache) => {
11460
- return openBlock(), createElementBlock("div", _hoisted_1$g, [
11397
+ return openBlock(), createElementBlock("div", _hoisted_1$f, [
11461
11398
  createElementVNode("div", _hoisted_2$7, [
11462
- _hoisted_3$6,
11463
- createElementVNode("div", _hoisted_4$4, [
11464
- createElementVNode("div", _hoisted_5$3, [
11399
+ _cache[3] || (_cache[3] = createElementVNode("div", { class: "title" }, [
11400
+ createElementVNode("label", { textContent: "Background" })
11401
+ ], -1)),
11402
+ createElementVNode("div", _hoisted_3$5, [
11403
+ createElementVNode("div", _hoisted_4$3, [
11465
11404
  createVNode(PbColorPicker, {
11466
11405
  value: color.value,
11467
11406
  "hide-delete": "",
@@ -11490,39 +11429,21 @@ const TopLeftCornerIcon = "data:image/svg+xml,%3c!DOCTYPE%20svg%20PUBLIC%20'-//W
11490
11429
  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";
11491
11430
  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";
11492
11431
  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";
11493
- const _hoisted_1$f = { class: "group-editor group-editor-border" };
11432
+ const _hoisted_1$e = { class: "group-editor group-editor-border" };
11494
11433
  const _hoisted_2$6 = { class: "flex-align-center" };
11495
- const _hoisted_3$5 = /* @__PURE__ */ createElementVNode("div", { class: "title" }, [
11496
- /* @__PURE__ */ createElementVNode("label", { textContent: "Border" })
11497
- ], -1);
11498
- const _hoisted_4$3 = { class: "" };
11499
- const _hoisted_5$2 = /* @__PURE__ */ createElementVNode("div", { class: "sub-title" }, [
11500
- /* @__PURE__ */ createElementVNode("label", { textContent: "Color" })
11501
- ], -1);
11502
- const _hoisted_6$2 = { class: "color" };
11503
- const _hoisted_7$2 = { class: "mt-8" };
11504
- const _hoisted_8$2 = /* @__PURE__ */ createElementVNode("div", { class: "sub-title" }, [
11505
- /* @__PURE__ */ createElementVNode("label", { textContent: "Border Width" })
11506
- ], -1);
11507
- const _hoisted_9$2 = { class: "flex-grow-1 mt-4" };
11508
- const _hoisted_10 = { class: "bg-gray-100 py-5 rounded-8" };
11509
- const _hoisted_11 = { class: "text-center" };
11510
- const _hoisted_12 = { class: "bs-layout-horizontal justify-content-center align-items-center" };
11511
- const _hoisted_13 = /* @__PURE__ */ createElementVNode("div", {
11512
- class: "d-inline-block text-center text-gray-300",
11513
- style: { "width": "30%", "font-size": "12px" }
11514
- }, [
11515
- /* @__PURE__ */ createElementVNode("span", { class: "font-icon" }, "add")
11516
- ], -1);
11517
- const _hoisted_14 = { class: "text-center" };
11518
- const _hoisted_15 = { class: "mt-8" };
11519
- const _hoisted_16 = /* @__PURE__ */ createElementVNode("div", { class: "sub-title" }, [
11520
- /* @__PURE__ */ createElementVNode("label", { textContent: "Border Radius" })
11521
- ], -1);
11522
- const _hoisted_17 = { class: "flex-grow-1 mt-4" };
11523
- const _hoisted_18 = { class: "bg-gray-100 py-5 rounded-8" };
11524
- const _hoisted_19 = { class: "" };
11525
- const _hoisted_20 = { class: "mt-2" };
11434
+ const _hoisted_3$4 = { class: "" };
11435
+ const _hoisted_4$2 = { class: "color" };
11436
+ const _hoisted_5$2 = { class: "mt-8" };
11437
+ const _hoisted_6$2 = { class: "flex-grow-1 mt-4" };
11438
+ const _hoisted_7$2 = { class: "bg-gray-100 py-5 rounded-8" };
11439
+ const _hoisted_8 = { class: "text-center" };
11440
+ const _hoisted_9 = { class: "bs-layout-horizontal justify-content-center align-items-center" };
11441
+ const _hoisted_10 = { class: "text-center" };
11442
+ const _hoisted_11 = { class: "mt-8" };
11443
+ const _hoisted_12 = { class: "flex-grow-1 mt-4" };
11444
+ const _hoisted_13 = { class: "bg-gray-100 py-5 rounded-8" };
11445
+ const _hoisted_14 = { class: "" };
11446
+ const _hoisted_15 = { class: "mt-2" };
11526
11447
  const _sfc_main$g = /* @__PURE__ */ defineComponent({
11527
11448
  __name: "PbPropertyGroupEditorBorder",
11528
11449
  props: {
@@ -11561,12 +11482,16 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
11561
11482
  const updateBorderBottomLeftRadius = (value) => updatePropertyValue({ borderBottomLeftRadius: value });
11562
11483
  const updateBorderBottomRightRadius = (value) => updatePropertyValue({ borderBottomRightRadius: value });
11563
11484
  return (_ctx, _cache) => {
11564
- return openBlock(), createElementBlock("div", _hoisted_1$f, [
11485
+ return openBlock(), createElementBlock("div", _hoisted_1$e, [
11565
11486
  createElementVNode("div", _hoisted_2$6, [
11566
- _hoisted_3$5,
11567
- createElementVNode("div", _hoisted_4$3, [
11568
- _hoisted_5$2,
11569
- createElementVNode("div", _hoisted_6$2, [
11487
+ _cache[7] || (_cache[7] = createElementVNode("div", { class: "title" }, [
11488
+ createElementVNode("label", { textContent: "Border" })
11489
+ ], -1)),
11490
+ createElementVNode("div", _hoisted_3$4, [
11491
+ _cache[3] || (_cache[3] = createElementVNode("div", { class: "sub-title" }, [
11492
+ createElementVNode("label", { textContent: "Color" })
11493
+ ], -1)),
11494
+ createElementVNode("div", _hoisted_4$2, [
11570
11495
  createVNode(PbColorPicker, {
11571
11496
  value: color.value,
11572
11497
  "hide-delete": "",
@@ -11584,11 +11509,13 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
11584
11509
  }, null, 8, ["model-value"])
11585
11510
  ])
11586
11511
  ]),
11587
- createElementVNode("div", _hoisted_7$2, [
11588
- _hoisted_8$2,
11589
- createElementVNode("div", _hoisted_9$2, [
11590
- createElementVNode("div", _hoisted_10, [
11591
- createElementVNode("div", _hoisted_11, [
11512
+ createElementVNode("div", _hoisted_5$2, [
11513
+ _cache[5] || (_cache[5] = createElementVNode("div", { class: "sub-title" }, [
11514
+ createElementVNode("label", { textContent: "Border Width" })
11515
+ ], -1)),
11516
+ createElementVNode("div", _hoisted_6$2, [
11517
+ createElementVNode("div", _hoisted_7$2, [
11518
+ createElementVNode("div", _hoisted_8, [
11592
11519
  createVNode(unref(BSTextInput), {
11593
11520
  "model-value": borderTopWidth.value,
11594
11521
  class: "ml-4",
@@ -11597,7 +11524,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
11597
11524
  "onUpdate:modelValue": updateBorderTopWidth
11598
11525
  }, null, 8, ["model-value"])
11599
11526
  ]),
11600
- createElementVNode("div", _hoisted_12, [
11527
+ createElementVNode("div", _hoisted_9, [
11601
11528
  createVNode(unref(BSTextInput), {
11602
11529
  "model-value": borderLeftWidth.value,
11603
11530
  class: "ml-4",
@@ -11605,7 +11532,12 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
11605
11532
  width: "30%",
11606
11533
  "onUpdate:modelValue": updateBorderLeftWidth
11607
11534
  }, null, 8, ["model-value"]),
11608
- _hoisted_13,
11535
+ _cache[4] || (_cache[4] = createElementVNode("div", {
11536
+ class: "d-inline-block text-center text-gray-300",
11537
+ style: { "width": "30%", "font-size": "12px" }
11538
+ }, [
11539
+ createElementVNode("span", { class: "font-icon" }, "add")
11540
+ ], -1)),
11609
11541
  createVNode(unref(BSTextInput), {
11610
11542
  "model-value": borderRightWidth.value,
11611
11543
  class: "ml-4",
@@ -11614,7 +11546,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
11614
11546
  "onUpdate:modelValue": updateBorderRightWidth
11615
11547
  }, null, 8, ["model-value"])
11616
11548
  ]),
11617
- createElementVNode("div", _hoisted_14, [
11549
+ createElementVNode("div", _hoisted_10, [
11618
11550
  createVNode(unref(BSTextInput), {
11619
11551
  "model-value": borderBottomWidth.value,
11620
11552
  class: "ml-4",
@@ -11626,11 +11558,13 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
11626
11558
  ])
11627
11559
  ])
11628
11560
  ]),
11629
- createElementVNode("div", _hoisted_15, [
11630
- _hoisted_16,
11631
- createElementVNode("div", _hoisted_17, [
11632
- createElementVNode("div", _hoisted_18, [
11633
- createElementVNode("div", _hoisted_19, [
11561
+ createElementVNode("div", _hoisted_11, [
11562
+ _cache[6] || (_cache[6] = createElementVNode("div", { class: "sub-title" }, [
11563
+ createElementVNode("label", { textContent: "Border Radius" })
11564
+ ], -1)),
11565
+ createElementVNode("div", _hoisted_12, [
11566
+ createElementVNode("div", _hoisted_13, [
11567
+ createElementVNode("div", _hoisted_14, [
11634
11568
  createVNode(unref(BSTextInput), {
11635
11569
  "model-value": borderTopLeftRadius.value,
11636
11570
  prefix: { type: "image-url", value: unref(TopLeftCornerIcon) },
@@ -11646,7 +11580,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
11646
11580
  "onUpdate:modelValue": updateBorderTopRightRadius
11647
11581
  }, null, 8, ["model-value", "prefix"])
11648
11582
  ]),
11649
- createElementVNode("div", _hoisted_20, [
11583
+ createElementVNode("div", _hoisted_15, [
11650
11584
  createVNode(unref(BSTextInput), {
11651
11585
  "model-value": borderBottomLeftRadius.value,
11652
11586
  prefix: { type: "image-url", value: unref(BottomLeftCornerIcon) },
@@ -11670,22 +11604,13 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
11670
11604
  };
11671
11605
  }
11672
11606
  });
11673
- const _hoisted_1$e = { class: "group-editor group-editor-margin" };
11607
+ const _hoisted_1$d = { class: "group-editor group-editor-margin" };
11674
11608
  const _hoisted_2$5 = { class: "flex-align-center" };
11675
- const _hoisted_3$4 = /* @__PURE__ */ createElementVNode("div", { class: "title" }, [
11676
- /* @__PURE__ */ createElementVNode("label", { textContent: "Margin" })
11677
- ], -1);
11678
- const _hoisted_4$2 = { class: "flex-grow-1" };
11679
- const _hoisted_5$1 = { class: "bg-gray-100 py-5 rounded-8" };
11680
- const _hoisted_6$1 = { class: "text-center" };
11681
- const _hoisted_7$1 = { class: "bs-layout-horizontal justify-content-center align-items-center" };
11682
- const _hoisted_8$1 = /* @__PURE__ */ createElementVNode("div", {
11683
- class: "d-inline-block text-center text-gray-300",
11684
- style: { "width": "30%", "font-size": "12px" }
11685
- }, [
11686
- /* @__PURE__ */ createElementVNode("span", { class: "font-icon" }, "add")
11687
- ], -1);
11688
- const _hoisted_9$1 = { class: "text-center" };
11609
+ const _hoisted_3$3 = { class: "flex-grow-1" };
11610
+ const _hoisted_4$1 = { class: "bg-gray-100 py-5 rounded-8" };
11611
+ const _hoisted_5$1 = { class: "text-center" };
11612
+ const _hoisted_6$1 = { class: "bs-layout-horizontal justify-content-center align-items-center" };
11613
+ const _hoisted_7$1 = { class: "text-center" };
11689
11614
  const _sfc_main$f = /* @__PURE__ */ defineComponent({
11690
11615
  __name: "PbPropertyGroupEditorMargin",
11691
11616
  props: {
@@ -11710,12 +11635,14 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
11710
11635
  const updateTop = (value) => updatePropertyValue({ marginTop: value });
11711
11636
  const updateBottom = (value) => updatePropertyValue({ marginBottom: value });
11712
11637
  return (_ctx, _cache) => {
11713
- return openBlock(), createElementBlock("div", _hoisted_1$e, [
11638
+ return openBlock(), createElementBlock("div", _hoisted_1$d, [
11714
11639
  createElementVNode("div", _hoisted_2$5, [
11715
- _hoisted_3$4,
11716
- createElementVNode("div", _hoisted_4$2, [
11717
- createElementVNode("div", _hoisted_5$1, [
11718
- createElementVNode("div", _hoisted_6$1, [
11640
+ _cache[1] || (_cache[1] = createElementVNode("div", { class: "title" }, [
11641
+ createElementVNode("label", { textContent: "Margin" })
11642
+ ], -1)),
11643
+ createElementVNode("div", _hoisted_3$3, [
11644
+ createElementVNode("div", _hoisted_4$1, [
11645
+ createElementVNode("div", _hoisted_5$1, [
11719
11646
  createVNode(unref(BSTextInput), {
11720
11647
  "model-value": top.value,
11721
11648
  class: "ml-4",
@@ -11724,7 +11651,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
11724
11651
  "onUpdate:modelValue": updateTop
11725
11652
  }, null, 8, ["model-value"])
11726
11653
  ]),
11727
- createElementVNode("div", _hoisted_7$1, [
11654
+ createElementVNode("div", _hoisted_6$1, [
11728
11655
  createVNode(unref(BSTextInput), {
11729
11656
  "model-value": left.value,
11730
11657
  class: "ml-4",
@@ -11732,7 +11659,12 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
11732
11659
  width: "30%",
11733
11660
  "onUpdate:modelValue": updateLeft
11734
11661
  }, null, 8, ["model-value"]),
11735
- _hoisted_8$1,
11662
+ _cache[0] || (_cache[0] = createElementVNode("div", {
11663
+ class: "d-inline-block text-center text-gray-300",
11664
+ style: { "width": "30%", "font-size": "12px" }
11665
+ }, [
11666
+ createElementVNode("span", { class: "font-icon" }, "add")
11667
+ ], -1)),
11736
11668
  createVNode(unref(BSTextInput), {
11737
11669
  "model-value": right.value,
11738
11670
  class: "ml-4",
@@ -11741,7 +11673,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
11741
11673
  "onUpdate:modelValue": updateRight
11742
11674
  }, null, 8, ["model-value"])
11743
11675
  ]),
11744
- createElementVNode("div", _hoisted_9$1, [
11676
+ createElementVNode("div", _hoisted_7$1, [
11745
11677
  createVNode(unref(BSTextInput), {
11746
11678
  "model-value": bottom.value,
11747
11679
  class: "ml-4",
@@ -11757,22 +11689,13 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
11757
11689
  };
11758
11690
  }
11759
11691
  });
11760
- const _hoisted_1$d = { class: "group-editor group-editor-padding" };
11692
+ const _hoisted_1$c = { class: "group-editor group-editor-padding" };
11761
11693
  const _hoisted_2$4 = { class: "flex-align-center" };
11762
- const _hoisted_3$3 = /* @__PURE__ */ createElementVNode("div", { class: "title" }, [
11763
- /* @__PURE__ */ createElementVNode("label", { textContent: "Padding" })
11764
- ], -1);
11765
- const _hoisted_4$1 = { class: "flex-grow-1" };
11766
- const _hoisted_5 = { class: "bg-gray-100 py-5 rounded-8" };
11767
- const _hoisted_6 = { class: "text-center" };
11768
- const _hoisted_7 = { class: "bs-layout-horizontal justify-content-center align-items-center" };
11769
- const _hoisted_8 = /* @__PURE__ */ createElementVNode("div", {
11770
- class: "d-inline-block text-center text-gray-300",
11771
- style: { "width": "30%", "font-size": "12px" }
11772
- }, [
11773
- /* @__PURE__ */ createElementVNode("span", { class: "font-icon" }, "add")
11774
- ], -1);
11775
- const _hoisted_9 = { class: "text-center" };
11694
+ const _hoisted_3$2 = { class: "flex-grow-1" };
11695
+ const _hoisted_4 = { class: "bg-gray-100 py-5 rounded-8" };
11696
+ const _hoisted_5 = { class: "text-center" };
11697
+ const _hoisted_6 = { class: "bs-layout-horizontal justify-content-center align-items-center" };
11698
+ const _hoisted_7 = { class: "text-center" };
11776
11699
  const _sfc_main$e = /* @__PURE__ */ defineComponent({
11777
11700
  __name: "PbPropertyGroupEditorPadding",
11778
11701
  props: {
@@ -11797,12 +11720,14 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
11797
11720
  const updateTop = (value) => updatePropertyValue({ paddingTop: value });
11798
11721
  const updateBottom = (value) => updatePropertyValue({ paddingBottom: value });
11799
11722
  return (_ctx, _cache) => {
11800
- return openBlock(), createElementBlock("div", _hoisted_1$d, [
11723
+ return openBlock(), createElementBlock("div", _hoisted_1$c, [
11801
11724
  createElementVNode("div", _hoisted_2$4, [
11802
- _hoisted_3$3,
11803
- createElementVNode("div", _hoisted_4$1, [
11804
- createElementVNode("div", _hoisted_5, [
11805
- createElementVNode("div", _hoisted_6, [
11725
+ _cache[1] || (_cache[1] = createElementVNode("div", { class: "title" }, [
11726
+ createElementVNode("label", { textContent: "Padding" })
11727
+ ], -1)),
11728
+ createElementVNode("div", _hoisted_3$2, [
11729
+ createElementVNode("div", _hoisted_4, [
11730
+ createElementVNode("div", _hoisted_5, [
11806
11731
  createVNode(unref(BSTextInput), {
11807
11732
  "model-value": top.value,
11808
11733
  class: "ml-4",
@@ -11811,7 +11736,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
11811
11736
  "onUpdate:modelValue": updateTop
11812
11737
  }, null, 8, ["model-value"])
11813
11738
  ]),
11814
- createElementVNode("div", _hoisted_7, [
11739
+ createElementVNode("div", _hoisted_6, [
11815
11740
  createVNode(unref(BSTextInput), {
11816
11741
  "model-value": left.value,
11817
11742
  class: "ml-4",
@@ -11819,7 +11744,12 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
11819
11744
  width: "30%",
11820
11745
  "onUpdate:modelValue": updateLeft
11821
11746
  }, null, 8, ["model-value"]),
11822
- _hoisted_8,
11747
+ _cache[0] || (_cache[0] = createElementVNode("div", {
11748
+ class: "d-inline-block text-center text-gray-300",
11749
+ style: { "width": "30%", "font-size": "12px" }
11750
+ }, [
11751
+ createElementVNode("span", { class: "font-icon" }, "add")
11752
+ ], -1)),
11823
11753
  createVNode(unref(BSTextInput), {
11824
11754
  "model-value": right.value,
11825
11755
  class: "ml-4",
@@ -11828,7 +11758,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
11828
11758
  "onUpdate:modelValue": updateRight
11829
11759
  }, null, 8, ["model-value"])
11830
11760
  ]),
11831
- createElementVNode("div", _hoisted_9, [
11761
+ createElementVNode("div", _hoisted_7, [
11832
11762
  createVNode(unref(BSTextInput), {
11833
11763
  "model-value": bottom.value,
11834
11764
  class: "ml-4",
@@ -12028,6 +11958,20 @@ const layoutGroup = () => {
12028
11958
  ]
12029
11959
  };
12030
11960
  };
11961
+ const alignGroup = () => {
11962
+ return {
11963
+ groupName: "align",
11964
+ caption: "Align",
11965
+ properties: [
11966
+ {
11967
+ propertyName: "align",
11968
+ caption: "Align",
11969
+ propertyType: "select",
11970
+ params: "left,center,right"
11971
+ }
11972
+ ]
11973
+ };
11974
+ };
12031
11975
  const backgroundGroup = () => {
12032
11976
  return {
12033
11977
  groupName: "background",
@@ -12102,24 +12046,55 @@ const borderGroup = () => {
12102
12046
  };
12103
12047
  };
12104
12048
  const defaultPropertyGroups = () => {
12105
- return [layoutGroup(), sizeGroup(), marginGroup(), paddingGroup(), backgroundGroup(), commonGroup()];
12049
+ return [layoutGroup(), alignGroup(), sizeGroup(), marginGroup(), paddingGroup(), backgroundGroup(), commonGroup()];
12106
12050
  };
12107
12051
  const defaultWidgetPropertyGroups = () => {
12108
- return [positionGroup(), sizeGroup(), marginGroup(), paddingGroup(), borderGroup(), backgroundGroup(), commonGroup()];
12052
+ return [alignGroup(), positionGroup(), sizeGroup(), marginGroup(), paddingGroup(), borderGroup(), backgroundGroup(), commonGroup()];
12109
12053
  };
12054
+ const _sfc_main$d = /* @__PURE__ */ defineComponent({
12055
+ __name: "PbContainerWidget",
12056
+ props: {
12057
+ part: {},
12058
+ placeholder: { type: Boolean }
12059
+ },
12060
+ setup(__props) {
12061
+ const pageBuilder = usePageBuilderEditor();
12062
+ const addWidget = () => {
12063
+ pageBuilder.commandRegistry.executeCommand(OpenAddWidgetModalCommand.COMMAND_ID);
12064
+ };
12065
+ return (_ctx, _cache) => {
12066
+ var _a;
12067
+ return openBlock(), createElementBlock(Fragment, null, [
12068
+ _ctx.part.children ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_ctx.part.children, (child) => {
12069
+ return openBlock(), createBlock$1(_sfc_main$o, {
12070
+ key: child.partId,
12071
+ part: child
12072
+ }, null, 8, ["part"]);
12073
+ }), 128)) : createCommentVNode("", true),
12074
+ !_ctx.part.children || ((_a = _ctx.part.children) == null ? void 0 : _a.length) === 0 ? (openBlock(), createBlock$1(PbAddWidgetButton, {
12075
+ key: 1,
12076
+ onAddWidget: addWidget
12077
+ })) : createCommentVNode("", true)
12078
+ ], 64);
12079
+ };
12080
+ }
12081
+ });
12110
12082
  const pageParts = [
12111
12083
  {
12112
12084
  partType: "Page",
12113
12085
  partName: "Page",
12114
12086
  caption: "Page",
12115
12087
  icon: "draft",
12088
+ className: "pb-page",
12116
12089
  propertyGroups: [
12090
+ alignGroup(),
12117
12091
  paddingGroup(),
12118
12092
  backgroundGroup(),
12119
12093
  commonGroup()
12120
12094
  ],
12121
- initialProperties: {},
12122
- localized: false,
12095
+ initialProperties: {
12096
+ align: "center"
12097
+ },
12123
12098
  allowsChild: () => true,
12124
12099
  creator: () => _sfc_main$l
12125
12100
  }
@@ -12130,13 +12105,14 @@ const sectionParts = [
12130
12105
  partName: "Section",
12131
12106
  caption: "Section",
12132
12107
  icon: "rectangle",
12108
+ className: "pb-section",
12133
12109
  propertyGroups: [
12134
12110
  ...defaultPropertyGroups()
12135
12111
  ],
12136
12112
  initialProperties: {
12137
- direction: "horizontal"
12113
+ direction: "horizontal",
12114
+ align: "center"
12138
12115
  },
12139
- localized: false,
12140
12116
  allowsChild: () => true,
12141
12117
  creator: () => _sfc_main$l
12142
12118
  }
@@ -12147,11 +12123,13 @@ const blockParts = [
12147
12123
  partName: "Block",
12148
12124
  caption: "Block",
12149
12125
  icon: "space_dashboard",
12126
+ className: "pb-block",
12150
12127
  propertyGroups: [
12151
12128
  ...defaultPropertyGroups()
12152
12129
  ],
12153
- initialProperties: {},
12154
- localized: false,
12130
+ initialProperties: {
12131
+ align: "center"
12132
+ },
12155
12133
  allowsChild: () => true,
12156
12134
  creator: () => _sfc_main$n
12157
12135
  }
@@ -12162,6 +12140,7 @@ const widgets = [
12162
12140
  partName: "TextWidget",
12163
12141
  caption: "Text",
12164
12142
  icon: "insert_text",
12143
+ className: "pb-text-widget",
12165
12144
  propertyGroups: [
12166
12145
  {
12167
12146
  groupName: "text",
@@ -12172,7 +12151,6 @@ const widgets = [
12172
12151
  caption: "Text",
12173
12152
  propertyType: "multiline-text",
12174
12153
  params: "",
12175
- localized: true,
12176
12154
  multiLang: true
12177
12155
  },
12178
12156
  {
@@ -12187,17 +12165,17 @@ const widgets = [
12187
12165
  propertyType: "text",
12188
12166
  params: ""
12189
12167
  },
12168
+ {
12169
+ propertyName: "textAlign",
12170
+ caption: "Text Align",
12171
+ propertyType: "select",
12172
+ params: "left,center,right"
12173
+ },
12190
12174
  {
12191
12175
  propertyName: "color",
12192
12176
  caption: "Font Color",
12193
12177
  propertyType: "color",
12194
12178
  params: ""
12195
- },
12196
- {
12197
- propertyName: "textAlign",
12198
- caption: "Align",
12199
- propertyType: "select",
12200
- params: "left,center,right"
12201
12179
  }
12202
12180
  ]
12203
12181
  },
@@ -12205,18 +12183,22 @@ const widgets = [
12205
12183
  ],
12206
12184
  initialProperties: {
12207
12185
  fontSize: "20px",
12186
+ textAlign: "center",
12208
12187
  paddingTop: "12px",
12209
- paddingBottom: "12px"
12188
+ paddingBottom: "12px",
12189
+ paddingLeft: "12px",
12190
+ paddingRight: "12px",
12191
+ align: "center"
12210
12192
  },
12211
- localized: true,
12212
12193
  allowsChild: () => false,
12213
- creator: () => _sfc_main$5$1
12194
+ creator: () => _sfc_main$7$1
12214
12195
  },
12215
12196
  {
12216
12197
  partType: "Widget",
12217
12198
  partName: "ImageWidget",
12218
12199
  caption: "Image",
12219
12200
  icon: "imagesmode",
12201
+ className: "pb-image-widget",
12220
12202
  propertyGroups: [
12221
12203
  {
12222
12204
  groupName: "image",
@@ -12226,23 +12208,22 @@ const widgets = [
12226
12208
  propertyName: "image",
12227
12209
  caption: "Image",
12228
12210
  propertyType: "image",
12229
- params: "",
12230
- localized: true
12211
+ params: ""
12231
12212
  }
12232
12213
  ]
12233
12214
  },
12234
12215
  ...defaultWidgetPropertyGroups()
12235
12216
  ],
12236
12217
  initialProperties: {},
12237
- localized: true,
12238
12218
  allowsChild: () => false,
12239
- creator: () => _sfc_main$6$1
12219
+ creator: () => _sfc_main$8$1
12240
12220
  },
12241
12221
  {
12242
12222
  partType: "Widget",
12243
12223
  partName: "HtmlWidget",
12244
12224
  caption: "HTML",
12245
12225
  icon: "code",
12226
+ className: "pb-html-widget",
12246
12227
  propertyGroups: [
12247
12228
  {
12248
12229
  groupName: "html",
@@ -12253,7 +12234,6 @@ const widgets = [
12253
12234
  caption: "HTML",
12254
12235
  propertyType: "html",
12255
12236
  params: "",
12256
- localized: true,
12257
12237
  multiLang: true
12258
12238
  }
12259
12239
  ]
@@ -12261,15 +12241,15 @@ const widgets = [
12261
12241
  ...defaultWidgetPropertyGroups()
12262
12242
  ],
12263
12243
  initialProperties: {},
12264
- localized: true,
12265
12244
  allowsChild: () => false,
12266
- creator: () => _sfc_main$4$1
12245
+ creator: () => _sfc_main$6$1
12267
12246
  },
12268
12247
  {
12269
12248
  partType: "Widget",
12270
12249
  partName: "IframeWidget",
12271
12250
  caption: "IFrame",
12272
12251
  icon: "code",
12252
+ className: "pb-iframe-widget",
12273
12253
  propertyGroups: [
12274
12254
  {
12275
12255
  groupName: "iframe",
@@ -12280,7 +12260,6 @@ const widgets = [
12280
12260
  caption: "URL",
12281
12261
  propertyType: "text",
12282
12262
  params: "",
12283
- localized: true,
12284
12263
  multiLang: true
12285
12264
  }
12286
12265
  ]
@@ -12288,9 +12267,53 @@ const widgets = [
12288
12267
  ...defaultWidgetPropertyGroups()
12289
12268
  ],
12290
12269
  initialProperties: {},
12291
- localized: true,
12292
12270
  allowsChild: () => false,
12293
- creator: () => _sfc_main$3$1
12271
+ creator: () => _sfc_main$5$1
12272
+ },
12273
+ {
12274
+ partType: "Widget",
12275
+ partName: "YoutubeWidget",
12276
+ caption: "Youtube",
12277
+ icon: "live_tv",
12278
+ className: "pb-youtube-widget",
12279
+ propertyGroups: [
12280
+ {
12281
+ groupName: "youtube",
12282
+ caption: "Youtube",
12283
+ properties: [
12284
+ {
12285
+ propertyName: "url",
12286
+ caption: "URL",
12287
+ propertyType: "youtube",
12288
+ params: ""
12289
+ }
12290
+ ]
12291
+ },
12292
+ ...defaultWidgetPropertyGroups()
12293
+ ],
12294
+ initialProperties: {},
12295
+ allowsChild: () => false,
12296
+ creator: () => _sfc_main$4$1
12297
+ },
12298
+ {
12299
+ partType: "Widget",
12300
+ partName: "ContainerWidget",
12301
+ caption: "Container",
12302
+ icon: "widgets",
12303
+ className: "pb-container-widget",
12304
+ propertyGroups: [
12305
+ {
12306
+ groupName: "container",
12307
+ caption: "Container",
12308
+ properties: []
12309
+ },
12310
+ ...defaultWidgetPropertyGroups()
12311
+ ],
12312
+ initialProperties: {
12313
+ height: "200px"
12314
+ },
12315
+ allowsChild: () => true,
12316
+ creator: () => _sfc_main$d
12294
12317
  }
12295
12318
  ];
12296
12319
  const partDefinitions = {};
@@ -12377,7 +12400,7 @@ __publicField(_OpenAddWidgetModalCommand, "COMMAND_ID", "OpenAddWidgetModal");
12377
12400
  let OpenAddWidgetModalCommand = _OpenAddWidgetModalCommand;
12378
12401
  const openWidgetAddModal = (modal, args, callback) => {
12379
12402
  modal.openModal({
12380
- component: defineAsyncComponent(() => import("./PbWidgetAddModal-haOQfRIi.js")),
12403
+ component: defineAsyncComponent(() => import("./PbWidgetAddModal-DO1t-xsl.js")),
12381
12404
  style: {
12382
12405
  width: "80%",
12383
12406
  height: "80%",
@@ -12395,6 +12418,10 @@ const openWidgetAddModal = (modal, args, callback) => {
12395
12418
  addPart(args.pageBuilder, part, { image: url });
12396
12419
  });
12397
12420
  }
12421
+ } else if (["YoutubeWidget"].includes(part.partName)) {
12422
+ selectYoutubeVideo(modal, "", (url) => {
12423
+ addPart(args.pageBuilder, part, { url });
12424
+ });
12398
12425
  } else {
12399
12426
  if (callback) {
12400
12427
  callback(part);
@@ -12407,20 +12434,11 @@ const openWidgetAddModal = (modal, args, callback) => {
12407
12434
  });
12408
12435
  };
12409
12436
  const findInsertTargetAndIndex = (pageBuilder, partType) => {
12410
- var _a, _b;
12437
+ var _a;
12411
12438
  const selected = pageBuilder.context.getSelectedParts()[0];
12412
- const page = pageBuilder.context.getSelectedPage();
12413
- if (partType === SECTION_TYPE) {
12414
- const section = pageBuilder.partManager.findNearestSection(selected);
12415
- return {
12416
- target: page,
12417
- index: section ? page.children.indexOf(section) + 1 : (_a = page.children) == null ? void 0 : _a.length
12418
- };
12419
- } else if (partType === WIDGET_TYPE) {
12420
- pageBuilder.partManager.findNearestBlock(selected);
12421
- }
12439
+ pageBuilder.context.getSelectedPage();
12422
12440
  const target = pageBuilder.partManager.findNearestAvailableParentPart(selected, partType);
12423
- const index = selected === target || !(target == null ? void 0 : target.children) ? ((_b = target == null ? void 0 : target.children) == null ? void 0 : _b.length) || 0 : target.children.indexOf(selected) + 1;
12441
+ const index = selected === target || !(target == null ? void 0 : target.children) ? ((_a = target == null ? void 0 : target.children) == null ? void 0 : _a.length) || 0 : target.children.indexOf(selected) + 1;
12424
12442
  return { target, index };
12425
12443
  };
12426
12444
  const createPartWithDefinition = (def, properties) => {
@@ -12435,14 +12453,12 @@ const createPartWithDefinition = (def, properties) => {
12435
12453
  };
12436
12454
  const createSection = (pageBuilder) => {
12437
12455
  const def = pageBuilder.partManager.getSectionDefinition();
12438
- if (!def)
12439
- return;
12456
+ if (!def) return;
12440
12457
  return createPartWithDefinition(def);
12441
12458
  };
12442
12459
  const createBlock = (pageBuilder) => {
12443
12460
  const def = pageBuilder.partManager.getBlockDefinition();
12444
- if (!def)
12445
- return;
12461
+ if (!def) return;
12446
12462
  return createPartWithDefinition(def);
12447
12463
  };
12448
12464
  const findLeafPart = (part) => {
@@ -12465,8 +12481,7 @@ const insertParts = (pageBuilder, partId, index, parts, selectAfterInsert) => {
12465
12481
  if (selectAfterInsert && result.inserted) {
12466
12482
  const partId2 = result.inserted[0].partId;
12467
12483
  const part = pageBuilder.model.findPartById(partId2);
12468
- if (part)
12469
- pageBuilder.context.setSelection([part]);
12484
+ if (part) pageBuilder.context.setSelection([part]);
12470
12485
  }
12471
12486
  };
12472
12487
  const _AddPartCommand = class _AddPartCommand {
@@ -12489,8 +12504,7 @@ const _AddSectionCommand = class _AddSectionCommand {
12489
12504
  }
12490
12505
  execute(pageBuilder, args) {
12491
12506
  const def = pageBuilder.partManager.getSectionDefinition();
12492
- if (!def)
12493
- return;
12507
+ if (!def) return;
12494
12508
  addPart(pageBuilder, def);
12495
12509
  }
12496
12510
  };
@@ -12504,8 +12518,7 @@ const _AddBlockCommand = class _AddBlockCommand {
12504
12518
  }
12505
12519
  execute(pageBuilder, args) {
12506
12520
  const def = pageBuilder.partManager.getBlockDefinition();
12507
- if (!def)
12508
- return;
12521
+ if (!def) return;
12509
12522
  addPart(pageBuilder, def);
12510
12523
  }
12511
12524
  };
@@ -12520,8 +12533,7 @@ const addPart = (pageBuilder, def, attrs) => {
12520
12533
  const target = page;
12521
12534
  const index = section ? page.children.indexOf(section) + 1 : ((_a = page.children) == null ? void 0 : _a.length) || 0;
12522
12535
  const newSection = createPartWithDefinition(def);
12523
- if (!newSection)
12524
- return;
12536
+ if (!newSection) return;
12525
12537
  if (((_b = def.initialProperties) == null ? void 0 : _b.sectionType) !== "static") {
12526
12538
  const block = createBlock(pageBuilder);
12527
12539
  newSection.children = [block];
@@ -12531,42 +12543,36 @@ const addPart = (pageBuilder, def, attrs) => {
12531
12543
  if (!selected) {
12532
12544
  const newSection = createSection(pageBuilder);
12533
12545
  const newBlock = createPartWithDefinition(def);
12534
- if (!newSection || !newBlock)
12535
- return;
12546
+ if (!newSection || !newBlock) return;
12536
12547
  newSection.children = [newBlock];
12537
12548
  insertParts(pageBuilder, page.partId, ((_c = page.children) == null ? void 0 : _c.length) || 0, [newSection], true);
12538
12549
  } else if (selected.isSection()) {
12539
12550
  const target = selected;
12540
12551
  const index = ((_d = target == null ? void 0 : target.children) == null ? void 0 : _d.length) || 0;
12541
12552
  const newBlock = createPartWithDefinition(def);
12542
- if (!newBlock)
12543
- return;
12553
+ if (!newBlock) return;
12544
12554
  insertParts(pageBuilder, target.partId, index, [newBlock], true);
12545
12555
  } else {
12546
12556
  const block = pageBuilder.partManager.findNearestBlock(selected);
12547
12557
  const target = block == null ? void 0 : block.parent;
12548
12558
  const index = target.children.indexOf(block) + 1;
12549
12559
  const newBlock = createPartWithDefinition(def);
12550
- if (!newBlock)
12551
- return;
12560
+ if (!newBlock) return;
12552
12561
  insertParts(pageBuilder, target.partId, index, [newBlock], true);
12553
12562
  }
12554
12563
  } else {
12555
12564
  const newWidget = createPartWithDefinition(def, attrs);
12556
- if (!newWidget)
12557
- return;
12565
+ if (!newWidget) return;
12558
12566
  if (!selected) {
12559
12567
  const newSection = createSection(pageBuilder);
12560
12568
  const newBlock = createBlock(pageBuilder);
12561
- if (!newSection || !newBlock)
12562
- return;
12569
+ if (!newSection || !newBlock) return;
12563
12570
  newSection.children = [newBlock];
12564
12571
  newBlock.children = [newWidget];
12565
12572
  insertParts(pageBuilder, page.partId, ((_e = page.children) == null ? void 0 : _e.length) || 0, [newSection], true);
12566
12573
  } else if (selected.isSection()) {
12567
12574
  const newBlock = createBlock(pageBuilder);
12568
- if (!newBlock)
12569
- return;
12575
+ if (!newBlock) return;
12570
12576
  newBlock.children = [newWidget];
12571
12577
  insertParts(pageBuilder, selected.partId, ((_f = selected.children) == null ? void 0 : _f.length) || 0, [newBlock], true);
12572
12578
  } else if (selected.isBlock()) {
@@ -12578,12 +12584,11 @@ const addPart = (pageBuilder, def, attrs) => {
12578
12584
  if (def2 && def2.allowsChild && def2.allowsChild(def2.partName)) {
12579
12585
  const target = selected;
12580
12586
  const index = ((_i = target.children) == null ? void 0 : _i.length) || 0;
12581
- if (def2.partName === "ImageWidget") {
12582
- if (!newWidget.properties)
12583
- newWidget.properties = {};
12587
+ if (def2.partName === "ContainerWidget") {
12588
+ if (!newWidget.properties) newWidget.properties = {};
12584
12589
  newWidget.properties.left = "25%";
12585
12590
  newWidget.properties.top = "25%";
12586
- newWidget.properties.width = "50%";
12591
+ newWidget.properties.width = "40%";
12587
12592
  }
12588
12593
  insertParts(pageBuilder, target.partId, index, [newWidget], true);
12589
12594
  } else {
@@ -12600,14 +12605,11 @@ const addPart = (pageBuilder, def, attrs) => {
12600
12605
  };
12601
12606
  const addSectionBefore = (pageBuilder, modal, args) => {
12602
12607
  const selected = pageBuilder.context.getSelectedParts()[0];
12603
- if (!selected)
12604
- return;
12608
+ if (!selected) return;
12605
12609
  const section = pageBuilder.partManager.findNearestSection(selected);
12606
- if (!section || !section.parent || !section.parent.children)
12607
- return;
12610
+ if (!section || !section.parent || !section.parent.children) return;
12608
12611
  const newSection = createSection(pageBuilder);
12609
- if (!newSection)
12610
- return;
12612
+ if (!newSection) return;
12611
12613
  const child = createBlock(pageBuilder);
12612
12614
  newSection.children = [child];
12613
12615
  const index = section.parent.children.indexOf(section);
@@ -12615,14 +12617,11 @@ const addSectionBefore = (pageBuilder, modal, args) => {
12615
12617
  };
12616
12618
  const addSectionAfter = (pageBuilder, modal, args) => {
12617
12619
  const selected = pageBuilder.context.getSelectedParts()[0];
12618
- if (!selected)
12619
- return;
12620
+ if (!selected) return;
12620
12621
  const section = pageBuilder.partManager.findNearestSection(selected);
12621
- if (!section || !section.parent || !section.parent.children)
12622
- return;
12622
+ if (!section || !section.parent || !section.parent.children) return;
12623
12623
  const newSection = createSection(pageBuilder);
12624
- if (!newSection)
12625
- return;
12624
+ if (!newSection) return;
12626
12625
  const child = createBlock(pageBuilder);
12627
12626
  newSection.children = [child];
12628
12627
  const index = section.parent.children.indexOf(section) + 1;
@@ -12630,22 +12629,18 @@ const addSectionAfter = (pageBuilder, modal, args) => {
12630
12629
  };
12631
12630
  const addBlockBefore = (pageBuilder) => {
12632
12631
  const selected = pageBuilder.context.getSelectedParts()[0];
12633
- if (!selected)
12634
- return;
12632
+ if (!selected) return;
12635
12633
  const block = pageBuilder.partManager.findNearestBlock(selected);
12636
- if (!block || !block.parent || !block.parent.children)
12637
- return;
12634
+ if (!block || !block.parent || !block.parent.children) return;
12638
12635
  const newBlock = createBlock(pageBuilder);
12639
12636
  const index = block.parent.children.indexOf(block);
12640
12637
  insertParts(pageBuilder, block.parent.partId, index, [newBlock], true);
12641
12638
  };
12642
12639
  const addBlockAfter = (pageBuilder) => {
12643
12640
  const selected = pageBuilder.context.getSelectedParts()[0];
12644
- if (!selected)
12645
- return;
12641
+ if (!selected) return;
12646
12642
  const block = pageBuilder.partManager.findNearestBlock(selected);
12647
- if (!block || !block.parent || !block.parent.children)
12648
- return;
12643
+ if (!block || !block.parent || !block.parent.children) return;
12649
12644
  const newBlock = createBlock(pageBuilder);
12650
12645
  const index = block.parent.children.indexOf(block) + 1;
12651
12646
  insertParts(pageBuilder, block.parent.partId, index, [newBlock], true);
@@ -12668,11 +12663,9 @@ const addWidgetBefore = (command, pageBuilder, modal, args) => {
12668
12663
  return;
12669
12664
  }
12670
12665
  const widget = pageBuilder.context.getSingleSelectedWidget();
12671
- if (!widget || !widget.parent || !widget.parent.children)
12672
- return;
12666
+ if (!widget || !widget.parent || !widget.parent.children) return;
12673
12667
  const newWidget = createPartWithDefinition(def, { image: args.image });
12674
- if (!newWidget)
12675
- return;
12668
+ if (!newWidget) return;
12676
12669
  const index = widget.parent.children.indexOf(widget);
12677
12670
  insertParts(pageBuilder, widget.parent.partId, index, [newWidget], true);
12678
12671
  };
@@ -12694,11 +12687,9 @@ const addWidgetAfter = (command, pageBuilder, modal, args) => {
12694
12687
  return;
12695
12688
  }
12696
12689
  const widget = pageBuilder.context.getSingleSelectedWidget();
12697
- if (!widget || !widget.parent || !widget.parent.children)
12698
- return;
12690
+ if (!widget || !widget.parent || !widget.parent.children) return;
12699
12691
  const newWidget = createPartWithDefinition(def, { image: args.image });
12700
- if (!newWidget)
12701
- return;
12692
+ if (!newWidget) return;
12702
12693
  const index = widget.parent.children.indexOf(widget) + 1;
12703
12694
  insertParts(pageBuilder, widget.parent.partId, index, [newWidget], true);
12704
12695
  };
@@ -12721,14 +12712,11 @@ const addWidgetInside = (command, pageBuilder, modal, args) => {
12721
12712
  return;
12722
12713
  }
12723
12714
  let selected = pageBuilder.context.getSingleSelectedWidget() || pageBuilder.context.getSingleSelectedBlock();
12724
- if (!selected)
12725
- return;
12715
+ if (!selected) return;
12726
12716
  const newWidget = createPartWithDefinition(def, { image: args.image });
12727
- if (!newWidget)
12728
- return;
12717
+ if (!newWidget) return;
12729
12718
  if (selected.isWidget() && def.partName === "ImageWidget") {
12730
- if (!newWidget.properties)
12731
- newWidget.properties = {};
12719
+ if (!newWidget.properties) newWidget.properties = {};
12732
12720
  newWidget.properties.left = "25%";
12733
12721
  newWidget.properties.top = "25%";
12734
12722
  newWidget.properties.width = "50%";
@@ -12957,8 +12945,7 @@ const _PastePartCommand = class _PastePartCommand {
12957
12945
  const object = JSON.parse(json);
12958
12946
  if (object.partType === ROOT_TYPE) {
12959
12947
  const rootPart = partFromJsonObject(object, true);
12960
- if (!rootPart)
12961
- throw new Error("Invalid data format");
12948
+ if (!rootPart) throw new Error("Invalid data format");
12962
12949
  let partIdsToDelete = void 0;
12963
12950
  if (pageBuilder.model.rootPart.children && pageBuilder.model.rootPart.children.length) {
12964
12951
  partIdsToDelete = pageBuilder.model.rootPart.children.map((v) => v.partId);
@@ -12993,8 +12980,7 @@ const _SelectAllPartsCommand = class _SelectAllPartsCommand {
12993
12980
  }
12994
12981
  execute(pageBuilder) {
12995
12982
  const page = pageBuilder.context.getSelectedPage();
12996
- if (page)
12997
- pageBuilder.context.setSelection([page]);
12983
+ if (page) pageBuilder.context.setSelection([page]);
12998
12984
  }
12999
12985
  };
13000
12986
  __publicField(_SelectAllPartsCommand, "COMMAND_ID", "SelectAllParts");
@@ -13326,15 +13312,12 @@ class ToolButtonRegistryImpl {
13326
13312
  }
13327
13313
  registerToolButtonGroup(group) {
13328
13314
  const found = this.groups.find((g) => g.groupId === group.groupId);
13329
- if (found)
13330
- group.buttons.forEach((btn) => found.buttons.push(btn));
13331
- else
13332
- this.groups.push(group);
13315
+ if (found) group.buttons.forEach((btn) => found.buttons.push(btn));
13316
+ else this.groups.push(group);
13333
13317
  }
13334
13318
  registerToolButtons(groupId, buttons) {
13335
13319
  const group = this.groups.find((g) => g.groupId === groupId);
13336
- if (group)
13337
- buttons.forEach((btn) => group.buttons.push(btn));
13320
+ if (group) buttons.forEach((btn) => group.buttons.push(btn));
13338
13321
  }
13339
13322
  getToolButtonGroups() {
13340
13323
  return this.groups;
@@ -13348,8 +13331,7 @@ class PageBuilderContextImpl {
13348
13331
  PageBuilderEditorEvent.on.modelUpdated((changes) => {
13349
13332
  var _a;
13350
13333
  const partIds = (_a = changes.deleted) == null ? void 0 : _a.map((result) => result.partId);
13351
- if (partIds)
13352
- this.removeSelection(partIds);
13334
+ if (partIds) this.removeSelection(partIds);
13353
13335
  });
13354
13336
  }
13355
13337
  setSelection(parts) {
@@ -13371,8 +13353,7 @@ class PageBuilderContextImpl {
13371
13353
  } else {
13372
13354
  index = this.selection.findIndex((sel) => sel === part);
13373
13355
  }
13374
- if (index >= 0)
13375
- this.selection.splice(index, 1);
13356
+ if (index >= 0) this.selection.splice(index, 1);
13376
13357
  });
13377
13358
  }
13378
13359
  isSelected(part) {
@@ -13390,11 +13371,9 @@ class PageBuilderContextImpl {
13390
13371
  getSelectedPage() {
13391
13372
  const pages = this.model.rootPart.children;
13392
13373
  let part = this.selection[0];
13393
- if (!part)
13394
- return pages && pages[0];
13374
+ if (!part) return pages && pages[0];
13395
13375
  while (part.parent) {
13396
- if (part.parent.isPage())
13397
- return part.parent;
13376
+ if (part.parent.isPage()) return part.parent;
13398
13377
  part = part.parent;
13399
13378
  }
13400
13379
  }
@@ -13471,8 +13450,7 @@ class KeyHandlersImpl {
13471
13450
  }
13472
13451
  removeKeyHandler(handler) {
13473
13452
  const index = this.handlers.indexOf(handler);
13474
- if (index >= 0)
13475
- this.handlers.splice(index, 1);
13453
+ if (index >= 0) this.handlers.splice(index, 1);
13476
13454
  }
13477
13455
  handleKeyDownEvent(event) {
13478
13456
  for (const handler of this.handlers) {
@@ -13499,8 +13477,7 @@ const providePageBuilderEditor = (pageBuilderEditor) => {
13499
13477
  };
13500
13478
  const usePageBuilderEditor = () => {
13501
13479
  const pageBuilderEditor = inject(PAGE_BUILDER_EDITOR_KEY);
13502
- if (!pageBuilderEditor)
13503
- throw Error("PageBuilderEditor not found");
13480
+ if (!pageBuilderEditor) throw Error("PageBuilderEditor not found");
13504
13481
  return pageBuilderEditor;
13505
13482
  };
13506
13483
  class PageBuilderEditorImpl {
@@ -13550,37 +13527,26 @@ class PageBuilderEditorImpl {
13550
13527
  }
13551
13528
  watchCustomWidgetData(part) {
13552
13529
  const def = this.partManager.getPartDefinition(part.partName);
13553
- if (!def || !def.dataWatcher)
13554
- return false;
13530
+ if (!def || !def.dataWatcher) return false;
13555
13531
  const watcher = this.watchers[def.dataWatcher];
13556
- if (!watcher)
13557
- return false;
13532
+ if (!watcher) return false;
13558
13533
  return watcher(part.properties);
13559
13534
  }
13560
13535
  provideCustomWidgetData(part) {
13561
13536
  const def = this.partManager.getPartDefinition(part.partName);
13562
- if (!def || !def.dataProvider)
13563
- return Promise.resolve();
13537
+ if (!def || !def.dataProvider) return Promise.resolve();
13564
13538
  const provider = this.providers[def.dataProvider];
13565
- if (!provider)
13566
- return Promise.resolve();
13539
+ if (!provider) return Promise.resolve();
13567
13540
  return provider(part.properties);
13568
13541
  }
13569
13542
  registerPlugin(plugin) {
13570
- if (plugin.partDefinitions)
13571
- this.partManager.registerPartDefinitions(plugin.partDefinitions);
13572
- if (plugin.partPropertyGroupEditors)
13573
- this.partManager.registerPartPropertyGroupEditors(plugin.partPropertyGroupEditors);
13574
- if (plugin.partPropertyEditors)
13575
- this.partManager.registerPartPropertyEditors(plugin.partPropertyEditors);
13576
- if (plugin.commands)
13577
- this.commandRegistry.registerCommands(plugin.commands);
13578
- if (plugin.contextMenus)
13579
- this.contextMenuRegistry.registerContextMenus(plugin.contextMenus);
13580
- if (plugin.keyHandlers)
13581
- this.keyHandlers.appendKeyHandlers(plugin.keyHandlers);
13582
- if (plugin.toolButtonGroups)
13583
- this.toolButtonRegistry.registerToolButtonGroups(plugin.toolButtonGroups);
13543
+ if (plugin.partDefinitions) this.partManager.registerPartDefinitions(plugin.partDefinitions);
13544
+ if (plugin.partPropertyGroupEditors) this.partManager.registerPartPropertyGroupEditors(plugin.partPropertyGroupEditors);
13545
+ if (plugin.partPropertyEditors) this.partManager.registerPartPropertyEditors(plugin.partPropertyEditors);
13546
+ if (plugin.commands) this.commandRegistry.registerCommands(plugin.commands);
13547
+ if (plugin.contextMenus) this.contextMenuRegistry.registerContextMenus(plugin.contextMenus);
13548
+ if (plugin.keyHandlers) this.keyHandlers.appendKeyHandlers(plugin.keyHandlers);
13549
+ if (plugin.toolButtonGroups) this.toolButtonRegistry.registerToolButtonGroups(plugin.toolButtonGroups);
13584
13550
  }
13585
13551
  registerCustomPlugin(plugin) {
13586
13552
  if (plugin.widgets) {
@@ -13619,11 +13585,9 @@ class PageBuilderEditorImpl {
13619
13585
  initData(data) {
13620
13586
  const _data = JSON.parse(data || "{}") || {};
13621
13587
  let rootPart = partFromJsonObject(_data, true);
13622
- if (!rootPart)
13623
- rootPart = new RootPart();
13588
+ if (!rootPart) rootPart = new RootPart();
13624
13589
  let parts = rootPart.children;
13625
- if (!parts)
13626
- parts = [this.getEmptyPageContent(), this.getEmptyPageContent()];
13590
+ if (!parts) parts = [this.getEmptyPageContent(), this.getEmptyPageContent()];
13627
13591
  if (parts.length === 1) {
13628
13592
  parts[0].properties = {
13629
13593
  ...parts[0].properties || {},
@@ -13666,11 +13630,9 @@ class PageBuilderEditorImpl {
13666
13630
  }
13667
13631
  makeSingleScreen(screenToKeep) {
13668
13632
  var _a;
13669
- if (!this.model.rootPart.children)
13670
- return;
13633
+ if (!this.model.rootPart.children) return;
13671
13634
  const screenCount = ((_a = this.model.rootPart.children) == null ? void 0 : _a.length) || 0;
13672
- if (screenCount !== 2)
13673
- return;
13635
+ if (screenCount !== 2) return;
13674
13636
  const remaining = this.model.rootPart.children[screenToKeep === 0 ? 0 : 1];
13675
13637
  const deleting = this.model.rootPart.children[screenToKeep === 0 ? 1 : 0];
13676
13638
  this.model.updateModel({
@@ -13687,16 +13649,13 @@ class PageBuilderEditorImpl {
13687
13649
  }
13688
13650
  makeMultipleScreen() {
13689
13651
  var _a;
13690
- if (!this.model.rootPart.children)
13691
- return;
13652
+ if (!this.model.rootPart.children) return;
13692
13653
  const screenCount = ((_a = this.model.rootPart.children) == null ? void 0 : _a.length) || 0;
13693
- if (screenCount !== 1)
13694
- return;
13654
+ if (screenCount !== 1) return;
13695
13655
  const part = this.model.rootPart.children[0];
13696
13656
  const json = this.model.serializeParts([part.partId]);
13697
13657
  const copied = this.model.parseParts(json);
13698
- if (!copied)
13699
- return;
13658
+ if (!copied) return;
13700
13659
  copied[0].properties = {
13701
13660
  ...copied[0].properties || {},
13702
13661
  name: "Page (PC)"
@@ -13759,10 +13718,8 @@ class PageBuilderEditorImpl {
13759
13718
  if (part.partName === "HtmlWidget" && part.properties.html) {
13760
13719
  for (const locale in part.properties.html) {
13761
13720
  const html = part.properties.html[locale];
13762
- if (html.tags)
13763
- this.extractMediaFromHtml(html.tags, urls);
13764
- if (html.style)
13765
- this.extractMediaFromHtml(html.style, urls);
13721
+ if (html.tags) this.extractMediaFromHtml(html.tags, urls);
13722
+ if (html.style) this.extractMediaFromHtml(html.style, urls);
13766
13723
  }
13767
13724
  }
13768
13725
  }
@@ -13840,251 +13797,8 @@ class PageBuilderEditorImpl {
13840
13797
  });
13841
13798
  }
13842
13799
  }
13843
- const _hoisted_1$c = ["data-part-id"];
13844
- const _hoisted_2$3 = /* @__PURE__ */ createElementVNode("i", { class: "material-icons-outlined" }, "add_circle_outline", -1);
13845
- const _hoisted_3$2 = [
13846
- _hoisted_2$3
13847
- ];
13848
- const _sfc_main$d = /* @__PURE__ */ defineComponent({
13849
- __name: "PbPage",
13850
- props: {
13851
- part: {},
13852
- width: {},
13853
- isMobilePage: { type: Boolean }
13854
- },
13855
- setup(__props) {
13856
- const props = __props;
13857
- const editor = usePageBuilderEditor();
13858
- const styleTag = computed(() => props.part.getStyleTag());
13859
- const style = computed(() => {
13860
- var _a, _b;
13861
- return {
13862
- width: `${props.width || 420}px`,
13863
- minHeight: ((_b = (_a = props.part) == null ? void 0 : _a.children) == null ? void 0 : _b.length) ? void 0 : "200px"
13864
- };
13865
- });
13866
- const properties = computed(() => {
13867
- var _a, _b;
13868
- return {
13869
- style: {
13870
- ...(_a = props.part) == null ? void 0 : _a.getStyles(),
13871
- ...(_b = props.part) == null ? void 0 : _b.getInlineStyles()
13872
- }
13873
- };
13874
- });
13875
- const selected = computed(() => !!props.part && editor.context.isSelected(props.part));
13876
- const insertSection = (index) => {
13877
- editor.commandRegistry.executeCommand(AddSectionCommand.COMMAND_ID);
13878
- };
13879
- return (_ctx, _cache) => {
13880
- var _a, _b;
13881
- return openBlock(), createElementBlock(Fragment, null, [
13882
- styleTag.value ? (openBlock(), createBlock$1(resolveDynamicComponent("style"), {
13883
- key: 0,
13884
- innerHTML: styleTag.value
13885
- }, null, 8, ["innerHTML"])) : createCommentVNode("", true),
13886
- createElementVNode("div", {
13887
- "data-part-id": (_a = _ctx.part) == null ? void 0 : _a.partId,
13888
- style: normalizeStyle(style.value),
13889
- class: "pb-page"
13890
- }, [
13891
- createElementVNode("div", mergeProps({
13892
- class: [selected.value && "selected", _ctx.isMobilePage ? "mobile" : "pc", "pb-page-content"]
13893
- }, properties.value), [
13894
- (openBlock(true), createElementBlock(Fragment, null, renderList((_b = _ctx.part) == null ? void 0 : _b.children, (section, index) => {
13895
- return openBlock(), createBlock$1(_sfc_main$l, {
13896
- key: section.partId,
13897
- part: section
13898
- }, null, 8, ["part"]);
13899
- }), 128))
13900
- ], 16),
13901
- createElementVNode("div", {
13902
- class: "pb-add-section-handle bottom",
13903
- onClick: _cache[0] || (_cache[0] = ($event) => {
13904
- var _a2, _b2;
13905
- return insertSection(((_b2 = (_a2 = _ctx.part) == null ? void 0 : _a2.children) == null ? void 0 : _b2.length) || 0);
13906
- })
13907
- }, _hoisted_3$2)
13908
- ], 12, _hoisted_1$c)
13909
- ], 64);
13910
- };
13911
- }
13912
- });
13913
- const _hoisted_1$b = { class: "pb-page-wrapper" };
13800
+ const _hoisted_1$b = { class: "pb-tool-button bs-layout-horizontal flex-align-center" };
13914
13801
  const _sfc_main$c = /* @__PURE__ */ defineComponent({
13915
- __name: "PbPageWrapper",
13916
- props: {
13917
- part: {},
13918
- width: {},
13919
- isMobilePage: { type: Boolean }
13920
- },
13921
- setup(__props) {
13922
- const props = __props;
13923
- const width = ref(props.width);
13924
- return (_ctx, _cache) => {
13925
- return openBlock(), createElementBlock("div", _hoisted_1$b, [
13926
- createVNode(unref(BSSelect), {
13927
- modelValue: width.value,
13928
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => width.value = $event),
13929
- items: [480, 768, 1024, 1280],
13930
- "label-provider": (v) => `${v}`,
13931
- "value-provider": (v) => v,
13932
- "view-model": false
13933
- }, null, 8, ["modelValue", "label-provider", "value-provider"]),
13934
- createVNode(_sfc_main$d, {
13935
- "is-mobile-page": _ctx.isMobilePage,
13936
- part: _ctx.part,
13937
- width: width.value
13938
- }, null, 8, ["is-mobile-page", "part", "width"])
13939
- ]);
13940
- };
13941
- }
13942
- });
13943
- const _hoisted_1$a = {
13944
- key: 1,
13945
- style: { "width": "20px" }
13946
- };
13947
- const _sfc_main$b = /* @__PURE__ */ defineComponent({
13948
- __name: "PbCanvas",
13949
- setup(__props) {
13950
- const pageBuilder = usePageBuilderEditor();
13951
- const partS = computed(() => {
13952
- var _a;
13953
- return (_a = pageBuilder.model.rootPart.children) == null ? void 0 : _a[0];
13954
- });
13955
- const partL = computed(() => {
13956
- var _a;
13957
- return (_a = pageBuilder.model.rootPart.children) == null ? void 0 : _a[1];
13958
- });
13959
- const handleClick = (event) => {
13960
- if (event.button === 0) {
13961
- pageBuilder.context.clearSelection();
13962
- }
13963
- };
13964
- const contextMenu = useContextMenu();
13965
- const style = computed(() => {
13966
- const scale = pageBuilder.scale.value;
13967
- return {
13968
- style: {
13969
- transform: `scale(${scale})`
13970
- }
13971
- };
13972
- });
13973
- const showContextMenu = (event) => {
13974
- var _a, _b;
13975
- if (event.altKey || event.ctrlKey || event.shiftKey)
13976
- return;
13977
- event.preventDefault();
13978
- const frame = ((_b = (_a = event.target) == null ? void 0 : _a.ownerDocument.defaultView) == null ? void 0 : _b.frameElement) || void 0;
13979
- const frameLeft = (frame == null ? void 0 : frame.offsetLeft) || 0;
13980
- const frameTop = (frame == null ? void 0 : frame.offsetTop) || 0;
13981
- const fakeEvent = {
13982
- clientX: event.clientX + frameLeft,
13983
- clientY: event.clientY + frameTop
13984
- };
13985
- const contextMenus = pageBuilder.contextMenuRegistry.composeContextMenuItems(pageBuilder);
13986
- contextMenu.showContextMenu(fakeEvent, contextMenus);
13987
- };
13988
- return (_ctx, _cache) => {
13989
- return openBlock(), createElementBlock("div", {
13990
- class: "pb-canvas-wrapper",
13991
- onContextmenu: showContextMenu,
13992
- onMousedown: withModifiers(handleClick, ["stop"])
13993
- }, [
13994
- createElementVNode("div", mergeProps({ class: "pb-canvas" }, style.value), [
13995
- partS.value ? (openBlock(), createBlock$1(_sfc_main$c, {
13996
- key: 0,
13997
- "is-mobile-page": true,
13998
- part: partS.value,
13999
- width: 480
14000
- }, null, 8, ["part"])) : createCommentVNode("", true),
14001
- partL.value ? (openBlock(), createElementBlock("div", _hoisted_1$a)) : createCommentVNode("", true),
14002
- partL.value ? (openBlock(), createBlock$1(_sfc_main$c, {
14003
- key: 2,
14004
- "is-mobile-page": false,
14005
- part: partL.value,
14006
- width: 1024
14007
- }, null, 8, ["part"])) : createCommentVNode("", true)
14008
- ], 16)
14009
- ], 32);
14010
- };
14011
- }
14012
- });
14013
- const canvasStyle = '.pb-page-wrapper {\n margin: 0 auto;\n padding: 0;\n}\n\n.pb-page {\n margin: 20px 0 auto 0;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n}\n\n.pb-page .pb-page-content.selected {\n outline: 2px solid #4998f8;\n outline-offset: 5px;\n}\n\n.pb-page * {\n box-sizing: border-box;\n}\n\n.pb-add-widget-button {\n width: 100%;\n height: 100%;\n min-height: 200px;\n position: relative;\n}\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\n.pb-add-widget-button button:hover {\n background-color: #eeeeee;\n}\n\n.pb-add-widget-button .icon {\n font-size: 1rem;\n vertical-align: middle;\n}\n\n.pb-add-widget-button .text {\n font-size: 1rem;\n vertical-align: middle;\n margin-left: 0.4rem;\n}\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\n.pb-section:hover:not(:has(.pb-block:hover)) {\n background-color: #f0f0f0;\n}\n\n.pb-section.selected {\n outline: 2px solid #4998f8;\n outline-offset: 1px;\n z-index: 999;\n}\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\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\n.pb-section-static .pb-widget {\n outline: none;\n}\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\n.pb-block:hover:not(:has(.pb-widget:hover)) {\n background-color: #f0f0f0;\n}\n\n.pb-block.selected {\n outline: 2px solid #4998f8;\n outline-offset: 1px;\n z-index: 999;\n}\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\n.pb-widget.selected {\n outline: 2px solid #4998f8;\n outline-offset: 1px;\n z-index: 999;\n}\n\n.pb-widget .children {\n position: absolute;\n width: 100%;\n height: 100%;\n}\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\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\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\n.pb-widget .children {\n position: absolute;\n width: 100%;\n height: 100%;\n}\n\n.pb-text-widget {\n width: 100%;\n height: fit-content;\n}\n\n.pb-text-widget .text {\n color: #333;\n}\n\n.pb-text-widget .placeholder {\n padding: 4px 0;\n font-size: 18px;\n text-align: center;\n color: #999;\n}\n\n.pb-image-widget {\n width: 100%;\n}\n\n.pb-image-widget .image {\n width: 100%;\n}\n\n.pb-image-widget .empty {\n height: 100px;\n background-color: #eee;\n text-align: center;\n}\n\n.pb-image-widget .empty span {\n font-size: 40px;\n color: #999;\n line-height: 100px;\n vertical-align: middle;\n}\n\n.pb-html-widget {\n width: 100%;\n height: fit-content;\n}\n\n.pb-html-widget .placeholder {\n padding: 4px 0;\n font-size: 18px;\n text-align: center;\n color: #999;\n}\n\n.pb-iframe-widget {\n width: 100%;\n height: fit-content;\n}\n\n.pb-iframe-widget .placeholder {\n padding: 4px 0;\n font-size: 18px;\n text-align: center;\n color: #999;\n}\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\n.pb-product-list-widget .product-wrapper {\n width: 25%;\n}\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\n.pb-product-list-widget .product-wrapper img {\n width: 100%;\n}\n\n.pb-product-list-widget .product-wrapper .name {\n margin-top: 8px;\n font-size: 14px;\n}\n\n.pb-product-list-widget .product-wrapper .price {\n margin-top: 8px;\n font-size: 14px;\n font-weight: bold;\n}\n\n.pb-product-list-widget .product-wrapper .empty {\n height: 200px;\n background-color: #eee;\n text-align: center;\n}\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\n@media (max-width: 768px) {\n .pb-product-list-widget .product-wrapper {\n width: 50%;\n }\n}\n\n.mobile .pb-product-list-widget .product-wrapper {\n width: 50%;\n}\n\n.pb-login-widget {\n height: 200px;\n text-align: center;\n}\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\n.font-icon {\n font-family: Material Symbols Outlined, monospace;\n font-size: 1rem;\n max-width: 1em;\n}\n\nhtml, body {\n font-family: Noto Sans, Noto Sans KR, Noto Sans JP, Arial, sans-serif;\n font-size: 12px;\n}\n\nbody {\n margin: 0;\n padding: 0;\n background-color: #aaa;\n overflow: auto;\n}\n\n.pb-canvas-wrapper {\n margin: 0;\n padding: 0;\n width: fit-content;\n}\n\n.pb-canvas-wrapper .pb-canvas {\n display: flex;\n flex-direction: row;\n flex: 1 1 auto;\n transform-origin: top left;\n width: fit-content;\n margin: 0;\n padding: 32px 40px 56px 40px;\n}\n\n.pb-position-mark {\n background-color: #ff3333;\n opacity: 0.5;\n border-radius: 2px;\n}\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\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\n.pb-add-section-handle.bottom {\n left: 50%;\n bottom: -32px;\n}\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\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\n.pb-button {\n background: none;\n border: none;\n cursor: pointer;\n vertical-align: middle;\n}\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\n.pb-guideline.selected {\n z-index: 3;\n}\n\n.pb-guideline.preselect {\n z-index: 4;\n}';
14014
- const _hoisted_1$9 = { class: "pb-canvas-frame" };
14015
- const _sfc_main$a = /* @__PURE__ */ defineComponent({
14016
- __name: "PbCanvasFrame",
14017
- setup(__props) {
14018
- const pageBuilderEditor = usePageBuilderEditor();
14019
- const iframeRef = ref();
14020
- provideMouseTracker(iframeRef);
14021
- const stopIframeWatch = watch(
14022
- () => {
14023
- var _a, _b;
14024
- return (_b = (_a = iframeRef.value) == null ? void 0 : _a.contentWindow) == null ? void 0 : _b.document;
14025
- },
14026
- () => {
14027
- var _a, _b, _c, _d, _e, _f, _g, _h;
14028
- if ((_c = (_b = (_a = iframeRef.value) == null ? void 0 : _a.contentWindow) == null ? void 0 : _b.document) == null ? void 0 : _c.head) {
14029
- const externalCss = pageBuilderEditor.getExternalCss();
14030
- const head = (_e = (_d = iframeRef.value) == null ? void 0 : _d.contentWindow) == null ? void 0 : _e.document.head;
14031
- head.innerHTML = `
14032
- <meta charset="UTF-8"/>
14033
- <link href="https://fonts.googleapis.com" rel="preconnect">
14034
- <link crossorigin href="https://fonts.gstatic.com" rel="preconnect">
14035
- <link href="https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500&display=swap" rel="stylesheet">
14036
- <link
14037
- href="https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500&family=Noto+Sans:wght@400;500&display=swap"
14038
- rel="stylesheet">
14039
- <link
14040
- href="https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500&family=Noto+Sans+KR:wght@400;500&family=Noto+Sans:wght@400;500&display=swap"
14041
- rel="stylesheet">
14042
- <link
14043
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=block"
14044
- rel="stylesheet"/>
14045
- <link href="https://fonts.googleapis.com/css2?family=Material+Icons+Outlined" rel="stylesheet" />
14046
-
14047
- <link href="https://bluesea5.g1project.net/assets/index-DjQFWKLW.css" rel="stylesheet" />
14048
-
14049
- ${externalCss}
14050
-
14051
- <style>${canvasStyle}</style>
14052
- `;
14053
- const script2 = (_g = (_f = iframeRef.value) == null ? void 0 : _f.contentWindow) == null ? void 0 : _g.document.createElement("script");
14054
- script2.innerHTML = `
14055
- function forwardPostMessage(event) {
14056
- if (event.data) {
14057
- window.parent.postMessage(event.data, '*');
14058
- }
14059
- }
14060
- window.addEventListener('message', forwardPostMessage);
14061
- `;
14062
- (_h = iframeRef.value) == null ? void 0 : _h.contentWindow.document.head.appendChild(script2);
14063
- pageBuilderEditor.keyHandlers.addDocumentKeyEventListener(iframeRef.value.contentWindow.document.body);
14064
- stopIframeWatch();
14065
- }
14066
- }
14067
- );
14068
- return (_ctx, _cache) => {
14069
- var _a, _b, _c, _d;
14070
- return openBlock(), createElementBlock("div", _hoisted_1$9, [
14071
- createElementVNode("iframe", {
14072
- ref_key: "iframeRef",
14073
- ref: iframeRef,
14074
- class: "canvas-frame"
14075
- }, null, 512),
14076
- ((_b = (_a = iframeRef.value) == null ? void 0 : _a.contentWindow) == null ? void 0 : _b.document.body) ? (openBlock(), createBlock$1(Teleport, {
14077
- key: 0,
14078
- to: (_d = (_c = iframeRef.value) == null ? void 0 : _c.contentWindow) == null ? void 0 : _d.document.body
14079
- }, [
14080
- createVNode(_sfc_main$b)
14081
- ], 8, ["to"])) : createCommentVNode("", true)
14082
- ]);
14083
- };
14084
- }
14085
- });
14086
- const _hoisted_1$8 = { class: "pb-tool-button bs-layout-horizontal flex-align-center" };
14087
- const _sfc_main$9 = /* @__PURE__ */ defineComponent({
14088
13802
  __name: "PbToolbarButton",
14089
13803
  props: {
14090
13804
  button: {}
@@ -14097,7 +13811,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
14097
13811
  (_b = (_a = props.button).handler) == null ? void 0 : _b.call(_a, pageBuilder);
14098
13812
  };
14099
13813
  return (_ctx, _cache) => {
14100
- return openBlock(), createElementBlock("div", _hoisted_1$8, [
13814
+ return openBlock(), createElementBlock("div", _hoisted_1$b, [
14101
13815
  createElementVNode("div", {
14102
13816
  class: "tool-button bs-clickable",
14103
13817
  onClick: handleClick
@@ -14112,17 +13826,17 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
14112
13826
  };
14113
13827
  }
14114
13828
  });
14115
- const _hoisted_1$7 = { class: "pb-tool-button-group bs-layout-horizontal flex-align-center" };
14116
- const _sfc_main$8 = /* @__PURE__ */ defineComponent({
13829
+ const _hoisted_1$a = { class: "pb-tool-button-group bs-layout-horizontal flex-align-center" };
13830
+ const _sfc_main$b = /* @__PURE__ */ defineComponent({
14117
13831
  __name: "PbToolbarButtonGroup",
14118
13832
  props: {
14119
13833
  group: {}
14120
13834
  },
14121
13835
  setup(__props) {
14122
13836
  return (_ctx, _cache) => {
14123
- return openBlock(), createElementBlock("div", _hoisted_1$7, [
13837
+ return openBlock(), createElementBlock("div", _hoisted_1$a, [
14124
13838
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.group.buttons, (button) => {
14125
- return openBlock(), createBlock$1(_sfc_main$9, {
13839
+ return openBlock(), createBlock$1(_sfc_main$c, {
14126
13840
  key: button.buttonId,
14127
13841
  button
14128
13842
  }, null, 8, ["button"]);
@@ -14131,11 +13845,10 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
14131
13845
  };
14132
13846
  }
14133
13847
  });
14134
- const _hoisted_1$6 = { class: "pb-toolbar bs-layout-horizontal align-items-center" };
14135
- const _hoisted_2$2 = { class: "bs-layout-horizontal align-items-center" };
14136
- const _hoisted_3$1 = /* @__PURE__ */ createElementVNode("div", { class: "flex-grow-1" }, null, -1);
14137
- const _hoisted_4 = { class: "mr-8" };
14138
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
13848
+ const _hoisted_1$9 = { class: "pb-toolbar bs-layout-horizontal align-items-center" };
13849
+ const _hoisted_2$3 = { class: "bs-layout-horizontal align-items-center" };
13850
+ const _hoisted_3$1 = { class: "mr-8" };
13851
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
14139
13852
  __name: "PbToolbar",
14140
13853
  props: {
14141
13854
  plugin: {}
@@ -14151,11 +13864,9 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
14151
13864
  },
14152
13865
  set: (count) => {
14153
13866
  var _a;
14154
- if (!count)
14155
- return;
13867
+ if (!count) return;
14156
13868
  console.log(count);
14157
- if (count === (((_a = pageBuilder.model.rootPart.children) == null ? void 0 : _a.length) || 0))
14158
- return;
13869
+ if (count === (((_a = pageBuilder.model.rootPart.children) == null ? void 0 : _a.length) || 0)) return;
14159
13870
  if (count >= 2) {
14160
13871
  makeMultipleScreen();
14161
13872
  } else {
@@ -14168,7 +13879,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
14168
13879
  };
14169
13880
  const makeSingleScreen = () => {
14170
13881
  modal.openModal({
14171
- component: defineAsyncComponent(() => import("./PbScreenSelectModal-DDATc9n1.js")),
13882
+ component: defineAsyncComponent(() => import("./PbScreenSelectModal-CnI1IsvW.js")),
14172
13883
  bind: {},
14173
13884
  on: {
14174
13885
  select: (selection) => {
@@ -14186,10 +13897,10 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
14186
13897
  });
14187
13898
  return (_ctx, _cache) => {
14188
13899
  var _a, _b, _c;
14189
- return openBlock(), createElementBlock("div", _hoisted_1$6, [
14190
- createElementVNode("div", _hoisted_2$2, [
13900
+ return openBlock(), createElementBlock("div", _hoisted_1$9, [
13901
+ createElementVNode("div", _hoisted_2$3, [
14191
13902
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(buttonGroups), (group) => {
14192
- return openBlock(), createBlock$1(_sfc_main$8, {
13903
+ return openBlock(), createBlock$1(_sfc_main$b, {
14193
13904
  key: group.groupId,
14194
13905
  group
14195
13906
  }, null, 8, ["group"]);
@@ -14211,30 +13922,30 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
14211
13922
  placeholder: "Scale"
14212
13923
  }, null, 8, ["modelValue"])
14213
13924
  ]),
14214
- _hoisted_3$1,
14215
- createElementVNode("div", _hoisted_4, [
13925
+ _cache[2] || (_cache[2] = createElementVNode("div", { class: "flex-grow-1" }, null, -1)),
13926
+ createElementVNode("div", _hoisted_3$1, [
14216
13927
  _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)
14217
13928
  ])
14218
13929
  ]);
14219
13930
  };
14220
13931
  }
14221
13932
  });
14222
- const _hoisted_1$5 = { class: "pb-menu bs-layout-vertical" };
14223
- const _sfc_main$6 = /* @__PURE__ */ defineComponent({
13933
+ const _hoisted_1$8 = { class: "pb-menu bs-layout-vertical" };
13934
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
14224
13935
  __name: "PbMenu",
14225
13936
  props: {
14226
13937
  toolbarPlugin: {}
14227
13938
  },
14228
13939
  setup(__props) {
14229
13940
  return (_ctx, _cache) => {
14230
- return openBlock(), createElementBlock("div", _hoisted_1$5, [
14231
- createVNode(_sfc_main$7, { plugin: _ctx.toolbarPlugin }, null, 8, ["plugin"])
13941
+ return openBlock(), createElementBlock("div", _hoisted_1$8, [
13942
+ createVNode(_sfc_main$a, { plugin: _ctx.toolbarPlugin }, null, 8, ["plugin"])
14232
13943
  ]);
14233
13944
  };
14234
13945
  }
14235
13946
  });
14236
- const _hoisted_1$4 = { class: "bs-layout-vertical border" };
14237
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
13947
+ const _hoisted_1$7 = { class: "bs-layout-vertical border" };
13948
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
14238
13949
  __name: "PbNavigator",
14239
13950
  setup(__props) {
14240
13951
  const pageBuilder = usePageBuilderEditor();
@@ -14276,21 +13987,17 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
14276
13987
  var _a, _b, _c, _d, _e, _f;
14277
13988
  let page2 = pageBuilder.context.getSelectedPage();
14278
13989
  const parentPartId = ((_a = event.destParent) == null ? void 0 : _a.partId) || (page2 == null ? void 0 : page2.partId);
14279
- if (!parentPartId)
14280
- return;
13990
+ if (!parentPartId) return;
14281
13991
  let ok = false;
14282
13992
  if (event.row.isSection()) {
14283
- if ((_b = event.destParent) == null ? void 0 : _b.isPage())
14284
- ok = true;
13993
+ if ((_b = event.destParent) == null ? void 0 : _b.isPage()) ok = true;
14285
13994
  } else if (event.row.isBlock()) {
14286
- if ((_c = event.destParent) == null ? void 0 : _c.isSection())
14287
- ok = true;
13995
+ if ((_c = event.destParent) == null ? void 0 : _c.isSection()) ok = true;
14288
13996
  } else if (event.row.isWidget()) {
14289
13997
  if ((_d = event.destParent) == null ? void 0 : _d.isBlock()) {
14290
13998
  ok = true;
14291
13999
  } else if (((_e = event.destParent) == null ? void 0 : _e.isWidget()) && !event.destParent.isNestedWidget()) {
14292
- if (!((_f = event.row.children) == null ? void 0 : _f.length))
14293
- ok = true;
14000
+ if (!((_f = event.row.children) == null ? void 0 : _f.length)) ok = true;
14294
14001
  }
14295
14002
  }
14296
14003
  if (ok) {
@@ -14327,8 +14034,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
14327
14034
  },
14328
14035
  () => {
14329
14036
  const selected = pageBuilder.context.getSelectedParts();
14330
- if (!selected || !selected[0])
14331
- return;
14037
+ if (!selected || !selected[0]) return;
14332
14038
  expandParent(selected[0]);
14333
14039
  }
14334
14040
  );
@@ -14361,7 +14067,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
14361
14067
  PageBuilderEditorEvent.off.modelUpdatedByUI(modelUpdateHandler);
14362
14068
  });
14363
14069
  return (_ctx, _cache) => {
14364
- return openBlock(), createElementBlock("div", _hoisted_1$4, [
14070
+ return openBlock(), createElementBlock("div", _hoisted_1$7, [
14365
14071
  createElementVNode("div", {
14366
14072
  ref_key: "tree",
14367
14073
  ref: tree,
@@ -14394,7 +14100,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
14394
14100
  };
14395
14101
  }
14396
14102
  });
14397
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
14103
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
14398
14104
  __name: "PbSidebarPropertyEditor",
14399
14105
  props: {
14400
14106
  property: {},
@@ -14407,8 +14113,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
14407
14113
  var _a;
14408
14114
  if (props.property.propertyEditor) {
14409
14115
  const editor = props.property.propertyEditor(props.property, props.selectedParts);
14410
- if (editor)
14411
- return editor;
14116
+ if (editor) return editor;
14412
14117
  }
14413
14118
  return (_a = pageBuilder.partManager.getPartPropertyEditor(props.property.propertyType)) == null ? void 0 : _a(props.property, props.selectedParts);
14414
14119
  });
@@ -14430,13 +14135,13 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
14430
14135
  };
14431
14136
  }
14432
14137
  });
14433
- const _hoisted_1$3 = { class: "pb-sidebar-property-group" };
14434
- const _hoisted_2$1 = {
14138
+ const _hoisted_1$6 = { class: "pb-sidebar-property-group" };
14139
+ const _hoisted_2$2 = {
14435
14140
  key: 0,
14436
14141
  class: "group-title"
14437
14142
  };
14438
14143
  const _hoisted_3 = ["textContent"];
14439
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
14144
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
14440
14145
  __name: "PbSidebarPropertyGroupEditor",
14441
14146
  props: {
14442
14147
  group: {},
@@ -14450,8 +14155,8 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
14450
14155
  return (_b = (_a = props.group).propertyGroupEditor) == null ? void 0 : _b.call(_a, props.group, props.selectedParts);
14451
14156
  });
14452
14157
  return (_ctx, _cache) => {
14453
- return openBlock(), createElementBlock("div", _hoisted_1$3, [
14454
- _ctx.group.showGroupName ? (openBlock(), createElementBlock("div", _hoisted_2$1, [
14158
+ return openBlock(), createElementBlock("div", _hoisted_1$6, [
14159
+ _ctx.group.showGroupName ? (openBlock(), createElementBlock("div", _hoisted_2$2, [
14455
14160
  createElementVNode("label", {
14456
14161
  textContent: toDisplayString(_ctx.group.caption)
14457
14162
  }, null, 8, _hoisted_3)
@@ -14462,7 +14167,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
14462
14167
  group: _ctx.group,
14463
14168
  "selected-parts": _ctx.selectedParts
14464
14169
  }, null, 8, ["group", "selected-parts"])) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(_ctx.group.properties, (property) => {
14465
- return openBlock(), createBlock$1(_sfc_main$4, {
14170
+ return openBlock(), createBlock$1(_sfc_main$7, {
14466
14171
  key: `${_ctx.partsKey}_${property.propertyName}`,
14467
14172
  property,
14468
14173
  "selected-parts": _ctx.selectedParts
@@ -14473,8 +14178,8 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
14473
14178
  };
14474
14179
  }
14475
14180
  });
14476
- const _hoisted_1$2 = { class: "pb-sidebar-properties" };
14477
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
14181
+ const _hoisted_1$5 = { class: "pb-sidebar-properties" };
14182
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
14478
14183
  __name: "PbSidebarProperties",
14479
14184
  setup(__props) {
14480
14185
  const pageBuilder = usePageBuilderEditor();
@@ -14492,12 +14197,12 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
14492
14197
  }
14493
14198
  });
14494
14199
  return (_ctx, _cache) => {
14495
- return openBlock(), createElementBlock("div", _hoisted_1$2, [
14200
+ return openBlock(), createElementBlock("div", _hoisted_1$5, [
14496
14201
  (openBlock(true), createElementBlock(Fragment, null, renderList(properties.value, (group) => {
14497
14202
  return openBlock(), createElementBlock("div", {
14498
14203
  key: `${partsKey.value}_${group.groupName}`
14499
14204
  }, [
14500
- createVNode(_sfc_main$3, {
14205
+ createVNode(_sfc_main$6, {
14501
14206
  group,
14502
14207
  partsKey: partsKey.value,
14503
14208
  "selected-parts": unref(selectedParts)
@@ -14508,13 +14213,275 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
14508
14213
  };
14509
14214
  }
14510
14215
  });
14511
- const _hoisted_1$1 = { class: "pb-sidebar" };
14512
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
14216
+ const _hoisted_1$4 = { class: "pb-sidebar" };
14217
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
14513
14218
  __name: "PbSidebar",
14514
14219
  setup(__props) {
14220
+ return (_ctx, _cache) => {
14221
+ return openBlock(), createElementBlock("div", _hoisted_1$4, [
14222
+ createVNode(_sfc_main$5)
14223
+ ]);
14224
+ };
14225
+ }
14226
+ });
14227
+ const _hoisted_1$3 = ["data-part-id"];
14228
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
14229
+ __name: "PbPage",
14230
+ props: {
14231
+ part: {},
14232
+ width: {},
14233
+ isMobilePage: { type: Boolean }
14234
+ },
14235
+ setup(__props) {
14236
+ const props = __props;
14237
+ const editor = usePageBuilderEditor();
14238
+ const styleTag = computed(() => props.part.getStyleTag());
14239
+ const style = computed(() => {
14240
+ var _a, _b;
14241
+ return {
14242
+ // width: `${props.width || 420}px`,
14243
+ minHeight: ((_b = (_a = props.part) == null ? void 0 : _a.children) == null ? void 0 : _b.length) ? void 0 : "200px"
14244
+ };
14245
+ });
14246
+ const properties = computed(() => {
14247
+ var _a, _b;
14248
+ return {
14249
+ style: {
14250
+ ...(_a = props.part) == null ? void 0 : _a.getStyles(),
14251
+ ...(_b = props.part) == null ? void 0 : _b.getInlineStyles()
14252
+ }
14253
+ };
14254
+ });
14255
+ const selected = computed(() => !!props.part && editor.context.isSelected(props.part));
14256
+ const insertSection = (index) => {
14257
+ editor.commandRegistry.executeCommand(AddSectionCommand.COMMAND_ID);
14258
+ };
14259
+ const pageBuilder = usePageBuilderEditor();
14260
+ const contextMenu = useContextMenu();
14261
+ const handleClick = (event) => {
14262
+ if (event.button === 0) {
14263
+ pageBuilder.context.clearSelection();
14264
+ }
14265
+ };
14266
+ const showContextMenu = (event) => {
14267
+ var _a, _b;
14268
+ if (event.altKey || event.ctrlKey || event.shiftKey) return;
14269
+ event.preventDefault();
14270
+ const frame = ((_b = (_a = event.target) == null ? void 0 : _a.ownerDocument.defaultView) == null ? void 0 : _b.frameElement) || void 0;
14271
+ const frameRect = frame == null ? void 0 : frame.getBoundingClientRect();
14272
+ const fakeEvent = {
14273
+ clientX: event.clientX + frameRect.left,
14274
+ clientY: event.clientY + frameRect.top
14275
+ };
14276
+ const contextMenus = pageBuilder.contextMenuRegistry.composeContextMenuItems(pageBuilder);
14277
+ contextMenu.showContextMenu(fakeEvent, contextMenus);
14278
+ };
14279
+ return (_ctx, _cache) => {
14280
+ var _a, _b;
14281
+ return openBlock(), createElementBlock(Fragment, null, [
14282
+ styleTag.value ? (openBlock(), createBlock$1(resolveDynamicComponent("style"), {
14283
+ key: 0,
14284
+ innerHTML: styleTag.value
14285
+ }, null, 8, ["innerHTML"])) : createCommentVNode("", true),
14286
+ createElementVNode("div", {
14287
+ "data-part-id": (_a = _ctx.part) == null ? void 0 : _a.partId,
14288
+ style: normalizeStyle(style.value),
14289
+ class: "pb-page",
14290
+ onContextmenu: showContextMenu,
14291
+ onMousedown: withModifiers(handleClick, ["stop"])
14292
+ }, [
14293
+ createElementVNode("div", mergeProps({
14294
+ class: [selected.value && "selected", _ctx.isMobilePage ? "mobile" : "pc", "pb-page-content"]
14295
+ }, properties.value), [
14296
+ (openBlock(true), createElementBlock(Fragment, null, renderList((_b = _ctx.part) == null ? void 0 : _b.children, (section, index) => {
14297
+ return openBlock(), createBlock$1(_sfc_main$l, {
14298
+ key: section.partId,
14299
+ part: section
14300
+ }, null, 8, ["part"]);
14301
+ }), 128))
14302
+ ], 16),
14303
+ createElementVNode("div", {
14304
+ class: "pb-add-section-handle bottom",
14305
+ onClick: _cache[0] || (_cache[0] = ($event) => {
14306
+ var _a2, _b2;
14307
+ return insertSection(((_b2 = (_a2 = _ctx.part) == null ? void 0 : _a2.children) == null ? void 0 : _b2.length) || 0);
14308
+ })
14309
+ }, _cache[1] || (_cache[1] = [
14310
+ createElementVNode("i", { class: "material-icons-outlined" }, "add_circle_outline", -1)
14311
+ ]))
14312
+ ], 44, _hoisted_1$3),
14313
+ _cache[2] || (_cache[2] = createElementVNode("div", { style: { "height": "100px" } }, null, -1))
14314
+ ], 64);
14315
+ };
14316
+ }
14317
+ });
14318
+ const canvasStyle = '.pb-page-wrapper {\n margin: 0 auto;\n padding: 0;\n}\n\n.pb-page {\n width: 100%;\n margin: 0;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n}\n\n.pb-page .pb-page-content.selected::before {\n content: "";\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 2px solid #4998f8;\n z-index: 999;\n pointer-events: none;\n}\n\n.pb-page * {\n box-sizing: border-box;\n}\n\n.pb-add-widget-button {\n width: 100%;\n height: 100%;\n min-height: 200px;\n position: relative;\n}\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\n.pb-add-widget-button button:hover {\n background-color: #eeeeee;\n}\n\n.pb-add-widget-button .icon {\n font-size: 1rem;\n vertical-align: middle;\n}\n\n.pb-add-widget-button .text {\n font-size: 1rem;\n vertical-align: middle;\n margin-left: 0.4rem;\n}\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\n.pb-section:hover:not(:has(.pb-block:hover)) {\n background-color: #f0f0f0;\n}\n\n.pb-section.selected::before {\n content: "";\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 2px solid #4998f8;\n z-index: 999;\n pointer-events: none;\n}\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\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\n.pb-section-static .pb-widget {\n outline: none;\n}\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\n.pb-block:hover:not(:has(.pb-widget:hover)) {\n background-color: #f0f0f0;\n}\n\n.pb-block.selected::before {\n content: "";\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 2px solid #4998f8;\n z-index: 999;\n pointer-events: none;\n}\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\n.pb-widget.selected::before {\n content: "";\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 2px solid #4998f8;\n z-index: 999;\n pointer-events: none;\n}\n\n.pb-widget .children {\n position: absolute;\n width: 100%;\n height: 100%;\n}\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\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\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\n.pb-widget .children {\n position: absolute;\n width: 100%;\n height: 100%;\n}\n\n.pb-text-widget {\n width: 100%;\n height: fit-content;\n}\n\n.pb-text-widget .text {\n color: #333;\n}\n\n.pb-text-widget .placeholder {\n padding: 4px 0;\n font-size: 18px;\n text-align: center;\n color: #999;\n}\n\n.pb-image-widget {\n width: 100%;\n}\n\n.pb-image-widget .image {\n width: 100%;\n}\n\n.pb-image-widget .placeholder {\n height: 100px;\n background-color: #eee;\n text-align: center;\n}\n\n.pb-image-widget .placeholder span {\n font-size: 40px;\n color: #999;\n line-height: 100px;\n vertical-align: middle;\n}\n\n.pb-html-widget {\n width: 100%;\n height: fit-content;\n}\n\n.pb-html-widget .placeholder {\n padding: 4px 0;\n font-size: 18px;\n text-align: center;\n color: #999;\n}\n\n.pb-iframe-widget {\n width: 100%;\n height: fit-content;\n}\n\n.pb-iframe-widget .placeholder {\n padding: 4px 0;\n font-size: 18px;\n text-align: center;\n color: #999;\n}\n\n.pb-youtube-widget {\n width: 100%;\n}\n\n.pb-youtube-widget .youtube {\n width: 100%;\n height: 100%;\n}\n\n.pb-youtube-widget .placeholder {\n height: 100px;\n background-color: #eee;\n text-align: center;\n}\n\n.pb-youtube-widget .placeholder span {\n font-size: 40px;\n color: #999;\n line-height: 100px;\n vertical-align: middle;\n}\n\n.pb-container-widget {\n width: 100%;\n}\n\n.pb-container-widget .placeholder {\n height: 100px;\n background-color: #eee;\n text-align: center;\n}\n\n.pb-container-widget .placeholder span {\n font-size: 40px;\n color: #999;\n line-height: 100px;\n vertical-align: middle;\n}\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\n.pb-product-list-widget .product-wrapper {\n width: 25%;\n}\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\n.pb-product-list-widget .product-wrapper img {\n width: 100%;\n}\n\n.pb-product-list-widget .product-wrapper .name {\n margin-top: 8px;\n font-size: 14px;\n}\n\n.pb-product-list-widget .product-wrapper .price {\n margin-top: 8px;\n font-size: 14px;\n font-weight: bold;\n}\n\n.pb-product-list-widget .product-wrapper .empty {\n height: 200px;\n background-color: #eee;\n text-align: center;\n}\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\n@media (max-width: 768px) {\n .pb-product-list-widget .product-wrapper {\n width: 50%;\n }\n}\n\n.mobile .pb-product-list-widget .product-wrapper {\n width: 50%;\n}\n\n.pb-login-widget {\n height: 200px;\n text-align: center;\n}\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\n.font-icon {\n font-family: Material Symbols Outlined, monospace;\n font-size: 1rem;\n max-width: 1em;\n}\n\nhtml, body {\n font-family: Noto Sans, Noto Sans KR, Noto Sans JP, Arial, sans-serif;\n font-size: 12px;\n}\n\nbody {\n margin: 0;\n padding: 0;\n background-color: #aaa;\n overflow: hidden;\n}\n\n.pb-position-mark {\n background-color: #ff3333;\n opacity: 0.5;\n border-radius: 2px;\n}\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\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\n.pb-add-section-handle.bottom {\n left: 50%;\n bottom: -32px;\n}\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\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}';
14319
+ const _hoisted_1$2 = ["height", "width"];
14320
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
14321
+ __name: "PbPageFrame",
14322
+ props: {
14323
+ part: {},
14324
+ width: {},
14325
+ isMobilePage: { type: Boolean }
14326
+ },
14327
+ setup(__props) {
14328
+ const props = __props;
14329
+ const pageBuilderEditor = usePageBuilderEditor();
14330
+ const iframeRef = ref();
14331
+ provideMouseTracker(iframeRef);
14332
+ const stopIframeWatch = watch(
14333
+ () => {
14334
+ var _a, _b;
14335
+ return (_b = (_a = iframeRef.value) == null ? void 0 : _a.contentWindow) == null ? void 0 : _b.document;
14336
+ },
14337
+ () => {
14338
+ var _a, _b, _c, _d, _e, _f, _g, _h;
14339
+ if ((_c = (_b = (_a = iframeRef.value) == null ? void 0 : _a.contentWindow) == null ? void 0 : _b.document) == null ? void 0 : _c.head) {
14340
+ const externalCss = pageBuilderEditor.getExternalCss();
14341
+ const head = (_e = (_d = iframeRef.value) == null ? void 0 : _d.contentWindow) == null ? void 0 : _e.document.head;
14342
+ head.innerHTML = `
14343
+ <meta charset="UTF-8"/>
14344
+ <link href="https://fonts.googleapis.com" rel="preconnect">
14345
+ <link crossorigin href="https://fonts.gstatic.com" rel="preconnect">
14346
+ <link href="https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500&display=swap" rel="stylesheet">
14347
+ <link
14348
+ href="https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500&family=Noto+Sans:wght@400;500&display=swap"
14349
+ rel="stylesheet">
14350
+ <link
14351
+ href="https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500&family=Noto+Sans+KR:wght@400;500&family=Noto+Sans:wght@400;500&display=swap"
14352
+ rel="stylesheet">
14353
+ <link
14354
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=block"
14355
+ rel="stylesheet"/>
14356
+ <link href="https://fonts.googleapis.com/css2?family=Material+Icons+Outlined" rel="stylesheet" />
14357
+
14358
+ <link href="https://bluesea5.g1project.net/assets/index-DjQFWKLW.css" rel="stylesheet" />
14359
+
14360
+ ${externalCss}
14361
+
14362
+ <style>${canvasStyle}</style>
14363
+ `;
14364
+ const script2 = (_g = (_f = iframeRef.value) == null ? void 0 : _f.contentWindow) == null ? void 0 : _g.document.createElement("script");
14365
+ script2.innerHTML = `
14366
+ function forwardPostMessage(event) {
14367
+ if (event.data) {
14368
+ console.log(event)
14369
+ window.parent.postMessage(event.data, '*');
14370
+ }
14371
+ }
14372
+ window.addEventListener('message', forwardPostMessage);
14373
+ `;
14374
+ (_h = iframeRef.value) == null ? void 0 : _h.contentWindow.document.head.appendChild(script2);
14375
+ pageBuilderEditor.keyHandlers.addDocumentKeyEventListener(iframeRef.value.contentWindow.document.body);
14376
+ stopIframeWatch();
14377
+ }
14378
+ }
14379
+ );
14380
+ const width = ref(props.width);
14381
+ const height = ref(200);
14382
+ const style = computed(() => ({
14383
+ // width: `${width.value}px`,
14384
+ // height: `${height.value}px`,
14385
+ }));
14386
+ let iframeObserver;
14387
+ const updateIframeHeight = () => {
14388
+ if (!iframeRef.value || !iframeRef.value.contentDocument) return;
14389
+ const iframeBody = iframeRef.value.contentDocument.body;
14390
+ if (iframeBody) {
14391
+ height.value = iframeBody.scrollHeight;
14392
+ }
14393
+ };
14394
+ onMounted(() => {
14395
+ if (!iframeRef.value || !iframeRef.value.contentDocument) return;
14396
+ const iframeBody = iframeRef.value.contentDocument.body;
14397
+ iframeObserver = new MutationObserver(updateIframeHeight);
14398
+ iframeObserver.observe(iframeBody, { childList: true, subtree: true });
14399
+ iframeRef.value.onload = updateIframeHeight;
14400
+ });
14401
+ onBeforeUnmount(() => {
14402
+ if (iframeObserver) {
14403
+ iframeObserver.disconnect();
14404
+ }
14405
+ });
14406
+ return (_ctx, _cache) => {
14407
+ var _a, _b, _c, _d;
14408
+ return openBlock(), createElementBlock("div", {
14409
+ style: normalizeStyle({ width: `${width.value}px` }),
14410
+ class: "pb-page-frame"
14411
+ }, [
14412
+ createVNode(unref(BSSelect), {
14413
+ modelValue: width.value,
14414
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => width.value = $event),
14415
+ items: [480, 768, 1024, 1280],
14416
+ "label-provider": (v) => `Screen Size: ${v}px`,
14417
+ "value-provider": (v) => v,
14418
+ "view-model": false
14419
+ }, null, 8, ["modelValue", "label-provider", "value-provider"]),
14420
+ createElementVNode("iframe", {
14421
+ ref_key: "iframeRef",
14422
+ ref: iframeRef,
14423
+ height: `${height.value}px`,
14424
+ style: normalizeStyle(style.value),
14425
+ width: `${width.value}px`,
14426
+ class: "page-frame mt-12"
14427
+ }, null, 12, _hoisted_1$2),
14428
+ ((_b = (_a = iframeRef.value) == null ? void 0 : _a.contentWindow) == null ? void 0 : _b.document.body) ? (openBlock(), createBlock$1(Teleport, {
14429
+ key: 0,
14430
+ to: (_d = (_c = iframeRef.value) == null ? void 0 : _c.contentWindow) == null ? void 0 : _d.document.body
14431
+ }, [
14432
+ createVNode(_sfc_main$3, {
14433
+ "is-mobile-page": _ctx.isMobilePage,
14434
+ part: _ctx.part,
14435
+ width: width.value
14436
+ }, null, 8, ["is-mobile-page", "part", "width"])
14437
+ ], 8, ["to"])) : createCommentVNode("", true)
14438
+ ], 4);
14439
+ };
14440
+ }
14441
+ });
14442
+ const _hoisted_1$1 = { class: "pb-canvas-wrapper" };
14443
+ const _hoisted_2$1 = {
14444
+ key: 1,
14445
+ style: { "width": "20px" }
14446
+ };
14447
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
14448
+ __name: "PbCanvas",
14449
+ setup(__props) {
14450
+ const pageBuilder = usePageBuilderEditor();
14451
+ const partS = computed(() => {
14452
+ var _a;
14453
+ return (_a = pageBuilder.model.rootPart.children) == null ? void 0 : _a[0];
14454
+ });
14455
+ const partL = computed(() => {
14456
+ var _a;
14457
+ return (_a = pageBuilder.model.rootPart.children) == null ? void 0 : _a[1];
14458
+ });
14459
+ useContextMenu();
14460
+ const style = computed(() => {
14461
+ const scale = pageBuilder.scale.value;
14462
+ return {
14463
+ style: {
14464
+ transform: `scale(${scale})`
14465
+ }
14466
+ };
14467
+ });
14515
14468
  return (_ctx, _cache) => {
14516
14469
  return openBlock(), createElementBlock("div", _hoisted_1$1, [
14517
- createVNode(_sfc_main$2)
14470
+ createElementVNode("div", mergeProps({ class: "pb-canvas" }, style.value), [
14471
+ partS.value ? (openBlock(), createBlock$1(_sfc_main$2, {
14472
+ key: 0,
14473
+ "is-mobile-page": true,
14474
+ part: partS.value,
14475
+ width: 480
14476
+ }, null, 8, ["part"])) : createCommentVNode("", true),
14477
+ partL.value ? (openBlock(), createElementBlock("div", _hoisted_2$1)) : createCommentVNode("", true),
14478
+ partL.value ? (openBlock(), createBlock$1(_sfc_main$2, {
14479
+ key: 2,
14480
+ "is-mobile-page": false,
14481
+ part: partL.value,
14482
+ width: 1024
14483
+ }, null, 8, ["part"])) : createCommentVNode("", true)
14484
+ ], 16)
14518
14485
  ]);
14519
14486
  };
14520
14487
  }
@@ -14538,12 +14505,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
14538
14505
  const pageBuilderEditor = createPageBuilderEditor();
14539
14506
  pageBuilderEditor.instanceId = props.instanceId;
14540
14507
  pageBuilderEditor.title = props.title;
14541
- if (props.locales)
14542
- pageBuilderEditor.setLocales(props.locales);
14543
- if (props.locale)
14544
- pageBuilderEditor.setLocale(props.locale);
14545
- if (props.plugin)
14546
- pageBuilderEditor.registerCustomPlugin(props.plugin);
14508
+ if (props.locales) pageBuilderEditor.setLocales(props.locales);
14509
+ if (props.locale) pageBuilderEditor.setLocale(props.locale);
14510
+ if (props.plugin) pageBuilderEditor.registerCustomPlugin(props.plugin);
14547
14511
  pageBuilderEditor.registerPlugin({
14548
14512
  // TODO
14549
14513
  commands: createDefaultCommands(modal)
@@ -14571,18 +14535,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
14571
14535
  });
14572
14536
  return (_ctx, _cache) => {
14573
14537
  return openBlock(), createElementBlock("div", _hoisted_1, [
14574
- createVNode(_sfc_main$6, { "toolbar-plugin": _ctx.toolbarPlugin }, null, 8, ["toolbar-plugin"]),
14538
+ createVNode(_sfc_main$9, { "toolbar-plugin": _ctx.toolbarPlugin }, null, 8, ["toolbar-plugin"]),
14575
14539
  createElementVNode("div", _hoisted_2, [
14576
- createVNode(_sfc_main$5),
14577
- createVNode(_sfc_main$a, { class: "flex-grow-1" }),
14578
- createVNode(_sfc_main$1)
14540
+ createVNode(_sfc_main$8),
14541
+ createVNode(_sfc_main$1),
14542
+ createVNode(_sfc_main$4)
14579
14543
  ])
14580
14544
  ]);
14581
14545
  };
14582
14546
  }
14583
14547
  });
14584
14548
  export {
14549
+ usePageBuilder as A,
14585
14550
  BLOCK_TYPE$1 as B,
14551
+ usePageBuilderViewer as C,
14586
14552
  Model$1 as M,
14587
14553
  PbColorPicker as P,
14588
14554
  ROOT_TYPE$1 as R,
@@ -14594,23 +14560,25 @@ export {
14594
14560
  PAGE_BUILDER_KEY as c,
14595
14561
  PAGE_TYPE$1 as d,
14596
14562
  Page as e,
14597
- _sfc_main$1$1 as f,
14563
+ _sfc_main$2$1 as f,
14598
14564
  Part as g,
14599
- _sfc_main$q as h,
14600
- _sfc_main$4$1 as i,
14601
- _sfc_main$3$1 as j,
14602
- _sfc_main$6$1 as k,
14603
- _sfc_main$5$1 as l,
14604
- RootPart as m,
14605
- Section as n,
14606
- Widget as o,
14607
- createPageBuilderViewer as p,
14608
- createPartComponent as q,
14609
- createPartComponents as r,
14610
- providePageBuilder as s,
14611
- providePageBuilderViewer as t,
14565
+ _sfc_main$1$1 as h,
14566
+ _sfc_main$q as i,
14567
+ _sfc_main$6$1 as j,
14568
+ _sfc_main$5$1 as k,
14569
+ _sfc_main$8$1 as l,
14570
+ _sfc_main$7$1 as m,
14571
+ _sfc_main$4$1 as n,
14572
+ RootPart as o,
14573
+ Section as p,
14574
+ Widget as q,
14575
+ createPageBuilderViewer as r,
14576
+ selectYoutubeVideo as s,
14577
+ createPartComponent as t,
14612
14578
  usePageBuilderEditor as u,
14613
- usePageBuilder as v,
14579
+ createPartComponents as v,
14614
14580
  widgetPartDefinitions as w,
14615
- usePageBuilderViewer as x
14581
+ getPartClassName as x,
14582
+ providePageBuilder as y,
14583
+ providePageBuilderViewer as z
14616
14584
  };