@unicom-cloud/ui-common 0.1.58 → 0.1.59
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/animation/Animation.js +41 -42
- package/animation/constants.d.ts +2 -0
- package/animation/constants.js +4 -4
- package/animation/context.d.ts +0 -1
- package/animation/context.js +3 -3
- package/animation/index.d.ts +0 -6
- package/animation/index.js +6 -10
- package/animation/interface.d.ts +1 -1
- package/animation/style/index.js +1 -1
- package/animation/utils.js +1 -1
- package/base/Base.js +1 -1
- package/base/constants.d.ts +2 -0
- package/base/constants.js +4 -1
- package/base/context.d.ts +0 -1
- package/base/context.js +3 -3
- package/base/index.js +1 -1
- package/base/style/index.js +1 -1
- package/base/utils.js +1 -1
- package/border-beam/BorderBeam.js +14 -14
- package/border-beam/Effect.d.ts +1 -6
- package/border-beam/Effect.js +3 -3
- package/border-beam/constants.d.ts +2 -1
- package/border-beam/constants.js +8 -3
- package/border-beam/context.d.ts +0 -1
- package/border-beam/context.js +4 -10
- package/border-beam/hooks/useBorderSize.d.ts +1 -5
- package/border-beam/hooks/useBorderSize.js +1 -1
- package/border-beam/hooks/useChildDom.d.ts +1 -1
- package/border-beam/hooks/useChildDom.js +1 -1
- package/border-beam/index.d.ts +0 -6
- package/border-beam/index.js +5 -9
- package/border-beam/interface.d.ts +27 -4
- package/border-beam/style/index.js +1 -1
- package/border-beam/utils.d.ts +1 -9
- package/border-beam/utils.js +9 -9
- package/development/Development.js +6 -5
- package/development/constants.d.ts +2 -0
- package/development/constants.js +4 -1
- package/development/context.d.ts +0 -1
- package/development/context.js +3 -3
- package/development/index.d.ts +0 -6
- package/development/index.js +5 -9
- package/development/style/index.js +1 -1
- package/development/utils.js +1 -1
- package/empty/Empty.d.ts +1 -1
- package/empty/Empty.js +28 -27
- package/empty/constants.d.ts +2 -0
- package/empty/constants.js +4 -1
- package/empty/context.d.ts +0 -1
- package/empty/context.js +3 -3
- package/empty/index.d.ts +1 -7
- package/empty/index.js +5 -9
- package/empty/style/index.js +1 -1
- package/empty/utils.js +1 -1
- package/flex/Flex.js +5 -4
- package/flex/FlexVertical.js +1 -1
- package/flex/constants.d.ts +2 -0
- package/flex/constants.js +7 -1
- package/flex/context.d.ts +0 -1
- package/flex/context.js +3 -6
- package/flex/index.d.ts +1 -7
- package/flex/index.js +9 -11
- package/flex/interface.d.ts +1 -1
- package/flex/style/index.js +1 -1
- package/flex/utils.d.ts +1 -1
- package/flex/utils.js +10 -12
- package/grid/Grid.js +16 -15
- package/grid/Item.js +10 -9
- package/grid/constants.d.ts +3 -0
- package/grid/constants.js +8 -1
- package/grid/context.d.ts +0 -2
- package/grid/context.js +4 -8
- package/grid/index.d.ts +0 -6
- package/grid/index.js +9 -11
- package/grid/style/index.js +1 -1
- package/grid/utils.js +1 -1
- package/higher-order/with-speech-synthesis/constants.d.ts +2 -0
- package/higher-order/with-speech-synthesis/constants.js +7 -0
- package/higher-order/with-speech-synthesis/context.d.ts +0 -1
- package/higher-order/with-speech-synthesis/context.js +3 -3
- package/higher-order/with-speech-synthesis/index.d.ts +0 -6
- package/higher-order/with-speech-synthesis/index.js +5 -9
- package/higher-order/with-speech-synthesis/style/index.js +1 -1
- package/higher-order/with-speech-synthesis/withSpeechSynthesis.d.ts +8 -1
- package/higher-order/with-speech-synthesis/withSpeechSynthesis.js +28 -27
- package/hoc/withContext.js +1 -1
- package/hooks/create-deep-compare-effect/index.js +1 -1
- package/hooks/create-update-effect/index.js +1 -1
- package/hooks/create-use-storage-state/index.js +9 -9
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +93 -92
- package/hooks/use-async-effect/index.js +1 -1
- package/hooks/use-boolean/index.js +1 -1
- package/hooks/use-click-away/index.d.ts +7 -1
- package/hooks/use-click-away/index.js +20 -12
- package/hooks/use-computed-state/index.js +1 -1
- package/hooks/use-controllable-value/index.js +1 -1
- package/hooks/use-cookie-state/index.js +2 -2
- package/hooks/use-count-down/index.js +1 -1
- package/hooks/use-counter/index.js +1 -1
- package/hooks/use-create/index.js +6 -5
- package/hooks/use-creation/index.js +7 -6
- package/hooks/use-debounce/debounceOptions.d.ts +1 -6
- package/hooks/use-debounce/index.js +1 -1
- package/hooks/use-debounce/interface.d.ts +14 -0
- package/hooks/use-debounce-effect/index.js +1 -1
- package/hooks/use-debounce-fn/index.js +5 -5
- 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 +7 -7
- package/hooks/use-drag/index.d.ts +1 -1
- package/hooks/use-drag/index.js +10 -10
- package/hooks/use-drag-move/index.js +1 -1
- package/hooks/use-drop/index.d.ts +1 -1
- package/hooks/use-drop/index.js +1 -1
- package/hooks/use-dynamic-list/index.d.ts +18 -0
- package/hooks/use-dynamic-list/index.js +105 -0
- package/hooks/use-effect-event/index.js +1 -1
- package/hooks/use-event/index.js +1 -1
- package/hooks/use-event-emitter/index.d.ts +13 -1
- package/hooks/use-event-emitter/index.js +15 -12
- package/hooks/use-event-listener/index.d.ts +2 -7
- package/hooks/use-event-listener/index.js +1 -1
- package/hooks/use-event-target/index.js +1 -1
- package/hooks/use-external/index.js +2 -2
- package/hooks/use-favicon/index.js +2 -2
- package/hooks/use-focus-within/index.d.ts +1 -5
- package/hooks/use-focus-within/index.js +1 -1
- package/hooks/use-focus-within/interface.d.ts +13 -0
- package/hooks/use-force-update/index.js +1 -1
- package/hooks/use-fullscreen/index.js +14 -14
- package/hooks/use-get-state/index.d.ts +1 -7
- package/hooks/use-get-state/index.js +1 -1
- package/hooks/use-history-travel/index.d.ts +1 -1
- package/hooks/use-history-travel/index.js +32 -26
- package/hooks/use-hover/index.js +1 -1
- package/hooks/use-id/index.js +1 -1
- package/hooks/use-in-viewport/index.js +10 -10
- package/hooks/use-infinite-scroll/index.js +33 -31
- package/hooks/use-intersection-observer/index.js +3 -3
- package/hooks/use-intersection-observers/index.js +10 -10
- 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.d.ts +1 -0
- 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 +4 -4
- 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 +1 -1
- package/hooks/use-memoized-fn/index.js +1 -1
- package/hooks/use-merge-component-props/index.d.ts +2 -2
- package/hooks/use-merge-component-props/index.js +2 -1
- package/hooks/use-merge-value/index.d.ts +1 -1
- package/hooks/use-merge-value/index.js +1 -1
- package/hooks/use-mobile/index.js +1 -1
- package/hooks/use-mount/index.js +1 -1
- package/hooks/use-mouse/index.d.ts +1 -1
- package/hooks/use-mouse/index.js +9 -9
- package/hooks/use-mutation-observer/index.js +2 -2
- package/hooks/use-mutation-observers/index.js +10 -10
- package/hooks/use-network/index.js +1 -1
- package/hooks/use-online-status/index.js +1 -1
- package/hooks/use-overflow-hidden/index.js +1 -1
- package/hooks/use-override-ref/index.d.ts +3 -5
- package/hooks/use-override-ref/index.js +5 -5
- package/hooks/use-pagination/index.js +1 -1
- package/hooks/use-pagination/types.d.ts +5 -8
- package/hooks/use-paste-file/index.js +9 -9
- package/hooks/use-paste-image/index.js +1 -1
- package/hooks/use-persist-callback/index.js +1 -1
- package/hooks/use-prefers-color-scheme-dark/index.js +1 -1
- package/hooks/use-previous/index.js +1 -1
- package/hooks/use-raf-interval/index.js +17 -17
- package/hooks/use-raf-state/index.d.ts +1 -6
- package/hooks/use-raf-state/index.js +1 -1
- package/hooks/use-raf-timeout/index.js +17 -17
- package/hooks/use-reactive/index.js +5 -5
- package/hooks/use-ref-latest/index.js +1 -1
- package/hooks/use-ref-map/index.d.ts +2 -1
- package/hooks/use-ref-map/index.js +1 -1
- package/hooks/use-refs/index.js +1 -1
- package/hooks/use-request/index.js +5 -5
- 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 +5 -5
- package/hooks/use-request/src/plugins/useDebouncePlugin.js +2 -2
- package/hooks/use-request/src/plugins/useLoadingDelayPlugin.js +13 -12
- package/hooks/use-request/src/plugins/usePollingPlugin.js +3 -3
- 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.d.ts +11 -4
- package/hooks/use-request/src/useRequest.js +1 -1
- package/hooks/use-request/src/useRequestImplement.js +18 -18
- package/hooks/use-request/src/utils/cache.js +1 -1
- 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 +3 -3
- 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 +6 -6
- package/hooks/use-resize-observer/index.d.ts +6 -1
- package/hooks/use-resize-observer/index.js +30 -4
- package/hooks/use-resize-observers/index.d.ts +1 -0
- package/hooks/use-resize-observers/index.js +23 -24
- package/hooks/use-responsive/index.js +2 -2
- package/hooks/use-safe-state/index.js +1 -1
- package/hooks/use-scroll/index.js +20 -20
- package/hooks/use-selections/index.d.ts +1 -1
- package/hooks/use-selections/index.js +45 -39
- package/hooks/use-session-storage-state/index.js +4 -4
- package/hooks/use-set/index.js +1 -1
- package/hooks/use-set-state/index.js +1 -1
- package/hooks/use-size/index.d.ts +1 -6
- package/hooks/use-size/index.js +4 -33
- package/hooks/use-state-callback/index.d.ts +1 -5
- package/hooks/use-state-callback/index.js +7 -7
- package/hooks/use-state-with-promise/index.d.ts +1 -4
- package/hooks/use-state-with-promise/index.js +1 -1
- package/hooks/use-sync-state/index.js +5 -5
- package/hooks/use-text-selection/index.js +1 -1
- package/hooks/use-theme/index.js +14 -14
- package/hooks/use-throttle/index.js +1 -1
- package/hooks/use-throttle/interface.d.ts +13 -0
- package/hooks/use-throttle/throttleOptions.d.ts +1 -5
- package/hooks/use-throttle-effect/index.js +5 -5
- package/hooks/use-throttle-fn/index.js +5 -5
- package/hooks/use-throttle-fn-with-raf/index.js +6 -6
- package/hooks/use-timeout/index.js +1 -1
- package/hooks/use-title/index.js +5 -5
- package/hooks/use-toggle/index.d.ts +6 -3
- 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 +1 -1
- 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.d.ts +1 -1
- package/hooks/use-url-state/index.js +1 -1
- package/hooks/use-virtual-list/index.js +13 -13
- package/hooks/use-watch/index.js +1 -1
- package/hooks/use-web-socket/index.js +7 -7
- package/hooks/use-why-did-you-update/index.js +1 -1
- package/hooks/use-window-size/index.js +7 -7
- package/hooks/utils/createEffectWithTarget.js +7 -7
- 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 +4 -4
- package/hooks/utils/useEffectWithTarget.js +1 -1
- package/hooks/utils/useIsomorphicLayoutEffectWithTarget.js +1 -1
- package/hooks/utils/useLayoutEffectWithTarget.js +1 -1
- package/icons/file/File.js +5 -4
- package/icons/file/constants.d.ts +2 -0
- package/icons/file/constants.js +7 -0
- package/icons/file/context.d.ts +0 -1
- package/icons/file/context.js +3 -3
- package/icons/file/index.js +2 -2
- package/icons/file/style/index.js +1 -1
- package/index.d.ts +2 -2
- package/index.js +542 -537
- package/morphicons/core/interpolate.js +1 -1
- package/morphicons/core/normalize.js +57 -57
- package/morphicons/core/parse.d.ts +1 -9
- package/morphicons/core/resample.js +1 -1
- package/morphicons/core/serialize.js +1 -1
- package/morphicons/core/spring.js +1 -1
- package/morphicons/dom/controller.d.ts +3 -3
- package/morphicons/dom/index.js +23 -23
- package/morphicons/element/index.d.ts +1 -1
- package/morphicons/index.d.ts +1 -1
- package/morphicons/index.js +6 -6
- package/morphicons/react/index.d.ts +1 -1
- package/morphicons/react/index.js +65 -65
- package/package.json +1 -1
- package/progress/Progress.js +20 -20
- package/progress/constants.js +1 -1
- package/progress/context.js +1 -1
- package/progress/index.js +1 -1
- package/progress/style/index.js +1 -1
- package/progress/utils.js +1 -1
- package/resize-observer/Collection.js +1 -1
- package/resize-observer/ResizeObserver.js +13 -12
- package/resize-observer/SingleObserver.d.ts +1 -5
- package/resize-observer/SingleObserver.js +4 -4
- package/resize-observer/constants.d.ts +2 -0
- package/resize-observer/constants.js +4 -1
- package/resize-observer/context.d.ts +0 -1
- package/resize-observer/context.js +3 -3
- package/resize-observer/index.d.ts +1 -7
- package/resize-observer/index.js +7 -9
- package/resize-observer/interface.d.ts +18 -0
- package/resize-observer/observerUtil.d.ts +1 -1
- package/resize-observer/observerUtil.js +1 -1
- package/resize-observer/style/index.js +1 -1
- package/resize-observer/utils.js +1 -1
- package/space/Space.d.ts +2 -1
- package/space/Space.js +12 -11
- package/space/SpaceVertical.js +1 -1
- package/space/constants.d.ts +2 -0
- package/space/constants.js +9 -1
- package/space/context.d.ts +0 -1
- package/space/context.js +3 -8
- package/space/index.d.ts +0 -6
- package/space/index.js +8 -10
- package/space/interface.d.ts +1 -0
- package/space/style/index.js +1 -1
- package/space/utils.js +1 -1
- package/style/animation.less +2 -8
- package/style/normalize.less +0 -13
- package/style.css +1 -1
- package/suspense-fallback-test/NeverLoadLazy.d.ts +3 -0
- package/suspense-fallback-test/NeverLoadLazy.js +8 -0
- package/suspense-fallback-test/SuspenseFallbackTest.js +14 -14
- package/suspense-fallback-test/constants.d.ts +2 -0
- package/suspense-fallback-test/constants.js +4 -1
- package/suspense-fallback-test/context.d.ts +0 -2
- package/suspense-fallback-test/context.js +3 -3
- package/suspense-fallback-test/index.d.ts +0 -6
- package/suspense-fallback-test/index.js +5 -9
- package/suspense-fallback-test/style/index.js +1 -1
- package/suspense-fallback-test/utils.js +1 -1
- package/test.js +1 -1
- package/timer/Timer.js +6 -5
- package/timer/constants.d.ts +2 -0
- package/timer/constants.js +4 -1
- package/timer/context.d.ts +0 -1
- package/timer/context.js +3 -3
- package/timer/index.d.ts +0 -6
- package/timer/index.js +5 -9
- package/timer/style/index.js +1 -1
- package/timer/utils.js +1 -1
- package/transition/Transition.d.ts +0 -1
- package/transition/Transition.js +55 -58
- package/transition/TransitionCSS.js +15 -15
- package/transition/TransitionGroup.js +13 -13
- package/transition/TransitionStyle.js +12 -12
- package/transition/constants.d.ts +4 -27
- package/transition/constants.js +37 -41
- package/transition/context.d.ts +2 -3
- package/transition/context.js +4 -5
- package/transition/index.d.ts +0 -7
- package/transition/index.js +15 -16
- package/transition/interface.d.ts +26 -1
- package/transition/interface.js +11 -0
- package/transition/style/index.js +1 -1
- package/transition/utils.d.ts +1 -1
- package/transition/utils.js +1 -1
- package/utils/callbackOriginRef.js +1 -1
- package/utils/confetti.js +1 -1
- package/utils/constants.d.ts +3 -2
- package/utils/constants.js +6 -5
- package/utils/copy.js +1 -1
- package/utils/createRoot.d.ts +1 -6
- package/utils/createRoot.js +11 -11
- package/utils/css.js +1 -1
- package/utils/date.d.ts +1 -1
- package/utils/date.js +1 -1
- package/utils/dayjs.js +1 -1
- package/utils/document.js +1 -1
- package/utils/dom.d.ts +1 -1
- package/utils/dom.js +9 -9
- package/utils/file.js +1 -1
- package/utils/fillNBSP.js +1 -1
- package/utils/getCompatProp.js +1 -1
- package/utils/getElement.js +1 -1
- package/utils/getHighlightText.js +1 -1
- package/utils/getHotkeyHandler.d.ts +1 -12
- package/utils/getHotkeyHandler.js +17 -17
- package/utils/getPrefixCls.js +1 -1
- package/utils/getScrollBarHeight.js +1 -1
- package/utils/getScrollBarSize.js +1 -1
- package/utils/getScrollBarWidth.js +1 -1
- package/utils/getScrollParent.js +1 -1
- package/utils/getStringLength.js +1 -1
- package/utils/getUrlSearchParam.js +1 -1
- package/utils/index.js +274 -273
- package/utils/initAllLineClamp.js +1 -1
- package/utils/injectLineClamp.js +1 -1
- package/utils/interface.d.ts +103 -0
- package/utils/interface.js +4 -0
- package/utils/intersectionObserver.js +1 -1
- package/utils/is.js +1 -1
- package/utils/keyboardCode.js +1 -1
- package/utils/lodash.d.ts +2 -1
- package/utils/lodash.js +19 -18
- package/utils/math.d.ts +1 -1
- package/utils/mergeProps.d.ts +1 -2
- package/utils/mergeProps.js +1 -1
- package/utils/mergedToString.js +1 -1
- package/utils/migrateLegacyProps.d.ts +1 -8
- package/utils/migrateLegacyProps.js +1 -1
- package/utils/mutationObserver.js +1 -1
- package/utils/names.d.ts +1 -8
- package/utils/names.js +1 -1
- package/utils/object.js +1 -1
- package/utils/omit.js +1 -1
- package/utils/pad.js +1 -1
- package/utils/pick.js +1 -1
- package/utils/react19Adapter.js +1 -1
- package/utils/reactNode.js +1 -1
- package/utils/ref.d.ts +2 -1
- package/utils/ref.js +13 -13
- package/utils/resizeObserver.js +1 -1
- package/utils/scrollIntoViewIfNeeded.js +1 -1
- package/utils/scrollTo.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/tinycolor.js +1 -1
- package/utils/toArray.js +1 -1
- package/utils/tunnel.d.ts +2 -12
- package/utils/tunnel.js +1 -1
- package/utils/warning.js +1 -1
- package/version/index.js +8 -8
- /package/{suspense-fallback-test → resize-observer}/style/index.css +0 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
/* 潘启宝 2026-11-
|
|
1
|
+
/* 潘启宝 2026-11-19 14:01:53 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import { useRef as e } from "react";
|
|
4
|
+
import { isFalse as t } from "@unicom-cloud/utils/is";
|
|
4
5
|
// components/common/hooks/use-create/index.ts
|
|
5
|
-
function
|
|
6
|
-
let
|
|
7
|
-
|
|
6
|
+
function n(n) {
|
|
7
|
+
let r = e(!1);
|
|
8
|
+
t(r.current) && (n(), r.current = !0);
|
|
8
9
|
}
|
|
9
|
-
export {
|
|
10
|
+
export { n as default };
|
|
10
11
|
/* 欲穷千里目,更上一层楼 */
|
|
11
12
|
/* 独立思考,明辨是非 */
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
/* 潘启宝 2026-11-
|
|
1
|
+
/* 潘启宝 2026-11-19 14:01:53 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import e from "../utils/depsAreSame.js";
|
|
4
4
|
import { useRef as t } from "react";
|
|
5
|
+
import { isFalse as n } from "@unicom-cloud/utils/is";
|
|
5
6
|
// components/common/hooks/use-creation/index.ts
|
|
6
|
-
var
|
|
7
|
-
let { current:
|
|
8
|
-
deps:
|
|
7
|
+
var r = (r, i) => {
|
|
8
|
+
let { current: a } = t({
|
|
9
|
+
deps: i,
|
|
9
10
|
obj: void 0,
|
|
10
11
|
initialized: !1
|
|
11
12
|
});
|
|
12
|
-
return
|
|
13
|
+
return (n(a.initialized) || !e(a.deps, i)) && (a.deps = i, a.obj = r(), a.initialized = !0), a.obj;
|
|
13
14
|
};
|
|
14
|
-
export {
|
|
15
|
+
export { r as default };
|
|
15
16
|
/* 欲穷千里目,更上一层楼 */
|
|
16
17
|
/* 独立思考,明辨是非 */
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
/* 潘启宝 2026-11-
|
|
1
|
+
/* 潘启宝 2026-11-19 14:01:53 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import e from "../use-latest/index.js";
|
|
4
|
-
import t from "../
|
|
5
|
-
import n from "../
|
|
4
|
+
import t from "../use-unmount/index.js";
|
|
5
|
+
import n from "../utils/isDev.js";
|
|
6
6
|
import { useMemo as r } from "react";
|
|
7
7
|
import { isFunction as i } from "@unicom-cloud/utils/is";
|
|
8
8
|
import a from "lodash/debounce";
|
|
9
9
|
// components/common/hooks/use-debounce-fn/index.ts
|
|
10
10
|
function o(o, s) {
|
|
11
|
-
|
|
11
|
+
n && (i(o) || console.error(`useDebounceFn expected parameter is a function, got ${typeof o}`));
|
|
12
12
|
let c = e(o), l = s?.wait ?? 1e3, u = r(() => a((...e) => c.current(...e), l, s), []);
|
|
13
|
-
return
|
|
13
|
+
return t(() => {
|
|
14
14
|
u.cancel();
|
|
15
15
|
}), {
|
|
16
16
|
run: u,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
/* 潘启宝 2026-11-
|
|
1
|
+
/* 潘启宝 2026-11-19 14:01:53 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
|
-
import e from "../
|
|
4
|
-
import t from "../
|
|
3
|
+
import e from "../use-event-listener/index.js";
|
|
4
|
+
import t from "../utils/isBrowser.js";
|
|
5
5
|
import { useState as n } from "react";
|
|
6
6
|
// components/common/hooks/use-document-visibility/index.ts
|
|
7
|
-
var r = () =>
|
|
7
|
+
var r = () => t ? document.visibilityState : "visible";
|
|
8
8
|
function i() {
|
|
9
|
-
let [
|
|
10
|
-
return
|
|
9
|
+
let [t, i] = n(r);
|
|
10
|
+
return e("visibilitychange", () => {
|
|
11
11
|
i(r());
|
|
12
|
-
}, { target: () => document }),
|
|
12
|
+
}, { target: () => document }), t;
|
|
13
13
|
}
|
|
14
14
|
export { i as default };
|
|
15
15
|
/* 欲穷千里目,更上一层楼 */
|
package/hooks/use-drag/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
/* 潘启宝 2026-11-
|
|
1
|
+
/* 潘启宝 2026-11-19 14:01:53 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import e from "../use-latest/index.js";
|
|
4
|
-
import t from "../
|
|
5
|
-
import n from "../utils/
|
|
6
|
-
import r from "../
|
|
4
|
+
import t from "../use-mount/index.js";
|
|
5
|
+
import n from "../utils/domTarget.js";
|
|
6
|
+
import r from "../utils/useEffectWithTarget.js";
|
|
7
7
|
import { useRef as i } from "react";
|
|
8
8
|
import { isString as a } from "@unicom-cloud/utils/is";
|
|
9
9
|
// components/common/hooks/use-drag/index.ts
|
|
10
10
|
var o = (o, s, c = {}) => {
|
|
11
11
|
let l = e(c), u = e(o), d = i(null), { dragImage: f } = l.current;
|
|
12
|
-
|
|
12
|
+
t(() => {
|
|
13
13
|
if (f?.image) {
|
|
14
14
|
let { image: e } = f;
|
|
15
15
|
if (a(e)) {
|
|
@@ -17,10 +17,10 @@ var o = (o, s, c = {}) => {
|
|
|
17
17
|
t.src = e, d.current = t;
|
|
18
18
|
} else d.current = e;
|
|
19
19
|
}
|
|
20
|
-
}),
|
|
21
|
-
let e =
|
|
20
|
+
}), r(() => {
|
|
21
|
+
let e = n(s);
|
|
22
22
|
if (!e?.addEventListener) return;
|
|
23
|
-
let
|
|
23
|
+
let t = (e) => {
|
|
24
24
|
if (l.current.onDragStart?.(e), e.dataTransfer.setData("custom", JSON.stringify(u.current)), f?.image && d.current) {
|
|
25
25
|
let { offsetX: t = 0, offsetY: n = 0 } = f;
|
|
26
26
|
e.dataTransfer.setDragImage(d.current, t, n);
|
|
@@ -28,8 +28,8 @@ var o = (o, s, c = {}) => {
|
|
|
28
28
|
}, r = (e) => {
|
|
29
29
|
l.current.onDragEnd?.(e);
|
|
30
30
|
};
|
|
31
|
-
return e.setAttribute("draggable", "true"), e.addEventListener("dragstart",
|
|
32
|
-
e.removeEventListener("dragstart",
|
|
31
|
+
return e.setAttribute("draggable", "true"), e.addEventListener("dragstart", t), e.addEventListener("dragend", r), () => {
|
|
32
|
+
e.removeEventListener("dragstart", t), e.removeEventListener("dragend", r);
|
|
33
33
|
};
|
|
34
34
|
}, [], s);
|
|
35
35
|
};
|
package/hooks/use-drop/index.js
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare const useDynamicList: <T>(initialList?: T[]) => {
|
|
2
|
+
list: T[];
|
|
3
|
+
insert: (index: number, item: T) => void;
|
|
4
|
+
merge: (index: number, items: T[]) => void;
|
|
5
|
+
replace: (index: number, item: T) => void;
|
|
6
|
+
remove: (index: number) => void;
|
|
7
|
+
batchRemove: (indexes: number[]) => void;
|
|
8
|
+
getKey: (index: number) => number;
|
|
9
|
+
getIndex: (key: number) => number;
|
|
10
|
+
move: (oldIndex: number, newIndex: number) => void;
|
|
11
|
+
push: (item: T) => void;
|
|
12
|
+
pop: () => void;
|
|
13
|
+
unshift: (item: T) => void;
|
|
14
|
+
shift: () => void;
|
|
15
|
+
sortList: (result: T[]) => T[];
|
|
16
|
+
resetList: (newList: T[]) => void;
|
|
17
|
+
};
|
|
18
|
+
export default useDynamicList;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/* 潘启宝 2026-11-19 14:01:53 星期四 山东省济南市 */
|
|
2
|
+
/* 世界因你而美丽 */
|
|
3
|
+
import e from "../utils/isDev.js";
|
|
4
|
+
import { useCallback as t, useRef as n, useState as r } from "react";
|
|
5
|
+
// components/common/hooks/use-dynamic-list/index.ts
|
|
6
|
+
var i = (i = []) => {
|
|
7
|
+
let a = n(-1), o = n([]), s = t((e) => {
|
|
8
|
+
a.current += 1, o.current.splice(e, 0, a.current);
|
|
9
|
+
}, []), [c, l] = r(() => (i.forEach((e, t) => {
|
|
10
|
+
s(t);
|
|
11
|
+
}), i)), u = t((e) => {
|
|
12
|
+
o.current = [], l(() => (e.forEach((e, t) => {
|
|
13
|
+
s(t);
|
|
14
|
+
}), e));
|
|
15
|
+
}, []), d = t((e, t) => {
|
|
16
|
+
l((n) => {
|
|
17
|
+
let r = [...n];
|
|
18
|
+
return r.splice(e, 0, t), s(e), r;
|
|
19
|
+
});
|
|
20
|
+
}, []), f = t((e) => o.current[e], []), p = t((e) => o.current.findIndex((t) => t === e), []);
|
|
21
|
+
return {
|
|
22
|
+
list: c,
|
|
23
|
+
insert: d,
|
|
24
|
+
merge: t((e, t) => {
|
|
25
|
+
l((n) => {
|
|
26
|
+
let r = [...n];
|
|
27
|
+
return t.forEach((t, n) => {
|
|
28
|
+
s(e + n);
|
|
29
|
+
}), r.splice(e, 0, ...t), r;
|
|
30
|
+
});
|
|
31
|
+
}, []),
|
|
32
|
+
replace: t((e, t) => {
|
|
33
|
+
l((n) => {
|
|
34
|
+
let r = [...n];
|
|
35
|
+
return r[e] = t, r;
|
|
36
|
+
});
|
|
37
|
+
}, []),
|
|
38
|
+
remove: t((e) => {
|
|
39
|
+
l((t) => {
|
|
40
|
+
let n = [...t];
|
|
41
|
+
n.splice(e, 1);
|
|
42
|
+
try {
|
|
43
|
+
o.current.splice(e, 1);
|
|
44
|
+
} catch (e) {
|
|
45
|
+
console.error(e);
|
|
46
|
+
}
|
|
47
|
+
return n;
|
|
48
|
+
});
|
|
49
|
+
}, []),
|
|
50
|
+
batchRemove: t((t) => {
|
|
51
|
+
Array.isArray(t) ? t.length && l((e) => {
|
|
52
|
+
let n = [], r = e.filter((e, r) => {
|
|
53
|
+
let i = !t.includes(r);
|
|
54
|
+
return i && n.push(f(r)), i;
|
|
55
|
+
});
|
|
56
|
+
return o.current = n, r;
|
|
57
|
+
}) : e && console.error(`\`indexes\` parameter of \`batchRemove\` function expected to be an array, but got "${typeof t}".`);
|
|
58
|
+
}, []),
|
|
59
|
+
getKey: f,
|
|
60
|
+
getIndex: p,
|
|
61
|
+
move: t((e, t) => {
|
|
62
|
+
e !== t && l((n) => {
|
|
63
|
+
let r = [...n], i = r.filter((t, n) => n !== e);
|
|
64
|
+
i.splice(t, 0, r[e]);
|
|
65
|
+
try {
|
|
66
|
+
let n = o.current.filter((t, n) => n !== e);
|
|
67
|
+
n.splice(t, 0, o.current[e]), o.current = n;
|
|
68
|
+
} catch (e) {
|
|
69
|
+
console.error(e);
|
|
70
|
+
}
|
|
71
|
+
return i;
|
|
72
|
+
});
|
|
73
|
+
}, []),
|
|
74
|
+
push: t((e) => {
|
|
75
|
+
l((t) => (s(t.length), t.concat([e])));
|
|
76
|
+
}, []),
|
|
77
|
+
pop: t(() => {
|
|
78
|
+
try {
|
|
79
|
+
o.current = o.current.slice(0, o.current.length - 1);
|
|
80
|
+
} catch (e) {
|
|
81
|
+
console.error(e);
|
|
82
|
+
}
|
|
83
|
+
l((e) => e.slice(0, e.length - 1));
|
|
84
|
+
}, []),
|
|
85
|
+
unshift: t((e) => {
|
|
86
|
+
l((t) => (s(0), [e].concat(t)));
|
|
87
|
+
}, []),
|
|
88
|
+
shift: t(() => {
|
|
89
|
+
try {
|
|
90
|
+
o.current = o.current.slice(1, o.current.length);
|
|
91
|
+
} catch (e) {
|
|
92
|
+
console.error(e);
|
|
93
|
+
}
|
|
94
|
+
l((e) => e.slice(1, e.length));
|
|
95
|
+
}, []),
|
|
96
|
+
sortList: t((e) => e.map((e, t) => ({
|
|
97
|
+
key: t,
|
|
98
|
+
item: e
|
|
99
|
+
})).sort((e, t) => p(e.key) - p(t.key)).filter((e) => e.item !== void 0 && e.item !== null).map((e) => e.item), []),
|
|
100
|
+
resetList: u
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
export { i as default };
|
|
104
|
+
/* 欲穷千里目,更上一层楼 */
|
|
105
|
+
/* 独立思考,明辨是非 */
|
package/hooks/use-event/index.js
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
type Subscription<T> = (value: T) => void;
|
|
2
|
+
/**
|
|
3
|
+
* 纯事件发射器 — 只管 emit / subscribe,不包含任何 React Hook
|
|
4
|
+
*/
|
|
2
5
|
export declare class EventEmitter<T> {
|
|
3
6
|
private subscriptions;
|
|
4
7
|
emit: (value: T) => void;
|
|
5
|
-
|
|
8
|
+
/** 订阅事件,返回取消订阅函数 */
|
|
9
|
+
subscribe(callback: Subscription<T>): () => void;
|
|
6
10
|
}
|
|
11
|
+
/** 创建 EventEmitter 实例(组件间共享) */
|
|
7
12
|
declare const useEventEmitter: <T = void>() => EventEmitter<T>;
|
|
13
|
+
/**
|
|
14
|
+
* 在函数组件里订阅 EventEmitter
|
|
15
|
+
* @example
|
|
16
|
+
* const focus$ = useEventEmitter<void>();
|
|
17
|
+
* useEventEmitterSubscription(focus$, () => inputRef.current?.focus());
|
|
18
|
+
*/
|
|
19
|
+
export declare function useEventEmitterSubscription<T>(emitter: EventEmitter<T> | null | undefined, callback: Subscription<T>): void;
|
|
8
20
|
export default useEventEmitter;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 潘启宝 2026-11-
|
|
1
|
+
/* 潘启宝 2026-11-19 14:01:53 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import { useEffect as e, useRef as t } from "react";
|
|
4
4
|
// components/common/hooks/use-event-emitter/index.ts
|
|
@@ -6,22 +6,25 @@ var n = class {
|
|
|
6
6
|
constructor() {
|
|
7
7
|
this.subscriptions = /* @__PURE__ */ new Set(), this.emit = (e) => {
|
|
8
8
|
for (let t of this.subscriptions) t(e);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
return this.subscriptions.add(e), () => {
|
|
16
|
-
this.subscriptions.delete(e);
|
|
17
|
-
};
|
|
18
|
-
}, []);
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
subscribe(e) {
|
|
12
|
+
return this.subscriptions.add(e), () => {
|
|
13
|
+
this.subscriptions.delete(e);
|
|
19
14
|
};
|
|
20
15
|
}
|
|
21
16
|
}, r = () => {
|
|
22
17
|
let e = t(void 0);
|
|
23
18
|
return e.current ||= new n(), e.current;
|
|
24
19
|
};
|
|
25
|
-
|
|
20
|
+
function i(n, r) {
|
|
21
|
+
let i = t(void 0);
|
|
22
|
+
i.current = r, e(() => {
|
|
23
|
+
if (n) return n.subscribe((e) => {
|
|
24
|
+
i.current && i.current(e);
|
|
25
|
+
});
|
|
26
|
+
}, [n]);
|
|
27
|
+
}
|
|
28
|
+
export { n as EventEmitter, r as default, i as useEventEmitterSubscription };
|
|
26
29
|
/* 欲穷千里目,更上一层楼 */
|
|
27
30
|
/* 独立思考,明辨是非 */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BasicTarget } from '../utils/domTarget';
|
|
2
|
-
type noop = (...p:
|
|
2
|
+
type noop = (...p: unknown[]) => void;
|
|
3
3
|
export type Target = BasicTarget<HTMLElement | Element | Window | Document>;
|
|
4
4
|
type TargetType = HTMLElement | Element | Window | Document;
|
|
5
5
|
type Options<T extends TargetType = TargetType> = {
|
|
@@ -9,10 +9,5 @@ type Options<T extends TargetType = TargetType> = {
|
|
|
9
9
|
passive?: boolean;
|
|
10
10
|
enable?: boolean;
|
|
11
11
|
};
|
|
12
|
-
declare function useEventListener
|
|
13
|
-
declare function useEventListener<K extends keyof ElementEventMap>(eventName: K, handler: (ev: ElementEventMap[K]) => void, options?: Options<Element>): void;
|
|
14
|
-
declare function useEventListener<K extends keyof DocumentEventMap>(eventName: K, handler: (ev: DocumentEventMap[K]) => void, options?: Options<Document>): void;
|
|
15
|
-
declare function useEventListener<K extends keyof WindowEventMap>(eventName: K, handler: (ev: WindowEventMap[K]) => void, options?: Options<Window>): void;
|
|
16
|
-
declare function useEventListener(eventName: string | string[], handler: (event: Event) => void, options?: Options<Window>): void;
|
|
17
|
-
declare function useEventListener(eventName: string | string[], handler: noop, options: Options): void;
|
|
12
|
+
declare function useEventListener(eventName: string | string[], handler: noop, options?: Options): void;
|
|
18
13
|
export default useEventListener;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 潘启宝 2026-11-
|
|
1
|
+
/* 潘启宝 2026-11-19 14:01:53 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import { getBody as e, getHead as t } from "../../utils/dom.js";
|
|
4
4
|
import { useEffect as n, useRef as r, useState as i } from "react";
|
|
@@ -41,7 +41,7 @@ var o = {}, s = (t, n = {}) => {
|
|
|
41
41
|
u("unset");
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
|
-
let n = e.replace(/[
|
|
44
|
+
let n = e.replace(/[?#].*$/, "");
|
|
45
45
|
if (t?.type === "css" || !t?.type && /(^css!|\.css$)/.test(n)) {
|
|
46
46
|
let n = c(e, t?.css);
|
|
47
47
|
d.current = n.ref, u(n.status);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 潘启宝 2026-11-
|
|
1
|
+
/* 潘启宝 2026-11-19 14:01:53 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import { useEffect as e } from "react";
|
|
4
4
|
// components/common/hooks/use-favicon/index.ts
|
|
@@ -10,7 +10,7 @@ var t = {
|
|
|
10
10
|
}, n = (n) => {
|
|
11
11
|
e(() => {
|
|
12
12
|
if (!n) return;
|
|
13
|
-
let e = n.split("."), r = e[e.length - 1].toLocaleUpperCase(), i = document.querySelector("link[rel*='icon']") || document.createElement("link");
|
|
13
|
+
let e = n.replace(/[?#].*$/, "").split("."), r = e[e.length - 1].toLocaleUpperCase(), i = document.querySelector("link[rel*='icon']") || document.createElement("link");
|
|
14
14
|
i.type = t[r], i.href = n, i.rel = "shortcut icon", document.getElementsByTagName("head")[0].appendChild(i);
|
|
15
15
|
}, [n]);
|
|
16
16
|
};
|
|
@@ -1,7 +1,3 @@
|
|
|
1
1
|
import type { BasicTarget } from '../utils/domTarget';
|
|
2
|
-
|
|
3
|
-
onFocus?: (e: FocusEvent) => void;
|
|
4
|
-
onBlur?: (e: FocusEvent) => void;
|
|
5
|
-
onChange?: (isFocusWithin: boolean) => void;
|
|
6
|
-
}
|
|
2
|
+
import type { Options } from './interface';
|
|
7
3
|
export default function useFocusWithin(target: BasicTarget, options?: Options): boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useFocusWithin hook 相关类型
|
|
3
|
+
* @en useFocusWithin hook types
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* useFocusWithin 配置选项
|
|
7
|
+
* @en useFocusWithin options
|
|
8
|
+
*/
|
|
9
|
+
export interface Options {
|
|
10
|
+
onFocus?: (e: FocusEvent) => void;
|
|
11
|
+
onBlur?: (e: FocusEvent) => void;
|
|
12
|
+
onChange?: (isFocusWithin: boolean) => void;
|
|
13
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/* 潘启宝 2026-11-
|
|
1
|
+
/* 潘启宝 2026-11-19 14:01:53 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import e from "../use-latest/index.js";
|
|
4
|
-
import t from "../
|
|
5
|
-
import n from "../
|
|
4
|
+
import t from "../use-memoized-fn/index.js";
|
|
5
|
+
import n from "../utils/domTarget.js";
|
|
6
6
|
import { useEffect as r, useRef as i, useState as a } from "react";
|
|
7
7
|
import { isBoolean as o } from "@unicom-cloud/utils/is";
|
|
8
8
|
import s from "@unicom-cloud/utils/screenfull";
|
|
@@ -10,26 +10,26 @@ import s from "@unicom-cloud/utils/screenfull";
|
|
|
10
10
|
var c = (c, l) => {
|
|
11
11
|
let { onExit: u, onEnter: d, pageFullscreen: f = !1 } = l || {}, { className: p = "@unicom-cloud-ui-hooks-page-fullscreen", zIndex: m = 999999 } = o(f) || !f ? {} : f, h = e(u), g = e(d), [_, v] = a(b), y = i(b());
|
|
12
12
|
function b() {
|
|
13
|
-
return s.isEnabled && !!s.element && s.element ===
|
|
13
|
+
return s.isEnabled && !!s.element && s.element === n(c);
|
|
14
14
|
}
|
|
15
15
|
let x = (e) => {
|
|
16
16
|
e ? g.current?.() : h.current?.();
|
|
17
17
|
}, S = (e) => {
|
|
18
|
-
y.current
|
|
18
|
+
y.current === e || (x(e), v(e), y.current = e);
|
|
19
19
|
}, C = () => {
|
|
20
20
|
let e = b();
|
|
21
21
|
S(e);
|
|
22
22
|
}, w = (e) => {
|
|
23
|
-
let
|
|
24
|
-
if (!
|
|
23
|
+
let t = n(c);
|
|
24
|
+
if (!t) return;
|
|
25
25
|
let r = document.getElementById(p);
|
|
26
|
-
e ? (
|
|
26
|
+
e ? (t.classList.add(p), r || (r = document.createElement("style"), r.setAttribute("id", p), r.textContent = `.${p} {
|
|
27
27
|
position: fixed; left: 0; top: 0; right: 0; bottom: 0;
|
|
28
28
|
width: 100% !important; height: 100% !important;
|
|
29
29
|
z-index: ${m};
|
|
30
|
-
}`,
|
|
30
|
+
}`, t.appendChild(r))) : (t.classList.remove(p), r && r.remove()), S(e);
|
|
31
31
|
}, T = () => {
|
|
32
|
-
let e =
|
|
32
|
+
let e = n(c);
|
|
33
33
|
if (e) {
|
|
34
34
|
if (f) w(!0);
|
|
35
35
|
else if (s.isEnabled) try {
|
|
@@ -39,7 +39,7 @@ var c = (c, l) => {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
}, E = () => {
|
|
42
|
-
let e =
|
|
42
|
+
let e = n(c);
|
|
43
43
|
e && (f ? w(!1) : s.isEnabled && s.element === e && s.exit());
|
|
44
44
|
};
|
|
45
45
|
return r(() => {
|
|
@@ -47,9 +47,9 @@ var c = (c, l) => {
|
|
|
47
47
|
s.off("change", C);
|
|
48
48
|
};
|
|
49
49
|
}, []), [_, {
|
|
50
|
-
enterFullscreen:
|
|
51
|
-
exitFullscreen:
|
|
52
|
-
toggleFullscreen:
|
|
50
|
+
enterFullscreen: t(T),
|
|
51
|
+
exitFullscreen: t(E),
|
|
52
|
+
toggleFullscreen: t(() => {
|
|
53
53
|
_ ? E() : T();
|
|
54
54
|
}),
|
|
55
55
|
isEnabled: s.isEnabled
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import { type Dispatch, type SetStateAction } from 'react';
|
|
2
1
|
export type GetStateAction<S> = () => S;
|
|
3
|
-
declare function useGetState<S>(initialState?: S | (
|
|
4
|
-
declare function useGetState<S = undefined>(): [
|
|
5
|
-
S | undefined,
|
|
6
|
-
Dispatch<SetStateAction<S | undefined>>,
|
|
7
|
-
GetStateAction<S | undefined>
|
|
8
|
-
];
|
|
2
|
+
declare function useGetState<S>(initialState?: S): (S | import("react").Dispatch<import("react").SetStateAction<S | undefined>> | undefined)[];
|
|
9
3
|
export default useGetState;
|