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

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.
@@ -1,5 +1,6 @@
1
1
  .pb-section {
2
2
  position: relative;
3
+ width: 100%;
3
4
  background-position: 50% 50%;
4
5
  background-repeat: no-repeat;
5
6
  background-size: cover;
@@ -0,0 +1,38 @@
1
+ import { defineComponent, ref, openBlock, createElementBlock, createElementVNode, createVNode, unref } from "vue";
2
+ import { BSCheckbox } from "@g1cloud/bluesea";
3
+ const _hoisted_1 = { class: "property-editor property-editor-boolean flex-align-center my-12" };
4
+ const _sfc_main = /* @__PURE__ */ defineComponent({
5
+ __name: "PbPropertyEditorBoolean",
6
+ props: {
7
+ property: {},
8
+ value: {}
9
+ },
10
+ emits: ["update-property-value"],
11
+ setup(__props, { emit: __emit }) {
12
+ const props = __props;
13
+ const booleanValue = ref((props == null ? void 0 : props.value) === "true");
14
+ const emit = __emit;
15
+ const emitUpdatePropertyValue = (value) => {
16
+ const properties = {};
17
+ properties[props.property.propertyName] = value ? "true" : "false";
18
+ emit("update-property-value", properties);
19
+ };
20
+ return (_ctx, _cache) => {
21
+ return openBlock(), createElementBlock("div", _hoisted_1, [
22
+ createElementVNode("div", null, [
23
+ createVNode(unref(BSCheckbox), {
24
+ modelValue: booleanValue.value,
25
+ "onUpdate:modelValue": [
26
+ _cache[0] || (_cache[0] = ($event) => booleanValue.value = $event),
27
+ emitUpdatePropertyValue
28
+ ],
29
+ label: _ctx.property.caption
30
+ }, null, 8, ["modelValue", "label"])
31
+ ])
32
+ ]);
33
+ };
34
+ }
35
+ });
36
+ export {
37
+ _sfc_main as default
38
+ };
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, createVNode, unref } from "vue";
2
2
  import { BSTextInput } from "@g1cloud/bluesea";
3
- import { P as PbColorPicker } from "./index-Cu4Pt-wp.js";
3
+ import { P as PbColorPicker } from "./index-B8JifwHW.js";
4
4
  const _hoisted_1 = { class: "property-editor property-editor-color" };
5
5
  const _hoisted_2 = { class: "title" };
6
6
  const _hoisted_3 = ["textContent"];
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, defineAsyncComponent } from "vue";
2
2
  import { useModal } from "@g1cloud/bluesea";
3
- import { u as usePageBuilderEditor } from "./index-Cu4Pt-wp.js";
3
+ import { u as usePageBuilderEditor } from "./index-B8JifwHW.js";
4
4
  const _hoisted_1 = { class: "property-editor property-editor-image flex-align-center" };
5
5
  const _hoisted_2 = { class: "title" };
6
6
  const _hoisted_3 = ["textContent"];
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, openBlock, createElementBlock, createElementVNode, toDisplayString } from "vue";
2
- import { u as usePageBuilderEditor } from "./index-Cu4Pt-wp.js";
2
+ import { u as usePageBuilderEditor } from "./index-B8JifwHW.js";
3
3
  import { useModal } from "@g1cloud/bluesea";
4
4
  const _hoisted_1 = { class: "property-editor property-editor-image flex-align-center" };
5
5
  const _hoisted_2 = { class: "title" };
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, computed, openBlock, createElementBlock, createElementVNode, toDisplayString, createBlock, unref } from "vue";
2
2
  import { BSMultiLangTextArea, BSTextArea } from "@g1cloud/bluesea";
3
- import { u as usePageBuilderEditor } from "./index-Cu4Pt-wp.js";
3
+ import { u as usePageBuilderEditor } from "./index-B8JifwHW.js";
4
4
  const _hoisted_1 = { class: "property-editor property-editor-multiline-text" };
5
5
  const _hoisted_2 = { class: "title" };
6
6
  const _hoisted_3 = ["textContent"];
@@ -1,4 +1,4 @@
1
- import { defineComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, createVNode, unref } from "vue";
1
+ import { defineComponent, computed, openBlock, createElementBlock, createElementVNode, toDisplayString, createVNode, unref } from "vue";
2
2
  import { BSNumberInput } from "@g1cloud/bluesea";
3
3
  const _hoisted_1 = { class: "property-editor property-editor-number flex-align-center" };
4
4
  const _hoisted_2 = { class: "title" };
@@ -13,6 +13,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
13
13
  setup(__props, { emit: __emit }) {
14
14
  const props = __props;
15
15
  const emit = __emit;
16
+ const modelValue = computed(() => {
17
+ if (props.value && !isNaN(Number(props.value))) {
18
+ return Number(props.value);
19
+ } else {
20
+ return void 0;
21
+ }
22
+ });
16
23
  const emitUpdatePropertyValue = (value) => {
17
24
  const properties = {};
18
25
  properties[props.property.propertyName] = `${value}`;
@@ -27,7 +34,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
27
34
  ]),
28
35
  createElementVNode("div", null, [
29
36
  createVNode(unref(BSNumberInput), {
30
- "model-value": Number(_ctx.value),
37
+ "model-value": modelValue.value,
31
38
  width: "100%",
32
39
  "onUpdate:modelValue": emitUpdatePropertyValue
33
40
  }, null, 8, ["model-value"])
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, computed, openBlock, createElementBlock, createElementVNode, toDisplayString, createBlock, unref } from "vue";
2
2
  import { BSMultiLangTextInput, BSTextInput } from "@g1cloud/bluesea";
3
- import { u as usePageBuilderEditor } from "./index-Cu4Pt-wp.js";
3
+ import { u as usePageBuilderEditor } from "./index-B8JifwHW.js";
4
4
  const _hoisted_1 = { class: "property-editor property-editor-text flex-align-center" };
5
5
  const _hoisted_2 = { class: "title" };
6
6
  const _hoisted_3 = ["textContent"];
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, openBlock, createElementBlock, createElementVNode, toDisplayString } from "vue";
2
2
  import { useModal } from "@g1cloud/bluesea";
3
- import { s as selectYoutubeVideo } from "./index-Cu4Pt-wp.js";
3
+ import { s as selectYoutubeVideo } from "./index-B8JifwHW.js";
4
4
  const _hoisted_1 = { class: "property-editor property-editor-image flex-align-center" };
5
5
  const _hoisted_2 = { class: "title" };
6
6
  const _hoisted_3 = ["textContent"];
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, computed, openBlock, createBlock, unref, withCtx, createElementVNode, createElementBlock, Fragment, renderList, toDisplayString } from "vue";
2
2
  import { useModalHandle, BSModalFrame } from "@g1cloud/bluesea";
3
- import { w as widgetPartDefinitions } from "./index-Cu4Pt-wp.js";
3
+ import { w as widgetPartDefinitions } from "./index-B8JifwHW.js";
4
4
  const _hoisted_1 = { class: "bs-layout-vertical pb-part-add-modal" };
5
5
  const _hoisted_2 = { class: "bs-layout-horizontal-wrap ml-16 mb-8 gap-8" };
6
6
  const _hoisted_3 = ["onClick", "textContent"];
@@ -0,0 +1,23 @@
1
+ import { PartProperty } from '../../../model/part-property.ts';
2
+
3
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
4
+ property: PartProperty;
5
+ value?: string | undefined;
6
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
7
+ "update-property-value": (properties: Record<string, string>) => void;
8
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
9
+ property: PartProperty;
10
+ value?: string | undefined;
11
+ }>>> & Readonly<{
12
+ "onUpdate-property-value"?: ((properties: Record<string, string>) => any) | undefined;
13
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
14
+ export default _default;
15
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
16
+ type __VLS_TypePropsToRuntimeProps<T> = {
17
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
18
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
19
+ } : {
20
+ type: import('vue').PropType<T[K]>;
21
+ required: true;
22
+ };
23
+ };
@@ -1,7 +1,7 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- import { ref, defineComponent, computed, openBlock, createElementBlock, normalizeStyle, createElementVNode, createCommentVNode, toDisplayString, onMounted, onBeforeUnmount, createBlock as createBlock$1, unref, provide, inject, watch, Fragment, renderList, resolveDynamicComponent, normalizeProps, mergeProps, normalizeClass, reactive, defineAsyncComponent, withDirectives, createVNode, resolveComponent, vModelText, resolveDirective, withModifiers, renderSlot, guardReactiveProps, markRaw, toHandlers, Teleport } from "vue";
4
+ import { ref, defineComponent, computed, openBlock, createElementBlock, Fragment, createElementVNode, normalizeStyle, createCommentVNode, toDisplayString, onMounted, onBeforeUnmount, createBlock as createBlock$1, unref, provide, inject, watch, renderList, resolveDynamicComponent, normalizeProps, mergeProps, normalizeClass, reactive, defineAsyncComponent, withDirectives, createVNode, resolveComponent, vModelText, resolveDirective, withModifiers, renderSlot, guardReactiveProps, markRaw, toHandlers, Teleport } from "vue";
5
5
  import { notNull, BSTextInput, vClickOutside, useModal, BSSelect, BSTree, useContextMenu } from "@g1cloud/bluesea";
6
6
  import YouTube from "vue3-youtube";
7
7
  const create$5 = () => /* @__PURE__ */ new Map();
@@ -6693,6 +6693,10 @@ class Part {
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
+ } else if (this.isPage()) {
6697
+ style.display = "flex";
6698
+ style.flexDirection = "column";
6699
+ style.alignItems = this.getAlignStyleValue(align);
6696
6700
  } else {
6697
6701
  const direction = isMobilePage ? (_b = this.properties) == null ? void 0 : _b.directionSm : (_c = this.properties) == null ? void 0 : _c.directionLg;
6698
6702
  if (direction === "horizontal") {
@@ -6724,10 +6728,10 @@ class Part {
6724
6728
  if ((_r = this.properties) == null ? void 0 : _r.bottom) style.bottom = this.properties.bottom;
6725
6729
  if ((_s = this.properties) == null ? void 0 : _s.width) style.width = this.properties.width;
6726
6730
  if ((_t = this.properties) == null ? void 0 : _t.height) style.height = this.properties.height;
6727
- if ((_u = this.properties) == null ? void 0 : _u.maxWidth) style.width = this.properties.maxWidth;
6728
- if ((_v = this.properties) == null ? void 0 : _v.maxHeight) style.height = this.properties.maxHeight;
6729
- if ((_w = this.properties) == null ? void 0 : _w.minWidth) style.width = this.properties.minWidth;
6730
- if ((_x = this.properties) == null ? void 0 : _x.minHeight) style.height = this.properties.minHeight;
6731
+ if ((_u = this.properties) == null ? void 0 : _u.maxWidth) style.maxWidth = this.properties.maxWidth;
6732
+ if ((_v = this.properties) == null ? void 0 : _v.maxHeight) style.maxHeight = this.properties.maxHeight;
6733
+ if ((_w = this.properties) == null ? void 0 : _w.minWidth) style.minWidth = this.properties.minWidth;
6734
+ if ((_x = this.properties) == null ? void 0 : _x.minHeight) style.minHeight = this.properties.minHeight;
6731
6735
  if ((_y = this.properties) == null ? void 0 : _y.textAlign) style.textAlign = this.properties.textAlign;
6732
6736
  if ((_z = this.properties) == null ? void 0 : _z.backgroundColor) style.backgroundColor = this.properties.backgroundColor;
6733
6737
  if ((_A = this.properties) == null ? void 0 : _A.borderLeftWidth) style.borderLeftWidth = this.properties.borderLeftWidth;
@@ -6981,8 +6985,10 @@ const _sfc_main$9$1 = /* @__PURE__ */ defineComponent({
6981
6985
  };
6982
6986
  }
6983
6987
  });
6984
- const _hoisted_1$7$1 = ["alt", "src"];
6985
- const _hoisted_2$4$1 = {
6988
+ const _hoisted_1$7$1 = ["href", "target"];
6989
+ const _hoisted_2$4$1 = ["alt", "src"];
6990
+ const _hoisted_3$d = ["alt", "src"];
6991
+ const _hoisted_4$a = {
6986
6992
  key: 1,
6987
6993
  class: "placeholder"
6988
6994
  };
@@ -7015,14 +7021,27 @@ const _sfc_main$8$1 = /* @__PURE__ */ defineComponent({
7015
7021
  return {};
7016
7022
  });
7017
7023
  return (_ctx, _cache) => {
7018
- var _a, _b;
7019
- return ((_a = _ctx.part.properties) == null ? void 0 : _a.media) ? (openBlock(), createElementBlock("img", {
7020
- key: 0,
7021
- alt: altText.value,
7022
- src: ((_b = _ctx.part.properties) == null ? void 0 : _b.media).url,
7023
- style: normalizeStyle(style.value),
7024
- class: "image"
7025
- }, null, 12, _hoisted_1$7$1)) : _ctx.placeholder ? (openBlock(), createElementBlock("div", _hoisted_2$4$1, _cache[0] || (_cache[0] = [
7024
+ var _a, _b, _c, _d, _e, _f;
7025
+ return ((_a = _ctx.part.properties) == null ? void 0 : _a.media) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
7026
+ ((_b = _ctx.part.properties) == null ? void 0 : _b.link) ? (openBlock(), createElementBlock("a", {
7027
+ key: 0,
7028
+ href: (_c = _ctx.part.properties) == null ? void 0 : _c.link,
7029
+ target: (_d = _ctx.part.properties) == null ? void 0 : _d.linkTarget
7030
+ }, [
7031
+ createElementVNode("img", {
7032
+ alt: altText.value,
7033
+ src: ((_e = _ctx.part.properties) == null ? void 0 : _e.media).url,
7034
+ style: normalizeStyle(style.value),
7035
+ class: "image"
7036
+ }, null, 12, _hoisted_2$4$1)
7037
+ ], 8, _hoisted_1$7$1)) : (openBlock(), createElementBlock("img", {
7038
+ key: 1,
7039
+ alt: altText.value,
7040
+ src: ((_f = _ctx.part.properties) == null ? void 0 : _f.media).url,
7041
+ style: normalizeStyle(style.value),
7042
+ class: "image"
7043
+ }, null, 12, _hoisted_3$d))
7044
+ ], 64)) : _ctx.placeholder ? (openBlock(), createElementBlock("div", _hoisted_4$a, _cache[0] || (_cache[0] = [
7026
7045
  createElementVNode("span", { class: "font-icon" }, "image", -1)
7027
7046
  ]))) : createCommentVNode("", true);
7028
7047
  };
@@ -8102,14 +8121,15 @@ class PartManager {
8102
8121
  const defaultPartPropertyEditors = () => {
8103
8122
  return {
8104
8123
  "readonly-text": () => defineAsyncComponent(() => import("./PbPropertyEditorReadonlyText-Dgp_AVOD.js")),
8105
- "text": () => defineAsyncComponent(() => import("./PbPropertyEditorText-DPMCCfN3.js")),
8106
- "number": () => defineAsyncComponent(() => import("./PbPropertyEditorNumber-DrxTz2s1.js")),
8107
- "multiline-text": () => defineAsyncComponent(() => import("./PbPropertyEditorMultilineText-BupCrg8y.js")),
8124
+ "text": () => defineAsyncComponent(() => import("./PbPropertyEditorText-tvKIJh2H.js")),
8125
+ "number": () => defineAsyncComponent(() => import("./PbPropertyEditorNumber-TTgo0zbQ.js")),
8126
+ "boolean": () => defineAsyncComponent(() => import("./PbPropertyEditorBoolean-C7-iSAtn.js")),
8127
+ "multiline-text": () => defineAsyncComponent(() => import("./PbPropertyEditorMultilineText-RrUB1pI3.js")),
8108
8128
  "select": () => defineAsyncComponent(() => import("./PbPropertyEditorSelect-CWedbXJI.js")),
8109
- "color": () => defineAsyncComponent(() => import("./PbPropertyEditorColor-CnF04lLw.js")),
8110
- "image": () => defineAsyncComponent(() => import("./PbPropertyEditorImage-wnD2ZhtY.js")),
8111
- "html": () => defineAsyncComponent(() => import("./PbPropertyEditorHtml-DGWhLeBV.js")),
8112
- "youtube": () => defineAsyncComponent(() => import("./PbPropertyEditorYoutube-CyyNcDAu.js"))
8129
+ "color": () => defineAsyncComponent(() => import("./PbPropertyEditorColor-Btwd1WP_.js")),
8130
+ "image": () => defineAsyncComponent(() => import("./PbPropertyEditorImage-BV2SeGBT.js")),
8131
+ "html": () => defineAsyncComponent(() => import("./PbPropertyEditorHtml-DQpflvo0.js")),
8132
+ "youtube": () => defineAsyncComponent(() => import("./PbPropertyEditorYoutube-Bcq06f0I.js"))
8113
8133
  };
8114
8134
  };
8115
8135
  const getPropertyValueOfParts = (parts, propertyName) => {
@@ -9320,7 +9340,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
9320
9340
  const updateWidth = (value) => updatePropertyValue({ width: value });
9321
9341
  const updateHeight = (value) => updatePropertyValue({ height: value });
9322
9342
  const updateMaxWidth = (value) => updatePropertyValue({ maxWidth: value });
9323
- const updateMaxHeight = (value) => updatePropertyValue({ maxWeight: value });
9343
+ const updateMaxHeight = (value) => updatePropertyValue({ maxHeight: value });
9324
9344
  const updateMinWidth = (value) => updatePropertyValue({ minWidth: value });
9325
9345
  const updateMinHeight = (value) => updatePropertyValue({ minHeight: value });
9326
9346
  return (_ctx, _cache) => {
@@ -11796,22 +11816,22 @@ const sizeGroup = () => {
11796
11816
  propertyType: "text"
11797
11817
  },
11798
11818
  {
11799
- propertyName: "min-width",
11819
+ propertyName: "minWidth",
11800
11820
  caption: "Min Width",
11801
11821
  propertyType: "text"
11802
11822
  },
11803
11823
  {
11804
- propertyName: "min-height",
11824
+ propertyName: "minHeight",
11805
11825
  caption: "Min Height",
11806
11826
  propertyType: "text"
11807
11827
  },
11808
11828
  {
11809
- propertyName: "max-width",
11829
+ propertyName: "maxWidth",
11810
11830
  caption: "Max Width",
11811
11831
  propertyType: "text"
11812
11832
  },
11813
11833
  {
11814
- propertyName: "max-height",
11834
+ propertyName: "maxHeight",
11815
11835
  caption: "Max Height",
11816
11836
  propertyType: "text"
11817
11837
  }
@@ -12071,6 +12091,18 @@ const pageParts = [
12071
12091
  icon: "draft",
12072
12092
  className: "pb-page",
12073
12093
  propertyGroups: [
12094
+ {
12095
+ groupName: "size",
12096
+ caption: "Size",
12097
+ properties: [
12098
+ {
12099
+ propertyName: "maxWidth",
12100
+ caption: "Max Width",
12101
+ propertyType: "text",
12102
+ params: ""
12103
+ }
12104
+ ]
12105
+ },
12074
12106
  alignGroup(),
12075
12107
  paddingGroup(),
12076
12108
  backgroundGroup(),
@@ -12196,6 +12228,18 @@ const widgets = [
12196
12228
  caption: "Image",
12197
12229
  propertyType: "image",
12198
12230
  params: ""
12231
+ },
12232
+ {
12233
+ propertyName: "link",
12234
+ caption: "Link",
12235
+ propertyType: "text",
12236
+ params: ""
12237
+ },
12238
+ {
12239
+ propertyName: "linkTarget",
12240
+ caption: "Link Target",
12241
+ propertyType: "text",
12242
+ params: ""
12199
12243
  }
12200
12244
  ]
12201
12245
  },
@@ -12387,7 +12431,7 @@ __publicField(_OpenAddWidgetModalCommand, "COMMAND_ID", "OpenAddWidgetModal");
12387
12431
  let OpenAddWidgetModalCommand = _OpenAddWidgetModalCommand;
12388
12432
  const openWidgetAddModal = (modal, args, callback) => {
12389
12433
  modal.openModal({
12390
- component: defineAsyncComponent(() => import("./PbWidgetAddModal-CpkklmlZ.js")),
12434
+ component: defineAsyncComponent(() => import("./PbWidgetAddModal-Ca9HNoSU.js")),
12391
12435
  style: {
12392
12436
  width: "80%",
12393
12437
  height: "80%",
@@ -14290,7 +14334,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
14290
14334
  };
14291
14335
  }
14292
14336
  });
14293
- 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 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}';
14337
+ 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}';
14294
14338
  const _hoisted_1$2 = ["height", "width"];
14295
14339
  const _sfc_main$2 = /* @__PURE__ */ defineComponent({
14296
14340
  __name: "PbPageFrame",
@@ -14358,7 +14402,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
14358
14402
  // width: `${width.value}px`,
14359
14403
  // height: `${height.value}px`,
14360
14404
  }));
14361
- let iframeObserver;
14405
+ let resizeObserver;
14362
14406
  const updateIframeHeight = () => {
14363
14407
  setTimeout(() => {
14364
14408
  if (!iframeRef.value || !iframeRef.value.contentDocument) return;
@@ -14371,13 +14415,15 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
14371
14415
  onMounted(() => {
14372
14416
  if (!iframeRef.value || !iframeRef.value.contentDocument) return;
14373
14417
  const iframeBody = iframeRef.value.contentDocument.body;
14374
- iframeObserver = new MutationObserver(updateIframeHeight);
14375
- iframeObserver.observe(iframeBody, { childList: true, subtree: true });
14418
+ resizeObserver = new ResizeObserver(() => {
14419
+ updateIframeHeight();
14420
+ });
14421
+ resizeObserver.observe(iframeBody, {});
14376
14422
  iframeRef.value.onload = updateIframeHeight;
14377
14423
  });
14378
14424
  onBeforeUnmount(() => {
14379
- if (iframeObserver) {
14380
- iframeObserver.disconnect();
14425
+ if (resizeObserver) {
14426
+ resizeObserver.disconnect();
14381
14427
  }
14382
14428
  });
14383
14429
  return (_ctx, _cache) => {
package/dist/index.d.ts CHANGED
@@ -1,4 +1,7 @@
1
+ import { PartProperty } from './model/part-property.ts';
2
+
1
3
  export { default as PageBuilderEditor } from './PageBuilderEditor.vue';
4
+ export type { PartProperty };
2
5
  export * from './model/event';
3
6
  export * from './model/plugin';
4
7
  export * from '@g1cloud/page-builder-viewer';
@@ -1,7 +1,7 @@
1
1
  import { IPart } from '@g1cloud/page-builder-viewer';
2
2
  import { Component } from 'vue';
3
3
 
4
- export type PartPropertyType = 'readonly-text' | 'text' | 'number' | 'multiline-text' | 'select' | string;
4
+ export type PartPropertyType = 'readonly-text' | 'text' | 'number' | 'boolean' | 'multiline-text' | 'select' | string;
5
5
  export type PartPropertyEditor = (property: PartProperty, parts: IPart[]) => Component | undefined;
6
6
  export type PartProperty = {
7
7
  propertyName: string;
@@ -1,4 +1,4 @@
1
- import { B, b, M, c, d, e, _, a, f, g, h, i, j, k, l, m, n, R, o, S, p, W, q, r, t, v, x, y, z, A, C } from "./index-Cu4Pt-wp.js";
1
+ import { B, b, M, c, d, e, _, a, f, g, h, i, j, k, l, m, n, R, o, S, p, W, q, r, t, v, x, y, z, A, C } from "./index-B8JifwHW.js";
2
2
  export {
3
3
  B as BLOCK_TYPE,
4
4
  b as Block,