@g1cloud/page-builder-editor 1.0.0-alpha.98 → 1.0.0-alpha.99

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, withDirectives, unref, createVNode } from "vue";
2
2
  import { vT, BSTextInput } from "@g1cloud/bluesea";
3
- import { P as PbColorPicker } from "./index-bTsjAv2l.js";
3
+ import { P as PbColorPicker } from "./index-DWYmZB2S.js";
4
4
  const _hoisted_1 = { class: "property-editor property-editor-color" };
5
5
  const _hoisted_2 = { class: "title" };
6
6
  const _hoisted_3 = { class: "bs-layout-horizontal flex-align-center color" };
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, openBlock, createElementBlock, createElementVNode, withDirectives, unref, createVNode } from "vue";
2
2
  import { vT, BSTextInput } from "@g1cloud/bluesea";
3
- import { t as toCssLength } from "./index-bTsjAv2l.js";
3
+ import { t as toCssLength } from "./index-DWYmZB2S.js";
4
4
  const _hoisted_1 = { class: "property-editor property-editor-number flex-align-center" };
5
5
  const _hoisted_2 = { class: "title" };
6
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, openBlock, createElementBlock, createElementVNode, withDirectives, unref, createTextVNode, defineAsyncComponent } from "vue";
2
2
  import { useModal, vT } from "@g1cloud/bluesea";
3
- import { u as usePageBuilderEditor } from "./index-bTsjAv2l.js";
3
+ import { u as usePageBuilderEditor } from "./index-DWYmZB2S.js";
4
4
  const _hoisted_1 = { class: "property-editor property-editor-html flex-align-center" };
5
5
  const _hoisted_2 = { class: "title" };
6
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, computed, openBlock, createElementBlock, createElementVNode, withDirectives, unref, createTextVNode, toDisplayString, createVNode, createCommentVNode, Fragment } from "vue";
2
- import { u as usePageBuilderEditor, C as ChangePropertyCommand } from "./index-bTsjAv2l.js";
2
+ import { u as usePageBuilderEditor, C as ChangePropertyCommand } from "./index-DWYmZB2S.js";
3
3
  import { useModal, vT, BSButton, BSMultiLangTextInput, showNotification } from "@g1cloud/bluesea";
4
4
  const _hoisted_1 = { class: "property-editor property-editor-image" };
5
5
  const _hoisted_2 = { class: "title" };
@@ -21,9 +21,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
21
21
  const part = pageBuilder.context.getSelectedParts();
22
22
  const modal = useModal();
23
23
  const selectMedia = () => {
24
+ var _a;
24
25
  const imageProvider = pageBuilder.getProvider("imageProvider");
25
26
  if (imageProvider) {
26
- imageProvider({ modal, mediaTypes: ["Image"] }, (media2) => {
27
+ imageProvider({ modal, mediaTypes: ["Image"], selectedMediaUrls: ((_a = media.value) == null ? void 0 : _a.fileUrl) ? [media.value.fileUrl] : [] }, (media2) => {
27
28
  updateProperty({ [props.property.propertyName]: media2 });
28
29
  });
29
30
  }
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, computed, openBlock, createElementBlock, createElementVNode, withDirectives, unref, createBlock } from "vue";
2
2
  import { vT, BSMultiLangTextArea, BSTextArea } from "@g1cloud/bluesea";
3
- import { u as usePageBuilderEditor } from "./index-bTsjAv2l.js";
3
+ import { u as usePageBuilderEditor } from "./index-DWYmZB2S.js";
4
4
  const _hoisted_1 = { class: "property-editor property-editor-multiline-text" };
5
5
  const _hoisted_2 = { class: "title" };
6
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, computed, openBlock, createElementBlock, createElementVNode, withDirectives, unref, createBlock } from "vue";
2
2
  import { vT, BSMultiLangTextInput, BSTextInput } from "@g1cloud/bluesea";
3
- import { u as usePageBuilderEditor } from "./index-bTsjAv2l.js";
3
+ import { u as usePageBuilderEditor } from "./index-DWYmZB2S.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 _sfc_main = /* @__PURE__ */ defineComponent({
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, openBlock, createElementBlock, createElementVNode, withDirectives, unref } from "vue";
2
2
  import { useModal, vT } from "@g1cloud/bluesea";
3
- import { s as selectYoutubeVideo } from "./index-bTsjAv2l.js";
3
+ import { s as selectYoutubeVideo } from "./index-DWYmZB2S.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 _sfc_main = /* @__PURE__ */ defineComponent({
@@ -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-bTsjAv2l.js";
3
+ import { w as widgetPartDefinitions } from "./index-DWYmZB2S.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"];
@@ -6798,7 +6798,9 @@ class Part {
6798
6798
  if (!inlineStyle) return styleObject;
6799
6799
  inlineStyle.split(";").forEach((rule) => {
6800
6800
  if (rule.trim()) {
6801
- const [property, value] = rule.split(":").map((part) => part.trim());
6801
+ const index = rule.indexOf(":");
6802
+ const property = rule.slice(0, index).trim();
6803
+ const value = rule.slice(index + 1).trim();
6802
6804
  if (property && value) {
6803
6805
  const camelCasedProperty = property.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
6804
6806
  styleObject[camelCasedProperty] = value;
@@ -8592,16 +8594,16 @@ class PartManager {
8592
8594
  const defaultPartPropertyEditors = () => {
8593
8595
  return {
8594
8596
  "readonly-text": () => defineAsyncComponent(() => import("./PbPropertyEditorReadonlyText-BJ5qx69O.js")),
8595
- "text": () => defineAsyncComponent(() => import("./PbPropertyEditorText-BpLqKfaJ.js")),
8597
+ "text": () => defineAsyncComponent(() => import("./PbPropertyEditorText-CXzFycVD.js")),
8596
8598
  "number": () => defineAsyncComponent(() => import("./PbPropertyEditorNumber-B76ArSb5.js")),
8597
8599
  "boolean": () => defineAsyncComponent(() => import("./PbPropertyEditorBoolean-c5CNiTpt.js")),
8598
- "multiline-text": () => defineAsyncComponent(() => import("./PbPropertyEditorMultilineText-B0JUZw_Q.js")),
8600
+ "multiline-text": () => defineAsyncComponent(() => import("./PbPropertyEditorMultilineText-DKF6Ogyq.js")),
8599
8601
  "select": () => defineAsyncComponent(() => import("./PbPropertyEditorSelect-B5sfulvx.js")),
8600
- "css-length": () => defineAsyncComponent(() => import("./PbPropertyEditorCssLength-DxcSclK9.js")),
8601
- "color": () => defineAsyncComponent(() => import("./PbPropertyEditorColor-CpCyIjwS.js")),
8602
- "image": () => defineAsyncComponent(() => import("./PbPropertyEditorImage-DvjpV1hv.js")),
8603
- "html": () => defineAsyncComponent(() => import("./PbPropertyEditorHtml-Chtjtv6-.js")),
8604
- "youtube": () => defineAsyncComponent(() => import("./PbPropertyEditorYoutube-D9rwvL_i.js"))
8602
+ "css-length": () => defineAsyncComponent(() => import("./PbPropertyEditorCssLength-CqQObPGf.js")),
8603
+ "color": () => defineAsyncComponent(() => import("./PbPropertyEditorColor-BqVNRgdH.js")),
8604
+ "image": () => defineAsyncComponent(() => import("./PbPropertyEditorImage-BMr4-UFz.js")),
8605
+ "html": () => defineAsyncComponent(() => import("./PbPropertyEditorHtml-Cicp7p_s.js")),
8606
+ "youtube": () => defineAsyncComponent(() => import("./PbPropertyEditorYoutube-CgCsG9wD.js"))
8605
8607
  };
8606
8608
  };
8607
8609
  const getPropertyValueOfParts = (parts, propertyName) => {
@@ -11998,7 +12000,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
11998
12000
  const selectImage = () => {
11999
12001
  const imageProvider = pageBuilder.getProvider("imageProvider");
12000
12002
  if (imageProvider) {
12001
- imageProvider({ modal, mediaTypes: ["Image"] }, (media) => {
12003
+ imageProvider({ modal, mediaTypes: ["Image"], selectedMediaUrls: image.value ? [image.value] : [] }, (media) => {
12002
12004
  if (media.mediaType === "Image" && media.fileUrl) {
12003
12005
  updatePropertyValue({ backgroundImage: media.fileUrl });
12004
12006
  }
@@ -12849,9 +12851,10 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
12849
12851
  const part = pageBuilder.context.getSelectedParts();
12850
12852
  const modal = useModal();
12851
12853
  const selectMedia = () => {
12854
+ var _a;
12852
12855
  const imageProvider = pageBuilder.getProvider("imageProvider");
12853
12856
  if (imageProvider) {
12854
- imageProvider({ modal }, (media2) => {
12857
+ imageProvider({ modal, selectedMediaUrls: ((_a = media.value) == null ? void 0 : _a.fileUrl) ? [media.value.fileUrl] : [] }, (media2) => {
12855
12858
  if (media2.mediaType === "Image") {
12856
12859
  updateProperty({ media: media2, thumbnail: "" });
12857
12860
  } else if (media2.mediaType === "Video") {
@@ -13384,7 +13387,7 @@ __publicField(_OpenAddWidgetModalCommand, "COMMAND_ID", "OpenAddWidgetModal");
13384
13387
  let OpenAddWidgetModalCommand = _OpenAddWidgetModalCommand;
13385
13388
  const openWidgetAddModal = (modal, args, callback) => {
13386
13389
  modal.openModal({
13387
- component: defineAsyncComponent(() => import("./PbWidgetAddModal-BnF61r3d.js")),
13390
+ component: defineAsyncComponent(() => import("./PbWidgetAddModal-CKLzgZaN.js")),
13388
13391
  style: {
13389
13392
  width: "80%",
13390
13393
  height: "80%",
@@ -35,4 +35,5 @@ export type PageBuilderContextMenu = {
35
35
  export type ImageProviderArg = {
36
36
  modal: BSModal;
37
37
  mediaTypes: string[];
38
+ selectedMediaUrls?: string[];
38
39
  };
@@ -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, v, x, y, z, A, D, E } from "./index-bTsjAv2l.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, v, x, y, z, A, D, E } from "./index-DWYmZB2S.js";
2
2
  export {
3
3
  B as BLOCK_TYPE,
4
4
  b as Block,
@@ -6799,7 +6799,9 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
6799
6799
  if (!inlineStyle) return styleObject;
6800
6800
  inlineStyle.split(";").forEach((rule) => {
6801
6801
  if (rule.trim()) {
6802
- const [property, value] = rule.split(":").map((part) => part.trim());
6802
+ const index = rule.indexOf(":");
6803
+ const property = rule.slice(0, index).trim();
6804
+ const value = rule.slice(index + 1).trim();
6803
6805
  if (property && value) {
6804
6806
  const camelCasedProperty = property.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
6805
6807
  styleObject[camelCasedProperty] = value;
@@ -11999,7 +12001,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
11999
12001
  const selectImage = () => {
12000
12002
  const imageProvider = pageBuilder.getProvider("imageProvider");
12001
12003
  if (imageProvider) {
12002
- imageProvider({ modal, mediaTypes: ["Image"] }, (media) => {
12004
+ imageProvider({ modal, mediaTypes: ["Image"], selectedMediaUrls: image.value ? [image.value] : [] }, (media) => {
12003
12005
  if (media.mediaType === "Image" && media.fileUrl) {
12004
12006
  updatePropertyValue({ backgroundImage: media.fileUrl });
12005
12007
  }
@@ -12850,9 +12852,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
12850
12852
  const part = pageBuilder.context.getSelectedParts();
12851
12853
  const modal = bluesea.useModal();
12852
12854
  const selectMedia = () => {
12855
+ var _a;
12853
12856
  const imageProvider = pageBuilder.getProvider("imageProvider");
12854
12857
  if (imageProvider) {
12855
- imageProvider({ modal }, (media2) => {
12858
+ imageProvider({ modal, selectedMediaUrls: ((_a = media.value) == null ? void 0 : _a.fileUrl) ? [media.value.fileUrl] : [] }, (media2) => {
12856
12859
  if (media2.mediaType === "Image") {
12857
12860
  updateProperty({ media: media2, thumbnail: "" });
12858
12861
  } else if (media2.mediaType === "Video") {
@@ -17924,9 +17927,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
17924
17927
  const part = pageBuilder.context.getSelectedParts();
17925
17928
  const modal = bluesea.useModal();
17926
17929
  const selectMedia = () => {
17930
+ var _a;
17927
17931
  const imageProvider = pageBuilder.getProvider("imageProvider");
17928
17932
  if (imageProvider) {
17929
- imageProvider({ modal, mediaTypes: ["Image"] }, (media2) => {
17933
+ imageProvider({ modal, mediaTypes: ["Image"], selectedMediaUrls: ((_a = media.value) == null ? void 0 : _a.fileUrl) ? [media.value.fileUrl] : [] }, (media2) => {
17930
17934
  updateProperty({ [props.property.propertyName]: media2 });
17931
17935
  });
17932
17936
  }
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.98",
4
+ "version": "1.0.0-alpha.99",
5
5
  "engins": {
6
6
  "node": ">= 20.0.0"
7
7
  },
@@ -31,7 +31,7 @@
31
31
  "vue-router": "^4.4.3",
32
32
  "vue3-click-away": "^1.2.4",
33
33
  "yjs": "^13.6.14",
34
- "@g1cloud/page-builder-viewer": "1.0.0-alpha.98"
34
+ "@g1cloud/page-builder-viewer": "1.0.0-alpha.99"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/node": "^20.12.7",