@unicom-cloud/ui 0.8.55 → 0.8.57
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/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/{BC0PujUD.js → BMvZCjSU.js} +118 -120
- 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/CR4u270n.js +284 -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/CkAOsst1.js +73 -0
- package/chunk/{CTSIr-Pr.js → CwXmtKib.js} +89 -101
- package/chunk/{C3I_L73_.js → CwjaGytU.js} +39 -40
- package/chunk/{RRWbBHK-.js → D5p8q9Pa.js} +221 -221
- package/chunk/{DTgc2wl4.js → D6RTBH4C.js} +36 -36
- package/chunk/D6mVoX-C.js +116 -0
- package/chunk/D9TqtOhq.js +40 -0
- package/chunk/{CZ8iz63Z.js → DBJ8d0o0.js} +210 -217
- package/chunk/{RL1SNlng.js → DDda6s72.js} +16 -16
- package/chunk/{BH5fVprw.js → DJmWXheU.js} +9 -9
- package/chunk/{Niaq_og8.js → DMWMrXg1.js} +220 -226
- package/chunk/DPvnQJ-H.js +52 -0
- package/chunk/DQXq1QT0.js +58 -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/Dbk4DVhB.js +855 -0
- 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/{DbtCtriE.js → DxNRWF67.js} +30 -31
- package/chunk/HlP8inLK.js +1796 -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/{Dki1RB5p.js → aM2ePYrq.js} +154 -155
- 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/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/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/chunk/BdYAMaw9.js +0 -6
- 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/useStateList.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { useRef as c, useMemo as f } from "react";
|
|
2
|
-
import s from "./useForceUpdate.js";
|
|
3
|
-
import l from "./useMountedState.js";
|
|
4
|
-
import d from "./useUpdateEffect.js";
|
|
5
|
-
function a(r = []) {
|
|
6
|
-
const u = l(), n = s(), t = c(0);
|
|
7
|
-
d(() => {
|
|
8
|
-
r.length <= t.current && (t.current = r.length - 1, n());
|
|
9
|
-
}, [r.length]);
|
|
10
|
-
const o = f(
|
|
11
|
-
() => ({
|
|
12
|
-
next: () => o.setStateAt(t.current + 1),
|
|
13
|
-
prev: () => o.setStateAt(t.current - 1),
|
|
14
|
-
setStateAt: (e) => {
|
|
15
|
-
u() && r.length && e !== t.current && (t.current = e >= 0 ? e % r.length : r.length + e % r.length, n());
|
|
16
|
-
},
|
|
17
|
-
setState: (e) => {
|
|
18
|
-
if (!u()) return;
|
|
19
|
-
const i = r.length ? r.indexOf(e) : -1;
|
|
20
|
-
if (i === -1)
|
|
21
|
-
throw new Error(
|
|
22
|
-
`State '${e}' is not a valid state (does not exist in state list)`
|
|
23
|
-
);
|
|
24
|
-
t.current = i, n();
|
|
25
|
-
}
|
|
26
|
-
}),
|
|
27
|
-
[r]
|
|
28
|
-
);
|
|
29
|
-
return {
|
|
30
|
-
state: r[t.current],
|
|
31
|
-
currentIndex: t.current,
|
|
32
|
-
...o
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
export {
|
|
36
|
-
a as default
|
|
37
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { useRef as a, useState as o, useCallback as l, useEffect as f } from "react";
|
|
2
|
-
function v(t, u, s = [void 0]) {
|
|
3
|
-
const e = a(u), r = a(t);
|
|
4
|
-
e.current = u, r.current = t;
|
|
5
|
-
const [i, n] = o(s), c = l(() => {
|
|
6
|
-
e.current.length >= 2 ? e.current(
|
|
7
|
-
r.current,
|
|
8
|
-
n
|
|
9
|
-
) : n(e.current(r.current));
|
|
10
|
-
}, [n]);
|
|
11
|
-
return f(() => {
|
|
12
|
-
c();
|
|
13
|
-
}, [t]), [i, c];
|
|
14
|
-
}
|
|
15
|
-
export {
|
|
16
|
-
v as default
|
|
17
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { useState as m, useRef as h, useCallback as M, useMemo as b } from "react";
|
|
2
|
-
import { r as k } from "../chunk/BdYAMaw9.js";
|
|
3
|
-
import d from "./useFirstMountState.js";
|
|
4
|
-
function H(u, n = 10, f) {
|
|
5
|
-
if (n < 1)
|
|
6
|
-
throw new Error(`Capacity has to be greater than 1, got '${n}'`);
|
|
7
|
-
const l = d(), [s, c] = m(u), r = h(f ?? []), t = h(0);
|
|
8
|
-
l && (r.current.length ? (r.current[r.current.length - 1] !== u && r.current.push(u), r.current.length > n && (r.current = r.current.slice(
|
|
9
|
-
r.current.length - n
|
|
10
|
-
))) : r.current.push(u), t.current = r.current.length && r.current.length - 1);
|
|
11
|
-
const g = M(
|
|
12
|
-
(e) => {
|
|
13
|
-
c((o) => (e = k(e, o), e !== o && (t.current < r.current.length - 1 && (r.current = r.current.slice(
|
|
14
|
-
0,
|
|
15
|
-
t.current + 1
|
|
16
|
-
)), t.current = r.current.push(e) - 1, r.current.length > n && (r.current = r.current.slice(
|
|
17
|
-
r.current.length - n
|
|
18
|
-
))), e));
|
|
19
|
-
},
|
|
20
|
-
[s, n]
|
|
21
|
-
), i = b(
|
|
22
|
-
() => ({
|
|
23
|
-
history: r.current,
|
|
24
|
-
position: t.current,
|
|
25
|
-
capacity: n,
|
|
26
|
-
back: (e = 1) => {
|
|
27
|
-
t.current && c(() => (t.current -= Math.min(e, t.current), r.current[t.current]));
|
|
28
|
-
},
|
|
29
|
-
forward: (e = 1) => {
|
|
30
|
-
t.current !== r.current.length - 1 && c(() => (t.current = Math.min(
|
|
31
|
-
t.current + e,
|
|
32
|
-
r.current.length - 1
|
|
33
|
-
), r.current[t.current]));
|
|
34
|
-
},
|
|
35
|
-
go: (e) => {
|
|
36
|
-
e !== t.current && c(() => (t.current = e < 0 ? Math.max(r.current.length + e, 0) : Math.min(r.current.length - 1, e), r.current[t.current]));
|
|
37
|
-
}
|
|
38
|
-
}),
|
|
39
|
-
[s]
|
|
40
|
-
);
|
|
41
|
-
return [s, g, i];
|
|
42
|
-
}
|
|
43
|
-
export {
|
|
44
|
-
H as default,
|
|
45
|
-
H as useStateWithHistory
|
|
46
|
-
};
|
package/hooks/useSyncState.js
DELETED
package/hooks/useThrottle.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { useState as a, useRef as u, useEffect as f } from "react";
|
|
2
|
-
import l from "./useUnmount.js";
|
|
3
|
-
const p = (e, n = 200) => {
|
|
4
|
-
const [i, c] = a(e), t = u(), o = u(null), r = u(0);
|
|
5
|
-
return f(() => {
|
|
6
|
-
if (t.current)
|
|
7
|
-
o.current = e, r.current = !0;
|
|
8
|
-
else {
|
|
9
|
-
c(e);
|
|
10
|
-
const s = () => {
|
|
11
|
-
r.current ? (r.current = !1, c(o.current), t.current = setTimeout(s, n)) : t.current = void 0;
|
|
12
|
-
};
|
|
13
|
-
t.current = setTimeout(s, n);
|
|
14
|
-
}
|
|
15
|
-
}, [e]), l(() => {
|
|
16
|
-
t.current && clearTimeout(t.current);
|
|
17
|
-
}), i;
|
|
18
|
-
};
|
|
19
|
-
export {
|
|
20
|
-
p as default
|
|
21
|
-
};
|
package/hooks/useThrottleFn.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { useState as l, useRef as s, useEffect as m } from "react";
|
|
2
|
-
import f from "./useUnmount.js";
|
|
3
|
-
const d = (u, n = 200, r) => {
|
|
4
|
-
const [i, o] = l(null), t = s(), e = s();
|
|
5
|
-
return m(() => {
|
|
6
|
-
if (t.current)
|
|
7
|
-
e.current = r;
|
|
8
|
-
else {
|
|
9
|
-
o(u(...r));
|
|
10
|
-
const c = () => {
|
|
11
|
-
e.current ? (o(u(...e.current)), e.current = void 0, t.current = setTimeout(c, n)) : t.current = void 0;
|
|
12
|
-
};
|
|
13
|
-
t.current = setTimeout(c, n);
|
|
14
|
-
}
|
|
15
|
-
}, r), f(() => {
|
|
16
|
-
t.current && clearTimeout(t.current);
|
|
17
|
-
}), i;
|
|
18
|
-
};
|
|
19
|
-
export {
|
|
20
|
-
d as default
|
|
21
|
-
};
|
package/hooks/useTimeout.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { useEffect as u } from "react";
|
|
2
|
-
import s from "./useLatest.js";
|
|
3
|
-
const i = (e, t) => {
|
|
4
|
-
const r = s(e);
|
|
5
|
-
u(() => {
|
|
6
|
-
if (!t || t < 0) return;
|
|
7
|
-
const o = setTimeout(() => {
|
|
8
|
-
r.current();
|
|
9
|
-
}, t);
|
|
10
|
-
return () => {
|
|
11
|
-
clearTimeout(o);
|
|
12
|
-
};
|
|
13
|
-
}, [t]);
|
|
14
|
-
};
|
|
15
|
-
export {
|
|
16
|
-
i as default
|
|
17
|
-
};
|
package/hooks/useTimeoutFn.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { useRef as c, useCallback as n, useEffect as l } from "react";
|
|
2
|
-
function m(t, u = 0) {
|
|
3
|
-
const r = c(!1), e = c(), o = c(t), i = n(() => r.current, []), s = n(() => {
|
|
4
|
-
r.current = !1, e.current && clearTimeout(e.current), e.current = setTimeout(() => {
|
|
5
|
-
r.current = !0, o.current();
|
|
6
|
-
}, u);
|
|
7
|
-
}, [u]), a = n(() => {
|
|
8
|
-
r.current = null, e.current && clearTimeout(e.current);
|
|
9
|
-
}, []);
|
|
10
|
-
return l(() => {
|
|
11
|
-
o.current = t;
|
|
12
|
-
}, [t]), l(() => (s(), a), [u]), [i, a, s];
|
|
13
|
-
}
|
|
14
|
-
export {
|
|
15
|
-
m as default
|
|
16
|
-
};
|
package/hooks/useTitle.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { useRef as u, useEffect as o } from "react";
|
|
2
|
-
const r = {
|
|
3
|
-
restoreOnUnmount: !1
|
|
4
|
-
};
|
|
5
|
-
function f(e, t = r) {
|
|
6
|
-
const n = u(document.title);
|
|
7
|
-
document.title !== e && (document.title = e), o(() => {
|
|
8
|
-
if (t && t.restoreOnUnmount)
|
|
9
|
-
return () => {
|
|
10
|
-
document.title = n.current;
|
|
11
|
-
};
|
|
12
|
-
}, []);
|
|
13
|
-
}
|
|
14
|
-
const i = typeof document < "u" ? f : (e) => {
|
|
15
|
-
};
|
|
16
|
-
export {
|
|
17
|
-
i as default
|
|
18
|
-
};
|
package/hooks/useToggle.js
DELETED
package/hooks/useTween.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import n from "@unicom-cloud/utils/tween/easing";
|
|
2
|
-
import i from "./useRaf.js";
|
|
3
|
-
const f = (o = "linear", t = 200, r = 0) => {
|
|
4
|
-
const e = n[o], s = i(t, r);
|
|
5
|
-
return process.env.NODE_ENV !== "production" && typeof e != "function" ? (console.error(
|
|
6
|
-
'useTween() expected "easingName" property to be a valid easing function name, like:"' + Object.keys(n).join('", "') + '".'
|
|
7
|
-
), console.trace(), 0) : e(s);
|
|
8
|
-
};
|
|
9
|
-
export {
|
|
10
|
-
f as default
|
|
11
|
-
};
|
package/hooks/useUnmount.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { useRef as u, useMemo as c } from "react";
|
|
2
|
-
import m from "./useEffectOnce.js";
|
|
3
|
-
const w = () => {
|
|
4
|
-
const r = u(!1);
|
|
5
|
-
return m(() => () => {
|
|
6
|
-
r.current = !0;
|
|
7
|
-
}), c(() => (t, n) => new Promise((s, o) => {
|
|
8
|
-
t.then(
|
|
9
|
-
(e) => {
|
|
10
|
-
r.current || s(e);
|
|
11
|
-
},
|
|
12
|
-
(e) => {
|
|
13
|
-
r.current ? n ? n(e) : console.error("useUnmountPromise", e) : o(e);
|
|
14
|
-
}
|
|
15
|
-
);
|
|
16
|
-
}), []);
|
|
17
|
-
};
|
|
18
|
-
export {
|
|
19
|
-
w as default
|
|
20
|
-
};
|
package/hooks/useUpdate.js
DELETED
package/hooks/useUpsert.js
DELETED
package/hooks/useVibrate.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { useEffect as s } from "react";
|
|
2
|
-
import { n as v, b as f } from "../chunk/TXCrI0jN.js";
|
|
3
|
-
const u = f && "vibrate" in navigator;
|
|
4
|
-
function c(r = !0, i = [1e3, 1e3], t = !0) {
|
|
5
|
-
s(() => {
|
|
6
|
-
let a;
|
|
7
|
-
if (r && (navigator.vibrate(i), t)) {
|
|
8
|
-
const e = i instanceof Array ? i.reduce((o, n) => o + n) : i;
|
|
9
|
-
a = setInterval(() => {
|
|
10
|
-
navigator.vibrate(i);
|
|
11
|
-
}, e);
|
|
12
|
-
}
|
|
13
|
-
return () => {
|
|
14
|
-
r && (navigator.vibrate(0), t && clearInterval(a));
|
|
15
|
-
};
|
|
16
|
-
}, [r]);
|
|
17
|
-
}
|
|
18
|
-
const m = u ? c : v;
|
|
19
|
-
export {
|
|
20
|
-
m as default
|
|
21
|
-
};
|
package/hooks/useVideo.js
DELETED
package/hooks/useWindowScroll.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { useEffect as n } from "react";
|
|
2
|
-
import { i as r, o as i, a as w } from "../chunk/TXCrI0jN.js";
|
|
3
|
-
import p from "./useRafState.js";
|
|
4
|
-
const d = () => {
|
|
5
|
-
const [f, a] = p(() => ({
|
|
6
|
-
x: r ? window.pageXOffset : 0,
|
|
7
|
-
y: r ? window.pageYOffset : 0
|
|
8
|
-
}));
|
|
9
|
-
return n(() => {
|
|
10
|
-
const e = () => {
|
|
11
|
-
a((o) => {
|
|
12
|
-
const { pageXOffset: s, pageYOffset: t } = window;
|
|
13
|
-
return o.x !== s || o.y !== t ? {
|
|
14
|
-
x: s,
|
|
15
|
-
y: t
|
|
16
|
-
} : o;
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
return e(), i(window, "scroll", e, {
|
|
20
|
-
capture: !1,
|
|
21
|
-
passive: !0
|
|
22
|
-
}), () => {
|
|
23
|
-
w(window, "scroll", e);
|
|
24
|
-
};
|
|
25
|
-
}, []), f;
|
|
26
|
-
};
|
|
27
|
-
export {
|
|
28
|
-
d as default
|
|
29
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { IHookStateInitAction, IHookStateSetAction } from '../misc/hookState';
|
|
2
|
-
export declare function createGlobalState<S = any>(initialState: IHookStateInitAction<S>): () => [S, (state: IHookStateSetAction<S>) => void];
|
|
3
|
-
export declare function createGlobalState<S = undefined>(): () => [
|
|
4
|
-
S,
|
|
5
|
-
(state: IHookStateSetAction<S>) => void
|
|
6
|
-
];
|
|
7
|
-
export default createGlobalState;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export interface HTMLMediaProps extends React.AudioHTMLAttributes<any>, React.VideoHTMLAttributes<any> {
|
|
3
|
-
src: string;
|
|
4
|
-
}
|
|
5
|
-
export interface HTMLMediaState {
|
|
6
|
-
buffered: any[];
|
|
7
|
-
duration: number;
|
|
8
|
-
paused: boolean;
|
|
9
|
-
muted: boolean;
|
|
10
|
-
time: number;
|
|
11
|
-
volume: number;
|
|
12
|
-
playing: boolean;
|
|
13
|
-
}
|
|
14
|
-
export interface HTMLMediaControls {
|
|
15
|
-
play: () => Promise<void> | void;
|
|
16
|
-
pause: () => void;
|
|
17
|
-
mute: () => void;
|
|
18
|
-
unmute: () => void;
|
|
19
|
-
volume: (volume: number) => void;
|
|
20
|
-
seek: (time: number) => void;
|
|
21
|
-
}
|
|
22
|
-
type MediaPropsWithRef<T> = HTMLMediaProps & {
|
|
23
|
-
ref?: React.MutableRefObject<T | null>;
|
|
24
|
-
};
|
|
25
|
-
export default function createHTMLMediaHook<T extends HTMLAudioElement | HTMLVideoElement>(tag: 'audio' | 'video'): (elOrProps: HTMLMediaProps | React.ReactElement<HTMLMediaProps>) => readonly [React.ReactElement<MediaPropsWithRef<T>, string | React.JSXElementConstructor<any>>, HTMLMediaState, {
|
|
26
|
-
play: () => Promise<void> | undefined;
|
|
27
|
-
pause: () => void;
|
|
28
|
-
seek: (time: number) => void;
|
|
29
|
-
volume: (volume: number) => void;
|
|
30
|
-
mute: () => void;
|
|
31
|
-
unmute: () => void;
|
|
32
|
-
}, React.MutableRefObject<T | null>];
|
|
33
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
type Dispatch<Action> = (action: Action) => void;
|
|
2
|
-
interface Store<Action, State> {
|
|
3
|
-
getState: () => State;
|
|
4
|
-
dispatch: Dispatch<Action>;
|
|
5
|
-
}
|
|
6
|
-
type Middleware<Action, State> = (store: Store<Action, State>) => (next: Dispatch<Action>) => (action: Action) => void;
|
|
7
|
-
declare const createReducer: <Action, State>(...middlewares: Middleware<Action, State>[]) => (reducer: (state: State, action: Action) => State, initialState: State, initializer?: (value: State) => State) => [State, Dispatch<Action>];
|
|
8
|
-
export default createReducer;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
declare const createReducerContext: <R extends React.Reducer<any, any>>(reducer: R, defaultInitialState: React.ReducerState<R>) => readonly [() => [import("react").ReducerState<R>, import("react").Dispatch<import("react").ReducerAction<R>>], ({ children, initialState, }: {
|
|
2
|
-
children?: React.ReactNode;
|
|
3
|
-
initialState?: React.ReducerState<R>;
|
|
4
|
-
}) => import("react").FunctionComponentElement<import("react").ProviderProps<[import("react").ReducerState<R>, import("react").Dispatch<import("react").ReducerAction<R>>] | undefined>>, import("react").Context<[import("react").ReducerState<R>, import("react").Dispatch<import("react").ReducerAction<R>>] | undefined>];
|
|
5
|
-
export default createReducerContext;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function createRenderProp(hook: any, mapPropsToArgs?: (props: any) => any[]): (props: any) => any;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
declare const createStateContext: <T>(defaultInitialValue: T) => readonly [() => [T, import("react").Dispatch<import("react").SetStateAction<T>>], ({ children, initialValue, }: {
|
|
2
|
-
children?: React.ReactNode;
|
|
3
|
-
initialValue?: T;
|
|
4
|
-
}) => import("react").FunctionComponentElement<import("react").ProviderProps<[T, import("react").Dispatch<import("react").SetStateAction<T>>] | undefined>>, import("react").Context<[T, import("react").Dispatch<import("react").SetStateAction<T>>] | undefined>];
|
|
5
|
-
export default createStateContext;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export type IHookStateInitialSetter<S> = () => S;
|
|
2
|
-
export type IHookStateInitAction<S> = S | IHookStateInitialSetter<S>;
|
|
3
|
-
export type IHookStateSetter<S> = ((prevState: S) => S) | (() => S);
|
|
4
|
-
export type IHookStateSetAction<S> = S | IHookStateSetter<S>;
|
|
5
|
-
export type IHookStateResolvable<S> = S | IHookStateInitialSetter<S> | IHookStateSetter<S>;
|
|
6
|
-
export declare function resolveHookState<S>(nextState: IHookStateInitAction<S>): S;
|
|
7
|
-
export declare function resolveHookState<S, C extends S>(nextState: IHookStateSetAction<S>, currentState?: C): S;
|
|
8
|
-
export declare function resolveHookState<S, C extends S>(nextState: IHookStateResolvable<S>, currentState?: C): S;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const noop: () => void;
|
|
2
|
-
export declare function on<T extends Window | Document | HTMLElement | EventTarget>(obj: T | null, ...args: Parameters<T['addEventListener']> | [string, Function | null, ...any]): void;
|
|
3
|
-
export declare function off<T extends Window | Document | HTMLElement | EventTarget>(obj: T | null, ...args: Parameters<T['removeEventListener']> | [string, Function | null, ...any]): void;
|
|
4
|
-
export declare const isBrowser: boolean;
|
|
5
|
-
export declare const isNavigator: boolean;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { DependencyList } from 'react';
|
|
2
|
-
import { FunctionReturningPromise } from './misc/types';
|
|
3
|
-
export type { AsyncFnReturn, AsyncState } from './useAsyncFn';
|
|
4
|
-
export default function useAsync<T extends FunctionReturningPromise>(fn: T, deps?: DependencyList): {
|
|
5
|
-
loading: boolean;
|
|
6
|
-
error?: undefined;
|
|
7
|
-
value?: undefined;
|
|
8
|
-
} | {
|
|
9
|
-
loading: false;
|
|
10
|
-
error: Error;
|
|
11
|
-
value?: undefined;
|
|
12
|
-
} | {
|
|
13
|
-
loading: true;
|
|
14
|
-
error?: Error | undefined;
|
|
15
|
-
value?: import("./misc/types").PromiseType<ReturnType<T>> | undefined;
|
|
16
|
-
} | {
|
|
17
|
-
loading: false;
|
|
18
|
-
error?: undefined;
|
|
19
|
-
value: import("./misc/types").PromiseType<ReturnType<T>>;
|
|
20
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { DependencyList } from 'react';
|
|
2
|
-
import { FunctionReturningPromise, PromiseType } from './misc/types';
|
|
3
|
-
export type AsyncState<T> = {
|
|
4
|
-
loading: boolean;
|
|
5
|
-
error?: undefined;
|
|
6
|
-
value?: undefined;
|
|
7
|
-
} | {
|
|
8
|
-
loading: true;
|
|
9
|
-
error?: Error | undefined;
|
|
10
|
-
value?: T;
|
|
11
|
-
} | {
|
|
12
|
-
loading: false;
|
|
13
|
-
error: Error;
|
|
14
|
-
value?: undefined;
|
|
15
|
-
} | {
|
|
16
|
-
loading: false;
|
|
17
|
-
error?: undefined;
|
|
18
|
-
value: T;
|
|
19
|
-
};
|
|
20
|
-
type StateFromFunctionReturningPromise<T extends FunctionReturningPromise> = AsyncState<PromiseType<ReturnType<T>>>;
|
|
21
|
-
export type AsyncFnReturn<T extends FunctionReturningPromise = FunctionReturningPromise> = [StateFromFunctionReturningPromise<T>, T];
|
|
22
|
-
export default function useAsyncFn<T extends FunctionReturningPromise>(fn: T, deps?: DependencyList, initialState?: StateFromFunctionReturningPromise<T>): AsyncFnReturn<T>;
|
|
23
|
-
export {};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { DependencyList } from 'react';
|
|
2
|
-
import { AsyncState } from './useAsync';
|
|
3
|
-
export type AsyncStateRetry<T> = AsyncState<T> & {
|
|
4
|
-
retry(): void;
|
|
5
|
-
};
|
|
6
|
-
declare const useAsyncRetry: <T>(fn: () => Promise<T>, deps?: DependencyList) => {
|
|
7
|
-
retry: () => void;
|
|
8
|
-
loading: boolean;
|
|
9
|
-
error?: undefined;
|
|
10
|
-
value?: undefined;
|
|
11
|
-
} | {
|
|
12
|
-
retry: () => void;
|
|
13
|
-
loading: false;
|
|
14
|
-
error: Error;
|
|
15
|
-
value?: undefined;
|
|
16
|
-
} | {
|
|
17
|
-
retry: () => void;
|
|
18
|
-
loading: true;
|
|
19
|
-
error?: Error | undefined;
|
|
20
|
-
value?: T | undefined;
|
|
21
|
-
} | {
|
|
22
|
-
retry: () => void;
|
|
23
|
-
loading: false;
|
|
24
|
-
error?: undefined;
|
|
25
|
-
value: T;
|
|
26
|
-
};
|
|
27
|
-
export default useAsyncRetry;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
declare const useAudio: (elOrProps: import("./factory/createHTMLMediaHook").HTMLMediaProps | import("react").ReactElement<import("./factory/createHTMLMediaHook").HTMLMediaProps>) => readonly [import("react").ReactElement<import("./factory/createHTMLMediaHook").HTMLMediaProps & {
|
|
2
|
-
ref?: import("react").MutableRefObject<HTMLAudioElement | null> | undefined;
|
|
3
|
-
}, string | import("react").JSXElementConstructor<any>>, import("./factory/createHTMLMediaHook").HTMLMediaState, {
|
|
4
|
-
play: () => Promise<void> | undefined;
|
|
5
|
-
pause: () => void;
|
|
6
|
-
seek: (time: number) => void;
|
|
7
|
-
volume: (volume: number) => void;
|
|
8
|
-
mute: () => void;
|
|
9
|
-
unmute: () => void;
|
|
10
|
-
}, import("react").MutableRefObject<HTMLAudioElement | null>];
|
|
11
|
-
export default useAudio;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { IHookStateInitAction, IHookStateSetAction } from './misc/hookState';
|
|
2
|
-
export interface CounterActions {
|
|
3
|
-
inc: (delta?: number) => void;
|
|
4
|
-
dec: (delta?: number) => void;
|
|
5
|
-
get: () => number;
|
|
6
|
-
set: (value: IHookStateSetAction<number>) => void;
|
|
7
|
-
reset: (value?: IHookStateSetAction<number>) => void;
|
|
8
|
-
}
|
|
9
|
-
export default function useCounter(initialValue?: IHookStateInitAction<number>, max?: number | null, min?: number | null): [number, CounterActions];
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { DependencyList, EffectCallback } from 'react';
|
|
2
|
-
type DepsEqualFnType<TDeps extends DependencyList> = (prevDeps: TDeps, nextDeps: TDeps) => boolean;
|
|
3
|
-
declare const useCustomCompareEffect: <TDeps extends DependencyList>(effect: EffectCallback, deps: TDeps, depsEqual: DepsEqualFnType<TDeps>) => void;
|
|
4
|
-
export default useCustomCompareEffect;
|
package/types/hooks/useDrop.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export interface DropAreaState {
|
|
2
|
-
over: boolean;
|
|
3
|
-
}
|
|
4
|
-
export interface DropAreaBond {
|
|
5
|
-
onDragOver: React.DragEventHandler;
|
|
6
|
-
onDragEnter: React.DragEventHandler;
|
|
7
|
-
onDragLeave: React.DragEventHandler;
|
|
8
|
-
onDrop: React.DragEventHandler;
|
|
9
|
-
onPaste: React.ClipboardEventHandler;
|
|
10
|
-
}
|
|
11
|
-
export interface DropAreaOptions {
|
|
12
|
-
onFiles?: (files: File[], event?: any) => void;
|
|
13
|
-
onText?: (text: string, event?: any) => void;
|
|
14
|
-
onUri?: (url: string, event?: any) => void;
|
|
15
|
-
}
|
|
16
|
-
declare const useDrop: (options?: DropAreaOptions, args?: never[]) => DropAreaState;
|
|
17
|
-
export default useDrop;
|