@unicom-cloud/ui-common 0.1.22 → 0.1.24

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 (283) hide show
  1. package/.virtual/_rolldown/runtime.js +1 -1
  2. package/.vite/manifest.json +159 -23
  3. package/border-beam/BorderBeam.d.ts +4 -0
  4. package/border-beam/BorderBeam.js +45 -0
  5. package/border-beam/Effect.d.ts +9 -0
  6. package/border-beam/Effect.js +23 -0
  7. package/border-beam/constants.d.ts +2 -0
  8. package/border-beam/constants.js +131 -0
  9. package/border-beam/hooks/useBorderSize.d.ts +7 -0
  10. package/border-beam/hooks/useBorderSize.js +36 -0
  11. package/border-beam/hooks/useChildDom.d.ts +8 -0
  12. package/border-beam/hooks/useChildDom.js +17 -0
  13. package/border-beam/index.d.ts +6 -0
  14. package/border-beam/index.js +9 -0
  15. package/border-beam/interface.d.ts +31 -0
  16. package/border-beam/utils.d.ts +9 -0
  17. package/border-beam/utils.js +22 -0
  18. package/development/Development.js +20 -19
  19. package/development/index.d.ts +3 -1
  20. package/development/index.js +5 -4
  21. package/empty/Empty.js +18 -17
  22. package/empty/index.d.ts +3 -1
  23. package/empty/index.js +5 -4
  24. package/flex/Flex.js +20 -19
  25. package/flex/index.d.ts +1 -0
  26. package/flex/index.js +9 -5
  27. package/flex/interface.d.ts +2 -2
  28. package/flex/utils.js +1 -1
  29. package/higher-order/index.js +1 -1
  30. package/higher-order/with-speech-synthesis/index.d.ts +3 -1
  31. package/higher-order/with-speech-synthesis/index.js +5 -4
  32. package/higher-order/with-speech-synthesis/withSpeechSynthesis.d.ts +0 -3
  33. package/higher-order/with-speech-synthesis/withSpeechSynthesis.js +22 -22
  34. package/hooks/create-deep-compare-effect/index.js +1 -1
  35. package/hooks/create-update-effect/index.js +1 -1
  36. package/hooks/create-use-storage-state/index.js +1 -1
  37. package/hooks/index.js +1 -1
  38. package/hooks/use-async-effect/index.js +1 -1
  39. package/hooks/use-boolean/index.js +1 -1
  40. package/hooks/use-click-away/index.js +1 -1
  41. package/hooks/use-computed-state/index.js +1 -1
  42. package/hooks/use-controllable-value/index.d.ts +2 -0
  43. package/hooks/use-controllable-value/index.js +30 -15
  44. package/hooks/use-cookie-state/index.js +1 -1
  45. package/hooks/use-count-down/index.js +1 -1
  46. package/hooks/use-counter/index.js +1 -1
  47. package/hooks/use-create/index.js +1 -1
  48. package/hooks/use-creation/index.js +1 -1
  49. package/hooks/use-debounce/index.js +1 -1
  50. package/hooks/use-debounce-effect/index.js +1 -1
  51. package/hooks/use-debounce-fn/index.js +1 -1
  52. package/hooks/use-deep-compare-effect/index.js +1 -1
  53. package/hooks/use-deep-compare-layout-effect/index.js +1 -1
  54. package/hooks/use-document-visibility/index.js +1 -1
  55. package/hooks/use-drag/index.js +1 -1
  56. package/hooks/use-drop/index.js +1 -1
  57. package/hooks/use-effect-event/index.js +1 -1
  58. package/hooks/use-event/index.js +1 -1
  59. package/hooks/use-event-emitter/index.js +1 -1
  60. package/hooks/use-event-listener/index.js +1 -1
  61. package/hooks/use-event-target/index.js +1 -1
  62. package/hooks/use-external/index.js +1 -1
  63. package/hooks/use-favicon/index.js +1 -1
  64. package/hooks/use-focus-within/index.js +1 -1
  65. package/hooks/use-force-update/index.js +1 -1
  66. package/hooks/use-fullscreen/index.js +1 -1
  67. package/hooks/use-get-state/index.js +1 -1
  68. package/hooks/use-history-travel/index.js +1 -1
  69. package/hooks/use-hover/index.js +1 -1
  70. package/hooks/use-id/index.js +1 -1
  71. package/hooks/use-in-viewport/index.js +1 -1
  72. package/hooks/use-infinite-scroll/index.js +1 -1
  73. package/hooks/use-intersection-observer/index.js +1 -1
  74. package/hooks/use-intersection-observers/index.js +1 -1
  75. package/hooks/use-interval/index.js +1 -1
  76. package/hooks/use-is-first-render/index.js +1 -1
  77. package/hooks/use-isomorphic-layout-effect/index.js +1 -1
  78. package/hooks/use-key-press/index.js +1 -1
  79. package/hooks/use-keyboard-event/index.js +1 -1
  80. package/hooks/use-latest/index.js +1 -1
  81. package/hooks/use-listen-window-resize/index.js +1 -1
  82. package/hooks/use-local-storage-state/index.js +1 -1
  83. package/hooks/use-lock-fn/index.js +1 -1
  84. package/hooks/use-long-press/index.js +1 -1
  85. package/hooks/use-map/index.js +1 -1
  86. package/hooks/use-media/index.js +1 -1
  87. package/hooks/use-memo/index.js +1 -1
  88. package/hooks/use-memoized-fn/index.js +1 -1
  89. package/hooks/use-merge-props/index.js +1 -1
  90. package/hooks/use-merge-value/index.js +1 -1
  91. package/hooks/use-mobile/index.js +1 -1
  92. package/hooks/use-mount/index.js +1 -1
  93. package/hooks/use-mouse/index.js +1 -1
  94. package/hooks/use-move/index.js +8 -8
  95. package/hooks/use-mutation-observer/index.js +1 -1
  96. package/hooks/use-mutation-observers/index.js +1 -1
  97. package/hooks/use-network/index.js +16 -19
  98. package/hooks/use-online-status/index.js +1 -1
  99. package/hooks/use-overflow-hidden/index.js +1 -1
  100. package/hooks/use-override-ref/index.js +1 -1
  101. package/hooks/use-pagination/index.js +1 -1
  102. package/hooks/use-paste-image/index.d.ts +3 -1
  103. package/hooks/use-paste-image/index.js +16 -13
  104. package/hooks/use-persist-callback/index.js +1 -1
  105. package/hooks/use-prefers-color-scheme-dark/index.js +1 -1
  106. package/hooks/use-previous/index.js +1 -1
  107. package/hooks/use-raf-interval/index.js +1 -1
  108. package/hooks/use-raf-state/index.js +1 -1
  109. package/hooks/use-raf-timeout/index.js +1 -1
  110. package/hooks/use-reactive/index.js +1 -1
  111. package/hooks/use-ref-latest/index.js +1 -1
  112. package/hooks/use-refs/index.js +1 -1
  113. package/hooks/use-request/index.js +1 -1
  114. package/hooks/use-request/src/Fetch.js +1 -1
  115. package/hooks/use-request/src/plugins/useAutoRunPlugin.js +1 -1
  116. package/hooks/use-request/src/plugins/useCachePlugin.js +1 -1
  117. package/hooks/use-request/src/plugins/useDebouncePlugin.js +1 -1
  118. package/hooks/use-request/src/plugins/useLoadingDelayPlugin.js +1 -1
  119. package/hooks/use-request/src/plugins/usePollingPlugin.js +1 -1
  120. package/hooks/use-request/src/plugins/useRefreshOnWindowFocusPlugin.js +1 -1
  121. package/hooks/use-request/src/plugins/useRetryPlugin.js +1 -1
  122. package/hooks/use-request/src/plugins/useThrottlePlugin.js +1 -1
  123. package/hooks/use-request/src/useRequest.js +1 -1
  124. package/hooks/use-request/src/useRequestImplement.js +1 -1
  125. package/hooks/use-request/src/utils/cache.js +1 -1
  126. package/hooks/use-request/src/utils/cachePromise.js +1 -1
  127. package/hooks/use-request/src/utils/cacheSubscribe.js +1 -1
  128. package/hooks/use-request/src/utils/isDocumentVisible.js +1 -1
  129. package/hooks/use-request/src/utils/isOnline.js +1 -1
  130. package/hooks/use-request/src/utils/limit.js +1 -1
  131. package/hooks/use-request/src/utils/subscribeFocus.js +1 -1
  132. package/hooks/use-request/src/utils/subscribeReVisible.js +1 -1
  133. package/hooks/use-reset-state/index.js +1 -1
  134. package/hooks/use-resize-observer/index.js +1 -1
  135. package/hooks/use-resize-observers/index.js +1 -1
  136. package/hooks/use-responsive/index.js +1 -1
  137. package/hooks/use-safe-state/index.js +1 -1
  138. package/hooks/use-scroll/index.js +1 -1
  139. package/hooks/use-selections/index.js +1 -1
  140. package/hooks/use-session-storage-state/index.js +1 -1
  141. package/hooks/use-set/index.js +1 -1
  142. package/hooks/use-set-state/index.js +1 -1
  143. package/hooks/use-size/index.js +1 -1
  144. package/hooks/use-state-callback/index.js +1 -1
  145. package/hooks/use-state-with-promise/index.js +1 -1
  146. package/hooks/use-sync-state/index.js +1 -1
  147. package/hooks/use-text-selection/index.js +1 -1
  148. package/hooks/use-theme/index.js +10 -10
  149. package/hooks/use-throttle/index.js +1 -1
  150. package/hooks/use-throttle-effect/index.js +1 -1
  151. package/hooks/use-throttle-fn/index.js +1 -1
  152. package/hooks/use-timeout/index.js +1 -1
  153. package/hooks/use-title/index.js +1 -1
  154. package/hooks/use-toggle/index.js +1 -1
  155. package/hooks/use-tracked-effect/index.js +1 -1
  156. package/hooks/use-unmount/index.js +1 -1
  157. package/hooks/use-unmounted-ref/index.js +1 -1
  158. package/hooks/use-update/index.js +1 -1
  159. package/hooks/use-update-effect/index.js +1 -1
  160. package/hooks/use-update-layout-effect/index.js +1 -1
  161. package/hooks/use-url-state/index.js +1 -1
  162. package/hooks/use-virtual-list/index.js +1 -1
  163. package/hooks/use-watch/index.js +1 -1
  164. package/hooks/use-web-socket/index.js +29 -29
  165. package/hooks/use-why-did-you-update/index.js +1 -1
  166. package/hooks/use-window-size/index.js +1 -1
  167. package/hooks/utils/createEffectWithTarget.js +1 -1
  168. package/hooks/utils/depsAreSame.js +1 -1
  169. package/hooks/utils/depsEqual.js +1 -1
  170. package/hooks/utils/domTarget.js +1 -1
  171. package/hooks/utils/getDocumentOrShadow.js +1 -1
  172. package/hooks/utils/index.js +1 -1
  173. package/hooks/utils/isAppleDevice.js +1 -1
  174. package/hooks/utils/isBrowser.js +1 -1
  175. package/hooks/utils/isDev.js +1 -1
  176. package/hooks/utils/rect.js +1 -1
  177. package/hooks/utils/useDeepCompareWithTarget.js +1 -1
  178. package/hooks/utils/useEffectWithTarget.js +1 -1
  179. package/hooks/utils/useIsomorphicLayoutEffectWithTarget.js +1 -1
  180. package/hooks/utils/useLayoutEffectWithTarget.js +1 -1
  181. package/icons/file/IconFile.js +16 -15
  182. package/icons/file/index.d.ts +3 -1
  183. package/icons/file/index.js +5 -4
  184. package/index.js +607 -598
  185. package/package.json +1 -1
  186. package/progress/Progress.js +1 -1
  187. package/progress/index.d.ts +2 -0
  188. package/progress/index.js +5 -4
  189. package/resize-observer/Collection.js +1 -1
  190. package/resize-observer/ResizeObserver.js +11 -10
  191. package/resize-observer/SingleObserver.js +1 -1
  192. package/resize-observer/index.d.ts +2 -0
  193. package/resize-observer/index.js +11 -5
  194. package/resize-observer/observerUtil.js +1 -1
  195. package/space/Space.js +19 -18
  196. package/space/index.d.ts +1 -0
  197. package/space/index.js +8 -4
  198. package/style.css +1 -1
  199. package/suspense-fallback-test/SuspenseFallbackTest.js +10 -9
  200. package/suspense-fallback-test/index.d.ts +3 -1
  201. package/suspense-fallback-test/index.js +5 -4
  202. package/test.js +1 -1
  203. package/timer/Timer.js +16 -15
  204. package/timer/index.d.ts +3 -1
  205. package/timer/index.js +5 -4
  206. package/transition/Transition.js +41 -39
  207. package/transition/TransitionCSS.js +28 -27
  208. package/transition/TransitionGroup.js +31 -30
  209. package/transition/TransitionStyle.js +23 -22
  210. package/transition/constants.js +1 -1
  211. package/transition/context.js +1 -1
  212. package/transition/index.d.ts +5 -2
  213. package/transition/index.js +11 -10
  214. package/transition/utils.js +1 -1
  215. package/utils/callOrReturn.js +1 -1
  216. package/utils/callbackOriginRef.js +1 -1
  217. package/utils/caseName.js +1 -1
  218. package/utils/className.js +1 -1
  219. package/utils/constant.js +1 -1
  220. package/utils/copy.js +1 -1
  221. package/utils/date.js +1 -1
  222. package/utils/dayjs.js +1 -1
  223. package/utils/dom.d.ts +7 -2
  224. package/utils/dom.js +30 -17
  225. package/utils/emitter.js +1 -1
  226. package/utils/file.d.ts +1 -0
  227. package/utils/file.js +4 -0
  228. package/utils/fileRead.js +1 -1
  229. package/utils/fileToDataURL.js +1 -1
  230. package/utils/fillNBSP.js +1 -1
  231. package/utils/findRootElement.js +1 -1
  232. package/utils/findScrollParent.js +1 -1
  233. package/utils/getHighlightText.js +1 -1
  234. package/utils/getHotkeyHandler.js +1 -1
  235. package/utils/getScrollBarHeight.js +1 -1
  236. package/utils/getScrollBarSize.js +1 -1
  237. package/utils/getScrollBarWidth.js +1 -1
  238. package/utils/getStringLength.js +1 -1
  239. package/utils/include.js +1 -1
  240. package/utils/index.d.ts +2 -0
  241. package/utils/index.js +320 -310
  242. package/utils/intersectionObserver.js +1 -1
  243. package/utils/is.d.ts +5 -2
  244. package/utils/is.js +27 -19
  245. package/utils/keyboardCode.js +1 -1
  246. package/utils/lodash.js +1 -1
  247. package/utils/math.js +1 -1
  248. package/utils/mergeProps.js +1 -1
  249. package/utils/mergedToString.js +1 -1
  250. package/utils/mutationObserver.js +1 -1
  251. package/utils/names.d.ts +207 -0
  252. package/utils/names.js +110 -0
  253. package/utils/object.js +1 -1
  254. package/utils/omit.js +1 -1
  255. package/utils/pad.js +1 -1
  256. package/utils/pick.js +1 -1
  257. package/utils/pinyin.js +1 -1
  258. package/utils/react19Adapter.js +1 -1
  259. package/utils/reactNode.d.ts +7 -0
  260. package/utils/reactNode.js +14 -0
  261. package/utils/ref.d.ts +2 -2
  262. package/utils/ref.js +1 -1
  263. package/utils/resizeObserver.js +1 -1
  264. package/utils/saveAs.js +1 -1
  265. package/utils/screenfull.js +1 -1
  266. package/utils/scrollIntoViewIfNeeded.js +1 -1
  267. package/utils/setCreateRoot.js +1 -1
  268. package/utils/setDarkTheme.js +1 -1
  269. package/utils/setDir.js +1 -1
  270. package/utils/setPrimaryColor.js +1 -1
  271. package/utils/setTheme.js +1 -1
  272. package/utils/string.js +1 -1
  273. package/utils/style.js +1 -1
  274. package/utils/throttleByRaf.js +1 -1
  275. package/utils/throttleByRaf2.js +1 -1
  276. package/utils/tinycolor.js +1 -1
  277. package/utils/toArray.js +1 -1
  278. package/utils/tree.js +1 -1
  279. package/utils/tween.js +1 -1
  280. package/utils/uuid.js +1 -1
  281. package/utils/validate.js +1 -1
  282. package/utils/warning.js +1 -1
  283. package/version/index.js +8 -8
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ /**
3
+ * Merge the child ref with an internal ref and expose the resolved DOM node.
4
+ *
5
+ * @returns A tuple containing the renderable child node and the DOM node resolved from its ref.
6
+ */
7
+ declare const useChildDom: (children: React.ReactNode) => [childNode: React.ReactNode, domNode: HTMLElement | SVGElement | null];
8
+ export default useChildDom;
@@ -0,0 +1,17 @@
1
+ /* 潘启宝 2026-05-18 15:16:57 星期一 */
2
+ import { getNodeRef as e, supportRef as t, useComposeRef as n } from "../../utils/ref.js";
3
+ import { getDOM as r } from "../../utils/dom.js";
4
+ import "../../utils/index.js";
5
+ import { cloneElement as i } from "../../utils/reactNode.js";
6
+ import a from "react";
7
+ //#region components/common/border-beam/hooks/useChildDom.ts
8
+ var o = (o) => {
9
+ let [s, c] = a.useState(null), l = a.isValidElement(o) ? o : null, u = a.useCallback((e) => {
10
+ let t = r(e);
11
+ c((e) => e === t ? e : t);
12
+ }, []), d = n(l ? e(l) : null, u);
13
+ return !l || !t(l) ? [o, s] : [i(l, { ref: d }), s];
14
+ };
15
+ //#endregion
16
+ export { o as default };
17
+ /* 独立思考,明辨是非 */
@@ -0,0 +1,6 @@
1
+ import { GRADIENT_PRESETS } from './constants';
2
+ declare const BorderBeam: import("react").ForwardRefExoticComponent<import("./interface").BorderBeamProps & import("react").RefAttributes<unknown>> & {
3
+ id: string;
4
+ };
5
+ export { GRADIENT_PRESETS as BORDER_BEAM_GRADIENT_PRESETS };
6
+ export default BorderBeam;
@@ -0,0 +1,9 @@
1
+ /* 潘启宝 2026-05-18 15:16:57 星期一 */
2
+ import { BORDER_BEAM_COMPONENT_INFO as e } from "../utils/names.js";
3
+ import { GRADIENT_PRESETS as t } from "./constants.js";
4
+ import n from "./BorderBeam.js";
5
+ //#region components/common/border-beam/index.ts
6
+ var r = Object.assign(n, { id: e.id });
7
+ //#endregion
8
+ export { t as BORDER_BEAM_GRADIENT_PRESETS, r as default };
9
+ /* 独立思考,明辨是非 */
@@ -0,0 +1,31 @@
1
+ import { ReactNode } from 'react';
2
+ type BorderBeamGradientItem = {
3
+ color: string;
4
+ percent: number;
5
+ };
6
+ export type BorderBeamGradient = BorderBeamGradientItem[];
7
+ export type BorderBeamColor = string | BorderBeamGradient;
8
+ /**
9
+ * @title BorderBeam 边框流光
10
+ * @description 为容器边框提供持续流动的装饰性高亮效果。
11
+ */
12
+ export interface BorderBeamProps {
13
+ prefixCls?: string;
14
+ className?: string;
15
+ style?: React.CSSProperties;
16
+ children?: ReactNode;
17
+ color?: BorderBeamColor;
18
+ gradientType?: 'ocean' | 'sunset' | 'aurora' | 'forest' | 'ember' | 'nebula';
19
+ outset?: number | string;
20
+ }
21
+ export interface Preset {
22
+ key: BorderBeamProps['gradientType'];
23
+ name: string;
24
+ usage: string;
25
+ description: string;
26
+ color: Array<{
27
+ color: string;
28
+ percent: number;
29
+ }>;
30
+ }
31
+ export {};
@@ -0,0 +1,9 @@
1
+ type BorderBeamGradientItem = {
2
+ color: string;
3
+ percent: number;
4
+ };
5
+ export type BorderBeamGradient = BorderBeamGradientItem[];
6
+ export type BorderBeamColor = string | BorderBeamGradient;
7
+ export declare const MAX_BEAM_COLOR_STOP_PERCENT = 70;
8
+ export declare const getBorderBeamGradient: (value?: BorderBeamColor) => string | undefined;
9
+ export {};
@@ -0,0 +1,22 @@
1
+ /* 潘启宝 2026-05-18 15:16:57 星期一 */
2
+ import { isString as e } from "../utils/is.js";
3
+ //#region components/common/border-beam/utils.ts
4
+ var t = 70, n = (...e) => `linear-gradient(to left, ${e.join(", ")}, transparent)`, r = (t) => e(t) ? [{
5
+ color: t,
6
+ percent: 0
7
+ }] : t ?? [], i = (e) => {
8
+ let t = e[e.length - 1];
9
+ return !t || t.percent === 100 ? e : [...e, {
10
+ ...t,
11
+ percent: 100
12
+ }];
13
+ }, a = (e) => Number((Math.min(Math.max(e, 0), 100) / 100 * 70).toFixed(2)), o = (e) => i(e).map((e) => ({
14
+ ...e,
15
+ percent: a(e.percent)
16
+ })), s = (e) => {
17
+ let t = o(r(e));
18
+ return t.length ? n(...t.map((e) => `${e.color} ${e.percent}%`)) : void 0;
19
+ };
20
+ //#endregion
21
+ export { t as MAX_BEAM_COLOR_STOP_PERCENT, s as getBorderBeamGradient };
22
+ /* 独立思考,明辨是非 */
@@ -1,36 +1,37 @@
1
- /* 潘启宝 2026-05-08 09:02:53 星期五 */
2
- import { forwardRef as e, useImperativeHandle as t, useMemo as n, useRef as r } from "react";
3
- import { UI_COMMON_PREFIX as i } from "@unicom-cloud/utils/constant/ui";
4
- import a from "@unicom-cloud/utils/class-name";
5
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
6
- import c from "@unicom-cloud/icons/IconFluentHourglassNotDone";
1
+ /* 潘启宝 2026-05-18 15:16:57 星期一 */
2
+ import { DEVELOPMENT_COMPONENT_INFO as e } from "../utils/names.js";
3
+ import { forwardRef as t, useImperativeHandle as n, useMemo as r, useRef as i } from "react";
4
+ import { UI_COMMON_PREFIX as a } from "@unicom-cloud/utils/constant/ui";
5
+ import o from "@unicom-cloud/utils/class-name";
6
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
7
+ import l from "@unicom-cloud/icons/IconFluentHourglassNotDone";
7
8
  //#region components/common/development/Development.tsx
8
- function l(e, l) {
9
- let { url: u, imgClassName: d, icon: f, iconClassName: p, tip: m, label: h = "等待开发", labelClassName: g, style: _, className: v } = e, y = `${i}-development`, b = n(() => u ? /* @__PURE__ */ o("img", {
10
- className: a(`${y}-img`, d),
9
+ function u(e, t) {
10
+ let { url: u, imgClassName: d, icon: f, iconClassName: p, tip: m, label: h = "等待开发", labelClassName: g, style: _, className: v } = e, y = `${a}-development`, b = r(() => u ? /* @__PURE__ */ s("img", {
11
+ className: o(`${y}-img`, d),
11
12
  src: u,
12
13
  alt: "开发预览图"
13
- }) : f ?? /* @__PURE__ */ o(c, { className: a(`${y}-icon`, p) }), [
14
+ }) : f ?? /* @__PURE__ */ s(l, { className: o(`${y}-icon`, p) }), [
14
15
  u,
15
16
  y,
16
17
  d,
17
18
  f,
18
19
  p
19
- ]), x = m ?? h, S = r(null);
20
- return t(l, () => ({ getRootElement() {
20
+ ]), x = m ?? h, S = i(null);
21
+ return n(t, () => ({ getRootElement() {
21
22
  return S.current;
22
- } })), /* @__PURE__ */ s("div", {
23
+ } })), /* @__PURE__ */ c("div", {
23
24
  ref: S,
24
25
  style: { ..._ },
25
- className: a(y, v),
26
- children: [b, /* @__PURE__ */ o("div", {
27
- className: a(`${y}-label`, g),
26
+ className: o(y, v),
27
+ children: [b, /* @__PURE__ */ s("div", {
28
+ className: o(`${y}-label`, g),
28
29
  children: x
29
30
  })]
30
31
  });
31
32
  }
32
- var u = e(l);
33
- u.displayName = "Development";
33
+ var d = t(u);
34
+ d.displayName = e.displayName;
34
35
  //#endregion
35
- export { u as default };
36
+ export { d as default };
36
37
  /* 独立思考,明辨是非 */
@@ -1,3 +1,5 @@
1
- declare const Development: import("react").ForwardRefExoticComponent<import("./interface").DevelopmentProps & import("react").RefAttributes<HTMLDivElement>>;
1
+ declare const Development: import("react").ForwardRefExoticComponent<import("./interface").DevelopmentProps & import("react").RefAttributes<HTMLDivElement>> & {
2
+ id: string;
3
+ };
2
4
  export default Development;
3
5
  export type { DevelopmentProps } from './interface';
@@ -1,7 +1,8 @@
1
- /* 潘启宝 2026-05-08 09:02:53 星期五 */
2
- import e from "./Development.js";
1
+ /* 潘启宝 2026-05-18 15:16:57 星期一 */
2
+ import { DEVELOPMENT_COMPONENT_INFO as e } from "../utils/names.js";
3
+ import t from "./Development.js";
3
4
  //#region components/common/development/index.ts
4
- var t = Object.assign(e, {});
5
+ var n = Object.assign(t, { id: e.id });
5
6
  //#endregion
6
- export { t as default };
7
+ export { n as default };
7
8
  /* 独立思考,明辨是非 */
package/empty/Empty.js CHANGED
@@ -1,40 +1,41 @@
1
- /* 潘启宝 2026-05-08 09:02:53 星期五 */
1
+ /* 潘启宝 2026-05-18 15:16:57 星期一 */
2
2
  import { isString as e } from "../utils/is.js";
3
3
  import t from "../utils/className.js";
4
- import n from "../space/index.js";
5
- import { forwardRef as r, memo as i, useImperativeHandle as a, useRef as o } from "react";
6
- import { UI_COMMON_PREFIX as s } from "@unicom-cloud/utils/constant/ui";
7
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
8
- import u from "@unicom-cloud/icons/IconUiEmpty";
4
+ import { EMPTY_COMPONENT_INFO as n } from "../utils/names.js";
5
+ import r from "../space/index.js";
6
+ import { forwardRef as i, memo as a, useImperativeHandle as o, useRef as s } from "react";
7
+ import { UI_COMMON_PREFIX as c } from "@unicom-cloud/utils/constant/ui";
8
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
9
+ import d from "@unicom-cloud/icons/IconUiEmpty";
9
10
  //#region components/common/empty/Empty.tsx
10
- function d(r, i) {
11
- let { style: d, className: f, description: p = "无数据", icon: m, imgSrc: h, prefixCls: g, ..._ } = r, v = `${s}-empty`, y = g || v, b = e(p) ? p : "empty", x = () => h ? /* @__PURE__ */ c("img", {
11
+ function f(n, i) {
12
+ let { style: a, className: f, description: p = "无数据", icon: m, imgSrc: h, prefixCls: g, ..._ } = n, v = `${c}-empty`, y = g || v, b = e(p) ? p : "empty", x = () => h ? /* @__PURE__ */ l("img", {
12
13
  className: t(`${v}-img`, `${y}-img`),
13
14
  alt: b,
14
15
  src: h,
15
16
  loading: "lazy"
16
- }) : m ? /* @__PURE__ */ c("div", {
17
+ }) : m ? /* @__PURE__ */ l("div", {
17
18
  className: t(`${v}-icon`, `${y}-icon`),
18
19
  children: m
19
- }) : /* @__PURE__ */ c(u, { className: t(`${v}-icon`, `${y}-icon`) }), S = o(null);
20
- return a(i, () => ({ getRootElement() {
20
+ }) : /* @__PURE__ */ l(d, { className: t(`${v}-icon`, `${y}-icon`) }), S = s(null);
21
+ return o(i, () => ({ getRootElement() {
21
22
  return S.current;
22
- } })), /* @__PURE__ */ l(n.Vertical, {
23
+ } })), /* @__PURE__ */ u(r.Vertical, {
23
24
  ref: S,
24
25
  className: t(v, y, f),
25
- style: d,
26
+ style: a,
26
27
  justifyContent: "center",
27
28
  alignItems: "center",
28
29
  gap: 5,
29
30
  ..._,
30
- children: [x(), /* @__PURE__ */ c("div", {
31
+ children: [x(), /* @__PURE__ */ l("div", {
31
32
  className: t(`${v}-description`, `${y}-description`),
32
33
  children: p
33
34
  })]
34
35
  });
35
36
  }
36
- var f = i(r(d));
37
- f.displayName = "Empty";
37
+ var p = a(i(f));
38
+ p.displayName = n.displayName;
38
39
  //#endregion
39
- export { f as Empty, f as default };
40
+ export { p as Empty, p as default };
40
41
  /* 独立思考,明辨是非 */
package/empty/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
- declare const Empty: import("react").NamedExoticComponent<import("./interface").EmptyProps & import("react").RefAttributes<HTMLDivElement>>;
1
+ declare const Empty: import("react").NamedExoticComponent<import("./interface").EmptyProps & import("react").RefAttributes<HTMLDivElement>> & {
2
+ id: string;
3
+ };
2
4
  export default Empty;
3
5
  export type { EmptyProps } from './interface';
package/empty/index.js CHANGED
@@ -1,7 +1,8 @@
1
- /* 潘启宝 2026-05-08 09:02:53 星期五 */
2
- import { Empty as e } from "./Empty.js";
1
+ /* 潘启宝 2026-05-18 15:16:57 星期一 */
2
+ import { EMPTY_COMPONENT_INFO as e } from "../utils/names.js";
3
+ import { Empty as t } from "./Empty.js";
3
4
  //#region components/common/empty/index.ts
4
- var t = Object.assign(e, {});
5
+ var n = Object.assign(t, { id: e.id });
5
6
  //#endregion
6
- export { t as default };
7
+ export { n as default };
7
8
  /* 独立思考,明辨是非 */
package/flex/Flex.js CHANGED
@@ -1,31 +1,32 @@
1
- /* 潘启宝 2026-05-08 09:02:53 星期五 */
1
+ /* 潘启宝 2026-05-18 15:16:57 星期一 */
2
2
  import { isBoolean as e } from "../utils/is.js";
3
3
  import t from "../hooks/use-merge-props/index.js";
4
4
  import n from "../utils/className.js";
5
- import { processGap as r } from "./utils.js";
6
- import { forwardRef as i, useImperativeHandle as a, useRef as o } from "react";
7
- import { UI_COMMON_PREFIX as s } from "@unicom-cloud/utils/constant/ui";
8
- import { jsx as c } from "react/jsx-runtime";
5
+ import { FLEX_COMPONENT_INFO as r, FLEX_VERTICAL_COMPONENT_INFO as i } from "../utils/names.js";
6
+ import { processGap as a } from "./utils.js";
7
+ import { forwardRef as o, useImperativeHandle as s, useRef as c } from "react";
8
+ import { UI_COMMON_PREFIX as l } from "@unicom-cloud/utils/constant/ui";
9
+ import { jsx as u } from "react/jsx-runtime";
9
10
  //#region components/common/flex/Flex.tsx
10
- var l = {
11
+ var d = {
11
12
  component: "div",
12
13
  gap: "small"
13
14
  };
14
- function u(i, u) {
15
- let d = t(i, l, {}), { className: f, style: p, gap: m, children: h, direction: g, justify: _, justifyContent: v, align: y, alignItems: b, component: x = "div", wrap: S, rtl: C, inline: w, ...T } = d, E = v ?? _, D = b ?? y, O = `${s}-flex`, k = { display: w ? "inline-flex" : "flex" };
16
- if ("wrap" in d) {
15
+ function f(r, i) {
16
+ let o = t(r, d, {}), { className: f, style: p, gap: m, children: h, direction: g, justify: _, justifyContent: v, align: y, alignItems: b, component: x = "div", wrap: S, rtl: C, inline: w, ...T } = o, E = v ?? _, D = b ?? y, O = `${l}-flex`, k = { display: w ? "inline-flex" : "flex" };
17
+ if ("wrap" in o) {
17
18
  let t = S;
18
19
  t = e(t) ? t ? "wrap" : "nowrap" : S, k.flexWrap = t;
19
20
  }
20
21
  D && (k.alignItems = D), E && (k.justifyContent = E), g && (k.flexDirection = g);
21
- let A = o(null);
22
- return a(u, () => ({ getRootElement() {
22
+ let A = c(null);
23
+ return s(i, () => ({ getRootElement() {
23
24
  return A.current;
24
- } })), /* @__PURE__ */ c(x, {
25
+ } })), /* @__PURE__ */ u(x, {
25
26
  ref: A,
26
27
  style: {
27
28
  ...k,
28
- ...r(m),
29
+ ...a(m),
29
30
  ...p
30
31
  },
31
32
  className: n(O, {
@@ -36,17 +37,17 @@ function u(i, u) {
36
37
  children: h
37
38
  });
38
39
  }
39
- var d = i(u);
40
- d.displayName = "Flex";
41
- var f = i((e, t) => {
40
+ var p = o(f);
41
+ p.displayName = r.displayName;
42
+ var m = o((e, t) => {
42
43
  let { direction: n = "column", ...r } = e;
43
- return /* @__PURE__ */ c(d, {
44
+ return /* @__PURE__ */ u(p, {
44
45
  ...r,
45
46
  ref: t,
46
47
  direction: n
47
48
  });
48
49
  });
49
- f.displayName = "FlexVertical";
50
+ m.displayName = i.displayName;
50
51
  //#endregion
51
- export { f as FlexVertical, d as default };
52
+ export { m as FlexVertical, p as default };
52
53
  /* 独立思考,明辨是非 */
package/flex/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { FlexVertical } from './Flex';
2
2
  import { GAP_SIZE_MAP, processGap } from './utils';
3
3
  declare const Flex: import("react").ForwardRefExoticComponent<import("./interface").FlexProps & import("react").RefAttributes<unknown>> & {
4
+ id: string;
4
5
  Vertical: import("react").ForwardRefExoticComponent<import("./interface").FlexVerticalProps & import("react").RefAttributes<HTMLElement>>;
5
6
  };
6
7
  export { GAP_SIZE_MAP as FLEX_GAP_SIZE_MAP, processGap as flexProcessGap, FlexVertical, };
package/flex/index.js CHANGED
@@ -1,8 +1,12 @@
1
- /* 潘启宝 2026-05-08 09:02:53 星期五 */
2
- import { GAP_SIZE_MAP as e, processGap as t } from "./utils.js";
3
- import n, { FlexVertical as r } from "./Flex.js";
1
+ /* 潘启宝 2026-05-18 15:16:57 星期一 */
2
+ import { FLEX_COMPONENT_INFO as e } from "../utils/names.js";
3
+ import { GAP_SIZE_MAP as t, processGap as n } from "./utils.js";
4
+ import r, { FlexVertical as i } from "./Flex.js";
4
5
  //#region components/common/flex/index.ts
5
- var i = Object.assign(n, { Vertical: r });
6
+ var a = Object.assign(r, {
7
+ id: e.id,
8
+ Vertical: i
9
+ });
6
10
  //#endregion
7
- export { e as FLEX_GAP_SIZE_MAP, r as FlexVertical, i as default, t as flexProcessGap };
11
+ export { t as FLEX_GAP_SIZE_MAP, i as FlexVertical, a as default, n as flexProcessGap };
8
12
  /* 独立思考,明辨是非 */
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { HTMLAttributes } from 'react';
2
2
  export type GapProperty = 'gap' | 'rowGap' | 'columnGap';
3
3
  export type SizeType = 'default' | 'mini' | 'small' | 'medium' | 'large' | '1x' | '2x' | '3x' | '4x' | '5x' | '6x' | '7x' | '8x' | '9x' | 'x1' | 'x2' | 'x3' | 'x4' | 'x5' | 'x6' | 'x7' | 'x8' | 'x9';
4
4
  export type GapType = SizeType | React.CSSProperties['gap'];
@@ -6,7 +6,7 @@ export type GapType = SizeType | React.CSSProperties['gap'];
6
6
  * @title Flex
7
7
  * @description Flex布局组件属性
8
8
  */
9
- export interface FlexProps extends React.HTMLAttributes<HTMLElement> {
9
+ export interface FlexProps extends HTMLAttributes<HTMLElement> {
10
10
  /**
11
11
  * @zh 元素的行为类似于行级元素并且它的内容根据弹性盒模型布局。
12
12
  */
package/flex/utils.js CHANGED
@@ -1,4 +1,4 @@
1
- /* 潘启宝 2026-05-08 09:02:53 星期五 */
1
+ /* 潘启宝 2026-05-18 15:16:57 星期一 */
2
2
  import { isArray as e } from "../utils/is.js";
3
3
  import "react";
4
4
  //#region components/common/flex/utils.ts
@@ -1,4 +1,4 @@
1
- /* 潘启宝 2026-05-08 09:02:53 星期五 */
1
+ /* 潘启宝 2026-05-18 15:16:57 星期一 */
2
2
  import e from "./with-speech-synthesis/index.js";
3
3
  export { e as withSpeechSynthesis };
4
4
  /* 独立思考,明辨是非 */
@@ -1,4 +1,6 @@
1
1
  import Component from './withSpeechSynthesis';
2
- declare const withSpeechSynthesis: typeof Component;
2
+ declare const withSpeechSynthesis: typeof Component & {
3
+ id: string;
4
+ };
3
5
  export default withSpeechSynthesis;
4
6
  export type { SpeechSynthesisHandles, SpeechSynthesisProps } from './interface';
@@ -1,7 +1,8 @@
1
- /* 潘启宝 2026-05-08 09:02:53 星期五 */
2
- import e from "./withSpeechSynthesis.js";
1
+ /* 潘启宝 2026-05-18 15:16:57 星期一 */
2
+ import { SPEECH_SYNTHESIS_COMPONENT_INFO as e } from "../../utils/names.js";
3
+ import t from "./withSpeechSynthesis.js";
3
4
  //#region components/common/higher-order/with-speech-synthesis/index.ts
4
- var t = Object.assign(e, {});
5
+ var n = Object.assign(t, { id: e.id });
5
6
  //#endregion
6
- export { t as default };
7
+ export { n as default };
7
8
  /* 独立思考,明辨是非 */
@@ -1,7 +1,4 @@
1
1
  import React from 'react';
2
2
  import type { SpeechSynthesisHandles, SpeechSynthesisProps } from './interface';
3
3
  declare function withSpeechSynthesis<P extends object>(WrappedComponent: React.ComponentType<P>): React.NamedExoticComponent<React.PropsWithoutRef<SpeechSynthesisProps & P> & React.RefAttributes<SpeechSynthesisHandles>>;
4
- declare namespace withSpeechSynthesis {
5
- var displayName: string;
6
- }
7
4
  export default withSpeechSynthesis;
@@ -1,16 +1,17 @@
1
- /* 潘启宝 2026-05-08 09:02:53 星期五 */
2
- import { forwardRef as e, memo as t, useCallback as n, useEffect as r, useImperativeHandle as i, useMemo as a, useState as o } from "react";
3
- import { jsx as s } from "react/jsx-runtime";
4
- import c from "@unicom-cloud/icons/IconUiMute";
5
- import l from "@unicom-cloud/icons/IconUiPauseCircleFill";
6
- import u from "@unicom-cloud/icons/IconUiPlayCircleFill";
7
- import d from "@unicom-cloud/icons/IconUiSound";
1
+ /* 潘启宝 2026-05-18 15:16:57 星期一 */
2
+ import { SPEECH_SYNTHESIS_COMPONENT_INFO as e } from "../../utils/names.js";
3
+ import { forwardRef as t, memo as n, useCallback as r, useEffect as i, useImperativeHandle as a, useMemo as o, useState as s } from "react";
4
+ import { jsx as c } from "react/jsx-runtime";
5
+ import l from "@unicom-cloud/icons/IconUiMute";
6
+ import u from "@unicom-cloud/icons/IconUiPauseCircleFill";
7
+ import d from "@unicom-cloud/icons/IconUiPlayCircleFill";
8
+ import f from "@unicom-cloud/icons/IconUiSound";
8
9
  //#region components/common/higher-order/with-speech-synthesis/withSpeechSynthesis.tsx
9
- function f(f) {
10
- let p = e((e, t) => {
11
- let { useButton: p = !0, buttonProps: m = {}, ...h } = e, [g, _] = o(!1), [v, y] = o(null), b = a(() => "speechSynthesis" in window && "SpeechSynthesisUtterance" in window, []), x = n(() => {
10
+ function p(p) {
11
+ let m = t((e, t) => {
12
+ let { useButton: n = !0, buttonProps: m = {}, ...h } = e, [g, _] = s(!1), [v, y] = s(null), b = o(() => "speechSynthesis" in window && "SpeechSynthesisUtterance" in window, []), x = r(() => {
12
13
  b && (window.speechSynthesis.cancel(), _(!1), y(null));
13
- }, [b]), S = n(() => {
14
+ }, [b]), S = r(() => {
14
15
  if (!b) return;
15
16
  x();
16
17
  let e = h.getText?.() ?? h.text;
@@ -31,11 +32,11 @@ function f(f) {
31
32
  b,
32
33
  h.getText,
33
34
  h.text
34
- ]), C = n(() => {
35
+ ]), C = r(() => {
35
36
  b && v && window.speechSynthesis.pause();
36
- }, [b, v]), w = n(() => {
37
+ }, [b, v]), w = r(() => {
37
38
  b && v && window.speechSynthesis.resume();
38
- }, [b, v]), T = n((e) => {
39
+ }, [b, v]), T = r((e) => {
39
40
  e.preventDefault(), e.stopPropagation(), g ? C() : S(), m.onClick?.(e);
40
41
  }, [
41
42
  g,
@@ -43,33 +44,32 @@ function f(f) {
43
44
  S,
44
45
  m.onClick
45
46
  ]);
46
- if (r(() => x, [x]), i(t, () => ({
47
+ if (i(() => x, [x]), a(t, () => ({
47
48
  cancel: x,
48
49
  speak: S,
49
50
  pause: C,
50
51
  resume: w
51
52
  })), !b) return null;
52
- if (p) {
53
+ if (n) {
53
54
  let { label: e, text: t, children: n, ...r } = m;
54
- return /* @__PURE__ */ s(f, {
55
+ return /* @__PURE__ */ c(p, {
55
56
  ...h,
56
57
  type: "text",
57
58
  size: "mini",
58
- icon: s(g ? c : d, {}),
59
+ icon: c(g ? l : f, {}),
59
60
  ...r,
60
61
  onClick: T,
61
62
  children: e || t || n
62
63
  });
63
64
  }
64
- return /* @__PURE__ */ s(g ? l : u, {
65
+ return /* @__PURE__ */ c(g ? u : d, {
65
66
  ...h.iconProps,
66
67
  onClick: T,
67
68
  style: { cursor: "pointer" }
68
69
  });
69
70
  });
70
- return p.displayName = `WithSpeechSynthesis.${f.displayName || f.name || "SpeechSynthesis"}`, t(p);
71
+ return m.displayName = `WithSpeechSynthesis.${p.displayName || p.name || e.displayName}`, n(m);
71
72
  }
72
- f.displayName = "withSpeechSynthesis";
73
73
  //#endregion
74
- export { f as default };
74
+ export { p as default };
75
75
  /* 独立思考,明辨是非 */
@@ -1,4 +1,4 @@
1
- /* 潘启宝 2026-05-08 09:02:53 星期五 */
1
+ /* 潘启宝 2026-05-18 15:16:57 星期一 */
2
2
  import { isUndefined as e } from "../../utils/is.js";
3
3
  import { depsEqual as t } from "../utils/depsEqual.js";
4
4
  import { useRef as n } from "react";
@@ -1,4 +1,4 @@
1
- /* 潘启宝 2026-05-08 09:02:53 星期五 */
1
+ /* 潘启宝 2026-05-18 15:16:57 星期一 */
2
2
  import { useRef as e } from "react";
3
3
  //#region components/common/hooks/create-update-effect/index.ts
4
4
  function t(t) {
@@ -1,4 +1,4 @@
1
- /* 潘启宝 2026-05-08 09:02:53 星期五 */
1
+ /* 潘启宝 2026-05-18 15:16:57 星期一 */
2
2
  import { isFunction as e, isUndefined as t } from "../../utils/is.js";
3
3
  import n from "../use-memoized-fn/index.js";
4
4
  import r from "../use-update-effect/index.js";
package/hooks/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /* 潘启宝 2026-05-08 09:02:53 星期五 */
1
+ /* 潘启宝 2026-05-18 15:16:57 星期一 */
2
2
  import e from "./create-update-effect/index.js";
3
3
  import t from "./use-async-effect/index.js";
4
4
  import n from "./use-toggle/index.js";
@@ -1,4 +1,4 @@
1
- /* 潘启宝 2026-05-08 09:02:53 星期五 */
1
+ /* 潘启宝 2026-05-18 15:16:57 星期一 */
2
2
  import { isFunction as e } from "../../utils/is.js";
3
3
  import { useEffect as t } from "react";
4
4
  //#region components/common/hooks/use-async-effect/index.ts
@@ -1,4 +1,4 @@
1
- /* 潘启宝 2026-05-08 09:02:53 星期五 */
1
+ /* 潘启宝 2026-05-18 15:16:57 星期一 */
2
2
  import e from "../use-toggle/index.js";
3
3
  import { useMemo as t } from "react";
4
4
  //#region components/common/hooks/use-boolean/index.ts
@@ -1,4 +1,4 @@
1
- /* 潘启宝 2026-05-08 09:02:53 星期五 */
1
+ /* 潘启宝 2026-05-18 15:16:57 星期一 */
2
2
  import e from "../use-latest/index.js";
3
3
  import t from "../utils/domTarget.js";
4
4
  import n from "../utils/getDocumentOrShadow.js";
@@ -1,4 +1,4 @@
1
- /* 潘启宝 2026-05-08 09:02:53 星期五 */
1
+ /* 潘启宝 2026-05-18 15:16:57 星期一 */
2
2
  import { useEffect as e, useState as t } from "react";
3
3
  //#region components/common/hooks/use-computed-state/index.ts
4
4
  function n(n, r) {
@@ -2,7 +2,9 @@ import type { SetStateAction } from 'react';
2
2
  export interface Options<T> {
3
3
  defaultValue?: T;
4
4
  defaultValuePropName?: string;
5
+ defaultValueParser?: (v: T) => T;
5
6
  valuePropName?: string;
7
+ valueParser?: (v: T) => T;
6
8
  triggerPropName?: string | false;
7
9
  useStrict?: boolean;
8
10
  }