@unicom-cloud/ui-common 0.1.6 → 0.1.8

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 (399) hide show
  1. package/Development.js +1 -1
  2. package/Empty.js +1 -1
  3. package/Flex.js +1 -1
  4. package/Motion.js +9 -0
  5. package/Progress.js +1 -1
  6. package/ResizeObserver.js +10 -0
  7. package/Space.js +1 -1
  8. package/SuspenseFallbackTest.js +1 -1
  9. package/TransitionGroup.js +30 -29
  10. package/development/index.js +38 -27
  11. package/empty/index.js +36 -32
  12. package/flex/index.js +56 -50
  13. package/flex/interface.js +1 -1
  14. package/higher-order/index.js +1 -1
  15. package/higher-order/with-speech-synthesis/index.js +33 -37
  16. package/higher-order/withSpeechSynthesis.js +1 -1
  17. package/hooks/create-deep-compare-effect/index.js +1 -1
  18. package/hooks/create-update-effect/index.js +1 -1
  19. package/hooks/create-use-storage-state/index.js +1 -1
  20. package/hooks/createDeepCompareEffect.js +1 -1
  21. package/hooks/createUpdateEffect.js +1 -1
  22. package/hooks/createUseStorageState.js +1 -1
  23. package/hooks/index.js +181 -173
  24. package/hooks/use-async-effect/index.js +1 -1
  25. package/hooks/use-boolean/index.js +1 -1
  26. package/hooks/use-click-away/index.js +19 -20
  27. package/hooks/use-computed-state/index.js +1 -1
  28. package/hooks/use-controllable-value/index.js +5 -5
  29. package/hooks/use-cookie-state/index.js +1 -1
  30. package/hooks/use-count-down/index.js +3 -3
  31. package/hooks/use-counter/index.js +1 -1
  32. package/hooks/use-create/index.js +1 -1
  33. package/hooks/use-creation/index.js +1 -1
  34. package/hooks/use-debounce/index.js +1 -1
  35. package/hooks/use-debounce-effect/index.js +1 -1
  36. package/hooks/use-debounce-fn/index.js +1 -1
  37. package/hooks/use-deep-compare-effect/index.js +1 -1
  38. package/hooks/use-deep-compare-layout-effect/index.js +1 -1
  39. package/hooks/use-document-visibility/index.js +1 -1
  40. package/hooks/use-drag/index.js +10 -10
  41. package/hooks/use-drop/index.js +1 -1
  42. package/hooks/use-event/index.js +10 -0
  43. package/hooks/use-event-listener/index.js +15 -16
  44. package/hooks/use-event-target/index.js +3 -3
  45. package/hooks/use-external/index.js +1 -1
  46. package/hooks/use-favicon/index.js +1 -1
  47. package/hooks/use-focus-within/index.js +1 -1
  48. package/hooks/use-force-update/index.js +1 -1
  49. package/hooks/use-fullscreen/index.js +13 -13
  50. package/hooks/use-get-state/index.js +6 -6
  51. package/hooks/use-history-travel/index.js +18 -18
  52. package/hooks/use-hover/index.js +1 -1
  53. package/hooks/use-id/index.js +1 -1
  54. package/hooks/use-in-view/index.js +1 -1
  55. package/hooks/use-in-viewport/index.js +17 -18
  56. package/hooks/use-infinite-scroll/index.js +1 -1
  57. package/hooks/use-intersection-observer/index.js +7 -6
  58. package/hooks/use-intersection-observers/index.js +34 -26
  59. package/hooks/use-interval/index.js +7 -7
  60. package/hooks/use-is-first-render/index.js +1 -1
  61. package/hooks/use-isomorphic-layout-effect/index.js +1 -1
  62. package/hooks/use-key-press/index.js +21 -21
  63. package/hooks/use-keyboard-event/index.js +1 -1
  64. package/hooks/use-latest/index.js +1 -1
  65. package/hooks/use-listen-window-resize/index.js +4 -4
  66. package/hooks/use-local-storage-state/index.js +1 -1
  67. package/hooks/use-lock-fn/index.js +1 -1
  68. package/hooks/use-long-press/index.js +24 -24
  69. package/hooks/use-map/index.js +1 -1
  70. package/hooks/use-media/index.js +1 -1
  71. package/hooks/use-memo/index.js +9 -0
  72. package/hooks/use-memoized-fn/index.js +1 -1
  73. package/hooks/use-merge-props/index.js +1 -1
  74. package/hooks/use-merge-value/index.js +1 -1
  75. package/hooks/use-mount/index.js +1 -1
  76. package/hooks/use-mouse/index.js +1 -1
  77. package/hooks/use-move/index.js +69 -0
  78. package/hooks/use-mutation-observer/index.js +9 -9
  79. package/hooks/use-mutation-observers/index.js +33 -25
  80. package/hooks/use-network/index.js +1 -1
  81. package/hooks/use-online-status/index.js +1 -1
  82. package/hooks/use-overflow-hidden/index.js +1 -1
  83. package/hooks/use-override-ref/index.js +3 -3
  84. package/hooks/use-pagination/index.js +1 -1
  85. package/hooks/use-persist-callback/index.js +1 -1
  86. package/hooks/use-prefers-color-scheme-dark/index.js +1 -1
  87. package/hooks/use-previous/index.js +1 -1
  88. package/hooks/use-raf-interval/index.js +15 -15
  89. package/hooks/use-raf-state/index.js +1 -1
  90. package/hooks/use-raf-timeout/index.js +3 -3
  91. package/hooks/use-reactive/index.js +7 -7
  92. package/hooks/use-ref-latest/index.js +1 -1
  93. package/hooks/use-refs/index.js +4 -4
  94. package/hooks/use-request/index.js +1 -1
  95. package/hooks/use-request/src/Fetch.js +1 -1
  96. package/hooks/use-request/src/plugins/useAutoRunPlugin.js +1 -1
  97. package/hooks/use-request/src/plugins/useCachePlugin.js +3 -3
  98. package/hooks/use-request/src/plugins/useDebouncePlugin.js +1 -1
  99. package/hooks/use-request/src/plugins/useLoadingDelayPlugin.js +8 -8
  100. package/hooks/use-request/src/plugins/usePollingPlugin.js +13 -13
  101. package/hooks/use-request/src/plugins/useRefreshOnWindowFocusPlugin.js +3 -3
  102. package/hooks/use-request/src/plugins/useRetryPlugin.js +5 -5
  103. package/hooks/use-request/src/plugins/useThrottlePlugin.js +3 -3
  104. package/hooks/use-request/src/useRequest.js +1 -1
  105. package/hooks/use-request/src/useRequestImplement.js +7 -7
  106. package/hooks/use-request/src/utils/cache.js +1 -1
  107. package/hooks/use-request/src/utils/cachePromise.js +1 -1
  108. package/hooks/use-request/src/utils/cacheSubscribe.js +1 -1
  109. package/hooks/use-request/src/utils/isDocumentVisible.js +1 -1
  110. package/hooks/use-request/src/utils/isOnline.js +1 -1
  111. package/hooks/use-request/src/utils/limit.js +1 -1
  112. package/hooks/use-request/src/utils/subscribeFocus.js +1 -1
  113. package/hooks/use-request/src/utils/subscribeReVisible.js +1 -1
  114. package/hooks/use-reset-state/index.js +7 -7
  115. package/hooks/use-resize-observer/index.js +1 -1
  116. package/hooks/use-resize-observers/index.js +34 -26
  117. package/hooks/use-responsive/index.js +1 -1
  118. package/hooks/use-safe-state/index.js +4 -4
  119. package/hooks/use-scroll/index.js +1 -1
  120. package/hooks/use-selections/index.js +1 -1
  121. package/hooks/use-session-storage-state/index.js +1 -1
  122. package/hooks/use-set/index.js +1 -1
  123. package/hooks/use-set-state/index.js +1 -1
  124. package/hooks/use-size/index.js +20 -23
  125. package/hooks/use-state-callback/index.js +6 -6
  126. package/hooks/use-state-with-promise/index.js +1 -1
  127. package/hooks/use-sync-state/index.js +15 -0
  128. package/hooks/use-text-selection/index.js +13 -13
  129. package/hooks/use-theme/index.js +1 -1
  130. package/hooks/use-throttle/index.js +1 -1
  131. package/hooks/use-throttle-effect/index.js +1 -1
  132. package/hooks/use-throttle-fn/index.js +6 -6
  133. package/hooks/use-timeout/index.js +3 -3
  134. package/hooks/use-title/index.js +1 -1
  135. package/hooks/use-toggle/index.js +1 -1
  136. package/hooks/use-tracked-effect/index.js +1 -1
  137. package/hooks/use-unmount/index.js +1 -1
  138. package/hooks/use-unmounted-ref/index.js +4 -4
  139. package/hooks/use-update/index.js +1 -1
  140. package/hooks/use-update-effect/index.js +1 -1
  141. package/hooks/use-update-layout-effect/index.js +1 -1
  142. package/hooks/use-url-state/index.js +3 -3
  143. package/hooks/use-virtual-list/index.js +10 -10
  144. package/hooks/use-watch/index.js +1 -1
  145. package/hooks/use-web-socket/index.js +30 -30
  146. package/hooks/use-why-did-you-update/index.js +1 -1
  147. package/hooks/use-window-size/index.js +28 -25
  148. package/hooks/useAsyncEffect.js +1 -1
  149. package/hooks/useBoolean.js +1 -1
  150. package/hooks/useClickAway.js +4 -5
  151. package/hooks/useComputedState.js +1 -1
  152. package/hooks/useControllableValue.js +1 -1
  153. package/hooks/useCookieState.js +1 -1
  154. package/hooks/useCountDown.js +1 -1
  155. package/hooks/useCounter.js +1 -1
  156. package/hooks/useCreate.js +1 -1
  157. package/hooks/useCreation.js +1 -1
  158. package/hooks/useDebounce.js +1 -1
  159. package/hooks/useDebounceEffect.js +1 -1
  160. package/hooks/useDebounceFn.js +1 -1
  161. package/hooks/useDeepCompareEffect.js +1 -1
  162. package/hooks/useDeepCompareLayoutEffect.js +1 -1
  163. package/hooks/useDocumentVisibility.js +1 -1
  164. package/hooks/useDrag.js +1 -1
  165. package/hooks/useDrop.js +1 -1
  166. package/hooks/useEvent.js +7 -0
  167. package/hooks/useEventListener.js +4 -5
  168. package/hooks/useEventTarget.js +1 -1
  169. package/hooks/useExternal.js +1 -1
  170. package/hooks/useFavicon.js +1 -1
  171. package/hooks/useFocusWithin.js +1 -1
  172. package/hooks/useForceUpdate.js +1 -1
  173. package/hooks/useFullscreen.js +1 -1
  174. package/hooks/useGetState.js +1 -1
  175. package/hooks/useHistoryTravel.js +1 -1
  176. package/hooks/useHover.js +1 -1
  177. package/hooks/useId.js +1 -1
  178. package/hooks/useInView.js +1 -1
  179. package/hooks/useInViewport.js +4 -5
  180. package/hooks/useInfiniteScroll.js +1 -1
  181. package/hooks/useIntersectionObserver.js +5 -4
  182. package/hooks/useIntersectionObservers.js +11 -7
  183. package/hooks/useInterval.js +1 -1
  184. package/hooks/useIsFirstRender.js +1 -1
  185. package/hooks/useIsomorphicLayoutEffect.js +1 -1
  186. package/hooks/useKeyPress.js +1 -1
  187. package/hooks/useKeyboardEvent.js +1 -1
  188. package/hooks/useLatest.js +1 -1
  189. package/hooks/useListenWindowResize.js +1 -1
  190. package/hooks/useLocalStorageState.js +1 -1
  191. package/hooks/useLockFn.js +1 -1
  192. package/hooks/useLongPress.js +1 -1
  193. package/hooks/useMap.js +1 -1
  194. package/hooks/useMedia.js +1 -1
  195. package/hooks/useMemo.js +6 -0
  196. package/hooks/useMemoizedFn.js +1 -1
  197. package/hooks/useMergeProps.js +1 -1
  198. package/hooks/useMergeValue.js +1 -1
  199. package/hooks/useMount.js +1 -1
  200. package/hooks/useMouse.js +1 -1
  201. package/hooks/useMove.js +10 -0
  202. package/hooks/useMutationObserver.js +1 -1
  203. package/hooks/useMutationObservers.js +11 -7
  204. package/hooks/useNetwork.js +1 -1
  205. package/hooks/useOnlineStatus.js +1 -1
  206. package/hooks/useOverflowHidden.js +1 -1
  207. package/hooks/useOverrideRef.js +3 -3
  208. package/hooks/usePagination.js +1 -1
  209. package/hooks/usePersistCallback.js +1 -1
  210. package/hooks/usePrefersColorSchemeDark.js +1 -1
  211. package/hooks/usePrevious.js +1 -1
  212. package/hooks/useRafInterval.js +1 -1
  213. package/hooks/useRafState.js +1 -1
  214. package/hooks/useRafTimeout.js +1 -1
  215. package/hooks/useReactive.js +1 -1
  216. package/hooks/useRefLatest.js +1 -1
  217. package/hooks/useRefs.js +1 -1
  218. package/hooks/useRequest.js +1 -1
  219. package/hooks/useResetState.js +1 -1
  220. package/hooks/useResizeObserver.js +1 -1
  221. package/hooks/useResizeObservers.js +11 -7
  222. package/hooks/useResponsive.js +1 -1
  223. package/hooks/useSafeState.js +1 -1
  224. package/hooks/useScroll.js +1 -1
  225. package/hooks/useSelections.js +1 -1
  226. package/hooks/useSessionStorageState.js +1 -1
  227. package/hooks/useSet.js +1 -1
  228. package/hooks/useSetState.js +1 -1
  229. package/hooks/useSize.js +4 -3
  230. package/hooks/useStateCallback.js +1 -1
  231. package/hooks/useStateWithPromise.js +1 -1
  232. package/hooks/useSyncState.js +10 -0
  233. package/hooks/useTextSelection.js +1 -1
  234. package/hooks/useTheme.js +1 -1
  235. package/hooks/useThrottle.js +1 -1
  236. package/hooks/useThrottleEffect.js +1 -1
  237. package/hooks/useThrottleFn.js +1 -1
  238. package/hooks/useTimeout.js +1 -1
  239. package/hooks/useTitle.js +1 -1
  240. package/hooks/useToggle.js +1 -1
  241. package/hooks/useTrackedEffect.js +1 -1
  242. package/hooks/useUnmount.js +1 -1
  243. package/hooks/useUnmountedRef.js +1 -1
  244. package/hooks/useUpdate.js +1 -1
  245. package/hooks/useUpdateEffect.js +1 -1
  246. package/hooks/useUpdateLayoutEffect.js +1 -1
  247. package/hooks/useUrlState.js +1 -1
  248. package/hooks/useVirtualList.js +1 -1
  249. package/hooks/useWatch.js +1 -1
  250. package/hooks/useWebSocket.js +1 -1
  251. package/hooks/useWhyDidYouUpdate.js +1 -1
  252. package/hooks/useWindowSize.js +4 -3
  253. package/hooks/utils/createEffectWithTarget.js +11 -12
  254. package/hooks/utils/depsAreSame.js +1 -1
  255. package/hooks/utils/depsEqual.js +1 -1
  256. package/hooks/utils/domTarget.js +1 -1
  257. package/hooks/utils/getDocumentOrShadow.js +5 -6
  258. package/hooks/utils/index.js +1 -1
  259. package/hooks/utils/isAppleDevice.js +1 -1
  260. package/hooks/utils/isBrowser.js +1 -1
  261. package/hooks/utils/isDev.js +1 -1
  262. package/hooks/utils/rect.js +1 -1
  263. package/hooks/utils/useDeepCompareWithTarget.js +4 -4
  264. package/hooks/utils/useEffectWithTarget.js +1 -1
  265. package/hooks/utils/useIsomorphicLayoutEffectWithTarget.js +1 -1
  266. package/hooks/utils/useLayoutEffectWithTarget.js +1 -1
  267. package/hooks/utils.js +1 -1
  268. package/icons/file/index.js +31 -24
  269. package/icons/file.js +1 -1
  270. package/index.js +47 -46
  271. package/motion/CSSMotion.js +102 -0
  272. package/motion/CSSMotionList.js +100 -0
  273. package/motion/context.js +14 -0
  274. package/motion/hooks/useDomMotionEvents.js +21 -0
  275. package/motion/hooks/useNextFrame.js +24 -0
  276. package/motion/hooks/useStatus.js +121 -0
  277. package/motion/hooks/useStepQueue.js +44 -0
  278. package/motion/index.js +9 -0
  279. package/motion/interface.js +14 -0
  280. package/motion/util/diff.js +56 -0
  281. package/motion/util/motion.js +56 -0
  282. package/package.json +1 -1
  283. package/progress/index.js +1 -1
  284. package/resize-observer/Collection.js +25 -0
  285. package/resize-observer/SingleObserver.js +48 -0
  286. package/resize-observer/index.js +27 -0
  287. package/resize-observer/observerUtil.js +22 -0
  288. package/space/index.js +65 -52
  289. package/suspense-fallback-test/index.js +1 -1
  290. package/transition-group/CSSTransition.js +59 -54
  291. package/transition-group/ChildMapping.js +68 -0
  292. package/transition-group/PqbCSSTransition.js +22 -18
  293. package/transition-group/ReplaceTransition.js +7 -7
  294. package/transition-group/SwitchTransition.js +1 -1
  295. package/transition-group/Transition.js +56 -52
  296. package/transition-group/TransitionGroup.js +2 -3
  297. package/transition-group/TransitionGroupContext.js +1 -1
  298. package/transition-group/index.js +30 -29
  299. package/types/hooks/index.d.ts +4 -0
  300. package/types/hooks/use-event/index.d.ts +2 -0
  301. package/types/hooks/use-intersection-observers/index.d.ts +3 -1
  302. package/types/hooks/use-listen-window-resize/index.d.ts +4 -4
  303. package/types/hooks/use-memo/index.d.ts +2 -0
  304. package/types/hooks/use-move/index.d.ts +4 -0
  305. package/types/hooks/use-mutation-observers/index.d.ts +3 -1
  306. package/types/hooks/use-resize-observers/index.d.ts +3 -1
  307. package/types/hooks/use-size/index.d.ts +1 -1
  308. package/types/hooks/use-sync-state/index.d.ts +10 -0
  309. package/types/hooks/use-window-size/index.d.ts +2 -3
  310. package/types/motion/CSSMotion.d.ts +77 -0
  311. package/types/motion/CSSMotionList.d.ts +34 -0
  312. package/types/motion/context.d.ts +9 -0
  313. package/types/motion/hooks/useDomMotionEvents.d.ts +3 -0
  314. package/types/motion/hooks/useNextFrame.d.ts +7 -0
  315. package/types/motion/hooks/useStatus.d.ts +5 -0
  316. package/types/motion/hooks/useStepQueue.d.ts +8 -0
  317. package/types/motion/index.d.ts +9 -0
  318. package/types/motion/interface.d.ts +22 -0
  319. package/types/motion/util/diff.d.ts +20 -0
  320. package/types/motion/util/motion.d.ts +10 -0
  321. package/types/resize-observer/Collection.d.ts +9 -0
  322. package/types/resize-observer/SingleObserver.d.ts +7 -0
  323. package/types/resize-observer/index.d.ts +7 -0
  324. package/types/resize-observer/interface.d.ts +25 -0
  325. package/types/resize-observer/observerUtil.d.ts +3 -0
  326. package/types/space/interface.d.ts +1 -1
  327. package/types/transition-group/CSSTransition.d.ts +0 -1
  328. package/types/transition-group/{utils/ChildMapping.d.ts → ChildMapping.d.ts} +4 -4
  329. package/types/transition-group/SwitchTransition.d.ts +3 -3
  330. package/types/transition-group/Transition.d.ts +1 -1
  331. package/types/transition-group/TransitionGroup.d.ts +1 -1
  332. package/types/transition-group/index.d.ts +1 -1
  333. package/types/utils/callbackOriginRef.d.ts +4 -0
  334. package/types/utils/dom.d.ts +2 -1
  335. package/types/utils/findRootElement.d.ts +23 -0
  336. package/types/utils/index.d.ts +4 -2
  337. package/types/utils/is.d.ts +5 -4
  338. package/types/utils/lodash.d.ts +2 -1
  339. package/types/utils/ref.d.ts +27 -0
  340. package/types/utils/setCreateRoot.d.ts +13 -0
  341. package/types/utils/toArray.d.ts +3 -3
  342. package/utils/callbackOriginRef.js +11 -0
  343. package/utils/caseName.js +1 -1
  344. package/utils/className.js +1 -1
  345. package/utils/compute.js +1 -1
  346. package/utils/constant.js +1 -1
  347. package/utils/copy.js +1 -1
  348. package/utils/date.js +1 -1
  349. package/utils/dayjs.js +1 -1
  350. package/utils/dom.js +12 -10
  351. package/utils/emitter.js +1 -1
  352. package/utils/fileToURL.js +1 -1
  353. package/utils/fillNBSP.js +1 -1
  354. package/utils/findRootElement.js +28 -0
  355. package/utils/findScrollParent.js +1 -1
  356. package/utils/getHighlightText.js +1 -1
  357. package/utils/getHotkeyHandler.js +1 -1
  358. package/utils/getStringLength.js +1 -1
  359. package/utils/include.js +1 -1
  360. package/utils/index.js +341 -329
  361. package/utils/intersectionObserver.js +1 -1
  362. package/utils/is.js +72 -81
  363. package/utils/keyboardCode.js +1 -1
  364. package/utils/lodash.js +45 -43
  365. package/utils/math.js +1 -1
  366. package/utils/mergeProps.js +1 -1
  367. package/utils/mergedToString.js +1 -1
  368. package/utils/mutationObserver.js +1 -1
  369. package/utils/omit.js +1 -1
  370. package/utils/pad.js +1 -1
  371. package/utils/pick.js +1 -1
  372. package/utils/pinyin.js +1 -1
  373. package/utils/react19Adapter.js +2 -2
  374. package/utils/ref.js +41 -0
  375. package/utils/resizeObserver.js +1 -1
  376. package/utils/saveAs.js +1 -1
  377. package/utils/screenfull.js +1 -1
  378. package/utils/scrollIntoViewIfNeeded.js +1 -1
  379. package/utils/setCreateRoot.js +53 -0
  380. package/utils/setDarkTheme.js +1 -1
  381. package/utils/setDir.js +1 -1
  382. package/utils/setPrimaryColor.js +1 -1
  383. package/utils/setTheme.js +1 -1
  384. package/utils/string.js +1 -1
  385. package/utils/style.js +1 -1
  386. package/utils/throttleByRaf.js +1 -1
  387. package/utils/throttleByRaf2.js +1 -1
  388. package/utils/tinycolor.js +1 -1
  389. package/utils/toArray.js +9 -9
  390. package/utils/tree.js +1 -1
  391. package/utils/tween.js +1 -1
  392. package/utils/uuid.js +1 -1
  393. package/utils/validate.js +1 -1
  394. package/utils/warning.js +1 -1
  395. package/transition-group/utils/ChildMapping.js +0 -66
  396. package/types/utils/reactDOM.d.ts +0 -34
  397. package/types/utils/supportRef.d.ts +0 -3
  398. package/utils/reactDOM.js +0 -87
  399. package/utils/supportRef.js +0 -10
@@ -1,3 +1,4 @@
1
+ export * from './callbackOriginRef';
1
2
  export * from './caseName';
2
3
  export * from './className';
3
4
  export * from './constant';
@@ -8,6 +9,7 @@ export * from './dom';
8
9
  export * from './emitter';
9
10
  export * from './fileToURL';
10
11
  export * from './fillNBSP';
12
+ export * from './findRootElement';
11
13
  export * from './findScrollParent';
12
14
  export * from './getHighlightText';
13
15
  export * from './getHotkeyHandler';
@@ -24,18 +26,18 @@ export * from './omit';
24
26
  export * from './pad';
25
27
  export * from './pick';
26
28
  export * from './pinyin';
27
- export * from './reactDOM';
29
+ export * from './ref';
28
30
  export * from './resizeObserver';
29
31
  export * from './saveAs';
30
32
  export * from './screenfull';
31
33
  export * from './scrollIntoViewIfNeeded';
34
+ export * from './setCreateRoot';
32
35
  export * from './setDarkTheme';
33
36
  export * from './setDir';
34
37
  export * from './setPrimaryColor';
35
38
  export * from './setTheme';
36
39
  export * from './string';
37
40
  export * from './style';
38
- export * from './supportRef';
39
41
  export * from './throttleByRaf';
40
42
  export * from './tinycolor';
41
43
  export * from './toArray';
@@ -1,10 +1,11 @@
1
1
  import { is32Bit, isArguments, isArray, isArrayBuffer, isArrayLike, isArrayLikeObject, isBlob, isBoolean, isBuffer, isColorValue, isDate, isElement, isEmpty, isEmptyArray, isEmptyObject, isEmptyValue, isEqual, isEqualWith, isError, isEventTarget, isExist, isFile, isFinite, isFunction, isInteger, isJSON, isLength, isMap, isMatch, isMatchWith, isNaN, isNative, isNil, isNull, isNullOrUndefined, isNumber, isObject, isObjectLike, isPlainObject, isPromise, isReadableStream, isRegExp, isSafeInteger, isSet, isString, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet, isWindow } from '@unicom-cloud/utils/is';
2
2
  import { isDayjs } from 'dayjs';
3
+ import React from 'react';
3
4
  declare const isServerRendering: boolean;
4
5
  declare const isReact18: boolean, isReact19: boolean;
5
- export declare function isEmptyReactNode(content: any, trim?: boolean): boolean;
6
+ export declare function isEmptyReactNode(element: any, trim?: boolean): boolean;
7
+ export declare function isReactComponentAndNotFragment(element: React.ReactElement): element is never;
6
8
  export declare function isReactComponent(element: any): boolean;
7
- export declare function isClassComponent(element: any): boolean;
8
- export declare function isDOMElement(element: any): boolean;
9
- export declare function isForwardRefReact(object: any): boolean;
9
+ export declare function isReactClassComponent(element: any): boolean;
10
+ export declare function isElementByInstanceof(element: Element): boolean;
10
11
  export { is32Bit, isArguments, isArray, isArrayBuffer, isArrayLike, isArrayLikeObject, isBlob, isBoolean, isBuffer, isColorValue, isDate, isDayjs, isElement, isEmpty, isEmptyArray, isEmptyObject, isEmptyValue, isEqual, isEqualWith, isError, isEventTarget, isExist, isFile, isFinite, isFunction, isInteger, isJSON, isLength, isMap, isMatch, isMatchWith, isNaN, isNative, isNil, isNull, isNullOrUndefined, isNumber, isObject, isObjectLike, isPlainObject, isPromise, isReact18, isReact19, isReadableStream, isRegExp, isSafeInteger, isServerRendering, isSet, isString, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet, isWindow, };
@@ -42,6 +42,7 @@ import set from 'lodash/set';
42
42
  import setWith from 'lodash/setWith';
43
43
  import shuffle from 'lodash/shuffle';
44
44
  import snakeCase from 'lodash/snakeCase';
45
+ import sortBy from 'lodash/sortBy';
45
46
  import startCase from 'lodash/startCase';
46
47
  import throttle from 'lodash/throttle';
47
48
  import toPath from 'lodash/toPath';
@@ -57,4 +58,4 @@ import upperFirst from 'lodash/upperFirst';
57
58
  import without from 'lodash/without';
58
59
  import xor from 'lodash/xor';
59
60
  import zip from 'lodash/zip';
60
- export { assign, assignIn, at, camelCase, capitalize, castArray, chain, chunk, clone, cloneDeep, cloneDeepWith, cloneWith, compact, curry, debounce, defaults, defaultsDeep, defaultTo, difference, escape, findKey, flattenDeep, flow, get, groupBy, has, intersection, invert, invertBy, kebabCase, mean, memoize, merge, mergeWith, orderBy, partition, pullAll, result, sample, sampleSize, set, setWith, shuffle, snakeCase, startCase, throttle, toPath, truncate, union, uniq, uniqueId, unset, update, updateWith, upperCase, upperFirst, without, xor, zip, };
61
+ export { assign, assignIn, at, camelCase, capitalize, castArray, chain, chunk, clone, cloneDeep, cloneDeepWith, cloneWith, compact, curry, debounce, defaults, defaultsDeep, defaultTo, difference, escape, findKey, flattenDeep, flow, get, groupBy, has, intersection, invert, invertBy, kebabCase, mean, memoize, merge, mergeWith, orderBy, partition, pullAll, result, sample, sampleSize, set, setWith, shuffle, snakeCase, sortBy, startCase, throttle, toPath, truncate, union, uniq, uniqueId, unset, update, updateWith, upperCase, upperFirst, without, xor, zip, };
@@ -0,0 +1,27 @@
1
+ import React, { RefObject } from 'react';
2
+ export declare const fillRef: <T>(ref: RefObject<T>, node: T) => void;
3
+ /**
4
+ * Merge refs into one ref function to support ref passing.
5
+ */
6
+ export declare const composeRef: <T>(...refs: React.Ref<T>[]) => React.Ref<T>;
7
+ export declare const useComposeRef: <T>(...refs: React.Ref<T>[]) => React.Ref<T>;
8
+ export declare function supportRef(nodeOrComponent: React.ReactElement): boolean;
9
+ interface RefAttributes<T> extends React.Attributes {
10
+ ref: React.Ref<T>;
11
+ }
12
+ export declare const supportNodeRef: <T = unknown>(node: React.ReactNode) => node is React.ReactElement & RefAttributes<T>;
13
+ /**
14
+ * Returns the ref of a React element handling differences between React 19 and older versions.
15
+ * It will throw runtime error if the element is not a valid React element.
16
+ *
17
+ * @param element React.ReactElement
18
+ * @returns React.Ref<any> | null
19
+ */
20
+ export declare function getReactElementRef(element: React.ReactElement): React.Ref<unknown> | null;
21
+ /**
22
+ * In React 19. `ref` is not a property from node.
23
+ * But a property from `props.ref`.
24
+ * To check if `props.ref` exist or fallback to `ref`.
25
+ */
26
+ export declare const getNodeRef: typeof getReactElementRef;
27
+ export {};
@@ -0,0 +1,13 @@
1
+ import { ReactElement } from 'react';
2
+ type CreateRootFnType = (container: Element | DocumentFragment) => {
3
+ render: (element: ReactElement) => void;
4
+ unmount: () => void;
5
+ };
6
+ type RenderResult = {
7
+ render: (element: ReactElement) => void;
8
+ _unmount: () => void;
9
+ };
10
+ declare function setCreateRoot(v?: CreateRootFnType): void;
11
+ declare function render(node: ReactElement, el: Element | DocumentFragment): RenderResult;
12
+ export { render, setCreateRoot };
13
+ export default setCreateRoot;
@@ -1,13 +1,13 @@
1
1
  import React from 'react';
2
- interface ToArrayOptions {
2
+ interface Option {
3
3
  keepEmpty?: boolean;
4
4
  }
5
5
  /**
6
6
  * 将React子节点转换为数组
7
7
  * @param children React子节点
8
- * @param options 配置选项
8
+ * @param option 配置选项
9
9
  * @returns React元素数组
10
10
  */
11
- declare function toArray(children: React.ReactNode, options?: ToArrayOptions): React.ReactElement[];
11
+ declare function toArray(children: React.ReactNode, option?: Option): React.ReactElement[];
12
12
  export { toArray };
13
13
  export default toArray;
@@ -0,0 +1,11 @@
1
+ /* 2025-11-28 16:31:16 */
2
+ import { getReactElementRef as r, fillRef as l } from "./ref.js";
3
+ function n(e, t) {
4
+ if (!e) return;
5
+ const f = r(e);
6
+ f && l(f, t);
7
+ }
8
+ export {
9
+ n as callbackOriginRef,
10
+ n as default
11
+ };
package/utils/caseName.js CHANGED
@@ -1,4 +1,4 @@
1
- /* 2025-11-19 10:00:01 */
1
+ /* 2025-11-28 16:31:16 */
2
2
  import { default as f, default as t } from "@unicom-cloud/utils/case-name";
3
3
  export {
4
4
  f as caseName,
@@ -1,4 +1,4 @@
1
- /* 2025-11-19 10:00:01 */
1
+ /* 2025-11-28 16:31:16 */
2
2
  import { default as f, default as l } from "@unicom-cloud/utils/class-name";
3
3
  export {
4
4
  f as className,
package/utils/compute.js CHANGED
@@ -1,4 +1,4 @@
1
- /* 2025-11-19 10:00:01 */
1
+ /* 2025-11-28 16:31:16 */
2
2
  import "./is.js";
3
3
  import { isFunction as z, isElement as _ } from "@unicom-cloud/utils/is";
4
4
  const Y = (t, e) => !(e && t === "hidden" || t === "visible" || t === "clip"), E = (t) => {
package/utils/constant.js CHANGED
@@ -1,4 +1,4 @@
1
- /* 2025-11-19 10:00:01 */
1
+ /* 2025-11-28 16:31:16 */
2
2
  import o from "lodash/noop";
3
3
  import { UI_PC_KEY as m, UI_PC_THEME_DARK_CLASS_NAME as r } from "@unicom-cloud/utils/constant/ui";
4
4
  const _ = window.document.documentElement, t = o;
package/utils/copy.js CHANGED
@@ -1,4 +1,4 @@
1
- /* 2025-11-19 10:00:01 */
1
+ /* 2025-11-28 16:31:16 */
2
2
  import "@unicom-cloud/utils/clipboard-copy";
3
3
  import { default as r, default as t, default as d } from "@unicom-cloud/utils/clipboard-copy";
4
4
  export {
package/utils/date.js CHANGED
@@ -1,2 +1,2 @@
1
- /* 2025-11-19 10:00:01 */
1
+ /* 2025-11-28 16:31:16 */
2
2
  export * from "@unicom-cloud/utils/date";
package/utils/dayjs.js CHANGED
@@ -1,4 +1,4 @@
1
- /* 2025-11-19 10:00:01 */
1
+ /* 2025-11-28 16:31:16 */
2
2
  import e from "dayjs";
3
3
  import { default as y, default as F } from "dayjs";
4
4
  import r from "dayjs/plugin/advancedFormat";
package/utils/dom.js CHANGED
@@ -1,12 +1,13 @@
1
- /* 2025-11-19 10:00:01 */
2
- import { default as h, default as g } from "@unicom-cloud/utils/dom-helpers/reflow";
1
+ /* 2025-11-28 16:31:16 */
2
+ import { default as h } from "@unicom-cloud/utils/dom-helpers/canUseDOM";
3
+ import { default as y, default as E } from "@unicom-cloud/utils/dom-helpers/reflow";
3
4
  import { isServerRendering as o } from "./is.js";
4
- import { isEventTarget as i } from "@unicom-cloud/utils/is";
5
+ import { isEventTarget as f } from "@unicom-cloud/utils/is";
5
6
  function u(e, n, t, r) {
6
- o || i(e) && e.addEventListener(n, t, r || !1);
7
+ o || f(e) && e.addEventListener(n, t, r || !1);
7
8
  }
8
9
  function c(e, n, t, r) {
9
- o || i(e) && e.removeEventListener(n, t, r || !1);
10
+ o || f(e) && e.removeEventListener(n, t, r || !1);
10
11
  }
11
12
  function a(e, n) {
12
13
  if (!e) return !1;
@@ -20,7 +21,7 @@ function a(e, n) {
20
21
  }
21
22
  return !1;
22
23
  }
23
- function f(e) {
24
+ function i(e) {
24
25
  if (!(e instanceof HTMLElement) || [document.documentElement].includes(e))
25
26
  return !1;
26
27
  const n = window.getComputedStyle(e), t = ["auto", "scroll", "overlay"];
@@ -30,7 +31,7 @@ function d(e, n = document.documentElement) {
30
31
  const t = [];
31
32
  let r = e;
32
33
  for (; r && r !== n; )
33
- f(r) && t.push(r), r = r.parentElement;
34
+ i(r) && t.push(r), r = r.parentElement;
34
35
  return t;
35
36
  }
36
37
  function w(e, n) {
@@ -50,14 +51,15 @@ function m() {
50
51
  return window.document.body;
51
52
  }
52
53
  export {
54
+ h as canUseDOM,
53
55
  a as contains,
54
- h as forceReflow,
56
+ y as forceReflow,
55
57
  m as getBodyContainer,
56
58
  d as getScrollElements,
57
- f as isScrollElement,
59
+ i as isScrollElement,
58
60
  o as isServerRendering,
59
61
  c as off,
60
62
  u as on,
61
63
  w as parentContainsChildren,
62
- g as reflow
64
+ E as reflow
63
65
  };
package/utils/emitter.js CHANGED
@@ -1,4 +1,4 @@
1
- /* 2025-11-19 10:00:01 */
1
+ /* 2025-11-28 16:31:16 */
2
2
  import { default as a, default as f } from "@unicom-cloud/utils/emitter";
3
3
  export {
4
4
  a as default,
@@ -1,4 +1,4 @@
1
- /* 2025-11-19 10:00:01 */
1
+ /* 2025-11-28 16:31:16 */
2
2
  import { default as a, default as l } from "@unicom-cloud/utils/file/fileToURL";
3
3
  export {
4
4
  a as default,
package/utils/fillNBSP.js CHANGED
@@ -1,4 +1,4 @@
1
- /* 2025-11-19 10:00:01 */
1
+ /* 2025-11-28 16:31:16 */
2
2
  import "./is.js";
3
3
  import { isString as t } from "@unicom-cloud/utils/is";
4
4
  function n(e) {
@@ -0,0 +1,28 @@
1
+ /* 2025-11-28 16:31:16 */
2
+ import { Component as e } from "react";
3
+ import u from "react-dom";
4
+ import { isElementByInstanceof as n } from "./is.js";
5
+ import { getReactElementRef as c } from "./ref.js";
6
+ import { isFunction as i } from "@unicom-cloud/utils/is";
7
+ const m = u, f = m.findDOMNode;
8
+ function p(r) {
9
+ let t = r;
10
+ if (!t) return null;
11
+ {
12
+ if (t = r, n(t))
13
+ return t;
14
+ if (n(t?.dom))
15
+ return t.dom;
16
+ }
17
+ return t = r, t = t.current, n(t) || (t = o(t), n(t)) || (t = r, t = c(t), t && (t = t.current, t && (n(t) || (t = o(t), n(t))))) || (t = r, t = o(t), n(t)) ? t : (t = r, t instanceof e && i(f) ? f(t) : null);
18
+ }
19
+ function o(r) {
20
+ if (!r) return null;
21
+ const t = r.getRootElement;
22
+ if (i(t))
23
+ return t();
24
+ }
25
+ export {
26
+ p as default,
27
+ p as findRootElement
28
+ };
@@ -1,4 +1,4 @@
1
- /* 2025-11-19 10:00:01 */
1
+ /* 2025-11-28 16:31:16 */
2
2
  function i(o, l = !1) {
3
3
  if (!o) return document.documentElement;
4
4
  const n = getComputedStyle(o), r = n.position === "absolute", c = l ? /(auto|scroll|hidden)/ : /(auto|scroll)/;
@@ -1,4 +1,4 @@
1
- /* 2025-11-19 10:00:01 */
1
+ /* 2025-11-28 16:31:16 */
2
2
  import l from "lodash/escapeRegExp";
3
3
  import { cloneElement as m, createElement as n } from "react";
4
4
  import "./is.js";
@@ -1,4 +1,4 @@
1
- /* 2025-11-19 10:00:01 */
1
+ /* 2025-11-28 16:31:16 */
2
2
  import "./is.js";
3
3
  import { isNumber as o, isString as s } from "@unicom-cloud/utils/is";
4
4
  const e = (a) => JSON.stringify({
@@ -1,4 +1,4 @@
1
- /* 2025-11-19 10:00:01 */
1
+ /* 2025-11-28 16:31:16 */
2
2
  function l(t) {
3
3
  let n = 0;
4
4
  for (let e = 0; e < t.length; e++)
package/utils/include.js CHANGED
@@ -1,4 +1,4 @@
1
- /* 2025-11-19 10:00:01 */
1
+ /* 2025-11-28 16:31:16 */
2
2
  function f(c, t) {
3
3
  const e = {};
4
4
  return Object.keys(c).forEach((n) => {