@g1cloud/page-builder-editor 1.0.0-alpha.14 → 1.0.0-alpha.16

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.
@@ -8,8 +8,9 @@ declare const _default: import('vue').DefineComponent<__VLS_TypePropsToRuntimePr
8
8
  locales?: string[] | undefined;
9
9
  locale?: string | undefined;
10
10
  toolbarPlugin?: PageBuilderToolbarPlugin | undefined;
11
+ plugin?: unknown;
11
12
  }>, {
12
- getLocalDesignPartContent: () => any[] | undefined;
13
+ getPageContent: () => string;
13
14
  }, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
14
15
  instanceId?: string | undefined;
15
16
  title?: string | undefined;
@@ -18,6 +19,7 @@ declare const _default: import('vue').DefineComponent<__VLS_TypePropsToRuntimePr
18
19
  locales?: string[] | undefined;
19
20
  locale?: string | undefined;
20
21
  toolbarPlugin?: PageBuilderToolbarPlugin | undefined;
22
+ plugin?: unknown;
21
23
  }>>>, {}, {}>;
22
24
  export default _default;
23
25
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : 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-CuI4K01B.js";
3
+ import { P as PbColorPicker } from "./index-BcD7YsdY.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-CuI4K01B.js";
3
+ import { u as usePageBuilderEditor } from "./index-BcD7YsdY.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, openBlock, createElementBlock, createElementVNode, toDisplayString } from "vue";
2
+ import { u as usePageBuilderEditor } from "./index-BcD7YsdY.js";
2
3
  import { useModal } from "@g1cloud/bluesea";
3
- import { u as usePageBuilderEditor, a as PageBuilderEditorEvent } from "./index-CuI4K01B.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"];
@@ -12,16 +12,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
12
12
  },
13
13
  emits: ["update-property-value"],
14
14
  setup(__props, { emit: __emit }) {
15
- useModal();
16
15
  const pageBuilder = usePageBuilderEditor();
16
+ const modal = useModal();
17
17
  const emit = __emit;
18
18
  const selectImage = () => {
19
- PageBuilderEditorEvent.emit.requestImage({
20
- pageBuilderId: pageBuilder.instanceId,
21
- callback: (url) => {
19
+ const imageProvider = pageBuilder.getProvider("image");
20
+ if (imageProvider) {
21
+ imageProvider({ modal }, (url) => {
22
22
  emit("update-property-value", { image: url });
23
- }
24
- });
23
+ });
24
+ }
25
25
  };
26
26
  return (_ctx, _cache) => {
27
27
  return openBlock(), createElementBlock("div", _hoisted_1, [
@@ -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-CuI4K01B.js";
3
+ import { u as usePageBuilderEditor } from "./index-BcD7YsdY.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,9 +1,20 @@
1
- import { defineComponent, openBlock, createBlock, unref, withCtx, createElementVNode, createElementBlock, Fragment, renderList, toDisplayString } from "vue";
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-BcD7YsdY.js";
3
4
  const _hoisted_1 = { class: "bs-layout-vertical pb-part-add-modal" };
4
- const _hoisted_2 = ["textContent"];
5
+ const _hoisted_2 = /* @__PURE__ */ createElementVNode("div", {
6
+ class: "mb-8",
7
+ textContent: "Basic Widgets"
8
+ }, null, -1);
5
9
  const _hoisted_3 = { class: "bs-layout-horizontal-wrap ml-16 mb-8 gap-8" };
6
10
  const _hoisted_4 = ["onClick", "textContent"];
11
+ const _hoisted_5 = { class: "group mb-16" };
12
+ const _hoisted_6 = /* @__PURE__ */ createElementVNode("div", {
13
+ class: "mb-8",
14
+ textContent: "Custom Widgets"
15
+ }, null, -1);
16
+ const _hoisted_7 = { class: "bs-layout-horizontal-wrap ml-16 mb-8 gap-8" };
17
+ const _hoisted_8 = ["onClick", "textContent"];
7
18
  const _sfc_main = /* @__PURE__ */ defineComponent({
8
19
  __name: "PbWidgetAddModal",
9
20
  props: {
@@ -12,9 +23,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
12
23
  },
13
24
  emits: ["selectHandler"],
14
25
  setup(__props, { emit: __emit }) {
26
+ const props = __props;
15
27
  const emit = __emit;
16
28
  const modalHandle = useModalHandle();
29
+ const customWidgets = computed(() => props.pageBuilder.getCustomWidgets());
17
30
  const select = (partDefinition) => {
31
+ console.log(partDefinition);
18
32
  emit("selectHandler", partDefinition);
19
33
  modalHandle.close();
20
34
  };
@@ -22,15 +36,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
22
36
  return openBlock(), createBlock(unref(BSModalFrame), { title: "Add Block/Widget" }, {
23
37
  default: withCtx(() => [
24
38
  createElementVNode("div", _hoisted_1, [
25
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.partDefinitionGroups, (group) => {
39
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(widgetPartDefinitions), (group) => {
26
40
  return openBlock(), createElementBlock("div", {
27
41
  key: group.groupName,
28
42
  class: "group mb-16"
29
43
  }, [
30
- createElementVNode("div", {
31
- class: "mb-8",
32
- textContent: toDisplayString(group.caption)
33
- }, null, 8, _hoisted_2),
44
+ _hoisted_2,
34
45
  createElementVNode("div", _hoisted_3, [
35
46
  (openBlock(true), createElementBlock(Fragment, null, renderList(group.partDefinitions, (part) => {
36
47
  return openBlock(), createElementBlock("div", {
@@ -42,7 +53,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
42
53
  }), 128))
43
54
  ])
44
55
  ]);
45
- }), 128))
56
+ }), 128)),
57
+ createElementVNode("div", _hoisted_5, [
58
+ _hoisted_6,
59
+ createElementVNode("div", _hoisted_7, [
60
+ (openBlock(true), createElementBlock(Fragment, null, renderList(customWidgets.value, (part) => {
61
+ return openBlock(), createElementBlock("div", {
62
+ key: part.partName,
63
+ class: "part",
64
+ onClick: ($event) => select(part),
65
+ textContent: toDisplayString(part.caption)
66
+ }, null, 8, _hoisted_8);
67
+ }), 128))
68
+ ])
69
+ ])
46
70
  ])
47
71
  ]),
48
72
  _: 1