@g1cloud/page-builder-editor 1.0.0-alpha.40 → 1.0.0-alpha.41

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.
@@ -10,7 +10,9 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
10
10
  plugin?: unknown;
11
11
  }>>, {
12
12
  getPageContent: () => string;
13
- }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
13
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
14
+ "update-model": (modified: boolean) => void;
15
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
14
16
  instanceId?: string | undefined;
15
17
  title?: string | undefined;
16
18
  pageContent?: string | undefined;
@@ -18,7 +20,9 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
18
20
  locale?: string | undefined;
19
21
  toolbarPlugin?: PageBuilderToolbarPlugin | undefined;
20
22
  plugin?: unknown;
21
- }>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
23
+ }>>> & Readonly<{
24
+ "onUpdate-model"?: ((modified: boolean) => any) | undefined;
25
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
22
26
  export default _default;
23
27
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
24
28
  type __VLS_TypePropsToRuntimeProps<T> = {
@@ -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-CujMrKaK.js";
3
+ import { P as PbColorPicker } from "./index-JJUQKU18.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-CujMrKaK.js";
3
+ import { u as usePageBuilderEditor } from "./index-JJUQKU18.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-CujMrKaK.js";
2
+ import { u as usePageBuilderEditor } from "./index-JJUQKU18.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" };
@@ -19,7 +19,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
19
19
  const imageProvider = pageBuilder.getProvider("imageProvider");
20
20
  if (imageProvider) {
21
21
  imageProvider({ modal }, (media) => {
22
- emit("update-property-value", { media });
22
+ emit("update-property-value", { media, altText: media.altText });
23
23
  });
24
24
  }
25
25
  };
@@ -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-CujMrKaK.js";
3
+ import { u as usePageBuilderEditor } from "./index-JJUQKU18.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-CujMrKaK.js";
3
+ import { u as usePageBuilderEditor } from "./index-JJUQKU18.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-CujMrKaK.js";
3
+ import { s as selectYoutubeVideo } from "./index-JJUQKU18.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-CujMrKaK.js";
3
+ import { w as widgetPartDefinitions } from "./index-JJUQKU18.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,16 +1,15 @@
1
- import { Media } from '@g1cloud/page-builder-viewer';
2
1
  import { PartProperty } from '../../../model/part-property.ts';
3
2
 
4
3
  declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
5
4
  property: PartProperty;
6
5
  value?: string | undefined;
7
6
  }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
8
- "update-property-value": (properties: Record<string, Media>) => void;
7
+ "update-property-value": (properties: Record<string, unknown>) => void;
9
8
  }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
10
9
  property: PartProperty;
11
10
  value?: string | undefined;
12
11
  }>>> & Readonly<{
13
- "onUpdate-property-value"?: ((properties: Record<string, Media>) => any) | undefined;
12
+ "onUpdate-property-value"?: ((properties: Record<string, unknown>) => any) | undefined;
14
13
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
15
14
  export default _default;
16
15
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -8153,15 +8153,15 @@ class PartManager {
8153
8153
  const defaultPartPropertyEditors = () => {
8154
8154
  return {
8155
8155
  "readonly-text": () => defineAsyncComponent(() => import("./PbPropertyEditorReadonlyText-Dgp_AVOD.js")),
8156
- "text": () => defineAsyncComponent(() => import("./PbPropertyEditorText-6sglUVrs.js")),
8156
+ "text": () => defineAsyncComponent(() => import("./PbPropertyEditorText-C5J3oD2S.js")),
8157
8157
  "number": () => defineAsyncComponent(() => import("./PbPropertyEditorNumber-TTgo0zbQ.js")),
8158
8158
  "boolean": () => defineAsyncComponent(() => import("./PbPropertyEditorBoolean-C7-iSAtn.js")),
8159
- "multiline-text": () => defineAsyncComponent(() => import("./PbPropertyEditorMultilineText-BZHzQltK.js")),
8159
+ "multiline-text": () => defineAsyncComponent(() => import("./PbPropertyEditorMultilineText-_sKX10aQ.js")),
8160
8160
  "select": () => defineAsyncComponent(() => import("./PbPropertyEditorSelect-CWedbXJI.js")),
8161
- "color": () => defineAsyncComponent(() => import("./PbPropertyEditorColor-CxzuXdSU.js")),
8162
- "image": () => defineAsyncComponent(() => import("./PbPropertyEditorImage-BUrb2xHD.js")),
8163
- "html": () => defineAsyncComponent(() => import("./PbPropertyEditorHtml-CAwd0B2-.js")),
8164
- "youtube": () => defineAsyncComponent(() => import("./PbPropertyEditorYoutube-D4YwWYvB.js"))
8161
+ "color": () => defineAsyncComponent(() => import("./PbPropertyEditorColor-DK3I3ptt.js")),
8162
+ "image": () => defineAsyncComponent(() => import("./PbPropertyEditorImage-C9-36J1r.js")),
8163
+ "html": () => defineAsyncComponent(() => import("./PbPropertyEditorHtml-TFX1UdLf.js")),
8164
+ "youtube": () => defineAsyncComponent(() => import("./PbPropertyEditorYoutube-D0yzhz00.js"))
8165
8165
  };
8166
8166
  };
8167
8167
  const getPropertyValueOfParts = (parts, propertyName) => {
@@ -12293,6 +12293,13 @@ const widgets = [
12293
12293
  propertyType: "image",
12294
12294
  params: ""
12295
12295
  },
12296
+ {
12297
+ propertyName: "altText",
12298
+ caption: "ALT Text",
12299
+ propertyType: "text",
12300
+ params: "",
12301
+ multiLang: true
12302
+ },
12296
12303
  {
12297
12304
  propertyName: "link",
12298
12305
  caption: "Link",
@@ -12503,7 +12510,7 @@ __publicField(_OpenAddWidgetModalCommand, "COMMAND_ID", "OpenAddWidgetModal");
12503
12510
  let OpenAddWidgetModalCommand = _OpenAddWidgetModalCommand;
12504
12511
  const openWidgetAddModal = (modal, args, callback) => {
12505
12512
  modal.openModal({
12506
- component: defineAsyncComponent(() => import("./PbWidgetAddModal-B1D1-muE.js")),
12513
+ component: defineAsyncComponent(() => import("./PbWidgetAddModal-DoIC_0FH.js")),
12507
12514
  style: {
12508
12515
  width: "80%",
12509
12516
  height: "80%",
@@ -13732,7 +13739,21 @@ class PageBuilderEditorImpl {
13732
13739
  __publicField(this, "providers", {});
13733
13740
  __publicField(this, "externalCssLinks", []);
13734
13741
  __publicField(this, "externalCssContent", "");
13742
+ __publicField(this, "initialized", false);
13743
+ __publicField(this, "onModelUpdated");
13735
13744
  this.model = new Model2();
13745
+ this.model.undoManager.on("stack-item-added", (event) => {
13746
+ if (!this.initialized) return;
13747
+ if (this.onModelUpdated) this.onModelUpdated(this.model.undoManager.undoStack.length > 0);
13748
+ });
13749
+ this.model.undoManager.on("stack-item-popped", (event) => {
13750
+ if (!this.initialized) return;
13751
+ if (this.onModelUpdated) this.onModelUpdated(this.model.undoManager.undoStack.length > 0);
13752
+ });
13753
+ this.model.undoManager.on("stack-cleared", (event) => {
13754
+ if (!this.initialized) return;
13755
+ if (this.onModelUpdated) this.onModelUpdated(this.model.undoManager.undoStack.length > 0);
13756
+ });
13736
13757
  this.context = new PageBuilderContextImpl(this);
13737
13758
  this.scale.value = 1;
13738
13759
  this.initPlugins();
@@ -13843,6 +13864,8 @@ class PageBuilderEditorImpl {
13843
13864
  ]
13844
13865
  };
13845
13866
  this.model.updateModel(param);
13867
+ this.initialized = true;
13868
+ this.model.undoManager.clear();
13846
13869
  }
13847
13870
  undo() {
13848
13871
  this.model.undoManager.undo();
@@ -14711,12 +14734,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
14711
14734
  toolbarPlugin: {},
14712
14735
  plugin: {}
14713
14736
  },
14714
- setup(__props, { expose: __expose }) {
14737
+ emits: ["update-model"],
14738
+ setup(__props, { expose: __expose, emit: __emit }) {
14715
14739
  const props = __props;
14740
+ const emit = __emit;
14716
14741
  const modal = useModal();
14717
14742
  const pageBuilderEditor = createPageBuilderEditor();
14718
14743
  pageBuilderEditor.instanceId = props.instanceId;
14719
14744
  pageBuilderEditor.title = props.title;
14745
+ pageBuilderEditor.onModelUpdated = (modified) => {
14746
+ emit("update-model", modified);
14747
+ };
14720
14748
  if (props.locales) pageBuilderEditor.setLocales(props.locales);
14721
14749
  if (props.locale) pageBuilderEditor.setLocale(props.locale);
14722
14750
  if (props.plugin) pageBuilderEditor.registerCustomPlugin(props.plugin);
@@ -26,6 +26,7 @@ export interface PageBuilderEditor extends PageBuilder {
26
26
  scale: Ref<number>;
27
27
  locale: Ref<string>;
28
28
  locales: Ref<string[]>;
29
+ onModelUpdated?: (modified: boolean) => void;
29
30
  registerPlugin(plugin: PageBuilderPlugin): void;
30
31
  registerCustomPlugin(plugin: any): void;
31
32
  initData(data?: string): void;
@@ -57,6 +58,8 @@ export declare class PageBuilderEditorImpl implements PageBuilderEditor {
57
58
  providers: Record<string, unknown>;
58
59
  externalCssLinks: string[];
59
60
  externalCssContent: string;
61
+ initialized: boolean;
62
+ onModelUpdated?: (modified: boolean) => void;
60
63
  constructor();
61
64
  getLocale(): string;
62
65
  setLocale(locale?: string): void;
@@ -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-CujMrKaK.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-JJUQKU18.js";
2
2
  export {
3
3
  B as BLOCK_TYPE,
4
4
  b as Block,
@@ -12294,6 +12294,13 @@ ${_html.style}
12294
12294
  propertyType: "image",
12295
12295
  params: ""
12296
12296
  },
12297
+ {
12298
+ propertyName: "altText",
12299
+ caption: "ALT Text",
12300
+ propertyType: "text",
12301
+ params: "",
12302
+ multiLang: true
12303
+ },
12297
12304
  {
12298
12305
  propertyName: "link",
12299
12306
  caption: "Link",
@@ -13733,7 +13740,21 @@ ${_html.style}
13733
13740
  __publicField(this, "providers", {});
13734
13741
  __publicField(this, "externalCssLinks", []);
13735
13742
  __publicField(this, "externalCssContent", "");
13743
+ __publicField(this, "initialized", false);
13744
+ __publicField(this, "onModelUpdated");
13736
13745
  this.model = new Model();
13746
+ this.model.undoManager.on("stack-item-added", (event) => {
13747
+ if (!this.initialized) return;
13748
+ if (this.onModelUpdated) this.onModelUpdated(this.model.undoManager.undoStack.length > 0);
13749
+ });
13750
+ this.model.undoManager.on("stack-item-popped", (event) => {
13751
+ if (!this.initialized) return;
13752
+ if (this.onModelUpdated) this.onModelUpdated(this.model.undoManager.undoStack.length > 0);
13753
+ });
13754
+ this.model.undoManager.on("stack-cleared", (event) => {
13755
+ if (!this.initialized) return;
13756
+ if (this.onModelUpdated) this.onModelUpdated(this.model.undoManager.undoStack.length > 0);
13757
+ });
13737
13758
  this.context = new PageBuilderContextImpl(this);
13738
13759
  this.scale.value = 1;
13739
13760
  this.initPlugins();
@@ -13844,6 +13865,8 @@ ${_html.style}
13844
13865
  ]
13845
13866
  };
13846
13867
  this.model.updateModel(param);
13868
+ this.initialized = true;
13869
+ this.model.undoManager.clear();
13847
13870
  }
13848
13871
  undo() {
13849
13872
  this.model.undoManager.undo();
@@ -14712,12 +14735,17 @@ ${_html.style}
14712
14735
  toolbarPlugin: {},
14713
14736
  plugin: {}
14714
14737
  },
14715
- setup(__props, { expose: __expose }) {
14738
+ emits: ["update-model"],
14739
+ setup(__props, { expose: __expose, emit: __emit }) {
14716
14740
  const props = __props;
14741
+ const emit = __emit;
14717
14742
  const modal = bluesea.useModal();
14718
14743
  const pageBuilderEditor = createPageBuilderEditor();
14719
14744
  pageBuilderEditor.instanceId = props.instanceId;
14720
14745
  pageBuilderEditor.title = props.title;
14746
+ pageBuilderEditor.onModelUpdated = (modified) => {
14747
+ emit("update-model", modified);
14748
+ };
14721
14749
  if (props.locales) pageBuilderEditor.setLocales(props.locales);
14722
14750
  if (props.locale) pageBuilderEditor.setLocale(props.locale);
14723
14751
  if (props.plugin) pageBuilderEditor.registerCustomPlugin(props.plugin);
@@ -15100,7 +15128,7 @@ ${_html.style}
15100
15128
  const imageProvider = pageBuilder.getProvider("imageProvider");
15101
15129
  if (imageProvider) {
15102
15130
  imageProvider({ modal }, (media) => {
15103
- emit("update-property-value", { media });
15131
+ emit("update-property-value", { media, altText: media.altText });
15104
15132
  });
15105
15133
  }
15106
15134
  };
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.40",
4
+ "version": "1.0.0-alpha.41",
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.40"
33
+ "@g1cloud/page-builder-viewer": "1.0.0-alpha.41"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/node": "^20.12.7",