@okam/stack-ui 1.42.1 → 1.42.3
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/CHANGELOG.md +23 -0
- package/components/ShareButton/interface.d.ts +0 -1
- package/index100.js +1 -1
- package/index100.mjs +1 -1
- package/index101.js +1 -1
- package/index101.mjs +1 -1
- package/index102.js +1 -1
- package/index102.mjs +1 -1
- package/index151.js +1 -1
- package/index151.mjs +1 -1
- package/index153.js +1 -1
- package/index153.mjs +4 -4
- package/index154.js +1 -1
- package/index154.mjs +2 -2
- package/index155.js +1 -1
- package/index155.mjs +1 -1
- package/index156.js +1 -1
- package/index156.mjs +1 -1
- package/index161.js +1 -1
- package/index161.mjs +2 -2
- package/index163.js +1 -1
- package/index163.mjs +2 -2
- package/index164.js +1 -1
- package/index164.mjs +5 -5
- package/index165.js +1 -1
- package/index165.mjs +3 -3
- package/index167.js +1 -1
- package/index167.mjs +2 -2
- package/index172.js +1 -1
- package/index172.mjs +2 -2
- package/index176.js +1 -1
- package/index176.mjs +4 -4
- package/index177.js +1 -1
- package/index177.mjs +1 -1
- package/index178.js +1 -1
- package/index178.mjs +2 -2
- package/index179.js +1 -1
- package/index179.mjs +3 -3
- package/index181.js +1 -1
- package/index181.mjs +3 -3
- package/index187.js +1 -1
- package/index187.mjs +5 -11
- package/index188.js +2 -1
- package/index188.mjs +49 -5
- package/index189.js +1 -2
- package/index189.mjs +11 -49
- package/index232.js +1 -1
- package/index232.mjs +132 -117
- package/index233.js +1 -1
- package/index233.mjs +196 -26
- package/index234.js +1 -1
- package/index234.mjs +18 -69
- package/index235.js +1 -1
- package/index235.mjs +4 -382
- package/index236.js +1 -1
- package/index236.mjs +28 -46
- package/index237.js +1 -1
- package/index237.mjs +50 -4
- package/index238.js +1 -1
- package/index238.mjs +52 -22
- package/index239.js +1 -1
- package/index239.mjs +46 -45
- package/index240.js +1 -1
- package/index240.mjs +96 -4
- package/index241.js +1 -1
- package/index241.mjs +5 -24
- package/index242.js +1 -1
- package/index242.mjs +6 -12
- package/index243.js +1 -1
- package/index243.mjs +41 -4
- package/index244.js +1 -1
- package/index244.mjs +72 -15
- package/index245.js +1 -1
- package/index245.mjs +14 -42
- package/index246.js +1 -1
- package/index246.mjs +66 -55
- package/index247.js +1 -1
- package/index247.mjs +7 -41
- package/index248.js +1 -1
- package/index248.mjs +10 -27
- package/index249.js +1 -1
- package/index249.mjs +46 -30
- package/index250.js +1 -1
- package/index250.mjs +124 -13
- package/index251.js +1 -1
- package/index251.mjs +73 -10
- package/index252.js +1 -1
- package/index252.mjs +378 -25
- package/index253.js +1 -1
- package/index253.mjs +45 -8
- package/index254.js +1 -1
- package/index254.mjs +24 -6
- package/index255.js +1 -1
- package/index255.mjs +24 -5
- package/index256.js +1 -1
- package/index256.mjs +12 -7
- package/index257.js +1 -1
- package/index257.mjs +4 -29
- package/index258.js +1 -1
- package/index258.mjs +14 -18
- package/index259.js +1 -1
- package/index259.mjs +42 -13
- package/index260.js +1 -1
- package/index260.mjs +54 -40
- package/index261.js +1 -1
- package/index261.mjs +27 -7
- package/index262.js +1 -1
- package/index262.mjs +29 -15
- package/index263.js +1 -1
- package/index263.mjs +11 -3
- package/index264.js +1 -1
- package/index264.mjs +9 -4
- package/index265.js +1 -1
- package/index265.mjs +5 -19
- package/index266.js +1 -1
- package/index266.mjs +7 -54
- package/index267.js +1 -1
- package/index267.mjs +25 -136
- package/index268.js +1 -1
- package/index268.mjs +17 -196
- package/index269.js +1 -1
- package/index269.mjs +12 -21
- package/index270.js +1 -1
- package/index270.mjs +41 -47
- package/index271.js +1 -1
- package/index271.mjs +7 -47
- package/index272.js +1 -1
- package/index272.mjs +15 -95
- package/index273.js +1 -1
- package/index273.mjs +3 -72
- package/index274.js +1 -1
- package/index274.mjs +4 -68
- package/index275.js +1 -1
- package/index275.mjs +19 -7
- package/index276.js +1 -1
- package/index276.mjs +27 -11
- package/index277.js +1 -1
- package/index277.mjs +31 -5
- package/index278.js +1 -1
- package/index278.mjs +5 -121
- package/index279.js +1 -1
- package/index279.mjs +121 -43
- package/index280.js +1 -1
- package/index280.mjs +43 -230
- package/index281.js +1 -1
- package/index281.mjs +226 -27
- package/index324.js +1 -1
- package/index324.mjs +7 -63
- package/index325.js +1 -1
- package/index325.mjs +28 -7
- package/index326.js +1 -1
- package/index326.mjs +89 -24
- package/index327.js +1 -1
- package/index327.mjs +58 -88
- package/index330.js +1 -1
- package/index330.mjs +3 -3
- package/index333.js +1 -1
- package/index333.mjs +5 -5
- package/index334.js +1 -1
- package/index334.mjs +2 -2
- package/index335.js +1 -1
- package/index335.mjs +5 -5
- package/index336.js +1 -1
- package/index336.mjs +65 -20
- package/index337.js +1 -1
- package/index337.mjs +53 -29
- package/index338.js +1 -1
- package/index338.mjs +51 -63
- package/index339.js +1 -1
- package/index339.mjs +271 -43
- package/index340.js +1 -1
- package/index340.mjs +18 -52
- package/index341.js +1 -1
- package/index341.mjs +21 -281
- package/index342.js +1 -1
- package/index342.mjs +29 -20
- package/index8.js +1 -1
- package/index8.mjs +32 -32
- package/index99.js +1 -1
- package/index99.mjs +1 -1
- package/package.json +1 -1
package/index281.mjs
CHANGED
|
@@ -1,34 +1,233 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { getItemElement as V, useCollectionId as fe, isNonContiguousSelectionModifier as H } from "./index341.mjs";
|
|
2
|
+
import { useTypeSelect as ae } from "./index342.mjs";
|
|
3
|
+
import { mergeProps as G } from "./index154.mjs";
|
|
4
|
+
import { focusWithoutScrolling as j } from "./index259.mjs";
|
|
5
|
+
import { useRouter as de } from "./index260.mjs";
|
|
6
|
+
import { useUpdateLayoutEffect as q } from "./index263.mjs";
|
|
7
|
+
import { useEvent as S } from "./index268.mjs";
|
|
8
|
+
import { scrollIntoView as ve, scrollIntoViewport as J } from "./index270.mjs";
|
|
9
|
+
import { useEffectEvent as Q } from "./index269.mjs";
|
|
10
|
+
import { FOCUS_EVENT as pe, CLEAR_FOCUS_EVENT as ye } from "./index273.mjs";
|
|
11
|
+
import { isCtrlKeyPressed as m } from "./index274.mjs";
|
|
12
|
+
import { flushSync as be } from "react-dom";
|
|
13
|
+
import { useRef as $, useEffect as X } from "react";
|
|
14
|
+
import { getInteractionModality as Y } from "./index327.mjs";
|
|
15
|
+
import { focusSafely as Z } from "./index335.mjs";
|
|
16
|
+
import { moveVirtualFocus as Ke, getFocusableTreeWalker as me } from "@react-aria/focus";
|
|
17
|
+
import { useLocale as $e } from "@react-aria/i18n";
|
|
18
|
+
function Ce(g) {
|
|
19
|
+
let { selectionManager: e, keyboardDelegate: o, ref: i, autoFocus: h = !1, shouldFocusWrap: F = !1, disallowEmptySelection: _ = !1, disallowSelectAll: ee = !1, escapeKeyBehavior: le = "clearSelection", selectOnFocus: b = e.selectionBehavior === "replace", disallowTypeAhead: oe = !1, shouldUseVirtualFocus: y, allowsTabNavigation: te = !1, isVirtualized: B, scrollRef: f = i, linkBehavior: C = "action" } = g, { direction: x } = $e(), re = de(), ce = (l) => {
|
|
20
|
+
var r;
|
|
21
|
+
if (l.altKey && l.key === "Tab" && l.preventDefault(), !(!((r = i.current) === null || r === void 0) && r.contains(l.target))) return;
|
|
22
|
+
const c = (t, v) => {
|
|
23
|
+
if (t != null) {
|
|
24
|
+
if (e.isLink(t) && C === "selection" && b && !H(l)) {
|
|
25
|
+
be(() => {
|
|
26
|
+
e.setFocusedKey(t, v);
|
|
27
|
+
});
|
|
28
|
+
let p = V(i, t), W = e.getItemProps(t);
|
|
29
|
+
p && re.open(p, l, W.href, W.routerOptions);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (e.setFocusedKey(t, v), e.isLink(t) && C === "override") return;
|
|
33
|
+
l.shiftKey && e.selectionMode === "multiple" ? e.extendSelection(t) : b && !H(l) && e.replaceSelection(t);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
switch (l.key) {
|
|
37
|
+
case "ArrowDown":
|
|
38
|
+
if (o.getKeyBelow) {
|
|
39
|
+
var n, s, u;
|
|
40
|
+
let t = e.focusedKey != null ? (n = o.getKeyBelow) === null || n === void 0 ? void 0 : n.call(o, e.focusedKey) : (s = o.getFirstKey) === null || s === void 0 ? void 0 : s.call(o);
|
|
41
|
+
t == null && F && (t = (u = o.getFirstKey) === null || u === void 0 ? void 0 : u.call(o, e.focusedKey)), t != null && (l.preventDefault(), c(t));
|
|
42
|
+
}
|
|
43
|
+
break;
|
|
44
|
+
case "ArrowUp":
|
|
45
|
+
if (o.getKeyAbove) {
|
|
46
|
+
var a, d, P;
|
|
47
|
+
let t = e.focusedKey != null ? (a = o.getKeyAbove) === null || a === void 0 ? void 0 : a.call(o, e.focusedKey) : (d = o.getLastKey) === null || d === void 0 ? void 0 : d.call(o);
|
|
48
|
+
t == null && F && (t = (P = o.getLastKey) === null || P === void 0 ? void 0 : P.call(o, e.focusedKey)), t != null && (l.preventDefault(), c(t));
|
|
49
|
+
}
|
|
50
|
+
break;
|
|
51
|
+
case "ArrowLeft":
|
|
52
|
+
if (o.getKeyLeftOf) {
|
|
53
|
+
var k, A, I;
|
|
54
|
+
let t = e.focusedKey != null ? (k = o.getKeyLeftOf) === null || k === void 0 ? void 0 : k.call(o, e.focusedKey) : null;
|
|
55
|
+
t == null && F && (t = x === "rtl" ? (A = o.getFirstKey) === null || A === void 0 ? void 0 : A.call(o, e.focusedKey) : (I = o.getLastKey) === null || I === void 0 ? void 0 : I.call(o, e.focusedKey)), t != null && (l.preventDefault(), c(t, x === "rtl" ? "first" : "last"));
|
|
56
|
+
}
|
|
57
|
+
break;
|
|
58
|
+
case "ArrowRight":
|
|
59
|
+
if (o.getKeyRightOf) {
|
|
60
|
+
var M, R, O;
|
|
61
|
+
let t = e.focusedKey != null ? (M = o.getKeyRightOf) === null || M === void 0 ? void 0 : M.call(o, e.focusedKey) : null;
|
|
62
|
+
t == null && F && (t = x === "rtl" ? (R = o.getLastKey) === null || R === void 0 ? void 0 : R.call(o, e.focusedKey) : (O = o.getFirstKey) === null || O === void 0 ? void 0 : O.call(o, e.focusedKey)), t != null && (l.preventDefault(), c(t, x === "rtl" ? "last" : "first"));
|
|
63
|
+
}
|
|
64
|
+
break;
|
|
65
|
+
case "Home":
|
|
66
|
+
if (o.getFirstKey) {
|
|
67
|
+
if (e.focusedKey === null && l.shiftKey) return;
|
|
68
|
+
l.preventDefault();
|
|
69
|
+
let t = o.getFirstKey(e.focusedKey, m(l));
|
|
70
|
+
e.setFocusedKey(t), t != null && (m(l) && l.shiftKey && e.selectionMode === "multiple" ? e.extendSelection(t) : b && e.replaceSelection(t));
|
|
71
|
+
}
|
|
72
|
+
break;
|
|
73
|
+
case "End":
|
|
74
|
+
if (o.getLastKey) {
|
|
75
|
+
if (e.focusedKey === null && l.shiftKey) return;
|
|
76
|
+
l.preventDefault();
|
|
77
|
+
let t = o.getLastKey(e.focusedKey, m(l));
|
|
78
|
+
e.setFocusedKey(t), t != null && (m(l) && l.shiftKey && e.selectionMode === "multiple" ? e.extendSelection(t) : b && e.replaceSelection(t));
|
|
79
|
+
}
|
|
80
|
+
break;
|
|
81
|
+
case "PageDown":
|
|
82
|
+
if (o.getKeyPageBelow && e.focusedKey != null) {
|
|
83
|
+
let t = o.getKeyPageBelow(e.focusedKey);
|
|
84
|
+
t != null && (l.preventDefault(), c(t));
|
|
85
|
+
}
|
|
86
|
+
break;
|
|
87
|
+
case "PageUp":
|
|
88
|
+
if (o.getKeyPageAbove && e.focusedKey != null) {
|
|
89
|
+
let t = o.getKeyPageAbove(e.focusedKey);
|
|
90
|
+
t != null && (l.preventDefault(), c(t));
|
|
91
|
+
}
|
|
92
|
+
break;
|
|
93
|
+
case "a":
|
|
94
|
+
m(l) && e.selectionMode === "multiple" && ee !== !0 && (l.preventDefault(), e.selectAll());
|
|
95
|
+
break;
|
|
96
|
+
case "Escape":
|
|
97
|
+
le === "clearSelection" && !_ && e.selectedKeys.size !== 0 && (l.stopPropagation(), l.preventDefault(), e.clearSelection());
|
|
98
|
+
break;
|
|
99
|
+
case "Tab":
|
|
100
|
+
if (!te) {
|
|
101
|
+
if (l.shiftKey) i.current.focus();
|
|
102
|
+
else {
|
|
103
|
+
let t = me(i.current, {
|
|
104
|
+
tabbable: !0
|
|
105
|
+
}), v, p;
|
|
106
|
+
do
|
|
107
|
+
p = t.lastChild(), p && (v = p);
|
|
108
|
+
while (p);
|
|
109
|
+
v && !v.contains(document.activeElement) && j(v);
|
|
110
|
+
}
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}, w = $({
|
|
115
|
+
top: 0,
|
|
116
|
+
left: 0
|
|
117
|
+
});
|
|
118
|
+
S(f, "scroll", B ? void 0 : () => {
|
|
119
|
+
var l, r, c, n;
|
|
120
|
+
w.current = {
|
|
121
|
+
top: (c = (l = f.current) === null || l === void 0 ? void 0 : l.scrollTop) !== null && c !== void 0 ? c : 0,
|
|
122
|
+
left: (n = (r = f.current) === null || r === void 0 ? void 0 : r.scrollLeft) !== null && n !== void 0 ? n : 0
|
|
123
|
+
};
|
|
124
|
+
});
|
|
125
|
+
let ie = (l) => {
|
|
126
|
+
if (e.isFocused) {
|
|
127
|
+
l.currentTarget.contains(l.target) || e.setFocused(!1);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
if (l.currentTarget.contains(l.target)) {
|
|
131
|
+
if (e.setFocused(!0), e.focusedKey == null) {
|
|
132
|
+
var r, c;
|
|
133
|
+
let u = (d) => {
|
|
134
|
+
d != null && (e.setFocusedKey(d), b && !e.isSelected(d) && e.replaceSelection(d));
|
|
135
|
+
}, a = l.relatedTarget;
|
|
136
|
+
var n, s;
|
|
137
|
+
a && l.currentTarget.compareDocumentPosition(a) & Node.DOCUMENT_POSITION_FOLLOWING ? u((n = e.lastSelectedKey) !== null && n !== void 0 ? n : (r = o.getLastKey) === null || r === void 0 ? void 0 : r.call(o)) : u((s = e.firstSelectedKey) !== null && s !== void 0 ? s : (c = o.getFirstKey) === null || c === void 0 ? void 0 : c.call(o));
|
|
138
|
+
} else !B && f.current && (f.current.scrollTop = w.current.top, f.current.scrollLeft = w.current.left);
|
|
139
|
+
if (e.focusedKey != null && f.current) {
|
|
140
|
+
let u = V(i, e.focusedKey);
|
|
141
|
+
u instanceof HTMLElement && (!u.contains(document.activeElement) && !y && j(u), Y() === "keyboard" && J(u, {
|
|
142
|
+
containingElement: i.current
|
|
143
|
+
}));
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}, ne = (l) => {
|
|
147
|
+
l.currentTarget.contains(l.relatedTarget) || e.setFocused(!1);
|
|
148
|
+
}, K = $(!1);
|
|
149
|
+
S(i, pe, y ? (l) => {
|
|
150
|
+
let { detail: r } = l;
|
|
151
|
+
l.stopPropagation(), e.setFocused(!0), (r == null ? void 0 : r.focusStrategy) === "first" && (K.current = !0);
|
|
152
|
+
} : void 0);
|
|
153
|
+
let N = Q(() => {
|
|
154
|
+
var l, r;
|
|
155
|
+
let c = (r = (l = o.getFirstKey) === null || l === void 0 ? void 0 : l.call(o)) !== null && r !== void 0 ? r : null;
|
|
156
|
+
c == null ? (Ke(i.current), e.collection.size > 0 && (K.current = !1)) : (e.setFocusedKey(c), K.current = !1);
|
|
157
|
+
});
|
|
158
|
+
q(() => {
|
|
159
|
+
K.current && N();
|
|
160
|
+
}, [
|
|
161
|
+
e.collection,
|
|
162
|
+
N
|
|
163
|
+
]);
|
|
164
|
+
let U = Q(() => {
|
|
165
|
+
e.collection.size > 0 && (K.current = !1);
|
|
166
|
+
});
|
|
167
|
+
q(() => {
|
|
168
|
+
U();
|
|
169
|
+
}, [
|
|
170
|
+
e.focusedKey,
|
|
171
|
+
U
|
|
172
|
+
]), S(i, ye, y ? (l) => {
|
|
173
|
+
var r;
|
|
174
|
+
l.stopPropagation(), e.setFocused(!1), !((r = l.detail) === null || r === void 0) && r.clearFocusKey && e.setFocusedKey(null);
|
|
175
|
+
} : void 0);
|
|
176
|
+
const z = $(h), T = $(!1);
|
|
177
|
+
X(() => {
|
|
178
|
+
if (z.current) {
|
|
179
|
+
var l, r;
|
|
180
|
+
let s = null;
|
|
181
|
+
var c;
|
|
182
|
+
h === "first" && (s = (c = (l = o.getFirstKey) === null || l === void 0 ? void 0 : l.call(o)) !== null && c !== void 0 ? c : null);
|
|
18
183
|
var n;
|
|
19
|
-
|
|
20
|
-
|
|
184
|
+
h === "last" && (s = (n = (r = o.getLastKey) === null || r === void 0 ? void 0 : r.call(o)) !== null && n !== void 0 ? n : null);
|
|
185
|
+
let u = e.selectedKeys;
|
|
186
|
+
if (u.size) {
|
|
187
|
+
for (let a of u) if (e.canSelectItem(a)) {
|
|
188
|
+
s = a;
|
|
189
|
+
break;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
e.setFocused(!0), e.setFocusedKey(s), s == null && !y && i.current && Z(i.current), e.collection.size > 0 && (z.current = !1, T.current = !0);
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
let D = $(e.focusedKey);
|
|
196
|
+
X(() => {
|
|
197
|
+
if (e.isFocused && e.focusedKey != null && (e.focusedKey !== D.current || T.current) && f.current && i.current) {
|
|
198
|
+
let l = Y(), r = V(i, e.focusedKey);
|
|
199
|
+
if (!(r instanceof HTMLElement))
|
|
200
|
+
return;
|
|
201
|
+
(l === "keyboard" || T.current) && (ve(f.current, r), l !== "virtual" && J(r, {
|
|
202
|
+
containingElement: i.current
|
|
203
|
+
}));
|
|
204
|
+
}
|
|
205
|
+
!y && e.isFocused && e.focusedKey == null && D.current != null && i.current && Z(i.current), D.current = e.focusedKey, T.current = !1;
|
|
206
|
+
}), S(i, "react-aria-focus-scope-restore", (l) => {
|
|
207
|
+
l.preventDefault(), e.setFocused(!0);
|
|
208
|
+
});
|
|
209
|
+
let E = {
|
|
210
|
+
onKeyDown: ce,
|
|
211
|
+
onFocus: ie,
|
|
212
|
+
onBlur: ne,
|
|
213
|
+
onMouseDown(l) {
|
|
214
|
+
f.current === l.target && l.preventDefault();
|
|
21
215
|
}
|
|
22
|
-
}
|
|
216
|
+
}, { typeSelectProps: ue } = ae({
|
|
217
|
+
keyboardDelegate: o,
|
|
218
|
+
selectionManager: e
|
|
219
|
+
});
|
|
220
|
+
oe || (E = G(ue, E));
|
|
221
|
+
let L;
|
|
222
|
+
y || (L = e.focusedKey == null ? 0 : -1);
|
|
223
|
+
let se = fe(e.collection);
|
|
23
224
|
return {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
setSelectedKey: c,
|
|
29
|
-
selectedItem: r
|
|
225
|
+
collectionProps: G(E, {
|
|
226
|
+
tabIndex: L,
|
|
227
|
+
"data-collection": se
|
|
228
|
+
})
|
|
30
229
|
};
|
|
31
230
|
}
|
|
32
231
|
export {
|
|
33
|
-
|
|
232
|
+
Ce as useSelectableCollection
|
|
34
233
|
};
|
package/index324.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),e=t.createContext({register:()=>{}});e.displayName="PressResponderContext";exports.PressResponderContext=e;
|
package/index324.mjs
CHANGED
|
@@ -1,65 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
function u(e, n) {
|
|
8
|
-
for (let t of w) t(e, n);
|
|
9
|
-
}
|
|
10
|
-
function g(e) {
|
|
11
|
-
return !(e.metaKey || !L() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
|
|
12
|
-
}
|
|
13
|
-
function d(e) {
|
|
14
|
-
a = !0, g(e) && (f = "keyboard", u("keyboard", e));
|
|
15
|
-
}
|
|
16
|
-
function o(e) {
|
|
17
|
-
f = "pointer", (e.type === "mousedown" || e.type === "pointerdown") && (a = !0, u("pointer", e));
|
|
18
|
-
}
|
|
19
|
-
function l(e) {
|
|
20
|
-
y(e) && (a = !0, f = "virtual");
|
|
21
|
-
}
|
|
22
|
-
function p(e) {
|
|
23
|
-
e.target === window || e.target === document || b || !e.isTrusted || (!a && !c && (f = "virtual", u("virtual", e)), a = !1, c = !1);
|
|
24
|
-
}
|
|
25
|
-
function E() {
|
|
26
|
-
b || (a = !1, c = !0);
|
|
27
|
-
}
|
|
28
|
-
function $(e) {
|
|
29
|
-
if (typeof window > "u" || i.get(s(e))) return;
|
|
30
|
-
const n = s(e), t = v(e);
|
|
31
|
-
let r = n.HTMLElement.prototype.focus;
|
|
32
|
-
n.HTMLElement.prototype.focus = function() {
|
|
33
|
-
a = !0, r.apply(this, arguments);
|
|
34
|
-
}, t.addEventListener("keydown", d, !0), t.addEventListener("keyup", d, !0), t.addEventListener("click", l, !0), n.addEventListener("focus", p, !0), n.addEventListener("blur", E, !1), typeof PointerEvent < "u" ? (t.addEventListener("pointerdown", o, !0), t.addEventListener("pointermove", o, !0), t.addEventListener("pointerup", o, !0)) : process.env.NODE_ENV === "test" && (t.addEventListener("mousedown", o, !0), t.addEventListener("mousemove", o, !0), t.addEventListener("mouseup", o, !0)), n.addEventListener("beforeunload", () => {
|
|
35
|
-
m(e);
|
|
36
|
-
}, {
|
|
37
|
-
once: !0
|
|
38
|
-
}), i.set(n, {
|
|
39
|
-
focus: r
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
const m = (e, n) => {
|
|
43
|
-
const t = s(e), r = v(e);
|
|
44
|
-
n && r.removeEventListener("DOMContentLoaded", n), i.has(t) && (t.HTMLElement.prototype.focus = i.get(t).focus, r.removeEventListener("keydown", d, !0), r.removeEventListener("keyup", d, !0), r.removeEventListener("click", l, !0), t.removeEventListener("focus", p, !0), t.removeEventListener("blur", E, !1), typeof PointerEvent < "u" ? (r.removeEventListener("pointerdown", o, !0), r.removeEventListener("pointermove", o, !0), r.removeEventListener("pointerup", o, !0)) : process.env.NODE_ENV === "test" && (r.removeEventListener("mousedown", o, !0), r.removeEventListener("mousemove", o, !0), r.removeEventListener("mouseup", o, !0)), i.delete(t));
|
|
45
|
-
};
|
|
46
|
-
function k(e) {
|
|
47
|
-
const n = v(e);
|
|
48
|
-
let t;
|
|
49
|
-
return n.readyState !== "loading" ? $(e) : (t = () => {
|
|
50
|
-
$(e);
|
|
51
|
-
}, n.addEventListener("DOMContentLoaded", t)), () => m(e, t);
|
|
52
|
-
}
|
|
53
|
-
typeof document < "u" && k();
|
|
54
|
-
function D() {
|
|
55
|
-
return f;
|
|
56
|
-
}
|
|
57
|
-
function F(e) {
|
|
58
|
-
f = e, u(e, null);
|
|
59
|
-
}
|
|
1
|
+
import e from "react";
|
|
2
|
+
const t = e.createContext({
|
|
3
|
+
register: () => {
|
|
4
|
+
}
|
|
5
|
+
});
|
|
6
|
+
t.displayName = "PressResponderContext";
|
|
60
7
|
export {
|
|
61
|
-
|
|
62
|
-
D as getInteractionModality,
|
|
63
|
-
i as hasSetupGlobalListeners,
|
|
64
|
-
F as setInteractionModality
|
|
8
|
+
t as PressResponderContext
|
|
65
9
|
};
|
package/index325.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index326.js"),a=require("react"),r=require("./index255.js"),F=require("./index256.js");function v(l){let{isDisabled:u,onFocus:o,onBlur:n,onFocusChange:t}=l;const c=a.useCallback(e=>{if(e.target===e.currentTarget)return n&&n(e),t&&t(!1),!0},[n,t]),s=g.useSyntheticBlurEvent(c),d=a.useCallback(e=>{const i=F.getOwnerDocument(e.target),f=i?r.getActiveElement(i):r.getActiveElement();e.target===e.currentTarget&&f===r.getEventTarget(e.nativeEvent)&&(o&&o(e),t&&t(!0),s(e))},[t,o,s]);return{focusProps:{onFocus:!u&&(o||t||n)?d:void 0,onBlur:!u&&(n||t)?c:void 0}}}exports.useFocus=v;
|
package/index325.mjs
CHANGED
|
@@ -1,9 +1,30 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
t
|
|
1
|
+
import { useSyntheticBlurEvent as l } from "./index326.mjs";
|
|
2
|
+
import { useCallback as u } from "react";
|
|
3
|
+
import { getActiveElement as a, getEventTarget as p } from "./index255.mjs";
|
|
4
|
+
import { getOwnerDocument as m } from "./index256.mjs";
|
|
5
|
+
function x(d) {
|
|
6
|
+
let { isDisabled: r, onFocus: n, onBlur: o, onFocusChange: t } = d;
|
|
7
|
+
const c = u((e) => {
|
|
8
|
+
if (e.target === e.currentTarget)
|
|
9
|
+
return o && o(e), t && t(!1), !0;
|
|
10
|
+
}, [
|
|
11
|
+
o,
|
|
12
|
+
t
|
|
13
|
+
]), f = l(c), i = u((e) => {
|
|
14
|
+
const s = m(e.target), $ = s ? a(s) : a();
|
|
15
|
+
e.target === e.currentTarget && $ === p(e.nativeEvent) && (n && n(e), t && t(!0), f(e));
|
|
16
|
+
}, [
|
|
17
|
+
t,
|
|
18
|
+
n,
|
|
19
|
+
f
|
|
20
|
+
]);
|
|
21
|
+
return {
|
|
22
|
+
focusProps: {
|
|
23
|
+
onFocus: !r && (n || t || o) ? i : void 0,
|
|
24
|
+
onBlur: !r && (o || t) ? c : void 0
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
7
28
|
export {
|
|
8
|
-
|
|
29
|
+
x as useFocus
|
|
9
30
|
};
|
package/index326.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./index256.js"),l=require("./index259.js"),E=require("./index235.js"),m=require("./index269.js"),p=require("./index275.js"),d=require("react");function f(r){let e=r;return e.nativeEvent=r,e.isDefaultPrevented=()=>e.defaultPrevented,e.isPropagationStopped=()=>e.cancelBubble,e.persist=()=>{},e}function g(r,e){Object.defineProperty(r,"target",{value:e}),Object.defineProperty(r,"currentTarget",{value:e})}function F(r){let e=d.useRef({isFocused:!1,observer:null});E.useLayoutEffect(()=>{const t=e.current;return()=>{t.observer&&(t.observer.disconnect(),t.observer=null)}},[]);let u=m.useEffectEvent(t=>{r==null||r(t)});return d.useCallback(t=>{if(t.target instanceof HTMLButtonElement||t.target instanceof HTMLInputElement||t.target instanceof HTMLTextAreaElement||t.target instanceof HTMLSelectElement){e.current.isFocused=!0;let o=t.target,s=c=>{if(e.current.isFocused=!1,o.disabled){let i=f(c);u(i)}e.current.observer&&(e.current.observer.disconnect(),e.current.observer=null)};o.addEventListener("focusout",s,{once:!0}),e.current.observer=new MutationObserver(()=>{if(e.current.isFocused&&o.disabled){var c;(c=e.current.observer)===null||c===void 0||c.disconnect();let i=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:i})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:i}))}}),e.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[u])}exports.ignoreFocusEvent=!1;function L(r){for(;r&&!p.isFocusable(r);)r=r.parentElement;let e=b.getOwnerWindow(r),u=e.document.activeElement;if(!u||u===r)return;exports.ignoreFocusEvent=!0;let t=!1,o=n=>{(n.target===u||t)&&n.stopImmediatePropagation()},s=n=>{(n.target===u||t)&&(n.stopImmediatePropagation(),!r&&!t&&(t=!0,l.focusWithoutScrolling(u),a()))},c=n=>{(n.target===r||t)&&n.stopImmediatePropagation()},i=n=>{(n.target===r||t)&&(n.stopImmediatePropagation(),t||(t=!0,l.focusWithoutScrolling(u),a()))};e.addEventListener("blur",o,!0),e.addEventListener("focusout",s,!0),e.addEventListener("focusin",i,!0),e.addEventListener("focus",c,!0);let a=()=>{cancelAnimationFrame(v),e.removeEventListener("blur",o,!0),e.removeEventListener("focusout",s,!0),e.removeEventListener("focusin",i,!0),e.removeEventListener("focus",c,!0),exports.ignoreFocusEvent=!1,t=!1},v=requestAnimationFrame(a);return a}exports.createSyntheticEvent=f;exports.preventFocus=L;exports.setEventTarget=g;exports.useSyntheticBlurEvent=F;
|
package/index326.mjs
CHANGED
|
@@ -1,30 +1,95 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
},
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { getOwnerWindow as b } from "./index256.mjs";
|
|
2
|
+
import { focusWithoutScrolling as l } from "./index259.mjs";
|
|
3
|
+
import { useLayoutEffect as v } from "./index235.mjs";
|
|
4
|
+
import { useEffectEvent as m } from "./index269.mjs";
|
|
5
|
+
import { isFocusable as p } from "./index275.mjs";
|
|
6
|
+
import { useRef as E, useCallback as $ } from "react";
|
|
7
|
+
function g(r) {
|
|
8
|
+
let e = r;
|
|
9
|
+
return e.nativeEvent = r, e.isDefaultPrevented = () => e.defaultPrevented, e.isPropagationStopped = () => e.cancelBubble, e.persist = () => {
|
|
10
|
+
}, e;
|
|
11
|
+
}
|
|
12
|
+
function h(r, e) {
|
|
13
|
+
Object.defineProperty(r, "target", {
|
|
14
|
+
value: e
|
|
15
|
+
}), Object.defineProperty(r, "currentTarget", {
|
|
16
|
+
value: e
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function I(r) {
|
|
20
|
+
let e = E({
|
|
21
|
+
isFocused: !1,
|
|
22
|
+
observer: null
|
|
23
|
+
});
|
|
24
|
+
v(() => {
|
|
25
|
+
const t = e.current;
|
|
26
|
+
return () => {
|
|
27
|
+
t.observer && (t.observer.disconnect(), t.observer = null);
|
|
28
|
+
};
|
|
29
|
+
}, []);
|
|
30
|
+
let a = m((t) => {
|
|
31
|
+
r == null || r(t);
|
|
32
|
+
});
|
|
33
|
+
return $((t) => {
|
|
34
|
+
if (t.target instanceof HTMLButtonElement || t.target instanceof HTMLInputElement || t.target instanceof HTMLTextAreaElement || t.target instanceof HTMLSelectElement) {
|
|
35
|
+
e.current.isFocused = !0;
|
|
36
|
+
let o = t.target, u = (c) => {
|
|
37
|
+
if (e.current.isFocused = !1, o.disabled) {
|
|
38
|
+
let s = g(c);
|
|
39
|
+
a(s);
|
|
40
|
+
}
|
|
41
|
+
e.current.observer && (e.current.observer.disconnect(), e.current.observer = null);
|
|
42
|
+
};
|
|
43
|
+
o.addEventListener("focusout", u, {
|
|
44
|
+
once: !0
|
|
45
|
+
}), e.current.observer = new MutationObserver(() => {
|
|
46
|
+
if (e.current.isFocused && o.disabled) {
|
|
47
|
+
var c;
|
|
48
|
+
(c = e.current.observer) === null || c === void 0 || c.disconnect();
|
|
49
|
+
let s = o === document.activeElement ? null : document.activeElement;
|
|
50
|
+
o.dispatchEvent(new FocusEvent("blur", {
|
|
51
|
+
relatedTarget: s
|
|
52
|
+
})), o.dispatchEvent(new FocusEvent("focusout", {
|
|
53
|
+
bubbles: !0,
|
|
54
|
+
relatedTarget: s
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
}), e.current.observer.observe(o, {
|
|
58
|
+
attributes: !0,
|
|
59
|
+
attributeFilter: [
|
|
60
|
+
"disabled"
|
|
61
|
+
]
|
|
62
|
+
});
|
|
63
|
+
}
|
|
16
64
|
}, [
|
|
17
|
-
|
|
18
|
-
n,
|
|
19
|
-
f
|
|
65
|
+
a
|
|
20
66
|
]);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
67
|
+
}
|
|
68
|
+
let d = !1;
|
|
69
|
+
function y(r) {
|
|
70
|
+
for (; r && !p(r); ) r = r.parentElement;
|
|
71
|
+
let e = b(r), a = e.document.activeElement;
|
|
72
|
+
if (!a || a === r) return;
|
|
73
|
+
d = !0;
|
|
74
|
+
let t = !1, o = (n) => {
|
|
75
|
+
(n.target === a || t) && n.stopImmediatePropagation();
|
|
76
|
+
}, u = (n) => {
|
|
77
|
+
(n.target === a || t) && (n.stopImmediatePropagation(), !r && !t && (t = !0, l(a), i()));
|
|
78
|
+
}, c = (n) => {
|
|
79
|
+
(n.target === r || t) && n.stopImmediatePropagation();
|
|
80
|
+
}, s = (n) => {
|
|
81
|
+
(n.target === r || t) && (n.stopImmediatePropagation(), t || (t = !0, l(a), i()));
|
|
26
82
|
};
|
|
83
|
+
e.addEventListener("blur", o, !0), e.addEventListener("focusout", u, !0), e.addEventListener("focusin", s, !0), e.addEventListener("focus", c, !0);
|
|
84
|
+
let i = () => {
|
|
85
|
+
cancelAnimationFrame(f), e.removeEventListener("blur", o, !0), e.removeEventListener("focusout", u, !0), e.removeEventListener("focusin", s, !0), e.removeEventListener("focus", c, !0), d = !1, t = !1;
|
|
86
|
+
}, f = requestAnimationFrame(i);
|
|
87
|
+
return i;
|
|
27
88
|
}
|
|
28
89
|
export {
|
|
29
|
-
|
|
90
|
+
g as createSyntheticEvent,
|
|
91
|
+
d as ignoreFocusEvent,
|
|
92
|
+
y as preventFocus,
|
|
93
|
+
h as setEventTarget,
|
|
94
|
+
I as useSyntheticBlurEvent
|
|
30
95
|
};
|
package/index327.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index326.js"),u=require("./index256.js"),m=require("./index243.js"),L=require("./index271.js");require("react");let f=null,y=new Set,a=new Map,i=!1,c=!1;function d(e,n){for(let t of y)t(e,n)}function g(e){return!(e.metaKey||!m.isMac()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function s(e){i=!0,g(e)&&(f="keyboard",d("keyboard",e))}function o(e){f="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(i=!0,d("pointer",e))}function b(e){L.isVirtualClick(e)&&(i=!0,f="virtual")}function $(e){e.target===window||e.target===document||l.ignoreFocusEvent||!e.isTrusted||(!i&&!c&&(f="virtual",d("virtual",e)),i=!1,c=!1)}function E(){l.ignoreFocusEvent||(i=!1,c=!0)}function v(e){if(typeof window>"u"||a.get(u.getOwnerWindow(e)))return;const n=u.getOwnerWindow(e),t=u.getOwnerDocument(e);let r=n.HTMLElement.prototype.focus;n.HTMLElement.prototype.focus=function(){i=!0,r.apply(this,arguments)},t.addEventListener("keydown",s,!0),t.addEventListener("keyup",s,!0),t.addEventListener("click",b,!0),n.addEventListener("focus",$,!0),n.addEventListener("blur",E,!1),typeof PointerEvent<"u"?(t.addEventListener("pointerdown",o,!0),t.addEventListener("pointermove",o,!0),t.addEventListener("pointerup",o,!0)):process.env.NODE_ENV==="test"&&(t.addEventListener("mousedown",o,!0),t.addEventListener("mousemove",o,!0),t.addEventListener("mouseup",o,!0)),n.addEventListener("beforeunload",()=>{p(e)},{once:!0}),a.set(n,{focus:r})}const p=(e,n)=>{const t=u.getOwnerWindow(e),r=u.getOwnerDocument(e);n&&r.removeEventListener("DOMContentLoaded",n),a.has(t)&&(t.HTMLElement.prototype.focus=a.get(t).focus,r.removeEventListener("keydown",s,!0),r.removeEventListener("keyup",s,!0),r.removeEventListener("click",b,!0),t.removeEventListener("focus",$,!0),t.removeEventListener("blur",E,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",o,!0),r.removeEventListener("pointermove",o,!0),r.removeEventListener("pointerup",o,!0)):process.env.NODE_ENV==="test"&&(r.removeEventListener("mousedown",o,!0),r.removeEventListener("mousemove",o,!0),r.removeEventListener("mouseup",o,!0)),a.delete(t))};function w(e){const n=u.getOwnerDocument(e);let t;return n.readyState!=="loading"?v(e):(t=()=>{v(e)},n.addEventListener("DOMContentLoaded",t)),()=>p(e,t)}typeof document<"u"&&w();function O(){return f}function k(e){f=e,d(e,null)}exports.addWindowFocusTracking=w;exports.getInteractionModality=O;exports.hasSetupGlobalListeners=a;exports.setInteractionModality=k;
|