@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/useIdle.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import h from "lodash/throttle";
|
|
2
|
-
import { useState as w, useEffect as g } from "react";
|
|
3
|
-
import { o as f, a as c } from "../chunk/TXCrI0jN.js";
|
|
4
|
-
const p = [
|
|
5
|
-
"mousemove",
|
|
6
|
-
"mousedown",
|
|
7
|
-
"resize",
|
|
8
|
-
"keydown",
|
|
9
|
-
"touchstart",
|
|
10
|
-
"wheel"
|
|
11
|
-
], y = 6e4, S = (o = y, m = !1, e = p) => {
|
|
12
|
-
const [u, d] = w(m);
|
|
13
|
-
return g(() => {
|
|
14
|
-
let l = !0, i, r = u;
|
|
15
|
-
const n = (t) => {
|
|
16
|
-
l && (r = t, d(t));
|
|
17
|
-
}, s = h(() => {
|
|
18
|
-
r && n(!1), clearTimeout(i), i = setTimeout(() => n(!0), o);
|
|
19
|
-
}, 50), a = () => {
|
|
20
|
-
document.hidden || s();
|
|
21
|
-
};
|
|
22
|
-
for (let t = 0; t < e.length; t++)
|
|
23
|
-
f(window, e[t], s);
|
|
24
|
-
return f(document, "visibilitychange", a), i = setTimeout(() => n(!0), o), () => {
|
|
25
|
-
l = !1;
|
|
26
|
-
for (let t = 0; t < e.length; t++)
|
|
27
|
-
c(window, e[t], s);
|
|
28
|
-
c(document, "visibilitychange", a);
|
|
29
|
-
};
|
|
30
|
-
}, [o, e]), u;
|
|
31
|
-
};
|
|
32
|
-
export {
|
|
33
|
-
S as default
|
|
34
|
-
};
|
package/hooks/useIntersection.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { useState as u, useEffect as i } from "react";
|
|
2
|
-
const b = (r, e) => {
|
|
3
|
-
const [s, t] = u(null);
|
|
4
|
-
return i(() => {
|
|
5
|
-
if (r.current && typeof IntersectionObserver == "function") {
|
|
6
|
-
const c = (o) => {
|
|
7
|
-
t(o[0]);
|
|
8
|
-
}, n = new IntersectionObserver(c, e);
|
|
9
|
-
return n.observe(r.current), () => {
|
|
10
|
-
t(null), n.disconnect();
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
return () => {
|
|
14
|
-
};
|
|
15
|
-
}, [r.current, e.threshold, e.root, e.rootMargin]), s;
|
|
16
|
-
};
|
|
17
|
-
export {
|
|
18
|
-
b as default
|
|
19
|
-
};
|
package/hooks/useKey.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { useMemo as u } from "react";
|
|
2
|
-
import { n as m } from "../chunk/TXCrI0jN.js";
|
|
3
|
-
import d from "./useEvent.js";
|
|
4
|
-
const i = (o) => typeof o == "function" ? o : typeof o == "string" ? (t) => t.key === o : o ? () => !0 : () => !1, v = (o, t = m, n = {}, r = [o]) => {
|
|
5
|
-
const { event: s = "keydown", target: a, options: c } = n, f = u(() => {
|
|
6
|
-
const p = i(o);
|
|
7
|
-
return (e) => {
|
|
8
|
-
if (p(e))
|
|
9
|
-
return t(e);
|
|
10
|
-
};
|
|
11
|
-
}, r);
|
|
12
|
-
d(s, f, a, c);
|
|
13
|
-
};
|
|
14
|
-
export {
|
|
15
|
-
v as default
|
|
16
|
-
};
|
package/hooks/useKeyPress.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { useState as u } from "react";
|
|
2
|
-
import r from "./useKey.js";
|
|
3
|
-
const f = (s) => {
|
|
4
|
-
const [e, o] = u([!1, null]);
|
|
5
|
-
return r(s, (t) => o([!0, t]), { event: "keydown" }, [
|
|
6
|
-
e
|
|
7
|
-
]), r(s, (t) => o([!1, t]), { event: "keyup" }, [
|
|
8
|
-
e
|
|
9
|
-
]), e;
|
|
10
|
-
};
|
|
11
|
-
export {
|
|
12
|
-
f as default
|
|
13
|
-
};
|
package/hooks/useLatest.js
DELETED
package/hooks/useLifecycles.js
DELETED
package/hooks/useList.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { useRef as l, useMemo as i } from "react";
|
|
2
|
-
import { r as u } from "../chunk/BdYAMaw9.js";
|
|
3
|
-
import d from "./useForceUpdate.js";
|
|
4
|
-
function m(a = []) {
|
|
5
|
-
const c = l(u(a)), p = d(), o = i(() => {
|
|
6
|
-
const n = {
|
|
7
|
-
set: (t) => {
|
|
8
|
-
c.current = u(t, c.current), p();
|
|
9
|
-
},
|
|
10
|
-
push: (...t) => {
|
|
11
|
-
t.length && o.set((e) => e.concat(t));
|
|
12
|
-
},
|
|
13
|
-
updateAt: (t, e) => {
|
|
14
|
-
o.set((r) => {
|
|
15
|
-
const s = r.slice();
|
|
16
|
-
return s[t] = e, s;
|
|
17
|
-
});
|
|
18
|
-
},
|
|
19
|
-
insertAt: (t, e) => {
|
|
20
|
-
o.set((r) => {
|
|
21
|
-
const s = r.slice();
|
|
22
|
-
return t > s.length ? s[t] = e : s.splice(t, 0, e), s;
|
|
23
|
-
});
|
|
24
|
-
},
|
|
25
|
-
update: (t, e) => {
|
|
26
|
-
o.set(
|
|
27
|
-
(r) => r.map((s) => t(s, e) ? e : s)
|
|
28
|
-
);
|
|
29
|
-
},
|
|
30
|
-
updateFirst: (t, e) => {
|
|
31
|
-
const r = c.current.findIndex(
|
|
32
|
-
(s) => t(s, e)
|
|
33
|
-
);
|
|
34
|
-
r >= 0 && o.updateAt(r, e);
|
|
35
|
-
},
|
|
36
|
-
upsert: (t, e) => {
|
|
37
|
-
const r = c.current.findIndex(
|
|
38
|
-
(s) => t(s, e)
|
|
39
|
-
);
|
|
40
|
-
r >= 0 ? o.updateAt(r, e) : o.push(e);
|
|
41
|
-
},
|
|
42
|
-
sort: (t) => {
|
|
43
|
-
o.set((e) => e.slice().sort(t));
|
|
44
|
-
},
|
|
45
|
-
filter: (t, e) => {
|
|
46
|
-
o.set((r) => r.slice().filter(t, e));
|
|
47
|
-
},
|
|
48
|
-
removeAt: (t) => {
|
|
49
|
-
o.set((e) => {
|
|
50
|
-
const r = e.slice();
|
|
51
|
-
return r.splice(t, 1), r;
|
|
52
|
-
});
|
|
53
|
-
},
|
|
54
|
-
clear: () => {
|
|
55
|
-
o.set([]);
|
|
56
|
-
},
|
|
57
|
-
reset: () => {
|
|
58
|
-
o.set(u(a).slice());
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
return n.remove = n.removeAt, n;
|
|
62
|
-
}, []);
|
|
63
|
-
return [c.current, o];
|
|
64
|
-
}
|
|
65
|
-
export {
|
|
66
|
-
m as default
|
|
67
|
-
};
|
package/hooks/useLocalStorage.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { useRef as m, useState as w, useLayoutEffect as z, useCallback as i } from "react";
|
|
2
|
-
import { i as d, n as S } from "../chunk/TXCrI0jN.js";
|
|
3
|
-
const N = (a, o, r) => {
|
|
4
|
-
if (!d)
|
|
5
|
-
return [o, S, S];
|
|
6
|
-
if (!a)
|
|
7
|
-
throw new Error("useLocalStorage key may not be falsy");
|
|
8
|
-
const l = r ? r.raw ? (t) => t : r.deserializer : JSON.parse, f = m((t) => {
|
|
9
|
-
try {
|
|
10
|
-
const e = r ? r.raw ? String : r.serializer : JSON.stringify, s = localStorage.getItem(t);
|
|
11
|
-
return s !== null ? l(s) : (o && localStorage.setItem(t, e(o)), o);
|
|
12
|
-
} catch (e) {
|
|
13
|
-
return console.error(e), o;
|
|
14
|
-
}
|
|
15
|
-
}), [n, c] = w(
|
|
16
|
-
() => f.current(a)
|
|
17
|
-
);
|
|
18
|
-
z(() => c(f.current(a)), [a]);
|
|
19
|
-
const u = i(
|
|
20
|
-
(t) => {
|
|
21
|
-
try {
|
|
22
|
-
const e = typeof t == "function" ? t(n) : t;
|
|
23
|
-
if (typeof e > "u") return;
|
|
24
|
-
let s;
|
|
25
|
-
r ? r.raw ? typeof e == "string" ? s = e : s = JSON.stringify(e) : r.serializer ? s = r.serializer(e) : s = JSON.stringify(e) : s = JSON.stringify(e), localStorage.setItem(a, s), c(l(s));
|
|
26
|
-
} catch (e) {
|
|
27
|
-
console.error(e);
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
[a, c]
|
|
31
|
-
), g = i(() => {
|
|
32
|
-
try {
|
|
33
|
-
localStorage.removeItem(a), c(void 0);
|
|
34
|
-
} catch (t) {
|
|
35
|
-
console.error(t);
|
|
36
|
-
}
|
|
37
|
-
}, [a, c]);
|
|
38
|
-
return [n, u, g];
|
|
39
|
-
};
|
|
40
|
-
export {
|
|
41
|
-
N as default
|
|
42
|
-
};
|
package/hooks/useLocation.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { useState as v, useEffect as y } from "react";
|
|
2
|
-
import { i as w, o as c, a as i } from "../chunk/TXCrI0jN.js";
|
|
3
|
-
const p = (o) => {
|
|
4
|
-
const t = window.history, e = t[o];
|
|
5
|
-
t[o] = function(s) {
|
|
6
|
-
const n = e.apply(this, arguments), a = new Event(o.toLowerCase());
|
|
7
|
-
return a.state = s, window.dispatchEvent(a), n;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
w && (p("pushState"), p("replaceState"));
|
|
11
|
-
const S = () => ({
|
|
12
|
-
trigger: "load",
|
|
13
|
-
length: 1
|
|
14
|
-
}), r = (o) => {
|
|
15
|
-
const { state: t, length: e } = window.history, {
|
|
16
|
-
hash: s,
|
|
17
|
-
host: n,
|
|
18
|
-
hostname: a,
|
|
19
|
-
href: u,
|
|
20
|
-
origin: h,
|
|
21
|
-
pathname: l,
|
|
22
|
-
port: d,
|
|
23
|
-
protocol: f,
|
|
24
|
-
search: g
|
|
25
|
-
} = window.location;
|
|
26
|
-
return {
|
|
27
|
-
trigger: o,
|
|
28
|
-
state: t,
|
|
29
|
-
length: e,
|
|
30
|
-
hash: s,
|
|
31
|
-
host: n,
|
|
32
|
-
hostname: a,
|
|
33
|
-
href: u,
|
|
34
|
-
origin: h,
|
|
35
|
-
pathname: l,
|
|
36
|
-
port: d,
|
|
37
|
-
protocol: f,
|
|
38
|
-
search: g
|
|
39
|
-
};
|
|
40
|
-
}, m = () => {
|
|
41
|
-
const [o, t] = v(r("load"));
|
|
42
|
-
return y(() => {
|
|
43
|
-
const e = () => t(r("popstate")), s = () => t(r("pushstate")), n = () => t(r("replacestate"));
|
|
44
|
-
return c(window, "popstate", e), c(window, "pushstate", s), c(window, "replacestate", n), () => {
|
|
45
|
-
i(window, "popstate", e), i(window, "pushstate", s), i(window, "replacestate", n);
|
|
46
|
-
};
|
|
47
|
-
}, []), o;
|
|
48
|
-
}, E = typeof Event == "function", C = w && E ? m : S;
|
|
49
|
-
export {
|
|
50
|
-
C as default
|
|
51
|
-
};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { useRef as m, useEffect as c } from "react";
|
|
2
|
-
import { o as p, a as g, i as h } from "../chunk/TXCrI0jN.js";
|
|
3
|
-
function u(t) {
|
|
4
|
-
if (t) {
|
|
5
|
-
if (t.tagName === "BODY")
|
|
6
|
-
return t;
|
|
7
|
-
if (t.tagName === "IFRAME") {
|
|
8
|
-
const o = t.contentDocument;
|
|
9
|
-
return o ? o.body : null;
|
|
10
|
-
} else if (!t.offsetParent)
|
|
11
|
-
return null;
|
|
12
|
-
} else return null;
|
|
13
|
-
return u(t.offsetParent);
|
|
14
|
-
}
|
|
15
|
-
function l(t) {
|
|
16
|
-
const o = t || window.event;
|
|
17
|
-
return o.touches.length > 1 ? !0 : (o.preventDefault && o.preventDefault(), !1);
|
|
18
|
-
}
|
|
19
|
-
const a = h && window.navigator && window.navigator.platform && /iP(ad|hone|od)/.test(window.navigator.platform), i = /* @__PURE__ */ new Map(), d = typeof document == "object" ? document : void 0;
|
|
20
|
-
let s = !1;
|
|
21
|
-
const k = d ? function(o = !0, r) {
|
|
22
|
-
const v = m(d.body);
|
|
23
|
-
r = r || v;
|
|
24
|
-
const w = (e) => {
|
|
25
|
-
const n = i.get(e);
|
|
26
|
-
n ? i.set(e, {
|
|
27
|
-
counter: n.counter + 1,
|
|
28
|
-
initialOverflow: n.initialOverflow
|
|
29
|
-
}) : (i.set(e, {
|
|
30
|
-
counter: 1,
|
|
31
|
-
initialOverflow: e.style.overflow
|
|
32
|
-
}), a ? s || (p(document, "touchmove", l, { passive: !1 }), s = !0) : e.style.overflow = "hidden");
|
|
33
|
-
}, f = (e) => {
|
|
34
|
-
const n = i.get(e);
|
|
35
|
-
n && (n.counter === 1 ? (i.delete(e), a ? (e.ontouchmove = null, s && (g(document, "touchmove", l), s = !1)) : e.style.overflow = n.initialOverflow) : i.set(e, {
|
|
36
|
-
counter: n.counter - 1,
|
|
37
|
-
initialOverflow: n.initialOverflow
|
|
38
|
-
}));
|
|
39
|
-
};
|
|
40
|
-
c(() => {
|
|
41
|
-
const e = u(r.current);
|
|
42
|
-
e && (o ? w(e) : f(e));
|
|
43
|
-
}, [o, r.current]), c(() => {
|
|
44
|
-
const e = u(r.current);
|
|
45
|
-
if (e)
|
|
46
|
-
return () => {
|
|
47
|
-
f(e);
|
|
48
|
-
};
|
|
49
|
-
}, []);
|
|
50
|
-
} : function(o = !0, r) {
|
|
51
|
-
};
|
|
52
|
-
export {
|
|
53
|
-
k as default,
|
|
54
|
-
u as getClosestBody
|
|
55
|
-
};
|
package/hooks/useLogger.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import t from "./useEffectOnce.js";
|
|
2
|
-
import u from "./useUpdateEffect.js";
|
|
3
|
-
const r = (o, ...e) => {
|
|
4
|
-
t(() => (console.log(`${o} mounted`, ...e), () => console.log(`${o} unmounted`))), u(() => {
|
|
5
|
-
console.log(`${o} updated`, ...e);
|
|
6
|
-
});
|
|
7
|
-
};
|
|
8
|
-
export {
|
|
9
|
-
r as default
|
|
10
|
-
};
|
package/hooks/useLongPress.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { useRef as a, useCallback as f } from "react";
|
|
2
|
-
import { o as h, a as p } from "../chunk/TXCrI0jN.js";
|
|
3
|
-
const m = (t) => "touches" in t, i = (t) => {
|
|
4
|
-
m(t) && t.touches.length < 2 && t.preventDefault && t.preventDefault();
|
|
5
|
-
}, l = (t, { isPreventDefault: r = !0, delay: s = 300 } = {}) => {
|
|
6
|
-
const e = a(), n = a(), c = f(
|
|
7
|
-
(o) => {
|
|
8
|
-
r && o.target && (h(o.target, "touchend", i, { passive: !1 }), n.current = o.target), e.current = setTimeout(() => t(o), s);
|
|
9
|
-
},
|
|
10
|
-
[t, s, r]
|
|
11
|
-
), u = f(() => {
|
|
12
|
-
e.current && clearTimeout(e.current), r && n.current && p(n.current, "touchend", i);
|
|
13
|
-
}, [r]);
|
|
14
|
-
return {
|
|
15
|
-
onMouseDown: (o) => c(o),
|
|
16
|
-
onTouchStart: (o) => c(o),
|
|
17
|
-
onMouseUp: u,
|
|
18
|
-
onMouseLeave: u,
|
|
19
|
-
onTouchEnd: u
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
export {
|
|
23
|
-
l as default
|
|
24
|
-
};
|
package/hooks/useMap.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { useState as l, useMemo as m, useCallback as p } from "react";
|
|
2
|
-
const f = (r = {}) => {
|
|
3
|
-
const [s, e] = l(r), c = m(
|
|
4
|
-
() => ({
|
|
5
|
-
set: (t, o) => {
|
|
6
|
-
e((u) => ({
|
|
7
|
-
...u,
|
|
8
|
-
[t]: o
|
|
9
|
-
}));
|
|
10
|
-
},
|
|
11
|
-
setAll: (t) => {
|
|
12
|
-
e(t);
|
|
13
|
-
},
|
|
14
|
-
remove: (t) => {
|
|
15
|
-
e((o) => {
|
|
16
|
-
const { [t]: u, ...a } = o;
|
|
17
|
-
return a;
|
|
18
|
-
});
|
|
19
|
-
},
|
|
20
|
-
reset: () => e(r)
|
|
21
|
-
}),
|
|
22
|
-
[e]
|
|
23
|
-
), n = {
|
|
24
|
-
get: p((t) => s[t], [s]),
|
|
25
|
-
...c
|
|
26
|
-
};
|
|
27
|
-
return [s, n];
|
|
28
|
-
};
|
|
29
|
-
export {
|
|
30
|
-
f as default
|
|
31
|
-
};
|
package/hooks/useMeasure.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { useState as r, useMemo as l } from "react";
|
|
2
|
-
import { i as b, n as g } from "../chunk/TXCrI0jN.js";
|
|
3
|
-
import v from "./useIsomorphicLayoutEffect.js";
|
|
4
|
-
const s = {
|
|
5
|
-
x: 0,
|
|
6
|
-
y: 0,
|
|
7
|
-
width: 0,
|
|
8
|
-
height: 0,
|
|
9
|
-
top: 0,
|
|
10
|
-
left: 0,
|
|
11
|
-
bottom: 0,
|
|
12
|
-
right: 0
|
|
13
|
-
};
|
|
14
|
-
function y() {
|
|
15
|
-
const [e, n] = r(null), [i, u] = r(s), t = l(
|
|
16
|
-
() => new window.ResizeObserver((o) => {
|
|
17
|
-
if (o[0]) {
|
|
18
|
-
const { x: c, y: f, width: m, height: a, top: d, left: h, bottom: p, right: w } = o[0].contentRect;
|
|
19
|
-
u({ x: c, y: f, width: m, height: a, top: d, left: h, bottom: p, right: w });
|
|
20
|
-
}
|
|
21
|
-
}),
|
|
22
|
-
[]
|
|
23
|
-
);
|
|
24
|
-
return v(() => {
|
|
25
|
-
if (e)
|
|
26
|
-
return t.observe(e), () => {
|
|
27
|
-
t.disconnect();
|
|
28
|
-
};
|
|
29
|
-
}, [e]), [n, i];
|
|
30
|
-
}
|
|
31
|
-
const z = b && typeof window.ResizeObserver < "u" ? y : () => [g, s];
|
|
32
|
-
export {
|
|
33
|
-
z as default
|
|
34
|
-
};
|
package/hooks/useMeasureDirty.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { useRef as u, useState as c, useEffect as a } from "react";
|
|
2
|
-
const f = (e) => {
|
|
3
|
-
const t = u(0), [s, o] = c({
|
|
4
|
-
width: 0,
|
|
5
|
-
height: 0,
|
|
6
|
-
top: 0,
|
|
7
|
-
left: 0,
|
|
8
|
-
bottom: 0,
|
|
9
|
-
right: 0
|
|
10
|
-
}), [r] = c(
|
|
11
|
-
() => new ResizeObserver((i) => {
|
|
12
|
-
const n = i[0];
|
|
13
|
-
n && (cancelAnimationFrame(t.current), t.current = requestAnimationFrame(() => {
|
|
14
|
-
e.current && o(n.contentRect);
|
|
15
|
-
}));
|
|
16
|
-
})
|
|
17
|
-
);
|
|
18
|
-
return a(() => {
|
|
19
|
-
r.disconnect(), e.current && r.observe(e.current);
|
|
20
|
-
}, [e]), s;
|
|
21
|
-
};
|
|
22
|
-
export {
|
|
23
|
-
f as default
|
|
24
|
-
};
|
package/hooks/useMediaDevices.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { useState as v, useEffect as d } from "react";
|
|
2
|
-
import { b as m, o as u, a as f, n as g } from "../chunk/TXCrI0jN.js";
|
|
3
|
-
const D = () => {
|
|
4
|
-
const [t, s] = v({});
|
|
5
|
-
return d(() => {
|
|
6
|
-
let a = !0;
|
|
7
|
-
const e = () => {
|
|
8
|
-
navigator.mediaDevices.enumerateDevices().then((i) => {
|
|
9
|
-
a && s({
|
|
10
|
-
devices: i.map(({ deviceId: o, groupId: c, kind: n, label: r }) => ({
|
|
11
|
-
deviceId: o,
|
|
12
|
-
groupId: c,
|
|
13
|
-
kind: n,
|
|
14
|
-
label: r
|
|
15
|
-
}))
|
|
16
|
-
});
|
|
17
|
-
}).catch(g);
|
|
18
|
-
};
|
|
19
|
-
return u(navigator.mediaDevices, "devicechange", e), e(), () => {
|
|
20
|
-
a = !1, f(navigator.mediaDevices, "devicechange", e);
|
|
21
|
-
};
|
|
22
|
-
}, []), t;
|
|
23
|
-
}, h = () => ({}), l = m && navigator.mediaDevices ? D : h;
|
|
24
|
-
export {
|
|
25
|
-
l as default
|
|
26
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { useRef as c, useState as o, useCallback as d } from "react";
|
|
2
|
-
function f(a, n) {
|
|
3
|
-
const t = c(a), [e, r] = o(n), u = d(
|
|
4
|
-
(s) => {
|
|
5
|
-
t.current.length === 2 ? t.current(s, r) : r(t.current(s));
|
|
6
|
-
},
|
|
7
|
-
[e]
|
|
8
|
-
);
|
|
9
|
-
return [e, u];
|
|
10
|
-
}
|
|
11
|
-
export {
|
|
12
|
-
f as default,
|
|
13
|
-
f as useMediatedState
|
|
14
|
-
};
|
package/hooks/useMethods.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { useMemo as n, useReducer as m } from "react";
|
|
2
|
-
const T = (r, s) => {
|
|
3
|
-
const p = n(
|
|
4
|
-
() => (u, e) => r(u)[e.type](...e.payload),
|
|
5
|
-
[r]
|
|
6
|
-
), [t, c] = m(
|
|
7
|
-
p,
|
|
8
|
-
s
|
|
9
|
-
), d = n(() => Object.keys(r(s)).reduce((e, o) => (e[o] = (...y) => c({ type: o, payload: y }), e), {}), [r, s]);
|
|
10
|
-
return [t, d];
|
|
11
|
-
};
|
|
12
|
-
export {
|
|
13
|
-
T as default
|
|
14
|
-
};
|
package/hooks/useMotion.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { useState as u, useEffect as s } from "react";
|
|
2
|
-
import { o as m, a as d } from "../chunk/TXCrI0jN.js";
|
|
3
|
-
const y = {
|
|
4
|
-
acceleration: {
|
|
5
|
-
x: null,
|
|
6
|
-
y: null,
|
|
7
|
-
z: null
|
|
8
|
-
},
|
|
9
|
-
accelerationIncludingGravity: {
|
|
10
|
-
x: null,
|
|
11
|
-
y: null,
|
|
12
|
-
z: null
|
|
13
|
-
},
|
|
14
|
-
rotationRate: {
|
|
15
|
-
alpha: null,
|
|
16
|
-
beta: null,
|
|
17
|
-
gamma: null
|
|
18
|
-
},
|
|
19
|
-
interval: 16
|
|
20
|
-
}, x = (l = y) => {
|
|
21
|
-
const [o, i] = u(l);
|
|
22
|
-
return s(() => {
|
|
23
|
-
const e = (r) => {
|
|
24
|
-
const {
|
|
25
|
-
acceleration: a,
|
|
26
|
-
accelerationIncludingGravity: t,
|
|
27
|
-
rotationRate: n,
|
|
28
|
-
interval: c
|
|
29
|
-
} = r;
|
|
30
|
-
i({
|
|
31
|
-
acceleration: {
|
|
32
|
-
x: a.x,
|
|
33
|
-
y: a.y,
|
|
34
|
-
z: a.z
|
|
35
|
-
},
|
|
36
|
-
accelerationIncludingGravity: {
|
|
37
|
-
x: t.x,
|
|
38
|
-
y: t.y,
|
|
39
|
-
z: t.z
|
|
40
|
-
},
|
|
41
|
-
rotationRate: {
|
|
42
|
-
alpha: n.alpha,
|
|
43
|
-
beta: n.beta,
|
|
44
|
-
gamma: n.gamma
|
|
45
|
-
},
|
|
46
|
-
interval: c
|
|
47
|
-
});
|
|
48
|
-
};
|
|
49
|
-
return m(window, "devicemotion", e), () => {
|
|
50
|
-
d(window, "devicemotion", e);
|
|
51
|
-
};
|
|
52
|
-
}, []), o;
|
|
53
|
-
};
|
|
54
|
-
export {
|
|
55
|
-
x as default
|
|
56
|
-
};
|
package/hooks/useMount.js
DELETED
package/hooks/useMountedState.js
DELETED
package/hooks/useMouse.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { useEffect as m } from "react";
|
|
2
|
-
import { o as i, a as g } from "../chunk/TXCrI0jN.js";
|
|
3
|
-
import X from "./useRafState.js";
|
|
4
|
-
const E = (e) => {
|
|
5
|
-
process.env.NODE_ENV === "development" && (typeof e != "object" || typeof e.current > "u") && console.error("useMouse expects a single ref argument.");
|
|
6
|
-
const [c, p] = X({
|
|
7
|
-
docX: 0,
|
|
8
|
-
docY: 0,
|
|
9
|
-
posX: 0,
|
|
10
|
-
posY: 0,
|
|
11
|
-
elX: 0,
|
|
12
|
-
elY: 0,
|
|
13
|
-
elH: 0,
|
|
14
|
-
elW: 0
|
|
15
|
-
});
|
|
16
|
-
return m(() => {
|
|
17
|
-
const t = (o) => {
|
|
18
|
-
if (e && e.current) {
|
|
19
|
-
const {
|
|
20
|
-
left: r,
|
|
21
|
-
top: u,
|
|
22
|
-
width: a,
|
|
23
|
-
height: f
|
|
24
|
-
} = e.current.getBoundingClientRect(), s = r + window.pageXOffset, n = u + window.pageYOffset, d = o.pageX - s, l = o.pageY - n;
|
|
25
|
-
p({
|
|
26
|
-
docX: o.pageX,
|
|
27
|
-
docY: o.pageY,
|
|
28
|
-
posX: s,
|
|
29
|
-
posY: n,
|
|
30
|
-
elX: d,
|
|
31
|
-
elY: l,
|
|
32
|
-
elH: f,
|
|
33
|
-
elW: a
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
return i(document, "mousemove", t), () => {
|
|
38
|
-
g(document, "mousemove", t);
|
|
39
|
-
};
|
|
40
|
-
}, [e]), c;
|
|
41
|
-
};
|
|
42
|
-
export {
|
|
43
|
-
E as default
|
|
44
|
-
};
|
package/hooks/useMouseHovered.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import u from "./useHoverDirty.js";
|
|
2
|
-
import l from "./useMouse.js";
|
|
3
|
-
const a = { current: null }, d = (o, t = {}) => {
|
|
4
|
-
const n = !!t.whenHovered, r = !!t.bound, s = u(o, n), e = l(n && !s ? a : o);
|
|
5
|
-
return r && (e.elX = Math.max(0, Math.min(e.elX, e.elW)), e.elY = Math.max(0, Math.min(e.elY, e.elH))), e;
|
|
6
|
-
};
|
|
7
|
-
export {
|
|
8
|
-
d as default
|
|
9
|
-
};
|
package/hooks/useMouseWheel.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { useState as s, useEffect as r } from "react";
|
|
2
|
-
import { o as u, a } from "../chunk/TXCrI0jN.js";
|
|
3
|
-
const c = () => {
|
|
4
|
-
const [e, t] = s(0);
|
|
5
|
-
return r(() => {
|
|
6
|
-
const o = (l) => {
|
|
7
|
-
t(l.deltaY + e);
|
|
8
|
-
};
|
|
9
|
-
return u(window, "wheel", o, !1), () => a(window, "wheel", o);
|
|
10
|
-
}), e;
|
|
11
|
-
};
|
|
12
|
-
export {
|
|
13
|
-
c as default
|
|
14
|
-
};
|