@g1cloud/page-builder-editor 1.0.0-alpha.43 → 1.0.0-alpha.44

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, createVNode, unref } from "vue";
2
2
  import { BSTextInput } from "@g1cloud/bluesea";
3
- import { P as PbColorPicker } from "./index-DMnlRaKO.js";
3
+ import { P as PbColorPicker } from "./index-HSJAvXph.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-DMnlRaKO.js";
3
+ import { u as usePageBuilderEditor } from "./index-HSJAvXph.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-DMnlRaKO.js";
2
+ import { u as usePageBuilderEditor } from "./index-HSJAvXph.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-DMnlRaKO.js";
3
+ import { u as usePageBuilderEditor } from "./index-HSJAvXph.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,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-DMnlRaKO.js";
3
+ import { u as usePageBuilderEditor } from "./index-HSJAvXph.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-DMnlRaKO.js";
3
+ import { s as selectYoutubeVideo } from "./index-HSJAvXph.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-DMnlRaKO.js";
3
+ import { w as widgetPartDefinitions } from "./index-HSJAvXph.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"];
@@ -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, Fragment, createElementVNode, normalizeStyle, createCommentVNode, toDisplayString, onMounted, onBeforeUnmount, createBlock as createBlock$1, resolveDynamicComponent, unref, provide, inject, watch, renderList, 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, resolveDynamicComponent, unref, provide, inject, watch, renderList, normalizeProps, mergeProps, normalizeClass, withDirectives, vShow, reactive, defineAsyncComponent, 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();
@@ -6879,14 +6879,21 @@ let Model$1 = class Model {
6879
6879
  this.rootPart = ref(new RootPart());
6880
6880
  }
6881
6881
  };
6882
- const _hoisted_1$b$1 = ["data-part-id"];
6883
- const _sfc_main$c$1 = /* @__PURE__ */ defineComponent({
6882
+ const _hoisted_1$a$1 = ["data-part-id"];
6883
+ const _sfc_main$b$1 = /* @__PURE__ */ defineComponent({
6884
6884
  __name: "PbWidget",
6885
6885
  props: {
6886
6886
  part: {}
6887
6887
  },
6888
- setup(__props) {
6888
+ emits: ["update:visible"],
6889
+ setup(__props, { emit: __emit }) {
6889
6890
  const props = __props;
6891
+ const emit = __emit;
6892
+ const visible = ref(true);
6893
+ const updateVisible = (value) => {
6894
+ visible.value = value;
6895
+ emit("update:visible", value);
6896
+ };
6890
6897
  const classNames = computed(() => [getPartClassName(props.part), props.part.getClassNames()]);
6891
6898
  const styleTag = computed(() => props.part.getStyleTag());
6892
6899
  const style = computed(() => ({
@@ -6896,83 +6903,76 @@ const _sfc_main$c$1 = /* @__PURE__ */ defineComponent({
6896
6903
  const thisComponent = computed(() => createPartComponent(props.part));
6897
6904
  return (_ctx, _cache) => {
6898
6905
  return openBlock(), createElementBlock(Fragment, null, [
6899
- styleTag.value ? (openBlock(), createBlock$1(resolveDynamicComponent("style"), {
6906
+ styleTag.value && visible.value ? (openBlock(), createBlock$1(resolveDynamicComponent("style"), {
6900
6907
  key: 0,
6901
6908
  innerHTML: styleTag.value
6902
6909
  }, null, 8, ["innerHTML"])) : createCommentVNode("", true),
6903
- createElementVNode("div", {
6910
+ withDirectives(createElementVNode("div", {
6904
6911
  class: normalizeClass([classNames.value, "pb-widget"]),
6905
6912
  "data-part-id": _ctx.part.partId,
6906
6913
  style: normalizeStyle(style.value)
6907
6914
  }, [
6908
6915
  thisComponent.value ? (openBlock(), createBlock$1(resolveDynamicComponent(thisComponent.value), {
6909
6916
  key: 0,
6910
- part: _ctx.part
6911
- }, null, 8, ["part"])) : createCommentVNode("", true)
6912
- ], 14, _hoisted_1$b$1)
6917
+ part: _ctx.part,
6918
+ "onUpdate:visible": updateVisible
6919
+ }, null, 40, ["part"])) : createCommentVNode("", true)
6920
+ ], 14, _hoisted_1$a$1), [
6921
+ [vShow, visible.value]
6922
+ ])
6913
6923
  ], 64);
6914
6924
  };
6915
6925
  }
6916
6926
  });
6917
- const _hoisted_1$a$1 = ["data-part-id"];
6918
- const _sfc_main$b$1 = /* @__PURE__ */ defineComponent({
6927
+ const _hoisted_1$9$1 = ["data-part-id"];
6928
+ const _sfc_main$a$1 = /* @__PURE__ */ defineComponent({
6919
6929
  __name: "PbBlock",
6920
6930
  props: {
6921
6931
  part: {},
6922
6932
  isMobilePage: { type: Boolean }
6923
6933
  },
6924
- setup(__props) {
6934
+ emits: ["update:visible"],
6935
+ setup(__props, { emit: __emit }) {
6925
6936
  const props = __props;
6937
+ const emit = __emit;
6938
+ const visible = ref(true);
6939
+ const childrenVisible = {};
6940
+ const updateVisible = (partId, value) => {
6941
+ childrenVisible[partId] = value;
6942
+ visible.value = props.part.children.some((child) => !(child.partId in childrenVisible) || childrenVisible[child.partId]);
6943
+ emit("update:visible", visible.value);
6944
+ };
6926
6945
  const classNames = computed(() => [getPartClassName(props.part), props.part.getClassNames()]);
6927
6946
  const styleTag = computed(() => props.part.getStyleTag());
6928
6947
  const style = computed(() => ({
6929
6948
  ...props.part.getStyles(props.isMobilePage),
6930
6949
  ...props.part.getInlineStyles()
6931
6950
  }));
6932
- computed(() => createPartComponents(props.part.children));
6933
6951
  return (_ctx, _cache) => {
6934
6952
  return openBlock(), createElementBlock(Fragment, null, [
6935
- styleTag.value ? (openBlock(), createBlock$1(resolveDynamicComponent("style"), {
6953
+ styleTag.value && visible.value ? (openBlock(), createBlock$1(resolveDynamicComponent("style"), {
6936
6954
  key: 0,
6937
6955
  innerHTML: styleTag.value
6938
6956
  }, null, 8, ["innerHTML"])) : createCommentVNode("", true),
6939
- createElementVNode("div", {
6957
+ withDirectives(createElementVNode("div", {
6940
6958
  class: normalizeClass([classNames.value, "pb-block"]),
6941
6959
  "data-part-id": _ctx.part.partId,
6942
6960
  style: normalizeStyle(style.value)
6943
6961
  }, [
6944
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.part.children, (child) => {
6945
- return openBlock(), createBlock$1(_sfc_main$c$1, {
6962
+ _ctx.part.children && _ctx.part.children.length > 0 ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_ctx.part.children, (child) => {
6963
+ return openBlock(), createBlock$1(_sfc_main$b$1, {
6946
6964
  key: child.partId,
6947
- part: child
6948
- }, null, 8, ["part"]);
6949
- }), 128))
6950
- ], 14, _hoisted_1$a$1)
6965
+ part: child,
6966
+ "onUpdate:visible": (value) => updateVisible(child.partId, value)
6967
+ }, null, 8, ["part", "onUpdate:visible"]);
6968
+ }), 128)) : createCommentVNode("", true)
6969
+ ], 14, _hoisted_1$9$1), [
6970
+ [vShow, visible.value]
6971
+ ])
6951
6972
  ], 64);
6952
6973
  };
6953
6974
  }
6954
6975
  });
6955
- const _hoisted_1$9$1 = { class: "pb-block" };
6956
- const _sfc_main$a$1 = /* @__PURE__ */ defineComponent({
6957
- __name: "PbLoginDepart",
6958
- props: {
6959
- part: {}
6960
- },
6961
- setup(__props) {
6962
- return (_ctx, _cache) => {
6963
- return openBlock(), createElementBlock("div", _hoisted_1$9$1, _cache[0] || (_cache[0] = [
6964
- createElementVNode("div", {
6965
- class: "pb-widget",
6966
- style: { "margin": "0 auto" }
6967
- }, [
6968
- createElementVNode("div", { class: "pb-login-widget" }, [
6969
- createElementVNode("h3", null, "Login Design Part")
6970
- ])
6971
- ], -1)
6972
- ]));
6973
- };
6974
- }
6975
- });
6976
6976
  const _hoisted_1$8$1 = ["data-part-id"];
6977
6977
  const _sfc_main$9$1 = /* @__PURE__ */ defineComponent({
6978
6978
  __name: "PbSection",
@@ -6982,6 +6982,12 @@ const _sfc_main$9$1 = /* @__PURE__ */ defineComponent({
6982
6982
  },
6983
6983
  setup(__props) {
6984
6984
  const props = __props;
6985
+ const visible = ref(true);
6986
+ const childrenVisible = {};
6987
+ const updateVisible = (partId, value) => {
6988
+ childrenVisible[partId] = value;
6989
+ visible.value = props.part.children.some((child) => !(child.partId in childrenVisible) || childrenVisible[child.partId]);
6990
+ };
6985
6991
  const classNames = computed(() => [getPartClassName(props.part), props.part.getClassNames()]);
6986
6992
  const styleTag = computed(() => props.part.getStyleTag());
6987
6993
  const style = computed(() => ({
@@ -6989,28 +6995,27 @@ const _sfc_main$9$1 = /* @__PURE__ */ defineComponent({
6989
6995
  ...props.part.getInlineStyles()
6990
6996
  }));
6991
6997
  return (_ctx, _cache) => {
6992
- var _a;
6993
6998
  return openBlock(), createElementBlock(Fragment, null, [
6994
- styleTag.value ? (openBlock(), createBlock$1(resolveDynamicComponent("style"), {
6999
+ styleTag.value && visible.value ? (openBlock(), createBlock$1(resolveDynamicComponent("style"), {
6995
7000
  key: 0,
6996
7001
  innerHTML: styleTag.value
6997
7002
  }, null, 8, ["innerHTML"])) : createCommentVNode("", true),
6998
- createElementVNode("div", {
7003
+ withDirectives(createElementVNode("div", {
6999
7004
  class: normalizeClass([classNames.value, "pb-section"]),
7000
7005
  "data-part-id": _ctx.part.partId,
7001
7006
  style: normalizeStyle(style.value)
7002
7007
  }, [
7003
- ((_a = _ctx.part.properties) == null ? void 0 : _a.name) === "Login Design Part" ? (openBlock(), createBlock$1(_sfc_main$a$1, {
7004
- key: 0,
7005
- part: _ctx.part
7006
- }, null, 8, ["part"])) : _ctx.part.children && _ctx.part.children.length > 0 ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(_ctx.part.children, (block) => {
7007
- return openBlock(), createBlock$1(_sfc_main$b$1, {
7008
- key: block.partId,
7008
+ _ctx.part.children && _ctx.part.children.length > 0 ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_ctx.part.children, (child) => {
7009
+ return openBlock(), createBlock$1(_sfc_main$a$1, {
7010
+ key: child.partId,
7009
7011
  "is-mobile-page": _ctx.isMobilePage,
7010
- part: block
7011
- }, null, 8, ["is-mobile-page", "part"]);
7012
+ part: child,
7013
+ "onUpdate:visible": (value) => updateVisible(child.partId, value)
7014
+ }, null, 8, ["is-mobile-page", "part", "onUpdate:visible"]);
7012
7015
  }), 128)) : createCommentVNode("", true)
7013
- ], 14, _hoisted_1$8$1)
7016
+ ], 14, _hoisted_1$8$1), [
7017
+ [vShow, visible.value]
7018
+ ])
7014
7019
  ], 64);
7015
7020
  };
7016
7021
  }
@@ -7280,7 +7285,7 @@ const defaultPartDefinitions = {
7280
7285
  partType: "Block",
7281
7286
  partName: "Block",
7282
7287
  className: "pb-block",
7283
- creator: () => _sfc_main$b$1
7288
+ creator: () => _sfc_main$a$1
7284
7289
  },
7285
7290
  "TextWidget": {
7286
7291
  partType: "Widget",
@@ -8171,15 +8176,15 @@ class PartManager {
8171
8176
  const defaultPartPropertyEditors = () => {
8172
8177
  return {
8173
8178
  "readonly-text": () => defineAsyncComponent(() => import("./PbPropertyEditorReadonlyText-Dgp_AVOD.js")),
8174
- "text": () => defineAsyncComponent(() => import("./PbPropertyEditorText-DmfUyQGj.js")),
8179
+ "text": () => defineAsyncComponent(() => import("./PbPropertyEditorText-4FO396e0.js")),
8175
8180
  "number": () => defineAsyncComponent(() => import("./PbPropertyEditorNumber-TTgo0zbQ.js")),
8176
8181
  "boolean": () => defineAsyncComponent(() => import("./PbPropertyEditorBoolean-C7-iSAtn.js")),
8177
- "multiline-text": () => defineAsyncComponent(() => import("./PbPropertyEditorMultilineText-DfvOukAA.js")),
8182
+ "multiline-text": () => defineAsyncComponent(() => import("./PbPropertyEditorMultilineText-P-U54Cz2.js")),
8178
8183
  "select": () => defineAsyncComponent(() => import("./PbPropertyEditorSelect-CWedbXJI.js")),
8179
- "color": () => defineAsyncComponent(() => import("./PbPropertyEditorColor-ECWITss2.js")),
8180
- "image": () => defineAsyncComponent(() => import("./PbPropertyEditorImage-D9sBmfaV.js")),
8181
- "html": () => defineAsyncComponent(() => import("./PbPropertyEditorHtml-Bpa0EKp9.js")),
8182
- "youtube": () => defineAsyncComponent(() => import("./PbPropertyEditorYoutube-D0EpPwPV.js"))
8184
+ "color": () => defineAsyncComponent(() => import("./PbPropertyEditorColor-B3xl9E3o.js")),
8185
+ "image": () => defineAsyncComponent(() => import("./PbPropertyEditorImage-BVxHJlyq.js")),
8186
+ "html": () => defineAsyncComponent(() => import("./PbPropertyEditorHtml-EMisPKLD.js")),
8187
+ "youtube": () => defineAsyncComponent(() => import("./PbPropertyEditorYoutube-P8ajWtxn.js"))
8183
8188
  };
8184
8189
  };
8185
8190
  const getPropertyValueOfParts = (parts, propertyName) => {
@@ -12533,7 +12538,7 @@ __publicField(_OpenAddWidgetModalCommand, "COMMAND_ID", "OpenAddWidgetModal");
12533
12538
  let OpenAddWidgetModalCommand = _OpenAddWidgetModalCommand;
12534
12539
  const openWidgetAddModal = (modal, args, callback) => {
12535
12540
  modal.openModal({
12536
- component: defineAsyncComponent(() => import("./PbWidgetAddModal-BDzxd8h_.js")),
12541
+ component: defineAsyncComponent(() => import("./PbWidgetAddModal-B0LCiyLg.js")),
12537
12542
  style: {
12538
12543
  width: "80%",
12539
12544
  height: "80%",
@@ -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-DMnlRaKO.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-HSJAvXph.js";
2
2
  export {
3
3
  B as BLOCK_TYPE,
4
4
  b as Block,
@@ -6880,14 +6880,21 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
6880
6880
  this.rootPart = vue.ref(new RootPart());
6881
6881
  }
6882
6882
  };
6883
- const _hoisted_1$b$1 = ["data-part-id"];
6884
- const _sfc_main$c$1 = /* @__PURE__ */ vue.defineComponent({
6883
+ const _hoisted_1$a$1 = ["data-part-id"];
6884
+ const _sfc_main$b$1 = /* @__PURE__ */ vue.defineComponent({
6885
6885
  __name: "PbWidget",
6886
6886
  props: {
6887
6887
  part: {}
6888
6888
  },
6889
- setup(__props) {
6889
+ emits: ["update:visible"],
6890
+ setup(__props, { emit: __emit }) {
6890
6891
  const props = __props;
6892
+ const emit = __emit;
6893
+ const visible = vue.ref(true);
6894
+ const updateVisible = (value) => {
6895
+ visible.value = value;
6896
+ emit("update:visible", value);
6897
+ };
6891
6898
  const classNames = vue.computed(() => [getPartClassName(props.part), props.part.getClassNames()]);
6892
6899
  const styleTag = vue.computed(() => props.part.getStyleTag());
6893
6900
  const style = vue.computed(() => ({
@@ -6897,83 +6904,76 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
6897
6904
  const thisComponent = vue.computed(() => createPartComponent(props.part));
6898
6905
  return (_ctx, _cache) => {
6899
6906
  return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
6900
- styleTag.value ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent("style"), {
6907
+ styleTag.value && visible.value ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent("style"), {
6901
6908
  key: 0,
6902
6909
  innerHTML: styleTag.value
6903
6910
  }, null, 8, ["innerHTML"])) : vue.createCommentVNode("", true),
6904
- vue.createElementVNode("div", {
6911
+ vue.withDirectives(vue.createElementVNode("div", {
6905
6912
  class: vue.normalizeClass([classNames.value, "pb-widget"]),
6906
6913
  "data-part-id": _ctx.part.partId,
6907
6914
  style: vue.normalizeStyle(style.value)
6908
6915
  }, [
6909
6916
  thisComponent.value ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(thisComponent.value), {
6910
6917
  key: 0,
6911
- part: _ctx.part
6912
- }, null, 8, ["part"])) : vue.createCommentVNode("", true)
6913
- ], 14, _hoisted_1$b$1)
6918
+ part: _ctx.part,
6919
+ "onUpdate:visible": updateVisible
6920
+ }, null, 40, ["part"])) : vue.createCommentVNode("", true)
6921
+ ], 14, _hoisted_1$a$1), [
6922
+ [vue.vShow, visible.value]
6923
+ ])
6914
6924
  ], 64);
6915
6925
  };
6916
6926
  }
6917
6927
  });
6918
- const _hoisted_1$a$1 = ["data-part-id"];
6919
- const _sfc_main$b$1 = /* @__PURE__ */ vue.defineComponent({
6928
+ const _hoisted_1$9$1 = ["data-part-id"];
6929
+ const _sfc_main$a$1 = /* @__PURE__ */ vue.defineComponent({
6920
6930
  __name: "PbBlock",
6921
6931
  props: {
6922
6932
  part: {},
6923
6933
  isMobilePage: { type: Boolean }
6924
6934
  },
6925
- setup(__props) {
6935
+ emits: ["update:visible"],
6936
+ setup(__props, { emit: __emit }) {
6926
6937
  const props = __props;
6938
+ const emit = __emit;
6939
+ const visible = vue.ref(true);
6940
+ const childrenVisible = {};
6941
+ const updateVisible = (partId, value) => {
6942
+ childrenVisible[partId] = value;
6943
+ visible.value = props.part.children.some((child) => !(child.partId in childrenVisible) || childrenVisible[child.partId]);
6944
+ emit("update:visible", visible.value);
6945
+ };
6927
6946
  const classNames = vue.computed(() => [getPartClassName(props.part), props.part.getClassNames()]);
6928
6947
  const styleTag = vue.computed(() => props.part.getStyleTag());
6929
6948
  const style = vue.computed(() => ({
6930
6949
  ...props.part.getStyles(props.isMobilePage),
6931
6950
  ...props.part.getInlineStyles()
6932
6951
  }));
6933
- vue.computed(() => createPartComponents(props.part.children));
6934
6952
  return (_ctx, _cache) => {
6935
6953
  return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
6936
- styleTag.value ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent("style"), {
6954
+ styleTag.value && visible.value ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent("style"), {
6937
6955
  key: 0,
6938
6956
  innerHTML: styleTag.value
6939
6957
  }, null, 8, ["innerHTML"])) : vue.createCommentVNode("", true),
6940
- vue.createElementVNode("div", {
6958
+ vue.withDirectives(vue.createElementVNode("div", {
6941
6959
  class: vue.normalizeClass([classNames.value, "pb-block"]),
6942
6960
  "data-part-id": _ctx.part.partId,
6943
6961
  style: vue.normalizeStyle(style.value)
6944
6962
  }, [
6945
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.part.children, (child) => {
6946
- return vue.openBlock(), vue.createBlock(_sfc_main$c$1, {
6963
+ _ctx.part.children && _ctx.part.children.length > 0 ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(_ctx.part.children, (child) => {
6964
+ return vue.openBlock(), vue.createBlock(_sfc_main$b$1, {
6947
6965
  key: child.partId,
6948
- part: child
6949
- }, null, 8, ["part"]);
6950
- }), 128))
6951
- ], 14, _hoisted_1$a$1)
6966
+ part: child,
6967
+ "onUpdate:visible": (value) => updateVisible(child.partId, value)
6968
+ }, null, 8, ["part", "onUpdate:visible"]);
6969
+ }), 128)) : vue.createCommentVNode("", true)
6970
+ ], 14, _hoisted_1$9$1), [
6971
+ [vue.vShow, visible.value]
6972
+ ])
6952
6973
  ], 64);
6953
6974
  };
6954
6975
  }
6955
6976
  });
6956
- const _hoisted_1$9$1 = { class: "pb-block" };
6957
- const _sfc_main$a$1 = /* @__PURE__ */ vue.defineComponent({
6958
- __name: "PbLoginDepart",
6959
- props: {
6960
- part: {}
6961
- },
6962
- setup(__props) {
6963
- return (_ctx, _cache) => {
6964
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$9$1, _cache[0] || (_cache[0] = [
6965
- vue.createElementVNode("div", {
6966
- class: "pb-widget",
6967
- style: { "margin": "0 auto" }
6968
- }, [
6969
- vue.createElementVNode("div", { class: "pb-login-widget" }, [
6970
- vue.createElementVNode("h3", null, "Login Design Part")
6971
- ])
6972
- ], -1)
6973
- ]));
6974
- };
6975
- }
6976
- });
6977
6977
  const _hoisted_1$8$1 = ["data-part-id"];
6978
6978
  const _sfc_main$9$1 = /* @__PURE__ */ vue.defineComponent({
6979
6979
  __name: "PbSection",
@@ -6983,6 +6983,12 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
6983
6983
  },
6984
6984
  setup(__props) {
6985
6985
  const props = __props;
6986
+ const visible = vue.ref(true);
6987
+ const childrenVisible = {};
6988
+ const updateVisible = (partId, value) => {
6989
+ childrenVisible[partId] = value;
6990
+ visible.value = props.part.children.some((child) => !(child.partId in childrenVisible) || childrenVisible[child.partId]);
6991
+ };
6986
6992
  const classNames = vue.computed(() => [getPartClassName(props.part), props.part.getClassNames()]);
6987
6993
  const styleTag = vue.computed(() => props.part.getStyleTag());
6988
6994
  const style = vue.computed(() => ({
@@ -6990,28 +6996,27 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
6990
6996
  ...props.part.getInlineStyles()
6991
6997
  }));
6992
6998
  return (_ctx, _cache) => {
6993
- var _a;
6994
6999
  return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
6995
- styleTag.value ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent("style"), {
7000
+ styleTag.value && visible.value ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent("style"), {
6996
7001
  key: 0,
6997
7002
  innerHTML: styleTag.value
6998
7003
  }, null, 8, ["innerHTML"])) : vue.createCommentVNode("", true),
6999
- vue.createElementVNode("div", {
7004
+ vue.withDirectives(vue.createElementVNode("div", {
7000
7005
  class: vue.normalizeClass([classNames.value, "pb-section"]),
7001
7006
  "data-part-id": _ctx.part.partId,
7002
7007
  style: vue.normalizeStyle(style.value)
7003
7008
  }, [
7004
- ((_a = _ctx.part.properties) == null ? void 0 : _a.name) === "Login Design Part" ? (vue.openBlock(), vue.createBlock(_sfc_main$a$1, {
7005
- key: 0,
7006
- part: _ctx.part
7007
- }, null, 8, ["part"])) : _ctx.part.children && _ctx.part.children.length > 0 ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(_ctx.part.children, (block) => {
7008
- return vue.openBlock(), vue.createBlock(_sfc_main$b$1, {
7009
- key: block.partId,
7009
+ _ctx.part.children && _ctx.part.children.length > 0 ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(_ctx.part.children, (child) => {
7010
+ return vue.openBlock(), vue.createBlock(_sfc_main$a$1, {
7011
+ key: child.partId,
7010
7012
  "is-mobile-page": _ctx.isMobilePage,
7011
- part: block
7012
- }, null, 8, ["is-mobile-page", "part"]);
7013
+ part: child,
7014
+ "onUpdate:visible": (value) => updateVisible(child.partId, value)
7015
+ }, null, 8, ["is-mobile-page", "part", "onUpdate:visible"]);
7013
7016
  }), 128)) : vue.createCommentVNode("", true)
7014
- ], 14, _hoisted_1$8$1)
7017
+ ], 14, _hoisted_1$8$1), [
7018
+ [vue.vShow, visible.value]
7019
+ ])
7015
7020
  ], 64);
7016
7021
  };
7017
7022
  }
@@ -7281,7 +7286,7 @@ ${_html.style}
7281
7286
  partType: "Block",
7282
7287
  partName: "Block",
7283
7288
  className: "pb-block",
7284
- creator: () => _sfc_main$b$1
7289
+ creator: () => _sfc_main$a$1
7285
7290
  },
7286
7291
  "TextWidget": {
7287
7292
  partType: "Widget",
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.43",
4
+ "version": "1.0.0-alpha.44",
5
5
  "engins": {
6
6
  "node": ">= 20.0.0"
7
7
  },
@@ -30,7 +30,7 @@
30
30
  "vue-router": "^4.4.3",
31
31
  "vue3-click-away": "^1.2.4",
32
32
  "yjs": "^13.6.14",
33
- "@g1cloud/page-builder-viewer": "1.0.0-alpha.43"
33
+ "@g1cloud/page-builder-viewer": "1.0.0-alpha.44"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/node": "^20.12.7",