@g1cloud/page-builder-editor 1.0.0-alpha.5 → 1.0.0-alpha.50

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.
Files changed (100) hide show
  1. package/css/canvas.scss +16 -137
  2. package/css/{canvas-block.scss → page-block.scss} +15 -3
  3. package/css/page-builder-editor.scss +108 -22
  4. package/css/{canvas-page.scss → page-page.scss} +24 -16
  5. package/css/{canvas-section.scss → page-section.scss} +17 -3
  6. package/css/{canvas-widget.scss → page-widget.scss} +23 -3
  7. package/css/page.scss +74 -0
  8. package/css/property-editor-color.scss +5 -0
  9. package/css/property-editor-html.scss +16 -0
  10. package/css/property-editor-image.scss +1 -1
  11. package/css/property-editor-number.scss +10 -0
  12. package/css/property-editor-youtube.scss +16 -0
  13. package/css/property-group-editor-background.scss +1 -13
  14. package/css/property-group-editor-border.scss +6 -12
  15. package/css/property-group-editor-margin.scss +0 -11
  16. package/css/property-group-editor-media.scss +16 -0
  17. package/css/property-group-editor-padding.scss +0 -11
  18. package/css/property-group-editor-position.scss +0 -11
  19. package/css/property-group-editor-size.scss +0 -11
  20. package/css/property-localpart.scss +2 -2
  21. package/dist/PageBuilderEditor.vue.d.ts +19 -11
  22. package/dist/PbHtmlEditorModal-C0MLYY66.js +193 -0
  23. package/dist/PbPropertyEditorBoolean-c5CNiTpt.js +38 -0
  24. package/dist/PbPropertyEditorColor-hFvMuUZC.js +56 -0
  25. package/dist/PbPropertyEditorHtml-gzh9Nb2Q.js +62 -0
  26. package/dist/PbPropertyEditorImage-D4wJ9fgi.js +43 -0
  27. package/dist/{PbPropertyEditorMultilineText-CfRbKELF.js → PbPropertyEditorMultilineText-Bq1QUweO.js} +29 -28
  28. package/dist/PbPropertyEditorNumber-B76ArSb5.js +47 -0
  29. package/dist/{PbPropertyEditorReadonlyText-Bk0WJxA0.js → PbPropertyEditorReadonlyText-BJ5qx69O.js} +7 -7
  30. package/dist/{PbPropertyEditorSelect-BJovN1su.js → PbPropertyEditorSelect-B5sfulvx.js} +6 -7
  31. package/dist/PbPropertyEditorText-BGIyzz1q.js +50 -0
  32. package/dist/PbPropertyEditorYoutube-uRftqvVU.js +40 -0
  33. package/dist/PbScreenSelectModal-57LXAzjs.js +69 -0
  34. package/dist/PbWidgetAddModal-DF7MRQUS.js +80 -0
  35. package/dist/PbYoutubeModal-CU8sClMD.js +73 -0
  36. package/dist/components/canvas/PbCanvas.vue.d.ts +1 -1
  37. package/dist/components/depart/PbLoginDepart.vue.d.ts +3 -3
  38. package/dist/components/menu/PbMenu.vue.d.ts +16 -1
  39. package/dist/components/menu/PbToolbar.vue.d.ts +16 -1
  40. package/dist/components/menu/PbToolbarButton.vue.d.ts +3 -3
  41. package/dist/components/menu/PbToolbarButtonGroup.vue.d.ts +3 -3
  42. package/dist/components/modal/PbHtmlEditorModal.vue.d.ts +28 -0
  43. package/dist/components/modal/PbPartAddModal.vue.d.ts +4 -4
  44. package/dist/components/modal/PbScreenSelectModal.vue.d.ts +6 -0
  45. package/dist/components/modal/PbWidgetAddModal.vue.d.ts +4 -4
  46. package/dist/components/modal/PbYoutubeModal.vue.d.ts +19 -0
  47. package/dist/components/navigator/PbNavigator.vue.d.ts +1 -1
  48. package/dist/components/part/PbAddWidgetButton.vue.d.ts +1 -1
  49. package/dist/components/part/PbBlock.vue.d.ts +7 -3
  50. package/dist/components/part/PbContainerWidget.vue.d.ts +19 -0
  51. package/dist/components/part/PbPage.vue.d.ts +5 -5
  52. package/dist/components/part/PbPageFrame.vue.d.ts +19 -0
  53. package/dist/components/part/PbSection.vue.d.ts +7 -3
  54. package/dist/components/part/PbWidget.vue.d.ts +5 -3
  55. package/dist/components/sidebar/PbSidebar.vue.d.ts +1 -1
  56. package/dist/components/sidebar/PbSidebarProperties.vue.d.ts +1 -1
  57. package/dist/components/sidebar/PbSidebarPropertyEditor.vue.d.ts +3 -3
  58. package/dist/components/sidebar/PbSidebarPropertyGroupEditor.vue.d.ts +3 -3
  59. package/dist/components/sidebar/property/{PbPropertyEditorProduct.vue.d.ts → PbPropertyEditorBoolean.vue.d.ts} +4 -4
  60. package/dist/components/sidebar/property/{PbPropertyLocalMarketingPart.vue.d.ts → PbPropertyEditorColor.vue.d.ts} +9 -9
  61. package/dist/components/sidebar/property/PbPropertyEditorHtml.vue.d.ts +23 -0
  62. package/dist/components/sidebar/property/PbPropertyEditorImage.vue.d.ts +6 -6
  63. package/dist/components/sidebar/property/PbPropertyEditorMultilineText.vue.d.ts +7 -6
  64. package/dist/components/sidebar/property/PbPropertyEditorNumber.vue.d.ts +23 -0
  65. package/dist/components/sidebar/property/PbPropertyEditorReadonlyText.vue.d.ts +3 -3
  66. package/dist/components/sidebar/property/PbPropertyEditorSelect.vue.d.ts +4 -4
  67. package/dist/components/sidebar/property/PbPropertyEditorText.vue.d.ts +9 -8
  68. package/dist/components/sidebar/property/PbPropertyEditorYoutube.vue.d.ts +23 -0
  69. package/dist/components/sidebar/property/PbPropertyGroupEditorBackground.vue.d.ts +3 -3
  70. package/dist/components/sidebar/property/PbPropertyGroupEditorBorder.vue.d.ts +3 -3
  71. package/dist/components/sidebar/property/PbPropertyGroupEditorMargin.vue.d.ts +3 -3
  72. package/dist/components/sidebar/property/PbPropertyGroupEditorMedia.vue.d.ts +20 -0
  73. package/dist/components/sidebar/property/PbPropertyGroupEditorPadding.vue.d.ts +3 -3
  74. package/dist/components/sidebar/property/PbPropertyGroupEditorPosition.vue.d.ts +3 -3
  75. package/dist/components/sidebar/property/PbPropertyGroupEditorSize.vue.d.ts +3 -3
  76. package/dist/components/ui/PbColorPicker.vue.d.ts +21 -8
  77. package/dist/directives/vPartHandler.d.ts +1 -0
  78. package/dist/{index-Mob7K7vK.js → index-B-YMeKky.js} +4552 -2140
  79. package/dist/index.d.ts +5 -0
  80. package/dist/model/command.d.ts +46 -34
  81. package/dist/model/context.d.ts +22 -25
  82. package/dist/model/default-part-property-group.d.ts +3 -0
  83. package/dist/model/event.d.ts +0 -56
  84. package/dist/model/model.d.ts +9 -5
  85. package/dist/model/page-builder-editor.d.ts +39 -13
  86. package/dist/model/page-builder-util.d.ts +2 -0
  87. package/dist/model/part-definintion.d.ts +3 -2
  88. package/dist/model/part-manager.d.ts +2 -1
  89. package/dist/model/part-property.d.ts +3 -3
  90. package/dist/model/plugin.d.ts +15 -0
  91. package/dist/page-builder-editor.js +27 -19
  92. package/dist/page-builder-editor.umd.cjs +5228 -2318
  93. package/dist/text/text.d.ts +1 -0
  94. package/package.json +9 -6
  95. package/dist/PbPartAddModal-DuLpnV4E.js +0 -50
  96. package/dist/PbPropertyEditorImage-EuqsavTF.js +0 -42
  97. package/dist/PbPropertyEditorProduct-COnCyYJl.js +0 -49
  98. package/dist/PbPropertyEditorText-DNdXl-Tr.js +0 -41
  99. package/dist/PbWidgetAddModal-CQvFYzfU.js +0 -55
  100. package/dist/components/canvas/PbCanvasFrame.vue.d.ts +0 -2
@@ -1,16 +1,4 @@
1
1
  .group-editor-border {
2
- padding: 4px 8px;
3
- font-size: 0.9em;
4
-
5
- > div {
6
- > label {
7
- min-width: 6em;
8
- max-width: 6em;
9
- padding-right: 0.5em;
10
- font-weight: bold;
11
- }
12
- }
13
-
14
2
  .color {
15
3
  width: 50%;
16
4
  flex: 1;
@@ -22,4 +10,10 @@
22
10
  flex-grow: 1;
23
11
  }
24
12
  }
13
+
14
+ .corner-icon {
15
+ width: 1.1em;
16
+ height: 1.1em;
17
+ fill: #000;
18
+ }
25
19
  }
@@ -1,13 +1,2 @@
1
1
  .group-editor-margin {
2
- padding: 4px 8px;
3
- font-size: 0.9em;
4
-
5
- > div {
6
- > label {
7
- min-width: 6em;
8
- max-width: 6em;
9
- padding-right: 0.5em;
10
- font-weight: bold;
11
- }
12
- }
13
2
  }
@@ -0,0 +1,16 @@
1
+ .group-editor-media {
2
+ button {
3
+ color: #fff;
4
+ border: none;
5
+ padding: 4px 12px;
6
+ cursor: pointer;
7
+ line-height: 1;
8
+ width: 120px;
9
+ height: 28px;
10
+ background-color: #1f8fff;
11
+ }
12
+
13
+ .input-area {
14
+ height: 24px;
15
+ }
16
+ }
@@ -1,13 +1,2 @@
1
1
  .group-editor-padding {
2
- padding: 4px 8px;
3
- font-size: 0.9em;
4
-
5
- > div {
6
- > label {
7
- min-width: 6em;
8
- max-width: 6em;
9
- padding-right: 0.5em;
10
- font-weight: bold;
11
- }
12
- }
13
2
  }
@@ -1,13 +1,2 @@
1
1
  .group-editor-position {
2
- padding: 4px 8px;
3
- font-size: 0.9em;
4
-
5
- > div {
6
- > label {
7
- min-width: 6em;
8
- max-width: 6em;
9
- padding-right: 0.5em;
10
- font-weight: bold;
11
- }
12
- }
13
2
  }
@@ -1,13 +1,2 @@
1
1
  .group-editor-size {
2
- padding: 4px 8px;
3
- font-size: 0.9em;
4
-
5
- > div {
6
- > label {
7
- min-width: 6em;
8
- max-width: 6em;
9
- padding-right: 0.5em;
10
- font-weight: bold;
11
- }
12
- }
13
2
  }
@@ -1,7 +1,7 @@
1
1
  .property-editor-local-part {
2
2
 
3
- .label {
4
- font-weight: bold;
3
+ .title {
4
+ font-weight: 600;
5
5
  }
6
6
 
7
7
  button {
@@ -1,20 +1,28 @@
1
- declare const _default: import('vue').DefineComponent<__VLS_TypePropsToRuntimeProps<{
1
+ import { PageBuilderToolbarPlugin } from './model/plugin.ts';
2
+
3
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
2
4
  instanceId?: string | undefined;
3
5
  title?: string | undefined;
4
- editMode?: string | undefined;
5
- pageContent?: any;
6
+ pageContent?: string | undefined;
6
7
  locales?: string[] | undefined;
7
- language?: string | undefined;
8
- }>, {
9
- getLocalDesignPartContent: () => any[] | undefined;
10
- }, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
8
+ locale?: string | undefined;
9
+ toolbarPlugin?: PageBuilderToolbarPlugin | undefined;
10
+ plugin?: unknown;
11
+ }>>, {
12
+ getPageContent: () => string;
13
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
14
+ "update-model": (modified: boolean) => void;
15
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
11
16
  instanceId?: string | undefined;
12
17
  title?: string | undefined;
13
- editMode?: string | undefined;
14
- pageContent?: any;
18
+ pageContent?: string | undefined;
15
19
  locales?: string[] | undefined;
16
- language?: string | undefined;
17
- }>>>, {}, {}>;
20
+ locale?: string | undefined;
21
+ toolbarPlugin?: PageBuilderToolbarPlugin | undefined;
22
+ plugin?: unknown;
23
+ }>>> & Readonly<{
24
+ "onUpdate-model"?: ((modified: boolean) => any) | undefined;
25
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
18
26
  export default _default;
19
27
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
20
28
  type __VLS_TypePropsToRuntimeProps<T> = {
@@ -0,0 +1,193 @@
1
+ import { defineComponent, ref, computed, onMounted, onBeforeUnmount, openBlock, createBlock, unref, withCtx, createElementVNode, createVNode, createSlots, renderList, withDirectives, normalizeStyle } from "vue";
2
+ import { useModalHandle, waitDuring, BSModalFrame, BSTabSheet, vT, BSSelect, BSCodeEditor } from "@g1cloud/bluesea";
3
+ const _hoisted_1 = { class: "bs-layout-vertical flex-grow-1 h-full" };
4
+ const _hoisted_2 = { class: "bs-layout-horizontal h-full pt-8" };
5
+ const _hoisted_3 = { class: "preview" };
6
+ const _hoisted_4 = { class: "bs-layout-vertical w-full h-full" };
7
+ const _hoisted_5 = { class: "bs-layout-horizontal pb-4 align-items-center justify-content-between" };
8
+ const _hoisted_6 = { class: "title pb-4" };
9
+ const _hoisted_7 = { class: "content flex-grow-1 overflow-y-hidden" };
10
+ const _hoisted_8 = ["srcdoc"];
11
+ const _hoisted_9 = { class: "editor bs-layout-vertical pl-8 h-full" };
12
+ const _hoisted_10 = { class: "bs-layout-horizontal justify-content-center" };
13
+ const _sfc_main = /* @__PURE__ */ defineComponent({
14
+ __name: "PbHtmlEditorModal",
15
+ props: {
16
+ html: {},
17
+ locales: {},
18
+ localeTabs: {},
19
+ pageBuilder: {}
20
+ },
21
+ emits: ["updateHtml"],
22
+ setup(__props, { emit: __emit }) {
23
+ const props = __props;
24
+ const emit = __emit;
25
+ const localeTabId = ref(props.localeTabs && props.localeTabs[0].tabId);
26
+ const modalHandle = useModalHandle();
27
+ const html = ref(props.html || {});
28
+ const previewWidth = ref(480);
29
+ const previewStyle = computed(() => ({
30
+ width: `${previewWidth.value}px`,
31
+ height: "100%",
32
+ overflow: "auto",
33
+ transformOrigin: `top left`
34
+ }));
35
+ const preview = computed(() => {
36
+ var _a;
37
+ let data = {};
38
+ const externalCss = props.pageBuilder.getExternalCss();
39
+ (_a = props.locales) == null ? void 0 : _a.forEach((locale) => {
40
+ const _html = html.value[locale] || { tags: "", style: "" };
41
+ data[locale] = _html.tags ? `${externalCss}
42
+ <style>${_html.style}</style>
43
+ ${_html.tags}` : "";
44
+ });
45
+ return data;
46
+ });
47
+ const editorTabs = [
48
+ { tabId: "tags", caption: { key: "pb.modal.htmlEditor.tags" } },
49
+ { tabId: "style", caption: { key: "pb.modal.htmlEditor.style" } }
50
+ ];
51
+ const editorTabId = ref("tags");
52
+ const updateTags = (locale, value) => {
53
+ if (!html.value) html.value = {};
54
+ if (!html.value[locale]) html.value[locale] = {};
55
+ html.value[locale].tags = value;
56
+ };
57
+ const updateStyle = (locale, value) => {
58
+ if (!html.value) html.value = {};
59
+ if (!html.value[locale]) html.value[locale] = {};
60
+ html.value[locale].style = value;
61
+ };
62
+ const ok = () => {
63
+ emit("updateHtml", html.value);
64
+ modalHandle.close();
65
+ };
66
+ const editorHeight = ref("");
67
+ const updateEditorHeight = async () => {
68
+ await waitDuring(50);
69
+ if (editorHeight.value) {
70
+ const editor = document.querySelector(".bs-code-editor");
71
+ if (editor) {
72
+ editor.style.height = editorHeight.value;
73
+ }
74
+ }
75
+ };
76
+ let resizeObserver;
77
+ onMounted(async () => {
78
+ await waitDuring(50);
79
+ const editorParent = document.querySelector(".editor > .bs-tab-sheet > .bs-layout-vertical");
80
+ resizeObserver = new ResizeObserver(() => {
81
+ if (editorParent && editorParent.clientHeight) {
82
+ editorHeight.value = `${editorParent.clientHeight}px`;
83
+ updateEditorHeight();
84
+ }
85
+ });
86
+ if (editorParent) {
87
+ resizeObserver.observe(editorParent);
88
+ }
89
+ });
90
+ onBeforeUnmount(() => {
91
+ if (resizeObserver) {
92
+ resizeObserver.disconnect();
93
+ }
94
+ });
95
+ return (_ctx, _cache) => {
96
+ return openBlock(), createBlock(unref(BSModalFrame), {
97
+ title: { key: "pb.modal.htmlEditor.title" },
98
+ class: "pb-html-editor-modal"
99
+ }, {
100
+ default: withCtx(() => [
101
+ createElementVNode("div", _hoisted_1, [
102
+ createVNode(unref(BSTabSheet), {
103
+ "tab-id": localeTabId.value,
104
+ "onUpdate:tabId": [
105
+ _cache[2] || (_cache[2] = ($event) => localeTabId.value = $event),
106
+ updateEditorHeight
107
+ ],
108
+ tabs: _ctx.localeTabs,
109
+ class: "flex-grow-1"
110
+ }, createSlots({ _: 2 }, [
111
+ renderList(_ctx.locales, (locale) => {
112
+ return {
113
+ name: `tab-${locale}`,
114
+ fn: withCtx(() => [
115
+ createElementVNode("div", _hoisted_2, [
116
+ createElementVNode("div", _hoisted_3, [
117
+ createElementVNode("div", _hoisted_4, [
118
+ createElementVNode("div", _hoisted_5, [
119
+ withDirectives(createElementVNode("div", _hoisted_6, null, 512), [
120
+ [unref(vT), { key: "pb.modal.htmlEditor.preview" }]
121
+ ]),
122
+ createVNode(unref(BSSelect), {
123
+ modelValue: previewWidth.value,
124
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => previewWidth.value = $event),
125
+ items: [480, 768, 1024, 1280],
126
+ "label-provider": (v) => `Screen Size: ${v}px`,
127
+ "view-model": false
128
+ }, null, 8, ["modelValue", "label-provider"])
129
+ ]),
130
+ createElementVNode("div", _hoisted_7, [
131
+ createElementVNode("iframe", {
132
+ srcdoc: preview.value[locale],
133
+ style: normalizeStyle(previewStyle.value)
134
+ }, null, 12, _hoisted_8)
135
+ ])
136
+ ])
137
+ ]),
138
+ createElementVNode("div", _hoisted_9, [
139
+ createVNode(unref(BSTabSheet), {
140
+ "tab-id": editorTabId.value,
141
+ "onUpdate:tabId": [
142
+ _cache[1] || (_cache[1] = ($event) => editorTabId.value = $event),
143
+ updateEditorHeight
144
+ ],
145
+ tabs: editorTabs,
146
+ class: "compact flex-grow-1"
147
+ }, {
148
+ tags: withCtx(() => [
149
+ createVNode(unref(BSCodeEditor), {
150
+ "model-value": (html.value[locale] || {}).tags,
151
+ class: "border-top-0",
152
+ "editor-height": "100%",
153
+ lang: "html",
154
+ "onUpdate:modelValue": (value) => updateTags(locale, value)
155
+ }, null, 8, ["model-value", "onUpdate:modelValue"])
156
+ ]),
157
+ style: withCtx(() => [
158
+ createVNode(unref(BSCodeEditor), {
159
+ "model-value": (html.value[locale] || {}).style,
160
+ class: "border-top-0",
161
+ "editor-height": "100%",
162
+ lang: "css",
163
+ "onUpdate:modelValue": (value) => updateStyle(locale, value)
164
+ }, null, 8, ["model-value", "onUpdate:modelValue"])
165
+ ]),
166
+ _: 2
167
+ }, 1032, ["tab-id"])
168
+ ])
169
+ ])
170
+ ])
171
+ };
172
+ })
173
+ ]), 1032, ["tab-id", "tabs"])
174
+ ])
175
+ ]),
176
+ buttons: withCtx(() => [
177
+ createElementVNode("div", _hoisted_10, [
178
+ withDirectives(createElementVNode("button", {
179
+ class: "mr-4",
180
+ onClick: ok
181
+ }, null, 512), [
182
+ [unref(vT), { key: "pb.button.ok" }]
183
+ ])
184
+ ])
185
+ ]),
186
+ _: 1
187
+ });
188
+ };
189
+ }
190
+ });
191
+ export {
192
+ _sfc_main as default
193
+ };
@@ -0,0 +1,38 @@
1
+ import { defineComponent, ref, openBlock, createElementBlock, createElementVNode, createVNode, unref } from "vue";
2
+ import { BSCheckbox } from "@g1cloud/bluesea";
3
+ const _hoisted_1 = { class: "property-editor property-editor-boolean flex-align-center my-12" };
4
+ const _sfc_main = /* @__PURE__ */ defineComponent({
5
+ __name: "PbPropertyEditorBoolean",
6
+ props: {
7
+ property: {},
8
+ value: {}
9
+ },
10
+ emits: ["update-property-value"],
11
+ setup(__props, { emit: __emit }) {
12
+ const props = __props;
13
+ const booleanValue = ref((props == null ? void 0 : props.value) === "true");
14
+ const emit = __emit;
15
+ const emitUpdatePropertyValue = (value) => {
16
+ const properties = {};
17
+ properties[props.property.propertyName] = value ? "true" : "false";
18
+ emit("update-property-value", properties);
19
+ };
20
+ return (_ctx, _cache) => {
21
+ return openBlock(), createElementBlock("div", _hoisted_1, [
22
+ createElementVNode("div", null, [
23
+ createVNode(unref(BSCheckbox), {
24
+ modelValue: booleanValue.value,
25
+ "onUpdate:modelValue": [
26
+ _cache[0] || (_cache[0] = ($event) => booleanValue.value = $event),
27
+ emitUpdatePropertyValue
28
+ ],
29
+ label: { key: _ctx.property.caption }
30
+ }, null, 8, ["modelValue", "label"])
31
+ ])
32
+ ]);
33
+ };
34
+ }
35
+ });
36
+ export {
37
+ _sfc_main as default
38
+ };
@@ -0,0 +1,56 @@
1
+ import { defineComponent, openBlock, createElementBlock, createElementVNode, withDirectives, unref, createVNode } from "vue";
2
+ import { vT, BSTextInput } from "@g1cloud/bluesea";
3
+ import { P as PbColorPicker } from "./index-B-YMeKky.js";
4
+ const _hoisted_1 = { class: "property-editor property-editor-color" };
5
+ const _hoisted_2 = { class: "title" };
6
+ const _hoisted_3 = { class: "bs-layout-horizontal flex-align-center color" };
7
+ const _sfc_main = /* @__PURE__ */ defineComponent({
8
+ __name: "PbPropertyEditorColor",
9
+ props: {
10
+ property: {},
11
+ value: {}
12
+ },
13
+ emits: ["update-property-value"],
14
+ setup(__props, { emit: __emit }) {
15
+ const props = __props;
16
+ const emit = __emit;
17
+ const emptyColor = () => {
18
+ };
19
+ const saveOriginalColor = () => {
20
+ };
21
+ const updateColor = (value) => {
22
+ const properties = {};
23
+ properties[props.property.propertyName] = value;
24
+ emit("update-property-value", properties);
25
+ };
26
+ return (_ctx, _cache) => {
27
+ return openBlock(), createElementBlock("div", _hoisted_1, [
28
+ createElementVNode("div", _hoisted_2, [
29
+ withDirectives(createElementVNode("label", null, null, 512), [
30
+ [unref(vT), { key: _ctx.property.caption }]
31
+ ])
32
+ ]),
33
+ createElementVNode("div", _hoisted_3, [
34
+ createVNode(PbColorPicker, {
35
+ value: _ctx.value,
36
+ "hide-delete": "",
37
+ onEmpty: _cache[0] || (_cache[0] = ($event) => emptyColor()),
38
+ onHide: _cache[1] || (_cache[1] = ($event) => updateColor($event)),
39
+ onShow: saveOriginalColor,
40
+ onChangeColor: _cache[2] || (_cache[2] = ($event) => updateColor($event))
41
+ }, null, 8, ["value"]),
42
+ createVNode(unref(BSTextInput), {
43
+ "model-value": _ctx.value,
44
+ prefix: { type: "font-icon", value: "palette" },
45
+ class: "ml-4",
46
+ width: "",
47
+ "onUpdate:modelValue": updateColor
48
+ }, null, 8, ["model-value"])
49
+ ])
50
+ ]);
51
+ };
52
+ }
53
+ });
54
+ export {
55
+ _sfc_main as default
56
+ };
@@ -0,0 +1,62 @@
1
+ import { defineComponent, openBlock, createElementBlock, createElementVNode, withDirectives, unref, createTextVNode, defineAsyncComponent } from "vue";
2
+ import { useModal, vT } from "@g1cloud/bluesea";
3
+ import { u as usePageBuilderEditor } from "./index-B-YMeKky.js";
4
+ const _hoisted_1 = { class: "property-editor property-editor-image flex-align-center" };
5
+ const _hoisted_2 = { class: "title" };
6
+ const _sfc_main = /* @__PURE__ */ defineComponent({
7
+ __name: "PbPropertyEditorHtml",
8
+ props: {
9
+ property: {},
10
+ value: {}
11
+ },
12
+ emits: ["update-property-value"],
13
+ setup(__props, { emit: __emit }) {
14
+ const props = __props;
15
+ const modal = useModal();
16
+ const pageBuilder = usePageBuilderEditor();
17
+ const emit = __emit;
18
+ const editHtml = () => {
19
+ const locales = pageBuilder.getLocales();
20
+ const localeTabs = locales.map((v) => ({ tabId: `tab-${v}`, caption: v }));
21
+ modal.openModal({
22
+ component: defineAsyncComponent(() => import("./PbHtmlEditorModal-C0MLYY66.js")),
23
+ style: {
24
+ width: "80%",
25
+ height: "80%",
26
+ minWidth: "500px",
27
+ minHeight: "400px"
28
+ },
29
+ bind: {
30
+ html: JSON.parse(JSON.stringify(props.value || {})),
31
+ locales,
32
+ localeTabs,
33
+ pageBuilder
34
+ },
35
+ on: {
36
+ updateHtml: (html) => {
37
+ emit("update-property-value", { html });
38
+ }
39
+ }
40
+ });
41
+ };
42
+ return (_ctx, _cache) => {
43
+ return openBlock(), createElementBlock("div", _hoisted_1, [
44
+ createElementVNode("div", _hoisted_2, [
45
+ withDirectives(createElementVNode("label", null, null, 512), [
46
+ [unref(vT), { key: _ctx.property.caption }]
47
+ ])
48
+ ]),
49
+ createElementVNode("div", null, [
50
+ withDirectives((openBlock(), createElementBlock("button", { onClick: editHtml }, _cache[0] || (_cache[0] = [
51
+ createTextVNode("Edit HTML")
52
+ ]))), [
53
+ [unref(vT), { key: "pb.prop.editHtml" }]
54
+ ])
55
+ ])
56
+ ]);
57
+ };
58
+ }
59
+ });
60
+ export {
61
+ _sfc_main as default
62
+ };
@@ -0,0 +1,43 @@
1
+ import { defineComponent, openBlock, createElementBlock, createElementVNode, withDirectives, unref } from "vue";
2
+ import { u as usePageBuilderEditor } from "./index-B-YMeKky.js";
3
+ import { useModal, vT } from "@g1cloud/bluesea";
4
+ const _hoisted_1 = { class: "property-editor property-editor-image flex-align-center" };
5
+ const _hoisted_2 = { class: "title" };
6
+ const _sfc_main = /* @__PURE__ */ defineComponent({
7
+ __name: "PbPropertyEditorImage",
8
+ props: {
9
+ property: {},
10
+ value: {}
11
+ },
12
+ emits: ["update-property-value"],
13
+ setup(__props, { emit: __emit }) {
14
+ const pageBuilder = usePageBuilderEditor();
15
+ const modal = useModal();
16
+ const emit = __emit;
17
+ const selectImage = () => {
18
+ const imageProvider = pageBuilder.getProvider("imageProvider");
19
+ if (imageProvider) {
20
+ imageProvider({ modal }, (media) => {
21
+ emit("update-property-value", { media, altText: media.altText });
22
+ });
23
+ }
24
+ };
25
+ return (_ctx, _cache) => {
26
+ return openBlock(), createElementBlock("div", _hoisted_1, [
27
+ createElementVNode("div", _hoisted_2, [
28
+ withDirectives(createElementVNode("label", null, null, 512), [
29
+ [unref(vT), { key: _ctx.property.caption }]
30
+ ])
31
+ ]),
32
+ createElementVNode("div", null, [
33
+ withDirectives(createElementVNode("button", { onClick: selectImage }, null, 512), [
34
+ [unref(vT), { key: "pb.prop.selectImage" }]
35
+ ])
36
+ ])
37
+ ]);
38
+ };
39
+ }
40
+ });
41
+ export {
42
+ _sfc_main as default
43
+ };
@@ -1,9 +1,8 @@
1
- import { defineComponent, computed, openBlock, createElementBlock, createElementVNode, toDisplayString, createVNode, unref } from "vue";
2
- import { BSTextArea } from "@g1cloud/bluesea";
3
- import { u as usePageBuilderEditor } from "./index-Mob7K7vK.js";
1
+ import { defineComponent, computed, openBlock, createElementBlock, createElementVNode, withDirectives, unref, createBlock } from "vue";
2
+ import { vT, BSMultiLangTextArea, BSTextArea } from "@g1cloud/bluesea";
3
+ import { u as usePageBuilderEditor } from "./index-B-YMeKky.js";
4
4
  const _hoisted_1 = { class: "property-editor property-editor-multiline-text" };
5
- const _hoisted_2 = { class: "label" };
6
- const _hoisted_3 = ["textContent"];
5
+ const _hoisted_2 = { class: "title" };
7
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
8
7
  __name: "PbPropertyEditorMultilineText",
9
8
  props: {
@@ -14,47 +13,49 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
14
13
  setup(__props, { emit: __emit }) {
15
14
  const props = __props;
16
15
  const emit = __emit;
17
- const emitUpdatePropertyValue = (value) => {
18
- const properties = {};
19
- if (props.value && typeof props.value === "object") {
20
- properties[props.property.propertyName] = {
21
- ...props.value,
22
- [language.value]: value
23
- };
24
- } else {
25
- properties[props.property.propertyName] = {
26
- [language.value]: value
27
- };
28
- }
29
- emit("update-property-value", properties);
30
- };
31
16
  const pageBuilder = usePageBuilderEditor();
32
- const language = computed(() => pageBuilder.language.value);
17
+ const locales = computed(() => pageBuilder.getLocales());
33
18
  const text = computed({
34
19
  get() {
35
- return props.value && typeof props.value === "object" ? props.value[language.value] : "";
20
+ return props.value;
36
21
  },
37
- set() {
22
+ // @ts-ignore
23
+ set(value) {
38
24
  }
39
25
  });
26
+ const emitUpdatePropertyValue = (value) => {
27
+ const properties = {};
28
+ properties[props.property.propertyName] = value;
29
+ emit("update-property-value", properties);
30
+ };
40
31
  return (_ctx, _cache) => {
41
32
  return openBlock(), createElementBlock("div", _hoisted_1, [
42
33
  createElementVNode("div", _hoisted_2, [
43
- createElementVNode("label", {
44
- textContent: toDisplayString(_ctx.property.caption)
45
- }, null, 8, _hoisted_3)
34
+ withDirectives(createElementVNode("label", null, null, 512), [
35
+ [unref(vT), { key: _ctx.property.caption }]
36
+ ])
46
37
  ]),
47
38
  createElementVNode("div", null, [
48
- createVNode(unref(BSTextArea), {
39
+ _ctx.property.multiLang ? (openBlock(), createBlock(unref(BSMultiLangTextArea), {
40
+ key: 0,
49
41
  modelValue: text.value,
50
42
  "onUpdate:modelValue": [
51
43
  _cache[0] || (_cache[0] = ($event) => text.value = $event),
52
44
  emitUpdatePropertyValue
53
45
  ],
54
- prefix: language.value,
46
+ locales: locales.value,
47
+ height: "60px",
48
+ width: "100%"
49
+ }, null, 8, ["modelValue", "locales"])) : (openBlock(), createBlock(unref(BSTextArea), {
50
+ key: 1,
51
+ modelValue: text.value,
52
+ "onUpdate:modelValue": [
53
+ _cache[1] || (_cache[1] = ($event) => text.value = $event),
54
+ emitUpdatePropertyValue
55
+ ],
55
56
  height: "60px",
56
57
  width: "100%"
57
- }, null, 8, ["modelValue", "prefix"])
58
+ }, null, 8, ["modelValue"]))
58
59
  ])
59
60
  ]);
60
61
  };