@unicom-cloud/ui-common 0.1.6 → 0.1.8
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 +1 -1
- package/Empty.js +1 -1
- package/Flex.js +1 -1
- package/Motion.js +9 -0
- package/Progress.js +1 -1
- package/ResizeObserver.js +10 -0
- package/Space.js +1 -1
- package/SuspenseFallbackTest.js +1 -1
- package/TransitionGroup.js +30 -29
- package/development/index.js +38 -27
- package/empty/index.js +36 -32
- package/flex/index.js +56 -50
- package/flex/interface.js +1 -1
- package/higher-order/index.js +1 -1
- package/higher-order/with-speech-synthesis/index.js +33 -37
- package/higher-order/withSpeechSynthesis.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 +1 -1
- package/hooks/createDeepCompareEffect.js +1 -1
- package/hooks/createUpdateEffect.js +1 -1
- package/hooks/createUseStorageState.js +1 -1
- package/hooks/index.js +181 -173
- package/hooks/use-async-effect/index.js +1 -1
- package/hooks/use-boolean/index.js +1 -1
- package/hooks/use-click-away/index.js +19 -20
- package/hooks/use-computed-state/index.js +1 -1
- package/hooks/use-controllable-value/index.js +5 -5
- package/hooks/use-cookie-state/index.js +1 -1
- package/hooks/use-count-down/index.js +3 -3
- package/hooks/use-counter/index.js +1 -1
- package/hooks/use-create/index.js +1 -1
- package/hooks/use-creation/index.js +1 -1
- package/hooks/use-debounce/index.js +1 -1
- package/hooks/use-debounce-effect/index.js +1 -1
- package/hooks/use-debounce-fn/index.js +1 -1
- package/hooks/use-deep-compare-effect/index.js +1 -1
- package/hooks/use-deep-compare-layout-effect/index.js +1 -1
- package/hooks/use-document-visibility/index.js +1 -1
- package/hooks/use-drag/index.js +10 -10
- package/hooks/use-drop/index.js +1 -1
- package/hooks/use-event/index.js +10 -0
- package/hooks/use-event-listener/index.js +15 -16
- package/hooks/use-event-target/index.js +3 -3
- package/hooks/use-external/index.js +1 -1
- package/hooks/use-favicon/index.js +1 -1
- package/hooks/use-focus-within/index.js +1 -1
- package/hooks/use-force-update/index.js +1 -1
- package/hooks/use-fullscreen/index.js +13 -13
- package/hooks/use-get-state/index.js +6 -6
- package/hooks/use-history-travel/index.js +18 -18
- package/hooks/use-hover/index.js +1 -1
- package/hooks/use-id/index.js +1 -1
- package/hooks/use-in-view/index.js +1 -1
- package/hooks/use-in-viewport/index.js +17 -18
- package/hooks/use-infinite-scroll/index.js +1 -1
- package/hooks/use-intersection-observer/index.js +7 -6
- package/hooks/use-intersection-observers/index.js +34 -26
- package/hooks/use-interval/index.js +7 -7
- 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 +21 -21
- 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 +4 -4
- package/hooks/use-local-storage-state/index.js +1 -1
- package/hooks/use-lock-fn/index.js +1 -1
- package/hooks/use-long-press/index.js +24 -24
- package/hooks/use-map/index.js +1 -1
- package/hooks/use-media/index.js +1 -1
- package/hooks/use-memo/index.js +9 -0
- package/hooks/use-memoized-fn/index.js +1 -1
- package/hooks/use-merge-props/index.js +1 -1
- package/hooks/use-merge-value/index.js +1 -1
- package/hooks/use-mount/index.js +1 -1
- package/hooks/use-mouse/index.js +1 -1
- package/hooks/use-move/index.js +69 -0
- package/hooks/use-mutation-observer/index.js +9 -9
- package/hooks/use-mutation-observers/index.js +33 -25
- 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.js +3 -3
- package/hooks/use-pagination/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 +15 -15
- package/hooks/use-raf-state/index.js +1 -1
- package/hooks/use-raf-timeout/index.js +3 -3
- package/hooks/use-reactive/index.js +7 -7
- package/hooks/use-ref-latest/index.js +1 -1
- package/hooks/use-refs/index.js +4 -4
- package/hooks/use-request/index.js +1 -1
- package/hooks/use-request/src/Fetch.js +1 -1
- package/hooks/use-request/src/plugins/useAutoRunPlugin.js +1 -1
- package/hooks/use-request/src/plugins/useCachePlugin.js +3 -3
- package/hooks/use-request/src/plugins/useDebouncePlugin.js +1 -1
- package/hooks/use-request/src/plugins/useLoadingDelayPlugin.js +8 -8
- package/hooks/use-request/src/plugins/usePollingPlugin.js +13 -13
- package/hooks/use-request/src/plugins/useRefreshOnWindowFocusPlugin.js +3 -3
- package/hooks/use-request/src/plugins/useRetryPlugin.js +5 -5
- package/hooks/use-request/src/plugins/useThrottlePlugin.js +3 -3
- package/hooks/use-request/src/useRequest.js +1 -1
- package/hooks/use-request/src/useRequestImplement.js +7 -7
- 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 +1 -1
- package/hooks/use-request/src/utils/limit.js +1 -1
- package/hooks/use-request/src/utils/subscribeFocus.js +1 -1
- package/hooks/use-request/src/utils/subscribeReVisible.js +1 -1
- package/hooks/use-reset-state/index.js +7 -7
- package/hooks/use-resize-observer/index.js +1 -1
- package/hooks/use-resize-observers/index.js +34 -26
- package/hooks/use-responsive/index.js +1 -1
- package/hooks/use-safe-state/index.js +4 -4
- package/hooks/use-scroll/index.js +1 -1
- package/hooks/use-selections/index.js +1 -1
- package/hooks/use-session-storage-state/index.js +1 -1
- package/hooks/use-set/index.js +1 -1
- package/hooks/use-set-state/index.js +1 -1
- package/hooks/use-size/index.js +20 -23
- package/hooks/use-state-callback/index.js +6 -6
- package/hooks/use-state-with-promise/index.js +1 -1
- package/hooks/use-sync-state/index.js +15 -0
- package/hooks/use-text-selection/index.js +13 -13
- package/hooks/use-theme/index.js +1 -1
- package/hooks/use-throttle/index.js +1 -1
- package/hooks/use-throttle-effect/index.js +1 -1
- package/hooks/use-throttle-fn/index.js +6 -6
- package/hooks/use-timeout/index.js +3 -3
- package/hooks/use-title/index.js +1 -1
- package/hooks/use-toggle/index.js +1 -1
- package/hooks/use-tracked-effect/index.js +1 -1
- package/hooks/use-unmount/index.js +1 -1
- package/hooks/use-unmounted-ref/index.js +4 -4
- 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.js +3 -3
- package/hooks/use-virtual-list/index.js +10 -10
- package/hooks/use-watch/index.js +1 -1
- package/hooks/use-web-socket/index.js +30 -30
- package/hooks/use-why-did-you-update/index.js +1 -1
- package/hooks/use-window-size/index.js +28 -25
- package/hooks/useAsyncEffect.js +1 -1
- package/hooks/useBoolean.js +1 -1
- package/hooks/useClickAway.js +4 -5
- package/hooks/useComputedState.js +1 -1
- package/hooks/useControllableValue.js +1 -1
- package/hooks/useCookieState.js +1 -1
- package/hooks/useCountDown.js +1 -1
- package/hooks/useCounter.js +1 -1
- package/hooks/useCreate.js +1 -1
- package/hooks/useCreation.js +1 -1
- package/hooks/useDebounce.js +1 -1
- package/hooks/useDebounceEffect.js +1 -1
- package/hooks/useDebounceFn.js +1 -1
- package/hooks/useDeepCompareEffect.js +1 -1
- package/hooks/useDeepCompareLayoutEffect.js +1 -1
- package/hooks/useDocumentVisibility.js +1 -1
- package/hooks/useDrag.js +1 -1
- package/hooks/useDrop.js +1 -1
- package/hooks/useEvent.js +7 -0
- package/hooks/useEventListener.js +4 -5
- package/hooks/useEventTarget.js +1 -1
- package/hooks/useExternal.js +1 -1
- package/hooks/useFavicon.js +1 -1
- package/hooks/useFocusWithin.js +1 -1
- package/hooks/useForceUpdate.js +1 -1
- package/hooks/useFullscreen.js +1 -1
- package/hooks/useGetState.js +1 -1
- package/hooks/useHistoryTravel.js +1 -1
- package/hooks/useHover.js +1 -1
- package/hooks/useId.js +1 -1
- package/hooks/useInView.js +1 -1
- package/hooks/useInViewport.js +4 -5
- package/hooks/useInfiniteScroll.js +1 -1
- package/hooks/useIntersectionObserver.js +5 -4
- package/hooks/useIntersectionObservers.js +11 -7
- package/hooks/useInterval.js +1 -1
- package/hooks/useIsFirstRender.js +1 -1
- package/hooks/useIsomorphicLayoutEffect.js +1 -1
- package/hooks/useKeyPress.js +1 -1
- package/hooks/useKeyboardEvent.js +1 -1
- package/hooks/useLatest.js +1 -1
- package/hooks/useListenWindowResize.js +1 -1
- package/hooks/useLocalStorageState.js +1 -1
- package/hooks/useLockFn.js +1 -1
- package/hooks/useLongPress.js +1 -1
- package/hooks/useMap.js +1 -1
- package/hooks/useMedia.js +1 -1
- package/hooks/useMemo.js +6 -0
- package/hooks/useMemoizedFn.js +1 -1
- package/hooks/useMergeProps.js +1 -1
- package/hooks/useMergeValue.js +1 -1
- package/hooks/useMount.js +1 -1
- package/hooks/useMouse.js +1 -1
- package/hooks/useMove.js +10 -0
- package/hooks/useMutationObserver.js +1 -1
- package/hooks/useMutationObservers.js +11 -7
- package/hooks/useNetwork.js +1 -1
- package/hooks/useOnlineStatus.js +1 -1
- package/hooks/useOverflowHidden.js +1 -1
- package/hooks/useOverrideRef.js +3 -3
- package/hooks/usePagination.js +1 -1
- package/hooks/usePersistCallback.js +1 -1
- package/hooks/usePrefersColorSchemeDark.js +1 -1
- package/hooks/usePrevious.js +1 -1
- package/hooks/useRafInterval.js +1 -1
- package/hooks/useRafState.js +1 -1
- package/hooks/useRafTimeout.js +1 -1
- package/hooks/useReactive.js +1 -1
- package/hooks/useRefLatest.js +1 -1
- package/hooks/useRefs.js +1 -1
- package/hooks/useRequest.js +1 -1
- package/hooks/useResetState.js +1 -1
- package/hooks/useResizeObserver.js +1 -1
- package/hooks/useResizeObservers.js +11 -7
- package/hooks/useResponsive.js +1 -1
- package/hooks/useSafeState.js +1 -1
- package/hooks/useScroll.js +1 -1
- package/hooks/useSelections.js +1 -1
- package/hooks/useSessionStorageState.js +1 -1
- package/hooks/useSet.js +1 -1
- package/hooks/useSetState.js +1 -1
- package/hooks/useSize.js +4 -3
- package/hooks/useStateCallback.js +1 -1
- package/hooks/useStateWithPromise.js +1 -1
- package/hooks/useSyncState.js +10 -0
- package/hooks/useTextSelection.js +1 -1
- package/hooks/useTheme.js +1 -1
- package/hooks/useThrottle.js +1 -1
- package/hooks/useThrottleEffect.js +1 -1
- package/hooks/useThrottleFn.js +1 -1
- package/hooks/useTimeout.js +1 -1
- package/hooks/useTitle.js +1 -1
- package/hooks/useToggle.js +1 -1
- package/hooks/useTrackedEffect.js +1 -1
- package/hooks/useUnmount.js +1 -1
- package/hooks/useUnmountedRef.js +1 -1
- package/hooks/useUpdate.js +1 -1
- package/hooks/useUpdateEffect.js +1 -1
- package/hooks/useUpdateLayoutEffect.js +1 -1
- package/hooks/useUrlState.js +1 -1
- package/hooks/useVirtualList.js +1 -1
- package/hooks/useWatch.js +1 -1
- package/hooks/useWebSocket.js +1 -1
- package/hooks/useWhyDidYouUpdate.js +1 -1
- package/hooks/useWindowSize.js +4 -3
- package/hooks/utils/createEffectWithTarget.js +11 -12
- 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 +5 -6
- 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/hooks/utils.js +1 -1
- package/icons/file/index.js +31 -24
- package/icons/file.js +1 -1
- package/index.js +47 -46
- package/motion/CSSMotion.js +102 -0
- package/motion/CSSMotionList.js +100 -0
- package/motion/context.js +14 -0
- package/motion/hooks/useDomMotionEvents.js +21 -0
- package/motion/hooks/useNextFrame.js +24 -0
- package/motion/hooks/useStatus.js +121 -0
- package/motion/hooks/useStepQueue.js +44 -0
- package/motion/index.js +9 -0
- package/motion/interface.js +14 -0
- package/motion/util/diff.js +56 -0
- package/motion/util/motion.js +56 -0
- package/package.json +1 -1
- package/progress/index.js +1 -1
- package/resize-observer/Collection.js +25 -0
- package/resize-observer/SingleObserver.js +48 -0
- package/resize-observer/index.js +27 -0
- package/resize-observer/observerUtil.js +22 -0
- package/space/index.js +65 -52
- package/suspense-fallback-test/index.js +1 -1
- package/transition-group/CSSTransition.js +59 -54
- package/transition-group/ChildMapping.js +68 -0
- package/transition-group/PqbCSSTransition.js +22 -18
- package/transition-group/ReplaceTransition.js +7 -7
- package/transition-group/SwitchTransition.js +1 -1
- package/transition-group/Transition.js +56 -52
- package/transition-group/TransitionGroup.js +2 -3
- package/transition-group/TransitionGroupContext.js +1 -1
- package/transition-group/index.js +30 -29
- package/types/hooks/index.d.ts +4 -0
- package/types/hooks/use-event/index.d.ts +2 -0
- package/types/hooks/use-intersection-observers/index.d.ts +3 -1
- package/types/hooks/use-listen-window-resize/index.d.ts +4 -4
- package/types/hooks/use-memo/index.d.ts +2 -0
- package/types/hooks/use-move/index.d.ts +4 -0
- package/types/hooks/use-mutation-observers/index.d.ts +3 -1
- package/types/hooks/use-resize-observers/index.d.ts +3 -1
- package/types/hooks/use-size/index.d.ts +1 -1
- package/types/hooks/use-sync-state/index.d.ts +10 -0
- package/types/hooks/use-window-size/index.d.ts +2 -3
- package/types/motion/CSSMotion.d.ts +77 -0
- package/types/motion/CSSMotionList.d.ts +34 -0
- package/types/motion/context.d.ts +9 -0
- package/types/motion/hooks/useDomMotionEvents.d.ts +3 -0
- package/types/motion/hooks/useNextFrame.d.ts +7 -0
- package/types/motion/hooks/useStatus.d.ts +5 -0
- package/types/motion/hooks/useStepQueue.d.ts +8 -0
- package/types/motion/index.d.ts +9 -0
- package/types/motion/interface.d.ts +22 -0
- package/types/motion/util/diff.d.ts +20 -0
- package/types/motion/util/motion.d.ts +10 -0
- package/types/resize-observer/Collection.d.ts +9 -0
- package/types/resize-observer/SingleObserver.d.ts +7 -0
- package/types/resize-observer/index.d.ts +7 -0
- package/types/resize-observer/interface.d.ts +25 -0
- package/types/resize-observer/observerUtil.d.ts +3 -0
- package/types/space/interface.d.ts +1 -1
- package/types/transition-group/CSSTransition.d.ts +0 -1
- package/types/transition-group/{utils/ChildMapping.d.ts → ChildMapping.d.ts} +4 -4
- package/types/transition-group/SwitchTransition.d.ts +3 -3
- package/types/transition-group/Transition.d.ts +1 -1
- package/types/transition-group/TransitionGroup.d.ts +1 -1
- package/types/transition-group/index.d.ts +1 -1
- package/types/utils/callbackOriginRef.d.ts +4 -0
- package/types/utils/dom.d.ts +2 -1
- package/types/utils/findRootElement.d.ts +23 -0
- package/types/utils/index.d.ts +4 -2
- package/types/utils/is.d.ts +5 -4
- package/types/utils/lodash.d.ts +2 -1
- package/types/utils/ref.d.ts +27 -0
- package/types/utils/setCreateRoot.d.ts +13 -0
- package/types/utils/toArray.d.ts +3 -3
- package/utils/callbackOriginRef.js +11 -0
- package/utils/caseName.js +1 -1
- package/utils/className.js +1 -1
- package/utils/compute.js +1 -1
- package/utils/constant.js +1 -1
- package/utils/copy.js +1 -1
- package/utils/date.js +1 -1
- package/utils/dayjs.js +1 -1
- package/utils/dom.js +12 -10
- package/utils/emitter.js +1 -1
- package/utils/fileToURL.js +1 -1
- package/utils/fillNBSP.js +1 -1
- package/utils/findRootElement.js +28 -0
- package/utils/findScrollParent.js +1 -1
- package/utils/getHighlightText.js +1 -1
- package/utils/getHotkeyHandler.js +1 -1
- package/utils/getStringLength.js +1 -1
- package/utils/include.js +1 -1
- package/utils/index.js +341 -329
- package/utils/intersectionObserver.js +1 -1
- package/utils/is.js +72 -81
- package/utils/keyboardCode.js +1 -1
- package/utils/lodash.js +45 -43
- package/utils/math.js +1 -1
- package/utils/mergeProps.js +1 -1
- package/utils/mergedToString.js +1 -1
- package/utils/mutationObserver.js +1 -1
- package/utils/omit.js +1 -1
- package/utils/pad.js +1 -1
- package/utils/pick.js +1 -1
- package/utils/pinyin.js +1 -1
- package/utils/react19Adapter.js +2 -2
- package/utils/ref.js +41 -0
- package/utils/resizeObserver.js +1 -1
- package/utils/saveAs.js +1 -1
- package/utils/screenfull.js +1 -1
- package/utils/scrollIntoViewIfNeeded.js +1 -1
- package/utils/setCreateRoot.js +53 -0
- package/utils/setDarkTheme.js +1 -1
- package/utils/setDir.js +1 -1
- package/utils/setPrimaryColor.js +1 -1
- package/utils/setTheme.js +1 -1
- package/utils/string.js +1 -1
- package/utils/style.js +1 -1
- package/utils/throttleByRaf.js +1 -1
- package/utils/throttleByRaf2.js +1 -1
- package/utils/tinycolor.js +1 -1
- package/utils/toArray.js +9 -9
- package/utils/tree.js +1 -1
- package/utils/tween.js +1 -1
- package/utils/uuid.js +1 -1
- package/utils/validate.js +1 -1
- package/utils/warning.js +1 -1
- package/transition-group/utils/ChildMapping.js +0 -66
- package/types/utils/reactDOM.d.ts +0 -34
- package/types/utils/supportRef.d.ts +0 -3
- package/utils/reactDOM.js +0 -87
- package/utils/supportRef.js +0 -10
package/types/utils/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from './callbackOriginRef';
|
|
1
2
|
export * from './caseName';
|
|
2
3
|
export * from './className';
|
|
3
4
|
export * from './constant';
|
|
@@ -8,6 +9,7 @@ export * from './dom';
|
|
|
8
9
|
export * from './emitter';
|
|
9
10
|
export * from './fileToURL';
|
|
10
11
|
export * from './fillNBSP';
|
|
12
|
+
export * from './findRootElement';
|
|
11
13
|
export * from './findScrollParent';
|
|
12
14
|
export * from './getHighlightText';
|
|
13
15
|
export * from './getHotkeyHandler';
|
|
@@ -24,18 +26,18 @@ export * from './omit';
|
|
|
24
26
|
export * from './pad';
|
|
25
27
|
export * from './pick';
|
|
26
28
|
export * from './pinyin';
|
|
27
|
-
export * from './
|
|
29
|
+
export * from './ref';
|
|
28
30
|
export * from './resizeObserver';
|
|
29
31
|
export * from './saveAs';
|
|
30
32
|
export * from './screenfull';
|
|
31
33
|
export * from './scrollIntoViewIfNeeded';
|
|
34
|
+
export * from './setCreateRoot';
|
|
32
35
|
export * from './setDarkTheme';
|
|
33
36
|
export * from './setDir';
|
|
34
37
|
export * from './setPrimaryColor';
|
|
35
38
|
export * from './setTheme';
|
|
36
39
|
export * from './string';
|
|
37
40
|
export * from './style';
|
|
38
|
-
export * from './supportRef';
|
|
39
41
|
export * from './throttleByRaf';
|
|
40
42
|
export * from './tinycolor';
|
|
41
43
|
export * from './toArray';
|
package/types/utils/is.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { is32Bit, isArguments, isArray, isArrayBuffer, isArrayLike, isArrayLikeObject, isBlob, isBoolean, isBuffer, isColorValue, isDate, isElement, isEmpty, isEmptyArray, isEmptyObject, isEmptyValue, isEqual, isEqualWith, isError, isEventTarget, isExist, isFile, isFinite, isFunction, isInteger, isJSON, isLength, isMap, isMatch, isMatchWith, isNaN, isNative, isNil, isNull, isNullOrUndefined, isNumber, isObject, isObjectLike, isPlainObject, isPromise, isReadableStream, isRegExp, isSafeInteger, isSet, isString, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet, isWindow } from '@unicom-cloud/utils/is';
|
|
2
2
|
import { isDayjs } from 'dayjs';
|
|
3
|
+
import React from 'react';
|
|
3
4
|
declare const isServerRendering: boolean;
|
|
4
5
|
declare const isReact18: boolean, isReact19: boolean;
|
|
5
|
-
export declare function isEmptyReactNode(
|
|
6
|
+
export declare function isEmptyReactNode(element: any, trim?: boolean): boolean;
|
|
7
|
+
export declare function isReactComponentAndNotFragment(element: React.ReactElement): element is never;
|
|
6
8
|
export declare function isReactComponent(element: any): boolean;
|
|
7
|
-
export declare function
|
|
8
|
-
export declare function
|
|
9
|
-
export declare function isForwardRefReact(object: any): boolean;
|
|
9
|
+
export declare function isReactClassComponent(element: any): boolean;
|
|
10
|
+
export declare function isElementByInstanceof(element: Element): boolean;
|
|
10
11
|
export { is32Bit, isArguments, isArray, isArrayBuffer, isArrayLike, isArrayLikeObject, isBlob, isBoolean, isBuffer, isColorValue, isDate, isDayjs, isElement, isEmpty, isEmptyArray, isEmptyObject, isEmptyValue, isEqual, isEqualWith, isError, isEventTarget, isExist, isFile, isFinite, isFunction, isInteger, isJSON, isLength, isMap, isMatch, isMatchWith, isNaN, isNative, isNil, isNull, isNullOrUndefined, isNumber, isObject, isObjectLike, isPlainObject, isPromise, isReact18, isReact19, isReadableStream, isRegExp, isSafeInteger, isServerRendering, isSet, isString, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet, isWindow, };
|
package/types/utils/lodash.d.ts
CHANGED
|
@@ -42,6 +42,7 @@ import set from 'lodash/set';
|
|
|
42
42
|
import setWith from 'lodash/setWith';
|
|
43
43
|
import shuffle from 'lodash/shuffle';
|
|
44
44
|
import snakeCase from 'lodash/snakeCase';
|
|
45
|
+
import sortBy from 'lodash/sortBy';
|
|
45
46
|
import startCase from 'lodash/startCase';
|
|
46
47
|
import throttle from 'lodash/throttle';
|
|
47
48
|
import toPath from 'lodash/toPath';
|
|
@@ -57,4 +58,4 @@ import upperFirst from 'lodash/upperFirst';
|
|
|
57
58
|
import without from 'lodash/without';
|
|
58
59
|
import xor from 'lodash/xor';
|
|
59
60
|
import zip from 'lodash/zip';
|
|
60
|
-
export { assign, assignIn, at, camelCase, capitalize, castArray, chain, chunk, clone, cloneDeep, cloneDeepWith, cloneWith, compact, curry, debounce, defaults, defaultsDeep, defaultTo, difference, escape, findKey, flattenDeep, flow, get, groupBy, has, intersection, invert, invertBy, kebabCase, mean, memoize, merge, mergeWith, orderBy, partition, pullAll, result, sample, sampleSize, set, setWith, shuffle, snakeCase, startCase, throttle, toPath, truncate, union, uniq, uniqueId, unset, update, updateWith, upperCase, upperFirst, without, xor, zip, };
|
|
61
|
+
export { assign, assignIn, at, camelCase, capitalize, castArray, chain, chunk, clone, cloneDeep, cloneDeepWith, cloneWith, compact, curry, debounce, defaults, defaultsDeep, defaultTo, difference, escape, findKey, flattenDeep, flow, get, groupBy, has, intersection, invert, invertBy, kebabCase, mean, memoize, merge, mergeWith, orderBy, partition, pullAll, result, sample, sampleSize, set, setWith, shuffle, snakeCase, sortBy, startCase, throttle, toPath, truncate, union, uniq, uniqueId, unset, update, updateWith, upperCase, upperFirst, without, xor, zip, };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React, { RefObject } from 'react';
|
|
2
|
+
export declare const fillRef: <T>(ref: RefObject<T>, node: T) => void;
|
|
3
|
+
/**
|
|
4
|
+
* Merge refs into one ref function to support ref passing.
|
|
5
|
+
*/
|
|
6
|
+
export declare const composeRef: <T>(...refs: React.Ref<T>[]) => React.Ref<T>;
|
|
7
|
+
export declare const useComposeRef: <T>(...refs: React.Ref<T>[]) => React.Ref<T>;
|
|
8
|
+
export declare function supportRef(nodeOrComponent: React.ReactElement): boolean;
|
|
9
|
+
interface RefAttributes<T> extends React.Attributes {
|
|
10
|
+
ref: React.Ref<T>;
|
|
11
|
+
}
|
|
12
|
+
export declare const supportNodeRef: <T = unknown>(node: React.ReactNode) => node is React.ReactElement & RefAttributes<T>;
|
|
13
|
+
/**
|
|
14
|
+
* Returns the ref of a React element handling differences between React 19 and older versions.
|
|
15
|
+
* It will throw runtime error if the element is not a valid React element.
|
|
16
|
+
*
|
|
17
|
+
* @param element React.ReactElement
|
|
18
|
+
* @returns React.Ref<any> | null
|
|
19
|
+
*/
|
|
20
|
+
export declare function getReactElementRef(element: React.ReactElement): React.Ref<unknown> | null;
|
|
21
|
+
/**
|
|
22
|
+
* In React 19. `ref` is not a property from node.
|
|
23
|
+
* But a property from `props.ref`.
|
|
24
|
+
* To check if `props.ref` exist or fallback to `ref`.
|
|
25
|
+
*/
|
|
26
|
+
export declare const getNodeRef: typeof getReactElementRef;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
type CreateRootFnType = (container: Element | DocumentFragment) => {
|
|
3
|
+
render: (element: ReactElement) => void;
|
|
4
|
+
unmount: () => void;
|
|
5
|
+
};
|
|
6
|
+
type RenderResult = {
|
|
7
|
+
render: (element: ReactElement) => void;
|
|
8
|
+
_unmount: () => void;
|
|
9
|
+
};
|
|
10
|
+
declare function setCreateRoot(v?: CreateRootFnType): void;
|
|
11
|
+
declare function render(node: ReactElement, el: Element | DocumentFragment): RenderResult;
|
|
12
|
+
export { render, setCreateRoot };
|
|
13
|
+
export default setCreateRoot;
|
package/types/utils/toArray.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
interface
|
|
2
|
+
interface Option {
|
|
3
3
|
keepEmpty?: boolean;
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
6
|
* 将React子节点转换为数组
|
|
7
7
|
* @param children React子节点
|
|
8
|
-
* @param
|
|
8
|
+
* @param option 配置选项
|
|
9
9
|
* @returns React元素数组
|
|
10
10
|
*/
|
|
11
|
-
declare function toArray(children: React.ReactNode,
|
|
11
|
+
declare function toArray(children: React.ReactNode, option?: Option): React.ReactElement[];
|
|
12
12
|
export { toArray };
|
|
13
13
|
export default toArray;
|
package/utils/caseName.js
CHANGED
package/utils/className.js
CHANGED
package/utils/compute.js
CHANGED
package/utils/constant.js
CHANGED
package/utils/copy.js
CHANGED
package/utils/date.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 2025-11-
|
|
1
|
+
/* 2025-11-28 16:31:16 */
|
|
2
2
|
export * from "@unicom-cloud/utils/date";
|
package/utils/dayjs.js
CHANGED
package/utils/dom.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
/* 2025-11-
|
|
2
|
-
import { default as h
|
|
1
|
+
/* 2025-11-28 16:31:16 */
|
|
2
|
+
import { default as h } from "@unicom-cloud/utils/dom-helpers/canUseDOM";
|
|
3
|
+
import { default as y, default as E } from "@unicom-cloud/utils/dom-helpers/reflow";
|
|
3
4
|
import { isServerRendering as o } from "./is.js";
|
|
4
|
-
import { isEventTarget as
|
|
5
|
+
import { isEventTarget as f } from "@unicom-cloud/utils/is";
|
|
5
6
|
function u(e, n, t, r) {
|
|
6
|
-
o ||
|
|
7
|
+
o || f(e) && e.addEventListener(n, t, r || !1);
|
|
7
8
|
}
|
|
8
9
|
function c(e, n, t, r) {
|
|
9
|
-
o ||
|
|
10
|
+
o || f(e) && e.removeEventListener(n, t, r || !1);
|
|
10
11
|
}
|
|
11
12
|
function a(e, n) {
|
|
12
13
|
if (!e) return !1;
|
|
@@ -20,7 +21,7 @@ function a(e, n) {
|
|
|
20
21
|
}
|
|
21
22
|
return !1;
|
|
22
23
|
}
|
|
23
|
-
function
|
|
24
|
+
function i(e) {
|
|
24
25
|
if (!(e instanceof HTMLElement) || [document.documentElement].includes(e))
|
|
25
26
|
return !1;
|
|
26
27
|
const n = window.getComputedStyle(e), t = ["auto", "scroll", "overlay"];
|
|
@@ -30,7 +31,7 @@ function d(e, n = document.documentElement) {
|
|
|
30
31
|
const t = [];
|
|
31
32
|
let r = e;
|
|
32
33
|
for (; r && r !== n; )
|
|
33
|
-
|
|
34
|
+
i(r) && t.push(r), r = r.parentElement;
|
|
34
35
|
return t;
|
|
35
36
|
}
|
|
36
37
|
function w(e, n) {
|
|
@@ -50,14 +51,15 @@ function m() {
|
|
|
50
51
|
return window.document.body;
|
|
51
52
|
}
|
|
52
53
|
export {
|
|
54
|
+
h as canUseDOM,
|
|
53
55
|
a as contains,
|
|
54
|
-
|
|
56
|
+
y as forceReflow,
|
|
55
57
|
m as getBodyContainer,
|
|
56
58
|
d as getScrollElements,
|
|
57
|
-
|
|
59
|
+
i as isScrollElement,
|
|
58
60
|
o as isServerRendering,
|
|
59
61
|
c as off,
|
|
60
62
|
u as on,
|
|
61
63
|
w as parentContainsChildren,
|
|
62
|
-
|
|
64
|
+
E as reflow
|
|
63
65
|
};
|
package/utils/emitter.js
CHANGED
package/utils/fileToURL.js
CHANGED
package/utils/fillNBSP.js
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/* 2025-11-28 16:31:16 */
|
|
2
|
+
import { Component as e } from "react";
|
|
3
|
+
import u from "react-dom";
|
|
4
|
+
import { isElementByInstanceof as n } from "./is.js";
|
|
5
|
+
import { getReactElementRef as c } from "./ref.js";
|
|
6
|
+
import { isFunction as i } from "@unicom-cloud/utils/is";
|
|
7
|
+
const m = u, f = m.findDOMNode;
|
|
8
|
+
function p(r) {
|
|
9
|
+
let t = r;
|
|
10
|
+
if (!t) return null;
|
|
11
|
+
{
|
|
12
|
+
if (t = r, n(t))
|
|
13
|
+
return t;
|
|
14
|
+
if (n(t?.dom))
|
|
15
|
+
return t.dom;
|
|
16
|
+
}
|
|
17
|
+
return t = r, t = t.current, n(t) || (t = o(t), n(t)) || (t = r, t = c(t), t && (t = t.current, t && (n(t) || (t = o(t), n(t))))) || (t = r, t = o(t), n(t)) ? t : (t = r, t instanceof e && i(f) ? f(t) : null);
|
|
18
|
+
}
|
|
19
|
+
function o(r) {
|
|
20
|
+
if (!r) return null;
|
|
21
|
+
const t = r.getRootElement;
|
|
22
|
+
if (i(t))
|
|
23
|
+
return t();
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
p as default,
|
|
27
|
+
p as findRootElement
|
|
28
|
+
};
|
package/utils/getStringLength.js
CHANGED
package/utils/include.js
CHANGED