@g1cloud/page-builder-editor 1.0.0-alpha.15 → 1.0.0-alpha.17

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.
@@ -5,7 +5,7 @@
5
5
  padding: 4px 12px;
6
6
  cursor: pointer;
7
7
  line-height: 1;
8
- width: 100px;
8
+ width: 120px;
9
9
  height: 28px;
10
10
  background-color: #1f8fff;
11
11
  }
@@ -20,7 +20,7 @@
20
20
  padding: 4px 12px;
21
21
  cursor: pointer;
22
22
  line-height: 1;
23
- width: 100px;
23
+ width: 120px;
24
24
  height: 28px;
25
25
  background-color: #1f8fff;
26
26
  }
@@ -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-BIoyBfxM.js";
3
+ import { P as PbColorPicker } from "./index-rPBXWjSz.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-BIoyBfxM.js";
3
+ import { u as usePageBuilderEditor } from "./index-rPBXWjSz.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-rPBXWjSz.js";
2
3
  import { useModal } from "@g1cloud/bluesea";
3
- import { u as usePageBuilderEditor, a as PageBuilderEditorEvent } from "./index-BIoyBfxM.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-BIoyBfxM.js";
3
+ import { u as usePageBuilderEditor } from "./index-rPBXWjSz.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,5 +1,6 @@
1
- import { defineComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, createVNode, unref } from "vue";
2
- import { BSTextInput } from "@g1cloud/bluesea";
1
+ import { defineComponent, computed, openBlock, createElementBlock, createElementVNode, toDisplayString, createBlock, unref } from "vue";
2
+ import { BSMultiLangTextInput, BSTextInput } from "@g1cloud/bluesea";
3
+ import { u as usePageBuilderEditor } from "./index-rPBXWjSz.js";
3
4
  const _hoisted_1 = { class: "property-editor property-editor-text flex-align-center" };
4
5
  const _hoisted_2 = { class: "title" };
5
6
  const _hoisted_3 = ["textContent"];
@@ -13,6 +14,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
13
14
  setup(__props, { emit: __emit }) {
14
15
  const props = __props;
15
16
  const emit = __emit;
17
+ const pageBuilder = usePageBuilderEditor();
18
+ const locales = computed(() => pageBuilder.getLocales());
16
19
  const emitUpdatePropertyValue = (value) => {
17
20
  const properties = {};
18
21
  properties[props.property.propertyName] = value;
@@ -26,11 +29,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
26
29
  }, null, 8, _hoisted_3)
27
30
  ]),
28
31
  createElementVNode("div", null, [
29
- createVNode(unref(BSTextInput), {
32
+ _ctx.property.multiLang ? (openBlock(), createBlock(unref(BSMultiLangTextInput), {
33
+ key: 0,
34
+ locales: locales.value,
30
35
  "model-value": _ctx.value,
31
36
  width: "100%",
32
37
  "onUpdate:modelValue": emitUpdatePropertyValue
33
- }, null, 8, ["model-value"])
38
+ }, null, 8, ["locales", "model-value"])) : (openBlock(), createBlock(unref(BSTextInput), {
39
+ key: 1,
40
+ "model-value": _ctx.value,
41
+ width: "100%",
42
+ "onUpdate:modelValue": emitUpdatePropertyValue
43
+ }, null, 8, ["model-value"]))
34
44
  ])
35
45
  ]);
36
46
  };
@@ -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-rPBXWjSz.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
@@ -1,15 +1,16 @@
1
1
  import { PartProperty } from '../../../model/part-property.ts';
2
+ import { MultiLangString } from '@g1cloud/bluesea';
2
3
 
3
4
  declare const _default: import('vue').DefineComponent<__VLS_TypePropsToRuntimeProps<{
4
5
  property: PartProperty;
5
- value?: string | undefined;
6
+ value?: string | MultiLangString | undefined;
6
7
  }>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
7
- "update-property-value": (properties: Record<string, string>) => void;
8
+ "update-property-value": (properties: Record<string, unknown>) => void;
8
9
  }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
9
10
  property: PartProperty;
10
- value?: string | undefined;
11
+ value?: string | MultiLangString | undefined;
11
12
  }>>> & {
12
- "onUpdate-property-value"?: ((properties: Record<string, string>) => any) | undefined;
13
+ "onUpdate-property-value"?: ((properties: Record<string, unknown>) => any) | undefined;
13
14
  }, {}, {}>;
14
15
  export default _default;
15
16
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;