@vef-framework-react/shared 2.1.0

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.
Files changed (96) hide show
  1. package/README +15 -0
  2. package/dist/cjs/_internal/_rolldown/runtime.cjs +1 -0
  3. package/dist/cjs/color/color-ops.cjs +1 -0
  4. package/dist/cjs/color/index.cjs +1 -0
  5. package/dist/cjs/color/name.cjs +1 -0
  6. package/dist/cjs/color/palette.cjs +1 -0
  7. package/dist/cjs/constants/color-names.cjs +1 -0
  8. package/dist/cjs/constants/color-palettes.cjs +1 -0
  9. package/dist/cjs/constants/index.cjs +1 -0
  10. package/dist/cjs/index.cjs +1 -0
  11. package/dist/cjs/types/color.cjs +0 -0
  12. package/dist/cjs/types/common.cjs +0 -0
  13. package/dist/cjs/types/deep-keys.cjs +0 -0
  14. package/dist/cjs/types/index.cjs +0 -0
  15. package/dist/cjs/utils/chrono.cjs +1 -0
  16. package/dist/cjs/utils/equal.cjs +1 -0
  17. package/dist/cjs/utils/error.cjs +2 -0
  18. package/dist/cjs/utils/event.cjs +1 -0
  19. package/dist/cjs/utils/format.cjs +1 -0
  20. package/dist/cjs/utils/function.cjs +1 -0
  21. package/dist/cjs/utils/id.cjs +1 -0
  22. package/dist/cjs/utils/index.cjs +1 -0
  23. package/dist/cjs/utils/key.cjs +1 -0
  24. package/dist/cjs/utils/lib.cjs +1 -0
  25. package/dist/cjs/utils/object.cjs +1 -0
  26. package/dist/cjs/utils/path.cjs +1 -0
  27. package/dist/cjs/utils/pinyin.cjs +1 -0
  28. package/dist/cjs/utils/security.cjs +1 -0
  29. package/dist/cjs/utils/string.cjs +1 -0
  30. package/dist/cjs/utils/table.cjs +1 -0
  31. package/dist/cjs/utils/task.cjs +1 -0
  32. package/dist/cjs/utils/tree.cjs +1 -0
  33. package/dist/cjs/utils/zod.cjs +1 -0
  34. package/dist/es/color/color-ops.js +55 -0
  35. package/dist/es/color/index.js +4 -0
  36. package/dist/es/color/name.js +30 -0
  37. package/dist/es/color/palette.js +77 -0
  38. package/dist/es/constants/color-names.js +1572 -0
  39. package/dist/es/constants/color-palettes.js +1085 -0
  40. package/dist/es/constants/index.js +3 -0
  41. package/dist/es/index.js +25 -0
  42. package/dist/es/types/color.js +1 -0
  43. package/dist/es/types/common.js +1 -0
  44. package/dist/es/types/deep-keys.js +1 -0
  45. package/dist/es/types/index.js +1 -0
  46. package/dist/es/utils/chrono.js +89 -0
  47. package/dist/es/utils/equal.js +85 -0
  48. package/dist/es/utils/error.js +34 -0
  49. package/dist/es/utils/event.js +28 -0
  50. package/dist/es/utils/format.js +29 -0
  51. package/dist/es/utils/function.js +31 -0
  52. package/dist/es/utils/id.js +25 -0
  53. package/dist/es/utils/index.js +19 -0
  54. package/dist/es/utils/key.js +18 -0
  55. package/dist/es/utils/lib.js +8 -0
  56. package/dist/es/utils/object.js +13 -0
  57. package/dist/es/utils/path.js +37 -0
  58. package/dist/es/utils/pinyin.js +44 -0
  59. package/dist/es/utils/security.js +73 -0
  60. package/dist/es/utils/string.js +20 -0
  61. package/dist/es/utils/table.js +15 -0
  62. package/dist/es/utils/task.js +7 -0
  63. package/dist/es/utils/tree.js +167 -0
  64. package/dist/es/utils/zod.js +7 -0
  65. package/dist/types/src/color/color-ops.d.ts +84 -0
  66. package/dist/types/src/color/index.d.ts +3 -0
  67. package/dist/types/src/color/name.d.ts +7 -0
  68. package/dist/types/src/color/palette.d.ts +8 -0
  69. package/dist/types/src/constants/color-names.d.ts +11 -0
  70. package/dist/types/src/constants/color-palettes.d.ts +823 -0
  71. package/dist/types/src/constants/index.d.ts +2 -0
  72. package/dist/types/src/index.d.ts +4 -0
  73. package/dist/types/src/types/color.d.ts +25 -0
  74. package/dist/types/src/types/common.d.ts +29 -0
  75. package/dist/types/src/types/deep-keys.d.ts +37 -0
  76. package/dist/types/src/types/index.d.ts +3 -0
  77. package/dist/types/src/utils/chrono.d.ts +152 -0
  78. package/dist/types/src/utils/equal.d.ts +16 -0
  79. package/dist/types/src/utils/error.d.ts +22 -0
  80. package/dist/types/src/utils/event.d.ts +46 -0
  81. package/dist/types/src/utils/format.d.ts +31 -0
  82. package/dist/types/src/utils/function.d.ts +27 -0
  83. package/dist/types/src/utils/id.d.ts +6 -0
  84. package/dist/types/src/utils/index.d.ts +18 -0
  85. package/dist/types/src/utils/key.d.ts +5 -0
  86. package/dist/types/src/utils/lib.d.ts +5 -0
  87. package/dist/types/src/utils/object.d.ts +9 -0
  88. package/dist/types/src/utils/path.d.ts +13 -0
  89. package/dist/types/src/utils/pinyin.d.ts +40 -0
  90. package/dist/types/src/utils/security.d.ts +60 -0
  91. package/dist/types/src/utils/string.d.ts +15 -0
  92. package/dist/types/src/utils/table.d.ts +25 -0
  93. package/dist/types/src/utils/task.d.ts +4 -0
  94. package/dist/types/src/utils/tree.d.ts +216 -0
  95. package/dist/types/src/utils/zod.d.ts +2 -0
  96. package/package.json +74 -0
@@ -0,0 +1,3 @@
1
+ /*! @vef-framework-react/shared v2.1.0 made by Venus | 2026-03-27T08:01:38.947Z */
2
+ import "./color-names.js";
3
+ import "./color-palettes.js";
@@ -0,0 +1,25 @@
1
+ /*! @vef-framework-react/shared v2.1.0 made by Venus | 2026-03-27T08:01:38.947Z */
2
+ import { convertHslToHex as e, convertTransparentToOpaque as t, getColorDifference as n, isValidColor as r, isWhiteColor as i, mixColor as a, setColorAlpha as o, toHexColor as s, toHslColor as c, toHsvColor as l, toRgbColor as u } from "./color/color-ops.js";
3
+ import { colorEntries as d, colorNameMap as f } from "./constants/color-names.js";
4
+ import { DEFAULT_DATETIME_FORMAT as p, DEFAULT_DATE_FORMAT as m, DEFAULT_TIME_FORMAT as h, LOCALIZED_DATETIME_FORMAT as g, LOCALIZED_DATE_FORMAT as _, formatDate as v, formatDuration as y, getLocalizedDateTime as b, getNow as x, getNowDateString as S, getNowDateTimeString as C, getNowTimeString as w, getTemporalFormats as T, parseDate as E, tryParseDate as D } from "./utils/chrono.js";
5
+ import { isDeepEqual as O, isShallowEqual as k } from "./utils/equal.js";
6
+ import { formatPath as A, getBaseName as j, getDirName as M, getExtName as N, getRelativePath as P, isAbsolutePath as F, joinPaths as I, normalizePath as L, parsePath as R, pathSeparator as z, resolvePath as B } from "./utils/path.js";
7
+ import { filterUserFrame as V, getCurrentStack as H, getCurrentStackSync as U, getSanitizedErrorStack as W, parseErrorStack as G } from "./utils/error.js";
8
+ import { EventEmitter as K, createEventEmitter as q } from "./utils/event.js";
9
+ import { formatBytes as J, formatNumber as Y } from "./utils/format.js";
10
+ import { createThrowNotImplementedFn as X, identity as Z, invokeAwaitableFn as Q, isAsyncFunction as $, throwNotImplemented as ee } from "./utils/function.js";
11
+ import { generateId as te } from "./utils/id.js";
12
+ import { always as ne, alwaysFalse as re, alwaysTrue as ie, assign as ae, camelCase as oe, capitalize as se, cloneDeep as ce, cluster as le, debounce as ue, decodeQueryString as de, encodeQueryString as fe, first as pe, get as me, isArray as he, isBigInt as ge, isBoolean as _e, isDate as ve, isEmpty as ye, isError as be, isFloat as xe, isFunction as Se, isInt as Ce, isIntString as we, isMap as Te, isNullish as Ee, isNumber as De, isObject as Oe, isPlainObject as ke, isPrimitive as Ae, isPromise as je, isRegExp as Me, isSet as Ne, isString as Pe, isSymbol as Fe, isUndefined as Ie, isWeakMap as Le, isWeakSet as Re, kebabCase as ze, last as Be, max as Ve, memoize as He, min as Ue, noop as We, omit as Ge, once as Ke, pascalCase as qe, pick as Je, set as Ye, similarity as Xe, snakeCase as Ze, sum as Qe, template as $e, throttle as et, toFloat as tt, toInt as nt, trim as rt, unique as it } from "./utils/lib.js";
13
+ import { hashKey as at } from "./utils/key.js";
14
+ import { mergeWith as ot } from "./utils/object.js";
15
+ import { getPinyin as st, getPinyinInitials as ct, withPinyin as lt } from "./utils/pinyin.js";
16
+ import { decryptUsingRSA as ut, encryptUsingRSA as dt, obfuscateDecode as ft, obfuscateDecodeFromBase64 as pt, obfuscateDecodeFromHex as mt, obfuscateEncode as ht, obfuscateEncodeToBase64 as gt, obfuscateEncodeToHex as _t } from "./utils/security.js";
17
+ import { constantCase as vt, stringify as yt } from "./utils/string.js";
18
+ import { shouldUpdateByKeys as bt } from "./utils/table.js";
19
+ import { scheduleMicrotask as xt } from "./utils/task.js";
20
+ import { buildTree as St, filterTree as Ct, filterTreeWithAncestors as wt, findNodeInTree as Tt, flattenTree as Et, mapTree as Dt, traverseTree as Ot } from "./utils/tree.js";
21
+ import { z as kt } from "./utils/zod.js";
22
+ import { colorPaletteMap as At, colorPalettes as jt } from "./constants/color-palettes.js";
23
+ import { getColorName as Mt } from "./color/name.js";
24
+ import { getColorPalette as Nt } from "./color/palette.js";
25
+ export { p as DEFAULT_DATETIME_FORMAT, m as DEFAULT_DATE_FORMAT, h as DEFAULT_TIME_FORMAT, K as EventEmitter, g as LOCALIZED_DATETIME_FORMAT, _ as LOCALIZED_DATE_FORMAT, ne as always, re as alwaysFalse, ie as alwaysTrue, ae as assign, St as buildTree, oe as camelCase, se as capitalize, ce as cloneDeep, le as cluster, d as colorEntries, f as colorNameMap, At as colorPaletteMap, jt as colorPalettes, vt as constantCase, e as convertHslToHex, t as convertTransparentToOpaque, q as createEventEmitter, X as createThrowNotImplementedFn, ue as debounce, de as decodeQueryString, ut as decryptUsingRSA, fe as encodeQueryString, dt as encryptUsingRSA, Ct as filterTree, wt as filterTreeWithAncestors, V as filterUserFrame, Tt as findNodeInTree, pe as first, Et as flattenTree, J as formatBytes, v as formatDate, y as formatDuration, Y as formatNumber, A as formatPath, te as generateId, me as get, j as getBaseName, n as getColorDifference, Mt as getColorName, Nt as getColorPalette, H as getCurrentStack, U as getCurrentStackSync, M as getDirName, N as getExtName, b as getLocalizedDateTime, x as getNow, S as getNowDateString, C as getNowDateTimeString, w as getNowTimeString, st as getPinyin, ct as getPinyinInitials, P as getRelativePath, W as getSanitizedErrorStack, T as getTemporalFormats, at as hashKey, Z as identity, Q as invokeAwaitableFn, F as isAbsolutePath, he as isArray, $ as isAsyncFunction, ge as isBigInt, _e as isBoolean, ve as isDate, O as isDeepEqual, ye as isEmpty, be as isError, xe as isFloat, Se as isFunction, Ce as isInt, we as isIntString, Te as isMap, Ee as isNullish, De as isNumber, Oe as isObject, ke as isPlainObject, Ae as isPrimitive, je as isPromise, Me as isRegExp, Ne as isSet, k as isShallowEqual, Pe as isString, Fe as isSymbol, Ie as isUndefined, r as isValidColor, Le as isWeakMap, Re as isWeakSet, i as isWhiteColor, I as joinPaths, ze as kebabCase, Be as last, Dt as mapTree, Ve as max, He as memoize, ot as mergeWith, Ue as min, a as mixColor, We as noop, L as normalizePath, ft as obfuscateDecode, pt as obfuscateDecodeFromBase64, mt as obfuscateDecodeFromHex, ht as obfuscateEncode, gt as obfuscateEncodeToBase64, _t as obfuscateEncodeToHex, Ge as omit, Ke as once, E as parseDate, G as parseErrorStack, R as parsePath, qe as pascalCase, z as pathSeparator, Je as pick, B as resolvePath, xt as scheduleMicrotask, Ye as set, o as setColorAlpha, bt as shouldUpdateByKeys, Xe as similarity, Ze as snakeCase, yt as stringify, Qe as sum, $e as template, et as throttle, ee as throwNotImplemented, tt as toFloat, s as toHexColor, c as toHslColor, l as toHsvColor, nt as toInt, u as toRgbColor, Ot as traverseTree, rt as trim, D as tryParseDate, it as unique, lt as withPinyin, kt as z };
@@ -0,0 +1 @@
1
+ /*! @vef-framework-react/shared v2.1.0 made by Venus | 2026-03-27T08:01:38.947Z */
@@ -0,0 +1 @@
1
+ /*! @vef-framework-react/shared v2.1.0 made by Venus | 2026-03-27T08:01:38.947Z */
@@ -0,0 +1 @@
1
+ /*! @vef-framework-react/shared v2.1.0 made by Venus | 2026-03-27T08:01:38.947Z */
@@ -0,0 +1 @@
1
+ /*! @vef-framework-react/shared v2.1.0 made by Venus | 2026-03-27T08:01:38.947Z */
@@ -0,0 +1,89 @@
1
+ /*! @vef-framework-react/shared v2.1.0 made by Venus | 2026-03-27T08:01:38.947Z */
2
+ import e from "dayjs";
3
+ import t from "dayjs/locale/zh-cn";
4
+ import n from "dayjs/plugin/customParseFormat";
5
+ import r from "dayjs/plugin/duration";
6
+ import i from "dayjs/plugin/localizedFormat";
7
+ import a from "dayjs/plugin/relativeTime";
8
+ e.locale(t), e.extend(i), e.extend(n), e.extend(r), e.extend(a);
9
+ var o = "YYYY-MM-DD", s = "HH:mm:ss", c = "YYYY-MM-DD HH:mm:ss", l = "LLLL", u = "LLdddd", d = ["YYYY"], f = ["YYYY-Q季度"], p = [
10
+ "YYYY-MM",
11
+ "YYYY/MM",
12
+ "YYYY.MM",
13
+ "YYYYMM"
14
+ ], m = ["YYYY-wo"], h = [
15
+ "YYYY-MM-DD",
16
+ "YYYY/MM/DD",
17
+ "YYYY.MM.DD",
18
+ "YYYYMMDD",
19
+ "YY/MM/DD",
20
+ "YY.MM.DD",
21
+ "YYMMDD"
22
+ ], g = [
23
+ "HH:mm:ss",
24
+ "HH.mm.ss",
25
+ "HHmmss"
26
+ ], _ = ["HH"], v = [
27
+ "HH:mm",
28
+ "HH.mm",
29
+ "HHmm"
30
+ ], y = [
31
+ "YYYY-MM-DD HH:mm:ss",
32
+ "YYYY/MM/DD HH:mm:ss",
33
+ "YYYY.MM.DD HH.mm.ss",
34
+ "YYYYMMDDHHmmss",
35
+ "YY/MM/DD HH:mm:ss",
36
+ "YY.MM.DD HH:mm:ss",
37
+ "YY.MM.DD HH.mm.ss",
38
+ "YYMMDDHHmmss"
39
+ ];
40
+ function b(t, n = "seconds") {
41
+ let r = e.duration(t, n), i = Math.floor(r.asDays()), a = r.hours(), o = r.minutes();
42
+ return i > 0 ? `${i}天${a}小时${o}分钟` : a > 0 ? `${a}小时${o}分钟` : `${o}分钟`;
43
+ }
44
+ function x(t, n = c) {
45
+ return t instanceof Date ? e(t) : n ? e(t, n) : e(t);
46
+ }
47
+ function S(t) {
48
+ let n = [...y, ...h];
49
+ for (let r of n) {
50
+ let n = e(t, r, !0);
51
+ if (n.isValid()) return n;
52
+ }
53
+ let r = e(t);
54
+ return r.isValid() ? r : null;
55
+ }
56
+ function C(e, t = c) {
57
+ return e.format(t);
58
+ }
59
+ function w() {
60
+ return e();
61
+ }
62
+ function T() {
63
+ return e().format(o);
64
+ }
65
+ function E() {
66
+ return e().format(s);
67
+ }
68
+ function D() {
69
+ return e().format(c);
70
+ }
71
+ function O(t = !0) {
72
+ return e().format(t ? l : u);
73
+ }
74
+ var k = {
75
+ year: d,
76
+ quarter: f,
77
+ month: p,
78
+ week: m,
79
+ date: h,
80
+ time: g,
81
+ hour: _,
82
+ minute: v,
83
+ datetime: y
84
+ };
85
+ function A(e) {
86
+ return k[e];
87
+ }
88
+ //#endregion
89
+ export { c as DEFAULT_DATETIME_FORMAT, o as DEFAULT_DATE_FORMAT, s as DEFAULT_TIME_FORMAT, l as LOCALIZED_DATETIME_FORMAT, u as LOCALIZED_DATE_FORMAT, C as formatDate, b as formatDuration, O as getLocalizedDateTime, w as getNow, T as getNowDateString, D as getNowDateTimeString, E as getNowTimeString, A as getTemporalFormats, x as parseDate, S as tryParseDate };
@@ -0,0 +1,85 @@
1
+ /*! @vef-framework-react/shared v2.1.0 made by Venus | 2026-03-27T08:01:38.947Z */
2
+ //#region src/utils/equal.ts
3
+ function e(e, t) {
4
+ if (Object.is(e, t)) return !0;
5
+ if (typeof e != "object" || !e || typeof t != "object" || !t) return !1;
6
+ if (e instanceof Map && t instanceof Map) {
7
+ if (e.size !== t.size) return !1;
8
+ for (let [n, r] of e) if (!t.has(n) || !Object.is(r, t.get(n))) return !1;
9
+ return !0;
10
+ }
11
+ if (e instanceof Set && t instanceof Set) {
12
+ if (e.size !== t.size) return !1;
13
+ for (let n of e) if (!t.has(n)) return !1;
14
+ return !0;
15
+ }
16
+ if (Array.isArray(e) !== Array.isArray(t) || e.constructor !== t.constructor) return !1;
17
+ let n = Object.keys(e), r = Object.keys(t);
18
+ if (n.length !== r.length) return !1;
19
+ for (let r of n) if (!Object.hasOwn(t, r) || !Object.is(e[r], t[r])) return !1;
20
+ return !0;
21
+ }
22
+ function t(e, t) {
23
+ let { valueOf: n, toString: r } = Object.prototype, i = /* @__PURE__ */ new WeakMap(), a = (e, t) => {
24
+ if (e === t) return !0;
25
+ if (typeof e != "object" || typeof t != "object" || !e || !t) return e !== e && t !== t;
26
+ if (Object.getPrototypeOf(e) !== Object.getPrototypeOf(t)) return !1;
27
+ let { constructor: o } = e;
28
+ if (o === Date) return e.getTime() === t.getTime();
29
+ if (o === RegExp) {
30
+ let n = e, r = t;
31
+ return n.source === r.source && n.flags === r.flags;
32
+ }
33
+ if (o === Set) {
34
+ let n = e, r = t;
35
+ if (n.size !== r.size) return !1;
36
+ for (let e of n) {
37
+ let t = !1;
38
+ for (let n of r) if (a(e, n)) {
39
+ t = !0;
40
+ break;
41
+ }
42
+ if (!t) return !1;
43
+ }
44
+ return !0;
45
+ }
46
+ if (o === ArrayBuffer) return a(new DataView(e), new DataView(t));
47
+ if (o === DataView || ArrayBuffer.isView(e)) {
48
+ let n, r;
49
+ if (o === DataView) n = e, r = t;
50
+ else {
51
+ let i = e, a = t;
52
+ n = new DataView(i.buffer, i.byteOffset, i.byteLength), r = new DataView(a.buffer, a.byteOffset, a.byteLength);
53
+ }
54
+ if (n.byteLength !== r.byteLength) return !1;
55
+ for (let e = n.byteLength; e-- !== 0;) if (n.getUint8(e) !== r.getUint8(e)) return !1;
56
+ return !0;
57
+ }
58
+ if (i.has(e) && i.get(e) === t) return !0;
59
+ if (i.set(e, t), o === Array) {
60
+ let n = e, r = t;
61
+ if (n.length !== r.length) return !1;
62
+ for (let e = n.length; e-- !== 0;) if (!a(n[e], r[e])) return !1;
63
+ return !0;
64
+ }
65
+ if (o === Map) {
66
+ let n = e, r = t;
67
+ if (n.size !== r.size) return !1;
68
+ for (let [e, t] of n) if (!r.has(e) || !a(t, r.get(e))) return !1;
69
+ return !0;
70
+ }
71
+ let s = e, c = t;
72
+ if (s.valueOf !== n && typeof s.valueOf == "function" && typeof c.valueOf == "function") return s.valueOf() === c.valueOf();
73
+ if (s.toString !== r && typeof s.toString == "function" && typeof c.toString == "function") return s.toString() === c.toString();
74
+ let l = Object.keys(e), u = Object.keys(t);
75
+ if (l.length !== u.length) return !1;
76
+ for (let e = l.length; e-- !== 0;) {
77
+ let n = l[e];
78
+ if (!Object.hasOwn(t, n) || !a(s[n], c[n])) return !1;
79
+ }
80
+ return !0;
81
+ };
82
+ return a(e, t);
83
+ }
84
+ //#endregion
85
+ export { t as isDeepEqual, e as isShallowEqual };
@@ -0,0 +1,34 @@
1
+ /*! @vef-framework-react/shared v2.1.0 made by Venus | 2026-03-27T08:01:38.947Z */
2
+ import { getBaseName as e } from "./path.js";
3
+ import * as t from "stacktrace-js";
4
+ //#region src/utils/error.ts
5
+ function n(e, n) {
6
+ return t.fromError(e, {
7
+ offline: !0,
8
+ filter: n
9
+ });
10
+ }
11
+ function r(e) {
12
+ return !e.fileName || !e.fileName.includes("node_modules");
13
+ }
14
+ function i(t) {
15
+ return ` at ${t.functionName || "anonymous"} (${`${t.fileName ? e(t.fileName, !0) : "unknown"}:${t.lineNumber}:${t.columnNumber}`})`;
16
+ }
17
+ async function a(e) {
18
+ let t = (await n(e, r)).map((e) => i(e)).join("\n");
19
+ return `${e.name}: ${e.message}\n${t}`;
20
+ }
21
+ function o(e) {
22
+ return t.get({
23
+ offline: !0,
24
+ filter: e
25
+ });
26
+ }
27
+ function s(e) {
28
+ return t.getSync({
29
+ offline: !0,
30
+ filter: e
31
+ });
32
+ }
33
+ //#endregion
34
+ export { r as filterUserFrame, o as getCurrentStack, s as getCurrentStackSync, a as getSanitizedErrorStack, n as parseErrorStack };
@@ -0,0 +1,28 @@
1
+ /*! @vef-framework-react/shared v2.1.0 made by Venus | 2026-03-27T08:01:38.947Z */
2
+ import e from "mitt";
3
+ //#region src/utils/event.ts
4
+ var t = class {
5
+ #e = e();
6
+ on(e, t) {
7
+ return this.#e.on(e, t), () => {
8
+ this.#e.off(e, t);
9
+ };
10
+ }
11
+ emit(e, t) {
12
+ t === void 0 ? this.#e.emit(e) : this.#e.emit(e, t);
13
+ }
14
+ off(e, t) {
15
+ this.#e.off(e, t);
16
+ }
17
+ clear() {
18
+ this.#e.all.clear();
19
+ }
20
+ getAllListeners() {
21
+ return this.#e.all;
22
+ }
23
+ };
24
+ function n() {
25
+ return new t();
26
+ }
27
+ //#endregion
28
+ export { t as EventEmitter, n as createEventEmitter };
@@ -0,0 +1,29 @@
1
+ /*! @vef-framework-react/shared v2.1.0 made by Venus | 2026-03-27T08:01:38.947Z */
2
+ //#region src/utils/format.ts
3
+ var e = 1024, t = [
4
+ "B",
5
+ "KB",
6
+ "MB",
7
+ "GB",
8
+ "TB",
9
+ "PB"
10
+ ], n = 1e3, r = [
11
+ "",
12
+ "K",
13
+ "M",
14
+ "B",
15
+ "T"
16
+ ], i = Math.log(e), a = Math.log(n);
17
+ function o(n, r = 2) {
18
+ if (n === 0) return "0 B";
19
+ let a = Math.max(r, 0), o = Math.floor(Math.log(n) / i);
20
+ return `${Number.parseFloat((n / e ** o).toFixed(a))} ${t[o]}`;
21
+ }
22
+ function s(e, t = 2) {
23
+ if (e === 0) return "0";
24
+ if (e < n) return e.toString();
25
+ let i = Math.max(t, 0), o = Math.floor(Math.log(e) / a);
26
+ return `${Number.parseFloat((e / n ** o).toFixed(i))} ${r[o]}`;
27
+ }
28
+ //#endregion
29
+ export { o as formatBytes, s as formatNumber };
@@ -0,0 +1,31 @@
1
+ /*! @vef-framework-react/shared v2.1.0 made by Venus | 2026-03-27T08:01:38.947Z */
2
+ //#region src/utils/function.ts
3
+ function e(e) {
4
+ let t = e.constructor.name;
5
+ return t === "AsyncFunction" || t === "AsyncGeneratorFunction";
6
+ }
7
+ async function t(e, t, n) {
8
+ let { onInvoke: r, onSuccess: i, onError: a, onFinally: o } = n, s = e(...t);
9
+ if (!(s instanceof Promise)) return s;
10
+ let c = r?.();
11
+ try {
12
+ let e = await s;
13
+ return i?.(e, c), e;
14
+ } catch (e) {
15
+ throw a?.(e, c), e;
16
+ } finally {
17
+ o?.(c);
18
+ }
19
+ }
20
+ function n(e) {
21
+ return e;
22
+ }
23
+ function r(e) {
24
+ return () => i(e);
25
+ }
26
+ function i(e) {
27
+ let t = e ? `${e} not implemented` : "Not implemented";
28
+ throw Error(t);
29
+ }
30
+ //#endregion
31
+ export { r as createThrowNotImplementedFn, n as identity, t as invokeAwaitableFn, e as isAsyncFunction, i as throwNotImplemented };
@@ -0,0 +1,25 @@
1
+ /*! @vef-framework-react/shared v2.1.0 made by Venus | 2026-03-27T08:01:38.947Z */
2
+ import { init as e } from "@paralleldrive/cuid2";
3
+ import { isNullish as t } from "radashi";
4
+ //#region src/utils/id.ts
5
+ var n = "0cd902ccad1f26c27b8db84af2282b7b", r = 16;
6
+ function i() {
7
+ return !t(navigator) && !navigator.userAgent.includes("jsdom");
8
+ }
9
+ var a = e({
10
+ length: r,
11
+ fingerprint: n
12
+ });
13
+ i() && import("@fingerprintjs/fingerprintjs").then(({ load: e }) => e()).then((e) => e.get()).then((t) => {
14
+ a = e({
15
+ length: r,
16
+ fingerprint: t.visitorId
17
+ });
18
+ }).catch((e) => {
19
+ console.error("Failed to initialize fingerprint:", e);
20
+ });
21
+ function o() {
22
+ return a();
23
+ }
24
+ //#endregion
25
+ export { o as generateId };
@@ -0,0 +1,19 @@
1
+ /*! @vef-framework-react/shared v2.1.0 made by Venus | 2026-03-27T08:01:38.947Z */
2
+ import "./chrono.js";
3
+ import "./equal.js";
4
+ import "./path.js";
5
+ import "./error.js";
6
+ import "./event.js";
7
+ import "./format.js";
8
+ import "./function.js";
9
+ import "./id.js";
10
+ import "./lib.js";
11
+ import "./key.js";
12
+ import "./object.js";
13
+ import "./pinyin.js";
14
+ import "./security.js";
15
+ import "./string.js";
16
+ import "./table.js";
17
+ import "./task.js";
18
+ import "./tree.js";
19
+ import "./zod.js";
@@ -0,0 +1,18 @@
1
+ /*! @vef-framework-react/shared v2.1.0 made by Venus | 2026-03-27T08:01:38.947Z */
2
+ import { isPlainObject as e } from "./lib.js";
3
+ //#region src/utils/key.ts
4
+ function t(e) {
5
+ let t = {}, n = Object.keys(e).toSorted(), r = Object.getOwnPropertySymbols(e);
6
+ for (let r of n) t[r] = e[r];
7
+ let i = r.map((t) => ({
8
+ key: t.toString(),
9
+ value: e[t]
10
+ })).toSorted((e, t) => e.key.localeCompare(t.key));
11
+ for (let { key: e, value: n } of i) t[`@@${e}`] = n;
12
+ return t;
13
+ }
14
+ function n(n) {
15
+ return JSON.stringify(n, (n, r) => e(r) ? t(r) : r);
16
+ }
17
+ //#endregion
18
+ export { n as hashKey };
@@ -0,0 +1,8 @@
1
+ /*! @vef-framework-react/shared v2.1.0 made by Venus | 2026-03-27T08:01:38.947Z */
2
+ import { always as e, always as t, assign as n, camel as r, capitalize as i, cluster as a, dash as o, debounce as s, first as c, get as l, isArray as u, isBigInt as d, isBoolean as f, isDate as p, isEmpty as m, isError as h, isFloat as g, isFunction as _, isInt as v, isIntString as y, isMap as b, isNullish as x, isNumber as S, isObject as C, isPlainObject as w, isPrimitive as T, isPromise as E, isRegExp as D, isSet as O, isString as k, isSymbol as A, isUndefined as j, isWeakMap as M, isWeakSet as N, last as P, max as F, memo as I, min as L, noop as R, omit as z, once as B, pascal as V, pick as H, set as U, similarity as W, snake as G, sum as K, template as q, throttle as J, toFloat as Y, toInt as X, trim as Z, unique as Q } from "radashi";
3
+ import { klona as $ } from "klona";
4
+ import { parse as ee, stringify as te } from "qs";
5
+ //#region src/utils/lib.ts
6
+ var ne = e(!0), re = e(!1);
7
+ //#endregion
8
+ export { t as always, re as alwaysFalse, ne as alwaysTrue, n as assign, r as camelCase, i as capitalize, $ as cloneDeep, a as cluster, s as debounce, ee as decodeQueryString, te as encodeQueryString, c as first, l as get, u as isArray, d as isBigInt, f as isBoolean, p as isDate, m as isEmpty, h as isError, g as isFloat, _ as isFunction, v as isInt, y as isIntString, b as isMap, x as isNullish, S as isNumber, C as isObject, w as isPlainObject, T as isPrimitive, E as isPromise, D as isRegExp, O as isSet, k as isString, A as isSymbol, j as isUndefined, M as isWeakMap, N as isWeakSet, o as kebabCase, P as last, F as max, I as memoize, L as min, R as noop, z as omit, B as once, V as pascalCase, H as pick, U as set, W as similarity, G as snakeCase, K as sum, q as template, J as throttle, Y as toFloat, X as toInt, Z as trim, Q as unique };
@@ -0,0 +1,13 @@
1
+ /*! @vef-framework-react/shared v2.1.0 made by Venus | 2026-03-27T08:01:38.947Z */
2
+ import { isUndefined as e } from "./lib.js";
3
+ //#region src/utils/object.ts
4
+ function t(t, n, r = !1) {
5
+ for (let [i, a] of Object.entries(n)) {
6
+ if (e(a)) continue;
7
+ let n = i;
8
+ (r || e(t[n])) && (t[n] = a);
9
+ }
10
+ return t;
11
+ }
12
+ //#endregion
13
+ export { t as mergeWith };
@@ -0,0 +1,37 @@
1
+ /*! @vef-framework-react/shared v2.1.0 made by Venus | 2026-03-27T08:01:38.947Z */
2
+ import e from "path-browserify";
3
+ //#region src/utils/path.ts
4
+ function t(t, n = !0) {
5
+ let r = n ? void 0 : e.extname(t);
6
+ return e.basename(t, r);
7
+ }
8
+ function n(t) {
9
+ return e.extname(t);
10
+ }
11
+ function r(t) {
12
+ return e.dirname(t);
13
+ }
14
+ function i(...t) {
15
+ return e.join(...t);
16
+ }
17
+ function a(t) {
18
+ return e.isAbsolute(t);
19
+ }
20
+ function o(t) {
21
+ return e.normalize(t);
22
+ }
23
+ function s(t) {
24
+ return e.parse(t);
25
+ }
26
+ function c(t) {
27
+ return e.format(t);
28
+ }
29
+ function l(t, n) {
30
+ return e.relative(t, n);
31
+ }
32
+ function u(...t) {
33
+ return e.resolve(...t);
34
+ }
35
+ var d = e.sep;
36
+ //#endregion
37
+ export { c as formatPath, t as getBaseName, r as getDirName, n as getExtName, l as getRelativePath, a as isAbsolutePath, i as joinPaths, o as normalizePath, s as parsePath, d as pathSeparator, u as resolvePath };
@@ -0,0 +1,44 @@
1
+ /*! @vef-framework-react/shared v2.1.0 made by Venus | 2026-03-27T08:01:38.947Z */
2
+ import { isString as e } from "./lib.js";
3
+ import t from "@pinyin-pro/data/modern";
4
+ import { addDict as n, pinyin as r } from "pinyin-pro";
5
+ //#region src/utils/pinyin.ts
6
+ n(t);
7
+ var i = {
8
+ type: "array",
9
+ toneType: "none",
10
+ multiple: !1,
11
+ nonZh: "consecutive",
12
+ surname: "head"
13
+ }, a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
14
+ function s(e) {
15
+ let t = a.get(e);
16
+ if (t) return t;
17
+ let n = r(e, {
18
+ ...i,
19
+ pattern: "pinyin"
20
+ });
21
+ return a.set(e, n), n;
22
+ }
23
+ function c(e) {
24
+ let t = o.get(e);
25
+ if (t) return t;
26
+ let n = r(e, {
27
+ ...i,
28
+ pattern: "first"
29
+ });
30
+ return o.set(e, n), n;
31
+ }
32
+ function l(t, ...n) {
33
+ let r = { ...t };
34
+ for (let i of n) {
35
+ let n = t[i];
36
+ if (e(n)) {
37
+ let e = `${i}Pinyin`, t = `${i}PinyinInitials`;
38
+ r[e] = s(n).join(""), r[t] = c(n).join("");
39
+ }
40
+ }
41
+ return r;
42
+ }
43
+ //#endregion
44
+ export { s as getPinyin, c as getPinyinInitials, l as withPinyin };
@@ -0,0 +1,73 @@
1
+ /*! @vef-framework-react/shared v2.1.0 made by Venus | 2026-03-27T08:01:38.947Z */
2
+ import { isNullish as e } from "./lib.js";
3
+ import t from "jsencrypt";
4
+ //#region src/utils/security.ts
5
+ var n = new Uint8Array([
6
+ 90,
7
+ 75,
8
+ 60,
9
+ 45,
10
+ 30,
11
+ 15,
12
+ 154,
13
+ 139,
14
+ 124,
15
+ 109,
16
+ 94,
17
+ 79,
18
+ 58,
19
+ 43,
20
+ 28,
21
+ 13
22
+ ]);
23
+ function r(e) {
24
+ if (!e) return new Uint8Array();
25
+ let t = new TextEncoder().encode(e), r = new Uint8Array(t.length);
26
+ for (let [e, i] of t.entries()) r[e] = i ^ n[e % n.length];
27
+ return r;
28
+ }
29
+ function i(e) {
30
+ if (!e?.length) return "";
31
+ let t = e instanceof Uint8Array ? e : new Uint8Array(e), r = new Uint8Array(t.length);
32
+ for (let [e, i] of t.entries()) r[e] = i ^ n[e % n.length];
33
+ return new TextDecoder("utf-8").decode(r);
34
+ }
35
+ function a(e) {
36
+ return [...r(e)].map((e) => e.toString(16).padStart(2, "0")).join("");
37
+ }
38
+ function o(e) {
39
+ if (!e) return "";
40
+ let t = new Uint8Array(e.length / 2);
41
+ for (let n = 0; n < e.length; n += 2) t[n / 2] = Number.parseInt(e.slice(n, n + 2), 16);
42
+ return i(t);
43
+ }
44
+ function s(e) {
45
+ let t = r(e);
46
+ if (t.length === 0) return "";
47
+ let n = String.fromCodePoint(...t);
48
+ return btoa(n);
49
+ }
50
+ function c(e) {
51
+ if (!e) return "";
52
+ let t = atob(e), n = new Uint8Array(t.length);
53
+ for (let e = 0; e < t.length; e++) n[e] = t.codePointAt(e);
54
+ return i(n);
55
+ }
56
+ function l(n, r) {
57
+ if (e(n) || !r?.trim()) throw Error("Failed to encrypt data using RSA: invalid input");
58
+ let i = new t();
59
+ i.setPublicKey(r);
60
+ let a = i.encrypt(n);
61
+ if (!a) throw console.error("Failed to encrypt data using RSA"), Error("Failed to encrypt data using RSA");
62
+ return a;
63
+ }
64
+ function u(n, r) {
65
+ if (e(n) || !r?.trim()) throw Error("Failed to decrypt data using RSA: invalid input");
66
+ let i = new t();
67
+ i.setPrivateKey(r);
68
+ let a = i.decrypt(n);
69
+ if (!a) throw console.error("Failed to decrypt data using RSA"), Error("Failed to decrypt data using RSA");
70
+ return a;
71
+ }
72
+ //#endregion
73
+ export { u as decryptUsingRSA, l as encryptUsingRSA, i as obfuscateDecode, c as obfuscateDecodeFromBase64, o as obfuscateDecodeFromHex, r as obfuscateEncode, s as obfuscateEncodeToBase64, a as obfuscateEncodeToHex };
@@ -0,0 +1,20 @@
1
+ /*! @vef-framework-react/shared v2.1.0 made by Venus | 2026-03-27T08:01:38.947Z */
2
+ import { snakeCase as e } from "./lib.js";
3
+ //#region src/utils/string.ts
4
+ function t(t) {
5
+ return e(t).toUpperCase();
6
+ }
7
+ function n(e, t = !0) {
8
+ if (e === null) return t ? "" : "null";
9
+ if (e === void 0) return t ? "" : "undefined";
10
+ if (typeof e == "string") return e;
11
+ if (typeof e == "number" || typeof e == "boolean" || typeof e == "bigint") return String(e);
12
+ if (typeof e == "symbol" || typeof e == "function") return e.toString();
13
+ try {
14
+ return JSON.stringify(e);
15
+ } catch {
16
+ return String(e);
17
+ }
18
+ }
19
+ //#endregion
20
+ export { t as constantCase, n as stringify };
@@ -0,0 +1,15 @@
1
+ /*! @vef-framework-react/shared v2.1.0 made by Venus | 2026-03-27T08:01:38.947Z */
2
+ import { isDeepEqual as e, isShallowEqual as t } from "./equal.js";
3
+ import { isPlainObject as n } from "./lib.js";
4
+ //#region src/utils/table.ts
5
+ var r = {
6
+ reference: (e, t) => e === t,
7
+ shallow: t,
8
+ deep: e
9
+ };
10
+ function i(e, ...t) {
11
+ let i = n(e) && "compare" in e, a = i ? e : {}, o = i ? t : [e, ...t], s = r[a.compare ?? "reference"];
12
+ return (e, t) => o.some((n) => !s(e?.[n], t?.[n]));
13
+ }
14
+ //#endregion
15
+ export { i as shouldUpdateByKeys };
@@ -0,0 +1,7 @@
1
+ /*! @vef-framework-react/shared v2.1.0 made by Venus | 2026-03-27T08:01:38.947Z */
2
+ //#region src/utils/task.ts
3
+ function e(e) {
4
+ typeof queueMicrotask == "function" ? queueMicrotask(e) : Promise.resolve().then(e);
5
+ }
6
+ //#endregion
7
+ export { e as scheduleMicrotask };