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