@unicom-cloud/ui-common 0.1.36 → 0.1.38
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/animation/Animation.js +1 -1
- package/animation/constants.d.ts +1 -1
- package/animation/constants.js +1 -1
- package/animation/context.js +1 -1
- package/animation/index.d.ts +1 -1
- package/animation/index.js +1 -1
- package/animation/style/index.js +1 -1
- package/border-beam/BorderBeam.js +1 -1
- package/border-beam/Effect.js +1 -1
- package/border-beam/constants.js +1 -1
- package/border-beam/context.js +1 -1
- package/border-beam/hooks/useBorderSize.js +1 -1
- package/border-beam/hooks/useChildDom.js +1 -1
- package/border-beam/index.d.ts +1 -1
- package/border-beam/index.js +1 -1
- package/border-beam/style/index.js +1 -1
- package/border-beam/utils.js +1 -1
- package/development/Development.js +1 -1
- package/development/constants.js +1 -1
- package/development/context.js +1 -1
- package/development/index.d.ts +1 -1
- package/development/index.js +1 -1
- package/development/style/index.js +1 -1
- package/empty/Empty.js +1 -1
- package/empty/constants.js +1 -1
- package/empty/context.js +1 -1
- package/empty/index.d.ts +1 -1
- package/empty/index.js +1 -1
- package/empty/style/index.js +1 -1
- package/flex/Flex.js +1 -1
- package/flex/constants.js +1 -1
- package/flex/context.js +1 -1
- package/flex/index.d.ts +2 -2
- package/flex/index.js +1 -1
- package/flex/style/index.js +1 -1
- package/flex/utils.js +1 -1
- package/higher-order/index.js +1 -1
- package/higher-order/with-speech-synthesis/context.js +1 -1
- package/higher-order/with-speech-synthesis/index.d.ts +1 -1
- package/higher-order/with-speech-synthesis/index.js +1 -1
- package/higher-order/with-speech-synthesis/style/index.js +1 -1
- package/higher-order/with-speech-synthesis/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/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 +3 -2
- 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.d.ts +1 -1
- package/hooks/use-deep-compare-effect/index.js +1 -1
- package/hooks/use-deep-compare-layout-effect/index.d.ts +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-emitter/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.d.ts +1 -1
- package/hooks/use-fullscreen/index.js +3 -2
- package/hooks/use-get-state/index.js +1 -1
- package/hooks/use-history-travel/index.js +1 -1
- package/hooks/use-hover/index.d.ts +1 -1
- package/hooks/use-hover/index.js +1 -1
- package/hooks/use-id/index.js +1 -1
- package/hooks/use-in-viewport/index.js +2 -2
- 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 +5 -5
- 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.d.ts +2 -2
- package/hooks/use-isomorphic-layout-effect/index.js +1 -1
- package/hooks/use-key-press/index.js +3 -3
- 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.d.ts +1 -1
- package/hooks/use-mouse/index.js +1 -1
- package/hooks/use-move/index.js +13 -13
- package/hooks/use-mutation-observer/index.js +1 -1
- package/hooks/use-mutation-observers/index.js +5 -5
- package/hooks/use-network/index.js +1 -1
- package/hooks/use-online-status/index.d.ts +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 +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.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 +2 -2
- 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 +5 -5
- 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.d.ts +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-throttle-fn-with-raf/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.d.ts +1 -1
- package/hooks/use-update-effect/index.js +1 -1
- package/hooks/use-update-layout-effect/index.d.ts +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/File.js +1 -1
- package/icons/file/context.js +1 -1
- package/icons/file/index.d.ts +1 -1
- package/icons/file/index.js +1 -1
- package/icons/file/style/index.js +1 -1
- package/index.js +618 -622
- package/package.json +1 -1
- package/progress/Progress.d.ts +24 -368
- package/progress/Progress.js +1 -1
- package/progress/constants.js +1 -1
- package/progress/index.d.ts +2 -1
- package/progress/index.js +1 -1
- package/progress/style/index.js +1 -1
- package/resize-observer/Collection.js +1 -1
- package/resize-observer/ResizeObserver.js +1 -1
- package/resize-observer/SingleObserver.js +1 -1
- package/resize-observer/constants.js +1 -1
- package/resize-observer/context.js +1 -1
- package/resize-observer/index.d.ts +3 -3
- package/resize-observer/index.js +1 -1
- package/resize-observer/observerUtil.js +1 -1
- package/resize-observer/style/index.js +1 -1
- package/space/Space.js +1 -1
- package/space/constants.js +1 -1
- package/space/context.js +1 -1
- package/space/index.d.ts +2 -2
- package/space/index.js +1 -1
- package/space/style/index.js +1 -1
- package/suspense-fallback-test/SuspenseFallbackTest.js +1 -1
- package/suspense-fallback-test/constants.js +1 -1
- package/suspense-fallback-test/context.js +1 -1
- package/suspense-fallback-test/index.d.ts +1 -1
- package/suspense-fallback-test/index.js +1 -1
- package/suspense-fallback-test/style/index.js +1 -1
- package/test.js +1 -1
- package/timer/Timer.js +1 -1
- package/timer/constants.js +1 -1
- package/timer/context.js +1 -1
- package/timer/index.d.ts +1 -1
- package/timer/index.js +1 -1
- package/timer/style/index.js +1 -1
- package/transition/Transition.d.ts +1 -1
- package/transition/Transition.js +1 -1
- package/transition/TransitionCSS.js +1 -1
- package/transition/TransitionGroup.js +1 -1
- package/transition/TransitionStyle.js +1 -1
- package/transition/constants.js +1 -1
- package/transition/context.js +1 -1
- package/transition/index.d.ts +5 -5
- package/transition/index.js +1 -1
- package/transition/style/index.js +1 -1
- package/transition/utils.d.ts +1 -1
- package/transition/utils.js +1 -1
- package/typewriter/Typewriter.js +1 -1
- package/typewriter/constants.js +1 -1
- package/typewriter/context.js +1 -1
- package/typewriter/index.d.ts +1 -1
- package/typewriter/index.js +1 -1
- package/typewriter/style/index.js +1 -1
- 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/constants.js +1 -1
- package/utils/copy.js +1 -1
- package/utils/css.js +1 -1
- package/utils/date.js +1 -1
- package/utils/dayjs.js +1 -1
- package/utils/document.js +1 -1
- package/utils/dom.d.ts +6 -0
- package/utils/dom.js +26 -22
- package/utils/emitter.js +1 -1
- package/utils/file.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 +14 -14
- package/utils/findScrollParent.js +1 -1
- package/utils/getHighlightText.js +1 -1
- package/utils/getHotkeyHandler.js +4 -4
- package/utils/getScrollBarHeight.js +1 -1
- package/utils/getScrollBarSize.d.ts +1 -1
- package/utils/getScrollBarSize.js +1 -1
- package/utils/getScrollBarWidth.js +1 -1
- package/utils/getStringLength.js +1 -1
- package/utils/include.js +1 -1
- package/utils/index.js +323 -327
- package/utils/intersectionObserver.js +1 -1
- package/utils/is.d.ts +0 -5
- package/utils/is.js +125 -34
- 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/names.js +1 -1
- package/utils/object.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/reactNode.js +1 -1
- package/utils/ref.js +1 -1
- package/utils/resizeObserver.js +4 -4
- 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 +4 -4
- 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/tinycolor.js +1 -1
- package/utils/toArray.js +1 -1
- package/utils/tree.js +1 -1
- package/utils/tunnel.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 +8 -8
- /package/{resize-observer → suspense-fallback-test}/style/index.css +0 -0
|
@@ -8,7 +8,7 @@ export interface Options {
|
|
|
8
8
|
onEnter?: () => void;
|
|
9
9
|
pageFullscreen?: boolean | PageFullscreenOptions;
|
|
10
10
|
}
|
|
11
|
-
declare const useFullscreen: (target: BasicTarget, options?: Options) => readonly [
|
|
11
|
+
declare const useFullscreen: (target: BasicTarget, options?: Options) => readonly [false, {
|
|
12
12
|
readonly enterFullscreen: () => void;
|
|
13
13
|
readonly exitFullscreen: () => void;
|
|
14
14
|
readonly toggleFullscreen: () => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 潘启宝 2026-07-
|
|
1
|
+
/* 潘启宝 2026-07-09 17:05:26 星期四 山东省济南市 */
|
|
2
2
|
import { isBoolean as e } from "../../utils/is.js";
|
|
3
3
|
import t from "../use-latest/index.js";
|
|
4
4
|
import n from "../utils/domTarget.js";
|
|
@@ -16,7 +16,8 @@ var c = (c, l) => {
|
|
|
16
16
|
}, S = (e) => {
|
|
17
17
|
y.current !== e && (x(e), v(e), y.current = e);
|
|
18
18
|
}, C = () => {
|
|
19
|
-
|
|
19
|
+
let e = b();
|
|
20
|
+
S(e);
|
|
20
21
|
}, w = (e) => {
|
|
21
22
|
let t = n(c);
|
|
22
23
|
if (!t) return;
|
|
@@ -4,5 +4,5 @@ export interface Options {
|
|
|
4
4
|
onLeave?: () => void;
|
|
5
5
|
onChange?: (isHovering: boolean) => void;
|
|
6
6
|
}
|
|
7
|
-
declare const _default: (target: BasicTarget, options?: Options) => boolean;
|
|
8
7
|
export default _default;
|
|
8
|
+
declare function _default(target: BasicTarget, options?: Options): boolean;
|
package/hooks/use-hover/index.js
CHANGED
package/hooks/use-id/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 潘启宝 2026-07-
|
|
1
|
+
/* 潘启宝 2026-07-09 17:05:26 星期四 山东省济南市 */
|
|
2
2
|
import e from "../utils/domTarget.js";
|
|
3
3
|
import t from "../utils/useEffectWithTarget.js";
|
|
4
4
|
import { supportIntersectionObserver as n } from "../use-intersection-observer/index.js";
|
|
@@ -6,7 +6,7 @@ import { useState as r } from "react";
|
|
|
6
6
|
import i from "lodash/castArray";
|
|
7
7
|
//#region components/common/hooks/use-in-viewport/index.ts
|
|
8
8
|
function a(a, o) {
|
|
9
|
-
let { flag: s = !0, defaultInView: c, callback: l, ...u } = o || {}, [d, f] = r(n
|
|
9
|
+
let { flag: s = !0, defaultInView: c, callback: l, ...u } = o || {}, [d, f] = r(!n || !!c), [p, m] = r();
|
|
10
10
|
return t(() => {
|
|
11
11
|
if (!s) return;
|
|
12
12
|
let t = i(a).map((t) => e(t)).filter(Boolean);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 潘启宝 2026-07-
|
|
1
|
+
/* 潘启宝 2026-07-09 17:05:26 星期四 山东省济南市 */
|
|
2
2
|
import { isServerRendering as e, isUndefined as t } from "../../utils/is.js";
|
|
3
3
|
import { useRef as n } from "react";
|
|
4
4
|
//#region components/common/hooks/use-intersection-observer/index.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* 潘启宝 2026-07-
|
|
2
|
-
import {
|
|
1
|
+
/* 潘启宝 2026-07-09 17:05:26 星期四 山东省济南市 */
|
|
2
|
+
import { isFunction as e, is_exports as t } from "../../utils/is.js";
|
|
3
3
|
import n from "../use-latest/index.js";
|
|
4
4
|
import { NOOP as r } from "../../utils/constants.js";
|
|
5
5
|
import { uniq as i } from "../../utils/lodash.js";
|
|
@@ -10,11 +10,11 @@ function l(l, u = [], d = {}) {
|
|
|
10
10
|
let { immediate: f, ...p } = d, [m, h] = s(), g = a(m), _ = n(l);
|
|
11
11
|
return o(() => {
|
|
12
12
|
if (!(u.length || f)) return r;
|
|
13
|
-
let n = i([].concat(u).filter((
|
|
13
|
+
let n = i([].concat(u).filter((e, n, r) => (0, t.isElementByInstanceof)(e)));
|
|
14
14
|
if (!(n.length || f)) return r;
|
|
15
|
-
let a = c((
|
|
15
|
+
let a = c((t, n) => {
|
|
16
16
|
let r = _.current;
|
|
17
|
-
|
|
17
|
+
e(r) && r(t, n), h(t);
|
|
18
18
|
}, 227), o = new IntersectionObserver(a, { ...p });
|
|
19
19
|
return n.forEach((e, t, n) => {
|
|
20
20
|
o.observe(e);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const useIsomorphicLayoutEffect: typeof
|
|
1
|
+
import { useLayoutEffect } from 'react';
|
|
2
|
+
declare const useIsomorphicLayoutEffect: typeof useLayoutEffect;
|
|
3
3
|
export default useIsomorphicLayoutEffect;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 潘启宝 2026-07-
|
|
1
|
+
/* 潘启宝 2026-07-09 17:05:26 星期四 山东省济南市 */
|
|
2
2
|
import { isArray as e, isFunction as t, isNumber as n, isString as r } from "../../utils/is.js";
|
|
3
3
|
import i from "../use-latest/index.js";
|
|
4
4
|
import a from "../utils/domTarget.js";
|
|
@@ -136,13 +136,13 @@ function d(e) {
|
|
|
136
136
|
}
|
|
137
137
|
function f(e, t, r) {
|
|
138
138
|
if (!e.key) return !1;
|
|
139
|
-
if (n(t)) return e.keyCode === t
|
|
139
|
+
if (n(t)) return e.keyCode === t && t;
|
|
140
140
|
let i = t.split("."), a = 0;
|
|
141
141
|
for (let t of i) {
|
|
142
142
|
let n = l[t], r = c[t.toLowerCase()];
|
|
143
143
|
(n && n(e) || r && r === e.keyCode) && a++;
|
|
144
144
|
}
|
|
145
|
-
return r ? a === i.length && d(e) === i.length
|
|
145
|
+
return r ? a === i.length && d(e) === i.length && t : a === i.length && t;
|
|
146
146
|
}
|
|
147
147
|
function p(n, r) {
|
|
148
148
|
return t(n) ? n : u(n) ? (e) => f(e, n, r) : e(n) ? (e) => n.find((t) => f(e, t, r)) : () => !!n;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 潘启宝 2026-07-
|
|
1
|
+
/* 潘启宝 2026-07-09 17:05:26 星期四 山东省济南市 */
|
|
2
2
|
import { useCallback as e } from "react";
|
|
3
3
|
import { ArrowDown as t, ArrowLeft as n, ArrowRight as r, ArrowUp as i, Enter as a } from "@unicom-cloud/utils/constants/keyboardCode";
|
|
4
4
|
//#region components/common/hooks/use-keyboard-event/index.ts
|
package/hooks/use-map/index.js
CHANGED
package/hooks/use-media/index.js
CHANGED
package/hooks/use-memo/index.js
CHANGED
package/hooks/use-mount/index.js
CHANGED
package/hooks/use-mouse/index.js
CHANGED
package/hooks/use-move/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* 潘启宝 2026-07-
|
|
2
|
-
import {
|
|
1
|
+
/* 潘启宝 2026-07-09 17:05:26 星期四 山东省济南市 */
|
|
2
|
+
import { isPlainObject as e, is_exports as t } from "../../utils/is.js";
|
|
3
3
|
import n from "../../utils/findRootElement.js";
|
|
4
4
|
import { off as r, on as i } from "../../utils/dom.js";
|
|
5
5
|
import a from "../use-force-update/index.js";
|
|
@@ -21,25 +21,25 @@ function u(u, d = !1) {
|
|
|
21
21
|
target: null,
|
|
22
22
|
draggable: !0
|
|
23
23
|
};
|
|
24
|
-
|
|
24
|
+
e(u) && ("trigger" in u || "target" in u) ? (f = n(u.trigger), p = n(u.target), m = u.draggable ?? m) : f = p = n(u), f ||= p, p ||= f;
|
|
25
25
|
let h = document.documentElement, [g, _] = c(d ? { translate: void 0 } : {}), v = a(), y = s(l());
|
|
26
|
-
function b(
|
|
27
|
-
if (!
|
|
28
|
-
|
|
26
|
+
function b(e) {
|
|
27
|
+
if (!(0, t.isElementByInstanceof)(p)) return;
|
|
28
|
+
e.preventDefault(), e.stopPropagation();
|
|
29
29
|
let n = y.current, r = window.getComputedStyle(p).transform.split(",");
|
|
30
|
-
r.length > 1 && (n.translateX = parseFloat(r.at(-2)) || n.translateX, n.translateY = parseFloat(r.at(-1)) || n.translateY), n.screenX =
|
|
30
|
+
r.length > 1 && (n.translateX = parseFloat(r.at(-2)) || n.translateX, n.translateY = parseFloat(r.at(-1)) || n.translateY), n.screenX = e.screenX, n.screenY = e.screenY, n.boundingClientRect = p.getBoundingClientRect();
|
|
31
31
|
let i = p.parentElement;
|
|
32
32
|
n.offsetParentBoundingClientRect = i ? i.getBoundingClientRect() : new DOMRect(), w();
|
|
33
33
|
}
|
|
34
|
-
function x(
|
|
35
|
-
if (!(
|
|
36
|
-
|
|
37
|
-
let n = y.current, { left: r, right: i, top: a, bottom: o } = n.boundingClientRect || new DOMRect(), { left: s, right: c, top: l, bottom: u, width: f, height: m } = n.offsetParentBoundingClientRect || new DOMRect(), h = Math.max(
|
|
34
|
+
function x(e) {
|
|
35
|
+
if (!(e instanceof Event)) return;
|
|
36
|
+
e.preventDefault(), e.stopPropagation();
|
|
37
|
+
let n = y.current, { left: r, right: i, top: a, bottom: o } = n.boundingClientRect || new DOMRect(), { left: s, right: c, top: l, bottom: u, width: f, height: m } = n.offsetParentBoundingClientRect || new DOMRect(), h = Math.max(e.screenX - n.screenX, -(r - s));
|
|
38
38
|
h = Math.min(h, s + f - i);
|
|
39
|
-
let g = Math.max(
|
|
39
|
+
let g = Math.max(e.screenY - n.screenY, -(a - l));
|
|
40
40
|
g = Math.min(g, l + m - o), h += n.translateX, g += n.translateY;
|
|
41
41
|
let v = `translate(${h}px, ${g}px)`;
|
|
42
|
-
d ? _({ translate: v }) :
|
|
42
|
+
d ? _({ translate: v }) : (0, t.isElementByInstanceof)(p) && (p.style.transform = v);
|
|
43
43
|
}
|
|
44
44
|
function S(e) {
|
|
45
45
|
e.preventDefault(), e.stopPropagation(), T();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* 潘启宝 2026-07-
|
|
2
|
-
import {
|
|
1
|
+
/* 潘启宝 2026-07-09 17:05:26 星期四 山东省济南市 */
|
|
2
|
+
import { isFunction as e, is_exports as t } from "../../utils/is.js";
|
|
3
3
|
import n from "../use-latest/index.js";
|
|
4
4
|
import { NOOP as r } from "../../utils/constants.js";
|
|
5
5
|
import { uniq as i } from "../../utils/lodash.js";
|
|
@@ -11,11 +11,11 @@ function l(l, u = [], d = {}) {
|
|
|
11
11
|
let { immediate: f, ...p } = d, [m, h] = s(), g = a(m), _ = n(l);
|
|
12
12
|
return o(() => {
|
|
13
13
|
if (!(u.length || f)) return r;
|
|
14
|
-
let n = i([].concat(u).filter((
|
|
14
|
+
let n = i([].concat(u).filter((e, n, r) => (0, t.isElementByInstanceof)(e)));
|
|
15
15
|
if (!(n.length || f)) return r;
|
|
16
|
-
let a = c((
|
|
16
|
+
let a = c((t, n) => {
|
|
17
17
|
let r = _.current;
|
|
18
|
-
|
|
18
|
+
e(r) && r(t, n), h(t);
|
|
19
19
|
}, 227), o = new MutationObserver(a);
|
|
20
20
|
return n.forEach((e, t, n) => {
|
|
21
21
|
o.observe(e, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 潘启宝 2026-07-
|
|
1
|
+
/* 潘启宝 2026-07-09 17:05:26 星期四 山东省济南市 */
|
|
2
2
|
import { supportRef as e } from "../../utils/ref.js";
|
|
3
3
|
import { callbackOriginRef as t } from "../../utils/callbackOriginRef.js";
|
|
4
4
|
import { cloneElement as n, isValidElement as r, useCallback as i, useRef as a } from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 潘启宝 2026-07-
|
|
1
|
+
/* 潘启宝 2026-07-09 17:05:26 星期四 山东省济南市 */
|
|
2
2
|
import { useEffect as e, useState as t } from "react";
|
|
3
3
|
import { MATCH_MEDIA_PREFERS_COLOR_SCHEME_DARK as n } from "@unicom-cloud/utils/constants";
|
|
4
4
|
//#region components/common/hooks/use-prefers-color-scheme-dark/index.ts
|
package/hooks/use-refs/index.js
CHANGED