@g1cloud/page-builder-editor 1.0.0-alpha.15 → 1.0.0-alpha.17

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.
@@ -4,7 +4,7 @@ var __publicField = (obj, key, value) => {
4
4
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
5
  return value;
6
6
  };
7
- import { ref, defineComponent, openBlock, createElementBlock, createCommentVNode, computed, normalizeClass, createElementVNode, mergeProps, toDisplayString, provide, inject, onMounted, watch, createBlock as createBlock$1, resolveDynamicComponent, normalizeProps, Fragment, renderList, reactive, defineAsyncComponent, withDirectives, unref, createVNode, normalizeStyle, resolveComponent, vModelText, onBeforeUnmount, resolveDirective, withModifiers, renderSlot, guardReactiveProps, markRaw, Teleport, toHandlers, withCtx } from "vue";
7
+ import { ref, defineComponent, openBlock, createElementBlock, createCommentVNode, computed, mergeProps, toDisplayString, onMounted, onBeforeUnmount, provide, inject, watch, createBlock as createBlock$1, resolveDynamicComponent, normalizeProps, createElementVNode, normalizeClass, Fragment, renderList, reactive, defineAsyncComponent, withDirectives, unref, createVNode, normalizeStyle, resolveComponent, vModelText, resolveDirective, withModifiers, renderSlot, guardReactiveProps, markRaw, Teleport, toHandlers, withCtx } from "vue";
8
8
  import { notNull, BSTextInput, vClickOutside, useContextMenu, useModal, BSSelect, BSTabSheet, BSTree, BSDateRange } from "@g1cloud/bluesea";
9
9
  const create$5 = () => /* @__PURE__ */ new Map();
10
10
  const copy = (m) => {
@@ -6892,12 +6892,12 @@ let Model$1 = class Model {
6892
6892
  this.rootPart = ref(new RootPart());
6893
6893
  }
6894
6894
  };
6895
- const _hoisted_1$7$1 = ["data-model-id"];
6896
- const _hoisted_2$3$1 = {
6895
+ const _hoisted_1$8$1 = ["data-model-id"];
6896
+ const _hoisted_2$5$1 = {
6897
6897
  key: 1,
6898
6898
  class: "pb-nested-widget"
6899
6899
  };
6900
- const _sfc_main$9$1 = /* @__PURE__ */ defineComponent({
6900
+ const _sfc_main$a$1 = /* @__PURE__ */ defineComponent({
6901
6901
  __name: "PbWidget",
6902
6902
  props: {
6903
6903
  part: {}
@@ -6919,7 +6919,7 @@ const _sfc_main$9$1 = /* @__PURE__ */ defineComponent({
6919
6919
  key: 0,
6920
6920
  part: _ctx.part
6921
6921
  }, null, 8, ["part"])) : createCommentVNode("", true),
6922
- childComponents.value && childComponents.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_2$3$1, [
6922
+ childComponents.value && childComponents.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_2$5$1, [
6923
6923
  (openBlock(true), createElementBlock(Fragment, null, renderList(childComponents.value, (child) => {
6924
6924
  return openBlock(), createBlock$1(resolveDynamicComponent(child.component), {
6925
6925
  key: child.part.partId,
@@ -6927,12 +6927,12 @@ const _sfc_main$9$1 = /* @__PURE__ */ defineComponent({
6927
6927
  }, null, 8, ["part"]);
6928
6928
  }), 128))
6929
6929
  ])) : createCommentVNode("", true)
6930
- ], 16, _hoisted_1$7$1);
6930
+ ], 16, _hoisted_1$8$1);
6931
6931
  };
6932
6932
  }
6933
6933
  });
6934
- const _hoisted_1$6$1 = ["data-model-id"];
6935
- const _sfc_main$8$1 = /* @__PURE__ */ defineComponent({
6934
+ const _hoisted_1$7$1 = ["data-model-id"];
6935
+ const _sfc_main$9$1 = /* @__PURE__ */ defineComponent({
6936
6936
  __name: "PbBlock",
6937
6937
  props: {
6938
6938
  part: {}
@@ -6950,17 +6950,17 @@ const _sfc_main$8$1 = /* @__PURE__ */ defineComponent({
6950
6950
  style: (_a = _ctx.part.properties) == null ? void 0 : _a.css
6951
6951
  }, properties.value), [
6952
6952
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.part.children, (child) => {
6953
- return openBlock(), createBlock$1(_sfc_main$9$1, {
6953
+ return openBlock(), createBlock$1(_sfc_main$a$1, {
6954
6954
  key: child.partId,
6955
6955
  part: child
6956
6956
  }, null, 8, ["part"]);
6957
6957
  }), 128))
6958
- ], 16, _hoisted_1$6$1);
6958
+ ], 16, _hoisted_1$7$1);
6959
6959
  };
6960
6960
  }
6961
6961
  });
6962
- const _hoisted_1$5$1 = { class: "pb-block" };
6963
- const _hoisted_2$2$1 = /* @__PURE__ */ createElementVNode("div", {
6962
+ const _hoisted_1$6$1 = { class: "pb-block" };
6963
+ const _hoisted_2$4$1 = /* @__PURE__ */ createElementVNode("div", {
6964
6964
  class: "pb-widget",
6965
6965
  style: { "margin": "0 auto" }
6966
6966
  }, [
@@ -6968,22 +6968,22 @@ const _hoisted_2$2$1 = /* @__PURE__ */ createElementVNode("div", {
6968
6968
  /* @__PURE__ */ createElementVNode("h3", null, "Login Design Part")
6969
6969
  ])
6970
6970
  ], -1);
6971
- const _hoisted_3$1$1 = [
6972
- _hoisted_2$2$1
6971
+ const _hoisted_3$4$1 = [
6972
+ _hoisted_2$4$1
6973
6973
  ];
6974
- const _sfc_main$7$1 = /* @__PURE__ */ defineComponent({
6974
+ const _sfc_main$8$1 = /* @__PURE__ */ defineComponent({
6975
6975
  __name: "PbLoginDepart",
6976
6976
  props: {
6977
6977
  part: {}
6978
6978
  },
6979
6979
  setup(__props) {
6980
6980
  return (_ctx, _cache) => {
6981
- return openBlock(), createElementBlock("div", _hoisted_1$5$1, _hoisted_3$1$1);
6981
+ return openBlock(), createElementBlock("div", _hoisted_1$6$1, _hoisted_3$4$1);
6982
6982
  };
6983
6983
  }
6984
6984
  });
6985
- const _hoisted_1$4$1 = ["data-model-id"];
6986
- const _sfc_main$6$1 = /* @__PURE__ */ defineComponent({
6985
+ const _hoisted_1$5$1 = ["data-model-id"];
6986
+ const _sfc_main$7$1 = /* @__PURE__ */ defineComponent({
6987
6987
  __name: "PbSection",
6988
6988
  props: {
6989
6989
  part: {}
@@ -6999,94 +6999,74 @@ const _sfc_main$6$1 = /* @__PURE__ */ defineComponent({
6999
6999
  "data-model-id": _ctx.part.partId,
7000
7000
  style: (_a = _ctx.part.properties) == null ? void 0 : _a.css
7001
7001
  }, properties.value), [
7002
- ((_b = _ctx.part.properties) == null ? void 0 : _b.name) === "Login Design Part" ? (openBlock(), createBlock$1(_sfc_main$7$1, {
7002
+ ((_b = _ctx.part.properties) == null ? void 0 : _b.name) === "Login Design Part" ? (openBlock(), createBlock$1(_sfc_main$8$1, {
7003
7003
  key: 0,
7004
7004
  part: _ctx.part
7005
7005
  }, null, 8, ["part"])) : _ctx.part.children && _ctx.part.children.length > 0 ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(_ctx.part.children, (block) => {
7006
- return openBlock(), createBlock$1(_sfc_main$8$1, {
7006
+ return openBlock(), createBlock$1(_sfc_main$9$1, {
7007
7007
  key: block.partId,
7008
7008
  part: block
7009
7009
  }, null, 8, ["part"]);
7010
7010
  }), 128)) : createCommentVNode("", true)
7011
- ], 16, _hoisted_1$4$1);
7011
+ ], 16, _hoisted_1$5$1);
7012
7012
  };
7013
7013
  }
7014
7014
  });
7015
- const _hoisted_1$3$1 = { class: "pb-image-widget" };
7016
- const _hoisted_2$1$1 = ["src"];
7017
- const _hoisted_3$h = {
7015
+ const _hoisted_1$4$1 = { class: "pb-image-widget" };
7016
+ const _hoisted_2$3$1 = ["src"];
7017
+ const _hoisted_3$3$1 = {
7018
7018
  key: 1,
7019
- class: "empty"
7019
+ class: "placeholder"
7020
7020
  };
7021
7021
  const _hoisted_4$e = /* @__PURE__ */ createElementVNode("span", { class: "font-icon" }, "image", -1);
7022
7022
  const _hoisted_5$7 = [
7023
7023
  _hoisted_4$e
7024
7024
  ];
7025
- const _sfc_main$5$1 = /* @__PURE__ */ defineComponent({
7025
+ const _sfc_main$6$1 = /* @__PURE__ */ defineComponent({
7026
7026
  __name: "PbImageWidget",
7027
7027
  props: {
7028
7028
  part: {},
7029
- viewMode: { type: Boolean, default: false }
7029
+ placeholder: { type: Boolean }
7030
7030
  },
7031
7031
  setup(__props) {
7032
7032
  return (_ctx, _cache) => {
7033
7033
  var _a, _b;
7034
- return openBlock(), createElementBlock("div", _hoisted_1$3$1, [
7034
+ return openBlock(), createElementBlock("div", _hoisted_1$4$1, [
7035
7035
  ((_a = _ctx.part.properties) == null ? void 0 : _a.image) ? (openBlock(), createElementBlock("img", {
7036
7036
  key: 0,
7037
7037
  src: (_b = _ctx.part.properties) == null ? void 0 : _b.image,
7038
7038
  alt: "",
7039
7039
  class: "image"
7040
- }, null, 8, _hoisted_2$1$1)) : !_ctx.viewMode ? (openBlock(), createElementBlock("div", _hoisted_3$h, _hoisted_5$7)) : createCommentVNode("", true)
7040
+ }, null, 8, _hoisted_2$3$1)) : _ctx.placeholder ? (openBlock(), createElementBlock("div", _hoisted_3$3$1, _hoisted_5$7)) : createCommentVNode("", true)
7041
7041
  ]);
7042
7042
  };
7043
7043
  }
7044
7044
  });
7045
- const _hoisted_1$2$1 = ["textContent"];
7046
- const _sfc_main$4$1 = /* @__PURE__ */ defineComponent({
7045
+ const _hoisted_1$3$1 = { class: "pb-text-widget" };
7046
+ const _hoisted_2$2$1 = ["textContent"];
7047
+ const _hoisted_3$2$1 = {
7048
+ key: 1,
7049
+ class: "placeholder",
7050
+ textContent: "Empty Text"
7051
+ };
7052
+ const _sfc_main$5$1 = /* @__PURE__ */ defineComponent({
7047
7053
  __name: "PbTextWidget",
7048
7054
  props: {
7049
7055
  part: {},
7050
- viewMode: { type: Boolean, default: false }
7056
+ placeholder: { type: Boolean }
7051
7057
  },
7052
7058
  setup(__props) {
7053
7059
  const props = __props;
7054
7060
  const pageBuilder = usePageBuilder();
7055
- const emptyClass = computed(() => {
7056
- var _a;
7057
- if (props.viewMode) {
7058
- return false;
7059
- } else if ((_a = props.part.properties) == null ? void 0 : _a.text) {
7060
- if (typeof props.part.properties.text === "string") {
7061
- return true;
7062
- } else {
7063
- return !props.part.properties.text[pageBuilder.locale.value];
7064
- }
7065
- } else {
7066
- return true;
7067
- }
7068
- });
7069
7061
  const text = computed(() => {
7070
7062
  var _a;
7071
7063
  if ((_a = props.part.properties) == null ? void 0 : _a.text) {
7072
7064
  if (typeof props.part.properties.text === "string") {
7073
- if (props.viewMode) {
7074
- return "";
7075
- } else {
7076
- return "Empty text";
7077
- }
7065
+ return props.part.properties.text;
7078
7066
  } else {
7079
- const t = props.part.properties.text[pageBuilder.locale.value];
7080
- if (props.viewMode) {
7081
- return t || "";
7082
- } else {
7083
- return t || "Empty text";
7084
- }
7067
+ const locale = pageBuilder.getLocale();
7068
+ return props.part.properties.text[locale] || "";
7085
7069
  }
7086
- } else if (props.viewMode) {
7087
- return "";
7088
- } else {
7089
- return "Empty text";
7090
7070
  }
7091
7071
  });
7092
7072
  const style = computed(() => {
@@ -7099,23 +7079,29 @@ const _sfc_main$4$1 = /* @__PURE__ */ defineComponent({
7099
7079
  };
7100
7080
  });
7101
7081
  return (_ctx, _cache) => {
7102
- return openBlock(), createElementBlock("div", {
7103
- class: normalizeClass([[emptyClass.value ? "empty" : ""], "pb-text-widget"])
7104
- }, [
7105
- createElementVNode("div", mergeProps({ class: "text" }, style.value, {
7082
+ return openBlock(), createElementBlock("div", _hoisted_1$3$1, [
7083
+ text.value ? (openBlock(), createElementBlock("div", mergeProps({
7084
+ key: 0,
7085
+ class: "text"
7086
+ }, style.value, {
7106
7087
  textContent: toDisplayString(text.value)
7107
- }), null, 16, _hoisted_1$2$1)
7108
- ], 2);
7088
+ }), null, 16, _hoisted_2$2$1)) : _ctx.placeholder ? (openBlock(), createElementBlock("div", _hoisted_3$2$1)) : createCommentVNode("", true)
7089
+ ]);
7109
7090
  };
7110
7091
  }
7111
7092
  });
7112
- const _hoisted_1$1$1 = ["innerHTML"];
7113
- const _hoisted_2$k = { key: 1 };
7114
- const _sfc_main$3$1 = /* @__PURE__ */ defineComponent({
7093
+ const _hoisted_1$2$1 = { class: "pb-html-widget" };
7094
+ const _hoisted_2$1$1 = ["innerHTML"];
7095
+ const _hoisted_3$1$1 = {
7096
+ key: 1,
7097
+ class: "placeholder",
7098
+ textContent: "Empty HTML"
7099
+ };
7100
+ const _sfc_main$4$1 = /* @__PURE__ */ defineComponent({
7115
7101
  __name: "PbHtmlWidget",
7116
7102
  props: {
7117
7103
  part: {},
7118
- viewMode: { type: Boolean, default: false }
7104
+ placeholder: { type: Boolean }
7119
7105
  },
7120
7106
  setup(__props) {
7121
7107
  const props = __props;
@@ -7142,23 +7128,69 @@ ${_html.style}
7142
7128
  var _a;
7143
7129
  return getHtml((_a = props.part.properties) == null ? void 0 : _a.html);
7144
7130
  });
7145
- const emptyClass = computed(() => {
7146
- if (props.viewMode) {
7147
- return false;
7148
- } else {
7149
- return !html.value;
7150
- }
7151
- });
7131
+ computed(() => props.placeholder ? !html.value : false);
7152
7132
  return (_ctx, _cache) => {
7153
- return openBlock(), createElementBlock("div", {
7154
- class: normalizeClass([[emptyClass.value ? "empty" : ""], "pb-html-widget"])
7155
- }, [
7133
+ return openBlock(), createElementBlock("div", _hoisted_1$2$1, [
7156
7134
  html.value ? (openBlock(), createElementBlock("div", {
7157
7135
  key: 0,
7158
7136
  class: "html",
7159
7137
  innerHTML: html.value
7160
- }, null, 8, _hoisted_1$1$1)) : (openBlock(), createElementBlock("span", _hoisted_2$k, "Empty HTML"))
7161
- ], 2);
7138
+ }, null, 8, _hoisted_2$1$1)) : _ctx.placeholder ? (openBlock(), createElementBlock("div", _hoisted_3$1$1)) : createCommentVNode("", true)
7139
+ ]);
7140
+ };
7141
+ }
7142
+ });
7143
+ const _hoisted_1$1$1 = { class: "pb-iframe-widget" };
7144
+ const _hoisted_2$k = ["src"];
7145
+ const _hoisted_3$h = {
7146
+ key: 1,
7147
+ class: "placeholder",
7148
+ textContent: "Empty URL"
7149
+ };
7150
+ const _sfc_main$3$1 = /* @__PURE__ */ defineComponent({
7151
+ __name: "PbIframeWidget",
7152
+ props: {
7153
+ part: {},
7154
+ placeholder: { type: Boolean }
7155
+ },
7156
+ setup(__props) {
7157
+ const props = __props;
7158
+ const pageBuilder = usePageBuilder();
7159
+ const url = computed(() => {
7160
+ var _a;
7161
+ const url2 = (_a = props.part.properties) == null ? void 0 : _a.url;
7162
+ if (!url2)
7163
+ return;
7164
+ if (typeof url2 !== "object")
7165
+ return;
7166
+ const locale = pageBuilder.getLocale();
7167
+ return url2[locale];
7168
+ });
7169
+ const style = computed(() => ({
7170
+ style: {
7171
+ width: "100%",
7172
+ height: `${height.value}px`
7173
+ }
7174
+ }));
7175
+ const height = ref(200);
7176
+ const updateHeight = (event) => {
7177
+ if (event.data && event.data.height) {
7178
+ height.value = event.data.height;
7179
+ }
7180
+ };
7181
+ onMounted(() => {
7182
+ window.addEventListener("message", updateHeight);
7183
+ });
7184
+ onBeforeUnmount(() => {
7185
+ window.removeEventListener("message", updateHeight);
7186
+ });
7187
+ return (_ctx, _cache) => {
7188
+ return openBlock(), createElementBlock("div", _hoisted_1$1$1, [
7189
+ url.value ? (openBlock(), createElementBlock("iframe", mergeProps({
7190
+ key: 0,
7191
+ src: url.value
7192
+ }, style.value), null, 16, _hoisted_2$k)) : _ctx.placeholder ? (openBlock(), createElementBlock("div", _hoisted_3$h)) : createCommentVNode("", true)
7193
+ ]);
7162
7194
  };
7163
7195
  }
7164
7196
  });
@@ -7166,41 +7198,46 @@ const defaultPartDefinitions = {
7166
7198
  "Section": {
7167
7199
  partType: "Section",
7168
7200
  partName: "Section",
7169
- creator: () => _sfc_main$6$1
7201
+ creator: () => _sfc_main$7$1
7170
7202
  },
7171
7203
  "GlobalDesignPart": {
7172
7204
  partType: "Section",
7173
7205
  partName: "GlobalDesignPart",
7174
- creator: () => _sfc_main$6$1
7206
+ creator: () => _sfc_main$7$1
7175
7207
  },
7176
7208
  "LocalDesignPart": {
7177
7209
  partType: "Section",
7178
7210
  partName: "LocalDesignPart",
7179
- creator: () => _sfc_main$6$1
7211
+ creator: () => _sfc_main$7$1
7180
7212
  },
7181
7213
  "LocalMarketingPart": {
7182
7214
  partType: "Section",
7183
7215
  partName: "LocalMarketingPart",
7184
- creator: () => _sfc_main$6$1
7216
+ creator: () => _sfc_main$7$1
7185
7217
  },
7186
7218
  "Block": {
7187
7219
  partType: "Block",
7188
7220
  partName: "Block",
7189
- creator: () => _sfc_main$8$1
7221
+ creator: () => _sfc_main$9$1
7190
7222
  },
7191
7223
  "TextWidget": {
7192
7224
  partType: "Widget",
7193
7225
  partName: "TextWidget",
7194
- creator: () => _sfc_main$4$1
7226
+ creator: () => _sfc_main$5$1
7195
7227
  },
7196
7228
  "ImageWidget": {
7197
7229
  partType: "Widget",
7198
7230
  partName: "ImageWidget",
7199
- creator: () => _sfc_main$5$1
7231
+ creator: () => _sfc_main$6$1
7200
7232
  },
7201
7233
  "HtmlWidget": {
7202
7234
  partType: "Widget",
7203
7235
  partName: "HtmlWidget",
7236
+ creator: () => _sfc_main$4$1
7237
+ },
7238
+ "IframeWidget": {
7239
+ partType: "Widget",
7240
+ partName: "IframeWidget",
7204
7241
  creator: () => _sfc_main$3$1
7205
7242
  }
7206
7243
  };
@@ -7223,15 +7260,25 @@ class PageBuilderViewerImpl {
7223
7260
  registerCustomPlugin(plugin) {
7224
7261
  if (plugin.widgets) {
7225
7262
  plugin.widgets.forEach((v) => {
7226
- partDefinitions$1[v.partName] = {
7227
- partType: "Widget",
7228
- partName: v.partName,
7229
- creator: () => _sfc_main$q,
7230
- component: v.component
7231
- };
7263
+ const w = { ...v };
7264
+ w.partType = "Widget";
7265
+ w.creator = () => _sfc_main$q;
7266
+ partDefinitions$1[v.partName] = w;
7232
7267
  });
7233
7268
  }
7234
7269
  }
7270
+ watchCustomWidgetData(part) {
7271
+ const def = partDefinitions$1[part.partName];
7272
+ if (!def || !def.dataWatcher)
7273
+ return false;
7274
+ return def.dataWatcher(part.properties);
7275
+ }
7276
+ provideCustomWidgetData(part) {
7277
+ const def = partDefinitions$1[part.partName];
7278
+ if (!def || !def.dataProvider)
7279
+ return Promise.resolve();
7280
+ return def.dataProvider(part.properties);
7281
+ }
7235
7282
  render(pageContent) {
7236
7283
  const rootPart = new RootPart();
7237
7284
  rootPart.pageBuilderId = this.instanceId;
@@ -7336,7 +7383,7 @@ const _sfc_main$2$1 = /* @__PURE__ */ defineComponent({
7336
7383
  class: normalizeClass([[_ctx.isMobilePage ? "mobile" : "pc"], "pb-page-content"])
7337
7384
  }, [
7338
7385
  (openBlock(true), createElementBlock(Fragment, null, renderList((_a = _ctx.page) == null ? void 0 : _a.children, (section) => {
7339
- return openBlock(), createBlock$1(_sfc_main$6$1, {
7386
+ return openBlock(), createBlock$1(_sfc_main$7$1, {
7340
7387
  key: section.partId,
7341
7388
  part: section
7342
7389
  }, null, 8, ["part"]);
@@ -7394,17 +7441,28 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
7394
7441
  __name: "PbCustomWidget",
7395
7442
  props: {
7396
7443
  part: {},
7397
- viewMode: { type: Boolean, default: false }
7444
+ dataWatcher: { type: Function },
7445
+ dataProvider: { type: Function }
7398
7446
  },
7399
7447
  setup(__props) {
7400
7448
  const props = __props;
7401
7449
  const pageBuilder = usePageBuilder();
7402
7450
  const comp = computed(() => pageBuilder.getCustomWidgetComponent(props.part));
7451
+ const data = ref({});
7403
7452
  const bind = computed(() => ({
7404
7453
  pageBuilderId: pageBuilder.instanceId,
7405
- properties: props.part.properties,
7406
- placeholder: true
7454
+ ...props.part.properties || {},
7455
+ placeholder: true,
7456
+ ...data.value || {}
7407
7457
  }));
7458
+ const updateData = async () => {
7459
+ data.value = await pageBuilder.provideCustomWidgetData(props.part);
7460
+ };
7461
+ onMounted(updateData);
7462
+ watch(
7463
+ () => pageBuilder.watchCustomWidgetData(props.part),
7464
+ () => updateData()
7465
+ );
7408
7466
  return (_ctx, _cache) => {
7409
7467
  return comp.value ? (openBlock(), createBlock$1(resolveDynamicComponent(comp.value), normalizeProps(mergeProps({ key: 0 }, bind.value)), null, 16)) : createCommentVNode("", true);
7410
7468
  };
@@ -7936,20 +7994,6 @@ class PartManager {
7936
7994
  }
7937
7995
  }
7938
7996
  }
7939
- getLocalDesignPartPropertyDefinitions(partName) {
7940
- let properties;
7941
- const partDef = this.getPartDefinition(partName);
7942
- if (!partDef || !partDef.propertyGroups)
7943
- return;
7944
- for (const group of partDef.propertyGroups) {
7945
- for (const property of group.properties) {
7946
- if (property.localized) {
7947
- properties = [...properties || [], property];
7948
- }
7949
- }
7950
- }
7951
- return properties;
7952
- }
7953
7997
  createPartComponent(part) {
7954
7998
  if (part) {
7955
7999
  const def = this.getPartDefinition(part.partName);
@@ -8028,12 +8072,12 @@ class PartManager {
8028
8072
  const defaultPartPropertyEditors = () => {
8029
8073
  return {
8030
8074
  "readonly-text": () => defineAsyncComponent(() => import("./PbPropertyEditorReadonlyText-Dgp_AVOD.js")),
8031
- "text": () => defineAsyncComponent(() => import("./PbPropertyEditorText-BWOKvwD9.js")),
8032
- "multiline-text": () => defineAsyncComponent(() => import("./PbPropertyEditorMultilineText-CefJbbiM.js")),
8075
+ "text": () => defineAsyncComponent(() => import("./PbPropertyEditorText-CleInrev.js")),
8076
+ "multiline-text": () => defineAsyncComponent(() => import("./PbPropertyEditorMultilineText-zmUCXJQZ.js")),
8033
8077
  "select": () => defineAsyncComponent(() => import("./PbPropertyEditorSelect-CWedbXJI.js")),
8034
- "color": () => defineAsyncComponent(() => import("./PbPropertyEditorColor-DI5Bm25g.js")),
8035
- "image": () => defineAsyncComponent(() => import("./PbPropertyEditorImage-DbxF_eg7.js")),
8036
- "html": () => defineAsyncComponent(() => import("./PbPropertyEditorHtml-Bb_kuc4m.js"))
8078
+ "color": () => defineAsyncComponent(() => import("./PbPropertyEditorColor-DEVkcUND.js")),
8079
+ "image": () => defineAsyncComponent(() => import("./PbPropertyEditorImage-DAEVOkpl.js")),
8080
+ "html": () => defineAsyncComponent(() => import("./PbPropertyEditorHtml-CxPlqBYx.js"))
8037
8081
  };
8038
8082
  };
8039
8083
  const getPropertyValueOfParts = (parts, propertyName) => {
@@ -8758,13 +8802,15 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
8758
8802
  }, properties.value), [
8759
8803
  thisComponent.value ? (openBlock(), createBlock$1(resolveDynamicComponent(thisComponent.value), {
8760
8804
  key: 0,
8761
- part: _ctx.part
8805
+ part: _ctx.part,
8806
+ placeholder: true
8762
8807
  }, null, 8, ["part"])) : createCommentVNode("", true),
8763
8808
  childComponents.value && childComponents.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_2$i, [
8764
8809
  (openBlock(true), createElementBlock(Fragment, null, renderList(childComponents.value, (child) => {
8765
8810
  return openBlock(), createBlock$1(resolveDynamicComponent(child.component), {
8766
8811
  key: child.part.partId,
8767
- part: child.part
8812
+ part: child.part,
8813
+ placeholder: true
8768
8814
  }, null, 8, ["part"]);
8769
8815
  }), 128))
8770
8816
  ])) : createCommentVNode("", true),
@@ -11996,7 +12042,7 @@ const widgets = [
11996
12042
  {
11997
12043
  partType: "Widget",
11998
12044
  partName: "TextWidget",
11999
- caption: "Text Widget",
12045
+ caption: "Text",
12000
12046
  icon: "insert_text",
12001
12047
  propertyGroups: [
12002
12048
  {
@@ -12034,12 +12080,12 @@ const widgets = [
12034
12080
  },
12035
12081
  localized: true,
12036
12082
  allowsChild: () => false,
12037
- creator: () => _sfc_main$4$1
12083
+ creator: () => _sfc_main$5$1
12038
12084
  },
12039
12085
  {
12040
12086
  partType: "Widget",
12041
12087
  partName: "ImageWidget",
12042
- caption: "Image Widget",
12088
+ caption: "Image",
12043
12089
  icon: "imagesmode",
12044
12090
  propertyGroups: [
12045
12091
  {
@@ -12060,12 +12106,12 @@ const widgets = [
12060
12106
  initialProperties: {},
12061
12107
  localized: true,
12062
12108
  allowsChild: () => false,
12063
- creator: () => _sfc_main$5$1
12109
+ creator: () => _sfc_main$6$1
12064
12110
  },
12065
12111
  {
12066
12112
  partType: "Widget",
12067
12113
  partName: "HtmlWidget",
12068
- caption: "HTML Widget",
12114
+ caption: "HTML",
12069
12115
  icon: "code",
12070
12116
  propertyGroups: [
12071
12117
  {
@@ -12087,6 +12133,33 @@ const widgets = [
12087
12133
  initialProperties: {},
12088
12134
  localized: true,
12089
12135
  allowsChild: () => false,
12136
+ creator: () => _sfc_main$4$1
12137
+ },
12138
+ {
12139
+ partType: "Widget",
12140
+ partName: "IframeWidget",
12141
+ caption: "IFrame",
12142
+ icon: "code",
12143
+ propertyGroups: [
12144
+ {
12145
+ groupName: "iframe",
12146
+ caption: "Iframe",
12147
+ properties: [
12148
+ {
12149
+ propertyName: "url",
12150
+ caption: "URL",
12151
+ propertyType: "text",
12152
+ params: "",
12153
+ localized: true,
12154
+ multiLang: true
12155
+ }
12156
+ ]
12157
+ },
12158
+ ...defaultWidgetPropertyGroups()
12159
+ ],
12160
+ initialProperties: {},
12161
+ localized: true,
12162
+ allowsChild: () => false,
12090
12163
  creator: () => _sfc_main$3$1
12091
12164
  }
12092
12165
  ];
@@ -12120,6 +12193,13 @@ const designPartDefinitions = [
12120
12193
  ]
12121
12194
  }
12122
12195
  ];
12196
+ const widgetPartDefinitions = [
12197
+ {
12198
+ groupName: "Widget",
12199
+ caption: "Widget",
12200
+ partDefinitions: widgets
12201
+ }
12202
+ ];
12123
12203
  const blockWidgetPartDefinitions = [
12124
12204
  {
12125
12205
  groupName: "Block",
@@ -12209,7 +12289,7 @@ const openPartAddModal = (modal, args, callback) => {
12209
12289
  };
12210
12290
  const openWidgetAddModal = (modal, args, callback) => {
12211
12291
  modal.openModal({
12212
- component: defineAsyncComponent(() => import("./PbWidgetAddModal-CQvFYzfU.js")),
12292
+ component: defineAsyncComponent(() => import("./PbWidgetAddModal-DoR8HJUd.js")),
12213
12293
  style: {
12214
12294
  width: "80%",
12215
12295
  height: "80%",
@@ -12313,6 +12393,36 @@ const _AddPartCommand = class _AddPartCommand {
12313
12393
  };
12314
12394
  __publicField(_AddPartCommand, "COMMAND_ID", "AddPart");
12315
12395
  let AddPartCommand = _AddPartCommand;
12396
+ const _AddSectionCommand = class _AddSectionCommand {
12397
+ constructor(modal) {
12398
+ __publicField(this, "commandId", _AddSectionCommand.COMMAND_ID);
12399
+ __publicField(this, "caption", "Add Section");
12400
+ this.modal = modal;
12401
+ }
12402
+ execute(pageBuilder, args) {
12403
+ const def = pageBuilder.partManager.getSectionDefinition();
12404
+ if (!def)
12405
+ return;
12406
+ addPart(pageBuilder, def);
12407
+ }
12408
+ };
12409
+ __publicField(_AddSectionCommand, "COMMAND_ID", "AddSection");
12410
+ let AddSectionCommand = _AddSectionCommand;
12411
+ const _AddBlockCommand = class _AddBlockCommand {
12412
+ constructor(modal) {
12413
+ __publicField(this, "commandId", _AddBlockCommand.COMMAND_ID);
12414
+ __publicField(this, "caption", "Add Block");
12415
+ this.modal = modal;
12416
+ }
12417
+ execute(pageBuilder, args) {
12418
+ const def = pageBuilder.partManager.getBlockDefinition();
12419
+ if (!def)
12420
+ return;
12421
+ addPart(pageBuilder, def);
12422
+ }
12423
+ };
12424
+ __publicField(_AddBlockCommand, "COMMAND_ID", "AddBlock");
12425
+ let AddBlockCommand = _AddBlockCommand;
12316
12426
  const addPart = (pageBuilder, def, attrs) => {
12317
12427
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
12318
12428
  const selected = pageBuilder.context.getSelectedParts()[0];
@@ -12401,29 +12511,13 @@ const addPart = (pageBuilder, def, attrs) => {
12401
12511
  }
12402
12512
  };
12403
12513
  const addSectionBefore = (pageBuilder, modal, args) => {
12404
- const def = args && args.partDefinition;
12405
- if (!def) {
12406
- const partDefinitionGroups = designPartDefinitions;
12407
- openPartAddModal(modal, {
12408
- ...args || {},
12409
- pageBuilder,
12410
- partDefinitionGroups
12411
- }, (part, attrs) => {
12412
- addSectionBefore(pageBuilder, modal, {
12413
- ...args || {},
12414
- partDefinition: part,
12415
- ...attrs || {}
12416
- });
12417
- });
12418
- return;
12419
- }
12420
12514
  const selected = pageBuilder.context.getSelectedParts()[0];
12421
12515
  if (!selected)
12422
12516
  return;
12423
12517
  const section = pageBuilder.partManager.findNearestSection(selected);
12424
12518
  if (!section || !section.parent || !section.parent.children)
12425
12519
  return;
12426
- const newSection = createPartWithDefinition(def);
12520
+ const newSection = createSection(pageBuilder);
12427
12521
  if (!newSection)
12428
12522
  return;
12429
12523
  const child = createBlock(pageBuilder);
@@ -12432,29 +12526,13 @@ const addSectionBefore = (pageBuilder, modal, args) => {
12432
12526
  insertParts(pageBuilder, section.parent.partId, index, [newSection], true);
12433
12527
  };
12434
12528
  const addSectionAfter = (pageBuilder, modal, args) => {
12435
- const def = args && args.partDefinition;
12436
- if (!def) {
12437
- const partDefinitionGroups = designPartDefinitions;
12438
- openPartAddModal(modal, {
12439
- ...args || {},
12440
- pageBuilder,
12441
- partDefinitionGroups
12442
- }, (part, attrs) => {
12443
- addSectionAfter(pageBuilder, modal, {
12444
- ...args || {},
12445
- partDefinition: part,
12446
- ...attrs || {}
12447
- });
12448
- });
12449
- return;
12450
- }
12451
12529
  const selected = pageBuilder.context.getSelectedParts()[0];
12452
12530
  if (!selected)
12453
12531
  return;
12454
12532
  const section = pageBuilder.partManager.findNearestSection(selected);
12455
12533
  if (!section || !section.parent || !section.parent.children)
12456
12534
  return;
12457
- const newSection = createPartWithDefinition(def);
12535
+ const newSection = createSection(pageBuilder);
12458
12536
  if (!newSection)
12459
12537
  return;
12460
12538
  const child = createBlock(pageBuilder);
@@ -12577,7 +12655,7 @@ const _AddSectionAboveCommand = class _AddSectionAboveCommand {
12577
12655
  this.modal = modal;
12578
12656
  }
12579
12657
  execute(pageBuilder, args) {
12580
- addSectionBefore(pageBuilder, this.modal, args);
12658
+ addSectionBefore(pageBuilder, this.modal);
12581
12659
  }
12582
12660
  };
12583
12661
  __publicField(_AddSectionAboveCommand, "COMMAND_ID", "AddSectionAbove");
@@ -12590,7 +12668,7 @@ const _AddSectionBelowCommand = class _AddSectionBelowCommand {
12590
12668
  this.modal = modal;
12591
12669
  }
12592
12670
  execute(pageBuilder, args) {
12593
- addSectionAfter(pageBuilder, this.modal, args);
12671
+ addSectionAfter(pageBuilder, this.modal);
12594
12672
  }
12595
12673
  };
12596
12674
  __publicField(_AddSectionBelowCommand, "COMMAND_ID", "AddSectionBelow");
@@ -12802,6 +12880,8 @@ const createDefaultCommands = (modal) => {
12802
12880
  new OpenAddPartModalCommand(modal),
12803
12881
  new OpenAddWidgetModalCommand(modal),
12804
12882
  new AddPartCommand(modal),
12883
+ new AddSectionCommand(modal),
12884
+ new AddBlockCommand(modal),
12805
12885
  new AddSectionAboveCommand(modal),
12806
12886
  new AddSectionBelowCommand(modal),
12807
12887
  new AddBlockLeftCommand(),
@@ -13094,14 +13174,20 @@ const createDefaultToolButtonGroups = () => {
13094
13174
  groupId: "add",
13095
13175
  buttons: [
13096
13176
  {
13097
- buttonId: "core:openAddPartLayer",
13098
- caption: "Add Design Part...",
13177
+ buttonId: "core:addSection",
13178
+ caption: "Add Section",
13099
13179
  icon: "add_row_below",
13100
- handler: (modeler) => modeler.commandRegistry.executeCommand(OpenAddPartModalCommand.COMMAND_ID)
13180
+ handler: (modeler) => modeler.commandRegistry.executeCommand(AddSectionCommand.COMMAND_ID)
13101
13181
  },
13102
13182
  {
13103
- buttonId: "core:openAddWidgetLayer",
13104
- caption: "Add Widget...",
13183
+ buttonId: "core:addBlock",
13184
+ caption: "Add Block",
13185
+ icon: "add_column_right",
13186
+ handler: (modeler) => modeler.commandRegistry.executeCommand(AddBlockCommand.COMMAND_ID)
13187
+ },
13188
+ {
13189
+ buttonId: "core:addWidget",
13190
+ caption: "Add Widget",
13105
13191
  icon: "desktop_landscape_add",
13106
13192
  handler: (modeler) => modeler.commandRegistry.executeCommand(OpenAddWidgetModalCommand.COMMAND_ID)
13107
13193
  }
@@ -13307,6 +13393,8 @@ class PageBuilderEditorImpl {
13307
13393
  __publicField(this, "scale", ref(1));
13308
13394
  __publicField(this, "locale", ref("en"));
13309
13395
  __publicField(this, "locales", ref(["en"]));
13396
+ __publicField(this, "customWidgets", []);
13397
+ __publicField(this, "providers", {});
13310
13398
  this.model = new Model2();
13311
13399
  this.context = new PageBuilderContextImpl(this);
13312
13400
  this.editMode = "free";
@@ -13331,6 +13419,21 @@ class PageBuilderEditorImpl {
13331
13419
  return def.component;
13332
13420
  }
13333
13421
  }
13422
+ getProvider(name) {
13423
+ return this.providers[name];
13424
+ }
13425
+ watchCustomWidgetData(part) {
13426
+ const def = this.partManager.getPartDefinition(part.partName);
13427
+ if (!def || !def.dataWatcher)
13428
+ return false;
13429
+ return def.dataWatcher(part.properties);
13430
+ }
13431
+ provideCustomWidgetData(part) {
13432
+ const def = this.partManager.getPartDefinition(part.partName);
13433
+ if (!def || !def.dataProvider)
13434
+ return Promise.resolve();
13435
+ return def.dataProvider(part.properties);
13436
+ }
13334
13437
  registerPlugin(plugin) {
13335
13438
  if (plugin.partDefinitions)
13336
13439
  this.partManager.registerPartDefinitions(plugin.partDefinitions);
@@ -13352,13 +13455,23 @@ class PageBuilderEditorImpl {
13352
13455
  const partDefinitions2 = {};
13353
13456
  plugin.widgets.forEach((v) => {
13354
13457
  const w = { ...v };
13355
- w.partName = "Widget";
13458
+ w.partType = "Widget";
13356
13459
  w.creator = () => _sfc_main$q;
13357
13460
  w.propertyGroups = [...w.propertyGroups, ...defaultWidgetPropertyGroups()];
13358
13461
  partDefinitions2[v.partName] = w;
13462
+ const found = this.customWidgets.find((x) => x.partName === v.partName);
13463
+ if (!found) {
13464
+ this.customWidgets.push(w);
13465
+ }
13359
13466
  });
13360
13467
  this.partManager.registerPartDefinitions(partDefinitions2);
13361
13468
  }
13469
+ if (plugin.providers) {
13470
+ this.providers = {
13471
+ ...this.providers,
13472
+ ...plugin.providers
13473
+ };
13474
+ }
13362
13475
  if (plugin.propertyEditors) {
13363
13476
  this.partManager.registerPartPropertyEditors(plugin.propertyEditors);
13364
13477
  }
@@ -13434,6 +13547,9 @@ class PageBuilderEditorImpl {
13434
13547
  ]
13435
13548
  });
13436
13549
  }
13550
+ getCustomWidgets() {
13551
+ return this.customWidgets;
13552
+ }
13437
13553
  getEmptyPageContent() {
13438
13554
  const block = new Block();
13439
13555
  const section = new Section();
@@ -13479,7 +13595,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
13479
13595
  const insertSection = (index) => {
13480
13596
  if (!props.page)
13481
13597
  return;
13482
- editor.commandRegistry.executeCommand(OpenAddPartModalCommand.COMMAND_ID);
13598
+ editor.commandRegistry.executeCommand(AddSectionCommand.COMMAND_ID);
13483
13599
  };
13484
13600
  return (_ctx, _cache) => {
13485
13601
  var _a;
@@ -13572,7 +13688,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
13572
13688
  };
13573
13689
  }
13574
13690
  });
13575
- const canvasStyle = '.pb-page {\n margin: 0 auto;\n margin-top: 20px;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n}\n.pb-page .pb-page-content.selected {\n outline: 2px solid #4998f8;\n outline-offset: 5px;\n}\n.pb-page * {\n box-sizing: border-box;\n}\n.pb-add-widget-button {\n width: 100%;\n height: 100%;\n min-height: 200px;\n position: relative;\n}\n.pb-add-widget-button button {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n padding: 8px;\n background: none;\n border: none;\n cursor: pointer;\n}\n.pb-add-widget-button button:hover {\n background-color: #eeeeee;\n}\n.pb-add-widget-button .icon {\n font-size: 1rem;\n vertical-align: middle;\n}\n.pb-add-widget-button .text {\n font-size: 1rem;\n vertical-align: middle;\n margin-left: 0.4rem;\n}\n.pb-section {\n position: relative;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n outline: 1px dashed #ccc;\n background-color: #fff;\n}\n.pb-section:hover:not(:has(.pb-block:hover)) {\n background-color: #f0f0f0;\n}\n.pb-section.selected {\n outline: 1px solid #e67e22;\n outline-offset: 1px;\n z-index: 999;\n}\n.pb-section.pb-section-static {\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n}\n.pb-section.pb-section-static:after {\n content: "";\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n background-color: rgba(0, 0, 0, 0.2);\n}\n.pb-section-static .pb-widget {\n outline: none;\n}\n.pb-block {\n display: flex;\n min-width: 1px;\n position: relative;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n width: 100%;\n outline: 1px dashed #ccc;\n}\n.pb-block:hover:not(:has(.pb-widget:hover)) {\n background-color: #f0f0f0;\n}\n.pb-block.selected {\n outline: 1px solid #8e44ad;\n outline-offset: 1px;\n z-index: 999;\n}\n.pb-widget {\n position: relative;\n outline: 1px dashed #ccc;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n}\n.pb-widget.selected {\n outline: 2px solid #27ae60;\n outline-offset: 1px;\n z-index: 999;\n}\n.pb-widget .children {\n position: absolute;\n width: 100%;\n height: 100%;\n}\n.pb-widget .pan-handle {\n position: absolute;\n left: -6px;\n top: -6px;\n width: 12px;\n height: 12px;\n background-color: #27ae60;\n cursor: move;\n}\n.pb-widget .resize-handle {\n position: absolute;\n right: -6px;\n bottom: -6px;\n width: 12px;\n height: 12px;\n background-color: #27ae60;\n cursor: nwse-resize;\n}\n.pb-widget {\n position: relative;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n width: 100%;\n}\n.pb-widget .children {\n position: absolute;\n width: 100%;\n height: 100%;\n}\n.pb-text-widget {\n width: 100%;\n height: fit-content;\n}\n.pb-text-widget .text {\n color: #333;\n}\n.pb-text-widget.empty .text {\n color: #999;\n}\n.pb-image-widget {\n width: 100%;\n}\n.pb-image-widget .image {\n width: 100%;\n}\n.pb-image-widget .empty {\n height: 100px;\n background-color: #eee;\n text-align: center;\n}\n.pb-image-widget .empty span {\n font-size: 40px;\n color: #999;\n line-height: 100px;\n vertical-align: middle;\n}\n.pb-html-widget {\n width: 100%;\n height: fit-content;\n}\n.pb-html-widget.empty {\n padding: 4px 0;\n font-size: 18px;\n color: #999;\n}\n.pb-product-list-widget {\n width: 100%;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n justify-content: flex-start;\n align-items: center;\n}\n.pb-product-list-widget .product-wrapper {\n width: 25%;\n}\n.pb-product-list-widget .product-wrapper .product {\n width: 95%;\n margin: 0 auto;\n padding-top: 8px;\n padding-bottom: 8px;\n}\n.pb-product-list-widget .product-wrapper img {\n width: 100%;\n}\n.pb-product-list-widget .product-wrapper .name {\n margin-top: 8px;\n font-size: 14px;\n}\n.pb-product-list-widget .product-wrapper .price {\n margin-top: 8px;\n font-size: 14px;\n font-weight: bold;\n}\n.pb-product-list-widget .product-wrapper .empty {\n height: 200px;\n background-color: #eee;\n text-align: center;\n}\n.pb-product-list-widget .product-wrapper .empty span {\n font-size: 40px;\n color: #999;\n line-height: 200px;\n vertical-align: middle;\n}\n@media (max-width: 768px) {\n .pb-product-list-widget .product-wrapper {\n width: 50%;\n }\n}\n.mobile .pb-product-list-widget .product-wrapper {\n width: 50%;\n}\n.pb-login-widget {\n height: 200px;\n text-align: center;\n}\n.pb-login-widget h3 {\n padding: 0;\n margin: 0;\n font-size: 32px;\n font-weight: bold;\n color: #ccc;\n line-height: 200px;\n vertical-align: middle;\n}\n.font-icon {\n font-family: Material Symbols Outlined, monospace;\n font-size: 1rem;\n max-width: 1em;\n}\nhtml, body {\n font-family: Noto Sans, Noto Sans KR, Noto Sans JP, Arial, sans-serif;\n font-size: 12px;\n}\nbody {\n background-color: white;\n height: 100%;\n margin: 0;\n}\n.pb-canvas-wrapper {\n padding: 32px 40px 56px 40px;\n height: 100%;\n background-color: #aaa;\n overflow: auto;\n}\n.pb-canvas-wrapper .pb-canvas {\n display: flex;\n flex-direction: row;\n transform-origin: top left;\n width: fit-content;\n min-width: 40px;\n min-height: 40px;\n margin: 0 auto;\n}\n.pb-position-mark {\n background-color: #ff3333;\n opacity: 0.5;\n border-radius: 2px;\n}\n.pb-add-section-handle {\n position: relative;\n text-align: center;\n cursor: pointer;\n z-index: 5;\n height: 0;\n}\n.pb-add-section-handle.top::before, .pb-add-section-handle.bottom::before, .pb-add-section-handle.middle::before {\n content: "";\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n opacity: 0;\n pointer-events: none;\n}\n.pb-add-section-handle.bottom {\n left: 50%;\n bottom: -32px;\n}\n.pb-add-section-handle:hover.top::before, .pb-add-section-handle:hover.bottom::before, .pb-add-section-handle:hover.middle::before,\n.pb-add-section-handle:hover > i {\n opacity: 1;\n}\n.pb-add-section-handle > i {\n vertical-align: middle;\n position: absolute;\n top: 50%;\n left: -20px;\n font-size: 2rem;\n transform: translate(-50%, -50%);\n opacity: 0.2;\n}\n.pb-button {\n background: none;\n border: none;\n cursor: pointer;\n vertical-align: middle;\n}\n.pb-guideline {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n}\n.pb-guideline.selected {\n z-index: 3;\n}\n.pb-guideline.preselect {\n z-index: 4;\n}';
13691
+ const canvasStyle = '.pb-page {\n margin: 0 auto;\n margin-top: 20px;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n}\n.pb-page .pb-page-content.selected {\n outline: 2px solid #4998f8;\n outline-offset: 5px;\n}\n.pb-page * {\n box-sizing: border-box;\n}\n.pb-add-widget-button {\n width: 100%;\n height: 100%;\n min-height: 200px;\n position: relative;\n}\n.pb-add-widget-button button {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n padding: 8px;\n background: none;\n border: none;\n cursor: pointer;\n}\n.pb-add-widget-button button:hover {\n background-color: #eeeeee;\n}\n.pb-add-widget-button .icon {\n font-size: 1rem;\n vertical-align: middle;\n}\n.pb-add-widget-button .text {\n font-size: 1rem;\n vertical-align: middle;\n margin-left: 0.4rem;\n}\n.pb-section {\n position: relative;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n outline: 1px dashed #ccc;\n background-color: #fff;\n}\n.pb-section:hover:not(:has(.pb-block:hover)) {\n background-color: #f0f0f0;\n}\n.pb-section.selected {\n outline: 1px solid #e67e22;\n outline-offset: 1px;\n z-index: 999;\n}\n.pb-section.pb-section-static {\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n}\n.pb-section.pb-section-static:after {\n content: "";\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n background-color: rgba(0, 0, 0, 0.2);\n}\n.pb-section-static .pb-widget {\n outline: none;\n}\n.pb-block {\n display: flex;\n min-width: 1px;\n position: relative;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n width: 100%;\n outline: 1px dashed #ccc;\n}\n.pb-block:hover:not(:has(.pb-widget:hover)) {\n background-color: #f0f0f0;\n}\n.pb-block.selected {\n outline: 1px solid #8e44ad;\n outline-offset: 1px;\n z-index: 999;\n}\n.pb-widget {\n position: relative;\n outline: 1px dashed #ccc;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n}\n.pb-widget.selected {\n outline: 2px solid #27ae60;\n outline-offset: 1px;\n z-index: 999;\n}\n.pb-widget .children {\n position: absolute;\n width: 100%;\n height: 100%;\n}\n.pb-widget .pan-handle {\n position: absolute;\n left: -6px;\n top: -6px;\n width: 12px;\n height: 12px;\n background-color: #27ae60;\n cursor: move;\n}\n.pb-widget .resize-handle {\n position: absolute;\n right: -6px;\n bottom: -6px;\n width: 12px;\n height: 12px;\n background-color: #27ae60;\n cursor: nwse-resize;\n}\n.pb-widget {\n position: relative;\n background-position: 50% 50%;\n background-repeat: no-repeat;\n background-size: cover;\n width: 100%;\n}\n.pb-widget .children {\n position: absolute;\n width: 100%;\n height: 100%;\n}\n.pb-text-widget {\n width: 100%;\n height: fit-content;\n}\n.pb-text-widget .text {\n color: #333;\n}\n.pb-text-widget .placeholder {\n padding: 4px 0;\n font-size: 18px;\n text-align: center;\n color: #999;\n}\n.pb-image-widget {\n width: 100%;\n}\n.pb-image-widget .image {\n width: 100%;\n}\n.pb-image-widget .empty {\n height: 100px;\n background-color: #eee;\n text-align: center;\n}\n.pb-image-widget .empty span {\n font-size: 40px;\n color: #999;\n line-height: 100px;\n vertical-align: middle;\n}\n.pb-html-widget {\n width: 100%;\n height: fit-content;\n}\n.pb-html-widget .placeholder {\n padding: 4px 0;\n font-size: 18px;\n text-align: center;\n color: #999;\n}\n.pb-iframe-widget {\n width: 100%;\n height: fit-content;\n}\n.pb-iframe-widget .placeholder {\n padding: 4px 0;\n font-size: 18px;\n text-align: center;\n color: #999;\n}\n.pb-product-list-widget {\n width: 100%;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n justify-content: flex-start;\n align-items: center;\n}\n.pb-product-list-widget .product-wrapper {\n width: 25%;\n}\n.pb-product-list-widget .product-wrapper .product {\n width: 95%;\n margin: 0 auto;\n padding-top: 8px;\n padding-bottom: 8px;\n}\n.pb-product-list-widget .product-wrapper img {\n width: 100%;\n}\n.pb-product-list-widget .product-wrapper .name {\n margin-top: 8px;\n font-size: 14px;\n}\n.pb-product-list-widget .product-wrapper .price {\n margin-top: 8px;\n font-size: 14px;\n font-weight: bold;\n}\n.pb-product-list-widget .product-wrapper .empty {\n height: 200px;\n background-color: #eee;\n text-align: center;\n}\n.pb-product-list-widget .product-wrapper .empty span {\n font-size: 40px;\n color: #999;\n line-height: 200px;\n vertical-align: middle;\n}\n@media (max-width: 768px) {\n .pb-product-list-widget .product-wrapper {\n width: 50%;\n }\n}\n.mobile .pb-product-list-widget .product-wrapper {\n width: 50%;\n}\n.pb-login-widget {\n height: 200px;\n text-align: center;\n}\n.pb-login-widget h3 {\n padding: 0;\n margin: 0;\n font-size: 32px;\n font-weight: bold;\n color: #ccc;\n line-height: 200px;\n vertical-align: middle;\n}\n.font-icon {\n font-family: Material Symbols Outlined, monospace;\n font-size: 1rem;\n max-width: 1em;\n}\nhtml, body {\n font-family: Noto Sans, Noto Sans KR, Noto Sans JP, Arial, sans-serif;\n font-size: 12px;\n}\nbody {\n background-color: white;\n height: 100%;\n margin: 0;\n}\n.pb-canvas-wrapper {\n padding: 32px 40px 56px 40px;\n height: 100%;\n background-color: #aaa;\n overflow: auto;\n}\n.pb-canvas-wrapper .pb-canvas {\n display: flex;\n flex-direction: row;\n transform-origin: top left;\n width: fit-content;\n min-width: 40px;\n min-height: 40px;\n margin: 0 auto;\n}\n.pb-position-mark {\n background-color: #ff3333;\n opacity: 0.5;\n border-radius: 2px;\n}\n.pb-add-section-handle {\n position: relative;\n text-align: center;\n cursor: pointer;\n z-index: 5;\n height: 0;\n}\n.pb-add-section-handle.top::before, .pb-add-section-handle.bottom::before, .pb-add-section-handle.middle::before {\n content: "";\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n opacity: 0;\n pointer-events: none;\n}\n.pb-add-section-handle.bottom {\n left: 50%;\n bottom: -32px;\n}\n.pb-add-section-handle:hover.top::before, .pb-add-section-handle:hover.bottom::before, .pb-add-section-handle:hover.middle::before,\n.pb-add-section-handle:hover > i {\n opacity: 1;\n}\n.pb-add-section-handle > i {\n vertical-align: middle;\n position: absolute;\n top: 50%;\n left: -20px;\n font-size: 2rem;\n transform: translate(-50%, -50%);\n opacity: 0.2;\n}\n.pb-button {\n background: none;\n border: none;\n cursor: pointer;\n vertical-align: middle;\n}\n.pb-guideline {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n}\n.pb-guideline.selected {\n z-index: 3;\n}\n.pb-guideline.preselect {\n z-index: 4;\n}';
13576
13692
  const _hoisted_1$a = { class: "pb-canvas-frame" };
13577
13693
  const _sfc_main$b = /* @__PURE__ */ defineComponent({
13578
13694
  __name: "PbCanvasFrame",
@@ -13586,7 +13702,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
13586
13702
  return (_b = (_a = iframeRef.value) == null ? void 0 : _a.contentWindow) == null ? void 0 : _b.document;
13587
13703
  },
13588
13704
  () => {
13589
- var _a, _b, _c, _d, _e;
13705
+ var _a, _b, _c, _d, _e, _f, _g, _h;
13590
13706
  if ((_c = (_b = (_a = iframeRef.value) == null ? void 0 : _a.contentWindow) == null ? void 0 : _b.document) == null ? void 0 : _c.head) {
13591
13707
  const head = (_e = (_d = iframeRef.value) == null ? void 0 : _d.contentWindow) == null ? void 0 : _e.document.head;
13592
13708
  head.innerHTML = `
@@ -13609,6 +13725,16 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
13609
13725
  <link href="https://fonts.googleapis.com/css2?family=Material+Icons+Outlined" rel="stylesheet" />
13610
13726
  <style>${canvasStyle}</style>
13611
13727
  `;
13728
+ const script2 = (_g = (_f = iframeRef.value) == null ? void 0 : _f.contentWindow) == null ? void 0 : _g.document.createElement("script");
13729
+ script2.innerHTML = `
13730
+ function forwardPostMessage(event) {
13731
+ if (event.data) {
13732
+ window.parent.postMessage(event.data, '*');
13733
+ }
13734
+ }
13735
+ window.addEventListener('message', forwardPostMessage);
13736
+ `;
13737
+ (_h = iframeRef.value) == null ? void 0 : _h.contentWindow.document.head.appendChild(script2);
13612
13738
  pageBuilderEditor.keyHandlers.addDocumentKeyEventListener(iframeRef.value.contentWindow.document.body);
13613
13739
  stopIframeWatch();
13614
13740
  }
@@ -14398,18 +14524,20 @@ export {
14398
14524
  PageBuilderViewerEvent as g,
14399
14525
  Part as h,
14400
14526
  _sfc_main$q as i,
14401
- _sfc_main$3$1 as j,
14402
- _sfc_main$5$1 as k,
14403
- _sfc_main$4$1 as l,
14404
- RootPart as m,
14405
- Section as n,
14406
- Widget as o,
14407
- createPageBuilderViewer as p,
14408
- createPartComponent as q,
14409
- createPartComponents as r,
14410
- providePageBuilder as s,
14411
- providePageBuilderViewer as t,
14527
+ _sfc_main$4$1 as j,
14528
+ _sfc_main$3$1 as k,
14529
+ _sfc_main$6$1 as l,
14530
+ _sfc_main$5$1 as m,
14531
+ RootPart as n,
14532
+ Section as o,
14533
+ Widget as p,
14534
+ createPageBuilderViewer as q,
14535
+ createPartComponent as r,
14536
+ createPartComponents as s,
14537
+ providePageBuilder as t,
14412
14538
  usePageBuilderEditor as u,
14413
- usePageBuilder as v,
14414
- usePageBuilderViewer as w
14539
+ providePageBuilderViewer as v,
14540
+ widgetPartDefinitions as w,
14541
+ usePageBuilder as x,
14542
+ usePageBuilderViewer as y
14415
14543
  };