@unicom-cloud/ui-common 0.1.11 → 0.1.12
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 +1 -1
- package/Progress.js +1 -1
- package/ResizeObserver.js +5 -3
- package/Space.js +1 -1
- package/SuspenseFallbackTest.js +1 -1
- package/Timer.js +1 -1
- package/TransitionGroup.js +19 -21
- package/development/index.js +1 -1
- package/empty/index.js +1 -1
- package/flex/index.js +1 -1
- package/flex/utils.js +1 -1
- package/higher-order/index.js +1 -1
- package/higher-order/with-speech-synthesis/index.js +1 -1
- 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 +30 -29
- package/hooks/use-async-effect/index.js +1 -1
- package/hooks/use-boolean/index.js +1 -1
- package/hooks/use-click-away/index.js +1 -1
- package/hooks/use-computed-state/index.js +1 -1
- package/hooks/use-controllable-value/index.js +1 -1
- package/hooks/use-cookie-state/index.js +1 -1
- package/hooks/use-count-down/index.js +1 -1
- 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 +1 -1
- package/hooks/use-drop/index.js +1 -1
- package/hooks/use-event/index.js +1 -1
- package/hooks/use-event-listener/index.js +1 -1
- package/hooks/use-event-target/index.js +1 -1
- 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 +1 -1
- package/hooks/use-get-state/index.js +1 -1
- package/hooks/use-history-travel/index.js +1 -1
- 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 +1 -1
- package/hooks/use-infinite-scroll/index.js +1 -1
- package/hooks/use-intersection-observer/index.js +1 -1
- package/hooks/use-intersection-observers/index.js +1 -1
- package/hooks/use-interval/index.js +1 -1
- package/hooks/use-is-first-render/index.js +1 -1
- package/hooks/use-isomorphic-layout-effect/index.js +1 -1
- package/hooks/use-key-press/index.js +1 -1
- package/hooks/use-keyboard-event/index.js +1 -1
- package/hooks/use-latest/index.js +1 -1
- package/hooks/use-listen-window-resize/index.js +1 -1
- package/hooks/use-local-storage-state/index.js +1 -1
- package/hooks/use-lock-fn/index.js +1 -1
- package/hooks/use-long-press/index.js +1 -1
- package/hooks/use-map/index.js +1 -1
- package/hooks/use-media/index.js +1 -1
- package/hooks/use-memo/index.js +1 -1
- package/hooks/use-memoized-fn/index.js +1 -1
- package/hooks/use-merge-props/index.js +1 -1
- package/hooks/use-merge-value/index.js +1 -1
- package/hooks/use-mobile/index.js +1 -1
- package/hooks/use-mount/index.js +1 -1
- package/hooks/use-mouse/index.js +1 -1
- package/hooks/use-move/index.js +1 -1
- package/hooks/use-mutation-observer/index.js +1 -1
- package/hooks/use-mutation-observers/index.js +1 -1
- 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 +1 -1
- package/hooks/use-pagination/index.js +1 -1
- package/hooks/use-paste-image/index.js +1 -1
- package/hooks/use-persist-callback/index.js +1 -1
- package/hooks/use-prefers-color-scheme-dark/index.js +1 -1
- package/hooks/use-previous/index.js +1 -1
- package/hooks/use-raf-interval/index.js +1 -1
- package/hooks/use-raf-state/index.js +1 -1
- package/hooks/use-raf-timeout/index.js +1 -1
- package/hooks/use-reactive/index.js +1 -1
- package/hooks/use-ref-latest/index.js +1 -1
- package/hooks/use-refs/index.js +15 -7
- 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 +1 -1
- package/hooks/use-request/src/plugins/useDebouncePlugin.js +1 -1
- package/hooks/use-request/src/plugins/useLoadingDelayPlugin.js +1 -1
- package/hooks/use-request/src/plugins/usePollingPlugin.js +1 -1
- package/hooks/use-request/src/plugins/useRefreshOnWindowFocusPlugin.js +1 -1
- package/hooks/use-request/src/plugins/useRetryPlugin.js +1 -1
- package/hooks/use-request/src/plugins/useThrottlePlugin.js +1 -1
- package/hooks/use-request/src/useRequest.js +1 -1
- package/hooks/use-request/src/useRequestImplement.js +1 -1
- 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 +1 -1
- package/hooks/use-resize-observer/index.js +1 -1
- package/hooks/use-resize-observers/index.js +1 -1
- package/hooks/use-responsive/index.js +26 -25
- package/hooks/use-safe-state/index.js +1 -1
- 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 +1 -1
- package/hooks/use-state-callback/index.js +1 -1
- package/hooks/use-state-with-promise/index.js +1 -1
- package/hooks/use-sync-state/index.js +1 -1
- package/hooks/use-text-selection/index.js +1 -1
- 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 +1 -1
- package/hooks/use-timeout/index.js +1 -1
- 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 +1 -1
- package/hooks/use-update/index.js +1 -1
- package/hooks/use-update-effect/index.js +1 -1
- package/hooks/use-update-layout-effect/index.js +1 -1
- package/hooks/use-url-state/index.js +1 -1
- package/hooks/use-virtual-list/index.js +1 -1
- package/hooks/use-watch/index.js +1 -1
- package/hooks/use-web-socket/index.js +1 -1
- package/hooks/use-why-did-you-update/index.js +1 -1
- package/hooks/use-window-size/index.js +1 -1
- package/hooks/useAsyncEffect.js +1 -1
- package/hooks/useBoolean.js +1 -1
- package/hooks/useClickAway.js +1 -1
- 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 +1 -1
- package/hooks/useEventListener.js +1 -1
- 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 +1 -1
- package/hooks/useInfiniteScroll.js +1 -1
- package/hooks/useIntersectionObserver.js +1 -1
- package/hooks/useIntersectionObservers.js +1 -1
- 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 +1 -1
- package/hooks/useMemoizedFn.js +1 -1
- package/hooks/useMergeProps.js +1 -1
- package/hooks/useMergeValue.js +1 -1
- package/hooks/useMobile.js +1 -1
- package/hooks/useMount.js +1 -1
- package/hooks/useMouse.js +1 -1
- package/hooks/useMove.js +1 -1
- package/hooks/useMutationObserver.js +1 -1
- package/hooks/useMutationObservers.js +1 -1
- package/hooks/useNetwork.js +1 -1
- package/hooks/useOnlineStatus.js +1 -1
- package/hooks/useOverflowHidden.js +1 -1
- package/hooks/useOverrideRef.js +1 -1
- package/hooks/usePagination.js +1 -1
- package/hooks/usePasteImage.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 +5 -3
- package/hooks/useRequest.js +1 -1
- package/hooks/useResetState.js +1 -1
- package/hooks/useResizeObserver.js +1 -1
- package/hooks/useResizeObservers.js +1 -1
- 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 +1 -1
- package/hooks/useStateCallback.js +1 -1
- package/hooks/useStateWithPromise.js +1 -1
- package/hooks/useSyncState.js +1 -1
- 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 +1 -1
- package/hooks/utils/createEffectWithTarget.js +1 -1
- package/hooks/utils/depsAreSame.js +1 -1
- package/hooks/utils/depsEqual.js +1 -1
- package/hooks/utils/domTarget.js +1 -1
- package/hooks/utils/getDocumentOrShadow.js +1 -1
- package/hooks/utils/index.js +1 -1
- package/hooks/utils/isAppleDevice.js +1 -1
- package/hooks/utils/isBrowser.js +1 -1
- package/hooks/utils/isDev.js +1 -1
- package/hooks/utils/rect.js +1 -1
- package/hooks/utils/useDeepCompareWithTarget.js +1 -1
- 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 +1 -1
- package/icons/file.js +1 -1
- package/index.js +442 -443
- package/motion/CSSMotion.js +34 -32
- package/motion/CSSMotionList.js +1 -1
- package/motion/context.js +1 -1
- package/motion/hooks/useDomMotionEvents.js +1 -1
- package/motion/hooks/useNextFrame.js +1 -1
- package/motion/hooks/useStatus.js +1 -1
- package/motion/hooks/useStepQueue.js +1 -1
- package/motion/index.js +1 -1
- package/motion/interface.js +1 -1
- package/motion/util/diff.js +33 -31
- package/motion/util/motion.js +26 -25
- package/package.json +1 -1
- package/progress/index.js +1 -1
- package/resize-observer/Collection.js +1 -1
- package/resize-observer/SingleObserver.js +7 -5
- package/resize-observer/index.js +13 -11
- package/resize-observer/observerUtil.js +1 -1
- package/space/index.js +1 -1
- package/suspense-fallback-test/index.js +1 -1
- package/timer/index.js +1 -1
- package/transition-group/CSSTransition.js +26 -26
- package/transition-group/ChildMapping.js +1 -1
- package/transition-group/PqbCSSTransition.js +1 -1
- package/transition-group/ReplaceTransition.js +1 -1
- package/transition-group/SwitchTransition.js +1 -1
- package/transition-group/Transition.js +28 -29
- package/transition-group/TransitionGroup.js +1 -1
- package/transition-group/TransitionGroupContext.js +1 -1
- package/transition-group/index.js +19 -21
- package/types/hooks/index.d.ts +1 -1
- package/types/hooks/use-refs/index.d.ts +2 -0
- package/types/motion/CSSMotion.d.ts +3 -3
- package/types/motion/CSSMotionList.d.ts +4 -4
- package/types/transition-group/index.d.ts +1 -2
- package/utils/callOrReturn.js +1 -1
- package/utils/callbackOriginRef.js +1 -1
- 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 +1 -1
- package/utils/emitter.js +1 -1
- package/utils/fileRead.js +1 -1
- package/utils/fileToDataURL.js +1 -1
- package/utils/fillNBSP.js +1 -1
- package/utils/findRootElement.js +7 -8
- 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 +1 -1
- package/utils/intersectionObserver.js +1 -1
- package/utils/is.js +1 -1
- package/utils/keyboardCode.js +1 -1
- package/utils/lodash.js +1 -1
- 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 +1 -1
- package/utils/ref.js +1 -1
- 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 +1 -1
- package/utils/setDarkTheme.js +1 -1
- package/utils/setDir.js +1 -1
- package/utils/setPrimaryColor.js +1 -1
- package/utils/setTheme.js +1 -1
- package/utils/string.js +1 -1
- package/utils/style.js +1 -1
- package/utils/throttleByRaf.js +1 -1
- package/utils/throttleByRaf2.js +1 -1
- package/utils/tinycolor.js +1 -1
- package/utils/toArray.js +1 -1
- 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/motion/CSSMotion.js
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
/* 2025-12-
|
|
1
|
+
/* 2025-12-30 17:27:19 */
|
|
2
2
|
import o, { useRef as _ } from "react";
|
|
3
3
|
import h from "@unicom-cloud/utils/class-name";
|
|
4
|
-
import { findRootElement as
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
import { findRootElement as L } from "../utils/findRootElement.js";
|
|
5
|
+
import "../utils/is.js";
|
|
6
|
+
import { supportRef as V, getReactElementRef as $ } from "../utils/ref.js";
|
|
7
|
+
import { Context as k } from "./context.js";
|
|
8
|
+
import w from "./hooks/useStatus.js";
|
|
9
|
+
import { isActive as D } from "./hooks/useStepQueue.js";
|
|
10
|
+
import { STATUS_NONE as M, STEP_PREPARE as H, STEP_START as I } from "./interface.js";
|
|
11
|
+
import { getTransitionName as T, supportTransition as U } from "./util/motion.js";
|
|
12
|
+
import { isObjectLike as q, isString as z } from "@unicom-cloud/utils/is";
|
|
13
|
+
function B(l) {
|
|
14
|
+
let S = l;
|
|
15
|
+
q(l) && ({ transitionSupport: S } = l);
|
|
16
|
+
function P(r, f) {
|
|
15
17
|
return !!(r.motionName && S && f !== !1);
|
|
16
18
|
}
|
|
17
19
|
const d = o.forwardRef(
|
|
@@ -20,23 +22,23 @@ function q(m) {
|
|
|
20
22
|
// Default config
|
|
21
23
|
visible: R = !0,
|
|
22
24
|
removeOnLeave: g = !0,
|
|
23
|
-
forceRender:
|
|
25
|
+
forceRender: x,
|
|
24
26
|
children: i,
|
|
25
27
|
motionName: s,
|
|
26
28
|
leavedClassName: u,
|
|
27
|
-
eventProps:
|
|
28
|
-
} = r, { motion:
|
|
29
|
+
eventProps: y
|
|
30
|
+
} = r, { motion: O } = o.useContext(k), E = P(r, O), n = _(null);
|
|
29
31
|
function N() {
|
|
30
|
-
return
|
|
32
|
+
return L(n);
|
|
31
33
|
}
|
|
32
|
-
const [b, a,
|
|
34
|
+
const [b, a, j, c] = w(
|
|
33
35
|
E,
|
|
34
36
|
R,
|
|
35
37
|
N,
|
|
36
38
|
r
|
|
37
39
|
), p = b(), v = o.useRef(c);
|
|
38
40
|
c && (v.current = !0);
|
|
39
|
-
const
|
|
41
|
+
const A = o.useMemo(() => {
|
|
40
42
|
const t = {};
|
|
41
43
|
return Object.defineProperties(t, {
|
|
42
44
|
nativeElement: {
|
|
@@ -53,39 +55,39 @@ function q(m) {
|
|
|
53
55
|
}
|
|
54
56
|
}), t;
|
|
55
57
|
}, []);
|
|
56
|
-
o.useImperativeHandle(f, () =>
|
|
58
|
+
o.useImperativeHandle(f, () => A, []);
|
|
57
59
|
let e;
|
|
58
|
-
const
|
|
60
|
+
const m = { ...y, visible: R };
|
|
59
61
|
if (!i)
|
|
60
62
|
e = null;
|
|
61
63
|
else if (p === M)
|
|
62
|
-
c ? e = i({ ...
|
|
63
|
-
{ ...
|
|
64
|
+
c ? e = i({ ...m }, n) : !g && v.current && u ? e = i(
|
|
65
|
+
{ ...m, className: u },
|
|
64
66
|
n
|
|
65
|
-
) :
|
|
66
|
-
{ ...
|
|
67
|
+
) : x || !g && !u ? e = i(
|
|
68
|
+
{ ...m, style: { display: "none" } },
|
|
67
69
|
n
|
|
68
70
|
) : e = null;
|
|
69
71
|
else {
|
|
70
72
|
let t;
|
|
71
|
-
a ===
|
|
73
|
+
a === H ? t = "prepare" : D(a) ? t = "active" : a === I && (t = "start");
|
|
72
74
|
const C = T(
|
|
73
75
|
s,
|
|
74
76
|
`${p}-${t}`
|
|
75
77
|
);
|
|
76
78
|
e = i(
|
|
77
79
|
{
|
|
78
|
-
...
|
|
80
|
+
...m,
|
|
79
81
|
className: h(T(s, p), {
|
|
80
82
|
[C]: C && t,
|
|
81
|
-
[s]:
|
|
83
|
+
[s]: z(s)
|
|
82
84
|
}),
|
|
83
|
-
style:
|
|
85
|
+
style: j
|
|
84
86
|
},
|
|
85
87
|
n
|
|
86
88
|
);
|
|
87
89
|
}
|
|
88
|
-
return o.isValidElement(e) &&
|
|
90
|
+
return o.isValidElement(e) && V(e) && ($(e) || (e = o.cloneElement(
|
|
89
91
|
e,
|
|
90
92
|
{
|
|
91
93
|
ref: n
|
|
@@ -95,8 +97,8 @@ function q(m) {
|
|
|
95
97
|
);
|
|
96
98
|
return d.displayName = "CSSMotion", d;
|
|
97
99
|
}
|
|
98
|
-
const
|
|
100
|
+
const oe = B(U);
|
|
99
101
|
export {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
+
oe as default,
|
|
103
|
+
B as genCSSMotion
|
|
102
104
|
};
|
package/motion/CSSMotionList.js
CHANGED
package/motion/context.js
CHANGED
package/motion/index.js
CHANGED
package/motion/interface.js
CHANGED
package/motion/util/diff.js
CHANGED
|
@@ -1,56 +1,58 @@
|
|
|
1
|
-
/* 2025-12-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
/* 2025-12-30 17:27:19 */
|
|
2
|
+
import "../../utils/is.js";
|
|
3
|
+
import { isObjectLike as d } from "@unicom-cloud/utils/is";
|
|
4
|
+
const l = "add", p = "keep", E = "remove", K = "removed";
|
|
5
|
+
function O(s) {
|
|
6
|
+
let r;
|
|
7
|
+
return s && d(s) && "key" in s ? r = s : r = { key: s }, {
|
|
8
|
+
...r,
|
|
9
|
+
key: String(r.key)
|
|
8
10
|
};
|
|
9
11
|
}
|
|
10
|
-
function
|
|
11
|
-
return s.map(
|
|
12
|
+
function y(s = []) {
|
|
13
|
+
return s.map(O);
|
|
12
14
|
}
|
|
13
|
-
function
|
|
14
|
-
let e = [],
|
|
15
|
-
const f =
|
|
16
|
-
|
|
15
|
+
function j(s = [], r = []) {
|
|
16
|
+
let e = [], n = 0;
|
|
17
|
+
const f = r.length, S = y(s), a = y(r);
|
|
18
|
+
S.forEach((t) => {
|
|
17
19
|
let o = !1;
|
|
18
|
-
for (let c =
|
|
20
|
+
for (let c = n; c < f; c += 1) {
|
|
19
21
|
const u = a[c];
|
|
20
22
|
if (u.key === t.key) {
|
|
21
|
-
|
|
22
|
-
a.slice(
|
|
23
|
-
),
|
|
23
|
+
n < c && (e = e.concat(
|
|
24
|
+
a.slice(n, c).map((T) => ({ ...T, status: l }))
|
|
25
|
+
), n = c), e.push({
|
|
24
26
|
...u,
|
|
25
|
-
status:
|
|
26
|
-
}),
|
|
27
|
+
status: p
|
|
28
|
+
}), n += 1, o = !0;
|
|
27
29
|
break;
|
|
28
30
|
}
|
|
29
31
|
}
|
|
30
32
|
o || e.push({
|
|
31
33
|
...t,
|
|
32
|
-
status:
|
|
34
|
+
status: E
|
|
33
35
|
});
|
|
34
|
-
}),
|
|
35
|
-
a.slice(
|
|
36
|
+
}), n < f && (e = e.concat(
|
|
37
|
+
a.slice(n).map((t) => ({ ...t, status: l }))
|
|
36
38
|
));
|
|
37
39
|
const i = {};
|
|
38
40
|
return e.forEach(({ key: t }) => {
|
|
39
41
|
i[t] = (i[t] || 0) + 1;
|
|
40
42
|
}), Object.keys(i).filter((t) => i[t] > 1).forEach((t) => {
|
|
41
43
|
e = e.filter(
|
|
42
|
-
({ key: o, status: c }) => o !== t || c !==
|
|
44
|
+
({ key: o, status: c }) => o !== t || c !== E
|
|
43
45
|
), e.forEach((o) => {
|
|
44
|
-
o.key === t && (o.status =
|
|
46
|
+
o.key === t && (o.status = p);
|
|
45
47
|
});
|
|
46
48
|
}), e;
|
|
47
49
|
}
|
|
48
50
|
export {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
l as STATUS_ADD,
|
|
52
|
+
p as STATUS_KEEP,
|
|
53
|
+
E as STATUS_REMOVE,
|
|
54
|
+
K as STATUS_REMOVED,
|
|
55
|
+
j as diffKeys,
|
|
56
|
+
y as parseKeys,
|
|
57
|
+
O as wrapKeyToObject
|
|
56
58
|
};
|
package/motion/util/motion.js
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
/* 2025-12-
|
|
1
|
+
/* 2025-12-30 17:27:19 */
|
|
2
2
|
import d from "@unicom-cloud/utils/dom-helpers/canUseDOM";
|
|
3
3
|
import "@unicom-cloud/utils/dom-helpers/getElementCoordinates";
|
|
4
4
|
import "@unicom-cloud/utils/dom-helpers/reflow";
|
|
5
5
|
import "../../utils/is.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import { isObjectLike as u } from "@unicom-cloud/utils/is";
|
|
7
|
+
function a(n, i) {
|
|
8
|
+
const t = {};
|
|
9
|
+
return t[n.toLowerCase()] = i.toLowerCase(), t[`Webkit${n}`] = `webkit${i}`, t[`Moz${n}`] = `moz${i}`, t[`ms${n}`] = `MS${i}`, t[`O${n}`] = `o${i.toLowerCase()}`, t;
|
|
9
10
|
}
|
|
10
|
-
function
|
|
11
|
-
const
|
|
11
|
+
function l(n, i) {
|
|
12
|
+
const t = {
|
|
12
13
|
animationend: a("Animation", "AnimationEnd"),
|
|
13
14
|
transitionend: a("Transition", "TransitionEnd")
|
|
14
15
|
};
|
|
15
|
-
return n && ("AnimationEvent" in
|
|
16
|
+
return n && ("AnimationEvent" in i || delete t.animationend.animation, "TransitionEvent" in i || delete t.transitionend.transition), t;
|
|
16
17
|
}
|
|
17
|
-
const
|
|
18
|
+
const E = l(
|
|
18
19
|
d,
|
|
19
20
|
typeof window < "u" ? window : {}
|
|
20
21
|
);
|
|
@@ -24,34 +25,34 @@ const o = {};
|
|
|
24
25
|
function f(n) {
|
|
25
26
|
if (o[n])
|
|
26
27
|
return o[n];
|
|
27
|
-
const
|
|
28
|
-
if (
|
|
29
|
-
const
|
|
28
|
+
const i = E[n];
|
|
29
|
+
if (i) {
|
|
30
|
+
const t = Object.keys(i), e = t.length;
|
|
30
31
|
for (let r = 0; r < e; r += 1) {
|
|
31
|
-
const s =
|
|
32
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
33
|
-
return o[n] =
|
|
32
|
+
const s = t[r];
|
|
33
|
+
if (Object.prototype.hasOwnProperty.call(i, s) && s in c)
|
|
34
|
+
return o[n] = i[s], o[n];
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
return "";
|
|
37
38
|
}
|
|
38
|
-
const p = f("animationend"), m = f("transitionend"),
|
|
39
|
-
function
|
|
39
|
+
const p = f("animationend"), m = f("transitionend"), g = !!(p && m), k = p || "animationend", L = m || "transitionend";
|
|
40
|
+
function M(n, i) {
|
|
40
41
|
if (!n) return null;
|
|
41
|
-
if (
|
|
42
|
-
const
|
|
42
|
+
if (u(n)) {
|
|
43
|
+
const t = i.replace(
|
|
43
44
|
/-\w/g,
|
|
44
45
|
(e) => e[1].toUpperCase()
|
|
45
46
|
);
|
|
46
|
-
return n[
|
|
47
|
+
return n[t];
|
|
47
48
|
}
|
|
48
|
-
return `${n}-${
|
|
49
|
+
return `${n}-${i}`;
|
|
49
50
|
}
|
|
50
51
|
export {
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
k as animationEndName,
|
|
53
|
+
M as getTransitionName,
|
|
53
54
|
f as getVendorPrefixedEventName,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
l as getVendorPrefixes,
|
|
56
|
+
g as supportTransition,
|
|
57
|
+
L as transitionEndName
|
|
57
58
|
};
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@unicom-cloud/ui-common","version":"0.1.
|
|
1
|
+
{"name":"@unicom-cloud/ui-common","version":"0.1.12","dependencies":{"@unicom-cloud/utils":"^0.1.0","@unicom-cloud/icons":"^0.1.0"},"peerDependencies":{"dayjs":"^1.11.19","lodash":"^4.17.21","react":"^18.3.1","react-dom":"^18.3.1","react-is":"^18.3.1"},"type":"module","types":"types/index.d.ts","main":"./index.js","publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"}}
|
package/progress/index.js
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
/* 2025-12-
|
|
1
|
+
/* 2025-12-30 17:27:19 */
|
|
2
2
|
import e from "react";
|
|
3
3
|
import { findRootElement as I } from "../utils/findRootElement.js";
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
4
|
+
import "../utils/is.js";
|
|
5
|
+
import { supportRef as S, getReactElementRef as P, useComposeRef as k } from "../utils/ref.js";
|
|
6
|
+
import { CollectionContext as y } from "./Collection.js";
|
|
6
7
|
import { observe as B, unobserve as D } from "./observerUtil.js";
|
|
8
|
+
import { isFunction as F } from "@unicom-cloud/utils/is";
|
|
7
9
|
function N(f, H) {
|
|
8
|
-
const { children: c, disabled: h } = f, r = e.useRef(null), z = e.useContext(
|
|
10
|
+
const { children: c, disabled: h } = f, r = e.useRef(null), z = e.useContext(y), u = F(c), n = u ? c(r) : c, o = e.useRef({
|
|
9
11
|
width: -1,
|
|
10
12
|
height: -1,
|
|
11
13
|
offsetWidth: -1,
|
|
12
14
|
offsetHeight: -1
|
|
13
|
-
}), m = !u && e.isValidElement(n) && S(n), W = m ?
|
|
15
|
+
}), m = !u && e.isValidElement(n) && S(n), W = m ? P(n) : null, w = k(W, r), R = () => I(r);
|
|
14
16
|
e.useImperativeHandle(H, () => R());
|
|
15
17
|
const g = e.useRef(f);
|
|
16
18
|
g.current = f;
|
package/resize-observer/index.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
/* 2025-12-
|
|
2
|
-
import
|
|
1
|
+
/* 2025-12-30 17:27:19 */
|
|
2
|
+
import f, { createElement as m } from "react";
|
|
3
|
+
import "../utils/is.js";
|
|
3
4
|
import { toArray as a } from "../utils/toArray.js";
|
|
4
5
|
import { warning as t } from "../utils/warning.js";
|
|
5
|
-
import { Collection as
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import { Collection as p } from "./Collection.js";
|
|
7
|
+
import d from "./SingleObserver.js";
|
|
8
|
+
import { isFunction as v } from "@unicom-cloud/utils/is";
|
|
9
|
+
function h(o, l) {
|
|
10
|
+
const { children: e } = o, r = v(e) ? [e] : a(e);
|
|
9
11
|
return process.env.NODE_ENV !== "production" && (r.length > 1 ? t(
|
|
10
12
|
!1,
|
|
11
13
|
"Find more than one child node with `children` in ResizeObserver. Please use ResizeObserver.Collection instead."
|
|
@@ -13,15 +15,15 @@ function v(o, f) {
|
|
|
13
15
|
!1,
|
|
14
16
|
"`children` of ResizeObserver is empty. Nothing is in observe."
|
|
15
17
|
)), r.map((i, n) => {
|
|
16
|
-
const
|
|
17
|
-
return /* @__PURE__ */ m(
|
|
18
|
+
const c = i?.key || `observer-key-${n}`;
|
|
19
|
+
return /* @__PURE__ */ m(d, { ...o, key: c, ref: n === 0 ? l : void 0 }, i);
|
|
18
20
|
});
|
|
19
21
|
}
|
|
20
|
-
const s =
|
|
21
|
-
|
|
22
|
+
const s = f.forwardRef(
|
|
23
|
+
h
|
|
22
24
|
);
|
|
23
25
|
process.env.NODE_ENV !== "production" && (s.displayName = "ResizeObserver");
|
|
24
|
-
s.Collection =
|
|
26
|
+
s.Collection = p;
|
|
25
27
|
export {
|
|
26
28
|
s as default
|
|
27
29
|
};
|
package/space/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 2025-12-
|
|
1
|
+
/* 2025-12-30 17:27:19 */
|
|
2
2
|
import { jsx as o, jsxs as k } from "react/jsx-runtime";
|
|
3
3
|
import { UI_COMMON_PREFIX as H } from "@unicom-cloud/utils/constant/ui";
|
|
4
4
|
import { forwardRef as g, useRef as O, useImperativeHandle as _, Fragment as A } from "react";
|
package/timer/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
/* 2025-12-
|
|
2
|
-
import { jsx as
|
|
3
|
-
import
|
|
1
|
+
/* 2025-12-30 17:27:19 */
|
|
2
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
3
|
+
import d from "react";
|
|
4
4
|
import "@unicom-cloud/utils/dom-helpers/canUseDOM";
|
|
5
5
|
import "@unicom-cloud/utils/dom-helpers/getElementCoordinates";
|
|
6
|
-
import
|
|
6
|
+
import c from "@unicom-cloud/utils/dom-helpers/reflow";
|
|
7
7
|
import "../utils/is.js";
|
|
8
|
-
import { findRootElement as
|
|
9
|
-
import
|
|
10
|
-
import { isString as
|
|
11
|
-
function
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
import { findRootElement as E } from "../utils/findRootElement.js";
|
|
9
|
+
import f from "./Transition.js";
|
|
10
|
+
import { isFunction as o, isString as p } from "@unicom-cloud/utils/is";
|
|
11
|
+
function r(a, t, s = "add") {
|
|
12
|
+
a instanceof Element && t && p(t) && t.split(" ").filter(Boolean).forEach((e, i, n) => {
|
|
13
|
+
a.classList[s](e);
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
|
-
class
|
|
16
|
+
class R extends d.Component {
|
|
17
17
|
constructor() {
|
|
18
18
|
super(...arguments), this.appliedClasses = {
|
|
19
19
|
appear: {},
|
|
@@ -24,37 +24,37 @@ class S extends m.Component {
|
|
|
24
24
|
t,
|
|
25
25
|
s
|
|
26
26
|
);
|
|
27
|
-
this.removeClasses(e, "exit"), this.addClass(e, i ? "appear" : "enter", "base"), this.props.onEnter && this.props.onEnter(e, s);
|
|
27
|
+
this.removeClasses(e, "exit"), this.addClass(e, i ? "appear" : "enter", "base"), o(this.props.onEnter) && this.props.onEnter(e, s);
|
|
28
28
|
}, this.onEntering = (t, s) => {
|
|
29
29
|
const [e, i] = this.resolveArguments(
|
|
30
30
|
t,
|
|
31
31
|
s
|
|
32
32
|
), n = i ? "appear" : "enter";
|
|
33
|
-
this.addClass(e, n, "active"), this.props.onEntering && this.props.onEntering(e, s);
|
|
33
|
+
this.addClass(e, n, "active"), o(this.props.onEntering) && this.props.onEntering(e, s);
|
|
34
34
|
}, this.onEntered = (t, s) => {
|
|
35
35
|
const [e, i] = this.resolveArguments(
|
|
36
36
|
t,
|
|
37
37
|
s
|
|
38
38
|
), n = i ? "appear" : "enter";
|
|
39
|
-
this.removeClasses(e, n), this.addClass(e, n, "done"), this.props.onEntered && this.props.onEntered(e, s);
|
|
39
|
+
this.removeClasses(e, n), this.addClass(e, n, "done"), o(this.props.onEntered) && this.props.onEntered(e, s);
|
|
40
40
|
}, this.onExit = (t) => {
|
|
41
41
|
const [s] = this.resolveArguments(t);
|
|
42
|
-
this.removeClasses(s, "appear"), this.removeClasses(s, "enter"), this.addClass(s, "exit", "base"), this.props.onExit && this.props.onExit(s);
|
|
42
|
+
this.removeClasses(s, "appear"), this.removeClasses(s, "enter"), this.addClass(s, "exit", "base"), o(this.props.onExit) && this.props.onExit(s);
|
|
43
43
|
}, this.onExiting = (t) => {
|
|
44
44
|
const [s] = this.resolveArguments(t);
|
|
45
|
-
this.addClass(s, "exit", "active"), this.props.onExiting && this.props.onExiting(s);
|
|
45
|
+
this.addClass(s, "exit", "active"), o(this.props.onExiting) && this.props.onExiting(s);
|
|
46
46
|
}, this.onExited = (t) => {
|
|
47
47
|
const [s] = this.resolveArguments(t);
|
|
48
|
-
this.removeClasses(s, "exit"), this.addClass(s, "exit", "done"), this.props.onExited && this.props.onExited(s);
|
|
48
|
+
this.removeClasses(s, "exit"), this.addClass(s, "exit", "done"), o(this.props.onExited) && this.props.onExited(s);
|
|
49
49
|
}, this.resolveArguments = (t, s) => [
|
|
50
|
-
|
|
50
|
+
E(this.props.refElement) || t,
|
|
51
51
|
s
|
|
52
52
|
], this.getClassNames = (t) => {
|
|
53
|
-
const { classNames: s } = this.props, e =
|
|
53
|
+
const { classNames: s } = this.props, e = p(s), i = e && s ? `${s}-` : "", n = e ? `${i}${t}` : s[t], l = e ? `${n}-active` : s[`${t}Active`], h = e ? `${n}-done` : s[`${t}Done`];
|
|
54
54
|
return {
|
|
55
55
|
baseClassName: n,
|
|
56
|
-
activeClassName:
|
|
57
|
-
doneClassName:
|
|
56
|
+
activeClassName: l,
|
|
57
|
+
doneClassName: h
|
|
58
58
|
};
|
|
59
59
|
};
|
|
60
60
|
}
|
|
@@ -66,7 +66,7 @@ class S extends m.Component {
|
|
|
66
66
|
addClass(t, s, e) {
|
|
67
67
|
let i = this.getClassNames(s)[`${e}ClassName`];
|
|
68
68
|
const { doneClassName: n } = this.getClassNames("enter");
|
|
69
|
-
s === "appear" && e === "done" && n && (i += ` ${n}`), e === "active" && t &&
|
|
69
|
+
s === "appear" && e === "done" && n && (i += ` ${n}`), e === "active" && t && c(t), i && (this.appliedClasses[s][e] = i, r(t, i, "add"));
|
|
70
70
|
}
|
|
71
71
|
removeClasses(t, s) {
|
|
72
72
|
const {
|
|
@@ -74,12 +74,12 @@ class S extends m.Component {
|
|
|
74
74
|
active: i,
|
|
75
75
|
done: n
|
|
76
76
|
} = this.appliedClasses[s];
|
|
77
|
-
this.appliedClasses[s] = {}, e &&
|
|
77
|
+
this.appliedClasses[s] = {}, e && r(t, e, "remove"), i && r(t, i, "remove"), n && r(t, n, "remove");
|
|
78
78
|
}
|
|
79
79
|
render() {
|
|
80
80
|
const { classNames: t, ...s } = this.props;
|
|
81
|
-
return /* @__PURE__ */
|
|
82
|
-
|
|
81
|
+
return /* @__PURE__ */ m(
|
|
82
|
+
f,
|
|
83
83
|
{
|
|
84
84
|
...s,
|
|
85
85
|
onEnter: this.onEnter,
|
|
@@ -93,5 +93,5 @@ class S extends m.Component {
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
export {
|
|
96
|
-
|
|
96
|
+
R as default
|
|
97
97
|
};
|