@unicom-cloud/ui-common 0.1.18 → 0.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.virtual/_rolldown/runtime.js +1 -1
- package/.vite/manifest.json +86 -171
- 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/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.d.ts +2 -1
- package/hooks/create-use-storage-state/index.js +44 -35
- package/hooks/index.js +1 -1
- 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-effect-event/index.js +1 -1
- package/hooks/use-event/index.js +1 -1
- package/hooks/use-event-listener/index.d.ts +3 -2
- 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 +25 -25
- 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 +24 -24
- package/hooks/use-network/index.js +1 -1
- package/hooks/use-online-status/index.js +1 -1
- package/hooks/use-overflow-hidden/index.js +17 -16
- 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 +1 -1
- 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.d.ts +6 -2
- 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 +25 -25
- package/hooks/use-responsive/index.js +1 -1
- 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/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/icons/file/index.js +1 -1
- package/index.js +487 -480
- package/package.json +1 -1
- package/progress/index.js +1 -1
- package/resize-observer/Collection.js +1 -1
- package/resize-observer/SingleObserver.js +1 -1
- package/resize-observer/index.js +2 -2
- package/resize-observer/observerUtil.js +1 -1
- package/space/index.js +1 -1
- package/style/animation.less +4 -4
- package/style.css +1 -1
- package/suspense-fallback-test/index.js +1 -1
- package/test.d.ts +0 -0
- package/test.js +5 -0
- package/timer/index.js +1 -1
- package/transition-group/ChildMapping.js +1 -1
- package/transition-group/Transition.d.ts +37 -41
- package/transition-group/Transition.js +96 -102
- package/transition-group/{CSSTransition.d.ts → TransitionCSS.d.ts} +9 -9
- package/transition-group/TransitionCSS.js +73 -0
- package/transition-group/TransitionGroup.d.ts +1 -1
- package/transition-group/TransitionGroup.js +2 -2
- package/transition-group/{ReplaceTransition.d.ts → TransitionReplace.d.ts} +5 -5
- package/transition-group/{ReplaceTransition.js → TransitionReplace.js} +2 -2
- package/transition-group/{SwitchTransition.d.ts → TransitionSwitch.d.ts} +10 -10
- package/transition-group/{SwitchTransition.js → TransitionSwitch.js} +3 -3
- package/transition-group/context.d.ts +2 -0
- package/transition-group/context.js +7 -0
- package/transition-group/index.d.ts +5 -5
- package/transition-group/index.js +6 -6
- 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/constant.js +1 -1
- package/utils/copy.js +1 -1
- package/utils/date.js +1 -1
- package/utils/dayjs.d.ts +1 -1
- package/utils/dayjs.js +19 -13
- package/utils/dom.js +15 -15
- 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.d.ts +4 -2
- package/utils/findRootElement.js +1 -1
- package/utils/findScrollParent.js +1 -1
- package/utils/getHighlightText.js +1 -1
- package/utils/getHotkeyHandler.js +1 -1
- package/utils/getScrollBarHeight.d.ts +3 -0
- package/utils/getScrollBarHeight.js +7 -0
- package/utils/getScrollBarSize.d.ts +3 -0
- package/utils/getScrollBarSize.js +10 -0
- package/utils/getScrollBarWidth.d.ts +3 -0
- package/utils/getScrollBarWidth.js +7 -0
- package/utils/getStringLength.js +1 -1
- package/utils/include.js +1 -1
- package/utils/index.d.ts +3 -0
- package/utils/index.js +221 -214
- package/utils/intersectionObserver.js +1 -1
- package/utils/is.d.ts +6 -6
- package/utils/is.js +15 -15
- 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.d.ts +5 -1
- package/utils/omit.js +4 -8
- package/utils/pad.js +1 -1
- package/utils/pick.d.ts +4 -1
- package/utils/pick.js +5 -10
- package/utils/pinyin.js +1 -1
- package/utils/react19Adapter.js +1 -1
- package/utils/ref.js +1 -1
- package/utils/resizeObserver.js +21 -21
- 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/version/index.js +11 -14
- package/motion/CSSMotion.d.ts +0 -77
- package/motion/CSSMotion.js +0 -76
- package/motion/CSSMotionList.d.ts +0 -34
- package/motion/CSSMotionList.js +0 -82
- package/motion/context.d.ts +0 -9
- package/motion/context.js +0 -14
- package/motion/hooks/useDomMotionEvents.d.ts +0 -3
- package/motion/hooks/useDomMotionEvents.js +0 -19
- package/motion/hooks/useNextFrame.d.ts +0 -7
- package/motion/hooks/useNextFrame.js +0 -22
- package/motion/hooks/useStatus.d.ts +0 -5
- package/motion/hooks/useStatus.js +0 -92
- package/motion/hooks/useStepQueue.d.ts +0 -8
- package/motion/hooks/useStepQueue.js +0 -39
- package/motion/index.d.ts +0 -9
- package/motion/index.js +0 -9
- package/motion/interface.d.ts +0 -22
- package/motion/interface.js +0 -6
- package/motion/util/diff.d.ts +0 -20
- package/motion/util/diff.js +0 -50
- package/motion/util/motion.d.ts +0 -10
- package/motion/util/motion.js +0 -37
- package/transition-group/CSSTransition.js +0 -73
- package/transition-group/PqbCSSTransition.d.ts +0 -4
- package/transition-group/PqbCSSTransition.js +0 -34
- package/transition-group/TransitionGroupContext.d.ts +0 -3
- package/transition-group/TransitionGroupContext.js +0 -7
package/utils/mergedToString.js
CHANGED
package/utils/omit.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
declare
|
|
1
|
+
declare const omit: {
|
|
2
|
+
<T extends object, K extends import("lodash").PropertyName[]>(object: T | null | undefined, ...paths: K): Pick<T, Exclude<keyof T, K[number]>>;
|
|
3
|
+
<T extends object, K extends keyof T>(object: T | null | undefined, ...paths: Array<import("lodash").Many<K>>): import("lodash").Omit<T, K>;
|
|
4
|
+
<T extends object>(object: T | null | undefined, ...paths: Array<import("lodash").Many<import("lodash").PropertyName>>): import("lodash").PartialObject<T>;
|
|
5
|
+
};
|
|
2
6
|
export { omit };
|
|
3
7
|
export default omit;
|
package/utils/omit.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
/* 潘启宝 2026-03
|
|
1
|
+
/* 潘启宝 2026-04-03 14:07:44 星期五 */
|
|
2
|
+
import e from "lodash/omit";
|
|
2
3
|
//#region components/common/utils/omit.ts
|
|
3
|
-
|
|
4
|
-
let n = { ...e };
|
|
5
|
-
return t.forEach((e) => {
|
|
6
|
-
e in n && delete n[e];
|
|
7
|
-
}), n;
|
|
8
|
-
}
|
|
4
|
+
var t = e;
|
|
9
5
|
//#endregion
|
|
10
|
-
export {
|
|
6
|
+
export { t as default, t as omit };
|
|
11
7
|
/* 独立思考,明辨是非 */
|
package/utils/pad.js
CHANGED
package/utils/pick.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
declare
|
|
1
|
+
declare const pick: {
|
|
2
|
+
<T extends object, U extends keyof T>(object: T, ...props: Array<import("lodash").Many<U>>): Pick<T, U>;
|
|
3
|
+
<T>(object: T | null | undefined, ...props: Array<import("lodash").Many<import("lodash").PropertyPath>>): import("lodash").PartialObject<T>;
|
|
4
|
+
};
|
|
2
5
|
declare function pickDataAttributes<T extends object, K extends keyof T>(o: T | undefined): {
|
|
3
6
|
[key in K]: unknown;
|
|
4
7
|
};
|
package/utils/pick.js
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
/* 潘启宝 2026-03
|
|
1
|
+
/* 潘启宝 2026-04-03 14:07:44 星期五 */
|
|
2
|
+
import e from "lodash/pick";
|
|
2
3
|
//#region components/common/utils/pick.ts
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
return t.forEach((t) => {
|
|
6
|
-
let r = t;
|
|
7
|
-
t in e && (n[r] = e[r]);
|
|
8
|
-
}), n;
|
|
9
|
-
}
|
|
10
|
-
function t(e) {
|
|
4
|
+
var t = e;
|
|
5
|
+
function n(e) {
|
|
11
6
|
let t = {};
|
|
12
7
|
return Object.entries(e ?? {}).forEach(([e, n], r, i) => {
|
|
13
8
|
e.startsWith("data-") && (t[e] = n), e.startsWith("aria-") && (t[e] = n);
|
|
14
9
|
}), t;
|
|
15
10
|
}
|
|
16
11
|
//#endregion
|
|
17
|
-
export {
|
|
12
|
+
export { t as default, t as pick, n as pickDataAttributes };
|
|
18
13
|
/* 独立思考,明辨是非 */
|
package/utils/pinyin.js
CHANGED
package/utils/react19Adapter.js
CHANGED
package/utils/ref.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 潘启宝 2026-03
|
|
1
|
+
/* 潘启宝 2026-04-03 14:07:44 星期五 */
|
|
2
2
|
import { isFunction as e, isObjectLike as t, isReact19 as n, isReactComponentAndNotFragment as r } from "./is.js";
|
|
3
3
|
import i from "../hooks/use-memo/index.js";
|
|
4
4
|
import { isValidElement as a } from "react";
|
package/utils/resizeObserver.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
/* 潘启宝 2026-03
|
|
2
|
-
import {
|
|
3
|
-
import { NOOP as
|
|
4
|
-
import
|
|
1
|
+
/* 潘启宝 2026-04-03 14:07:44 星期五 */
|
|
2
|
+
import { isElementByInstanceof as e, isFunction as t } from "./is.js";
|
|
3
|
+
import { NOOP as n } from "./constant.js";
|
|
4
|
+
import r from "lodash/throttle";
|
|
5
5
|
//#region components/common/utils/resizeObserver.ts
|
|
6
|
-
function
|
|
7
|
-
let
|
|
8
|
-
if (!(
|
|
9
|
-
let
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
function i(i, a) {
|
|
7
|
+
let o = [].concat(i).filter((t, n, r) => e(t));
|
|
8
|
+
if (!(o.length && t(a))) return n;
|
|
9
|
+
let s, c = r((...e) => {
|
|
10
|
+
u(), s = window.requestAnimationFrame(() => {
|
|
11
|
+
a(...e);
|
|
12
12
|
});
|
|
13
|
-
}, 227),
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
}, 227), l = new ResizeObserver(c);
|
|
14
|
+
o.forEach((e, t, n) => {
|
|
15
|
+
l.observe(e);
|
|
16
16
|
});
|
|
17
|
-
function l() {
|
|
18
|
-
o && window.cancelAnimationFrame(o);
|
|
19
|
-
}
|
|
20
17
|
function u() {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
s && window.cancelAnimationFrame(s);
|
|
19
|
+
}
|
|
20
|
+
function d() {
|
|
21
|
+
o.forEach((e, t, n) => {
|
|
22
|
+
l.unobserve(e);
|
|
23
|
+
}), l.disconnect(), c.cancel(), u();
|
|
24
24
|
}
|
|
25
25
|
return () => {
|
|
26
|
-
|
|
26
|
+
d();
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
//#endregion
|
|
30
|
-
export {
|
|
30
|
+
export { i as default, i as resizeObserver };
|
|
31
31
|
/* 独立思考,明辨是非 */
|
package/utils/saveAs.js
CHANGED
package/utils/screenfull.js
CHANGED
package/utils/setCreateRoot.js
CHANGED
package/utils/setDarkTheme.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 潘启宝 2026-03
|
|
1
|
+
/* 潘启宝 2026-04-03 14:07:44 星期五 */
|
|
2
2
|
import { isElementByInstanceof as e } from "./is.js";
|
|
3
3
|
import { CSS_VARIABLE_ELEMENT as t } from "./constant.js";
|
|
4
4
|
import { UI_PC_THEME_DARK_CLASS_NAME as n } from "@unicom-cloud/utils/constant/ui";
|
package/utils/setDir.js
CHANGED
package/utils/setPrimaryColor.js
CHANGED
package/utils/setTheme.js
CHANGED
package/utils/string.js
CHANGED
package/utils/style.js
CHANGED
package/utils/throttleByRaf.js
CHANGED
package/utils/throttleByRaf2.js
CHANGED
package/utils/tinycolor.js
CHANGED
package/utils/toArray.js
CHANGED
package/utils/tree.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 潘启宝 2026-03
|
|
1
|
+
/* 潘启宝 2026-04-03 14:07:44 星期五 */
|
|
2
2
|
import e, { findNodeBy as t, getChildWithParentBy as n, getItemBy as r, getItemByID as i, getLabelFromDictionaryByValue as a, searchTree as o, default as s } from "@unicom-cloud/utils/tree";
|
|
3
3
|
export { s as default, t as findNodeBy, n as getChildWithParentBy, r as getItemBy, i as getItemByID, a as getLabelFromDictionaryByValue, o as searchTree, e as tree };
|
|
4
4
|
/* 独立思考,明辨是非 */
|
package/utils/tween.js
CHANGED
package/utils/uuid.js
CHANGED
package/utils/validate.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 潘启宝 2026-03
|
|
1
|
+
/* 潘启宝 2026-04-03 14:07:44 星期五 */
|
|
2
2
|
import { PqbValidator as e, Validator as t, ValidatorArray as n, ValidatorBase as r, ValidatorBoolean as i, ValidatorCustom as a, ValidatorNumber as o, ValidatorObject as s, ValidatorSchema as c, ValidatorString as l, ValidatorType as u, validatorLocale as d } from "@unicom-cloud/utils/validate";
|
|
3
3
|
export { e as PqbValidator, t as Validator, n as ValidatorArray, r as ValidatorBase, i as ValidatorBoolean, a as ValidatorCustom, o as ValidatorNumber, s as ValidatorObject, c as ValidatorSchema, l as ValidatorString, u as ValidatorType, d as validatorLocale };
|
|
4
4
|
/* 独立思考,明辨是非 */
|
package/utils/warning.js
CHANGED
package/version/index.js
CHANGED
|
@@ -1,30 +1,27 @@
|
|
|
1
|
-
/* 潘启宝 2026-03
|
|
1
|
+
/* 潘启宝 2026-04-03 14:07:44 星期五 */
|
|
2
2
|
//#region components/common/version/index.ts
|
|
3
3
|
var e = {
|
|
4
4
|
name: "潘启宝",
|
|
5
|
-
date: "2026-03
|
|
5
|
+
date: "2026-04-03 14:07:44",
|
|
6
6
|
platform: "darwin",
|
|
7
7
|
arch: "arm64",
|
|
8
8
|
hostname: "Mac-mini-2.local",
|
|
9
9
|
username: "panqibao",
|
|
10
10
|
cpu: "Apple M4",
|
|
11
11
|
endianness: "LE",
|
|
12
|
-
release: "Darwin25.
|
|
13
|
-
uptime:
|
|
14
|
-
UUID: "
|
|
15
|
-
mac: "
|
|
12
|
+
release: "Darwin25.4.0",
|
|
13
|
+
uptime: 191060,
|
|
14
|
+
UUID: "b5ad029c-610f-47ba-8a7b-81209f210d9b",
|
|
15
|
+
mac: "1a:ff:94:c8:83:73",
|
|
16
16
|
version: {
|
|
17
|
-
node: "
|
|
17
|
+
node: "24.14.0",
|
|
18
18
|
npm: "11.9.0",
|
|
19
|
-
vite: "8.0.
|
|
20
|
-
rolldown: "1.0.0-rc.
|
|
19
|
+
vite: "8.0.3",
|
|
20
|
+
rolldown: "1.0.0-rc.12",
|
|
21
21
|
self: "0.0.0",
|
|
22
|
-
react: "19.2.4"
|
|
23
|
-
redux: "5.0.1",
|
|
24
|
-
reactRedux: "9.2.0",
|
|
25
|
-
reactRouter: "7.13.2"
|
|
22
|
+
react: "19.2.4"
|
|
26
23
|
}
|
|
27
|
-
}, t = "2026-03
|
|
24
|
+
}, t = "2026-04-03 14:07:44", n = "1775196464021", r = "0.1.0";
|
|
28
25
|
//#endregion
|
|
29
26
|
export { r as VERSION, r as default, t as VERSION_BUILD_DATE, e as VERSION_BUILD_INFO, n as VERSION_BUILD_TIME };
|
|
30
27
|
/* 独立思考,明辨是非 */
|
package/motion/CSSMotion.d.ts
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { MotionEndEventHandler, MotionEventHandler, MotionPrepareEventHandler, MotionStatus } from './interface';
|
|
3
|
-
export interface CSSMotionRef {
|
|
4
|
-
nativeElement: HTMLElement;
|
|
5
|
-
inMotion: () => boolean;
|
|
6
|
-
enableMotion: () => boolean;
|
|
7
|
-
}
|
|
8
|
-
export type CSSMotionConfig = boolean | {
|
|
9
|
-
transitionSupport?: boolean;
|
|
10
|
-
};
|
|
11
|
-
export type MotionName = string | {
|
|
12
|
-
appear?: string;
|
|
13
|
-
enter?: string;
|
|
14
|
-
leave?: string;
|
|
15
|
-
appearActive?: string;
|
|
16
|
-
enterActive?: string;
|
|
17
|
-
leaveActive?: string;
|
|
18
|
-
};
|
|
19
|
-
export interface CSSMotionProps {
|
|
20
|
-
motionName?: MotionName;
|
|
21
|
-
visible?: boolean;
|
|
22
|
-
motionAppear?: boolean;
|
|
23
|
-
motionEnter?: boolean;
|
|
24
|
-
motionLeave?: boolean;
|
|
25
|
-
motionLeaveImmediately?: boolean;
|
|
26
|
-
motionDeadline?: number;
|
|
27
|
-
/**
|
|
28
|
-
* Create element in view even the element is invisible.
|
|
29
|
-
* Will patch `display: none` style on it.
|
|
30
|
-
*/
|
|
31
|
-
forceRender?: boolean;
|
|
32
|
-
/**
|
|
33
|
-
* Remove element when motion end. This will not work when `forceRender` is set.
|
|
34
|
-
*/
|
|
35
|
-
removeOnLeave?: boolean;
|
|
36
|
-
leavedClassName?: string;
|
|
37
|
-
/** @private Used by CSSMotionList. Do not use in your production. */
|
|
38
|
-
eventProps?: object;
|
|
39
|
-
/** Prepare phase is used for measure element info. It will always trigger even motion is off */
|
|
40
|
-
onAppearPrepare?: MotionPrepareEventHandler;
|
|
41
|
-
/** Prepare phase is used for measure element info. It will always trigger even motion is off */
|
|
42
|
-
onEnterPrepare?: MotionPrepareEventHandler;
|
|
43
|
-
/** Prepare phase is used for measure element info. It will always trigger even motion is off */
|
|
44
|
-
onLeavePrepare?: MotionPrepareEventHandler;
|
|
45
|
-
onAppearStart?: MotionEventHandler;
|
|
46
|
-
onEnterStart?: MotionEventHandler;
|
|
47
|
-
onLeaveStart?: MotionEventHandler;
|
|
48
|
-
onAppearActive?: MotionEventHandler;
|
|
49
|
-
onEnterActive?: MotionEventHandler;
|
|
50
|
-
onLeaveActive?: MotionEventHandler;
|
|
51
|
-
onAppearEnd?: MotionEndEventHandler;
|
|
52
|
-
onEnterEnd?: MotionEndEventHandler;
|
|
53
|
-
onLeaveEnd?: MotionEndEventHandler;
|
|
54
|
-
/** This will always trigger after final visible changed. Even if no motion configured. */
|
|
55
|
-
onVisibleChanged?: (visible: boolean) => void;
|
|
56
|
-
internalRef?: React.Ref<unknown>;
|
|
57
|
-
children?: (props: {
|
|
58
|
-
visible?: boolean;
|
|
59
|
-
className?: string;
|
|
60
|
-
style?: React.CSSProperties;
|
|
61
|
-
[key: string]: unknown;
|
|
62
|
-
}, ref: React.Ref<unknown>) => React.ReactElement;
|
|
63
|
-
}
|
|
64
|
-
export interface CSSMotionState {
|
|
65
|
-
status?: MotionStatus;
|
|
66
|
-
statusActive?: boolean;
|
|
67
|
-
newStatus?: boolean;
|
|
68
|
-
statusStyle?: React.CSSProperties;
|
|
69
|
-
prevProps?: CSSMotionProps;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* `transitionSupport` is used for none transition test case.
|
|
73
|
-
* Default we use browser transition event support check.
|
|
74
|
-
*/
|
|
75
|
-
export declare function genCSSMotion(config: CSSMotionConfig): React.ForwardRefExoticComponent<CSSMotionProps & React.RefAttributes<CSSMotionRef>>;
|
|
76
|
-
declare const _default: React.ForwardRefExoticComponent<CSSMotionProps & React.RefAttributes<CSSMotionRef>>;
|
|
77
|
-
export default _default;
|
package/motion/CSSMotion.js
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/* 潘启宝 2026-03-24 15:26:24 星期二 */
|
|
2
|
-
import { isObjectLike as e, isString as t } from "../utils/is.js";
|
|
3
|
-
import { getReactElementRef as n, supportRef as r } from "../utils/ref.js";
|
|
4
|
-
import i from "../utils/findRootElement.js";
|
|
5
|
-
import a from "../utils/className.js";
|
|
6
|
-
import { Context as o } from "./context.js";
|
|
7
|
-
import { STATUS_NONE as s } from "./interface.js";
|
|
8
|
-
import { getTransitionName as c, supportTransition as l } from "./util/motion.js";
|
|
9
|
-
import { isActive as u } from "./hooks/useStepQueue.js";
|
|
10
|
-
import d from "./hooks/useStatus.js";
|
|
11
|
-
import f, { useRef as p } from "react";
|
|
12
|
-
//#region components/common/motion/CSSMotion.tsx
|
|
13
|
-
function m(l) {
|
|
14
|
-
let m = l;
|
|
15
|
-
e(l) && ({transitionSupport: m} = l);
|
|
16
|
-
function h(e, t) {
|
|
17
|
-
return !!(e.motionName && m && t !== !1);
|
|
18
|
-
}
|
|
19
|
-
let g = f.forwardRef((e, l) => {
|
|
20
|
-
let { visible: m = !0, removeOnLeave: g = !0, forceRender: _, children: v, motionName: y, leavedClassName: b, eventProps: x } = e, { motion: S } = f.useContext(o), C = h(e, S), w = p(null);
|
|
21
|
-
function T() {
|
|
22
|
-
return i(w);
|
|
23
|
-
}
|
|
24
|
-
let [E, D, O, k] = d(C, m, T, e), A = E(), j = f.useRef(k);
|
|
25
|
-
k && (j.current = !0);
|
|
26
|
-
let M = f.useMemo(() => {
|
|
27
|
-
let e = {};
|
|
28
|
-
return Object.defineProperties(e, {
|
|
29
|
-
nativeElement: {
|
|
30
|
-
enumerable: !0,
|
|
31
|
-
get: T
|
|
32
|
-
},
|
|
33
|
-
inMotion: {
|
|
34
|
-
enumerable: !0,
|
|
35
|
-
get: () => () => E() !== s
|
|
36
|
-
},
|
|
37
|
-
enableMotion: {
|
|
38
|
-
enumerable: !0,
|
|
39
|
-
get: () => () => C
|
|
40
|
-
}
|
|
41
|
-
}), e;
|
|
42
|
-
}, []);
|
|
43
|
-
f.useImperativeHandle(l, () => M, []);
|
|
44
|
-
let N, P = {
|
|
45
|
-
...x,
|
|
46
|
-
visible: m
|
|
47
|
-
};
|
|
48
|
-
if (!v) N = null;
|
|
49
|
-
else if (A === "none") N = k ? v({ ...P }, w) : !g && j.current && b ? v({
|
|
50
|
-
...P,
|
|
51
|
-
className: b
|
|
52
|
-
}, w) : _ || !g && !b ? v({
|
|
53
|
-
...P,
|
|
54
|
-
style: { display: "none" }
|
|
55
|
-
}, w) : null;
|
|
56
|
-
else {
|
|
57
|
-
let e;
|
|
58
|
-
D === "prepare" ? e = "prepare" : u(D) ? e = "active" : D === "start" && (e = "start");
|
|
59
|
-
let n = c(y, `${A}-${e}`);
|
|
60
|
-
N = v({
|
|
61
|
-
...P,
|
|
62
|
-
className: a(c(y, A), {
|
|
63
|
-
[n]: n && e,
|
|
64
|
-
[y]: t(y)
|
|
65
|
-
}),
|
|
66
|
-
style: O
|
|
67
|
-
}, w);
|
|
68
|
-
}
|
|
69
|
-
return f.isValidElement(N) && r(N) && (n(N) || (N = f.cloneElement(N, { ref: w }))), N;
|
|
70
|
-
});
|
|
71
|
-
return g.displayName = "CSSMotion", g;
|
|
72
|
-
}
|
|
73
|
-
var h = m(l);
|
|
74
|
-
//#endregion
|
|
75
|
-
export { h as default, m as genCSSMotion };
|
|
76
|
-
/* 独立思考,明辨是非 */
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { CSSMotionProps } from './CSSMotion';
|
|
3
|
-
import type { KeyObject } from './util/diff';
|
|
4
|
-
export interface CSSMotionListProps extends Omit<CSSMotionProps, 'onVisibleChanged' | 'children'>, Omit<React.HTMLAttributes<unknown>, 'children'> {
|
|
5
|
-
keys: (React.Key | {
|
|
6
|
-
key: React.Key;
|
|
7
|
-
[name: string]: unknown;
|
|
8
|
-
})[];
|
|
9
|
-
component?: string | React.ComponentType | false;
|
|
10
|
-
/** This will always trigger after final visible changed. Even if no motion configured. */
|
|
11
|
-
onVisibleChanged?: (visible: boolean, info: {
|
|
12
|
-
key: React.Key;
|
|
13
|
-
}) => void;
|
|
14
|
-
/** All motion leaves in the screen */
|
|
15
|
-
onAllRemoved?: () => void;
|
|
16
|
-
children?: (props: {
|
|
17
|
-
visible?: boolean;
|
|
18
|
-
className?: string;
|
|
19
|
-
style?: React.CSSProperties;
|
|
20
|
-
index?: number;
|
|
21
|
-
[key: string]: unknown;
|
|
22
|
-
}, ref: React.Ref<unknown>) => React.ReactElement;
|
|
23
|
-
}
|
|
24
|
-
export interface CSSMotionListState {
|
|
25
|
-
keyEntities: KeyObject[];
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Generate a CSSMotionList component with config
|
|
29
|
-
* @param transitionSupport No need since CSSMotionList no longer depends on transition support
|
|
30
|
-
* @param CSSMotion CSSMotion component
|
|
31
|
-
*/
|
|
32
|
-
export declare function genCSSMotionList(transitionSupport: boolean, CSSMotion?: React.ForwardRefExoticComponent<CSSMotionProps & React.RefAttributes<import("./CSSMotion").CSSMotionRef>>): React.ComponentClass<CSSMotionListProps>;
|
|
33
|
-
declare const _default: React.ComponentClass<CSSMotionListProps, any>;
|
|
34
|
-
export default _default;
|
package/motion/CSSMotionList.js
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
/* 潘启宝 2026-03-24 15:26:24 星期二 */
|
|
2
|
-
import { supportTransition as e } from "./util/motion.js";
|
|
3
|
-
import t from "./CSSMotion.js";
|
|
4
|
-
import { STATUS_REMOVED as n, diffKeys as r, parseKeys as i } from "./util/diff.js";
|
|
5
|
-
import a, { createElement as o } from "react";
|
|
6
|
-
import { jsx as s } from "react/jsx-runtime";
|
|
7
|
-
//#region components/common/motion/CSSMotionList.tsx
|
|
8
|
-
var c = [
|
|
9
|
-
"eventProps",
|
|
10
|
-
"visible",
|
|
11
|
-
"children",
|
|
12
|
-
"motionName",
|
|
13
|
-
"motionAppear",
|
|
14
|
-
"motionEnter",
|
|
15
|
-
"motionLeave",
|
|
16
|
-
"motionLeaveImmediately",
|
|
17
|
-
"motionDeadline",
|
|
18
|
-
"removeOnLeave",
|
|
19
|
-
"leavedClassName",
|
|
20
|
-
"onAppearPrepare",
|
|
21
|
-
"onAppearStart",
|
|
22
|
-
"onAppearActive",
|
|
23
|
-
"onAppearEnd",
|
|
24
|
-
"onEnterStart",
|
|
25
|
-
"onEnterActive",
|
|
26
|
-
"onEnterEnd",
|
|
27
|
-
"onLeaveStart",
|
|
28
|
-
"onLeaveActive",
|
|
29
|
-
"onLeaveEnd"
|
|
30
|
-
];
|
|
31
|
-
function l(e, l = t) {
|
|
32
|
-
class u extends a.Component {
|
|
33
|
-
constructor(...e) {
|
|
34
|
-
super(...e), this.state = { keyEntities: [] }, this.removeKey = (e) => {
|
|
35
|
-
this.setState((t) => ({ keyEntities: t.keyEntities.map((t) => t.key === e ? {
|
|
36
|
-
...t,
|
|
37
|
-
status: n
|
|
38
|
-
} : t) }), () => {
|
|
39
|
-
let { keyEntities: e } = this.state;
|
|
40
|
-
e.filter(({ status: e }) => e !== "removed").length === 0 && this.props.onAllRemoved && this.props.onAllRemoved();
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
static {
|
|
45
|
-
this.defaultProps = { component: "div" };
|
|
46
|
-
}
|
|
47
|
-
static getDerivedStateFromProps({ keys: e }, { keyEntities: t }) {
|
|
48
|
-
return { keyEntities: r(t, i(e)).filter((e) => {
|
|
49
|
-
let n = t.find(({ key: t }) => e.key === t);
|
|
50
|
-
return !(n && n.status === "removed" && e.status === "remove");
|
|
51
|
-
}) };
|
|
52
|
-
}
|
|
53
|
-
render() {
|
|
54
|
-
let { keyEntities: e } = this.state, { component: t, children: n, onVisibleChanged: r, onAllRemoved: i, ...u } = this.props, d = t || a.Fragment, f = {};
|
|
55
|
-
return c.forEach((e) => {
|
|
56
|
-
f[e] = u[e], delete u[e];
|
|
57
|
-
}), delete u.keys, /* @__PURE__ */ s(d, {
|
|
58
|
-
...u,
|
|
59
|
-
children: e.map(({ status: e, ...t }, i) => {
|
|
60
|
-
let a = e === "add" || e === "keep";
|
|
61
|
-
return /* @__PURE__ */ o(l, {
|
|
62
|
-
...f,
|
|
63
|
-
key: t.key,
|
|
64
|
-
visible: a,
|
|
65
|
-
eventProps: t,
|
|
66
|
-
onVisibleChanged: (e) => {
|
|
67
|
-
r?.(e, { key: t.key }), e || this.removeKey(t.key);
|
|
68
|
-
}
|
|
69
|
-
}, (e, t) => n({
|
|
70
|
-
...e,
|
|
71
|
-
index: i
|
|
72
|
-
}, t));
|
|
73
|
-
})
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
return u;
|
|
78
|
-
}
|
|
79
|
-
var u = l(e);
|
|
80
|
-
//#endregion
|
|
81
|
-
export { u as default, l as genCSSMotionList };
|
|
82
|
-
/* 独立思考,明辨是非 */
|
package/motion/context.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface MotionContextProps {
|
|
3
|
-
motion?: boolean;
|
|
4
|
-
}
|
|
5
|
-
export declare const Context: React.Context<MotionContextProps>;
|
|
6
|
-
export default function MotionProvider({ children, ...props }: MotionContextProps & {
|
|
7
|
-
children?: React.ReactNode;
|
|
8
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export {};
|
package/motion/context.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/* 潘启宝 2026-03-24 15:26:24 星期二 */
|
|
2
|
-
import e from "react";
|
|
3
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
-
//#region components/common/motion/context.tsx
|
|
5
|
-
var n = e.createContext({});
|
|
6
|
-
function r({ children: e, ...r }) {
|
|
7
|
-
return /* @__PURE__ */ t(n.Provider, {
|
|
8
|
-
value: r,
|
|
9
|
-
children: e
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
//#endregion
|
|
13
|
-
export { n as Context, r as default };
|
|
14
|
-
/* 独立思考,明辨是非 */
|