geekplus-digital-ui 0.1.33 → 0.1.34
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.d-editor[data-v-7bb70b23]{width:100%}.d-editor.w-e-full-screen-container[data-v-7bb70b23]{z-index:1000}.d-editor .toolbar-container[data-v-7bb70b23]{border-bottom:1px solid var(--el-border-color)}.d-editor .toolbar-container[data-v-7bb70b23] .w-e-toolbar{border-radius:4px}.d-editor .toolbar-container[data-v-7bb70b23] .w-e-drop-panel{z-index:100}.d-editor .editor-container[data-v-7bb70b23]{min-height:var(--minHeight);background:var(--el-fill-color-blank);border-radius:4px}.d-editor .editor-container[data-v-7bb70b23] p[id^=w-e-element-paragraph-]{margin:10px 0}.d-editor .editor-container[data-v-7bb70b23] .w-e-text-placeholder{font-size:14px;font-style:normal;line-height:normal;top:11px}.d-editor .editor-container[data-v-7bb70b23] .w-e-image-container{width:500px}.d-editor .editor-container[data-v-7bb70b23] pre code{text-shadow:none}.d-editor.editor-disabled[data-v-7bb70b23]:not(.editor-border) div[id^=w-e-textarea-]{padding:0}.d-editor.editor-disabled[data-v-7bb70b23]:not(.editor-border) p[id^=w-e-element-paragraph-]:first-child{margin-top:0}.d-editor.editor-disabled[data-v-7bb70b23]:not(.editor-border) p[id^=w-e-element-paragraph-]:last-child{margin-bottom:0}.editor-border[data-v-7bb70b23]{border:1px solid var(--el-border-color);background:var(--el-bg-color);border-radius:4px;transition:border-color .2s cubic-bezier(.645,.045,.355,1)}.editor-border[data-v-7bb70b23]:hover{border-color:var(--el-text-color-disabled)}.editor-disabled .editor-container[data-v-7bb70b23] img{cursor:zoom-in}.el-form-item.is-error .editor-border[data-v-7bb70b23]{border:1px solid var(--el-color-danger)}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useLocale as e } from "../../../hooks/use-locale/index.js";
|
|
2
2
|
import "../../../hooks/index.js";
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
import './editor.
|
|
4
|
+
import './editor.vue_vue_type_style_index_0_scoped_7bb70b23_lang.css';import './editor.css';/* empty css */
|
|
5
5
|
import n from "./code-collapse.js";
|
|
6
6
|
/* empty css */
|
|
7
7
|
import { computed as r, createApp as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createVNode as c, nextTick as l, normalizeClass as u, normalizeStyle as d, onBeforeUnmount as f, openBlock as p, ref as m, unref as h, vShow as g, watch as _, withDirectives as v } from "vue";
|
|
@@ -47,12 +47,20 @@ var w = /* @__PURE__ */ t(/* @__PURE__ */ Object.assign({ name: "DEditor" }, {
|
|
|
47
47
|
},
|
|
48
48
|
emits: ["update:model-value"],
|
|
49
49
|
setup(t, { emit: w }) {
|
|
50
|
-
let T = t, E = w, D = m(null), O = m(null), k = m(""), A = m(""), j = m(null), M = m(0), N = m(!1), P = m([]), F = m(0), I = /* @__PURE__ */ new Map(), { t: L, getLocale: R } = e(), { formItem: z } = b(), B = r(() => R()), V = (e) => {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
let T = t, E = w, D = m(null), O = m(null), k = m(""), A = m(""), j = m(null), M = m(0), N = m(!1), P = m([]), F = m(0), I = /* @__PURE__ */ new Map(), { t: L, getLocale: R } = e(), { formItem: z } = b(), B = r(() => R()), V = (e) => e === "<p><br></p>" ? "" : e || "", H = () => {
|
|
51
|
+
if (T.disabled) {
|
|
52
|
+
l(() => {
|
|
53
|
+
J(), X();
|
|
54
|
+
});
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
J();
|
|
55
58
|
}, U = (e) => {
|
|
59
|
+
O.value = Object.seal(e);
|
|
60
|
+
}, W = (e) => {
|
|
61
|
+
let t = V(e);
|
|
62
|
+
t !== A.value && (j.value = t, A.value = t, E("update:model-value", t), z?.validate("change"), z?.validate("blur"));
|
|
63
|
+
}, G = (e) => {
|
|
56
64
|
if (!T.disabled) return;
|
|
57
65
|
let t = e?.target?.closest?.("img");
|
|
58
66
|
if (!t) return;
|
|
@@ -62,19 +70,19 @@ var w = /* @__PURE__ */ t(/* @__PURE__ */ Object.assign({ name: "DEditor" }, {
|
|
|
62
70
|
if (a.length === 0) return;
|
|
63
71
|
let o = i(t), s = a.findIndex((e) => e === o);
|
|
64
72
|
P.value = a, F.value = s >= 0 ? s : 0, N.value = !0, e?.stopPropagation?.();
|
|
65
|
-
},
|
|
73
|
+
}, K = (e) => {
|
|
66
74
|
if (T.disabled) {
|
|
67
|
-
|
|
75
|
+
G(e);
|
|
68
76
|
return;
|
|
69
77
|
}
|
|
70
78
|
O.value?.focus?.();
|
|
71
|
-
},
|
|
79
|
+
}, q = () => {
|
|
72
80
|
N.value = !1, P.value = [], F.value = 0;
|
|
73
|
-
},
|
|
81
|
+
}, J = () => {
|
|
74
82
|
I.forEach(({ app: e, host: t, pre: n }) => {
|
|
75
83
|
t?.isConnected && n?.isConnected && t.parentNode && t.parentNode.insertBefore(n, t), e.unmount(), t?.remove();
|
|
76
84
|
}), I.clear();
|
|
77
|
-
},
|
|
85
|
+
}, Y = (e) => {
|
|
78
86
|
let t = document.createElement("div");
|
|
79
87
|
e.parentNode?.insertBefore(t, e);
|
|
80
88
|
let r = i(n), a = r.mount(t);
|
|
@@ -83,28 +91,30 @@ var w = /* @__PURE__ */ t(/* @__PURE__ */ Object.assign({ name: "DEditor" }, {
|
|
|
83
91
|
host: t,
|
|
84
92
|
pre: e
|
|
85
93
|
});
|
|
86
|
-
},
|
|
94
|
+
}, X = () => {
|
|
87
95
|
let e = O.value?.getEditableContainer?.()?.querySelectorAll("pre");
|
|
88
96
|
e && e.forEach((e) => {
|
|
89
|
-
e.parentElement?.tagName !== "DETAILS" &&
|
|
97
|
+
e.parentElement?.tagName !== "DETAILS" && Y(e);
|
|
90
98
|
});
|
|
91
|
-
},
|
|
99
|
+
}, Z = r(() => ({ ...T.toolbarConfig })), Q = r(() => ({
|
|
92
100
|
placeholder: T.disabled ? "" : T.placeholder || L("d.editor.placeholder"),
|
|
93
101
|
readOnly: T.disabled,
|
|
94
102
|
autoFocus: !1,
|
|
95
103
|
...T.editorConfig
|
|
96
|
-
})),
|
|
104
|
+
})), $ = r(() => ({ "--minHeight": T.disabled ? "" : `${T.minHeight}px` }));
|
|
97
105
|
return _(B, (e) => {
|
|
98
106
|
x(e === "zh-cn" ? "zh-CN" : "en");
|
|
99
107
|
}, { immediate: !0 }), _(() => T.disabled, () => {
|
|
100
|
-
|
|
101
|
-
}), _(() => T.modelValue, () => {
|
|
102
|
-
let e = j.value ===
|
|
103
|
-
A.value =
|
|
104
|
-
|
|
105
|
-
|
|
108
|
+
J(), M.value++;
|
|
109
|
+
}), _(() => T.modelValue, (e) => {
|
|
110
|
+
let t = V(e), n = A.value, r = j.value === t;
|
|
111
|
+
if (A.value = t, j.value = null, !r && O.value && t !== n) {
|
|
112
|
+
O.value = null, k.value = t, M.value++, H();
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
k.value = t, H();
|
|
106
116
|
}, { immediate: !0 }), f(() => {
|
|
107
|
-
|
|
117
|
+
J(), O.value?.destroy?.();
|
|
108
118
|
}), (e, n) => (p(), s("div", {
|
|
109
119
|
ref_key: "rootRef",
|
|
110
120
|
ref: D,
|
|
@@ -117,7 +127,7 @@ var w = /* @__PURE__ */ t(/* @__PURE__ */ Object.assign({ name: "DEditor" }, {
|
|
|
117
127
|
v(c(h(C), {
|
|
118
128
|
class: "toolbar-container",
|
|
119
129
|
editor: O.value,
|
|
120
|
-
"default-config":
|
|
130
|
+
"default-config": Z.value,
|
|
121
131
|
mode: t.mode
|
|
122
132
|
}, null, 8, [
|
|
123
133
|
"editor",
|
|
@@ -126,13 +136,13 @@ var w = /* @__PURE__ */ t(/* @__PURE__ */ Object.assign({ name: "DEditor" }, {
|
|
|
126
136
|
]), [[g, t.showToolbar && !t.disabled]]),
|
|
127
137
|
c(h(S), {
|
|
128
138
|
class: "editor-container",
|
|
129
|
-
style: d(
|
|
139
|
+
style: d($.value),
|
|
130
140
|
"model-value": k.value,
|
|
131
|
-
"default-config":
|
|
141
|
+
"default-config": Q.value,
|
|
132
142
|
mode: t.mode,
|
|
133
|
-
onOnCreated:
|
|
134
|
-
"onUpdate:modelValue":
|
|
135
|
-
onClick:
|
|
143
|
+
onOnCreated: U,
|
|
144
|
+
"onUpdate:modelValue": W,
|
|
145
|
+
onClick: K
|
|
136
146
|
}, null, 8, [
|
|
137
147
|
"style",
|
|
138
148
|
"model-value",
|
|
@@ -145,10 +155,10 @@ var w = /* @__PURE__ */ t(/* @__PURE__ */ Object.assign({ name: "DEditor" }, {
|
|
|
145
155
|
"initial-index": F.value,
|
|
146
156
|
"hide-on-click-modal": "",
|
|
147
157
|
teleported: "",
|
|
148
|
-
onClose:
|
|
158
|
+
onClose: q
|
|
149
159
|
}, null, 8, ["url-list", "initial-index"])) : o("", !0)
|
|
150
160
|
], 2));
|
|
151
161
|
}
|
|
152
|
-
}), [["__scopeId", "data-v-
|
|
162
|
+
}), [["__scopeId", "data-v-7bb70b23"]]);
|
|
153
163
|
//#endregion
|
|
154
164
|
export { w as default };
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.d-editor[data-v-4d9761f4]{width:100%}.d-editor.w-e-full-screen-container[data-v-4d9761f4]{z-index:1000}.d-editor .toolbar-container[data-v-4d9761f4]{border-bottom:1px solid var(--el-border-color)}.d-editor .toolbar-container[data-v-4d9761f4] .w-e-toolbar{border-radius:4px}.d-editor .toolbar-container[data-v-4d9761f4] .w-e-drop-panel{z-index:100}.d-editor .editor-container[data-v-4d9761f4]{min-height:var(--minHeight);background:var(--el-fill-color-blank);border-radius:4px}.d-editor .editor-container[data-v-4d9761f4] p[id^=w-e-element-paragraph-]{margin:10px 0}.d-editor .editor-container[data-v-4d9761f4] .w-e-text-placeholder{font-size:14px;font-style:normal;line-height:normal;top:11px}.d-editor .editor-container[data-v-4d9761f4] .w-e-image-container{width:500px}.d-editor .editor-container[data-v-4d9761f4] pre code{text-shadow:none}.d-editor.editor-disabled[data-v-4d9761f4]:not(.editor-border) div[id^=w-e-textarea-]{padding:0}.d-editor.editor-disabled[data-v-4d9761f4]:not(.editor-border) p[id^=w-e-element-paragraph-]:first-child{margin-top:0}.d-editor.editor-disabled[data-v-4d9761f4]:not(.editor-border) p[id^=w-e-element-paragraph-]:last-child{margin-bottom:0}.editor-border[data-v-4d9761f4]{border:1px solid var(--el-border-color);background:var(--el-bg-color);border-radius:4px;transition:border-color .2s cubic-bezier(.645,.045,.355,1)}.editor-border[data-v-4d9761f4]:hover{border-color:var(--el-text-color-disabled)}.editor-disabled .editor-container[data-v-4d9761f4] img{cursor:zoom-in}.el-form-item.is-error .editor-border[data-v-4d9761f4]{border:1px solid var(--el-color-danger)}
|