@rpcbase/ui 0.245.0 → 0.246.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/index149.js +5 -14
- package/dist/index149.js.map +1 -1
- package/dist/index150.js +63 -63
- package/dist/index150.js.map +1 -1
- package/dist/index151.js +2 -38
- package/dist/index151.js.map +1 -1
- package/dist/index152.js +385 -13
- package/dist/index152.js.map +1 -1
- package/dist/index153.js +261 -23
- package/dist/index153.js.map +1 -1
- package/dist/index154.js +58 -109
- package/dist/index154.js.map +1 -1
- package/dist/index155.js +47 -13
- package/dist/index155.js.map +1 -1
- package/dist/index156.js +169 -4
- package/dist/index156.js.map +1 -1
- package/dist/index157.js +110 -4
- package/dist/index157.js.map +1 -1
- package/dist/index158.js +25 -5
- package/dist/index158.js.map +1 -1
- package/dist/index159.js +8 -12
- package/dist/index159.js.map +1 -1
- package/dist/index160.js +4 -19
- package/dist/index160.js.map +1 -1
- package/dist/index161.js +6 -11
- package/dist/index161.js.map +1 -1
- package/dist/index162.js +4 -176
- package/dist/index162.js.map +1 -1
- package/dist/index163.js +476 -268
- package/dist/index163.js.map +1 -1
- package/dist/index164.js +189 -4
- package/dist/index164.js.map +1 -1
- package/dist/index165.js +14 -28
- package/dist/index165.js.map +1 -1
- package/dist/index166.js +105 -124
- package/dist/index166.js.map +1 -1
- package/dist/index167.js +262 -63
- package/dist/index167.js.map +1 -1
- package/dist/index168.js +6 -8
- package/dist/index168.js.map +1 -1
- package/dist/index169.js +40 -15
- package/dist/index169.js.map +1 -1
- package/dist/index170.js +4 -30
- package/dist/index170.js.map +1 -1
- package/dist/index171.js +14 -69
- package/dist/index171.js.map +1 -1
- package/dist/index172.js +68 -5
- package/dist/index172.js.map +1 -1
- package/dist/index173.js +35 -66
- package/dist/index173.js.map +1 -1
- package/dist/index174.js +14 -2
- package/dist/index174.js.map +1 -1
- package/dist/index175.js +22 -384
- package/dist/index175.js.map +1 -1
- package/dist/index176.js +108 -258
- package/dist/index176.js.map +1 -1
- package/dist/index177.js +13 -61
- package/dist/index177.js.map +1 -1
- package/dist/index178.js +4 -46
- package/dist/index178.js.map +1 -1
- package/dist/index179.js +4 -170
- package/dist/index179.js.map +1 -1
- package/dist/index180.js +5 -110
- package/dist/index180.js.map +1 -1
- package/dist/index181.js +11 -24
- package/dist/index181.js.map +1 -1
- package/dist/index182.js +20 -8
- package/dist/index182.js.map +1 -1
- package/dist/index183.js +11 -5
- package/dist/index183.js.map +1 -1
- package/dist/index184.js +176 -5
- package/dist/index184.js.map +1 -1
- package/dist/index185.js +279 -4
- package/dist/index185.js.map +1 -1
- package/dist/index186.js +4 -487
- package/dist/index186.js.map +1 -1
- package/dist/index187.js +27 -189
- package/dist/index187.js.map +1 -1
- package/dist/index188.js +126 -13
- package/dist/index188.js.map +1 -1
- package/dist/index189.js +63 -107
- package/dist/index189.js.map +1 -1
- package/dist/index190.js +8 -262
- package/dist/index190.js.map +1 -1
- package/dist/index191.js +16 -7
- package/dist/index191.js.map +1 -1
- package/dist/index192.js +29 -39
- package/dist/index192.js.map +1 -1
- package/dist/index193.js +69 -4
- package/dist/index193.js.map +1 -1
- package/dist/index254.js +20 -67
- package/dist/index254.js.map +1 -1
- package/dist/index255.js +66 -8
- package/dist/index255.js.map +1 -1
- package/dist/index256.js +6 -11
- package/dist/index256.js.map +1 -1
- package/dist/index257.js +5 -8
- package/dist/index257.js.map +1 -1
- package/dist/index258.js +11 -5
- package/dist/index258.js.map +1 -1
- package/dist/index259.js +3 -13
- package/dist/index259.js.map +1 -1
- package/dist/index260.js +50 -3
- package/dist/index260.js.map +1 -1
- package/dist/index261.js +4 -4
- package/dist/index261.js.map +1 -1
- package/dist/index262.js +27 -97
- package/dist/index262.js.map +1 -1
- package/dist/index263.js +15 -16
- package/dist/index263.js.map +1 -1
- package/dist/index264.js +5 -29
- package/dist/index264.js.map +1 -1
- package/dist/index265.js +21 -51
- package/dist/index265.js.map +1 -1
- package/dist/index266.js +53 -5
- package/dist/index266.js.map +1 -1
- package/dist/index267.js +20 -5
- package/dist/index267.js.map +1 -1
- package/dist/index268.js +39 -59
- package/dist/index268.js.map +1 -1
- package/dist/index269.js +36 -63
- package/dist/index269.js.map +1 -1
- package/dist/index270.js +46 -134
- package/dist/index270.js.map +1 -1
- package/dist/index271.js +19 -7
- package/dist/index271.js.map +1 -1
- package/dist/index272.js +71 -5
- package/dist/index272.js.map +1 -1
- package/dist/index273.js +18 -4
- package/dist/index273.js.map +1 -1
- package/dist/index274.js +3 -11
- package/dist/index274.js.map +1 -1
- package/dist/index275.js +11 -21
- package/dist/index275.js.map +1 -1
- package/dist/index276.js +13 -16
- package/dist/index276.js.map +1 -1
- package/dist/index277.js +17 -10
- package/dist/index277.js.map +1 -1
- package/dist/index278.js +37 -8
- package/dist/index278.js.map +1 -1
- package/dist/index279.js +237 -142
- package/dist/index279.js.map +1 -1
- package/dist/index28.js +1 -1
- package/dist/index280.js +249 -76
- package/dist/index280.js.map +1 -1
- package/dist/index281.js +68 -61
- package/dist/index281.js.map +1 -1
- package/dist/index282.js +100 -15
- package/dist/index282.js.map +1 -1
- package/dist/index283.js +84 -20
- package/dist/index283.js.map +1 -1
- package/dist/index284.js +3 -6
- package/dist/index284.js.map +1 -1
- package/dist/index285.js +29 -11
- package/dist/index285.js.map +1 -1
- package/dist/index286.js +16 -3
- package/dist/index286.js.map +1 -1
- package/dist/index287.js +34 -50
- package/dist/index287.js.map +1 -1
- package/dist/index288.js +16 -15
- package/dist/index288.js.map +1 -1
- package/dist/index289.js +3 -21
- package/dist/index289.js.map +1 -1
- package/dist/index29.js +1 -1
- package/dist/index290.js +26 -53
- package/dist/index290.js.map +1 -1
- package/dist/index291.js +28 -20
- package/dist/index291.js.map +1 -1
- package/dist/index292.js +4 -42
- package/dist/index292.js.map +1 -1
- package/dist/index293.js +73 -34
- package/dist/index293.js.map +1 -1
- package/dist/index294.js +273 -46
- package/dist/index294.js.map +1 -1
- package/dist/index295.js +11 -20
- package/dist/index295.js.map +1 -1
- package/dist/index296.js +11 -71
- package/dist/index296.js.map +1 -1
- package/dist/index297.js +25 -17
- package/dist/index297.js.map +1 -1
- package/dist/index298.js +16 -3
- package/dist/index298.js.map +1 -1
- package/dist/index299.js +124 -12
- package/dist/index299.js.map +1 -1
- package/dist/index300.js +5 -18
- package/dist/index300.js.map +1 -1
- package/dist/index301.js +64 -35
- package/dist/index301.js.map +1 -1
- package/dist/index302.js +14 -240
- package/dist/index302.js.map +1 -1
- package/dist/index303.js +7 -252
- package/dist/index303.js.map +1 -1
- package/dist/index304.js +5 -68
- package/dist/index304.js.map +1 -1
- package/dist/index305.js +3 -83
- package/dist/index305.js.map +1 -1
- package/dist/index306.js +10 -3
- package/dist/index306.js.map +1 -1
- package/dist/index307.js +7 -29
- package/dist/index307.js.map +1 -1
- package/dist/index308.js +133 -16
- package/dist/index308.js.map +1 -1
- package/dist/index309.js +397 -32
- package/dist/index309.js.map +1 -1
- package/dist/index310.js +5 -18
- package/dist/index310.js.map +1 -1
- package/dist/index311.js +52 -3
- package/dist/index311.js.map +1 -1
- package/dist/index312.js +11 -26
- package/dist/index312.js.map +1 -1
- package/dist/index313.js +25 -26
- package/dist/index313.js.map +1 -1
- package/dist/index314.js +12 -4
- package/dist/index314.js.map +1 -1
- package/dist/index315.js +151 -75
- package/dist/index315.js.map +1 -1
- package/dist/index316.js +30 -270
- package/dist/index316.js.map +1 -1
- package/dist/index317.js +11 -11
- package/dist/index317.js.map +1 -1
- package/dist/index318.js +50 -11
- package/dist/index318.js.map +1 -1
- package/dist/index319.js +8 -24
- package/dist/index319.js.map +1 -1
- package/dist/index320.js +11 -16
- package/dist/index320.js.map +1 -1
- package/dist/index321.js +42 -124
- package/dist/index321.js.map +1 -1
- package/dist/index322.js +97 -5
- package/dist/index322.js.map +1 -1
- package/dist/index323.js +82 -61
- package/dist/index323.js.map +1 -1
- package/dist/index324.js +104 -12
- package/dist/index324.js.map +1 -1
- package/dist/index325.js +52 -7
- package/dist/index325.js.map +1 -1
- package/dist/index326.js +11 -5
- package/dist/index326.js.map +1 -1
- package/dist/index327.js +4 -3
- package/dist/index327.js.map +1 -1
- package/dist/index328.js +37 -10
- package/dist/index328.js.map +1 -1
- package/dist/index329.js +8 -7
- package/dist/index329.js.map +1 -1
- package/dist/index33.js +2 -2
- package/dist/index330.js +121 -385
- package/dist/index330.js.map +1 -1
- package/dist/index331.js +18 -5
- package/dist/index331.js.map +1 -1
- package/dist/index332.js +14 -51
- package/dist/index332.js.map +1 -1
- package/dist/index333.js +3 -11
- package/dist/index333.js.map +1 -1
- package/dist/index334.js +34 -25
- package/dist/index334.js.map +1 -1
- package/dist/index335.js +20 -11
- package/dist/index335.js.map +1 -1
- package/dist/index336.js +9 -154
- package/dist/index336.js.map +1 -1
- package/dist/index337.js +8 -32
- package/dist/index337.js.map +1 -1
- package/dist/index338.js +24 -11
- package/dist/index338.js.map +1 -1
- package/dist/index339.js +25 -46
- package/dist/index339.js.map +1 -1
- package/dist/index34.js +5 -5
- package/dist/index340.js +16 -9
- package/dist/index340.js.map +1 -1
- package/dist/index341.js +8 -11
- package/dist/index341.js.map +1 -1
- package/dist/index342.js +11 -43
- package/dist/index342.js.map +1 -1
- package/dist/index343.js +7 -96
- package/dist/index343.js.map +1 -1
- package/dist/index344.js +11 -84
- package/dist/index344.js.map +1 -1
- package/dist/index345.js +3 -105
- package/dist/index345.js.map +1 -1
- package/dist/index346.js +3 -52
- package/dist/index346.js.map +1 -1
- package/dist/index347.js +16 -10
- package/dist/index347.js.map +1 -1
- package/dist/index348.js +51 -4
- package/dist/index348.js.map +1 -1
- package/dist/index349.js +5 -37
- package/dist/index349.js.map +1 -1
- package/dist/index35.js +11 -11
- package/dist/index350.js +61 -8
- package/dist/index350.js.map +1 -1
- package/dist/index351.js +61 -130
- package/dist/index351.js.map +1 -1
- package/dist/index352.js +8 -17
- package/dist/index352.js.map +1 -1
- package/dist/index353.js +5 -16
- package/dist/index353.js.map +1 -1
- package/dist/index354.js +11 -3
- package/dist/index354.js.map +1 -1
- package/dist/index355.js +19 -34
- package/dist/index355.js.map +1 -1
- package/dist/index356.js +16 -20
- package/dist/index356.js.map +1 -1
- package/dist/index357.js +8 -10
- package/dist/index357.js.map +1 -1
- package/dist/index358.js +144 -8
- package/dist/index358.js.map +1 -1
- package/dist/index359.js +77 -22
- package/dist/index359.js.map +1 -1
- package/dist/index36.js +3 -3
- package/dist/index360.js +61 -28
- package/dist/index360.js.map +1 -1
- package/dist/index361.js +15 -17
- package/dist/index361.js.map +1 -1
- package/dist/index365.js +11 -8
- package/dist/index365.js.map +1 -1
- package/dist/index366.js +4 -27
- package/dist/index366.js.map +1 -1
- package/dist/index367.js +5 -137
- package/dist/index367.js.map +1 -1
- package/dist/index368.js +3 -13
- package/dist/index368.js.map +1 -1
- package/dist/index369.js +20 -46
- package/dist/index369.js.map +1 -1
- package/dist/index37.js +4 -4
- package/dist/index370.js +45 -4
- package/dist/index370.js.map +1 -1
- package/dist/index371.js +17 -21
- package/dist/index371.js.map +1 -1
- package/dist/index372.js +4 -75
- package/dist/index372.js.map +1 -1
- package/dist/index373.js +200 -11
- package/dist/index373.js.map +1 -1
- package/dist/index374.js +73 -3
- package/dist/index374.js.map +1 -1
- package/dist/index375.js +122 -72
- package/dist/index375.js.map +1 -1
- package/dist/index376.js +4 -200
- package/dist/index376.js.map +1 -1
- package/dist/index377.js +20 -71
- package/dist/index377.js.map +1 -1
- package/dist/index378.js +8 -35
- package/dist/index378.js.map +1 -1
- package/dist/index379.js +27 -7
- package/dist/index379.js.map +1 -1
- package/dist/index38.js +5 -5
- package/dist/index380.js +136 -14
- package/dist/index380.js.map +1 -1
- package/dist/index381.js +10 -121
- package/dist/index381.js.map +1 -1
- package/dist/index382.js +47 -4
- package/dist/index382.js.map +1 -1
- package/dist/index383.js +3 -11
- package/dist/index383.js.map +1 -1
- package/dist/index384.js +21 -5
- package/dist/index384.js.map +1 -1
- package/dist/index385.js +76 -3
- package/dist/index385.js.map +1 -1
- package/dist/index386.js +12 -21
- package/dist/index386.js.map +1 -1
- package/dist/index387.js +4 -45
- package/dist/index387.js.map +1 -1
- package/dist/index388.js +70 -16
- package/dist/index388.js.map +1 -1
- package/dist/index389.js +36 -5
- package/dist/index389.js.map +1 -1
- package/dist/index39.js +3 -3
- package/dist/index390.js +7 -5
- package/dist/index390.js.map +1 -1
- package/dist/index391.js +15 -20
- package/dist/index391.js.map +1 -1
- package/dist/index40.js +10 -10
- package/dist/index409.js +3 -3
- package/dist/index409.js.map +1 -1
- package/dist/index410.js +3 -15
- package/dist/index410.js.map +1 -1
- package/dist/index411.js +3 -492
- package/dist/index411.js.map +1 -1
- package/dist/index412.js +15 -3
- package/dist/index412.js.map +1 -1
- package/dist/index413.js +492 -3
- package/dist/index413.js.map +1 -1
- package/dist/index417.js +1 -1
- package/dist/index419.js +1 -1
- package/dist/index420.js +2 -2
- package/dist/index421.js +7 -32
- package/dist/index421.js.map +1 -1
- package/dist/index422.js +2 -8
- package/dist/index422.js.map +1 -1
- package/dist/index423.js +44 -2
- package/dist/index423.js.map +1 -1
- package/dist/index424.js +52 -40
- package/dist/index424.js.map +1 -1
- package/dist/index425.js +7 -55
- package/dist/index425.js.map +1 -1
- package/dist/index426.js +2 -8
- package/dist/index426.js.map +1 -1
- package/dist/index427.js +55 -2
- package/dist/index427.js.map +1 -1
- package/dist/index428.js +53 -52
- package/dist/index428.js.map +1 -1
- package/dist/index429.js +32 -55
- package/dist/index429.js.map +1 -1
- package/dist/index430.js +2 -16
- package/dist/index430.js.map +1 -1
- package/dist/index431.js +2 -29
- package/dist/index431.js.map +1 -1
- package/dist/index432.js +2 -13
- package/dist/index432.js.map +1 -1
- package/dist/index433.js +2 -7
- package/dist/index433.js.map +1 -1
- package/dist/index434.js +16 -2
- package/dist/index434.js.map +1 -1
- package/dist/index435.js +29 -2
- package/dist/index435.js.map +1 -1
- package/dist/index436.js +13 -2
- package/dist/index436.js.map +1 -1
- package/dist/index437.js +7 -2
- package/dist/index437.js.map +1 -1
- package/dist/index47.js +2 -2
- package/dist/index48.js +36 -36
- package/dist/index49.js +29 -29
- package/dist/index50.js +2 -2
- package/dist/index51.js +12 -12
- package/dist/index52.js +4 -4
- package/dist/index53.js +1 -1
- package/dist/index54.js +21 -21
- package/dist/index55.js +5 -5
- package/dist/index56.js +5 -5
- package/dist/index57.js +8 -8
- package/dist/index58.js +5 -5
- package/dist/index59.js +17 -17
- package/dist/index60.js +5 -5
- package/dist/index61.js +3 -3
- package/dist/index64.js +5 -5
- package/dist/index64.js.map +1 -1
- package/dist/index66.js +10 -22
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +17 -232
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +5 -5
- package/dist/index68.js.map +1 -1
- package/dist/index70.js +22 -10
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +232 -17
- package/dist/index71.js.map +1 -1
- package/dist/index76.js +1 -1
- package/dist/index77.js +2 -2
- package/dist/index78.js +2 -2
- package/package.json +1 -1
package/dist/index302.js
CHANGED
|
@@ -1,243 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
import { getTarget as z, contains as B } from "./index313.js";
|
|
15
|
-
import { triggerPress as qe, escapeKey as Ve, outsidePress as Ue } from "./index155.js";
|
|
16
|
-
import { webkit as je } from "./index331.js";
|
|
17
|
-
function Ge() {
|
|
18
|
-
return !1;
|
|
19
|
-
}
|
|
20
|
-
function Je(f) {
|
|
21
|
-
return {
|
|
22
|
-
escapeKey: typeof f == "boolean" ? f : f?.escapeKey ?? !1,
|
|
23
|
-
outsidePress: typeof f == "boolean" ? f : f?.outsidePress ?? !0
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
function dt(f, he = {}) {
|
|
27
|
-
const {
|
|
28
|
-
enabled: m = !0,
|
|
29
|
-
escapeKey: v = !0,
|
|
30
|
-
outsidePress: I = !0,
|
|
31
|
-
outsidePressEvent: ge = "sloppy",
|
|
32
|
-
referencePress: ye = Ge,
|
|
33
|
-
bubbles: Pe,
|
|
34
|
-
externalTree: Ee
|
|
35
|
-
} = he, n = "rootStore" in f ? f.rootStore : f, C = n.useState("open"), ee = n.useState("floatingElement"), {
|
|
36
|
-
dataRef: h
|
|
37
|
-
} = n.context, S = Ne(Ee), Te = p(typeof I == "function" ? I : () => !1), y = typeof I == "function" ? Te : I, te = y !== !1, re = p(() => ge), {
|
|
38
|
-
escapeKey: K,
|
|
39
|
-
outsidePress: ne
|
|
40
|
-
} = Je(Pe), O = l.useRef(!1), X = l.useRef(!1), P = l.useRef(!1), A = l.useRef(!1), H = l.useRef(""), s = l.useRef(null), D = de(), se = de(), g = p(() => {
|
|
41
|
-
se.clear(), h.current.insideReactTree = !1;
|
|
42
|
-
}), N = p((r) => {
|
|
43
|
-
const a = h.current.floatingContext?.nodeId;
|
|
44
|
-
return (S ? me(S.nodesRef.current, a) : []).some((x) => x.context?.open && !x.context.dataRef.current[r]);
|
|
45
|
-
}), E = p((r) => Z(r, n.select("floatingElement")) || Z(r, n.select("domReferenceElement"))), L = p((r) => {
|
|
46
|
-
ye() && n.setOpen(!1, Q(qe, r.nativeEvent));
|
|
47
|
-
}), b = p((r) => {
|
|
48
|
-
if (!C || !m || !v || r.key !== "Escape" || A.current || !K && N("__escapeKeyBubbles"))
|
|
49
|
-
return;
|
|
50
|
-
const a = $e(r) ? r.nativeEvent : r, w = Q(Ve, a);
|
|
51
|
-
n.setOpen(!1, w), w.isCanceled || r.preventDefault(), !K && !w.isPropagationAllowed && r.stopPropagation();
|
|
52
|
-
}), T = p(() => {
|
|
53
|
-
h.current.insideReactTree = !0, se.start(0, g);
|
|
54
|
-
}), F = p((r) => {
|
|
55
|
-
if (!C || !m || r.button !== 0)
|
|
56
|
-
return;
|
|
57
|
-
const a = z(r.nativeEvent);
|
|
58
|
-
B(n.select("floatingElement"), a) && (O.current || (O.current = !0, X.current = !1));
|
|
59
|
-
}), $ = p((r) => {
|
|
60
|
-
!C || !m || (r.defaultPrevented || r.nativeEvent.defaultPrevented) && O.current && (X.current = !0);
|
|
61
|
-
});
|
|
62
|
-
l.useEffect(() => {
|
|
63
|
-
if (!C || !m)
|
|
64
|
-
return;
|
|
65
|
-
h.current.__escapeKeyBubbles = K, h.current.__outsidePressBubbles = ne;
|
|
66
|
-
const r = new pe(), a = new pe();
|
|
67
|
-
function w() {
|
|
68
|
-
r.clear(), A.current = !0;
|
|
69
|
-
}
|
|
70
|
-
function x() {
|
|
71
|
-
r.start(
|
|
72
|
-
// 0ms or 1ms don't work in Safari. 5ms appears to consistently work.
|
|
73
|
-
// Only apply to WebKit for the test to remain 0ms.
|
|
74
|
-
je ? 5 : 0,
|
|
75
|
-
() => {
|
|
76
|
-
A.current = !1;
|
|
77
|
-
}
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
function ce() {
|
|
81
|
-
P.current = !0, a.start(0, () => {
|
|
82
|
-
P.current = !1;
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
function ie() {
|
|
86
|
-
O.current = !1, X.current = !1;
|
|
87
|
-
}
|
|
88
|
-
function R() {
|
|
89
|
-
const e = H.current, t = e === "pen" || !e ? "mouse" : e, o = re(), c = typeof o == "function" ? o() : o;
|
|
90
|
-
return typeof c == "string" ? c : c[t];
|
|
91
|
-
}
|
|
92
|
-
function Re(e) {
|
|
93
|
-
const t = R();
|
|
94
|
-
return t === "intentional" && e.type !== "click" || t === "sloppy" && e.type === "click";
|
|
95
|
-
}
|
|
96
|
-
function ue(e) {
|
|
97
|
-
const t = h.current.floatingContext?.nodeId, o = S && me(S.nodesRef.current, t).some((c) => Z(e, c.context?.elements.floating));
|
|
98
|
-
return E(e) || o;
|
|
99
|
-
}
|
|
100
|
-
function W(e) {
|
|
101
|
-
if (Re(e)) {
|
|
102
|
-
e.type !== "click" && !E(e) && (a.clear(), P.current = !1), g();
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
if (h.current.insideReactTree) {
|
|
106
|
-
g();
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
const t = z(e), o = `[${Le("inert")}]`, c = _(t) ? t.getRootNode() : null, k = Array.from((Be(c) ? c : fe(n.select("floatingElement"))).querySelectorAll(o)), ae = n.context.triggerElements;
|
|
110
|
-
if (t && (ae.hasElement(t) || ae.hasMatchingElement((d) => B(d, t))))
|
|
111
|
-
return;
|
|
112
|
-
let M = _(t) ? t : null;
|
|
113
|
-
for (; M && !J(M); ) {
|
|
114
|
-
const d = ve(M);
|
|
115
|
-
if (J(d) || !_(d))
|
|
116
|
-
break;
|
|
117
|
-
M = d;
|
|
118
|
-
}
|
|
119
|
-
if (!(k.length && _(t) && !Fe(t) && // Clicked on a direct ancestor (e.g. FloatingOverlay).
|
|
120
|
-
!B(t, n.select("floatingElement")) && // If the target root element contains none of the markers, then the
|
|
121
|
-
// element was injected after the floating element rendered.
|
|
122
|
-
k.every((d) => !B(M, d)))) {
|
|
123
|
-
if (Ae(t) && !("touches" in e)) {
|
|
124
|
-
const d = J(t), j = He(t), le = /auto|scroll/, Ie = d || le.test(j.overflowX), Ke = d || le.test(j.overflowY), Xe = Ie && t.clientWidth > 0 && t.scrollWidth > t.clientWidth, xe = Ke && t.clientHeight > 0 && t.scrollHeight > t.clientHeight, We = j.direction === "rtl", Ye = xe && (We ? e.offsetX <= t.offsetWidth - t.clientWidth : e.offsetX > t.clientWidth), _e = Xe && e.offsetY > t.clientHeight;
|
|
125
|
-
if (Ye || _e)
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
if (!ue(e)) {
|
|
129
|
-
if (R() === "intentional" && P.current) {
|
|
130
|
-
a.clear(), P.current = !1;
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
typeof y == "function" && !y(e) || N("__outsidePressBubbles") || (n.setOpen(!1, Q(Ue, e)), g());
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
function be(e) {
|
|
138
|
-
R() !== "sloppy" || e.pointerType === "touch" || !n.select("open") || !m || E(e) || W(e);
|
|
139
|
-
}
|
|
140
|
-
function we(e) {
|
|
141
|
-
if (R() !== "sloppy" || !n.select("open") || !m || E(e))
|
|
142
|
-
return;
|
|
143
|
-
const t = e.touches[0];
|
|
144
|
-
t && (s.current = {
|
|
145
|
-
startTime: Date.now(),
|
|
146
|
-
startX: t.clientX,
|
|
147
|
-
startY: t.clientY,
|
|
148
|
-
dismissOnTouchEnd: !1,
|
|
149
|
-
dismissOnMouseDown: !0
|
|
150
|
-
}, D.start(1e3, () => {
|
|
151
|
-
s.current && (s.current.dismissOnTouchEnd = !1, s.current.dismissOnMouseDown = !1);
|
|
152
|
-
}));
|
|
153
|
-
}
|
|
154
|
-
function Y(e, t) {
|
|
155
|
-
const o = z(e);
|
|
156
|
-
if (!o)
|
|
157
|
-
return;
|
|
158
|
-
const c = i(o, e.type, () => {
|
|
159
|
-
t(e), c();
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
function Ce(e) {
|
|
163
|
-
H.current = "touch", Y(e, we);
|
|
164
|
-
}
|
|
165
|
-
function V(e) {
|
|
166
|
-
D.clear(), e.type === "pointerdown" && (H.current = e.pointerType), !(e.type === "mousedown" && s.current && !s.current.dismissOnMouseDown) && Y(e, (t) => {
|
|
167
|
-
t.type === "pointerdown" ? be(t) : W(t);
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
function U(e) {
|
|
171
|
-
if (!O.current)
|
|
172
|
-
return;
|
|
173
|
-
const t = X.current;
|
|
174
|
-
if (ie(), R() === "intentional") {
|
|
175
|
-
if (e.type === "pointercancel") {
|
|
176
|
-
t && ce();
|
|
177
|
-
return;
|
|
178
|
-
}
|
|
179
|
-
if (!ue(e)) {
|
|
180
|
-
if (t) {
|
|
181
|
-
ce();
|
|
182
|
-
return;
|
|
183
|
-
}
|
|
184
|
-
typeof y == "function" && !y(e) || (a.clear(), P.current = !0, g());
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
function Se(e) {
|
|
189
|
-
if (R() !== "sloppy" || !s.current || E(e))
|
|
190
|
-
return;
|
|
191
|
-
const t = e.touches[0];
|
|
192
|
-
if (!t)
|
|
193
|
-
return;
|
|
194
|
-
const o = Math.abs(t.clientX - s.current.startX), c = Math.abs(t.clientY - s.current.startY), k = Math.sqrt(o * o + c * c);
|
|
195
|
-
k > 5 && (s.current.dismissOnTouchEnd = !0), k > 10 && (W(e), D.clear(), s.current = null);
|
|
196
|
-
}
|
|
197
|
-
function Oe(e) {
|
|
198
|
-
Y(e, Se);
|
|
199
|
-
}
|
|
200
|
-
function De(e) {
|
|
201
|
-
R() !== "sloppy" || !s.current || E(e) || (s.current.dismissOnTouchEnd && W(e), D.clear(), s.current = null);
|
|
202
|
-
}
|
|
203
|
-
function ke(e) {
|
|
204
|
-
Y(e, De);
|
|
205
|
-
}
|
|
206
|
-
const u = fe(ee), Me = G(v && G(i(u, "keydown", b), i(u, "compositionstart", w), i(u, "compositionend", x)), te && G(i(u, "click", V, !0), i(u, "pointerdown", V, !0), i(u, "pointerup", U, !0), i(u, "pointercancel", U, !0), i(u, "mousedown", V, !0), i(u, "mouseup", U, !0), i(u, "touchstart", Ce, !0), i(u, "touchmove", Oe, !0), i(u, "touchend", ke, !0)));
|
|
207
|
-
return () => {
|
|
208
|
-
Me(), r.clear(), a.clear(), ie(), P.current = !1;
|
|
209
|
-
};
|
|
210
|
-
}, [h, ee, v, te, y, C, m, K, ne, b, g, re, N, E, S, n, D]), l.useEffect(g, [y, g]);
|
|
211
|
-
const q = l.useMemo(() => ({
|
|
212
|
-
onKeyDown: b,
|
|
213
|
-
onPointerDown: L,
|
|
214
|
-
onClick: L
|
|
215
|
-
}), [b, L]), oe = l.useMemo(() => ({
|
|
216
|
-
onKeyDown: b,
|
|
217
|
-
// `onMouseDown` may be blocked if `event.preventDefault()` is called in
|
|
218
|
-
// `onPointerDown`, such as with <NumberField.ScrubArea>.
|
|
219
|
-
// See https://github.com/mui/base-ui/pull/3379
|
|
220
|
-
onPointerDown: $,
|
|
221
|
-
onMouseDown: $,
|
|
222
|
-
onClickCapture: T,
|
|
223
|
-
onMouseDownCapture(r) {
|
|
224
|
-
T(), F(r);
|
|
225
|
-
},
|
|
226
|
-
onPointerDownCapture(r) {
|
|
227
|
-
T(), F(r);
|
|
228
|
-
},
|
|
229
|
-
onMouseUpCapture: T,
|
|
230
|
-
onTouchEndCapture: T,
|
|
231
|
-
onTouchMoveCapture: T
|
|
232
|
-
}), [b, T, F, $]);
|
|
233
|
-
return l.useMemo(() => m ? {
|
|
234
|
-
reference: q,
|
|
235
|
-
floating: oe,
|
|
236
|
-
trigger: q
|
|
237
|
-
} : {}, [m, q, oe]);
|
|
238
|
-
}
|
|
1
|
+
import { j as s } from "./index28.js";
|
|
2
|
+
const e = "base-ui-disable-scrollbar", r = {
|
|
3
|
+
className: e,
|
|
4
|
+
getElement(l) {
|
|
5
|
+
return /* @__PURE__ */ s.jsx("style", {
|
|
6
|
+
nonce: l,
|
|
7
|
+
href: e,
|
|
8
|
+
precedence: "base-ui:low",
|
|
9
|
+
children: `.${e}{scrollbar-width:none}.${e}::-webkit-scrollbar{display:none}`
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
process.env.NODE_ENV !== "production" && (r.getElement.displayName = "styleDisableScrollbar.getElement");
|
|
239
14
|
export {
|
|
240
|
-
|
|
241
|
-
dt as useDismiss
|
|
15
|
+
r as styleDisableScrollbar
|
|
242
16
|
};
|
|
243
17
|
//# sourceMappingURL=index302.js.map
|
package/dist/index302.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index302.js","sources":["../../../node_modules/@base-ui/react/floating-ui-react/hooks/useDismiss.mjs"],"sourcesContent":["'use client';\n\n/* eslint-disable no-underscore-dangle */\nimport * as React from 'react';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { mergeCleanups } from '@base-ui/utils/mergeCleanups';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { Timeout, useTimeout } from '@base-ui/utils/useTimeout';\nimport { getComputedStyle, getParentNode, isElement, isHTMLElement, isLastTraversableNode, isShadowRoot } from '@floating-ui/utils/dom';\nimport { platform } from '@base-ui/utils/platform';\nimport { useFloatingTree } from \"../components/FloatingTree.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { createAttribute } from \"../utils/createAttribute.mjs\";\nimport { contains, getTarget, isEventTargetWithin, isRootElement } from \"../utils/element.mjs\";\nimport { isReactEvent } from \"../utils/event.mjs\";\nimport { getNodeChildren } from \"../utils/nodes.mjs\";\nfunction alwaysFalse() {\n return false;\n}\nexport function normalizeProp(normalizable) {\n return {\n escapeKey: typeof normalizable === 'boolean' ? normalizable : normalizable?.escapeKey ?? false,\n outsidePress: typeof normalizable === 'boolean' ? normalizable : normalizable?.outsidePress ?? true\n };\n}\n/**\n * Closes the floating element when a dismissal is requested — by default, when\n * the user presses the `escape` key or outside of the floating element.\n * @see https://floating-ui.com/docs/useDismiss\n */\nexport function useDismiss(context, props = {}) {\n const {\n enabled = true,\n escapeKey = true,\n outsidePress: outsidePressProp = true,\n outsidePressEvent = 'sloppy',\n referencePress = alwaysFalse,\n bubbles,\n externalTree\n } = props;\n const store = 'rootStore' in context ? context.rootStore : context;\n const open = store.useState('open');\n const floatingElement = store.useState('floatingElement');\n const {\n dataRef\n } = store.context;\n const tree = useFloatingTree(externalTree);\n const outsidePressFn = useStableCallback(typeof outsidePressProp === 'function' ? outsidePressProp : () => false);\n const outsidePress = typeof outsidePressProp === 'function' ? outsidePressFn : outsidePressProp;\n const outsidePressEnabled = outsidePress !== false;\n const getOutsidePressEventProp = useStableCallback(() => outsidePressEvent);\n const {\n escapeKey: escapeKeyBubbles,\n outsidePress: outsidePressBubbles\n } = normalizeProp(bubbles);\n const pressStartedInsideRef = React.useRef(false);\n const pressStartPreventedRef = React.useRef(false);\n // Ignore only the very next outside click after dragging from inside to outside.\n const suppressNextOutsideClickRef = React.useRef(false);\n const isComposingRef = React.useRef(false);\n const currentPointerTypeRef = React.useRef('');\n const touchStateRef = React.useRef(null);\n const cancelDismissOnEndTimeout = useTimeout();\n const clearInsideReactTreeTimeout = useTimeout();\n const clearInsideReactTree = useStableCallback(() => {\n clearInsideReactTreeTimeout.clear();\n dataRef.current.insideReactTree = false;\n });\n const hasBlockingChild = useStableCallback(bubbleKey => {\n const nodeId = dataRef.current.floatingContext?.nodeId;\n const children = tree ? getNodeChildren(tree.nodesRef.current, nodeId) : [];\n return children.some(child => child.context?.open && !child.context.dataRef.current[bubbleKey]);\n });\n const isEventWithinOwnElements = useStableCallback(event => {\n return isEventTargetWithin(event, store.select('floatingElement')) || isEventTargetWithin(event, store.select('domReferenceElement'));\n });\n const closeOnReferencePress = useStableCallback(event => {\n if (!referencePress()) {\n return;\n }\n store.setOpen(false, createChangeEventDetails(REASONS.triggerPress, event.nativeEvent));\n });\n const closeOnEscapeKeyDown = useStableCallback(event => {\n if (!open || !enabled || !escapeKey || event.key !== 'Escape') {\n return;\n }\n\n // Wait until IME is settled. Pressing `Escape` while composing should\n // close the compose menu, but not the floating element.\n if (isComposingRef.current) {\n return;\n }\n if (!escapeKeyBubbles && hasBlockingChild('__escapeKeyBubbles')) {\n return;\n }\n const native = isReactEvent(event) ? event.nativeEvent : event;\n const eventDetails = createChangeEventDetails(REASONS.escapeKey, native);\n store.setOpen(false, eventDetails);\n if (!eventDetails.isCanceled) {\n event.preventDefault();\n }\n if (!escapeKeyBubbles && !eventDetails.isPropagationAllowed) {\n event.stopPropagation();\n }\n });\n const markInsideReactTree = useStableCallback(() => {\n dataRef.current.insideReactTree = true;\n clearInsideReactTreeTimeout.start(0, clearInsideReactTree);\n });\n const markPressStartedInsideReactTree = useStableCallback(event => {\n if (!open || !enabled || event.button !== 0) {\n return;\n }\n const target = getTarget(event.nativeEvent);\n\n // Only treat presses that start within the floating DOM subtree as inside.\n // This avoids suppressing parent dismissal when interacting with nested portals.\n if (!contains(store.select('floatingElement'), target)) {\n return;\n }\n if (!pressStartedInsideRef.current) {\n pressStartedInsideRef.current = true;\n pressStartPreventedRef.current = false;\n }\n });\n const markInsidePressStartPrevented = useStableCallback(event => {\n if (!open || !enabled) {\n return;\n }\n if (!(event.defaultPrevented || event.nativeEvent.defaultPrevented)) {\n return;\n }\n if (pressStartedInsideRef.current) {\n pressStartPreventedRef.current = true;\n }\n });\n React.useEffect(() => {\n if (!open || !enabled) {\n return undefined;\n }\n dataRef.current.__escapeKeyBubbles = escapeKeyBubbles;\n dataRef.current.__outsidePressBubbles = outsidePressBubbles;\n const compositionTimeout = new Timeout();\n const preventedPressSuppressionTimeout = new Timeout();\n function handleCompositionStart() {\n compositionTimeout.clear();\n isComposingRef.current = true;\n }\n function handleCompositionEnd() {\n // Safari fires `compositionend` before `keydown`, so we need to wait\n // until the next tick to set `isComposing` to `false`.\n // https://bugs.webkit.org/show_bug.cgi?id=165004\n compositionTimeout.start(\n // 0ms or 1ms don't work in Safari. 5ms appears to consistently work.\n // Only apply to WebKit for the test to remain 0ms.\n platform.engine.webkit ? 5 : 0, () => {\n isComposingRef.current = false;\n });\n }\n function suppressImmediateOutsideClickAfterPreventedStart() {\n suppressNextOutsideClickRef.current = true;\n // Firefox can emit the synthetic outside click in a later task after\n // pointer lock exit, so microtask clearing is too early here.\n preventedPressSuppressionTimeout.start(0, () => {\n suppressNextOutsideClickRef.current = false;\n });\n }\n function resetPressStartState() {\n pressStartedInsideRef.current = false;\n pressStartPreventedRef.current = false;\n }\n function getOutsidePressEvent() {\n const type = currentPointerTypeRef.current;\n const computedType = type === 'pen' || !type ? 'mouse' : type;\n const outsidePressEventValue = getOutsidePressEventProp();\n const resolved = typeof outsidePressEventValue === 'function' ? outsidePressEventValue() : outsidePressEventValue;\n if (typeof resolved === 'string') {\n return resolved;\n }\n return resolved[computedType];\n }\n function shouldIgnoreEvent(event) {\n const computedOutsidePressEvent = getOutsidePressEvent();\n return computedOutsidePressEvent === 'intentional' && event.type !== 'click' || computedOutsidePressEvent === 'sloppy' && event.type === 'click';\n }\n function isEventWithinFloatingTree(event) {\n const nodeId = dataRef.current.floatingContext?.nodeId;\n const targetIsInsideChildren = tree && getNodeChildren(tree.nodesRef.current, nodeId).some(node => isEventTargetWithin(event, node.context?.elements.floating));\n return isEventWithinOwnElements(event) || targetIsInsideChildren;\n }\n function closeOnPressOutside(event) {\n if (shouldIgnoreEvent(event)) {\n // A new press began outside the floating element and its trigger. Clear any\n // leftover drag-out suppression so this press's eventual click can dismiss.\n if (event.type !== 'click' && !isEventWithinOwnElements(event)) {\n preventedPressSuppressionTimeout.clear();\n suppressNextOutsideClickRef.current = false;\n }\n clearInsideReactTree();\n return;\n }\n if (dataRef.current.insideReactTree) {\n clearInsideReactTree();\n return;\n }\n const target = getTarget(event);\n const inertSelector = `[${createAttribute('inert')}]`;\n const targetRoot = isElement(target) ? target.getRootNode() : null;\n const markers = Array.from((isShadowRoot(targetRoot) ? targetRoot : ownerDocument(store.select('floatingElement'))).querySelectorAll(inertSelector));\n const triggers = store.context.triggerElements;\n\n // If another trigger is clicked, don't close the floating element.\n if (target && (triggers.hasElement(target) || triggers.hasMatchingElement(trigger => contains(trigger, target)))) {\n return;\n }\n let targetRootAncestor = isElement(target) ? target : null;\n while (targetRootAncestor && !isLastTraversableNode(targetRootAncestor)) {\n const nextParent = getParentNode(targetRootAncestor);\n if (isLastTraversableNode(nextParent) || !isElement(nextParent)) {\n break;\n }\n targetRootAncestor = nextParent;\n }\n\n // Check if the click occurred on a third-party element injected after the\n // floating element rendered.\n if (markers.length && isElement(target) && !isRootElement(target) &&\n // Clicked on a direct ancestor (e.g. FloatingOverlay).\n !contains(target, store.select('floatingElement')) &&\n // If the target root element contains none of the markers, then the\n // element was injected after the floating element rendered.\n markers.every(marker => !contains(targetRootAncestor, marker))) {\n return;\n }\n\n // Check if the click occurred on the scrollbar\n // Skip for touch events: scrollbars don't receive touch events on most platforms\n if (isHTMLElement(target) && !('touches' in event)) {\n const lastTraversableNode = isLastTraversableNode(target);\n const style = getComputedStyle(target);\n const scrollRe = /auto|scroll/;\n const isScrollableX = lastTraversableNode || scrollRe.test(style.overflowX);\n const isScrollableY = lastTraversableNode || scrollRe.test(style.overflowY);\n const canScrollX = isScrollableX && target.clientWidth > 0 && target.scrollWidth > target.clientWidth;\n const canScrollY = isScrollableY && target.clientHeight > 0 && target.scrollHeight > target.clientHeight;\n const isRTL = style.direction === 'rtl';\n\n // Check click position relative to scrollbar.\n // In some browsers it is possible to change the <body> (or window)\n // scrollbar to the left side, but is very rare and is difficult to\n // check for. Plus, for modal dialogs with backdrops, it is more\n // important that the backdrop is checked but not so much the window.\n const pressedVerticalScrollbar = canScrollY && (isRTL ? event.offsetX <= target.offsetWidth - target.clientWidth : event.offsetX > target.clientWidth);\n const pressedHorizontalScrollbar = canScrollX && event.offsetY > target.clientHeight;\n if (pressedVerticalScrollbar || pressedHorizontalScrollbar) {\n return;\n }\n }\n if (isEventWithinFloatingTree(event)) {\n return;\n }\n\n // In intentional mode, a press that starts inside and ends outside gets\n // one suppressed outside click. Run this after inside-target checks so\n // inside clicks don't consume the one-shot suppression.\n if (getOutsidePressEvent() === 'intentional' && suppressNextOutsideClickRef.current) {\n preventedPressSuppressionTimeout.clear();\n suppressNextOutsideClickRef.current = false;\n return;\n }\n if (typeof outsidePress === 'function' && !outsidePress(event)) {\n return;\n }\n if (hasBlockingChild('__outsidePressBubbles')) {\n return;\n }\n store.setOpen(false, createChangeEventDetails(REASONS.outsidePress, event));\n clearInsideReactTree();\n }\n function handlePointerDown(event) {\n if (getOutsidePressEvent() !== 'sloppy' || event.pointerType === 'touch' || !store.select('open') || !enabled || isEventWithinOwnElements(event)) {\n return;\n }\n closeOnPressOutside(event);\n }\n function handleTouchStart(event) {\n if (getOutsidePressEvent() !== 'sloppy' || !store.select('open') || !enabled || isEventWithinOwnElements(event)) {\n return;\n }\n const touch = event.touches[0];\n if (touch) {\n touchStateRef.current = {\n startTime: Date.now(),\n startX: touch.clientX,\n startY: touch.clientY,\n dismissOnTouchEnd: false,\n dismissOnMouseDown: true\n };\n cancelDismissOnEndTimeout.start(1000, () => {\n if (touchStateRef.current) {\n touchStateRef.current.dismissOnTouchEnd = false;\n touchStateRef.current.dismissOnMouseDown = false;\n }\n });\n }\n }\n function addTargetEventListenerOnce(event, listener) {\n const target = getTarget(event);\n if (!target) {\n return;\n }\n const unsubscribe = addEventListener(target, event.type, () => {\n listener(event);\n unsubscribe();\n });\n }\n function handleTouchStartCapture(event) {\n currentPointerTypeRef.current = 'touch';\n addTargetEventListenerOnce(event, handleTouchStart);\n }\n function closeOnPressOutsideCapture(event) {\n cancelDismissOnEndTimeout.clear();\n if (event.type === 'pointerdown') {\n currentPointerTypeRef.current = event.pointerType;\n }\n if (event.type === 'mousedown' && touchStateRef.current && !touchStateRef.current.dismissOnMouseDown) {\n return;\n }\n addTargetEventListenerOnce(event, targetEvent => {\n if (targetEvent.type === 'pointerdown') {\n handlePointerDown(targetEvent);\n } else {\n closeOnPressOutside(targetEvent);\n }\n });\n }\n function handlePressEndCapture(event) {\n if (!pressStartedInsideRef.current) {\n return;\n }\n const pressStartedInsideDefaultPrevented = pressStartPreventedRef.current;\n resetPressStartState();\n if (getOutsidePressEvent() !== 'intentional') {\n return;\n }\n if (event.type === 'pointercancel') {\n if (pressStartedInsideDefaultPrevented) {\n suppressImmediateOutsideClickAfterPreventedStart();\n }\n return;\n }\n if (isEventWithinFloatingTree(event)) {\n return;\n }\n\n // If pointerdown was prevented, no click may be generated for that\n // interaction. However, Firefox may still emit an immediate click after\n // pointerup (e.g. NumberField scrub with pointer lock), so suppress for\n // one tick to absorb that synthetic click only.\n if (pressStartedInsideDefaultPrevented) {\n suppressImmediateOutsideClickAfterPreventedStart();\n return;\n }\n\n // Avoid suppressing when outsidePress explicitly ignores this target.\n if (typeof outsidePress === 'function' && !outsidePress(event)) {\n return;\n }\n preventedPressSuppressionTimeout.clear();\n suppressNextOutsideClickRef.current = true;\n clearInsideReactTree();\n }\n function handleTouchMove(event) {\n if (getOutsidePressEvent() !== 'sloppy' || !touchStateRef.current || isEventWithinOwnElements(event)) {\n return;\n }\n const touch = event.touches[0];\n if (!touch) {\n return;\n }\n const deltaX = Math.abs(touch.clientX - touchStateRef.current.startX);\n const deltaY = Math.abs(touch.clientY - touchStateRef.current.startY);\n const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);\n if (distance > 5) {\n touchStateRef.current.dismissOnTouchEnd = true;\n }\n if (distance > 10) {\n closeOnPressOutside(event);\n cancelDismissOnEndTimeout.clear();\n touchStateRef.current = null;\n }\n }\n function handleTouchMoveCapture(event) {\n addTargetEventListenerOnce(event, handleTouchMove);\n }\n function handleTouchEnd(event) {\n if (getOutsidePressEvent() !== 'sloppy' || !touchStateRef.current || isEventWithinOwnElements(event)) {\n return;\n }\n if (touchStateRef.current.dismissOnTouchEnd) {\n closeOnPressOutside(event);\n }\n cancelDismissOnEndTimeout.clear();\n touchStateRef.current = null;\n }\n function handleTouchEndCapture(event) {\n addTargetEventListenerOnce(event, handleTouchEnd);\n }\n const doc = ownerDocument(floatingElement);\n const unsubscribe = mergeCleanups(escapeKey && mergeCleanups(addEventListener(doc, 'keydown', closeOnEscapeKeyDown), addEventListener(doc, 'compositionstart', handleCompositionStart), addEventListener(doc, 'compositionend', handleCompositionEnd)), outsidePressEnabled && mergeCleanups(addEventListener(doc, 'click', closeOnPressOutsideCapture, true), addEventListener(doc, 'pointerdown', closeOnPressOutsideCapture, true), addEventListener(doc, 'pointerup', handlePressEndCapture, true), addEventListener(doc, 'pointercancel', handlePressEndCapture, true), addEventListener(doc, 'mousedown', closeOnPressOutsideCapture, true), addEventListener(doc, 'mouseup', handlePressEndCapture, true), addEventListener(doc, 'touchstart', handleTouchStartCapture, true), addEventListener(doc, 'touchmove', handleTouchMoveCapture, true), addEventListener(doc, 'touchend', handleTouchEndCapture, true)));\n return () => {\n unsubscribe();\n compositionTimeout.clear();\n preventedPressSuppressionTimeout.clear();\n resetPressStartState();\n suppressNextOutsideClickRef.current = false;\n };\n }, [dataRef, floatingElement, escapeKey, outsidePressEnabled, outsidePress, open, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, clearInsideReactTree, getOutsidePressEventProp, hasBlockingChild, isEventWithinOwnElements, tree, store, cancelDismissOnEndTimeout]);\n React.useEffect(clearInsideReactTree, [outsidePress, clearInsideReactTree]);\n const reference = React.useMemo(() => ({\n onKeyDown: closeOnEscapeKeyDown,\n onPointerDown: closeOnReferencePress,\n onClick: closeOnReferencePress\n }), [closeOnEscapeKeyDown, closeOnReferencePress]);\n const floating = React.useMemo(() => ({\n onKeyDown: closeOnEscapeKeyDown,\n // `onMouseDown` may be blocked if `event.preventDefault()` is called in\n // `onPointerDown`, such as with <NumberField.ScrubArea>.\n // See https://github.com/mui/base-ui/pull/3379\n onPointerDown: markInsidePressStartPrevented,\n onMouseDown: markInsidePressStartPrevented,\n onClickCapture: markInsideReactTree,\n onMouseDownCapture(event) {\n markInsideReactTree();\n markPressStartedInsideReactTree(event);\n },\n onPointerDownCapture(event) {\n markInsideReactTree();\n markPressStartedInsideReactTree(event);\n },\n onMouseUpCapture: markInsideReactTree,\n onTouchEndCapture: markInsideReactTree,\n onTouchMoveCapture: markInsideReactTree\n }), [closeOnEscapeKeyDown, markInsideReactTree, markPressStartedInsideReactTree, markInsidePressStartPrevented]);\n return React.useMemo(() => enabled ? {\n reference,\n floating,\n trigger: reference\n } : {}, [enabled, reference, floating]);\n}"],"names":["alwaysFalse","normalizeProp","normalizable","useDismiss","context","props","enabled","escapeKey","outsidePressProp","outsidePressEvent","referencePress","bubbles","externalTree","store","open","floatingElement","dataRef","tree","useFloatingTree","outsidePressFn","useStableCallback","outsidePress","outsidePressEnabled","getOutsidePressEventProp","escapeKeyBubbles","outsidePressBubbles","pressStartedInsideRef","React","pressStartPreventedRef","suppressNextOutsideClickRef","isComposingRef","currentPointerTypeRef","touchStateRef","cancelDismissOnEndTimeout","useTimeout","clearInsideReactTreeTimeout","clearInsideReactTree","hasBlockingChild","bubbleKey","nodeId","getNodeChildren","child","isEventWithinOwnElements","event","isEventTargetWithin","closeOnReferencePress","createChangeEventDetails","REASONS.triggerPress","closeOnEscapeKeyDown","native","isReactEvent","eventDetails","REASONS.escapeKey","markInsideReactTree","markPressStartedInsideReactTree","target","getTarget","contains","markInsidePressStartPrevented","compositionTimeout","Timeout","preventedPressSuppressionTimeout","handleCompositionStart","handleCompositionEnd","platform.engine.webkit","suppressImmediateOutsideClickAfterPreventedStart","resetPressStartState","getOutsidePressEvent","type","computedType","outsidePressEventValue","resolved","shouldIgnoreEvent","computedOutsidePressEvent","isEventWithinFloatingTree","targetIsInsideChildren","node","closeOnPressOutside","inertSelector","createAttribute","targetRoot","isElement","markers","isShadowRoot","ownerDocument","triggers","trigger","targetRootAncestor","isLastTraversableNode","nextParent","getParentNode","isRootElement","marker","isHTMLElement","lastTraversableNode","style","getComputedStyle","scrollRe","isScrollableX","isScrollableY","canScrollX","canScrollY","isRTL","pressedVerticalScrollbar","pressedHorizontalScrollbar","REASONS.outsidePress","handlePointerDown","handleTouchStart","touch","addTargetEventListenerOnce","listener","unsubscribe","addEventListener","handleTouchStartCapture","closeOnPressOutsideCapture","targetEvent","handlePressEndCapture","pressStartedInsideDefaultPrevented","handleTouchMove","deltaX","deltaY","distance","handleTouchMoveCapture","handleTouchEnd","handleTouchEndCapture","doc","mergeCleanups","reference","floating"],"mappings":";;;;;;;;;;;;;;;;AAkBA,SAASA,KAAc;AACrB,SAAO;AACT;AACO,SAASC,GAAcC,GAAc;AAC1C,SAAO;AAAA,IACL,WAAW,OAAOA,KAAiB,YAAYA,IAAeA,GAAc,aAAa;AAAA,IACzF,cAA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AA,IACvC;AAAA,IACA,qBAAqBA,GAAO;AAC1B,MAAAU,EAAmB,GACnBC,EAAgCX,CAAK;AAAA,IACvC;AAAA,IACA,kBAAkBU;AAAA,IAClB,mBAAmBA;AAAA,IACnB,oBAAoBA;AAAA,EACxB,IAAM,CAACL,GAAsBK,GAAqBC,GAAiCI,CAA6B,CAAC;AAC/G,SAAO/B,EAAM,QAAQ,MAAMrB,IAAU;AAAA,IACnC,WAAAyH;AAAA,IACA,UAAAC;AAAA,IACA,SAASD;AAAA,EACb,IAAM,CAAA,GAAI,CAACzH,GAASyH,GAAWC,EAAQ,CAAC;AACxC;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index302.js","sources":["../../../node_modules/@base-ui/react/utils/styles.mjs"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nconst DISABLE_SCROLLBAR_CLASS_NAME = 'base-ui-disable-scrollbar';\nexport const styleDisableScrollbar = {\n className: DISABLE_SCROLLBAR_CLASS_NAME,\n getElement(nonce) {\n return /*#__PURE__*/_jsx(\"style\", {\n nonce: nonce,\n href: DISABLE_SCROLLBAR_CLASS_NAME,\n precedence: \"base-ui:low\",\n children: `.${DISABLE_SCROLLBAR_CLASS_NAME}{scrollbar-width:none}.${DISABLE_SCROLLBAR_CLASS_NAME}::-webkit-scrollbar{display:none}`\n });\n }\n};\nif (process.env.NODE_ENV !== \"production\") styleDisableScrollbar.getElement.displayName = \"styleDisableScrollbar.getElement\";"],"names":["DISABLE_SCROLLBAR_CLASS_NAME","styleDisableScrollbar","nonce","_jsx"],"mappings":";AACA,MAAMA,IAA+B,6BACxBC,IAAwB;AAAA,EACnC,WAAWD;AAAA,EACX,WAAWE,GAAO;AAChB,WAAoBC,gBAAAA,EAAAA,IAAK,SAAS;AAAA,MAChC,OAAOD;AAAA,MACP,MAAMF;AAAA,MACN,YAAY;AAAA,MACZ,UAAU,IAAIA,CAA4B,0BAA0BA,CAA4B;AAAA,IACtG,CAAK;AAAA,EACH;AACF;AACI,QAAQ,IAAI,aAAa,iBAAcC,EAAsB,WAAW,cAAc;","x_google_ignoreList":[0]}
|
package/dist/index303.js
CHANGED
|
@@ -1,256 +1,11 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { useValueAsRef as k } from "./index288.js";
|
|
7
|
-
import { isHTMLElement as Pe } from "./index270.js";
|
|
8
|
-
import { createChangeEventDetails as ce } from "./index153.js";
|
|
9
|
-
import { useFloatingParentNodeId as ze, useFloatingTree as We } from "./index373.js";
|
|
10
|
-
import { isIndexOutOfListBounds as Fe, getMinListIndex as ie, getMaxListIndex as ve, findNonDisabledListIndex as G } from "./index369.js";
|
|
11
|
-
import { ARROW_LEFT as B, ARROW_RIGHT as Q, ARROW_UP as Se, ARROW_DOWN as le } from "./index379.js";
|
|
12
|
-
import { getFloatingFocusElement as _e, isTypeableCombobox as qe } from "./index312.js";
|
|
13
|
-
import { enqueueFocus as He } from "./index371.js";
|
|
14
|
-
import { stopEvent as P, isVirtualClick as Ge, isVirtualPointerEvent as $e } from "./index334.js";
|
|
15
|
-
import { activeElement as ue, contains as se, getTarget as Be } from "./index313.js";
|
|
16
|
-
import { listNavigation as Te, focusOut as Qe } from "./index155.js";
|
|
17
|
-
const Ue = "Escape";
|
|
18
|
-
function U(c, d, n) {
|
|
19
|
-
switch (c) {
|
|
20
|
-
case "vertical":
|
|
21
|
-
return d;
|
|
22
|
-
case "horizontal":
|
|
23
|
-
return n;
|
|
24
|
-
default:
|
|
25
|
-
return d || n;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
function $(c, d) {
|
|
29
|
-
return U(d, c === Se || c === le, c === B || c === Q);
|
|
30
|
-
}
|
|
31
|
-
function ae(c, d, n) {
|
|
32
|
-
return U(d, c === le, n ? c === B : c === Q) || c === "Enter" || c === " " || c === "";
|
|
33
|
-
}
|
|
34
|
-
function je(c, d, n) {
|
|
35
|
-
return U(d, n ? c === B : c === Q, c === le);
|
|
36
|
-
}
|
|
37
|
-
function Je(c, d, n, p) {
|
|
38
|
-
const K = n ? c === Q : c === B, R = c === Se;
|
|
39
|
-
return d === "both" || d === "horizontal" && p ? c === Ue : U(d, K, R);
|
|
40
|
-
}
|
|
41
|
-
function dr(c, d) {
|
|
42
|
-
const {
|
|
43
|
-
listRef: n,
|
|
44
|
-
activeIndex: p,
|
|
45
|
-
onNavigate: K = () => {
|
|
46
|
-
},
|
|
47
|
-
enabled: R = !0,
|
|
48
|
-
selectedIndex: L = null,
|
|
49
|
-
allowEscape: j = !1,
|
|
50
|
-
loopFocus: V = !1,
|
|
51
|
-
nested: w = !1,
|
|
52
|
-
rtl: O = !1,
|
|
53
|
-
virtual: s = !1,
|
|
54
|
-
focusItemOnOpen: y = "auto",
|
|
55
|
-
focusItemOnHover: J = !0,
|
|
56
|
-
openOnArrowKeyDown: X = !0,
|
|
57
|
-
disabledIndices: x = void 0,
|
|
58
|
-
orientation: a = "vertical",
|
|
59
|
-
parentOrientation: Ke,
|
|
60
|
-
id: fe,
|
|
61
|
-
resetOnPointerLeave: Le = !0,
|
|
62
|
-
externalTree: Ce,
|
|
63
|
-
grid: Y
|
|
64
|
-
} = d, de = Y != null;
|
|
65
|
-
process.env.NODE_ENV !== "production" && (j && (V || console.warn("`useListNavigation` looping must be enabled to allow escaping."), s || console.warn("`useListNavigation` must be virtual to allow escaping.")), a === "vertical" && de && console.warn("In grid list navigation mode, the `orientation` should", 'be either "horizontal" or "both".'));
|
|
66
|
-
const g = "rootStore" in c ? c.rootStore : c, m = g.useState("open"), E = g.useState("floatingElement"), I = g.useState("domReferenceElement"), me = g.context.dataRef, De = _e(E), Z = qe(I), C = k(De), ee = ze(), F = We(Ce), M = f.useRef(y), o = f.useRef(L ?? -1), b = f.useRef(null), v = f.useRef(!0), u = S((e) => {
|
|
67
|
-
K(o.current === -1 ? null : o.current, e);
|
|
68
|
-
}), D = f.useRef(!!E), pe = f.useRef(m), h = f.useRef(!1), z = f.useRef(!1), re = f.useRef(null), Ne = k(x), W = k(m), N = k(L), ge = k(Le), Ae = Me(), Re = Me(), te = S(() => {
|
|
69
|
-
function e(i) {
|
|
70
|
-
s ? F?.events.emit("virtualfocus", i) : re.current = He(i, {
|
|
71
|
-
sync: h.current,
|
|
72
|
-
preventScroll: !0
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
const r = n.current[o.current], l = z.current;
|
|
76
|
-
r && e(r), (h.current ? (i) => i() : (i) => Ae.request(i))(() => {
|
|
77
|
-
const i = n.current[o.current] || r;
|
|
78
|
-
if (!i)
|
|
79
|
-
return;
|
|
80
|
-
r || e(i), // eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
81
|
-
oe && (l || !v.current) && i.scrollIntoView?.({
|
|
82
|
-
block: "nearest",
|
|
83
|
-
inline: "nearest"
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
T(() => {
|
|
88
|
-
me.current.orientation = a;
|
|
89
|
-
}, [me, a]), T(() => {
|
|
90
|
-
R && (m && E ? (o.current = L ?? -1, M.current && L != null && (z.current = !0, u())) : D.current && (o.current = -1, u()));
|
|
91
|
-
}, [R, m, E, L, u]), T(() => {
|
|
92
|
-
if (R) {
|
|
93
|
-
if (!m) {
|
|
94
|
-
h.current = !1;
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
if (E)
|
|
98
|
-
if (p == null) {
|
|
99
|
-
if (h.current = !1, N.current != null)
|
|
100
|
-
return;
|
|
101
|
-
if (D.current && (o.current = -1, te()), (!pe.current || !D.current) && M.current && (b.current != null || M.current === !0 && b.current == null)) {
|
|
102
|
-
let e = 0;
|
|
103
|
-
const r = () => {
|
|
104
|
-
n.current[0] == null ? (e < 2 && (e ? (t) => Re.request(t) : queueMicrotask)(r), e += 1) : (o.current = b.current == null || ae(b.current, a, O) || w ? ie(n) : ve(n), b.current = null, u());
|
|
105
|
-
};
|
|
106
|
-
r();
|
|
107
|
-
}
|
|
108
|
-
} else Fe(n.current, p) || (o.current = p, te(), z.current = !1);
|
|
109
|
-
}
|
|
110
|
-
}, [R, m, E, p, N, w, n, a, O, u, te, Re]), T(() => {
|
|
111
|
-
if (!R || E || !F || s || !D.current)
|
|
112
|
-
return;
|
|
113
|
-
const e = F.nodesRef.current, r = e.find((i) => i.id === ee)?.context?.elements.floating, l = ue(be(I ?? r ?? null)), t = e.some((i) => i.context && se(i.context.elements.floating, l));
|
|
114
|
-
r && !t && v.current && r.focus({
|
|
115
|
-
preventScroll: !0
|
|
116
|
-
});
|
|
117
|
-
}, [R, E, I, F, ee, s]), T(() => {
|
|
118
|
-
pe.current = m, D.current = !!E;
|
|
119
|
-
}), T(() => {
|
|
120
|
-
m || (b.current = null, M.current = y);
|
|
121
|
-
}, [m, y]);
|
|
122
|
-
const he = p != null, ne = S((e) => {
|
|
123
|
-
if (!W.current)
|
|
124
|
-
return;
|
|
125
|
-
const r = n.current.indexOf(e.currentTarget);
|
|
126
|
-
r !== -1 && (o.current !== r || p !== r) && (o.current = r, u(e));
|
|
127
|
-
}), _ = S(() => Ke ?? F?.nodesRef.current.find((e) => e.id === ee)?.context?.dataRef?.current.orientation), Ee = S(() => ie(n, Ne.current)), A = S((e) => {
|
|
128
|
-
if (v.current = !1, h.current = !0, e.which === 229 || !W.current && e.currentTarget === C.current)
|
|
129
|
-
return;
|
|
130
|
-
if (w && Je(e.key, a, O, de)) {
|
|
131
|
-
$(e.key, _()) || P(e), g.setOpen(!1, ce(Te, e.nativeEvent)), Pe(I) && (s ? F?.events.emit("virtualfocus", I) : I.focus());
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
const r = o.current, l = ie(n, x), t = ve(n, x);
|
|
135
|
-
if (Z || (e.key === "Home" && (P(e), o.current = l, u(e)), e.key === "End" && (P(e), o.current = t, u(e))), Y != null) {
|
|
136
|
-
const i = Y(e, o.current, n, a, V, O, x, l, t);
|
|
137
|
-
if (i != null && (o.current = i, u(e)), a === "both")
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
if ($(e.key, a)) {
|
|
141
|
-
if (P(e), m && !s && ue(e.currentTarget.ownerDocument) === e.currentTarget) {
|
|
142
|
-
o.current = ae(e.key, a, O) ? l : t, u(e);
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
ae(e.key, a, O) ? V ? r >= t ? j && r !== n.current.length ? o.current = -1 : (h.current = !1, o.current = l) : o.current = G(n.current, {
|
|
146
|
-
startingIndex: r,
|
|
147
|
-
disabledIndices: x
|
|
148
|
-
}) : o.current = Math.min(t, G(n.current, {
|
|
149
|
-
startingIndex: r,
|
|
150
|
-
disabledIndices: x
|
|
151
|
-
})) : V ? r <= l ? j && r !== -1 ? o.current = n.current.length : (h.current = !1, o.current = t) : o.current = G(n.current, {
|
|
152
|
-
startingIndex: r,
|
|
153
|
-
decrement: !0,
|
|
154
|
-
disabledIndices: x
|
|
155
|
-
}) : o.current = Math.max(l, G(n.current, {
|
|
156
|
-
startingIndex: r,
|
|
157
|
-
decrement: !0,
|
|
158
|
-
disabledIndices: x
|
|
159
|
-
})), Fe(n.current, o.current) && (o.current = -1), u(e);
|
|
160
|
-
}
|
|
161
|
-
}), oe = f.useMemo(() => ({
|
|
162
|
-
onFocus(r) {
|
|
163
|
-
h.current = !0, ne(r);
|
|
164
|
-
},
|
|
165
|
-
onClick: ({
|
|
166
|
-
currentTarget: r
|
|
167
|
-
}) => r.focus({
|
|
168
|
-
preventScroll: !0
|
|
169
|
-
}),
|
|
170
|
-
// Safari
|
|
171
|
-
onMouseMove(r) {
|
|
172
|
-
h.current = !0, z.current = !1, J && ne(r);
|
|
173
|
-
},
|
|
174
|
-
onPointerLeave(r) {
|
|
175
|
-
if (!W.current || !v.current || r.pointerType === "touch")
|
|
176
|
-
return;
|
|
177
|
-
h.current = !0;
|
|
178
|
-
const l = r.relatedTarget;
|
|
179
|
-
if (!(!J || n.current.includes(l)) && ge.current && (re.current?.(), re.current = null, o.current = -1, u(r), !s)) {
|
|
180
|
-
const t = C.current, i = ue(be(t));
|
|
181
|
-
t && se(t, i) && t.focus({
|
|
182
|
-
preventScroll: !0
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}), [ne, W, C, J, n, u, ge, s]), q = f.useMemo(() => s && m && he && {
|
|
187
|
-
"aria-activedescendant": `${fe}-${p}`
|
|
188
|
-
}, [s, m, he, fe, p]), Ie = f.useMemo(() => ({
|
|
189
|
-
"aria-orientation": a === "both" ? void 0 : a,
|
|
190
|
-
...Z ? {} : q,
|
|
191
|
-
onKeyDown(e) {
|
|
192
|
-
if (e.key === "Tab" && e.shiftKey && m && !s) {
|
|
193
|
-
const r = Be(e.nativeEvent);
|
|
194
|
-
if (r && !se(C.current, r))
|
|
195
|
-
return;
|
|
196
|
-
P(e), g.setOpen(!1, ce(Qe, e.nativeEvent)), Pe(I) && I.focus();
|
|
197
|
-
return;
|
|
198
|
-
}
|
|
199
|
-
A(e);
|
|
200
|
-
},
|
|
201
|
-
onPointerMove() {
|
|
202
|
-
v.current = !0;
|
|
203
|
-
}
|
|
204
|
-
}), [q, A, C, a, Z, g, m, s, I]), H = f.useMemo(() => {
|
|
205
|
-
function e(t) {
|
|
206
|
-
g.setOpen(!0, ce(Te, t.nativeEvent, t.currentTarget));
|
|
207
|
-
}
|
|
208
|
-
function r(t) {
|
|
209
|
-
y === "auto" && Ge(t.nativeEvent) && (M.current = !s);
|
|
210
|
-
}
|
|
211
|
-
function l(t) {
|
|
212
|
-
M.current = y, y === "auto" && $e(t.nativeEvent) && (M.current = !0);
|
|
213
|
-
}
|
|
214
|
-
return {
|
|
215
|
-
onKeyDown(t) {
|
|
216
|
-
const i = g.select("open");
|
|
217
|
-
v.current = !1;
|
|
218
|
-
const xe = t.key.startsWith("Arrow"), we = je(t.key, _(), O), ye = $(t.key, a), ke = (w ? we : ye) || t.key === "Enter" || t.key.trim() === "";
|
|
219
|
-
if (s && i)
|
|
220
|
-
return A(t);
|
|
221
|
-
if (!(!i && !X && xe)) {
|
|
222
|
-
if (ke) {
|
|
223
|
-
const Ve = $(t.key, _());
|
|
224
|
-
b.current = w && Ve ? null : t.key;
|
|
225
|
-
}
|
|
226
|
-
if (w) {
|
|
227
|
-
we && (P(t), i ? (o.current = Ee(), u(t)) : e(t));
|
|
228
|
-
return;
|
|
229
|
-
}
|
|
230
|
-
ye && (N.current != null && (o.current = N.current), P(t), !i && X ? e(t) : A(t), i && u(t));
|
|
231
|
-
}
|
|
232
|
-
},
|
|
233
|
-
onFocus(t) {
|
|
234
|
-
g.select("open") && !s && (o.current = -1, u(t));
|
|
235
|
-
},
|
|
236
|
-
onPointerDown: l,
|
|
237
|
-
onPointerEnter: l,
|
|
238
|
-
onMouseDown: r,
|
|
239
|
-
onClick: r
|
|
240
|
-
};
|
|
241
|
-
}, [A, y, Ee, w, u, g, X, a, _, O, N, s]), Oe = f.useMemo(() => ({
|
|
242
|
-
...q,
|
|
243
|
-
...H
|
|
244
|
-
}), [q, H]);
|
|
245
|
-
return f.useMemo(() => R ? {
|
|
246
|
-
reference: Oe,
|
|
247
|
-
floating: Ie,
|
|
248
|
-
item: oe,
|
|
249
|
-
trigger: H
|
|
250
|
-
} : {}, [R, Oe, Ie, H, oe]);
|
|
1
|
+
import * as o from "react";
|
|
2
|
+
const t = /* @__PURE__ */ o.createContext(void 0);
|
|
3
|
+
process.env.NODE_ENV !== "production" && (t.displayName = "ToolbarRootContext");
|
|
4
|
+
function r(e) {
|
|
5
|
+
return o.useContext(t);
|
|
251
6
|
}
|
|
252
7
|
export {
|
|
253
|
-
|
|
254
|
-
|
|
8
|
+
t as ToolbarRootContext,
|
|
9
|
+
r as useToolbarRootContext
|
|
255
10
|
};
|
|
256
11
|
//# sourceMappingURL=index303.js.map
|