@unicom-cloud/ui-common 0.1.1
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/Development.js +10 -0
- package/Empty.js +14 -0
- package/Flex.js +14 -0
- package/Progress.js +8 -0
- package/Space.js +15 -0
- package/SuspenseFallbackTest.js +7 -0
- package/TransitionGroup.js +32 -0
- package/development/index.js +48 -0
- package/empty/index.js +52 -0
- package/flex/index.js +78 -0
- package/flex/interface.js +10 -0
- package/higher-order/index.js +5 -0
- package/higher-order/with-speech-synthesis/index.js +83 -0
- package/higher-order/withSpeechSynthesis.js +11 -0
- package/hooks/create-deep-compare-effect/index.js +10 -0
- package/hooks/create-update-effect/index.js +15 -0
- package/hooks/create-use-storage-state/index.js +79 -0
- package/hooks/createDeepCompareEffect.js +7 -0
- package/hooks/createUpdateEffect.js +6 -0
- package/hooks/createUseStorageState.js +12 -0
- package/hooks/index.js +197 -0
- package/hooks/use-async-effect/index.js +26 -0
- package/hooks/use-boolean/index.js +15 -0
- package/hooks/use-click-away/index.js +32 -0
- package/hooks/use-computed-state/index.js +12 -0
- package/hooks/use-controllable-value/index.js +27 -0
- package/hooks/use-cookie-state/index.js +21 -0
- package/hooks/use-count-down/index.js +37 -0
- package/hooks/use-counter/index.js +44 -0
- package/hooks/use-create/index.js +9 -0
- package/hooks/use-creation/index.js +14 -0
- package/hooks/use-debounce/index.js +14 -0
- package/hooks/use-debounce-effect/index.js +13 -0
- package/hooks/use-debounce-fn/index.js +31 -0
- package/hooks/use-deep-compare-effect/index.js +7 -0
- package/hooks/use-deep-compare-layout-effect/index.js +7 -0
- package/hooks/use-document-visibility/index.js +20 -0
- package/hooks/use-drag/index.js +47 -0
- package/hooks/use-drop/index.js +60 -0
- package/hooks/use-event-listener/index.js +37 -0
- package/hooks/use-event-target/index.js +21 -0
- package/hooks/use-external/index.js +65 -0
- package/hooks/use-favicon/index.js +18 -0
- package/hooks/use-focus-within/index.js +26 -0
- package/hooks/use-force-update/index.js +5 -0
- package/hooks/use-fullscreen/index.js +75 -0
- package/hooks/use-get-state/index.js +10 -0
- package/hooks/use-history-travel/index.js +79 -0
- package/hooks/use-hover/index.js +26 -0
- package/hooks/use-id/index.js +11 -0
- package/hooks/use-in-view/index.js +32 -0
- package/hooks/use-in-viewport/index.js +34 -0
- package/hooks/use-infinite-scroll/index.js +83 -0
- package/hooks/use-intersection-observer/index.js +25 -0
- package/hooks/use-interval/index.js +17 -0
- package/hooks/use-is-first-render/index.js +10 -0
- package/hooks/use-isomorphic-layout-effect/index.js +7 -0
- package/hooks/use-key-press/index.js +169 -0
- package/hooks/use-keyboard-event/index.js +17 -0
- package/hooks/use-latest/index.js +9 -0
- package/hooks/use-listen-window-resize/index.js +10 -0
- package/hooks/use-local-storage-state/index.js +9 -0
- package/hooks/use-lock-fn/index.js +23 -0
- package/hooks/use-long-press/index.js +59 -0
- package/hooks/use-map/index.js +31 -0
- package/hooks/use-media/index.js +16 -0
- package/hooks/use-memoized-fn/index.js +19 -0
- package/hooks/use-merge-props/index.js +18 -0
- package/hooks/use-merge-value/index.js +21 -0
- package/hooks/use-mount/index.js +13 -0
- package/hooks/use-mouse/index.js +50 -0
- package/hooks/use-mutation-observer/index.js +23 -0
- package/hooks/use-network/index.js +57 -0
- package/hooks/use-online-status/index.js +21 -0
- package/hooks/use-overflow-hidden/index.js +27 -0
- package/hooks/use-override-ref/index.js +15 -0
- package/hooks/use-pagination/index.js +49 -0
- package/hooks/use-persist-callback/index.js +9 -0
- package/hooks/use-prefers-color-scheme-dark/index.js +25 -0
- package/hooks/use-previous/index.js +10 -0
- package/hooks/use-raf-interval/index.js +36 -0
- package/hooks/use-raf-state/index.js +16 -0
- package/hooks/use-raf-timeout/index.js +35 -0
- package/hooks/use-reactive/index.js +38 -0
- package/hooks/use-ref-latest/index.js +5 -0
- package/hooks/use-refs/index.js +11 -0
- package/hooks/use-request/index.js +7 -0
- package/hooks/use-request/src/Fetch.js +93 -0
- package/hooks/use-request/src/plugins/useAutoRunPlugin.js +30 -0
- package/hooks/use-request/src/plugins/useCachePlugin.js +66 -0
- package/hooks/use-request/src/plugins/useDebouncePlugin.js +34 -0
- package/hooks/use-request/src/plugins/useLoadingDelayPlugin.js +28 -0
- package/hooks/use-request/src/plugins/usePollingPlugin.js +37 -0
- package/hooks/use-request/src/plugins/useRefreshOnWindowFocusPlugin.js +29 -0
- package/hooks/use-request/src/plugins/useRetryPlugin.js +28 -0
- package/hooks/use-request/src/plugins/useThrottlePlugin.js +31 -0
- package/hooks/use-request/src/useRequest.js +26 -0
- package/hooks/use-request/src/useRequestImplement.js +54 -0
- package/hooks/use-request/src/utils/cache.js +20 -0
- package/hooks/use-request/src/utils/cachePromise.js +10 -0
- package/hooks/use-request/src/utils/cacheSubscribe.js +11 -0
- package/hooks/use-request/src/utils/isDocumentVisible.js +8 -0
- package/hooks/use-request/src/utils/isOnline.js +8 -0
- package/hooks/use-request/src/utils/limit.js +12 -0
- package/hooks/use-request/src/utils/subscribeFocus.js +19 -0
- package/hooks/use-request/src/utils/subscribeReVisible.js +18 -0
- package/hooks/use-reset-state/index.js +18 -0
- package/hooks/use-resize-observer/index.js +5 -0
- package/hooks/use-responsive/index.js +47 -0
- package/hooks/use-safe-state/index.js +12 -0
- package/hooks/use-scroll/index.js +44 -0
- package/hooks/use-selections/index.js +58 -0
- package/hooks/use-session-storage-state/index.js +9 -0
- package/hooks/use-set/index.js +23 -0
- package/hooks/use-set-state/index.js +17 -0
- package/hooks/use-size/index.js +41 -0
- package/hooks/use-state-callback/index.js +16 -0
- package/hooks/use-state-with-promise/index.js +36 -0
- package/hooks/use-text-selection/index.js +56 -0
- package/hooks/use-theme/index.js +36 -0
- package/hooks/use-throttle/index.js +14 -0
- package/hooks/use-throttle-effect/index.js +13 -0
- package/hooks/use-throttle-fn/index.js +31 -0
- package/hooks/use-timeout/index.js +17 -0
- package/hooks/use-title/index.js +18 -0
- package/hooks/use-toggle/index.js +17 -0
- package/hooks/use-tracked-effect/index.js +12 -0
- package/hooks/use-unmount/index.js +21 -0
- package/hooks/use-unmounted-ref/index.js +11 -0
- package/hooks/use-update/index.js +9 -0
- package/hooks/use-update-effect/index.js +7 -0
- package/hooks/use-update-layout-effect/index.js +7 -0
- package/hooks/use-url-state/index.js +60 -0
- package/hooks/use-virtual-list/index.js +83 -0
- package/hooks/use-watch/index.js +14 -0
- package/hooks/use-web-socket/index.js +74 -0
- package/hooks/use-why-did-you-update/index.js +20 -0
- package/hooks/use-window-size/index.js +40 -0
- package/hooks/useAsyncEffect.js +8 -0
- package/hooks/useBoolean.js +7 -0
- package/hooks/useClickAway.js +11 -0
- package/hooks/useComputedState.js +6 -0
- package/hooks/useControllableValue.js +10 -0
- package/hooks/useCookieState.js +10 -0
- package/hooks/useCountDown.js +10 -0
- package/hooks/useCounter.js +9 -0
- package/hooks/useCreate.js +6 -0
- package/hooks/useCreation.js +7 -0
- package/hooks/useDebounce.js +7 -0
- package/hooks/useDebounceEffect.js +8 -0
- package/hooks/useDebounceFn.js +12 -0
- package/hooks/useDeepCompareEffect.js +7 -0
- package/hooks/useDeepCompareLayoutEffect.js +7 -0
- package/hooks/useDocumentVisibility.js +8 -0
- package/hooks/useDrag.js +12 -0
- package/hooks/useDrop.js +9 -0
- package/hooks/useEventListener.js +10 -0
- package/hooks/useEventTarget.js +9 -0
- package/hooks/useExternal.js +6 -0
- package/hooks/useFavicon.js +6 -0
- package/hooks/useFocusWithin.js +7 -0
- package/hooks/useForceUpdate.js +5 -0
- package/hooks/useFullscreen.js +12 -0
- package/hooks/useGetState.js +7 -0
- package/hooks/useHistoryTravel.js +9 -0
- package/hooks/useHover.js +7 -0
- package/hooks/useId.js +8 -0
- package/hooks/useInView.js +7 -0
- package/hooks/useInViewport.js +10 -0
- package/hooks/useInfiniteScroll.js +13 -0
- package/hooks/useIntersectionObserver.js +10 -0
- package/hooks/useInterval.js +9 -0
- package/hooks/useIsFirstRender.js +6 -0
- package/hooks/useIsomorphicLayoutEffect.js +7 -0
- package/hooks/useKeyPress.js +11 -0
- package/hooks/useKeyboardEvent.js +7 -0
- package/hooks/useLatest.js +6 -0
- package/hooks/useListenWindowResize.js +6 -0
- package/hooks/useLocalStorageState.js +7 -0
- package/hooks/useLockFn.js +6 -0
- package/hooks/useLongPress.js +9 -0
- package/hooks/useMap.js +7 -0
- package/hooks/useMedia.js +6 -0
- package/hooks/useMemoizedFn.js +9 -0
- package/hooks/useMergeProps.js +7 -0
- package/hooks/useMergeValue.js +9 -0
- package/hooks/useMount.js +9 -0
- package/hooks/useMouse.js +8 -0
- package/hooks/useMutationObserver.js +8 -0
- package/hooks/useNetwork.js +8 -0
- package/hooks/useOnlineStatus.js +6 -0
- package/hooks/useOverflowHidden.js +6 -0
- package/hooks/useOverrideRef.js +8 -0
- package/hooks/usePagination.js +9 -0
- package/hooks/usePersistCallback.js +6 -0
- package/hooks/usePrefersColorSchemeDark.js +7 -0
- package/hooks/usePrevious.js +6 -0
- package/hooks/useRafInterval.js +9 -0
- package/hooks/useRafState.js +7 -0
- package/hooks/useRafTimeout.js +9 -0
- package/hooks/useReactive.js +10 -0
- package/hooks/useRefLatest.js +5 -0
- package/hooks/useRefs.js +6 -0
- package/hooks/useRequest.js +7 -0
- package/hooks/useResetState.js +10 -0
- package/hooks/useResizeObserver.js +5 -0
- package/hooks/useResponsive.js +8 -0
- package/hooks/useSafeState.js +7 -0
- package/hooks/useScroll.js +9 -0
- package/hooks/useSelections.js +9 -0
- package/hooks/useSessionStorageState.js +7 -0
- package/hooks/useSet.js +7 -0
- package/hooks/useSetState.js +9 -0
- package/hooks/useSize.js +11 -0
- package/hooks/useStateCallback.js +6 -0
- package/hooks/useStateWithPromise.js +8 -0
- package/hooks/useTextSelection.js +8 -0
- package/hooks/useTheme.js +9 -0
- package/hooks/useThrottle.js +7 -0
- package/hooks/useThrottleEffect.js +8 -0
- package/hooks/useThrottleFn.js +12 -0
- package/hooks/useTimeout.js +9 -0
- package/hooks/useTitle.js +8 -0
- package/hooks/useToggle.js +6 -0
- package/hooks/useTrackedEffect.js +6 -0
- package/hooks/useUnmount.js +10 -0
- package/hooks/useUnmountedRef.js +6 -0
- package/hooks/useUpdate.js +6 -0
- package/hooks/useUpdateEffect.js +7 -0
- package/hooks/useUpdateLayoutEffect.js +7 -0
- package/hooks/useUrlState.js +12 -0
- package/hooks/useVirtualList.js +14 -0
- package/hooks/useWatch.js +9 -0
- package/hooks/useWebSocket.js +10 -0
- package/hooks/useWhyDidYouUpdate.js +6 -0
- package/hooks/useWindowSize.js +10 -0
- package/hooks/utils/createEffectWithTarget.js +23 -0
- package/hooks/utils/depsAreSame.js +12 -0
- package/hooks/utils/depsEqual.js +7 -0
- package/hooks/utils/domTarget.js +16 -0
- package/hooks/utils/getDocumentOrShadow.js +16 -0
- package/hooks/utils/index.js +5 -0
- package/hooks/utils/isAppleDevice.js +6 -0
- package/hooks/utils/isBrowser.js +6 -0
- package/hooks/utils/isDev.js +5 -0
- package/hooks/utils/rect.js +19 -0
- package/hooks/utils/useDeepCompareWithTarget.js +11 -0
- package/hooks/utils/useEffectWithTarget.js +7 -0
- package/hooks/utils/useIsomorphicLayoutEffectWithTarget.js +8 -0
- package/hooks/utils/useLayoutEffectWithTarget.js +7 -0
- package/hooks/utils.js +5 -0
- package/icons/file/index.js +59 -0
- package/icons/file.js +9 -0
- package/index.js +49 -0
- package/package.json +1 -0
- package/progress/index.js +153 -0
- package/space/index.js +77 -0
- package/style/animation.less +21 -0
- package/style/global.less +69 -0
- package/style/index.less +41 -0
- package/style/keyframes.less +48 -0
- package/style/normalize.less +0 -0
- package/style/override.less +0 -0
- package/style/style.less +2 -0
- package/style/variables.css +3 -0
- package/style/variables.less +0 -0
- package/style.css +1 -0
- package/suspense-fallback-test/index.js +17 -0
- package/transition-group/CSSTransition.js +91 -0
- package/transition-group/PqbCSSTransition.js +36 -0
- package/transition-group/ReplaceTransition.js +34 -0
- package/transition-group/SwitchTransition.js +102 -0
- package/transition-group/Transition.js +188 -0
- package/transition-group/TransitionGroup.js +50 -0
- package/transition-group/TransitionGroupContext.js +6 -0
- package/transition-group/index.js +32 -0
- package/transition-group/utils/ChildMapping.js +66 -0
- package/types/development/index.d.ts +8 -0
- package/types/development/interface.d.ts +22 -0
- package/types/empty/index.d.ts +5 -0
- package/types/empty/interface.d.ts +24 -0
- package/types/flex/index.d.ts +8 -0
- package/types/flex/interface.d.ts +73 -0
- package/types/higher-order/index.d.ts +1 -0
- package/types/higher-order/with-speech-synthesis/index.d.ts +7 -0
- package/types/higher-order/with-speech-synthesis/interface.d.ts +13 -0
- package/types/hooks/create-deep-compare-effect/index.d.ts +5 -0
- package/types/hooks/create-update-effect/index.d.ts +4 -0
- package/types/hooks/create-use-storage-state/index.d.ts +11 -0
- package/types/hooks/index.d.ts +97 -0
- package/types/hooks/use-async-effect/index.d.ts +3 -0
- package/types/hooks/use-boolean/index.d.ts +7 -0
- package/types/hooks/use-click-away/index.d.ts +4 -0
- package/types/hooks/use-computed-state/index.d.ts +4 -0
- package/types/hooks/use-controllable-value/index.d.ts +16 -0
- package/types/hooks/use-cookie-state/index.d.ts +7 -0
- package/types/hooks/use-count-down/index.d.ts +17 -0
- package/types/hooks/use-counter/index.d.ts +18 -0
- package/types/hooks/use-create/index.d.ts +2 -0
- package/types/hooks/use-creation/index.d.ts +3 -0
- package/types/hooks/use-debounce/debounceOptions.d.ts +6 -0
- package/types/hooks/use-debounce/index.d.ts +3 -0
- package/types/hooks/use-debounce-effect/index.d.ts +4 -0
- package/types/hooks/use-debounce-fn/index.d.ts +8 -0
- package/types/hooks/use-deep-compare-effect/index.d.ts +3 -0
- package/types/hooks/use-deep-compare-layout-effect/index.d.ts +3 -0
- package/types/hooks/use-document-visibility/index.d.ts +3 -0
- package/types/hooks/use-drag/index.d.ts +13 -0
- package/types/hooks/use-drop/index.d.ts +15 -0
- package/types/hooks/use-event-listener/index.d.ts +17 -0
- package/types/hooks/use-event-target/index.d.ts +14 -0
- package/types/hooks/use-external/index.d.ts +20 -0
- package/types/hooks/use-favicon/index.d.ts +2 -0
- package/types/hooks/use-focus-within/index.d.ts +7 -0
- package/types/hooks/use-force-update/index.d.ts +16 -0
- package/types/hooks/use-fullscreen/index.d.ts +17 -0
- package/types/hooks/use-get-state/index.d.ts +9 -0
- package/types/hooks/use-history-travel/index.d.ts +10 -0
- package/types/hooks/use-hover/index.d.ts +8 -0
- package/types/hooks/use-id/index.d.ts +6 -0
- package/types/hooks/use-in-view/index.d.ts +11 -0
- package/types/hooks/use-in-viewport/index.d.ts +10 -0
- package/types/hooks/use-infinite-scroll/index.d.ts +15 -0
- package/types/hooks/use-infinite-scroll/types.d.ts +32 -0
- package/types/hooks/use-intersection-observer/index.d.ts +7 -0
- package/types/hooks/use-interval/index.d.ts +4 -0
- package/types/hooks/use-is-first-render/index.d.ts +2 -0
- package/types/hooks/use-isomorphic-layout-effect/index.d.ts +3 -0
- package/types/hooks/use-key-press/index.d.ts +14 -0
- package/types/hooks/use-keyboard-event/index.d.ts +8 -0
- package/types/hooks/use-latest/index.d.ts +2 -0
- package/types/hooks/use-listen-window-resize/index.d.ts +16 -0
- package/types/hooks/use-local-storage-state/index.d.ts +2 -0
- package/types/hooks/use-lock-fn/index.d.ts +2 -0
- package/types/hooks/use-long-press/index.d.ts +13 -0
- package/types/hooks/use-map/index.d.ts +8 -0
- package/types/hooks/use-media/index.d.ts +2 -0
- package/types/hooks/use-memoized-fn/index.d.ts +4 -0
- package/types/hooks/use-merge-props/index.d.ts +5 -0
- package/types/hooks/use-merge-value/index.d.ts +6 -0
- package/types/hooks/use-mount/index.d.ts +3 -0
- package/types/hooks/use-mouse/index.d.ts +17 -0
- package/types/hooks/use-mutation-observer/index.d.ts +3 -0
- package/types/hooks/use-network/index.d.ts +12 -0
- package/types/hooks/use-online-status/index.d.ts +2 -0
- package/types/hooks/use-overflow-hidden/index.d.ts +5 -0
- package/types/hooks/use-override-ref/index.d.ts +3 -0
- package/types/hooks/use-pagination/index.d.ts +3 -0
- package/types/hooks/use-pagination/types.d.ts +29 -0
- package/types/hooks/use-persist-callback/index.d.ts +2 -0
- package/types/hooks/use-prefers-color-scheme-dark/index.d.ts +2 -0
- package/types/hooks/use-previous/index.d.ts +3 -0
- package/types/hooks/use-raf-interval/index.d.ts +4 -0
- package/types/hooks/use-raf-state/index.d.ts +7 -0
- package/types/hooks/use-raf-timeout/index.d.ts +2 -0
- package/types/hooks/use-reactive/index.d.ts +2 -0
- package/types/hooks/use-ref-latest/index.d.ts +2 -0
- package/types/hooks/use-refs/index.d.ts +2 -0
- package/types/hooks/use-request/index.d.ts +4 -0
- package/types/hooks/use-request/src/Fetch.d.ts +20 -0
- package/types/hooks/use-request/src/plugins/useAutoRunPlugin.d.ts +3 -0
- package/types/hooks/use-request/src/plugins/useCachePlugin.d.ts +3 -0
- package/types/hooks/use-request/src/plugins/useDebouncePlugin.d.ts +3 -0
- package/types/hooks/use-request/src/plugins/useLoadingDelayPlugin.d.ts +3 -0
- package/types/hooks/use-request/src/plugins/usePollingPlugin.d.ts +3 -0
- package/types/hooks/use-request/src/plugins/useRefreshOnWindowFocusPlugin.d.ts +3 -0
- package/types/hooks/use-request/src/plugins/useRetryPlugin.d.ts +3 -0
- package/types/hooks/use-request/src/plugins/useThrottlePlugin.d.ts +3 -0
- package/types/hooks/use-request/src/types.d.ts +73 -0
- package/types/hooks/use-request/src/useRequest.d.ts +3 -0
- package/types/hooks/use-request/src/useRequestImplement.d.ts +3 -0
- package/types/hooks/use-request/src/utils/cache.d.ts +14 -0
- package/types/hooks/use-request/src/utils/cachePromise.d.ts +4 -0
- package/types/hooks/use-request/src/utils/cacheSubscribe.d.ts +4 -0
- package/types/hooks/use-request/src/utils/isDocumentVisible.d.ts +1 -0
- package/types/hooks/use-request/src/utils/isOnline.d.ts +2 -0
- package/types/hooks/use-request/src/utils/limit.d.ts +1 -0
- package/types/hooks/use-request/src/utils/subscribeFocus.d.ts +3 -0
- package/types/hooks/use-request/src/utils/subscribeReVisible.d.ts +3 -0
- package/types/hooks/use-reset-state/index.d.ts +4 -0
- package/types/hooks/use-resize-observer/index.d.ts +2 -0
- package/types/hooks/use-responsive/index.d.ts +5 -0
- package/types/hooks/use-safe-state/index.d.ts +7 -0
- package/types/hooks/use-scroll/index.d.ts +9 -0
- package/types/hooks/use-selections/index.d.ts +21 -0
- package/types/hooks/use-session-storage-state/index.d.ts +2 -0
- package/types/hooks/use-set/index.d.ts +6 -0
- package/types/hooks/use-set-state/index.d.ts +3 -0
- package/types/hooks/use-size/index.d.ts +7 -0
- package/types/hooks/use-state-callback/index.d.ts +5 -0
- package/types/hooks/use-state-with-promise/index.d.ts +2 -0
- package/types/hooks/use-text-selection/index.d.ts +14 -0
- package/types/hooks/use-theme/index.d.ts +16 -0
- package/types/hooks/use-throttle/index.d.ts +3 -0
- package/types/hooks/use-throttle/throttleOptions.d.ts +5 -0
- package/types/hooks/use-throttle-effect/index.d.ts +4 -0
- package/types/hooks/use-throttle-fn/index.d.ts +8 -0
- package/types/hooks/use-timeout/index.d.ts +2 -0
- package/types/hooks/use-title/index.d.ts +5 -0
- package/types/hooks/use-toggle/index.d.ts +10 -0
- package/types/hooks/use-tracked-effect/index.d.ts +4 -0
- package/types/hooks/use-unmount/index.d.ts +2 -0
- package/types/hooks/use-unmounted-ref/index.d.ts +2 -0
- package/types/hooks/use-update/index.d.ts +2 -0
- package/types/hooks/use-update-effect/index.d.ts +3 -0
- package/types/hooks/use-update-layout-effect/index.d.ts +3 -0
- package/types/hooks/use-url-state/index.d.ts +10 -0
- package/types/hooks/use-virtual-list/index.d.ts +13 -0
- package/types/hooks/use-watch/index.d.ts +3 -0
- package/types/hooks/use-web-socket/index.d.ts +26 -0
- package/types/hooks/use-why-did-you-update/index.d.ts +3 -0
- package/types/hooks/use-window-size/index.d.ts +18 -0
- package/types/hooks/utils/createEffectWithTarget.d.ts +4 -0
- package/types/hooks/utils/depsAreSame.d.ts +3 -0
- package/types/hooks/utils/depsEqual.d.ts +2 -0
- package/types/hooks/utils/domTarget.d.ts +6 -0
- package/types/hooks/utils/getDocumentOrShadow.d.ts +3 -0
- package/types/hooks/utils/index.d.ts +2 -0
- package/types/hooks/utils/isAppleDevice.d.ts +2 -0
- package/types/hooks/utils/isBrowser.d.ts +2 -0
- package/types/hooks/utils/isDev.d.ts +2 -0
- package/types/hooks/utils/rect.d.ts +4 -0
- package/types/hooks/utils/useDeepCompareWithTarget.d.ts +4 -0
- package/types/hooks/utils/useEffectWithTarget.d.ts +2 -0
- package/types/hooks/utils/useIsomorphicLayoutEffectWithTarget.d.ts +2 -0
- package/types/hooks/utils/useLayoutEffectWithTarget.d.ts +2 -0
- package/types/icons/file/index.d.ts +4 -0
- package/types/icons/file/interface.d.ts +20 -0
- package/types/index.d.ts +16 -0
- package/types/progress/index.d.ts +437 -0
- package/types/space/index.d.ts +7 -0
- package/types/space/interface.d.ts +53 -0
- package/types/suspense-fallback-test/index.d.ts +7 -0
- package/types/suspense-fallback-test/interface.d.ts +1 -0
- package/types/transition-group/CSSTransition.d.ts +98 -0
- package/types/transition-group/PqbCSSTransition.d.ts +4 -0
- package/types/transition-group/ReplaceTransition.d.ts +23 -0
- package/types/transition-group/SwitchTransition.d.ts +88 -0
- package/types/transition-group/Transition.d.ts +130 -0
- package/types/transition-group/TransitionGroup.d.ts +31 -0
- package/types/transition-group/TransitionGroupContext.d.ts +3 -0
- package/types/transition-group/index.d.ts +10 -0
- package/types/transition-group/utils/ChildMapping.d.ts +27 -0
- package/types/utils/caseName.d.ts +1 -0
- package/types/utils/className.d.ts +1 -0
- package/types/utils/compute.d.ts +100 -0
- package/types/utils/constant.d.ts +3 -0
- package/types/utils/copy.d.ts +3 -0
- package/types/utils/date.d.ts +1 -0
- package/types/utils/dayjs.d.ts +3 -0
- package/types/utils/dom.d.ts +27 -0
- package/types/utils/emitter.d.ts +1 -0
- package/types/utils/fileToURL.d.ts +1 -0
- package/types/utils/fillNBSP.d.ts +3 -0
- package/types/utils/findScrollParent.d.ts +2 -0
- package/types/utils/getHighlightText.d.ts +7 -0
- package/types/utils/getHotkeyHandler.d.ts +18 -0
- package/types/utils/getStringLength.d.ts +3 -0
- package/types/utils/include.d.ts +3 -0
- package/types/utils/index.d.ts +46 -0
- package/types/utils/intersectionObserver.d.ts +3 -0
- package/types/utils/is.d.ts +10 -0
- package/types/utils/keyboardCode.d.ts +4 -0
- package/types/utils/lodash.d.ts +60 -0
- package/types/utils/math.d.ts +1 -0
- package/types/utils/mergeProps.d.ts +3 -0
- package/types/utils/mergedToString.d.ts +4 -0
- package/types/utils/mutationObserver.d.ts +3 -0
- package/types/utils/omit.d.ts +3 -0
- package/types/utils/pad.d.ts +2 -0
- package/types/utils/pick.d.ts +6 -0
- package/types/utils/pinyin.d.ts +1 -0
- package/types/utils/react19Adapter.d.ts +1 -0
- package/types/utils/reactDOM.d.ts +34 -0
- package/types/utils/resizeObserver.d.ts +3 -0
- package/types/utils/saveAs.d.ts +1 -0
- package/types/utils/screenfull.d.ts +1 -0
- package/types/utils/scrollIntoViewIfNeeded.d.ts +12 -0
- package/types/utils/setDarkTheme.d.ts +4 -0
- package/types/utils/setDir.d.ts +3 -0
- package/types/utils/setPrimaryColor.d.ts +3 -0
- package/types/utils/setTheme.d.ts +3 -0
- package/types/utils/style.d.ts +3 -0
- package/types/utils/supportRef.d.ts +3 -0
- package/types/utils/throttleByRaf.d.ts +6 -0
- package/types/utils/throttleByRaf2.d.ts +6 -0
- package/types/utils/tinycolor.d.ts +2 -0
- package/types/utils/toArray.d.ts +13 -0
- package/types/utils/tree.d.ts +1 -0
- package/types/utils/tween.d.ts +1 -0
- package/types/utils/uuid.d.ts +1 -0
- package/types/utils/validate.d.ts +1 -0
- package/types/utils/warning.d.ts +3 -0
- package/utils/caseName.js +6 -0
- package/utils/className.js +6 -0
- package/utils/compute.js +142 -0
- package/utils/constant.js +10 -0
- package/utils/copy.js +8 -0
- package/utils/date.js +2 -0
- package/utils/dayjs.js +23 -0
- package/utils/dom.js +63 -0
- package/utils/emitter.js +6 -0
- package/utils/fileToURL.js +6 -0
- package/utils/fillNBSP.js +10 -0
- package/utils/findScrollParent.js +18 -0
- package/utils/getHighlightText.js +45 -0
- package/utils/getHotkeyHandler.js +29 -0
- package/utils/getStringLength.js +11 -0
- package/utils/include.js +11 -0
- package/utils/index.js +334 -0
- package/utils/intersectionObserver.js +23 -0
- package/utils/is.js +98 -0
- package/utils/keyboardCode.js +7 -0
- package/utils/lodash.js +121 -0
- package/utils/math.js +10 -0
- package/utils/mergeProps.js +13 -0
- package/utils/mergedToString.js +16 -0
- package/utils/mutationObserver.js +21 -0
- package/utils/omit.js +13 -0
- package/utils/pad.js +19 -0
- package/utils/pick.js +19 -0
- package/utils/pinyin.js +6 -0
- package/utils/react19Adapter.js +4 -0
- package/utils/reactDOM.js +87 -0
- package/utils/resizeObserver.js +33 -0
- package/utils/saveAs.js +6 -0
- package/utils/screenfull.js +6 -0
- package/utils/scrollIntoViewIfNeeded.js +75 -0
- package/utils/setDarkTheme.js +28 -0
- package/utils/setDir.js +14 -0
- package/utils/setPrimaryColor.js +31 -0
- package/utils/setTheme.js +56 -0
- package/utils/style.js +40 -0
- package/utils/supportRef.js +10 -0
- package/utils/throttleByRaf.js +17 -0
- package/utils/throttleByRaf2.js +9 -0
- package/utils/tinycolor.js +7 -0
- package/utils/toArray.js +15 -0
- package/utils/tree.js +14 -0
- package/utils/tween.js +7 -0
- package/utils/uuid.js +6 -0
- package/utils/validate.js +18 -0
- package/utils/warning.js +12 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
const n = {}, t = (s, c) => {
|
|
3
|
+
n[s] && n[s].forEach((i) => i(c));
|
|
4
|
+
}, o = (s, c) => (n[s] || (n[s] = []), n[s].push(c), function() {
|
|
5
|
+
const r = n[s].indexOf(c);
|
|
6
|
+
n[s].splice(r, 1);
|
|
7
|
+
});
|
|
8
|
+
export {
|
|
9
|
+
o as subscribe,
|
|
10
|
+
t as trigger
|
|
11
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import "../../../../utils/is.js";
|
|
3
|
+
import { isBrowser as r } from "@unicom-cloud/utils/constant/platform";
|
|
4
|
+
import { isUndefined as i } from "@unicom-cloud/utils/is";
|
|
5
|
+
const t = () => r && !i(navigator.onLine) ? navigator.onLine : !0;
|
|
6
|
+
export {
|
|
7
|
+
t as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { isBrowser as s } from "@unicom-cloud/utils/constant/platform";
|
|
3
|
+
import t from "./isDocumentVisible.js";
|
|
4
|
+
import r from "./isOnline.js";
|
|
5
|
+
const i = /* @__PURE__ */ new Set();
|
|
6
|
+
function d(e) {
|
|
7
|
+
return i.add(e), function() {
|
|
8
|
+
i.has(e) && i.delete(e);
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
if (s) {
|
|
12
|
+
const e = () => {
|
|
13
|
+
!t() || !r() || i.forEach((n) => n());
|
|
14
|
+
};
|
|
15
|
+
window.addEventListener("visibilitychange", e, !1), window.addEventListener("focus", e, !1);
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
d as default
|
|
19
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { isBrowser as r } from "@unicom-cloud/utils/constant/platform";
|
|
3
|
+
import s from "./isDocumentVisible.js";
|
|
4
|
+
const i = /* @__PURE__ */ new Set();
|
|
5
|
+
function a(e) {
|
|
6
|
+
return i.add(e), function() {
|
|
7
|
+
i.has(e) && i.delete(e);
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
if (r) {
|
|
11
|
+
const e = () => {
|
|
12
|
+
s() && i.forEach((t) => t());
|
|
13
|
+
};
|
|
14
|
+
window.addEventListener("visibilitychange", e, !1);
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
a as default
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { useRef as n, useState as a } from "react";
|
|
3
|
+
import "../../utils/is.js";
|
|
4
|
+
import m from "../use-creation/index.js";
|
|
5
|
+
import u from "../use-memoized-fn/index.js";
|
|
6
|
+
import { isFunction as c } from "@unicom-cloud/utils/is";
|
|
7
|
+
const d = (o) => {
|
|
8
|
+
const t = n(o), e = m(
|
|
9
|
+
() => c(t.current) ? t.current() : t.current,
|
|
10
|
+
[]
|
|
11
|
+
), [s, r] = a(e), i = u(() => {
|
|
12
|
+
r(e);
|
|
13
|
+
});
|
|
14
|
+
return [s, r, i];
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
d as default
|
|
18
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { useState as l, useEffect as a } from "react";
|
|
3
|
+
import { isBrowser as u } from "@unicom-cloud/utils/constant/platform";
|
|
4
|
+
const r = /* @__PURE__ */ new Set();
|
|
5
|
+
let e, c = {
|
|
6
|
+
xs: 0,
|
|
7
|
+
sm: 576,
|
|
8
|
+
md: 768,
|
|
9
|
+
lg: 992,
|
|
10
|
+
xl: 1200
|
|
11
|
+
};
|
|
12
|
+
function f() {
|
|
13
|
+
const t = e;
|
|
14
|
+
if (d(), t !== e)
|
|
15
|
+
for (const n of r)
|
|
16
|
+
n();
|
|
17
|
+
}
|
|
18
|
+
let o = !1;
|
|
19
|
+
function d() {
|
|
20
|
+
const t = window.innerWidth, n = {};
|
|
21
|
+
let s = !1;
|
|
22
|
+
for (const i of Object.keys(c))
|
|
23
|
+
n[i] = t >= c[i], n[i] !== e[i] && (s = !0);
|
|
24
|
+
s && (e = n);
|
|
25
|
+
}
|
|
26
|
+
function m(t) {
|
|
27
|
+
c = t, e && d();
|
|
28
|
+
}
|
|
29
|
+
function p() {
|
|
30
|
+
u && !o && (e = {}, d(), window.addEventListener("resize", f), o = !0);
|
|
31
|
+
const [t, n] = l(e);
|
|
32
|
+
return a(() => {
|
|
33
|
+
if (!u)
|
|
34
|
+
return;
|
|
35
|
+
o || window.addEventListener("resize", f);
|
|
36
|
+
const s = () => {
|
|
37
|
+
n(e);
|
|
38
|
+
};
|
|
39
|
+
return r.add(s), () => {
|
|
40
|
+
r.delete(s), r.size === 0 && (window.removeEventListener("resize", f), o = !1);
|
|
41
|
+
};
|
|
42
|
+
}, []), t;
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
m as configResponsive,
|
|
46
|
+
p as default
|
|
47
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { useState as s, useCallback as a } from "react";
|
|
3
|
+
import f from "../use-unmounted-ref/index.js";
|
|
4
|
+
function S(t) {
|
|
5
|
+
const e = f(), [n, r] = s(t), u = a((o) => {
|
|
6
|
+
e.current || r(o);
|
|
7
|
+
}, []);
|
|
8
|
+
return [n, u];
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
S as default
|
|
12
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import m from "../use-latest/index.js";
|
|
3
|
+
import f from "../use-raf-state/index.js";
|
|
4
|
+
import { getTargetElement as i } from "../utils/domTarget.js";
|
|
5
|
+
import u from "../utils/useEffectWithTarget.js";
|
|
6
|
+
function g(l, n = () => !0) {
|
|
7
|
+
const [r, s] = f(), c = m(n);
|
|
8
|
+
return u(
|
|
9
|
+
() => {
|
|
10
|
+
const e = i(l, document);
|
|
11
|
+
if (!e)
|
|
12
|
+
return;
|
|
13
|
+
const o = () => {
|
|
14
|
+
let t;
|
|
15
|
+
e === document ? document.scrollingElement ? t = {
|
|
16
|
+
left: document.scrollingElement.scrollLeft,
|
|
17
|
+
top: document.scrollingElement.scrollTop
|
|
18
|
+
} : t = {
|
|
19
|
+
left: Math.max(
|
|
20
|
+
window.pageXOffset,
|
|
21
|
+
document.documentElement.scrollLeft,
|
|
22
|
+
document.body.scrollLeft
|
|
23
|
+
),
|
|
24
|
+
top: Math.max(
|
|
25
|
+
window.pageYOffset,
|
|
26
|
+
document.documentElement.scrollTop,
|
|
27
|
+
document.body.scrollTop
|
|
28
|
+
)
|
|
29
|
+
} : t = {
|
|
30
|
+
left: e.scrollLeft,
|
|
31
|
+
top: e.scrollTop
|
|
32
|
+
}, c.current(t) && s(t);
|
|
33
|
+
};
|
|
34
|
+
return o(), e.addEventListener("scroll", o), () => {
|
|
35
|
+
e.removeEventListener("scroll", o);
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
[],
|
|
39
|
+
l
|
|
40
|
+
), r;
|
|
41
|
+
}
|
|
42
|
+
export {
|
|
43
|
+
g as default
|
|
44
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { useState as b, useMemo as S } from "react";
|
|
3
|
+
import "../../utils/is.js";
|
|
4
|
+
import r from "../use-memoized-fn/index.js";
|
|
5
|
+
import { isArray as p, isPlainObject as M, isFunction as j, isString as k } from "@unicom-cloud/utils/is";
|
|
6
|
+
function O(c, n) {
|
|
7
|
+
let u = [], s;
|
|
8
|
+
p(n) ? u = n : M(n) && (u = n?.defaultSelected ?? u, s = n?.itemKey ?? s);
|
|
9
|
+
const t = (e) => j(s) ? s(e) : k(s) && M(e) ? e[s] : e, [f, o] = b(u), l = S(() => {
|
|
10
|
+
const e = /* @__PURE__ */ new Map();
|
|
11
|
+
return p(f) && f.forEach((v) => {
|
|
12
|
+
e.set(t(v), v);
|
|
13
|
+
}), e;
|
|
14
|
+
}, [f]), A = (e) => l.has(t(e)), y = (e) => {
|
|
15
|
+
l.set(t(e), e), o(Array.from(l.values()));
|
|
16
|
+
}, g = (e) => {
|
|
17
|
+
l.delete(t(e)), o(Array.from(l.values()));
|
|
18
|
+
}, m = (e) => {
|
|
19
|
+
A(e) ? g(e) : y(e);
|
|
20
|
+
}, i = () => {
|
|
21
|
+
c.forEach((e) => {
|
|
22
|
+
l.set(t(e), e);
|
|
23
|
+
}), o(Array.from(l.values()));
|
|
24
|
+
}, h = () => {
|
|
25
|
+
c.forEach((e) => {
|
|
26
|
+
l.delete(t(e));
|
|
27
|
+
}), o(Array.from(l.values()));
|
|
28
|
+
}, a = S(
|
|
29
|
+
() => c.every((e) => !l.has(t(e))),
|
|
30
|
+
[c, l]
|
|
31
|
+
), d = S(
|
|
32
|
+
() => c.every((e) => l.has(t(e))) && !a,
|
|
33
|
+
[c, l, a]
|
|
34
|
+
), E = S(
|
|
35
|
+
() => !a && !d,
|
|
36
|
+
[a, d]
|
|
37
|
+
), K = () => d ? h() : i(), F = () => {
|
|
38
|
+
l.clear(), o([]);
|
|
39
|
+
};
|
|
40
|
+
return {
|
|
41
|
+
selected: f,
|
|
42
|
+
noneSelected: a,
|
|
43
|
+
allSelected: d,
|
|
44
|
+
partiallySelected: E,
|
|
45
|
+
setSelected: o,
|
|
46
|
+
isSelected: A,
|
|
47
|
+
select: r(y),
|
|
48
|
+
unSelect: r(g),
|
|
49
|
+
toggle: r(m),
|
|
50
|
+
selectAll: r(i),
|
|
51
|
+
unSelectAll: r(h),
|
|
52
|
+
clearAll: r(F),
|
|
53
|
+
toggleAll: r(K)
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export {
|
|
57
|
+
O as default
|
|
58
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { useState as m } from "react";
|
|
3
|
+
import s from "../use-memoized-fn/index.js";
|
|
4
|
+
function S(a) {
|
|
5
|
+
const n = () => new Set(a), [r, o] = m(n), u = (e) => {
|
|
6
|
+
o((t) => e(new Set(t)));
|
|
7
|
+
}, d = (e) => {
|
|
8
|
+
r.has(e) || u((t) => (t.add(e), t));
|
|
9
|
+
}, c = (e) => {
|
|
10
|
+
r.has(e) && u((t) => (t.delete(e), t));
|
|
11
|
+
}, i = () => o(n());
|
|
12
|
+
return [
|
|
13
|
+
r,
|
|
14
|
+
{
|
|
15
|
+
add: s(d),
|
|
16
|
+
remove: s(c),
|
|
17
|
+
reset: s(i)
|
|
18
|
+
}
|
|
19
|
+
];
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
S as default
|
|
23
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { useState as i } from "react";
|
|
3
|
+
import "../../utils/is.js";
|
|
4
|
+
import u from "../use-memoized-fn/index.js";
|
|
5
|
+
import { isFunction as a } from "@unicom-cloud/utils/is";
|
|
6
|
+
const F = (s) => {
|
|
7
|
+
const [r, n] = i(s), m = u((t) => {
|
|
8
|
+
n((e) => {
|
|
9
|
+
const o = a(t) ? t(e) : t;
|
|
10
|
+
return o ? { ...e, ...o } : e;
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
return [r, m];
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
F as default
|
|
17
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { useRef as a, useEffect as d } from "react";
|
|
3
|
+
import "../../utils/is.js";
|
|
4
|
+
import l from "../use-raf-state/index.js";
|
|
5
|
+
import { getTargetElement as s } from "../utils/domTarget.js";
|
|
6
|
+
import h from "../utils/useIsomorphicLayoutEffectWithTarget.js";
|
|
7
|
+
import { isFunction as p } from "@unicom-cloud/utils/is";
|
|
8
|
+
function S(i, c) {
|
|
9
|
+
const [r, u] = l(() => o(i)), n = a(void 0);
|
|
10
|
+
n.current = c;
|
|
11
|
+
function o(e) {
|
|
12
|
+
const t = s(e);
|
|
13
|
+
return t ? { width: t.clientWidth, height: t.clientHeight } : void 0;
|
|
14
|
+
}
|
|
15
|
+
return h(
|
|
16
|
+
() => {
|
|
17
|
+
const e = s(i);
|
|
18
|
+
if (!e) return;
|
|
19
|
+
const t = new ResizeObserver((f) => {
|
|
20
|
+
f.forEach((m) => {
|
|
21
|
+
u(o(m.target));
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
return t.observe(e), () => {
|
|
25
|
+
t.disconnect();
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
[],
|
|
29
|
+
i
|
|
30
|
+
), d(() => {
|
|
31
|
+
let e;
|
|
32
|
+
return r && p(n.current) && (e = window.requestAnimationFrame(() => {
|
|
33
|
+
n.current(r);
|
|
34
|
+
})), () => {
|
|
35
|
+
e && window.cancelAnimationFrame(e);
|
|
36
|
+
};
|
|
37
|
+
}, [r]), r;
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
S as default
|
|
41
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { useState as n, useRef as r, useCallback as f, useEffect as o } from "react";
|
|
3
|
+
function b(a) {
|
|
4
|
+
const [t, s] = n(a), e = r(null), c = f(
|
|
5
|
+
(u, l) => {
|
|
6
|
+
e.current = l, s(u);
|
|
7
|
+
},
|
|
8
|
+
[]
|
|
9
|
+
);
|
|
10
|
+
return o(() => {
|
|
11
|
+
e.current?.(t);
|
|
12
|
+
}, [t]), [t, c];
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
b as default
|
|
16
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { useState as l, useEffect as a } from "react";
|
|
3
|
+
import "../../utils/is.js";
|
|
4
|
+
import { isFunction as m } from "@unicom-cloud/utils/is";
|
|
5
|
+
function d(n, o) {
|
|
6
|
+
const [t, u] = l({
|
|
7
|
+
value: n,
|
|
8
|
+
resolve: (e) => {
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
return a(() => {
|
|
12
|
+
let e = -1;
|
|
13
|
+
const r = window.requestAnimationFrame(() => {
|
|
14
|
+
o ? e = window.setTimeout(() => {
|
|
15
|
+
t.resolve(t.value);
|
|
16
|
+
}, o) : t.resolve(t.value);
|
|
17
|
+
});
|
|
18
|
+
return () => {
|
|
19
|
+
window.cancelAnimationFrame(r), window.clearTimeout(e);
|
|
20
|
+
};
|
|
21
|
+
}, [t, o]), [
|
|
22
|
+
t.value,
|
|
23
|
+
(e) => new Promise((r, c) => {
|
|
24
|
+
u((s) => {
|
|
25
|
+
let i = e;
|
|
26
|
+
return m(e) && (i = e(s.value)), {
|
|
27
|
+
value: i,
|
|
28
|
+
resolve: r
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
})
|
|
32
|
+
];
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
d as default
|
|
36
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { useState as d, useRef as m } from "react";
|
|
3
|
+
import { getTargetElement as w } from "../utils/domTarget.js";
|
|
4
|
+
import N from "../utils/useEffectWithTarget.js";
|
|
5
|
+
const f = {
|
|
6
|
+
top: NaN,
|
|
7
|
+
left: NaN,
|
|
8
|
+
bottom: NaN,
|
|
9
|
+
right: NaN,
|
|
10
|
+
height: NaN,
|
|
11
|
+
width: NaN
|
|
12
|
+
}, g = {
|
|
13
|
+
text: "",
|
|
14
|
+
...f
|
|
15
|
+
};
|
|
16
|
+
function S(e) {
|
|
17
|
+
if (!e || e.rangeCount < 1)
|
|
18
|
+
return f;
|
|
19
|
+
const n = e.getRangeAt(0), { height: u, width: s, top: i, left: o, right: c, bottom: a } = n.getBoundingClientRect();
|
|
20
|
+
return {
|
|
21
|
+
height: u,
|
|
22
|
+
width: s,
|
|
23
|
+
top: i,
|
|
24
|
+
left: o,
|
|
25
|
+
right: c,
|
|
26
|
+
bottom: a
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function v(e) {
|
|
30
|
+
const [n, u] = d(g), s = m(n), i = m(!1);
|
|
31
|
+
return s.current = n, N(
|
|
32
|
+
() => {
|
|
33
|
+
const o = w(e, document);
|
|
34
|
+
if (!o)
|
|
35
|
+
return;
|
|
36
|
+
const c = () => {
|
|
37
|
+
let t = null, r = "", l = f;
|
|
38
|
+
window.getSelection && (t = window.getSelection(), r = t ? t.toString() : "", r && i.current && (l = S(t), u({ ...n, text: r, ...l })));
|
|
39
|
+
}, a = (t) => {
|
|
40
|
+
if (t.button === 2 || !window.getSelection)
|
|
41
|
+
return;
|
|
42
|
+
s.current.text && u({ ...g }), i.current = !1;
|
|
43
|
+
const r = window.getSelection();
|
|
44
|
+
r && (r.removeAllRanges(), i.current = o.contains(t.target));
|
|
45
|
+
};
|
|
46
|
+
return o.addEventListener("mouseup", c), document.addEventListener("mousedown", a), () => {
|
|
47
|
+
o.removeEventListener("mouseup", c), document.removeEventListener("mousedown", a);
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
[],
|
|
51
|
+
e
|
|
52
|
+
), n;
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
v as default
|
|
56
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { useState as h, useEffect as c } from "react";
|
|
3
|
+
import i from "../use-memoized-fn/index.js";
|
|
4
|
+
import { isBrowser as m } from "@unicom-cloud/utils/constant/platform";
|
|
5
|
+
var d = /* @__PURE__ */ ((e) => (e.LIGHT = "light", e.DARK = "dark", e.SYSTEM = "system", e))(d || {});
|
|
6
|
+
const l = () => {
|
|
7
|
+
const e = m ? window.matchMedia("(prefers-color-scheme: dark)") : void 0, [t, r] = h(() => m && e?.matches ? "dark" : "light");
|
|
8
|
+
return c(() => {
|
|
9
|
+
const o = (s) => {
|
|
10
|
+
s.matches ? r(
|
|
11
|
+
"dark"
|
|
12
|
+
/* DARK */
|
|
13
|
+
) : r(
|
|
14
|
+
"light"
|
|
15
|
+
/* LIGHT */
|
|
16
|
+
);
|
|
17
|
+
};
|
|
18
|
+
return e?.addEventListener("change", o), () => {
|
|
19
|
+
e?.removeEventListener("change", o);
|
|
20
|
+
};
|
|
21
|
+
}, []), t;
|
|
22
|
+
};
|
|
23
|
+
function M(e = {}) {
|
|
24
|
+
const { localStorageKey: t } = e, [r, o] = h(() => t?.length && localStorage.getItem(t) || "system"), s = (n) => {
|
|
25
|
+
o(n), t?.length && localStorage.setItem(t, n);
|
|
26
|
+
}, a = l();
|
|
27
|
+
return {
|
|
28
|
+
theme: r === "system" ? a : r,
|
|
29
|
+
themeMode: r,
|
|
30
|
+
setThemeMode: i(s)
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
d as ThemeMode,
|
|
35
|
+
M as default
|
|
36
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { useState as n, useEffect as f } from "react";
|
|
3
|
+
import u from "../use-throttle-fn/index.js";
|
|
4
|
+
function m(t, e) {
|
|
5
|
+
const [o, r] = n(t), { run: s } = u(() => {
|
|
6
|
+
r(t);
|
|
7
|
+
}, e);
|
|
8
|
+
return f(() => {
|
|
9
|
+
s();
|
|
10
|
+
}, [t]), o;
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
m as default
|
|
14
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { useState as u, useEffect as n } from "react";
|
|
3
|
+
import a from "../use-throttle-fn/index.js";
|
|
4
|
+
import c from "../use-update-effect/index.js";
|
|
5
|
+
function i(t, e, f) {
|
|
6
|
+
const [o, r] = u({}), { run: s } = a(() => {
|
|
7
|
+
r({});
|
|
8
|
+
}, f);
|
|
9
|
+
n(() => s(), e), c(t, [o]);
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
i as default
|
|
13
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import m from "lodash/throttle";
|
|
3
|
+
import { useMemo as u } from "react";
|
|
4
|
+
import "../../utils/is.js";
|
|
5
|
+
import c from "../use-latest/index.js";
|
|
6
|
+
import s from "../use-unmount/index.js";
|
|
7
|
+
import f from "../utils/isDev.js";
|
|
8
|
+
import { isFunction as a } from "@unicom-cloud/utils/is";
|
|
9
|
+
function T(e, r) {
|
|
10
|
+
f && (a(e) || console.error(
|
|
11
|
+
`useThrottleFn expected parameter is a function, got ${typeof e}`
|
|
12
|
+
));
|
|
13
|
+
const o = c(e), n = r?.wait ?? 1e3, t = u(
|
|
14
|
+
() => m(
|
|
15
|
+
(...i) => o.current(...i),
|
|
16
|
+
n,
|
|
17
|
+
r
|
|
18
|
+
),
|
|
19
|
+
[]
|
|
20
|
+
);
|
|
21
|
+
return s(() => {
|
|
22
|
+
t.cancel();
|
|
23
|
+
}), {
|
|
24
|
+
run: t,
|
|
25
|
+
cancel: t.cancel,
|
|
26
|
+
flush: t.flush
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
T as default
|
|
31
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { useRef as m, useCallback as i, useEffect as c } from "react";
|
|
3
|
+
import "../../utils/is.js";
|
|
4
|
+
import n from "../use-memoized-fn/index.js";
|
|
5
|
+
import { isNumber as s } from "@unicom-cloud/utils/is";
|
|
6
|
+
const b = (u, r) => {
|
|
7
|
+
const o = n(u), e = m(null), t = i(() => {
|
|
8
|
+
e.current && clearTimeout(e.current);
|
|
9
|
+
}, []);
|
|
10
|
+
return c(() => {
|
|
11
|
+
if (!(!s(r) || r < 0))
|
|
12
|
+
return e.current = setTimeout(o, r), t;
|
|
13
|
+
}, [r]), t;
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
b as default
|
|
17
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { useRef as n, useEffect as r } from "react";
|
|
3
|
+
import u from "../use-unmount/index.js";
|
|
4
|
+
import { isBrowser as m } from "@unicom-cloud/utils/constant/platform";
|
|
5
|
+
const s = {
|
|
6
|
+
restoreOnUnmount: !1
|
|
7
|
+
};
|
|
8
|
+
function l(t, e = s) {
|
|
9
|
+
const o = n(m ? document.title : "");
|
|
10
|
+
r(() => {
|
|
11
|
+
document.title = t;
|
|
12
|
+
}, [t]), u(() => {
|
|
13
|
+
e.restoreOnUnmount && (document.title = o.current);
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
l as default
|
|
18
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { useState as i, useMemo as r } from "react";
|
|
3
|
+
function R(t = !1, e) {
|
|
4
|
+
const [c, s] = i(t), g = r(() => {
|
|
5
|
+
const n = e === void 0 ? !t : e;
|
|
6
|
+
return {
|
|
7
|
+
toggle: () => s((o) => o === t ? n : t),
|
|
8
|
+
set: (o) => s(o),
|
|
9
|
+
setLeft: () => s(t),
|
|
10
|
+
setRight: () => s(n)
|
|
11
|
+
};
|
|
12
|
+
}, []);
|
|
13
|
+
return [c, g];
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
R as default
|
|
17
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { useRef as f, useEffect as n } from "react";
|
|
3
|
+
const u = (c, r) => c ? c.map((t, e) => Object.is(c[e], r?.[e]) ? -1 : e).filter((t) => t >= 0) : r ? r.map((t, e) => e) : [], a = (c, r) => {
|
|
4
|
+
const t = f(void 0);
|
|
5
|
+
n(() => {
|
|
6
|
+
const e = u(t.current, r), o = t.current;
|
|
7
|
+
return t.current = r, c(e, o, r);
|
|
8
|
+
}, r);
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
a as default
|
|
12
|
+
};
|