geekplus-digital-ui 0.1.37 → 0.1.38
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-e54f6c52]{width:100%}.d-editor.w-e-full-screen-container[data-v-e54f6c52]{z-index:1000}.d-editor .toolbar-container[data-v-e54f6c52]{border-bottom:1px solid var(--el-border-color)}.d-editor .toolbar-container[data-v-e54f6c52] .w-e-toolbar{border-radius:4px}.d-editor .toolbar-container[data-v-e54f6c52] .w-e-drop-panel{z-index:100}.d-editor .editor-container[data-v-e54f6c52]{min-height:var(--minHeight);background:var(--el-fill-color-blank);border-radius:4px}.d-editor .editor-container[data-v-e54f6c52] p[id^=w-e-element-paragraph-]{margin:10px 0}.d-editor .editor-container[data-v-e54f6c52] .w-e-text-placeholder{font-size:14px;font-style:normal;line-height:normal;top:11px}.d-editor .editor-container[data-v-e54f6c52] .w-e-image-container{width:500px}.d-editor .editor-container[data-v-e54f6c52] pre code{text-shadow:none}.d-editor.editor-disabled[data-v-e54f6c52]:not(.editor-border) div[id^=w-e-textarea-]{padding:0}.d-editor.editor-disabled[data-v-e54f6c52]:not(.editor-border) p[id^=w-e-element-paragraph-]:first-child{margin-top:0}.d-editor.editor-disabled[data-v-e54f6c52]:not(.editor-border) p[id^=w-e-element-paragraph-]:last-child{margin-bottom:0}.editor-border[data-v-e54f6c52]{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-e54f6c52]:hover{border-color:var(--el-text-color-disabled)}.editor-disabled .editor-container[data-v-e54f6c52] img{cursor:zoom-in}.el-form-item.is-error .editor-border[data-v-e54f6c52]{border:1px solid var(--el-color-danger)}
|
|
@@ -1,12 +1,12 @@
|
|
|
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_e54f6c52_lang.css';import './editor.css';/* empty css */
|
|
5
5
|
import n from "./code-collapse.js";
|
|
6
6
|
/* empty css */
|
|
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
|
|
8
|
-
import { ElImageViewer as
|
|
9
|
-
import { i18nChangeLanguage as
|
|
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 ee } from "vue";
|
|
8
|
+
import { ElImageViewer as v, useFormItem as y } from "element-plus";
|
|
9
|
+
import { i18nChangeLanguage as b } from "@wangeditor-next/editor";
|
|
10
10
|
import { Editor as x, Toolbar as S } from "@wangeditor-next/editor-for-vue";
|
|
11
11
|
//#region packages/components/editor/src/editor.vue
|
|
12
12
|
var C = "<p><br></p>", w = /* @__PURE__ */ t(/* @__PURE__ */ Object.assign({ name: "DEditor" }, {
|
|
@@ -48,7 +48,7 @@ var C = "<p><br></p>", w = /* @__PURE__ */ t(/* @__PURE__ */ Object.assign({ nam
|
|
|
48
48
|
},
|
|
49
49
|
emits: ["update:model-value"],
|
|
50
50
|
setup(t, { expose: w, emit: T }) {
|
|
51
|
-
let E = t, D = T, O = m(null), k = m(""), A = m(""), j = m(null), M = m(!1),
|
|
51
|
+
let E = t, D = T, 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 } = y(), B = r(() => R()), V = /[\s\u00A0\u200B-\u200D\uFEFF]/g, H = [
|
|
52
52
|
"img",
|
|
53
53
|
"video",
|
|
54
54
|
"audio",
|
|
@@ -60,89 +60,96 @@ var C = "<p><br></p>", w = /* @__PURE__ */ t(/* @__PURE__ */ Object.assign({ nam
|
|
|
60
60
|
"table",
|
|
61
61
|
"pre",
|
|
62
62
|
"hr"
|
|
63
|
-
],
|
|
63
|
+
], U = H.join(","), W = RegExp(`<(${H.join("|")})(\\s|>|/)`, "i"), G = (e) => e?.currentSrc || e?.src || e?.getAttribute?.("data-src") || "", K = (e) => {
|
|
64
64
|
if (!e) return !1;
|
|
65
|
-
if (typeof document > "u") return
|
|
65
|
+
if (typeof document > "u") return W.test(e) ? !0 : e.replace(/<[^>]+>/g, "").replace(V, "").length > 0;
|
|
66
66
|
let t = document.createElement("div");
|
|
67
|
-
return t.innerHTML = e, t.querySelector(
|
|
68
|
-
},
|
|
67
|
+
return t.innerHTML = e, t.querySelector(U) ? !0 : t.textContent?.replace(V, "").length > 0;
|
|
68
|
+
}, q = (e) => K(e) ? e : "", J = (e, t = q(e)) => t === "" ? C : e || C, Y = () => {
|
|
69
69
|
if (E.disabled) {
|
|
70
70
|
l(() => {
|
|
71
|
-
$(),
|
|
71
|
+
$(), ae();
|
|
72
72
|
});
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
75
|
$();
|
|
76
|
-
},
|
|
76
|
+
}, X = () => {
|
|
77
77
|
let e = O.value;
|
|
78
78
|
if (e) {
|
|
79
79
|
if (E.disabled) {
|
|
80
|
-
e.disable?.(),
|
|
80
|
+
e.disable?.(), Y();
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
83
83
|
e.enable?.(), $();
|
|
84
84
|
}
|
|
85
|
-
}, X = (e) => {
|
|
86
|
-
O.value = Object.seal(e), E.disabled && Y();
|
|
87
85
|
}, Z = (e) => {
|
|
88
|
-
|
|
89
|
-
t !== A.value && (j.value = t, A.value = t, D("update:model-value", t), R?.validate("change"), R?.validate("blur"));
|
|
86
|
+
O.value = Object.seal(e), E.disabled && X();
|
|
90
87
|
}, Q = (e) => {
|
|
88
|
+
let t = q(e);
|
|
89
|
+
t !== A.value && (j.value = t, A.value = t, D("update:model-value", t), z?.validate("change"), z?.validate("blur"));
|
|
90
|
+
}, te = (e) => {
|
|
91
91
|
if (!E.disabled) return;
|
|
92
92
|
let t = e?.target?.closest?.("img");
|
|
93
93
|
if (!t) return;
|
|
94
94
|
let n = O.value?.getEditableContainer?.(), r = Array.from(n?.querySelectorAll?.("img") || []);
|
|
95
95
|
if (r.length === 0) return;
|
|
96
|
-
let i = r.map(
|
|
96
|
+
let i = r.map(G).filter(Boolean);
|
|
97
97
|
if (i.length === 0) return;
|
|
98
|
-
let a =
|
|
99
|
-
|
|
100
|
-
},
|
|
98
|
+
let a = G(t), o = i.findIndex((e) => e === a);
|
|
99
|
+
P.value = i, F.value = o >= 0 ? o : 0, N.value = !0, e?.stopPropagation?.();
|
|
100
|
+
}, ne = (e) => {
|
|
101
101
|
if (E.disabled) {
|
|
102
|
-
|
|
102
|
+
te(e);
|
|
103
103
|
return;
|
|
104
104
|
}
|
|
105
105
|
O.value?.focus?.();
|
|
106
|
-
},
|
|
107
|
-
|
|
106
|
+
}, re = () => {
|
|
107
|
+
N.value = !1, P.value = [], F.value = 0;
|
|
108
108
|
}, $ = () => {
|
|
109
|
-
|
|
109
|
+
I.forEach(({ app: e, host: t, pre: n }) => {
|
|
110
110
|
t?.isConnected && n?.isConnected && t.parentNode && t.parentNode.insertBefore(n, t), e.unmount(), t?.remove();
|
|
111
|
-
}),
|
|
112
|
-
},
|
|
111
|
+
}), I.clear();
|
|
112
|
+
}, ie = (e) => {
|
|
113
113
|
let t = document.createElement("div");
|
|
114
114
|
e.parentNode?.insertBefore(t, e);
|
|
115
115
|
let r = i(n), a = r.mount(t);
|
|
116
|
-
(a.contentRef?.value || a.contentRef)?.appendChild(e),
|
|
116
|
+
(a.contentRef?.value || a.contentRef)?.appendChild(e), I.set(e, {
|
|
117
117
|
app: r,
|
|
118
118
|
host: t,
|
|
119
119
|
pre: e
|
|
120
120
|
});
|
|
121
|
-
},
|
|
121
|
+
}, ae = () => {
|
|
122
122
|
let e = O.value?.getEditableContainer?.()?.querySelectorAll("pre");
|
|
123
123
|
e && e.forEach((e) => {
|
|
124
|
-
e.parentElement?.tagName !== "DETAILS" &&
|
|
124
|
+
e.parentElement?.tagName !== "DETAILS" && ie(e);
|
|
125
125
|
});
|
|
126
|
-
},
|
|
127
|
-
placeholder: E.disabled ? "" : E.placeholder ||
|
|
126
|
+
}, oe = r(() => ({
|
|
127
|
+
placeholder: E.disabled ? "" : E.placeholder || L("d.editor.placeholder"),
|
|
128
128
|
readOnly: E.disabled,
|
|
129
129
|
autoFocus: !1,
|
|
130
130
|
...E.editorConfig
|
|
131
|
-
})),
|
|
132
|
-
return _(
|
|
133
|
-
|
|
131
|
+
})), se = r(() => ({ "--minHeight": E.disabled ? "" : `${E.minHeight}px` }));
|
|
132
|
+
return _(B, (e) => {
|
|
133
|
+
b(e === "zh-cn" ? "zh-CN" : "en");
|
|
134
134
|
}, { immediate: !0 }), _(() => E.disabled, () => {
|
|
135
|
-
|
|
135
|
+
X();
|
|
136
136
|
}), _(() => E.modelValue, (e) => {
|
|
137
|
-
let t =
|
|
138
|
-
A.value = t, j.value = null, !
|
|
137
|
+
let t = q(e), n = J(e, t), r = A.value, i = j.value === t;
|
|
138
|
+
if (A.value = t, j.value = null, !i && O.value && t !== r) {
|
|
139
|
+
O.value = null, k.value = n, M.value++, Y();
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
i && n !== e || (k.value = n, i || Y());
|
|
139
143
|
}, { immediate: !0 }), f(() => {
|
|
140
144
|
$(), O.value?.destroy?.();
|
|
141
|
-
}), w({ editorRef: O }), (e, n) => (p(), s("div", {
|
|
142
|
-
|
|
143
|
-
"editor
|
|
144
|
-
|
|
145
|
-
|
|
145
|
+
}), w({ editorRef: O }), (e, n) => (p(), s("div", {
|
|
146
|
+
key: M.value,
|
|
147
|
+
class: u(["d-editor", {
|
|
148
|
+
"editor-border": t.border,
|
|
149
|
+
"editor-disabled": t.disabled
|
|
150
|
+
}])
|
|
151
|
+
}, [
|
|
152
|
+
ee(c(h(S), {
|
|
146
153
|
class: "toolbar-container",
|
|
147
154
|
editor: O.value,
|
|
148
155
|
"default-config": t.toolbarConfig,
|
|
@@ -154,29 +161,29 @@ var C = "<p><br></p>", w = /* @__PURE__ */ t(/* @__PURE__ */ Object.assign({ nam
|
|
|
154
161
|
]), [[g, t.showToolbar && !t.disabled]]),
|
|
155
162
|
c(h(x), {
|
|
156
163
|
class: "editor-container",
|
|
157
|
-
style: d(
|
|
164
|
+
style: d(se.value),
|
|
158
165
|
"model-value": k.value,
|
|
159
|
-
"default-config":
|
|
166
|
+
"default-config": oe.value,
|
|
160
167
|
mode: t.mode,
|
|
161
|
-
onOnCreated:
|
|
162
|
-
"onUpdate:modelValue":
|
|
163
|
-
onClick:
|
|
168
|
+
onOnCreated: Z,
|
|
169
|
+
"onUpdate:modelValue": Q,
|
|
170
|
+
onClick: ne
|
|
164
171
|
}, null, 8, [
|
|
165
172
|
"style",
|
|
166
173
|
"model-value",
|
|
167
174
|
"default-config",
|
|
168
175
|
"mode"
|
|
169
176
|
]),
|
|
170
|
-
|
|
177
|
+
N.value ? (p(), a(h(v), {
|
|
171
178
|
key: 0,
|
|
172
|
-
"url-list":
|
|
173
|
-
"initial-index":
|
|
179
|
+
"url-list": P.value,
|
|
180
|
+
"initial-index": F.value,
|
|
174
181
|
"hide-on-click-modal": "",
|
|
175
182
|
teleported: "",
|
|
176
|
-
onClose:
|
|
183
|
+
onClose: re
|
|
177
184
|
}, null, 8, ["url-list", "initial-index"])) : o("", !0)
|
|
178
185
|
], 2));
|
|
179
186
|
}
|
|
180
|
-
}), [["__scopeId", "data-v-
|
|
187
|
+
}), [["__scopeId", "data-v-e54f6c52"]]);
|
|
181
188
|
//#endregion
|
|
182
189
|
export { w as default };
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.d-editor[data-v-290537fe]{width:100%}.d-editor.w-e-full-screen-container[data-v-290537fe]{z-index:1000}.d-editor .toolbar-container[data-v-290537fe]{border-bottom:1px solid var(--el-border-color)}.d-editor .toolbar-container[data-v-290537fe] .w-e-toolbar{border-radius:4px}.d-editor .toolbar-container[data-v-290537fe] .w-e-drop-panel{z-index:100}.d-editor .editor-container[data-v-290537fe]{min-height:var(--minHeight);background:var(--el-fill-color-blank);border-radius:4px}.d-editor .editor-container[data-v-290537fe] p[id^=w-e-element-paragraph-]{margin:10px 0}.d-editor .editor-container[data-v-290537fe] .w-e-text-placeholder{font-size:14px;font-style:normal;line-height:normal;top:11px}.d-editor .editor-container[data-v-290537fe] .w-e-image-container{width:500px}.d-editor .editor-container[data-v-290537fe] pre code{text-shadow:none}.d-editor.editor-disabled[data-v-290537fe]:not(.editor-border) div[id^=w-e-textarea-]{padding:0}.d-editor.editor-disabled[data-v-290537fe]:not(.editor-border) p[id^=w-e-element-paragraph-]:first-child{margin-top:0}.d-editor.editor-disabled[data-v-290537fe]:not(.editor-border) p[id^=w-e-element-paragraph-]:last-child{margin-bottom:0}.editor-border[data-v-290537fe]{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-290537fe]:hover{border-color:var(--el-text-color-disabled)}.editor-disabled .editor-container[data-v-290537fe] img{cursor:zoom-in}.el-form-item.is-error .editor-border[data-v-290537fe]{border:1px solid var(--el-color-danger)}
|