@g1cloud/page-builder-editor 1.0.0-alpha.1 → 1.0.0-alpha.11
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 +109 -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-B2wOdZTD.js +98 -0
- package/dist/PageBuilderEditor.vue.d.ts +5 -1
- package/dist/PbPropertyEditorColor-D3brNT4U.js +57 -0
- package/dist/PbPropertyEditorHtml-D--QgdEp.js +64 -0
- package/dist/{PbPropertyEditorImage-BFIqG-bL.js → PbPropertyEditorImage-BB25lcTu.js} +2 -2
- package/dist/PbPropertyEditorMultilineText-BN2Q1P1o.js +65 -0
- package/dist/{PbPropertyEditorProduct--cf9LI2Z.js → PbPropertyEditorProduct-CBk2DLhW.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-DdC6jCrv.js} +987 -535
- package/dist/model/context.d.ts +19 -10
- 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 +1368 -681
- 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,69 @@
|
|
|
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;
|
|
72
|
+
|
|
73
|
+
&:focus {
|
|
74
|
+
outline: none;
|
|
75
|
+
}
|
|
49
76
|
}
|
|
50
77
|
|
|
78
|
+
|
|
51
79
|
.pb-sidebar {
|
|
52
80
|
width: 300px;
|
|
53
81
|
overflow: auto;
|
|
54
|
-
border
|
|
82
|
+
border: 1px solid $color-border-light;
|
|
55
83
|
|
|
56
84
|
.pb-sidebar-properties {
|
|
57
|
-
padding:
|
|
85
|
+
padding: 0;
|
|
58
86
|
|
|
59
87
|
.pb-sidebar-property-group {
|
|
88
|
+
&:not(:empty) {
|
|
89
|
+
padding: 16px 16px;
|
|
90
|
+
border-bottom: 1px solid #eaeaea;
|
|
60
91
|
|
|
61
|
-
|
|
92
|
+
}
|
|
62
93
|
|
|
63
94
|
.group-title {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
95
|
+
> label {
|
|
96
|
+
padding: 4px 0;
|
|
97
|
+
font-size: 90%;
|
|
98
|
+
font-weight: 600;
|
|
99
|
+
}
|
|
67
100
|
}
|
|
68
101
|
|
|
69
102
|
.group-editor {
|
|
70
|
-
padding: 4px
|
|
103
|
+
padding: 4px 0;
|
|
71
104
|
font-size: 0.9em;
|
|
72
105
|
|
|
73
|
-
.
|
|
106
|
+
.title {
|
|
74
107
|
padding: 0 0 8px 0;
|
|
75
108
|
|
|
76
109
|
label {
|
|
@@ -80,20 +113,29 @@
|
|
|
80
113
|
font-weight: bold;
|
|
81
114
|
}
|
|
82
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
|
+
}
|
|
83
125
|
}
|
|
84
126
|
|
|
85
127
|
.property-editor {
|
|
86
|
-
padding: 4px
|
|
128
|
+
padding: 4px 0;
|
|
87
129
|
font-size: 0.9em;
|
|
88
130
|
|
|
89
|
-
> .
|
|
131
|
+
> .title {
|
|
90
132
|
padding: 0 0 8px 0;
|
|
91
133
|
|
|
92
|
-
label {
|
|
134
|
+
> label {
|
|
93
135
|
min-width: 6em;
|
|
94
136
|
max-width: 6em;
|
|
95
137
|
padding-right: 0.5em;
|
|
96
|
-
font-weight:
|
|
138
|
+
font-weight: 600;
|
|
97
139
|
}
|
|
98
140
|
}
|
|
99
141
|
}
|
|
@@ -102,12 +144,14 @@
|
|
|
102
144
|
margin-top: 4px
|
|
103
145
|
}
|
|
104
146
|
|
|
147
|
+
@import "./property-editor-color";
|
|
105
148
|
@import "./property-editor-image";
|
|
106
149
|
@import "./property-editor-multiline-text";
|
|
107
150
|
@import "./property-editor-product";
|
|
108
151
|
@import "./property-editor-readonly-text";
|
|
109
152
|
@import "./property-editor-select";
|
|
110
153
|
@import "./property-editor-text";
|
|
154
|
+
@import "./property-editor-html";
|
|
111
155
|
|
|
112
156
|
@import "./property-group-editor-background";
|
|
113
157
|
@import "./property-group-editor-border";
|
|
@@ -182,4 +226,50 @@
|
|
|
182
226
|
padding: 8px 16px;
|
|
183
227
|
}
|
|
184
228
|
}
|
|
185
|
-
}
|
|
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
|
+
|
|
248
|
+
.style {
|
|
249
|
+
height: 40%;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.bs-code-editor {
|
|
253
|
+
height: 100%;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
textarea {
|
|
257
|
+
width: 100%;
|
|
258
|
+
height: 100%;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.buttons {
|
|
263
|
+
text-align: center;
|
|
264
|
+
|
|
265
|
+
button {
|
|
266
|
+
color: #fff;
|
|
267
|
+
border: none;
|
|
268
|
+
padding: 4px 12px;
|
|
269
|
+
cursor: pointer;
|
|
270
|
+
line-height: 1;
|
|
271
|
+
height: 28px;
|
|
272
|
+
background-color: #1f8fff;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
@@ -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,98 @@
|
|
|
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 updateTags = (value) => {
|
|
32
|
+
tags.value = value;
|
|
33
|
+
};
|
|
34
|
+
const updateStyle = (value) => {
|
|
35
|
+
style.value = value;
|
|
36
|
+
};
|
|
37
|
+
const ok = () => {
|
|
38
|
+
emit("updateHtml", {
|
|
39
|
+
tags: tags.value || "",
|
|
40
|
+
style: style.value || ""
|
|
41
|
+
});
|
|
42
|
+
modalHandle.close();
|
|
43
|
+
};
|
|
44
|
+
return (_ctx, _cache) => {
|
|
45
|
+
return openBlock(), createBlock(unref(BSModalFrame), { title: "HTML Editor" }, {
|
|
46
|
+
default: withCtx(() => [
|
|
47
|
+
createElementVNode("div", _hoisted_1, [
|
|
48
|
+
createElementVNode("div", _hoisted_2, [
|
|
49
|
+
createElementVNode("div", _hoisted_3, [
|
|
50
|
+
createElementVNode("div", _hoisted_4, [
|
|
51
|
+
_hoisted_5,
|
|
52
|
+
createElementVNode("div", {
|
|
53
|
+
class: "content flex-grow-1",
|
|
54
|
+
innerHTML: html.value
|
|
55
|
+
}, null, 8, _hoisted_6)
|
|
56
|
+
])
|
|
57
|
+
]),
|
|
58
|
+
createElementVNode("div", _hoisted_7, [
|
|
59
|
+
createElementVNode("div", _hoisted_8, [
|
|
60
|
+
_hoisted_9,
|
|
61
|
+
createElementVNode("div", _hoisted_10, [
|
|
62
|
+
createVNode(unref(BSCodeEditor), {
|
|
63
|
+
"model-value": tags.value,
|
|
64
|
+
"editor-height": "100%",
|
|
65
|
+
lang: "html",
|
|
66
|
+
"onUpdate:modelValue": updateTags
|
|
67
|
+
}, null, 8, ["model-value"])
|
|
68
|
+
])
|
|
69
|
+
]),
|
|
70
|
+
createElementVNode("div", _hoisted_11, [
|
|
71
|
+
_hoisted_12,
|
|
72
|
+
createElementVNode("div", _hoisted_13, [
|
|
73
|
+
createVNode(unref(BSCodeEditor), {
|
|
74
|
+
"model-value": style.value,
|
|
75
|
+
"editor-height": "100%",
|
|
76
|
+
lang: "css",
|
|
77
|
+
"onUpdate:modelValue": updateStyle
|
|
78
|
+
}, null, 8, ["model-value"])
|
|
79
|
+
])
|
|
80
|
+
])
|
|
81
|
+
])
|
|
82
|
+
]),
|
|
83
|
+
createElementVNode("div", { class: "buttons pt-24" }, [
|
|
84
|
+
createElementVNode("button", {
|
|
85
|
+
class: "mr-4",
|
|
86
|
+
onClick: ok
|
|
87
|
+
}, "OK")
|
|
88
|
+
])
|
|
89
|
+
])
|
|
90
|
+
]),
|
|
91
|
+
_: 1
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
export {
|
|
97
|
+
_sfc_main as default
|
|
98
|
+
};
|
|
@@ -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-DdC6jCrv.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-DdC6jCrv.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-B2wOdZTD.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-DdC6jCrv.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",
|