@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
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { useRef as u, useState as l, useCallback as f, useEffect as s } from "react";
|
|
2
|
-
function b(e, o, a = [void 0]) {
|
|
3
|
-
if (typeof e != "object")
|
|
4
|
-
throw new Error(
|
|
5
|
-
"states expected to be an object or array, got " + typeof e
|
|
6
|
-
);
|
|
7
|
-
const t = u(o), r = u(e);
|
|
8
|
-
t.current = o, r.current = e;
|
|
9
|
-
const [i, n] = l(a), c = f(() => {
|
|
10
|
-
t.current.length >= 2 ? t.current(r.current, n) : n(t.current(r.current));
|
|
11
|
-
}, [n]);
|
|
12
|
-
return s(() => {
|
|
13
|
-
c();
|
|
14
|
-
}, Object.values(e)), [i, c];
|
|
15
|
-
}
|
|
16
|
-
export {
|
|
17
|
-
b as default,
|
|
18
|
-
b as useMultiStateValidator
|
|
19
|
-
};
|
package/hooks/useNetworkState.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { useState as l, useEffect as r } from "react";
|
|
2
|
-
import { o as f, a as s, b as d } from "../chunk/TXCrI0jN.js";
|
|
3
|
-
const t = d ? navigator : void 0, e = t && (t.connection || t.mozConnection || t.webkitConnection);
|
|
4
|
-
function w(n) {
|
|
5
|
-
const o = t == null ? void 0 : t.onLine, a = n == null ? void 0 : n.online;
|
|
6
|
-
return {
|
|
7
|
-
online: o,
|
|
8
|
-
previous: a,
|
|
9
|
-
since: o !== a ? /* @__PURE__ */ new Date() : n == null ? void 0 : n.since,
|
|
10
|
-
downlink: e == null ? void 0 : e.downlink,
|
|
11
|
-
downlinkMax: e == null ? void 0 : e.downlinkMax,
|
|
12
|
-
effectiveType: e == null ? void 0 : e.effectiveType,
|
|
13
|
-
rtt: e == null ? void 0 : e.rtt,
|
|
14
|
-
saveData: e == null ? void 0 : e.saveData,
|
|
15
|
-
type: e == null ? void 0 : e.type
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
function k(n) {
|
|
19
|
-
const [o, a] = l(n ?? w);
|
|
20
|
-
return r(() => {
|
|
21
|
-
const i = () => {
|
|
22
|
-
a(w);
|
|
23
|
-
};
|
|
24
|
-
return f(window, "online", i, { passive: !0 }), f(window, "offline", i, { passive: !0 }), e && f(e, "change", i, { passive: !0 }), () => {
|
|
25
|
-
s(window, "online", i), s(window, "offline", i), e && s(e, "change", i);
|
|
26
|
-
};
|
|
27
|
-
}, []), o;
|
|
28
|
-
}
|
|
29
|
-
export {
|
|
30
|
-
k as default
|
|
31
|
-
};
|
package/hooks/useNumber.js
DELETED
package/hooks/useObservable.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { useState as o } from "react";
|
|
2
|
-
import c from "./useIsomorphicLayoutEffect.js";
|
|
3
|
-
function f(t, e) {
|
|
4
|
-
const [u, r] = o(e);
|
|
5
|
-
return c(() => {
|
|
6
|
-
const s = t.subscribe(r);
|
|
7
|
-
return () => s.unsubscribe();
|
|
8
|
-
}, [t]), u;
|
|
9
|
-
}
|
|
10
|
-
export {
|
|
11
|
-
f as default
|
|
12
|
-
};
|
package/hooks/useOrientation.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { useState as f, useEffect as w } from "react";
|
|
2
|
-
import { o as d, a as u } from "../chunk/TXCrI0jN.js";
|
|
3
|
-
const l = {
|
|
4
|
-
angle: 0,
|
|
5
|
-
type: "landscape-primary"
|
|
6
|
-
}, g = (n = l) => {
|
|
7
|
-
const [i, e] = f(n);
|
|
8
|
-
return w(() => {
|
|
9
|
-
const r = window.screen;
|
|
10
|
-
let o = !0;
|
|
11
|
-
const t = () => {
|
|
12
|
-
if (o) {
|
|
13
|
-
const { orientation: a } = r;
|
|
14
|
-
if (a) {
|
|
15
|
-
const { angle: s, type: c } = a;
|
|
16
|
-
e({ angle: s, type: c });
|
|
17
|
-
} else window.orientation !== void 0 ? e({
|
|
18
|
-
angle: typeof window.orientation == "number" ? window.orientation : 0,
|
|
19
|
-
type: ""
|
|
20
|
-
}) : e(n);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
return d(window, "orientationchange", t), t(), () => {
|
|
24
|
-
o = !1, u(window, "orientationchange", t);
|
|
25
|
-
};
|
|
26
|
-
}, []), i;
|
|
27
|
-
};
|
|
28
|
-
export {
|
|
29
|
-
g as default
|
|
30
|
-
};
|
package/hooks/usePageLeave.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { useEffect as u } from "react";
|
|
2
|
-
import { o as f, a as s } from "../chunk/TXCrI0jN.js";
|
|
3
|
-
const d = (t, m = []) => {
|
|
4
|
-
u(() => {
|
|
5
|
-
if (!t)
|
|
6
|
-
return;
|
|
7
|
-
const e = (o) => {
|
|
8
|
-
o = o || window.event;
|
|
9
|
-
const r = o.relatedTarget || o.toElement;
|
|
10
|
-
(!r || r.nodeName === "HTML") && t();
|
|
11
|
-
};
|
|
12
|
-
return f(document, "mouseout", e), () => {
|
|
13
|
-
s(document, "mouseout", e);
|
|
14
|
-
};
|
|
15
|
-
}, m);
|
|
16
|
-
};
|
|
17
|
-
export {
|
|
18
|
-
d as default
|
|
19
|
-
};
|
package/hooks/usePermission.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { useState as u, useEffect as f } from "react";
|
|
2
|
-
import { o as l, n as c, a as h } from "../chunk/TXCrI0jN.js";
|
|
3
|
-
const i = (n) => {
|
|
4
|
-
const [o, r] = u("");
|
|
5
|
-
return f(() => {
|
|
6
|
-
let a = !0, t = null;
|
|
7
|
-
const e = () => {
|
|
8
|
-
a && r(() => (t == null ? void 0 : t.state) ?? "");
|
|
9
|
-
};
|
|
10
|
-
return navigator.permissions.query(n).then((s) => {
|
|
11
|
-
t = s, l(t, "change", e), e();
|
|
12
|
-
}).catch(c), () => {
|
|
13
|
-
t && h(t, "change", e), a = !1, t = null;
|
|
14
|
-
};
|
|
15
|
-
}, [n]), o;
|
|
16
|
-
};
|
|
17
|
-
export {
|
|
18
|
-
i as default
|
|
19
|
-
};
|
package/hooks/usePinchZoom.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { useMemo as v, useState as u, useEffect as l } from "react";
|
|
2
|
-
var s = /* @__PURE__ */ ((e) => (e.ZOOMING_IN = "ZOOMING_IN", e.ZOOMING_OUT = "ZOOMING_OUT", e))(s || {});
|
|
3
|
-
const f = (e) => {
|
|
4
|
-
const t = v(
|
|
5
|
-
() => ({
|
|
6
|
-
evCache: [],
|
|
7
|
-
prevDiff: -1
|
|
8
|
-
}),
|
|
9
|
-
[e.current]
|
|
10
|
-
), [i, r] = u(), a = (o) => {
|
|
11
|
-
for (let n = 0; n < t.evCache.length; n++)
|
|
12
|
-
if (o.pointerId == t.evCache[n].pointerId) {
|
|
13
|
-
t.evCache[n] = o;
|
|
14
|
-
break;
|
|
15
|
-
}
|
|
16
|
-
if (t.evCache.length == 2) {
|
|
17
|
-
const n = Math.abs(
|
|
18
|
-
t.evCache[0].clientX - t.evCache[1].clientX
|
|
19
|
-
);
|
|
20
|
-
t.prevDiff > 0 && (n > t.prevDiff && r(["ZOOMING_IN", n]), n < t.prevDiff && r(["ZOOMING_OUT", n])), t.prevDiff = n;
|
|
21
|
-
}
|
|
22
|
-
}, p = (o) => {
|
|
23
|
-
t.evCache.push(o);
|
|
24
|
-
}, c = (o) => {
|
|
25
|
-
h(o), t.evCache.length < 2 && (t.prevDiff = -1);
|
|
26
|
-
}, h = (o) => {
|
|
27
|
-
for (let n = 0; n < t.evCache.length; n++)
|
|
28
|
-
if (t.evCache[n].pointerId == o.pointerId) {
|
|
29
|
-
t.evCache.splice(n, 1);
|
|
30
|
-
break;
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
return l(() => {
|
|
34
|
-
e != null && e.current && (e.current.onpointerdown = p, e.current.onpointermove = a, e.current.onpointerup = c, e.current.onpointercancel = c, e.current.onpointerout = c, e.current.onpointerleave = c);
|
|
35
|
-
}, [e == null ? void 0 : e.current]), i ? { zoomingState: i[0], pinchState: i[1] } : { zoomingState: null, pinchState: 0 };
|
|
36
|
-
};
|
|
37
|
-
export {
|
|
38
|
-
s as ZoomState,
|
|
39
|
-
f as default
|
|
40
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { useRef as e } from "react";
|
|
2
|
-
import u from "./useFirstMountState.js";
|
|
3
|
-
const o = (t, r) => t === r;
|
|
4
|
-
function m(t, r = o) {
|
|
5
|
-
const n = e(), s = e(t);
|
|
6
|
-
return !u() && !r(s.current, t) && (n.current = s.current, s.current = t), n.current;
|
|
7
|
-
}
|
|
8
|
-
export {
|
|
9
|
-
m as default
|
|
10
|
-
};
|
package/hooks/usePromise.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { useCallback as a } from "react";
|
|
2
|
-
import m from "./useMountedState.js";
|
|
3
|
-
const l = () => {
|
|
4
|
-
const e = m();
|
|
5
|
-
return a(
|
|
6
|
-
(t) => new Promise((r, n) => {
|
|
7
|
-
const s = (o) => {
|
|
8
|
-
e() && r(o);
|
|
9
|
-
}, u = (o) => {
|
|
10
|
-
e() && n(o);
|
|
11
|
-
};
|
|
12
|
-
t.then(s, u);
|
|
13
|
-
}),
|
|
14
|
-
[]
|
|
15
|
-
);
|
|
16
|
-
};
|
|
17
|
-
export {
|
|
18
|
-
l as default
|
|
19
|
-
};
|
package/hooks/useQueue.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { useState as a } from "react";
|
|
2
|
-
const o = (s = []) => {
|
|
3
|
-
const [e, u] = a(s);
|
|
4
|
-
return {
|
|
5
|
-
add: (t) => {
|
|
6
|
-
u((r) => [...r, t]);
|
|
7
|
-
},
|
|
8
|
-
remove: () => {
|
|
9
|
-
let t;
|
|
10
|
-
return u(([r, ...n]) => (t = r, n)), t;
|
|
11
|
-
},
|
|
12
|
-
get first() {
|
|
13
|
-
return e[0];
|
|
14
|
-
},
|
|
15
|
-
get last() {
|
|
16
|
-
return e[e.length - 1];
|
|
17
|
-
},
|
|
18
|
-
get size() {
|
|
19
|
-
return e.length;
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
export {
|
|
24
|
-
o as default
|
|
25
|
-
};
|
package/hooks/useRaf.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { useState as l } from "react";
|
|
2
|
-
import f from "./useIsomorphicLayoutEffect.js";
|
|
3
|
-
const T = (t = 1e12, o = 0) => {
|
|
4
|
-
const [i, a] = l(0);
|
|
5
|
-
return f(() => {
|
|
6
|
-
let e, n, r;
|
|
7
|
-
const s = () => {
|
|
8
|
-
const u = Math.min(1, (Date.now() - r) / t);
|
|
9
|
-
a(u), m();
|
|
10
|
-
}, m = () => {
|
|
11
|
-
e = requestAnimationFrame(s);
|
|
12
|
-
}, c = setTimeout(() => {
|
|
13
|
-
n = setTimeout(() => {
|
|
14
|
-
cancelAnimationFrame(e), a(1);
|
|
15
|
-
}, t), r = Date.now(), m();
|
|
16
|
-
}, o);
|
|
17
|
-
return () => {
|
|
18
|
-
clearTimeout(n), clearTimeout(c), cancelAnimationFrame(e);
|
|
19
|
-
};
|
|
20
|
-
}, [t, o]), i;
|
|
21
|
-
};
|
|
22
|
-
export {
|
|
23
|
-
T as default
|
|
24
|
-
};
|
package/hooks/useRafLoop.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { useRef as n, useCallback as o, useMemo as i, useEffect as l } from "react";
|
|
2
|
-
function p(u, s = !0) {
|
|
3
|
-
const e = n(null), r = n(!1), c = n(u);
|
|
4
|
-
c.current = u;
|
|
5
|
-
const a = o((f) => {
|
|
6
|
-
r.current && (c.current(f), e.current = requestAnimationFrame(a));
|
|
7
|
-
}, []), t = i(
|
|
8
|
-
() => [
|
|
9
|
-
() => {
|
|
10
|
-
r.current && (r.current = !1, e.current && cancelAnimationFrame(e.current));
|
|
11
|
-
},
|
|
12
|
-
() => {
|
|
13
|
-
r.current || (r.current = !0, e.current = requestAnimationFrame(a));
|
|
14
|
-
},
|
|
15
|
-
() => r.current
|
|
16
|
-
// isActive
|
|
17
|
-
],
|
|
18
|
-
[]
|
|
19
|
-
);
|
|
20
|
-
return l(() => (s && t[1](), t[0]), []), t;
|
|
21
|
-
}
|
|
22
|
-
export {
|
|
23
|
-
p as default
|
|
24
|
-
};
|
package/hooks/useRafState.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { useRef as o, useState as c, useCallback as m } from "react";
|
|
2
|
-
import u from "./useUnmount.js";
|
|
3
|
-
const l = (e) => {
|
|
4
|
-
const t = o(0), [a, n] = c(e), r = m((s) => {
|
|
5
|
-
cancelAnimationFrame(t.current), t.current = requestAnimationFrame(() => {
|
|
6
|
-
n(s);
|
|
7
|
-
});
|
|
8
|
-
}, []);
|
|
9
|
-
return u(() => {
|
|
10
|
-
cancelAnimationFrame(t.current);
|
|
11
|
-
}), [a, r];
|
|
12
|
-
};
|
|
13
|
-
export {
|
|
14
|
-
l as default
|
|
15
|
-
};
|
package/hooks/useReactive.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { useRef as u } from "react";
|
|
2
|
-
import p from "./useCreation.js";
|
|
3
|
-
import a from "./useForceUpdate.js";
|
|
4
|
-
const f = (s, t) => new Proxy(s, {
|
|
5
|
-
get(e, r, n) {
|
|
6
|
-
const o = Reflect.get(e, r, n);
|
|
7
|
-
return typeof o == "object" ? f(o, t) : Reflect.get(e, r);
|
|
8
|
-
},
|
|
9
|
-
set(e, r, n) {
|
|
10
|
-
const o = Reflect.set(e, r, n);
|
|
11
|
-
return t(), o;
|
|
12
|
-
}
|
|
13
|
-
}), l = (s) => {
|
|
14
|
-
const t = u(s), c = a();
|
|
15
|
-
return p(() => f(t.current, () => {
|
|
16
|
-
c();
|
|
17
|
-
}), []);
|
|
18
|
-
};
|
|
19
|
-
export {
|
|
20
|
-
l as default
|
|
21
|
-
};
|
package/hooks/useRendersCount.js
DELETED
package/hooks/useScroll.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { useEffect as s } from "react";
|
|
2
|
-
import { o as c, a as n } from "../chunk/TXCrI0jN.js";
|
|
3
|
-
import u from "./useRafState.js";
|
|
4
|
-
const f = (e) => {
|
|
5
|
-
process.env.NODE_ENV === "development" && (typeof e != "object" || typeof e.current > "u") && console.error("`useScroll` expects a single ref argument.");
|
|
6
|
-
const [r, o] = u({
|
|
7
|
-
x: 0,
|
|
8
|
-
y: 0
|
|
9
|
-
});
|
|
10
|
-
return s(() => {
|
|
11
|
-
const t = () => {
|
|
12
|
-
e.current && o({
|
|
13
|
-
x: e.current.scrollLeft,
|
|
14
|
-
y: e.current.scrollTop
|
|
15
|
-
});
|
|
16
|
-
};
|
|
17
|
-
return e.current && c(e.current, "scroll", t, {
|
|
18
|
-
capture: !1,
|
|
19
|
-
passive: !0
|
|
20
|
-
}), () => {
|
|
21
|
-
e.current && n(e.current, "scroll", t);
|
|
22
|
-
};
|
|
23
|
-
}, [e]), r;
|
|
24
|
-
};
|
|
25
|
-
export {
|
|
26
|
-
f as default
|
|
27
|
-
};
|
package/hooks/useScrolling.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { useState as n, useEffect as c } from "react";
|
|
2
|
-
import { o as u, a } from "../chunk/TXCrI0jN.js";
|
|
3
|
-
const m = (l) => {
|
|
4
|
-
const [o, r] = n(!1);
|
|
5
|
-
return c(() => {
|
|
6
|
-
if (l.current) {
|
|
7
|
-
let t;
|
|
8
|
-
const s = () => {
|
|
9
|
-
r(!1);
|
|
10
|
-
}, e = () => {
|
|
11
|
-
r(!0), clearTimeout(t), t = setTimeout(() => s(), 150);
|
|
12
|
-
};
|
|
13
|
-
return u(l.current, "scroll", e, !1), () => {
|
|
14
|
-
l.current && a(l.current, "scroll", e, !1);
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
return () => {
|
|
18
|
-
};
|
|
19
|
-
}, [l]), o;
|
|
20
|
-
};
|
|
21
|
-
export {
|
|
22
|
-
m as default
|
|
23
|
-
};
|
package/hooks/useSearchParam.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { useState as w, useEffect as u } from "react";
|
|
2
|
-
import { i, o, a as s } from "../chunk/TXCrI0jN.js";
|
|
3
|
-
const r = (a, t) => new URLSearchParams(a).get(t), l = (a) => {
|
|
4
|
-
const t = window.location, [n, c] = w(
|
|
5
|
-
() => r(t.search, a)
|
|
6
|
-
);
|
|
7
|
-
return u(() => {
|
|
8
|
-
const e = () => {
|
|
9
|
-
c(r(t.search, a));
|
|
10
|
-
};
|
|
11
|
-
return o(window, "popstate", e), o(window, "pushstate", e), o(window, "replacestate", e), () => {
|
|
12
|
-
s(window, "popstate", e), s(window, "pushstate", e), s(window, "replacestate", e);
|
|
13
|
-
};
|
|
14
|
-
}, []), n;
|
|
15
|
-
}, p = () => null, f = i ? l : p;
|
|
16
|
-
export {
|
|
17
|
-
f as default
|
|
18
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { useState as S, useEffect as c } from "react";
|
|
2
|
-
import { i as g } from "../chunk/TXCrI0jN.js";
|
|
3
|
-
const a = (s, t, r) => {
|
|
4
|
-
if (!g)
|
|
5
|
-
return [t, () => {
|
|
6
|
-
}];
|
|
7
|
-
const [o, n] = S(() => {
|
|
8
|
-
try {
|
|
9
|
-
const e = sessionStorage.getItem(s);
|
|
10
|
-
return typeof e != "string" ? (sessionStorage.setItem(
|
|
11
|
-
s,
|
|
12
|
-
r ? String(t) : JSON.stringify(t)
|
|
13
|
-
), t) : r ? e : JSON.parse(e || "null");
|
|
14
|
-
} catch (e) {
|
|
15
|
-
return console.error(e), t;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
return c(() => {
|
|
19
|
-
try {
|
|
20
|
-
const e = r ? String(o) : JSON.stringify(o);
|
|
21
|
-
sessionStorage.setItem(s, e);
|
|
22
|
-
} catch (e) {
|
|
23
|
-
console.error(e);
|
|
24
|
-
}
|
|
25
|
-
}), [o, n];
|
|
26
|
-
};
|
|
27
|
-
export {
|
|
28
|
-
a as default
|
|
29
|
-
};
|
package/hooks/useSet.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { useState as l, useMemo as u, useCallback as m } from "react";
|
|
2
|
-
const S = (a = /* @__PURE__ */ new Set()) => {
|
|
3
|
-
const [s, r] = l(a), c = u(() => ({ add: (e) => r((t) => /* @__PURE__ */ new Set([...Array.from(t), e])), remove: (e) => r(
|
|
4
|
-
(t) => new Set(Array.from(t).filter((o) => o !== e))
|
|
5
|
-
), toggle: (e) => r(
|
|
6
|
-
(t) => t.has(e) ? new Set(Array.from(t).filter((o) => o !== e)) : /* @__PURE__ */ new Set([...Array.from(t), e])
|
|
7
|
-
), reset: () => r(a) }), [r]), f = {
|
|
8
|
-
has: m((n) => s.has(n), [s]),
|
|
9
|
-
...c
|
|
10
|
-
};
|
|
11
|
-
return [s, f];
|
|
12
|
-
};
|
|
13
|
-
export {
|
|
14
|
-
S as default
|
|
15
|
-
};
|
package/hooks/useSetState.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { useState as u, useCallback as c } from "react";
|
|
2
|
-
const r = (s = {}) => {
|
|
3
|
-
const [n, o] = u(s), a = c((t) => {
|
|
4
|
-
o(
|
|
5
|
-
(e) => Object.assign(
|
|
6
|
-
{},
|
|
7
|
-
e,
|
|
8
|
-
t instanceof Function ? t(e) : t
|
|
9
|
-
)
|
|
10
|
-
);
|
|
11
|
-
}, []);
|
|
12
|
-
return [n, a];
|
|
13
|
-
};
|
|
14
|
-
export {
|
|
15
|
-
r as default
|
|
16
|
-
};
|
package/hooks/useSize.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import i from "react";
|
|
2
|
-
import { i as z, a as p, o as l } from "../chunk/TXCrI0jN.js";
|
|
3
|
-
const { useState: w, useEffect: W, useRef: E } = i, S = (o) => setTimeout(o, 35), I = (o, { width: e = 1 / 0, height: s = 1 / 0 } = {}) => {
|
|
4
|
-
if (!z)
|
|
5
|
-
return [
|
|
6
|
-
typeof o == "function" ? o({ width: e, height: s }) : o,
|
|
7
|
-
{ width: e, height: s }
|
|
8
|
-
];
|
|
9
|
-
const [a, y] = w({ width: e, height: s });
|
|
10
|
-
typeof o == "function" && (o = o(a));
|
|
11
|
-
const u = o.props.style || {}, f = E(null);
|
|
12
|
-
let n = null;
|
|
13
|
-
const c = () => {
|
|
14
|
-
const t = f.current, r = t ? {
|
|
15
|
-
width: t.offsetWidth,
|
|
16
|
-
height: t.offsetHeight
|
|
17
|
-
} : { width: e, height: s };
|
|
18
|
-
y(r);
|
|
19
|
-
}, d = (t) => {
|
|
20
|
-
l(t, "resize", c), S(c);
|
|
21
|
-
};
|
|
22
|
-
return W(() => {
|
|
23
|
-
const t = f.current;
|
|
24
|
-
if (t) {
|
|
25
|
-
if (t.contentWindow)
|
|
26
|
-
n = t.contentWindow, d(n);
|
|
27
|
-
else {
|
|
28
|
-
const r = () => {
|
|
29
|
-
l(t, "load", r), n = t.contentWindow, d(n);
|
|
30
|
-
};
|
|
31
|
-
p(t, "load", r);
|
|
32
|
-
}
|
|
33
|
-
return () => {
|
|
34
|
-
n && n.removeEventListener && p(n, "resize", c);
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
}, []), u.position = "relative", [i.cloneElement(
|
|
38
|
-
o,
|
|
39
|
-
{ style: u },
|
|
40
|
-
i.createElement("iframe", {
|
|
41
|
-
ref: f,
|
|
42
|
-
style: {
|
|
43
|
-
background: "transparent",
|
|
44
|
-
border: "none",
|
|
45
|
-
height: "100%",
|
|
46
|
-
left: 0,
|
|
47
|
-
position: "absolute",
|
|
48
|
-
top: 0,
|
|
49
|
-
width: "100%",
|
|
50
|
-
zIndex: -1
|
|
51
|
-
}
|
|
52
|
-
}),
|
|
53
|
-
...i.Children.toArray(o.props.children)
|
|
54
|
-
), a];
|
|
55
|
-
};
|
|
56
|
-
export {
|
|
57
|
-
I as default
|
|
58
|
-
};
|
package/hooks/useSlider.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { useRef as f, useEffect as X } from "react";
|
|
2
|
-
import { i as Y, n as S, o as r, a as u } from "../chunk/TXCrI0jN.js";
|
|
3
|
-
import p from "./useMountedState.js";
|
|
4
|
-
import q from "./useSetState.js";
|
|
5
|
-
const k = (n, t = {}) => {
|
|
6
|
-
const l = p(), o = f(!1), h = f(0), g = f(0), [b, m] = q({
|
|
7
|
-
isSliding: !1,
|
|
8
|
-
value: 0
|
|
9
|
-
});
|
|
10
|
-
return h.current = b.value, X(() => {
|
|
11
|
-
if (Y) {
|
|
12
|
-
const E = t.styles === void 0 ? !0 : t.styles, R = t.reverse === void 0 ? !1 : t.reverse;
|
|
13
|
-
n.current && E && (n.current.style.userSelect = "none");
|
|
14
|
-
const M = () => {
|
|
15
|
-
!o.current && l() && ((t.onScrubStart || S)(), o.current = !0, m({ isSliding: !0 }), A());
|
|
16
|
-
}, s = () => {
|
|
17
|
-
o.current && l() && ((t.onScrubStop || S)(h.current), o.current = !1, m({ isSliding: !1 }), B());
|
|
18
|
-
}, w = (e) => {
|
|
19
|
-
M(), d(e);
|
|
20
|
-
}, d = t.vertical ? (e) => i(e.clientY) : (e) => i(e.clientX), y = (e) => {
|
|
21
|
-
M(), v(e);
|
|
22
|
-
}, v = t.vertical ? (e) => i(e.changedTouches[0].clientY) : (e) => i(e.changedTouches[0].clientX), A = () => {
|
|
23
|
-
r(document, "mousemove", d), r(document, "mouseup", s), r(document, "touchmove", v), r(document, "touchend", s);
|
|
24
|
-
}, B = () => {
|
|
25
|
-
u(document, "mousemove", d), u(document, "mouseup", s), u(document, "touchmove", v), u(document, "touchend", s);
|
|
26
|
-
}, i = (e) => {
|
|
27
|
-
cancelAnimationFrame(g.current), g.current = requestAnimationFrame(() => {
|
|
28
|
-
if (l() && n.current) {
|
|
29
|
-
const a = n.current.getBoundingClientRect(), F = t.vertical ? a.top : a.left, T = t.vertical ? a.height : a.width;
|
|
30
|
-
if (!T)
|
|
31
|
-
return;
|
|
32
|
-
let c = (e - F) / T;
|
|
33
|
-
c > 1 ? c = 1 : c < 0 && (c = 0), R && (c = 1 - c), m({
|
|
34
|
-
value: c
|
|
35
|
-
}), (t.onScrub || S)(c);
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
return r(n.current, "mousedown", w), r(n.current, "touchstart", y), () => {
|
|
40
|
-
u(n.current, "mousedown", w), u(n.current, "touchstart", y);
|
|
41
|
-
};
|
|
42
|
-
} else
|
|
43
|
-
return;
|
|
44
|
-
}, [n, t.vertical]), b;
|
|
45
|
-
};
|
|
46
|
-
export {
|
|
47
|
-
k as default
|
|
48
|
-
};
|
package/hooks/useSpeech.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { useRef as h, useState as g, useCallback as l, useEffect as v } from "react";
|
|
2
|
-
var t = /* @__PURE__ */ ((n) => (n[n.init = 0] = "init", n[n.play = 1] = "play", n[n.pause = 2] = "pause", n[n.end = 3] = "end", n))(t || {});
|
|
3
|
-
const y = (n, r) => {
|
|
4
|
-
let a = h(!1);
|
|
5
|
-
const [s, u] = g(() => {
|
|
6
|
-
const { lang: e = "default", name: d = "" } = r.voice || {};
|
|
7
|
-
return {
|
|
8
|
-
isPlaying: !1,
|
|
9
|
-
status: t[
|
|
10
|
-
0
|
|
11
|
-
/* init */
|
|
12
|
-
],
|
|
13
|
-
lang: r.lang || "default",
|
|
14
|
-
voiceInfo: { lang: e, name: d },
|
|
15
|
-
rate: r.rate || 1,
|
|
16
|
-
pitch: r.pitch || 1,
|
|
17
|
-
volume: r.volume || 1
|
|
18
|
-
};
|
|
19
|
-
}), c = l(() => {
|
|
20
|
-
a.current && u((e) => ({ ...e, isPlaying: !0, status: t[
|
|
21
|
-
1
|
|
22
|
-
/* play */
|
|
23
|
-
] }));
|
|
24
|
-
}, []), i = l(() => {
|
|
25
|
-
a.current && u((e) => ({ ...e, isPlaying: !1, status: t[
|
|
26
|
-
2
|
|
27
|
-
/* pause */
|
|
28
|
-
] }));
|
|
29
|
-
}, []), f = l(() => {
|
|
30
|
-
a.current && u((e) => ({ ...e, isPlaying: !1, status: t[
|
|
31
|
-
3
|
|
32
|
-
/* end */
|
|
33
|
-
] }));
|
|
34
|
-
}, []);
|
|
35
|
-
return v(() => {
|
|
36
|
-
a.current = !0;
|
|
37
|
-
const e = new SpeechSynthesisUtterance(n);
|
|
38
|
-
return r.lang && (e.lang = r.lang), r.voice && (e.voice = r.voice), e.rate = r.rate || 1, e.pitch = r.pitch || 1, e.volume = r.volume || 1, e.onstart = c, e.onpause = i, e.onresume = c, e.onend = f, window.speechSynthesis.speak(e), () => {
|
|
39
|
-
a.current = !1;
|
|
40
|
-
};
|
|
41
|
-
}, []), s;
|
|
42
|
-
};
|
|
43
|
-
export {
|
|
44
|
-
y as default
|
|
45
|
-
};
|
package/hooks/useStartTyping.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { o, a as s } from "../chunk/TXCrI0jN.js";
|
|
2
|
-
import u from "./useIsomorphicLayoutEffect.js";
|
|
3
|
-
const a = () => {
|
|
4
|
-
const { activeElement: t, body: e } = document;
|
|
5
|
-
if (!t || t === e)
|
|
6
|
-
return !1;
|
|
7
|
-
switch (t.tagName) {
|
|
8
|
-
case "INPUT":
|
|
9
|
-
case "TEXTAREA":
|
|
10
|
-
return !0;
|
|
11
|
-
}
|
|
12
|
-
return t.hasAttribute("contenteditable");
|
|
13
|
-
}, c = ({
|
|
14
|
-
keyCode: t,
|
|
15
|
-
metaKey: e,
|
|
16
|
-
ctrlKey: r,
|
|
17
|
-
altKey: n
|
|
18
|
-
}) => e || r || n ? !1 : t >= 48 && t <= 57 || t >= 65 && t <= 90, m = (t) => {
|
|
19
|
-
u(() => {
|
|
20
|
-
const e = (r) => {
|
|
21
|
-
!a() && c(r) && t(r);
|
|
22
|
-
};
|
|
23
|
-
return o(document, "keydown", e), () => {
|
|
24
|
-
s(document, "keydown", e);
|
|
25
|
-
};
|
|
26
|
-
}, []);
|
|
27
|
-
};
|
|
28
|
-
export {
|
|
29
|
-
m as default
|
|
30
|
-
};
|