@rpcbase/ui 0.234.0 → 0.235.0
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/components/FilesUploadField/index.d.ts.map +1 -1
- package/dist/index151.js +4 -4
- package/dist/index156.js +1 -1
- package/dist/index157.js +1 -1
- package/dist/index164.js +1 -1
- package/dist/index165.js +6 -6
- package/dist/index167.js +4 -4
- package/dist/index169.js +1 -1
- package/dist/index172.js +9 -9
- package/dist/index175.js +1 -1
- package/dist/index176.js +4 -4
- package/dist/index178.js +1 -1
- package/dist/index182.js +1 -1
- package/dist/index184.js +12 -12
- package/dist/index187.js +6 -6
- package/dist/index189.js +3 -3
- package/dist/index190.js +1 -1
- package/dist/index193.js +3 -3
- package/dist/index194.js +5 -5
- package/dist/index256.js +20 -14
- package/dist/index256.js.map +1 -1
- package/dist/index257.js +58 -146
- package/dist/index257.js.map +1 -1
- package/dist/index258.js +6 -30
- package/dist/index258.js.map +1 -1
- package/dist/index259.js +11 -9
- package/dist/index259.js.map +1 -1
- package/dist/index260.js +46 -44
- package/dist/index260.js.map +1 -1
- package/dist/index261.js +4 -12
- package/dist/index261.js.map +1 -1
- package/dist/index262.js +28 -43
- package/dist/index262.js.map +1 -1
- package/dist/index263.js +14 -93
- package/dist/index263.js.map +1 -1
- package/dist/index264.js +5 -86
- package/dist/index264.js.map +1 -1
- package/dist/index265.js +21 -105
- package/dist/index265.js.map +1 -1
- package/dist/index266.js +50 -51
- package/dist/index266.js.map +1 -1
- package/dist/index267.js +25 -11
- package/dist/index267.js.map +1 -1
- package/dist/index268.js +41 -37
- package/dist/index268.js.map +1 -1
- package/dist/index269.js +39 -8
- package/dist/index269.js.map +1 -1
- package/dist/index270.js +45 -117
- package/dist/index270.js.map +1 -1
- package/dist/index271.js +20 -17
- package/dist/index271.js.map +1 -1
- package/dist/index272.js +69 -14
- package/dist/index272.js.map +1 -1
- package/dist/index273.js +17 -3
- package/dist/index273.js.map +1 -1
- package/dist/index274.js +11 -36
- package/dist/index274.js.map +1 -1
- package/dist/index275.js +27 -20
- package/dist/index275.js.map +1 -1
- package/dist/index276.js +13 -9
- package/dist/index276.js.map +1 -1
- package/dist/index277.js +18 -8
- package/dist/index277.js.map +1 -1
- package/dist/index278.js +35 -18
- package/dist/index278.js.map +1 -1
- package/dist/index279.js +260 -26
- package/dist/index279.js.map +1 -1
- package/dist/index280.js +277 -15
- package/dist/index280.js.map +1 -1
- package/dist/index281.js +69 -20
- package/dist/index281.js.map +1 -1
- package/dist/index282.js +92 -59
- package/dist/index282.js.map +1 -1
- package/dist/index283.js +83 -6
- package/dist/index283.js.map +1 -1
- package/dist/index284.js +3 -11
- package/dist/index284.js.map +1 -1
- package/dist/index285.js +27 -48
- package/dist/index285.js.map +1 -1
- package/dist/index286.js +17 -4
- package/dist/index286.js.map +1 -1
- package/dist/index287.js +35 -30
- package/dist/index287.js.map +1 -1
- package/dist/index288.js +15 -15
- package/dist/index288.js.map +1 -1
- package/dist/index289.js +3 -5
- package/dist/index289.js.map +1 -1
- package/dist/index290.js +25 -20
- package/dist/index290.js.map +1 -1
- package/dist/index291.js +26 -49
- package/dist/index291.js.map +1 -1
- package/dist/index292.js +4 -26
- package/dist/index292.js.map +1 -1
- package/dist/index293.js +76 -39
- package/dist/index293.js.map +1 -1
- package/dist/index294.js +265 -35
- package/dist/index294.js.map +1 -1
- package/dist/index295.js +12 -45
- package/dist/index295.js.map +1 -1
- package/dist/index296.js +10 -20
- package/dist/index296.js.map +1 -1
- package/dist/index297.js +25 -70
- package/dist/index297.js.map +1 -1
- package/dist/index298.js +16 -17
- package/dist/index298.js.map +1 -1
- package/dist/index299.js +125 -11
- package/dist/index299.js.map +1 -1
- package/dist/index300.js +5 -27
- package/dist/index300.js.map +1 -1
- package/dist/index301.js +39 -12
- package/dist/index301.js.map +1 -1
- package/dist/index302.js +63 -16
- package/dist/index302.js.map +1 -1
- package/dist/index303.js +13 -36
- package/dist/index303.js.map +1 -1
- package/dist/index304.js +7 -262
- package/dist/index304.js.map +1 -1
- package/dist/index305.js +5 -278
- package/dist/index305.js.map +1 -1
- package/dist/index306.js +3 -68
- package/dist/index306.js.map +1 -1
- package/dist/index307.js +10 -99
- package/dist/index307.js.map +1 -1
- package/dist/index308.js +7 -83
- package/dist/index308.js.map +1 -1
- package/dist/index309.js +133 -3
- package/dist/index309.js.map +1 -1
- package/dist/index310.js +399 -29
- package/dist/index310.js.map +1 -1
- package/dist/index311.js +52 -16
- package/dist/index311.js.map +1 -1
- package/dist/index312.js +12 -35
- package/dist/index312.js.map +1 -1
- package/dist/index313.js +11 -16
- package/dist/index313.js.map +1 -1
- package/dist/index314.js +13 -3
- package/dist/index314.js.map +1 -1
- package/dist/index315.js +150 -22
- package/dist/index315.js.map +1 -1
- package/dist/index316.js +27 -25
- package/dist/index316.js.map +1 -1
- package/dist/index317.js +10 -4
- package/dist/index317.js.map +1 -1
- package/dist/index318.js +44 -74
- package/dist/index318.js.map +1 -1
- package/dist/index319.js +10 -268
- package/dist/index319.js.map +1 -1
- package/dist/index320.js +44 -11
- package/dist/index320.js.map +1 -1
- package/dist/index321.js +95 -10
- package/dist/index321.js.map +1 -1
- package/dist/index322.js +86 -25
- package/dist/index322.js.map +1 -1
- package/dist/index323.js +104 -15
- package/dist/index323.js.map +1 -1
- package/dist/index324.js +50 -123
- package/dist/index324.js.map +1 -1
- package/dist/index325.js +11 -5
- package/dist/index325.js.map +1 -1
- package/dist/index326.js +34 -37
- package/dist/index326.js.map +1 -1
- package/dist/index327.js +8 -65
- package/dist/index327.js.map +1 -1
- package/dist/index328.js +116 -13
- package/dist/index328.js.map +1 -1
- package/dist/index329.js +17 -7
- package/dist/index329.js.map +1 -1
- package/dist/index330.js +15 -5
- package/dist/index330.js.map +1 -1
- package/dist/index331.js +3 -3
- package/dist/index331.js.map +1 -1
- package/dist/index332.js +36 -10
- package/dist/index332.js.map +1 -1
- package/dist/index333.js +20 -7
- package/dist/index333.js.map +1 -1
- package/dist/index334.js +9 -133
- package/dist/index334.js.map +1 -1
- package/dist/index335.js +7 -398
- package/dist/index335.js.map +1 -1
- package/dist/index336.js +8 -52
- package/dist/index336.js.map +1 -1
- package/dist/index337.js +11 -11
- package/dist/index337.js.map +1 -1
- package/dist/index338.js +8 -11
- package/dist/index338.js.map +1 -1
- package/dist/index339.js +13 -8
- package/dist/index339.js.map +1 -1
- package/dist/index340.js +3 -11
- package/dist/index340.js.map +1 -1
- package/dist/index341.js +3 -8
- package/dist/index341.js.map +1 -1
- package/dist/index342.js +16 -12
- package/dist/index342.js.map +1 -1
- package/dist/index343.js +19 -3
- package/dist/index343.js.map +1 -1
- package/dist/index344.js +28 -3
- package/dist/index344.js.map +1 -1
- package/dist/index345.js +15 -16
- package/dist/index345.js.map +1 -1
- package/dist/index346.js +2 -2
- package/dist/index347.js +8 -8
- package/dist/index348.js +4 -4
- package/dist/index349.js +3 -3
- package/dist/index350.js +5 -5
- package/dist/index352.js +1 -1
- package/dist/index362.js +10 -19
- package/dist/index362.js.map +1 -1
- package/dist/index363.js +17 -4
- package/dist/index363.js.map +1 -1
- package/dist/index364.js +5 -11
- package/dist/index364.js.map +1 -1
- package/dist/index365.js +4 -17
- package/dist/index365.js.map +1 -1
- package/dist/index366.js +20 -5
- package/dist/index366.js.map +1 -1
- package/dist/index367.js +43 -19
- package/dist/index367.js.map +1 -1
- package/dist/index368.js +13 -40
- package/dist/index368.js.map +1 -1
- package/dist/index369.js +4 -17
- package/dist/index369.js.map +1 -1
- package/dist/index370.js +200 -4
- package/dist/index370.js.map +1 -1
- package/dist/index371.js +74 -197
- package/dist/index371.js.map +1 -1
- package/dist/index372.js +20 -77
- package/dist/index372.js.map +1 -1
- package/dist/index374.js +3 -3
- package/dist/index375.js +1 -1
- package/dist/index376.js +3 -3
- package/dist/index378.js +2 -2
- package/dist/index380.js +1 -1
- package/dist/index381.js +2 -2
- package/dist/index407.js +1 -1
- package/dist/index417.js +1 -1
- package/dist/index418.js +1 -1
- package/dist/index421.js +1 -1
- package/dist/index422.js +1 -1
- package/dist/index427.js +2 -2
- package/dist/index429.js +2 -2
- package/dist/index44.js +1 -1
- package/dist/index45.js +2 -2
- package/dist/index49.js +28 -28
- package/dist/index50.js +21 -21
- package/dist/index51.js +1 -1
- package/dist/index52.js +8 -8
- package/dist/index53.js +2 -2
- package/dist/index55.js +17 -17
- package/dist/index56.js +4 -4
- package/dist/index57.js +3 -3
- package/dist/index58.js +7 -7
- package/dist/index59.js +4 -4
- package/dist/index60.js +12 -12
- package/dist/index61.js +2 -2
- package/dist/index62.js +2 -2
- package/dist/index70.js +1 -1
- package/dist/index71.js +1 -1
- package/dist/index74.js +2 -6
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +2 -8
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +5 -5
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +8 -2
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +6 -2
- package/dist/index78.js.map +1 -1
- package/dist/index8.js +533 -698
- package/dist/index8.js.map +1 -1
- package/package.json +1 -1
package/dist/index274.js
CHANGED
|
@@ -1,40 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import o from "./
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
if (r.numberingPlan.possibleLengths() && (n || (n = N(r.numberingPlan.callingCode(), {
|
|
13
|
-
nationalNumber: t,
|
|
14
|
-
metadata: r
|
|
15
|
-
})), !f(t, n, r)))
|
|
16
|
-
return {
|
|
17
|
-
nationalNumber: e
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
return {
|
|
21
|
-
nationalNumber: t,
|
|
22
|
-
carrierCode: a
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
function m(e, n, r) {
|
|
26
|
-
return !(o(e, r.nationalNumberPattern()) && !o(n, r.nationalNumberPattern()));
|
|
27
|
-
}
|
|
28
|
-
function f(e, n, r) {
|
|
29
|
-
switch (u(e, n, r)) {
|
|
30
|
-
case "TOO_SHORT":
|
|
31
|
-
case "INVALID_LENGTH":
|
|
32
|
-
return !1;
|
|
33
|
-
default:
|
|
34
|
-
return !0;
|
|
35
|
-
}
|
|
1
|
+
import * as c from "react";
|
|
2
|
+
import { useIsoLayoutEffect as o } from "./index261.js";
|
|
3
|
+
import { useStableCallback as f } from "./index262.js";
|
|
4
|
+
function u(r, n) {
|
|
5
|
+
const t = c.useRef(r), e = f(n);
|
|
6
|
+
o(() => {
|
|
7
|
+
t.current !== r && e(t.current);
|
|
8
|
+
}, [r, e]), o(() => {
|
|
9
|
+
t.current = r;
|
|
10
|
+
}, [r]);
|
|
36
11
|
}
|
|
37
12
|
export {
|
|
38
|
-
|
|
13
|
+
u as useValueChanged
|
|
39
14
|
};
|
|
40
15
|
//# sourceMappingURL=index274.js.map
|
package/dist/index274.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index274.js","sources":["../../../node_modules
|
|
1
|
+
{"version":3,"file":"index274.js","sources":["../../../node_modules/@base-ui/react/esm/internals/useValueChanged.js"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nexport function useValueChanged(value, onChange) {\n const valueRef = React.useRef(value);\n const onChangeCallback = useStableCallback(onChange);\n useIsoLayoutEffect(() => {\n if (valueRef.current === value) {\n return;\n }\n onChangeCallback(valueRef.current);\n }, [value, onChangeCallback]);\n useIsoLayoutEffect(() => {\n valueRef.current = value;\n }, [value]);\n}"],"names":["useValueChanged","value","onChange","valueRef","React","onChangeCallback","useStableCallback","useIsoLayoutEffect"],"mappings":";;;AAKO,SAASA,EAAgBC,GAAOC,GAAU;AAC/C,QAAMC,IAAWC,EAAM,OAAOH,CAAK,GAC7BI,IAAmBC,EAAkBJ,CAAQ;AACnD,EAAAK,EAAmB,MAAM;AACvB,IAAIJ,EAAS,YAAYF,KAGzBI,EAAiBF,EAAS,OAAO;AAAA,EACnC,GAAG,CAACF,GAAOI,CAAgB,CAAC,GAC5BE,EAAmB,MAAM;AACvB,IAAAJ,EAAS,UAAUF;AAAA,EACrB,GAAG,CAACA,CAAK,CAAC;AACZ;","x_google_ignoreList":[0]}
|
package/dist/index275.js
CHANGED
|
@@ -1,24 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import * as l from "react";
|
|
2
|
+
import { useStableCallback as c } from "./index262.js";
|
|
3
|
+
import { useEnhancedClickHandler as u } from "./index363.js";
|
|
4
|
+
import { isIOS as m } from "./index301.js";
|
|
5
|
+
import { useValueChanged as p } from "./index274.js";
|
|
6
|
+
function C(e) {
|
|
7
|
+
const [o, t] = l.useState(null), s = c((i, a) => {
|
|
8
|
+
e || t(a || // On iOS Safari, the hitslop around touch targets means tapping outside an element's
|
|
9
|
+
// bounds does not fire `pointerdown` but does fire `mousedown`. The `interactionType`
|
|
10
|
+
// will be "" in that case.
|
|
11
|
+
(m ? "touch" : ""));
|
|
12
|
+
});
|
|
13
|
+
p(e, (i) => {
|
|
14
|
+
i && !e && t(null);
|
|
15
|
+
});
|
|
16
|
+
const {
|
|
17
|
+
onClick: r,
|
|
18
|
+
onPointerDown: n
|
|
19
|
+
} = u(s);
|
|
20
|
+
return l.useMemo(() => ({
|
|
21
|
+
openMethod: o,
|
|
22
|
+
triggerProps: {
|
|
23
|
+
onClick: r,
|
|
24
|
+
onPointerDown: n
|
|
25
|
+
}
|
|
26
|
+
}), [o, r, n]);
|
|
20
27
|
}
|
|
21
28
|
export {
|
|
22
|
-
|
|
29
|
+
C as useOpenInteractionType
|
|
23
30
|
};
|
|
24
31
|
//# sourceMappingURL=index275.js.map
|
package/dist/index275.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index275.js","sources":["../../../node_modules
|
|
1
|
+
{"version":3,"file":"index275.js","sources":["../../../node_modules/@base-ui/react/esm/utils/useOpenInteractionType.js"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useEnhancedClickHandler } from '@base-ui/utils/useEnhancedClickHandler';\nimport { isIOS } from '@base-ui/utils/detectBrowser';\nimport { useValueChanged } from \"../internals/useValueChanged.js\";\n\n/**\n * Determines the interaction type (keyboard, mouse, touch, etc.) that opened the component.\n *\n * @param open The open state of the component.\n */\nexport function useOpenInteractionType(open) {\n const [openMethod, setOpenMethod] = React.useState(null);\n const handleTriggerClick = useStableCallback((_, interactionType) => {\n if (!open) {\n setOpenMethod(interactionType || (\n // On iOS Safari, the hitslop around touch targets means tapping outside an element's\n // bounds does not fire `pointerdown` but does fire `mousedown`. The `interactionType`\n // will be \"\" in that case.\n isIOS ? 'touch' : ''));\n }\n });\n useValueChanged(open, previousOpen => {\n if (previousOpen && !open) {\n setOpenMethod(null);\n }\n });\n const {\n onClick,\n onPointerDown\n } = useEnhancedClickHandler(handleTriggerClick);\n return React.useMemo(() => ({\n openMethod,\n triggerProps: {\n onClick,\n onPointerDown\n }\n }), [openMethod, onClick, onPointerDown]);\n}"],"names":["useOpenInteractionType","open","openMethod","setOpenMethod","React","handleTriggerClick","useStableCallback","_","interactionType","isIOS","useValueChanged","previousOpen","onClick","onPointerDown","useEnhancedClickHandler"],"mappings":";;;;;AAaO,SAASA,EAAuBC,GAAM;AAC3C,QAAM,CAACC,GAAYC,CAAa,IAAIC,EAAM,SAAS,IAAI,GACjDC,IAAqBC,EAAkB,CAACC,GAAGC,MAAoB;AACnE,IAAKP,KACHE,EAAcK;AAAA;AAAA;AAAA,KAIdC,IAAQ,UAAU,GAAG;AAAA,EAEzB,CAAC;AACD,EAAAC,EAAgBT,GAAM,CAAAU,MAAgB;AACpC,IAAIA,KAAgB,CAACV,KACnBE,EAAc,IAAI;AAAA,EAEtB,CAAC;AACD,QAAM;AAAA,IACJ,SAAAS;AAAA,IACA,eAAAC;AAAA,EACJ,IAAMC,EAAwBT,CAAkB;AAC9C,SAAOD,EAAM,QAAQ,OAAO;AAAA,IAC1B,YAAAF;AAAA,IACA,cAAc;AAAA,MACZ,SAAAU;AAAA,MACA,eAAAC;AAAA,IACN;AAAA,EACA,IAAM,CAACX,GAAYU,GAASC,CAAa,CAAC;AAC1C;","x_google_ignoreList":[0]}
|
package/dist/index276.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
if (
|
|
8
|
-
return
|
|
1
|
+
import { clamp as s } from "./index306.js";
|
|
2
|
+
const f = 1;
|
|
3
|
+
function a(n, t) {
|
|
4
|
+
return Math.max(0, n - t);
|
|
5
|
+
}
|
|
6
|
+
function u(n, t) {
|
|
7
|
+
if (t <= 0)
|
|
8
|
+
return 0;
|
|
9
|
+
const r = s(n, 0, t), e = r, c = t - r, o = e <= f, i = c <= f;
|
|
10
|
+
return o && i ? e <= c ? 0 : t : o ? 0 : i ? t : r;
|
|
9
11
|
}
|
|
10
12
|
export {
|
|
11
|
-
|
|
13
|
+
f as SCROLL_EDGE_TOLERANCE_PX,
|
|
14
|
+
a as getMaxScrollOffset,
|
|
15
|
+
u as normalizeScrollOffset
|
|
12
16
|
};
|
|
13
17
|
//# sourceMappingURL=index276.js.map
|
package/dist/index276.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index276.js","sources":["../../../node_modules
|
|
1
|
+
{"version":3,"file":"index276.js","sources":["../../../node_modules/@base-ui/react/esm/utils/scrollEdges.js"],"sourcesContent":["import { clamp } from \"../internals/clamp.js\";\nexport const SCROLL_EDGE_TOLERANCE_PX = 1;\nexport function getMaxScrollOffset(scrollSize, clientSize) {\n return Math.max(0, scrollSize - clientSize);\n}\nexport function normalizeScrollOffset(value, max) {\n if (max <= 0) {\n return 0;\n }\n const clamped = clamp(value, 0, max);\n const startDistance = clamped;\n const endDistance = max - clamped;\n const withinStartTolerance = startDistance <= SCROLL_EDGE_TOLERANCE_PX;\n const withinEndTolerance = endDistance <= SCROLL_EDGE_TOLERANCE_PX;\n if (withinStartTolerance && withinEndTolerance) {\n return startDistance <= endDistance ? 0 : max;\n }\n if (withinStartTolerance) {\n return 0;\n }\n if (withinEndTolerance) {\n return max;\n }\n return clamped;\n}"],"names":["SCROLL_EDGE_TOLERANCE_PX","getMaxScrollOffset","scrollSize","clientSize","normalizeScrollOffset","value","max","clamped","clamp","startDistance","endDistance","withinStartTolerance","withinEndTolerance"],"mappings":";AACY,MAACA,IAA2B;AACjC,SAASC,EAAmBC,GAAYC,GAAY;AACzD,SAAO,KAAK,IAAI,GAAGD,IAAaC,CAAU;AAC5C;AACO,SAASC,EAAsBC,GAAOC,GAAK;AAChD,MAAIA,KAAO;AACT,WAAO;AAET,QAAMC,IAAUC,EAAMH,GAAO,GAAGC,CAAG,GAC7BG,IAAgBF,GAChBG,IAAcJ,IAAMC,GACpBI,IAAuBF,KAAiBT,GACxCY,IAAqBF,KAAeV;AAC1C,SAAIW,KAAwBC,IACnBH,KAAiBC,IAAc,IAAIJ,IAExCK,IACK,IAELC,IACKN,IAEFC;AACT;","x_google_ignoreList":[0]}
|
package/dist/index277.js
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return
|
|
1
|
+
import * as c from "react";
|
|
2
|
+
import { s as u } from "./index404.js";
|
|
3
|
+
import { w as i } from "./index405.js";
|
|
4
|
+
import { isReactVersionAtLeast as S } from "./index354.js";
|
|
5
|
+
const a = S(19), m = a ? f : l;
|
|
6
|
+
function g(t, e, r, n, o) {
|
|
7
|
+
return m(t, e, r, n, o);
|
|
8
|
+
}
|
|
9
|
+
function p(t, e, r, n, o) {
|
|
10
|
+
const s = c.useCallback(() => e(t.getSnapshot(), r, n, o), [t, e, r, n, o]);
|
|
11
|
+
return u.useSyncExternalStore(t.subscribe, s, s);
|
|
12
|
+
}
|
|
13
|
+
function f(t, e, r, n, o) {
|
|
14
|
+
return p(t, e, r, n, o);
|
|
15
|
+
}
|
|
16
|
+
function l(t, e, r, n, o) {
|
|
17
|
+
return i.useSyncExternalStoreWithSelector(t.subscribe, t.getSnapshot, t.getSnapshot, (s) => e(s, r, n, o));
|
|
8
18
|
}
|
|
9
19
|
export {
|
|
10
|
-
|
|
20
|
+
g as useStore
|
|
11
21
|
};
|
|
12
22
|
//# sourceMappingURL=index277.js.map
|
package/dist/index277.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index277.js","sources":["../../../node_modules
|
|
1
|
+
{"version":3,"file":"index277.js","sources":["../../../node_modules/@base-ui/utils/esm/store/useStore.js"],"sourcesContent":["import * as React from 'react';\n/* We need to import the shim because React 17 does not support the `useSyncExternalStore` API.\n * More info: https://github.com/mui/mui-x/issues/18303#issuecomment-2958392341 */\nimport { useSyncExternalStore } from 'use-sync-external-store/shim';\nimport { useSyncExternalStoreWithSelector } from 'use-sync-external-store/shim/with-selector';\nimport { isReactVersionAtLeast } from \"../reactVersion.js\";\nimport { register, getInstance } from \"../fastHooks.js\";\n/* Some tests fail in R18 with the raw useSyncExternalStore. It may be possible to make it work\n * but for now we only enable it for R19+. */\nconst canUseRawUseSyncExternalStore = isReactVersionAtLeast(19);\nconst useStoreImplementation = canUseRawUseSyncExternalStore ? useStoreFast : useStoreLegacy;\nexport function useStore(store, selector, a1, a2, a3) {\n return useStoreImplementation(store, selector, a1, a2, a3);\n}\nfunction useStoreR19(store, selector, a1, a2, a3) {\n const getSelection = React.useCallback(() => selector(store.getSnapshot(), a1, a2, a3), [store, selector, a1, a2, a3]);\n return useSyncExternalStore(store.subscribe, getSelection, getSelection);\n}\nregister({\n before(instance) {\n instance.syncIndex = 0;\n if (!instance.didInitialize) {\n instance.syncTick = 1;\n instance.syncHooks = [];\n instance.didChangeStore = true;\n instance.getSnapshot = () => {\n let didChange = false;\n for (let i = 0; i < instance.syncHooks.length; i += 1) {\n const hook = instance.syncHooks[i];\n const value = hook.selector(hook.store.state, hook.a1, hook.a2, hook.a3);\n if (hook.didChange || !Object.is(hook.value, value)) {\n didChange = true;\n hook.value = value;\n hook.didChange = false;\n }\n }\n if (didChange) {\n instance.syncTick += 1;\n }\n return instance.syncTick;\n };\n }\n },\n after(instance) {\n if (instance.syncHooks.length > 0) {\n if (instance.didChangeStore) {\n instance.didChangeStore = false;\n instance.subscribe = onStoreChange => {\n const stores = new Set();\n for (const hook of instance.syncHooks) {\n stores.add(hook.store);\n }\n const unsubscribes = [];\n for (const store of stores) {\n unsubscribes.push(store.subscribe(onStoreChange));\n }\n return () => {\n for (const unsubscribe of unsubscribes) {\n unsubscribe();\n }\n };\n };\n }\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useSyncExternalStore(instance.subscribe, instance.getSnapshot, instance.getSnapshot);\n }\n }\n});\nfunction useStoreFast(store, selector, a1, a2, a3) {\n const instance = getInstance();\n if (!instance) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useStoreR19(store, selector, a1, a2, a3);\n }\n const index = instance.syncIndex;\n instance.syncIndex += 1;\n let hook;\n if (!instance.didInitialize) {\n hook = {\n store,\n selector,\n a1,\n a2,\n a3,\n value: selector(store.getSnapshot(), a1, a2, a3),\n didChange: false\n };\n instance.syncHooks.push(hook);\n } else {\n hook = instance.syncHooks[index];\n if (hook.store !== store || hook.selector !== selector || !Object.is(hook.a1, a1) || !Object.is(hook.a2, a2) || !Object.is(hook.a3, a3)) {\n if (hook.store !== store) {\n instance.didChangeStore = true;\n }\n hook.store = store;\n hook.selector = selector;\n hook.a1 = a1;\n hook.a2 = a2;\n hook.a3 = a3;\n hook.didChange = true;\n }\n }\n return hook.value;\n}\nfunction useStoreLegacy(store, selector, a1, a2, a3) {\n return useSyncExternalStoreWithSelector(store.subscribe, store.getSnapshot, store.getSnapshot, state => selector(state, a1, a2, a3));\n}"],"names":["canUseRawUseSyncExternalStore","isReactVersionAtLeast","useStoreImplementation","useStoreFast","useStoreLegacy","useStore","store","selector","a1","a2","a3","useStoreR19","getSelection","React","useSyncExternalStore","useSyncExternalStoreWithSelector","state"],"mappings":";;;;AASA,MAAMA,IAAgCC,EAAsB,EAAE,GACxDC,IAAyBF,IAAgCG,IAAeC;AACvE,SAASC,EAASC,GAAOC,GAAUC,GAAIC,GAAIC,GAAI;AACpD,SAAOR,EAAuBI,GAAOC,GAAUC,GAAIC,GAAIC,CAAE;AAC3D;AACA,SAASC,EAAYL,GAAOC,GAAUC,GAAIC,GAAIC,GAAI;AAChD,QAAME,IAAeC,EAAM,YAAY,MAAMN,EAASD,EAAM,eAAeE,GAAIC,GAAIC,CAAE,GAAG,CAACJ,GAAOC,GAAUC,GAAIC,GAAIC,CAAE,CAAC;AACrH,SAAOI,EAAAA,qBAAqBR,EAAM,WAAWM,GAAcA,CAAY;AACzE;AAmDA,SAAST,EAAaG,GAAOC,GAAUC,GAAIC,GAAIC,GAAI;AAI/C,SAAOC,EAAYL,GAAOC,GAAUC,GAAIC,GAAIC,CAAE;AA+BlD;AACA,SAASN,EAAeE,GAAOC,GAAUC,GAAIC,GAAIC,GAAI;AACnD,SAAOK,EAAAA,iCAAiCT,EAAM,WAAWA,EAAM,aAAaA,EAAM,aAAa,CAAAU,MAAST,EAASS,GAAOR,GAAIC,GAAIC,CAAE,CAAC;AACrI;","x_google_ignoreList":[0]}
|
package/dist/index278.js
CHANGED
|
@@ -1,23 +1,40 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { isElement as l } from "./index309.js";
|
|
2
|
+
import { useId as c } from "./index342.js";
|
|
3
|
+
import { useRefWithInit as a } from "./index258.js";
|
|
4
|
+
import { useIsoLayoutEffect as m } from "./index261.js";
|
|
5
|
+
import { useFloatingParentNodeId as u } from "./index382.js";
|
|
6
|
+
import { FloatingRootStore as p } from "./index384.js";
|
|
7
|
+
import { PopupTriggerMap as d } from "./index351.js";
|
|
8
|
+
function y(s) {
|
|
9
|
+
const {
|
|
10
|
+
open: o = !1,
|
|
11
|
+
onOpenChange: f,
|
|
12
|
+
elements: e = {}
|
|
13
|
+
} = s, r = c(), i = u() != null;
|
|
14
|
+
if (process.env.NODE_ENV !== "production") {
|
|
15
|
+
const n = e.reference;
|
|
16
|
+
n && !l(n) && console.error("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `context.setPositionReference()`", "instead.");
|
|
15
17
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
const t = a(() => new p({
|
|
19
|
+
open: o,
|
|
20
|
+
transitionStatus: void 0,
|
|
21
|
+
onOpenChange: f,
|
|
22
|
+
referenceElement: e.reference ?? null,
|
|
23
|
+
floatingElement: e.floating ?? null,
|
|
24
|
+
triggerElements: new d(),
|
|
25
|
+
floatingId: r,
|
|
26
|
+
syncOnly: !1,
|
|
27
|
+
nested: i
|
|
28
|
+
})).current;
|
|
29
|
+
return m(() => {
|
|
30
|
+
const n = {
|
|
31
|
+
open: o,
|
|
32
|
+
floatingId: r
|
|
33
|
+
};
|
|
34
|
+
e.reference !== void 0 && (n.referenceElement = e.reference, n.domReferenceElement = l(e.reference) ? e.reference : null), e.floating !== void 0 && (n.floatingElement = e.floating), t.update(n);
|
|
35
|
+
}, [o, r, e.reference, e.floating, t]), t.context.onOpenChange = f, t.context.nested = i, t;
|
|
19
36
|
}
|
|
20
37
|
export {
|
|
21
|
-
|
|
38
|
+
y as useFloatingRootContext
|
|
22
39
|
};
|
|
23
40
|
//# sourceMappingURL=index278.js.map
|
package/dist/index278.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index278.js","sources":["../../../node_modules/
|
|
1
|
+
{"version":3,"file":"index278.js","sources":["../../../node_modules/@base-ui/react/esm/floating-ui-react/hooks/useFloatingRootContext.js"],"sourcesContent":["'use client';\n\nimport { isElement } from '@floating-ui/utils/dom';\nimport { useId } from '@base-ui/utils/useId';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useFloatingParentNodeId } from \"../components/FloatingTree.js\";\nimport { FloatingRootStore } from \"../components/FloatingRootStore.js\";\nimport { PopupTriggerMap } from \"../../utils/popups/index.js\";\nexport function useFloatingRootContext(options) {\n const {\n open = false,\n onOpenChange,\n elements = {}\n } = options;\n const floatingId = useId();\n const nested = useFloatingParentNodeId() != null;\n if (process.env.NODE_ENV !== 'production') {\n const optionDomReference = elements.reference;\n if (optionDomReference && !isElement(optionDomReference)) {\n console.error('Cannot pass a virtual element to the `elements.reference` option,', 'as it must be a real DOM element. Use `context.setPositionReference()`', 'instead.');\n }\n }\n const store = useRefWithInit(() => new FloatingRootStore({\n open,\n transitionStatus: undefined,\n onOpenChange,\n referenceElement: elements.reference ?? null,\n floatingElement: elements.floating ?? null,\n triggerElements: new PopupTriggerMap(),\n floatingId,\n syncOnly: false,\n nested\n })).current;\n useIsoLayoutEffect(() => {\n const valuesToSync = {\n open,\n floatingId\n };\n\n // Only sync elements that are defined to avoid overwriting existing ones\n if (elements.reference !== undefined) {\n valuesToSync.referenceElement = elements.reference;\n valuesToSync.domReferenceElement = isElement(elements.reference) ? elements.reference : null;\n }\n if (elements.floating !== undefined) {\n valuesToSync.floatingElement = elements.floating;\n }\n store.update(valuesToSync);\n }, [open, floatingId, elements.reference, elements.floating, store]);\n store.context.onOpenChange = onOpenChange;\n store.context.nested = nested;\n return store;\n}"],"names":["useFloatingRootContext","options","open","onOpenChange","elements","floatingId","useId","nested","useFloatingParentNodeId","optionDomReference","isElement","store","useRefWithInit","FloatingRootStore","PopupTriggerMap","useIsoLayoutEffect","valuesToSync"],"mappings":";;;;;;;AASO,SAASA,EAAuBC,GAAS;AAC9C,QAAM;AAAA,IACJ,MAAAC,IAAO;AAAA,IACP,cAAAC;AAAA,IACA,UAAAC,IAAW,CAAA;AAAA,EACf,IAAMH,GACEI,IAAaC,EAAK,GAClBC,IAASC,EAAuB,KAAM;AAC5C,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,UAAMC,IAAqBL,EAAS;AACpC,IAAIK,KAAsB,CAACC,EAAUD,CAAkB,KACrD,QAAQ,MAAM,qEAAqE,0EAA0E,UAAU;AAAA,EAE3K;AACA,QAAME,IAAQC,EAAe,MAAM,IAAIC,EAAkB;AAAA,IACvD,MAAAX;AAAA,IACA,kBAAkB;AAAA,IAClB,cAAAC;AAAA,IACA,kBAAkBC,EAAS,aAAa;AAAA,IACxC,iBAAiBA,EAAS,YAAY;AAAA,IACtC,iBAAiB,IAAIU,EAAe;AAAA,IACpC,YAAAT;AAAA,IACA,UAAU;AAAA,IACV,QAAAE;AAAA,EACJ,CAAG,CAAC,EAAE;AACJ,SAAAQ,EAAmB,MAAM;AACvB,UAAMC,IAAe;AAAA,MACnB,MAAAd;AAAA,MACA,YAAAG;AAAA,IACN;AAGI,IAAID,EAAS,cAAc,WACzBY,EAAa,mBAAmBZ,EAAS,WACzCY,EAAa,sBAAsBN,EAAUN,EAAS,SAAS,IAAIA,EAAS,YAAY,OAEtFA,EAAS,aAAa,WACxBY,EAAa,kBAAkBZ,EAAS,WAE1CO,EAAM,OAAOK,CAAY;AAAA,EAC3B,GAAG,CAACd,GAAMG,GAAYD,EAAS,WAAWA,EAAS,UAAUO,CAAK,CAAC,GACnEA,EAAM,QAAQ,eAAeR,GAC7BQ,EAAM,QAAQ,SAASJ,GAChBI;AACT;","x_google_ignoreList":[0]}
|