@g1cloud/page-builder-editor 1.0.0-alpha.33 → 1.0.0-alpha.35

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.
@@ -6671,6 +6671,24 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
6671
6671
  isNestedWidget() {
6672
6672
  return false;
6673
6673
  }
6674
+ isParentOf(part) {
6675
+ if (!part) return false;
6676
+ let parent = part.parent;
6677
+ while (parent) {
6678
+ if (parent === this || parent.partId === this.partId) return true;
6679
+ parent = parent.parent;
6680
+ }
6681
+ return false;
6682
+ }
6683
+ isChildOf(part) {
6684
+ if (!part) return false;
6685
+ let parent = this.parent;
6686
+ while (parent) {
6687
+ if (parent === part || parent.partId === part.partId) return true;
6688
+ parent = parent.parent;
6689
+ }
6690
+ return false;
6691
+ }
6674
6692
  getName() {
6675
6693
  var _a;
6676
6694
  return (_a = this.properties) == null ? void 0 : _a.name;
@@ -6684,80 +6702,87 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
6684
6702
  return ((_a = this.properties) == null ? void 0 : _a.classNames) || "";
6685
6703
  }
6686
6704
  getAlignStyleValue(align) {
6687
- if (align === "left") return "flex-start";
6688
- if (align === "right") return "flex-end";
6689
- return "center";
6705
+ switch (align) {
6706
+ case "start":
6707
+ return "flex-start";
6708
+ case "end":
6709
+ return "flex-end";
6710
+ case "center":
6711
+ return "center";
6712
+ case "between":
6713
+ return "space-between";
6714
+ default:
6715
+ return;
6716
+ }
6690
6717
  }
6691
6718
  getStyles(isMobilePage) {
6692
- 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;
6719
+ 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, _Q;
6693
6720
  const style = {};
6694
- const align = ((_a = this.properties) == null ? void 0 : _a.align) || "center";
6695
- if (this.isWidget()) {
6696
- style.alignSelf = this.getAlignStyleValue(align);
6697
- } else if (this.isPage()) {
6698
- style.display = "flex";
6699
- style.flexDirection = "column";
6700
- style.alignItems = this.getAlignStyleValue(align);
6721
+ if (((_a = this.properties) == null ? void 0 : _a.direction) === "horizontal") {
6722
+ style.flexDirection = "row";
6701
6723
  } else {
6702
- const direction = isMobilePage ? (_b = this.properties) == null ? void 0 : _b.directionSm : (_c = this.properties) == null ? void 0 : _c.directionLg;
6703
- if (direction === "horizontal") {
6704
- style.display = "flex";
6705
- style.flexDirection = "row";
6706
- style.justifyContent = this.getAlignStyleValue(align);
6707
- } else if (direction === "vertical") {
6708
- style.display = "flex";
6709
- style.flexDirection = "column";
6710
- style.alignItems = this.getAlignStyleValue(align);
6711
- }
6712
- }
6713
- if (((_d = this.properties) == null ? void 0 : _d.wrap) === "wrap") {
6724
+ style.flexDirection = "column";
6725
+ }
6726
+ if (((_b = this.properties) == null ? void 0 : _b.wrap) === "wrap") {
6714
6727
  style.flexWrap = "wrap";
6715
6728
  }
6716
- if ((_e = this.properties) == null ? void 0 : _e.margin) style.margin = this.properties.margin;
6717
- if ((_f = this.properties) == null ? void 0 : _f.marginLeft) style.marginLeft = this.properties.marginLeft;
6718
- if ((_g = this.properties) == null ? void 0 : _g.marginRight) style.marginRight = this.properties.marginRight;
6719
- if ((_h = this.properties) == null ? void 0 : _h.marginTop) style.marginTop = this.properties.marginTop;
6720
- if ((_i = this.properties) == null ? void 0 : _i.marginBottom) style.marginBottom = this.properties.marginBottom;
6721
- if ((_j = this.properties) == null ? void 0 : _j.padding) style.padding = this.properties.padding;
6722
- if ((_k = this.properties) == null ? void 0 : _k.paddingLeft) style.paddingLeft = this.properties.paddingLeft;
6723
- if ((_l = this.properties) == null ? void 0 : _l.paddingRight) style.paddingRight = this.properties.paddingRight;
6724
- if ((_m = this.properties) == null ? void 0 : _m.paddingTop) style.paddingTop = this.properties.paddingTop;
6725
- if ((_n = this.properties) == null ? void 0 : _n.paddingBottom) style.paddingBottom = this.properties.paddingBottom;
6726
- if ((_o = this.properties) == null ? void 0 : _o.left) style.left = this.properties.left;
6727
- if ((_p = this.properties) == null ? void 0 : _p.right) style.right = this.properties.right;
6728
- if ((_q = this.properties) == null ? void 0 : _q.top) style.top = this.properties.top;
6729
- if ((_r = this.properties) == null ? void 0 : _r.bottom) style.bottom = this.properties.bottom;
6730
- if ((_s = this.properties) == null ? void 0 : _s.width) style.width = this.properties.width;
6731
- if ((_t = this.properties) == null ? void 0 : _t.height) style.height = this.properties.height;
6732
- if ((_u = this.properties) == null ? void 0 : _u.maxWidth) style.maxWidth = this.properties.maxWidth;
6733
- if ((_v = this.properties) == null ? void 0 : _v.maxHeight) style.maxHeight = this.properties.maxHeight;
6734
- if ((_w = this.properties) == null ? void 0 : _w.minWidth) style.minWidth = this.properties.minWidth;
6735
- if ((_x = this.properties) == null ? void 0 : _x.minHeight) style.minHeight = this.properties.minHeight;
6736
- if ((_y = this.properties) == null ? void 0 : _y.textAlign) style.textAlign = this.properties.textAlign;
6737
- if ((_z = this.properties) == null ? void 0 : _z.backgroundColor) style.backgroundColor = this.properties.backgroundColor;
6738
- if ((_A = this.properties) == null ? void 0 : _A.borderLeftWidth) style.borderLeftWidth = this.properties.borderLeftWidth;
6739
- if ((_B = this.properties) == null ? void 0 : _B.borderRightWidth) style.borderRightWidth = this.properties.borderRightWidth;
6740
- if ((_C = this.properties) == null ? void 0 : _C.borderTopWidth) style.borderTopWidth = this.properties.borderTopWidth;
6741
- if ((_D = this.properties) == null ? void 0 : _D.borderBottomWidth) style.borderBottomWidth = this.properties.borderBottomWidth;
6742
- if ((_E = this.properties) == null ? void 0 : _E.borderTopLeftRadius) style.borderTopLeftRadius = this.properties.borderTopLeftRadius;
6743
- if ((_F = this.properties) == null ? void 0 : _F.borderTopRightRadius) style.borderTopRightRadius = this.properties.borderTopRightRadius;
6744
- if ((_G = this.properties) == null ? void 0 : _G.borderBottomLeftRadius) style.borderBottomLeftRadius = this.properties.borderBottomLeftRadius;
6745
- if ((_H = this.properties) == null ? void 0 : _H.borderBottomRightRadius) style.borderBottomRightRadius = this.properties.borderBottomRightRadius;
6746
- if (((_I = this.properties) == null ? void 0 : _I.borderColor) && style.borderLeftWidth) {
6729
+ const alignItems = this.getAlignStyleValue((_c = this.properties) == null ? void 0 : _c.alignItems);
6730
+ const justifyContent = this.getAlignStyleValue((_d = this.properties) == null ? void 0 : _d.justifyContent);
6731
+ const alignSelf = this.getAlignStyleValue((_e = this.properties) == null ? void 0 : _e.alignSelf);
6732
+ if (this.isWidget()) {
6733
+ if (alignSelf) style.alignSelf = alignSelf;
6734
+ } else if (this.isPage()) {
6735
+ if (alignItems) style.alignItems = alignItems;
6736
+ } else {
6737
+ if (alignItems) style.alignItems = alignItems;
6738
+ if (justifyContent) style.justifyContent = justifyContent;
6739
+ if (alignSelf) style.alignSelf = alignSelf;
6740
+ }
6741
+ if ((_f = this.properties) == null ? void 0 : _f.margin) style.margin = this.properties.margin;
6742
+ if ((_g = this.properties) == null ? void 0 : _g.marginLeft) style.marginLeft = this.properties.marginLeft;
6743
+ if ((_h = this.properties) == null ? void 0 : _h.marginRight) style.marginRight = this.properties.marginRight;
6744
+ if ((_i = this.properties) == null ? void 0 : _i.marginTop) style.marginTop = this.properties.marginTop;
6745
+ if ((_j = this.properties) == null ? void 0 : _j.marginBottom) style.marginBottom = this.properties.marginBottom;
6746
+ if ((_k = this.properties) == null ? void 0 : _k.padding) style.padding = this.properties.padding;
6747
+ if ((_l = this.properties) == null ? void 0 : _l.paddingLeft) style.paddingLeft = this.properties.paddingLeft;
6748
+ if ((_m = this.properties) == null ? void 0 : _m.paddingRight) style.paddingRight = this.properties.paddingRight;
6749
+ if ((_n = this.properties) == null ? void 0 : _n.paddingTop) style.paddingTop = this.properties.paddingTop;
6750
+ if ((_o = this.properties) == null ? void 0 : _o.paddingBottom) style.paddingBottom = this.properties.paddingBottom;
6751
+ if ((_p = this.properties) == null ? void 0 : _p.left) style.left = this.properties.left;
6752
+ if ((_q = this.properties) == null ? void 0 : _q.right) style.right = this.properties.right;
6753
+ if ((_r = this.properties) == null ? void 0 : _r.top) style.top = this.properties.top;
6754
+ if ((_s = this.properties) == null ? void 0 : _s.bottom) style.bottom = this.properties.bottom;
6755
+ if ((_t = this.properties) == null ? void 0 : _t.width) style.width = this.properties.width;
6756
+ if ((_u = this.properties) == null ? void 0 : _u.height) style.height = this.properties.height;
6757
+ if ((_v = this.properties) == null ? void 0 : _v.maxWidth) style.maxWidth = this.properties.maxWidth;
6758
+ if ((_w = this.properties) == null ? void 0 : _w.maxHeight) style.maxHeight = this.properties.maxHeight;
6759
+ if ((_x = this.properties) == null ? void 0 : _x.minWidth) style.minWidth = this.properties.minWidth;
6760
+ if ((_y = this.properties) == null ? void 0 : _y.minHeight) style.minHeight = this.properties.minHeight;
6761
+ if ((_z = this.properties) == null ? void 0 : _z.textAlign) style.textAlign = this.properties.textAlign;
6762
+ if ((_A = this.properties) == null ? void 0 : _A.backgroundColor) style.backgroundColor = this.properties.backgroundColor;
6763
+ if ((_B = this.properties) == null ? void 0 : _B.borderLeftWidth) style.borderLeftWidth = this.properties.borderLeftWidth;
6764
+ if ((_C = this.properties) == null ? void 0 : _C.borderRightWidth) style.borderRightWidth = this.properties.borderRightWidth;
6765
+ if ((_D = this.properties) == null ? void 0 : _D.borderTopWidth) style.borderTopWidth = this.properties.borderTopWidth;
6766
+ if ((_E = this.properties) == null ? void 0 : _E.borderBottomWidth) style.borderBottomWidth = this.properties.borderBottomWidth;
6767
+ if ((_F = this.properties) == null ? void 0 : _F.borderTopLeftRadius) style.borderTopLeftRadius = this.properties.borderTopLeftRadius;
6768
+ if ((_G = this.properties) == null ? void 0 : _G.borderTopRightRadius) style.borderTopRightRadius = this.properties.borderTopRightRadius;
6769
+ if ((_H = this.properties) == null ? void 0 : _H.borderBottomLeftRadius) style.borderBottomLeftRadius = this.properties.borderBottomLeftRadius;
6770
+ if ((_I = this.properties) == null ? void 0 : _I.borderBottomRightRadius) style.borderBottomRightRadius = this.properties.borderBottomRightRadius;
6771
+ if (((_J = this.properties) == null ? void 0 : _J.borderColor) && style.borderLeftWidth) {
6747
6772
  style.borderLeftStyle = "solid";
6748
- style.borderLeftColor = (_J = this.properties) == null ? void 0 : _J.borderColor;
6773
+ style.borderLeftColor = (_K = this.properties) == null ? void 0 : _K.borderColor;
6749
6774
  }
6750
- if (((_K = this.properties) == null ? void 0 : _K.borderColor) && style.borderRightWidth) {
6775
+ if (((_L = this.properties) == null ? void 0 : _L.borderColor) && style.borderRightWidth) {
6751
6776
  style.borderRightStyle = "solid";
6752
- style.borderRightColor = (_L = this.properties) == null ? void 0 : _L.borderColor;
6777
+ style.borderRightColor = (_M = this.properties) == null ? void 0 : _M.borderColor;
6753
6778
  }
6754
- if (((_M = this.properties) == null ? void 0 : _M.borderColor) && style.borderTopWidth) {
6779
+ if (((_N = this.properties) == null ? void 0 : _N.borderColor) && style.borderTopWidth) {
6755
6780
  style.borderTopStyle = "solid";
6756
- style.borderTopColor = (_N = this.properties) == null ? void 0 : _N.borderColor;
6781
+ style.borderTopColor = (_O = this.properties) == null ? void 0 : _O.borderColor;
6757
6782
  }
6758
- if (((_O = this.properties) == null ? void 0 : _O.borderColor) && style.borderBottomWidth) {
6783
+ if (((_P = this.properties) == null ? void 0 : _P.borderColor) && style.borderBottomWidth) {
6759
6784
  style.borderBottomStyle = "solid";
6760
- style.borderBottomColor = (_P = this.properties) == null ? void 0 : _P.borderColor;
6785
+ style.borderBottomColor = (_Q = this.properties) == null ? void 0 : _Q.borderColor;
6761
6786
  }
6762
6787
  return style;
6763
6788
  }
@@ -7535,8 +7560,7 @@ ${_html.style}
7535
7560
  const pageBuilder = usePageBuilder();
7536
7561
  const comp = vue.computed(() => pageBuilder.getCustomWidgetComponent(props.part));
7537
7562
  const bind = vue.computed(() => ({
7538
- ...props.part.properties || {},
7539
- placeholder: props.placeholder
7563
+ ...props.part.properties || {}
7540
7564
  }));
7541
7565
  return (_ctx, _cache) => {
7542
7566
  return comp.value ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(comp.value), vue.normalizeProps(vue.mergeProps({ key: 0 }, bind.value)), null, 16)) : vue.createCommentVNode("", true);
@@ -8181,6 +8205,7 @@ ${_html.style}
8181
8205
  el.onmousedown = async (event) => {
8182
8206
  if (event.button === 0) {
8183
8207
  setTimeout(() => {
8208
+ if (pageBuilder.context.isSelected(part)) return;
8184
8209
  if (event.shiftKey) {
8185
8210
  pageBuilder.context.addSelection([part]);
8186
8211
  } else {
@@ -8199,9 +8224,8 @@ ${_html.style}
8199
8224
  const eventAny = event;
8200
8225
  if (eventAny._partContextMenuHandled) return;
8201
8226
  else eventAny._partContextMenuHandled = true;
8202
- if (!pageBuilder.context.isSelected(part)) {
8203
- pageBuilder.context.setSelection([part]);
8204
- }
8227
+ if (pageBuilder.context.isSelected(part)) return;
8228
+ pageBuilder.context.setSelection([part]);
8205
8229
  };
8206
8230
  };
8207
8231
  const createPositionMark = () => {
@@ -8370,11 +8394,7 @@ ${_html.style}
8370
8394
  style.height = height || "";
8371
8395
  };
8372
8396
  const getLayoutDirection = (isMobilePage, properties) => {
8373
- if (isMobilePage) {
8374
- return properties && properties.directionSm || "vertical";
8375
- } else {
8376
- return properties && properties.directionLg || "horizontal";
8377
- }
8397
+ return properties && properties.direction || (isMobilePage ? "vertical" : "horizontal");
8378
8398
  };
8379
8399
  const _export_sfc = (sfc, props) => {
8380
8400
  const target = sfc.__vccOpts || sfc;
@@ -8872,7 +8892,8 @@ ${_html.style}
8872
8892
  __name: "PbBlock",
8873
8893
  props: {
8874
8894
  part: {},
8875
- isMobilePage: { type: Boolean }
8895
+ isMobilePage: { type: Boolean },
8896
+ placeholder: { type: Boolean }
8876
8897
  },
8877
8898
  setup(__props) {
8878
8899
  const props = __props;
@@ -9096,7 +9117,8 @@ ${_html.style}
9096
9117
  __name: "PbSection",
9097
9118
  props: {
9098
9119
  part: {},
9099
- isMobilePage: { type: Boolean }
9120
+ isMobilePage: { type: Boolean },
9121
+ placeholder: { type: Boolean }
9100
9122
  },
9101
9123
  setup(__props) {
9102
9124
  const props = __props;
@@ -11942,14 +11964,8 @@ ${_html.style}
11942
11964
  caption: "Layout",
11943
11965
  properties: [
11944
11966
  {
11945
- propertyName: "directionSm",
11946
- caption: "Direction for Mobile (<= 768px)",
11947
- propertyType: "select",
11948
- params: "vertical,horizontal"
11949
- },
11950
- {
11951
- propertyName: "directionLg",
11952
- caption: "Direction for PC (> 768px)",
11967
+ propertyName: "direction",
11968
+ caption: "Layout",
11953
11969
  propertyType: "select",
11954
11970
  params: "vertical,horizontal"
11955
11971
  },
@@ -11968,10 +11984,50 @@ ${_html.style}
11968
11984
  caption: "Align",
11969
11985
  properties: [
11970
11986
  {
11971
- propertyName: "align",
11972
- caption: "Align",
11987
+ propertyName: "alignItems",
11988
+ caption: "Align Items",
11989
+ propertyType: "select",
11990
+ params: "start,center,end"
11991
+ },
11992
+ {
11993
+ propertyName: "justifyContent",
11994
+ caption: "Justify Content",
11995
+ propertyType: "select",
11996
+ params: "start,center,end,between"
11997
+ },
11998
+ {
11999
+ propertyName: "alignSelf",
12000
+ caption: "Align Self",
11973
12001
  propertyType: "select",
11974
- params: "left,center,right"
12002
+ params: "start,center,end"
12003
+ }
12004
+ ]
12005
+ };
12006
+ };
12007
+ const alignItemsGroup = () => {
12008
+ return {
12009
+ groupName: "align",
12010
+ caption: "Align",
12011
+ properties: [
12012
+ {
12013
+ propertyName: "alignItems",
12014
+ caption: "Align Items",
12015
+ propertyType: "select",
12016
+ params: "start,center,end"
12017
+ }
12018
+ ]
12019
+ };
12020
+ };
12021
+ const alignSelfGroup = () => {
12022
+ return {
12023
+ groupName: "align",
12024
+ caption: "Align",
12025
+ properties: [
12026
+ {
12027
+ propertyName: "alignSelf",
12028
+ caption: "Align Self",
12029
+ propertyType: "select",
12030
+ params: ",start,center,end"
11975
12031
  }
11976
12032
  ]
11977
12033
  };
@@ -12053,7 +12109,7 @@ ${_html.style}
12053
12109
  return [layoutGroup(), alignGroup(), sizeGroup(), marginGroup(), paddingGroup(), backgroundGroup(), commonGroup()];
12054
12110
  };
12055
12111
  const defaultWidgetPropertyGroups = () => {
12056
- return [alignGroup(), positionGroup(), sizeGroup(), marginGroup(), paddingGroup(), borderGroup(), backgroundGroup(), commonGroup()];
12112
+ return [alignSelfGroup(), positionGroup(), sizeGroup(), marginGroup(), paddingGroup(), borderGroup(), backgroundGroup(), commonGroup()];
12057
12113
  };
12058
12114
  const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
12059
12115
  __name: "PbContainerWidget",
@@ -12104,13 +12160,13 @@ ${_html.style}
12104
12160
  }
12105
12161
  ]
12106
12162
  },
12107
- alignGroup(),
12163
+ alignItemsGroup(),
12108
12164
  paddingGroup(),
12109
12165
  backgroundGroup(),
12110
12166
  commonGroup()
12111
12167
  ],
12112
12168
  initialProperties: {
12113
- align: "center"
12169
+ alignItems: "center"
12114
12170
  },
12115
12171
  allowsChild: () => true,
12116
12172
  creator: () => _sfc_main$z
@@ -12127,9 +12183,9 @@ ${_html.style}
12127
12183
  ...defaultPropertyGroups()
12128
12184
  ],
12129
12185
  initialProperties: {
12130
- directionSm: "horizontal",
12131
- directionLg: "horizontal",
12132
- align: "center"
12186
+ direction: "horizontal",
12187
+ alignItems: "start",
12188
+ justifyContent: "start"
12133
12189
  },
12134
12190
  allowsChild: () => true,
12135
12191
  creator: () => _sfc_main$z
@@ -12146,9 +12202,9 @@ ${_html.style}
12146
12202
  ...defaultPropertyGroups()
12147
12203
  ],
12148
12204
  initialProperties: {
12149
- directionSm: "vertical",
12150
- directionLg: "vertical",
12151
- align: "center"
12205
+ direction: "vertical",
12206
+ alignItems: "start",
12207
+ justifyContent: "start"
12152
12208
  },
12153
12209
  allowsChild: () => true,
12154
12210
  creator: () => _sfc_main$B
@@ -12466,12 +12522,38 @@ ${_html.style}
12466
12522
  });
12467
12523
  };
12468
12524
  const findInsertTargetAndIndex = (pageBuilder, partType) => {
12469
- var _a;
12525
+ var _a, _b, _c;
12470
12526
  const selected = pageBuilder.context.getSelectedParts()[0];
12471
- pageBuilder.context.getSelectedPage();
12472
- const target = pageBuilder.partManager.findNearestAvailableParentPart(selected, partType);
12473
- 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;
12474
- return { target, index };
12527
+ const page = pageBuilder.context.getSelectedPage();
12528
+ if (!page) return {};
12529
+ if (partType === SECTION_TYPE) {
12530
+ const section = pageBuilder.partManager.findNearestSection(selected);
12531
+ return {
12532
+ target: page,
12533
+ index: section ? page.children.indexOf(section) + 1 : (_a = page.children) == null ? void 0 : _a.length
12534
+ };
12535
+ } else if (partType === BLOCK_TYPE) {
12536
+ let section = pageBuilder.partManager.findNearestSection(selected);
12537
+ let block = pageBuilder.partManager.findNearestBlock(selected);
12538
+ if (!section) {
12539
+ section = page.children[page.children.length - 1];
12540
+ }
12541
+ return {
12542
+ target: section,
12543
+ index: block ? section.children.indexOf(block) + 1 : (_b = section.children) == null ? void 0 : _b.length
12544
+ };
12545
+ } else {
12546
+ let block = pageBuilder.partManager.findNearestBlock(selected);
12547
+ let widget = selected.parent.isWidget() ? selected.parent : selected;
12548
+ if (!block) {
12549
+ const section = page.children[page.children.length - 1];
12550
+ block = section.children[section.children.length - 1];
12551
+ }
12552
+ return {
12553
+ target: block,
12554
+ index: widget ? block.children.indexOf(widget) + 1 : (_c = block.children) == null ? void 0 : _c.length
12555
+ };
12556
+ }
12475
12557
  };
12476
12558
  const createPartWithDefinition = (def, properties) => {
12477
12559
  const part = createPart(def.partType, def.partName, def.initialProperties);
@@ -12538,9 +12620,14 @@ ${_html.style}
12538
12620
  if (args && args.page) {
12539
12621
  addSectionToPage(pageBuilder, args.page);
12540
12622
  } else {
12541
- const def = pageBuilder.partManager.getSectionDefinition();
12542
- if (!def) return;
12543
- addPart(pageBuilder, def);
12623
+ const selected = pageBuilder.context.getSelectedParts()[0];
12624
+ if (selected && selected.isPage()) {
12625
+ addSectionToPage(pageBuilder, selected);
12626
+ } else {
12627
+ const def = pageBuilder.partManager.getSectionDefinition();
12628
+ if (!def) return;
12629
+ addPart(pageBuilder, def);
12630
+ }
12544
12631
  }
12545
12632
  }
12546
12633
  };
@@ -12932,11 +13019,20 @@ ${_html.style}
12932
13019
  __publicField(this, "caption", _DeletePartCommand.CAPTION);
12933
13020
  }
12934
13021
  execute(pageBuilder) {
12935
- const partIds = pageBuilder.context.getSelectedParts().map((part) => part.partId);
12936
- const param = {
12937
- delete: partIds
12938
- };
12939
- pageBuilder.model.updateModel(param);
13022
+ const selected = pageBuilder.context.getSelectedParts();
13023
+ if (selected.length === 0) return;
13024
+ let partIds;
13025
+ if (selected[0].isPage()) {
13026
+ const page = selected[0];
13027
+ const partsToDelete = page.children || [];
13028
+ if (partsToDelete.length === 0) return;
13029
+ partIds = partsToDelete.map((part) => part.partId);
13030
+ } else {
13031
+ partIds = selected.filter((part) => {
13032
+ return !selected.some((v) => part.isChildOf(v));
13033
+ }).map((part) => part.partId);
13034
+ }
13035
+ pageBuilder.model.updateModel({ delete: partIds });
12940
13036
  }
12941
13037
  };
12942
13038
  __publicField(_DeletePartCommand, "COMMAND_ID", "DeletePart");
@@ -12958,7 +13054,11 @@ ${_html.style}
12958
13054
  __publicField(this, "commandId", _CopyPartCommand.COMMAND_ID);
12959
13055
  }
12960
13056
  async execute(pageBuilder) {
12961
- const partIds = pageBuilder.context.getSelectedParts().map((part) => part.partId);
13057
+ const selected = pageBuilder.context.getSelectedParts();
13058
+ if (selected.length === 0) return;
13059
+ const partIds = selected.filter((part) => {
13060
+ return !selected.some((v) => part.isChildOf(v));
13061
+ }).map((part) => part.partId);
12962
13062
  if (partIds.length > 0) {
12963
13063
  const json = pageBuilder.model.serializeParts(partIds);
12964
13064
  await navigator.clipboard.writeText(json);
@@ -12983,13 +13083,14 @@ ${_html.style}
12983
13083
  __publicField(this, "commandId", _PastePartCommand.COMMAND_ID);
12984
13084
  }
12985
13085
  async execute(pageBuilder) {
13086
+ var _a;
12986
13087
  const json = await navigator.clipboard.readText();
12987
13088
  const object = JSON.parse(json);
12988
13089
  if (object.partType === ROOT_TYPE) {
12989
13090
  const rootPart = partFromJsonObject(object, true);
12990
13091
  if (!rootPart) throw new Error("Invalid data format");
12991
13092
  let partIdsToDelete = void 0;
12992
- if (pageBuilder.model.rootPart.children && pageBuilder.model.rootPart.children.length) {
13093
+ if ((_a = pageBuilder.model.rootPart.children) == null ? void 0 : _a.length) {
12993
13094
  partIdsToDelete = pageBuilder.model.rootPart.children.map((v) => v.partId);
12994
13095
  }
12995
13096
  const param = {
@@ -13003,13 +13104,88 @@ ${_html.style}
13003
13104
  ]
13004
13105
  };
13005
13106
  pageBuilder.model.updateModel(param);
13107
+ } else if (Array.isArray(object) && object[0] && object[0].partType === PAGE_TYPE) {
13108
+ const newPages = pageBuilder.model.parseParts(json);
13109
+ if (!newPages) throw new Error("Invalid data format");
13110
+ const newPage = newPages[0];
13111
+ const selectedPage = pageBuilder.context.getSelectedPage();
13112
+ if (!selectedPage) return;
13113
+ const pages = pageBuilder.model.rootPart.children;
13114
+ if (!pages) return;
13115
+ let index = 0;
13116
+ if (pages.length == 1) {
13117
+ newPage.properties = {
13118
+ ...newPage.properties || {},
13119
+ name: "Page"
13120
+ };
13121
+ } else if (selectedPage === pages[0]) {
13122
+ newPage.properties = {
13123
+ ...newPage.properties || {},
13124
+ name: "Page (Mobile)"
13125
+ };
13126
+ } else if (selectedPage === pages[1]) {
13127
+ newPage.properties = {
13128
+ ...newPage.properties || {},
13129
+ name: "Page (PC)"
13130
+ };
13131
+ index = 1;
13132
+ }
13133
+ const param = {
13134
+ delete: [selectedPage.partId],
13135
+ insert: [
13136
+ {
13137
+ partId: pageBuilder.model.getRootPartId(),
13138
+ index,
13139
+ parts: [newPage]
13140
+ }
13141
+ ]
13142
+ };
13143
+ pageBuilder.model.updateModel(param);
13006
13144
  } else {
13007
- const { target, index = 0 } = findInsertTargetAndIndex(pageBuilder);
13008
- if (target) {
13009
- const parts = pageBuilder.model.parseParts(json);
13010
- if (parts) {
13011
- insertParts(pageBuilder, target.partId, index, parts, false);
13145
+ const parts = pageBuilder.model.parseParts(json);
13146
+ if (!parts) return;
13147
+ let pasteType = "";
13148
+ parts.forEach((part) => {
13149
+ if (part.partType === SECTION_TYPE) pasteType = SECTION_TYPE;
13150
+ else if (part.partType === BLOCK_TYPE && (!pasteType || pasteType === WIDGET_TYPE)) pasteType = BLOCK_TYPE;
13151
+ else if (part.partType === WIDGET_TYPE && !pasteType) pasteType = WIDGET_TYPE;
13152
+ });
13153
+ if (!pasteType) return;
13154
+ const partsToInsert = parts.map((part) => {
13155
+ if (pasteType === SECTION_TYPE) {
13156
+ if (part.partType === SECTION_TYPE) {
13157
+ return part;
13158
+ } else if (part.partType === BLOCK_TYPE) {
13159
+ const section = createSection(pageBuilder);
13160
+ if (!section) return;
13161
+ section.children = [part];
13162
+ return section;
13163
+ } else {
13164
+ const block = createBlock(pageBuilder);
13165
+ if (!block) return;
13166
+ block.children = [part];
13167
+ const section = createSection(pageBuilder);
13168
+ if (!section) return;
13169
+ section.children = [block];
13170
+ return section;
13171
+ }
13172
+ } else if (pasteType === BLOCK_TYPE) {
13173
+ if (part.partType === BLOCK_TYPE) {
13174
+ return part;
13175
+ } else {
13176
+ const block = createBlock(pageBuilder);
13177
+ if (!block) return;
13178
+ block.children = [part];
13179
+ return block;
13180
+ }
13181
+ } else {
13182
+ return part;
13012
13183
  }
13184
+ }).filter(bluesea.notNull);
13185
+ const targetType = pasteType === SECTION_TYPE ? SECTION_TYPE : pasteType === BLOCK_TYPE ? BLOCK_TYPE : WIDGET_TYPE;
13186
+ const { target, index } = findInsertTargetAndIndex(pageBuilder, targetType);
13187
+ if (target && index !== void 0 && partsToInsert) {
13188
+ insertParts(pageBuilder, target.partId, index, partsToInsert, false);
13013
13189
  }
13014
13190
  }
13015
13191
  }
@@ -13385,6 +13561,7 @@ ${_html.style}
13385
13561
  }
13386
13562
  }
13387
13563
  addSelection(parts) {
13564
+ if (parts && !parts.length) return;
13388
13565
  parts.forEach((part) => this.selection.push(part));
13389
13566
  }
13390
13567
  removeSelection(parts) {
@@ -14261,7 +14438,6 @@ ${_html.style}
14261
14438
  const style = vue.computed(() => {
14262
14439
  var _a, _b;
14263
14440
  return {
14264
- // width: `${props.width || 420}px`,
14265
14441
  minHeight: ((_b = (_a = props.part) == null ? void 0 : _a.children) == null ? void 0 : _b.length) ? void 0 : "200px"
14266
14442
  };
14267
14443
  });
@@ -14282,7 +14458,7 @@ ${_html.style}
14282
14458
  const contextMenu = bluesea.useContextMenu();
14283
14459
  const handleClick = (event) => {
14284
14460
  if (event.button === 0) {
14285
- pageBuilder.context.clearSelection();
14461
+ pageBuilder.context.setSelection([props.part]);
14286
14462
  }
14287
14463
  };
14288
14464
  const showContextMenu = (event) => {
@@ -14335,8 +14511,8 @@ ${_html.style}
14335
14511
  };
14336
14512
  }
14337
14513
  });
14338
- const canvasStyle = '.pb-page-wrapper {\n margin: 0 auto;\n padding: 0;\n}\n\n.pb-page {\n width: 100%;\n margin: 0 auto;\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 width: 100%;\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 pointer-events: auto !important;\n}\n\n.pb-widget * {\n pointer-events: none;\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 pointer-events: auto !important;\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 pointer-events: auto !important;\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}';
14339
- const _hoisted_1$g = ["height", "width"];
14514
+ const canvasStyle = '.pb-page-wrapper {\n margin: 0 auto;\n padding: 0;\n}\n\n.pb-page {\n display: flex;\n flex-direction: column;\n margin: 0 auto;\n width: 100%;\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 display: flex;\n position: relative;\n width: 100%;\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 pointer-events: auto !important;\n}\n\n.pb-widget * {\n pointer-events: none;\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 pointer-events: auto !important;\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 pointer-events: auto !important;\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}';
14515
+ const _hoisted_1$g = ["width"];
14340
14516
  const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
14341
14517
  __name: "PbPageFrame",
14342
14518
  props: {
@@ -14397,35 +14573,41 @@ ${_html.style}
14397
14573
  }
14398
14574
  );
14399
14575
  const width = vue.ref(props.width);
14400
- const height = vue.ref(200);
14576
+ vue.ref(200);
14401
14577
  const isMobilePage = vue.computed(() => width.value <= 768);
14402
14578
  const style = vue.computed(() => ({
14403
14579
  // width: `${width.value}px`,
14404
14580
  // height: `${height.value}px`,
14405
14581
  }));
14406
14582
  let resizeObserver;
14583
+ let mutationObserver;
14407
14584
  const updateIframeHeight = () => {
14408
- setTimeout(() => {
14585
+ requestAnimationFrame(() => {
14409
14586
  if (!iframeRef.value || !iframeRef.value.contentDocument) return;
14410
14587
  const iframeBody = iframeRef.value.contentDocument.body;
14411
14588
  if (iframeBody) {
14412
- height.value = iframeBody.scrollHeight;
14589
+ iframeRef.value.style.height = "1px";
14590
+ const newHeight = iframeBody.scrollHeight;
14591
+ iframeRef.value.style.height = `${newHeight}px`;
14413
14592
  }
14414
- }, 100);
14593
+ });
14415
14594
  };
14416
14595
  vue.onMounted(() => {
14417
14596
  if (!iframeRef.value || !iframeRef.value.contentDocument) return;
14418
14597
  const iframeBody = iframeRef.value.contentDocument.body;
14419
- resizeObserver = new ResizeObserver(() => {
14420
- updateIframeHeight();
14421
- });
14598
+ resizeObserver = new ResizeObserver(updateIframeHeight);
14422
14599
  resizeObserver.observe(iframeBody, {});
14600
+ mutationObserver = new MutationObserver(updateIframeHeight);
14601
+ mutationObserver.observe(iframeBody, { childList: true, subtree: true });
14423
14602
  iframeRef.value.onload = updateIframeHeight;
14424
14603
  });
14425
14604
  vue.onBeforeUnmount(() => {
14426
14605
  if (resizeObserver) {
14427
14606
  resizeObserver.disconnect();
14428
14607
  }
14608
+ if (mutationObserver) {
14609
+ mutationObserver.disconnect();
14610
+ }
14429
14611
  });
14430
14612
  return (_ctx, _cache) => {
14431
14613
  var _a, _b, _c, _d;
@@ -14447,7 +14629,6 @@ ${_html.style}
14447
14629
  vue.createElementVNode("iframe", {
14448
14630
  ref_key: "iframeRef",
14449
14631
  ref: iframeRef,
14450
- height: `${height.value}px`,
14451
14632
  style: vue.normalizeStyle(style.value),
14452
14633
  width: `${width.value}px`,
14453
14634
  class: "page-frame mt-12"