@g1cloud/page-builder-editor 1.0.0-alpha.2 → 1.0.0-alpha.3

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,6 +1,6 @@
1
1
  import { defineComponent, openBlock, createElementBlock, createElementVNode, toDisplayString } from "vue";
2
2
  import { useModal } from "@g1cloud/bluesea";
3
- import { u as usePageBuilderEditor, P as PageBuilderEditorEvent } from "./index-Dwk2ffWe.js";
3
+ import { u as usePageBuilderEditor, P as PageBuilderEditorEvent } from "./index-DSV66_zQ.js";
4
4
  const _hoisted_1 = { class: "property-editor property-editor-image flex-align-center" };
5
5
  const _hoisted_2 = { class: "label" };
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 { u as usePageBuilderEditor, P as PageBuilderEditorEvent } from "./index-Dwk2ffWe.js";
3
+ import { u as usePageBuilderEditor, P as PageBuilderEditorEvent } from "./index-DSV66_zQ.js";
4
4
  const _hoisted_1 = { class: "property-editor property-editor-product flex-align-center" };
5
5
  const _hoisted_2 = { class: "label" };
6
6
  const _hoisted_3 = ["textContent"];
@@ -6835,7 +6835,7 @@ let Model$1 = class Model {
6835
6835
  this.rootPart = ref(new RootPart());
6836
6836
  }
6837
6837
  };
6838
- const _hoisted_1$8$1 = ["data-model-id"];
6838
+ const _hoisted_1$7$1 = ["data-model-id"];
6839
6839
  const _hoisted_2$3$1 = {
6840
6840
  key: 1,
6841
6841
  class: "pb-nested-widget"
@@ -6870,11 +6870,11 @@ const _sfc_main$8$1 = /* @__PURE__ */ defineComponent({
6870
6870
  }, null, 8, ["part"]);
6871
6871
  }), 128))
6872
6872
  ])) : createCommentVNode("", true)
6873
- ], 16, _hoisted_1$8$1);
6873
+ ], 16, _hoisted_1$7$1);
6874
6874
  };
6875
6875
  }
6876
6876
  });
6877
- const _hoisted_1$7$1 = ["data-model-id"];
6877
+ const _hoisted_1$6$1 = ["data-model-id"];
6878
6878
  const _sfc_main$7$1 = /* @__PURE__ */ defineComponent({
6879
6879
  __name: "PbBlock",
6880
6880
  props: {
@@ -6898,11 +6898,11 @@ const _sfc_main$7$1 = /* @__PURE__ */ defineComponent({
6898
6898
  part: child
6899
6899
  }, null, 8, ["part"]);
6900
6900
  }), 128))
6901
- ], 16, _hoisted_1$7$1);
6901
+ ], 16, _hoisted_1$6$1);
6902
6902
  };
6903
6903
  }
6904
6904
  });
6905
- const _hoisted_1$6$1 = { class: "pb-block" };
6905
+ const _hoisted_1$5$1 = { class: "pb-block" };
6906
6906
  const _hoisted_2$2$1 = /* @__PURE__ */ createElementVNode("div", {
6907
6907
  class: "pb-widget",
6908
6908
  style: { "margin": "0 auto" }
@@ -6921,11 +6921,11 @@ const _sfc_main$6$1 = /* @__PURE__ */ defineComponent({
6921
6921
  },
6922
6922
  setup(__props) {
6923
6923
  return (_ctx, _cache) => {
6924
- return openBlock(), createElementBlock("div", _hoisted_1$6$1, _hoisted_3$2$1);
6924
+ return openBlock(), createElementBlock("div", _hoisted_1$5$1, _hoisted_3$2$1);
6925
6925
  };
6926
6926
  }
6927
6927
  });
6928
- const _hoisted_1$5$1 = ["data-model-id"];
6928
+ const _hoisted_1$4$1 = ["data-model-id"];
6929
6929
  const _sfc_main$5$1 = /* @__PURE__ */ defineComponent({
6930
6930
  __name: "PbSection",
6931
6931
  props: {
@@ -6951,11 +6951,11 @@ const _sfc_main$5$1 = /* @__PURE__ */ defineComponent({
6951
6951
  part: block
6952
6952
  }, null, 8, ["part"]);
6953
6953
  }), 128)) : createCommentVNode("", true)
6954
- ], 16, _hoisted_1$5$1);
6954
+ ], 16, _hoisted_1$4$1);
6955
6955
  };
6956
6956
  }
6957
6957
  });
6958
- const _hoisted_1$4$1 = { class: "pb-image-widget" };
6958
+ const _hoisted_1$3$1 = { class: "pb-image-widget" };
6959
6959
  const _hoisted_2$1$1 = ["src"];
6960
6960
  const _hoisted_3$1$1 = {
6961
6961
  key: 1,
@@ -6974,7 +6974,7 @@ const _sfc_main$4$1 = /* @__PURE__ */ defineComponent({
6974
6974
  setup(__props) {
6975
6975
  return (_ctx, _cache) => {
6976
6976
  var _a, _b;
6977
- return openBlock(), createElementBlock("div", _hoisted_1$4$1, [
6977
+ return openBlock(), createElementBlock("div", _hoisted_1$3$1, [
6978
6978
  ((_a = _ctx.part.properties) == null ? void 0 : _a.image) ? (openBlock(), createElementBlock("img", {
6979
6979
  key: 0,
6980
6980
  src: (_b = _ctx.part.properties) == null ? void 0 : _b.image,
@@ -6985,7 +6985,7 @@ const _sfc_main$4$1 = /* @__PURE__ */ defineComponent({
6985
6985
  };
6986
6986
  }
6987
6987
  });
6988
- const _hoisted_1$3$1 = ["textContent"];
6988
+ const _hoisted_1$2$1 = ["textContent"];
6989
6989
  const _sfc_main$3$1 = /* @__PURE__ */ defineComponent({
6990
6990
  __name: "PbTextWidget",
6991
6991
  props: {
@@ -7009,7 +7009,7 @@ const _sfc_main$3$1 = /* @__PURE__ */ defineComponent({
7009
7009
  }, [
7010
7010
  createElementVNode("div", mergeProps({ class: "text" }, style.value, {
7011
7011
  textContent: toDisplayString(((_b = _ctx.part.properties) == null ? void 0 : _b.text) || (!_ctx.viewMode ? "Empty text" : " "))
7012
- }), null, 16, _hoisted_1$3$1)
7012
+ }), null, 16, _hoisted_1$2$1)
7013
7013
  ], 2);
7014
7014
  };
7015
7015
  }
@@ -7048,7 +7048,7 @@ const PageBuilderViewerEvent = {
7048
7048
  }
7049
7049
  }
7050
7050
  };
7051
- const _hoisted_1$2$1 = { class: "pb-product-list-widget" };
7051
+ const _hoisted_1$1$1 = { class: "pb-product-list-widget" };
7052
7052
  const _hoisted_2$l = { class: "product" };
7053
7053
  const _hoisted_3$g = { class: "image" };
7054
7054
  const _hoisted_4$d = ["src"];
@@ -7090,7 +7090,7 @@ const _sfc_main$2$1 = /* @__PURE__ */ defineComponent({
7090
7090
  return (_a = props.part.properties) == null ? void 0 : _a.products;
7091
7091
  }, () => updateProducts());
7092
7092
  return (_ctx, _cache) => {
7093
- return openBlock(), createElementBlock("div", _hoisted_1$2$1, [
7093
+ return openBlock(), createElementBlock("div", _hoisted_1$1$1, [
7094
7094
  products.value ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(productCount.value, (index) => {
7095
7095
  return openBlock(), createElementBlock("div", {
7096
7096
  key: index,
@@ -7228,11 +7228,11 @@ const createPartComponent = (part) => {
7228
7228
  }
7229
7229
  };
7230
7230
  const getPartDefinition = (partName) => partDefinitions$1[partName];
7231
- const _hoisted_1$1$1 = { class: "pb-page-content" };
7232
7231
  const _sfc_main$1$1 = /* @__PURE__ */ defineComponent({
7233
7232
  __name: "PbPage",
7234
7233
  props: {
7235
- page: {}
7234
+ page: {},
7235
+ isMobilePage: { type: Boolean }
7236
7236
  },
7237
7237
  setup(__props) {
7238
7238
  const properties = computed(() => ({
@@ -7243,14 +7243,16 @@ const _sfc_main$1$1 = /* @__PURE__ */ defineComponent({
7243
7243
  return (_ctx, _cache) => {
7244
7244
  var _a;
7245
7245
  return openBlock(), createElementBlock("div", mergeProps({ class: "pb-page" }, properties.value), [
7246
- createElementVNode("div", _hoisted_1$1$1, [
7246
+ createElementVNode("div", {
7247
+ class: normalizeClass([[_ctx.isMobilePage ? "mobile" : "pc"], "pb-page-content"])
7248
+ }, [
7247
7249
  (openBlock(true), createElementBlock(Fragment, null, renderList((_a = _ctx.page) == null ? void 0 : _a.children, (section) => {
7248
7250
  return openBlock(), createBlock$1(_sfc_main$5$1, {
7249
7251
  key: section.partId,
7250
7252
  part: section
7251
7253
  }, null, 8, ["part"]);
7252
7254
  }), 128))
7253
- ])
7255
+ ], 2)
7254
7256
  ], 16);
7255
7257
  };
7256
7258
  }
@@ -7260,14 +7262,15 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
7260
7262
  __name: "PageBuilderViewer",
7261
7263
  props: {
7262
7264
  instanceId: {},
7263
- pageContent: {}
7265
+ pageContent: {},
7266
+ isMobilePage: { type: Boolean }
7264
7267
  },
7265
7268
  setup(__props) {
7266
7269
  const props = __props;
7267
7270
  const pageBuilderViewer = createPageBuilderViewer();
7268
7271
  pageBuilderViewer.instanceId = props.instanceId;
7269
7272
  providePageBuilderViewer(pageBuilderViewer);
7270
- const page = computed(() => pageBuilderViewer.model.rootPart.value.children && pageBuilderViewer.model.rootPart.value.children[0]);
7273
+ const page = computed(() => pageBuilderViewer.model.rootPart.value.children && pageBuilderViewer.model.rootPart.value.children[props.isMobilePage ? 0 : 1]);
7271
7274
  onMounted(() => {
7272
7275
  if (props.pageContent) {
7273
7276
  pageBuilderViewer.render(props.pageContent);
@@ -7285,8 +7288,9 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
7285
7288
  return openBlock(), createElementBlock("div", _hoisted_1$u, [
7286
7289
  page.value ? (openBlock(), createBlock$1(_sfc_main$1$1, {
7287
7290
  key: 0,
7291
+ "is-mobile-page": _ctx.isMobilePage,
7288
7292
  page: page.value
7289
- }, null, 8, ["page"])) : createCommentVNode("", true)
7293
+ }, null, 8, ["is-mobile-page", "page"])) : createCommentVNode("", true)
7290
7294
  ]);
7291
7295
  };
7292
7296
  }
@@ -7864,8 +7868,8 @@ const defaultPartPropertyEditors = () => {
7864
7868
  "text": () => defineAsyncComponent(() => import("./PbPropertyEditorText-DNdXl-Tr.js")),
7865
7869
  "multiline-text": () => defineAsyncComponent(() => import("./PbPropertyEditorMultilineText-BMeNUGm8.js")),
7866
7870
  "select": () => defineAsyncComponent(() => import("./PbPropertyEditorSelect-BJovN1su.js")),
7867
- "image": () => defineAsyncComponent(() => import("./PbPropertyEditorImage-DA92v7AE.js")),
7868
- "product": () => defineAsyncComponent(() => import("./PbPropertyEditorProduct-CkydxTwD.js"))
7871
+ "image": () => defineAsyncComponent(() => import("./PbPropertyEditorImage-B4sYTAHu.js")),
7872
+ "product": () => defineAsyncComponent(() => import("./PbPropertyEditorProduct-qHnu5dvM.js"))
7869
7873
  };
7870
7874
  };
7871
7875
  const getPropertyValueOfParts = (parts, propertyName) => {
@@ -1,4 +1,4 @@
1
- import { B, a, M, b, c, _, P, d, e, f, g, h, i, R, j, S, k, W, l, m, n, o, p, q } from "./index-Dwk2ffWe.js";
1
+ import { B, a, M, b, c, _, P, d, e, f, g, h, i, R, j, S, k, W, l, m, n, o, p, q } from "./index-DSV66_zQ.js";
2
2
  export {
3
3
  B as BLOCK_TYPE,
4
4
  a as Block,
@@ -6837,7 +6837,7 @@ var __publicField = (obj, key, value) => {
6837
6837
  this.rootPart = vue.ref(new RootPart());
6838
6838
  }
6839
6839
  };
6840
- const _hoisted_1$8$1 = ["data-model-id"];
6840
+ const _hoisted_1$7$1 = ["data-model-id"];
6841
6841
  const _hoisted_2$3$1 = {
6842
6842
  key: 1,
6843
6843
  class: "pb-nested-widget"
@@ -6872,11 +6872,11 @@ var __publicField = (obj, key, value) => {
6872
6872
  }, null, 8, ["part"]);
6873
6873
  }), 128))
6874
6874
  ])) : vue.createCommentVNode("", true)
6875
- ], 16, _hoisted_1$8$1);
6875
+ ], 16, _hoisted_1$7$1);
6876
6876
  };
6877
6877
  }
6878
6878
  });
6879
- const _hoisted_1$7$1 = ["data-model-id"];
6879
+ const _hoisted_1$6$1 = ["data-model-id"];
6880
6880
  const _sfc_main$7$1 = /* @__PURE__ */ vue.defineComponent({
6881
6881
  __name: "PbBlock",
6882
6882
  props: {
@@ -6900,11 +6900,11 @@ var __publicField = (obj, key, value) => {
6900
6900
  part: child
6901
6901
  }, null, 8, ["part"]);
6902
6902
  }), 128))
6903
- ], 16, _hoisted_1$7$1);
6903
+ ], 16, _hoisted_1$6$1);
6904
6904
  };
6905
6905
  }
6906
6906
  });
6907
- const _hoisted_1$6$1 = { class: "pb-block" };
6907
+ const _hoisted_1$5$1 = { class: "pb-block" };
6908
6908
  const _hoisted_2$2$1 = /* @__PURE__ */ vue.createElementVNode("div", {
6909
6909
  class: "pb-widget",
6910
6910
  style: { "margin": "0 auto" }
@@ -6923,11 +6923,11 @@ var __publicField = (obj, key, value) => {
6923
6923
  },
6924
6924
  setup(__props) {
6925
6925
  return (_ctx, _cache) => {
6926
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$6$1, _hoisted_3$2$1);
6926
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$5$1, _hoisted_3$2$1);
6927
6927
  };
6928
6928
  }
6929
6929
  });
6930
- const _hoisted_1$5$1 = ["data-model-id"];
6930
+ const _hoisted_1$4$1 = ["data-model-id"];
6931
6931
  const _sfc_main$5$1 = /* @__PURE__ */ vue.defineComponent({
6932
6932
  __name: "PbSection",
6933
6933
  props: {
@@ -6953,11 +6953,11 @@ var __publicField = (obj, key, value) => {
6953
6953
  part: block
6954
6954
  }, null, 8, ["part"]);
6955
6955
  }), 128)) : vue.createCommentVNode("", true)
6956
- ], 16, _hoisted_1$5$1);
6956
+ ], 16, _hoisted_1$4$1);
6957
6957
  };
6958
6958
  }
6959
6959
  });
6960
- const _hoisted_1$4$1 = { class: "pb-image-widget" };
6960
+ const _hoisted_1$3$1 = { class: "pb-image-widget" };
6961
6961
  const _hoisted_2$1$1 = ["src"];
6962
6962
  const _hoisted_3$1$1 = {
6963
6963
  key: 1,
@@ -6976,7 +6976,7 @@ var __publicField = (obj, key, value) => {
6976
6976
  setup(__props) {
6977
6977
  return (_ctx, _cache) => {
6978
6978
  var _a, _b;
6979
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$4$1, [
6979
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$3$1, [
6980
6980
  ((_a = _ctx.part.properties) == null ? void 0 : _a.image) ? (vue.openBlock(), vue.createElementBlock("img", {
6981
6981
  key: 0,
6982
6982
  src: (_b = _ctx.part.properties) == null ? void 0 : _b.image,
@@ -6987,7 +6987,7 @@ var __publicField = (obj, key, value) => {
6987
6987
  };
6988
6988
  }
6989
6989
  });
6990
- const _hoisted_1$3$1 = ["textContent"];
6990
+ const _hoisted_1$2$1 = ["textContent"];
6991
6991
  const _sfc_main$3$1 = /* @__PURE__ */ vue.defineComponent({
6992
6992
  __name: "PbTextWidget",
6993
6993
  props: {
@@ -7011,7 +7011,7 @@ var __publicField = (obj, key, value) => {
7011
7011
  }, [
7012
7012
  vue.createElementVNode("div", vue.mergeProps({ class: "text" }, style.value, {
7013
7013
  textContent: vue.toDisplayString(((_b = _ctx.part.properties) == null ? void 0 : _b.text) || (!_ctx.viewMode ? "Empty text" : " "))
7014
- }), null, 16, _hoisted_1$3$1)
7014
+ }), null, 16, _hoisted_1$2$1)
7015
7015
  ], 2);
7016
7016
  };
7017
7017
  }
@@ -7050,7 +7050,7 @@ var __publicField = (obj, key, value) => {
7050
7050
  }
7051
7051
  }
7052
7052
  };
7053
- const _hoisted_1$2$1 = { class: "pb-product-list-widget" };
7053
+ const _hoisted_1$1$1 = { class: "pb-product-list-widget" };
7054
7054
  const _hoisted_2$t = { class: "product" };
7055
7055
  const _hoisted_3$o = { class: "image" };
7056
7056
  const _hoisted_4$f = ["src"];
@@ -7092,7 +7092,7 @@ var __publicField = (obj, key, value) => {
7092
7092
  return (_a = props.part.properties) == null ? void 0 : _a.products;
7093
7093
  }, () => updateProducts());
7094
7094
  return (_ctx, _cache) => {
7095
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2$1, [
7095
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1$1, [
7096
7096
  products.value ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(productCount.value, (index) => {
7097
7097
  return vue.openBlock(), vue.createElementBlock("div", {
7098
7098
  key: index,
@@ -7230,11 +7230,11 @@ var __publicField = (obj, key, value) => {
7230
7230
  }
7231
7231
  };
7232
7232
  const getPartDefinition = (partName) => partDefinitions$1[partName];
7233
- const _hoisted_1$1$1 = { class: "pb-page-content" };
7234
7233
  const _sfc_main$1$1 = /* @__PURE__ */ vue.defineComponent({
7235
7234
  __name: "PbPage",
7236
7235
  props: {
7237
- page: {}
7236
+ page: {},
7237
+ isMobilePage: { type: Boolean }
7238
7238
  },
7239
7239
  setup(__props) {
7240
7240
  const properties = vue.computed(() => ({
@@ -7245,14 +7245,16 @@ var __publicField = (obj, key, value) => {
7245
7245
  return (_ctx, _cache) => {
7246
7246
  var _a;
7247
7247
  return vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({ class: "pb-page" }, properties.value), [
7248
- vue.createElementVNode("div", _hoisted_1$1$1, [
7248
+ vue.createElementVNode("div", {
7249
+ class: vue.normalizeClass([[_ctx.isMobilePage ? "mobile" : "pc"], "pb-page-content"])
7250
+ }, [
7249
7251
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList((_a = _ctx.page) == null ? void 0 : _a.children, (section) => {
7250
7252
  return vue.openBlock(), vue.createBlock(_sfc_main$5$1, {
7251
7253
  key: section.partId,
7252
7254
  part: section
7253
7255
  }, null, 8, ["part"]);
7254
7256
  }), 128))
7255
- ])
7257
+ ], 2)
7256
7258
  ], 16);
7257
7259
  };
7258
7260
  }
@@ -7262,14 +7264,15 @@ var __publicField = (obj, key, value) => {
7262
7264
  __name: "PageBuilderViewer",
7263
7265
  props: {
7264
7266
  instanceId: {},
7265
- pageContent: {}
7267
+ pageContent: {},
7268
+ isMobilePage: { type: Boolean }
7266
7269
  },
7267
7270
  setup(__props) {
7268
7271
  const props = __props;
7269
7272
  const pageBuilderViewer = createPageBuilderViewer();
7270
7273
  pageBuilderViewer.instanceId = props.instanceId;
7271
7274
  providePageBuilderViewer(pageBuilderViewer);
7272
- const page = vue.computed(() => pageBuilderViewer.model.rootPart.value.children && pageBuilderViewer.model.rootPart.value.children[0]);
7275
+ const page = vue.computed(() => pageBuilderViewer.model.rootPart.value.children && pageBuilderViewer.model.rootPart.value.children[props.isMobilePage ? 0 : 1]);
7273
7276
  vue.onMounted(() => {
7274
7277
  if (props.pageContent) {
7275
7278
  pageBuilderViewer.render(props.pageContent);
@@ -7287,8 +7290,9 @@ var __publicField = (obj, key, value) => {
7287
7290
  return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$C, [
7288
7291
  page.value ? (vue.openBlock(), vue.createBlock(_sfc_main$1$1, {
7289
7292
  key: 0,
7293
+ "is-mobile-page": _ctx.isMobilePage,
7290
7294
  page: page.value
7291
- }, null, 8, ["page"])) : vue.createCommentVNode("", true)
7295
+ }, null, 8, ["is-mobile-page", "page"])) : vue.createCommentVNode("", true)
7292
7296
  ]);
7293
7297
  };
7294
7298
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@g1cloud/page-builder-editor",
3
3
  "private": false,
4
- "version": "1.0.0-alpha.2",
4
+ "version": "1.0.0-alpha.3",
5
5
  "engins": {
6
6
  "node": ">= 20.0.0"
7
7
  },
@@ -27,7 +27,7 @@
27
27
  "vue-router": "^4.3.2",
28
28
  "vue3-click-away": "^1.2.4",
29
29
  "yjs": "^13.6.14",
30
- "@g1cloud/page-builder-viewer": "1.0.0-alpha.2"
30
+ "@g1cloud/page-builder-viewer": "1.0.0-alpha.3"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/node": "^20.12.7",