@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.
- package/Affix.js +36 -36
- package/Alert.js +41 -45
- package/Anchor.js +1 -1
- package/AutoComplete.js +40 -40
- package/Avatar.js +36 -36
- package/BackTop.js +26 -26
- package/Badge.js +43 -43
- package/Breadcrumb.js +17 -17
- package/Button.js +42 -42
- package/Calendar.js +54 -56
- package/Card.js +28 -28
- package/Carousel.js +42 -43
- package/Cascader.js +1 -1
- package/Checkbox.js +1 -1
- package/Collapse.js +1 -1
- package/ColorPicker.js +11 -580
- package/Comment.js +14 -14
- package/ConfigProvider.js +2 -2
- package/Copy.js +26 -26
- package/DatePicker.js +661 -670
- package/Descriptions.js +53 -53
- package/Divider.js +15 -15
- package/Draggable.js +16 -16
- package/Drawer.js +1 -1
- package/Dropdown.js +10 -10
- package/Empty.js +3 -3
- package/Form.js +10 -1410
- package/Grid.js +49 -49
- package/Icon.js +10 -10
- package/IconHover.js +2 -2
- package/Image.js +1 -1
- package/Input.js +1 -1
- package/InputNumber.js +7 -7
- package/InputTag.js +1 -1
- package/Layout.js +34 -34
- package/Link.js +26 -26
- package/List.js +39 -39
- package/Mentions.js +17 -17
- package/Menu.js +1 -1
- package/Message.js +3 -3
- package/Modal.js +1 -1
- package/Notice.js +4 -10
- package/Notification.js +3 -3
- package/OverflowEllipsis.js +18 -18
- package/PageHeader.js +26 -27
- package/Pagination.js +1 -1
- package/Picker.js +1 -1
- package/Popconfirm.js +15 -15
- package/Popover.js +22 -22
- package/Progress.js +18 -18
- package/Radio.js +2 -2
- package/Rate.js +40 -43
- package/ResizeBox.js +191 -192
- package/Result.js +17 -17
- package/Select.js +1 -1
- package/SelectView.js +56 -56
- package/Skeleton.js +35 -35
- package/Slider.js +81 -81
- package/Space.js +27 -27
- package/SpeechSynthesis.js +29 -32
- package/Spin.js +15 -15
- package/Statistic.js +54 -54
- package/Steps.js +44 -44
- package/Switch.js +39 -38
- package/Table.js +488 -488
- package/Tabs.js +1 -1
- package/Tag.js +13 -14
- package/TimePicker.js +68 -68
- package/Timeline.js +1 -1
- package/Tooltip.js +27 -28
- package/Transfer.js +29 -30
- package/Tree.js +1 -1
- package/TreeSelect.js +1 -1
- package/Trigger.js +53 -52
- package/Typography.js +2 -737
- package/Upload.js +1 -1
- package/VerificationCode.js +1 -1
- package/Version.js +1 -1
- package/Watermark.js +1 -1
- package/chunk/1mEO29GP.js +23 -0
- package/chunk/5pZ3ayqs.js +29 -0
- package/chunk/9Gh1afjL.js +23 -0
- package/chunk/B1S1OEw6.js +29 -0
- package/chunk/{RRWbBHK-.js → B2Bp3i5u.js} +221 -221
- package/chunk/B45v5S9k.js +209 -0
- package/chunk/B6fn5y_s.js +23 -0
- package/chunk/B9PsJar0.js +118 -0
- package/chunk/BA02BFUV.js +41 -0
- package/chunk/BCk8e9fj.js +29 -0
- package/chunk/BHK9zpXn.js +207 -0
- package/chunk/BHLTzWzi.js +29 -0
- package/chunk/BK1FKNAX.js +41 -0
- package/chunk/BM6dpkeM.js +32 -0
- package/chunk/{DQ3uFRJD.js → BP7xX86Q.js} +223 -202
- package/chunk/BWx1cVT_.js +66 -0
- package/chunk/BbI3gqVr.js +23 -0
- package/chunk/{CIc4yo9k.js → BbYzi8M0.js} +46 -46
- package/chunk/Be7oeWU8.js +34 -0
- package/chunk/BeM2hfks.js +88 -0
- package/chunk/BkHxm4sv.js +41 -0
- package/chunk/{BUQBof6z.js → Bl-ODC57.js} +206 -207
- package/chunk/BlKc_pDZ.js +678 -0
- package/chunk/{BzqZZHGK.js → Bny52uiG.js} +48 -48
- package/chunk/{PuuHmqnW.js → BpwDupra.js} +238 -238
- package/chunk/BqxwlITu.js +52 -0
- package/chunk/BuEC_zcc.js +278 -0
- package/chunk/{CqcZfQQ4.js → Bv8ZRDFt.js} +80 -80
- package/chunk/{DZGcv_9A.js → C-w9pFY-.js} +32 -32
- package/chunk/C2fspJbE.js +23 -0
- package/chunk/C7Okdv4u.js +34 -0
- package/chunk/C95ipQ6b.js +41 -0
- package/chunk/{BzMYgxgO.js → CF3Telny.js} +26 -26
- package/chunk/CPl52AZh.js +206 -0
- package/chunk/CXNW5Y2a.js +23 -0
- package/chunk/Cb_oWoGj.js +40 -0
- package/chunk/CcX2pBUh.js +46 -0
- package/chunk/{BdJcAQ0Q.js → CggcswbO.js} +18 -18
- package/chunk/CilQ012k.js +1796 -0
- package/chunk/CkAOsst1.js +73 -0
- package/chunk/CnY8SvgY.js +126 -0
- package/chunk/{CTSIr-Pr.js → CwXmtKib.js} +89 -101
- package/chunk/{C3I_L73_.js → CwjaGytU.js} +39 -40
- package/chunk/{DTgc2wl4.js → D6RTBH4C.js} +36 -36
- package/chunk/D6mVoX-C.js +116 -0
- package/chunk/D9TqtOhq.js +40 -0
- package/chunk/{qSJXQ1qu.js → DBJ8d0o0.js} +183 -189
- package/chunk/{RL1SNlng.js → DDda6s72.js} +16 -16
- package/chunk/{BH5fVprw.js → DJmWXheU.js} +9 -9
- package/chunk/DPvnQJ-H.js +52 -0
- package/chunk/DQXq1QT0.js +58 -0
- package/chunk/DRJO1GfY.js +855 -0
- package/chunk/DUxWiN2U.js +1465 -0
- package/chunk/DYZzQ2uT.js +29 -0
- package/chunk/{CK0H_Yi4.js → DafaH1Qt.js} +140 -138
- package/chunk/{ShWkfsJd.js → DalIRWr7.js} +21 -21
- package/chunk/{CzTYWtfa.js → Dg2DmtzA.js} +31 -30
- package/chunk/DhLbnw3R.js +29 -0
- package/chunk/{BmtF7P8U.js → DkIjpuBZ.js} +170 -170
- package/chunk/Do1aMgY3.js +12 -0
- package/chunk/Dtnux4qL.js +38 -0
- package/chunk/{Niaq_og8.js → Dw4SJ4o1.js} +219 -225
- package/chunk/{DbtCtriE.js → DxNRWF67.js} +30 -31
- package/chunk/JnyGFb5j.js +284 -0
- package/chunk/Lk60-jkf.js +1098 -0
- package/chunk/V_IcWDFx.js +49 -0
- package/chunk/{DG7VgAhL.js → WkB0MERB.js} +107 -108
- package/chunk/bsawGxt8.js +32 -0
- package/chunk/cUuQh7L_.js +46 -0
- package/chunk/fqgc8r6C.js +29 -0
- package/chunk/m_kOQCiU.js +29 -0
- package/chunk/sl8s35SK.js +29 -0
- package/chunk/{Dki1RB5p.js → t51ig1FZ.js} +154 -155
- package/chunk/{BC0PujUD.js → yvbAFxtk.js} +119 -121
- package/hooks/index.js +52 -246
- package/hooks/useForceUpdate.js +6 -6
- package/hooks/useIntersectionObserver.js +12 -10
- package/hooks/useKeyboardEvent.js +7 -7
- package/hooks/useMedia.js +9 -12
- package/hooks/useMergeValue.js +10 -8
- package/hooks/useResizeObserver.js +16 -0
- package/hooks/useUpdateEffect.js +7 -9
- package/hooks/useWindowSize.js +16 -20
- package/icons.js +6003 -0
- package/index.js +377 -472
- package/locale/en-US.js +20 -6
- package/locale/ja-JP.js +4 -2
- package/locale/ko-KR.js +2 -2
- package/locale/pt-BR.js +3 -3
- package/locale/pt-PT.js +3 -3
- package/locale/tr-TR.js +11 -3
- package/locale/zh-CN.js +6 -0
- package/locale/zh-HK.js +2 -0
- package/locale/zh-TW.js +2 -0
- package/package.json +1 -1
- package/style.css +1 -1
- package/types/anchor/util.d.ts +1 -0
- package/types/button/index.d.ts +2 -2
- package/types/color-picker/colors.d.ts +1 -1
- package/types/date-picker/util.d.ts +1 -1
- package/types/hooks/index.d.ts +3 -101
- package/types/hooks/useForceUpdate.d.ts +1 -2
- package/types/hooks/useIntersectionObserver.d.ts +1 -1
- package/types/hooks/useKeyboardEvent.d.ts +2 -2
- package/types/hooks/useMergeProps.d.ts +1 -1
- package/types/hooks/useResizeObserver.d.ts +5 -0
- package/types/hooks/useUpdateEffect.d.ts +2 -3
- package/types/hooks/useWindowSize.d.ts +1 -1
- package/types/icons.d.ts +4 -0
- package/types/index.d.ts +12 -2
- package/types/locale/en-US.d.ts +4 -0
- package/types/locale/interface.d.ts +2 -0
- package/types/locale/ja-JP.d.ts +4 -0
- package/types/locale/zh-CN.d.ts +4 -0
- package/types/locale/zh-HK.d.ts +4 -0
- package/types/locale/zh-TW.d.ts +4 -0
- package/types/modal/config.d.ts +1 -1
- package/types/version/index.d.ts +1 -1
- package/utils/CSSTransition.js +1 -1
- package/utils/className.js +2 -3
- package/utils/contextHolder.js +2 -2
- package/utils/copy.js +2 -3
- package/utils/is.js +127 -90
- package/utils/reactDOM.js +17 -15
- package/utils/responsiveObserve.js +16 -16
- package/utils/saveAs.js +2 -3
- package/utils/scrollIntoView.js +1 -1
- package/chunk/BdYAMaw9.js +0 -6
- package/chunk/CiZVOdJ3.js +0 -122
- package/chunk/DdtfPvgk.js +0 -272
- package/chunk/I4RV9SKZ.js +0 -135
- package/chunk/TXCrI0jN.js +0 -20
- package/chunk/i1A7W8Qt.js +0 -277
- package/chunk/xPzFRQJn.js +0 -740
- package/hooks/useAsync.js +0 -13
- package/hooks/useAsyncFn.js +0 -15
- package/hooks/useAsyncRetry.js +0 -17
- package/hooks/useAudio.js +0 -5
- package/hooks/useBeforeUnload.js +0 -18
- package/hooks/useBoolean.js +0 -4
- package/hooks/useClickAway.js +0 -22
- package/hooks/useCopyToClipboard.js +0 -51
- package/hooks/useCounter.js +0 -45
- package/hooks/useCreation.js +0 -17
- package/hooks/useCustomCompareEffect.js +0 -15
- package/hooks/useDebounce.js +0 -9
- package/hooks/useDefault.js +0 -10
- package/hooks/useDrop.js +0 -44
- package/hooks/useDropArea.js +0 -45
- package/hooks/useEffectOnce.js +0 -7
- package/hooks/useEffectState.js +0 -9
- package/hooks/useEnsuredForwardedRef.js +0 -17
- package/hooks/useError.js +0 -13
- package/hooks/useEvent.js +0 -13
- package/hooks/useEventListener.js +0 -39
- package/hooks/useFavicon.js +0 -16
- package/hooks/useFirstMountState.js +0 -8
- package/hooks/useFullscreen.js +0 -39
- package/hooks/useGeolocation.js +0 -38
- package/hooks/useGetSet.js +0 -18
- package/hooks/useGetSetState.js +0 -12
- package/hooks/useHash.js +0 -26
- package/hooks/useHover.js +0 -16
- package/hooks/useHoverDirty.js +0 -17
- package/hooks/useIdle.js +0 -34
- package/hooks/useIntersection.js +0 -19
- package/hooks/useIsomorphicLayoutEffect2.js +0 -6
- package/hooks/useKey.js +0 -16
- package/hooks/useKeyPress.js +0 -13
- package/hooks/useKeyPressEvent.js +0 -11
- package/hooks/useLatest.js +0 -8
- package/hooks/useLifecycles.js +0 -9
- package/hooks/useList.js +0 -67
- package/hooks/useLocalStorage.js +0 -42
- package/hooks/useLocation.js +0 -51
- package/hooks/useLockBodyScroll.js +0 -55
- package/hooks/useLogger.js +0 -10
- package/hooks/useLongPress.js +0 -24
- package/hooks/useMap.js +0 -31
- package/hooks/useMeasure.js +0 -34
- package/hooks/useMeasureDirty.js +0 -24
- package/hooks/useMediaDevices.js +0 -26
- package/hooks/useMediatedState.js +0 -14
- package/hooks/useMethods.js +0 -14
- package/hooks/useMotion.js +0 -56
- package/hooks/useMount.js +0 -9
- package/hooks/useMountedState.js +0 -10
- package/hooks/useMouse.js +0 -44
- package/hooks/useMouseHovered.js +0 -9
- package/hooks/useMouseWheel.js +0 -14
- package/hooks/useMultiStateValidator.js +0 -19
- package/hooks/useNetworkState.js +0 -31
- package/hooks/useNumber.js +0 -4
- package/hooks/useObservable.js +0 -12
- package/hooks/useOrientation.js +0 -30
- package/hooks/usePageLeave.js +0 -19
- package/hooks/usePermission.js +0 -19
- package/hooks/usePinchZoom.js +0 -40
- package/hooks/usePreviousDistinct.js +0 -10
- package/hooks/usePromise.js +0 -19
- package/hooks/useQueue.js +0 -25
- package/hooks/useRaf.js +0 -24
- package/hooks/useRafLoop.js +0 -24
- package/hooks/useRafState.js +0 -15
- package/hooks/useReactive.js +0 -21
- package/hooks/useRendersCount.js +0 -7
- package/hooks/useScroll.js +0 -27
- package/hooks/useScrolling.js +0 -23
- package/hooks/useSearchParam.js +0 -18
- package/hooks/useSessionStorage.js +0 -29
- package/hooks/useSet.js +0 -15
- package/hooks/useSetState.js +0 -16
- package/hooks/useSize.js +0 -58
- package/hooks/useSlider.js +0 -48
- package/hooks/useSpeech.js +0 -45
- package/hooks/useStartTyping.js +0 -30
- package/hooks/useStateList.js +0 -37
- package/hooks/useStateValidator.js +0 -17
- package/hooks/useStateWithHistory.js +0 -46
- package/hooks/useSyncState.js +0 -14
- package/hooks/useThrottle.js +0 -21
- package/hooks/useThrottleFn.js +0 -21
- package/hooks/useTimeout.js +0 -17
- package/hooks/useTimeoutFn.js +0 -16
- package/hooks/useTitle.js +0 -18
- package/hooks/useToggle.js +0 -5
- package/hooks/useTween.js +0 -11
- package/hooks/useUnmount.js +0 -9
- package/hooks/useUnmountPromise.js +0 -20
- package/hooks/useUpdate.js +0 -10
- package/hooks/useUpdateTimeout.js +0 -9
- package/hooks/useUpsert.js +0 -16
- package/hooks/useVibrate.js +0 -21
- package/hooks/useVideo.js +0 -5
- package/hooks/useWindowScroll.js +0 -29
- package/types/hooks/component/UseKey.d.ts +0 -2
- package/types/hooks/factory/createBreakpoint.d.ts +0 -4
- package/types/hooks/factory/createGlobalState.d.ts +0 -7
- package/types/hooks/factory/createHTMLMediaHook.d.ts +0 -33
- package/types/hooks/factory/createMemo.d.ts +0 -2
- package/types/hooks/factory/createReducer.d.ts +0 -8
- package/types/hooks/factory/createReducerContext.d.ts +0 -5
- package/types/hooks/factory/createRenderProp.d.ts +0 -1
- package/types/hooks/factory/createRouter.d.ts +0 -7
- package/types/hooks/factory/createStateContext.d.ts +0 -5
- package/types/hooks/misc/hookState.d.ts +0 -8
- package/types/hooks/misc/parseTimeRanges.d.ts +0 -4
- package/types/hooks/misc/types.d.ts +0 -2
- package/types/hooks/misc/util.d.ts +0 -5
- package/types/hooks/useAsync.d.ts +0 -20
- package/types/hooks/useAsyncFn.d.ts +0 -23
- package/types/hooks/useAsyncRetry.d.ts +0 -27
- package/types/hooks/useAudio.d.ts +0 -11
- package/types/hooks/useBeforeUnload.d.ts +0 -2
- package/types/hooks/useBoolean.d.ts +0 -2
- package/types/hooks/useClickAway.d.ts +0 -3
- package/types/hooks/useCopyToClipboard.d.ts +0 -7
- package/types/hooks/useCounter.d.ts +0 -9
- package/types/hooks/useCreation.d.ts +0 -2
- package/types/hooks/useCustomCompareEffect.d.ts +0 -4
- package/types/hooks/useDebounce.d.ts +0 -3
- package/types/hooks/useDefault.d.ts +0 -2
- package/types/hooks/useDrop.d.ts +0 -17
- package/types/hooks/useDropArea.d.ts +0 -18
- package/types/hooks/useEffectOnce.d.ts +0 -3
- package/types/hooks/useEffectState.d.ts +0 -2
- package/types/hooks/useEnsuredForwardedRef.d.ts +0 -3
- package/types/hooks/useError.d.ts +0 -2
- package/types/hooks/useEvent.d.ts +0 -13
- package/types/hooks/useEventListener.d.ts +0 -2
- package/types/hooks/useFavicon.d.ts +0 -2
- package/types/hooks/useFirstMountState.d.ts +0 -1
- package/types/hooks/useFullscreen.d.ts +0 -10
- package/types/hooks/useGeolocation.d.ts +0 -21
- package/types/hooks/useGetSet.d.ts +0 -3
- package/types/hooks/useGetSetState.d.ts +0 -2
- package/types/hooks/useHash.d.ts +0 -2
- package/types/hooks/useHover.d.ts +0 -4
- package/types/hooks/useHoverDirty.d.ts +0 -3
- package/types/hooks/useIdle.d.ts +0 -2
- package/types/hooks/useIntersection.d.ts +0 -3
- package/types/hooks/useIsomorphicLayoutEffect2.d.ts +0 -3
- package/types/hooks/useKey.d.ts +0 -12
- package/types/hooks/useKeyPress.d.ts +0 -3
- package/types/hooks/useKeyPressEvent.d.ts +0 -3
- package/types/hooks/useLatest.d.ts +0 -4
- package/types/hooks/useLifecycles.d.ts +0 -2
- package/types/hooks/useList.d.ts +0 -18
- package/types/hooks/useLocalStorage.d.ts +0 -10
- package/types/hooks/useLocation.d.ts +0 -16
- package/types/hooks/useLockBodyScroll.d.ts +0 -8
- package/types/hooks/useLogger.d.ts +0 -2
- package/types/hooks/useLongPress.d.ts +0 -12
- package/types/hooks/useMap.d.ts +0 -11
- package/types/hooks/useMeasure.d.ts +0 -9
- package/types/hooks/useMeasureDirty.d.ts +0 -11
- package/types/hooks/useMediaDevices.d.ts +0 -2
- package/types/hooks/useMediatedState.d.ts +0 -9
- package/types/hooks/useMethods.d.ts +0 -8
- package/types/hooks/useMotion.d.ts +0 -20
- package/types/hooks/useMount.d.ts +0 -2
- package/types/hooks/useMountedState.d.ts +0 -1
- package/types/hooks/useMouse.d.ts +0 -13
- package/types/hooks/useMouseHovered.d.ts +0 -8
- package/types/hooks/useMouseWheel.d.ts +0 -2
- package/types/hooks/useMultiStateValidator.d.ts +0 -9
- package/types/hooks/useNetworkState.d.ts +0 -22
- package/types/hooks/useNumber.d.ts +0 -2
- package/types/hooks/useObservable.d.ts +0 -8
- package/types/hooks/useOrientation.d.ts +0 -6
- package/types/hooks/usePageLeave.d.ts +0 -2
- package/types/hooks/usePermission.d.ts +0 -16
- package/types/hooks/usePinchZoom.d.ts +0 -18
- package/types/hooks/usePreviousDistinct.d.ts +0 -2
- package/types/hooks/usePromise.d.ts +0 -3
- package/types/hooks/useQueue.d.ts +0 -9
- package/types/hooks/useRaf.d.ts +0 -2
- package/types/hooks/useRafLoop.d.ts +0 -2
- package/types/hooks/useRafState.d.ts +0 -3
- package/types/hooks/useReactive.d.ts +0 -2
- package/types/hooks/useRendersCount.d.ts +0 -1
- package/types/hooks/useScroll.d.ts +0 -7
- package/types/hooks/useScrolling.d.ts +0 -3
- package/types/hooks/useSearchParam.d.ts +0 -3
- package/types/hooks/useSessionStorage.d.ts +0 -2
- package/types/hooks/useSet.d.ts +0 -11
- package/types/hooks/useSetState.d.ts +0 -2
- package/types/hooks/useSize.d.ts +0 -8
- package/types/hooks/useSlider.d.ts +0 -15
- package/types/hooks/useSpeech.d.ts +0 -16
- package/types/hooks/useStartTyping.d.ts +0 -2
- package/types/hooks/useStateList.d.ts +0 -9
- package/types/hooks/useStateValidator.d.ts +0 -8
- package/types/hooks/useStateWithHistory.d.ts +0 -18
- package/types/hooks/useSyncState.d.ts +0 -3
- package/types/hooks/useThrottle.d.ts +0 -2
- package/types/hooks/useThrottleFn.d.ts +0 -2
- package/types/hooks/useTimeout.d.ts +0 -2
- package/types/hooks/useTimeoutFn.d.ts +0 -2
- package/types/hooks/useTitle.d.ts +0 -6
- package/types/hooks/useToggle.d.ts +0 -2
- package/types/hooks/useTween.d.ts +0 -3
- package/types/hooks/useUnmount.d.ts +0 -2
- package/types/hooks/useUnmountPromise.d.ts +0 -3
- package/types/hooks/useUpdate.d.ts +0 -2
- package/types/hooks/useUpdateTimeout.d.ts +0 -2
- package/types/hooks/useUpsert.d.ts +0 -6
- package/types/hooks/useVibrate.d.ts +0 -4
- package/types/hooks/useVideo.d.ts +0 -11
- package/types/hooks/useWindowScroll.d.ts +0 -6
package/hooks/useAsync.js
DELETED
package/hooks/useAsyncFn.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { useRef as i, useState as f, useCallback as g } from "react";
|
|
2
|
-
import m from "./useMountedState.js";
|
|
3
|
-
function k(o, r = [], u = { loading: !1 }) {
|
|
4
|
-
const e = i(0), a = m(), [s, n] = f(u), c = g((...d) => {
|
|
5
|
-
const l = ++e.current;
|
|
6
|
-
return s.loading || n((t) => ({ ...t, loading: !0 })), o(...d).then(
|
|
7
|
-
(t) => (a() && l === e.current && n({ value: t, loading: !1 }), t),
|
|
8
|
-
(t) => (a() && l === e.current && n({ error: t, loading: !1 }), t)
|
|
9
|
-
);
|
|
10
|
-
}, r);
|
|
11
|
-
return [s, c];
|
|
12
|
-
}
|
|
13
|
-
export {
|
|
14
|
-
k as default
|
|
15
|
-
};
|
package/hooks/useAsyncRetry.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { useState as i, useCallback as l } from "react";
|
|
2
|
-
import u from "./useAsync.js";
|
|
3
|
-
const y = (s, t = []) => {
|
|
4
|
-
const [n, r] = i(0), e = u(s, [...t, n]), o = e.loading, a = l(() => {
|
|
5
|
-
if (o) {
|
|
6
|
-
process.env.NODE_ENV === "development" && console.log(
|
|
7
|
-
"You are calling useAsyncRetry hook retry() method while loading in progress, this is a no-op."
|
|
8
|
-
);
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
r((c) => c + 1);
|
|
12
|
-
}, [...t, o]);
|
|
13
|
-
return { ...e, retry: a };
|
|
14
|
-
};
|
|
15
|
-
export {
|
|
16
|
-
y as default
|
|
17
|
-
};
|
package/hooks/useAudio.js
DELETED
package/hooks/useBeforeUnload.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { useCallback as n, useEffect as u } from "react";
|
|
2
|
-
import { o as e, a } from "../chunk/TXCrI0jN.js";
|
|
3
|
-
const d = (r = !0, o) => {
|
|
4
|
-
const f = n(
|
|
5
|
-
(t) => {
|
|
6
|
-
if (typeof r != "function" || r())
|
|
7
|
-
return t.preventDefault(), o && (t.returnValue = o), o;
|
|
8
|
-
},
|
|
9
|
-
[r, o]
|
|
10
|
-
);
|
|
11
|
-
u(() => {
|
|
12
|
-
if (r)
|
|
13
|
-
return e(window, "beforeunload", f), () => a(window, "beforeunload", f);
|
|
14
|
-
}, [r, f]);
|
|
15
|
-
};
|
|
16
|
-
export {
|
|
17
|
-
d as default
|
|
18
|
-
};
|
package/hooks/useBoolean.js
DELETED
package/hooks/useClickAway.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { useRef as u, useEffect as a } from "react";
|
|
2
|
-
import { o as f, a as m } from "../chunk/TXCrI0jN.js";
|
|
3
|
-
const d = ["mousedown", "touchstart"], h = (r, o, e = d) => {
|
|
4
|
-
const n = u(o);
|
|
5
|
-
a(() => {
|
|
6
|
-
n.current = o;
|
|
7
|
-
}, [o]), a(() => {
|
|
8
|
-
const s = (t) => {
|
|
9
|
-
const { current: c } = r;
|
|
10
|
-
c && !c.contains(t.target) && n.current(t);
|
|
11
|
-
};
|
|
12
|
-
for (const t of e)
|
|
13
|
-
f(document, t, s);
|
|
14
|
-
return () => {
|
|
15
|
-
for (const t of e)
|
|
16
|
-
m(document, t, s);
|
|
17
|
-
};
|
|
18
|
-
}, [e, r]);
|
|
19
|
-
};
|
|
20
|
-
export {
|
|
21
|
-
h as default
|
|
22
|
-
};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { useCallback as p } from "react";
|
|
2
|
-
import a from "@unicom-cloud/utils/clipboard-copy";
|
|
3
|
-
import f from "./useMountedState.js";
|
|
4
|
-
import m from "./useSetState.js";
|
|
5
|
-
const b = () => {
|
|
6
|
-
const s = f(), [i, e] = m({
|
|
7
|
-
value: void 0,
|
|
8
|
-
error: void 0,
|
|
9
|
-
noUserInteraction: !0
|
|
10
|
-
}), c = p((r) => {
|
|
11
|
-
if (!s())
|
|
12
|
-
return;
|
|
13
|
-
let n, t;
|
|
14
|
-
try {
|
|
15
|
-
if (typeof r != "string" && typeof r != "number") {
|
|
16
|
-
const o = new Error(
|
|
17
|
-
`Cannot copy typeof ${typeof r} to clipboard, must be a string`
|
|
18
|
-
);
|
|
19
|
-
process.env.NODE_ENV === "development" && console.error(o), e({
|
|
20
|
-
value: r,
|
|
21
|
-
error: o,
|
|
22
|
-
noUserInteraction: !0
|
|
23
|
-
});
|
|
24
|
-
return;
|
|
25
|
-
} else if (r === "") {
|
|
26
|
-
const o = new Error("Cannot copy empty string to clipboard.");
|
|
27
|
-
process.env.NODE_ENV === "development" && console.error(o), e({
|
|
28
|
-
value: r,
|
|
29
|
-
error: o,
|
|
30
|
-
noUserInteraction: !0
|
|
31
|
-
});
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
t = r.toString(), n = a(t), e({
|
|
35
|
-
value: t,
|
|
36
|
-
error: void 0,
|
|
37
|
-
noUserInteraction: n
|
|
38
|
-
});
|
|
39
|
-
} catch (o) {
|
|
40
|
-
e({
|
|
41
|
-
value: t,
|
|
42
|
-
error: o,
|
|
43
|
-
noUserInteraction: n
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
}, []);
|
|
47
|
-
return [i, c];
|
|
48
|
-
};
|
|
49
|
-
export {
|
|
50
|
-
b as default
|
|
51
|
-
};
|
package/hooks/useCounter.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { useMemo as i } from "react";
|
|
2
|
-
import { r as a } from "../chunk/BdYAMaw9.js";
|
|
3
|
-
import p from "./useGetSet.js";
|
|
4
|
-
function g(l = 0, r = null, n = null) {
|
|
5
|
-
let o = a(l);
|
|
6
|
-
typeof o != "number" && console.error(
|
|
7
|
-
"initialValue has to be a number, got " + typeof l
|
|
8
|
-
), typeof n == "number" ? o = Math.max(o, n) : n !== null && console.error("min has to be a number, got " + typeof n), typeof r == "number" ? o = Math.min(o, r) : r !== null && console.error("max has to be a number, got " + typeof r);
|
|
9
|
-
const [f, b] = p(o);
|
|
10
|
-
return [
|
|
11
|
-
f(),
|
|
12
|
-
i(() => {
|
|
13
|
-
const s = (u) => {
|
|
14
|
-
const e = f();
|
|
15
|
-
let t = a(u, e);
|
|
16
|
-
e !== t && (typeof n == "number" && (t = Math.max(t, n)), typeof r == "number" && (t = Math.min(t, r)), e !== t && b(t));
|
|
17
|
-
};
|
|
18
|
-
return {
|
|
19
|
-
get: f,
|
|
20
|
-
set: s,
|
|
21
|
-
inc: (u = 1) => {
|
|
22
|
-
const e = a(u, f());
|
|
23
|
-
typeof e != "number" && console.error(
|
|
24
|
-
"delta has to be a number or function returning a number, got " + typeof e
|
|
25
|
-
), s((t) => t + e);
|
|
26
|
-
},
|
|
27
|
-
dec: (u = 1) => {
|
|
28
|
-
const e = a(u, f());
|
|
29
|
-
typeof e != "number" && console.error(
|
|
30
|
-
"delta has to be a number or function returning a number, got " + typeof e
|
|
31
|
-
), s((t) => t - e);
|
|
32
|
-
},
|
|
33
|
-
reset: (u = o) => {
|
|
34
|
-
const e = a(u, f());
|
|
35
|
-
typeof e != "number" && console.error(
|
|
36
|
-
"value has to be a number or function returning a number, got " + typeof e
|
|
37
|
-
), o = e, s(e);
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
}, [o, n, r])
|
|
41
|
-
];
|
|
42
|
-
}
|
|
43
|
-
export {
|
|
44
|
-
g as default
|
|
45
|
-
};
|
package/hooks/useCreation.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { useRef as r } from "react";
|
|
2
|
-
const n = (i, t) => {
|
|
3
|
-
if (i === t) return !0;
|
|
4
|
-
for (let e = 0; e < i.length; e++)
|
|
5
|
-
if (!Object.is(i[e], t[e])) return !1;
|
|
6
|
-
return !0;
|
|
7
|
-
}, f = (i, t) => {
|
|
8
|
-
const { current: e } = r({
|
|
9
|
-
deps: t,
|
|
10
|
-
obj: void 0,
|
|
11
|
-
initialized: !1
|
|
12
|
-
});
|
|
13
|
-
return (e.initialized === !1 || !n(e.deps, t)) && (e.deps = t, e.obj = i(), e.initialized = !0), e.obj;
|
|
14
|
-
};
|
|
15
|
-
export {
|
|
16
|
-
f as default
|
|
17
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { useRef as n, useEffect as c } from "react";
|
|
2
|
-
const r = (t) => t !== Object(t), i = (t, e, s) => {
|
|
3
|
-
process.env.NODE_ENV !== "production" && ((!(e instanceof Array) || !e.length) && console.warn(
|
|
4
|
-
"`useCustomCompareEffect` should not be used with no dependencies. Use React.useEffect instead."
|
|
5
|
-
), e.every(r) && console.warn(
|
|
6
|
-
"`useCustomCompareEffect` should not be used with dependencies that are all primitive values. Use React.useEffect instead."
|
|
7
|
-
), typeof s != "function" && console.warn(
|
|
8
|
-
"`useCustomCompareEffect` should be used with depsEqual callback for comparing deps list"
|
|
9
|
-
));
|
|
10
|
-
const o = n(void 0);
|
|
11
|
-
(!o.current || !s(e, o.current)) && (o.current = e), c(t, o.current);
|
|
12
|
-
};
|
|
13
|
-
export {
|
|
14
|
-
i as default
|
|
15
|
-
};
|
package/hooks/useDebounce.js
DELETED
package/hooks/useDefault.js
DELETED
package/hooks/useDrop.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { useState as b, useCallback as E, useMemo as O, useEffect as F } from "react";
|
|
2
|
-
import { o as a, a as n, n as l } from "../chunk/TXCrI0jN.js";
|
|
3
|
-
const P = (o) => (r, t) => {
|
|
4
|
-
const s = r.getData("text/uri-list");
|
|
5
|
-
if (s) {
|
|
6
|
-
(o.onUri || l)(s, t);
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
if (r.files && r.files.length) {
|
|
10
|
-
(o.onFiles || l)(Array.from(r.files), t);
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
if (t.clipboardData) {
|
|
14
|
-
const u = t.clipboardData.getData("text");
|
|
15
|
-
(o.onText || l)(u, t);
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
}, k = (o = {}, r = []) => {
|
|
19
|
-
const { onFiles: t, onText: s, onUri: u } = o, [x, v] = b(!1), c = E(v, []), d = O(
|
|
20
|
-
() => P(o),
|
|
21
|
-
[t, s, u]
|
|
22
|
-
);
|
|
23
|
-
return F(() => {
|
|
24
|
-
const f = (e) => {
|
|
25
|
-
e.preventDefault(), c(!0);
|
|
26
|
-
}, i = (e) => {
|
|
27
|
-
e.preventDefault(), c(!0);
|
|
28
|
-
}, m = () => {
|
|
29
|
-
c(!1);
|
|
30
|
-
}, g = () => {
|
|
31
|
-
c(!1);
|
|
32
|
-
}, p = (e) => {
|
|
33
|
-
e.preventDefault(), c(!1), d(e.dataTransfer, e);
|
|
34
|
-
}, D = (e) => {
|
|
35
|
-
d(e.clipboardData, e);
|
|
36
|
-
};
|
|
37
|
-
return a(document, "dragover", f), a(document, "dragenter", i), a(document, "dragleave", m), a(document, "dragexit", g), a(document, "drop", p), s && a(document, "paste", D), () => {
|
|
38
|
-
n(document, "dragover", f), n(document, "dragenter", i), n(document, "dragleave", m), n(document, "dragexit", g), n(document, "drop", p), n(document, "paste", D);
|
|
39
|
-
};
|
|
40
|
-
}, [d, ...r]), { over: x };
|
|
41
|
-
};
|
|
42
|
-
export {
|
|
43
|
-
k as default
|
|
44
|
-
};
|
package/hooks/useDropArea.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { useState as f, useMemo as c } from "react";
|
|
2
|
-
import { n } from "../chunk/TXCrI0jN.js";
|
|
3
|
-
import m from "./useMountedState.js";
|
|
4
|
-
const a = (o, t) => (e, r) => {
|
|
5
|
-
const s = e.getData("text/uri-list");
|
|
6
|
-
if (s) {
|
|
7
|
-
(o.onUri || n)(s, r);
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
if (e.files && e.files.length) {
|
|
11
|
-
(o.onFiles || n)(Array.from(e.files), r);
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
e.items && e.items.length && e.items[0].getAsString((i) => {
|
|
15
|
-
t && (o.onText || n)(i, r);
|
|
16
|
-
});
|
|
17
|
-
}, p = (o, t) => ({
|
|
18
|
-
onDragOver: (e) => {
|
|
19
|
-
e.preventDefault();
|
|
20
|
-
},
|
|
21
|
-
onDragEnter: (e) => {
|
|
22
|
-
e.preventDefault(), t(!0);
|
|
23
|
-
},
|
|
24
|
-
onDragLeave: () => {
|
|
25
|
-
t(!1);
|
|
26
|
-
},
|
|
27
|
-
onDrop: (e) => {
|
|
28
|
-
e.preventDefault(), e.persist(), t(!1), o(e.dataTransfer, e);
|
|
29
|
-
},
|
|
30
|
-
onPaste: (e) => {
|
|
31
|
-
e.persist(), o(e.clipboardData, e);
|
|
32
|
-
}
|
|
33
|
-
}), A = (o = {}) => {
|
|
34
|
-
const { onFiles: t, onText: e, onUri: r } = o, s = m(), [i, l] = f(!1), u = c(
|
|
35
|
-
() => a(o, s()),
|
|
36
|
-
[t, e, r]
|
|
37
|
-
);
|
|
38
|
-
return [c(
|
|
39
|
-
() => p(u, l),
|
|
40
|
-
[u, l]
|
|
41
|
-
), { over: i }];
|
|
42
|
-
};
|
|
43
|
-
export {
|
|
44
|
-
A as default
|
|
45
|
-
};
|
package/hooks/useEffectOnce.js
DELETED
package/hooks/useEffectState.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { useRef as t, useEffect as s, forwardRef as c } from "react";
|
|
2
|
-
function f(e) {
|
|
3
|
-
const r = t(e && e.current);
|
|
4
|
-
return s(() => {
|
|
5
|
-
e && (e.current = r.current);
|
|
6
|
-
}, [e]), r;
|
|
7
|
-
}
|
|
8
|
-
function i(e) {
|
|
9
|
-
return c((r, n) => {
|
|
10
|
-
const u = f(n);
|
|
11
|
-
return e(r, u);
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
export {
|
|
15
|
-
f as default,
|
|
16
|
-
i as ensuredForwardRef
|
|
17
|
-
};
|
package/hooks/useError.js
DELETED
package/hooks/useEvent.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { useEffect as r } from "react";
|
|
2
|
-
import { o as n, a as c, i as w } from "../chunk/TXCrI0jN.js";
|
|
3
|
-
const y = w ? window : null, e = (s) => !!s.addEventListener, o = (s) => !!s.on, T = (s, i, f = y, u) => {
|
|
4
|
-
r(() => {
|
|
5
|
-
if (i && f)
|
|
6
|
-
return e(f) ? n(f, s, i, u) : o(f) && f.on(s, i, u), () => {
|
|
7
|
-
e(f) ? c(f, s, i, u) : o(f) && f.off(s, i, u);
|
|
8
|
-
};
|
|
9
|
-
}, [s, i, f, JSON.stringify(u)]);
|
|
10
|
-
};
|
|
11
|
-
export {
|
|
12
|
-
T as default
|
|
13
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { useRef as o, useEffect as a } from "react";
|
|
2
|
-
import d from "./useLatest.js";
|
|
3
|
-
import l from "./useUnmount.js";
|
|
4
|
-
const m = (t, c) => {
|
|
5
|
-
for (let r = 0; r < t.length; r++)
|
|
6
|
-
if (!Object.is(t[r], c[r])) return !1;
|
|
7
|
-
return !0;
|
|
8
|
-
}, E = (t, c, r) => {
|
|
9
|
-
const i = o(!1), n = o([]), s = o([]), e = o();
|
|
10
|
-
a(() => {
|
|
11
|
-
var f;
|
|
12
|
-
const u = "current" in r ? r.current : window;
|
|
13
|
-
if (!i.current) {
|
|
14
|
-
i.current = !0, n.current = u, s.current = c, e.current = t();
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
(n.current !== u || !m(c, s.current)) && ((f = e.current) == null || f.call(e), n.current = u, s.current = c, e.current = t());
|
|
18
|
-
}), l(() => {
|
|
19
|
-
var u;
|
|
20
|
-
(u = e.current) == null || u.call(e), i.current = !1;
|
|
21
|
-
});
|
|
22
|
-
}, h = (t, c, r = window) => {
|
|
23
|
-
const i = d(c);
|
|
24
|
-
E(
|
|
25
|
-
() => {
|
|
26
|
-
const n = "current" in r ? r.current : window;
|
|
27
|
-
if (!(n != null && n.addEventListener)) return;
|
|
28
|
-
const s = (e) => i.current(e);
|
|
29
|
-
return n.addEventListener(t, s), () => {
|
|
30
|
-
n.removeEventListener(t, s);
|
|
31
|
-
};
|
|
32
|
-
},
|
|
33
|
-
[t],
|
|
34
|
-
r
|
|
35
|
-
);
|
|
36
|
-
};
|
|
37
|
-
export {
|
|
38
|
-
h as default
|
|
39
|
-
};
|
package/hooks/useFavicon.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { useEffect as o } from "react";
|
|
2
|
-
const t = {
|
|
3
|
-
SVG: "image/svg+xml",
|
|
4
|
-
ICO: "image/x-icon",
|
|
5
|
-
GIF: "image/gif",
|
|
6
|
-
PNG: "image/png"
|
|
7
|
-
}, a = (e) => {
|
|
8
|
-
o(() => {
|
|
9
|
-
if (!e) return;
|
|
10
|
-
const n = e.split(".").at(-1).toLocaleUpperCase(), i = window.document.querySelector("link[rel*='icon']") || window.document.createElement("link");
|
|
11
|
-
i.type = t[n], i.href = e, i.rel = "shortcut icon", window.document.head.appendChild(i);
|
|
12
|
-
}, [e]);
|
|
13
|
-
};
|
|
14
|
-
export {
|
|
15
|
-
a as default
|
|
16
|
-
};
|
package/hooks/useFullscreen.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import r from "@unicom-cloud/utils/screenfull";
|
|
2
|
-
import { useState as F } from "react";
|
|
3
|
-
import { o as b, a as i, n as m } from "../chunk/TXCrI0jN.js";
|
|
4
|
-
import E from "./useIsomorphicLayoutEffect.js";
|
|
5
|
-
const d = (c, l, f = {}) => {
|
|
6
|
-
const { video: e, onClose: s = m } = f, [a, n] = F(l);
|
|
7
|
-
return E(() => {
|
|
8
|
-
if (!l || !c.current)
|
|
9
|
-
return;
|
|
10
|
-
const u = () => {
|
|
11
|
-
e != null && e.current && i(e.current, "webkitendfullscreen", u), s();
|
|
12
|
-
}, o = () => {
|
|
13
|
-
if (r.isEnabled) {
|
|
14
|
-
const t = r.isFullscreen;
|
|
15
|
-
n(t), t || s();
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
if (r.isEnabled) {
|
|
19
|
-
try {
|
|
20
|
-
r.request(c.current), n(!0);
|
|
21
|
-
} catch (t) {
|
|
22
|
-
s(t), n(!1);
|
|
23
|
-
}
|
|
24
|
-
r.on("change", o);
|
|
25
|
-
} else e && e.current && e.current.webkitEnterFullscreen ? (e.current.webkitEnterFullscreen(), b(e.current, "webkitendfullscreen", u), n(!0)) : (s(), n(!1));
|
|
26
|
-
return () => {
|
|
27
|
-
if (n(!1), r.isEnabled)
|
|
28
|
-
try {
|
|
29
|
-
r.off("change", o), r.exit();
|
|
30
|
-
} catch (t) {
|
|
31
|
-
console.error(t);
|
|
32
|
-
}
|
|
33
|
-
else e && e.current && e.current.webkitExitFullscreen && (i(e.current, "webkitendfullscreen", u), e.current.webkitExitFullscreen());
|
|
34
|
-
};
|
|
35
|
-
}, [l, e, c]), a;
|
|
36
|
-
};
|
|
37
|
-
export {
|
|
38
|
-
d as default
|
|
39
|
-
};
|
package/hooks/useGeolocation.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { useState as r, useEffect as n } from "react";
|
|
2
|
-
const g = (o) => {
|
|
3
|
-
const [i, e] = r({
|
|
4
|
-
loading: !0,
|
|
5
|
-
accuracy: null,
|
|
6
|
-
altitude: null,
|
|
7
|
-
altitudeAccuracy: null,
|
|
8
|
-
heading: null,
|
|
9
|
-
latitude: null,
|
|
10
|
-
longitude: null,
|
|
11
|
-
speed: null,
|
|
12
|
-
timestamp: Date.now()
|
|
13
|
-
});
|
|
14
|
-
let a = !0, l;
|
|
15
|
-
const c = (t) => {
|
|
16
|
-
a && e({
|
|
17
|
-
loading: !1,
|
|
18
|
-
accuracy: t.coords.accuracy,
|
|
19
|
-
altitude: t.coords.altitude,
|
|
20
|
-
altitudeAccuracy: t.coords.altitudeAccuracy,
|
|
21
|
-
heading: t.coords.heading,
|
|
22
|
-
latitude: t.coords.latitude,
|
|
23
|
-
longitude: t.coords.longitude,
|
|
24
|
-
speed: t.coords.speed,
|
|
25
|
-
timestamp: t.timestamp
|
|
26
|
-
});
|
|
27
|
-
}, u = (t) => a && e((d) => ({ ...d, loading: !1, error: t }));
|
|
28
|
-
return n(() => (navigator.geolocation.getCurrentPosition(c, u, o), l = navigator.geolocation.watchPosition(
|
|
29
|
-
c,
|
|
30
|
-
u,
|
|
31
|
-
o
|
|
32
|
-
), () => {
|
|
33
|
-
a = !1, navigator.geolocation.clearWatch(l);
|
|
34
|
-
}), []), i;
|
|
35
|
-
};
|
|
36
|
-
export {
|
|
37
|
-
g as default
|
|
38
|
-
};
|
package/hooks/useGetSet.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { useRef as u, useMemo as c } from "react";
|
|
2
|
-
import { r as t } from "../chunk/BdYAMaw9.js";
|
|
3
|
-
import n from "./useForceUpdate.js";
|
|
4
|
-
function p(r) {
|
|
5
|
-
const e = u(t(r)), o = n();
|
|
6
|
-
return c(
|
|
7
|
-
() => [
|
|
8
|
-
() => e.current,
|
|
9
|
-
(s) => {
|
|
10
|
-
e.current = t(s, e.current), o();
|
|
11
|
-
}
|
|
12
|
-
],
|
|
13
|
-
[]
|
|
14
|
-
);
|
|
15
|
-
}
|
|
16
|
-
export {
|
|
17
|
-
p as default
|
|
18
|
-
};
|
package/hooks/useGetSetState.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { useRef as u, useCallback as r } from "react";
|
|
2
|
-
import a from "./useForceUpdate.js";
|
|
3
|
-
const p = (t = {}) => {
|
|
4
|
-
process.env.NODE_ENV !== "production" && typeof t != "object" && console.error("useGetSetState initial state must be an object.");
|
|
5
|
-
const s = a(), o = u({ ...t }), c = r(() => o.current, []), n = r((e) => {
|
|
6
|
-
e && (process.env.NODE_ENV !== "production" && typeof e != "object" && console.error("useGetSetState setter patch must be an object."), Object.assign(o.current, e), s());
|
|
7
|
-
}, []);
|
|
8
|
-
return [c, n];
|
|
9
|
-
};
|
|
10
|
-
export {
|
|
11
|
-
p as default
|
|
12
|
-
};
|
package/hooks/useHash.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { useState as e, useCallback as h } from "react";
|
|
2
|
-
import { a as i, o as c } from "../chunk/TXCrI0jN.js";
|
|
3
|
-
import r from "./useLifecycles.js";
|
|
4
|
-
const d = () => {
|
|
5
|
-
const [o, n] = e(() => window.location.hash), a = h(() => {
|
|
6
|
-
n(window.location.hash);
|
|
7
|
-
}, []);
|
|
8
|
-
r(
|
|
9
|
-
() => {
|
|
10
|
-
c(window, "hashchange", a);
|
|
11
|
-
},
|
|
12
|
-
() => {
|
|
13
|
-
i(window, "hashchange", a);
|
|
14
|
-
}
|
|
15
|
-
);
|
|
16
|
-
const t = h(
|
|
17
|
-
(s) => {
|
|
18
|
-
s !== o && (window.location.hash = s);
|
|
19
|
-
},
|
|
20
|
-
[o]
|
|
21
|
-
);
|
|
22
|
-
return [o, t];
|
|
23
|
-
};
|
|
24
|
-
export {
|
|
25
|
-
d as default
|
|
26
|
-
};
|
package/hooks/useHover.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import a from "react";
|
|
2
|
-
import { n as r } from "../chunk/TXCrI0jN.js";
|
|
3
|
-
const { useState: p } = a, v = (o) => {
|
|
4
|
-
const [e, n] = p(!1), u = (s) => (t) => {
|
|
5
|
-
(s || r)(t), n(!0);
|
|
6
|
-
}, c = (s) => (t) => {
|
|
7
|
-
(s || r)(t), n(!1);
|
|
8
|
-
};
|
|
9
|
-
return typeof o == "function" && (o = o(e)), [a.cloneElement(o, {
|
|
10
|
-
onMouseEnter: u(o.props.onMouseEnter),
|
|
11
|
-
onMouseLeave: c(o.props.onMouseLeave)
|
|
12
|
-
}), e];
|
|
13
|
-
};
|
|
14
|
-
export {
|
|
15
|
-
v as default
|
|
16
|
-
};
|
package/hooks/useHoverDirty.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { useState as f, useEffect as i } from "react";
|
|
2
|
-
import { o as n, a as c } from "../chunk/TXCrI0jN.js";
|
|
3
|
-
const v = (e, o = !0) => {
|
|
4
|
-
process.env.NODE_ENV === "development" && (typeof e != "object" || typeof e.current > "u") && console.error("useHoverDirty expects a single ref argument.");
|
|
5
|
-
const [a, r] = f(!1);
|
|
6
|
-
return i(() => {
|
|
7
|
-
const u = () => r(!0), s = () => r(!1);
|
|
8
|
-
o && e && e.current && (n(e.current, "mouseover", u), n(e.current, "mouseout", s));
|
|
9
|
-
const { current: t } = e;
|
|
10
|
-
return () => {
|
|
11
|
-
o && t && (c(t, "mouseover", u), c(t, "mouseout", s));
|
|
12
|
-
};
|
|
13
|
-
}, [o, e]), a;
|
|
14
|
-
};
|
|
15
|
-
export {
|
|
16
|
-
v as default
|
|
17
|
-
};
|