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.vue_vue_type_style_index_0_scoped_290537fe_lang.css';import './editor.css';/* empty css */
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 v } from "vue";
8
- import { ElImageViewer as y, useFormItem as b } from "element-plus";
9
- import { i18nChangeLanguage as ee } from "@wangeditor-next/editor";
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), N = m([]), P = m(0), F = /* @__PURE__ */ new Map(), { t: I, getLocale: L } = e(), { formItem: R } = b(), z = r(() => L()), B = /[\s\u00A0\u200B-\u200D\uFEFF]/g, V = [
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
- ], H = V.join(","), U = RegExp(`<(${V.join("|")})(\\s|>|/)`, "i"), W = (e) => e?.currentSrc || e?.src || e?.getAttribute?.("data-src") || "", G = (e) => {
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 U.test(e) ? !0 : e.replace(/<[^>]+>/g, "").replace(B, "").length > 0;
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(H) ? !0 : t.textContent?.replace(B, "").length > 0;
68
- }, K = (e) => G(e) ? e : "", q = (e, t = K(e)) => t === "" ? C : e || C, J = () => {
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
- $(), ie();
71
+ $(), ae();
72
72
  });
73
73
  return;
74
74
  }
75
75
  $();
76
- }, Y = () => {
76
+ }, X = () => {
77
77
  let e = O.value;
78
78
  if (e) {
79
79
  if (E.disabled) {
80
- e.disable?.(), J();
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
- 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"));
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(W).filter(Boolean);
96
+ let i = r.map(G).filter(Boolean);
97
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) => {
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
- Q(e);
102
+ te(e);
103
103
  return;
104
104
  }
105
105
  O.value?.focus?.();
106
- }, ne = () => {
107
- M.value = !1, N.value = [], P.value = 0;
106
+ }, re = () => {
107
+ N.value = !1, P.value = [], F.value = 0;
108
108
  }, $ = () => {
109
- F.forEach(({ app: e, host: t, pre: n }) => {
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
- }), F.clear();
112
- }, re = (e) => {
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), F.set(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
- }, ie = () => {
121
+ }, ae = () => {
122
122
  let e = O.value?.getEditableContainer?.()?.querySelectorAll("pre");
123
123
  e && e.forEach((e) => {
124
- e.parentElement?.tagName !== "DETAILS" && re(e);
124
+ e.parentElement?.tagName !== "DETAILS" && ie(e);
125
125
  });
126
- }, ae = r(() => ({
127
- placeholder: E.disabled ? "" : E.placeholder || I("d.editor.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
- })), oe = r(() => ({ "--minHeight": E.disabled ? "" : `${E.minHeight}px` }));
132
- return _(z, (e) => {
133
- ee(e === "zh-cn" ? "zh-CN" : "en");
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
- Y();
135
+ X();
136
136
  }), _(() => E.modelValue, (e) => {
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
+ 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", { class: u(["d-editor", {
142
- "editor-border": t.border,
143
- "editor-disabled": t.disabled
144
- }]) }, [
145
- v(c(h(S), {
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(oe.value),
164
+ style: d(se.value),
158
165
  "model-value": k.value,
159
- "default-config": ae.value,
166
+ "default-config": oe.value,
160
167
  mode: t.mode,
161
- onOnCreated: X,
162
- "onUpdate:modelValue": Z,
163
- onClick: te
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
- M.value ? (p(), a(h(y), {
177
+ N.value ? (p(), a(h(v), {
171
178
  key: 0,
172
- "url-list": N.value,
173
- "initial-index": P.value,
179
+ "url-list": P.value,
180
+ "initial-index": F.value,
174
181
  "hide-on-click-modal": "",
175
182
  teleported: "",
176
- onClose: ne
183
+ onClose: re
177
184
  }, null, 8, ["url-list", "initial-index"])) : o("", !0)
178
185
  ], 2));
179
186
  }
180
- }), [["__scopeId", "data-v-290537fe"]]);
187
+ }), [["__scopeId", "data-v-e54f6c52"]]);
181
188
  //#endregion
182
189
  export { w as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geekplus-digital-ui",
3
- "version": "0.1.37",
3
+ "version": "0.1.38",
4
4
  "homepage": "https://ui.geekplus.cc/static/ui/",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -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)}