@unicom-cloud/ui-common 0.1.53 → 0.1.55
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 +2 -3
- package/animation/Animation.js +2 -3
- package/animation/constants.js +2 -3
- package/animation/context.js +2 -3
- package/animation/index.js +2 -3
- package/animation/style/index.js +1 -1
- package/animation/utils.js +1 -1
- package/base/Base.js +2 -3
- package/base/constants.js +1 -1
- package/base/context.js +2 -3
- package/base/index.js +2 -3
- package/base/style/index.js +1 -1
- package/base/utils.js +1 -1
- package/border-beam/BorderBeam.js +2 -3
- package/border-beam/Effect.js +2 -3
- package/border-beam/constants.js +2 -3
- package/border-beam/context.js +2 -3
- package/border-beam/hooks/useBorderSize.js +2 -3
- package/border-beam/hooks/useChildDom.js +2 -3
- package/border-beam/index.js +2 -3
- package/border-beam/style/index.js +1 -1
- package/border-beam/utils.js +2 -3
- package/development/Development.js +2 -3
- package/development/constants.js +1 -1
- package/development/context.js +2 -3
- package/development/index.js +2 -3
- package/development/style/index.js +1 -1
- package/development/utils.js +1 -1
- package/empty/Empty.js +2 -3
- package/empty/constants.js +1 -1
- package/empty/context.js +2 -3
- package/empty/index.js +2 -3
- package/empty/style/index.js +1 -1
- package/empty/utils.js +1 -1
- package/flex/Flex.js +18 -17
- package/flex/FlexVertical.js +2 -3
- package/flex/constants.js +1 -1
- package/flex/context.js +2 -3
- package/flex/index.js +2 -3
- package/flex/style/index.js +1 -1
- package/flex/utils.js +2 -3
- package/grid/Grid.js +2 -3
- package/grid/Item.js +2 -3
- package/grid/constants.js +1 -1
- package/grid/context.js +2 -3
- package/grid/index.js +2 -3
- package/grid/style/index.js +1 -1
- package/grid/utils.js +2 -3
- package/higher-order/index.js +1 -4
- package/higher-order/with-speech-synthesis/context.js +2 -3
- package/higher-order/with-speech-synthesis/index.js +2 -3
- package/higher-order/with-speech-synthesis/style/index.js +1 -1
- package/higher-order/with-speech-synthesis/withSpeechSynthesis.js +2 -3
- package/hoc/withContext.js +2 -3
- package/hooks/create-deep-compare-effect/index.js +2 -3
- package/hooks/create-update-effect/index.js +2 -3
- package/hooks/create-use-storage-state/index.js +2 -3
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +14 -13
- package/hooks/use-async-effect/index.js +2 -3
- package/hooks/use-boolean/index.js +2 -3
- package/hooks/use-click-away/index.js +2 -3
- package/hooks/use-computed-state/index.js +2 -3
- package/hooks/use-controllable-value/index.js +2 -3
- package/hooks/use-cookie-state/index.js +2 -3
- package/hooks/use-count-down/index.js +2 -3
- package/hooks/use-counter/index.js +2 -3
- package/hooks/use-create/index.js +2 -3
- package/hooks/use-creation/index.js +3 -4
- package/hooks/use-debounce/index.js +2 -3
- package/hooks/use-debounce-effect/index.js +2 -3
- package/hooks/use-debounce-fn/index.js +2 -3
- package/hooks/use-deep-compare-effect/index.js +2 -3
- package/hooks/use-deep-compare-layout-effect/index.js +2 -3
- package/hooks/use-document-visibility/index.js +2 -3
- package/hooks/use-drag/index.js +2 -3
- package/hooks/use-drag-move/index.js +2 -3
- package/hooks/use-drop/index.js +3 -14
- package/hooks/use-effect-event/index.js +2 -3
- package/hooks/use-event/index.js +2 -3
- package/hooks/use-event-emitter/index.js +2 -3
- package/hooks/use-event-listener/index.js +2 -3
- package/hooks/use-event-target/index.js +2 -3
- package/hooks/use-external/index.js +2 -3
- package/hooks/use-favicon/index.js +2 -3
- package/hooks/use-focus-within/index.js +2 -3
- package/hooks/use-force-update/index.js +2 -3
- package/hooks/use-fullscreen/index.js +5 -15
- package/hooks/use-get-state/index.js +2 -3
- package/hooks/use-history-travel/index.js +2 -3
- package/hooks/use-hover/index.js +2 -3
- package/hooks/use-id/index.js +2 -3
- package/hooks/use-in-viewport/index.js +17 -18
- package/hooks/use-infinite-scroll/index.js +2 -3
- package/hooks/use-intersection-observer/index.js +2 -3
- package/hooks/use-intersection-observers/index.js +19 -20
- package/hooks/use-interval/index.js +2 -3
- package/hooks/use-is-first-render/index.js +2 -3
- package/hooks/use-isomorphic-layout-effect/index.js +2 -3
- package/hooks/use-key-press/index.js +2 -3
- package/hooks/use-keyboard-event/index.js +2 -3
- package/hooks/use-latest/index.js +2 -3
- package/hooks/use-listen-window-resize/index.js +2 -3
- package/hooks/use-local-storage-state/index.js +2 -3
- package/hooks/use-lock-fn/index.js +2 -3
- package/hooks/use-long-press/index.js +2 -3
- package/hooks/use-map/index.js +2 -3
- package/hooks/use-media/index.js +2 -3
- package/hooks/use-memo/index.js +2 -3
- package/hooks/use-memoized-fn/index.js +2 -3
- package/hooks/use-merge-component-props/index.js +2 -3
- package/hooks/use-merge-value/index.js +2 -3
- package/hooks/use-mobile/index.js +2 -3
- package/hooks/use-mount/index.js +2 -3
- package/hooks/use-mouse/index.js +2 -3
- package/hooks/use-move/index.js +1 -4
- package/hooks/use-mutation-observer/index.js +2 -3
- package/hooks/use-mutation-observers/index.js +19 -20
- package/hooks/use-network/index.js +2 -3
- package/hooks/use-online-status/index.js +2 -3
- package/hooks/use-overflow-hidden/index.js +2 -3
- package/hooks/use-override-ref/index.js +2 -3
- package/hooks/use-pagination/index.js +2 -3
- package/hooks/use-paste-file/index.d.ts +10 -0
- package/hooks/use-paste-file/index.js +29 -0
- package/hooks/use-paste-image/index.d.ts +2 -3
- package/hooks/use-paste-image/index.js +8 -20
- package/hooks/use-persist-callback/index.js +2 -3
- package/hooks/use-prefers-color-scheme-dark/index.js +2 -3
- package/hooks/use-previous/index.js +2 -3
- package/hooks/use-raf-interval/index.js +2 -3
- package/hooks/use-raf-state/index.js +2 -3
- package/hooks/use-raf-timeout/index.js +2 -3
- package/hooks/use-reactive/index.js +2 -3
- package/hooks/use-ref-latest/index.js +2 -3
- package/hooks/use-ref-map/index.js +2 -3
- package/hooks/use-refs/index.js +2 -3
- package/hooks/use-request/index.js +2 -3
- package/hooks/use-request/src/Fetch.js +2 -3
- package/hooks/use-request/src/plugins/useAutoRunPlugin.js +2 -3
- package/hooks/use-request/src/plugins/useCachePlugin.js +3 -4
- package/hooks/use-request/src/plugins/useDebouncePlugin.js +2 -3
- package/hooks/use-request/src/plugins/useLoadingDelayPlugin.js +2 -3
- package/hooks/use-request/src/plugins/usePollingPlugin.js +2 -3
- package/hooks/use-request/src/plugins/useRefreshOnWindowFocusPlugin.js +2 -3
- package/hooks/use-request/src/plugins/useRetryPlugin.js +2 -3
- package/hooks/use-request/src/plugins/useThrottlePlugin.js +2 -3
- package/hooks/use-request/src/useRequest.js +2 -3
- package/hooks/use-request/src/useRequestImplement.js +2 -3
- package/hooks/use-request/src/utils/cache.js +2 -3
- package/hooks/use-request/src/utils/cachePromise.js +2 -3
- package/hooks/use-request/src/utils/cacheSubscribe.js +2 -3
- package/hooks/use-request/src/utils/isDocumentVisible.js +2 -3
- package/hooks/use-request/src/utils/isOnline.js +2 -3
- package/hooks/use-request/src/utils/limit.js +2 -3
- package/hooks/use-request/src/utils/subscribeFocus.js +2 -3
- package/hooks/use-request/src/utils/subscribeReVisible.js +2 -3
- package/hooks/use-reset-state/index.js +2 -3
- package/hooks/use-resize-observer/index.js +2 -3
- package/hooks/use-resize-observers/index.js +19 -20
- package/hooks/use-responsive/index.js +2 -3
- package/hooks/use-safe-state/index.js +2 -3
- package/hooks/use-scroll/index.js +2 -3
- package/hooks/use-selections/index.js +2 -3
- package/hooks/use-session-storage-state/index.js +2 -3
- package/hooks/use-set/index.js +2 -3
- package/hooks/use-set-state/index.js +2 -3
- package/hooks/use-size/index.js +2 -3
- package/hooks/use-state-callback/index.js +11 -12
- package/hooks/use-state-with-promise/index.js +2 -3
- package/hooks/use-sync-state/index.js +2 -3
- package/hooks/use-text-selection/index.js +2 -3
- package/hooks/use-theme/index.js +2 -3
- package/hooks/use-throttle/index.js +2 -3
- package/hooks/use-throttle-effect/index.js +2 -3
- package/hooks/use-throttle-fn/index.js +2 -3
- package/hooks/use-throttle-fn-with-raf/index.js +2 -3
- package/hooks/use-timeout/index.js +2 -3
- package/hooks/use-title/index.js +2 -3
- package/hooks/use-toggle/index.js +2 -3
- package/hooks/use-tracked-effect/index.js +2 -3
- package/hooks/use-unmount/index.js +2 -3
- package/hooks/use-unmounted-ref/index.js +2 -3
- package/hooks/use-update/index.js +2 -3
- package/hooks/use-update-effect/index.js +2 -3
- package/hooks/use-update-layout-effect/index.js +2 -3
- package/hooks/use-url-state/index.js +2 -3
- package/hooks/use-virtual-list/index.js +3 -8
- package/hooks/use-watch/index.js +2 -3
- package/hooks/use-web-socket/index.js +3 -4
- package/hooks/use-why-did-you-update/index.js +2 -3
- package/hooks/use-window-size/index.js +2 -3
- package/hooks/utils/createEffectWithTarget.js +3 -8
- package/hooks/utils/depsAreSame.js +2 -3
- package/hooks/utils/depsEqual.js +2 -3
- package/hooks/utils/domTarget.js +2 -3
- package/hooks/utils/getDocumentOrShadow.js +2 -3
- package/hooks/utils/index.js +2 -3
- package/hooks/utils/isAppleDevice.js +2 -3
- package/hooks/utils/isBrowser.js +2 -3
- package/hooks/utils/isDev.js +2 -3
- package/hooks/utils/rect.js +2 -3
- package/hooks/utils/useDeepCompareWithTarget.js +2 -3
- package/hooks/utils/useEffectWithTarget.js +2 -3
- package/hooks/utils/useIsomorphicLayoutEffectWithTarget.js +2 -3
- package/hooks/utils/useLayoutEffectWithTarget.js +2 -3
- package/icons/file/File.js +2 -3
- package/icons/file/context.js +2 -3
- package/icons/file/index.js +2 -3
- package/icons/file/style/index.js +1 -1
- package/index.js +554 -557
- package/morphicons/core/interpolate.js +2 -3
- package/morphicons/core/normalize.js +2 -3
- package/morphicons/core/parse.js +0 -1
- package/morphicons/core/plan.js +4 -11
- package/morphicons/core/resample.js +2 -3
- package/morphicons/core/serialize.js +2 -3
- package/morphicons/core/spring.js +2 -3
- package/morphicons/dom/index.js +2 -3
- package/morphicons/index.js +1 -1
- package/morphicons/react/index.js +3 -4
- package/package.json +1 -1
- package/progress/Progress.js +40 -41
- package/progress/constants.js +1 -1
- package/progress/context.js +1 -1
- package/progress/index.js +2 -3
- package/progress/style/index.js +1 -1
- package/progress/utils.js +1 -1
- package/resize-observer/Collection.js +2 -3
- package/resize-observer/ResizeObserver.js +2 -3
- package/resize-observer/SingleObserver.js +2 -3
- package/resize-observer/constants.js +1 -1
- package/resize-observer/context.js +2 -3
- package/resize-observer/index.js +2 -3
- package/resize-observer/observerUtil.js +2 -3
- package/resize-observer/style/index.js +1 -1
- package/resize-observer/utils.js +1 -1
- package/space/Space.js +42 -42
- package/space/SpaceVertical.js +7 -7
- package/space/constants.js +1 -1
- package/space/context.js +7 -7
- package/space/index.js +2 -3
- package/space/style/index.js +1 -1
- package/space/utils.js +1 -1
- package/suspense-fallback-test/SuspenseFallbackTest.js +2 -3
- package/suspense-fallback-test/constants.js +1 -1
- package/suspense-fallback-test/context.js +2 -3
- package/suspense-fallback-test/index.js +2 -3
- package/suspense-fallback-test/style/index.js +1 -1
- package/suspense-fallback-test/utils.js +1 -1
- package/test.js +2 -3
- package/timer/Timer.js +2 -3
- package/timer/constants.js +1 -1
- package/timer/context.js +2 -3
- package/timer/index.js +2 -3
- package/timer/style/index.js +1 -1
- package/timer/utils.js +1 -1
- package/transition/Transition.js +2 -3
- package/transition/TransitionCSS.js +2 -3
- package/transition/TransitionGroup.js +2 -3
- package/transition/TransitionStyle.js +2 -3
- package/transition/constants.js +2 -3
- package/transition/context.js +2 -3
- package/transition/index.js +2 -3
- package/transition/style/index.js +1 -1
- package/transition/utils.js +2 -3
- package/utils/call.d.ts +1 -0
- package/utils/call.js +3 -0
- package/utils/callbackOriginRef.js +2 -3
- package/utils/caseName.js +1 -4
- package/utils/className.js +1 -4
- package/utils/confetti.js +3 -4
- package/utils/constants.js +2 -3
- package/utils/copy.js +2 -3
- package/utils/createRoot.js +16 -17
- package/utils/css.js +1 -1
- package/utils/date.js +1 -4
- package/utils/dayjs.js +12 -12
- package/utils/document.js +2 -3
- package/utils/dom.js +2 -3
- package/utils/emitter.js +1 -4
- package/utils/file.js +1 -1
- package/utils/fileRead.js +1 -4
- package/utils/fileToDataURL.js +1 -4
- package/utils/fillNBSP.js +2 -3
- package/utils/getCompatProp.js +2 -3
- package/utils/getElement.js +14 -15
- package/utils/getHighlightText.js +2 -3
- package/utils/getHotkeyHandler.js +2 -3
- package/utils/getPrefixCls.js +2 -3
- package/utils/getScrollBarHeight.js +2 -3
- package/utils/getScrollBarSize.js +2 -3
- package/utils/getScrollBarWidth.js +2 -3
- package/utils/getScrollParent.js +2 -3
- package/utils/getStringLength.js +2 -3
- package/utils/getUrlSearchParam.js +2 -3
- package/utils/index.d.ts +1 -3
- package/utils/index.js +268 -273
- package/utils/initAllLineClamp.js +2 -3
- package/utils/injectLineClamp.js +2 -3
- package/utils/intersectionObserver.js +2 -3
- package/utils/is.js +2 -3
- package/utils/keyboardCode.js +2 -3
- package/utils/lodash.d.ts +2 -1
- package/utils/lodash.js +12 -11
- package/utils/math.js +1 -4
- package/utils/mergeProps.js +2 -3
- package/utils/mergedToString.js +2 -3
- package/utils/migrateLegacyProps.js +2 -3
- package/utils/mutationObserver.js +2 -3
- package/utils/names.js +22 -3
- package/utils/object.js +2 -3
- package/utils/omit.js +2 -3
- package/utils/pad.js +2 -3
- package/utils/pick.js +2 -3
- package/utils/pinyin.js +1 -4
- package/utils/react19Adapter.js +2 -3
- package/utils/reactNode.js +2 -3
- package/utils/ref.js +2 -3
- package/utils/resizeObserver.js +2 -3
- package/utils/saveAs.js +1 -4
- package/utils/screenfull.js +1 -4
- package/utils/scrollIntoViewIfNeeded.js +2 -3
- package/utils/scrollTo.js +2 -3
- package/utils/setDarkTheme.js +2 -3
- package/utils/setDir.js +2 -3
- package/utils/setPrimaryColor.js +2 -3
- package/utils/setTheme.js +2 -3
- package/utils/string.js +2 -3
- package/utils/style.js +2 -3
- package/utils/tinycolor.js +2 -3
- package/utils/toArray.js +2 -3
- package/utils/tree.js +1 -4
- package/utils/tunnel.js +2 -3
- package/utils/uuid.js +1 -4
- package/utils/validate.d.ts +2 -2
- package/utils/validate.js +1 -4
- package/utils/warning.js +2 -3
- package/version/index.js +11 -12
- package/utils/callOrReturn.d.ts +0 -1
- package/utils/callOrReturn.js +0 -6
- package/utils/include.d.ts +0 -3
- package/utils/include.js +0 -13
- package/utils/tween.d.ts +0 -1
- package/utils/tween.js +0 -6
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/* 潘启宝 2026-10-
|
|
1
|
+
/* 潘启宝 2026-10-29 16:11:51 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import e from "../use-latest/index.js";
|
|
4
4
|
import t from "../utils/domTarget.js";
|
|
5
5
|
import n from "../utils/isAppleDevice.js";
|
|
6
6
|
import r from "../utils/useDeepCompareWithTarget.js";
|
|
7
7
|
import { isArray as i, isFunction as a, isNumber as o, isStringOrNumber as s } from "@unicom-cloud/utils/is";
|
|
8
|
-
|
|
8
|
+
// components/common/hooks/use-key-press/index.ts
|
|
9
9
|
var c = {
|
|
10
10
|
0: 48,
|
|
11
11
|
1: 49,
|
|
@@ -164,7 +164,6 @@ function h(n, i, a) {
|
|
|
164
164
|
};
|
|
165
165
|
}, [o], s);
|
|
166
166
|
}
|
|
167
|
-
//#endregion
|
|
168
167
|
export { h as default };
|
|
169
168
|
/* 欲穷千里目,更上一层楼 */
|
|
170
169
|
/* 独立思考,明辨是非 */
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
/* 潘启宝 2026-10-
|
|
1
|
+
/* 潘启宝 2026-10-29 16:11:51 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import { useCallback as e } from "react";
|
|
4
4
|
import { ArrowDown as t, ArrowLeft as n, ArrowRight as r, ArrowUp as i, Enter as a } from "@unicom-cloud/utils/constants/keyboardCode";
|
|
5
|
-
|
|
5
|
+
// components/common/hooks/use-keyboard-event/index.ts
|
|
6
6
|
function o(o = {}) {
|
|
7
7
|
return e((e) => ({ onKeyDown(s) {
|
|
8
8
|
let c = s.key;
|
|
9
9
|
c === a.key && e.onPressEnter?.(s, c), c === t.key && e.onArrowDown?.(s, c), c === n.key && e.onArrowLeft?.(s, c), c === r.key && e.onArrowRight?.(s, c), c === i.key && e.onArrowUp?.(s, c), o.onKeyDown?.(s);
|
|
10
10
|
} }), []);
|
|
11
11
|
}
|
|
12
|
-
//#endregion
|
|
13
12
|
export { o as default };
|
|
14
13
|
/* 欲穷千里目,更上一层楼 */
|
|
15
14
|
/* 独立思考,明辨是非 */
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
/* 潘启宝 2026-10-
|
|
1
|
+
/* 潘启宝 2026-10-29 16:11:51 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import { useRef as e } from "react";
|
|
4
|
-
|
|
4
|
+
// components/common/hooks/use-latest/index.ts
|
|
5
5
|
function t(t) {
|
|
6
6
|
let n = e(t);
|
|
7
7
|
return n.current = t, n;
|
|
8
8
|
}
|
|
9
|
-
//#endregion
|
|
10
9
|
export { t as default };
|
|
11
10
|
/* 欲穷千里目,更上一层楼 */
|
|
12
11
|
/* 独立思考,明辨是非 */
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
/* 潘启宝 2026-10-
|
|
1
|
+
/* 潘启宝 2026-10-29 16:11:51 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import { useEffect as e } from "react";
|
|
4
|
-
|
|
4
|
+
// components/common/hooks/use-listen-window-resize/index.ts
|
|
5
5
|
function t(t, n = []) {
|
|
6
6
|
e(() => (window.addEventListener("resize", t), window.addEventListener("orientationchange", t), () => {
|
|
7
7
|
window.removeEventListener("resize", t), window.removeEventListener("orientationchange", t);
|
|
8
8
|
}), [...n]);
|
|
9
9
|
}
|
|
10
|
-
//#endregion
|
|
11
10
|
export { t as default };
|
|
12
11
|
/* 欲穷千里目,更上一层楼 */
|
|
13
12
|
/* 独立思考,明辨是非 */
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
/* 潘启宝 2026-10-
|
|
1
|
+
/* 潘启宝 2026-10-29 16:11:51 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import e from "../utils/isBrowser.js";
|
|
4
4
|
import t from "../create-use-storage-state/index.js";
|
|
5
|
-
|
|
5
|
+
// components/common/hooks/use-local-storage-state/index.ts
|
|
6
6
|
var n = t(() => e ? localStorage : void 0);
|
|
7
|
-
//#endregion
|
|
8
7
|
export { n as default };
|
|
9
8
|
/* 欲穷千里目,更上一层楼 */
|
|
10
9
|
/* 独立思考,明辨是非 */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/* 潘启宝 2026-10-
|
|
1
|
+
/* 潘启宝 2026-10-29 16:11:51 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import { useCallback as e, useRef as t } from "react";
|
|
4
|
-
|
|
4
|
+
// components/common/hooks/use-lock-fn/index.ts
|
|
5
5
|
function n(n) {
|
|
6
6
|
let r = t(!1);
|
|
7
7
|
return e(async (...e) => {
|
|
@@ -17,7 +17,6 @@ function n(n) {
|
|
|
17
17
|
}
|
|
18
18
|
}, [n]);
|
|
19
19
|
}
|
|
20
|
-
//#endregion
|
|
21
20
|
export { n as default };
|
|
22
21
|
/* 欲穷千里目,更上一层楼 */
|
|
23
22
|
/* 独立思考,明辨是非 */
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/* 潘启宝 2026-10-
|
|
1
|
+
/* 潘启宝 2026-10-29 16:11:51 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import e from "../use-latest/index.js";
|
|
4
4
|
import t from "../utils/domTarget.js";
|
|
5
5
|
import n from "../utils/useEffectWithTarget.js";
|
|
6
6
|
import { useRef as r } from "react";
|
|
7
|
-
|
|
7
|
+
// components/common/hooks/use-long-press/index.ts
|
|
8
8
|
function i(i, a, { delay: o = 300, moveThreshold: s, onClick: c, onLongPressEnd: l } = {}) {
|
|
9
9
|
let u = e(i), d = e(c), f = e(l), p = r(void 0), m = r(!1), h = r({
|
|
10
10
|
x: 0,
|
|
@@ -57,7 +57,6 @@ function i(i, a, { delay: o = 300, moveThreshold: s, onClick: c, onLongPressEnd:
|
|
|
57
57
|
};
|
|
58
58
|
}, [], a);
|
|
59
59
|
}
|
|
60
|
-
//#endregion
|
|
61
60
|
export { i as default };
|
|
62
61
|
/* 欲穷千里目,更上一层楼 */
|
|
63
62
|
/* 独立思考,明辨是非 */
|
package/hooks/use-map/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/* 潘启宝 2026-10-
|
|
1
|
+
/* 潘启宝 2026-10-29 16:11:51 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import e from "../use-memoized-fn/index.js";
|
|
4
4
|
import { useState as t } from "react";
|
|
5
|
-
|
|
5
|
+
// components/common/hooks/use-map/index.ts
|
|
6
6
|
function n(n) {
|
|
7
7
|
let r = () => new Map(n), [i, a] = t(r);
|
|
8
8
|
return [i, {
|
|
@@ -25,7 +25,6 @@ function n(n) {
|
|
|
25
25
|
get: e((e) => i.get(e))
|
|
26
26
|
}];
|
|
27
27
|
}
|
|
28
|
-
//#endregion
|
|
29
28
|
export { n as default };
|
|
30
29
|
/* 欲穷千里目,更上一层楼 */
|
|
31
30
|
/* 独立思考,明辨是非 */
|
package/hooks/use-media/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/* 潘启宝 2026-10-
|
|
1
|
+
/* 潘启宝 2026-10-29 16:11:51 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import { useEffect as e, useState as t } from "react";
|
|
4
4
|
import { isUndefined as n } from "@unicom-cloud/utils/is";
|
|
5
|
-
|
|
5
|
+
// components/common/hooks/use-media/index.ts
|
|
6
6
|
var r = (e, t) => n(t) ? window.matchMedia(e).matches : t, i = (n, i) => {
|
|
7
7
|
let [a, o] = t(r(n, i));
|
|
8
8
|
return e(() => {
|
|
@@ -14,7 +14,6 @@ var r = (e, t) => n(t) ? window.matchMedia(e).matches : t, i = (n, i) => {
|
|
|
14
14
|
};
|
|
15
15
|
}, [n]), a;
|
|
16
16
|
};
|
|
17
|
-
//#endregion
|
|
18
17
|
export { i as default };
|
|
19
18
|
/* 欲穷千里目,更上一层楼 */
|
|
20
19
|
/* 独立思考,明辨是非 */
|
package/hooks/use-memo/index.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
/* 潘启宝 2026-10-
|
|
1
|
+
/* 潘启宝 2026-10-29 16:11:51 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import { useRef as e } from "react";
|
|
4
|
-
|
|
4
|
+
// components/common/hooks/use-memo/index.ts
|
|
5
5
|
function t(t, n, r) {
|
|
6
6
|
let i = e({});
|
|
7
7
|
return (!("value" in i.current) || r(i.current.condition, n)) && (i.current.value = t(), i.current.condition = n), i.current.value;
|
|
8
8
|
}
|
|
9
|
-
//#endregion
|
|
10
9
|
export { t as default };
|
|
11
10
|
/* 欲穷千里目,更上一层楼 */
|
|
12
11
|
/* 独立思考,明辨是非 */
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/* 潘启宝 2026-10-
|
|
1
|
+
/* 潘启宝 2026-10-29 16:11:51 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import e from "../utils/isDev.js";
|
|
4
4
|
import { useMemo as t, useRef as n } from "react";
|
|
5
5
|
import { isFunction as r } from "@unicom-cloud/utils/is";
|
|
6
|
-
|
|
6
|
+
// components/common/hooks/use-memoized-fn/index.ts
|
|
7
7
|
function i(i) {
|
|
8
8
|
e && (r(i) || console.error(`useMemoizedFn 期望传入函数,却得到了:${typeof i}`));
|
|
9
9
|
let a = n(i);
|
|
@@ -11,7 +11,6 @@ function i(i) {
|
|
|
11
11
|
return a.current.apply(this, e);
|
|
12
12
|
}).current;
|
|
13
13
|
}
|
|
14
|
-
//#endregion
|
|
15
14
|
export { i as default };
|
|
16
15
|
/* 欲穷千里目,更上一层楼 */
|
|
17
16
|
/* 独立思考,明辨是非 */
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
/* 潘启宝 2026-10-
|
|
1
|
+
/* 潘启宝 2026-10-29 16:11:51 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import e from "../../utils/mergeProps.js";
|
|
4
4
|
import t from "../../utils/migrateLegacyProps.js";
|
|
5
5
|
import { isObjectAndNotEmpty as n } from "@unicom-cloud/utils/is";
|
|
6
|
-
|
|
6
|
+
// components/common/hooks/use-merge-component-props/index.ts
|
|
7
7
|
function r(r, ...i) {
|
|
8
8
|
let { internalProps: a, contextProps: o, globalProps: s, defaultProps: c, legacyProps: l } = r, { _ignoreGlobalProps: u, ...d } = a ?? {};
|
|
9
9
|
return i = [].concat(d, u ? {} : o, u ? {} : s, c, ...i), n(l) && (i = i.map((e, r, i) => n(e) ? t({ ...e }, l) : e)), e(...i);
|
|
10
10
|
}
|
|
11
|
-
//#endregion
|
|
12
11
|
export { r as default };
|
|
13
12
|
/* 欲穷千里目,更上一层楼 */
|
|
14
13
|
/* 独立思考,明辨是非 */
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/* 潘启宝 2026-10-
|
|
1
|
+
/* 潘启宝 2026-10-29 16:11:51 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import e from "../use-previous/index.js";
|
|
4
4
|
import t from "../use-update-effect/index.js";
|
|
5
5
|
import { useState as n } from "react";
|
|
6
6
|
import { isUndefined as r } from "@unicom-cloud/utils/is";
|
|
7
|
-
|
|
7
|
+
// components/common/hooks/use-merge-value/index.ts
|
|
8
8
|
function i(i, a) {
|
|
9
9
|
let { defaultValue: o, value: s } = a || {}, c = e(s), [l, u] = n(() => {
|
|
10
10
|
let e = s;
|
|
@@ -18,7 +18,6 @@ function i(i, a) {
|
|
|
18
18
|
l
|
|
19
19
|
];
|
|
20
20
|
}
|
|
21
|
-
//#endregion
|
|
22
21
|
export { i as default };
|
|
23
22
|
/* 欲穷千里目,更上一层楼 */
|
|
24
23
|
/* 独立思考,明辨是非 */
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
/* 潘启宝 2026-10-
|
|
1
|
+
/* 潘启宝 2026-10-29 16:11:51 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import e from "../use-isomorphic-layout-effect/index.js";
|
|
4
4
|
import { useState as t } from "react";
|
|
5
5
|
import { isMobileDevice as n } from "@unicom-cloud/utils/constants/platform";
|
|
6
|
-
|
|
6
|
+
// components/common/hooks/use-mobile/index.ts
|
|
7
7
|
var r = () => {
|
|
8
8
|
let [r, i] = t(!1);
|
|
9
9
|
return e(() => {
|
|
10
10
|
i(n);
|
|
11
11
|
}, []), r;
|
|
12
12
|
};
|
|
13
|
-
//#endregion
|
|
14
13
|
export { r as default };
|
|
15
14
|
/* 欲穷千里目,更上一层楼 */
|
|
16
15
|
/* 独立思考,明辨是非 */
|
package/hooks/use-mount/index.js
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
/* 潘启宝 2026-10-
|
|
1
|
+
/* 潘启宝 2026-10-29 16:11:51 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import e from "../utils/isDev.js";
|
|
4
4
|
import { useEffect as t } from "react";
|
|
5
5
|
import { isFunction as n, isThenable as r } from "@unicom-cloud/utils/is";
|
|
6
|
-
|
|
6
|
+
// components/common/hooks/use-mount/index.ts
|
|
7
7
|
var i = (i) => {
|
|
8
8
|
e && (n(i) || console.error(`useMount: parameter \`fn\` expected to be a function, but got "${typeof i}".`)), t(() => {
|
|
9
9
|
let e = i?.();
|
|
10
10
|
if (!r(e)) return e;
|
|
11
11
|
}, []);
|
|
12
12
|
};
|
|
13
|
-
//#endregion
|
|
14
13
|
export { i as default };
|
|
15
14
|
/* 欲穷千里目,更上一层楼 */
|
|
16
15
|
/* 独立思考,明辨是非 */
|
package/hooks/use-mouse/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/* 潘启宝 2026-10-
|
|
1
|
+
/* 潘启宝 2026-10-29 16:11:51 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import e from "../utils/domTarget.js";
|
|
4
4
|
import t from "../use-event-listener/index.js";
|
|
5
5
|
import n from "../use-raf-state/index.js";
|
|
6
|
-
|
|
6
|
+
// components/common/hooks/use-mouse/index.ts
|
|
7
7
|
var r = {
|
|
8
8
|
screenX: NaN,
|
|
9
9
|
screenY: NaN,
|
|
@@ -41,7 +41,6 @@ var r = {
|
|
|
41
41
|
o(u);
|
|
42
42
|
}, { target: () => document }), a;
|
|
43
43
|
};
|
|
44
|
-
//#endregion
|
|
45
44
|
export { i as default };
|
|
46
45
|
/* 欲穷千里目,更上一层楼 */
|
|
47
46
|
/* 独立思考,明辨是非 */
|
package/hooks/use-move/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/* 潘启宝 2026-10-
|
|
1
|
+
/* 潘启宝 2026-10-29 16:11:51 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import e from "../use-latest/index.js";
|
|
4
4
|
import t from "../utils/domTarget.js";
|
|
5
5
|
import n from "../utils/useDeepCompareWithTarget.js";
|
|
6
|
-
|
|
6
|
+
// components/common/hooks/use-mutation-observer/index.ts
|
|
7
7
|
var r = (r, i, a = {}) => {
|
|
8
8
|
let o = e(r);
|
|
9
9
|
n(() => {
|
|
@@ -15,7 +15,6 @@ var r = (r, i, a = {}) => {
|
|
|
15
15
|
};
|
|
16
16
|
}, [a], i);
|
|
17
17
|
};
|
|
18
|
-
//#endregion
|
|
19
18
|
export { r as default };
|
|
20
19
|
/* 欲穷千里目,更上一层楼 */
|
|
21
20
|
/* 独立思考,明辨是非 */
|
|
@@ -1,42 +1,41 @@
|
|
|
1
|
-
/* 潘启宝 2026-10-
|
|
1
|
+
/* 潘启宝 2026-10-29 16:11:51 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import e from "../use-latest/index.js";
|
|
4
4
|
import { noop as t, uniq as n } from "../../utils/lodash.js";
|
|
5
5
|
import "../../utils/index.js";
|
|
6
6
|
import { startTransition as r, useDeferredValue as i, useEffect as a, useState as o } from "react";
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
function
|
|
11
|
-
let { immediate:
|
|
7
|
+
import { isArrayAndNotEmpty as s, isElement as c, isFunction as l } from "@unicom-cloud/utils/is";
|
|
8
|
+
import u from "lodash/throttle";
|
|
9
|
+
// components/common/hooks/use-mutation-observers/index.ts
|
|
10
|
+
function d(d, f = [], p = {}) {
|
|
11
|
+
let { immediate: m, shouldReturn: h = !1, ...g } = p, [_, v] = o(), y = i(_), b = e(d);
|
|
12
12
|
if (a(() => {
|
|
13
|
-
let e =
|
|
14
|
-
let n =
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
let e = u((e, t) => {
|
|
14
|
+
let n = b.current;
|
|
15
|
+
l(n) && n(e, t), h && r(() => {
|
|
16
|
+
v(e);
|
|
17
17
|
});
|
|
18
18
|
}, 227);
|
|
19
|
-
|
|
20
|
-
let i = n([].concat(
|
|
21
|
-
if (!i
|
|
19
|
+
m && e();
|
|
20
|
+
let i = n([].concat(f).filter((e, t, n) => c(e, !0)));
|
|
21
|
+
if (!s(i)) return t;
|
|
22
22
|
let a = new MutationObserver(e);
|
|
23
23
|
return i.forEach((e, t, n) => {
|
|
24
24
|
a.observe(e, {
|
|
25
25
|
subtree: !0,
|
|
26
26
|
childList: !0,
|
|
27
27
|
attributes: !0,
|
|
28
|
-
...
|
|
28
|
+
...g
|
|
29
29
|
});
|
|
30
30
|
}), () => {
|
|
31
31
|
a.disconnect(), e.cancel();
|
|
32
32
|
};
|
|
33
33
|
}, [
|
|
34
|
-
...
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
]),
|
|
34
|
+
...f,
|
|
35
|
+
m,
|
|
36
|
+
h
|
|
37
|
+
]), h) return y;
|
|
38
38
|
}
|
|
39
|
-
|
|
40
|
-
export { u as default, u as useMutationObservers };
|
|
39
|
+
export { d as default, d as useMutationObservers };
|
|
41
40
|
/* 欲穷千里目,更上一层楼 */
|
|
42
41
|
/* 独立思考,明辨是非 */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/* 潘启宝 2026-10-
|
|
1
|
+
/* 潘启宝 2026-10-29 16:11:51 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import { useEffect as e, useState as t } from "react";
|
|
4
4
|
import { isObject as n } from "@unicom-cloud/utils/is";
|
|
5
|
-
|
|
5
|
+
// components/common/hooks/use-network/index.ts
|
|
6
6
|
function r() {
|
|
7
7
|
let e = navigator;
|
|
8
8
|
return n(e) ? e.connection || e.mozConnection || e.webkitConnection : null;
|
|
@@ -50,7 +50,6 @@ function a() {
|
|
|
50
50
|
};
|
|
51
51
|
}, []), n;
|
|
52
52
|
}
|
|
53
|
-
//#endregion
|
|
54
53
|
export { a as default };
|
|
55
54
|
/* 欲穷千里目,更上一层楼 */
|
|
56
55
|
/* 独立思考,明辨是非 */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/* 潘启宝 2026-10-
|
|
1
|
+
/* 潘启宝 2026-10-29 16:11:51 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import { useDebugValue as e, useSyncExternalStore as t } from "react";
|
|
4
|
-
|
|
4
|
+
// components/common/hooks/use-online-status/index.js
|
|
5
5
|
function n(e) {
|
|
6
6
|
return window.addEventListener("online", e), window.addEventListener("offline", e), () => {
|
|
7
7
|
window.removeEventListener("online", e), window.removeEventListener("offline", e);
|
|
@@ -11,7 +11,6 @@ function r() {
|
|
|
11
11
|
let r = t(n, () => navigator.onLine, () => !0);
|
|
12
12
|
return e(r ? "Online" : "Offline"), r;
|
|
13
13
|
}
|
|
14
|
-
//#endregion
|
|
15
14
|
export { r as default };
|
|
16
15
|
/* 欲穷千里目,更上一层楼 */
|
|
17
16
|
/* 独立思考,明辨是非 */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/* 潘启宝 2026-10-
|
|
1
|
+
/* 潘启宝 2026-10-29 16:11:51 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import e from "../../utils/getScrollBarWidth.js";
|
|
4
4
|
import { useEffect as t, useRef as n } from "react";
|
|
5
|
-
|
|
5
|
+
// components/common/hooks/use-overflow-hidden/index.ts
|
|
6
6
|
function r(r, { hidden: i }) {
|
|
7
7
|
let a = n(!1), o = n({}), s = () => {
|
|
8
8
|
let t = r();
|
|
@@ -26,7 +26,6 @@ function r(r, { hidden: i }) {
|
|
|
26
26
|
c();
|
|
27
27
|
}), [r, i]), [c, s];
|
|
28
28
|
}
|
|
29
|
-
//#endregion
|
|
30
29
|
export { r as default };
|
|
31
30
|
/* 欲穷千里目,更上一层楼 */
|
|
32
31
|
/* 独立思考,明辨是非 */
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
/* 潘启宝 2026-10-
|
|
1
|
+
/* 潘启宝 2026-10-29 16:11:51 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import { supportRef as e } from "../../utils/ref.js";
|
|
4
4
|
import { callbackOriginRef as t } from "../../utils/callbackOriginRef.js";
|
|
5
5
|
import { cloneElement as n, isValidElement as r, useCallback as i, useRef as a } from "react";
|
|
6
|
-
|
|
6
|
+
// components/common/hooks/use-override-ref/index.ts
|
|
7
7
|
function o() {
|
|
8
8
|
let o = a(null);
|
|
9
9
|
return [i((i) => r(i) && e(i) ? n(i, { ref(e) {
|
|
10
10
|
o.current = e, t(i, e);
|
|
11
11
|
} }) : i, []), o];
|
|
12
12
|
}
|
|
13
|
-
//#endregion
|
|
14
13
|
export { o as default };
|
|
15
14
|
/* 欲穷千里目,更上一层楼 */
|
|
16
15
|
/* 独立思考,明辨是非 */
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/* 潘启宝 2026-10-
|
|
1
|
+
/* 潘启宝 2026-10-29 16:11:51 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import e from "../use-memoized-fn/index.js";
|
|
4
4
|
import t from "../use-request/index.js";
|
|
5
5
|
import { useMemo as n } from "react";
|
|
6
|
-
|
|
6
|
+
// components/common/hooks/use-pagination/index.ts
|
|
7
7
|
var r = (r, i = {}) => {
|
|
8
8
|
let { defaultPageSize: a = 10, defaultCurrent: o = 1, ...s } = i, c = t(r, {
|
|
9
9
|
defaultParams: [{
|
|
@@ -41,7 +41,6 @@ var r = (r, i = {}) => {
|
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
};
|
|
44
|
-
//#endregion
|
|
45
44
|
export { r as default };
|
|
46
45
|
/* 欲穷千里目,更上一层楼 */
|
|
47
46
|
/* 独立思考,明辨是非 */
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type DependencyList } from 'react';
|
|
2
|
+
import { noop } from '../../utils/lodash';
|
|
3
|
+
import type { BasicTarget } from '../utils/domTarget';
|
|
4
|
+
export type PasteFilter = (item: DataTransferItem) => boolean;
|
|
5
|
+
declare function usePasteFile(element: BasicTarget, callback?: typeof noop, depsOrOptions?: DependencyList | {
|
|
6
|
+
deps?: DependencyList;
|
|
7
|
+
filter?: PasteFilter;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}): File[];
|
|
10
|
+
export default usePasteFile;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/* 潘启宝 2026-10-29 16:11:51 星期四 山东省济南市 */
|
|
2
|
+
/* 世界因你而美丽 */
|
|
3
|
+
import e from "../use-latest/index.js";
|
|
4
|
+
import t from "../utils/domTarget.js";
|
|
5
|
+
import n from "../use-memoized-fn/index.js";
|
|
6
|
+
import { noop as r } from "../../utils/lodash.js";
|
|
7
|
+
import { getDOM as i } from "../../utils/dom.js";
|
|
8
|
+
import { useEffect as a, useState as o } from "react";
|
|
9
|
+
import { isArray as s, isArrayAndNotEmpty as c, isDocument as l, isElement as u, isFunction as d } from "@unicom-cloud/utils/is";
|
|
10
|
+
// components/common/hooks/use-paste-file/index.ts
|
|
11
|
+
var f = (e) => e.kind === "file";
|
|
12
|
+
function p(p, m = r, h = []) {
|
|
13
|
+
let { deps: g = [], filter: _ = f, disabled: v = !1 } = s(h) ? { deps: h } : h, y = e(m), b = e(_), [x, S] = o([]), C = n((e) => {
|
|
14
|
+
let t = (e.clipboardData || window.clipboardData).items, n = Array.from(t).filter((e) => b.current(e)).map((e) => e.getAsFile()).filter(Boolean), r = y.current;
|
|
15
|
+
c(n) && d(r) && r(n), S(n);
|
|
16
|
+
}), w = i(p) || t(p) || document;
|
|
17
|
+
return a(() => {
|
|
18
|
+
if (!v && (l(w) || u(w, !0))) return w.addEventListener("paste", C), () => {
|
|
19
|
+
w.removeEventListener("paste", C);
|
|
20
|
+
};
|
|
21
|
+
}, [
|
|
22
|
+
v,
|
|
23
|
+
w,
|
|
24
|
+
...g
|
|
25
|
+
]), x;
|
|
26
|
+
}
|
|
27
|
+
export { p as default };
|
|
28
|
+
/* 欲穷千里目,更上一层楼 */
|
|
29
|
+
/* 独立思考,明辨是非 */
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { noop } from '../../utils/lodash';
|
|
1
|
+
import type { DependencyList } from 'react';
|
|
3
2
|
import type { BasicTarget } from '../utils/domTarget';
|
|
4
|
-
declare function usePasteImage(element: BasicTarget, callback?:
|
|
3
|
+
declare function usePasteImage(element: BasicTarget, callback?: (...args: any[]) => any, deps?: DependencyList): File[];
|
|
5
4
|
export default usePasteImage;
|
|
@@ -1,25 +1,13 @@
|
|
|
1
|
-
/* 潘启宝 2026-10-
|
|
1
|
+
/* 潘启宝 2026-10-29 16:11:51 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
|
-
import e from "../use-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
//#region components/common/hooks/use-paste-image/index.ts
|
|
10
|
-
function l(l, u = r, d = []) {
|
|
11
|
-
let f = e(u), [p, m] = a([]), h = n((e) => {
|
|
12
|
-
let t = (e.clipboardData || window.clipboardData).items, n = Array.from(t).filter((e, t, n) => e.kind === "file" && e.type.startsWith("image/")).map((e, t, n) => e.getAsFile()), r = f.current;
|
|
13
|
-
o(n) && !s(n) && c(r) && r(n), m(n);
|
|
3
|
+
import e from "../use-paste-file/index.js";
|
|
4
|
+
// components/common/hooks/use-paste-image/index.ts
|
|
5
|
+
function t(t, n = () => {}, r = []) {
|
|
6
|
+
return e(t, n, {
|
|
7
|
+
deps: r,
|
|
8
|
+
filter: (e) => e.kind === "file" && e.type.startsWith("image/")
|
|
14
9
|
});
|
|
15
|
-
return i(() => {
|
|
16
|
-
let e = t(l) || document;
|
|
17
|
-
return e.addEventListener("paste", h), () => {
|
|
18
|
-
e.removeEventListener("paste", h);
|
|
19
|
-
};
|
|
20
|
-
}, d), p;
|
|
21
10
|
}
|
|
22
|
-
|
|
23
|
-
export { l as default };
|
|
11
|
+
export { t as default };
|
|
24
12
|
/* 欲穷千里目,更上一层楼 */
|
|
25
13
|
/* 独立思考,明辨是非 */
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
/* 潘启宝 2026-10-
|
|
1
|
+
/* 潘启宝 2026-10-29 16:11:51 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import e from "../use-memoized-fn/index.js";
|
|
4
|
-
|
|
4
|
+
// components/common/hooks/use-persist-callback/index.ts
|
|
5
5
|
var t = e;
|
|
6
|
-
//#endregion
|
|
7
6
|
export { t as default };
|
|
8
7
|
/* 欲穷千里目,更上一层楼 */
|
|
9
8
|
/* 独立思考,明辨是非 */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/* 潘启宝 2026-10-
|
|
1
|
+
/* 潘启宝 2026-10-29 16:11:51 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import { useEffect as e, useState as t } from "react";
|
|
4
4
|
import { MATCH_MEDIA_PREFERS_COLOR_SCHEME_DARK as n } from "@unicom-cloud/utils/constants/matchMedia";
|
|
5
|
-
|
|
5
|
+
// components/common/hooks/use-prefers-color-scheme-dark/index.ts
|
|
6
6
|
function r() {
|
|
7
7
|
let [r, i] = t(n.matches);
|
|
8
8
|
return e(() => {
|
|
@@ -14,7 +14,6 @@ function r() {
|
|
|
14
14
|
};
|
|
15
15
|
}, []), r;
|
|
16
16
|
}
|
|
17
|
-
//#endregion
|
|
18
17
|
export { r as default };
|
|
19
18
|
/* 欲穷千里目,更上一层楼 */
|
|
20
19
|
/* 独立思考,明辨是非 */
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
/* 潘启宝 2026-10-
|
|
1
|
+
/* 潘启宝 2026-10-29 16:11:51 星期四 山东省济南市 */
|
|
2
2
|
/* 世界因你而美丽 */
|
|
3
3
|
import { useEffect as e, useRef as t } from "react";
|
|
4
|
-
|
|
4
|
+
// components/common/hooks/use-previous/index.ts
|
|
5
5
|
function n(n, r) {
|
|
6
6
|
let i = t(r);
|
|
7
7
|
return e(() => (i.current = n, () => {})), i.current;
|
|
8
8
|
}
|
|
9
|
-
//#endregion
|
|
10
9
|
export { n as default };
|
|
11
10
|
/* 欲穷千里目,更上一层楼 */
|
|
12
11
|
/* 独立思考,明辨是非 */
|