@unicom-cloud/ui-common 0.1.57 → 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 +13 -12
- 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 +72 -71
- 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 +68 -67
- 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 -64
- 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 +10 -9
- /package/{base → resize-observer}/style/index.css +0 -0
|
@@ -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;
|
|
@@ -2,7 +2,7 @@ export default function useHistoryTravel<T>(initialValue?: T, maxLength?: number
|
|
|
2
2
|
value: T | undefined;
|
|
3
3
|
backLength: number;
|
|
4
4
|
forwardLength: number;
|
|
5
|
-
setValue: (
|
|
5
|
+
setValue: (val: T) => void;
|
|
6
6
|
go: (step: number) => void;
|
|
7
7
|
back: () => void;
|
|
8
8
|
forward: () => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 潘启宝 2026-11-
|
|
1
|
+
/* 潘启宝 2026-11-19 14:01:53 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import e from "../use-memoized-fn/index.js";
|
|
4
4
|
import { useRef as t, useState as n } from "react";
|
|
@@ -28,35 +28,41 @@ function o(i, o = 0) {
|
|
|
28
28
|
past: []
|
|
29
29
|
});
|
|
30
30
|
}, m = (e) => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
c((t) => {
|
|
32
|
+
let n = [...t.past, t.present], i = r(o) ? o : Number(o);
|
|
33
|
+
return i > 0 && n.length > i && n.splice(0, 1), {
|
|
34
|
+
present: e,
|
|
35
|
+
future: [],
|
|
36
|
+
past: n
|
|
37
|
+
};
|
|
36
38
|
});
|
|
37
39
|
}, h = (e = 1) => {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
40
|
+
c((t) => {
|
|
41
|
+
if (t.future.length === 0) return t;
|
|
42
|
+
let { _before: n, _current: r, _after: i } = a(e, t.future);
|
|
43
|
+
return {
|
|
44
|
+
past: [
|
|
45
|
+
...t.past,
|
|
46
|
+
t.present,
|
|
47
|
+
...n
|
|
48
|
+
],
|
|
49
|
+
present: r,
|
|
50
|
+
future: i
|
|
51
|
+
};
|
|
48
52
|
});
|
|
49
53
|
}, g = (e = -1) => {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
54
|
+
c((t) => {
|
|
55
|
+
if (t.past.length === 0) return t;
|
|
56
|
+
let { _before: n, _current: r, _after: i } = a(e, t.past);
|
|
57
|
+
return {
|
|
58
|
+
past: n,
|
|
59
|
+
present: r,
|
|
60
|
+
future: [
|
|
61
|
+
...i,
|
|
62
|
+
t.present,
|
|
63
|
+
...t.future
|
|
64
|
+
]
|
|
65
|
+
};
|
|
60
66
|
});
|
|
61
67
|
}, _ = (e) => {
|
|
62
68
|
let t = r(e) ? e : Number(e);
|
package/hooks/use-hover/index.js
CHANGED
package/hooks/use-id/index.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
/* 潘启宝 2026-11-
|
|
1
|
+
/* 潘启宝 2026-11-19 14:01:53 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
|
-
import e from "../
|
|
4
|
-
import t from "../utils/
|
|
5
|
-
import
|
|
3
|
+
import { supportIntersectionObserver as e } from "../use-intersection-observer/index.js";
|
|
4
|
+
import t from "../utils/domTarget.js";
|
|
5
|
+
import n from "../utils/useEffectWithTarget.js";
|
|
6
6
|
import { useState as r } from "react";
|
|
7
7
|
import { isArrayAndNotEmpty as i, isExist as a } from "@unicom-cloud/utils/is";
|
|
8
8
|
import o from "lodash/castArray";
|
|
9
9
|
// components/common/hooks/use-in-viewport/index.ts
|
|
10
10
|
function s(s, c) {
|
|
11
|
-
let { flag: l = !0, defaultInView: u, callback: d, ...f } = c || {}, [p, m] = r(!
|
|
12
|
-
return
|
|
11
|
+
let { flag: l = !0, defaultInView: u, callback: d, ...f } = c || {}, [p, m] = r(!e || !!u), [h, g] = r();
|
|
12
|
+
return n(() => {
|
|
13
13
|
if (!l) return;
|
|
14
|
-
let
|
|
15
|
-
if (!i(
|
|
14
|
+
let e = o(s).map((e) => t(e)).filter(a);
|
|
15
|
+
if (!i(e)) return;
|
|
16
16
|
let n = new IntersectionObserver((e) => {
|
|
17
17
|
for (let t of e) g(t.intersectionRatio), m(t.isIntersecting), d?.(t);
|
|
18
18
|
}, {
|
|
19
19
|
...f,
|
|
20
|
-
root:
|
|
20
|
+
root: t(c?.root)
|
|
21
21
|
});
|
|
22
|
-
return
|
|
22
|
+
return e.forEach((e, t, r) => n.observe(e)), () => {
|
|
23
23
|
n.disconnect();
|
|
24
24
|
};
|
|
25
25
|
}, [
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
/* 潘启宝 2026-11-
|
|
1
|
+
/* 潘启宝 2026-11-19 14:01:53 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
|
-
import e from "
|
|
4
|
-
import t from "../use-
|
|
5
|
-
import n from "../use-
|
|
6
|
-
import r from "../use-
|
|
7
|
-
import
|
|
8
|
-
import a from "../
|
|
3
|
+
import { getDocumentElement as e } from "../../utils/dom.js";
|
|
4
|
+
import t from "../use-event-listener/index.js";
|
|
5
|
+
import n from "../use-memoized-fn/index.js";
|
|
6
|
+
import r from "../use-request/index.js";
|
|
7
|
+
import i from "../use-update-effect/index.js";
|
|
8
|
+
import a from "../utils/domTarget.js";
|
|
9
9
|
import { getClientHeight as o, getScrollHeight as s, getScrollTop as c } from "../utils/rect.js";
|
|
10
10
|
import l from "../utils/useIsomorphicLayoutEffectWithTarget.js";
|
|
11
11
|
import { useMemo as u, useRef as d, useState as f } from "react";
|
|
12
|
-
import {
|
|
12
|
+
import { isDefined as p } from "@unicom-cloud/utils/is";
|
|
13
13
|
// components/common/hooks/use-infinite-scroll/index.tsx
|
|
14
14
|
var m = (m, h = {}) => {
|
|
15
|
-
let { target: g, isNoMore: _, threshold: v = 100, direction: y = "bottom", reloadDeps: b = [], manual: x, onBefore: S, onSuccess: C, onError: w, onFinally: T } = h, [E, D] = f(), [O, k] = f(!1), A = y === "top", j = d(void 0), M = d(0), N = d(!1), P = u(() => _ ? _(E) : !1, [E]), { loading: F, error: I, run: L, runAsync: R, cancel: z } =
|
|
15
|
+
let { target: g, isNoMore: _, threshold: v = 100, direction: y = "bottom", reloadDeps: b = [], manual: x, onBefore: S, onSuccess: C, onError: w, onFinally: T } = h, [E, D] = f(), [O, k] = f(!1), A = y === "top", j = d(void 0), M = d(0), N = d(!1), P = u(() => _ ? _(E) : !1, [E]), { loading: F, error: I, run: L, runAsync: R, cancel: z } = r(async (e) => ({
|
|
16
16
|
currentData: await m(e),
|
|
17
17
|
lastData: e
|
|
18
18
|
}), {
|
|
@@ -30,8 +30,8 @@ var m = (m, h = {}) => {
|
|
|
30
30
|
list: [...t.currentData.list ?? []]
|
|
31
31
|
}), N.current = !A && !!t.currentData.list?.length, A && setTimeout(() => {
|
|
32
32
|
requestAnimationFrame(() => {
|
|
33
|
-
let t =
|
|
34
|
-
if (t = t === document ?
|
|
33
|
+
let t = a(g);
|
|
34
|
+
if (t = t === document ? e() : t, t) {
|
|
35
35
|
let e = s(t);
|
|
36
36
|
t.scrollTo(0, e - M.current);
|
|
37
37
|
}
|
|
@@ -39,37 +39,37 @@ var m = (m, h = {}) => {
|
|
|
39
39
|
}), C?.(t.currentData);
|
|
40
40
|
},
|
|
41
41
|
onError: (e) => w?.(e)
|
|
42
|
-
}), B =
|
|
42
|
+
}), B = n(() => {
|
|
43
43
|
P || (k(!0), L(E));
|
|
44
|
-
}), V = async (e) => (await R(e)).currentData, H =
|
|
44
|
+
}), V = async (e) => (await R(e)).currentData, H = n(() => P ? Promise.reject() : (k(!0), V(E))), U = () => (k(!1), L()), W = () => (k(!1), V()), G = n(() => {
|
|
45
45
|
if (F || O) return;
|
|
46
|
-
let t =
|
|
46
|
+
let t = a(g);
|
|
47
47
|
if (!t) return;
|
|
48
|
-
let n = t === document ?
|
|
49
|
-
A ? (
|
|
48
|
+
let n = t === document ? e() : t, r = c(n), i = s(n), l = o(n);
|
|
49
|
+
A ? (p(j.current) && j.current > r && r <= v && B(), j.current = r, M.current = i - r) : i - r <= l + v && B();
|
|
50
50
|
});
|
|
51
|
-
|
|
51
|
+
i(() => {
|
|
52
52
|
!N.current || F || O || (N.current = !1, G());
|
|
53
53
|
}, [
|
|
54
54
|
E,
|
|
55
55
|
F,
|
|
56
56
|
O
|
|
57
|
-
]),
|
|
58
|
-
let K =
|
|
57
|
+
]), t("scroll", G, { target: g });
|
|
58
|
+
let K = n(() => {
|
|
59
59
|
E && G();
|
|
60
60
|
});
|
|
61
61
|
return l(() => {
|
|
62
|
-
let
|
|
63
|
-
if (!
|
|
64
|
-
if (
|
|
65
|
-
let
|
|
66
|
-
let e =
|
|
67
|
-
(e !==
|
|
62
|
+
let e = a(g);
|
|
63
|
+
if (!e) return;
|
|
64
|
+
if (e === document) return window.addEventListener("resize", K), () => window.removeEventListener("resize", K);
|
|
65
|
+
let t = e, n = t.clientWidth, r = t.clientHeight, i = new ResizeObserver(() => {
|
|
66
|
+
let e = t.clientWidth, i = t.clientHeight;
|
|
67
|
+
(e !== n || i !== r) && (n = e, r = i, K());
|
|
68
68
|
});
|
|
69
|
-
return
|
|
70
|
-
|
|
69
|
+
return i.observe(t), () => {
|
|
70
|
+
i.disconnect();
|
|
71
71
|
};
|
|
72
|
-
}, [], g),
|
|
72
|
+
}, [], g), i(() => {
|
|
73
73
|
L();
|
|
74
74
|
}, [...b]), {
|
|
75
75
|
data: E,
|
|
@@ -79,10 +79,12 @@ var m = (m, h = {}) => {
|
|
|
79
79
|
noMore: P,
|
|
80
80
|
loadMore: B,
|
|
81
81
|
loadMoreAsync: H,
|
|
82
|
-
reload:
|
|
83
|
-
reloadAsync:
|
|
82
|
+
reload: n(U),
|
|
83
|
+
reloadAsync: n(W),
|
|
84
84
|
mutate: D,
|
|
85
|
-
cancel:
|
|
85
|
+
cancel: n(() => {
|
|
86
|
+
k(!1), z();
|
|
87
|
+
})
|
|
86
88
|
};
|
|
87
89
|
};
|
|
88
90
|
export { m as default };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/* 潘启宝 2026-11-
|
|
1
|
+
/* 潘启宝 2026-11-19 14:01:53 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import { isServerRendering as e } from "../../utils/is.js";
|
|
4
4
|
import { useRef as t } from "react";
|
|
5
|
-
import {
|
|
5
|
+
import { isDefined as n } from "@unicom-cloud/utils/is";
|
|
6
6
|
// components/common/hooks/use-intersection-observer/index.ts
|
|
7
|
-
var r = !e &&
|
|
7
|
+
var r = !e && n(window?.IntersectionObserver);
|
|
8
8
|
function i(e, n = {}) {
|
|
9
9
|
let i = t(null), a = () => {
|
|
10
10
|
i.current &&= (i.current.disconnect(), null);
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
/* 潘启宝 2026-11-
|
|
1
|
+
/* 潘启宝 2026-11-19 14:01:53 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
|
-
import e from "
|
|
4
|
-
import
|
|
3
|
+
import { noop as e, uniq as t } from "../../utils/lodash.js";
|
|
4
|
+
import n from "../use-latest/index.js";
|
|
5
5
|
import { startTransition as r, useDeferredValue as i, useEffect as a, useState as o } from "react";
|
|
6
6
|
import { isArrayAndNotEmpty as s, isElement as c, isFunction as l } from "@unicom-cloud/utils/is";
|
|
7
7
|
import u from "lodash/throttle";
|
|
8
8
|
// components/common/hooks/use-intersection-observers/index.ts
|
|
9
9
|
function d(d, f = [], p = {}) {
|
|
10
|
-
let { immediate: m, shouldReturn: h = !1, ...g } = p, [_, v] = o(), y = i(_), b =
|
|
10
|
+
let { immediate: m, shouldReturn: h = !1, ...g } = p, [_, v] = o(), y = i(_), b = n(d);
|
|
11
11
|
if (a(() => {
|
|
12
|
-
let
|
|
12
|
+
let n = u((e, t) => {
|
|
13
13
|
let n = b.current;
|
|
14
14
|
l(n) && n(e, t), h && r(() => {
|
|
15
15
|
v(e);
|
|
16
16
|
});
|
|
17
17
|
}, 227);
|
|
18
|
-
m &&
|
|
19
|
-
let i =
|
|
20
|
-
if (!s(i)) return
|
|
21
|
-
let a = new IntersectionObserver(
|
|
18
|
+
m && n();
|
|
19
|
+
let i = t([].concat(f).filter((e, t, n) => c(e, !0)));
|
|
20
|
+
if (!s(i)) return e;
|
|
21
|
+
let a = new IntersectionObserver(n, { ...g });
|
|
22
22
|
return i.forEach((e, t, n) => {
|
|
23
23
|
a.observe(e);
|
|
24
24
|
}), () => {
|
|
25
25
|
i.forEach((e, t, n) => {
|
|
26
26
|
a.unobserve(e);
|
|
27
|
-
}), a.disconnect(),
|
|
27
|
+
}), a.disconnect(), n.cancel();
|
|
28
28
|
};
|
|
29
29
|
}, [
|
|
30
30
|
...f,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 潘启宝 2026-11-
|
|
1
|
+
/* 潘启宝 2026-11-19 14:01:53 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import { useCallback as e } from "react";
|
|
4
4
|
import { ArrowDown as t, ArrowLeft as n, ArrowRight as r, ArrowUp as i, Enter as a } from "@unicom-cloud/utils/constants/keyboardCode";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/* 潘启宝 2026-11-
|
|
1
|
+
/* 潘启宝 2026-11-19 14:01:53 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
|
-
import e from "../
|
|
4
|
-
import t from "../
|
|
3
|
+
import e from "../create-use-storage-state/index.js";
|
|
4
|
+
import t from "../utils/isBrowser.js";
|
|
5
5
|
// components/common/hooks/use-local-storage-state/index.ts
|
|
6
|
-
var n =
|
|
6
|
+
var n = e(() => t ? localStorage : void 0);
|
|
7
7
|
export { n as default };
|
|
8
8
|
/* 欲穷千里目,更上一层楼 */
|
|
9
9
|
/* 独立思考,明辨是非 */
|
package/hooks/use-map/index.js
CHANGED
package/hooks/use-media/index.js
CHANGED
package/hooks/use-memo/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type
|
|
1
|
+
import type { LegacyPropsType } from '../../utils/interface';
|
|
2
|
+
import { type MergePropsArgsType, type MergePropsArgType } from '../../utils/interface';
|
|
3
3
|
export interface MergePropsOptions {
|
|
4
4
|
_ignoreGlobalProps?: boolean;
|
|
5
5
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
/* 潘启宝 2026-11-
|
|
1
|
+
/* 潘启宝 2026-11-19 14:01:53 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
|
+
import "../../utils/interface.js";
|
|
3
4
|
import { get as e } from "../../utils/lodash.js";
|
|
4
5
|
import t from "../../utils/mergeProps.js";
|
|
5
6
|
import n from "../../utils/migrateLegacyProps.js";
|
package/hooks/use-mount/index.js
CHANGED
package/hooks/use-mouse/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/* 潘启宝 2026-11-
|
|
1
|
+
/* 潘启宝 2026-11-19 14:01:53 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
|
-
import e from "../
|
|
4
|
-
import t from "../use-
|
|
5
|
-
import n from "../
|
|
3
|
+
import e from "../use-event-listener/index.js";
|
|
4
|
+
import t from "../use-raf-state/index.js";
|
|
5
|
+
import n from "../utils/domTarget.js";
|
|
6
6
|
// components/common/hooks/use-mouse/index.ts
|
|
7
7
|
var r = {
|
|
8
8
|
screenX: NaN,
|
|
@@ -18,10 +18,10 @@ var r = {
|
|
|
18
18
|
elementPosX: NaN,
|
|
19
19
|
elementPosY: NaN
|
|
20
20
|
}, i = (i) => {
|
|
21
|
-
let [a, o] =
|
|
22
|
-
return
|
|
23
|
-
let { screenX:
|
|
24
|
-
screenX:
|
|
21
|
+
let [a, o] = t(r);
|
|
22
|
+
return e("mousemove", (e) => {
|
|
23
|
+
let { screenX: t, screenY: r, clientX: a, clientY: s, pageX: c, pageY: l } = e, u = {
|
|
24
|
+
screenX: t,
|
|
25
25
|
screenY: r,
|
|
26
26
|
clientX: a,
|
|
27
27
|
clientY: s,
|
|
@@ -33,7 +33,7 @@ var r = {
|
|
|
33
33
|
elementW: NaN,
|
|
34
34
|
elementPosX: NaN,
|
|
35
35
|
elementPosY: NaN
|
|
36
|
-
}, d =
|
|
36
|
+
}, d = n(i);
|
|
37
37
|
if (d) {
|
|
38
38
|
let { left: e, top: t, width: n, height: r } = d.getBoundingClientRect();
|
|
39
39
|
u.elementPosX = e + window.pageXOffset, u.elementPosY = t + window.pageYOffset, u.elementX = c - u.elementPosX, u.elementY = l - u.elementPosY, u.elementW = n, u.elementH = r;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 潘启宝 2026-11-
|
|
1
|
+
/* 潘启宝 2026-11-19 14:01:53 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import e from "../use-latest/index.js";
|
|
4
4
|
import t from "../utils/domTarget.js";
|
|
@@ -9,7 +9,7 @@ var r = (r, i, a = {}) => {
|
|
|
9
9
|
n(() => {
|
|
10
10
|
let e = t(i);
|
|
11
11
|
if (!e) return;
|
|
12
|
-
let n = new MutationObserver(o.current);
|
|
12
|
+
let n = new MutationObserver((e, t) => o.current.call(t, e, t));
|
|
13
13
|
return n.observe(e, a), () => {
|
|
14
14
|
n?.disconnect?.();
|
|
15
15
|
};
|