@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
package/Development.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import "react/jsx-runtime";
|
|
3
|
+
import "@unicom-cloud/icons/IconFluentFlatHourglassNotDone";
|
|
4
|
+
import "@unicom-cloud/utils/class-name";
|
|
5
|
+
import "@unicom-cloud/utils/constant/ui";
|
|
6
|
+
import "react";
|
|
7
|
+
import { default as f } from "./development/index.js";
|
|
8
|
+
export {
|
|
9
|
+
f as default
|
|
10
|
+
};
|
package/Empty.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import "react/jsx-runtime";
|
|
3
|
+
import "@unicom-cloud/icons/IconUiEmpty";
|
|
4
|
+
import "@unicom-cloud/utils/constant/ui";
|
|
5
|
+
import "react";
|
|
6
|
+
import "./space/index.js";
|
|
7
|
+
import "@unicom-cloud/utils/class-name";
|
|
8
|
+
import "./utils/is.js";
|
|
9
|
+
import "@unicom-cloud/utils/is";
|
|
10
|
+
import { Empty as E, Empty as d } from "./empty/index.js";
|
|
11
|
+
export {
|
|
12
|
+
E as Empty,
|
|
13
|
+
d as default
|
|
14
|
+
};
|
package/Flex.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import "react/jsx-runtime";
|
|
3
|
+
import "@unicom-cloud/utils/constant/ui";
|
|
4
|
+
import "react";
|
|
5
|
+
import "./hooks/use-merge-props/index.js";
|
|
6
|
+
import "@unicom-cloud/utils/class-name";
|
|
7
|
+
import "./utils/is.js";
|
|
8
|
+
import "./flex/interface.js";
|
|
9
|
+
import "@unicom-cloud/utils/is";
|
|
10
|
+
import { FlexVertical as x, default as c } from "./flex/index.js";
|
|
11
|
+
export {
|
|
12
|
+
x as FlexVertical,
|
|
13
|
+
c as default
|
|
14
|
+
};
|
package/Progress.js
ADDED
package/Space.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import "react/jsx-runtime";
|
|
3
|
+
import "@unicom-cloud/utils/constant/ui";
|
|
4
|
+
import "react";
|
|
5
|
+
import "./flex/interface.js";
|
|
6
|
+
import "./hooks/use-merge-props/index.js";
|
|
7
|
+
import "@unicom-cloud/utils/class-name";
|
|
8
|
+
import "./utils/is.js";
|
|
9
|
+
import "./utils/toArray.js";
|
|
10
|
+
import "@unicom-cloud/utils/is";
|
|
11
|
+
import { SpaceVertical as d, default as u } from "./space/index.js";
|
|
12
|
+
export {
|
|
13
|
+
d as SpaceVertical,
|
|
14
|
+
u as default
|
|
15
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { default as o } from "@unicom-cloud/utils/dom-helpers/reflow";
|
|
3
|
+
import "./utils/is.js";
|
|
4
|
+
import { default as n } from "./transition-group/CSSTransition.js";
|
|
5
|
+
import { PqbCSSTransition as p } from "./transition-group/PqbCSSTransition.js";
|
|
6
|
+
import { default as T } from "./transition-group/ReplaceTransition.js";
|
|
7
|
+
import { default as l, modes as I } from "./transition-group/SwitchTransition.js";
|
|
8
|
+
import { ENTERED as f, ENTERING as E, EXITED as u, EXITING as G, UNMOUNTED as g, default as m } from "./transition-group/Transition.js";
|
|
9
|
+
import { default as M, default as C } from "./transition-group/TransitionGroup.js";
|
|
10
|
+
import { default as S } from "./transition-group/TransitionGroupContext.js";
|
|
11
|
+
import { getChildMapping as O, getInitialChildMapping as D, getNextChildMapping as A, mergeChildMappings as _ } from "./transition-group/utils/ChildMapping.js";
|
|
12
|
+
export {
|
|
13
|
+
n as CSSTransition,
|
|
14
|
+
p as PqbCSSTransition,
|
|
15
|
+
T as ReplaceTransition,
|
|
16
|
+
l as SwitchTransition,
|
|
17
|
+
I as SwitchTransitionModes,
|
|
18
|
+
f as TRANSITION_ENTERED,
|
|
19
|
+
E as TRANSITION_ENTERING,
|
|
20
|
+
u as TRANSITION_EXITED,
|
|
21
|
+
G as TRANSITION_EXITING,
|
|
22
|
+
g as TRANSITION_UNMOUNTED,
|
|
23
|
+
m as Transition,
|
|
24
|
+
M as TransitionGroup,
|
|
25
|
+
S as TransitionGroupContext,
|
|
26
|
+
o as TransitionGroupForceReflow,
|
|
27
|
+
O as TransitionGroupGetChildMapping,
|
|
28
|
+
D as TransitionGroupGetInitialChildMapping,
|
|
29
|
+
A as TransitionGroupGetNextChildMapping,
|
|
30
|
+
_ as TransitionGroupMergeChildMappings,
|
|
31
|
+
C as default
|
|
32
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { jsx as o, jsxs as u } from "react/jsx-runtime";
|
|
3
|
+
import C from "@unicom-cloud/icons/IconFluentFlatHourglassNotDone";
|
|
4
|
+
import s from "@unicom-cloud/utils/class-name";
|
|
5
|
+
import { UI_COMMON_PREFIX as v } from "@unicom-cloud/utils/constant/ui";
|
|
6
|
+
import { forwardRef as x, useMemo as b } from "react";
|
|
7
|
+
const g = (t, n) => {
|
|
8
|
+
const {
|
|
9
|
+
url: a,
|
|
10
|
+
// 图片地址
|
|
11
|
+
imgClassName: l,
|
|
12
|
+
// 图片自定义类名
|
|
13
|
+
icon: m,
|
|
14
|
+
// 自定义图标
|
|
15
|
+
iconClassName: r,
|
|
16
|
+
// 图标自定义类名
|
|
17
|
+
tip: c,
|
|
18
|
+
// 高优先级提示文字
|
|
19
|
+
label: i = "等待开发",
|
|
20
|
+
// 次要提示文字(默认值)
|
|
21
|
+
labelClassName: p,
|
|
22
|
+
// 文字容器类名
|
|
23
|
+
className: N
|
|
24
|
+
// 外层容器类名
|
|
25
|
+
} = t, e = `${v}-development`, d = b(() => a ? /* @__PURE__ */ o(
|
|
26
|
+
"img",
|
|
27
|
+
{
|
|
28
|
+
className: s(`${e}-img`, l),
|
|
29
|
+
src: a,
|
|
30
|
+
alt: "开发预览图"
|
|
31
|
+
}
|
|
32
|
+
) : m ?? /* @__PURE__ */ o(
|
|
33
|
+
C,
|
|
34
|
+
{
|
|
35
|
+
className: s(`${e}-icon`, r)
|
|
36
|
+
}
|
|
37
|
+
), [a, e, l, m, r]), f = c ?? i;
|
|
38
|
+
return /* @__PURE__ */ u("div", { ref: n, className: s(e, N), children: [
|
|
39
|
+
d,
|
|
40
|
+
/* @__PURE__ */ o("div", { className: s(`${e}-label`, p), children: f })
|
|
41
|
+
] });
|
|
42
|
+
}, D = x(
|
|
43
|
+
g
|
|
44
|
+
);
|
|
45
|
+
D.displayName = "Development";
|
|
46
|
+
export {
|
|
47
|
+
D as default
|
|
48
|
+
};
|
package/empty/index.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { jsxs as $, jsx as i } from "react/jsx-runtime";
|
|
3
|
+
import g from "@unicom-cloud/icons/IconUiEmpty";
|
|
4
|
+
import { UI_COMMON_PREFIX as N } from "@unicom-cloud/utils/constant/ui";
|
|
5
|
+
import { memo as x, forwardRef as u } from "react";
|
|
6
|
+
import C from "../space/index.js";
|
|
7
|
+
import e from "@unicom-cloud/utils/class-name";
|
|
8
|
+
import "../utils/is.js";
|
|
9
|
+
import { isString as E } from "@unicom-cloud/utils/is";
|
|
10
|
+
const I = (n, c) => {
|
|
11
|
+
const {
|
|
12
|
+
style: a,
|
|
13
|
+
className: p,
|
|
14
|
+
description: o = "无数据",
|
|
15
|
+
// 默认描述文本
|
|
16
|
+
icon: m,
|
|
17
|
+
imgSrc: s,
|
|
18
|
+
prefixCls: l,
|
|
19
|
+
...f
|
|
20
|
+
} = n, t = `${N}-empty`, r = l ?? t, d = E(o) ? o : "empty", y = () => s ? /* @__PURE__ */ i(
|
|
21
|
+
"img",
|
|
22
|
+
{
|
|
23
|
+
className: e(`${t}-img`, `${r}-img`),
|
|
24
|
+
alt: d,
|
|
25
|
+
src: s,
|
|
26
|
+
loading: "lazy"
|
|
27
|
+
}
|
|
28
|
+
) : m ? /* @__PURE__ */ i("div", { className: e(`${t}-icon`, `${r}-icon`), children: m }) : /* @__PURE__ */ i(g, { className: e(`${t}-icon`, `${r}-icon`) });
|
|
29
|
+
return /* @__PURE__ */ $(
|
|
30
|
+
C.Vertical,
|
|
31
|
+
{
|
|
32
|
+
ref: c,
|
|
33
|
+
className: e(t, r, p),
|
|
34
|
+
style: a,
|
|
35
|
+
justifyContent: "center",
|
|
36
|
+
alignItems: "center",
|
|
37
|
+
gap: 5,
|
|
38
|
+
...f,
|
|
39
|
+
children: [
|
|
40
|
+
y(),
|
|
41
|
+
/* @__PURE__ */ i("div", { className: e(`${t}-description`, `${r}-description`), children: o })
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}, h = x(
|
|
46
|
+
u(I)
|
|
47
|
+
);
|
|
48
|
+
h.displayName = "Empty";
|
|
49
|
+
export {
|
|
50
|
+
h as Empty,
|
|
51
|
+
h as default
|
|
52
|
+
};
|
package/flex/index.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { jsx as y } from "react/jsx-runtime";
|
|
3
|
+
import { UI_COMMON_PREFIX as O } from "@unicom-cloud/utils/constant/ui";
|
|
4
|
+
import { forwardRef as g } from "react";
|
|
5
|
+
import I from "../hooks/use-merge-props/index.js";
|
|
6
|
+
import M from "@unicom-cloud/utils/class-name";
|
|
7
|
+
import "../utils/is.js";
|
|
8
|
+
import { GAP_SIZE_MAP as d } from "./interface.js";
|
|
9
|
+
import { isBoolean as P, isArray as S, isString as V } from "@unicom-cloud/utils/is";
|
|
10
|
+
function a(e, i, t) {
|
|
11
|
+
if (t === void 0)
|
|
12
|
+
return;
|
|
13
|
+
V(t) && Object.keys(d).includes(t) ? e[i] = d[t] : e[i] = t;
|
|
14
|
+
}
|
|
15
|
+
function _(e = {}, i, t = "gap") {
|
|
16
|
+
return i === void 0 || (S(i) ? (a(e, "rowGap", i[0]), a(e, "columnGap", i[1] ?? i[0])) : a(e, t, i)), e;
|
|
17
|
+
}
|
|
18
|
+
const b = {
|
|
19
|
+
component: "div",
|
|
20
|
+
gap: "small"
|
|
21
|
+
}, c = g((e, i) => {
|
|
22
|
+
const t = I(e, b, {}), {
|
|
23
|
+
className: l,
|
|
24
|
+
style: u,
|
|
25
|
+
flex: j,
|
|
26
|
+
gap: w,
|
|
27
|
+
children: F,
|
|
28
|
+
direction: s,
|
|
29
|
+
justify: f,
|
|
30
|
+
align: p,
|
|
31
|
+
component: C = "div",
|
|
32
|
+
wrap: m,
|
|
33
|
+
rtl: G,
|
|
34
|
+
inline: x,
|
|
35
|
+
...N
|
|
36
|
+
} = t, o = `${O}-flex`, n = {
|
|
37
|
+
display: x ? "inline-flex" : "flex"
|
|
38
|
+
};
|
|
39
|
+
if ("wrap" in t) {
|
|
40
|
+
let r = m;
|
|
41
|
+
P(r) ? r = r ? "wrap" : "nowrap" : r = m, n.flexWrap = r;
|
|
42
|
+
}
|
|
43
|
+
return "flex" in t && (n.flex = j), p && (n.alignItems = p), f && (n.justifyContent = f), s && (n.flexDirection = s), Object.assign(n, _({}, w), u), /* @__PURE__ */ y(
|
|
44
|
+
C,
|
|
45
|
+
{
|
|
46
|
+
ref: i,
|
|
47
|
+
style: n,
|
|
48
|
+
className: M(
|
|
49
|
+
o,
|
|
50
|
+
{
|
|
51
|
+
[`${o}-rtl`]: G,
|
|
52
|
+
[`${o}-inline`]: x
|
|
53
|
+
},
|
|
54
|
+
!!s && `${o}-flex-direction-${s}`,
|
|
55
|
+
!!f && `${o}-justify-content-${f}`,
|
|
56
|
+
!!p && `${o}-align-items-${p}`,
|
|
57
|
+
l
|
|
58
|
+
),
|
|
59
|
+
...N,
|
|
60
|
+
children: F
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
});
|
|
64
|
+
c.displayName = "Flex";
|
|
65
|
+
const $ = g(
|
|
66
|
+
(e, i) => {
|
|
67
|
+
const { direction: t = "column", ...l } = e;
|
|
68
|
+
return /* @__PURE__ */ y(c, { ...l, ref: i, direction: t });
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
$.displayName = "FlexVertical";
|
|
72
|
+
const W = Object.assign(c, {
|
|
73
|
+
Vertical: $
|
|
74
|
+
});
|
|
75
|
+
export {
|
|
76
|
+
$ as FlexVertical,
|
|
77
|
+
W as default
|
|
78
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { jsx as h } from "react/jsx-runtime";
|
|
3
|
+
import P from "@unicom-cloud/icons/IconUiMute";
|
|
4
|
+
import U from "@unicom-cloud/icons/IconUiPauseCircleFill";
|
|
5
|
+
import b from "@unicom-cloud/icons/IconUiPlayCircleFill";
|
|
6
|
+
import N from "@unicom-cloud/icons/IconUiSound";
|
|
7
|
+
import { forwardRef as v, useState as x, useMemo as E, useCallback as c, useImperativeHandle as F, useEffect as M, memo as R } from "react";
|
|
8
|
+
const T = (S) => {
|
|
9
|
+
const d = v((g, C) => {
|
|
10
|
+
const { useButton: I = !0, buttonProps: f = {}, ...s } = g, [l, i] = x(!1), [a, m] = x(
|
|
11
|
+
null
|
|
12
|
+
), e = E(
|
|
13
|
+
() => "speechSynthesis" in window && "SpeechSynthesisUtterance" in window,
|
|
14
|
+
[]
|
|
15
|
+
), o = c(() => {
|
|
16
|
+
e && (window.speechSynthesis.cancel(), i(!1), m(null));
|
|
17
|
+
}, [e]), p = c(() => {
|
|
18
|
+
if (!e) return;
|
|
19
|
+
o();
|
|
20
|
+
const n = s.getText?.() ?? s.text;
|
|
21
|
+
if (!n) return;
|
|
22
|
+
const t = new SpeechSynthesisUtterance(n);
|
|
23
|
+
m(t);
|
|
24
|
+
const r = () => {
|
|
25
|
+
i(!1), m(null);
|
|
26
|
+
};
|
|
27
|
+
t.onstart = () => i(!0), t.onend = r, t.onerror = r, t.onpause = () => i(!1), t.onresume = () => i(!0);
|
|
28
|
+
try {
|
|
29
|
+
window.speechSynthesis.speak(t);
|
|
30
|
+
} catch (y) {
|
|
31
|
+
console.error("Speech synthesis failed:", y), r();
|
|
32
|
+
}
|
|
33
|
+
}, [o, e, s.getText, s.text]), u = c(() => {
|
|
34
|
+
e && a && window.speechSynthesis.pause();
|
|
35
|
+
}, [e, a]), w = c(() => {
|
|
36
|
+
e && a && window.speechSynthesis.resume();
|
|
37
|
+
}, [e, a]), k = c(
|
|
38
|
+
(n) => {
|
|
39
|
+
n.preventDefault(), n.stopPropagation(), l ? u() : p(), f.onClick?.(n);
|
|
40
|
+
},
|
|
41
|
+
[l, u, p, f.onClick]
|
|
42
|
+
);
|
|
43
|
+
if (F(
|
|
44
|
+
C,
|
|
45
|
+
() => ({
|
|
46
|
+
cancel: o,
|
|
47
|
+
speak: p,
|
|
48
|
+
pause: u,
|
|
49
|
+
resume: w
|
|
50
|
+
}),
|
|
51
|
+
[o, p, u, w]
|
|
52
|
+
), M(() => o, [o]), !e)
|
|
53
|
+
return null;
|
|
54
|
+
if (I) {
|
|
55
|
+
const { label: n, text: t, children: r, ...y } = f;
|
|
56
|
+
return /* @__PURE__ */ h(
|
|
57
|
+
S,
|
|
58
|
+
{
|
|
59
|
+
...s,
|
|
60
|
+
type: "text",
|
|
61
|
+
size: "mini",
|
|
62
|
+
icon: l ? /* @__PURE__ */ h(P, {}) : /* @__PURE__ */ h(N, {}),
|
|
63
|
+
...y,
|
|
64
|
+
onClick: k,
|
|
65
|
+
children: n || t || r
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
return /* @__PURE__ */ h(
|
|
70
|
+
l ? U : b,
|
|
71
|
+
{
|
|
72
|
+
...s.iconProps,
|
|
73
|
+
onClick: k,
|
|
74
|
+
style: { cursor: "pointer" }
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
});
|
|
78
|
+
return d.displayName = `WithSpeechSynthesis.${S.displayName || S.name || "SpeechSynthesis"}`, R(d);
|
|
79
|
+
};
|
|
80
|
+
T.displayName = "withSpeechSynthesis";
|
|
81
|
+
export {
|
|
82
|
+
T as default
|
|
83
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import "react/jsx-runtime";
|
|
3
|
+
import "@unicom-cloud/icons/IconUiMute";
|
|
4
|
+
import "@unicom-cloud/icons/IconUiPauseCircleFill";
|
|
5
|
+
import "@unicom-cloud/icons/IconUiPlayCircleFill";
|
|
6
|
+
import "@unicom-cloud/icons/IconUiSound";
|
|
7
|
+
import "react";
|
|
8
|
+
import { default as a } from "./with-speech-synthesis/index.js";
|
|
9
|
+
export {
|
|
10
|
+
a as default
|
|
11
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { useRef as o } from "react";
|
|
3
|
+
import { depsEqual as n } from "../utils/depsEqual.js";
|
|
4
|
+
const i = (c) => (f, r) => {
|
|
5
|
+
const e = o(void 0), t = o(0);
|
|
6
|
+
(r === void 0 || !n(r, e.current)) && (t.current += 1), e.current = r, c(f, [t.current]);
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
i as default
|
|
10
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import c from "react";
|
|
3
|
+
const n = (t) => (r, u) => {
|
|
4
|
+
const e = c.useRef(!1);
|
|
5
|
+
t(() => () => {
|
|
6
|
+
e.current = !1;
|
|
7
|
+
}, []), t(() => {
|
|
8
|
+
if (e.current)
|
|
9
|
+
return r();
|
|
10
|
+
e.current = !0;
|
|
11
|
+
}, u);
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
n as default
|
|
15
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import { useState as O } from "react";
|
|
3
|
+
import "../../utils/is.js";
|
|
4
|
+
import m from "../use-event-listener/index.js";
|
|
5
|
+
import h from "../use-memoized-fn/index.js";
|
|
6
|
+
import C from "../use-update-effect/index.js";
|
|
7
|
+
import { isFunction as S, isUndefined as p } from "@unicom-cloud/utils/is";
|
|
8
|
+
const d = "HOOKS_SYNC_STORAGE_EVENT_NAME";
|
|
9
|
+
function b(E) {
|
|
10
|
+
function g(r, t = {}) {
|
|
11
|
+
let a;
|
|
12
|
+
const {
|
|
13
|
+
listenStorageChange: s = !1,
|
|
14
|
+
onError: i = (e) => {
|
|
15
|
+
console.error(e);
|
|
16
|
+
}
|
|
17
|
+
} = t;
|
|
18
|
+
try {
|
|
19
|
+
a = E();
|
|
20
|
+
} catch (e) {
|
|
21
|
+
i(e);
|
|
22
|
+
}
|
|
23
|
+
const N = (e) => t.serializer ? t.serializer(e) : JSON.stringify(e), V = (e) => t.deserializer ? t.deserializer(e) : JSON.parse(e);
|
|
24
|
+
function o() {
|
|
25
|
+
try {
|
|
26
|
+
const e = a?.getItem(r);
|
|
27
|
+
if (e)
|
|
28
|
+
return V(e);
|
|
29
|
+
} catch (e) {
|
|
30
|
+
i(e);
|
|
31
|
+
}
|
|
32
|
+
return S(t.defaultValue) ? t.defaultValue() : t.defaultValue;
|
|
33
|
+
}
|
|
34
|
+
const [l, u] = O(o);
|
|
35
|
+
C(() => {
|
|
36
|
+
u(o());
|
|
37
|
+
}, [r]);
|
|
38
|
+
const z = (e) => {
|
|
39
|
+
const c = S(e) ? e(l) : e;
|
|
40
|
+
s || u(c);
|
|
41
|
+
try {
|
|
42
|
+
let n;
|
|
43
|
+
const A = a?.getItem(r);
|
|
44
|
+
p(c) ? (n = null, a?.removeItem(r)) : (n = N(c), a?.setItem(r, n)), dispatchEvent(
|
|
45
|
+
// send custom event to communicate within same page
|
|
46
|
+
// importantly this should not be a StorageEvent since those cannot
|
|
47
|
+
// be constructed with a non-built-in storage area
|
|
48
|
+
new CustomEvent(d, {
|
|
49
|
+
detail: {
|
|
50
|
+
key: r,
|
|
51
|
+
newValue: n,
|
|
52
|
+
oldValue: A,
|
|
53
|
+
storageArea: a
|
|
54
|
+
}
|
|
55
|
+
})
|
|
56
|
+
);
|
|
57
|
+
} catch (n) {
|
|
58
|
+
i(n);
|
|
59
|
+
}
|
|
60
|
+
}, f = (e) => {
|
|
61
|
+
e.key !== r || e.storageArea !== a || u(o());
|
|
62
|
+
}, _ = (e) => {
|
|
63
|
+
f(e.detail);
|
|
64
|
+
};
|
|
65
|
+
return m("storage", f, {
|
|
66
|
+
enable: s
|
|
67
|
+
}), m(d, _, {
|
|
68
|
+
enable: s
|
|
69
|
+
}), [
|
|
70
|
+
l,
|
|
71
|
+
h(z)
|
|
72
|
+
];
|
|
73
|
+
}
|
|
74
|
+
return g;
|
|
75
|
+
}
|
|
76
|
+
export {
|
|
77
|
+
d as SYNC_STORAGE_EVENT_NAME,
|
|
78
|
+
b as default
|
|
79
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* 2025-11-14 09:11:19 */
|
|
2
|
+
import "react";
|
|
3
|
+
import "../utils/is.js";
|
|
4
|
+
import "./use-event-listener/index.js";
|
|
5
|
+
import "./use-memoized-fn/index.js";
|
|
6
|
+
import "./use-update-effect/index.js";
|
|
7
|
+
import "@unicom-cloud/utils/is";
|
|
8
|
+
import { SYNC_STORAGE_EVENT_NAME as _, default as e } from "./create-use-storage-state/index.js";
|
|
9
|
+
export {
|
|
10
|
+
_ as SYNC_STORAGE_EVENT_NAME,
|
|
11
|
+
e as default
|
|
12
|
+
};
|