@unicom-cloud/ui-common 0.1.21 → 0.1.23
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/.virtual/_rolldown/runtime.js +1 -1
- package/.vite/manifest.json +209 -69
- package/development/Development.d.ts +8 -0
- package/development/Development.js +36 -0
- package/development/index.d.ts +2 -7
- package/development/index.js +5 -32
- package/empty/Empty.d.ts +5 -0
- package/empty/Empty.js +40 -0
- package/empty/index.d.ts +2 -4
- package/empty/index.js +5 -36
- package/flex/Flex.d.ts +6 -0
- package/flex/Flex.js +52 -0
- package/flex/index.d.ts +4 -5
- package/flex/index.js +6 -50
- package/flex/interface.d.ts +2 -2
- package/flex/utils.d.ts +2 -12
- package/flex/utils.js +1 -1
- package/higher-order/index.js +1 -1
- package/higher-order/with-speech-synthesis/index.d.ts +3 -6
- package/higher-order/with-speech-synthesis/index.js +5 -73
- package/higher-order/with-speech-synthesis/withSpeechSynthesis.d.ts +7 -0
- package/higher-order/with-speech-synthesis/withSpeechSynthesis.js +75 -0
- package/hooks/create-deep-compare-effect/index.js +1 -1
- package/hooks/create-update-effect/index.js +3 -3
- package/hooks/create-use-storage-state/index.d.ts +1 -1
- package/hooks/create-use-storage-state/index.js +2 -2
- package/hooks/index.d.ts +1 -2
- package/hooks/index.js +90 -91
- package/hooks/use-async-effect/index.js +1 -1
- package/hooks/use-boolean/index.js +1 -1
- package/hooks/use-click-away/index.js +1 -1
- package/hooks/use-computed-state/index.js +1 -1
- package/hooks/use-controllable-value/index.d.ts +7 -5
- package/hooks/use-controllable-value/index.js +44 -14
- package/hooks/use-cookie-state/index.js +1 -1
- package/hooks/use-count-down/index.js +1 -1
- package/hooks/use-counter/index.js +1 -1
- package/hooks/use-create/index.js +1 -1
- package/hooks/use-creation/index.js +1 -1
- package/hooks/use-debounce/index.js +1 -1
- package/hooks/use-debounce-effect/index.js +1 -1
- package/hooks/use-debounce-fn/index.js +1 -1
- package/hooks/use-deep-compare-effect/index.js +1 -1
- package/hooks/use-deep-compare-layout-effect/index.js +1 -1
- package/hooks/use-document-visibility/index.js +1 -1
- package/hooks/use-drag/index.js +2 -2
- package/hooks/use-drop/index.js +1 -1
- package/hooks/use-effect-event/index.d.ts +2 -2
- package/hooks/use-effect-event/index.js +5 -15
- package/hooks/use-event/index.js +1 -1
- package/hooks/use-event-emitter/index.d.ts +2 -2
- package/hooks/use-event-emitter/index.js +1 -1
- package/hooks/use-event-listener/index.js +1 -1
- package/hooks/use-event-target/index.js +1 -1
- package/hooks/use-external/index.js +1 -1
- package/hooks/use-favicon/index.js +1 -1
- package/hooks/use-focus-within/index.js +1 -1
- package/hooks/use-force-update/index.js +1 -1
- package/hooks/use-fullscreen/index.js +1 -1
- package/hooks/use-get-state/index.d.ts +1 -1
- package/hooks/use-get-state/index.js +1 -1
- package/hooks/use-history-travel/index.js +1 -1
- package/hooks/use-hover/index.js +1 -1
- package/hooks/use-id/index.js +1 -1
- package/hooks/use-in-viewport/index.d.ts +3 -1
- package/hooks/use-in-viewport/index.js +16 -15
- package/hooks/use-infinite-scroll/index.js +1 -1
- package/hooks/use-intersection-observer/index.d.ts +1 -1
- package/hooks/use-intersection-observer/index.js +2 -2
- package/hooks/use-intersection-observers/index.js +1 -1
- package/hooks/use-interval/index.js +1 -1
- package/hooks/use-is-first-render/index.js +1 -1
- package/hooks/use-isomorphic-layout-effect/index.js +1 -1
- package/hooks/use-key-press/index.js +1 -1
- package/hooks/use-keyboard-event/index.js +1 -1
- package/hooks/use-latest/index.js +1 -1
- package/hooks/use-listen-window-resize/index.js +1 -1
- package/hooks/use-local-storage-state/index.js +1 -1
- package/hooks/use-lock-fn/index.js +1 -1
- package/hooks/use-long-press/index.js +1 -1
- package/hooks/use-map/index.js +1 -1
- package/hooks/use-media/index.js +1 -1
- package/hooks/use-memo/index.js +3 -3
- package/hooks/use-memoized-fn/index.js +1 -1
- package/hooks/use-merge-props/index.d.ts +1 -1
- package/hooks/use-merge-props/index.js +5 -9
- package/hooks/use-merge-value/index.js +5 -5
- package/hooks/use-mobile/index.js +3 -3
- package/hooks/use-mount/index.d.ts +2 -1
- package/hooks/use-mount/index.js +10 -7
- package/hooks/use-mouse/index.js +1 -1
- package/hooks/use-move/index.js +1 -1
- package/hooks/use-mutation-observer/index.js +1 -1
- package/hooks/use-mutation-observers/index.js +1 -1
- package/hooks/use-network/index.js +16 -19
- package/hooks/use-online-status/index.js +1 -1
- package/hooks/use-overflow-hidden/index.js +1 -1
- package/hooks/use-override-ref/index.js +6 -6
- package/hooks/use-pagination/index.js +1 -1
- package/hooks/use-paste-image/index.d.ts +3 -1
- package/hooks/use-paste-image/index.js +16 -13
- package/hooks/use-persist-callback/index.d.ts +2 -1
- package/hooks/use-persist-callback/index.js +4 -7
- package/hooks/use-prefers-color-scheme-dark/index.js +1 -1
- package/hooks/use-previous/index.d.ts +1 -1
- package/hooks/use-previous/index.js +4 -4
- package/hooks/use-raf-interval/index.js +1 -1
- package/hooks/use-raf-state/index.js +1 -1
- package/hooks/use-raf-timeout/index.js +1 -1
- package/hooks/use-reactive/index.js +1 -1
- package/hooks/use-ref-latest/index.js +1 -1
- package/hooks/use-refs/index.js +1 -1
- package/hooks/use-request/index.js +1 -1
- package/hooks/use-request/src/Fetch.js +1 -1
- package/hooks/use-request/src/plugins/useAutoRunPlugin.js +1 -1
- package/hooks/use-request/src/plugins/useCachePlugin.js +1 -1
- package/hooks/use-request/src/plugins/useDebouncePlugin.js +1 -1
- package/hooks/use-request/src/plugins/useLoadingDelayPlugin.js +1 -1
- package/hooks/use-request/src/plugins/usePollingPlugin.js +1 -1
- package/hooks/use-request/src/plugins/useRefreshOnWindowFocusPlugin.js +1 -1
- package/hooks/use-request/src/plugins/useRetryPlugin.js +1 -1
- package/hooks/use-request/src/plugins/useThrottlePlugin.js +1 -1
- package/hooks/use-request/src/useRequest.js +1 -1
- package/hooks/use-request/src/useRequestImplement.js +1 -1
- package/hooks/use-request/src/utils/cache.js +17 -10
- package/hooks/use-request/src/utils/cachePromise.js +1 -1
- package/hooks/use-request/src/utils/cacheSubscribe.js +1 -1
- package/hooks/use-request/src/utils/isDocumentVisible.js +1 -1
- package/hooks/use-request/src/utils/isOnline.js +1 -1
- package/hooks/use-request/src/utils/limit.js +1 -1
- package/hooks/use-request/src/utils/subscribeFocus.js +1 -1
- package/hooks/use-request/src/utils/subscribeReVisible.js +1 -1
- package/hooks/use-reset-state/index.js +1 -1
- package/hooks/use-resize-observer/index.js +1 -1
- package/hooks/use-resize-observers/index.js +1 -1
- package/hooks/use-responsive/index.js +1 -1
- package/hooks/use-safe-state/index.js +1 -1
- package/hooks/use-scroll/index.d.ts +1 -1
- package/hooks/use-scroll/index.js +1 -1
- package/hooks/use-selections/index.js +1 -1
- package/hooks/use-session-storage-state/index.js +1 -1
- package/hooks/use-set/index.js +1 -1
- package/hooks/use-set-state/index.d.ts +4 -2
- package/hooks/use-set-state/index.js +19 -14
- package/hooks/use-size/index.js +1 -1
- package/hooks/use-state-callback/index.d.ts +8 -3
- package/hooks/use-state-callback/index.js +12 -7
- package/hooks/use-state-with-promise/index.js +14 -13
- package/hooks/use-sync-state/index.js +3 -3
- package/hooks/use-text-selection/index.js +1 -1
- package/hooks/use-theme/index.js +10 -10
- package/hooks/use-throttle/index.js +1 -1
- package/hooks/use-throttle-effect/index.js +1 -1
- package/hooks/use-throttle-fn/index.js +1 -1
- package/hooks/use-timeout/index.js +1 -1
- package/hooks/use-title/index.js +1 -1
- package/hooks/use-toggle/index.js +1 -1
- package/hooks/use-tracked-effect/index.js +1 -1
- package/hooks/use-unmount/index.js +1 -1
- package/hooks/use-unmounted-ref/index.js +1 -1
- package/hooks/use-update/index.js +5 -2
- package/hooks/use-update-effect/index.js +1 -1
- package/hooks/use-update-layout-effect/index.js +1 -1
- package/hooks/use-url-state/index.js +1 -1
- package/hooks/use-virtual-list/index.js +1 -1
- package/hooks/use-watch/index.js +1 -1
- package/hooks/use-web-socket/index.js +29 -29
- package/hooks/use-why-did-you-update/index.js +1 -1
- package/hooks/use-window-size/index.js +1 -1
- package/hooks/utils/createEffectWithTarget.js +1 -1
- package/hooks/utils/depsAreSame.js +1 -1
- package/hooks/utils/depsEqual.js +1 -1
- package/hooks/utils/domTarget.js +1 -1
- package/hooks/utils/getDocumentOrShadow.js +1 -1
- package/hooks/utils/index.js +1 -1
- package/hooks/utils/isAppleDevice.js +1 -1
- package/hooks/utils/isBrowser.js +1 -1
- package/hooks/utils/isDev.js +1 -1
- package/hooks/utils/rect.js +1 -1
- package/hooks/utils/useDeepCompareWithTarget.js +1 -1
- package/hooks/utils/useEffectWithTarget.js +1 -1
- package/hooks/utils/useIsomorphicLayoutEffectWithTarget.js +1 -1
- package/hooks/utils/useLayoutEffectWithTarget.js +1 -1
- package/icons/file/IconFile.d.ts +4 -0
- package/icons/file/IconFile.js +55 -0
- package/icons/file/index.d.ts +2 -3
- package/icons/file/index.js +5 -53
- package/index.js +656 -623
- package/package.json +1 -1
- package/progress/Progress.d.ts +409 -0
- package/progress/Progress.js +90 -0
- package/progress/index.d.ts +22 -407
- package/progress/index.js +4 -87
- package/resize-observer/Collection.d.ts +1 -2
- package/resize-observer/Collection.js +16 -16
- package/resize-observer/ResizeObserver.d.ts +6 -0
- package/resize-observer/ResizeObserver.js +23 -0
- package/resize-observer/SingleObserver.d.ts +3 -3
- package/resize-observer/SingleObserver.js +20 -20
- package/resize-observer/index.d.ts +4 -4
- package/resize-observer/index.js +6 -21
- package/resize-observer/observerUtil.js +1 -1
- package/space/Space.d.ts +5 -0
- package/space/Space.js +76 -0
- package/space/index.d.ts +4 -4
- package/space/index.js +5 -72
- package/style/animation.less +1 -4
- package/style.css +1 -1
- package/suspense-fallback-test/SuspenseFallbackTest.d.ts +6 -0
- package/suspense-fallback-test/SuspenseFallbackTest.js +13 -0
- package/suspense-fallback-test/index.d.ts +2 -6
- package/suspense-fallback-test/index.js +5 -6
- package/test.js +1 -1
- package/timer/Timer.d.ts +3 -0
- package/timer/Timer.js +40 -0
- package/timer/index.d.ts +2 -2
- package/timer/index.js +5 -37
- package/transition/Transition.d.ts +1 -8
- package/transition/Transition.js +62 -64
- package/transition/TransitionCSS.d.ts +1 -2
- package/transition/TransitionCSS.js +30 -26
- package/transition/TransitionGroup.d.ts +3 -3
- package/transition/TransitionGroup.js +46 -40
- package/transition/TransitionStyle.d.ts +1 -2
- package/transition/TransitionStyle.js +27 -23
- package/transition/constants.js +9 -3
- package/transition/context.d.ts +15 -0
- package/transition/context.js +8 -0
- package/transition/index.d.ts +13 -4
- package/transition/index.js +10 -9
- package/transition/interface.d.ts +8 -6
- package/transition/utils.d.ts +3 -3
- package/transition/utils.js +9 -9
- package/utils/callOrReturn.js +1 -1
- package/utils/callbackOriginRef.js +1 -1
- package/utils/caseName.js +1 -1
- package/utils/className.js +1 -1
- package/utils/constant.js +1 -1
- package/utils/copy.js +1 -1
- package/utils/date.js +1 -1
- package/utils/dayjs.js +1 -1
- package/utils/dom.d.ts +3 -2
- package/utils/dom.js +11 -2
- package/utils/emitter.js +1 -1
- package/utils/file.d.ts +1 -0
- package/utils/file.js +4 -0
- package/utils/fileRead.js +1 -1
- package/utils/fileToDataURL.js +1 -1
- package/utils/fillNBSP.d.ts +1 -1
- package/utils/fillNBSP.js +1 -1
- package/utils/findRootElement.js +1 -1
- package/utils/findScrollParent.d.ts +1 -1
- package/utils/findScrollParent.js +1 -1
- package/utils/getHighlightText.js +1 -1
- package/utils/getHotkeyHandler.js +1 -1
- package/utils/getScrollBarHeight.js +1 -1
- package/utils/getScrollBarSize.js +1 -1
- package/utils/getScrollBarWidth.js +1 -1
- package/utils/getStringLength.js +1 -1
- package/utils/include.js +1 -1
- package/utils/index.d.ts +2 -0
- package/utils/index.js +336 -324
- package/utils/intersectionObserver.d.ts +1 -1
- package/utils/intersectionObserver.js +1 -1
- package/utils/is.d.ts +3 -2
- package/utils/is.js +18 -16
- package/utils/keyboardCode.js +1 -1
- package/utils/lodash.d.ts +5 -1
- package/utils/lodash.js +31 -27
- package/utils/math.js +1 -1
- package/utils/mergeProps.d.ts +1 -1
- package/utils/mergeProps.js +7 -8
- package/utils/mergedToString.js +1 -1
- package/utils/mutationObserver.d.ts +1 -1
- package/utils/mutationObserver.js +1 -1
- package/utils/object.d.ts +1 -0
- package/utils/object.js +10 -0
- package/utils/omit.d.ts +1 -5
- package/utils/omit.js +3 -3
- package/utils/pad.js +1 -1
- package/utils/pick.d.ts +2 -7
- package/utils/pick.js +6 -6
- package/utils/pinyin.js +1 -1
- package/utils/react19Adapter.js +1 -1
- package/utils/ref.d.ts +2 -2
- package/utils/ref.js +1 -1
- package/utils/resizeObserver.d.ts +1 -1
- package/utils/resizeObserver.js +1 -1
- package/utils/saveAs.js +1 -1
- package/utils/screenfull.js +1 -1
- package/utils/scrollIntoViewIfNeeded.js +1 -1
- package/utils/setCreateRoot.js +1 -1
- package/utils/setDarkTheme.js +1 -1
- package/utils/setDir.js +1 -1
- package/utils/setPrimaryColor.js +1 -1
- package/utils/setTheme.js +1 -1
- package/utils/string.js +1 -1
- package/utils/style.js +1 -1
- package/utils/throttleByRaf.js +1 -1
- package/utils/throttleByRaf2.d.ts +1 -1
- package/utils/throttleByRaf2.js +1 -1
- package/utils/tinycolor.js +1 -1
- package/utils/toArray.js +1 -1
- package/utils/tree.js +1 -1
- package/utils/tween.js +1 -1
- package/utils/uuid.js +1 -1
- package/utils/validate.js +1 -1
- package/utils/warning.js +1 -1
- package/version/index.js +11 -11
- package/hooks/use-in-view/index.d.ts +0 -11
- package/hooks/use-in-view/index.js +0 -21
package/hooks/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 潘启宝 2026-
|
|
1
|
+
/* 潘启宝 2026-05-15 17:45:46 星期五 */
|
|
2
2
|
import e from "./create-update-effect/index.js";
|
|
3
3
|
import t from "./use-async-effect/index.js";
|
|
4
4
|
import n from "./use-toggle/index.js";
|
|
@@ -8,91 +8,91 @@ import a from "./use-unmount/index.js";
|
|
|
8
8
|
import o from "./use-click-away/index.js";
|
|
9
9
|
import s from "./use-computed-state/index.js";
|
|
10
10
|
import c from "./use-memoized-fn/index.js";
|
|
11
|
-
import l from "./use-
|
|
12
|
-
import u from "./use-
|
|
13
|
-
import d from "./use-
|
|
14
|
-
import f from "./use-
|
|
15
|
-
import p from "./use-
|
|
16
|
-
import m from "./use-
|
|
17
|
-
import h from "./use-
|
|
18
|
-
import g from "./use-
|
|
19
|
-
import _ from "./use-debounce/index.js";
|
|
20
|
-
import v from "./use-
|
|
21
|
-
import y from "./use-
|
|
22
|
-
import b from "./use-
|
|
23
|
-
import x from "./use-deep-compare-
|
|
24
|
-
import S from "./use-
|
|
25
|
-
import C from "./use-
|
|
26
|
-
import w from "./use-
|
|
27
|
-
import T from "./use-
|
|
28
|
-
import E from "./use-
|
|
29
|
-
import D from "./use-
|
|
30
|
-
import O from "./use-event
|
|
31
|
-
import k from "./use-event-
|
|
32
|
-
import A from "./use-
|
|
33
|
-
import j from "./use-
|
|
34
|
-
import M from "./use-
|
|
35
|
-
import N from "./use-
|
|
36
|
-
import P from "./use-
|
|
37
|
-
import F from "./use-
|
|
38
|
-
import I from "./use-
|
|
39
|
-
import L from "./use-
|
|
40
|
-
import
|
|
41
|
-
import z from "./use-
|
|
42
|
-
import B from "./use-
|
|
43
|
-
import V from "./use-
|
|
44
|
-
import H from "./use-
|
|
45
|
-
import U from "./use-
|
|
46
|
-
import W from "./use-
|
|
47
|
-
import G from "./use-
|
|
48
|
-
import K from "./use-
|
|
49
|
-
import q from "./use-
|
|
50
|
-
import J from "./use-
|
|
51
|
-
import Y from "./use-
|
|
52
|
-
import X from "./use-
|
|
53
|
-
import Z from "./use-
|
|
54
|
-
import Q from "./use-
|
|
55
|
-
import $ from "./use-
|
|
56
|
-
import ee from "./use-
|
|
57
|
-
import te from "./use-
|
|
58
|
-
import ne from "./use-
|
|
59
|
-
import re from "./use-
|
|
60
|
-
import ie from "./use-raf-
|
|
61
|
-
import ae from "./use-
|
|
62
|
-
import oe from "./use-
|
|
63
|
-
import se from "./use-
|
|
64
|
-
import ce
|
|
65
|
-
import ue from "./use-
|
|
66
|
-
import de from "./use-
|
|
67
|
-
import fe from "./use-
|
|
68
|
-
import pe from "./use-
|
|
69
|
-
import me from "./use-
|
|
70
|
-
import he from "./use-
|
|
71
|
-
import ge from "./use-
|
|
72
|
-
import _e from "./use-
|
|
73
|
-
import ve from "./use-
|
|
74
|
-
import ye from "./use-
|
|
75
|
-
import be from "./use-
|
|
76
|
-
import xe from "./use-
|
|
77
|
-
import Se from "./use-throttle-
|
|
78
|
-
import Ce from "./use-
|
|
79
|
-
import we from "./use-
|
|
80
|
-
import Te from "./use-
|
|
81
|
-
import Ee from "./use-
|
|
82
|
-
import De from "./use-
|
|
83
|
-
import Oe from "./use-
|
|
84
|
-
import ke from "./use-
|
|
85
|
-
import Ae from "./use-
|
|
86
|
-
import je from "./use-
|
|
87
|
-
import Me from "./use-
|
|
88
|
-
import Ne from "./use-
|
|
89
|
-
import Pe from "./use-
|
|
90
|
-
import Fe from "./use-
|
|
91
|
-
import Ie from "./use-
|
|
92
|
-
import Le from "./use-
|
|
93
|
-
import Re from "./use-
|
|
94
|
-
import ze from "./use-
|
|
95
|
-
import Be from "./use-merge-
|
|
11
|
+
import l from "./use-previous/index.js";
|
|
12
|
+
import u from "./use-update/index.js";
|
|
13
|
+
import d from "./use-controllable-value/index.js";
|
|
14
|
+
import f from "./use-cookie-state/index.js";
|
|
15
|
+
import p from "./use-count-down/index.js";
|
|
16
|
+
import m from "./use-counter/index.js";
|
|
17
|
+
import h from "./use-create/index.js";
|
|
18
|
+
import g from "./use-creation/index.js";
|
|
19
|
+
import _ from "./use-debounce-fn/index.js";
|
|
20
|
+
import v from "./use-debounce/index.js";
|
|
21
|
+
import y from "./use-update-effect/index.js";
|
|
22
|
+
import b from "./use-debounce-effect/index.js";
|
|
23
|
+
import x from "./use-deep-compare-effect/index.js";
|
|
24
|
+
import S from "./use-deep-compare-layout-effect/index.js";
|
|
25
|
+
import C from "./use-event-listener/index.js";
|
|
26
|
+
import w from "./use-document-visibility/index.js";
|
|
27
|
+
import T from "./use-mount/index.js";
|
|
28
|
+
import E from "./use-drag/index.js";
|
|
29
|
+
import D from "./use-drop/index.js";
|
|
30
|
+
import O from "./use-event/index.js";
|
|
31
|
+
import k from "./use-event-emitter/index.js";
|
|
32
|
+
import A from "./use-event-target/index.js";
|
|
33
|
+
import j from "./use-external/index.js";
|
|
34
|
+
import M from "./use-favicon/index.js";
|
|
35
|
+
import N from "./use-focus-within/index.js";
|
|
36
|
+
import P from "./use-fullscreen/index.js";
|
|
37
|
+
import F from "./use-get-state/index.js";
|
|
38
|
+
import I from "./use-history-travel/index.js";
|
|
39
|
+
import L from "./use-hover/index.js";
|
|
40
|
+
import R from "./use-intersection-observer/index.js";
|
|
41
|
+
import z from "./use-in-viewport/index.js";
|
|
42
|
+
import { clearCache as B } from "./use-request/src/utils/cache.js";
|
|
43
|
+
import V from "./use-request/index.js";
|
|
44
|
+
import H from "./use-infinite-scroll/index.js";
|
|
45
|
+
import U from "./use-interval/index.js";
|
|
46
|
+
import W from "./use-isomorphic-layout-effect/index.js";
|
|
47
|
+
import G from "./use-key-press/index.js";
|
|
48
|
+
import K from "./use-local-storage-state/index.js";
|
|
49
|
+
import q from "./use-lock-fn/index.js";
|
|
50
|
+
import J from "./use-long-press/index.js";
|
|
51
|
+
import Y from "./use-memo/index.js";
|
|
52
|
+
import X from "./use-mobile/index.js";
|
|
53
|
+
import Z from "./use-raf-state/index.js";
|
|
54
|
+
import Q from "./use-mouse/index.js";
|
|
55
|
+
import $ from "./use-force-update/index.js";
|
|
56
|
+
import ee from "./use-move/index.js";
|
|
57
|
+
import te from "./use-mutation-observer/index.js";
|
|
58
|
+
import ne from "./use-network/index.js";
|
|
59
|
+
import re from "./use-pagination/index.js";
|
|
60
|
+
import ie from "./use-raf-interval/index.js";
|
|
61
|
+
import ae from "./use-raf-timeout/index.js";
|
|
62
|
+
import oe from "./use-reactive/index.js";
|
|
63
|
+
import se from "./use-ref-latest/index.js";
|
|
64
|
+
import ce from "./use-reset-state/index.js";
|
|
65
|
+
import le, { configResponsive as ue } from "./use-responsive/index.js";
|
|
66
|
+
import de from "./use-unmounted-ref/index.js";
|
|
67
|
+
import fe from "./use-safe-state/index.js";
|
|
68
|
+
import pe from "./use-scroll/index.js";
|
|
69
|
+
import me from "./use-selections/index.js";
|
|
70
|
+
import he from "./use-session-storage-state/index.js";
|
|
71
|
+
import ge from "./use-state-callback/index.js";
|
|
72
|
+
import _e from "./use-set-state/index.js";
|
|
73
|
+
import ve from "./use-size/index.js";
|
|
74
|
+
import ye from "./use-sync-state/index.js";
|
|
75
|
+
import be from "./use-text-selection/index.js";
|
|
76
|
+
import xe from "./use-theme/index.js";
|
|
77
|
+
import Se from "./use-throttle-fn/index.js";
|
|
78
|
+
import Ce from "./use-throttle/index.js";
|
|
79
|
+
import we from "./use-throttle-effect/index.js";
|
|
80
|
+
import Te from "./use-timeout/index.js";
|
|
81
|
+
import Ee from "./use-title/index.js";
|
|
82
|
+
import De from "./use-tracked-effect/index.js";
|
|
83
|
+
import Oe from "./use-update-layout-effect/index.js";
|
|
84
|
+
import ke from "./use-url-state/index.js";
|
|
85
|
+
import Ae from "./use-virtual-list/index.js";
|
|
86
|
+
import je from "./use-web-socket/index.js";
|
|
87
|
+
import Me from "./use-why-did-you-update/index.js";
|
|
88
|
+
import Ne from "./use-effect-event/index.js";
|
|
89
|
+
import Pe from "./use-id/index.js";
|
|
90
|
+
import Fe from "./use-intersection-observers/index.js";
|
|
91
|
+
import Ie from "./use-is-first-render/index.js";
|
|
92
|
+
import Le from "./use-keyboard-event/index.js";
|
|
93
|
+
import Re from "./use-listen-window-resize/index.js";
|
|
94
|
+
import ze from "./use-media/index.js";
|
|
95
|
+
import Be from "./use-merge-props/index.js";
|
|
96
96
|
import Ve from "./use-mutation-observers/index.js";
|
|
97
97
|
import He from "./use-online-status/index.js";
|
|
98
98
|
import Ue from "./use-overflow-hidden/index.js";
|
|
@@ -103,9 +103,8 @@ import qe from "./use-prefers-color-scheme-dark/index.js";
|
|
|
103
103
|
import Je, { useRefs2 as Ye } from "./use-refs/index.js";
|
|
104
104
|
import Xe from "./use-resize-observer/index.js";
|
|
105
105
|
import Ze from "./use-resize-observers/index.js";
|
|
106
|
-
import Qe from "./use-state-
|
|
107
|
-
import $e from "./use-
|
|
108
|
-
import et from "./use-
|
|
109
|
-
|
|
110
|
-
export { R as clearCache, le as configResponsive, e as createUpdateEffect, t as useAsyncEffect, r as useBoolean, o as useClickAway, s as useComputedState, u as useControllableValue, d as useCookieState, f as useCountDown, p as useCounter, m as useCreate, h as useCreation, _ as useDebounce, y as useDebounceEffect, g as useDebounceFn, b as useDeepCompareEffect, x as useDeepCompareLayoutEffect, C as useDocumentVisibility, T as useDrag, E as useDrop, D as useEvent, O as useEventEmitter, S as useEventListener, k as useEventTarget, A as useExternal, j as useFavicon, M as useFocusWithin, Z as useForceUpdate, N as useFullscreen, P as useGetState, F as useHistoryTravel, I as useHover, je as useId, Ne as useInView, L as useInViewport, B as useInfiniteScroll, Me as useIntersectionObserver, Pe as useIntersectionObservers, V as useInterval, Fe as useIsFirstRender, H as useIsomorphicLayoutEffect, U as useKeyPress, Ie as useKeyboardEvent, i as useLatest, Le as useListenWindowResize, W as useLocalStorageState, G as useLockFn, K as useLongPress, Re as useMedia, q as useMemo, c as useMemoizedFn, ze as useMergeProps, Be as useMergeValue, J as useMobile, w as useMount, X as useMouse, Q as useMove, $ as useMutationObserver, Ve as useMutationObservers, ee as useNetwork, He as useOnlineStatus, Ue as useOverflowHidden, We as useOverrideRef, te as usePagination, Ge as usePasteImage, Ke as usePersistCallback, qe as usePrefersColorSchemeDark, ne as usePrevious, re as useRafInterval, Y as useRafState, ie as useRafTimeout, ae as useReactive, oe as useRefLatest, Je as useRefs, Ye as useRefs2, z as useRequest, se as useResetState, Xe as useResizeObserver, Ze as useResizeObservers, ce as useResponsive, de as useSafeState, fe as useScroll, pe as useSelections, me as useSessionStorageState, he as useSetState, ge as useSize, Qe as useStateCallback, $e as useStateWithPromise, _e as useSyncState, ve as useTextSelection, ye as useTheme, xe as useThrottle, Se as useThrottleEffect, be as useThrottleFn, Ce as useTimeout, we as useTitle, n as useToggle, Te as useTrackedEffect, a as useUnmount, ue as useUnmountedRef, l as useUpdate, v as useUpdateEffect, Ee as useUpdateLayoutEffect, De as useUrlState, Oe as useVirtualList, et as useWatch, ke as useWebSocket, Ae as useWhyDidYouUpdate, tt as useWindowSize };
|
|
106
|
+
import Qe from "./use-state-with-promise/index.js";
|
|
107
|
+
import $e from "./use-watch/index.js";
|
|
108
|
+
import et from "./use-window-size/index.js";
|
|
109
|
+
export { B as clearCache, ue as configResponsive, e as createUpdateEffect, t as useAsyncEffect, r as useBoolean, o as useClickAway, s as useComputedState, d as useControllableValue, f as useCookieState, p as useCountDown, m as useCounter, h as useCreate, g as useCreation, v as useDebounce, b as useDebounceEffect, _ as useDebounceFn, x as useDeepCompareEffect, S as useDeepCompareLayoutEffect, w as useDocumentVisibility, E as useDrag, D as useDrop, Ne as useEffectEvent, O as useEvent, k as useEventEmitter, C as useEventListener, A as useEventTarget, j as useExternal, M as useFavicon, N as useFocusWithin, $ as useForceUpdate, P as useFullscreen, F as useGetState, I as useHistoryTravel, L as useHover, Pe as useId, z as useInViewport, H as useInfiniteScroll, R as useIntersectionObserver, Fe as useIntersectionObservers, U as useInterval, Ie as useIsFirstRender, W as useIsomorphicLayoutEffect, G as useKeyPress, Le as useKeyboardEvent, i as useLatest, Re as useListenWindowResize, K as useLocalStorageState, q as useLockFn, J as useLongPress, ze as useMedia, Y as useMemo, c as useMemoizedFn, Be as useMergeProps, X as useMobile, T as useMount, Q as useMouse, ee as useMove, te as useMutationObserver, Ve as useMutationObservers, ne as useNetwork, He as useOnlineStatus, Ue as useOverflowHidden, We as useOverrideRef, re as usePagination, Ge as usePasteImage, Ke as usePersistCallback, qe as usePrefersColorSchemeDark, l as usePrevious, ie as useRafInterval, Z as useRafState, ae as useRafTimeout, oe as useReactive, se as useRefLatest, Je as useRefs, Ye as useRefs2, V as useRequest, ce as useResetState, Xe as useResizeObserver, Ze as useResizeObservers, le as useResponsive, fe as useSafeState, pe as useScroll, me as useSelections, he as useSessionStorageState, _e as useSetState, ve as useSize, ge as useStateCallback, Qe as useStateWithPromise, ye as useSyncState, be as useTextSelection, xe as useTheme, Ce as useThrottle, we as useThrottleEffect, Se as useThrottleFn, Te as useTimeout, Ee as useTitle, n as useToggle, De as useTrackedEffect, a as useUnmount, de as useUnmountedRef, u as useUpdate, y as useUpdateEffect, Oe as useUpdateLayoutEffect, ke as useUrlState, Ae as useVirtualList, $e as useWatch, je as useWebSocket, Me as useWhyDidYouUpdate, et as useWindowSize };
|
|
111
110
|
/* 独立思考,明辨是非 */
|
|
@@ -2,15 +2,17 @@ import type { SetStateAction } from 'react';
|
|
|
2
2
|
export interface Options<T> {
|
|
3
3
|
defaultValue?: T;
|
|
4
4
|
defaultValuePropName?: string;
|
|
5
|
+
defaultValueParser?: (v: T) => T;
|
|
5
6
|
valuePropName?: string;
|
|
6
|
-
|
|
7
|
+
valueParser?: (v: T) => T;
|
|
8
|
+
triggerPropName?: string | false;
|
|
9
|
+
useStrict?: boolean;
|
|
7
10
|
}
|
|
8
|
-
export type Props = Record<string,
|
|
11
|
+
export type Props = Record<string, unknown> | (() => Record<string, unknown>);
|
|
9
12
|
export interface StandardProps<T> {
|
|
10
13
|
value: T;
|
|
11
14
|
defaultValue?: T;
|
|
12
|
-
onChange: (
|
|
15
|
+
onChange: (value: T) => void;
|
|
13
16
|
}
|
|
14
|
-
declare function useControllableValue<T =
|
|
15
|
-
declare function useControllableValue<T = any>(props?: Props, options?: Options<T>): [T, (v: SetStateAction<T>, ...args: any[]) => void];
|
|
17
|
+
declare function useControllableValue<T = unknown>(props?: Props, options?: Options<T>): [T, (s: SetStateAction<T>, ...args: unknown[]) => void, T];
|
|
16
18
|
export default useControllableValue;
|
|
@@ -1,19 +1,49 @@
|
|
|
1
|
-
/* 潘启宝 2026-
|
|
2
|
-
import { isFunction as e } from "../../utils/is.js";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
/* 潘启宝 2026-05-15 17:45:46 星期五 */
|
|
2
|
+
import { isFunction as e, isString as t, isUndefined as n } from "../../utils/is.js";
|
|
3
|
+
import { object_exports as r } from "../../utils/object.js";
|
|
4
|
+
import i from "../use-memoized-fn/index.js";
|
|
5
|
+
import a from "../use-previous/index.js";
|
|
6
|
+
import o from "../use-update/index.js";
|
|
7
|
+
import { useMemo as s, useRef as c } from "react";
|
|
6
8
|
//#region components/common/hooks/use-controllable-value/index.ts
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
p
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
let r = e(t) ? t(m.current) : t;
|
|
13
|
-
p || (m.current = r, h()), s[d] && s[d](r, ...n);
|
|
9
|
+
function l(l = {}, u = {}) {
|
|
10
|
+
e(l) && (l = l());
|
|
11
|
+
let { defaultValue: d, defaultValuePropName: f = "defaultValue", defaultValueParser: p, valuePropName: m = "value", valueParser: h, triggerPropName: g = "onChange", useStrict: _ = !1 } = u;
|
|
12
|
+
function v(e, t) {
|
|
13
|
+
return _ ? (0, r.hasOwn)(e, t) : !n(e[t]);
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
let y = v(l, m), b = v(l, f), { [f]: x, [m]: S } = l, C = o(), w = c(s(() => y ? O() : D(), []));
|
|
16
|
+
a(E(), E());
|
|
17
|
+
function T(e) {
|
|
18
|
+
w.current = e, C();
|
|
19
|
+
}
|
|
20
|
+
function E() {
|
|
21
|
+
return w.current;
|
|
22
|
+
}
|
|
23
|
+
function D(t) {
|
|
24
|
+
let n = t ?? (b ? x : d), r = p;
|
|
25
|
+
return e(r) ? r(n) : n;
|
|
26
|
+
}
|
|
27
|
+
function O(t) {
|
|
28
|
+
let n = t ?? S, r = h;
|
|
29
|
+
return e(r) ? r(n) : n;
|
|
30
|
+
}
|
|
31
|
+
function k() {
|
|
32
|
+
return y ? O() : E();
|
|
33
|
+
}
|
|
34
|
+
let A = i((...n) => {
|
|
35
|
+
let [r, ...i] = n, a = e(r) ? r(E()) : r;
|
|
36
|
+
if (T(a), t(g)) {
|
|
37
|
+
let t = l[g];
|
|
38
|
+
e(t) && t(a, ...i);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
return [
|
|
42
|
+
k(),
|
|
43
|
+
A,
|
|
44
|
+
E()
|
|
45
|
+
];
|
|
16
46
|
}
|
|
17
47
|
//#endregion
|
|
18
|
-
export {
|
|
48
|
+
export { l as default };
|
|
19
49
|
/* 独立思考,明辨是非 */
|
package/hooks/use-drag/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 潘启宝 2026-
|
|
1
|
+
/* 潘启宝 2026-05-15 17:45:46 星期五 */
|
|
2
2
|
import { isString as e } from "../../utils/is.js";
|
|
3
3
|
import t from "../use-latest/index.js";
|
|
4
4
|
import n from "../utils/domTarget.js";
|
|
@@ -7,7 +7,7 @@ import i from "../use-mount/index.js";
|
|
|
7
7
|
import { useRef as a } from "react";
|
|
8
8
|
//#region components/common/hooks/use-drag/index.ts
|
|
9
9
|
var o = (o, s, c = {}) => {
|
|
10
|
-
let l = t(c), u = t(o), d = a(
|
|
10
|
+
let l = t(c), u = t(o), d = a(null), { dragImage: f } = l.current;
|
|
11
11
|
i(() => {
|
|
12
12
|
if (f?.image) {
|
|
13
13
|
let { image: t } = f;
|
package/hooks/use-drop/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
declare const
|
|
3
|
-
export default
|
|
2
|
+
declare const useEffectEvent: typeof React.useEffectEvent;
|
|
3
|
+
export default useEffectEvent;
|
|
@@ -1,18 +1,8 @@
|
|
|
1
|
-
/* 潘启宝 2026-
|
|
2
|
-
import
|
|
3
|
-
import t
|
|
1
|
+
/* 潘启宝 2026-05-15 17:45:46 星期五 */
|
|
2
|
+
import e from "../use-memoized-fn/index.js";
|
|
3
|
+
import t from "react";
|
|
4
4
|
//#region components/common/hooks/use-effect-event/index.ts
|
|
5
|
-
|
|
6
|
-
let a = i(null);
|
|
7
|
-
return r(() => {
|
|
8
|
-
a.current = t;
|
|
9
|
-
}), n((...t) => {
|
|
10
|
-
let n = a.current;
|
|
11
|
-
if (!e(n)) throw Error("useEffectEvent handler is not a function");
|
|
12
|
-
return n(...t);
|
|
13
|
-
}, []);
|
|
14
|
-
}
|
|
15
|
-
var o = t.useEffectEvent || a;
|
|
5
|
+
var n = t.useEffectEvent || e;
|
|
16
6
|
//#endregion
|
|
17
|
-
export {
|
|
7
|
+
export { n as default };
|
|
18
8
|
/* 独立思考,明辨是非 */
|
package/hooks/use-event/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
type Subscription<T> = (
|
|
1
|
+
type Subscription<T> = (value: T) => void;
|
|
2
2
|
export declare class EventEmitter<T> {
|
|
3
3
|
private subscriptions;
|
|
4
|
-
emit: (
|
|
4
|
+
emit: (value: T) => void;
|
|
5
5
|
useSubscription: (callback: Subscription<T>) => void;
|
|
6
6
|
}
|
|
7
7
|
declare const useEventEmitter: <T = void>() => EventEmitter<T>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Dispatch, SetStateAction } from 'react';
|
|
2
|
-
type GetStateAction<S> = () => S;
|
|
2
|
+
export type GetStateAction<S> = () => S;
|
|
3
3
|
declare function useGetState<S>(initialState: S | (() => S)): [S, Dispatch<SetStateAction<S>>, GetStateAction<S>];
|
|
4
4
|
declare function useGetState<S = undefined>(): [
|
|
5
5
|
S | undefined,
|
package/hooks/use-hover/index.js
CHANGED
package/hooks/use-id/index.js
CHANGED
|
@@ -3,8 +3,10 @@ type CallbackType = (entry: IntersectionObserverEntry) => void;
|
|
|
3
3
|
export interface Options {
|
|
4
4
|
rootMargin?: string;
|
|
5
5
|
threshold?: number | number[];
|
|
6
|
+
scrollMargin?: string;
|
|
6
7
|
root?: BasicTarget<Element>;
|
|
8
|
+
defaultInView?: boolean;
|
|
7
9
|
callback?: CallbackType;
|
|
8
10
|
}
|
|
9
|
-
declare function useInViewport(target: BasicTarget | BasicTarget[], options?: Options): readonly [boolean
|
|
11
|
+
declare function useInViewport(target: BasicTarget | BasicTarget[], options?: Options): readonly [boolean, number | undefined];
|
|
10
12
|
export default useInViewport;
|