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.
@@ -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-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.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_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 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,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: 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);
53
- }, U = (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) => {
51
+ O.value = Object.seal(e);
52
+ }, H = (e) => {
54
53
  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"));
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 = k.value?.getEditableContainer?.(), r = Array.from(n?.querySelectorAll?.("img") || []);
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
- F.value = a, I.value = s >= 0 ? s : 0, P.value = !0, e?.stopPropagation?.();
68
- }, G = (e) => {
69
- if (E.disabled) {
70
- W(e);
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
- k.value?.focus?.();
70
+ O.value?.focus?.();
71
+ }, G = () => {
72
+ N.value = !1, P.value = [], F.value = 0;
74
73
  }, K = () => {
75
- P.value = !1, F.value = [], I.value = 0;
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
- }), L.clear();
80
- }, J = (e) => {
76
+ }), I.clear();
77
+ }, q = (e) => {
81
78
  let t = document.createElement("div");
82
79
  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, {
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
- }, Y = () => {
90
- let e = k.value?.getEditableContainer?.()?.querySelectorAll("pre");
86
+ }, J = () => {
87
+ let e = O.value?.getEditableContainer?.()?.querySelectorAll("pre");
91
88
  e && e.forEach((e) => {
92
- e.parentElement?.tagName !== "DETAILS" && J(e);
89
+ e.parentElement?.tagName !== "DETAILS" && q(e);
93
90
  });
94
- }, X = i(() => ({ ...E.toolbarConfig })), Z = i(() => ({
95
- placeholder: E.disabled ? "" : E.placeholder || R("d.editor.placeholder"),
96
- readOnly: E.disabled,
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
- ...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", {
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: O,
114
- key: N.value,
115
- class: d(["d-editor", {
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
- y(l(g(w), {
117
+ v(c(h(C), {
121
118
  class: "toolbar-container",
122
- editor: k.value,
123
- "default-config": X.value,
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
- ]), [[_, t.showToolbar && !t.disabled]]),
130
- l(g(C), {
126
+ ]), [[g, t.showToolbar && !t.disabled]]),
127
+ c(h(S), {
131
128
  class: "editor-container",
132
- style: f(Q.value),
133
- "model-value": A.value,
134
- "default-config": Z.value,
129
+ style: d(Z.value),
130
+ "model-value": k.value,
131
+ "default-config": X.value,
135
132
  mode: t.mode,
136
- onOnCreated: H,
137
- "onUpdate:modelValue": U,
138
- onClick: G
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
- P.value ? (m(), o(g(b), {
142
+ N.value ? (p(), a(h(y), {
146
143
  key: 0,
147
- "url-list": F.value,
148
- "initial-index": I.value,
144
+ "url-list": P.value,
145
+ "initial-index": F.value,
149
146
  "hide-on-click-modal": "",
150
147
  teleported: "",
151
- onClose: K
152
- }, null, 8, ["url-list", "initial-index"])) : s("", !0)
148
+ onClose: G
149
+ }, null, 8, ["url-list", "initial-index"])) : o("", !0)
153
150
  ], 2));
154
151
  }
155
- }), [["__scopeId", "data-v-fcdf4a89"]]);
152
+ }), [["__scopeId", "data-v-4d9761f4"]]);
156
153
  //#endregion
157
- export { T as default };
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.32",
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.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 };