@dxos/react-hooks 0.8.4-main.a4bbb77 → 0.8.4-main.ae835ea
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/dist/lib/browser/index.mjs +25 -14
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +25 -14
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/index.d.ts +2 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/useControlledState.d.ts +1 -0
- package/dist/types/src/useControlledState.d.ts.map +1 -1
- package/dist/types/src/useDynamicRef.d.ts +3 -3
- package/dist/types/src/useDynamicRef.d.ts.map +1 -1
- package/dist/types/src/useForwardedRef.d.ts +3 -3
- package/dist/types/src/useForwardedRef.d.ts.map +1 -1
- package/dist/types/src/useMediaQuery.d.ts.map +1 -1
- package/dist/types/src/useTransitions.d.ts +2 -1
- package/dist/types/src/useTransitions.d.ts.map +1 -1
- package/dist/types/src/useViewportResize.d.ts +3 -0
- package/dist/types/src/useViewportResize.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -5
- package/src/index.ts +3 -1
- package/src/useControlledState.ts +1 -0
- package/src/useDynamicRef.ts +3 -3
- package/src/useForwardedRef.ts +17 -14
- package/src/useMediaQuery.ts +1 -2
- package/src/useTransitions.ts +3 -1
- package/src/{useResize.ts → useViewportResize.ts} +1 -1
- package/dist/types/src/useResize.d.ts +0 -3
- package/dist/types/src/useResize.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/useAsyncEffect.ts":{"bytes":2988,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/useAsyncState.ts":{"bytes":2577,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/useControlledState.ts":{"bytes":
|
|
1
|
+
{"inputs":{"src/useAsyncEffect.ts":{"bytes":2988,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/useAsyncState.ts":{"bytes":2577,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/useControlledState.ts":{"bytes":2579,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/useDebugDeps.ts":{"bytes":3142,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/useDefaultValue.ts":{"bytes":4033,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/useDefaults.ts":{"bytes":1591,"imports":[{"path":"lodash.defaultsdeep","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/useDynamicRef.ts":{"bytes":3732,"imports":[{"path":"@preact-signals/safe-react/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/useFileDownload.ts":{"bytes":2671,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/useForwardedRef.ts":{"bytes":2278,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/useId.ts":{"bytes":2466,"imports":[{"path":"alea","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/useIsFocused.ts":{"bytes":3921,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/useMediaQuery.ts":{"bytes":9254,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/useMulticastObservable.ts":{"bytes":2972,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/useRefCallback.ts":{"bytes":1818,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/useViewportResize.ts":{"bytes":2878,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/useSignals.ts":{"bytes":2923,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/useTimeout.ts":{"bytes":3956,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/useTransitions.ts":{"bytes":7863,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":2454,"imports":[{"path":"src/useAsyncEffect.ts","kind":"import-statement","original":"./useAsyncEffect"},{"path":"src/useAsyncState.ts","kind":"import-statement","original":"./useAsyncState"},{"path":"src/useControlledState.ts","kind":"import-statement","original":"./useControlledState"},{"path":"src/useDebugDeps.ts","kind":"import-statement","original":"./useDebugDeps"},{"path":"src/useDefaultValue.ts","kind":"import-statement","original":"./useDefaultValue"},{"path":"src/useDefaults.ts","kind":"import-statement","original":"./useDefaults"},{"path":"src/useDynamicRef.ts","kind":"import-statement","original":"./useDynamicRef"},{"path":"src/useFileDownload.ts","kind":"import-statement","original":"./useFileDownload"},{"path":"src/useForwardedRef.ts","kind":"import-statement","original":"./useForwardedRef"},{"path":"src/useId.ts","kind":"import-statement","original":"./useId"},{"path":"src/useIsFocused.ts","kind":"import-statement","original":"./useIsFocused"},{"path":"src/useMediaQuery.ts","kind":"import-statement","original":"./useMediaQuery"},{"path":"src/useMulticastObservable.ts","kind":"import-statement","original":"./useMulticastObservable"},{"path":"src/useRefCallback.ts","kind":"import-statement","original":"./useRefCallback"},{"path":"src/useViewportResize.ts","kind":"import-statement","original":"./useViewportResize"},{"path":"src/useSignals.ts","kind":"import-statement","original":"./useSignals"},{"path":"src/useTimeout.ts","kind":"import-statement","original":"./useTimeout"},{"path":"src/useTransitions.ts","kind":"import-statement","original":"./useTransitions"},{"path":"mini-virtual-list","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":32505},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"lodash.defaultsdeep","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"alea","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"mini-virtual-list","kind":"import-statement","external":true}],"exports":["makeId","randomString","updateRef","useAsyncEffect","useAsyncState","useControlledState","useDebugDeps","useDefaultValue","useDefaults","useDidTransition","useDynamicRef","useFileDownload","useForwardedRef","useId","useInterval","useIsFocused","useMediaQuery","useMulticastObservable","useOnTransition","useRefCallback","useScroller","useSignalsEffect","useSignalsMemo","useSize","useStateWithRef","useTimeout","useViewportResize"],"entryPoint":"src/index.ts","inputs":{"src/useAsyncEffect.ts":{"bytesInOutput":405},"src/index.ts":{"bytesInOutput":58},"src/useAsyncState.ts":{"bytesInOutput":447},"src/useControlledState.ts":{"bytesInOutput":463},"src/useDebugDeps.ts":{"bytesInOutput":631},"src/useDefaultValue.ts":{"bytesInOutput":422},"src/useDefaults.ts":{"bytesInOutput":228},"src/useDynamicRef.ts":{"bytesInOutput":791},"src/useFileDownload.ts":{"bytesInOutput":416},"src/useForwardedRef.ts":{"bytesInOutput":395},"src/useId.ts":{"bytesInOutput":403},"src/useIsFocused.ts":{"bytesInOutput":833},"src/useMediaQuery.ts":{"bytesInOutput":1941},"src/useMulticastObservable.ts":{"bytesInOutput":368},"src/useRefCallback.ts":{"bytesInOutput":197},"src/useViewportResize.ts":{"bytesInOutput":627},"src/useSignals.ts":{"bytesInOutput":664},"src/useTimeout.ts":{"bytesInOutput":946},"src/useTransitions.ts":{"bytesInOutput":1406}},"bytes":12714}}}
|
|
@@ -12,8 +12,9 @@ export * from './useIsFocused';
|
|
|
12
12
|
export * from './useMediaQuery';
|
|
13
13
|
export * from './useMulticastObservable';
|
|
14
14
|
export * from './useRefCallback';
|
|
15
|
-
export * from './
|
|
15
|
+
export * from './useViewportResize';
|
|
16
16
|
export * from './useSignals';
|
|
17
17
|
export * from './useTimeout';
|
|
18
18
|
export * from './useTransitions';
|
|
19
|
+
export { useSize, useScroller } from 'mini-virtual-list';
|
|
19
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AAEjC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { type Dispatch, type SetStateAction } from 'react';
|
|
|
2
2
|
/**
|
|
3
3
|
* A stateful hook with a controlled value.
|
|
4
4
|
* NOTE: Be careful not to provide an inlinde default array.
|
|
5
|
+
* @deprecated Use Radix `useControllableState`.
|
|
5
6
|
*/
|
|
6
7
|
export declare const useControlledState: <T>(controlledValue: T, onChange?: (value: T) => void, ...deps: any[]) => [T, Dispatch<SetStateAction<T>>];
|
|
7
8
|
//# sourceMappingURL=useControlledState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useControlledState.d.ts","sourceRoot":"","sources":["../../../src/useControlledState.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAuB,MAAM,OAAO,CAAC;AAEhF
|
|
1
|
+
{"version":3,"file":"useControlledState.d.ts","sourceRoot":"","sources":["../../../src/useControlledState.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAuB,MAAM,OAAO,CAAC;AAEhF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,CAAC,EAClC,iBAAiB,CAAC,EAClB,WAAW,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,EAC7B,GAAG,MAAM,GAAG,EAAE,KACb,CAAC,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAajC,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { type Dispatch, type
|
|
1
|
+
import { type Dispatch, type RefObject, type SetStateAction } from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* Like `useState` but with an additional dynamic value.
|
|
4
4
|
*/
|
|
5
|
-
export declare const useStateWithRef: <T>(valueParam: T) => [T, Dispatch<SetStateAction<T>>,
|
|
5
|
+
export declare const useStateWithRef: <T>(valueParam: T) => [T, Dispatch<SetStateAction<T>>, RefObject<T>];
|
|
6
6
|
/**
|
|
7
7
|
* Ref that is updated by a dependency.
|
|
8
8
|
*/
|
|
9
|
-
export declare const useDynamicRef: <T>(value: T) =>
|
|
9
|
+
export declare const useDynamicRef: <T>(value: T) => RefObject<T>;
|
|
10
10
|
//# sourceMappingURL=useDynamicRef.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDynamicRef.d.ts","sourceRoot":"","sources":["../../../src/useDynamicRef.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"useDynamicRef.d.ts","sourceRoot":"","sources":["../../../src/useDynamicRef.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAA+B,MAAM,OAAO,CAAC;AAExG;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,CAAC,EAAE,YAAY,CAAC,KAAG,CAAC,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAgB/F,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,CAAC,EAAE,OAAO,CAAC,KAAG,SAAS,CAAC,CAAC,CAOtD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type ForwardedRef } from 'react';
|
|
1
|
+
import { type ForwardedRef, type RefObject } from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* Combines a possibly undefined forwarded ref with a locally defined ref.
|
|
4
|
-
* @deprecated Use `useComposedRefs` from @radix-ui/react-compose-refs
|
|
5
4
|
*/
|
|
6
|
-
export declare const useForwardedRef: <T>(ref: ForwardedRef<T>) =>
|
|
5
|
+
export declare const useForwardedRef: <T>(ref: ForwardedRef<T>) => RefObject<T | null>;
|
|
6
|
+
export declare const updateRef: <T>(ref: ForwardedRef<T>, value: T) => void;
|
|
7
7
|
//# sourceMappingURL=useForwardedRef.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useForwardedRef.d.ts","sourceRoot":"","sources":["../../../src/useForwardedRef.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,YAAY,EAAqB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useForwardedRef.d.ts","sourceRoot":"","sources":["../../../src/useForwardedRef.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAC;AAE7E;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,CAAC,EAAE,KAAK,YAAY,CAAC,CAAC,CAAC,KAAG,SAAS,CAAC,CAAC,GAAG,IAAI,CAO3E,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,CAAC,EAAE,KAAK,YAAY,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,KAAG,IAU7D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMediaQuery.d.ts","sourceRoot":"","sources":["../../../src/useMediaQuery.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,EAAE,CAAC;IAC/B,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAWF;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,GAAG,MAAM,EAAE,EAAE,UAAS,oBAAyB,KAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"useMediaQuery.d.ts","sourceRoot":"","sources":["../../../src/useMediaQuery.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,EAAE,CAAC;IAC/B,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAWF;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,GAAG,MAAM,EAAE,EAAE,UAAS,oBAAyB,KAAG,OAAO,EA0DnG,CAAC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Executes a callback function when a specified transition occurs in a value.
|
|
3
3
|
*
|
|
4
4
|
* This function utilizes the `useDidTransition` hook to monitor changes in `currentValue`.
|
|
5
|
-
* When `currentValue` transitions from `fromValue` to `toValue`, the provided `callback` function is executed.
|
|
5
|
+
* When `currentValue` transitions from `fromValue` to `toValue`, the provided `callback` function is executed.
|
|
6
|
+
*/
|
|
6
7
|
export declare const useOnTransition: <T>(currentValue: T, fromValue: T | ((value: T) => boolean), toValue: T | ((value: T) => boolean), callback: () => void) => void;
|
|
7
8
|
//# sourceMappingURL=useTransitions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTransitions.d.ts","sourceRoot":"","sources":["../../../src/useTransitions.ts"],"names":[],"mappings":"AA8CA
|
|
1
|
+
{"version":3,"file":"useTransitions.d.ts","sourceRoot":"","sources":["../../../src/useTransitions.ts"],"names":[],"mappings":"AA8CA;;;;;GAKG;AAEH,eAAO,MAAM,eAAe,GAAI,CAAC,EAC/B,cAAc,CAAC,EACf,WAAW,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,CAAC,EACtC,SAAS,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,CAAC,EACpC,UAAU,MAAM,IAAI,SAerB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useViewportResize.d.ts","sourceRoot":"","sources":["../../../src/useViewportResize.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAW,MAAM,OAAO,CAAC;AAEjD,eAAO,MAAM,iBAAiB,GAC5B,SAAS,CAAC,KAAK,CAAC,EAAE,KAAK,KAAK,IAAI,EAChC,OAAM,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC,CAAC,CAAM,EAChD,QAAO,MAAY,SAiBpB,CAAC"}
|