@contember/react-utils 2.1.0-alpha.9 → 2.1.0-beta.1
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/development/index.cjs +32 -32
- package/dist/development/index.js +11 -11
- package/dist/development/src/context/createContext.cjs.map +1 -1
- package/dist/development/src/context/createContext.js.map +1 -1
- package/dist/development/src/context/createRequiredContext.cjs +1 -1
- package/dist/development/src/context/createRequiredContext.cjs.map +1 -1
- package/dist/development/src/context/createRequiredContext.js +1 -1
- package/dist/development/src/context/createRequiredContext.js.map +1 -1
- package/dist/development/src/debug-context/Constants.cjs.map +1 -1
- package/dist/development/src/debug-context/Constants.js.map +1 -1
- package/dist/development/src/debug-context/Context.cjs.map +1 -1
- package/dist/development/src/debug-context/Context.js +1 -1
- package/dist/development/src/debug-context/Context.js.map +1 -1
- package/dist/development/src/hooks/unwrapRefValue.cjs.map +1 -1
- package/dist/development/src/hooks/unwrapRefValue.js.map +1 -1
- package/dist/development/src/hooks/useAbortController.cjs.map +1 -1
- package/dist/development/src/hooks/useAbortController.js.map +1 -1
- package/dist/development/src/hooks/useArrayMapMemo.cjs.map +1 -1
- package/dist/development/src/hooks/useArrayMapMemo.js.map +1 -1
- package/dist/development/src/hooks/useAutoHeightTextArea.cjs.map +1 -1
- package/dist/development/src/hooks/useAutoHeightTextArea.js.map +1 -1
- package/dist/development/src/hooks/useChildrenAsLabel.cjs +6 -5
- package/dist/development/src/hooks/useChildrenAsLabel.cjs.map +1 -1
- package/dist/development/src/hooks/useChildrenAsLabel.js +6 -5
- package/dist/development/src/hooks/useChildrenAsLabel.js.map +1 -1
- package/dist/development/src/hooks/useComposeRef.cjs.map +1 -1
- package/dist/development/src/hooks/useComposeRef.js.map +1 -1
- package/dist/development/src/hooks/useConstantLengthInvariant.cjs.map +1 -1
- package/dist/development/src/hooks/useConstantLengthInvariant.js.map +1 -1
- package/dist/development/src/hooks/useConstantValueInvariant.cjs.map +1 -1
- package/dist/development/src/hooks/useConstantValueInvariant.js.map +1 -1
- package/dist/development/src/hooks/useDebounce.cjs.map +1 -1
- package/dist/development/src/hooks/useDebounce.js.map +1 -1
- package/dist/development/src/hooks/useDebounceCallback.cjs +1 -1
- package/dist/development/src/hooks/useDebounceCallback.cjs.map +1 -1
- package/dist/development/src/hooks/useDebounceCallback.js +1 -1
- package/dist/development/src/hooks/useDebounceCallback.js.map +1 -1
- package/dist/development/src/hooks/useDocumentTitle.cjs.map +1 -1
- package/dist/development/src/hooks/useDocumentTitle.js.map +1 -1
- package/dist/development/src/hooks/useExpectSameValueReference.cjs.map +1 -1
- package/dist/development/src/hooks/useExpectSameValueReference.js.map +1 -1
- package/dist/development/src/hooks/useForceRender.cjs.map +1 -1
- package/dist/development/src/hooks/useForceRender.js.map +1 -1
- package/dist/development/src/hooks/useId.cjs.map +1 -1
- package/dist/development/src/hooks/useId.js.map +1 -1
- package/dist/development/src/hooks/useIsMounted.cjs.map +1 -1
- package/dist/development/src/hooks/useIsMounted.js.map +1 -1
- package/dist/development/src/hooks/useObjectMemo.cjs.map +1 -1
- package/dist/development/src/hooks/useObjectMemo.js.map +1 -1
- package/dist/development/src/hooks/useOnElementClickOutsideCallback.cjs.map +1 -1
- package/dist/development/src/hooks/useOnElementClickOutsideCallback.js.map +1 -1
- package/dist/development/src/hooks/useOnElementMouseEnterDelayedCallback.cjs +1 -1
- package/dist/development/src/hooks/useOnElementMouseEnterDelayedCallback.cjs.map +1 -1
- package/dist/development/src/hooks/useOnElementMouseEnterDelayedCallback.js +1 -1
- package/dist/development/src/hooks/useOnElementMouseEnterDelayedCallback.js.map +1 -1
- package/dist/development/src/hooks/useOnElementResize.cjs.map +1 -1
- package/dist/development/src/hooks/useOnElementResize.js.map +1 -1
- package/dist/development/src/hooks/useOnWindowResize.cjs.map +1 -1
- package/dist/development/src/hooks/useOnWindowResize.js.map +1 -1
- package/dist/development/src/hooks/usePreviousValue.cjs.map +1 -1
- package/dist/development/src/hooks/usePreviousValue.js.map +1 -1
- package/dist/development/src/hooks/useStoredState.cjs.map +1 -1
- package/dist/development/src/hooks/useStoredState.js.map +1 -1
- package/dist/development/src/hooks/useUpdatedRef.cjs.map +1 -1
- package/dist/development/src/hooks/useUpdatedRef.js.map +1 -1
- package/dist/development/src/hooks/useWindowSize.cjs.map +1 -1
- package/dist/development/src/hooks/useWindowSize.js.map +1 -1
- package/dist/development/src/referentiallyStable/emptyArray.cjs.map +1 -1
- package/dist/development/src/referentiallyStable/emptyArray.js.map +1 -1
- package/dist/development/src/referentiallyStable/emptyObject.cjs.map +1 -1
- package/dist/development/src/referentiallyStable/emptyObject.js.map +1 -1
- package/dist/development/src/referentiallyStable/identityFunction.cjs.map +1 -1
- package/dist/development/src/referentiallyStable/identityFunction.js.map +1 -1
- package/dist/development/src/referentiallyStable/useReferentiallyStableCallback.cjs +6 -3
- package/dist/development/src/referentiallyStable/useReferentiallyStableCallback.cjs.map +1 -1
- package/dist/development/src/referentiallyStable/useReferentiallyStableCallback.js +6 -3
- package/dist/development/src/referentiallyStable/useReferentiallyStableCallback.js.map +1 -1
- package/dist/production/index.cjs +32 -32
- package/dist/production/index.js +11 -11
- package/dist/production/src/context/createContext.cjs.map +1 -1
- package/dist/production/src/context/createContext.js.map +1 -1
- package/dist/production/src/context/createRequiredContext.cjs +1 -1
- package/dist/production/src/context/createRequiredContext.cjs.map +1 -1
- package/dist/production/src/context/createRequiredContext.js +1 -1
- package/dist/production/src/context/createRequiredContext.js.map +1 -1
- package/dist/production/src/debug-context/Constants.cjs.map +1 -1
- package/dist/production/src/debug-context/Constants.js.map +1 -1
- package/dist/production/src/debug-context/Context.cjs.map +1 -1
- package/dist/production/src/debug-context/Context.js +1 -1
- package/dist/production/src/debug-context/Context.js.map +1 -1
- package/dist/production/src/hooks/unwrapRefValue.cjs.map +1 -1
- package/dist/production/src/hooks/unwrapRefValue.js.map +1 -1
- package/dist/production/src/hooks/useAbortController.cjs.map +1 -1
- package/dist/production/src/hooks/useAbortController.js.map +1 -1
- package/dist/production/src/hooks/useArrayMapMemo.cjs.map +1 -1
- package/dist/production/src/hooks/useArrayMapMemo.js.map +1 -1
- package/dist/production/src/hooks/useAutoHeightTextArea.cjs.map +1 -1
- package/dist/production/src/hooks/useAutoHeightTextArea.js.map +1 -1
- package/dist/production/src/hooks/useChildrenAsLabel.cjs +6 -5
- package/dist/production/src/hooks/useChildrenAsLabel.cjs.map +1 -1
- package/dist/production/src/hooks/useChildrenAsLabel.js +6 -5
- package/dist/production/src/hooks/useChildrenAsLabel.js.map +1 -1
- package/dist/production/src/hooks/useComposeRef.cjs.map +1 -1
- package/dist/production/src/hooks/useComposeRef.js.map +1 -1
- package/dist/production/src/hooks/useConstantLengthInvariant.cjs.map +1 -1
- package/dist/production/src/hooks/useConstantLengthInvariant.js.map +1 -1
- package/dist/production/src/hooks/useConstantValueInvariant.cjs.map +1 -1
- package/dist/production/src/hooks/useConstantValueInvariant.js.map +1 -1
- package/dist/production/src/hooks/useDebounce.cjs.map +1 -1
- package/dist/production/src/hooks/useDebounce.js.map +1 -1
- package/dist/production/src/hooks/useDebounceCallback.cjs +1 -1
- package/dist/production/src/hooks/useDebounceCallback.cjs.map +1 -1
- package/dist/production/src/hooks/useDebounceCallback.js +1 -1
- package/dist/production/src/hooks/useDebounceCallback.js.map +1 -1
- package/dist/production/src/hooks/useDocumentTitle.cjs.map +1 -1
- package/dist/production/src/hooks/useDocumentTitle.js.map +1 -1
- package/dist/production/src/hooks/useExpectSameValueReference.cjs.map +1 -1
- package/dist/production/src/hooks/useExpectSameValueReference.js.map +1 -1
- package/dist/production/src/hooks/useForceRender.cjs.map +1 -1
- package/dist/production/src/hooks/useForceRender.js.map +1 -1
- package/dist/production/src/hooks/useId.cjs.map +1 -1
- package/dist/production/src/hooks/useId.js.map +1 -1
- package/dist/production/src/hooks/useIsMounted.cjs.map +1 -1
- package/dist/production/src/hooks/useIsMounted.js.map +1 -1
- package/dist/production/src/hooks/useObjectMemo.cjs.map +1 -1
- package/dist/production/src/hooks/useObjectMemo.js.map +1 -1
- package/dist/production/src/hooks/useOnElementClickOutsideCallback.cjs.map +1 -1
- package/dist/production/src/hooks/useOnElementClickOutsideCallback.js.map +1 -1
- package/dist/production/src/hooks/useOnElementMouseEnterDelayedCallback.cjs +1 -1
- package/dist/production/src/hooks/useOnElementMouseEnterDelayedCallback.cjs.map +1 -1
- package/dist/production/src/hooks/useOnElementMouseEnterDelayedCallback.js +1 -1
- package/dist/production/src/hooks/useOnElementMouseEnterDelayedCallback.js.map +1 -1
- package/dist/production/src/hooks/useOnElementResize.cjs.map +1 -1
- package/dist/production/src/hooks/useOnElementResize.js.map +1 -1
- package/dist/production/src/hooks/useOnWindowResize.cjs.map +1 -1
- package/dist/production/src/hooks/useOnWindowResize.js.map +1 -1
- package/dist/production/src/hooks/usePreviousValue.cjs.map +1 -1
- package/dist/production/src/hooks/usePreviousValue.js.map +1 -1
- package/dist/production/src/hooks/useStoredState.cjs.map +1 -1
- package/dist/production/src/hooks/useStoredState.js.map +1 -1
- package/dist/production/src/hooks/useUpdatedRef.cjs.map +1 -1
- package/dist/production/src/hooks/useUpdatedRef.js.map +1 -1
- package/dist/production/src/hooks/useWindowSize.cjs.map +1 -1
- package/dist/production/src/hooks/useWindowSize.js.map +1 -1
- package/dist/production/src/referentiallyStable/emptyArray.cjs.map +1 -1
- package/dist/production/src/referentiallyStable/emptyArray.js.map +1 -1
- package/dist/production/src/referentiallyStable/emptyObject.cjs.map +1 -1
- package/dist/production/src/referentiallyStable/emptyObject.js.map +1 -1
- package/dist/production/src/referentiallyStable/identityFunction.cjs.map +1 -1
- package/dist/production/src/referentiallyStable/identityFunction.js.map +1 -1
- package/dist/production/src/referentiallyStable/useReferentiallyStableCallback.cjs +6 -3
- package/dist/production/src/referentiallyStable/useReferentiallyStableCallback.cjs.map +1 -1
- package/dist/production/src/referentiallyStable/useReferentiallyStableCallback.js +6 -3
- package/dist/production/src/referentiallyStable/useReferentiallyStableCallback.js.map +1 -1
- package/dist/types/debug-context/Constants.d.ts.map +1 -1
- package/dist/types/debug-context/Context.d.ts +1 -1
- package/dist/types/debug-context/Context.d.ts.map +1 -1
- package/dist/types/hooks/unwrapRefValue.d.ts +1 -1
- package/dist/types/hooks/unwrapRefValue.d.ts.map +1 -1
- package/dist/types/hooks/useAutoHeightTextArea.d.ts.map +1 -1
- package/dist/types/hooks/useChildrenAsLabel.d.ts +0 -2
- package/dist/types/hooks/useChildrenAsLabel.d.ts.map +1 -1
- package/dist/types/hooks/useConstantLengthInvariant.d.ts.map +1 -1
- package/dist/types/hooks/useConstantValueInvariant.d.ts.map +1 -1
- package/dist/types/hooks/useExpectSameValueReference.d.ts.map +1 -1
- package/dist/types/hooks/useForceRender.d.ts +1 -1
- package/dist/types/hooks/useForceRender.d.ts.map +1 -1
- package/dist/types/hooks/useIsMounted.d.ts +1 -1
- package/dist/types/hooks/useIsMounted.d.ts.map +1 -1
- package/dist/types/hooks/useOnElementResize.d.ts.map +1 -1
- package/dist/types/hooks/useOnWindowResize.d.ts.map +1 -1
- package/dist/types/hooks/useStoredState.d.ts.map +1 -1
- package/dist/types/hooks/useUpdatedRef.d.ts +1 -1
- package/dist/types/hooks/useUpdatedRef.d.ts.map +1 -1
- package/dist/types/referentiallyStable/useReferentiallyStableCallback.d.ts +2 -1
- package/dist/types/referentiallyStable/useReferentiallyStableCallback.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -2
- package/src/debug-context/Constants.ts +1 -1
- package/src/debug-context/Context.tsx +13 -13
- package/src/hooks/unwrapRefValue.ts +1 -1
- package/src/hooks/useArrayMapMemo.ts +2 -2
- package/src/hooks/useAutoHeightTextArea.ts +1 -0
- package/src/hooks/useChildrenAsLabel.ts +7 -8
- package/src/hooks/useConstantLengthInvariant.ts +1 -3
- package/src/hooks/useConstantValueInvariant.ts +0 -1
- package/src/hooks/useDebounceCallback.ts +1 -1
- package/src/hooks/useExpectSameValueReference.ts +9 -6
- package/src/hooks/useOnElementMouseEnterDelayedCallback.ts +1 -1
- package/src/hooks/useOnElementResize.ts +2 -1
- package/src/hooks/useOnWindowResize.ts +3 -1
- package/src/hooks/useStoredState.ts +5 -3
- package/src/referentiallyStable/useReferentiallyStableCallback.ts +9 -5
- package/tests/hooks/useChildrenAsLabel.test.tsx +1 -0
- package/tests/hooks/useId.test.ts +1 -1
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
3
|
+
const Context = require("./src/debug-context/Context.cjs");
|
|
4
4
|
const createContext = require("./src/context/createContext.cjs");
|
|
5
|
+
const createRequiredContext = require("./src/context/createRequiredContext.cjs");
|
|
6
|
+
const emptyArray = require("./src/referentiallyStable/emptyArray.cjs");
|
|
7
|
+
const emptyObject = require("./src/referentiallyStable/emptyObject.cjs");
|
|
8
|
+
const useChildrenAsLabel = require("./src/hooks/useChildrenAsLabel.cjs");
|
|
9
|
+
const useStoredState = require("./src/hooks/useStoredState.cjs");
|
|
10
|
+
const identityFunction = require("./src/referentiallyStable/identityFunction.cjs");
|
|
5
11
|
const Constants = require("./src/debug-context/Constants.cjs");
|
|
6
|
-
const
|
|
12
|
+
const noop = require("./src/referentiallyStable/noop.cjs");
|
|
13
|
+
const returnFalse = require("./src/referentiallyStable/returnFalse.cjs");
|
|
14
|
+
const returnTrue = require("./src/referentiallyStable/returnTrue.cjs");
|
|
7
15
|
const unwrapRefValue = require("./src/hooks/unwrapRefValue.cjs");
|
|
8
16
|
const useAbortController = require("./src/hooks/useAbortController.cjs");
|
|
9
17
|
const useArrayMapMemo = require("./src/hooks/useArrayMapMemo.cjs");
|
|
10
18
|
const useAutoHeightTextArea = require("./src/hooks/useAutoHeightTextArea.cjs");
|
|
11
|
-
const useChildrenAsLabel = require("./src/hooks/useChildrenAsLabel.cjs");
|
|
12
19
|
const useComposeRef = require("./src/hooks/useComposeRef.cjs");
|
|
13
20
|
const useConstantLengthInvariant = require("./src/hooks/useConstantLengthInvariant.cjs");
|
|
14
21
|
const useConstantValueInvariant = require("./src/hooks/useConstantValueInvariant.cjs");
|
|
@@ -25,31 +32,38 @@ const useOnElementMouseEnterDelayedCallback = require("./src/hooks/useOnElementM
|
|
|
25
32
|
const useOnElementResize = require("./src/hooks/useOnElementResize.cjs");
|
|
26
33
|
const useOnWindowResize = require("./src/hooks/useOnWindowResize.cjs");
|
|
27
34
|
const usePreviousValue = require("./src/hooks/usePreviousValue.cjs");
|
|
28
|
-
const
|
|
35
|
+
const useReferentiallyStableCallback = require("./src/referentiallyStable/useReferentiallyStableCallback.cjs");
|
|
29
36
|
const useUpdatedRef = require("./src/hooks/useUpdatedRef.cjs");
|
|
30
37
|
const useWindowSize = require("./src/hooks/useWindowSize.cjs");
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const noop = require("./src/referentiallyStable/noop.cjs");
|
|
35
|
-
const returnFalse = require("./src/referentiallyStable/returnFalse.cjs");
|
|
36
|
-
const returnTrue = require("./src/referentiallyStable/returnTrue.cjs");
|
|
37
|
-
const useReferentiallyStableCallback = require("./src/referentiallyStable/useReferentiallyStableCallback.cjs");
|
|
38
|
-
exports.createRequiredContext = createRequiredContext.createRequiredContext;
|
|
38
|
+
exports.DebugChildren = Context.DebugChildren;
|
|
39
|
+
exports.ScopedConsoleContext = Context.ScopedConsoleContext;
|
|
40
|
+
exports.useScopedConsoleRef = Context.useScopedConsoleRef;
|
|
39
41
|
exports.createContext = createContext.createContext;
|
|
42
|
+
exports.createRequiredContext = createRequiredContext.createRequiredContext;
|
|
43
|
+
exports.emptyArray = emptyArray.emptyArray;
|
|
44
|
+
exports.emptyObject = emptyObject.emptyObject;
|
|
45
|
+
exports.getChildrenAsLabel = useChildrenAsLabel.getChildrenAsLabel;
|
|
46
|
+
exports.useChildrenAsLabel = useChildrenAsLabel.useChildrenAsLabel;
|
|
47
|
+
exports.getStateStorage = useStoredState.getStateStorage;
|
|
48
|
+
exports.localStateStorage = useStoredState.localStateStorage;
|
|
49
|
+
exports.nullStorage = useStoredState.nullStorage;
|
|
50
|
+
exports.sessionStateStorage = useStoredState.sessionStateStorage;
|
|
51
|
+
exports.urlStateStorage = useStoredState.urlStateStorage;
|
|
52
|
+
exports.useLocalStorageState = useStoredState.useLocalStorageState;
|
|
53
|
+
exports.useSessionStorageState = useStoredState.useSessionStorageState;
|
|
54
|
+
exports.useStoredState = useStoredState.useStoredState;
|
|
55
|
+
exports.identityFunction = identityFunction.identityFunction;
|
|
40
56
|
exports.isNoopScopedConsole = Constants.isNoopScopedConsole;
|
|
41
57
|
exports.noopLog = Constants.noopLog;
|
|
42
58
|
exports.noopLogged = Constants.noopLogged;
|
|
43
59
|
exports.noopScopedConsole = Constants.noopScopedConsole;
|
|
44
|
-
exports.
|
|
45
|
-
exports.
|
|
46
|
-
exports.
|
|
60
|
+
exports.noop = noop.noop;
|
|
61
|
+
exports.returnFalse = returnFalse.returnFalse;
|
|
62
|
+
exports.returnTrue = returnTrue.returnTrue;
|
|
47
63
|
exports.unwrapRefValue = unwrapRefValue.unwrapRefValue;
|
|
48
64
|
exports.useAbortController = useAbortController.useAbortController;
|
|
49
65
|
exports.useArrayMapMemo = useArrayMapMemo.useArrayMapMemo;
|
|
50
66
|
exports.useAutoHeightTextArea = useAutoHeightTextArea.useAutoHeightTextArea;
|
|
51
|
-
exports.getChildrenAsLabel = useChildrenAsLabel.getChildrenAsLabel;
|
|
52
|
-
exports.useChildrenAsLabel = useChildrenAsLabel.useChildrenAsLabel;
|
|
53
67
|
exports.useComposeRef = useComposeRef.useComposeRef;
|
|
54
68
|
exports.useConstantLengthInvariant = useConstantLengthInvariant.useConstantLengthInvariant;
|
|
55
69
|
exports.useConstantValueInvariant = useConstantValueInvariant.useConstantValueInvariant;
|
|
@@ -66,21 +80,7 @@ exports.useOnElementMouseEnterDelayedCallback = useOnElementMouseEnterDelayedCal
|
|
|
66
80
|
exports.useOnElementResize = useOnElementResize.useOnElementResize;
|
|
67
81
|
exports.useOnWindowResize = useOnWindowResize.useOnWindowResize;
|
|
68
82
|
exports.usePreviousValue = usePreviousValue.usePreviousValue;
|
|
69
|
-
exports.
|
|
70
|
-
exports.localStateStorage = useStoredState.localStateStorage;
|
|
71
|
-
exports.nullStorage = useStoredState.nullStorage;
|
|
72
|
-
exports.sessionStateStorage = useStoredState.sessionStateStorage;
|
|
73
|
-
exports.urlStateStorage = useStoredState.urlStateStorage;
|
|
74
|
-
exports.useLocalStorageState = useStoredState.useLocalStorageState;
|
|
75
|
-
exports.useSessionStorageState = useStoredState.useSessionStorageState;
|
|
76
|
-
exports.useStoredState = useStoredState.useStoredState;
|
|
83
|
+
exports.useReferentiallyStableCallback = useReferentiallyStableCallback.useReferentiallyStableCallback;
|
|
77
84
|
exports.useUpdatedRef = useUpdatedRef.useUpdatedRef;
|
|
78
85
|
exports.useWindowSize = useWindowSize.useWindowSize;
|
|
79
|
-
exports.emptyArray = emptyArray.emptyArray;
|
|
80
|
-
exports.emptyObject = emptyObject.emptyObject;
|
|
81
|
-
exports.identityFunction = identityFunction.identityFunction;
|
|
82
|
-
exports.noop = noop.noop;
|
|
83
|
-
exports.returnFalse = returnFalse.returnFalse;
|
|
84
|
-
exports.returnTrue = returnTrue.returnTrue;
|
|
85
|
-
exports.useReferentiallyStableCallback = useReferentiallyStableCallback.useReferentiallyStableCallback;
|
|
86
86
|
//# sourceMappingURL=index.cjs.map
|
package/dist/production/index.js
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DebugChildren, ScopedConsoleContext, useScopedConsoleRef } from "./src/debug-context/Context.js";
|
|
2
2
|
import { createContext } from "./src/context/createContext.js";
|
|
3
|
+
import { createRequiredContext } from "./src/context/createRequiredContext.js";
|
|
4
|
+
import { emptyArray } from "./src/referentiallyStable/emptyArray.js";
|
|
5
|
+
import { emptyObject } from "./src/referentiallyStable/emptyObject.js";
|
|
6
|
+
import { getChildrenAsLabel, useChildrenAsLabel } from "./src/hooks/useChildrenAsLabel.js";
|
|
7
|
+
import { getStateStorage, localStateStorage, nullStorage, sessionStateStorage, urlStateStorage, useLocalStorageState, useSessionStorageState, useStoredState } from "./src/hooks/useStoredState.js";
|
|
8
|
+
import { identityFunction } from "./src/referentiallyStable/identityFunction.js";
|
|
3
9
|
import { isNoopScopedConsole, noopLog, noopLogged, noopScopedConsole } from "./src/debug-context/Constants.js";
|
|
4
|
-
import {
|
|
10
|
+
import { noop } from "./src/referentiallyStable/noop.js";
|
|
11
|
+
import { returnFalse } from "./src/referentiallyStable/returnFalse.js";
|
|
12
|
+
import { returnTrue } from "./src/referentiallyStable/returnTrue.js";
|
|
5
13
|
import { unwrapRefValue } from "./src/hooks/unwrapRefValue.js";
|
|
6
14
|
import { useAbortController } from "./src/hooks/useAbortController.js";
|
|
7
15
|
import { useArrayMapMemo } from "./src/hooks/useArrayMapMemo.js";
|
|
8
16
|
import { useAutoHeightTextArea } from "./src/hooks/useAutoHeightTextArea.js";
|
|
9
|
-
import { getChildrenAsLabel, useChildrenAsLabel } from "./src/hooks/useChildrenAsLabel.js";
|
|
10
17
|
import { useComposeRef } from "./src/hooks/useComposeRef.js";
|
|
11
18
|
import { useConstantLengthInvariant } from "./src/hooks/useConstantLengthInvariant.js";
|
|
12
19
|
import { useConstantValueInvariant } from "./src/hooks/useConstantValueInvariant.js";
|
|
@@ -23,16 +30,9 @@ import { useOnElementMouseEnterDelayedCallback } from "./src/hooks/useOnElementM
|
|
|
23
30
|
import { useOnElementResize } from "./src/hooks/useOnElementResize.js";
|
|
24
31
|
import { useOnWindowResize } from "./src/hooks/useOnWindowResize.js";
|
|
25
32
|
import { usePreviousValue } from "./src/hooks/usePreviousValue.js";
|
|
26
|
-
import {
|
|
33
|
+
import { useReferentiallyStableCallback } from "./src/referentiallyStable/useReferentiallyStableCallback.js";
|
|
27
34
|
import { useUpdatedRef } from "./src/hooks/useUpdatedRef.js";
|
|
28
35
|
import { useWindowSize } from "./src/hooks/useWindowSize.js";
|
|
29
|
-
import { emptyArray } from "./src/referentiallyStable/emptyArray.js";
|
|
30
|
-
import { emptyObject } from "./src/referentiallyStable/emptyObject.js";
|
|
31
|
-
import { identityFunction } from "./src/referentiallyStable/identityFunction.js";
|
|
32
|
-
import { noop } from "./src/referentiallyStable/noop.js";
|
|
33
|
-
import { returnFalse } from "./src/referentiallyStable/returnFalse.js";
|
|
34
|
-
import { returnTrue } from "./src/referentiallyStable/returnTrue.js";
|
|
35
|
-
import { useReferentiallyStableCallback } from "./src/referentiallyStable/useReferentiallyStableCallback.js";
|
|
36
36
|
export {
|
|
37
37
|
DebugChildren,
|
|
38
38
|
ScopedConsoleContext,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createContext.cjs","sources":["../../../../../packages/react-utils/src/context/createContext.ts"],"sourcesContent":["import type { Context, Provider } from 'react'\nimport { createContext as baseCreateContext, useContext } from 'react'\n\nexport function createContext<T>(name: string, initialValue: T): [Context<T>, () => T, Provider<T>] {\n\tconst OptionalContext = baseCreateContext<T>(initialValue)\n\tOptionalContext.displayName = name\n\n\treturn [OptionalContext, () => useContext(OptionalContext), OptionalContext.Provider]\n}\n"],"names":["baseCreateContext","useContext"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"createContext.cjs","sources":["../../../../../packages/react-utils/src/context/createContext.ts"],"sourcesContent":["import type { Context, Provider } from 'react'\nimport { createContext as baseCreateContext, useContext } from 'react'\n\nexport function createContext<T>(name: string, initialValue: T): [Context<T>, () => T, Provider<T>] {\n\tconst OptionalContext = baseCreateContext<T>(initialValue)\n\tOptionalContext.displayName = name\n\n\treturn [OptionalContext, () => useContext(OptionalContext), OptionalContext.Provider]\n}\n"],"names":["baseCreateContext","useContext"],"mappings":";;;AAGO,SAAS,cAAiB,MAAc,cAAqD;AACnG,QAAM,kBAAkBA,MAAAA,cAAqB,YAAY;AACzD,kBAAgB,cAAc;AAE9B,SAAO,CAAC,iBAAiB,MAAMC,MAAAA,WAAW,eAAe,GAAG,gBAAgB,QAAQ;AACrF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createContext.js","sources":["../../../../../packages/react-utils/src/context/createContext.ts"],"sourcesContent":["import type { Context, Provider } from 'react'\nimport { createContext as baseCreateContext, useContext } from 'react'\n\nexport function createContext<T>(name: string, initialValue: T): [Context<T>, () => T, Provider<T>] {\n\tconst OptionalContext = baseCreateContext<T>(initialValue)\n\tOptionalContext.displayName = name\n\n\treturn [OptionalContext, () => useContext(OptionalContext), OptionalContext.Provider]\n}\n"],"names":["baseCreateContext"],"mappings":";
|
|
1
|
+
{"version":3,"file":"createContext.js","sources":["../../../../../packages/react-utils/src/context/createContext.ts"],"sourcesContent":["import type { Context, Provider } from 'react'\nimport { createContext as baseCreateContext, useContext } from 'react'\n\nexport function createContext<T>(name: string, initialValue: T): [Context<T>, () => T, Provider<T>] {\n\tconst OptionalContext = baseCreateContext<T>(initialValue)\n\tOptionalContext.displayName = name\n\n\treturn [OptionalContext, () => useContext(OptionalContext), OptionalContext.Provider]\n}\n"],"names":["baseCreateContext"],"mappings":";AAGO,SAAS,cAAiB,MAAc,cAAqD;AACnG,QAAM,kBAAkBA,gBAAqB,YAAY;AACzD,kBAAgB,cAAc;AAE9B,SAAO,CAAC,iBAAiB,MAAM,WAAW,eAAe,GAAG,gBAAgB,QAAQ;AACrF;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const React = require("react");
|
|
4
|
-
const EmptyContextSymbol = Symbol("EmptyContextSymbol");
|
|
4
|
+
const EmptyContextSymbol = /* @__PURE__ */ Symbol("EmptyContextSymbol");
|
|
5
5
|
function createRequiredContext(displayName) {
|
|
6
6
|
const RequiredContext = React.createContext(EmptyContextSymbol);
|
|
7
7
|
RequiredContext.displayName = displayName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createRequiredContext.cjs","sources":["../../../../../packages/react-utils/src/context/createRequiredContext.ts"],"sourcesContent":["import type { Context, Provider } from 'react'\nimport { createContext, useContext } from 'react'\n\nconst EmptyContextSymbol = Symbol('EmptyContextSymbol')\n\nexport function createRequiredContext<T>(displayName: string): [Context<T>, () => T, Provider<T>] {\n\tconst RequiredContext = createContext<T>(EmptyContextSymbol as T)\n\tRequiredContext.displayName = displayName\n\n\tconst useRequiredContext = (): T => {\n\t\tconst context = useContext(RequiredContext)\n\n\t\tif (context === EmptyContextSymbol) {\n\t\t\tthrow new Error(`use${displayName} must be used within a ${displayName} provider`)\n\t\t}\n\n\t\treturn context\n\t}\n\n\treturn [RequiredContext, useRequiredContext, RequiredContext.Provider]\n}\n"],"names":["createContext","useContext"],"mappings":";;;AAGA,MAAM,
|
|
1
|
+
{"version":3,"file":"createRequiredContext.cjs","sources":["../../../../../packages/react-utils/src/context/createRequiredContext.ts"],"sourcesContent":["import type { Context, Provider } from 'react'\nimport { createContext, useContext } from 'react'\n\nconst EmptyContextSymbol = Symbol('EmptyContextSymbol')\n\nexport function createRequiredContext<T>(displayName: string): [Context<T>, () => T, Provider<T>] {\n\tconst RequiredContext = createContext<T>(EmptyContextSymbol as T)\n\tRequiredContext.displayName = displayName\n\n\tconst useRequiredContext = (): T => {\n\t\tconst context = useContext(RequiredContext)\n\n\t\tif (context === EmptyContextSymbol) {\n\t\t\tthrow new Error(`use${displayName} must be used within a ${displayName} provider`)\n\t\t}\n\n\t\treturn context\n\t}\n\n\treturn [RequiredContext, useRequiredContext, RequiredContext.Provider]\n}\n"],"names":["createContext","useContext"],"mappings":";;;AAGA,MAAM,4CAA4B,oBAAoB;AAE/C,SAAS,sBAAyB,aAAyD;AACjG,QAAM,kBAAkBA,MAAAA,cAAiB,kBAAuB;AAChE,kBAAgB,cAAc;AAE9B,QAAM,qBAAqB,MAAS;AACnC,UAAM,UAAUC,MAAAA,WAAW,eAAe;AAE1C,QAAI,YAAY,oBAAoB;AACnC,YAAM,IAAI,MAAM,MAAM,WAAW,0BAA0B,WAAW,WAAW;AAAA,IAClF;AAEA,WAAO;AAAA,EACR;AAEA,SAAO,CAAC,iBAAiB,oBAAoB,gBAAgB,QAAQ;AACtE;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createContext, useContext } from "react";
|
|
2
|
-
const EmptyContextSymbol = Symbol("EmptyContextSymbol");
|
|
2
|
+
const EmptyContextSymbol = /* @__PURE__ */ Symbol("EmptyContextSymbol");
|
|
3
3
|
function createRequiredContext(displayName) {
|
|
4
4
|
const RequiredContext = createContext(EmptyContextSymbol);
|
|
5
5
|
RequiredContext.displayName = displayName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createRequiredContext.js","sources":["../../../../../packages/react-utils/src/context/createRequiredContext.ts"],"sourcesContent":["import type { Context, Provider } from 'react'\nimport { createContext, useContext } from 'react'\n\nconst EmptyContextSymbol = Symbol('EmptyContextSymbol')\n\nexport function createRequiredContext<T>(displayName: string): [Context<T>, () => T, Provider<T>] {\n\tconst RequiredContext = createContext<T>(EmptyContextSymbol as T)\n\tRequiredContext.displayName = displayName\n\n\tconst useRequiredContext = (): T => {\n\t\tconst context = useContext(RequiredContext)\n\n\t\tif (context === EmptyContextSymbol) {\n\t\t\tthrow new Error(`use${displayName} must be used within a ${displayName} provider`)\n\t\t}\n\n\t\treturn context\n\t}\n\n\treturn [RequiredContext, useRequiredContext, RequiredContext.Provider]\n}\n"],"names":[],"mappings":";AAGA,MAAM,
|
|
1
|
+
{"version":3,"file":"createRequiredContext.js","sources":["../../../../../packages/react-utils/src/context/createRequiredContext.ts"],"sourcesContent":["import type { Context, Provider } from 'react'\nimport { createContext, useContext } from 'react'\n\nconst EmptyContextSymbol = Symbol('EmptyContextSymbol')\n\nexport function createRequiredContext<T>(displayName: string): [Context<T>, () => T, Provider<T>] {\n\tconst RequiredContext = createContext<T>(EmptyContextSymbol as T)\n\tRequiredContext.displayName = displayName\n\n\tconst useRequiredContext = (): T => {\n\t\tconst context = useContext(RequiredContext)\n\n\t\tif (context === EmptyContextSymbol) {\n\t\t\tthrow new Error(`use${displayName} must be used within a ${displayName} provider`)\n\t\t}\n\n\t\treturn context\n\t}\n\n\treturn [RequiredContext, useRequiredContext, RequiredContext.Provider]\n}\n"],"names":[],"mappings":";AAGA,MAAM,4CAA4B,oBAAoB;AAE/C,SAAS,sBAAyB,aAAyD;AACjG,QAAM,kBAAkB,cAAiB,kBAAuB;AAChE,kBAAgB,cAAc;AAE9B,QAAM,qBAAqB,MAAS;AACnC,UAAM,UAAU,WAAW,eAAe;AAE1C,QAAI,YAAY,oBAAoB;AACnC,YAAM,IAAI,MAAM,MAAM,WAAW,0BAA0B,WAAW,WAAW;AAAA,IAClF;AAEA,WAAO;AAAA,EACR;AAEA,SAAO,CAAC,iBAAiB,oBAAoB,gBAAgB,QAAQ;AACtE;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Constants.cjs","sources":["../../../../../packages/react-utils/src/debug-context/Constants.ts"],"sourcesContent":["import type { ScopedConsoleContextType } from './Types'\n\nexport function noopLog(...parameters: any[]) {
|
|
1
|
+
{"version":3,"file":"Constants.cjs","sources":["../../../../../packages/react-utils/src/debug-context/Constants.ts"],"sourcesContent":["import type { ScopedConsoleContextType } from './Types'\n\nexport function noopLog(...parameters: any[]) {}\n\nexport function noopLogged<T>(message: string, value: T): T {\n\treturn value\n}\n\nexport const noopScopedConsole: ScopedConsoleContextType = Object.freeze({\n\tlog: noopLog,\n\tlogged: noopLogged,\n\twarn: noopLog,\n\twarned: noopLogged,\n\terror: noopLog,\n\terrored: noopLogged,\n\ttrace: noopLog,\n\ttraced: noopLogged,\n})\n\nexport function isNoopScopedConsole(value: unknown): boolean {\n\treturn value === noopScopedConsole\n}\n"],"names":[],"mappings":";;AAEO,SAAS,WAAW,YAAmB;AAAC;AAExC,SAAS,WAAc,SAAiB,OAAa;AAC3D,SAAO;AACR;AAEO,MAAM,oBAA8C,OAAO,OAAO;AAAA,EACxE,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AACT,CAAC;AAEM,SAAS,oBAAoB,OAAyB;AAC5D,SAAO,UAAU;AAClB;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Constants.js","sources":["../../../../../packages/react-utils/src/debug-context/Constants.ts"],"sourcesContent":["import type { ScopedConsoleContextType } from './Types'\n\nexport function noopLog(...parameters: any[]) {
|
|
1
|
+
{"version":3,"file":"Constants.js","sources":["../../../../../packages/react-utils/src/debug-context/Constants.ts"],"sourcesContent":["import type { ScopedConsoleContextType } from './Types'\n\nexport function noopLog(...parameters: any[]) {}\n\nexport function noopLogged<T>(message: string, value: T): T {\n\treturn value\n}\n\nexport const noopScopedConsole: ScopedConsoleContextType = Object.freeze({\n\tlog: noopLog,\n\tlogged: noopLogged,\n\twarn: noopLog,\n\twarned: noopLogged,\n\terror: noopLog,\n\terrored: noopLogged,\n\ttrace: noopLog,\n\ttraced: noopLogged,\n})\n\nexport function isNoopScopedConsole(value: unknown): boolean {\n\treturn value === noopScopedConsole\n}\n"],"names":[],"mappings":"AAEO,SAAS,WAAW,YAAmB;AAAC;AAExC,SAAS,WAAc,SAAiB,OAAa;AAC3D,SAAO;AACR;AAEO,MAAM,oBAA8C,OAAO,OAAO;AAAA,EACxE,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AACT,CAAC;AAEM,SAAS,oBAAoB,OAAyB;AAC5D,SAAO,UAAU;AAClB;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Context.cjs","sources":["../../../../../packages/react-utils/src/debug-context/Context.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"Context.cjs","sources":["../../../../../packages/react-utils/src/debug-context/Context.tsx"],"sourcesContent":["import { createContext, memo, ReactNode, useContext, useMemo, useRef } from 'react'\nimport { isNoopScopedConsole, noopScopedConsole } from './Constants'\nimport { ScopedConsoleContextType } from './Types'\n\nfunction createPrefixedConsole(message: string, prefixedConsole?: ScopedConsoleContextType): ScopedConsoleContextType {\n\treturn {\n\t\terror: function error(...parameters: any[]) {\n\t\t\t;(prefixedConsole ?? console).error(message, ...parameters)\n\t\t},\n\t\terrored: function errored<T,>(message: string, value: T): T {\n\t\t\t;(prefixedConsole ?? console).error(message, value)\n\t\t\treturn value\n\t\t},\n\t\tlog: function log(...parameters: any[]) {\n\t\t\t;(prefixedConsole ?? console).log(message, ...parameters)\n\t\t},\n\t\tlogged: function logged<T,>(message: string, value: T): T {\n\t\t\t;(prefixedConsole ?? console).log(message, value)\n\t\t\treturn value\n\t\t},\n\t\ttrace: function trace(...parameters: any[]) {\n\t\t\t;(prefixedConsole ?? console).trace(message, ...parameters)\n\t\t},\n\t\ttraced: function traced<T,>(message: string, value: T): T {\n\t\t\t;(prefixedConsole ?? console).trace(message, value)\n\t\t\treturn value\n\t\t},\n\t\twarn: function warn(...parameters: any[]) {\n\t\t\t;(prefixedConsole ?? console).warn(message, ...parameters)\n\t\t},\n\t\twarned: function warned<T,>(message: string, value: T): T {\n\t\t\t;(prefixedConsole ?? console).warn(message, value)\n\t\t\treturn value\n\t\t},\n\t}\n}\n\nexport const ScopedConsoleContext = createContext<ScopedConsoleContextType>(null!)\nScopedConsoleContext.displayName = 'ScopedConsoleContext'\n\nfunction parentScopedConsoleOrNone(parentConsole: ScopedConsoleContextType): ScopedConsoleContextType | undefined {\n\treturn isNoopScopedConsole(parentConsole) ? undefined : parentConsole\n}\n\nexport const useScopedConsoleRef = (prefix: string, override?: boolean) => {\n\tif (prefix.length === 0) {\n\t\tthrow new Error('Prefix must be non-empty string')\n\t}\n\tconst parentConsole = parentScopedConsoleOrNone(useContext(ScopedConsoleContext))\n\n\tconst scopedConsole = useMemo(() => {\n\t\tif (override !== false && (parentConsole || override)) {\n\t\t\treturn createPrefixedConsole(prefix, parentConsole)\n\t\t} else {\n\t\t\treturn noopScopedConsole\n\t\t}\n\t}, [override, parentConsole, prefix])\n\n\tconst ref = useRef(scopedConsole)\n\tref.current = scopedConsole\n\n\treturn ref\n}\n\nexport type DebugChildrenProps =\n\t| { active?: true; children: ReactNode; id: string }\n\t| { active?: false; children: ReactNode; id?: string }\n\nexport const DebugChildren = memo<DebugChildrenProps>(({ active = true, children, id }) => {\n\tconst parentScopedConsole = parentScopedConsoleOrNone(useContext(ScopedConsoleContext))\n\n\tconst console = active && id\n\t\t? createPrefixedConsole(id, parentScopedConsole)\n\t\t: noopScopedConsole\n\n\treturn (\n\t\t<ScopedConsoleContext.Provider value={active ? console : noopScopedConsole}>\n\t\t\t{children}\n\t\t</ScopedConsoleContext.Provider>\n\t)\n})\nDebugChildren.displayName = 'DebugChildren'\n"],"names":["message","createContext","isNoopScopedConsole","useContext","useMemo","noopScopedConsole","useRef","memo","console","jsx"],"mappings":";;;;;AAIA,SAAS,sBAAsB,SAAiB,iBAAsE;AACrH,SAAO;AAAA,IACN,OAAO,SAAS,SAAS,YAAmB;AAC1C,OAAC,mBAAmB,SAAS,MAAM,SAAS,GAAG,UAAU;AAAA,IAC3D;AAAA,IACA,SAAS,SAAS,QAAYA,UAAiB,OAAa;AAC1D,OAAC,mBAAmB,SAAS,MAAMA,UAAS,KAAK;AAClD,aAAO;AAAA,IACR;AAAA,IACA,KAAK,SAAS,OAAO,YAAmB;AACtC,OAAC,mBAAmB,SAAS,IAAI,SAAS,GAAG,UAAU;AAAA,IACzD;AAAA,IACA,QAAQ,SAAS,OAAWA,UAAiB,OAAa;AACxD,OAAC,mBAAmB,SAAS,IAAIA,UAAS,KAAK;AAChD,aAAO;AAAA,IACR;AAAA,IACA,OAAO,SAAS,SAAS,YAAmB;AAC1C,OAAC,mBAAmB,SAAS,MAAM,SAAS,GAAG,UAAU;AAAA,IAC3D;AAAA,IACA,QAAQ,SAAS,OAAWA,UAAiB,OAAa;AACxD,OAAC,mBAAmB,SAAS,MAAMA,UAAS,KAAK;AAClD,aAAO;AAAA,IACR;AAAA,IACA,MAAM,SAAS,QAAQ,YAAmB;AACxC,OAAC,mBAAmB,SAAS,KAAK,SAAS,GAAG,UAAU;AAAA,IAC1D;AAAA,IACA,QAAQ,SAAS,OAAWA,UAAiB,OAAa;AACxD,OAAC,mBAAmB,SAAS,KAAKA,UAAS,KAAK;AACjD,aAAO;AAAA,IACR;AAAA,EAAA;AAEF;AAEO,MAAM,uBAAuBC,MAAAA,cAAwC,IAAK;AACjF,qBAAqB,cAAc;AAEnC,SAAS,0BAA0B,eAA+E;AACjH,SAAOC,8BAAoB,aAAa,IAAI,SAAY;AACzD;AAEO,MAAM,sBAAsB,CAAC,QAAgB,aAAuB;AAC1E,MAAI,OAAO,WAAW,GAAG;AACxB,UAAM,IAAI,MAAM,iCAAiC;AAAA,EAClD;AACA,QAAM,gBAAgB,0BAA0BC,MAAAA,WAAW,oBAAoB,CAAC;AAEhF,QAAM,gBAAgBC,MAAAA,QAAQ,MAAM;AACnC,QAAI,aAAa,UAAU,iBAAiB,WAAW;AACtD,aAAO,sBAAsB,QAAQ,aAAa;AAAA,IACnD,OAAO;AACN,aAAOC,UAAAA;AAAAA,IACR;AAAA,EACD,GAAG,CAAC,UAAU,eAAe,MAAM,CAAC;AAEpC,QAAM,MAAMC,MAAAA,OAAO,aAAa;AAChC,MAAI,UAAU;AAEd,SAAO;AACR;AAMO,MAAM,gBAAgBC,MAAAA,KAAyB,CAAC,EAAE,SAAS,MAAM,UAAU,SAAS;AAC1F,QAAM,sBAAsB,0BAA0BJ,MAAAA,WAAW,oBAAoB,CAAC;AAEtF,QAAMK,WAAU,UAAU,KACvB,sBAAsB,IAAI,mBAAmB,IAC7CH,UAAAA;AAEH,SACCI,2BAAAA,IAAC,qBAAqB,UAArB,EAA8B,OAAO,SAASD,WAAUH,6BACvD,UACF;AAEF,CAAC;AACD,cAAc,cAAc;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { memo, useContext, createContext, useMemo, useRef } from "react";
|
|
3
3
|
import { noopScopedConsole, isNoopScopedConsole } from "./Constants.js";
|
|
4
4
|
function createPrefixedConsole(message, prefixedConsole) {
|
|
5
5
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Context.js","sources":["../../../../../packages/react-utils/src/debug-context/Context.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"Context.js","sources":["../../../../../packages/react-utils/src/debug-context/Context.tsx"],"sourcesContent":["import { createContext, memo, ReactNode, useContext, useMemo, useRef } from 'react'\nimport { isNoopScopedConsole, noopScopedConsole } from './Constants'\nimport { ScopedConsoleContextType } from './Types'\n\nfunction createPrefixedConsole(message: string, prefixedConsole?: ScopedConsoleContextType): ScopedConsoleContextType {\n\treturn {\n\t\terror: function error(...parameters: any[]) {\n\t\t\t;(prefixedConsole ?? console).error(message, ...parameters)\n\t\t},\n\t\terrored: function errored<T,>(message: string, value: T): T {\n\t\t\t;(prefixedConsole ?? console).error(message, value)\n\t\t\treturn value\n\t\t},\n\t\tlog: function log(...parameters: any[]) {\n\t\t\t;(prefixedConsole ?? console).log(message, ...parameters)\n\t\t},\n\t\tlogged: function logged<T,>(message: string, value: T): T {\n\t\t\t;(prefixedConsole ?? console).log(message, value)\n\t\t\treturn value\n\t\t},\n\t\ttrace: function trace(...parameters: any[]) {\n\t\t\t;(prefixedConsole ?? console).trace(message, ...parameters)\n\t\t},\n\t\ttraced: function traced<T,>(message: string, value: T): T {\n\t\t\t;(prefixedConsole ?? console).trace(message, value)\n\t\t\treturn value\n\t\t},\n\t\twarn: function warn(...parameters: any[]) {\n\t\t\t;(prefixedConsole ?? console).warn(message, ...parameters)\n\t\t},\n\t\twarned: function warned<T,>(message: string, value: T): T {\n\t\t\t;(prefixedConsole ?? console).warn(message, value)\n\t\t\treturn value\n\t\t},\n\t}\n}\n\nexport const ScopedConsoleContext = createContext<ScopedConsoleContextType>(null!)\nScopedConsoleContext.displayName = 'ScopedConsoleContext'\n\nfunction parentScopedConsoleOrNone(parentConsole: ScopedConsoleContextType): ScopedConsoleContextType | undefined {\n\treturn isNoopScopedConsole(parentConsole) ? undefined : parentConsole\n}\n\nexport const useScopedConsoleRef = (prefix: string, override?: boolean) => {\n\tif (prefix.length === 0) {\n\t\tthrow new Error('Prefix must be non-empty string')\n\t}\n\tconst parentConsole = parentScopedConsoleOrNone(useContext(ScopedConsoleContext))\n\n\tconst scopedConsole = useMemo(() => {\n\t\tif (override !== false && (parentConsole || override)) {\n\t\t\treturn createPrefixedConsole(prefix, parentConsole)\n\t\t} else {\n\t\t\treturn noopScopedConsole\n\t\t}\n\t}, [override, parentConsole, prefix])\n\n\tconst ref = useRef(scopedConsole)\n\tref.current = scopedConsole\n\n\treturn ref\n}\n\nexport type DebugChildrenProps =\n\t| { active?: true; children: ReactNode; id: string }\n\t| { active?: false; children: ReactNode; id?: string }\n\nexport const DebugChildren = memo<DebugChildrenProps>(({ active = true, children, id }) => {\n\tconst parentScopedConsole = parentScopedConsoleOrNone(useContext(ScopedConsoleContext))\n\n\tconst console = active && id\n\t\t? createPrefixedConsole(id, parentScopedConsole)\n\t\t: noopScopedConsole\n\n\treturn (\n\t\t<ScopedConsoleContext.Provider value={active ? console : noopScopedConsole}>\n\t\t\t{children}\n\t\t</ScopedConsoleContext.Provider>\n\t)\n})\nDebugChildren.displayName = 'DebugChildren'\n"],"names":["message","console"],"mappings":";;;AAIA,SAAS,sBAAsB,SAAiB,iBAAsE;AACrH,SAAO;AAAA,IACN,OAAO,SAAS,SAAS,YAAmB;AAC1C,OAAC,mBAAmB,SAAS,MAAM,SAAS,GAAG,UAAU;AAAA,IAC3D;AAAA,IACA,SAAS,SAAS,QAAYA,UAAiB,OAAa;AAC1D,OAAC,mBAAmB,SAAS,MAAMA,UAAS,KAAK;AAClD,aAAO;AAAA,IACR;AAAA,IACA,KAAK,SAAS,OAAO,YAAmB;AACtC,OAAC,mBAAmB,SAAS,IAAI,SAAS,GAAG,UAAU;AAAA,IACzD;AAAA,IACA,QAAQ,SAAS,OAAWA,UAAiB,OAAa;AACxD,OAAC,mBAAmB,SAAS,IAAIA,UAAS,KAAK;AAChD,aAAO;AAAA,IACR;AAAA,IACA,OAAO,SAAS,SAAS,YAAmB;AAC1C,OAAC,mBAAmB,SAAS,MAAM,SAAS,GAAG,UAAU;AAAA,IAC3D;AAAA,IACA,QAAQ,SAAS,OAAWA,UAAiB,OAAa;AACxD,OAAC,mBAAmB,SAAS,MAAMA,UAAS,KAAK;AAClD,aAAO;AAAA,IACR;AAAA,IACA,MAAM,SAAS,QAAQ,YAAmB;AACxC,OAAC,mBAAmB,SAAS,KAAK,SAAS,GAAG,UAAU;AAAA,IAC1D;AAAA,IACA,QAAQ,SAAS,OAAWA,UAAiB,OAAa;AACxD,OAAC,mBAAmB,SAAS,KAAKA,UAAS,KAAK;AACjD,aAAO;AAAA,IACR;AAAA,EAAA;AAEF;AAEO,MAAM,uBAAuB,cAAwC,IAAK;AACjF,qBAAqB,cAAc;AAEnC,SAAS,0BAA0B,eAA+E;AACjH,SAAO,oBAAoB,aAAa,IAAI,SAAY;AACzD;AAEO,MAAM,sBAAsB,CAAC,QAAgB,aAAuB;AAC1E,MAAI,OAAO,WAAW,GAAG;AACxB,UAAM,IAAI,MAAM,iCAAiC;AAAA,EAClD;AACA,QAAM,gBAAgB,0BAA0B,WAAW,oBAAoB,CAAC;AAEhF,QAAM,gBAAgB,QAAQ,MAAM;AACnC,QAAI,aAAa,UAAU,iBAAiB,WAAW;AACtD,aAAO,sBAAsB,QAAQ,aAAa;AAAA,IACnD,OAAO;AACN,aAAO;AAAA,IACR;AAAA,EACD,GAAG,CAAC,UAAU,eAAe,MAAM,CAAC;AAEpC,QAAM,MAAM,OAAO,aAAa;AAChC,MAAI,UAAU;AAEd,SAAO;AACR;AAMO,MAAM,gBAAgB,KAAyB,CAAC,EAAE,SAAS,MAAM,UAAU,SAAS;AAC1F,QAAM,sBAAsB,0BAA0B,WAAW,oBAAoB,CAAC;AAEtF,QAAMC,WAAU,UAAU,KACvB,sBAAsB,IAAI,mBAAmB,IAC7C;AAEH,SACC,oBAAC,qBAAqB,UAArB,EAA8B,OAAO,SAASA,WAAU,mBACvD,UACF;AAEF,CAAC;AACD,cAAc,cAAc;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unwrapRefValue.cjs","sources":["../../../../../packages/react-utils/src/hooks/unwrapRefValue.ts"],"sourcesContent":["import { RefObject } from 'react'\n\nexport type RefObjectOrElement<T> = T | RefObject<T>\n\n/**\n * Unwraps a ref object or returns the value if it is not a ref object.\n * @param value - Value to unwrap\n * @returns Unwrapped value\n */\nexport function unwrapRefValue<T>(value: RefObjectOrElement<T>): T | null {\n\tif (value && typeof value === 'object' && 'current' in value) {\n\t\treturn value.current\n\t} else {\n\t\treturn value\n\t}\n}\n"],"names":[],"mappings":";;AASO,SAAS,eAAkB,OAAwC;AACzE,MAAI,SAAS,OAAO,UAAU,YAAY,aAAa,OAAO;AAC7D,WAAO,MAAM;AAAA,
|
|
1
|
+
{"version":3,"file":"unwrapRefValue.cjs","sources":["../../../../../packages/react-utils/src/hooks/unwrapRefValue.ts"],"sourcesContent":["import { RefObject } from 'react'\n\nexport type RefObjectOrElement<T> = T | RefObject<T | null>\n\n/**\n * Unwraps a ref object or returns the value if it is not a ref object.\n * @param value - Value to unwrap\n * @returns Unwrapped value\n */\nexport function unwrapRefValue<T>(value: RefObjectOrElement<T>): T | null {\n\tif (value && typeof value === 'object' && 'current' in value) {\n\t\treturn value.current\n\t} else {\n\t\treturn value\n\t}\n}\n"],"names":[],"mappings":";;AASO,SAAS,eAAkB,OAAwC;AACzE,MAAI,SAAS,OAAO,UAAU,YAAY,aAAa,OAAO;AAC7D,WAAO,MAAM;AAAA,EACd,OAAO;AACN,WAAO;AAAA,EACR;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unwrapRefValue.js","sources":["../../../../../packages/react-utils/src/hooks/unwrapRefValue.ts"],"sourcesContent":["import { RefObject } from 'react'\n\nexport type RefObjectOrElement<T> = T | RefObject<T>\n\n/**\n * Unwraps a ref object or returns the value if it is not a ref object.\n * @param value - Value to unwrap\n * @returns Unwrapped value\n */\nexport function unwrapRefValue<T>(value: RefObjectOrElement<T>): T | null {\n\tif (value && typeof value === 'object' && 'current' in value) {\n\t\treturn value.current\n\t} else {\n\t\treturn value\n\t}\n}\n"],"names":[],"mappings":"AASO,SAAS,eAAkB,OAAwC;AACzE,MAAI,SAAS,OAAO,UAAU,YAAY,aAAa,OAAO;AAC7D,WAAO,MAAM;AAAA,
|
|
1
|
+
{"version":3,"file":"unwrapRefValue.js","sources":["../../../../../packages/react-utils/src/hooks/unwrapRefValue.ts"],"sourcesContent":["import { RefObject } from 'react'\n\nexport type RefObjectOrElement<T> = T | RefObject<T | null>\n\n/**\n * Unwraps a ref object or returns the value if it is not a ref object.\n * @param value - Value to unwrap\n * @returns Unwrapped value\n */\nexport function unwrapRefValue<T>(value: RefObjectOrElement<T>): T | null {\n\tif (value && typeof value === 'object' && 'current' in value) {\n\t\treturn value.current\n\t} else {\n\t\treturn value\n\t}\n}\n"],"names":[],"mappings":"AASO,SAAS,eAAkB,OAAwC;AACzE,MAAI,SAAS,OAAO,UAAU,YAAY,aAAa,OAAO;AAC7D,WAAO,MAAM;AAAA,EACd,OAAO;AACN,WAAO;AAAA,EACR;AACD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAbortController.cjs","sources":["../../../../../packages/react-utils/src/hooks/useAbortController.ts"],"sourcesContent":["import { useCallback, useEffect, useRef } from 'react'\n\nexport const useAbortController = () => {\n\tconst lastAbortControllerRef = useRef<AbortController | undefined>(undefined)\n\tuseEffect(() => () => {\n\t\tlastAbortControllerRef.current?.abort()\n\t}, [])\n\treturn useCallback((): AbortSignal => {\n\t\tlastAbortControllerRef.current?.abort()\n\n\t\tconst newController = new AbortController()\n\t\tlastAbortControllerRef.current = newController\n\t\treturn newController.signal\n\t}, [])\n}\n"],"names":["useRef","useEffect","useCallback"],"mappings":";;;AAEO,MAAM,qBAAqB,MAAM;
|
|
1
|
+
{"version":3,"file":"useAbortController.cjs","sources":["../../../../../packages/react-utils/src/hooks/useAbortController.ts"],"sourcesContent":["import { useCallback, useEffect, useRef } from 'react'\n\nexport const useAbortController = () => {\n\tconst lastAbortControllerRef = useRef<AbortController | undefined>(undefined)\n\tuseEffect(() => () => {\n\t\tlastAbortControllerRef.current?.abort()\n\t}, [])\n\treturn useCallback((): AbortSignal => {\n\t\tlastAbortControllerRef.current?.abort()\n\n\t\tconst newController = new AbortController()\n\t\tlastAbortControllerRef.current = newController\n\t\treturn newController.signal\n\t}, [])\n}\n"],"names":["useRef","useEffect","useCallback"],"mappings":";;;AAEO,MAAM,qBAAqB,MAAM;AACvC,QAAM,yBAAyBA,MAAAA,OAAoC,MAAS;AAC5EC,QAAAA,UAAU,MAAM,MAAM;AACrB,2BAAuB,SAAS,MAAA;AAAA,EACjC,GAAG,CAAA,CAAE;AACL,SAAOC,MAAAA,YAAY,MAAmB;AACrC,2BAAuB,SAAS,MAAA;AAEhC,UAAM,gBAAgB,IAAI,gBAAA;AAC1B,2BAAuB,UAAU;AACjC,WAAO,cAAc;AAAA,EACtB,GAAG,CAAA,CAAE;AACN;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAbortController.js","sources":["../../../../../packages/react-utils/src/hooks/useAbortController.ts"],"sourcesContent":["import { useCallback, useEffect, useRef } from 'react'\n\nexport const useAbortController = () => {\n\tconst lastAbortControllerRef = useRef<AbortController | undefined>(undefined)\n\tuseEffect(() => () => {\n\t\tlastAbortControllerRef.current?.abort()\n\t}, [])\n\treturn useCallback((): AbortSignal => {\n\t\tlastAbortControllerRef.current?.abort()\n\n\t\tconst newController = new AbortController()\n\t\tlastAbortControllerRef.current = newController\n\t\treturn newController.signal\n\t}, [])\n}\n"],"names":[],"mappings":";AAEO,MAAM,qBAAqB,MAAM;
|
|
1
|
+
{"version":3,"file":"useAbortController.js","sources":["../../../../../packages/react-utils/src/hooks/useAbortController.ts"],"sourcesContent":["import { useCallback, useEffect, useRef } from 'react'\n\nexport const useAbortController = () => {\n\tconst lastAbortControllerRef = useRef<AbortController | undefined>(undefined)\n\tuseEffect(() => () => {\n\t\tlastAbortControllerRef.current?.abort()\n\t}, [])\n\treturn useCallback((): AbortSignal => {\n\t\tlastAbortControllerRef.current?.abort()\n\n\t\tconst newController = new AbortController()\n\t\tlastAbortControllerRef.current = newController\n\t\treturn newController.signal\n\t}, [])\n}\n"],"names":[],"mappings":";AAEO,MAAM,qBAAqB,MAAM;AACvC,QAAM,yBAAyB,OAAoC,MAAS;AAC5E,YAAU,MAAM,MAAM;AACrB,2BAAuB,SAAS,MAAA;AAAA,EACjC,GAAG,CAAA,CAAE;AACL,SAAO,YAAY,MAAmB;AACrC,2BAAuB,SAAS,MAAA;AAEhC,UAAM,gBAAgB,IAAI,gBAAA;AAC1B,2BAAuB,UAAU;AACjC,WAAO,cAAc;AAAA,EACtB,GAAG,CAAA,CAAE;AACN;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useArrayMapMemo.cjs","sources":["../../../../../packages/react-utils/src/hooks/useArrayMapMemo.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { useConstantLengthInvariant } from './useConstantLengthInvariant'\n\n/**\n * ⚠️ ONLY USE THIS IF YOU *REALLY* KNOW WHAT YOU'RE DOING! ⚠️\n * ⚠ HERE BE DRAGONS THAT KNOW WHERE YOU LIVE! ⚠\n *\n * This is a bit of React naughtiness that allows us to memoize outputs of Array.prototype.map() based on the contents\n * of the original array, and not its referential equality. That way, if we create a new array with identical items,\n * we get an array that is referentially equal to the previous one.\n */\nexport const useArrayMapMemo = <Item, OutputItem>(\n\titems: Item[],\n\tmap: (value: Item, index: number, array: Item[]) => OutputItem,\n): OutputItem[] => {\n\tuseConstantLengthInvariant(items)\n\n\t// This is tricky. We don't want to exclude the map function from the dependency list because if it changes but the\n\t// items array remains the same, we still want to re-compute the new array. However, if that yields the same array,\n\t// in the sense that the items are identical, albeit computed via a different map function, we still want to\n\t// preserve the referential equality of the original. Hence the second memo.\n\n\t//
|
|
1
|
+
{"version":3,"file":"useArrayMapMemo.cjs","sources":["../../../../../packages/react-utils/src/hooks/useArrayMapMemo.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { useConstantLengthInvariant } from './useConstantLengthInvariant'\n\n/**\n * ⚠️ ONLY USE THIS IF YOU *REALLY* KNOW WHAT YOU'RE DOING! ⚠️\n * ⚠ HERE BE DRAGONS THAT KNOW WHERE YOU LIVE! ⚠\n *\n * This is a bit of React naughtiness that allows us to memoize outputs of Array.prototype.map() based on the contents\n * of the original array, and not its referential equality. That way, if we create a new array with identical items,\n * we get an array that is referentially equal to the previous one.\n */\nexport const useArrayMapMemo = <Item, OutputItem>(\n\titems: Item[],\n\tmap: (value: Item, index: number, array: Item[]) => OutputItem,\n): OutputItem[] => {\n\tuseConstantLengthInvariant(items)\n\n\t// This is tricky. We don't want to exclude the map function from the dependency list because if it changes but the\n\t// items array remains the same, we still want to re-compute the new array. However, if that yields the same array,\n\t// in the sense that the items are identical, albeit computed via a different map function, we still want to\n\t// preserve the referential equality of the original. Hence the second memo.\n\n\t// biome-ignore lint/correctness/useExhaustiveDependencies: intentional\n\tconst mapped = useMemo(() => items.map(map), [map, ...items])\n\n\t// biome-ignore lint/correctness/useExhaustiveDependencies: intentional\n\treturn useMemo(() => mapped, mapped) // This is deliberately not `[mapped]`\n}\n"],"names":["useMemo"],"mappings":";;;AAWO,MAAM,kBAAkB,CAC9B,OACA,QACkB;AASlB,QAAM,SAASA,cAAQ,MAAM,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC;AAG5D,SAAOA,MAAAA,QAAQ,MAAM,QAAQ,MAAM;AACpC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useArrayMapMemo.js","sources":["../../../../../packages/react-utils/src/hooks/useArrayMapMemo.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { useConstantLengthInvariant } from './useConstantLengthInvariant'\n\n/**\n * ⚠️ ONLY USE THIS IF YOU *REALLY* KNOW WHAT YOU'RE DOING! ⚠️\n * ⚠ HERE BE DRAGONS THAT KNOW WHERE YOU LIVE! ⚠\n *\n * This is a bit of React naughtiness that allows us to memoize outputs of Array.prototype.map() based on the contents\n * of the original array, and not its referential equality. That way, if we create a new array with identical items,\n * we get an array that is referentially equal to the previous one.\n */\nexport const useArrayMapMemo = <Item, OutputItem>(\n\titems: Item[],\n\tmap: (value: Item, index: number, array: Item[]) => OutputItem,\n): OutputItem[] => {\n\tuseConstantLengthInvariant(items)\n\n\t// This is tricky. We don't want to exclude the map function from the dependency list because if it changes but the\n\t// items array remains the same, we still want to re-compute the new array. However, if that yields the same array,\n\t// in the sense that the items are identical, albeit computed via a different map function, we still want to\n\t// preserve the referential equality of the original. Hence the second memo.\n\n\t//
|
|
1
|
+
{"version":3,"file":"useArrayMapMemo.js","sources":["../../../../../packages/react-utils/src/hooks/useArrayMapMemo.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { useConstantLengthInvariant } from './useConstantLengthInvariant'\n\n/**\n * ⚠️ ONLY USE THIS IF YOU *REALLY* KNOW WHAT YOU'RE DOING! ⚠️\n * ⚠ HERE BE DRAGONS THAT KNOW WHERE YOU LIVE! ⚠\n *\n * This is a bit of React naughtiness that allows us to memoize outputs of Array.prototype.map() based on the contents\n * of the original array, and not its referential equality. That way, if we create a new array with identical items,\n * we get an array that is referentially equal to the previous one.\n */\nexport const useArrayMapMemo = <Item, OutputItem>(\n\titems: Item[],\n\tmap: (value: Item, index: number, array: Item[]) => OutputItem,\n): OutputItem[] => {\n\tuseConstantLengthInvariant(items)\n\n\t// This is tricky. We don't want to exclude the map function from the dependency list because if it changes but the\n\t// items array remains the same, we still want to re-compute the new array. However, if that yields the same array,\n\t// in the sense that the items are identical, albeit computed via a different map function, we still want to\n\t// preserve the referential equality of the original. Hence the second memo.\n\n\t// biome-ignore lint/correctness/useExhaustiveDependencies: intentional\n\tconst mapped = useMemo(() => items.map(map), [map, ...items])\n\n\t// biome-ignore lint/correctness/useExhaustiveDependencies: intentional\n\treturn useMemo(() => mapped, mapped) // This is deliberately not `[mapped]`\n}\n"],"names":[],"mappings":";AAWO,MAAM,kBAAkB,CAC9B,OACA,QACkB;AASlB,QAAM,SAAS,QAAQ,MAAM,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC;AAG5D,SAAO,QAAQ,MAAM,QAAQ,MAAM;AACpC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAutoHeightTextArea.cjs","sources":["../../../../../packages/react-utils/src/hooks/useAutoHeightTextArea.ts"],"sourcesContent":["import { useCallback, useLayoutEffect } from 'react'\nimport { RefObjectOrElement, unwrapRefValue } from './unwrapRefValue'\nimport { useOnElementResize } from './useOnElementResize'\n\nfunction px<V extends number | false | null | undefined>(value?: V): string {\n\treturn typeof value === 'number' && !(isNaN(value) || value === Infinity || value === -Infinity) ? value + 'px' : ''\n}\n\nexport const useAutoHeightTextArea = (\n\ttextAreaRef: RefObjectOrElement<HTMLTextAreaElement>,\n\tvalue: string,\n\tminRows: number,\n\tmaxRows: number,\n) => {\n\tconst measure = useCallback(async (ref: HTMLTextAreaElement | null, minRows: number, maxRows: number) => {\n\t\tif (ref) {\n\t\t\tconst rowsAttribute = ref.rows\n\n\t\t\tref.style.height = ''\n\t\t\tref.style.minHeight = ''\n\t\t\tref.style.maxHeight = ''\n\n\t\t\tif (minRows !== maxRows) {\n\t\t\t\tconst height = ref.scrollHeight - ref.clientHeight + ref.offsetHeight\n\t\t\t\tlet minHeight: number\n\t\t\t\tlet maxHeight: number\n\n\t\t\t\tref.rows = minRows\n\t\t\t\tminHeight = await ref.getBoundingClientRect().height\n\n\t\t\t\tif (maxRows === Infinity) {\n\t\t\t\t\tmaxHeight = Infinity\n\t\t\t\t} else {\n\t\t\t\t\tref.rows = maxRows\n\t\t\t\t\tmaxHeight = await ref.getBoundingClientRect().height\n\t\t\t\t}\n\n\t\t\t\tref.style.height = px(height)\n\t\t\t\tref.style.minHeight = px(minHeight)\n\t\t\t\tref.style.maxHeight = px(maxHeight)\n\t\t\t}\n\n\t\t\tref.rows = rowsAttribute\n\t\t}\n\t}, [])\n\n\tuseOnElementResize(textAreaRef, () => {\n\t\tmeasure(unwrapRefValue(textAreaRef), minRows, maxRows)\n\t})\n\n\tuseLayoutEffect(() => {\n\t\tmeasure(unwrapRefValue(textAreaRef), minRows, maxRows)\n\t}, [maxRows, measure, minRows, textAreaRef, value])\n}\n"],"names":["useCallback","minRows","maxRows","useOnElementResize","unwrapRefValue","useLayoutEffect"],"mappings":";;;;;AAIA,SAAS,GAAgD,OAAmB;AAC3E,SAAO,OAAO,UAAU,YAAY,EAAE,MAAM,KAAK,KAAK,UAAU,YAAY,UAAU,aAAa,QAAQ,OAAO;AACnH;AAEO,MAAM,wBAAwB,CACpC,aACA,OACA,SACA,YACI;AACJ,QAAM,UAAUA,
|
|
1
|
+
{"version":3,"file":"useAutoHeightTextArea.cjs","sources":["../../../../../packages/react-utils/src/hooks/useAutoHeightTextArea.ts"],"sourcesContent":["import { useCallback, useLayoutEffect } from 'react'\nimport { RefObjectOrElement, unwrapRefValue } from './unwrapRefValue'\nimport { useOnElementResize } from './useOnElementResize'\n\nfunction px<V extends number | false | null | undefined>(value?: V): string {\n\treturn typeof value === 'number' && !(isNaN(value) || value === Infinity || value === -Infinity) ? value + 'px' : ''\n}\n\nexport const useAutoHeightTextArea = (\n\ttextAreaRef: RefObjectOrElement<HTMLTextAreaElement>,\n\tvalue: string,\n\tminRows: number,\n\tmaxRows: number,\n) => {\n\tconst measure = useCallback(async (ref: HTMLTextAreaElement | null, minRows: number, maxRows: number) => {\n\t\tif (ref) {\n\t\t\tconst rowsAttribute = ref.rows\n\n\t\t\tref.style.height = ''\n\t\t\tref.style.minHeight = ''\n\t\t\tref.style.maxHeight = ''\n\n\t\t\tif (minRows !== maxRows) {\n\t\t\t\tconst height = ref.scrollHeight - ref.clientHeight + ref.offsetHeight\n\t\t\t\tlet minHeight: number\n\t\t\t\tlet maxHeight: number\n\n\t\t\t\tref.rows = minRows\n\t\t\t\tminHeight = await ref.getBoundingClientRect().height\n\n\t\t\t\tif (maxRows === Infinity) {\n\t\t\t\t\tmaxHeight = Infinity\n\t\t\t\t} else {\n\t\t\t\t\tref.rows = maxRows\n\t\t\t\t\tmaxHeight = await ref.getBoundingClientRect().height\n\t\t\t\t}\n\n\t\t\t\tref.style.height = px(height)\n\t\t\t\tref.style.minHeight = px(minHeight)\n\t\t\t\tref.style.maxHeight = px(maxHeight)\n\t\t\t}\n\n\t\t\tref.rows = rowsAttribute\n\t\t}\n\t}, [])\n\n\tuseOnElementResize(textAreaRef, () => {\n\t\tmeasure(unwrapRefValue(textAreaRef), minRows, maxRows)\n\t})\n\n\t// biome-ignore lint/correctness/useExhaustiveDependencies: intentional\n\tuseLayoutEffect(() => {\n\t\tmeasure(unwrapRefValue(textAreaRef), minRows, maxRows)\n\t}, [maxRows, measure, minRows, textAreaRef, value])\n}\n"],"names":["useCallback","minRows","maxRows","useOnElementResize","unwrapRefValue","useLayoutEffect"],"mappings":";;;;;AAIA,SAAS,GAAgD,OAAmB;AAC3E,SAAO,OAAO,UAAU,YAAY,EAAE,MAAM,KAAK,KAAK,UAAU,YAAY,UAAU,aAAa,QAAQ,OAAO;AACnH;AAEO,MAAM,wBAAwB,CACpC,aACA,OACA,SACA,YACI;AACJ,QAAM,UAAUA,MAAAA,YAAY,OAAO,KAAiCC,UAAiBC,aAAoB;AACxG,QAAI,KAAK;AACR,YAAM,gBAAgB,IAAI;AAE1B,UAAI,MAAM,SAAS;AACnB,UAAI,MAAM,YAAY;AACtB,UAAI,MAAM,YAAY;AAEtB,UAAID,aAAYC,UAAS;AACxB,cAAM,SAAS,IAAI,eAAe,IAAI,eAAe,IAAI;AACzD,YAAI;AACJ,YAAI;AAEJ,YAAI,OAAOD;AACX,oBAAY,MAAM,IAAI,sBAAA,EAAwB;AAE9C,YAAIC,aAAY,UAAU;AACzB,sBAAY;AAAA,QACb,OAAO;AACN,cAAI,OAAOA;AACX,sBAAY,MAAM,IAAI,sBAAA,EAAwB;AAAA,QAC/C;AAEA,YAAI,MAAM,SAAS,GAAG,MAAM;AAC5B,YAAI,MAAM,YAAY,GAAG,SAAS;AAClC,YAAI,MAAM,YAAY,GAAG,SAAS;AAAA,MACnC;AAEA,UAAI,OAAO;AAAA,IACZ;AAAA,EACD,GAAG,CAAA,CAAE;AAELC,qBAAAA,mBAAmB,aAAa,MAAM;AACrC,YAAQC,eAAAA,eAAe,WAAW,GAAG,SAAS,OAAO;AAAA,EACtD,CAAC;AAGDC,QAAAA,gBAAgB,MAAM;AACrB,YAAQD,eAAAA,eAAe,WAAW,GAAG,SAAS,OAAO;AAAA,EACtD,GAAG,CAAC,SAAS,SAAS,SAAS,aAAa,KAAK,CAAC;AACnD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAutoHeightTextArea.js","sources":["../../../../../packages/react-utils/src/hooks/useAutoHeightTextArea.ts"],"sourcesContent":["import { useCallback, useLayoutEffect } from 'react'\nimport { RefObjectOrElement, unwrapRefValue } from './unwrapRefValue'\nimport { useOnElementResize } from './useOnElementResize'\n\nfunction px<V extends number | false | null | undefined>(value?: V): string {\n\treturn typeof value === 'number' && !(isNaN(value) || value === Infinity || value === -Infinity) ? value + 'px' : ''\n}\n\nexport const useAutoHeightTextArea = (\n\ttextAreaRef: RefObjectOrElement<HTMLTextAreaElement>,\n\tvalue: string,\n\tminRows: number,\n\tmaxRows: number,\n) => {\n\tconst measure = useCallback(async (ref: HTMLTextAreaElement | null, minRows: number, maxRows: number) => {\n\t\tif (ref) {\n\t\t\tconst rowsAttribute = ref.rows\n\n\t\t\tref.style.height = ''\n\t\t\tref.style.minHeight = ''\n\t\t\tref.style.maxHeight = ''\n\n\t\t\tif (minRows !== maxRows) {\n\t\t\t\tconst height = ref.scrollHeight - ref.clientHeight + ref.offsetHeight\n\t\t\t\tlet minHeight: number\n\t\t\t\tlet maxHeight: number\n\n\t\t\t\tref.rows = minRows\n\t\t\t\tminHeight = await ref.getBoundingClientRect().height\n\n\t\t\t\tif (maxRows === Infinity) {\n\t\t\t\t\tmaxHeight = Infinity\n\t\t\t\t} else {\n\t\t\t\t\tref.rows = maxRows\n\t\t\t\t\tmaxHeight = await ref.getBoundingClientRect().height\n\t\t\t\t}\n\n\t\t\t\tref.style.height = px(height)\n\t\t\t\tref.style.minHeight = px(minHeight)\n\t\t\t\tref.style.maxHeight = px(maxHeight)\n\t\t\t}\n\n\t\t\tref.rows = rowsAttribute\n\t\t}\n\t}, [])\n\n\tuseOnElementResize(textAreaRef, () => {\n\t\tmeasure(unwrapRefValue(textAreaRef), minRows, maxRows)\n\t})\n\n\tuseLayoutEffect(() => {\n\t\tmeasure(unwrapRefValue(textAreaRef), minRows, maxRows)\n\t}, [maxRows, measure, minRows, textAreaRef, value])\n}\n"],"names":["minRows","maxRows"],"mappings":";;;AAIA,SAAS,GAAgD,OAAmB;AAC3E,SAAO,OAAO,UAAU,YAAY,EAAE,MAAM,KAAK,KAAK,UAAU,YAAY,UAAU,aAAa,QAAQ,OAAO;AACnH;AAEO,MAAM,wBAAwB,CACpC,aACA,OACA,SACA,YACI;AACJ,QAAM,UAAU,YAAY,OAAO,KAAiCA,UAAiBC,aAAoB;AACxG,QAAI,KAAK;AACR,YAAM,gBAAgB,IAAI;AAE1B,UAAI,MAAM,SAAS;AACnB,UAAI,MAAM,YAAY;AACtB,UAAI,MAAM,YAAY;AAEtB,UAAID,aAAYC,UAAS;AACxB,cAAM,SAAS,IAAI,eAAe,IAAI,eAAe,IAAI;
|
|
1
|
+
{"version":3,"file":"useAutoHeightTextArea.js","sources":["../../../../../packages/react-utils/src/hooks/useAutoHeightTextArea.ts"],"sourcesContent":["import { useCallback, useLayoutEffect } from 'react'\nimport { RefObjectOrElement, unwrapRefValue } from './unwrapRefValue'\nimport { useOnElementResize } from './useOnElementResize'\n\nfunction px<V extends number | false | null | undefined>(value?: V): string {\n\treturn typeof value === 'number' && !(isNaN(value) || value === Infinity || value === -Infinity) ? value + 'px' : ''\n}\n\nexport const useAutoHeightTextArea = (\n\ttextAreaRef: RefObjectOrElement<HTMLTextAreaElement>,\n\tvalue: string,\n\tminRows: number,\n\tmaxRows: number,\n) => {\n\tconst measure = useCallback(async (ref: HTMLTextAreaElement | null, minRows: number, maxRows: number) => {\n\t\tif (ref) {\n\t\t\tconst rowsAttribute = ref.rows\n\n\t\t\tref.style.height = ''\n\t\t\tref.style.minHeight = ''\n\t\t\tref.style.maxHeight = ''\n\n\t\t\tif (minRows !== maxRows) {\n\t\t\t\tconst height = ref.scrollHeight - ref.clientHeight + ref.offsetHeight\n\t\t\t\tlet minHeight: number\n\t\t\t\tlet maxHeight: number\n\n\t\t\t\tref.rows = minRows\n\t\t\t\tminHeight = await ref.getBoundingClientRect().height\n\n\t\t\t\tif (maxRows === Infinity) {\n\t\t\t\t\tmaxHeight = Infinity\n\t\t\t\t} else {\n\t\t\t\t\tref.rows = maxRows\n\t\t\t\t\tmaxHeight = await ref.getBoundingClientRect().height\n\t\t\t\t}\n\n\t\t\t\tref.style.height = px(height)\n\t\t\t\tref.style.minHeight = px(minHeight)\n\t\t\t\tref.style.maxHeight = px(maxHeight)\n\t\t\t}\n\n\t\t\tref.rows = rowsAttribute\n\t\t}\n\t}, [])\n\n\tuseOnElementResize(textAreaRef, () => {\n\t\tmeasure(unwrapRefValue(textAreaRef), minRows, maxRows)\n\t})\n\n\t// biome-ignore lint/correctness/useExhaustiveDependencies: intentional\n\tuseLayoutEffect(() => {\n\t\tmeasure(unwrapRefValue(textAreaRef), minRows, maxRows)\n\t}, [maxRows, measure, minRows, textAreaRef, value])\n}\n"],"names":["minRows","maxRows"],"mappings":";;;AAIA,SAAS,GAAgD,OAAmB;AAC3E,SAAO,OAAO,UAAU,YAAY,EAAE,MAAM,KAAK,KAAK,UAAU,YAAY,UAAU,aAAa,QAAQ,OAAO;AACnH;AAEO,MAAM,wBAAwB,CACpC,aACA,OACA,SACA,YACI;AACJ,QAAM,UAAU,YAAY,OAAO,KAAiCA,UAAiBC,aAAoB;AACxG,QAAI,KAAK;AACR,YAAM,gBAAgB,IAAI;AAE1B,UAAI,MAAM,SAAS;AACnB,UAAI,MAAM,YAAY;AACtB,UAAI,MAAM,YAAY;AAEtB,UAAID,aAAYC,UAAS;AACxB,cAAM,SAAS,IAAI,eAAe,IAAI,eAAe,IAAI;AACzD,YAAI;AACJ,YAAI;AAEJ,YAAI,OAAOD;AACX,oBAAY,MAAM,IAAI,sBAAA,EAAwB;AAE9C,YAAIC,aAAY,UAAU;AACzB,sBAAY;AAAA,QACb,OAAO;AACN,cAAI,OAAOA;AACX,sBAAY,MAAM,IAAI,sBAAA,EAAwB;AAAA,QAC/C;AAEA,YAAI,MAAM,SAAS,GAAG,MAAM;AAC5B,YAAI,MAAM,YAAY,GAAG,SAAS;AAClC,YAAI,MAAM,YAAY,GAAG,SAAS;AAAA,MACnC;AAEA,UAAI,OAAO;AAAA,IACZ;AAAA,EACD,GAAG,CAAA,CAAE;AAEL,qBAAmB,aAAa,MAAM;AACrC,YAAQ,eAAe,WAAW,GAAG,SAAS,OAAO;AAAA,EACtD,CAAC;AAGD,kBAAgB,MAAM;AACrB,YAAQ,eAAe,WAAW,GAAG,SAAS,OAAO;AAAA,EACtD,GAAG,CAAC,SAAS,SAAS,SAAS,aAAa,KAAK,CAAC;AACnD;"}
|
|
@@ -18,16 +18,17 @@ function getChildrenAsLabel(node) {
|
|
|
18
18
|
if (child === null || child === void 0 || typeof child === "boolean") ;
|
|
19
19
|
else if (typeof child === "string") {
|
|
20
20
|
label.push(child);
|
|
21
|
-
} else if (typeof child === "number") {
|
|
22
|
-
label.push(child);
|
|
21
|
+
} else if (typeof child === "number" || typeof child === "bigint") {
|
|
22
|
+
label.push(String(child));
|
|
23
23
|
} else if (Array.isArray(child)) {
|
|
24
24
|
const childLabel = getChildrenAsLabel(child);
|
|
25
25
|
if (childLabel) {
|
|
26
26
|
label.push(childLabel);
|
|
27
27
|
}
|
|
28
|
-
} else {
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
} else if (typeof child === "object") {
|
|
29
|
+
const props = "props" in child ? child.props : null;
|
|
30
|
+
if (props && "children" in props) {
|
|
31
|
+
const childLabel = getChildrenAsLabel(props.children);
|
|
31
32
|
if (childLabel) {
|
|
32
33
|
label.push(childLabel);
|
|
33
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useChildrenAsLabel.cjs","sources":["../../../../../packages/react-utils/src/hooks/useChildrenAsLabel.ts"],"sourcesContent":["import { Children, ReactNode, useMemo } from 'react'\n\nconst MULTIPLE_SPACES_REG_EXP = / +/g\n\nfunction normalize(text: string): string {\n\treturn text.replace(MULTIPLE_SPACES_REG_EXP, ' ').trim()\n}\n\n/**\n * Walks through the children and returns a string representation of the text content.\n *\n * @param node - The children to walk through.\n * @returns String representation of the text content or undefined if there is no text content.\n
|
|
1
|
+
{"version":3,"file":"useChildrenAsLabel.cjs","sources":["../../../../../packages/react-utils/src/hooks/useChildrenAsLabel.ts"],"sourcesContent":["import { Children, ReactNode, useMemo } from 'react'\n\nconst MULTIPLE_SPACES_REG_EXP = / +/g\n\nfunction normalize(text: string): string {\n\treturn text.replace(MULTIPLE_SPACES_REG_EXP, ' ').trim()\n}\n\n/**\n * Walks through the children and returns a string representation of the text content.\n *\n * @param node - The children to walk through.\n * @returns String representation of the text content or undefined if there is no text content.\n */\nexport function getChildrenAsLabel(node: ReactNode): string | undefined {\n\tif (typeof node === 'string' || typeof node === 'number') {\n\t\treturn String(node)\n\t} else if (node === null || node === undefined || typeof node === 'boolean') {\n\t\treturn undefined\n\t} else if (Array.isArray(node)) {\n\t\treturn normalize(node.map(getChildrenAsLabel).join(''))\n\t} else {\n\t\tlet label: (string | number)[] = []\n\n\t\tChildren.map(node, child => {\n\t\t\tif (child === null || child === undefined || typeof child === 'boolean') {\n\t\t\t} else if (typeof child === 'string') {\n\t\t\t\tlabel.push(child)\n\t\t\t} else if (typeof child === 'number' || typeof child === 'bigint') {\n\t\t\t\tlabel.push(String(child))\n\t\t\t} else if (Array.isArray(child)) {\n\t\t\t\tconst childLabel = getChildrenAsLabel(child)\n\n\t\t\t\tif (childLabel) {\n\t\t\t\t\tlabel.push(childLabel)\n\t\t\t\t}\n\t\t\t} else if (typeof child === 'object') {\n\t\t\t\t// ReactElement | ReactPortal | Iterable\n\t\t\t\tconst props = 'props' in child ? child.props as Record<string, unknown> : null\n\t\t\t\tif (props && 'children' in props) {\n\t\t\t\t\tconst childLabel = getChildrenAsLabel(props.children as ReactNode)\n\n\t\t\t\t\tif (childLabel) {\n\t\t\t\t\t\tlabel.push(childLabel)\n\t\t\t\t\t}\n\t\t\t\t} else if ('children' in child) {\n\t\t\t\t\t// ReactPortal\n\t\t\t\t\tconst childLabel = getChildrenAsLabel(child.children)\n\n\t\t\t\t\tif (childLabel) {\n\t\t\t\t\t\tlabel.push(childLabel)\n\t\t\t\t\t}\n\t\t\t\t} else if (import.meta.env.DEV) {\n\t\t\t\t\tconsole.warn('Unsupported child:', child)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\treturn label.length > 0 ? label.join('') : undefined\n\t}\n}\n\n/**\n * Walks through the children and returns a string representation of the text content.\n *\n * @param node - The children to walk through.\n * @returns String representation of the text content or undefined if there is no text content.\n */\nexport function useChildrenAsLabel(node: ReactNode): string | undefined {\n\treturn useMemo(() => getChildrenAsLabel(node), [node])\n}\n"],"names":["Children","useMemo"],"mappings":";;;AAEA,MAAM,0BAA0B;AAEhC,SAAS,UAAU,MAAsB;AACxC,SAAO,KAAK,QAAQ,yBAAyB,GAAG,EAAE,KAAA;AACnD;AAQO,SAAS,mBAAmB,MAAqC;AACvE,MAAI,OAAO,SAAS,YAAY,OAAO,SAAS,UAAU;AACzD,WAAO,OAAO,IAAI;AAAA,EACnB,WAAW,SAAS,QAAQ,SAAS,UAAa,OAAO,SAAS,WAAW;AAC5E,WAAO;AAAA,EACR,WAAW,MAAM,QAAQ,IAAI,GAAG;AAC/B,WAAO,UAAU,KAAK,IAAI,kBAAkB,EAAE,KAAK,EAAE,CAAC;AAAA,EACvD,OAAO;AACN,QAAI,QAA6B,CAAA;AAEjCA,UAAAA,SAAS,IAAI,MAAM,CAAA,UAAS;AAC3B,UAAI,UAAU,QAAQ,UAAU,UAAa,OAAO,UAAU,UAAW;AAAA,eAC9D,OAAO,UAAU,UAAU;AACrC,cAAM,KAAK,KAAK;AAAA,MACjB,WAAW,OAAO,UAAU,YAAY,OAAO,UAAU,UAAU;AAClE,cAAM,KAAK,OAAO,KAAK,CAAC;AAAA,MACzB,WAAW,MAAM,QAAQ,KAAK,GAAG;AAChC,cAAM,aAAa,mBAAmB,KAAK;AAE3C,YAAI,YAAY;AACf,gBAAM,KAAK,UAAU;AAAA,QACtB;AAAA,MACD,WAAW,OAAO,UAAU,UAAU;AAErC,cAAM,QAAQ,WAAW,QAAQ,MAAM,QAAmC;AAC1E,YAAI,SAAS,cAAc,OAAO;AACjC,gBAAM,aAAa,mBAAmB,MAAM,QAAqB;AAEjE,cAAI,YAAY;AACf,kBAAM,KAAK,UAAU;AAAA,UACtB;AAAA,QACD,WAAW,cAAc,OAAO;AAE/B,gBAAM,aAAa,mBAAmB,MAAM,QAAQ;AAEpD,cAAI,YAAY;AACf,kBAAM,KAAK,UAAU;AAAA,UACtB;AAAA,QACD;MAGD;AAAA,IACD,CAAC;AAED,WAAO,MAAM,SAAS,IAAI,MAAM,KAAK,EAAE,IAAI;AAAA,EAC5C;AACD;AAQO,SAAS,mBAAmB,MAAqC;AACvE,SAAOC,MAAAA,QAAQ,MAAM,mBAAmB,IAAI,GAAG,CAAC,IAAI,CAAC;AACtD;;;"}
|
|
@@ -16,16 +16,17 @@ function getChildrenAsLabel(node) {
|
|
|
16
16
|
if (child === null || child === void 0 || typeof child === "boolean") ;
|
|
17
17
|
else if (typeof child === "string") {
|
|
18
18
|
label.push(child);
|
|
19
|
-
} else if (typeof child === "number") {
|
|
20
|
-
label.push(child);
|
|
19
|
+
} else if (typeof child === "number" || typeof child === "bigint") {
|
|
20
|
+
label.push(String(child));
|
|
21
21
|
} else if (Array.isArray(child)) {
|
|
22
22
|
const childLabel = getChildrenAsLabel(child);
|
|
23
23
|
if (childLabel) {
|
|
24
24
|
label.push(childLabel);
|
|
25
25
|
}
|
|
26
|
-
} else {
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
} else if (typeof child === "object") {
|
|
27
|
+
const props = "props" in child ? child.props : null;
|
|
28
|
+
if (props && "children" in props) {
|
|
29
|
+
const childLabel = getChildrenAsLabel(props.children);
|
|
29
30
|
if (childLabel) {
|
|
30
31
|
label.push(childLabel);
|
|
31
32
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useChildrenAsLabel.js","sources":["../../../../../packages/react-utils/src/hooks/useChildrenAsLabel.ts"],"sourcesContent":["import { Children, ReactNode, useMemo } from 'react'\n\nconst MULTIPLE_SPACES_REG_EXP = / +/g\n\nfunction normalize(text: string): string {\n\treturn text.replace(MULTIPLE_SPACES_REG_EXP, ' ').trim()\n}\n\n/**\n * Walks through the children and returns a string representation of the text content.\n *\n * @param node - The children to walk through.\n * @returns String representation of the text content or undefined if there is no text content.\n
|
|
1
|
+
{"version":3,"file":"useChildrenAsLabel.js","sources":["../../../../../packages/react-utils/src/hooks/useChildrenAsLabel.ts"],"sourcesContent":["import { Children, ReactNode, useMemo } from 'react'\n\nconst MULTIPLE_SPACES_REG_EXP = / +/g\n\nfunction normalize(text: string): string {\n\treturn text.replace(MULTIPLE_SPACES_REG_EXP, ' ').trim()\n}\n\n/**\n * Walks through the children and returns a string representation of the text content.\n *\n * @param node - The children to walk through.\n * @returns String representation of the text content or undefined if there is no text content.\n */\nexport function getChildrenAsLabel(node: ReactNode): string | undefined {\n\tif (typeof node === 'string' || typeof node === 'number') {\n\t\treturn String(node)\n\t} else if (node === null || node === undefined || typeof node === 'boolean') {\n\t\treturn undefined\n\t} else if (Array.isArray(node)) {\n\t\treturn normalize(node.map(getChildrenAsLabel).join(''))\n\t} else {\n\t\tlet label: (string | number)[] = []\n\n\t\tChildren.map(node, child => {\n\t\t\tif (child === null || child === undefined || typeof child === 'boolean') {\n\t\t\t} else if (typeof child === 'string') {\n\t\t\t\tlabel.push(child)\n\t\t\t} else if (typeof child === 'number' || typeof child === 'bigint') {\n\t\t\t\tlabel.push(String(child))\n\t\t\t} else if (Array.isArray(child)) {\n\t\t\t\tconst childLabel = getChildrenAsLabel(child)\n\n\t\t\t\tif (childLabel) {\n\t\t\t\t\tlabel.push(childLabel)\n\t\t\t\t}\n\t\t\t} else if (typeof child === 'object') {\n\t\t\t\t// ReactElement | ReactPortal | Iterable\n\t\t\t\tconst props = 'props' in child ? child.props as Record<string, unknown> : null\n\t\t\t\tif (props && 'children' in props) {\n\t\t\t\t\tconst childLabel = getChildrenAsLabel(props.children as ReactNode)\n\n\t\t\t\t\tif (childLabel) {\n\t\t\t\t\t\tlabel.push(childLabel)\n\t\t\t\t\t}\n\t\t\t\t} else if ('children' in child) {\n\t\t\t\t\t// ReactPortal\n\t\t\t\t\tconst childLabel = getChildrenAsLabel(child.children)\n\n\t\t\t\t\tif (childLabel) {\n\t\t\t\t\t\tlabel.push(childLabel)\n\t\t\t\t\t}\n\t\t\t\t} else if (import.meta.env.DEV) {\n\t\t\t\t\tconsole.warn('Unsupported child:', child)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\treturn label.length > 0 ? label.join('') : undefined\n\t}\n}\n\n/**\n * Walks through the children and returns a string representation of the text content.\n *\n * @param node - The children to walk through.\n * @returns String representation of the text content or undefined if there is no text content.\n */\nexport function useChildrenAsLabel(node: ReactNode): string | undefined {\n\treturn useMemo(() => getChildrenAsLabel(node), [node])\n}\n"],"names":[],"mappings":";AAEA,MAAM,0BAA0B;AAEhC,SAAS,UAAU,MAAsB;AACxC,SAAO,KAAK,QAAQ,yBAAyB,GAAG,EAAE,KAAA;AACnD;AAQO,SAAS,mBAAmB,MAAqC;AACvE,MAAI,OAAO,SAAS,YAAY,OAAO,SAAS,UAAU;AACzD,WAAO,OAAO,IAAI;AAAA,EACnB,WAAW,SAAS,QAAQ,SAAS,UAAa,OAAO,SAAS,WAAW;AAC5E,WAAO;AAAA,EACR,WAAW,MAAM,QAAQ,IAAI,GAAG;AAC/B,WAAO,UAAU,KAAK,IAAI,kBAAkB,EAAE,KAAK,EAAE,CAAC;AAAA,EACvD,OAAO;AACN,QAAI,QAA6B,CAAA;AAEjC,aAAS,IAAI,MAAM,CAAA,UAAS;AAC3B,UAAI,UAAU,QAAQ,UAAU,UAAa,OAAO,UAAU,UAAW;AAAA,eAC9D,OAAO,UAAU,UAAU;AACrC,cAAM,KAAK,KAAK;AAAA,MACjB,WAAW,OAAO,UAAU,YAAY,OAAO,UAAU,UAAU;AAClE,cAAM,KAAK,OAAO,KAAK,CAAC;AAAA,MACzB,WAAW,MAAM,QAAQ,KAAK,GAAG;AAChC,cAAM,aAAa,mBAAmB,KAAK;AAE3C,YAAI,YAAY;AACf,gBAAM,KAAK,UAAU;AAAA,QACtB;AAAA,MACD,WAAW,OAAO,UAAU,UAAU;AAErC,cAAM,QAAQ,WAAW,QAAQ,MAAM,QAAmC;AAC1E,YAAI,SAAS,cAAc,OAAO;AACjC,gBAAM,aAAa,mBAAmB,MAAM,QAAqB;AAEjE,cAAI,YAAY;AACf,kBAAM,KAAK,UAAU;AAAA,UACtB;AAAA,QACD,WAAW,cAAc,OAAO;AAE/B,gBAAM,aAAa,mBAAmB,MAAM,QAAQ;AAEpD,cAAI,YAAY;AACf,kBAAM,KAAK,UAAU;AAAA,UACtB;AAAA,QACD;MAGD;AAAA,IACD,CAAC;AAED,WAAO,MAAM,SAAS,IAAI,MAAM,KAAK,EAAE,IAAI;AAAA,EAC5C;AACD;AAQO,SAAS,mBAAmB,MAAqC;AACvE,SAAO,QAAQ,MAAM,mBAAmB,IAAI,GAAG,CAAC,IAAI,CAAC;AACtD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useComposeRef.cjs","sources":["../../../../../packages/react-utils/src/hooks/useComposeRef.ts"],"sourcesContent":["import { MutableRefObject, RefCallback, useMemo, useRef } from 'react'\n\nexport type MaybeRef<T> = ((instance: T | null) => void) | MutableRefObject<T | null> | null | undefined\nexport type ComposedRefCallback<T> = RefCallback<T> & { current: T | null }\n\nfunction setRef<T>(ref: MaybeRef<T>, instance: T | null): void {\n\tif (ref) {\n\t\tif (typeof ref === 'function') {\n\t\t\tref(instance)\n\t\t} else if (instance) {\n\t\t\tref.current = instance\n\t\t}\n\t}\n}\n\n/**\n * Fills any number of refs with an instance\n *\n * Useful when you need to use outer ref and inner in the same time, e.g. passing element\n * back to forwardedRef an also using the same value within the component locally.\n *\n * @param refs - Rest parameter of refs to fill with instance\n * @returns Returns a function similar to a RefCallback\n */\nexport function useComposeRef<T>(...refs: MaybeRef<T>[]): ComposedRefCallback<T> {\n\tconst initialRefs = useRef(refs)\n\n\tconst composeRef: ComposedRefCallback<T> = useMemo(() => {\n\t\tfunction composedRefCallback(instance: T | null) {\n\t\t\tinitialRefs.current.forEach(ref => setRef(ref, instance))\n\t\t\tsetCurrent(instance)\n\t\t}\n\n\t\tfunction setCurrent(instance: T | null) {\n\t\t\tif (instance) {\n\t\t\t\tcomposedRefCallback.current = instance\n\t\t\t}\n\t\t}\n\n\t\tcomposedRefCallback.current = null as T | null\n\n\t\treturn composedRefCallback\n\t}, [])\n\n\treturn composeRef\n}\n"],"names":["useRef","useMemo"],"mappings":";;;AAKA,SAAS,OAAU,KAAkB,UAA0B;AAC9D,MAAI,KAAK;
|
|
1
|
+
{"version":3,"file":"useComposeRef.cjs","sources":["../../../../../packages/react-utils/src/hooks/useComposeRef.ts"],"sourcesContent":["import { MutableRefObject, RefCallback, useMemo, useRef } from 'react'\n\nexport type MaybeRef<T> = ((instance: T | null) => void) | MutableRefObject<T | null> | null | undefined\nexport type ComposedRefCallback<T> = RefCallback<T> & { current: T | null }\n\nfunction setRef<T>(ref: MaybeRef<T>, instance: T | null): void {\n\tif (ref) {\n\t\tif (typeof ref === 'function') {\n\t\t\tref(instance)\n\t\t} else if (instance) {\n\t\t\tref.current = instance\n\t\t}\n\t}\n}\n\n/**\n * Fills any number of refs with an instance\n *\n * Useful when you need to use outer ref and inner in the same time, e.g. passing element\n * back to forwardedRef an also using the same value within the component locally.\n *\n * @param refs - Rest parameter of refs to fill with instance\n * @returns Returns a function similar to a RefCallback\n */\nexport function useComposeRef<T>(...refs: MaybeRef<T>[]): ComposedRefCallback<T> {\n\tconst initialRefs = useRef(refs)\n\n\tconst composeRef: ComposedRefCallback<T> = useMemo(() => {\n\t\tfunction composedRefCallback(instance: T | null) {\n\t\t\tinitialRefs.current.forEach(ref => setRef(ref, instance))\n\t\t\tsetCurrent(instance)\n\t\t}\n\n\t\tfunction setCurrent(instance: T | null) {\n\t\t\tif (instance) {\n\t\t\t\tcomposedRefCallback.current = instance\n\t\t\t}\n\t\t}\n\n\t\tcomposedRefCallback.current = null as T | null\n\n\t\treturn composedRefCallback\n\t}, [])\n\n\treturn composeRef\n}\n"],"names":["useRef","useMemo"],"mappings":";;;AAKA,SAAS,OAAU,KAAkB,UAA0B;AAC9D,MAAI,KAAK;AACR,QAAI,OAAO,QAAQ,YAAY;AAC9B,UAAI,QAAQ;AAAA,IACb,WAAW,UAAU;AACpB,UAAI,UAAU;AAAA,IACf;AAAA,EACD;AACD;AAWO,SAAS,iBAAoB,MAA6C;AAChF,QAAM,cAAcA,MAAAA,OAAO,IAAI;AAE/B,QAAM,aAAqCC,MAAAA,QAAQ,MAAM;AACxD,aAAS,oBAAoB,UAAoB;AAChD,kBAAY,QAAQ,QAAQ,CAAA,QAAO,OAAO,KAAK,QAAQ,CAAC;AACxD,iBAAW,QAAQ;AAAA,IACpB;AAEA,aAAS,WAAW,UAAoB;AACvC,UAAI,UAAU;AACb,4BAAoB,UAAU;AAAA,MAC/B;AAAA,IACD;AAEA,wBAAoB,UAAU;AAE9B,WAAO;AAAA,EACR,GAAG,CAAA,CAAE;AAEL,SAAO;AACR;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useComposeRef.js","sources":["../../../../../packages/react-utils/src/hooks/useComposeRef.ts"],"sourcesContent":["import { MutableRefObject, RefCallback, useMemo, useRef } from 'react'\n\nexport type MaybeRef<T> = ((instance: T | null) => void) | MutableRefObject<T | null> | null | undefined\nexport type ComposedRefCallback<T> = RefCallback<T> & { current: T | null }\n\nfunction setRef<T>(ref: MaybeRef<T>, instance: T | null): void {\n\tif (ref) {\n\t\tif (typeof ref === 'function') {\n\t\t\tref(instance)\n\t\t} else if (instance) {\n\t\t\tref.current = instance\n\t\t}\n\t}\n}\n\n/**\n * Fills any number of refs with an instance\n *\n * Useful when you need to use outer ref and inner in the same time, e.g. passing element\n * back to forwardedRef an also using the same value within the component locally.\n *\n * @param refs - Rest parameter of refs to fill with instance\n * @returns Returns a function similar to a RefCallback\n */\nexport function useComposeRef<T>(...refs: MaybeRef<T>[]): ComposedRefCallback<T> {\n\tconst initialRefs = useRef(refs)\n\n\tconst composeRef: ComposedRefCallback<T> = useMemo(() => {\n\t\tfunction composedRefCallback(instance: T | null) {\n\t\t\tinitialRefs.current.forEach(ref => setRef(ref, instance))\n\t\t\tsetCurrent(instance)\n\t\t}\n\n\t\tfunction setCurrent(instance: T | null) {\n\t\t\tif (instance) {\n\t\t\t\tcomposedRefCallback.current = instance\n\t\t\t}\n\t\t}\n\n\t\tcomposedRefCallback.current = null as T | null\n\n\t\treturn composedRefCallback\n\t}, [])\n\n\treturn composeRef\n}\n"],"names":[],"mappings":";AAKA,SAAS,OAAU,KAAkB,UAA0B;AAC9D,MAAI,KAAK;
|
|
1
|
+
{"version":3,"file":"useComposeRef.js","sources":["../../../../../packages/react-utils/src/hooks/useComposeRef.ts"],"sourcesContent":["import { MutableRefObject, RefCallback, useMemo, useRef } from 'react'\n\nexport type MaybeRef<T> = ((instance: T | null) => void) | MutableRefObject<T | null> | null | undefined\nexport type ComposedRefCallback<T> = RefCallback<T> & { current: T | null }\n\nfunction setRef<T>(ref: MaybeRef<T>, instance: T | null): void {\n\tif (ref) {\n\t\tif (typeof ref === 'function') {\n\t\t\tref(instance)\n\t\t} else if (instance) {\n\t\t\tref.current = instance\n\t\t}\n\t}\n}\n\n/**\n * Fills any number of refs with an instance\n *\n * Useful when you need to use outer ref and inner in the same time, e.g. passing element\n * back to forwardedRef an also using the same value within the component locally.\n *\n * @param refs - Rest parameter of refs to fill with instance\n * @returns Returns a function similar to a RefCallback\n */\nexport function useComposeRef<T>(...refs: MaybeRef<T>[]): ComposedRefCallback<T> {\n\tconst initialRefs = useRef(refs)\n\n\tconst composeRef: ComposedRefCallback<T> = useMemo(() => {\n\t\tfunction composedRefCallback(instance: T | null) {\n\t\t\tinitialRefs.current.forEach(ref => setRef(ref, instance))\n\t\t\tsetCurrent(instance)\n\t\t}\n\n\t\tfunction setCurrent(instance: T | null) {\n\t\t\tif (instance) {\n\t\t\t\tcomposedRefCallback.current = instance\n\t\t\t}\n\t\t}\n\n\t\tcomposedRefCallback.current = null as T | null\n\n\t\treturn composedRefCallback\n\t}, [])\n\n\treturn composeRef\n}\n"],"names":[],"mappings":";AAKA,SAAS,OAAU,KAAkB,UAA0B;AAC9D,MAAI,KAAK;AACR,QAAI,OAAO,QAAQ,YAAY;AAC9B,UAAI,QAAQ;AAAA,IACb,WAAW,UAAU;AACpB,UAAI,UAAU;AAAA,IACf;AAAA,EACD;AACD;AAWO,SAAS,iBAAoB,MAA6C;AAChF,QAAM,cAAc,OAAO,IAAI;AAE/B,QAAM,aAAqC,QAAQ,MAAM;AACxD,aAAS,oBAAoB,UAAoB;AAChD,kBAAY,QAAQ,QAAQ,CAAA,QAAO,OAAO,KAAK,QAAQ,CAAC;AACxD,iBAAW,QAAQ;AAAA,IACpB;AAEA,aAAS,WAAW,UAAoB;AACvC,UAAI,UAAU;AACb,4BAAoB,UAAU;AAAA,MAC/B;AAAA,IACD;AAEA,wBAAoB,UAAU;AAE9B,WAAO;AAAA,EACR,GAAG,CAAA,CAAE;AAEL,SAAO;AACR;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConstantLengthInvariant.cjs","sources":["../../../../../packages/react-utils/src/hooks/useConstantLengthInvariant.ts"],"sourcesContent":["import { usePreviousValue } from './usePreviousValue'\n\n// This entire hook should get optimized away for prod\nexport const useConstantLengthInvariant = <Item>(items: Item[], message?: string) => {\n\tif (import.meta.env.DEV) {\n\t\
|
|
1
|
+
{"version":3,"file":"useConstantLengthInvariant.cjs","sources":["../../../../../packages/react-utils/src/hooks/useConstantLengthInvariant.ts"],"sourcesContent":["import { usePreviousValue } from './usePreviousValue'\n\n// This entire hook should get optimized away for prod\nexport const useConstantLengthInvariant = <Item>(items: Item[], message?: string) => {\n\tif (import.meta.env.DEV) {\n\t\tconst previous = usePreviousValue(items)\n\t\tif (previous.length !== items.length) {\n\t\t\tthrow new Error(\n\t\t\t\t`Invariant violation: ${message || 'Changing the length of an array whose length must remain constant between renders.'}`,\n\t\t\t)\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;AAGO,MAAM,6BAA6B,CAAO,OAAe,YAAqB;AASrF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConstantLengthInvariant.js","sources":["../../../../../packages/react-utils/src/hooks/useConstantLengthInvariant.ts"],"sourcesContent":["import { usePreviousValue } from './usePreviousValue'\n\n// This entire hook should get optimized away for prod\nexport const useConstantLengthInvariant = <Item>(items: Item[], message?: string) => {\n\tif (import.meta.env.DEV) {\n\t\
|
|
1
|
+
{"version":3,"file":"useConstantLengthInvariant.js","sources":["../../../../../packages/react-utils/src/hooks/useConstantLengthInvariant.ts"],"sourcesContent":["import { usePreviousValue } from './usePreviousValue'\n\n// This entire hook should get optimized away for prod\nexport const useConstantLengthInvariant = <Item>(items: Item[], message?: string) => {\n\tif (import.meta.env.DEV) {\n\t\tconst previous = usePreviousValue(items)\n\t\tif (previous.length !== items.length) {\n\t\t\tthrow new Error(\n\t\t\t\t`Invariant violation: ${message || 'Changing the length of an array whose length must remain constant between renders.'}`,\n\t\t\t)\n\t\t}\n\t}\n}\n"],"names":[],"mappings":"AAGO,MAAM,6BAA6B,CAAO,OAAe,YAAqB;AASrF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConstantValueInvariant.cjs","sources":["../../../../../packages/react-utils/src/hooks/useConstantValueInvariant.ts"],"sourcesContent":["import { usePreviousValue } from './usePreviousValue'\n\n// This entire hook should get optimized away for prod\nexport const useConstantValueInvariant = <Value>(value: Value, message?: string) => {\n\tif (import.meta.env.DEV) {\n\t\
|
|
1
|
+
{"version":3,"file":"useConstantValueInvariant.cjs","sources":["../../../../../packages/react-utils/src/hooks/useConstantValueInvariant.ts"],"sourcesContent":["import { usePreviousValue } from './usePreviousValue'\n\n// This entire hook should get optimized away for prod\nexport const useConstantValueInvariant = <Value>(value: Value, message?: string) => {\n\tif (import.meta.env.DEV) {\n\t\tconst previous = usePreviousValue(value)\n\t\tif (previous !== value) {\n\t\t\tthrow new Error(\n\t\t\t\t`Invariant violation: ${message || 'Changing a value which must remain constant between renders.'}`,\n\t\t\t)\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;AAGO,MAAM,4BAA4B,CAAQ,OAAc,YAAqB;AASpF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConstantValueInvariant.js","sources":["../../../../../packages/react-utils/src/hooks/useConstantValueInvariant.ts"],"sourcesContent":["import { usePreviousValue } from './usePreviousValue'\n\n// This entire hook should get optimized away for prod\nexport const useConstantValueInvariant = <Value>(value: Value, message?: string) => {\n\tif (import.meta.env.DEV) {\n\t\
|
|
1
|
+
{"version":3,"file":"useConstantValueInvariant.js","sources":["../../../../../packages/react-utils/src/hooks/useConstantValueInvariant.ts"],"sourcesContent":["import { usePreviousValue } from './usePreviousValue'\n\n// This entire hook should get optimized away for prod\nexport const useConstantValueInvariant = <Value>(value: Value, message?: string) => {\n\tif (import.meta.env.DEV) {\n\t\tconst previous = usePreviousValue(value)\n\t\tif (previous !== value) {\n\t\t\tthrow new Error(\n\t\t\t\t`Invariant violation: ${message || 'Changing a value which must remain constant between renders.'}`,\n\t\t\t)\n\t\t}\n\t}\n}\n"],"names":[],"mappings":"AAGO,MAAM,4BAA4B,CAAQ,OAAc,YAAqB;AASpF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDebounce.cjs","sources":["../../../../../packages/react-utils/src/hooks/useDebounce.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\n\nexport const useDebounce = <T>(value: T, debounceMs: number): T => {\n\tconst [debounced, setDebounced] = useState(value)\n\tuseEffect(() => {\n\t\tconst handle = window.setTimeout(() => setDebounced(value), debounceMs)\n\t\treturn () => {\n\t\t\twindow.clearTimeout(handle)\n\t\t}\n\t}, [value, debounceMs])\n\treturn debounced\n}\n"],"names":["useState","useEffect"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"useDebounce.cjs","sources":["../../../../../packages/react-utils/src/hooks/useDebounce.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\n\nexport const useDebounce = <T>(value: T, debounceMs: number): T => {\n\tconst [debounced, setDebounced] = useState(value)\n\tuseEffect(() => {\n\t\tconst handle = window.setTimeout(() => setDebounced(value), debounceMs)\n\t\treturn () => {\n\t\t\twindow.clearTimeout(handle)\n\t\t}\n\t}, [value, debounceMs])\n\treturn debounced\n}\n"],"names":["useState","useEffect"],"mappings":";;;AAEO,MAAM,cAAc,CAAI,OAAU,eAA0B;AAClE,QAAM,CAAC,WAAW,YAAY,IAAIA,MAAAA,SAAS,KAAK;AAChDC,QAAAA,UAAU,MAAM;AACf,UAAM,SAAS,OAAO,WAAW,MAAM,aAAa,KAAK,GAAG,UAAU;AACtE,WAAO,MAAM;AACZ,aAAO,aAAa,MAAM;AAAA,IAC3B;AAAA,EACD,GAAG,CAAC,OAAO,UAAU,CAAC;AACtB,SAAO;AACR;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDebounce.js","sources":["../../../../../packages/react-utils/src/hooks/useDebounce.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\n\nexport const useDebounce = <T>(value: T, debounceMs: number): T => {\n\tconst [debounced, setDebounced] = useState(value)\n\tuseEffect(() => {\n\t\tconst handle = window.setTimeout(() => setDebounced(value), debounceMs)\n\t\treturn () => {\n\t\t\twindow.clearTimeout(handle)\n\t\t}\n\t}, [value, debounceMs])\n\treturn debounced\n}\n"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"useDebounce.js","sources":["../../../../../packages/react-utils/src/hooks/useDebounce.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\n\nexport const useDebounce = <T>(value: T, debounceMs: number): T => {\n\tconst [debounced, setDebounced] = useState(value)\n\tuseEffect(() => {\n\t\tconst handle = window.setTimeout(() => setDebounced(value), debounceMs)\n\t\treturn () => {\n\t\t\twindow.clearTimeout(handle)\n\t\t}\n\t}, [value, debounceMs])\n\treturn debounced\n}\n"],"names":[],"mappings":";AAEO,MAAM,cAAc,CAAI,OAAU,eAA0B;AAClE,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,KAAK;AAChD,YAAU,MAAM;AACf,UAAM,SAAS,OAAO,WAAW,MAAM,aAAa,KAAK,GAAG,UAAU;AACtE,WAAO,MAAM;AACZ,aAAO,aAAa,MAAM;AAAA,IAC3B;AAAA,EACD,GAAG,CAAC,OAAO,UAAU,CAAC;AACtB,SAAO;AACR;"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const React = require("react");
|
|
4
4
|
const useDebounceCallback = (cb, debounceMs) => {
|
|
5
|
-
const timerRef = React.useRef();
|
|
5
|
+
const timerRef = React.useRef(void 0);
|
|
6
6
|
const cbRef = React.useRef(cb);
|
|
7
7
|
cbRef.current = cb;
|
|
8
8
|
React.useEffect(() => {
|