geekplus-digital-ui 0.1.32 → 0.1.33
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/components/editor/src/code-collapse.js +2 -2
- package/components/editor/src/{code-collapse.vue_vue_type_style_index_0_scoped_04f9af29_lang.css → code-collapse.vue_vue_type_style_index_0_scoped_788021d6_lang.css} +1 -1
- package/components/editor/src/editor.vue_vue_type_style_index_0_scoped_4d9761f4_lang.css +1 -0
- package/components/editor/src/editor2.js +67 -70
- package/package.json +2 -2
- package/components/editor/src/editor.vue_vue_type_style_index_0_scoped_fcdf4a89_lang.css +0 -1
- package/components/editor/src/table-width.d.ts +0 -1
- package/components/editor/src/table-width.js +0 -52
|
@@ -3,7 +3,7 @@ import "../../../hooks/index.js";
|
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
4
|
import n from "../../icons/angle-down-light.js";
|
|
5
5
|
import r from "../../icons/angle-up-light.js";
|
|
6
|
-
import './code-collapse.
|
|
6
|
+
import './code-collapse.vue_vue_type_style_index_0_scoped_788021d6_lang.css';/* empty css */
|
|
7
7
|
import i from "../../icon/index.js";
|
|
8
8
|
import "../../index.js";
|
|
9
9
|
import { computed as a, createBlock as o, createElementBlock as s, createElementVNode as c, createVNode as l, openBlock as u, ref as d, toDisplayString as f, unref as p, withCtx as m } from "vue";
|
|
@@ -31,6 +31,6 @@ var h = ["open"], g = /* @__PURE__ */ t({
|
|
|
31
31
|
class: "code-collapse-content"
|
|
32
32
|
}, null, 512)], 40, h));
|
|
33
33
|
}
|
|
34
|
-
}, [["__scopeId", "data-v-
|
|
34
|
+
}, [["__scopeId", "data-v-788021d6"]]);
|
|
35
35
|
//#endregion
|
|
36
36
|
export { g as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.code-collapse[data-v-
|
|
1
|
+
.code-collapse[data-v-788021d6]{border:1px solid var(--el-border-color);background:var(--el-bg-color-overlay);border-radius:4px;overflow:hidden}.code-collapse summary[data-v-788021d6]{cursor:pointer;-webkit-user-select:none;user-select:none;color:var(--el-text-color-primary);justify-content:flex-end;align-items:center;gap:4px;padding:8px 12px;line-height:normal;list-style:none;display:flex}.code-collapse[data-v-788021d6] pre code{border:none;border-radius:0;margin:0}
|
|
@@ -0,0 +1 @@
|
|
|
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)}
|
|
@@ -1,15 +1,14 @@
|
|
|
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_4d9761f4_lang.css';import './editor.css';/* empty css */
|
|
5
5
|
import n from "./code-collapse.js";
|
|
6
|
-
import { normalizeTableColumnWidths as r } from "./table-width.js";
|
|
7
6
|
/* empty css */
|
|
8
|
-
import { computed as
|
|
9
|
-
import { ElImageViewer as
|
|
10
|
-
import { i18nChangeLanguage as
|
|
11
|
-
import { Editor as
|
|
12
|
-
var
|
|
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
|
+
import { ElImageViewer as y, useFormItem as b } from "element-plus";
|
|
9
|
+
import { i18nChangeLanguage as x } from "@wangeditor-next/editor";
|
|
10
|
+
import { Editor as S, Toolbar as C } from "@wangeditor-next/editor-for-vue";
|
|
11
|
+
var w = /* @__PURE__ */ t(/* @__PURE__ */ Object.assign({ name: "DEditor" }, {
|
|
13
12
|
__name: "editor",
|
|
14
13
|
props: {
|
|
15
14
|
modelValue: {
|
|
@@ -47,111 +46,109 @@ var T = /* @__PURE__ */ t(/* @__PURE__ */ Object.assign({ name: "DEditor" }, {
|
|
|
47
46
|
placeholder: String
|
|
48
47
|
},
|
|
49
48
|
emits: ["update:model-value"],
|
|
50
|
-
setup(t, { emit:
|
|
51
|
-
let
|
|
52
|
-
|
|
53
|
-
},
|
|
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
|
+
O.value = Object.seal(e);
|
|
52
|
+
}, H = (e) => {
|
|
54
53
|
let t = e;
|
|
55
|
-
t === "<p><br></p>" && (t = "");
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}, W = (e) => {
|
|
59
|
-
if (!E.disabled) return;
|
|
54
|
+
t === "<p><br></p>" && (t = ""), t !== A.value && (j.value = t, A.value = t, E("update:model-value", t), z?.validate("change"), z?.validate("blur"));
|
|
55
|
+
}, U = (e) => {
|
|
56
|
+
if (!T.disabled) return;
|
|
60
57
|
let t = e?.target?.closest?.("img");
|
|
61
58
|
if (!t) return;
|
|
62
|
-
let n =
|
|
59
|
+
let n = O.value?.getEditableContainer?.(), r = Array.from(n?.querySelectorAll?.("img") || []);
|
|
63
60
|
if (r.length === 0) return;
|
|
64
61
|
let i = (e) => e?.currentSrc || e?.src || e?.getAttribute?.("data-src") || "", a = r.map(i).filter(Boolean);
|
|
65
62
|
if (a.length === 0) return;
|
|
66
63
|
let o = i(t), s = a.findIndex((e) => e === o);
|
|
67
|
-
|
|
68
|
-
},
|
|
69
|
-
if (
|
|
70
|
-
|
|
64
|
+
P.value = a, F.value = s >= 0 ? s : 0, N.value = !0, e?.stopPropagation?.();
|
|
65
|
+
}, W = (e) => {
|
|
66
|
+
if (T.disabled) {
|
|
67
|
+
U(e);
|
|
71
68
|
return;
|
|
72
69
|
}
|
|
73
|
-
|
|
70
|
+
O.value?.focus?.();
|
|
71
|
+
}, G = () => {
|
|
72
|
+
N.value = !1, P.value = [], F.value = 0;
|
|
74
73
|
}, K = () => {
|
|
75
|
-
|
|
76
|
-
}, q = () => {
|
|
77
|
-
L.forEach(({ app: e, host: t, pre: n }) => {
|
|
74
|
+
I.forEach(({ app: e, host: t, pre: n }) => {
|
|
78
75
|
t?.isConnected && n?.isConnected && t.parentNode && t.parentNode.insertBefore(n, t), e.unmount(), t?.remove();
|
|
79
|
-
}),
|
|
80
|
-
},
|
|
76
|
+
}), I.clear();
|
|
77
|
+
}, q = (e) => {
|
|
81
78
|
let t = document.createElement("div");
|
|
82
79
|
e.parentNode?.insertBefore(t, e);
|
|
83
|
-
let r =
|
|
84
|
-
(
|
|
80
|
+
let r = i(n), a = r.mount(t);
|
|
81
|
+
(a.contentRef?.value || a.contentRef)?.appendChild(e), I.set(e, {
|
|
85
82
|
app: r,
|
|
86
83
|
host: t,
|
|
87
84
|
pre: e
|
|
88
85
|
});
|
|
89
|
-
},
|
|
90
|
-
let e =
|
|
86
|
+
}, J = () => {
|
|
87
|
+
let e = O.value?.getEditableContainer?.()?.querySelectorAll("pre");
|
|
91
88
|
e && e.forEach((e) => {
|
|
92
|
-
e.parentElement?.tagName !== "DETAILS" &&
|
|
89
|
+
e.parentElement?.tagName !== "DETAILS" && q(e);
|
|
93
90
|
});
|
|
94
|
-
},
|
|
95
|
-
placeholder:
|
|
96
|
-
readOnly:
|
|
91
|
+
}, Y = r(() => ({ ...T.toolbarConfig })), X = r(() => ({
|
|
92
|
+
placeholder: T.disabled ? "" : T.placeholder || L("d.editor.placeholder"),
|
|
93
|
+
readOnly: T.disabled,
|
|
97
94
|
autoFocus: !1,
|
|
98
|
-
...
|
|
99
|
-
})),
|
|
100
|
-
return
|
|
101
|
-
|
|
102
|
-
}, { immediate: !0 }),
|
|
103
|
-
|
|
104
|
-
}),
|
|
105
|
-
let e =
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}) :
|
|
109
|
-
}, { immediate: !0 }),
|
|
110
|
-
|
|
111
|
-
}), (e, n) => (
|
|
95
|
+
...T.editorConfig
|
|
96
|
+
})), Z = r(() => ({ "--minHeight": T.disabled ? "" : `${T.minHeight}px` }));
|
|
97
|
+
return _(B, (e) => {
|
|
98
|
+
x(e === "zh-cn" ? "zh-CN" : "en");
|
|
99
|
+
}, { immediate: !0 }), _(() => T.disabled, () => {
|
|
100
|
+
K(), M.value++;
|
|
101
|
+
}), _(() => T.modelValue, () => {
|
|
102
|
+
let e = j.value === T.modelValue;
|
|
103
|
+
A.value = T.modelValue, e ? j.value = null : k.value === T.modelValue ? M.value++ : k.value = T.modelValue, T.disabled ? l(() => {
|
|
104
|
+
K(), J();
|
|
105
|
+
}) : K();
|
|
106
|
+
}, { immediate: !0 }), f(() => {
|
|
107
|
+
K(), O.value?.destroy?.();
|
|
108
|
+
}), (e, n) => (p(), s("div", {
|
|
112
109
|
ref_key: "rootRef",
|
|
113
|
-
ref:
|
|
114
|
-
key:
|
|
115
|
-
class:
|
|
110
|
+
ref: D,
|
|
111
|
+
key: M.value,
|
|
112
|
+
class: u(["d-editor", {
|
|
116
113
|
"editor-border": t.border,
|
|
117
114
|
"editor-disabled": t.disabled
|
|
118
115
|
}])
|
|
119
116
|
}, [
|
|
120
|
-
|
|
117
|
+
v(c(h(C), {
|
|
121
118
|
class: "toolbar-container",
|
|
122
|
-
editor:
|
|
123
|
-
"default-config":
|
|
119
|
+
editor: O.value,
|
|
120
|
+
"default-config": Y.value,
|
|
124
121
|
mode: t.mode
|
|
125
122
|
}, null, 8, [
|
|
126
123
|
"editor",
|
|
127
124
|
"default-config",
|
|
128
125
|
"mode"
|
|
129
|
-
]), [[
|
|
130
|
-
|
|
126
|
+
]), [[g, t.showToolbar && !t.disabled]]),
|
|
127
|
+
c(h(S), {
|
|
131
128
|
class: "editor-container",
|
|
132
|
-
style:
|
|
133
|
-
"model-value":
|
|
134
|
-
"default-config":
|
|
129
|
+
style: d(Z.value),
|
|
130
|
+
"model-value": k.value,
|
|
131
|
+
"default-config": X.value,
|
|
135
132
|
mode: t.mode,
|
|
136
|
-
onOnCreated:
|
|
137
|
-
"onUpdate:modelValue":
|
|
138
|
-
onClick:
|
|
133
|
+
onOnCreated: V,
|
|
134
|
+
"onUpdate:modelValue": H,
|
|
135
|
+
onClick: W
|
|
139
136
|
}, null, 8, [
|
|
140
137
|
"style",
|
|
141
138
|
"model-value",
|
|
142
139
|
"default-config",
|
|
143
140
|
"mode"
|
|
144
141
|
]),
|
|
145
|
-
|
|
142
|
+
N.value ? (p(), a(h(y), {
|
|
146
143
|
key: 0,
|
|
147
|
-
"url-list":
|
|
148
|
-
"initial-index":
|
|
144
|
+
"url-list": P.value,
|
|
145
|
+
"initial-index": F.value,
|
|
149
146
|
"hide-on-click-modal": "",
|
|
150
147
|
teleported: "",
|
|
151
|
-
onClose:
|
|
152
|
-
}, null, 8, ["url-list", "initial-index"])) :
|
|
148
|
+
onClose: G
|
|
149
|
+
}, null, 8, ["url-list", "initial-index"])) : o("", !0)
|
|
153
150
|
], 2));
|
|
154
151
|
}
|
|
155
|
-
}), [["__scopeId", "data-v-
|
|
152
|
+
}), [["__scopeId", "data-v-4d9761f4"]]);
|
|
156
153
|
//#endregion
|
|
157
|
-
export {
|
|
154
|
+
export { w as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "geekplus-digital-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.33",
|
|
4
4
|
"homepage": "https://ui.geekplus.cc/static/ui/",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@vueuse/core": "^14.2.1",
|
|
24
|
-
"@wangeditor-next/editor": "^5.6.
|
|
24
|
+
"@wangeditor-next/editor": "^5.6.50",
|
|
25
25
|
"@wangeditor-next/editor-for-vue": "^5.1.14",
|
|
26
26
|
"file-saver": "^2.0.5",
|
|
27
27
|
"lodash-es": "^4.17.23",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.d-editor[data-v-fcdf4a89]{width:100%}.d-editor.w-e-full-screen-container[data-v-fcdf4a89]{z-index:1000}.d-editor .toolbar-container[data-v-fcdf4a89]{border-bottom:1px solid var(--el-border-color)}.d-editor .toolbar-container[data-v-fcdf4a89] .w-e-toolbar{border-radius:4px}.d-editor .toolbar-container[data-v-fcdf4a89] .w-e-drop-panel{z-index:100}.d-editor .editor-container[data-v-fcdf4a89]{min-height:var(--minHeight);background:var(--el-fill-color-blank);border-radius:4px}.d-editor .editor-container[data-v-fcdf4a89] p[id^=w-e-element-paragraph-]{margin:10px 0}.d-editor .editor-container[data-v-fcdf4a89] .w-e-text-placeholder{font-size:14px;font-style:normal;line-height:normal;top:11px}.d-editor .editor-container[data-v-fcdf4a89] .w-e-image-container{width:500px}.d-editor .editor-container[data-v-fcdf4a89] pre code{text-shadow:none}.d-editor.editor-disabled[data-v-fcdf4a89]:not(.editor-border) div[id^=w-e-textarea-]{padding:0}.d-editor.editor-disabled[data-v-fcdf4a89]:not(.editor-border) p[id^=w-e-element-paragraph-]:first-child{margin-top:0}.d-editor.editor-disabled[data-v-fcdf4a89]:not(.editor-border) p[id^=w-e-element-paragraph-]:last-child{margin-bottom:0}.editor-border[data-v-fcdf4a89]{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-fcdf4a89]:hover{border-color:var(--el-text-color-disabled)}.editor-disabled .editor-container[data-v-fcdf4a89] img{cursor:zoom-in}.el-form-item.is-error .editor-border[data-v-fcdf4a89]{border:1px solid var(--el-color-danger)}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function normalizeTableColumnWidths(html: any): any;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
//#region packages/components/editor/src/table-width.js
|
|
2
|
-
var e = /<table[\s>]/i, t = /<col(?:group)?[\s>]/i, n = new Set(["TD", "TH"]), r = (n) => e.test(n) && t.test(n), i = (e) => {
|
|
3
|
-
if (e == null) return "";
|
|
4
|
-
let t = `${e}`.trim();
|
|
5
|
-
return !t || t === "auto" ? "" : /^\d+(?:\.\d+)?$/.test(t) ? `${t}px` : t;
|
|
6
|
-
}, a = (e) => {
|
|
7
|
-
let t = i(e);
|
|
8
|
-
if (!t) return null;
|
|
9
|
-
let n = Number.parseFloat(t);
|
|
10
|
-
return Number.isFinite(n) ? n : null;
|
|
11
|
-
}, o = (e) => e ? i(e.getAttribute("width") || e.style?.width || e.getAttribute("data-width")) : "", s = (e, t) => {
|
|
12
|
-
if (!e || !t) return !1;
|
|
13
|
-
let n = !1;
|
|
14
|
-
e.style.width !== t && (e.style.width = t, n = !0);
|
|
15
|
-
let r = a(t);
|
|
16
|
-
if (r != null) {
|
|
17
|
-
let t = `${r}`;
|
|
18
|
-
e.getAttribute("width") !== t && (e.setAttribute("width", t), n = !0);
|
|
19
|
-
}
|
|
20
|
-
return n;
|
|
21
|
-
}, c = (e) => {
|
|
22
|
-
if (e.length === 0) return "";
|
|
23
|
-
if (e.length === 1) return e[0];
|
|
24
|
-
let t = e.map(a);
|
|
25
|
-
return t.every((e) => e != null) ? `${t.reduce((e, t) => e + t, 0)}px` : e[0];
|
|
26
|
-
}, l = (e) => {
|
|
27
|
-
let t = Array.from(e.querySelectorAll("colgroup col"));
|
|
28
|
-
if (t.length === 0) return !1;
|
|
29
|
-
let r = t.map(o);
|
|
30
|
-
if (r.every((e) => !e)) return !1;
|
|
31
|
-
let i = !1;
|
|
32
|
-
t.forEach((e, t) => {
|
|
33
|
-
i = s(e, r[t]) || i;
|
|
34
|
-
});
|
|
35
|
-
let a = e.querySelector("tr");
|
|
36
|
-
if (!a) return i;
|
|
37
|
-
let l = 0;
|
|
38
|
-
return Array.from(a.children).filter((e) => n.has(e.tagName)).forEach((e) => {
|
|
39
|
-
let t = Number.parseInt(e.getAttribute("colspan") || "1", 10) || 1;
|
|
40
|
-
i = s(e, c(r.slice(l, l + t).filter(Boolean))) || i, l += t;
|
|
41
|
-
}), i;
|
|
42
|
-
}, u = (e) => {
|
|
43
|
-
if (!e || typeof e != "string" || !r(e) || typeof document > "u") return e;
|
|
44
|
-
let t = document.createElement("template");
|
|
45
|
-
t.innerHTML = e;
|
|
46
|
-
let n = !1;
|
|
47
|
-
return t.content.querySelectorAll("table").forEach((e) => {
|
|
48
|
-
n = l(e) || n;
|
|
49
|
-
}), n ? t.innerHTML : e;
|
|
50
|
-
};
|
|
51
|
-
//#endregion
|
|
52
|
-
export { u as normalizeTableColumnWidths };
|