@g1cloud/page-builder-editor 1.0.0-alpha.10 → 1.0.0-alpha.12
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/page-builder-editor.scss +13 -0
- package/dist/HtmlEditorModal-CRzp6l55.js +131 -0
- package/dist/PageBuilderEditor.vue.d.ts +4 -2
- package/dist/{PbPropertyEditorColor-B9I99uQK.js → PbPropertyEditorColor-DXkzD-V2.js} +1 -1
- package/dist/{PbPropertyEditorHtml-BVT2SwoK.js → PbPropertyEditorHtml-CbEOlq-s.js} +9 -15
- package/dist/{PbPropertyEditorImage-DLwg5dJz.js → PbPropertyEditorImage-5RZoQbLF.js} +1 -1
- package/dist/{PbPropertyEditorMultilineText-Bv4luXWg.js → PbPropertyEditorMultilineText-BMF9jHpy.js} +25 -23
- package/dist/{PbPropertyEditorProduct-6STGd-Zs.js → PbPropertyEditorProduct-Dt5vraZc.js} +1 -1
- package/dist/components/modal/HtmlEditorModal.vue.d.ts +10 -8
- package/dist/components/sidebar/property/PbPropertyEditorMultilineText.vue.d.ts +3 -2
- package/dist/{index-jUNIezk-.js → index-BFtI1jYj.js} +161 -126
- package/dist/model/context.d.ts +4 -4
- package/dist/model/page-builder-editor.d.ts +9 -3
- package/dist/model/part-property.d.ts +1 -0
- package/dist/page-builder-editor.js +1 -1
- package/dist/page-builder-editor.umd.cjs +276 -214
- package/package.json +2 -2
- package/dist/HtmlEditorModal-oXFayeg-.js +0 -100
|
@@ -69,8 +69,13 @@
|
|
|
69
69
|
overflow-y: auto;
|
|
70
70
|
padding: 8px 0;
|
|
71
71
|
flex-grow: 1;
|
|
72
|
+
|
|
73
|
+
&:focus {
|
|
74
|
+
outline: none;
|
|
75
|
+
}
|
|
72
76
|
}
|
|
73
77
|
|
|
78
|
+
|
|
74
79
|
.pb-sidebar {
|
|
75
80
|
width: 300px;
|
|
76
81
|
overflow: auto;
|
|
@@ -238,10 +243,18 @@
|
|
|
238
243
|
|
|
239
244
|
.tags {
|
|
240
245
|
height: 60%;
|
|
246
|
+
|
|
247
|
+
.content {
|
|
248
|
+
overflow-y: auto;
|
|
249
|
+
}
|
|
241
250
|
}
|
|
242
251
|
|
|
243
252
|
.style {
|
|
244
253
|
height: 40%;
|
|
254
|
+
|
|
255
|
+
.content {
|
|
256
|
+
overflow-y: auto;
|
|
257
|
+
}
|
|
245
258
|
}
|
|
246
259
|
|
|
247
260
|
.bs-code-editor {
|
|
@@ -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: "HtmlEditorModal",
|
|
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
|
+
};
|
|
@@ -3,7 +3,8 @@ declare const _default: import('vue').DefineComponent<__VLS_TypePropsToRuntimePr
|
|
|
3
3
|
title?: string | undefined;
|
|
4
4
|
editMode?: string | undefined;
|
|
5
5
|
pageContent?: any;
|
|
6
|
-
|
|
6
|
+
locales?: string[] | undefined;
|
|
7
|
+
locale?: string | undefined;
|
|
7
8
|
}>, {
|
|
8
9
|
getLocalDesignPartContent: () => any[] | undefined;
|
|
9
10
|
}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
@@ -11,7 +12,8 @@ declare const _default: import('vue').DefineComponent<__VLS_TypePropsToRuntimePr
|
|
|
11
12
|
title?: string | undefined;
|
|
12
13
|
editMode?: string | undefined;
|
|
13
14
|
pageContent?: any;
|
|
14
|
-
|
|
15
|
+
locales?: string[] | undefined;
|
|
16
|
+
locale?: string | undefined;
|
|
15
17
|
}>>>, {}, {}>;
|
|
16
18
|
export default _default;
|
|
17
19
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
@@ -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-
|
|
3
|
+
import { P as PbColorPicker } from "./index-BFtI1jYj.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-
|
|
3
|
+
import { u as usePageBuilderEditor } from "./index-BFtI1jYj.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"];
|
|
@@ -17,13 +17,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
17
17
|
const pageBuilder = usePageBuilderEditor();
|
|
18
18
|
const emit = __emit;
|
|
19
19
|
const editHtml = () => {
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
if (props.value && typeof props.value === "object") {
|
|
23
|
-
html = props.value[language];
|
|
24
|
-
}
|
|
20
|
+
const locales = pageBuilder.getLocales();
|
|
21
|
+
const localeTabs = locales.map((v) => ({ tabId: `tab-${v}`, caption: v }));
|
|
25
22
|
modal.openModal({
|
|
26
|
-
component: defineAsyncComponent(() => import("./HtmlEditorModal-
|
|
23
|
+
component: defineAsyncComponent(() => import("./HtmlEditorModal-CRzp6l55.js")),
|
|
27
24
|
style: {
|
|
28
25
|
width: "80%",
|
|
29
26
|
height: "80%",
|
|
@@ -31,16 +28,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
31
28
|
minHeight: "400px"
|
|
32
29
|
},
|
|
33
30
|
bind: {
|
|
34
|
-
html
|
|
31
|
+
html: JSON.parse(JSON.stringify(props.value || {})),
|
|
32
|
+
locales,
|
|
33
|
+
localeTabs
|
|
35
34
|
},
|
|
36
35
|
on: {
|
|
37
|
-
updateHtml: (
|
|
38
|
-
|
|
39
|
-
const value = {
|
|
40
|
-
...props.value || {},
|
|
41
|
-
[language2]: html2
|
|
42
|
-
};
|
|
43
|
-
emit("update-property-value", { html: value });
|
|
36
|
+
updateHtml: (html) => {
|
|
37
|
+
emit("update-property-value", { html });
|
|
44
38
|
}
|
|
45
39
|
}
|
|
46
40
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, openBlock, createElementBlock, createElementVNode, toDisplayString } from "vue";
|
|
2
2
|
import { useModal } from "@g1cloud/bluesea";
|
|
3
|
-
import { u as usePageBuilderEditor, a as PageBuilderEditorEvent } from "./index-
|
|
3
|
+
import { u as usePageBuilderEditor, a as PageBuilderEditorEvent } from "./index-BFtI1jYj.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"];
|
package/dist/{PbPropertyEditorMultilineText-Bv4luXWg.js → PbPropertyEditorMultilineText-BMF9jHpy.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent, computed, openBlock, createElementBlock, createElementVNode, toDisplayString,
|
|
2
|
-
import { BSTextArea } from "@g1cloud/bluesea";
|
|
3
|
-
import { u as usePageBuilderEditor } from "./index-
|
|
1
|
+
import { defineComponent, computed, openBlock, createElementBlock, createElementVNode, toDisplayString, createBlock, unref } from "vue";
|
|
2
|
+
import { BSMultiLangTextArea, BSTextArea } from "@g1cloud/bluesea";
|
|
3
|
+
import { u as usePageBuilderEditor } from "./index-BFtI1jYj.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"];
|
|
@@ -14,29 +14,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
14
14
|
setup(__props, { emit: __emit }) {
|
|
15
15
|
const props = __props;
|
|
16
16
|
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
17
|
const pageBuilder = usePageBuilderEditor();
|
|
32
|
-
const
|
|
18
|
+
const locales = computed(() => pageBuilder.getLocales());
|
|
33
19
|
const text = computed({
|
|
34
20
|
get() {
|
|
35
|
-
return props.value
|
|
21
|
+
return props.value;
|
|
36
22
|
},
|
|
37
|
-
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
set(value) {
|
|
38
25
|
}
|
|
39
26
|
});
|
|
27
|
+
const emitUpdatePropertyValue = (value) => {
|
|
28
|
+
const properties = {};
|
|
29
|
+
properties[props.property.propertyName] = value;
|
|
30
|
+
emit("update-property-value", properties);
|
|
31
|
+
};
|
|
40
32
|
return (_ctx, _cache) => {
|
|
41
33
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
42
34
|
createElementVNode("div", _hoisted_2, [
|
|
@@ -45,16 +37,26 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
45
37
|
}, null, 8, _hoisted_3)
|
|
46
38
|
]),
|
|
47
39
|
createElementVNode("div", null, [
|
|
48
|
-
|
|
40
|
+
_ctx.property.multiLang ? (openBlock(), createBlock(unref(BSMultiLangTextArea), {
|
|
41
|
+
key: 0,
|
|
49
42
|
modelValue: text.value,
|
|
50
43
|
"onUpdate:modelValue": [
|
|
51
44
|
_cache[0] || (_cache[0] = ($event) => text.value = $event),
|
|
52
45
|
emitUpdatePropertyValue
|
|
53
46
|
],
|
|
54
|
-
|
|
47
|
+
locales: locales.value,
|
|
48
|
+
height: "60px",
|
|
49
|
+
width: "100%"
|
|
50
|
+
}, null, 8, ["modelValue", "locales"])) : (openBlock(), createBlock(unref(BSTextArea), {
|
|
51
|
+
key: 1,
|
|
52
|
+
modelValue: text.value,
|
|
53
|
+
"onUpdate:modelValue": [
|
|
54
|
+
_cache[1] || (_cache[1] = ($event) => text.value = $event),
|
|
55
|
+
emitUpdatePropertyValue
|
|
56
|
+
],
|
|
55
57
|
height: "60px",
|
|
56
58
|
width: "100%"
|
|
57
|
-
}, null, 8, ["modelValue"
|
|
59
|
+
}, null, 8, ["modelValue"]))
|
|
58
60
|
])
|
|
59
61
|
]);
|
|
60
62
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, openBlock, createElementBlock, createElementVNode, toDisplayString } from "vue";
|
|
2
2
|
import { useModal } from "@g1cloud/bluesea";
|
|
3
|
-
import { u as usePageBuilderEditor, a as PageBuilderEditorEvent } from "./index-
|
|
3
|
+
import { u as usePageBuilderEditor, a as PageBuilderEditorEvent } from "./index-BFtI1jYj.js";
|
|
4
4
|
const _hoisted_1 = { class: "property-editor property-editor-product flex-align-center" };
|
|
5
5
|
const _hoisted_2 = { class: "title" };
|
|
6
6
|
const _hoisted_3 = ["textContent"];
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
style: string;
|
|
4
|
-
};
|
|
1
|
+
import { TabEntry } from '@g1cloud/bluesea';
|
|
2
|
+
|
|
5
3
|
declare const _default: import('vue').DefineComponent<__VLS_TypePropsToRuntimeProps<{
|
|
6
|
-
html?:
|
|
4
|
+
html?: Record<string, unknown> | undefined;
|
|
5
|
+
locales?: string[] | undefined;
|
|
6
|
+
localeTabs?: TabEntry[] | undefined;
|
|
7
7
|
}>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
8
|
-
updateHtml: (html:
|
|
8
|
+
updateHtml: (html: Record<string, unknown>) => void;
|
|
9
9
|
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
10
|
-
html?:
|
|
10
|
+
html?: Record<string, unknown> | undefined;
|
|
11
|
+
locales?: string[] | undefined;
|
|
12
|
+
localeTabs?: TabEntry[] | undefined;
|
|
11
13
|
}>>> & {
|
|
12
|
-
onUpdateHtml?: ((html:
|
|
14
|
+
onUpdateHtml?: ((html: Record<string, unknown>) => any) | undefined;
|
|
13
15
|
}, {}, {}>;
|
|
14
16
|
export default _default;
|
|
15
17
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { MultiLangText } from '@g1cloud/page-builder-viewer';
|
|
2
2
|
import { PartProperty } from '../../../model/part-property.ts';
|
|
3
|
+
import { MultiLangString } from '@g1cloud/bluesea';
|
|
3
4
|
|
|
4
5
|
declare const _default: import('vue').DefineComponent<__VLS_TypePropsToRuntimeProps<{
|
|
5
6
|
property: PartProperty;
|
|
6
|
-
value?:
|
|
7
|
+
value?: MultiLangString | undefined;
|
|
7
8
|
}>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
8
9
|
"update-property-value": (properties: Record<string, MultiLangText>) => void;
|
|
9
10
|
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
10
11
|
property: PartProperty;
|
|
11
|
-
value?:
|
|
12
|
+
value?: MultiLangString | undefined;
|
|
12
13
|
}>>> & {
|
|
13
14
|
"onUpdate-property-value"?: ((properties: Record<string, MultiLangText>) => any) | undefined;
|
|
14
15
|
}, {}, {}>;
|