@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/index279.js
CHANGED
|
@@ -1,148 +1,243 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
if (
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
1
|
+
import * as l from "react";
|
|
2
|
+
import { addEventListener as i } from "./index300.js";
|
|
3
|
+
import { mergeCleanups as G } from "./index378.js";
|
|
4
|
+
import { ownerDocument as fe } from "./index284.js";
|
|
5
|
+
import { useStableCallback as p } from "./index262.js";
|
|
6
|
+
import { useTimeout as de, Timeout as pe } from "./index285.js";
|
|
7
|
+
import { isElement as _, isShadowRoot as Be, isLastTraversableNode as J, getParentNode as ve, isHTMLElement as Ae, getComputedStyle as He } from "./index308.js";
|
|
8
|
+
import { useFloatingTree as Ne } from "./index386.js";
|
|
9
|
+
import { createChangeEventDetails as Q } from "./index175.js";
|
|
10
|
+
import { createAttribute as Le } from "./index383.js";
|
|
11
|
+
import { isEventTargetWithin as Z, isRootElement as Fe } from "./index290.js";
|
|
12
|
+
import { isReactEvent as $e } from "./index313.js";
|
|
13
|
+
import { getNodeChildren as me } from "./index381.js";
|
|
14
|
+
import { getTarget as z, contains as B } from "./index291.js";
|
|
15
|
+
import { triggerPress as qe, escapeKey as Ve, outsidePress as Ue } from "./index177.js";
|
|
16
|
+
import { webkit as je } from "./index310.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);
|
|
76
168
|
});
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
* Used to subscribe to specific parts of the state.
|
|
95
|
-
* This methods causes a rerender whenever the selected state changes.
|
|
96
|
-
*
|
|
97
|
-
* @param key Key of the selector to use.
|
|
98
|
-
*/
|
|
99
|
-
useState(e, t, s, o) {
|
|
100
|
-
return c.useDebugValue(e), a(this, this.selectors[e], t, s, o);
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Wraps a function with `useStableCallback` to ensure it has a stable reference
|
|
104
|
-
* and assigns it to the context.
|
|
105
|
-
*
|
|
106
|
-
* @param key Key of the event callback. Must be a function in the context.
|
|
107
|
-
* @param fn Function to assign.
|
|
108
|
-
*/
|
|
109
|
-
useContextCallback(e, t) {
|
|
110
|
-
c.useDebugValue(e);
|
|
111
|
-
const s = f(t ?? d);
|
|
112
|
-
this.context[e] = s;
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Returns a stable setter function for a specific key in the store's state.
|
|
116
|
-
* It's commonly used to pass as a ref callback to React elements.
|
|
117
|
-
*
|
|
118
|
-
* @param key Key of the state to set.
|
|
119
|
-
*/
|
|
120
|
-
useStateSetter(e) {
|
|
121
|
-
const t = c.useRef(void 0);
|
|
122
|
-
return t.current === void 0 && (t.current = (s) => {
|
|
123
|
-
this.set(e, s);
|
|
124
|
-
}), t.current;
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Observes changes derived from the store's selectors and calls the listener when the selected value changes.
|
|
128
|
-
*
|
|
129
|
-
* @param key Key of the selector to observe.
|
|
130
|
-
* @param listener Listener function called when the selector result changes.
|
|
131
|
-
*/
|
|
132
|
-
observe(e, t) {
|
|
133
|
-
let s;
|
|
134
|
-
typeof e == "function" ? s = e : s = this.selectors[e];
|
|
135
|
-
let o = s(this.state);
|
|
136
|
-
return t(o, o, this), this.subscribe((n) => {
|
|
137
|
-
const r = s(n);
|
|
138
|
-
if (!Object.is(o, r)) {
|
|
139
|
-
const i = o;
|
|
140
|
-
o = r, t(r, i, this);
|
|
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
|
+
}
|
|
141
186
|
}
|
|
142
|
-
}
|
|
143
|
-
|
|
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]);
|
|
144
238
|
}
|
|
145
239
|
export {
|
|
146
|
-
|
|
240
|
+
Je as normalizeProp,
|
|
241
|
+
dt as useDismiss
|
|
147
242
|
};
|
|
148
243
|
//# sourceMappingURL=index279.js.map
|
package/dist/index279.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index279.js","sources":["../../../node_modules/@base-ui/utils/store/ReactStore.mjs"],"sourcesContent":["/* False positives - ESLint thinks we're calling a hook from a class component. */\n/* eslint-disable react-hooks/rules-of-hooks */\n'use client';\n\nimport * as React from 'react';\nimport { Store } from \"./Store.mjs\";\nimport { useStore } from \"./useStore.mjs\";\nimport { useStableCallback } from \"../useStableCallback.mjs\";\nimport { useIsoLayoutEffect } from \"../useIsoLayoutEffect.mjs\";\nimport { NOOP } from \"../empty.mjs\";\n\n/**\n * A Store that supports controlled state keys, non-reactive values and provides utility methods for React.\n */\nexport class ReactStore extends Store {\n /**\n * Creates a new ReactStore instance.\n *\n * @param state Initial state of the store.\n * @param context Non-reactive context values.\n * @param selectors Optional selectors for use with `useState`.\n */\n constructor(state, context = {}, selectors) {\n super(state);\n this.context = context;\n this.selectors = selectors;\n }\n\n /**\n * Non-reactive values such as refs, callbacks, etc.\n */\n\n /**\n * Synchronizes a single external value into the store.\n *\n * Note that the while the value in `state` is updated immediately, the value returned\n * by `useState` is updated before the next render (similarly to React's `useState`).\n */\n useSyncedValue(key, value) {\n React.useDebugValue(key);\n // eslint-disable-next-line consistent-this\n const store = this;\n useIsoLayoutEffect(() => {\n if (store.state[key] !== value) {\n store.set(key, value);\n }\n }, [store, key, value]);\n }\n\n /**\n * Synchronizes a single external value into the store and\n * cleans it up (sets to `undefined`) on unmount.\n *\n * Note that the while the value in `state` is updated immediately, the value returned\n * by `useState` is updated before the next render (similarly to React's `useState`).\n */\n useSyncedValueWithCleanup(key, value) {\n // eslint-disable-next-line consistent-this\n const store = this;\n useIsoLayoutEffect(() => {\n if (store.state[key] !== value) {\n store.set(key, value);\n }\n return () => {\n store.set(key, undefined);\n };\n }, [store, key, value]);\n }\n\n /**\n * Synchronizes multiple external values into the store.\n *\n * Note that the while the values in `state` are updated immediately, the values returned\n * by `useState` are updated before the next render (similarly to React's `useState`).\n */\n useSyncedValues(statePart) {\n // eslint-disable-next-line consistent-this\n const store = this;\n if (process.env.NODE_ENV !== 'production') {\n // Check that an object with the same shape is passed on every render\n React.useDebugValue(statePart, p => Object.keys(p));\n const keys = React.useRef(Object.keys(statePart)).current;\n const nextKeys = Object.keys(statePart);\n if (keys.length !== nextKeys.length || keys.some((key, index) => key !== nextKeys[index])) {\n console.error('ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.');\n }\n }\n const dependencies = Object.values(statePart);\n useIsoLayoutEffect(() => {\n store.update(statePart);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [store, ...dependencies]);\n }\n\n /**\n * Registers a controllable prop pair (`controlled`, `defaultValue`) for a specific key. If `controlled`\n * is non-undefined, the store's state at `key` is updated to match `controlled`.\n */\n useControlledProp(key, controlled) {\n React.useDebugValue(key);\n // eslint-disable-next-line consistent-this\n const store = this;\n const isControlled = controlled !== undefined;\n useIsoLayoutEffect(() => {\n if (isControlled && !Object.is(store.state[key], controlled)) {\n // Set the internal state to match the controlled value.\n store.setState({\n ...store.state,\n [key]: controlled\n });\n }\n }, [store, key, controlled, isControlled]);\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line\n const cache = this.controlledValues ??= new Map();\n if (!cache.has(key)) {\n cache.set(key, isControlled);\n }\n const previouslyControlled = cache.get(key);\n if (previouslyControlled !== undefined && previouslyControlled !== isControlled) {\n console.error(`A component is changing the ${isControlled ? '' : 'un'}controlled state of ${key.toString()} to be ${isControlled ? 'un' : ''}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`);\n }\n }\n }\n\n /** Gets the current value from the store using a selector with the provided key.\n *\n * @param key Key of the selector to use.\n */\n\n select(key, a1, a2, a3) {\n const selector = this.selectors[key];\n return selector(this.state, a1, a2, a3);\n }\n\n /**\n * Returns a value from the store's state using a selector function.\n * Used to subscribe to specific parts of the state.\n * This methods causes a rerender whenever the selected state changes.\n *\n * @param key Key of the selector to use.\n */\n\n useState(key, a1, a2, a3) {\n React.useDebugValue(key);\n return useStore(this, this.selectors[key], a1, a2, a3);\n }\n\n /**\n * Wraps a function with `useStableCallback` to ensure it has a stable reference\n * and assigns it to the context.\n *\n * @param key Key of the event callback. Must be a function in the context.\n * @param fn Function to assign.\n */\n useContextCallback(key, fn) {\n React.useDebugValue(key);\n const stableFunction = useStableCallback(fn ?? NOOP);\n this.context[key] = stableFunction;\n }\n\n /**\n * Returns a stable setter function for a specific key in the store's state.\n * It's commonly used to pass as a ref callback to React elements.\n *\n * @param key Key of the state to set.\n */\n useStateSetter(key) {\n const ref = React.useRef(undefined);\n if (ref.current === undefined) {\n ref.current = value => {\n this.set(key, value);\n };\n }\n return ref.current;\n }\n\n /**\n * Observes changes derived from the store's selectors and calls the listener when the selected value changes.\n *\n * @param key Key of the selector to observe.\n * @param listener Listener function called when the selector result changes.\n */\n\n observe(selector, listener) {\n let selectFn;\n if (typeof selector === 'function') {\n selectFn = selector;\n } else {\n selectFn = this.selectors[selector];\n }\n let prevValue = selectFn(this.state);\n listener(prevValue, prevValue, this);\n return this.subscribe(nextState => {\n const nextValue = selectFn(nextState);\n if (!Object.is(prevValue, nextValue)) {\n const oldValue = prevValue;\n prevValue = nextValue;\n listener(nextValue, oldValue, this);\n }\n });\n }\n}"],"names":["ReactStore","Store","state","context","selectors","key","value","React","store","useIsoLayoutEffect","statePart","p","keys","nextKeys","index","dependencies","controlled","isControlled","cache","previouslyControlled","a1","a2","a3","selector","useStore","fn","stableFunction","useStableCallback","NOOP","ref","listener","selectFn","prevValue","nextState","nextValue","oldValue"],"mappings":";;;;;;AAcO,MAAMA,UAAmBC,EAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQpC,YAAYC,GAAOC,IAAU,CAAA,GAAIC,GAAW;AAC1C,UAAMF,CAAK,GACX,KAAK,UAAUC,GACf,KAAK,YAAYC;AAAA,EACnB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,eAAeC,GAAKC,GAAO;AACzB,IAAAC,EAAM,cAAcF,CAAG;AAEvB,UAAMG,IAAQ;AACd,IAAAC,EAAmB,MAAM;AACvB,MAAID,EAAM,MAAMH,CAAG,MAAMC,KACvBE,EAAM,IAAIH,GAAKC,CAAK;AAAA,IAExB,GAAG,CAACE,GAAOH,GAAKC,CAAK,CAAC;AAAA,EAC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;AAAA;AAAA;AAAA;AAAA,EASA,QAAQN,GAAUO,GAAU;AAC1B,QAAIC;AACJ,IAAI,OAAOR,KAAa,aACtBQ,IAAWR,IAEXQ,IAAW,KAAK,UAAUR,CAAQ;AAEpC,QAAIS,IAAYD,EAAS,KAAK,KAAK;AACnC,WAAAD,EAASE,GAAWA,GAAW,IAAI,GAC5B,KAAK,UAAU,CAAAC,MAAa;AACjC,YAAMC,IAAYH,EAASE,CAAS;AACpC,UAAI,CAAC,OAAO,GAAGD,GAAWE,CAAS,GAAG;AACpC,cAAMC,IAAWH;AACjB,QAAAA,IAAYE,GACZJ,EAASI,GAAWC,GAAU,IAAI;AAAA,MACpC;AAAA,IACF,CAAC;AAAA,EACH;AACF;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index279.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,cAAc,OAAOA,KAAiB,YAAYA,IAAeA,GAAc,gBAAgB;AAAA,EACnG;AACA;AAMO,SAASC,GAAWC,GAASC,KAAQ,IAAI;AAC9C,QAAM;AAAA,IACJ,SAAAC,IAAU;AAAA,IACd,WAAIC,IAAY;AAAA,IACZ,cAAcC,IAAmB;AAAA,IACjC,mBAAAC,KAAoB;AAAA,IACpB,gBAAAC,KAAiBV;AAAA,IACjB,SAAAW;AAAA,IACA,cAAAC;AAAA,EACJ,IAAMP,IACEQ,IAAQ,eAAeT,IAAUA,EAAQ,YAAYA,GACrDU,IAAOD,EAAM,SAAS,MAAM,GAC5BE,KAAkBF,EAAM,SAAS,iBAAiB,GAClD;AAAA,IACJ,SAAAG;AAAA,EACJ,IAAMH,EAAM,SACJI,IAAOC,GAAgBN,EAAY,GACnCO,KAAiBC,EAAkB,OAAOZ,KAAqB,aAAaA,IAAmB,MAAM,EAAK,GAC1Ga,IAAe,OAAOb,KAAqB,aAAaW,KAAiBX,GACzEc,KAAsBD,MAAiB,IACvCE,K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