@unicom-cloud/ui 0.8.54 → 0.8.56

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 (429) hide show
  1. package/Affix.js +36 -36
  2. package/Alert.js +41 -45
  3. package/Anchor.js +1 -1
  4. package/AutoComplete.js +40 -40
  5. package/Avatar.js +36 -36
  6. package/BackTop.js +26 -26
  7. package/Badge.js +43 -43
  8. package/Breadcrumb.js +17 -17
  9. package/Button.js +42 -42
  10. package/Calendar.js +54 -56
  11. package/Card.js +28 -28
  12. package/Carousel.js +42 -43
  13. package/Cascader.js +1 -1
  14. package/Checkbox.js +1 -1
  15. package/Collapse.js +1 -1
  16. package/ColorPicker.js +11 -580
  17. package/Comment.js +14 -14
  18. package/ConfigProvider.js +2 -2
  19. package/Copy.js +26 -26
  20. package/DatePicker.js +661 -670
  21. package/Descriptions.js +53 -53
  22. package/Divider.js +15 -15
  23. package/Draggable.js +16 -16
  24. package/Drawer.js +1 -1
  25. package/Dropdown.js +10 -10
  26. package/Empty.js +3 -3
  27. package/Form.js +10 -1410
  28. package/Grid.js +49 -49
  29. package/Icon.js +10 -10
  30. package/IconHover.js +2 -2
  31. package/Image.js +1 -1
  32. package/Input.js +1 -1
  33. package/InputNumber.js +7 -7
  34. package/InputTag.js +1 -1
  35. package/Layout.js +34 -34
  36. package/Link.js +26 -26
  37. package/List.js +39 -39
  38. package/Mentions.js +17 -17
  39. package/Menu.js +1 -1
  40. package/Message.js +3 -3
  41. package/Modal.js +1 -1
  42. package/Notice.js +4 -10
  43. package/Notification.js +3 -3
  44. package/OverflowEllipsis.js +18 -18
  45. package/PageHeader.js +26 -27
  46. package/Pagination.js +1 -1
  47. package/Picker.js +1 -1
  48. package/Popconfirm.js +15 -15
  49. package/Popover.js +22 -22
  50. package/Progress.js +18 -18
  51. package/Radio.js +2 -2
  52. package/Rate.js +40 -43
  53. package/ResizeBox.js +191 -192
  54. package/Result.js +17 -17
  55. package/Select.js +1 -1
  56. package/SelectView.js +56 -56
  57. package/Skeleton.js +35 -35
  58. package/Slider.js +81 -81
  59. package/Space.js +27 -27
  60. package/SpeechSynthesis.js +29 -32
  61. package/Spin.js +15 -15
  62. package/Statistic.js +54 -54
  63. package/Steps.js +44 -44
  64. package/Switch.js +39 -38
  65. package/Table.js +488 -488
  66. package/Tabs.js +1 -1
  67. package/Tag.js +13 -14
  68. package/TimePicker.js +68 -68
  69. package/Timeline.js +1 -1
  70. package/Tooltip.js +27 -28
  71. package/Transfer.js +29 -30
  72. package/Tree.js +1 -1
  73. package/TreeSelect.js +1 -1
  74. package/Trigger.js +53 -52
  75. package/Typography.js +2 -737
  76. package/Upload.js +1 -1
  77. package/VerificationCode.js +1 -1
  78. package/Version.js +1 -1
  79. package/Watermark.js +1 -1
  80. package/chunk/1mEO29GP.js +23 -0
  81. package/chunk/5pZ3ayqs.js +29 -0
  82. package/chunk/9Gh1afjL.js +23 -0
  83. package/chunk/B1S1OEw6.js +29 -0
  84. package/chunk/{RRWbBHK-.js → B2Bp3i5u.js} +221 -221
  85. package/chunk/B45v5S9k.js +209 -0
  86. package/chunk/B6fn5y_s.js +23 -0
  87. package/chunk/B9PsJar0.js +118 -0
  88. package/chunk/BA02BFUV.js +41 -0
  89. package/chunk/BCk8e9fj.js +29 -0
  90. package/chunk/BHK9zpXn.js +207 -0
  91. package/chunk/BHLTzWzi.js +29 -0
  92. package/chunk/BK1FKNAX.js +41 -0
  93. package/chunk/BM6dpkeM.js +32 -0
  94. package/chunk/{DQ3uFRJD.js → BP7xX86Q.js} +223 -202
  95. package/chunk/BWx1cVT_.js +66 -0
  96. package/chunk/BbI3gqVr.js +23 -0
  97. package/chunk/{CIc4yo9k.js → BbYzi8M0.js} +46 -46
  98. package/chunk/Be7oeWU8.js +34 -0
  99. package/chunk/BeM2hfks.js +88 -0
  100. package/chunk/BkHxm4sv.js +41 -0
  101. package/chunk/{BUQBof6z.js → Bl-ODC57.js} +206 -207
  102. package/chunk/BlKc_pDZ.js +678 -0
  103. package/chunk/{BzqZZHGK.js → Bny52uiG.js} +48 -48
  104. package/chunk/{PuuHmqnW.js → BpwDupra.js} +238 -238
  105. package/chunk/BqxwlITu.js +52 -0
  106. package/chunk/BuEC_zcc.js +278 -0
  107. package/chunk/{CqcZfQQ4.js → Bv8ZRDFt.js} +80 -80
  108. package/chunk/{DZGcv_9A.js → C-w9pFY-.js} +32 -32
  109. package/chunk/C2fspJbE.js +23 -0
  110. package/chunk/C7Okdv4u.js +34 -0
  111. package/chunk/C95ipQ6b.js +41 -0
  112. package/chunk/{BzMYgxgO.js → CF3Telny.js} +26 -26
  113. package/chunk/CPl52AZh.js +206 -0
  114. package/chunk/CXNW5Y2a.js +23 -0
  115. package/chunk/Cb_oWoGj.js +40 -0
  116. package/chunk/CcX2pBUh.js +46 -0
  117. package/chunk/{BdJcAQ0Q.js → CggcswbO.js} +18 -18
  118. package/chunk/CilQ012k.js +1796 -0
  119. package/chunk/CkAOsst1.js +73 -0
  120. package/chunk/CnY8SvgY.js +126 -0
  121. package/chunk/{CTSIr-Pr.js → CwXmtKib.js} +89 -101
  122. package/chunk/{C3I_L73_.js → CwjaGytU.js} +39 -40
  123. package/chunk/{DTgc2wl4.js → D6RTBH4C.js} +36 -36
  124. package/chunk/D6mVoX-C.js +116 -0
  125. package/chunk/D9TqtOhq.js +40 -0
  126. package/chunk/{qSJXQ1qu.js → DBJ8d0o0.js} +183 -189
  127. package/chunk/{RL1SNlng.js → DDda6s72.js} +16 -16
  128. package/chunk/{BH5fVprw.js → DJmWXheU.js} +9 -9
  129. package/chunk/DPvnQJ-H.js +52 -0
  130. package/chunk/DQXq1QT0.js +58 -0
  131. package/chunk/DRJO1GfY.js +855 -0
  132. package/chunk/DUxWiN2U.js +1465 -0
  133. package/chunk/DYZzQ2uT.js +29 -0
  134. package/chunk/{CK0H_Yi4.js → DafaH1Qt.js} +140 -138
  135. package/chunk/{ShWkfsJd.js → DalIRWr7.js} +21 -21
  136. package/chunk/{CzTYWtfa.js → Dg2DmtzA.js} +31 -30
  137. package/chunk/DhLbnw3R.js +29 -0
  138. package/chunk/{BmtF7P8U.js → DkIjpuBZ.js} +170 -170
  139. package/chunk/Do1aMgY3.js +12 -0
  140. package/chunk/Dtnux4qL.js +38 -0
  141. package/chunk/{Niaq_og8.js → Dw4SJ4o1.js} +219 -225
  142. package/chunk/{DbtCtriE.js → DxNRWF67.js} +30 -31
  143. package/chunk/JnyGFb5j.js +284 -0
  144. package/chunk/Lk60-jkf.js +1098 -0
  145. package/chunk/V_IcWDFx.js +49 -0
  146. package/chunk/{DG7VgAhL.js → WkB0MERB.js} +107 -108
  147. package/chunk/bsawGxt8.js +32 -0
  148. package/chunk/cUuQh7L_.js +46 -0
  149. package/chunk/fqgc8r6C.js +29 -0
  150. package/chunk/m_kOQCiU.js +29 -0
  151. package/chunk/sl8s35SK.js +29 -0
  152. package/chunk/{Dki1RB5p.js → t51ig1FZ.js} +154 -155
  153. package/chunk/{BC0PujUD.js → yvbAFxtk.js} +119 -121
  154. package/hooks/index.js +52 -246
  155. package/hooks/useForceUpdate.js +6 -6
  156. package/hooks/useIntersectionObserver.js +12 -10
  157. package/hooks/useKeyboardEvent.js +7 -7
  158. package/hooks/useMedia.js +9 -12
  159. package/hooks/useMergeValue.js +10 -8
  160. package/hooks/useResizeObserver.js +16 -0
  161. package/hooks/useUpdateEffect.js +7 -9
  162. package/hooks/useWindowSize.js +16 -20
  163. package/icons.js +6003 -0
  164. package/index.js +377 -472
  165. package/locale/en-US.js +20 -6
  166. package/locale/ja-JP.js +4 -2
  167. package/locale/ko-KR.js +2 -2
  168. package/locale/pt-BR.js +3 -3
  169. package/locale/pt-PT.js +3 -3
  170. package/locale/tr-TR.js +11 -3
  171. package/locale/zh-CN.js +6 -0
  172. package/locale/zh-HK.js +2 -0
  173. package/locale/zh-TW.js +2 -0
  174. package/package.json +1 -1
  175. package/style.css +1 -1
  176. package/types/anchor/util.d.ts +1 -0
  177. package/types/button/index.d.ts +2 -2
  178. package/types/color-picker/colors.d.ts +1 -1
  179. package/types/date-picker/util.d.ts +1 -1
  180. package/types/hooks/index.d.ts +3 -101
  181. package/types/hooks/useForceUpdate.d.ts +1 -2
  182. package/types/hooks/useIntersectionObserver.d.ts +1 -1
  183. package/types/hooks/useKeyboardEvent.d.ts +2 -2
  184. package/types/hooks/useMergeProps.d.ts +1 -1
  185. package/types/hooks/useResizeObserver.d.ts +5 -0
  186. package/types/hooks/useUpdateEffect.d.ts +2 -3
  187. package/types/hooks/useWindowSize.d.ts +1 -1
  188. package/types/icons.d.ts +4 -0
  189. package/types/index.d.ts +12 -2
  190. package/types/locale/en-US.d.ts +4 -0
  191. package/types/locale/interface.d.ts +2 -0
  192. package/types/locale/ja-JP.d.ts +4 -0
  193. package/types/locale/zh-CN.d.ts +4 -0
  194. package/types/locale/zh-HK.d.ts +4 -0
  195. package/types/locale/zh-TW.d.ts +4 -0
  196. package/types/modal/config.d.ts +1 -1
  197. package/types/version/index.d.ts +1 -1
  198. package/utils/CSSTransition.js +1 -1
  199. package/utils/className.js +2 -3
  200. package/utils/contextHolder.js +2 -2
  201. package/utils/copy.js +2 -3
  202. package/utils/is.js +127 -90
  203. package/utils/reactDOM.js +17 -15
  204. package/utils/responsiveObserve.js +16 -16
  205. package/utils/saveAs.js +2 -3
  206. package/utils/scrollIntoView.js +1 -1
  207. package/chunk/BdYAMaw9.js +0 -6
  208. package/chunk/CiZVOdJ3.js +0 -122
  209. package/chunk/DdtfPvgk.js +0 -272
  210. package/chunk/I4RV9SKZ.js +0 -135
  211. package/chunk/TXCrI0jN.js +0 -20
  212. package/chunk/i1A7W8Qt.js +0 -277
  213. package/chunk/xPzFRQJn.js +0 -740
  214. package/hooks/useAsync.js +0 -13
  215. package/hooks/useAsyncFn.js +0 -15
  216. package/hooks/useAsyncRetry.js +0 -17
  217. package/hooks/useAudio.js +0 -5
  218. package/hooks/useBeforeUnload.js +0 -18
  219. package/hooks/useBoolean.js +0 -4
  220. package/hooks/useClickAway.js +0 -22
  221. package/hooks/useCopyToClipboard.js +0 -51
  222. package/hooks/useCounter.js +0 -45
  223. package/hooks/useCreation.js +0 -17
  224. package/hooks/useCustomCompareEffect.js +0 -15
  225. package/hooks/useDebounce.js +0 -9
  226. package/hooks/useDefault.js +0 -10
  227. package/hooks/useDrop.js +0 -44
  228. package/hooks/useDropArea.js +0 -45
  229. package/hooks/useEffectOnce.js +0 -7
  230. package/hooks/useEffectState.js +0 -9
  231. package/hooks/useEnsuredForwardedRef.js +0 -17
  232. package/hooks/useError.js +0 -13
  233. package/hooks/useEvent.js +0 -13
  234. package/hooks/useEventListener.js +0 -39
  235. package/hooks/useFavicon.js +0 -16
  236. package/hooks/useFirstMountState.js +0 -8
  237. package/hooks/useFullscreen.js +0 -39
  238. package/hooks/useGeolocation.js +0 -38
  239. package/hooks/useGetSet.js +0 -18
  240. package/hooks/useGetSetState.js +0 -12
  241. package/hooks/useHash.js +0 -26
  242. package/hooks/useHover.js +0 -16
  243. package/hooks/useHoverDirty.js +0 -17
  244. package/hooks/useIdle.js +0 -34
  245. package/hooks/useIntersection.js +0 -19
  246. package/hooks/useIsomorphicLayoutEffect2.js +0 -6
  247. package/hooks/useKey.js +0 -16
  248. package/hooks/useKeyPress.js +0 -13
  249. package/hooks/useKeyPressEvent.js +0 -11
  250. package/hooks/useLatest.js +0 -8
  251. package/hooks/useLifecycles.js +0 -9
  252. package/hooks/useList.js +0 -67
  253. package/hooks/useLocalStorage.js +0 -42
  254. package/hooks/useLocation.js +0 -51
  255. package/hooks/useLockBodyScroll.js +0 -55
  256. package/hooks/useLogger.js +0 -10
  257. package/hooks/useLongPress.js +0 -24
  258. package/hooks/useMap.js +0 -31
  259. package/hooks/useMeasure.js +0 -34
  260. package/hooks/useMeasureDirty.js +0 -24
  261. package/hooks/useMediaDevices.js +0 -26
  262. package/hooks/useMediatedState.js +0 -14
  263. package/hooks/useMethods.js +0 -14
  264. package/hooks/useMotion.js +0 -56
  265. package/hooks/useMount.js +0 -9
  266. package/hooks/useMountedState.js +0 -10
  267. package/hooks/useMouse.js +0 -44
  268. package/hooks/useMouseHovered.js +0 -9
  269. package/hooks/useMouseWheel.js +0 -14
  270. package/hooks/useMultiStateValidator.js +0 -19
  271. package/hooks/useNetworkState.js +0 -31
  272. package/hooks/useNumber.js +0 -4
  273. package/hooks/useObservable.js +0 -12
  274. package/hooks/useOrientation.js +0 -30
  275. package/hooks/usePageLeave.js +0 -19
  276. package/hooks/usePermission.js +0 -19
  277. package/hooks/usePinchZoom.js +0 -40
  278. package/hooks/usePreviousDistinct.js +0 -10
  279. package/hooks/usePromise.js +0 -19
  280. package/hooks/useQueue.js +0 -25
  281. package/hooks/useRaf.js +0 -24
  282. package/hooks/useRafLoop.js +0 -24
  283. package/hooks/useRafState.js +0 -15
  284. package/hooks/useReactive.js +0 -21
  285. package/hooks/useRendersCount.js +0 -7
  286. package/hooks/useScroll.js +0 -27
  287. package/hooks/useScrolling.js +0 -23
  288. package/hooks/useSearchParam.js +0 -18
  289. package/hooks/useSessionStorage.js +0 -29
  290. package/hooks/useSet.js +0 -15
  291. package/hooks/useSetState.js +0 -16
  292. package/hooks/useSize.js +0 -58
  293. package/hooks/useSlider.js +0 -48
  294. package/hooks/useSpeech.js +0 -45
  295. package/hooks/useStartTyping.js +0 -30
  296. package/hooks/useStateList.js +0 -37
  297. package/hooks/useStateValidator.js +0 -17
  298. package/hooks/useStateWithHistory.js +0 -46
  299. package/hooks/useSyncState.js +0 -14
  300. package/hooks/useThrottle.js +0 -21
  301. package/hooks/useThrottleFn.js +0 -21
  302. package/hooks/useTimeout.js +0 -17
  303. package/hooks/useTimeoutFn.js +0 -16
  304. package/hooks/useTitle.js +0 -18
  305. package/hooks/useToggle.js +0 -5
  306. package/hooks/useTween.js +0 -11
  307. package/hooks/useUnmount.js +0 -9
  308. package/hooks/useUnmountPromise.js +0 -20
  309. package/hooks/useUpdate.js +0 -10
  310. package/hooks/useUpdateTimeout.js +0 -9
  311. package/hooks/useUpsert.js +0 -16
  312. package/hooks/useVibrate.js +0 -21
  313. package/hooks/useVideo.js +0 -5
  314. package/hooks/useWindowScroll.js +0 -29
  315. package/types/hooks/component/UseKey.d.ts +0 -2
  316. package/types/hooks/factory/createBreakpoint.d.ts +0 -4
  317. package/types/hooks/factory/createGlobalState.d.ts +0 -7
  318. package/types/hooks/factory/createHTMLMediaHook.d.ts +0 -33
  319. package/types/hooks/factory/createMemo.d.ts +0 -2
  320. package/types/hooks/factory/createReducer.d.ts +0 -8
  321. package/types/hooks/factory/createReducerContext.d.ts +0 -5
  322. package/types/hooks/factory/createRenderProp.d.ts +0 -1
  323. package/types/hooks/factory/createRouter.d.ts +0 -7
  324. package/types/hooks/factory/createStateContext.d.ts +0 -5
  325. package/types/hooks/misc/hookState.d.ts +0 -8
  326. package/types/hooks/misc/parseTimeRanges.d.ts +0 -4
  327. package/types/hooks/misc/types.d.ts +0 -2
  328. package/types/hooks/misc/util.d.ts +0 -5
  329. package/types/hooks/useAsync.d.ts +0 -20
  330. package/types/hooks/useAsyncFn.d.ts +0 -23
  331. package/types/hooks/useAsyncRetry.d.ts +0 -27
  332. package/types/hooks/useAudio.d.ts +0 -11
  333. package/types/hooks/useBeforeUnload.d.ts +0 -2
  334. package/types/hooks/useBoolean.d.ts +0 -2
  335. package/types/hooks/useClickAway.d.ts +0 -3
  336. package/types/hooks/useCopyToClipboard.d.ts +0 -7
  337. package/types/hooks/useCounter.d.ts +0 -9
  338. package/types/hooks/useCreation.d.ts +0 -2
  339. package/types/hooks/useCustomCompareEffect.d.ts +0 -4
  340. package/types/hooks/useDebounce.d.ts +0 -3
  341. package/types/hooks/useDefault.d.ts +0 -2
  342. package/types/hooks/useDrop.d.ts +0 -17
  343. package/types/hooks/useDropArea.d.ts +0 -18
  344. package/types/hooks/useEffectOnce.d.ts +0 -3
  345. package/types/hooks/useEffectState.d.ts +0 -2
  346. package/types/hooks/useEnsuredForwardedRef.d.ts +0 -3
  347. package/types/hooks/useError.d.ts +0 -2
  348. package/types/hooks/useEvent.d.ts +0 -13
  349. package/types/hooks/useEventListener.d.ts +0 -2
  350. package/types/hooks/useFavicon.d.ts +0 -2
  351. package/types/hooks/useFirstMountState.d.ts +0 -1
  352. package/types/hooks/useFullscreen.d.ts +0 -10
  353. package/types/hooks/useGeolocation.d.ts +0 -21
  354. package/types/hooks/useGetSet.d.ts +0 -3
  355. package/types/hooks/useGetSetState.d.ts +0 -2
  356. package/types/hooks/useHash.d.ts +0 -2
  357. package/types/hooks/useHover.d.ts +0 -4
  358. package/types/hooks/useHoverDirty.d.ts +0 -3
  359. package/types/hooks/useIdle.d.ts +0 -2
  360. package/types/hooks/useIntersection.d.ts +0 -3
  361. package/types/hooks/useIsomorphicLayoutEffect2.d.ts +0 -3
  362. package/types/hooks/useKey.d.ts +0 -12
  363. package/types/hooks/useKeyPress.d.ts +0 -3
  364. package/types/hooks/useKeyPressEvent.d.ts +0 -3
  365. package/types/hooks/useLatest.d.ts +0 -4
  366. package/types/hooks/useLifecycles.d.ts +0 -2
  367. package/types/hooks/useList.d.ts +0 -18
  368. package/types/hooks/useLocalStorage.d.ts +0 -10
  369. package/types/hooks/useLocation.d.ts +0 -16
  370. package/types/hooks/useLockBodyScroll.d.ts +0 -8
  371. package/types/hooks/useLogger.d.ts +0 -2
  372. package/types/hooks/useLongPress.d.ts +0 -12
  373. package/types/hooks/useMap.d.ts +0 -11
  374. package/types/hooks/useMeasure.d.ts +0 -9
  375. package/types/hooks/useMeasureDirty.d.ts +0 -11
  376. package/types/hooks/useMediaDevices.d.ts +0 -2
  377. package/types/hooks/useMediatedState.d.ts +0 -9
  378. package/types/hooks/useMethods.d.ts +0 -8
  379. package/types/hooks/useMotion.d.ts +0 -20
  380. package/types/hooks/useMount.d.ts +0 -2
  381. package/types/hooks/useMountedState.d.ts +0 -1
  382. package/types/hooks/useMouse.d.ts +0 -13
  383. package/types/hooks/useMouseHovered.d.ts +0 -8
  384. package/types/hooks/useMouseWheel.d.ts +0 -2
  385. package/types/hooks/useMultiStateValidator.d.ts +0 -9
  386. package/types/hooks/useNetworkState.d.ts +0 -22
  387. package/types/hooks/useNumber.d.ts +0 -2
  388. package/types/hooks/useObservable.d.ts +0 -8
  389. package/types/hooks/useOrientation.d.ts +0 -6
  390. package/types/hooks/usePageLeave.d.ts +0 -2
  391. package/types/hooks/usePermission.d.ts +0 -16
  392. package/types/hooks/usePinchZoom.d.ts +0 -18
  393. package/types/hooks/usePreviousDistinct.d.ts +0 -2
  394. package/types/hooks/usePromise.d.ts +0 -3
  395. package/types/hooks/useQueue.d.ts +0 -9
  396. package/types/hooks/useRaf.d.ts +0 -2
  397. package/types/hooks/useRafLoop.d.ts +0 -2
  398. package/types/hooks/useRafState.d.ts +0 -3
  399. package/types/hooks/useReactive.d.ts +0 -2
  400. package/types/hooks/useRendersCount.d.ts +0 -1
  401. package/types/hooks/useScroll.d.ts +0 -7
  402. package/types/hooks/useScrolling.d.ts +0 -3
  403. package/types/hooks/useSearchParam.d.ts +0 -3
  404. package/types/hooks/useSessionStorage.d.ts +0 -2
  405. package/types/hooks/useSet.d.ts +0 -11
  406. package/types/hooks/useSetState.d.ts +0 -2
  407. package/types/hooks/useSize.d.ts +0 -8
  408. package/types/hooks/useSlider.d.ts +0 -15
  409. package/types/hooks/useSpeech.d.ts +0 -16
  410. package/types/hooks/useStartTyping.d.ts +0 -2
  411. package/types/hooks/useStateList.d.ts +0 -9
  412. package/types/hooks/useStateValidator.d.ts +0 -8
  413. package/types/hooks/useStateWithHistory.d.ts +0 -18
  414. package/types/hooks/useSyncState.d.ts +0 -3
  415. package/types/hooks/useThrottle.d.ts +0 -2
  416. package/types/hooks/useThrottleFn.d.ts +0 -2
  417. package/types/hooks/useTimeout.d.ts +0 -2
  418. package/types/hooks/useTimeoutFn.d.ts +0 -2
  419. package/types/hooks/useTitle.d.ts +0 -6
  420. package/types/hooks/useToggle.d.ts +0 -2
  421. package/types/hooks/useTween.d.ts +0 -3
  422. package/types/hooks/useUnmount.d.ts +0 -2
  423. package/types/hooks/useUnmountPromise.d.ts +0 -3
  424. package/types/hooks/useUpdate.d.ts +0 -2
  425. package/types/hooks/useUpdateTimeout.d.ts +0 -2
  426. package/types/hooks/useUpsert.d.ts +0 -6
  427. package/types/hooks/useVibrate.d.ts +0 -4
  428. package/types/hooks/useVideo.d.ts +0 -11
  429. package/types/hooks/useWindowScroll.d.ts +0 -6
package/utils/reactDOM.js CHANGED
@@ -1,19 +1,21 @@
1
1
  import { Component as a } from "react";
2
- import e from "react-dom";
2
+ import i from "react-dom";
3
3
  import { isReact18 as _ } from "./is.js";
4
4
  import R from "./warning.js";
5
- import { isFunction as O, isPlainObject as N } from "@unicom-cloud/utils/is";
6
- const d = "__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED", f = e;
7
- let i;
5
+ import "../chunk/BeM2hfks.js";
6
+ import O from "lodash/isFunction";
7
+ import p from "lodash/isPlainObject";
8
+ const d = "__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED", f = i;
9
+ let e;
8
10
  const s = (t) => {
9
- N(f[d]) && (f[d].usingClientEntryPoint = t);
11
+ p(f[d]) && (f[d].usingClientEntryPoint = t);
10
12
  };
11
13
  let u;
12
14
  try {
13
15
  u = f.createRoot;
14
16
  } catch {
15
17
  }
16
- _ && u ? i = (t, o) => {
18
+ _ && u ? e = (t, o) => {
17
19
  s(!0);
18
20
  const r = u(o);
19
21
  return s(!1), r.render(t), r._unmount = function() {
@@ -22,7 +24,7 @@ _ && u ? i = (t, o) => {
22
24
  (c = r == null ? void 0 : r.unmount) == null || c.call(r);
23
25
  });
24
26
  }, r;
25
- } : i = function(t, o) {
27
+ } : e = function(t, o) {
26
28
  return f.render(t, o), {
27
29
  render: (r) => {
28
30
  f.render(r, o);
@@ -33,22 +35,22 @@ _ && u ? i = (t, o) => {
33
35
  };
34
36
  };
35
37
  let n;
36
- function p(t) {
38
+ function N(t) {
37
39
  const o = t.constructor;
38
40
  if (typeof o != "function") return !1;
39
41
  !n && typeof WeakSet == "function" && (n = /* @__PURE__ */ new WeakSet());
40
42
  const r = !!(n != null && n.has(o));
41
43
  return n == null || n.add(o), r;
42
44
  }
43
- const y = (t, o) => t && t instanceof Element ? t : t && t.current && t.current instanceof Element ? t.current : t && O(t.getRootDOMNode) ? t.getRootDOMNode() : t instanceof a && e.findDOMNode ? e.findDOMNode(t) : o && (R(
44
- _ && !p(o),
45
+ const T = (t, o) => t && t instanceof Element ? t : t && t.current && t.current instanceof Element ? t.current : t && O(t.getRootDOMNode) ? t.getRootDOMNode() : t instanceof a && i.findDOMNode ? i.findDOMNode(t) : o && (R(
46
+ _ && !N(o),
45
47
  "Element does not define the `getRootDOMNode` method causing a call to React.findDOMNode. but findDOMNode is deprecated in StrictMode. Please check the code logic",
46
48
  { element: t, instance: o }
47
- ), e.findDOMNode) ? e.findDOMNode(o) : null, C = (t, o) => {
49
+ ), i.findDOMNode) ? i.findDOMNode(o) : null, S = (t, o) => {
48
50
  t && t.ref && (O(t.ref) && (t == null || t.ref(o)), "current" in t.ref && (t.ref.current = o));
49
- }, T = i;
51
+ }, L = e;
50
52
  export {
51
- C as callbackOriginRef,
52
- y as findDOMNode,
53
- T as render
53
+ S as callbackOriginRef,
54
+ T as findDOMNode,
55
+ L as render
54
56
  };
@@ -6,7 +6,7 @@ const c = [
6
6
  "md",
7
7
  "sm",
8
8
  "xs"
9
- ], r = {
9
+ ], n = {
10
10
  xs: "(max-width: 575px)",
11
11
  sm: "(min-width: 576px)",
12
12
  md: "(min-width: 768px)",
@@ -15,12 +15,12 @@ const c = [
15
15
  xxl: "(min-width: 1600px)",
16
16
  xxxl: "(min-width: 2000px)"
17
17
  };
18
- let i = [], a = -1, n = {};
18
+ let i = [], a = -1, r = {};
19
19
  const d = {
20
20
  matchHandlers: {},
21
21
  dispatch(e, t) {
22
- return n = e, i.length < 1 ? !1 : (i.forEach((s) => {
23
- s.func(n, t);
22
+ return r = e, i.length < 1 ? !1 : (i.forEach((s) => {
23
+ s.func(r, t);
24
24
  }), !0);
25
25
  },
26
26
  subscribe(e) {
@@ -29,37 +29,37 @@ const d = {
29
29
  return i.push({
30
30
  token: t,
31
31
  func: e
32
- }), e(n, null), t;
32
+ }), e(r, null), t;
33
33
  },
34
34
  unsubscribe(e) {
35
35
  i = i.filter((t) => t.token !== e), i.length === 0 && this.unregister();
36
36
  },
37
37
  unregister() {
38
- Object.keys(r).forEach((e) => {
39
- const t = r[e], s = this.matchHandlers[t];
38
+ Object.keys(n).forEach((e) => {
39
+ const t = n[e], s = this.matchHandlers[t];
40
40
  s && s.mql && s.listener && s.mql.removeListener(s.listener);
41
41
  });
42
42
  },
43
43
  register() {
44
- Object.keys(r).forEach((e) => {
45
- const t = r[e], s = ({ matches: h }) => {
44
+ Object.keys(n).forEach((e) => {
45
+ const t = n[e], s = ({ matches: l }) => {
46
46
  this.dispatch(
47
47
  {
48
- ...n,
49
- [e]: h
48
+ ...r,
49
+ [e]: l
50
50
  },
51
51
  e
52
52
  );
53
- }, l = window.matchMedia(t);
54
- l.addListener(s), this.matchHandlers[t] = {
55
- mql: l,
53
+ }, h = window.matchMedia(t);
54
+ h.addEventListener("change", s), this.matchHandlers[t] = {
55
+ mql: h,
56
56
  listener: s
57
- }, s(l);
57
+ }, s(h);
58
58
  });
59
59
  }
60
60
  };
61
61
  export {
62
62
  d as default,
63
63
  c as responsiveArray,
64
- r as responsiveMap
64
+ n as responsiveMap
65
65
  };
package/utils/saveAs.js CHANGED
@@ -1,5 +1,4 @@
1
- import "@unicom-cloud/utils/file/saveAs";
2
- import { default as m } from "@unicom-cloud/utils/file/saveAs";
1
+ import { i as r } from "../chunk/5pZ3ayqs.js";
3
2
  export {
4
- m as default
3
+ r as default
5
4
  };
@@ -1,4 +1,4 @@
1
- import { y as c } from "../chunk/CiZVOdJ3.js";
1
+ import { y as c } from "../chunk/CnY8SvgY.js";
2
2
  import i from "lodash/isFunction";
3
3
  function f(r, t) {
4
4
  if (r) {
package/chunk/BdYAMaw9.js DELETED
@@ -1,6 +0,0 @@
1
- function f(o, r) {
2
- return typeof o == "function" ? o.length ? o(r) : o() : o;
3
- }
4
- export {
5
- f as r
6
- };
package/chunk/CiZVOdJ3.js DELETED
@@ -1,122 +0,0 @@
1
- let Q = (e) => typeof e == "object" && e != null && e.nodeType === 1, U = (e, t) => t && e === "hidden" ? !1 : e !== "visible" && e !== "clip", _ = (e) => {
2
- if (!e.ownerDocument || !e.ownerDocument.defaultView)
3
- return null;
4
- try {
5
- return e.ownerDocument.defaultView.frameElement;
6
- } catch {
7
- return null;
8
- }
9
- }, $ = (e) => {
10
- let t = _(e);
11
- return t ? t.clientHeight < e.scrollHeight || t.clientWidth < e.scrollWidth : !1;
12
- }, F = (e, t) => {
13
- if (e.clientHeight < e.scrollHeight || e.clientWidth < e.scrollWidth) {
14
- let d = getComputedStyle(e, null);
15
- return U(d.overflowY, t) || U(d.overflowX, t) || $(e);
16
- }
17
- return !1;
18
- }, X = (e, t, d, u, m, l, o, c) => l < e && o > t || l > e && o < t ? 0 : l <= e && c <= d || o >= t && c >= d ? l - e - u : o > t && c < d || l < e && c > d ? o - t + m : 0, ee = (e) => e.parentElement ?? (e.getRootNode().host || null);
19
- const Z = (e, t) => {
20
- var d, u;
21
- if (typeof document > "u")
22
- return [];
23
- let { scrollMode: m, block: l, inline: o, boundary: c, skipOverflowHiddenElements: Y } = t, p = typeof c == "function" ? c : (E) => E !== c;
24
- if (!Q(e))
25
- throw new TypeError("Invalid target");
26
- let g = document.scrollingElement || document.documentElement, a = [], h = e;
27
- for (; Q(h) && p(h); ) {
28
- if (h = ee(h), h === g) {
29
- a.push(h);
30
- break;
31
- }
32
- h != null && h === document.body && F(h) && !F(document.documentElement) || h != null && F(h, Y) && a.push(h);
33
- }
34
- let w = ((d = window.visualViewport) == null ? void 0 : d.width) ?? innerWidth, b = ((u = window.visualViewport) == null ? void 0 : u.height) ?? innerHeight, v = window.scrollX ?? window.pageXOffset, y = window.scrollY ?? window.pageYOffset, {
35
- height: W,
36
- width: H,
37
- top: M,
38
- right: S,
39
- bottom: N,
40
- left: k
41
- } = e.getBoundingClientRect(), s = l === "start" || l === "nearest" ? M : l === "end" ? N : M + W / 2, f = o === "center" ? k + H / 2 : o === "end" ? S : k, q = [];
42
- for (let E = 0; E < a.length; E++) {
43
- let n = a[E], { height: x, width: C, top: I, right: z, bottom: A, left: O } = n.getBoundingClientRect();
44
- if (m === "if-needed" && M >= 0 && k >= 0 && N <= b && S <= w && M >= I && N <= A && k >= O && S <= z)
45
- return q;
46
- let T = getComputedStyle(n), j = parseInt(T.borderLeftWidth, 10), B = parseInt(T.borderTopWidth, 10), D = parseInt(T.borderRightWidth, 10), R = parseInt(T.borderBottomWidth, 10), i = 0, r = 0, V = "offsetWidth" in n ? n.offsetWidth - n.clientWidth - j - D : 0, L = "offsetHeight" in n ? n.offsetHeight - n.clientHeight - B - R : 0, G = "offsetWidth" in n ? n.offsetWidth === 0 ? 0 : C / n.offsetWidth : 0, J = "offsetHeight" in n ? n.offsetHeight === 0 ? 0 : x / n.offsetHeight : 0;
47
- if (g === n)
48
- l === "start" ? i = s : l === "end" ? i = s - b : l === "nearest" ? i = X(
49
- y,
50
- y + b,
51
- b,
52
- B,
53
- R,
54
- y + s,
55
- y + s + W,
56
- W
57
- ) : i = s - b / 2, o === "start" ? r = f : o === "center" ? r = f - w / 2 : o === "end" ? r = f - w : r = X(
58
- v,
59
- v + w,
60
- w,
61
- j,
62
- D,
63
- v + f,
64
- v + f + H,
65
- H
66
- ), i = Math.max(0, i + y), r = Math.max(0, r + v);
67
- else {
68
- l === "start" ? i = s - I - B : l === "end" ? i = s - A + R + L : l === "nearest" ? i = X(
69
- I,
70
- A,
71
- x,
72
- B,
73
- R + L,
74
- s,
75
- s + W,
76
- W
77
- ) : i = s - (I + x / 2) + L / 2, o === "start" ? r = f - O - j : o === "center" ? r = f - (O + C / 2) + V / 2 : o === "end" ? r = f - z + D + V : r = X(
78
- O,
79
- z,
80
- C,
81
- j,
82
- D + V,
83
- f,
84
- f + H,
85
- H
86
- );
87
- let { scrollLeft: K, scrollTop: P } = n;
88
- i = Math.max(
89
- 0,
90
- Math.min(
91
- P + i / J,
92
- n.scrollHeight - x / J + L
93
- )
94
- ), r = Math.max(
95
- 0,
96
- Math.min(
97
- K + r / G,
98
- n.scrollWidth - C / G + V
99
- )
100
- ), s += P - i, f += K - r;
101
- }
102
- q.push({ el: n, top: i, left: r });
103
- }
104
- return q;
105
- };
106
- let te = (e) => e === Object(e) && Object.keys(e).length !== 0, ne = (e) => typeof e == "object" ? typeof e.behavior == "function" : !1, le = (e) => e === !1 ? { block: "end", inline: "nearest" } : te(e) ? e : { block: "start", inline: "nearest" };
107
- function oe(e, t) {
108
- var d, u, m;
109
- let l = (e == null ? void 0 : e.isConnected) || ((m = (u = (d = e == null ? void 0 : e.ownerDocument) == null ? void 0 : d.documentElement) == null ? void 0 : u.contains) == null ? void 0 : m.call(u, e));
110
- if (ne(t))
111
- return t.behavior(l ? Z(e, t) : []);
112
- if (!l)
113
- return;
114
- let o = le(t), c = Z(e, o), Y = "scrollBehavior" in document.body.style;
115
- c.forEach(({ el: p, top: g, left: a }) => {
116
- p.scroll && Y ? p.scroll({ top: g, left: a, behavior: o.behavior }) : (p.scrollTop = g, p.scrollLeft = a);
117
- });
118
- }
119
- export {
120
- Z as t,
121
- oe as y
122
- };
package/chunk/DdtfPvgk.js DELETED
@@ -1,272 +0,0 @@
1
- import { jsxs as it, jsx as O } from "react/jsx-runtime";
2
- import { y as $t, t as At } from "./CiZVOdJ3.js";
3
- import rt from "lodash/isFunction";
4
- import Y from "lodash/isNumber";
5
- import Tt from "lodash/throttle";
6
- import Rt, { createContext as St, forwardRef as st, useContext as _, useRef as w, useImperativeHandle as ct, useEffect as b, isValidElement as vt, useState as Pt, useCallback as j } from "react";
7
- import Et from "../Affix.js";
8
- import { a as lt } from "./xPzFRQJn.js";
9
- import Mt from "../hooks/useIsFirstRender.js";
10
- import at from "../hooks/useMergeProps.js";
11
- import Ot from "../hooks/useStateWithPromise.js";
12
- import ft from "@unicom-cloud/utils/class-name";
13
- import { on as bt, off as Ft } from "../utils/dom.js";
14
- import { isWindow as ut } from "../utils/is.js";
15
- import It from "lodash/isNull";
16
- import Ut from "lodash/isPlainObject";
17
- import G from "lodash/isString";
18
- import jt from "lodash/isUndefined";
19
- import { Tween as zt, quartOut as Ht } from "@unicom-cloud/utils/tween";
20
- const mt = St({
21
- direction: "vertical",
22
- currentLink: "",
23
- onLinkClick: () => {
24
- },
25
- addLink: () => {
26
- },
27
- removeLink: () => {
28
- }
29
- }), dt = "AnchorLink", Vt = {
30
- href: "#"
31
- };
32
- function Bt(n) {
33
- return Ut(n) && Object.prototype.hasOwnProperty.call(n, "displayName");
34
- }
35
- function Dt(n, i) {
36
- const { getPrefixCls: c, componentConfig: s } = _(lt), { className: g, style: H, href: l, title: m, children: f, ...V } = at(
37
- n,
38
- Vt,
39
- s == null ? void 0 : s["Anchor.Link"]
40
- ), C = _(mt), { currentLink: B, addLink: L, removeLink: $, onLinkClick: A, direction: F } = C, r = c("anchor-link"), T = ft(
41
- r,
42
- {
43
- [`${r}-active`]: B === l
44
- },
45
- g
46
- ), R = w(null);
47
- return ct(i, () => R.current, []), b(() => (L == null || L(l, R.current), () => {
48
- $ == null || $(l);
49
- }), [l]), /* @__PURE__ */ it("div", { className: T, style: H, ref: R, ...V, children: [
50
- !jt(m) && !It(m) && /* @__PURE__ */ O(
51
- "a",
52
- {
53
- className: `${r}-title`,
54
- title: G(m) ? m : "",
55
- href: l,
56
- "data-href": l,
57
- onClick: (o) => {
58
- A == null || A(o, l);
59
- },
60
- children: m
61
- }
62
- ),
63
- f && F !== "horizontal" && Rt.Children.map(f, (o) => vt(o) && Bt(o.type) && o.type.displayName === dt && o)
64
- ] });
65
- }
66
- const pt = st(Dt);
67
- pt.displayName = dt;
68
- function z(n, i) {
69
- const c = G(i) && i[0] === "#" ? `[id='${i.replace("#", "")}']` : i;
70
- try {
71
- return n.querySelector(c);
72
- } catch (s) {
73
- return console.error(s), null;
74
- }
75
- }
76
- function Wt(n, i, c) {
77
- new zt({
78
- from: {
79
- scrollTop: n.scrollTop
80
- },
81
- to: {
82
- scrollTop: i
83
- },
84
- easing: Ht,
85
- duration: 300,
86
- onUpdate: (g) => {
87
- n.scrollTop = g.scrollTop;
88
- },
89
- onFinish: () => {
90
- c == null || c();
91
- }
92
- }).start();
93
- }
94
- function ot(n) {
95
- return G(n) ? z(document, n) : n || window;
96
- }
97
- function qt(n) {
98
- return ut(n) ? document.documentElement || document.body : n;
99
- }
100
- const Yt = {
101
- animation: !0,
102
- affix: !0,
103
- hash: !0,
104
- boundary: "start"
105
- };
106
- function _t(n, i) {
107
- const { getPrefixCls: c, componentConfig: s, rtl: g } = _(lt), H = at(
108
- n,
109
- Yt,
110
- s == null ? void 0 : s.Anchor
111
- ), {
112
- className: l,
113
- style: m,
114
- scrollContainer: f,
115
- animation: V = !0,
116
- lineless: C,
117
- affix: B = !0,
118
- affixStyle: L,
119
- offsetBottom: $,
120
- offsetTop: A,
121
- hash: F = !0,
122
- boundary: r = "start",
123
- targetOffset: T,
124
- children: R,
125
- direction: o = "vertical",
126
- onSelect: J,
127
- onChange: D,
128
- ...gt
129
- } = H, k = c("anchor"), Ct = ft(k, l, {
130
- [`${k}-lineless`]: C,
131
- [`${k}-rtl`]: g,
132
- [`${k}-horizontal`]: o === "horizontal"
133
- }), y = w(null), S = w(null), N = w(/* @__PURE__ */ new Map()), W = w(!1), v = w(null), [kt, K] = Pt(0), [u, yt] = Ot(""), Nt = Mt();
134
- b(() => {
135
- const t = ot(f);
136
- v.current = t;
137
- }, [f]);
138
- const xt = j(() => ot(f), [f]);
139
- ct(
140
- i,
141
- () => ({
142
- dom: y.current,
143
- getRootDOMNode: () => y.current
144
- }),
145
- []
146
- );
147
- function Q(t, e) {
148
- t && (N.current.set(t, e), K(Math.random()));
149
- }
150
- function wt(t) {
151
- N.current.delete(t), K(Math.random());
152
- }
153
- const I = j(
154
- (t) => {
155
- if (!t || !y.current) return;
156
- if (!N.current.has(t)) {
157
- const d = z(y.current, `a[data-href='${t}']`);
158
- d && Q(t, d);
159
- }
160
- const e = N.current.get(t);
161
- e && t !== u && ($t(e, {
162
- behavior: "instant",
163
- block: "nearest",
164
- scrollMode: "if-needed",
165
- boundary: y.current
166
- }), yt(t).then(() => {
167
- rt(D) && D(t, u);
168
- }));
169
- },
170
- [u, D]
171
- ), X = j(() => {
172
- let t;
173
- const e = Y(r) ? r : 0, d = v.current, E = qt(d).getBoundingClientRect(), U = document.documentElement.clientHeight;
174
- return [...N.current.keys()].some((q) => {
175
- const p = z(document, q);
176
- let x = !1;
177
- if (p) {
178
- const { top: a, height: M } = p.getBoundingClientRect();
179
- if (ut(d)) {
180
- const h = T ?? U / 2;
181
- x = a >= e && a <= h || a <= e && a + M >= h;
182
- } else {
183
- const h = a - E.top - e, nt = T ?? E.height / 2;
184
- x = h >= 0 && h <= nt || h <= 0 && h + M >= nt;
185
- }
186
- x && (t = p);
187
- }
188
- return x;
189
- }), t;
190
- }, [r, T]), P = j(
191
- Tt(
192
- () => {
193
- if (W.current) return;
194
- const t = X();
195
- if (t && t.id) {
196
- const e = `#${t.id}`;
197
- I(e);
198
- }
199
- },
200
- 30,
201
- { trailing: !0 }
202
- ),
203
- [X, I]
204
- );
205
- function Z(t) {
206
- if (t)
207
- try {
208
- const e = z(document, t);
209
- if (!e) return;
210
- const d = Y(r) ? "start" : r, et = Y(r) ? r : 0, E = At(e, { block: d });
211
- if (!E.length) return;
212
- let U = !1;
213
- const q = E.map(({ el: p, top: x }) => new Promise((a) => {
214
- if (!U) {
215
- p === v.current && (U = !0);
216
- const M = x - et;
217
- return V ? Wt(p, M, a) : (F || (p.scrollTop = M), a(null));
218
- }
219
- a(null);
220
- }));
221
- W.current = !0, Promise.all(q).then(() => {
222
- W.current = !1;
223
- });
224
- } catch (e) {
225
- console.error(e);
226
- }
227
- }
228
- function Lt(t, e) {
229
- F || t.preventDefault(), I(e), Z(e), rt(J) && J(e, u);
230
- }
231
- b(() => {
232
- const t = decodeURIComponent(location.hash);
233
- t ? (I(t), Z(t)) : P();
234
- }, []), b(() => (Nt || P(), bt(v.current, "scroll", P), () => {
235
- Ft(v.current, "scroll", P);
236
- }), [f, P]), b(() => {
237
- const t = N.current.get(u);
238
- t && !C && S.current && (o === "horizontal" ? (S.current.style.left = `${t.offsetLeft}px`, S.current.style.width = `${t.clientWidth}px`) : S.current.style.top = `${t.offsetTop}px`);
239
- }, [u, C, o, g, kt]);
240
- const tt = /* @__PURE__ */ it("div", { className: Ct, style: m, ref: y, ...gt, children: [
241
- !C && u && /* @__PURE__ */ O("div", { className: `${k}-line-slider`, ref: S }),
242
- /* @__PURE__ */ O(
243
- mt.Provider,
244
- {
245
- value: {
246
- direction: o,
247
- currentLink: u,
248
- addLink: Q,
249
- removeLink: wt,
250
- onLinkClick: Lt
251
- },
252
- children: /* @__PURE__ */ O("div", { className: `${k}-list`, children: R })
253
- }
254
- )
255
- ] });
256
- return B ? /* @__PURE__ */ O(
257
- Et,
258
- {
259
- offsetTop: A,
260
- offsetBottom: $,
261
- style: L,
262
- target: xt,
263
- children: tt
264
- }
265
- ) : tt;
266
- }
267
- const Gt = st(_t), ht = Gt;
268
- ht.displayName = "Anchor";
269
- ht.Link = pt;
270
- export {
271
- ht as A
272
- };
package/chunk/I4RV9SKZ.js DELETED
@@ -1,135 +0,0 @@
1
- import m, { useRef as D, useEffect as M } from "react";
2
- import U from "../hooks/useSetState.js";
3
- function v(a) {
4
- const i = [];
5
- for (let u = 0; u < a.length; u++)
6
- i.push({
7
- start: a.start(u),
8
- end: a.end(u)
9
- });
10
- return i;
11
- }
12
- function w(a) {
13
- return (i) => {
14
- let u, n;
15
- m.isValidElement(i) ? (u = i, n = u.props) : n = i;
16
- const [f, s] = U({
17
- buffered: [],
18
- time: 0,
19
- duration: 0,
20
- paused: !0,
21
- muted: !1,
22
- volume: 1,
23
- playing: !1
24
- }), r = D(null), t = (e, o) => (l) => {
25
- try {
26
- o == null || o(l);
27
- } finally {
28
- e == null || e(l);
29
- }
30
- }, d = () => s({ paused: !1 }), p = () => s({ playing: !0 }), g = () => s({ playing: !1 }), h = () => s({ paused: !0, playing: !1 }), y = () => {
31
- const e = r.current;
32
- e && s({
33
- muted: e.muted,
34
- volume: e.volume
35
- });
36
- }, P = () => {
37
- const e = r.current;
38
- if (!e)
39
- return;
40
- const { duration: o, buffered: l } = e;
41
- s({
42
- duration: o,
43
- buffered: v(l)
44
- });
45
- }, C = () => {
46
- const e = r.current;
47
- e && s({ time: e.currentTime });
48
- }, T = () => {
49
- const e = r.current;
50
- e && s({ buffered: v(e.buffered) });
51
- };
52
- u ? u = m.cloneElement(u, {
53
- controls: !1,
54
- ...n,
55
- ref: r,
56
- onPlay: t(n.onPlay, d),
57
- onPlaying: t(n.onPlaying, p),
58
- onWaiting: t(n.onWaiting, g),
59
- onPause: t(n.onPause, h),
60
- onVolumeChange: t(n.onVolumeChange, y),
61
- onDurationChange: t(n.onDurationChange, P),
62
- onTimeUpdate: t(n.onTimeUpdate, C),
63
- onProgress: t(n.onProgress, T)
64
- }) : u = m.createElement(a, {
65
- controls: !1,
66
- ...n,
67
- ref: r,
68
- onPlay: t(n.onPlay, d),
69
- onPlaying: t(n.onPlaying, p),
70
- onWaiting: t(n.onWaiting, g),
71
- onPause: t(n.onPause, h),
72
- onVolumeChange: t(n.onVolumeChange, y),
73
- onDurationChange: t(n.onDurationChange, P),
74
- onTimeUpdate: t(n.onTimeUpdate, C),
75
- onProgress: t(n.onProgress, T)
76
- });
77
- let c = !1;
78
- const V = {
79
- play: () => {
80
- const e = r.current;
81
- if (e && !c) {
82
- const o = e.play();
83
- if (typeof o == "object") {
84
- c = !0;
85
- const b = () => {
86
- c = !1;
87
- };
88
- o.then(b, b);
89
- }
90
- return o;
91
- }
92
- },
93
- pause: () => {
94
- const e = r.current;
95
- if (e && !c)
96
- return e.pause();
97
- },
98
- seek: (e) => {
99
- const o = r.current;
100
- !o || f.duration === void 0 || (e = Math.min(f.duration, Math.max(0, e)), o.currentTime = e);
101
- },
102
- volume: (e) => {
103
- const o = r.current;
104
- o && (e = Math.min(1, Math.max(0, e)), o.volume = e, s({ volume: e }));
105
- },
106
- mute: () => {
107
- const e = r.current;
108
- e && (e.muted = !0);
109
- },
110
- unmute: () => {
111
- const e = r.current;
112
- e && (e.muted = !1);
113
- }
114
- };
115
- return M(() => {
116
- const e = r.current;
117
- if (!e) {
118
- process.env.NODE_ENV !== "production" && (a === "audio" ? console.error(
119
- "useAudio() ref to <audio> element is empty at mount. It seem you have not rendered the audio element, which it returns as the first argument const [audio] = useAudio(...)."
120
- ) : a === "video" && console.error(
121
- "useVideo() ref to <video> element is empty at mount. It seem you have not rendered the video element, which it returns as the first argument const [video] = useVideo(...)."
122
- ));
123
- return;
124
- }
125
- s({
126
- volume: e.volume,
127
- muted: e.muted,
128
- paused: e.paused
129
- }), n.autoPlay && e.paused && V.play();
130
- }, [n.src]), [u, f, V, r];
131
- };
132
- }
133
- export {
134
- w as c
135
- };