@g1cloud/page-builder-editor 1.0.0-alpha.7 → 1.0.0-alpha.8

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.
@@ -244,11 +244,8 @@
244
244
  height: 40%;
245
245
  }
246
246
 
247
- textarea {
248
- border: solid 1px #ccc;
249
- width: 100%;
247
+ .bs-code-editor {
250
248
  height: 100%;
251
- overflow-y: auto;
252
249
  }
253
250
  }
254
251
 
@@ -1,5 +1,5 @@
1
- import { defineComponent, ref, computed, onMounted, openBlock, createBlock, unref, withCtx, createElementVNode, withDirectives, vModelText } from "vue";
2
- import { useModalHandle, BSModalFrame } from "@g1cloud/bluesea";
1
+ import { defineComponent, ref, computed, onMounted, openBlock, createBlock, unref, withCtx, createElementVNode, createVNode } from "vue";
2
+ import { useModalHandle, BSModalFrame, BSCodeEditor } from "@g1cloud/bluesea";
3
3
  const _hoisted_1 = { class: "bs-layout-vertical pb-html-editor-modal flex-grow-1 h-full" };
4
4
  const _hoisted_2 = { class: "bs-layout-horizontal flex-grow-1" };
5
5
  const _hoisted_3 = { class: "preview flex-grow-1" };
@@ -20,10 +20,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
20
20
  },
21
21
  emits: ["updateHtml"],
22
22
  setup(__props, { emit: __emit }) {
23
+ var _a, _b;
24
+ const props = __props;
23
25
  const emit = __emit;
24
26
  const modalHandle = useModalHandle();
25
- const tags = ref();
26
- const style = ref();
27
+ const tags = ref(((_a = props.html) == null ? void 0 : _a.tags) || "");
28
+ const style = ref(((_b = props.html) == null ? void 0 : _b.style) || "");
27
29
  const html = computed(() => `${tags.value || ""}
28
30
  <style>${style.value || ""}</style>`);
29
31
  onMounted(async () => {
@@ -53,21 +55,23 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
53
55
  createElementVNode("div", _hoisted_8, [
54
56
  _hoisted_9,
55
57
  createElementVNode("div", _hoisted_10, [
56
- withDirectives(createElementVNode("textarea", {
57
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => tags.value = $event)
58
- }, null, 512), [
59
- [vModelText, tags.value]
60
- ])
58
+ createVNode(unref(BSCodeEditor), {
59
+ modelValue: tags.value,
60
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => tags.value = $event),
61
+ "editor-height": "100%",
62
+ lang: "html"
63
+ }, null, 8, ["modelValue"])
61
64
  ])
62
65
  ]),
63
66
  createElementVNode("div", _hoisted_11, [
64
67
  _hoisted_12,
65
68
  createElementVNode("div", _hoisted_13, [
66
- withDirectives(createElementVNode("textarea", {
67
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => style.value = $event)
68
- }, null, 512), [
69
- [vModelText, style.value]
70
- ])
69
+ createVNode(unref(BSCodeEditor), {
70
+ modelValue: style.value,
71
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => style.value = $event),
72
+ "editor-height": "100%",
73
+ lang: "css"
74
+ }, null, 8, ["modelValue"])
71
75
  ])
72
76
  ])
73
77
  ])
@@ -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-BTlwA7HP.js";
3
+ import { P as PbColorPicker } from "./index-CFgXLaTI.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-BTlwA7HP.js";
3
+ import { u as usePageBuilderEditor } from "./index-CFgXLaTI.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"];
@@ -23,7 +23,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
23
23
  html = props.value[language];
24
24
  }
25
25
  modal.openModal({
26
- component: defineAsyncComponent(() => import("./HtmlEditorModal-BV5E6G70.js")),
26
+ component: defineAsyncComponent(() => import("./HtmlEditorModal-DDoVYM6n.js")),
27
27
  style: {
28
28
  width: "80%",
29
29
  height: "80%",
@@ -36,13 +36,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
36
36
  },
37
37
  on: {
38
38
  updateHtml: (html2) => {
39
- console.log(html2);
40
39
  const language2 = pageBuilder.getLanguage();
41
40
  const value = {
42
41
  ...props.value || {},
43
42
  [language2]: html2
44
43
  };
45
- console.log(value);
46
44
  emit("update-property-value", { html: value });
47
45
  }
48
46
  }
@@ -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, a as PageBuilderEditorEvent } from "./index-BTlwA7HP.js";
3
+ import { u as usePageBuilderEditor, a as PageBuilderEditorEvent } from "./index-CFgXLaTI.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, createElementBlock, createElementVNode, toDisplayString, createVNode, unref } from "vue";
2
2
  import { BSTextArea } from "@g1cloud/bluesea";
3
- import { u as usePageBuilderEditor } from "./index-BTlwA7HP.js";
3
+ import { u as usePageBuilderEditor } from "./index-CFgXLaTI.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, openBlock, createElementBlock, createElementVNode, toDisplayString } from "vue";
2
2
  import { useModal } from "@g1cloud/bluesea";
3
- import { u as usePageBuilderEditor, a as PageBuilderEditorEvent } from "./index-BTlwA7HP.js";
3
+ import { u as usePageBuilderEditor, a as PageBuilderEditorEvent } from "./index-CFgXLaTI.js";
4
4
  const _hoisted_1 = { class: "property-editor property-editor-product flex-align-center" };
5
5
  const _hoisted_2 = { class: "title" };
6
6
  const _hoisted_3 = ["textContent"];
@@ -7136,12 +7136,8 @@ ${_html.style}
7136
7136
  </style>`;
7137
7137
  };
7138
7138
  const html = computed(() => {
7139
- var _a, _b;
7140
- console.log("---------");
7141
- console.log((_a = props.part.properties) == null ? void 0 : _a.html);
7142
- console.log("---------");
7143
- console.log(props.part);
7144
- return getHtml((_b = props.part.properties) == null ? void 0 : _b.html);
7139
+ var _a;
7140
+ return getHtml((_a = props.part.properties) == null ? void 0 : _a.html);
7145
7141
  });
7146
7142
  const emptyClass = computed(() => {
7147
7143
  if (props.viewMode) {
@@ -7605,7 +7601,7 @@ const syncProperties = (part, element) => {
7605
7601
  }
7606
7602
  }
7607
7603
  for (const name in part.properties) {
7608
- if (!attrs[name])
7604
+ if (!attrs[name] && !attrs[`${name}.object`])
7609
7605
  delete part.properties[name];
7610
7606
  }
7611
7607
  if (Object.keys(part.properties).length === 0) {
@@ -8067,12 +8063,12 @@ const defaultPartPropertyEditors = () => {
8067
8063
  return {
8068
8064
  "readonly-text": () => defineAsyncComponent(() => import("./PbPropertyEditorReadonlyText-Dgp_AVOD.js")),
8069
8065
  "text": () => defineAsyncComponent(() => import("./PbPropertyEditorText-BWOKvwD9.js")),
8070
- "multiline-text": () => defineAsyncComponent(() => import("./PbPropertyEditorMultilineText-sb-oS_gz.js")),
8066
+ "multiline-text": () => defineAsyncComponent(() => import("./PbPropertyEditorMultilineText-bEBZmvFa.js")),
8071
8067
  "select": () => defineAsyncComponent(() => import("./PbPropertyEditorSelect-CWedbXJI.js")),
8072
- "color": () => defineAsyncComponent(() => import("./PbPropertyEditorColor-y7y6ZUQs.js")),
8073
- "image": () => defineAsyncComponent(() => import("./PbPropertyEditorImage-BXEXm2Px.js")),
8074
- "html": () => defineAsyncComponent(() => import("./PbPropertyEditorHtml-CbQR_BzH.js")),
8075
- "product": () => defineAsyncComponent(() => import("./PbPropertyEditorProduct-p0zOCA9R.js"))
8068
+ "color": () => defineAsyncComponent(() => import("./PbPropertyEditorColor-BonGhf7Z.js")),
8069
+ "image": () => defineAsyncComponent(() => import("./PbPropertyEditorImage-Du9R6CBU.js")),
8070
+ "html": () => defineAsyncComponent(() => import("./PbPropertyEditorHtml-DfOWZr6S.js")),
8071
+ "product": () => defineAsyncComponent(() => import("./PbPropertyEditorProduct-gzGulWGg.js"))
8076
8072
  };
8077
8073
  };
8078
8074
  const getPropertyValueOfParts = (parts, propertyName) => {
@@ -1,4 +1,4 @@
1
- import { IPart, MultiLangText } from '@g1cloud/page-builder-viewer';
1
+ import { IPart } from '@g1cloud/page-builder-viewer';
2
2
  import * as Y from 'yjs';
3
3
  export declare const ROOT_TYPE = "Root";
4
4
  export declare const PAGE_TYPE = "Page";
@@ -49,7 +49,7 @@ export type PartInsertResult = {
49
49
  };
50
50
  export type PartUpdateResult = {
51
51
  element: Y.XmlElement;
52
- properties: Record<string, MultiLangText>;
52
+ properties: Record<string, unknown>;
53
53
  removeOtherProperties?: boolean;
54
54
  };
55
55
  export type PartDeleteResult = {
@@ -1,4 +1,4 @@
1
- import { B, b, M, c, d, e, _, a, f, g, h, i, j, k, l, R, m, S, n, W, o, p, q, r, s, t, v, w } from "./index-BTlwA7HP.js";
1
+ import { B, b, M, c, d, e, _, a, f, g, h, i, j, k, l, R, m, S, n, W, o, p, q, r, s, t, v, w } from "./index-CFgXLaTI.js";
2
2
  export {
3
3
  B as BLOCK_TYPE,
4
4
  b as Block,
@@ -7138,12 +7138,8 @@ ${_html.style}
7138
7138
  </style>`;
7139
7139
  };
7140
7140
  const html = vue.computed(() => {
7141
- var _a, _b;
7142
- console.log("---------");
7143
- console.log((_a = props.part.properties) == null ? void 0 : _a.html);
7144
- console.log("---------");
7145
- console.log(props.part);
7146
- return getHtml((_b = props.part.properties) == null ? void 0 : _b.html);
7141
+ var _a;
7142
+ return getHtml((_a = props.part.properties) == null ? void 0 : _a.html);
7147
7143
  });
7148
7144
  const emptyClass = vue.computed(() => {
7149
7145
  if (props.viewMode) {
@@ -7607,7 +7603,7 @@ ${_html.style}
7607
7603
  }
7608
7604
  }
7609
7605
  for (const name in part.properties) {
7610
- if (!attrs[name])
7606
+ if (!attrs[name] && !attrs[`${name}.object`])
7611
7607
  delete part.properties[name];
7612
7608
  }
7613
7609
  if (Object.keys(part.properties).length === 0) {
@@ -14616,13 +14612,11 @@ ${_html.style}
14616
14612
  },
14617
14613
  on: {
14618
14614
  updateHtml: (html2) => {
14619
- console.log(html2);
14620
14615
  const language2 = pageBuilder.getLanguage();
14621
14616
  const value = {
14622
14617
  ...props.value || {},
14623
14618
  [language2]: html2
14624
14619
  };
14625
- console.log(value);
14626
14620
  emit("update-property-value", { html: value });
14627
14621
  }
14628
14622
  }
@@ -14816,10 +14810,12 @@ ${_html.style}
14816
14810
  },
14817
14811
  emits: ["updateHtml"],
14818
14812
  setup(__props, { emit: __emit }) {
14813
+ var _a, _b;
14814
+ const props = __props;
14819
14815
  const emit = __emit;
14820
14816
  const modalHandle = bluesea.useModalHandle();
14821
- const tags = vue.ref();
14822
- const style = vue.ref();
14817
+ const tags = vue.ref(((_a = props.html) == null ? void 0 : _a.tags) || "");
14818
+ const style = vue.ref(((_b = props.html) == null ? void 0 : _b.style) || "");
14823
14819
  const html = vue.computed(() => `${tags.value || ""}
14824
14820
  <style>${style.value || ""}</style>`);
14825
14821
  vue.onMounted(async () => {
@@ -14849,21 +14845,23 @@ ${_html.style}
14849
14845
  vue.createElementVNode("div", _hoisted_8, [
14850
14846
  _hoisted_9,
14851
14847
  vue.createElementVNode("div", _hoisted_10, [
14852
- vue.withDirectives(vue.createElementVNode("textarea", {
14853
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => tags.value = $event)
14854
- }, null, 512), [
14855
- [vue.vModelText, tags.value]
14856
- ])
14848
+ vue.createVNode(vue.unref(bluesea.BSCodeEditor), {
14849
+ modelValue: tags.value,
14850
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => tags.value = $event),
14851
+ "editor-height": "100%",
14852
+ lang: "html"
14853
+ }, null, 8, ["modelValue"])
14857
14854
  ])
14858
14855
  ]),
14859
14856
  vue.createElementVNode("div", _hoisted_11, [
14860
14857
  _hoisted_12,
14861
14858
  vue.createElementVNode("div", _hoisted_13, [
14862
- vue.withDirectives(vue.createElementVNode("textarea", {
14863
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => style.value = $event)
14864
- }, null, 512), [
14865
- [vue.vModelText, style.value]
14866
- ])
14859
+ vue.createVNode(vue.unref(bluesea.BSCodeEditor), {
14860
+ modelValue: style.value,
14861
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => style.value = $event),
14862
+ "editor-height": "100%",
14863
+ lang: "css"
14864
+ }, null, 8, ["modelValue"])
14867
14865
  ])
14868
14866
  ])
14869
14867
  ])
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.7",
4
+ "version": "1.0.0-alpha.8",
5
5
  "engins": {
6
6
  "node": ">= 20.0.0"
7
7
  },
@@ -16,7 +16,7 @@
16
16
  "author": "zag@g1project.net",
17
17
  "license": "LicenseRef-LICENSE",
18
18
  "peerDependencies": {
19
- "@g1cloud/bluesea": "5.0.0-alpha.58"
19
+ "@g1cloud/bluesea": "5.0.0-alpha.60"
20
20
  },
21
21
  "dependencies": {
22
22
  "@ckpack/vue-color": "^1.5.0",
@@ -28,7 +28,7 @@
28
28
  "vue-router": "^4.3.2",
29
29
  "vue3-click-away": "^1.2.4",
30
30
  "yjs": "^13.6.14",
31
- "@g1cloud/page-builder-viewer": "1.0.0-alpha.7"
31
+ "@g1cloud/page-builder-viewer": "1.0.0-alpha.8"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/node": "^20.12.7",