geekplus-digital-ui 0.1.32 → 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.
@@ -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.vue_vue_type_style_index_0_scoped_04f9af29_lang.css';/* empty css */
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-04f9af29"]]);
34
+ }, [["__scopeId", "data-v-788021d6"]]);
35
35
  //#endregion
36
36
  export { g as default };
@@ -1 +1 @@
1
- .code-collapse[data-v-04f9af29]{border:1px solid var(--el-border-color);background:var(--el-bg-color-overlay);border-radius:4px;overflow:hidden}.code-collapse summary[data-v-04f9af29]{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-04f9af29] .code-collapse-content pre code{border:none;border-radius:0;margin:0}
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-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,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.vue_vue_type_style_index_0_scoped_fcdf4a89_lang.css';import './editor.css';/* empty css */
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
- import { normalizeTableColumnWidths as r } from "./table-width.js";
7
6
  /* empty css */
8
- import { computed as i, createApp as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createVNode as l, nextTick as u, normalizeClass as d, normalizeStyle as f, onBeforeUnmount as p, openBlock as m, ref as h, unref as g, vShow as _, watch as v, withDirectives as y } from "vue";
9
- import { ElImageViewer as b, useFormItem as x } from "element-plus";
10
- import { i18nChangeLanguage as S } from "@wangeditor-next/editor";
11
- import { Editor as C, Toolbar as w } from "@wangeditor-next/editor-for-vue";
12
- var T = /* @__PURE__ */ t(/* @__PURE__ */ Object.assign({ name: "DEditor" }, {
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,119 @@ 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: T }) {
51
- let E = t, D = T, O = h(null), k = h(null), A = h(""), j = h(""), M = h(null), N = h(0), P = h(!1), F = h([]), I = h(0), L = /* @__PURE__ */ new Map(), { t: R, getLocale: z } = e(), { formItem: B } = x(), V = i(() => z()), H = (e) => {
52
- k.value = Object.seal(e);
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) => e === "<p><br></p>" ? "" : e || "", H = () => {
51
+ if (T.disabled) {
52
+ l(() => {
53
+ J(), X();
54
+ });
55
+ return;
56
+ }
57
+ J();
53
58
  }, U = (e) => {
54
- let t = e;
55
- t === "<p><br></p>" && (t = "");
56
- let n = r(t);
57
- n !== j.value && (M.value = n, j.value = n, D("update:model-value", n), B?.validate("change"), B?.validate("blur"));
59
+ O.value = Object.seal(e);
58
60
  }, W = (e) => {
59
- if (!E.disabled) return;
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) => {
64
+ if (!T.disabled) return;
60
65
  let t = e?.target?.closest?.("img");
61
66
  if (!t) return;
62
- let n = k.value?.getEditableContainer?.(), r = Array.from(n?.querySelectorAll?.("img") || []);
67
+ let n = O.value?.getEditableContainer?.(), r = Array.from(n?.querySelectorAll?.("img") || []);
63
68
  if (r.length === 0) return;
64
69
  let i = (e) => e?.currentSrc || e?.src || e?.getAttribute?.("data-src") || "", a = r.map(i).filter(Boolean);
65
70
  if (a.length === 0) return;
66
71
  let o = i(t), s = a.findIndex((e) => e === o);
67
- F.value = a, I.value = s >= 0 ? s : 0, P.value = !0, e?.stopPropagation?.();
68
- }, G = (e) => {
69
- if (E.disabled) {
70
- W(e);
72
+ P.value = a, F.value = s >= 0 ? s : 0, N.value = !0, e?.stopPropagation?.();
73
+ }, K = (e) => {
74
+ if (T.disabled) {
75
+ G(e);
71
76
  return;
72
77
  }
73
- k.value?.focus?.();
74
- }, K = () => {
75
- P.value = !1, F.value = [], I.value = 0;
78
+ O.value?.focus?.();
76
79
  }, q = () => {
77
- L.forEach(({ app: e, host: t, pre: n }) => {
80
+ N.value = !1, P.value = [], F.value = 0;
81
+ }, J = () => {
82
+ I.forEach(({ app: e, host: t, pre: n }) => {
78
83
  t?.isConnected && n?.isConnected && t.parentNode && t.parentNode.insertBefore(n, t), e.unmount(), t?.remove();
79
- }), L.clear();
80
- }, J = (e) => {
84
+ }), I.clear();
85
+ }, Y = (e) => {
81
86
  let t = document.createElement("div");
82
87
  e.parentNode?.insertBefore(t, e);
83
- let r = a(n), i = r.mount(t);
84
- (i.contentRef?.value || i.contentRef)?.appendChild(e), L.set(e, {
88
+ let r = i(n), a = r.mount(t);
89
+ (a.contentRef?.value || a.contentRef)?.appendChild(e), I.set(e, {
85
90
  app: r,
86
91
  host: t,
87
92
  pre: e
88
93
  });
89
- }, Y = () => {
90
- let e = k.value?.getEditableContainer?.()?.querySelectorAll("pre");
94
+ }, X = () => {
95
+ let e = O.value?.getEditableContainer?.()?.querySelectorAll("pre");
91
96
  e && e.forEach((e) => {
92
- e.parentElement?.tagName !== "DETAILS" && J(e);
97
+ e.parentElement?.tagName !== "DETAILS" && Y(e);
93
98
  });
94
- }, X = i(() => ({ ...E.toolbarConfig })), Z = i(() => ({
95
- placeholder: E.disabled ? "" : E.placeholder || R("d.editor.placeholder"),
96
- readOnly: E.disabled,
99
+ }, Z = r(() => ({ ...T.toolbarConfig })), Q = r(() => ({
100
+ placeholder: T.disabled ? "" : T.placeholder || L("d.editor.placeholder"),
101
+ readOnly: T.disabled,
97
102
  autoFocus: !1,
98
- ...E.editorConfig
99
- })), Q = i(() => ({ "--minHeight": E.disabled ? "" : `${E.minHeight}px` }));
100
- return v(V, (e) => {
101
- S(e === "zh-cn" ? "zh-CN" : "en");
102
- }, { immediate: !0 }), v(() => E.disabled, () => {
103
- q(), N.value++;
104
- }), v(() => E.modelValue, () => {
105
- let e = r(E.modelValue), t = M.value === E.modelValue;
106
- j.value = e, t ? M.value = null : A.value === e ? N.value++ : A.value = e, E.disabled ? u(() => {
107
- q(), Y();
108
- }) : q();
109
- }, { immediate: !0 }), p(() => {
110
- q(), k.value?.destroy?.();
111
- }), (e, n) => (m(), c("div", {
103
+ ...T.editorConfig
104
+ })), $ = r(() => ({ "--minHeight": T.disabled ? "" : `${T.minHeight}px` }));
105
+ return _(B, (e) => {
106
+ x(e === "zh-cn" ? "zh-CN" : "en");
107
+ }, { immediate: !0 }), _(() => T.disabled, () => {
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();
116
+ }, { immediate: !0 }), f(() => {
117
+ J(), O.value?.destroy?.();
118
+ }), (e, n) => (p(), s("div", {
112
119
  ref_key: "rootRef",
113
- ref: O,
114
- key: N.value,
115
- class: d(["d-editor", {
120
+ ref: D,
121
+ key: M.value,
122
+ class: u(["d-editor", {
116
123
  "editor-border": t.border,
117
124
  "editor-disabled": t.disabled
118
125
  }])
119
126
  }, [
120
- y(l(g(w), {
127
+ v(c(h(C), {
121
128
  class: "toolbar-container",
122
- editor: k.value,
123
- "default-config": X.value,
129
+ editor: O.value,
130
+ "default-config": Z.value,
124
131
  mode: t.mode
125
132
  }, null, 8, [
126
133
  "editor",
127
134
  "default-config",
128
135
  "mode"
129
- ]), [[_, t.showToolbar && !t.disabled]]),
130
- l(g(C), {
136
+ ]), [[g, t.showToolbar && !t.disabled]]),
137
+ c(h(S), {
131
138
  class: "editor-container",
132
- style: f(Q.value),
133
- "model-value": A.value,
134
- "default-config": Z.value,
139
+ style: d($.value),
140
+ "model-value": k.value,
141
+ "default-config": Q.value,
135
142
  mode: t.mode,
136
- onOnCreated: H,
137
- "onUpdate:modelValue": U,
138
- onClick: G
143
+ onOnCreated: U,
144
+ "onUpdate:modelValue": W,
145
+ onClick: K
139
146
  }, null, 8, [
140
147
  "style",
141
148
  "model-value",
142
149
  "default-config",
143
150
  "mode"
144
151
  ]),
145
- P.value ? (m(), o(g(b), {
152
+ N.value ? (p(), a(h(y), {
146
153
  key: 0,
147
- "url-list": F.value,
148
- "initial-index": I.value,
154
+ "url-list": P.value,
155
+ "initial-index": F.value,
149
156
  "hide-on-click-modal": "",
150
157
  teleported: "",
151
- onClose: K
152
- }, null, 8, ["url-list", "initial-index"])) : s("", !0)
158
+ onClose: q
159
+ }, null, 8, ["url-list", "initial-index"])) : o("", !0)
153
160
  ], 2));
154
161
  }
155
- }), [["__scopeId", "data-v-fcdf4a89"]]);
162
+ }), [["__scopeId", "data-v-7bb70b23"]]);
156
163
  //#endregion
157
- export { T as default };
164
+ export { w as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geekplus-digital-ui",
3
- "version": "0.1.32",
3
+ "version": "0.1.34",
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.49",
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 };