@g1cloud/page-builder-editor 1.0.0-alpha.26 → 1.0.0-alpha.28

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.
@@ -6687,18 +6687,19 @@ class Part {
6687
6687
  if (align === "right") return "flex-end";
6688
6688
  return "center";
6689
6689
  }
6690
- getStyles() {
6690
+ getStyles(isMobilePage) {
6691
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;
6692
6692
  const style = {};
6693
6693
  const align = ((_a = this.properties) == null ? void 0 : _a.align) || "center";
6694
6694
  if (this.isWidget()) {
6695
6695
  style.alignSelf = this.getAlignStyleValue(align);
6696
6696
  } else {
6697
- if (((_b = this.properties) == null ? void 0 : _b.direction) === "horizontal") {
6697
+ const direction = isMobilePage ? (_b = this.properties) == null ? void 0 : _b.directionSm : (_c = this.properties) == null ? void 0 : _c.directionLg;
6698
+ if (direction === "horizontal") {
6698
6699
  style.display = "flex";
6699
6700
  style.flexDirection = "row";
6700
6701
  style.justifyContent = this.getAlignStyleValue(align);
6701
- } else if (((_c = this.properties) == null ? void 0 : _c.direction) === "vertical") {
6702
+ } else if (direction === "vertical") {
6702
6703
  style.display = "flex";
6703
6704
  style.flexDirection = "column";
6704
6705
  style.alignItems = this.getAlignStyleValue(align);
@@ -6852,7 +6853,7 @@ const _sfc_main$c$1 = /* @__PURE__ */ defineComponent({
6852
6853
  },
6853
6854
  setup(__props) {
6854
6855
  const props = __props;
6855
- const className = computed(() => getPartClassName(props.part));
6856
+ const classNames = computed(() => [getPartClassName(props.part), props.part.getClassNames()]);
6856
6857
  const styleTag = computed(() => props.part.getStyleTag());
6857
6858
  const style = computed(() => ({
6858
6859
  ...props.part.getStyles(),
@@ -6866,7 +6867,7 @@ const _sfc_main$c$1 = /* @__PURE__ */ defineComponent({
6866
6867
  innerHTML: styleTag.value
6867
6868
  }, null, 8, ["innerHTML"])) : createCommentVNode("", true),
6868
6869
  createElementVNode("div", {
6869
- class: normalizeClass([className.value, "pb-widget"]),
6870
+ class: normalizeClass([classNames.value, "pb-widget"]),
6870
6871
  "data-part-id": _ctx.part.partId,
6871
6872
  style: normalizeStyle(style.value)
6872
6873
  }, [
@@ -6883,14 +6884,15 @@ const _hoisted_1$a$1 = ["data-part-id"];
6883
6884
  const _sfc_main$b$1 = /* @__PURE__ */ defineComponent({
6884
6885
  __name: "PbBlock",
6885
6886
  props: {
6886
- part: {}
6887
+ part: {},
6888
+ isMobilePage: { type: Boolean }
6887
6889
  },
6888
6890
  setup(__props) {
6889
6891
  const props = __props;
6890
- const classNames = computed(() => props.part.getClassNames());
6892
+ const classNames = computed(() => [getPartClassName(props.part), props.part.getClassNames()]);
6891
6893
  const styleTag = computed(() => props.part.getStyleTag());
6892
6894
  const style = computed(() => ({
6893
- ...props.part.getStyles(),
6895
+ ...props.part.getStyles(props.isMobilePage),
6894
6896
  ...props.part.getInlineStyles()
6895
6897
  }));
6896
6898
  computed(() => createPartComponents(props.part.children));
@@ -6941,14 +6943,15 @@ const _hoisted_1$8$1 = ["data-part-id"];
6941
6943
  const _sfc_main$9$1 = /* @__PURE__ */ defineComponent({
6942
6944
  __name: "PbSection",
6943
6945
  props: {
6944
- part: {}
6946
+ part: {},
6947
+ isMobilePage: { type: Boolean }
6945
6948
  },
6946
6949
  setup(__props) {
6947
6950
  const props = __props;
6948
- const classNames = computed(() => props.part.getClassNames());
6951
+ const classNames = computed(() => [getPartClassName(props.part), props.part.getClassNames()]);
6949
6952
  const styleTag = computed(() => props.part.getStyleTag());
6950
6953
  const style = computed(() => ({
6951
- ...props.part.getStyles(),
6954
+ ...props.part.getStyles(props.isMobilePage),
6952
6955
  ...props.part.getInlineStyles()
6953
6956
  }));
6954
6957
  return (_ctx, _cache) => {
@@ -6969,8 +6972,9 @@ const _sfc_main$9$1 = /* @__PURE__ */ defineComponent({
6969
6972
  }, null, 8, ["part"])) : _ctx.part.children && _ctx.part.children.length > 0 ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(_ctx.part.children, (block) => {
6970
6973
  return openBlock(), createBlock$1(_sfc_main$b$1, {
6971
6974
  key: block.partId,
6975
+ "is-mobile-page": _ctx.isMobilePage,
6972
6976
  part: block
6973
- }, null, 8, ["part"]);
6977
+ }, null, 8, ["is-mobile-page", "part"]);
6974
6978
  }), 128)) : createCommentVNode("", true)
6975
6979
  ], 14, _hoisted_1$8$1)
6976
6980
  ], 64);
@@ -7403,13 +7407,10 @@ const _sfc_main$3$1 = /* @__PURE__ */ defineComponent({
7403
7407
  },
7404
7408
  setup(__props) {
7405
7409
  const props = __props;
7406
- const classNames = computed(() => {
7407
- var _a;
7408
- return `${(_a = props.part) == null ? void 0 : _a.getClassNames()} ${props.isMobilePage ? "mobile" : "pc"}`;
7409
- });
7410
+ const classNames = computed(() => [getPartClassName(props.part), props.part.getClassNames(), props.isMobilePage ? "mobile" : "pc"]);
7410
7411
  const styleTag = computed(() => props.part.getStyleTag());
7411
7412
  const style = computed(() => ({
7412
- ...props.part.getStyles(),
7413
+ ...props.part.getStyles(props.isMobilePage),
7413
7414
  ...props.part.getInlineStyles()
7414
7415
  }));
7415
7416
  return (_ctx, _cache) => {
@@ -7429,8 +7430,9 @@ const _sfc_main$3$1 = /* @__PURE__ */ defineComponent({
7429
7430
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.part.children, (section) => {
7430
7431
  return openBlock(), createBlock$1(_sfc_main$9$1, {
7431
7432
  key: section.partId,
7433
+ "is-mobile-page": _ctx.isMobilePage,
7432
7434
  part: section
7433
- }, null, 8, ["part"]);
7435
+ }, null, 8, ["is-mobile-page", "part"]);
7434
7436
  }), 128))
7435
7437
  ], 2)
7436
7438
  ], 14, _hoisted_1$2$1)
@@ -8129,13 +8131,13 @@ class PartManager {
8129
8131
  const defaultPartPropertyEditors = () => {
8130
8132
  return {
8131
8133
  "readonly-text": () => defineAsyncComponent(() => import("./PbPropertyEditorReadonlyText-Dgp_AVOD.js")),
8132
- "text": () => defineAsyncComponent(() => import("./PbPropertyEditorText-CQwH7v7k.js")),
8133
- "multiline-text": () => defineAsyncComponent(() => import("./PbPropertyEditorMultilineText-Bnro6dbg.js")),
8134
+ "text": () => defineAsyncComponent(() => import("./PbPropertyEditorText-B19310oG.js")),
8135
+ "multiline-text": () => defineAsyncComponent(() => import("./PbPropertyEditorMultilineText-BjnxPdTc.js")),
8134
8136
  "select": () => defineAsyncComponent(() => import("./PbPropertyEditorSelect-CWedbXJI.js")),
8135
- "color": () => defineAsyncComponent(() => import("./PbPropertyEditorColor-6nHFFcG2.js")),
8136
- "image": () => defineAsyncComponent(() => import("./PbPropertyEditorImage-D47dKq2n.js")),
8137
- "html": () => defineAsyncComponent(() => import("./PbPropertyEditorHtml-BeIgPnp1.js")),
8138
- "youtube": () => defineAsyncComponent(() => import("./PbPropertyEditorYoutube-sa28xTeJ.js"))
8137
+ "color": () => defineAsyncComponent(() => import("./PbPropertyEditorColor-Ph16JiGf.js")),
8138
+ "image": () => defineAsyncComponent(() => import("./PbPropertyEditorImage-6ebH3rsd.js")),
8139
+ "html": () => defineAsyncComponent(() => import("./PbPropertyEditorHtml-BQ9llP6f.js")),
8140
+ "youtube": () => defineAsyncComponent(() => import("./PbPropertyEditorYoutube-DJlDigCR.js"))
8139
8141
  };
8140
8142
  };
8141
8143
  const getPropertyValueOfParts = (parts, propertyName) => {
@@ -8374,6 +8376,13 @@ const locateRight = (style, top, height) => {
8374
8376
  style.width = "20px";
8375
8377
  style.height = height || "";
8376
8378
  };
8379
+ const getLayoutDirection = (isMobilePage, properties) => {
8380
+ if (isMobilePage) {
8381
+ return properties && properties.directionSm || "vertical";
8382
+ } else {
8383
+ return properties && properties.directionLg || "horizontal";
8384
+ }
8385
+ };
8377
8386
  const _export_sfc = (sfc, props) => {
8378
8387
  const target = sfc.__vccOpts || sfc;
8379
8388
  for (const [key, val] of props) {
@@ -8425,7 +8434,8 @@ const _hoisted_1$r = ["data-part-id", "draggable"];
8425
8434
  const _sfc_main$o = /* @__PURE__ */ defineComponent({
8426
8435
  __name: "PbWidget",
8427
8436
  props: {
8428
- part: {}
8437
+ part: {},
8438
+ isMobilePage: { type: Boolean }
8429
8439
  },
8430
8440
  setup(__props) {
8431
8441
  const mouseTracker = useMouseTracker();
@@ -8509,11 +8519,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
8509
8519
  placeholder: true
8510
8520
  };
8511
8521
  });
8512
- const thisComponent = computed(() => pageBuilder.partManager.createPartComponent(props.part));
8513
- computed(() => pageBuilder.partManager.createPartComponents(props.part.children));
8514
- const droppable = computed(() => {
8515
- return pageBuilder.partManager.isChildAllowed(props.part);
8516
- });
8522
+ const component = computed(() => pageBuilder.partManager.createPartComponent(props.part));
8517
8523
  const locatePositionMark = (mark, target, mouseOffsetX, mouseOffsetY, draggingPart2, event) => {
8518
8524
  if (props.part.isNestedWidget()) {
8519
8525
  if (draggingPart2.isWidget())
@@ -8528,7 +8534,6 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
8528
8534
  locateWidget(mark, target, mouseOffsetX, mouseOffsetY, draggingPart2);
8529
8535
  };
8530
8536
  const locateSection = (mark, target, mouseOffsetX, mouseOffsetY, draggingPart2, event) => {
8531
- var _a, _b, _c;
8532
8537
  mark.style.background = "#e67e22";
8533
8538
  const widget2 = props.part;
8534
8539
  const widgetElement = target;
@@ -8543,8 +8548,10 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
8543
8548
  const isFirstBlock = blockIndex === 0;
8544
8549
  const isLastBlock = blockIndex === section.children.length - 1;
8545
8550
  const centerY = widgetElement.offsetHeight / 2;
8546
- if (((_a = section.properties) == null ? void 0 : _a.direction) === "vertical") {
8547
- if (((_b = block.properties) == null ? void 0 : _b.direction) === "vertical") {
8551
+ const sectionDirection = getLayoutDirection(props.isMobilePage, section.properties);
8552
+ const blockDirection = getLayoutDirection(props.isMobilePage, block.properties);
8553
+ if (sectionDirection === "vertical") {
8554
+ if (blockDirection === "vertical") {
8548
8555
  if (isFirstBlock && isFirstWidget && mouseOffsetY <= centerY)
8549
8556
  locateTop(mark.style);
8550
8557
  else if (isLastBlock && isLastWidget && mouseOffsetY > centerY)
@@ -8560,7 +8567,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
8560
8567
  locateNone(mark.style);
8561
8568
  }
8562
8569
  } else {
8563
- if (((_c = block.properties) == null ? void 0 : _c.direction) === "vertical") {
8570
+ if (blockDirection === "vertical") {
8564
8571
  if (isFirstWidget && mouseOffsetY <= centerY)
8565
8572
  locateTop(mark.style, `-${blockElement.offsetLeft + widgetElement.offsetLeft}px`, `${sectionElement.offsetWidth}px`);
8566
8573
  else if (isLastWidget && mouseOffsetY > centerY)
@@ -8576,7 +8583,6 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
8576
8583
  }
8577
8584
  };
8578
8585
  const locateBlock = (mark, target, mouseOffsetX, mouseOffsetY, draggingPart2, event) => {
8579
- var _a, _b, _c;
8580
8586
  mark.style.background = "#8e44ad";
8581
8587
  const widgetElement = target;
8582
8588
  const block = props.part.parent;
@@ -8585,9 +8591,12 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
8585
8591
  const isFirstWidget = widgetIndex === 0;
8586
8592
  const isLastWidget = widgetIndex === block.children.length - 1;
8587
8593
  const section = block.parent;
8588
- if (((_a = section.properties) == null ? void 0 : _a.direction) === "vertical") {
8594
+ const sectionDirection = getLayoutDirection(props.isMobilePage, section.properties);
8595
+ const blockDirection = getLayoutDirection(props.isMobilePage, block.properties);
8596
+ console.log(sectionDirection, blockDirection);
8597
+ if (sectionDirection === "vertical") {
8589
8598
  const centerY = widgetElement.offsetHeight / 2;
8590
- if (((_b = block.properties) == null ? void 0 : _b.direction) === "vertical") {
8599
+ if (blockDirection === "vertical") {
8591
8600
  if (isFirstWidget && mouseOffsetY <= centerY)
8592
8601
  locateTop(mark.style);
8593
8602
  else if (isLastWidget && mouseOffsetY > centerY)
@@ -8602,7 +8611,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
8602
8611
  }
8603
8612
  } else {
8604
8613
  const centerX = widgetElement.offsetWidth / 2;
8605
- if (((_c = block.properties) == null ? void 0 : _c.direction) === "vertical") {
8614
+ if (blockDirection === "vertical") {
8606
8615
  if (mouseOffsetX <= centerX)
8607
8616
  locateLeft(mark.style, `-${widgetElement.offsetTop}px`, `${blockElement.offsetHeight}px`);
8608
8617
  else
@@ -8618,8 +8627,11 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
8618
8627
  }
8619
8628
  };
8620
8629
  const locateWidget = (mark, target, mouseOffsetX, mouseOffsetY, draggingPart2, event) => {
8621
- var _a, _b, _c;
8622
- if (draggingPart2.partId === props.part.partId && !props.part.isNestedWidget()) return;
8630
+ var _a;
8631
+ if (props.part.isNestedWidget()) {
8632
+ locateNone(mark.style);
8633
+ return;
8634
+ }
8623
8635
  mark.style.background = "#27ae60";
8624
8636
  const isNestedWidget = props.part.isNestedWidget();
8625
8637
  const widget2 = isNestedWidget ? props.part.parent : props.part;
@@ -8629,25 +8641,26 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
8629
8641
  const centerY = widgetElement.offsetHeight / 2;
8630
8642
  const quaterX = centerX / 2;
8631
8643
  const quaterY = centerY / 2;
8644
+ const blockDirection = getLayoutDirection(props.isMobilePage, block.properties);
8632
8645
  if (!((_a = draggingPart2.children) == null ? void 0 : _a.length)) {
8633
- if (((_b = block.properties) == null ? void 0 : _b.direction) === "vertical") {
8646
+ if (blockDirection === "vertical") {
8634
8647
  if (mouseOffsetY <= quaterY)
8635
8648
  locateTop(mark.style);
8636
8649
  else if (mouseOffsetY > quaterY * 3)
8637
8650
  locateBottom(mark.style);
8638
- else
8651
+ else if (pageBuilder.partManager.isChildAllowed(props.part))
8639
8652
  locateCenter(mark.style);
8640
8653
  } else {
8641
8654
  if (mouseOffsetX <= quaterX)
8642
8655
  locateLeft(mark.style);
8643
8656
  else if (mouseOffsetX > quaterX * 3)
8644
8657
  locateRight(mark.style);
8645
- else
8658
+ else if (pageBuilder.partManager.isChildAllowed(props.part))
8646
8659
  locateCenter(mark.style);
8647
8660
  }
8648
8661
  return;
8649
8662
  }
8650
- if (((_c = block.properties) == null ? void 0 : _c.direction) === "vertical") {
8663
+ if (blockDirection === "vertical") {
8651
8664
  if (mouseOffsetY <= centerY)
8652
8665
  locateTop(mark.style);
8653
8666
  else
@@ -8660,17 +8673,13 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
8660
8673
  }
8661
8674
  };
8662
8675
  const acceptChildPart = (pageBuilder2, part, target, _index, partId, event) => {
8663
- if (partId === props.part.partId && !props.part.isNestedWidget()) return;
8676
+ if (partId === props.part.partId) return;
8677
+ if (props.part.isNestedWidget()) return;
8664
8678
  const droppedPart = pageBuilder2.model.findPartById(partId);
8665
8679
  if (!droppedPart) return;
8666
8680
  const targetRect = target.getBoundingClientRect();
8667
8681
  const mouseOffsetX = event.clientX - targetRect.left;
8668
8682
  const mouseOffsetY = event.clientY - targetRect.top;
8669
- if (props.part.isNestedWidget()) {
8670
- if (droppedPart.isWidget())
8671
- acceptWidget(pageBuilder2, target, droppedPart, mouseOffsetX, mouseOffsetY);
8672
- return;
8673
- }
8674
8683
  if (droppedPart.isSection())
8675
8684
  acceptSection(pageBuilder2, target, droppedPart, mouseOffsetX, mouseOffsetY);
8676
8685
  else if (droppedPart.isBlock())
@@ -8679,7 +8688,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
8679
8688
  acceptWidget(pageBuilder2, target, droppedPart, mouseOffsetX, mouseOffsetY);
8680
8689
  };
8681
8690
  const acceptSection = (pageBuilder2, target, droppedPart, mouseOffsetX, mouseOffsetY) => {
8682
- var _a, _b, _c, _d;
8691
+ var _a;
8683
8692
  const widget2 = props.part;
8684
8693
  const widgetElement = target;
8685
8694
  const block = widget2.parent;
@@ -8693,8 +8702,10 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
8693
8702
  const centerY = widgetElement.offsetHeight / 2;
8694
8703
  const page = section.parent;
8695
8704
  let index;
8696
- if (((_a = section.properties) == null ? void 0 : _a.direction) === "vertical") {
8697
- if (((_b = block.properties) == null ? void 0 : _b.direction) === "vertical") {
8705
+ const sectionDirection = getLayoutDirection(props.isMobilePage, section.properties);
8706
+ const blockDirection = getLayoutDirection(props.isMobilePage, block.properties);
8707
+ if (sectionDirection === "vertical") {
8708
+ if (blockDirection === "vertical") {
8698
8709
  if (isFirstBlock && isFirstWidget && mouseOffsetY <= centerY) index = blockIndex;
8699
8710
  else if (isLastBlock && isLastWidget && mouseOffsetY > centerY) index = blockIndex + 1;
8700
8711
  else return;
@@ -8704,7 +8715,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
8704
8715
  else return;
8705
8716
  }
8706
8717
  } else {
8707
- if (((_c = block.properties) == null ? void 0 : _c.direction) === "vertical") {
8718
+ if (blockDirection === "vertical") {
8708
8719
  if (isFirstWidget && mouseOffsetY <= centerY) index = blockIndex;
8709
8720
  else if (isLastWidget && mouseOffsetY > centerY) index = blockIndex + 1;
8710
8721
  else return;
@@ -8713,11 +8724,11 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
8713
8724
  else index = blockIndex + 1;
8714
8725
  }
8715
8726
  }
8716
- if (((_d = page.children) == null ? void 0 : _d.indexOf(droppedPart)) === index) return;
8727
+ if (((_a = page.children) == null ? void 0 : _a.indexOf(droppedPart)) === index) return;
8717
8728
  pageBuilder2.model.moveElements(droppedPart.partId, section.partId, index);
8718
8729
  };
8719
8730
  const acceptBlock = (pageBuilder2, target, droppedPart, mouseOffsetX, mouseOffsetY) => {
8720
- var _a, _b, _c, _d;
8731
+ var _a;
8721
8732
  const widget2 = props.part;
8722
8733
  const widgetElement = target;
8723
8734
  const block = widget2.parent;
@@ -8727,9 +8738,11 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
8727
8738
  const section = block.parent;
8728
8739
  let blockIndex = section.children.indexOf(block) || 0;
8729
8740
  let index;
8730
- if (((_a = section.properties) == null ? void 0 : _a.direction) === "vertical") {
8741
+ const sectionDirection = getLayoutDirection(props.isMobilePage, section.properties);
8742
+ const blockDirection = getLayoutDirection(props.isMobilePage, block.properties);
8743
+ if (sectionDirection === "vertical") {
8731
8744
  const centerY = widgetElement.offsetHeight / 2;
8732
- if (((_b = block.properties) == null ? void 0 : _b.direction) === "vertical") {
8745
+ if (blockDirection === "vertical") {
8733
8746
  if (isFirstWidget && mouseOffsetY <= centerY) index = blockIndex;
8734
8747
  else if (isLastWidget && mouseOffsetY > centerY) index = blockIndex + 1;
8735
8748
  else return;
@@ -8739,7 +8752,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
8739
8752
  }
8740
8753
  } else {
8741
8754
  const centerX = widgetElement.offsetWidth / 2;
8742
- if (((_c = block.properties) == null ? void 0 : _c.direction) === "vertical") {
8755
+ if (blockDirection === "vertical") {
8743
8756
  if (mouseOffsetX <= centerX) index = blockIndex;
8744
8757
  else index = blockIndex + 1;
8745
8758
  } else {
@@ -8748,11 +8761,10 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
8748
8761
  else return;
8749
8762
  }
8750
8763
  }
8751
- if (((_d = section.children) == null ? void 0 : _d.indexOf(droppedPart)) === index) return;
8764
+ if (((_a = section.children) == null ? void 0 : _a.indexOf(droppedPart)) === index) return;
8752
8765
  pageBuilder2.model.moveElements(droppedPart.partId, section.partId, index);
8753
8766
  };
8754
8767
  const acceptWidget = (pageBuilder2, target, droppedPart, mouseOffsetX, mouseOffsetY) => {
8755
- var _a, _b, _c, _d, _e, _f, _g;
8756
8768
  const isNestedWidget = props.part.isNestedWidget();
8757
8769
  const widget2 = isNestedWidget ? props.part.parent : props.part;
8758
8770
  const block = widget2.parent;
@@ -8762,73 +8774,64 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
8762
8774
  const quaterX = centerX / 2;
8763
8775
  const quaterY = centerY / 2;
8764
8776
  let index;
8765
- if (!((_a = droppedPart.children) == null ? void 0 : _a.length)) {
8766
- if (((_b = block.properties) == null ? void 0 : _b.direction) === "vertical") {
8767
- if (mouseOffsetY <= quaterY) {
8768
- index = widgetIndex;
8769
- } else if (mouseOffsetY > quaterY * 3) {
8770
- index = widgetIndex + 1;
8771
- } else {
8772
- index = ((_c = widget2.children) == null ? void 0 : _c.length) || 0;
8773
- if (((_d = widget2.children) == null ? void 0 : _d.indexOf(droppedPart)) === index) return;
8774
- const update2 = [{
8775
- partId: droppedPart.partId,
8776
- properties: {
8777
- left: "25%",
8778
- top: "25%",
8779
- width: "50%"
8780
- }
8781
- }];
8782
- pageBuilder2.model.moveElements(droppedPart.partId, widget2.partId, index, update2);
8783
- return;
8784
- }
8777
+ const blockDirection = getLayoutDirection(props.isMobilePage, block.properties);
8778
+ if (blockDirection === "vertical") {
8779
+ if (mouseOffsetY <= quaterY) {
8780
+ index = widgetIndex;
8781
+ } else if (mouseOffsetY > quaterY * 3) {
8782
+ index = widgetIndex + 1;
8785
8783
  } else {
8786
- if (mouseOffsetX <= quaterX) {
8787
- index = widgetIndex;
8788
- } else if (mouseOffsetX > quaterX * 3) {
8789
- index = widgetIndex + 1;
8790
- } else {
8791
- index = ((_e = widget2.children) == null ? void 0 : _e.length) || 0;
8792
- if (((_f = widget2.children) == null ? void 0 : _f.indexOf(droppedPart)) === index) return;
8793
- const update2 = [{
8794
- partId: droppedPart.partId,
8795
- properties: {
8796
- left: "25%",
8797
- top: "25%",
8798
- width: "50%"
8799
- }
8800
- }];
8801
- pageBuilder2.model.moveElements(droppedPart.partId, widget2.partId, index, update2);
8802
- return;
8784
+ if (pageBuilder2.partManager.isChildAllowed(props.part)) {
8785
+ acceptWidgetInside(widget2, droppedPart, pageBuilder2);
8803
8786
  }
8787
+ return;
8804
8788
  }
8805
8789
  } else {
8806
- if (((_g = block.properties) == null ? void 0 : _g.direction) === "vertical") {
8807
- index = mouseOffsetY <= centerY ? widgetIndex : widgetIndex + 1;
8790
+ if (mouseOffsetX <= quaterX) {
8791
+ index = widgetIndex;
8792
+ } else if (mouseOffsetX > quaterX * 3) {
8793
+ index = widgetIndex + 1;
8808
8794
  } else {
8809
- index = mouseOffsetX <= centerX ? widgetIndex : widgetIndex + 1;
8795
+ if (pageBuilder2.partManager.isChildAllowed(props.part)) {
8796
+ acceptWidgetInside(widget2, droppedPart, pageBuilder2);
8797
+ }
8798
+ return;
8810
8799
  }
8811
8800
  }
8812
8801
  if (block.children.indexOf(droppedPart) === index) return;
8813
8802
  const update = [{
8814
8803
  partId: droppedPart.partId,
8815
- properties: {
8804
+ properties: droppedPart.isNestedWidget() ? {
8816
8805
  left: "",
8817
8806
  top: "",
8818
8807
  width: "",
8819
8808
  height: ""
8820
- }
8809
+ } : {}
8821
8810
  }];
8822
8811
  pageBuilder2.model.moveElements(droppedPart.partId, block.partId, index, update);
8823
8812
  };
8813
+ const acceptWidgetInside = (widget2, droppedPart, pageBuilder2) => {
8814
+ var _a, _b;
8815
+ const index = ((_a = widget2.children) == null ? void 0 : _a.length) || 0;
8816
+ if (((_b = widget2.children) == null ? void 0 : _b.indexOf(droppedPart)) !== index) {
8817
+ const update = [{
8818
+ partId: droppedPart.partId,
8819
+ properties: {
8820
+ left: "25%",
8821
+ top: "25%",
8822
+ width: "50%"
8823
+ }
8824
+ }];
8825
+ pageBuilder2.model.moveElements(droppedPart.partId, widget2.partId, index, update);
8826
+ }
8827
+ };
8824
8828
  const calculateDropIndex = (part, target, mouseOffsetX, mouseOffsetY, _event) => {
8825
- var _a;
8826
8829
  if (!part.children || part.children.length === 0) return 0;
8827
8830
  const children = Array.from(target.children).filter((child) => !isPositionMark(child)).map((child) => child);
8828
- const dir = ((_a = props.part.properties) == null ? void 0 : _a.direction) || "vertical";
8831
+ const direction = getLayoutDirection(props.isMobilePage, props.part.properties);
8829
8832
  let index = 0;
8830
8833
  for (const child of children) {
8831
- if (dir === "horizontal") {
8834
+ if (direction === "horizontal") {
8832
8835
  const centerX = child.offsetLeft + child.offsetWidth / 2;
8833
8836
  if (mouseOffsetX <= centerX) return index;
8834
8837
  } else {
@@ -8853,7 +8856,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
8853
8856
  draggable: draggable.value,
8854
8857
  style: normalizeStyle(style.value)
8855
8858
  }, [
8856
- thisComponent.value ? (openBlock(), createBlock$1(resolveDynamicComponent(thisComponent.value), normalizeProps(mergeProps({ key: 0 }, bind.value)), null, 16)) : createCommentVNode("", true),
8859
+ component.value ? (openBlock(), createBlock$1(resolveDynamicComponent(component.value), normalizeProps(mergeProps({ key: 0 }, bind.value)), null, 16)) : createCommentVNode("", true),
8857
8860
  selected.value && _ctx.part.isNestedWidget() ? (openBlock(), createElementBlock("div", {
8858
8861
  key: 1,
8859
8862
  class: "pan-handle",
@@ -8865,7 +8868,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
8865
8868
  onMousedown: resizeChild
8866
8869
  }, null, 32)) : createCommentVNode("", true)
8867
8870
  ], 14, _hoisted_1$r)), [
8868
- [unref(vPartHandler), { pageBuilder: unref(pageBuilder), part: _ctx.part, droppable: droppable.value, locatePositionMark, calculateDropIndex, acceptChildPart }]
8871
+ [unref(vPartHandler), { pageBuilder: unref(pageBuilder), part: _ctx.part, droppable: true, locatePositionMark, calculateDropIndex, acceptChildPart }]
8869
8872
  ])
8870
8873
  ], 64);
8871
8874
  };
@@ -8875,7 +8878,8 @@ const _hoisted_1$q = ["data-part-id"];
8875
8878
  const _sfc_main$n = /* @__PURE__ */ defineComponent({
8876
8879
  __name: "PbBlock",
8877
8880
  props: {
8878
- part: {}
8881
+ part: {},
8882
+ isMobilePage: { type: Boolean }
8879
8883
  },
8880
8884
  setup(__props) {
8881
8885
  const props = __props;
@@ -8888,7 +8892,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
8888
8892
  const styleTag = computed(() => props.part.getStyleTag());
8889
8893
  const properties = computed(() => ({
8890
8894
  style: {
8891
- ...props.part.getStyles(),
8895
+ ...props.part.getStyles(props.isMobilePage),
8892
8896
  ...props.part.getInlineStyles()
8893
8897
  }
8894
8898
  }));
@@ -8907,7 +8911,6 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
8907
8911
  locateNone(mark.style);
8908
8912
  };
8909
8913
  const locateSection = (mark, target, mouseOffsetX, mouseOffsetY, draggingPart2, event) => {
8910
- var _a;
8911
8914
  mark.style.background = "#e67e22";
8912
8915
  const section = props.part.parent;
8913
8916
  const sectionElement = target.parentElement;
@@ -8915,7 +8918,8 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
8915
8918
  const isFirstBlock = index === 0;
8916
8919
  const isLastBlock = index === section.children.length - 1;
8917
8920
  const centerY = target.offsetHeight / 2;
8918
- if (((_a = section.properties) == null ? void 0 : _a.direction) === "vertical") {
8921
+ const sectionDirection = getLayoutDirection(props.isMobilePage, section.properties);
8922
+ if (sectionDirection === "vertical") {
8919
8923
  if (isFirstBlock && mouseOffsetY <= centerY)
8920
8924
  locateTop(mark.style);
8921
8925
  else if (isLastBlock && mouseOffsetY > centerY)
@@ -8930,12 +8934,12 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
8930
8934
  }
8931
8935
  };
8932
8936
  const locateBlock = (mark, target, mouseOffsetX, mouseOffsetY, draggingPart2, event) => {
8933
- var _a;
8934
8937
  mark.style.background = "#8e44ad";
8935
8938
  const block = props.part;
8936
8939
  const blockElement = target;
8937
8940
  const section = block.parent;
8938
- if (((_a = section.properties) == null ? void 0 : _a.direction) === "vertical") {
8941
+ const sectionDirection = getLayoutDirection(props.isMobilePage, section.properties);
8942
+ if (sectionDirection === "vertical") {
8939
8943
  const centerY = blockElement.offsetHeight / 2;
8940
8944
  if (mouseOffsetY <= centerY)
8941
8945
  locateTop(mark.style);
@@ -8972,7 +8976,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
8972
8976
  acceptWidget(pageBuilder2, target, droppedPart);
8973
8977
  };
8974
8978
  const acceptSection = (pageBuilder2, target, droppedPart, mouseOffsetX, mouseOffsetY) => {
8975
- var _a, _b;
8979
+ var _a;
8976
8980
  const block = props.part;
8977
8981
  const blockElement = target;
8978
8982
  const section = block.parent;
@@ -8982,8 +8986,9 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
8982
8986
  const isLastBlock = blockIndex === section.children.length - 1;
8983
8987
  let sectionIndex = page.children.indexOf(section) || 0;
8984
8988
  let index;
8989
+ const sectionDirection = getLayoutDirection(props.isMobilePage, section.properties);
8985
8990
  const centerY = blockElement.offsetHeight / 2;
8986
- if (((_a = section.properties) == null ? void 0 : _a.direction) === "vertical") {
8991
+ if (sectionDirection === "vertical") {
8987
8992
  if (isFirstBlock && mouseOffsetY <= centerY) index = sectionIndex;
8988
8993
  else if (isLastBlock && mouseOffsetY > centerY) index = sectionIndex + 1;
8989
8994
  else return;
@@ -8991,16 +8996,16 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
8991
8996
  if (mouseOffsetY <= centerY) index = sectionIndex;
8992
8997
  else index = sectionIndex + 1;
8993
8998
  }
8994
- if (((_b = page.children) == null ? void 0 : _b.indexOf(droppedPart)) === index) return;
8999
+ if (((_a = page.children) == null ? void 0 : _a.indexOf(droppedPart)) === index) return;
8995
9000
  pageBuilder2.model.moveElements(droppedPart.partId, page.partId, index);
8996
9001
  };
8997
9002
  const acceptBlock = (pageBuilder2, target, droppedPart, mouseOffsetX, mouseOffsetY) => {
8998
- var _a;
8999
9003
  const block = props.part;
9000
9004
  const section = props.part.parent;
9001
9005
  const blockIndex = section.children.indexOf(block) || 0;
9002
9006
  let index;
9003
- if (((_a = section.properties) == null ? void 0 : _a.direction) === "vertical") {
9007
+ const sectionDirection = getLayoutDirection(props.isMobilePage, section.properties);
9008
+ if (sectionDirection === "vertical") {
9004
9009
  const centerY = target.offsetHeight / 2;
9005
9010
  index = mouseOffsetY <= centerY ? blockIndex : blockIndex + 1;
9006
9011
  } else {
@@ -9027,13 +9032,12 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
9027
9032
  pageBuilder2.model.moveElements(droppedPart.partId, block.partId, 0, update);
9028
9033
  };
9029
9034
  const calculateDropIndex = (part, target, mouseOffsetX, mouseOffsetY, _event) => {
9030
- var _a;
9031
9035
  if (!part.children || part.children.length === 0) return 0;
9032
9036
  const children = Array.from(target.children).filter((child) => !isPositionMark(child)).map((child) => child);
9033
- const dir = ((_a = props.part.properties) == null ? void 0 : _a.direction) || "vertical";
9037
+ const direction = getLayoutDirection(props.isMobilePage, props.part.properties);
9034
9038
  let index = 0;
9035
9039
  for (const child of children) {
9036
- if (dir === "horizontal") {
9040
+ if (direction === "horizontal") {
9037
9041
  const centerX = child.offsetLeft + child.offsetWidth / 2;
9038
9042
  if (mouseOffsetX <= centerX) return index;
9039
9043
  } else {
@@ -9098,7 +9102,8 @@ const _hoisted_1$o = ["data-part-id"];
9098
9102
  const _sfc_main$l = /* @__PURE__ */ defineComponent({
9099
9103
  __name: "PbSection",
9100
9104
  props: {
9101
- part: {}
9105
+ part: {},
9106
+ isMobilePage: { type: Boolean }
9102
9107
  },
9103
9108
  setup(__props) {
9104
9109
  const props = __props;
@@ -9114,7 +9119,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
9114
9119
  const styleTag = computed(() => props.part.getStyleTag());
9115
9120
  const properties = computed(() => ({
9116
9121
  style: {
9117
- ...props.part.getStyles(),
9122
+ ...props.part.getStyles(props.isMobilePage),
9118
9123
  ...props.part.getInlineStyles()
9119
9124
  }
9120
9125
  }));
@@ -9175,13 +9180,12 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
9175
9180
  pageBuilder2.model.moveElements(droppedPart.partId, section.partId, 0);
9176
9181
  };
9177
9182
  const calculateDropIndex = (part, target, mouseOffsetX, mouseOffsetY, _event) => {
9178
- var _a;
9179
9183
  if (!part.children || part.children.length === 0) return 0;
9180
9184
  const children = Array.from(target.children).filter((child) => !isPositionMark(child)).map((child) => child);
9181
- const dir = ((_a = props.part.properties) == null ? void 0 : _a.direction) || "vertical";
9185
+ const direction = getLayoutDirection(props.isMobilePage, props.part.properties);
9182
9186
  let index = 0;
9183
9187
  for (const child of children) {
9184
- if (dir === "horizontal") {
9188
+ if (direction === "horizontal") {
9185
9189
  const centerX = child.offsetLeft + child.offsetWidth / 2;
9186
9190
  if (mouseOffsetX <= centerX) return index;
9187
9191
  } else {
@@ -9213,8 +9217,9 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
9213
9217
  _ctx.part.children && _ctx.part.children.length > 0 ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_ctx.part.children, (block) => {
9214
9218
  return openBlock(), createBlock$1(_sfc_main$n, {
9215
9219
  key: block.partId,
9220
+ "is-mobile-page": _ctx.isMobilePage,
9216
9221
  part: block
9217
- }, null, 8, ["part"]);
9222
+ }, null, 8, ["is-mobile-page", "part"]);
9218
9223
  }), 128)) : (openBlock(), createBlock$1(PbAddWidgetButton, {
9219
9224
  key: 1,
9220
9225
  onAddWidget: addWidget
@@ -11944,8 +11949,14 @@ const layoutGroup = () => {
11944
11949
  caption: "Layout",
11945
11950
  properties: [
11946
11951
  {
11947
- propertyName: "direction",
11948
- caption: "Direction",
11952
+ propertyName: "directionSm",
11953
+ caption: "Direction for Mobile (<= 768px)",
11954
+ propertyType: "select",
11955
+ params: "vertical,horizontal"
11956
+ },
11957
+ {
11958
+ propertyName: "directionLg",
11959
+ caption: "Direction for PC (> 768px)",
11949
11960
  propertyType: "select",
11950
11961
  params: "vertical,horizontal"
11951
11962
  },
@@ -12068,6 +12079,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
12068
12079
  _ctx.part.children ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_ctx.part.children, (child) => {
12069
12080
  return openBlock(), createBlock$1(_sfc_main$o, {
12070
12081
  key: child.partId,
12082
+ "is-mobile-page": false,
12071
12083
  part: child
12072
12084
  }, null, 8, ["part"]);
12073
12085
  }), 128)) : createCommentVNode("", true),
@@ -12110,7 +12122,8 @@ const sectionParts = [
12110
12122
  ...defaultPropertyGroups()
12111
12123
  ],
12112
12124
  initialProperties: {
12113
- direction: "horizontal",
12125
+ directionSm: "horizontal",
12126
+ directionLg: "horizontal",
12114
12127
  align: "center"
12115
12128
  },
12116
12129
  allowsChild: () => true,
@@ -12128,6 +12141,8 @@ const blockParts = [
12128
12141
  ...defaultPropertyGroups()
12129
12142
  ],
12130
12143
  initialProperties: {
12144
+ directionSm: "vertical",
12145
+ directionLg: "vertical",
12131
12146
  align: "center"
12132
12147
  },
12133
12148
  allowsChild: () => true,
@@ -12310,7 +12325,7 @@ const widgets = [
12310
12325
  ...defaultWidgetPropertyGroups()
12311
12326
  ],
12312
12327
  initialProperties: {
12313
- height: "200px"
12328
+ height: "300px"
12314
12329
  },
12315
12330
  allowsChild: () => true,
12316
12331
  creator: () => _sfc_main$d
@@ -12400,7 +12415,7 @@ __publicField(_OpenAddWidgetModalCommand, "COMMAND_ID", "OpenAddWidgetModal");
12400
12415
  let OpenAddWidgetModalCommand = _OpenAddWidgetModalCommand;
12401
12416
  const openWidgetAddModal = (modal, args, callback) => {
12402
12417
  modal.openModal({
12403
- component: defineAsyncComponent(() => import("./PbWidgetAddModal-BtGAzP14.js")),
12418
+ component: defineAsyncComponent(() => import("./PbWidgetAddModal-DQYPJftS.js")),
12404
12419
  style: {
12405
12420
  width: "80%",
12406
12421
  height: "80%",
@@ -12503,9 +12518,13 @@ const _AddSectionCommand = class _AddSectionCommand {
12503
12518
  this.modal = modal;
12504
12519
  }
12505
12520
  execute(pageBuilder, args) {
12506
- const def = pageBuilder.partManager.getSectionDefinition();
12507
- if (!def) return;
12508
- addPart(pageBuilder, def);
12521
+ if (args && args.page) {
12522
+ addSectionToPage(pageBuilder, args.page);
12523
+ } else {
12524
+ const def = pageBuilder.partManager.getSectionDefinition();
12525
+ if (!def) return;
12526
+ addPart(pageBuilder, def);
12527
+ }
12509
12528
  }
12510
12529
  };
12511
12530
  __publicField(_AddSectionCommand, "COMMAND_ID", "AddSection");
@@ -12627,6 +12646,15 @@ const addSectionAfter = (pageBuilder, modal, args) => {
12627
12646
  const index = section.parent.children.indexOf(section) + 1;
12628
12647
  insertParts(pageBuilder, section.parent.partId, index, [newSection], true);
12629
12648
  };
12649
+ const addSectionToPage = (pageBuilder, page) => {
12650
+ var _a;
12651
+ const newSection = createSection(pageBuilder);
12652
+ if (!newSection) return;
12653
+ const child = createBlock(pageBuilder);
12654
+ newSection.children = [child];
12655
+ const index = ((_a = page.children) == null ? void 0 : _a.length) || 0;
12656
+ insertParts(pageBuilder, page.partId, index, [newSection], true);
12657
+ };
12630
12658
  const addBlockBefore = (pageBuilder) => {
12631
12659
  const selected = pageBuilder.context.getSelectedParts()[0];
12632
12660
  if (!selected) return;
@@ -14247,14 +14275,14 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
14247
14275
  var _a, _b;
14248
14276
  return {
14249
14277
  style: {
14250
- ...(_a = props.part) == null ? void 0 : _a.getStyles(),
14278
+ ...(_a = props.part) == null ? void 0 : _a.getStyles(props.isMobilePage),
14251
14279
  ...(_b = props.part) == null ? void 0 : _b.getInlineStyles()
14252
14280
  }
14253
14281
  };
14254
14282
  });
14255
14283
  const selected = computed(() => !!props.part && editor.context.isSelected(props.part));
14256
- const insertSection = (index) => {
14257
- editor.commandRegistry.executeCommand(AddSectionCommand.COMMAND_ID);
14284
+ const addSection = () => {
14285
+ editor.commandRegistry.executeCommand(AddSectionCommand.COMMAND_ID, { page: props.part });
14258
14286
  };
14259
14287
  const pageBuilder = usePageBuilderEditor();
14260
14288
  const contextMenu = useContextMenu();
@@ -14296,33 +14324,30 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
14296
14324
  (openBlock(true), createElementBlock(Fragment, null, renderList((_b = _ctx.part) == null ? void 0 : _b.children, (section, index) => {
14297
14325
  return openBlock(), createBlock$1(_sfc_main$l, {
14298
14326
  key: section.partId,
14327
+ "is-mobile-page": _ctx.isMobilePage,
14299
14328
  part: section
14300
- }, null, 8, ["part"]);
14329
+ }, null, 8, ["is-mobile-page", "part"]);
14301
14330
  }), 128))
14302
14331
  ], 16),
14303
14332
  createElementVNode("div", {
14304
14333
  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] = [
14334
+ onClick: addSection
14335
+ }, _cache[0] || (_cache[0] = [
14310
14336
  createElementVNode("i", { class: "material-icons-outlined" }, "add_circle_outline", -1)
14311
14337
  ]))
14312
14338
  ], 44, _hoisted_1$3),
14313
- _cache[2] || (_cache[2] = createElementVNode("div", { style: { "height": "100px" } }, null, -1))
14339
+ _cache[1] || (_cache[1] = createElementVNode("div", { style: { "height": "100px" } }, null, -1))
14314
14340
  ], 64);
14315
14341
  };
14316
14342
  }
14317
14343
  });
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}';
14344
+ 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 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
14345
  const _hoisted_1$2 = ["height", "width"];
14320
14346
  const _sfc_main$2 = /* @__PURE__ */ defineComponent({
14321
14347
  __name: "PbPageFrame",
14322
14348
  props: {
14323
14349
  part: {},
14324
- width: {},
14325
- isMobilePage: { type: Boolean }
14350
+ width: {}
14326
14351
  },
14327
14352
  setup(__props) {
14328
14353
  const props = __props;
@@ -14379,17 +14404,20 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
14379
14404
  );
14380
14405
  const width = ref(props.width);
14381
14406
  const height = ref(200);
14407
+ const isMobilePage = computed(() => width.value <= 768);
14382
14408
  const style = computed(() => ({
14383
14409
  // width: `${width.value}px`,
14384
14410
  // height: `${height.value}px`,
14385
14411
  }));
14386
14412
  let iframeObserver;
14387
14413
  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
- }
14414
+ setTimeout(() => {
14415
+ if (!iframeRef.value || !iframeRef.value.contentDocument) return;
14416
+ const iframeBody = iframeRef.value.contentDocument.body;
14417
+ if (iframeBody) {
14418
+ height.value = iframeBody.scrollHeight;
14419
+ }
14420
+ }, 100);
14393
14421
  };
14394
14422
  onMounted(() => {
14395
14423
  if (!iframeRef.value || !iframeRef.value.contentDocument) return;
@@ -14430,7 +14458,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
14430
14458
  to: (_d = (_c = iframeRef.value) == null ? void 0 : _c.contentWindow) == null ? void 0 : _d.document.body
14431
14459
  }, [
14432
14460
  createVNode(_sfc_main$3, {
14433
- "is-mobile-page": _ctx.isMobilePage,
14461
+ "is-mobile-page": isMobilePage.value,
14434
14462
  part: _ctx.part,
14435
14463
  width: width.value
14436
14464
  }, null, 8, ["is-mobile-page", "part", "width"])
@@ -14470,14 +14498,12 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
14470
14498
  createElementVNode("div", mergeProps({ class: "pb-canvas" }, style.value), [
14471
14499
  partS.value ? (openBlock(), createBlock$1(_sfc_main$2, {
14472
14500
  key: 0,
14473
- "is-mobile-page": true,
14474
14501
  part: partS.value,
14475
14502
  width: 480
14476
14503
  }, null, 8, ["part"])) : createCommentVNode("", true),
14477
14504
  partL.value ? (openBlock(), createElementBlock("div", _hoisted_2$1)) : createCommentVNode("", true),
14478
14505
  partL.value ? (openBlock(), createBlock$1(_sfc_main$2, {
14479
14506
  key: 2,
14480
- "is-mobile-page": false,
14481
14507
  part: partL.value,
14482
14508
  width: 1024
14483
14509
  }, null, 8, ["part"])) : createCommentVNode("", true)