@unicom-cloud/ui 0.8.110 → 0.8.111

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/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@unicom-cloud/ui","version":"0.8.110","dependencies":{"@unicom-cloud/icons":"latest"},"peerDependencies":{"react":"^19.1.1","react-dom":"^19.1.1","dayjs":"^1.11.10","lodash":"^4.17.21","uuid":"^11.1.0","qrcode.react":"^4.2.0"},"peerDependenciesMeta":{},"type":"module","types":"types/pc/index.d.ts","main":"./index.js","publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"}}
1
+ {"name":"@unicom-cloud/ui","version":"0.8.111","dependencies":{"@unicom-cloud/icons":"latest"},"peerDependencies":{"react":"^19.1.1","react-dom":"^19.1.1","dayjs":"^1.11.10","lodash":"^4.17.21","uuid":"^11.1.0","qrcode.react":"^4.2.0"},"peerDependenciesMeta":{},"type":"module","types":"types/pc/index.d.ts","main":"./index.js","publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"}}
@@ -1,105 +1,36 @@
1
1
  import { jsx as I } from "react/jsx-runtime";
2
- import { forwardRef as w, useContext as D, useRef as E, useEffect as s, useImperativeHandle as P } from "react";
3
- import { a as j } from "../chunk/BcEZk8pT.js";
4
- import "../chunk/DsaQZE4X.js";
5
- import "../chunk/CdXR6dj7.js";
6
- import "@unicom-cloud/utils/js-cookie";
7
- import "dayjs";
8
- import "lodash/debounce";
9
- import { u as x } from "../chunk/COc48wzV.js";
10
- import "@unicom-cloud/utils/screenfull";
11
- import "../chunk/BDgzrqDN.js";
12
- import "lodash/throttle";
13
- import "@unicom-cloud/utils/constant/platform";
14
- import "lodash/isPlainObject";
15
- import "@unicom-cloud/utils/query-string";
16
- import "react-router";
17
- import "lodash/isEqualWith";
18
- import "@unicom-cloud/utils/constant/keyboardCode";
19
- import "lodash/isNumber";
20
- import "lodash/merge";
21
- import "../chunk/d1c9z8T1.js";
22
- import "@unicom-cloud/utils/date";
23
- import "@unicom-cloud/utils/case-name";
24
- import G from "@unicom-cloud/utils/class-name";
25
- import "@unicom-cloud/utils/constant/ui";
26
- import "@unicom-cloud/utils/clipboard-copy";
27
- import "../chunk/DS_deHpN.js";
28
- import "@unicom-cloud/utils/file/fileToURL";
29
- import "lodash/escapeRegExp";
30
- import "lodash/isArray";
31
- import "lodash/isString";
32
- import "lodash/isFunction";
33
- import "lodash/camelCase";
34
- import "lodash/capitalize";
35
- import "lodash/cloneDeep";
36
- import "lodash/get";
37
- import "lodash/has";
38
- import "lodash/kebabCase";
39
- import "lodash/mergeWith";
40
- import "lodash/set";
41
- import "lodash/setWith";
42
- import "lodash/snakeCase";
43
- import "lodash/startCase";
44
- import "lodash/uniq";
45
- import "lodash/upperFirst";
46
- import "@unicom-cloud/utils/math";
47
- import "@unicom-cloud/utils/mitt";
48
- import "@unicom-cloud/utils/pinyin";
49
- import "../chunk/BJ9_azwQ.js";
50
- import "../chunk/CXrVhA6-.js";
51
- import "@unicom-cloud/utils/file/saveAs";
52
- import "@unicom-cloud/utils/constant/ui.js";
53
- import "@unicom-cloud/utils/tinycolor";
54
- import "@unicom-cloud/utils/ui-color";
55
- import "react-is";
56
- import "@unicom-cloud/utils/tree";
57
- import "@unicom-cloud/utils/is";
58
- import "uuid";
59
- import "../chunk/hc_ufgVf.js";
60
- import "../chunk/RjJoagzL.js";
2
+ import { forwardRef as w, useContext as D, useRef as E, useEffect as a, useImperativeHandle as P } from "react";
3
+ import { a as G } from "../chunk/BcEZk8pT.js";
61
4
  import { u as _ } from "../chunk/FgWHhRFz.js";
62
- import "@unicom-cloud/utils/constant";
5
+ import M from "@unicom-cloud/utils/class-name";
63
6
  import "./rich.js";
64
- import { R as e } from "../chunk/BDMqvmVH.js";
65
- import { A as te, D as ee, M as re, O as oe, I as ne, P as ie, a as se } from "../chunk/BDMqvmVH.js";
66
- e.import("delta");
67
- const M = {};
68
- function S(i, R) {
69
- const { getPrefixCls: T, renderEmpty: L, componentConfig: y, rtl: V } = D(j), r = _(
70
- i,
71
- M,
72
- y?.RichText
7
+ import { R as t } from "../chunk/BDMqvmVH.js";
8
+ import { A as U, D as W, M as Y, O as Z, I as ee, P as te, a as ne } from "../chunk/BDMqvmVH.js";
9
+ t.import("delta");
10
+ const k = {};
11
+ function S(s, v) {
12
+ const { getPrefixCls: T, renderEmpty: L, componentConfig: x, rtl: V } = D(G), n = _(
13
+ s,
14
+ k,
15
+ x?.RichText
73
16
  ), N = T?.("rich-text"), {
74
- style: b,
75
- className: O,
76
- defaultValue: k,
77
- value: p,
78
- readOnly: m,
79
- ...X
80
- } = r, A = "defaultValue" in r, a = "value" in r, c = "readOnly" in r, l = E(void 0), t = E(void 0);
81
- x("https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.js", {
82
- js: {
83
- async: !0
84
- }
85
- }), x(
86
- "https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css",
87
- {
88
- css: {
89
- async: !0
90
- }
91
- }
92
- );
93
- function u() {
94
- return t.current.getContents();
17
+ style: y,
18
+ className: b,
19
+ defaultValue: O,
20
+ value: c,
21
+ readOnly: i,
22
+ ...j
23
+ } = n, A = "defaultValue" in n, l = "value" in n, u = "readOnly" in n, f = E(void 0), e = E(void 0);
24
+ function d() {
25
+ return e.current.getContents();
95
26
  }
96
- return s(() => {
97
- const n = l.current, H = n.appendChild(
98
- n.ownerDocument.createElement("div")
27
+ return a(() => {
28
+ const o = f.current, H = o.appendChild(
29
+ o.ownerDocument.createElement("div")
99
30
  );
100
- t.current = new e(H, {
31
+ e.current = new t(H, {
101
32
  theme: "snow",
102
- readOnly: m,
33
+ readOnly: i,
103
34
  modules: {
104
35
  // syntax: true,
105
36
  // toolbar: refRichTextToolbarDom.current,
@@ -124,7 +55,13 @@ function S(i, R) {
124
55
  [{ list: "ordered" }, { list: "bullet" }],
125
56
  [{ indent: "-1" }, { indent: "+1" }],
126
57
  [{ direction: "rtl" }],
127
- ["link", "image", "video", "formula", "table"],
58
+ [
59
+ "link",
60
+ "image",
61
+ "video",
62
+ !1,
63
+ !1
64
+ ].filter(Boolean),
128
65
  ["undo", "redo"],
129
66
  ["clean"]
130
67
  ],
@@ -136,47 +73,47 @@ function S(i, R) {
136
73
  table: !0
137
74
  },
138
75
  placeholder: "请输入富文本内容"
139
- }), console.log("new Rich", t.current);
140
- function f(o, C, g) {
141
- r.onTextChange?.(o, C, g), r.onChange?.(u(), o, C, g);
76
+ }), console.log("new Rich", e.current);
77
+ function m(r, C, g) {
78
+ n.onTextChange?.(r, C, g), n.onChange?.(d(), r, C, g);
142
79
  }
143
- function d(...o) {
144
- r.onSelectionChange?.(...o);
80
+ function p(...r) {
81
+ n.onSelectionChange?.(...r);
145
82
  }
146
- function h(...o) {
147
- r.onEditorChange?.(...o);
83
+ function h(...r) {
84
+ n.onEditorChange?.(...r);
148
85
  }
149
- return t.current.on(e.events.TEXT_CHANGE, f), t.current.on(e.events.SELECTION_CHANGE, d), t.current.on(e.events.EDITOR_CHANGE, h), () => {
150
- t.current.off(e.events.TEXT_CHANGE, f), t.current.off(e.events.SELECTION_CHANGE, d), t.current.off(e.events.EDITOR_CHANGE, h), t.current = null, n.innerHTML = "";
86
+ return e.current.on(t.events.TEXT_CHANGE, m), e.current.on(t.events.SELECTION_CHANGE, p), e.current.on(t.events.EDITOR_CHANGE, h), () => {
87
+ e.current.off(t.events.TEXT_CHANGE, m), e.current.off(t.events.SELECTION_CHANGE, p), e.current.off(t.events.EDITOR_CHANGE, h), e.current = null, o.innerHTML = "";
151
88
  };
152
- }, []), s(() => {
153
- a && t.current.setContents(p);
154
- }, [a, p]), s(() => {
155
- c && t.current.enable(!m);
156
- }, [c, m]), s(() => (A && t.current.setContents(k), () => {
157
- }), []), P(R, () => {
158
- const n = t.current;
89
+ }, []), a(() => {
90
+ l && e.current.setContents(c);
91
+ }, [l, c]), a(() => {
92
+ u && e.current.enable(!i);
93
+ }, [u, i]), a(() => (A && e.current.setContents(O), () => {
94
+ }), []), P(v, () => {
95
+ const o = e.current;
159
96
  return {
160
97
  getInstance() {
161
- return n;
98
+ return o;
162
99
  },
163
- getContents: u
100
+ getContents: d
164
101
  };
165
- }), /* @__PURE__ */ I("div", { ref: l, style: b, className: G(N, O) });
102
+ }), /* @__PURE__ */ I("div", { ref: f, style: y, className: M(N, b) });
166
103
  }
167
- const v = w(S);
168
- Reflect.ownKeys(e).forEach((i) => {
169
- v[i] = e[i];
104
+ const R = w(S);
105
+ Reflect.ownKeys(t).forEach((s) => {
106
+ R[s] = t[s];
170
107
  });
171
- v.displayName = "RichText";
108
+ R.displayName = "RichText";
172
109
  export {
173
- te as AttributeMap,
174
- ee as Delta,
175
- re as Module,
176
- oe as Op,
177
- ne as OpIterator,
178
- ie as Parchment,
179
- se as Range,
180
- e as Rich,
181
- v as default
110
+ U as AttributeMap,
111
+ W as Delta,
112
+ Y as Module,
113
+ Z as Op,
114
+ ee as OpIterator,
115
+ te as Parchment,
116
+ ne as Range,
117
+ t as Rich,
118
+ R as default
182
119
  };
package/version/index.js CHANGED
@@ -1,4 +1,4 @@
1
- const I = "2025-08-28 18:45:52", t = "1756377952626", E = "2.66.5";
1
+ const I = "2025-08-29 13:48:11", t = "1756446491561", E = "2.66.5";
2
2
  export {
3
3
  E as VERSION,
4
4
  I as VERSION_BUILD_DATE,
package/chunk/COc48wzV.js DELETED
@@ -1,64 +0,0 @@
1
- import { useState as i, useRef as l, useEffect as f } from "react";
2
- const a = {}, y = (t, s = {}) => {
3
- const n = document.querySelector(`script[src="${t}"]`);
4
- if (!n) {
5
- const e = document.createElement("script");
6
- return e.src = t, Object.keys(s).forEach((r) => {
7
- e[r] = s[r];
8
- }), e.setAttribute("data-status", "loading"), document.body.appendChild(e), {
9
- ref: e,
10
- status: "loading"
11
- };
12
- }
13
- return {
14
- ref: n,
15
- status: n.getAttribute("data-status") || "ready"
16
- };
17
- }, E = (t, s = {}) => {
18
- const n = document.querySelector(`link[href="${t}"]`);
19
- if (!n) {
20
- const e = document.createElement("link");
21
- return e.rel = "stylesheet", e.href = t, Object.keys(s).forEach((u) => {
22
- e[u] = s[u];
23
- }), "hideFocus" in e && e.relList && (e.rel = "preload", e.as = "style"), e.setAttribute("data-status", "loading"), document.head.appendChild(e), {
24
- ref: e,
25
- status: "loading"
26
- };
27
- }
28
- return {
29
- ref: n,
30
- status: n.getAttribute("data-status") || "ready"
31
- };
32
- }, v = (t, s) => {
33
- const [n, e] = i(t ? "loading" : "unset"), r = l(void 0);
34
- return f(() => {
35
- if (!t) {
36
- e("unset");
37
- return;
38
- }
39
- const u = t.replace(/[|#].*$/, "");
40
- if (s?.type === "css" || !s?.type && /(^css!|\.css$)/.test(u)) {
41
- const c = E(t, s?.css);
42
- r.current = c.ref, e(c.status);
43
- } else if (s?.type === "js" || !s?.type && /(^js!|\.js$)/.test(u)) {
44
- const c = y(t, s?.js);
45
- r.current = c.ref, e(c.status);
46
- } else
47
- console.error(
48
- "Cannot infer the type of external resource, and please provide a type ('js' | 'css'). "
49
- );
50
- if (!r.current)
51
- return;
52
- a[t] === void 0 ? a[t] = 1 : a[t] += 1;
53
- const o = (c) => {
54
- const d = c.type === "load" ? "ready" : "error";
55
- r.current?.setAttribute("data-status", d), e(d);
56
- };
57
- return r.current.addEventListener("load", o), r.current.addEventListener("error", o), () => {
58
- r.current?.removeEventListener("load", o), r.current?.removeEventListener("error", o), a[t] -= 1, a[t] === 0 && !s?.keepWhenUnused && r.current?.remove(), r.current = void 0;
59
- };
60
- }, [t]), n;
61
- };
62
- export {
63
- v as u
64
- };