@unicom-cloud/ui-common 0.1.21 → 0.1.23

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 (311) hide show
  1. package/.virtual/_rolldown/runtime.js +1 -1
  2. package/.vite/manifest.json +209 -69
  3. package/development/Development.d.ts +8 -0
  4. package/development/Development.js +36 -0
  5. package/development/index.d.ts +2 -7
  6. package/development/index.js +5 -32
  7. package/empty/Empty.d.ts +5 -0
  8. package/empty/Empty.js +40 -0
  9. package/empty/index.d.ts +2 -4
  10. package/empty/index.js +5 -36
  11. package/flex/Flex.d.ts +6 -0
  12. package/flex/Flex.js +52 -0
  13. package/flex/index.d.ts +4 -5
  14. package/flex/index.js +6 -50
  15. package/flex/interface.d.ts +2 -2
  16. package/flex/utils.d.ts +2 -12
  17. package/flex/utils.js +1 -1
  18. package/higher-order/index.js +1 -1
  19. package/higher-order/with-speech-synthesis/index.d.ts +3 -6
  20. package/higher-order/with-speech-synthesis/index.js +5 -73
  21. package/higher-order/with-speech-synthesis/withSpeechSynthesis.d.ts +7 -0
  22. package/higher-order/with-speech-synthesis/withSpeechSynthesis.js +75 -0
  23. package/hooks/create-deep-compare-effect/index.js +1 -1
  24. package/hooks/create-update-effect/index.js +3 -3
  25. package/hooks/create-use-storage-state/index.d.ts +1 -1
  26. package/hooks/create-use-storage-state/index.js +2 -2
  27. package/hooks/index.d.ts +1 -2
  28. package/hooks/index.js +90 -91
  29. package/hooks/use-async-effect/index.js +1 -1
  30. package/hooks/use-boolean/index.js +1 -1
  31. package/hooks/use-click-away/index.js +1 -1
  32. package/hooks/use-computed-state/index.js +1 -1
  33. package/hooks/use-controllable-value/index.d.ts +7 -5
  34. package/hooks/use-controllable-value/index.js +44 -14
  35. package/hooks/use-cookie-state/index.js +1 -1
  36. package/hooks/use-count-down/index.js +1 -1
  37. package/hooks/use-counter/index.js +1 -1
  38. package/hooks/use-create/index.js +1 -1
  39. package/hooks/use-creation/index.js +1 -1
  40. package/hooks/use-debounce/index.js +1 -1
  41. package/hooks/use-debounce-effect/index.js +1 -1
  42. package/hooks/use-debounce-fn/index.js +1 -1
  43. package/hooks/use-deep-compare-effect/index.js +1 -1
  44. package/hooks/use-deep-compare-layout-effect/index.js +1 -1
  45. package/hooks/use-document-visibility/index.js +1 -1
  46. package/hooks/use-drag/index.js +2 -2
  47. package/hooks/use-drop/index.js +1 -1
  48. package/hooks/use-effect-event/index.d.ts +2 -2
  49. package/hooks/use-effect-event/index.js +5 -15
  50. package/hooks/use-event/index.js +1 -1
  51. package/hooks/use-event-emitter/index.d.ts +2 -2
  52. package/hooks/use-event-emitter/index.js +1 -1
  53. package/hooks/use-event-listener/index.js +1 -1
  54. package/hooks/use-event-target/index.js +1 -1
  55. package/hooks/use-external/index.js +1 -1
  56. package/hooks/use-favicon/index.js +1 -1
  57. package/hooks/use-focus-within/index.js +1 -1
  58. package/hooks/use-force-update/index.js +1 -1
  59. package/hooks/use-fullscreen/index.js +1 -1
  60. package/hooks/use-get-state/index.d.ts +1 -1
  61. package/hooks/use-get-state/index.js +1 -1
  62. package/hooks/use-history-travel/index.js +1 -1
  63. package/hooks/use-hover/index.js +1 -1
  64. package/hooks/use-id/index.js +1 -1
  65. package/hooks/use-in-viewport/index.d.ts +3 -1
  66. package/hooks/use-in-viewport/index.js +16 -15
  67. package/hooks/use-infinite-scroll/index.js +1 -1
  68. package/hooks/use-intersection-observer/index.d.ts +1 -1
  69. package/hooks/use-intersection-observer/index.js +2 -2
  70. package/hooks/use-intersection-observers/index.js +1 -1
  71. package/hooks/use-interval/index.js +1 -1
  72. package/hooks/use-is-first-render/index.js +1 -1
  73. package/hooks/use-isomorphic-layout-effect/index.js +1 -1
  74. package/hooks/use-key-press/index.js +1 -1
  75. package/hooks/use-keyboard-event/index.js +1 -1
  76. package/hooks/use-latest/index.js +1 -1
  77. package/hooks/use-listen-window-resize/index.js +1 -1
  78. package/hooks/use-local-storage-state/index.js +1 -1
  79. package/hooks/use-lock-fn/index.js +1 -1
  80. package/hooks/use-long-press/index.js +1 -1
  81. package/hooks/use-map/index.js +1 -1
  82. package/hooks/use-media/index.js +1 -1
  83. package/hooks/use-memo/index.js +3 -3
  84. package/hooks/use-memoized-fn/index.js +1 -1
  85. package/hooks/use-merge-props/index.d.ts +1 -1
  86. package/hooks/use-merge-props/index.js +5 -9
  87. package/hooks/use-merge-value/index.js +5 -5
  88. package/hooks/use-mobile/index.js +3 -3
  89. package/hooks/use-mount/index.d.ts +2 -1
  90. package/hooks/use-mount/index.js +10 -7
  91. package/hooks/use-mouse/index.js +1 -1
  92. package/hooks/use-move/index.js +1 -1
  93. package/hooks/use-mutation-observer/index.js +1 -1
  94. package/hooks/use-mutation-observers/index.js +1 -1
  95. package/hooks/use-network/index.js +16 -19
  96. package/hooks/use-online-status/index.js +1 -1
  97. package/hooks/use-overflow-hidden/index.js +1 -1
  98. package/hooks/use-override-ref/index.js +6 -6
  99. package/hooks/use-pagination/index.js +1 -1
  100. package/hooks/use-paste-image/index.d.ts +3 -1
  101. package/hooks/use-paste-image/index.js +16 -13
  102. package/hooks/use-persist-callback/index.d.ts +2 -1
  103. package/hooks/use-persist-callback/index.js +4 -7
  104. package/hooks/use-prefers-color-scheme-dark/index.js +1 -1
  105. package/hooks/use-previous/index.d.ts +1 -1
  106. package/hooks/use-previous/index.js +4 -4
  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 +17 -10
  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.d.ts +1 -1
  139. package/hooks/use-scroll/index.js +1 -1
  140. package/hooks/use-selections/index.js +1 -1
  141. package/hooks/use-session-storage-state/index.js +1 -1
  142. package/hooks/use-set/index.js +1 -1
  143. package/hooks/use-set-state/index.d.ts +4 -2
  144. package/hooks/use-set-state/index.js +19 -14
  145. package/hooks/use-size/index.js +1 -1
  146. package/hooks/use-state-callback/index.d.ts +8 -3
  147. package/hooks/use-state-callback/index.js +12 -7
  148. package/hooks/use-state-with-promise/index.js +14 -13
  149. package/hooks/use-sync-state/index.js +3 -3
  150. package/hooks/use-text-selection/index.js +1 -1
  151. package/hooks/use-theme/index.js +10 -10
  152. package/hooks/use-throttle/index.js +1 -1
  153. package/hooks/use-throttle-effect/index.js +1 -1
  154. package/hooks/use-throttle-fn/index.js +1 -1
  155. package/hooks/use-timeout/index.js +1 -1
  156. package/hooks/use-title/index.js +1 -1
  157. package/hooks/use-toggle/index.js +1 -1
  158. package/hooks/use-tracked-effect/index.js +1 -1
  159. package/hooks/use-unmount/index.js +1 -1
  160. package/hooks/use-unmounted-ref/index.js +1 -1
  161. package/hooks/use-update/index.js +5 -2
  162. package/hooks/use-update-effect/index.js +1 -1
  163. package/hooks/use-update-layout-effect/index.js +1 -1
  164. package/hooks/use-url-state/index.js +1 -1
  165. package/hooks/use-virtual-list/index.js +1 -1
  166. package/hooks/use-watch/index.js +1 -1
  167. package/hooks/use-web-socket/index.js +29 -29
  168. package/hooks/use-why-did-you-update/index.js +1 -1
  169. package/hooks/use-window-size/index.js +1 -1
  170. package/hooks/utils/createEffectWithTarget.js +1 -1
  171. package/hooks/utils/depsAreSame.js +1 -1
  172. package/hooks/utils/depsEqual.js +1 -1
  173. package/hooks/utils/domTarget.js +1 -1
  174. package/hooks/utils/getDocumentOrShadow.js +1 -1
  175. package/hooks/utils/index.js +1 -1
  176. package/hooks/utils/isAppleDevice.js +1 -1
  177. package/hooks/utils/isBrowser.js +1 -1
  178. package/hooks/utils/isDev.js +1 -1
  179. package/hooks/utils/rect.js +1 -1
  180. package/hooks/utils/useDeepCompareWithTarget.js +1 -1
  181. package/hooks/utils/useEffectWithTarget.js +1 -1
  182. package/hooks/utils/useIsomorphicLayoutEffectWithTarget.js +1 -1
  183. package/hooks/utils/useLayoutEffectWithTarget.js +1 -1
  184. package/icons/file/IconFile.d.ts +4 -0
  185. package/icons/file/IconFile.js +55 -0
  186. package/icons/file/index.d.ts +2 -3
  187. package/icons/file/index.js +5 -53
  188. package/index.js +656 -623
  189. package/package.json +1 -1
  190. package/progress/Progress.d.ts +409 -0
  191. package/progress/Progress.js +90 -0
  192. package/progress/index.d.ts +22 -407
  193. package/progress/index.js +4 -87
  194. package/resize-observer/Collection.d.ts +1 -2
  195. package/resize-observer/Collection.js +16 -16
  196. package/resize-observer/ResizeObserver.d.ts +6 -0
  197. package/resize-observer/ResizeObserver.js +23 -0
  198. package/resize-observer/SingleObserver.d.ts +3 -3
  199. package/resize-observer/SingleObserver.js +20 -20
  200. package/resize-observer/index.d.ts +4 -4
  201. package/resize-observer/index.js +6 -21
  202. package/resize-observer/observerUtil.js +1 -1
  203. package/space/Space.d.ts +5 -0
  204. package/space/Space.js +76 -0
  205. package/space/index.d.ts +4 -4
  206. package/space/index.js +5 -72
  207. package/style/animation.less +1 -4
  208. package/style.css +1 -1
  209. package/suspense-fallback-test/SuspenseFallbackTest.d.ts +6 -0
  210. package/suspense-fallback-test/SuspenseFallbackTest.js +13 -0
  211. package/suspense-fallback-test/index.d.ts +2 -6
  212. package/suspense-fallback-test/index.js +5 -6
  213. package/test.js +1 -1
  214. package/timer/Timer.d.ts +3 -0
  215. package/timer/Timer.js +40 -0
  216. package/timer/index.d.ts +2 -2
  217. package/timer/index.js +5 -37
  218. package/transition/Transition.d.ts +1 -8
  219. package/transition/Transition.js +62 -64
  220. package/transition/TransitionCSS.d.ts +1 -2
  221. package/transition/TransitionCSS.js +30 -26
  222. package/transition/TransitionGroup.d.ts +3 -3
  223. package/transition/TransitionGroup.js +46 -40
  224. package/transition/TransitionStyle.d.ts +1 -2
  225. package/transition/TransitionStyle.js +27 -23
  226. package/transition/constants.js +9 -3
  227. package/transition/context.d.ts +15 -0
  228. package/transition/context.js +8 -0
  229. package/transition/index.d.ts +13 -4
  230. package/transition/index.js +10 -9
  231. package/transition/interface.d.ts +8 -6
  232. package/transition/utils.d.ts +3 -3
  233. package/transition/utils.js +9 -9
  234. package/utils/callOrReturn.js +1 -1
  235. package/utils/callbackOriginRef.js +1 -1
  236. package/utils/caseName.js +1 -1
  237. package/utils/className.js +1 -1
  238. package/utils/constant.js +1 -1
  239. package/utils/copy.js +1 -1
  240. package/utils/date.js +1 -1
  241. package/utils/dayjs.js +1 -1
  242. package/utils/dom.d.ts +3 -2
  243. package/utils/dom.js +11 -2
  244. package/utils/emitter.js +1 -1
  245. package/utils/file.d.ts +1 -0
  246. package/utils/file.js +4 -0
  247. package/utils/fileRead.js +1 -1
  248. package/utils/fileToDataURL.js +1 -1
  249. package/utils/fillNBSP.d.ts +1 -1
  250. package/utils/fillNBSP.js +1 -1
  251. package/utils/findRootElement.js +1 -1
  252. package/utils/findScrollParent.d.ts +1 -1
  253. package/utils/findScrollParent.js +1 -1
  254. package/utils/getHighlightText.js +1 -1
  255. package/utils/getHotkeyHandler.js +1 -1
  256. package/utils/getScrollBarHeight.js +1 -1
  257. package/utils/getScrollBarSize.js +1 -1
  258. package/utils/getScrollBarWidth.js +1 -1
  259. package/utils/getStringLength.js +1 -1
  260. package/utils/include.js +1 -1
  261. package/utils/index.d.ts +2 -0
  262. package/utils/index.js +336 -324
  263. package/utils/intersectionObserver.d.ts +1 -1
  264. package/utils/intersectionObserver.js +1 -1
  265. package/utils/is.d.ts +3 -2
  266. package/utils/is.js +18 -16
  267. package/utils/keyboardCode.js +1 -1
  268. package/utils/lodash.d.ts +5 -1
  269. package/utils/lodash.js +31 -27
  270. package/utils/math.js +1 -1
  271. package/utils/mergeProps.d.ts +1 -1
  272. package/utils/mergeProps.js +7 -8
  273. package/utils/mergedToString.js +1 -1
  274. package/utils/mutationObserver.d.ts +1 -1
  275. package/utils/mutationObserver.js +1 -1
  276. package/utils/object.d.ts +1 -0
  277. package/utils/object.js +10 -0
  278. package/utils/omit.d.ts +1 -5
  279. package/utils/omit.js +3 -3
  280. package/utils/pad.js +1 -1
  281. package/utils/pick.d.ts +2 -7
  282. package/utils/pick.js +6 -6
  283. package/utils/pinyin.js +1 -1
  284. package/utils/react19Adapter.js +1 -1
  285. package/utils/ref.d.ts +2 -2
  286. package/utils/ref.js +1 -1
  287. package/utils/resizeObserver.d.ts +1 -1
  288. package/utils/resizeObserver.js +1 -1
  289. package/utils/saveAs.js +1 -1
  290. package/utils/screenfull.js +1 -1
  291. package/utils/scrollIntoViewIfNeeded.js +1 -1
  292. package/utils/setCreateRoot.js +1 -1
  293. package/utils/setDarkTheme.js +1 -1
  294. package/utils/setDir.js +1 -1
  295. package/utils/setPrimaryColor.js +1 -1
  296. package/utils/setTheme.js +1 -1
  297. package/utils/string.js +1 -1
  298. package/utils/style.js +1 -1
  299. package/utils/throttleByRaf.js +1 -1
  300. package/utils/throttleByRaf2.d.ts +1 -1
  301. package/utils/throttleByRaf2.js +1 -1
  302. package/utils/tinycolor.js +1 -1
  303. package/utils/toArray.js +1 -1
  304. package/utils/tree.js +1 -1
  305. package/utils/tween.js +1 -1
  306. package/utils/uuid.js +1 -1
  307. package/utils/validate.js +1 -1
  308. package/utils/warning.js +1 -1
  309. package/version/index.js +11 -11
  310. package/hooks/use-in-view/index.d.ts +0 -11
  311. package/hooks/use-in-view/index.js +0 -21
@@ -1,8 +1,3 @@
1
- import type { DevelopmentProps } from './interface';
2
- /**
3
- * 开发占位组件
4
- * @description 用于展示未开发完成的功能区块,支持自定义图片/图标和提示文字
5
- */
6
- declare const Development: import("react").ForwardRefExoticComponent<DevelopmentProps & import("react").RefAttributes<HTMLDivElement>>;
1
+ declare const Development: import("react").ForwardRefExoticComponent<import("./interface").DevelopmentProps & import("react").RefAttributes<HTMLDivElement>>;
7
2
  export default Development;
8
- export type { DevelopmentProps };
3
+ export type { DevelopmentProps } from './interface';
@@ -1,34 +1,7 @@
1
- /* 潘启宝 2026-04-23 09:23:27 星期四 */
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";
7
- var l = e((e, l) => {
8
- 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", {
9
- className: a(`${y}-img`, d),
10
- src: u,
11
- alt: "开发预览图"
12
- }) : f ?? /* @__PURE__ */ o(c, { className: a(`${y}-icon`, p) }), [
13
- u,
14
- y,
15
- d,
16
- f,
17
- p
18
- ]), x = m ?? h, S = r(null);
19
- return t(l, () => ({ getRootElement() {
20
- return S.current;
21
- } })), /* @__PURE__ */ s("div", {
22
- ref: S,
23
- style: { ..._ },
24
- className: a(y, v),
25
- children: [b, /* @__PURE__ */ o("div", {
26
- className: a(`${y}-label`, g),
27
- children: x
28
- })]
29
- });
30
- });
31
- l.displayName = "Development";
1
+ /* 潘启宝 2026-05-15 17:45:46 星期五 */
2
+ import e from "./Development.js";
3
+ //#region components/common/development/index.ts
4
+ var t = Object.assign(e, {});
32
5
  //#endregion
33
- export { l as default };
6
+ export { t as default };
34
7
  /* 独立思考,明辨是非 */
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import type { EmptyProps } from './interface';
3
+ export declare const Empty: React.NamedExoticComponent<EmptyProps & React.RefAttributes<HTMLDivElement>>;
4
+ export default Empty;
5
+ export type { EmptyProps };
package/empty/Empty.js ADDED
@@ -0,0 +1,40 @@
1
+ /* 潘启宝 2026-05-15 17:45:46 星期五 */
2
+ import { isString as e } from "../utils/is.js";
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";
9
+ //#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", {
12
+ className: t(`${v}-img`, `${y}-img`),
13
+ alt: b,
14
+ src: h,
15
+ loading: "lazy"
16
+ }) : m ? /* @__PURE__ */ c("div", {
17
+ className: t(`${v}-icon`, `${y}-icon`),
18
+ children: m
19
+ }) : /* @__PURE__ */ c(u, { className: t(`${v}-icon`, `${y}-icon`) }), S = o(null);
20
+ return a(i, () => ({ getRootElement() {
21
+ return S.current;
22
+ } })), /* @__PURE__ */ l(n.Vertical, {
23
+ ref: S,
24
+ className: t(v, y, f),
25
+ style: d,
26
+ justifyContent: "center",
27
+ alignItems: "center",
28
+ gap: 5,
29
+ ..._,
30
+ children: [x(), /* @__PURE__ */ c("div", {
31
+ className: t(`${v}-description`, `${y}-description`),
32
+ children: p
33
+ })]
34
+ });
35
+ }
36
+ var f = i(r(d));
37
+ f.displayName = "Empty";
38
+ //#endregion
39
+ export { f as Empty, f as default };
40
+ /* 独立思考,明辨是非 */
package/empty/index.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- import React from 'react';
2
- import type { EmptyProps } from './interface';
3
- export declare const Empty: React.NamedExoticComponent<EmptyProps & React.RefAttributes<HTMLDivElement>>;
1
+ declare const Empty: import("react").NamedExoticComponent<import("./interface").EmptyProps & import("react").RefAttributes<HTMLDivElement>>;
4
2
  export default Empty;
5
- export type { EmptyProps };
3
+ export type { EmptyProps } from './interface';
package/empty/index.js CHANGED
@@ -1,38 +1,7 @@
1
- /* 潘启宝 2026-04-23 09:23:27 星期四 */
2
- import { isString as e } from "../utils/is.js";
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";
9
- var d = i(r((r, i) => {
10
- 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
- className: t(`${v}-img`, `${y}-img`),
12
- alt: b,
13
- src: h,
14
- loading: "lazy"
15
- }) : m ? /* @__PURE__ */ c("div", {
16
- className: t(`${v}-icon`, `${y}-icon`),
17
- children: m
18
- }) : /* @__PURE__ */ c(u, { className: t(`${v}-icon`, `${y}-icon`) }), S = o(null);
19
- return a(i, () => ({ getRootElement() {
20
- return S.current;
21
- } })), /* @__PURE__ */ l(n.Vertical, {
22
- ref: S,
23
- className: t(v, y, f),
24
- style: d,
25
- justifyContent: "center",
26
- alignItems: "center",
27
- gap: 5,
28
- ..._,
29
- children: [x(), /* @__PURE__ */ c("div", {
30
- className: t(`${v}-description`, `${y}-description`),
31
- children: p
32
- })]
33
- });
34
- }));
35
- d.displayName = "Empty";
1
+ /* 潘启宝 2026-05-15 17:45:46 星期五 */
2
+ import { Empty as e } from "./Empty.js";
3
+ //#region components/common/empty/index.ts
4
+ var t = Object.assign(e, {});
36
5
  //#endregion
37
- export { d as Empty, d as default };
6
+ export { t as default };
38
7
  /* 独立思考,明辨是非 */
package/flex/Flex.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import type { FlexProps, FlexVerticalProps } from './interface';
3
+ declare const Flex: React.ForwardRefExoticComponent<FlexProps & React.RefAttributes<unknown>>;
4
+ declare const FlexVertical: React.ForwardRefExoticComponent<FlexVerticalProps & React.RefAttributes<HTMLElement>>;
5
+ export { FlexVertical };
6
+ export default Flex;
package/flex/Flex.js ADDED
@@ -0,0 +1,52 @@
1
+ /* 潘启宝 2026-05-15 17:45:46 星期五 */
2
+ import { isBoolean as e } from "../utils/is.js";
3
+ import t from "../hooks/use-merge-props/index.js";
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";
9
+ //#region components/common/flex/Flex.tsx
10
+ var l = {
11
+ component: "div",
12
+ gap: "small"
13
+ };
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) {
17
+ let t = S;
18
+ t = e(t) ? t ? "wrap" : "nowrap" : S, k.flexWrap = t;
19
+ }
20
+ D && (k.alignItems = D), E && (k.justifyContent = E), g && (k.flexDirection = g);
21
+ let A = o(null);
22
+ return a(u, () => ({ getRootElement() {
23
+ return A.current;
24
+ } })), /* @__PURE__ */ c(x, {
25
+ ref: A,
26
+ style: {
27
+ ...k,
28
+ ...r(m),
29
+ ...p
30
+ },
31
+ className: n(O, {
32
+ [`${O}-rtl`]: C,
33
+ [`${O}-inline`]: w
34
+ }, !!g && `${O}-flex-direction-${g}`, !!E && `${O}-justify-content-${E}`, !!D && `${O}-align-items-${D}`, f),
35
+ ...T,
36
+ children: h
37
+ });
38
+ }
39
+ var d = i(u);
40
+ d.displayName = "Flex";
41
+ var f = i((e, t) => {
42
+ let { direction: n = "column", ...r } = e;
43
+ return /* @__PURE__ */ c(d, {
44
+ ...r,
45
+ ref: t,
46
+ direction: n
47
+ });
48
+ });
49
+ f.displayName = "FlexVertical";
50
+ //#endregion
51
+ export { f as FlexVertical, d as default };
52
+ /* 独立思考,明辨是非 */
package/flex/index.d.ts CHANGED
@@ -1,9 +1,8 @@
1
- import React from 'react';
2
- import type { FlexVerticalProps } from './interface';
1
+ import { FlexVertical } from './Flex';
3
2
  import { GAP_SIZE_MAP, processGap } from './utils';
4
- declare const Flex: typeof Flex & {
5
- Vertical: typeof FlexVertical;
3
+ declare const Flex: import("react").ForwardRefExoticComponent<import("./interface").FlexProps & import("react").RefAttributes<unknown>> & {
4
+ Vertical: import("react").ForwardRefExoticComponent<import("./interface").FlexVerticalProps & import("react").RefAttributes<HTMLElement>>;
6
5
  };
7
- declare const FlexVertical: React.ForwardRefExoticComponent<FlexVerticalProps & React.RefAttributes<HTMLElement>>;
8
6
  export { GAP_SIZE_MAP as FLEX_GAP_SIZE_MAP, processGap as flexProcessGap, FlexVertical, };
9
7
  export default Flex;
8
+ export type { FlexProps } from './interface';
package/flex/index.js CHANGED
@@ -1,52 +1,8 @@
1
- /* 潘启宝 2026-04-23 09:23:27 星期四 */
2
- import { isBoolean as e } from "../utils/is.js";
3
- import t from "../hooks/use-merge-props/index.js";
4
- import n from "../utils/className.js";
5
- import { GAP_SIZE_MAP as r, processGap as i } from "./utils.js";
6
- import { forwardRef 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 } from "react/jsx-runtime";
9
- //#region components/common/flex/index.tsx
10
- var u = {
11
- component: "div",
12
- gap: "small"
13
- };
14
- function d(r, a) {
15
- let d = t(r, u, {}), { 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 = `${c}-flex`, k = { display: w ? "inline-flex" : "flex" };
16
- if ("wrap" in d) {
17
- let t = S;
18
- t = e(t) ? t ? "wrap" : "nowrap" : S, k.flexWrap = t;
19
- }
20
- D && (k.alignItems = D), E && (k.justifyContent = E), g && (k.flexDirection = g);
21
- let A = s(null);
22
- return o(a, () => ({ getRootElement() {
23
- return A.current;
24
- } })), /* @__PURE__ */ l(x, {
25
- ref: A,
26
- style: {
27
- ...k,
28
- ...i(m),
29
- ...p
30
- },
31
- className: n(O, {
32
- [`${O}-rtl`]: C,
33
- [`${O}-inline`]: w
34
- }, !!g && `${O}-flex-direction-${g}`, !!E && `${O}-justify-content-${E}`, !!D && `${O}-align-items-${D}`, f),
35
- ...T,
36
- children: h
37
- });
38
- }
39
- var f = a(d);
40
- f.displayName = "Flex";
41
- var p = a((e, t) => {
42
- let { direction: n = "column", ...r } = e;
43
- return /* @__PURE__ */ l(f, {
44
- ...r,
45
- ref: t,
46
- direction: n
47
- });
48
- });
49
- p.displayName = "FlexVertical", f.Vertical = p;
1
+ /* 潘启宝 2026-05-15 17:45:46 星期五 */
2
+ import { GAP_SIZE_MAP as e, processGap as t } from "./utils.js";
3
+ import n, { FlexVertical as r } from "./Flex.js";
4
+ //#region components/common/flex/index.ts
5
+ var i = Object.assign(n, { Vertical: r });
50
6
  //#endregion
51
- export { r as FLEX_GAP_SIZE_MAP, p as FlexVertical, f as default, i as flexProcessGap };
7
+ export { e as FLEX_GAP_SIZE_MAP, r as FlexVertical, i as default, t as flexProcessGap };
52
8
  /* 独立思考,明辨是非 */
@@ -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.d.ts CHANGED
@@ -1,17 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { FlexProps } from './interface';
3
- declare const GAP_SIZE_MAP: {
4
- '1x': number;
5
- '2x': number;
6
- '3x': number;
7
- '4x': number;
8
- '5x': number;
9
- '6x': number;
10
- '7x': number;
11
- '8x': number;
12
- '9x': number;
13
- };
14
- declare function getGapFromSizeString(value: any): any;
3
+ declare const GAP_SIZE_MAP: Record<string, unknown>;
4
+ declare function getGapFromSizeString(value: string | number | undefined): string;
15
5
  /**
16
6
  * 处理间距属性
17
7
  */
package/flex/utils.js CHANGED
@@ -1,4 +1,4 @@
1
- /* 潘启宝 2026-04-23 09:23:27 星期四 */
1
+ /* 潘启宝 2026-05-15 17:45:46 星期五 */
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-04-23 09:23:27 星期四 */
1
+ /* 潘启宝 2026-05-15 17:45:46 星期五 */
2
2
  import e from "./with-speech-synthesis/index.js";
3
3
  export { e as withSpeechSynthesis };
4
4
  /* 独立思考,明辨是非 */
@@ -1,7 +1,4 @@
1
- import React from 'react';
2
- import type { SpeechSynthesisHandles, SpeechSynthesisProps } from './interface';
3
- declare const withSpeechSynthesis: {
4
- <P extends object>(WrappedComponent: React.ComponentType<P>): React.NamedExoticComponent<React.PropsWithoutRef<SpeechSynthesisProps & P> & React.RefAttributes<SpeechSynthesisHandles>>;
5
- displayName: string;
6
- };
1
+ import Component from './withSpeechSynthesis';
2
+ declare const withSpeechSynthesis: typeof Component;
7
3
  export default withSpeechSynthesis;
4
+ export type { SpeechSynthesisHandles, SpeechSynthesisProps } from './interface';
@@ -1,75 +1,7 @@
1
- /* 潘启宝 2026-04-23 09:23:27 星期四 */
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";
8
- //#region components/common/higher-order/with-speech-synthesis/index.tsx
9
- var 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(() => {
12
- b && (window.speechSynthesis.cancel(), _(!1), y(null));
13
- }, [b]), S = n(() => {
14
- if (!b) return;
15
- x();
16
- let e = h.getText?.() ?? h.text;
17
- if (!e) return;
18
- let t = new SpeechSynthesisUtterance(e);
19
- y(t);
20
- let n = () => {
21
- _(!1), y(null);
22
- };
23
- t.onstart = () => _(!0), t.onend = n, t.onerror = n, t.onpause = () => _(!1), t.onresume = () => _(!0);
24
- try {
25
- window.speechSynthesis.speak(t);
26
- } catch (e) {
27
- console.error("Speech synthesis failed:", e), n();
28
- }
29
- }, [
30
- x,
31
- b,
32
- h.getText,
33
- h.text
34
- ]), C = n(() => {
35
- b && v && window.speechSynthesis.pause();
36
- }, [b, v]), w = n(() => {
37
- b && v && window.speechSynthesis.resume();
38
- }, [b, v]), T = n((e) => {
39
- e.preventDefault(), e.stopPropagation(), g ? C() : S(), m.onClick?.(e);
40
- }, [
41
- g,
42
- C,
43
- S,
44
- m.onClick
45
- ]);
46
- if (r(() => x, [x]), i(t, () => ({
47
- cancel: x,
48
- speak: S,
49
- pause: C,
50
- resume: w
51
- })), !b) return null;
52
- if (p) {
53
- let { label: e, text: t, children: n, ...r } = m;
54
- return /* @__PURE__ */ s(f, {
55
- ...h,
56
- type: "text",
57
- size: "mini",
58
- icon: s(g ? c : d, {}),
59
- ...r,
60
- onClick: T,
61
- children: e || t || n
62
- });
63
- }
64
- return /* @__PURE__ */ s(g ? l : u, {
65
- ...h.iconProps,
66
- onClick: T,
67
- style: { cursor: "pointer" }
68
- });
69
- });
70
- return p.displayName = `WithSpeechSynthesis.${f.displayName || f.name || "SpeechSynthesis"}`, t(p);
71
- };
72
- f.displayName = "withSpeechSynthesis";
1
+ /* 潘启宝 2026-05-15 17:45:46 星期五 */
2
+ import e from "./withSpeechSynthesis.js";
3
+ //#region components/common/higher-order/with-speech-synthesis/index.ts
4
+ var t = Object.assign(e, {});
73
5
  //#endregion
74
- export { f as default };
6
+ export { t as default };
75
7
  /* 独立思考,明辨是非 */
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import type { SpeechSynthesisHandles, SpeechSynthesisProps } from './interface';
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
+ export default withSpeechSynthesis;
@@ -0,0 +1,75 @@
1
+ /* 潘启宝 2026-05-15 17:45:46 星期五 */
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";
8
+ //#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(() => {
12
+ b && (window.speechSynthesis.cancel(), _(!1), y(null));
13
+ }, [b]), S = n(() => {
14
+ if (!b) return;
15
+ x();
16
+ let e = h.getText?.() ?? h.text;
17
+ if (!e) return;
18
+ let t = new SpeechSynthesisUtterance(e);
19
+ y(t);
20
+ let n = () => {
21
+ _(!1), y(null);
22
+ };
23
+ t.onstart = () => _(!0), t.onend = n, t.onerror = n, t.onpause = () => _(!1), t.onresume = () => _(!0);
24
+ try {
25
+ window.speechSynthesis.speak(t);
26
+ } catch (e) {
27
+ console.error("Speech synthesis failed:", e), n();
28
+ }
29
+ }, [
30
+ x,
31
+ b,
32
+ h.getText,
33
+ h.text
34
+ ]), C = n(() => {
35
+ b && v && window.speechSynthesis.pause();
36
+ }, [b, v]), w = n(() => {
37
+ b && v && window.speechSynthesis.resume();
38
+ }, [b, v]), T = n((e) => {
39
+ e.preventDefault(), e.stopPropagation(), g ? C() : S(), m.onClick?.(e);
40
+ }, [
41
+ g,
42
+ C,
43
+ S,
44
+ m.onClick
45
+ ]);
46
+ if (r(() => x, [x]), i(t, () => ({
47
+ cancel: x,
48
+ speak: S,
49
+ pause: C,
50
+ resume: w
51
+ })), !b) return null;
52
+ if (p) {
53
+ let { label: e, text: t, children: n, ...r } = m;
54
+ return /* @__PURE__ */ s(f, {
55
+ ...h,
56
+ type: "text",
57
+ size: "mini",
58
+ icon: s(g ? c : d, {}),
59
+ ...r,
60
+ onClick: T,
61
+ children: e || t || n
62
+ });
63
+ }
64
+ return /* @__PURE__ */ s(g ? l : u, {
65
+ ...h.iconProps,
66
+ onClick: T,
67
+ style: { cursor: "pointer" }
68
+ });
69
+ });
70
+ return p.displayName = `WithSpeechSynthesis.${f.displayName || f.name || "SpeechSynthesis"}`, t(p);
71
+ }
72
+ f.displayName = "withSpeechSynthesis";
73
+ //#endregion
74
+ export { f as default };
75
+ /* 独立思考,明辨是非 */
@@ -1,4 +1,4 @@
1
- /* 潘启宝 2026-04-23 09:23:27 星期四 */
1
+ /* 潘启宝 2026-05-15 17:45:46 星期五 */
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,9 +1,9 @@
1
- /* 潘启宝 2026-04-23 09:23:27 星期四 */
2
- import e from "react";
1
+ /* 潘启宝 2026-05-15 17:45:46 星期五 */
2
+ import { useRef as e } from "react";
3
3
  //#region components/common/hooks/create-update-effect/index.ts
4
4
  function t(t) {
5
5
  return (n, r) => {
6
- let i = e.useRef(!1);
6
+ let i = e(!1);
7
7
  t(() => () => {
8
8
  i.current = !1;
9
9
  }, []), t(() => i.current ? n() : (i.current = !0, () => {}), r);
@@ -1,4 +1,4 @@
1
- export declare const SYNC_STORAGE_EVENT_NAME = "AHOOKS_SYNC_STORAGE_EVENT_NAME";
1
+ export declare const SYNC_STORAGE_EVENT_NAME = "PQB_HOOKS_SYNC_STORAGE_EVENT_NAME";
2
2
  export type SetState<S> = S | ((prevState?: S) => S);
3
3
  export interface Options<T> {
4
4
  defaultValue?: T | (() => T);
@@ -1,4 +1,4 @@
1
- /* 潘启宝 2026-04-23 09:23:27 星期四 */
1
+ /* 潘启宝 2026-05-15 17:45:46 星期五 */
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";
@@ -6,7 +6,7 @@ import i from "../use-event-listener/index.js";
6
6
  import a from "../use-mount/index.js";
7
7
  import { useRef as o, useState as s } from "react";
8
8
  //#region components/common/hooks/create-use-storage-state/index.ts
9
- var c = "AHOOKS_SYNC_STORAGE_EVENT_NAME";
9
+ var c = "PQB_HOOKS_SYNC_STORAGE_EVENT_NAME";
10
10
  function l(l) {
11
11
  function u(u, d = {}) {
12
12
  let f, { listenStorageChange: p = !1, getInitialValueInEffect: m = !1 } = d, h = e(d.serializer) ? d.serializer : JSON.stringify, g = e(d.deserializer) ? d.deserializer : JSON.parse, _ = e(d.onError) ? d.onError : console.error;
package/hooks/index.d.ts CHANGED
@@ -80,9 +80,9 @@ export { default as useUrlState } from './use-url-state';
80
80
  export { default as useVirtualList } from './use-virtual-list';
81
81
  export { default as useWebSocket } from './use-web-socket';
82
82
  export { default as useWhyDidYouUpdate } from './use-why-did-you-update';
83
+ export { default as useEffectEvent } from './use-effect-event';
83
84
  export { default as useForceUpdate } from './use-force-update';
84
85
  export { default as useId } from './use-id';
85
- export { default as useInView } from './use-in-view';
86
86
  export { default as useIntersectionObserver } from './use-intersection-observer';
87
87
  export { default as useIntersectionObservers } from './use-intersection-observers';
88
88
  export { default as useIsFirstRender } from './use-is-first-render';
@@ -90,7 +90,6 @@ export { default as useKeyboardEvent } from './use-keyboard-event';
90
90
  export { default as useListenWindowResize } from './use-listen-window-resize';
91
91
  export { default as useMedia } from './use-media';
92
92
  export { default as useMergeProps } from './use-merge-props';
93
- export { default as useMergeValue } from './use-merge-value';
94
93
  export { default as useMutationObservers } from './use-mutation-observers';
95
94
  export { default as useOnlineStatus } from './use-online-status';
96
95
  export { default as useOverflowHidden } from './use-overflow-hidden';