@g1cloud/page-builder-editor 1.0.0-alpha.1 → 1.0.0-alpha.10
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/README.md +31 -6
- package/css/canvas.scss +1 -0
- package/css/page-builder-editor.scss +99 -19
- package/css/property-editor-color.scss +5 -0
- package/css/property-editor-html.scss +16 -0
- package/css/property-group-editor-background.scss +0 -12
- 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/HtmlEditorModal-oXFayeg-.js +100 -0
- package/dist/PageBuilderEditor.vue.d.ts +5 -1
- package/dist/PbPropertyEditorColor-B9I99uQK.js +57 -0
- package/dist/PbPropertyEditorHtml-BVT2SwoK.js +64 -0
- package/dist/{PbPropertyEditorImage-BFIqG-bL.js → PbPropertyEditorImage-DLwg5dJz.js} +2 -2
- package/dist/PbPropertyEditorMultilineText-Bv4luXWg.js +65 -0
- package/dist/{PbPropertyEditorProduct--cf9LI2Z.js → PbPropertyEditorProduct-6STGd-Zs.js} +2 -2
- 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-BWOKvwD9.js} +1 -1
- package/dist/components/modal/HtmlEditorModal.vue.d.ts +23 -0
- package/dist/components/sidebar/property/PbPropertyEditorColor.vue.d.ts +23 -0
- package/dist/components/sidebar/property/PbPropertyEditorHtml.vue.d.ts +23 -0
- package/dist/components/sidebar/property/PbPropertyEditorMultilineText.vue.d.ts +5 -4
- package/dist/components/ui/PbColorPicker.vue.d.ts +2 -2
- package/dist/{index-BtILenNo.js → index-jUNIezk-.js} +874 -439
- package/dist/model/context.d.ts +15 -6
- package/dist/model/event.d.ts +9 -4
- package/dist/model/model.d.ts +6 -4
- package/dist/model/page-builder-editor.d.ts +8 -2
- package/dist/model/page-builder-util.d.ts +2 -2
- package/dist/model/part-definintion.d.ts +1 -0
- package/dist/model/part-manager.d.ts +1 -0
- package/dist/page-builder-editor.js +23 -19
- package/dist/page-builder-editor.umd.cjs +1346 -674
- package/dist/style.css +0 -167
- package/package.json +4 -3
- package/dist/PbPropertyEditorMultilineText-BMeNUGm8.js +0 -42
- /package/dist/components/sidebar/property/{PbPropertyLocalPart.vue.d.ts → PbPropertyLocalMarketingPart.vue.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
# Page Builder
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Viewer
|
|
4
|
+
|
|
5
|
+
Install packages
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
$ cd packages/viewer
|
|
9
|
+
$ pnpm install
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Build
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
$ pnpm build --watch
|
|
16
|
+
```
|
|
4
17
|
|
|
5
|
-
|
|
18
|
+
## Editor
|
|
6
19
|
|
|
7
20
|
Install packages
|
|
8
21
|
|
|
@@ -11,13 +24,25 @@ $ cd packages/editor
|
|
|
11
24
|
$ pnpm install
|
|
12
25
|
```
|
|
13
26
|
|
|
14
|
-
|
|
27
|
+
Build
|
|
15
28
|
|
|
16
|
-
|
|
29
|
+
```bash
|
|
30
|
+
$ pnpm build --watch
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Demo
|
|
34
|
+
|
|
35
|
+
Install packages
|
|
17
36
|
|
|
18
37
|
```bash
|
|
19
|
-
$ cd packages/
|
|
20
|
-
$ pnpm
|
|
38
|
+
$ cd packages/demo
|
|
39
|
+
$ pnpm install
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Run
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
$ pnpm dev
|
|
21
46
|
```
|
|
22
47
|
|
|
23
48
|
Open browser : http://localhost:5173/
|
package/css/canvas.scss
CHANGED
|
@@ -14,13 +14,12 @@
|
|
|
14
14
|
width: 100%;
|
|
15
15
|
|
|
16
16
|
.pb-toolbar {
|
|
17
|
-
|
|
18
|
-
margin: 6px 0;
|
|
19
|
-
|
|
17
|
+
margin: 0 -8px;
|
|
20
18
|
|
|
21
19
|
.pb-tool-button-group {
|
|
22
20
|
&::after {
|
|
23
21
|
content: '';
|
|
22
|
+
margin: 0 8px;
|
|
24
23
|
height: 80%;
|
|
25
24
|
border-right: 1px solid $color-border-light;
|
|
26
25
|
align-self: center;
|
|
@@ -28,6 +27,7 @@
|
|
|
28
27
|
|
|
29
28
|
.pb-tool-button {
|
|
30
29
|
padding: 2px;
|
|
30
|
+
margin: 0 2px;
|
|
31
31
|
|
|
32
32
|
.tool-button {
|
|
33
33
|
width: 28px;
|
|
@@ -41,36 +41,64 @@
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
.editor-wrapper {
|
|
45
|
+
height: 100%;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.pb-editor {
|
|
49
|
+
height: 100%;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.pb-editor-body {
|
|
53
|
+
padding: 8px 0 0;
|
|
54
|
+
gap: 8px;
|
|
55
|
+
height: 1px;
|
|
56
|
+
|
|
57
|
+
.bs-tab-sheet {
|
|
58
|
+
.tab-bar {
|
|
59
|
+
.tabs {
|
|
60
|
+
padding-top: 0;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
44
66
|
.pb-navigator {
|
|
45
67
|
width: 200px;
|
|
46
|
-
height:
|
|
47
|
-
overflow: auto;
|
|
48
|
-
|
|
68
|
+
height: 1px;
|
|
69
|
+
overflow-y: auto;
|
|
70
|
+
padding: 8px 0;
|
|
71
|
+
flex-grow: 1;
|
|
49
72
|
}
|
|
50
73
|
|
|
51
74
|
.pb-sidebar {
|
|
52
75
|
width: 300px;
|
|
53
76
|
overflow: auto;
|
|
54
|
-
border
|
|
77
|
+
border: 1px solid $color-border-light;
|
|
55
78
|
|
|
56
79
|
.pb-sidebar-properties {
|
|
57
|
-
padding:
|
|
80
|
+
padding: 0;
|
|
58
81
|
|
|
59
82
|
.pb-sidebar-property-group {
|
|
83
|
+
&:not(:empty) {
|
|
84
|
+
padding: 16px 16px;
|
|
85
|
+
border-bottom: 1px solid #eaeaea;
|
|
60
86
|
|
|
61
|
-
|
|
87
|
+
}
|
|
62
88
|
|
|
63
89
|
.group-title {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
90
|
+
> label {
|
|
91
|
+
padding: 4px 0;
|
|
92
|
+
font-size: 90%;
|
|
93
|
+
font-weight: 600;
|
|
94
|
+
}
|
|
67
95
|
}
|
|
68
96
|
|
|
69
97
|
.group-editor {
|
|
70
|
-
padding: 4px
|
|
98
|
+
padding: 4px 0;
|
|
71
99
|
font-size: 0.9em;
|
|
72
100
|
|
|
73
|
-
.
|
|
101
|
+
.title {
|
|
74
102
|
padding: 0 0 8px 0;
|
|
75
103
|
|
|
76
104
|
label {
|
|
@@ -80,20 +108,29 @@
|
|
|
80
108
|
font-weight: bold;
|
|
81
109
|
}
|
|
82
110
|
}
|
|
111
|
+
|
|
112
|
+
.sub-title {
|
|
113
|
+
label {
|
|
114
|
+
min-width: 6em;
|
|
115
|
+
max-width: 6em;
|
|
116
|
+
padding-right: 0.5em;
|
|
117
|
+
font-weight: 400;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
83
120
|
}
|
|
84
121
|
|
|
85
122
|
.property-editor {
|
|
86
|
-
padding: 4px
|
|
123
|
+
padding: 4px 0;
|
|
87
124
|
font-size: 0.9em;
|
|
88
125
|
|
|
89
|
-
> .
|
|
126
|
+
> .title {
|
|
90
127
|
padding: 0 0 8px 0;
|
|
91
128
|
|
|
92
|
-
label {
|
|
129
|
+
> label {
|
|
93
130
|
min-width: 6em;
|
|
94
131
|
max-width: 6em;
|
|
95
132
|
padding-right: 0.5em;
|
|
96
|
-
font-weight:
|
|
133
|
+
font-weight: 600;
|
|
97
134
|
}
|
|
98
135
|
}
|
|
99
136
|
}
|
|
@@ -102,12 +139,14 @@
|
|
|
102
139
|
margin-top: 4px
|
|
103
140
|
}
|
|
104
141
|
|
|
142
|
+
@import "./property-editor-color";
|
|
105
143
|
@import "./property-editor-image";
|
|
106
144
|
@import "./property-editor-multiline-text";
|
|
107
145
|
@import "./property-editor-product";
|
|
108
146
|
@import "./property-editor-readonly-text";
|
|
109
147
|
@import "./property-editor-select";
|
|
110
148
|
@import "./property-editor-text";
|
|
149
|
+
@import "./property-editor-html";
|
|
111
150
|
|
|
112
151
|
@import "./property-group-editor-background";
|
|
113
152
|
@import "./property-group-editor-border";
|
|
@@ -182,4 +221,45 @@
|
|
|
182
221
|
padding: 8px 16px;
|
|
183
222
|
}
|
|
184
223
|
}
|
|
185
|
-
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.pb-html-editor-modal {
|
|
227
|
+
.preview {
|
|
228
|
+
width: 50%;
|
|
229
|
+
|
|
230
|
+
.content {
|
|
231
|
+
border: solid 1px #ccc;
|
|
232
|
+
overflow-y: auto;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.editor {
|
|
237
|
+
width: 50%;
|
|
238
|
+
|
|
239
|
+
.tags {
|
|
240
|
+
height: 60%;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.style {
|
|
244
|
+
height: 40%;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.bs-code-editor {
|
|
248
|
+
height: 100%;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.buttons {
|
|
253
|
+
text-align: center;
|
|
254
|
+
|
|
255
|
+
button {
|
|
256
|
+
color: #fff;
|
|
257
|
+
border: none;
|
|
258
|
+
padding: 4px 12px;
|
|
259
|
+
cursor: pointer;
|
|
260
|
+
line-height: 1;
|
|
261
|
+
height: 28px;
|
|
262
|
+
background-color: #1f8fff;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
@@ -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
|
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { defineComponent, ref, computed, openBlock, createBlock, unref, withCtx, createElementVNode, createVNode } from "vue";
|
|
2
|
+
import { useModalHandle, BSModalFrame, BSCodeEditor } from "@g1cloud/bluesea";
|
|
3
|
+
const _hoisted_1 = { class: "bs-layout-vertical pb-html-editor-modal flex-grow-1 h-full" };
|
|
4
|
+
const _hoisted_2 = { class: "bs-layout-horizontal flex-grow-1" };
|
|
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: "HtmlEditorModal",
|
|
18
|
+
props: {
|
|
19
|
+
html: {}
|
|
20
|
+
},
|
|
21
|
+
emits: ["updateHtml"],
|
|
22
|
+
setup(__props, { emit: __emit }) {
|
|
23
|
+
var _a, _b;
|
|
24
|
+
const props = __props;
|
|
25
|
+
const emit = __emit;
|
|
26
|
+
const modalHandle = useModalHandle();
|
|
27
|
+
const tags = ref(((_a = props.html) == null ? void 0 : _a.tags) || "");
|
|
28
|
+
const style = ref(((_b = props.html) == null ? void 0 : _b.style) || "");
|
|
29
|
+
const html = computed(() => `${tags.value || ""}
|
|
30
|
+
<style>${style.value || ""}</style>`);
|
|
31
|
+
const updateHtml = (value) => {
|
|
32
|
+
};
|
|
33
|
+
const ok = () => {
|
|
34
|
+
emit("updateHtml", {
|
|
35
|
+
tags: tags.value || "",
|
|
36
|
+
style: style.value || ""
|
|
37
|
+
});
|
|
38
|
+
modalHandle.close();
|
|
39
|
+
};
|
|
40
|
+
return (_ctx, _cache) => {
|
|
41
|
+
return openBlock(), createBlock(unref(BSModalFrame), { title: "HTML Editor" }, {
|
|
42
|
+
default: withCtx(() => [
|
|
43
|
+
createElementVNode("div", _hoisted_1, [
|
|
44
|
+
createElementVNode("div", _hoisted_2, [
|
|
45
|
+
createElementVNode("div", _hoisted_3, [
|
|
46
|
+
createElementVNode("div", _hoisted_4, [
|
|
47
|
+
_hoisted_5,
|
|
48
|
+
createElementVNode("div", {
|
|
49
|
+
class: "content flex-grow-1",
|
|
50
|
+
innerHTML: html.value
|
|
51
|
+
}, null, 8, _hoisted_6)
|
|
52
|
+
])
|
|
53
|
+
]),
|
|
54
|
+
createElementVNode("div", _hoisted_7, [
|
|
55
|
+
createElementVNode("div", _hoisted_8, [
|
|
56
|
+
_hoisted_9,
|
|
57
|
+
createElementVNode("div", _hoisted_10, [
|
|
58
|
+
createVNode(unref(BSCodeEditor), {
|
|
59
|
+
modelValue: tags.value,
|
|
60
|
+
"onUpdate:modelValue": [
|
|
61
|
+
_cache[0] || (_cache[0] = ($event) => tags.value = $event),
|
|
62
|
+
updateHtml
|
|
63
|
+
],
|
|
64
|
+
"editor-height": "100%",
|
|
65
|
+
lang: "html"
|
|
66
|
+
}, null, 8, ["modelValue"])
|
|
67
|
+
])
|
|
68
|
+
]),
|
|
69
|
+
createElementVNode("div", _hoisted_11, [
|
|
70
|
+
_hoisted_12,
|
|
71
|
+
createElementVNode("div", _hoisted_13, [
|
|
72
|
+
createVNode(unref(BSCodeEditor), {
|
|
73
|
+
modelValue: style.value,
|
|
74
|
+
"onUpdate:modelValue": [
|
|
75
|
+
_cache[1] || (_cache[1] = ($event) => style.value = $event),
|
|
76
|
+
updateHtml
|
|
77
|
+
],
|
|
78
|
+
"editor-height": "100%",
|
|
79
|
+
lang: "css"
|
|
80
|
+
}, null, 8, ["modelValue"])
|
|
81
|
+
])
|
|
82
|
+
])
|
|
83
|
+
])
|
|
84
|
+
]),
|
|
85
|
+
createElementVNode("div", { class: "buttons pt-24" }, [
|
|
86
|
+
createElementVNode("button", {
|
|
87
|
+
class: "mr-4",
|
|
88
|
+
onClick: ok
|
|
89
|
+
}, "OK")
|
|
90
|
+
])
|
|
91
|
+
])
|
|
92
|
+
]),
|
|
93
|
+
_: 1
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
export {
|
|
99
|
+
_sfc_main as default
|
|
100
|
+
};
|
|
@@ -3,11 +3,15 @@ declare const _default: import('vue').DefineComponent<__VLS_TypePropsToRuntimePr
|
|
|
3
3
|
title?: string | undefined;
|
|
4
4
|
editMode?: string | undefined;
|
|
5
5
|
pageContent?: any;
|
|
6
|
-
|
|
6
|
+
language?: string | undefined;
|
|
7
|
+
}>, {
|
|
8
|
+
getLocalDesignPartContent: () => any[] | undefined;
|
|
9
|
+
}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
7
10
|
instanceId?: string | undefined;
|
|
8
11
|
title?: string | undefined;
|
|
9
12
|
editMode?: string | undefined;
|
|
10
13
|
pageContent?: any;
|
|
14
|
+
language?: string | undefined;
|
|
11
15
|
}>>>, {}, {}>;
|
|
12
16
|
export default _default;
|
|
13
17
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
@@ -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-jUNIezk-.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,64 @@
|
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, defineAsyncComponent } from "vue";
|
|
2
|
+
import { useModal } from "@g1cloud/bluesea";
|
|
3
|
+
import { u as usePageBuilderEditor } from "./index-jUNIezk-.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 language = pageBuilder.getLanguage();
|
|
21
|
+
let html;
|
|
22
|
+
if (props.value && typeof props.value === "object") {
|
|
23
|
+
html = props.value[language];
|
|
24
|
+
}
|
|
25
|
+
modal.openModal({
|
|
26
|
+
component: defineAsyncComponent(() => import("./HtmlEditorModal-oXFayeg-.js")),
|
|
27
|
+
style: {
|
|
28
|
+
width: "80%",
|
|
29
|
+
height: "80%",
|
|
30
|
+
minWidth: "500px",
|
|
31
|
+
minHeight: "400px"
|
|
32
|
+
},
|
|
33
|
+
bind: {
|
|
34
|
+
html
|
|
35
|
+
},
|
|
36
|
+
on: {
|
|
37
|
+
updateHtml: (html2) => {
|
|
38
|
+
const language2 = pageBuilder.getLanguage();
|
|
39
|
+
const value = {
|
|
40
|
+
...props.value || {},
|
|
41
|
+
[language2]: html2
|
|
42
|
+
};
|
|
43
|
+
emit("update-property-value", { html: value });
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
return (_ctx, _cache) => {
|
|
49
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
50
|
+
createElementVNode("div", _hoisted_2, [
|
|
51
|
+
createElementVNode("label", {
|
|
52
|
+
textContent: toDisplayString(_ctx.property.caption)
|
|
53
|
+
}, null, 8, _hoisted_3)
|
|
54
|
+
]),
|
|
55
|
+
createElementVNode("div", null, [
|
|
56
|
+
createElementVNode("button", { onClick: editHtml }, "Edit HTML")
|
|
57
|
+
])
|
|
58
|
+
]);
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
export {
|
|
63
|
+
_sfc_main as default
|
|
64
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent, openBlock, createElementBlock, createElementVNode, toDisplayString } from "vue";
|
|
2
2
|
import { useModal } from "@g1cloud/bluesea";
|
|
3
|
-
import { u as usePageBuilderEditor,
|
|
3
|
+
import { u as usePageBuilderEditor, a as PageBuilderEditorEvent } from "./index-jUNIezk-.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",
|