@g1cloud/page-builder-editor 1.0.0-alpha.2 → 1.0.0-alpha.21
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.
- package/css/canvas-block.scss +1 -1
- package/css/canvas-section.scss +1 -1
- package/css/canvas-widget.scss +1 -1
- package/css/canvas.scss +1 -2
- package/css/page-builder-editor.scss +84 -12
- package/css/property-editor-color.scss +5 -0
- package/css/property-editor-html.scss +16 -0
- package/css/property-editor-image.scss +1 -1
- package/css/property-group-editor-background.scss +1 -13
- package/css/property-group-editor-border.scss +6 -12
- package/css/property-group-editor-margin.scss +0 -11
- package/css/property-group-editor-padding.scss +0 -11
- package/css/property-group-editor-position.scss +0 -11
- package/css/property-group-editor-size.scss +0 -11
- package/css/property-localpart.scss +2 -2
- package/dist/PageBuilderEditor.vue.d.ts +13 -5
- package/dist/PbHtmlEditorModal-aaecwH7V.js +131 -0
- package/dist/PbPropertyEditorColor-BFMkFOYX.js +57 -0
- package/dist/PbPropertyEditorHtml-DZw8qbJH.js +58 -0
- package/dist/{PbPropertyEditorImage-DA92v7AE.js → PbPropertyEditorImage-BQhiQyNM.js} +8 -8
- package/dist/PbPropertyEditorMultilineText-CT3vTbYY.js +67 -0
- package/dist/{PbPropertyEditorReadonlyText-Bk0WJxA0.js → PbPropertyEditorReadonlyText-Dgp_AVOD.js} +1 -1
- package/dist/{PbPropertyEditorSelect-BJovN1su.js → PbPropertyEditorSelect-CWedbXJI.js} +1 -1
- package/dist/{PbPropertyEditorText-DNdXl-Tr.js → PbPropertyEditorText-DmM_LMjC.js} +15 -5
- package/dist/PbScreenSelectModal-DDATc9n1.js +67 -0
- package/dist/{PbWidgetAddModal-CQvFYzfU.js → PbWidgetAddModal-BoYfb0dm.js} +32 -8
- package/dist/components/menu/PbMenu.vue.d.ts +16 -1
- package/dist/components/menu/PbToolbar.vue.d.ts +16 -1
- package/dist/components/modal/PbHtmlEditorModal.vue.d.ts +25 -0
- package/dist/components/modal/PbScreenSelectModal.vue.d.ts +6 -0
- package/dist/components/sidebar/property/{PbPropertyLocalMarketingPart.vue.d.ts → PbPropertyEditorHtml.vue.d.ts} +7 -7
- package/dist/components/sidebar/property/PbPropertyEditorMultilineText.vue.d.ts +6 -4
- package/dist/components/sidebar/property/PbPropertyEditorText.vue.d.ts +5 -4
- package/dist/components/ui/PbColorPicker.vue.d.ts +2 -2
- package/dist/{index-Dwk2ffWe.js → index-Cr-_-n9T.js} +1502 -1167
- package/dist/index.d.ts +1 -0
- package/dist/model/command.d.ts +26 -13
- package/dist/model/context.d.ts +10 -13
- package/dist/model/event.d.ts +0 -56
- package/dist/model/model.d.ts +11 -4
- package/dist/model/page-builder-editor.d.ts +39 -7
- package/dist/model/page-builder-util.d.ts +2 -2
- package/dist/model/part-definintion.d.ts +4 -1
- package/dist/model/part-manager.d.ts +0 -1
- package/dist/model/part-property.d.ts +1 -0
- package/dist/model/plugin.d.ts +10 -0
- package/dist/page-builder-editor.js +23 -19
- package/dist/page-builder-editor.umd.cjs +1910 -1310
- package/package.json +4 -3
- package/dist/PbPartAddModal-DuLpnV4E.js +0 -50
- package/dist/PbPropertyEditorMultilineText-BMeNUGm8.js +0 -42
- package/dist/PbPropertyEditorProduct-CkydxTwD.js +0 -49
- /package/dist/components/sidebar/property/{PbPropertyEditorProduct.vue.d.ts → PbPropertyEditorColor.vue.d.ts} +0 -0
package/css/canvas-block.scss
CHANGED
package/css/canvas-section.scss
CHANGED
package/css/canvas-widget.scss
CHANGED
package/css/canvas.scss
CHANGED
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
.pb-tool-button-group {
|
|
20
20
|
&::after {
|
|
21
21
|
content: '';
|
|
22
|
+
margin: 0 8px;
|
|
22
23
|
height: 80%;
|
|
23
24
|
border-right: 1px solid $color-border-light;
|
|
24
25
|
align-self: center;
|
|
@@ -26,6 +27,7 @@
|
|
|
26
27
|
|
|
27
28
|
.pb-tool-button {
|
|
28
29
|
padding: 2px;
|
|
30
|
+
margin: 0 2px;
|
|
29
31
|
|
|
30
32
|
.tool-button {
|
|
31
33
|
width: 28px;
|
|
@@ -67,31 +69,41 @@
|
|
|
67
69
|
overflow-y: auto;
|
|
68
70
|
padding: 8px 0;
|
|
69
71
|
flex-grow: 1;
|
|
72
|
+
|
|
73
|
+
&:focus {
|
|
74
|
+
outline: none;
|
|
75
|
+
}
|
|
70
76
|
}
|
|
71
77
|
|
|
78
|
+
|
|
72
79
|
.pb-sidebar {
|
|
73
80
|
width: 300px;
|
|
74
81
|
overflow: auto;
|
|
75
82
|
border: 1px solid $color-border-light;
|
|
76
83
|
|
|
77
84
|
.pb-sidebar-properties {
|
|
78
|
-
padding:
|
|
85
|
+
padding: 0;
|
|
79
86
|
|
|
80
87
|
.pb-sidebar-property-group {
|
|
88
|
+
&:not(:empty) {
|
|
89
|
+
padding: 16px 16px;
|
|
90
|
+
border-bottom: 1px solid #eaeaea;
|
|
81
91
|
|
|
82
|
-
|
|
92
|
+
}
|
|
83
93
|
|
|
84
94
|
.group-title {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
95
|
+
> label {
|
|
96
|
+
padding: 4px 0;
|
|
97
|
+
font-size: 90%;
|
|
98
|
+
font-weight: 600;
|
|
99
|
+
}
|
|
88
100
|
}
|
|
89
101
|
|
|
90
102
|
.group-editor {
|
|
91
|
-
padding: 4px
|
|
103
|
+
padding: 4px 0;
|
|
92
104
|
font-size: 0.9em;
|
|
93
105
|
|
|
94
|
-
.
|
|
106
|
+
.title {
|
|
95
107
|
padding: 0 0 8px 0;
|
|
96
108
|
|
|
97
109
|
label {
|
|
@@ -101,20 +113,29 @@
|
|
|
101
113
|
font-weight: bold;
|
|
102
114
|
}
|
|
103
115
|
}
|
|
116
|
+
|
|
117
|
+
.sub-title {
|
|
118
|
+
label {
|
|
119
|
+
min-width: 6em;
|
|
120
|
+
max-width: 6em;
|
|
121
|
+
padding-right: 0.5em;
|
|
122
|
+
font-weight: 400;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
104
125
|
}
|
|
105
126
|
|
|
106
127
|
.property-editor {
|
|
107
|
-
padding: 4px
|
|
128
|
+
padding: 4px 0;
|
|
108
129
|
font-size: 0.9em;
|
|
109
130
|
|
|
110
|
-
> .
|
|
131
|
+
> .title {
|
|
111
132
|
padding: 0 0 8px 0;
|
|
112
133
|
|
|
113
|
-
label {
|
|
134
|
+
> label {
|
|
114
135
|
min-width: 6em;
|
|
115
136
|
max-width: 6em;
|
|
116
137
|
padding-right: 0.5em;
|
|
117
|
-
font-weight:
|
|
138
|
+
font-weight: 600;
|
|
118
139
|
}
|
|
119
140
|
}
|
|
120
141
|
}
|
|
@@ -123,12 +144,14 @@
|
|
|
123
144
|
margin-top: 4px
|
|
124
145
|
}
|
|
125
146
|
|
|
147
|
+
@import "./property-editor-color";
|
|
126
148
|
@import "./property-editor-image";
|
|
127
149
|
@import "./property-editor-multiline-text";
|
|
128
150
|
@import "./property-editor-product";
|
|
129
151
|
@import "./property-editor-readonly-text";
|
|
130
152
|
@import "./property-editor-select";
|
|
131
153
|
@import "./property-editor-text";
|
|
154
|
+
@import "./property-editor-html";
|
|
132
155
|
|
|
133
156
|
@import "./property-group-editor-background";
|
|
134
157
|
@import "./property-group-editor-border";
|
|
@@ -203,4 +226,53 @@
|
|
|
203
226
|
padding: 8px 16px;
|
|
204
227
|
}
|
|
205
228
|
}
|
|
206
|
-
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.pb-html-editor-modal {
|
|
232
|
+
.preview {
|
|
233
|
+
width: 50%;
|
|
234
|
+
|
|
235
|
+
.content {
|
|
236
|
+
border: solid 1px #ccc;
|
|
237
|
+
overflow-y: auto;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.editor {
|
|
242
|
+
width: 50%;
|
|
243
|
+
|
|
244
|
+
.tags {
|
|
245
|
+
height: 60%;
|
|
246
|
+
|
|
247
|
+
.content {
|
|
248
|
+
overflow-y: auto;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.style {
|
|
253
|
+
height: 40%;
|
|
254
|
+
|
|
255
|
+
.content {
|
|
256
|
+
overflow-y: auto;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.bs-code-editor {
|
|
261
|
+
height: 100%;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.buttons {
|
|
266
|
+
text-align: center;
|
|
267
|
+
|
|
268
|
+
button {
|
|
269
|
+
color: #fff;
|
|
270
|
+
border: none;
|
|
271
|
+
padding: 4px 12px;
|
|
272
|
+
cursor: pointer;
|
|
273
|
+
line-height: 1;
|
|
274
|
+
height: 28px;
|
|
275
|
+
background-color: #1f8fff;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
@@ -1,16 +1,4 @@
|
|
|
1
1
|
.group-editor-background {
|
|
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
|
flex: 1;
|
|
16
4
|
display: flex;
|
|
@@ -32,7 +20,7 @@
|
|
|
32
20
|
padding: 4px 12px;
|
|
33
21
|
cursor: pointer;
|
|
34
22
|
line-height: 1;
|
|
35
|
-
width:
|
|
23
|
+
width: 120px;
|
|
36
24
|
height: 28px;
|
|
37
25
|
background-color: #1f8fff;
|
|
38
26
|
}
|
|
@@ -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,15 +1,23 @@
|
|
|
1
|
+
import { PageBuilderToolbarPlugin } from './model/plugin.ts';
|
|
2
|
+
|
|
1
3
|
declare const _default: import('vue').DefineComponent<__VLS_TypePropsToRuntimeProps<{
|
|
2
4
|
instanceId?: string | undefined;
|
|
3
5
|
title?: string | undefined;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
+
pageContent?: string | undefined;
|
|
7
|
+
locales?: string[] | undefined;
|
|
8
|
+
locale?: string | undefined;
|
|
9
|
+
toolbarPlugin?: PageBuilderToolbarPlugin | undefined;
|
|
10
|
+
plugin?: unknown;
|
|
6
11
|
}>, {
|
|
7
|
-
|
|
12
|
+
getPageContent: () => string;
|
|
8
13
|
}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
9
14
|
instanceId?: string | undefined;
|
|
10
15
|
title?: string | undefined;
|
|
11
|
-
|
|
12
|
-
|
|
16
|
+
pageContent?: string | undefined;
|
|
17
|
+
locales?: string[] | undefined;
|
|
18
|
+
locale?: string | undefined;
|
|
19
|
+
toolbarPlugin?: PageBuilderToolbarPlugin | undefined;
|
|
20
|
+
plugin?: unknown;
|
|
13
21
|
}>>>, {}, {}>;
|
|
14
22
|
export default _default;
|
|
15
23
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { defineComponent, ref, computed, openBlock, createBlock, unref, withCtx, createElementVNode, createVNode, createSlots, renderList } from "vue";
|
|
2
|
+
import { useModalHandle, BSModalFrame, BSTabSheet, 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 flex-grow-1" };
|
|
6
|
+
const _hoisted_4 = { class: "bs-layout-vertical w-full h-full" };
|
|
7
|
+
const _hoisted_5 = /* @__PURE__ */ createElementVNode("div", { class: "title pb-4" }, "Preview", -1);
|
|
8
|
+
const _hoisted_6 = ["innerHTML"];
|
|
9
|
+
const _hoisted_7 = { class: "editor bs-layout-vertical pl-8" };
|
|
10
|
+
const _hoisted_8 = { class: "tags bs-layout-vertical w-full" };
|
|
11
|
+
const _hoisted_9 = /* @__PURE__ */ createElementVNode("div", { class: "title pb-4" }, "HTML", -1);
|
|
12
|
+
const _hoisted_10 = { class: "content flex-grow-1" };
|
|
13
|
+
const _hoisted_11 = { class: "style bs-layout-vertical w-full pt-8" };
|
|
14
|
+
const _hoisted_12 = /* @__PURE__ */ createElementVNode("div", { class: "title pb-4" }, "Style", -1);
|
|
15
|
+
const _hoisted_13 = { class: "content flex-grow-1" };
|
|
16
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
17
|
+
__name: "PbHtmlEditorModal",
|
|
18
|
+
props: {
|
|
19
|
+
html: {},
|
|
20
|
+
locales: {},
|
|
21
|
+
localeTabs: {}
|
|
22
|
+
},
|
|
23
|
+
emits: ["updateHtml"],
|
|
24
|
+
setup(__props, { emit: __emit }) {
|
|
25
|
+
const props = __props;
|
|
26
|
+
const emit = __emit;
|
|
27
|
+
const tabId = ref(props.localeTabs && props.localeTabs[0].tabId);
|
|
28
|
+
const modalHandle = useModalHandle();
|
|
29
|
+
const html = ref(props.html || {});
|
|
30
|
+
const preview = computed(() => {
|
|
31
|
+
var _a;
|
|
32
|
+
let data = {};
|
|
33
|
+
(_a = props.locales) == null ? void 0 : _a.forEach((locale) => {
|
|
34
|
+
const _html = html.value[locale] || { tags: "", style: "" };
|
|
35
|
+
data[locale] = _html.tags ? `${_html.tags}
|
|
36
|
+
<style>${_html.style}</style>` : "";
|
|
37
|
+
});
|
|
38
|
+
return data;
|
|
39
|
+
});
|
|
40
|
+
const updateTags = (locale, value) => {
|
|
41
|
+
if (!html.value)
|
|
42
|
+
html.value = {};
|
|
43
|
+
if (!html.value[locale])
|
|
44
|
+
html.value[locale] = {};
|
|
45
|
+
html.value[locale].tags = value;
|
|
46
|
+
};
|
|
47
|
+
const updateStyle = (locale, value) => {
|
|
48
|
+
if (!html.value)
|
|
49
|
+
html.value = {};
|
|
50
|
+
if (!html.value[locale])
|
|
51
|
+
html.value[locale] = {};
|
|
52
|
+
html.value[locale].style = value;
|
|
53
|
+
};
|
|
54
|
+
const ok = () => {
|
|
55
|
+
emit("updateHtml", html.value);
|
|
56
|
+
modalHandle.close();
|
|
57
|
+
};
|
|
58
|
+
return (_ctx, _cache) => {
|
|
59
|
+
return openBlock(), createBlock(unref(BSModalFrame), {
|
|
60
|
+
class: "pb-html-editor-modal",
|
|
61
|
+
title: "HTML Editor"
|
|
62
|
+
}, {
|
|
63
|
+
default: withCtx(() => [
|
|
64
|
+
createElementVNode("div", _hoisted_1, [
|
|
65
|
+
createVNode(unref(BSTabSheet), {
|
|
66
|
+
"tab-id": tabId.value,
|
|
67
|
+
"onUpdate:tabId": _cache[0] || (_cache[0] = ($event) => tabId.value = $event),
|
|
68
|
+
tabs: _ctx.localeTabs,
|
|
69
|
+
class: "flex-grow-1"
|
|
70
|
+
}, createSlots({ _: 2 }, [
|
|
71
|
+
renderList(_ctx.locales, (locale) => {
|
|
72
|
+
return {
|
|
73
|
+
name: `tab-${locale}`,
|
|
74
|
+
fn: withCtx(() => [
|
|
75
|
+
createElementVNode("div", _hoisted_2, [
|
|
76
|
+
createElementVNode("div", _hoisted_3, [
|
|
77
|
+
createElementVNode("div", _hoisted_4, [
|
|
78
|
+
_hoisted_5,
|
|
79
|
+
createElementVNode("div", {
|
|
80
|
+
class: "content flex-grow-1",
|
|
81
|
+
innerHTML: preview.value[locale]
|
|
82
|
+
}, null, 8, _hoisted_6)
|
|
83
|
+
])
|
|
84
|
+
]),
|
|
85
|
+
createElementVNode("div", _hoisted_7, [
|
|
86
|
+
createElementVNode("div", _hoisted_8, [
|
|
87
|
+
_hoisted_9,
|
|
88
|
+
createElementVNode("div", _hoisted_10, [
|
|
89
|
+
createVNode(unref(BSCodeEditor), {
|
|
90
|
+
"model-value": (html.value[locale] || {}).tags,
|
|
91
|
+
"editor-height": "100%",
|
|
92
|
+
lang: "html",
|
|
93
|
+
"onUpdate:modelValue": (value) => updateTags(locale, value)
|
|
94
|
+
}, null, 8, ["model-value", "onUpdate:modelValue"])
|
|
95
|
+
])
|
|
96
|
+
]),
|
|
97
|
+
createElementVNode("div", _hoisted_11, [
|
|
98
|
+
_hoisted_12,
|
|
99
|
+
createElementVNode("div", _hoisted_13, [
|
|
100
|
+
createVNode(unref(BSCodeEditor), {
|
|
101
|
+
"model-value": (html.value[locale] || {}).style,
|
|
102
|
+
"editor-height": "100%",
|
|
103
|
+
lang: "css",
|
|
104
|
+
"onUpdate:modelValue": (value) => updateStyle(locale, value)
|
|
105
|
+
}, null, 8, ["model-value", "onUpdate:modelValue"])
|
|
106
|
+
])
|
|
107
|
+
])
|
|
108
|
+
])
|
|
109
|
+
])
|
|
110
|
+
])
|
|
111
|
+
};
|
|
112
|
+
})
|
|
113
|
+
]), 1032, ["tab-id", "tabs"])
|
|
114
|
+
])
|
|
115
|
+
]),
|
|
116
|
+
buttons: withCtx(() => [
|
|
117
|
+
createElementVNode("div", { class: "bs-layout-horizontal justify-content-center" }, [
|
|
118
|
+
createElementVNode("button", {
|
|
119
|
+
class: "mr-4",
|
|
120
|
+
onClick: ok
|
|
121
|
+
}, "OK")
|
|
122
|
+
])
|
|
123
|
+
]),
|
|
124
|
+
_: 1
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
export {
|
|
130
|
+
_sfc_main as default
|
|
131
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, createVNode, unref } from "vue";
|
|
2
|
+
import { BSTextInput } from "@g1cloud/bluesea";
|
|
3
|
+
import { P as PbColorPicker } from "./index-Cr-_-n9T.js";
|
|
4
|
+
const _hoisted_1 = { class: "property-editor property-editor-color" };
|
|
5
|
+
const _hoisted_2 = { class: "title" };
|
|
6
|
+
const _hoisted_3 = ["textContent"];
|
|
7
|
+
const _hoisted_4 = { class: "bs-layout-horizontal flex-align-center color" };
|
|
8
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9
|
+
__name: "PbPropertyEditorColor",
|
|
10
|
+
props: {
|
|
11
|
+
property: {},
|
|
12
|
+
value: {}
|
|
13
|
+
},
|
|
14
|
+
emits: ["update-property-value"],
|
|
15
|
+
setup(__props, { emit: __emit }) {
|
|
16
|
+
const props = __props;
|
|
17
|
+
const emit = __emit;
|
|
18
|
+
const emptyColor = () => {
|
|
19
|
+
};
|
|
20
|
+
const saveOriginalColor = () => {
|
|
21
|
+
};
|
|
22
|
+
const updateColor = (value) => {
|
|
23
|
+
const properties = {};
|
|
24
|
+
properties[props.property.propertyName] = value;
|
|
25
|
+
emit("update-property-value", properties);
|
|
26
|
+
};
|
|
27
|
+
return (_ctx, _cache) => {
|
|
28
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
29
|
+
createElementVNode("div", _hoisted_2, [
|
|
30
|
+
createElementVNode("label", {
|
|
31
|
+
textContent: toDisplayString(_ctx.property.caption)
|
|
32
|
+
}, null, 8, _hoisted_3)
|
|
33
|
+
]),
|
|
34
|
+
createElementVNode("div", _hoisted_4, [
|
|
35
|
+
createVNode(PbColorPicker, {
|
|
36
|
+
value: _ctx.value,
|
|
37
|
+
"hide-delete": "",
|
|
38
|
+
onEmpty: _cache[0] || (_cache[0] = ($event) => emptyColor()),
|
|
39
|
+
onHide: _cache[1] || (_cache[1] = ($event) => updateColor($event)),
|
|
40
|
+
onShow: saveOriginalColor,
|
|
41
|
+
onChangeColor: _cache[2] || (_cache[2] = ($event) => updateColor($event))
|
|
42
|
+
}, null, 8, ["value"]),
|
|
43
|
+
createVNode(unref(BSTextInput), {
|
|
44
|
+
"model-value": _ctx.value,
|
|
45
|
+
prefix: { type: "font-icon", value: "palette" },
|
|
46
|
+
class: "ml-4",
|
|
47
|
+
width: "",
|
|
48
|
+
"onUpdate:modelValue": updateColor
|
|
49
|
+
}, null, 8, ["model-value"])
|
|
50
|
+
])
|
|
51
|
+
]);
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
export {
|
|
56
|
+
_sfc_main as default
|
|
57
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, defineAsyncComponent } from "vue";
|
|
2
|
+
import { useModal } from "@g1cloud/bluesea";
|
|
3
|
+
import { u as usePageBuilderEditor } from "./index-Cr-_-n9T.js";
|
|
4
|
+
const _hoisted_1 = { class: "property-editor property-editor-image flex-align-center" };
|
|
5
|
+
const _hoisted_2 = { class: "title" };
|
|
6
|
+
const _hoisted_3 = ["textContent"];
|
|
7
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
|
+
__name: "PbPropertyEditorHtml",
|
|
9
|
+
props: {
|
|
10
|
+
property: {},
|
|
11
|
+
value: {}
|
|
12
|
+
},
|
|
13
|
+
emits: ["update-property-value"],
|
|
14
|
+
setup(__props, { emit: __emit }) {
|
|
15
|
+
const props = __props;
|
|
16
|
+
const modal = useModal();
|
|
17
|
+
const pageBuilder = usePageBuilderEditor();
|
|
18
|
+
const emit = __emit;
|
|
19
|
+
const editHtml = () => {
|
|
20
|
+
const locales = pageBuilder.getLocales();
|
|
21
|
+
const localeTabs = locales.map((v) => ({ tabId: `tab-${v}`, caption: v }));
|
|
22
|
+
modal.openModal({
|
|
23
|
+
component: defineAsyncComponent(() => import("./PbHtmlEditorModal-aaecwH7V.js")),
|
|
24
|
+
style: {
|
|
25
|
+
width: "80%",
|
|
26
|
+
height: "80%",
|
|
27
|
+
minWidth: "500px",
|
|
28
|
+
minHeight: "400px"
|
|
29
|
+
},
|
|
30
|
+
bind: {
|
|
31
|
+
html: JSON.parse(JSON.stringify(props.value || {})),
|
|
32
|
+
locales,
|
|
33
|
+
localeTabs
|
|
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
|
+
createElementVNode("label", {
|
|
46
|
+
textContent: toDisplayString(_ctx.property.caption)
|
|
47
|
+
}, null, 8, _hoisted_3)
|
|
48
|
+
]),
|
|
49
|
+
createElementVNode("div", null, [
|
|
50
|
+
createElementVNode("button", { onClick: editHtml }, "Edit HTML")
|
|
51
|
+
])
|
|
52
|
+
]);
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
export {
|
|
57
|
+
_sfc_main as default
|
|
58
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent, openBlock, createElementBlock, createElementVNode, toDisplayString } from "vue";
|
|
2
|
+
import { u as usePageBuilderEditor } from "./index-Cr-_-n9T.js";
|
|
2
3
|
import { useModal } from "@g1cloud/bluesea";
|
|
3
|
-
import { u as usePageBuilderEditor, P as PageBuilderEditorEvent } from "./index-Dwk2ffWe.js";
|
|
4
4
|
const _hoisted_1 = { class: "property-editor property-editor-image flex-align-center" };
|
|
5
|
-
const _hoisted_2 = { class: "
|
|
5
|
+
const _hoisted_2 = { class: "title" };
|
|
6
6
|
const _hoisted_3 = ["textContent"];
|
|
7
7
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
8
|
__name: "PbPropertyEditorImage",
|
|
@@ -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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
const imageProvider = pageBuilder.getProvider("imageProvider");
|
|
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, [
|