@unicom-cloud/ui-common 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Development.js +1 -1
- package/Empty.js +1 -1
- package/Flex.js +1 -1
- package/Progress.js +1 -1
- package/Space.js +1 -1
- package/SuspenseFallbackTest.js +1 -1
- package/TransitionGroup.js +1 -1
- package/development/index.js +1 -1
- package/empty/index.js +1 -1
- package/flex/index.js +1 -1
- package/flex/interface.js +1 -1
- package/higher-order/index.js +1 -1
- package/higher-order/with-speech-synthesis/index.js +1 -1
- package/higher-order/withSpeechSynthesis.js +1 -1
- package/hooks/create-deep-compare-effect/index.js +1 -1
- package/hooks/create-update-effect/index.js +1 -1
- package/hooks/create-use-storage-state/index.js +45 -35
- package/hooks/createDeepCompareEffect.js +1 -1
- package/hooks/createUpdateEffect.js +1 -1
- package/hooks/createUseStorageState.js +1 -1
- package/hooks/index.js +94 -88
- 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 +41 -38
- 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 +113 -0
- 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-memoized-fn/index.js +1 -1
- package/hooks/use-merge-props/index.js +1 -1
- package/hooks/use-merge-value/index.js +1 -1
- package/hooks/use-mount/index.js +1 -1
- package/hooks/use-mouse/index.js +1 -1
- package/hooks/use-mutation-observer/index.js +1 -1
- package/hooks/use-mutation-observers/index.js +116 -0
- package/hooks/use-network/index.js +1 -1
- package/hooks/use-online-status/index.js +1 -1
- package/hooks/use-overflow-hidden/index.js +1 -1
- package/hooks/use-override-ref/index.js +1 -1
- package/hooks/use-pagination/index.js +1 -1
- package/hooks/use-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 +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 +113 -0
- 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-text-selection/index.js +1 -1
- package/hooks/use-theme/index.js +1 -1
- package/hooks/use-throttle/index.js +1 -1
- package/hooks/use-throttle-effect/index.js +1 -1
- package/hooks/use-throttle-fn/index.js +1 -1
- package/hooks/use-timeout/index.js +1 -1
- package/hooks/use-title/index.js +1 -1
- package/hooks/use-toggle/index.js +1 -1
- package/hooks/use-tracked-effect/index.js +1 -1
- package/hooks/use-unmount/index.js +1 -1
- package/hooks/use-unmounted-ref/index.js +1 -1
- package/hooks/use-update/index.js +1 -1
- package/hooks/use-update-effect/index.js +1 -1
- package/hooks/use-update-layout-effect/index.js +1 -1
- package/hooks/use-url-state/index.js +1 -1
- package/hooks/use-virtual-list/index.js +1 -1
- package/hooks/use-watch/index.js +1 -1
- package/hooks/use-web-socket/index.js +1 -1
- package/hooks/use-why-did-you-update/index.js +1 -1
- package/hooks/use-window-size/index.js +1 -1
- package/hooks/useAsyncEffect.js +1 -1
- package/hooks/useBoolean.js +1 -1
- package/hooks/useClickAway.js +1 -1
- package/hooks/useComputedState.js +1 -1
- package/hooks/useControllableValue.js +1 -1
- package/hooks/useCookieState.js +1 -1
- package/hooks/useCountDown.js +1 -1
- package/hooks/useCounter.js +1 -1
- package/hooks/useCreate.js +1 -1
- package/hooks/useCreation.js +1 -1
- package/hooks/useDebounce.js +1 -1
- package/hooks/useDebounceEffect.js +1 -1
- package/hooks/useDebounceFn.js +1 -1
- package/hooks/useDeepCompareEffect.js +1 -1
- package/hooks/useDeepCompareLayoutEffect.js +1 -1
- package/hooks/useDocumentVisibility.js +1 -1
- package/hooks/useDrag.js +1 -1
- package/hooks/useDrop.js +5 -3
- package/hooks/useEventListener.js +1 -1
- package/hooks/useEventTarget.js +1 -1
- package/hooks/useExternal.js +1 -1
- package/hooks/useFavicon.js +1 -1
- package/hooks/useFocusWithin.js +1 -1
- package/hooks/useForceUpdate.js +1 -1
- package/hooks/useFullscreen.js +1 -1
- package/hooks/useGetState.js +1 -1
- package/hooks/useHistoryTravel.js +1 -1
- package/hooks/useHover.js +1 -1
- package/hooks/useId.js +1 -1
- package/hooks/useInView.js +1 -1
- package/hooks/useInViewport.js +1 -1
- package/hooks/useInfiniteScroll.js +1 -1
- package/hooks/useIntersectionObserver.js +1 -1
- package/hooks/useIntersectionObservers.js +94 -0
- package/hooks/useInterval.js +1 -1
- package/hooks/useIsFirstRender.js +1 -1
- package/hooks/useIsomorphicLayoutEffect.js +1 -1
- package/hooks/useKeyPress.js +1 -1
- package/hooks/useKeyboardEvent.js +1 -1
- package/hooks/useLatest.js +1 -1
- package/hooks/useListenWindowResize.js +1 -1
- package/hooks/useLocalStorageState.js +1 -1
- package/hooks/useLockFn.js +1 -1
- package/hooks/useLongPress.js +1 -1
- package/hooks/useMap.js +1 -1
- package/hooks/useMedia.js +1 -1
- package/hooks/useMemoizedFn.js +1 -1
- package/hooks/useMergeProps.js +1 -1
- package/hooks/useMergeValue.js +1 -1
- package/hooks/useMount.js +1 -1
- package/hooks/useMouse.js +1 -1
- package/hooks/useMutationObserver.js +1 -1
- package/hooks/useMutationObservers.js +94 -0
- package/hooks/useNetwork.js +1 -1
- package/hooks/useOnlineStatus.js +1 -1
- package/hooks/useOverflowHidden.js +1 -1
- package/hooks/useOverrideRef.js +1 -1
- package/hooks/usePagination.js +1 -1
- package/hooks/usePersistCallback.js +1 -1
- package/hooks/usePrefersColorSchemeDark.js +1 -1
- package/hooks/usePrevious.js +1 -1
- package/hooks/useRafInterval.js +1 -1
- package/hooks/useRafState.js +1 -1
- package/hooks/useRafTimeout.js +1 -1
- package/hooks/useReactive.js +1 -1
- package/hooks/useRefLatest.js +1 -1
- package/hooks/useRefs.js +1 -1
- package/hooks/useRequest.js +1 -1
- package/hooks/useResetState.js +1 -1
- package/hooks/useResizeObserver.js +1 -1
- package/hooks/useResizeObservers.js +94 -0
- package/hooks/useResponsive.js +1 -1
- package/hooks/useSafeState.js +1 -1
- package/hooks/useScroll.js +1 -1
- package/hooks/useSelections.js +1 -1
- package/hooks/useSessionStorageState.js +1 -1
- package/hooks/useSet.js +1 -1
- package/hooks/useSetState.js +1 -1
- package/hooks/useSize.js +1 -1
- package/hooks/useStateCallback.js +1 -1
- package/hooks/useStateWithPromise.js +1 -1
- package/hooks/useTextSelection.js +1 -1
- package/hooks/useTheme.js +1 -1
- package/hooks/useThrottle.js +1 -1
- package/hooks/useThrottleEffect.js +1 -1
- package/hooks/useThrottleFn.js +1 -1
- package/hooks/useTimeout.js +1 -1
- package/hooks/useTitle.js +1 -1
- package/hooks/useToggle.js +1 -1
- package/hooks/useTrackedEffect.js +1 -1
- package/hooks/useUnmount.js +1 -1
- package/hooks/useUnmountedRef.js +1 -1
- package/hooks/useUpdate.js +1 -1
- package/hooks/useUpdateEffect.js +1 -1
- package/hooks/useUpdateLayoutEffect.js +1 -1
- package/hooks/useUrlState.js +1 -1
- package/hooks/useVirtualList.js +1 -1
- package/hooks/useWatch.js +1 -1
- package/hooks/useWebSocket.js +1 -1
- package/hooks/useWhyDidYouUpdate.js +1 -1
- package/hooks/useWindowSize.js +1 -1
- package/hooks/utils/createEffectWithTarget.js +1 -1
- package/hooks/utils/depsAreSame.js +1 -1
- package/hooks/utils/depsEqual.js +1 -1
- package/hooks/utils/domTarget.js +1 -1
- package/hooks/utils/getDocumentOrShadow.js +1 -1
- package/hooks/utils/index.js +1 -1
- package/hooks/utils/isAppleDevice.js +1 -1
- package/hooks/utils/isBrowser.js +1 -1
- package/hooks/utils/isDev.js +1 -1
- package/hooks/utils/rect.js +1 -1
- package/hooks/utils/useDeepCompareWithTarget.js +1 -1
- package/hooks/utils/useEffectWithTarget.js +1 -1
- package/hooks/utils/useIsomorphicLayoutEffectWithTarget.js +1 -1
- package/hooks/utils/useLayoutEffectWithTarget.js +1 -1
- package/hooks/utils.js +1 -1
- package/icons/file/index.js +1 -1
- package/icons/file.js +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/progress/index.js +1 -1
- package/space/index.js +6 -2
- package/suspense-fallback-test/index.js +1 -1
- package/transition-group/CSSTransition.js +1 -1
- package/transition-group/PqbCSSTransition.js +1 -1
- package/transition-group/ReplaceTransition.js +1 -1
- package/transition-group/SwitchTransition.js +1 -1
- package/transition-group/Transition.js +1 -1
- package/transition-group/TransitionGroup.js +1 -1
- package/transition-group/TransitionGroupContext.js +1 -1
- package/transition-group/index.js +1 -1
- package/transition-group/utils/ChildMapping.js +1 -1
- package/types/hooks/index.d.ts +3 -0
- package/types/hooks/use-intersection-observers/index.d.ts +4 -0
- package/types/hooks/use-mutation-observers/index.d.ts +4 -0
- package/types/hooks/use-resize-observers/index.d.ts +4 -0
- package/types/utils/constant.d.ts +1 -1
- package/types/utils/index.d.ts +1 -0
- package/types/utils/is.d.ts +1 -1
- package/types/utils/resizeObserver.d.ts +1 -1
- package/types/utils/string.d.ts +2 -0
- package/utils/caseName.js +1 -1
- package/utils/className.js +1 -1
- package/utils/compute.js +1 -1
- package/utils/constant.js +8 -8
- package/utils/copy.js +1 -1
- package/utils/date.js +1 -1
- package/utils/dayjs.js +1 -1
- package/utils/dom.js +1 -1
- package/utils/emitter.js +1 -1
- package/utils/fileToURL.js +1 -1
- package/utils/fillNBSP.js +1 -1
- package/utils/findScrollParent.js +1 -1
- package/utils/getHighlightText.js +1 -1
- package/utils/getHotkeyHandler.js +1 -1
- package/utils/getStringLength.js +1 -1
- package/utils/include.js +1 -1
- package/utils/index.js +144 -142
- package/utils/intersectionObserver.js +1 -1
- package/utils/is.js +77 -77
- package/utils/keyboardCode.js +1 -1
- package/utils/lodash.js +1 -1
- package/utils/math.js +1 -1
- package/utils/mergeProps.js +1 -1
- package/utils/mergedToString.js +1 -1
- package/utils/mutationObserver.js +1 -1
- package/utils/omit.js +1 -1
- package/utils/pad.js +1 -1
- package/utils/pick.js +1 -1
- package/utils/pinyin.js +1 -1
- package/utils/react19Adapter.js +1 -1
- package/utils/reactDOM.js +1 -1
- package/utils/resizeObserver.js +7 -7
- package/utils/saveAs.js +1 -1
- package/utils/screenfull.js +1 -1
- package/utils/scrollIntoViewIfNeeded.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 +10 -0
- package/utils/style.js +1 -1
- package/utils/supportRef.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/hooks/use-drag/index.js
CHANGED
package/hooks/use-drop/index.js
CHANGED
|
@@ -1,60 +1,63 @@
|
|
|
1
|
-
/* 2025-11-
|
|
2
|
-
import { useRef as
|
|
3
|
-
import
|
|
1
|
+
/* 2025-11-19 09:09:36 */
|
|
2
|
+
import { useRef as D } from "react";
|
|
3
|
+
import "../../utils/is.js";
|
|
4
|
+
import E from "../use-latest/index.js";
|
|
4
5
|
import { getTargetElement as v } from "../utils/domTarget.js";
|
|
5
6
|
import L from "../utils/useEffectWithTarget.js";
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
import { isString as h } from "@unicom-cloud/utils/is";
|
|
8
|
+
const F = (s, l = {}) => {
|
|
9
|
+
const e = E(l), a = D(void 0);
|
|
8
10
|
L(
|
|
9
11
|
() => {
|
|
10
|
-
const t = v(
|
|
12
|
+
const t = v(s);
|
|
11
13
|
if (!t?.addEventListener)
|
|
12
14
|
return;
|
|
13
|
-
const c = (
|
|
14
|
-
const
|
|
15
|
-
if (
|
|
16
|
-
let
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
const c = (r, i) => {
|
|
16
|
+
const f = r.getData("text/uri-list"), n = r.getData("custom");
|
|
17
|
+
if (n && e.current.onDom) {
|
|
18
|
+
let o = n;
|
|
19
|
+
if (h(n))
|
|
20
|
+
try {
|
|
21
|
+
o = JSON.parse(n);
|
|
22
|
+
} catch {
|
|
23
|
+
o = n;
|
|
24
|
+
}
|
|
25
|
+
e.current.onDom(o, i);
|
|
23
26
|
return;
|
|
24
27
|
}
|
|
25
|
-
if (
|
|
26
|
-
|
|
28
|
+
if (f && e.current.onUri) {
|
|
29
|
+
e.current.onUri(f, i);
|
|
27
30
|
return;
|
|
28
31
|
}
|
|
29
|
-
if (
|
|
30
|
-
|
|
31
|
-
Array.from(
|
|
32
|
-
|
|
32
|
+
if (r.files && r.files.length && e.current.onFiles) {
|
|
33
|
+
e.current.onFiles(
|
|
34
|
+
Array.from(r.files),
|
|
35
|
+
i
|
|
33
36
|
);
|
|
34
37
|
return;
|
|
35
38
|
}
|
|
36
|
-
|
|
37
|
-
|
|
39
|
+
r.items && r.items.length && e.current.onText && r.items[0].getAsString((o) => {
|
|
40
|
+
e.current.onText(o, i);
|
|
38
41
|
});
|
|
39
|
-
}, u = (
|
|
40
|
-
|
|
41
|
-
}, g = (
|
|
42
|
-
|
|
43
|
-
}, m = (
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
},
|
|
48
|
-
c(
|
|
42
|
+
}, u = (r) => {
|
|
43
|
+
r.preventDefault(), r.stopPropagation(), a.current = r.target, e.current.onDragEnter?.(r);
|
|
44
|
+
}, g = (r) => {
|
|
45
|
+
r.preventDefault(), e.current.onDragOver?.(r);
|
|
46
|
+
}, m = (r) => {
|
|
47
|
+
r.target === a.current && e.current.onDragLeave?.(r);
|
|
48
|
+
}, p = (r) => {
|
|
49
|
+
r.preventDefault(), c(r.dataTransfer, r), e.current.onDrop?.(r);
|
|
50
|
+
}, d = (r) => {
|
|
51
|
+
c(r.clipboardData, r), e.current.onPaste?.(r);
|
|
49
52
|
};
|
|
50
|
-
return t.addEventListener("dragenter", u), t.addEventListener("dragover", g), t.addEventListener("dragleave", m), t.addEventListener("drop",
|
|
51
|
-
t.removeEventListener("dragenter", u), t.removeEventListener("dragover", g), t.removeEventListener("dragleave", m), t.removeEventListener("drop",
|
|
53
|
+
return t.addEventListener("dragenter", u), t.addEventListener("dragover", g), t.addEventListener("dragleave", m), t.addEventListener("drop", p), t.addEventListener("paste", d), () => {
|
|
54
|
+
t.removeEventListener("dragenter", u), t.removeEventListener("dragover", g), t.removeEventListener("dragleave", m), t.removeEventListener("drop", p), t.removeEventListener("paste", d);
|
|
52
55
|
};
|
|
53
56
|
},
|
|
54
57
|
[],
|
|
55
|
-
|
|
58
|
+
s
|
|
56
59
|
);
|
|
57
60
|
};
|
|
58
61
|
export {
|
|
59
|
-
|
|
62
|
+
F as default
|
|
60
63
|
};
|
package/hooks/use-hover/index.js
CHANGED
package/hooks/use-id/index.js
CHANGED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/* 2025-11-19 09:09:36 */
|
|
2
|
+
import u from "lodash/throttle";
|
|
3
|
+
import { useState as l, useRef as b, useEffect as v } from "react";
|
|
4
|
+
import "@unicom-cloud/utils/case-name";
|
|
5
|
+
import "@unicom-cloud/utils/class-name";
|
|
6
|
+
import { NOOP as h } from "../../utils/constant.js";
|
|
7
|
+
import "@unicom-cloud/utils/clipboard-copy";
|
|
8
|
+
import "@unicom-cloud/utils/date";
|
|
9
|
+
import "../../utils/dayjs.js";
|
|
10
|
+
import "@unicom-cloud/utils/dom-helpers/reflow";
|
|
11
|
+
import "../../utils/is.js";
|
|
12
|
+
import "@unicom-cloud/utils/emitter";
|
|
13
|
+
import "@unicom-cloud/utils/file/fileToURL";
|
|
14
|
+
import "lodash/escapeRegExp";
|
|
15
|
+
import "lodash/assign";
|
|
16
|
+
import "lodash/assignIn";
|
|
17
|
+
import "lodash/at";
|
|
18
|
+
import "lodash/camelCase";
|
|
19
|
+
import "lodash/capitalize";
|
|
20
|
+
import "lodash/castArray";
|
|
21
|
+
import "lodash/chain";
|
|
22
|
+
import "lodash/chunk";
|
|
23
|
+
import "lodash/clone";
|
|
24
|
+
import "lodash/cloneDeep";
|
|
25
|
+
import "lodash/cloneDeepWith";
|
|
26
|
+
import "lodash/cloneWith";
|
|
27
|
+
import "lodash/compact";
|
|
28
|
+
import "lodash/curry";
|
|
29
|
+
import "lodash/debounce";
|
|
30
|
+
import "lodash/defaults";
|
|
31
|
+
import "lodash/defaultsDeep";
|
|
32
|
+
import "lodash/defaultTo";
|
|
33
|
+
import "lodash/difference";
|
|
34
|
+
import "lodash/escape";
|
|
35
|
+
import "lodash/findKey";
|
|
36
|
+
import "lodash/flattenDeep";
|
|
37
|
+
import "lodash/flow";
|
|
38
|
+
import "lodash/get";
|
|
39
|
+
import "lodash/groupBy";
|
|
40
|
+
import "lodash/has";
|
|
41
|
+
import "lodash/intersection";
|
|
42
|
+
import "lodash/invert";
|
|
43
|
+
import "lodash/invertBy";
|
|
44
|
+
import "lodash/kebabCase";
|
|
45
|
+
import "lodash/mean";
|
|
46
|
+
import "lodash/memoize";
|
|
47
|
+
import "lodash/merge";
|
|
48
|
+
import "lodash/mergeWith";
|
|
49
|
+
import "lodash/orderBy";
|
|
50
|
+
import "lodash/partition";
|
|
51
|
+
import "lodash/pullAll";
|
|
52
|
+
import "lodash/result";
|
|
53
|
+
import "lodash/sample";
|
|
54
|
+
import "lodash/sampleSize";
|
|
55
|
+
import "lodash/set";
|
|
56
|
+
import "lodash/setWith";
|
|
57
|
+
import "lodash/shuffle";
|
|
58
|
+
import "lodash/snakeCase";
|
|
59
|
+
import "lodash/startCase";
|
|
60
|
+
import "lodash/toPath";
|
|
61
|
+
import "lodash/truncate";
|
|
62
|
+
import "lodash/union";
|
|
63
|
+
import "lodash/uniq";
|
|
64
|
+
import "lodash/uniqueId";
|
|
65
|
+
import "lodash/unset";
|
|
66
|
+
import "lodash/update";
|
|
67
|
+
import "lodash/updateWith";
|
|
68
|
+
import "lodash/upperCase";
|
|
69
|
+
import "lodash/upperFirst";
|
|
70
|
+
import "lodash/without";
|
|
71
|
+
import "lodash/xor";
|
|
72
|
+
import "lodash/zip";
|
|
73
|
+
import "@unicom-cloud/utils/math";
|
|
74
|
+
import "@unicom-cloud/utils/pinyin";
|
|
75
|
+
import "../../utils/reactDOM.js";
|
|
76
|
+
import "@unicom-cloud/utils/file/saveAs";
|
|
77
|
+
import "@unicom-cloud/utils/screenfull";
|
|
78
|
+
import "@unicom-cloud/utils/constant/ui";
|
|
79
|
+
import "@unicom-cloud/utils/constant/ui.js";
|
|
80
|
+
import "@unicom-cloud/utils/tinycolor";
|
|
81
|
+
import "@unicom-cloud/utils/ui-color";
|
|
82
|
+
import "@unicom-cloud/utils/string";
|
|
83
|
+
import "react-is";
|
|
84
|
+
import "@unicom-cloud/utils/tree";
|
|
85
|
+
import "@unicom-cloud/utils/tween";
|
|
86
|
+
import "uuid";
|
|
87
|
+
import "@unicom-cloud/utils/validate";
|
|
88
|
+
import "@unicom-cloud/utils/constant/keyboardCode";
|
|
89
|
+
import { isFunction as E } from "@unicom-cloud/utils/is";
|
|
90
|
+
function _t(p, i = [], c) {
|
|
91
|
+
const [f, a] = l(), e = b(p);
|
|
92
|
+
return e.current = p, v(() => {
|
|
93
|
+
if (!i.length) return h;
|
|
94
|
+
const n = u(
|
|
95
|
+
(t, o) => {
|
|
96
|
+
const r = e.current;
|
|
97
|
+
E(r) && r(t, o), a(t);
|
|
98
|
+
},
|
|
99
|
+
227
|
|
100
|
+
), s = [].concat(i).filter((t, o, r) => t instanceof Element), m = new IntersectionObserver(n, c);
|
|
101
|
+
return s.forEach((t, o, r) => {
|
|
102
|
+
m.observe(t);
|
|
103
|
+
}), () => {
|
|
104
|
+
s.forEach((t, o, r) => {
|
|
105
|
+
m.unobserve(t);
|
|
106
|
+
}), m.disconnect(), n.cancel();
|
|
107
|
+
};
|
|
108
|
+
}, i), f;
|
|
109
|
+
}
|
|
110
|
+
export {
|
|
111
|
+
_t as default,
|
|
112
|
+
_t as useIntersectionObservers
|
|
113
|
+
};
|
package/hooks/use-map/index.js
CHANGED
package/hooks/use-media/index.js
CHANGED
package/hooks/use-mount/index.js
CHANGED
package/hooks/use-mouse/index.js
CHANGED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/* 2025-11-19 09:09:36 */
|
|
2
|
+
import a from "lodash/throttle";
|
|
3
|
+
import { useState as l, useRef as b, useEffect as h } from "react";
|
|
4
|
+
import "@unicom-cloud/utils/case-name";
|
|
5
|
+
import "@unicom-cloud/utils/class-name";
|
|
6
|
+
import { NOOP as v } from "../../utils/constant.js";
|
|
7
|
+
import "@unicom-cloud/utils/clipboard-copy";
|
|
8
|
+
import "@unicom-cloud/utils/date";
|
|
9
|
+
import "../../utils/dayjs.js";
|
|
10
|
+
import "@unicom-cloud/utils/dom-helpers/reflow";
|
|
11
|
+
import "../../utils/is.js";
|
|
12
|
+
import "@unicom-cloud/utils/emitter";
|
|
13
|
+
import "@unicom-cloud/utils/file/fileToURL";
|
|
14
|
+
import "lodash/escapeRegExp";
|
|
15
|
+
import "lodash/assign";
|
|
16
|
+
import "lodash/assignIn";
|
|
17
|
+
import "lodash/at";
|
|
18
|
+
import "lodash/camelCase";
|
|
19
|
+
import "lodash/capitalize";
|
|
20
|
+
import "lodash/castArray";
|
|
21
|
+
import "lodash/chain";
|
|
22
|
+
import "lodash/chunk";
|
|
23
|
+
import "lodash/clone";
|
|
24
|
+
import "lodash/cloneDeep";
|
|
25
|
+
import "lodash/cloneDeepWith";
|
|
26
|
+
import "lodash/cloneWith";
|
|
27
|
+
import "lodash/compact";
|
|
28
|
+
import "lodash/curry";
|
|
29
|
+
import "lodash/debounce";
|
|
30
|
+
import "lodash/defaults";
|
|
31
|
+
import "lodash/defaultsDeep";
|
|
32
|
+
import "lodash/defaultTo";
|
|
33
|
+
import "lodash/difference";
|
|
34
|
+
import "lodash/escape";
|
|
35
|
+
import "lodash/findKey";
|
|
36
|
+
import "lodash/flattenDeep";
|
|
37
|
+
import "lodash/flow";
|
|
38
|
+
import "lodash/get";
|
|
39
|
+
import "lodash/groupBy";
|
|
40
|
+
import "lodash/has";
|
|
41
|
+
import "lodash/intersection";
|
|
42
|
+
import "lodash/invert";
|
|
43
|
+
import "lodash/invertBy";
|
|
44
|
+
import "lodash/kebabCase";
|
|
45
|
+
import "lodash/mean";
|
|
46
|
+
import "lodash/memoize";
|
|
47
|
+
import "lodash/merge";
|
|
48
|
+
import "lodash/mergeWith";
|
|
49
|
+
import "lodash/orderBy";
|
|
50
|
+
import "lodash/partition";
|
|
51
|
+
import "lodash/pullAll";
|
|
52
|
+
import "lodash/result";
|
|
53
|
+
import "lodash/sample";
|
|
54
|
+
import "lodash/sampleSize";
|
|
55
|
+
import "lodash/set";
|
|
56
|
+
import "lodash/setWith";
|
|
57
|
+
import "lodash/shuffle";
|
|
58
|
+
import "lodash/snakeCase";
|
|
59
|
+
import "lodash/startCase";
|
|
60
|
+
import "lodash/toPath";
|
|
61
|
+
import "lodash/truncate";
|
|
62
|
+
import "lodash/union";
|
|
63
|
+
import "lodash/uniq";
|
|
64
|
+
import "lodash/uniqueId";
|
|
65
|
+
import "lodash/unset";
|
|
66
|
+
import "lodash/update";
|
|
67
|
+
import "lodash/updateWith";
|
|
68
|
+
import "lodash/upperCase";
|
|
69
|
+
import "lodash/upperFirst";
|
|
70
|
+
import "lodash/without";
|
|
71
|
+
import "lodash/xor";
|
|
72
|
+
import "lodash/zip";
|
|
73
|
+
import "@unicom-cloud/utils/math";
|
|
74
|
+
import "@unicom-cloud/utils/pinyin";
|
|
75
|
+
import "../../utils/reactDOM.js";
|
|
76
|
+
import "@unicom-cloud/utils/file/saveAs";
|
|
77
|
+
import "@unicom-cloud/utils/screenfull";
|
|
78
|
+
import "@unicom-cloud/utils/constant/ui";
|
|
79
|
+
import "@unicom-cloud/utils/constant/ui.js";
|
|
80
|
+
import "@unicom-cloud/utils/tinycolor";
|
|
81
|
+
import "@unicom-cloud/utils/ui-color";
|
|
82
|
+
import "@unicom-cloud/utils/string";
|
|
83
|
+
import "react-is";
|
|
84
|
+
import "@unicom-cloud/utils/tree";
|
|
85
|
+
import "@unicom-cloud/utils/tween";
|
|
86
|
+
import "uuid";
|
|
87
|
+
import "@unicom-cloud/utils/validate";
|
|
88
|
+
import "@unicom-cloud/utils/constant/keyboardCode";
|
|
89
|
+
import { isFunction as O } from "@unicom-cloud/utils/is";
|
|
90
|
+
function _t(m, o = [], s) {
|
|
91
|
+
const [c, u] = l(), p = b(m);
|
|
92
|
+
return p.current = m, h(() => {
|
|
93
|
+
if (!o.length) return v;
|
|
94
|
+
const e = a(
|
|
95
|
+
(t, i) => {
|
|
96
|
+
const r = p.current;
|
|
97
|
+
O(r) && r(t, i), u(t);
|
|
98
|
+
},
|
|
99
|
+
227
|
|
100
|
+
), f = [].concat(o).filter((t, i, r) => t instanceof Element), n = new MutationObserver(e);
|
|
101
|
+
return f.forEach((t, i, r) => {
|
|
102
|
+
n.observe(t, {
|
|
103
|
+
attributes: !0,
|
|
104
|
+
childList: !0,
|
|
105
|
+
subtree: !0,
|
|
106
|
+
...s
|
|
107
|
+
});
|
|
108
|
+
}), () => {
|
|
109
|
+
n.disconnect(), e.cancel();
|
|
110
|
+
};
|
|
111
|
+
}, o), c;
|
|
112
|
+
}
|
|
113
|
+
export {
|
|
114
|
+
_t as default,
|
|
115
|
+
_t as useMutationObservers
|
|
116
|
+
};
|