@react-aria/utils 3.21.0 → 3.22.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/import.mjs +19 -4
- package/dist/main.js +22 -3
- package/dist/main.js.map +1 -1
- package/dist/module.js +19 -4
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +36 -7
- package/dist/types.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/domHelpers.ts +14 -0
- package/src/index.ts +1 -0
- package/src/openLink.tsx +4 -4
- package/src/useDescription.ts +1 -1
- package/src/useEffectEvent.ts +5 -4
- package/src/useEvent.ts +1 -1
- package/src/useId.ts +10 -1
- package/src/useSyncRef.ts +1 -1
package/dist/import.mjs
CHANGED
|
@@ -69,6 +69,7 @@ function $8ae05eaa5c114e9c$export$7f54fc3180508a52(fn) {
|
|
|
69
69
|
}, [
|
|
70
70
|
fn
|
|
71
71
|
]);
|
|
72
|
+
// @ts-ignore
|
|
72
73
|
return (0, $12uGp$useCallback)((...args)=>{
|
|
73
74
|
const f = ref.current;
|
|
74
75
|
return f(...args);
|
|
@@ -110,6 +111,8 @@ function $1dbecbe27a04f9af$export$14d238f342723f25(defaultValue) {
|
|
|
110
111
|
}
|
|
111
112
|
|
|
112
113
|
|
|
114
|
+
// copied from SSRProvider.tsx to reduce exports, if needed again, consider sharing
|
|
115
|
+
let $bdb11010cef70236$var$canUseDOM = Boolean(typeof window !== "undefined" && window.document && window.document.createElement);
|
|
113
116
|
let $bdb11010cef70236$var$idsUpdaterMap = new Map();
|
|
114
117
|
function $bdb11010cef70236$export$f680877a34711e37(defaultId) {
|
|
115
118
|
let [value, setValue] = (0, $12uGp$useState)(defaultId);
|
|
@@ -118,7 +121,7 @@ function $bdb11010cef70236$export$f680877a34711e37(defaultId) {
|
|
|
118
121
|
let updateValue = (0, $12uGp$useCallback)((val)=>{
|
|
119
122
|
nextId.current = val;
|
|
120
123
|
}, []);
|
|
121
|
-
$bdb11010cef70236$var$idsUpdaterMap.set(res, updateValue);
|
|
124
|
+
if ($bdb11010cef70236$var$canUseDOM) $bdb11010cef70236$var$idsUpdaterMap.set(res, updateValue);
|
|
122
125
|
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
|
|
123
126
|
let r = res;
|
|
124
127
|
return ()=>{
|
|
@@ -192,6 +195,17 @@ function $bdb11010cef70236$export$b4cc09c592e8fdb8(depArray = []) {
|
|
|
192
195
|
}
|
|
193
196
|
|
|
194
197
|
|
|
198
|
+
const $431fbd86ca7dc216$export$b204af158042fbac = (el)=>{
|
|
199
|
+
var _el_ownerDocument;
|
|
200
|
+
return (_el_ownerDocument = el === null || el === void 0 ? void 0 : el.ownerDocument) !== null && _el_ownerDocument !== void 0 ? _el_ownerDocument : document;
|
|
201
|
+
};
|
|
202
|
+
const $431fbd86ca7dc216$export$f21a1ffae260145a = (el)=>{
|
|
203
|
+
if (el && "window" in el && el.window === el) return el;
|
|
204
|
+
const doc = $431fbd86ca7dc216$export$b204af158042fbac(el);
|
|
205
|
+
return doc.defaultView || window;
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
|
|
195
209
|
/*
|
|
196
210
|
* Copyright 2020 Adobe. All rights reserved.
|
|
197
211
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -462,7 +476,7 @@ function $ea8dcbcb9ea1b556$export$efa8c9099e530235(link, modifiers) {
|
|
|
462
476
|
!modifiers.shiftKey;
|
|
463
477
|
}
|
|
464
478
|
function $ea8dcbcb9ea1b556$export$95185d699e05d4d7(target, modifiers, setOpening = true) {
|
|
465
|
-
var
|
|
479
|
+
var _window_event_type, _window_event;
|
|
466
480
|
let { metaKey: metaKey, ctrlKey: ctrlKey, altKey: altKey, shiftKey: shiftKey } = modifiers;
|
|
467
481
|
// Firefox does not recognize keyboard events as a user action by default, and the popup blocker
|
|
468
482
|
// will prevent links with target="_blank" from opening. However, it does allow the event if the
|
|
@@ -493,6 +507,7 @@ function $ea8dcbcb9ea1b556$export$95185d699e05d4d7(target, modifiers, setOpening
|
|
|
493
507
|
target.dispatchEvent(event);
|
|
494
508
|
$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = false;
|
|
495
509
|
}
|
|
510
|
+
// https://github.com/parcel-bundler/parcel/issues/8724
|
|
496
511
|
$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = false;
|
|
497
512
|
function $ea8dcbcb9ea1b556$var$getSyntheticLink(target, open) {
|
|
498
513
|
if (target instanceof HTMLAnchorElement) open(target);
|
|
@@ -1140,7 +1155,7 @@ function $2f04cbc44ee30ce0$export$c826860796309d1b(targetElement, opts) {
|
|
|
1140
1155
|
let { left: newLeft, top: newTop } = targetElement.getBoundingClientRect();
|
|
1141
1156
|
// Account for sub pixel differences from rounding
|
|
1142
1157
|
if (Math.abs(originalLeft - newLeft) > 1 || Math.abs(originalTop - newTop) > 1) {
|
|
1143
|
-
var
|
|
1158
|
+
var _opts_containingElement_scrollIntoView, _opts_containingElement, _targetElement_scrollIntoView1;
|
|
1144
1159
|
opts === null || opts === void 0 ? void 0 : (_opts_containingElement = opts.containingElement) === null || _opts_containingElement === void 0 ? void 0 : (_opts_containingElement_scrollIntoView = _opts_containingElement.scrollIntoView) === null || _opts_containingElement_scrollIntoView === void 0 ? void 0 : _opts_containingElement_scrollIntoView.call(_opts_containingElement, {
|
|
1145
1160
|
block: "center",
|
|
1146
1161
|
inline: "center"
|
|
@@ -1249,5 +1264,5 @@ function $99facab73266f662$export$5add1d006293d136(ref, initialValue, onReset) {
|
|
|
1249
1264
|
|
|
1250
1265
|
|
|
1251
1266
|
|
|
1252
|
-
export {$bdb11010cef70236$export$f680877a34711e37 as useId, $bdb11010cef70236$export$cd8c9cb68f842629 as mergeIds, $bdb11010cef70236$export$b4cc09c592e8fdb8 as useSlotId, $ff5963eb1fccf552$export$e08e3b67e392101e as chain, $3ef42575df84b30b$export$9d1611c77c2fe928 as mergeProps, $5dc95899b306f630$export$c9058316764c140e as mergeRefs, $65484d02dcb7eb3e$export$457c3d6518dd4c6f as filterDOMProps, $7215afc6de606d6b$export$de79e2c695e052f3 as focusWithoutScrolling, $ab71dadb03a6fb2e$export$622cea445a1c5b7d as getOffset, $ea8dcbcb9ea1b556$export$95185d699e05d4d7 as openLink, $ea8dcbcb9ea1b556$export$51437d503373d223 as getSyntheticLinkProps, $ea8dcbcb9ea1b556$export$323e4fc2fa4753fb as RouterProvider, $ea8dcbcb9ea1b556$export$efa8c9099e530235 as shouldClientNavigate, $ea8dcbcb9ea1b556$export$9a302a45f65d0572 as useRouter, $bbed8b41f857bcc0$export$24490316f764c430 as runAfterTransition, $9cc09df9fd7676be$export$7bbed75feba39706 as useDrag1D, $03deb23ff14920c4$export$4eaf04e54aa8eed6 as useGlobalListeners, $313b98861ee5dd6c$export$d6875122194c7b44 as useLabels, $df56164dff5785e2$export$4338b53315abf666 as useObjectRef, $4f58c5f72bcf79f7$export$496315a1608d9602 as useUpdateEffect, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c as useLayoutEffect, $9daab02d461809db$export$683480f191c0e3ea as useResizeObserver, $e7801be82b4b2a53$export$4debdb1a3f0fa79e as useSyncRef, $62d8ded9296f3872$export$cfa2225e87938781 as getScrollParent, $62d8ded9296f3872$export$2bb74740c4e19def as isScrollable, $5df64b3807dc15ee$export$d699905dd57c73ca as useViewportSize, $ef06256079686ba0$export$f8aeda7b10753fa1 as useDescription, $c87311424ea30a05$export$9ac100e40613ea10 as isMac, $c87311424ea30a05$export$186c6964ca17d99 as isIPhone, $c87311424ea30a05$export$7bef049ce92e4224 as isIPad, $c87311424ea30a05$export$fedb369cb70207f1 as isIOS, $c87311424ea30a05$export$e1865c3bedcd822b as isAppleDevice, $c87311424ea30a05$export$78551043582a6a98 as isWebKit, $c87311424ea30a05$export$6446a186d09e379e as isChrome, $c87311424ea30a05$export$a11b0059900ceec8 as isAndroid, $e9faafb641e167db$export$90fc3a17d93f704c as useEvent, $1dbecbe27a04f9af$export$14d238f342723f25 as useValueEffect, $2f04cbc44ee30ce0$export$53a0910f038337bd as scrollIntoView, $2f04cbc44ee30ce0$export$c826860796309d1b as scrollIntoViewport, $4507461a1b870123$re_export$clamp as clamp, $4507461a1b870123$re_export$snapValueToStep as snapValueToStep, $6a7db85432448f7f$export$60278871457622de as isVirtualClick, $6a7db85432448f7f$export$29bf1b5f2c56cf63 as isVirtualPointerEvent, $8ae05eaa5c114e9c$export$7f54fc3180508a52 as useEffectEvent, $5a387cc49350e6db$export$722debc0e56fea39 as useDeepMemo, $99facab73266f662$export$5add1d006293d136 as useFormReset};
|
|
1267
|
+
export {$bdb11010cef70236$export$f680877a34711e37 as useId, $bdb11010cef70236$export$cd8c9cb68f842629 as mergeIds, $bdb11010cef70236$export$b4cc09c592e8fdb8 as useSlotId, $ff5963eb1fccf552$export$e08e3b67e392101e as chain, $431fbd86ca7dc216$export$b204af158042fbac as getOwnerDocument, $431fbd86ca7dc216$export$f21a1ffae260145a as getOwnerWindow, $3ef42575df84b30b$export$9d1611c77c2fe928 as mergeProps, $5dc95899b306f630$export$c9058316764c140e as mergeRefs, $65484d02dcb7eb3e$export$457c3d6518dd4c6f as filterDOMProps, $7215afc6de606d6b$export$de79e2c695e052f3 as focusWithoutScrolling, $ab71dadb03a6fb2e$export$622cea445a1c5b7d as getOffset, $ea8dcbcb9ea1b556$export$95185d699e05d4d7 as openLink, $ea8dcbcb9ea1b556$export$51437d503373d223 as getSyntheticLinkProps, $ea8dcbcb9ea1b556$export$323e4fc2fa4753fb as RouterProvider, $ea8dcbcb9ea1b556$export$efa8c9099e530235 as shouldClientNavigate, $ea8dcbcb9ea1b556$export$9a302a45f65d0572 as useRouter, $bbed8b41f857bcc0$export$24490316f764c430 as runAfterTransition, $9cc09df9fd7676be$export$7bbed75feba39706 as useDrag1D, $03deb23ff14920c4$export$4eaf04e54aa8eed6 as useGlobalListeners, $313b98861ee5dd6c$export$d6875122194c7b44 as useLabels, $df56164dff5785e2$export$4338b53315abf666 as useObjectRef, $4f58c5f72bcf79f7$export$496315a1608d9602 as useUpdateEffect, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c as useLayoutEffect, $9daab02d461809db$export$683480f191c0e3ea as useResizeObserver, $e7801be82b4b2a53$export$4debdb1a3f0fa79e as useSyncRef, $62d8ded9296f3872$export$cfa2225e87938781 as getScrollParent, $62d8ded9296f3872$export$2bb74740c4e19def as isScrollable, $5df64b3807dc15ee$export$d699905dd57c73ca as useViewportSize, $ef06256079686ba0$export$f8aeda7b10753fa1 as useDescription, $c87311424ea30a05$export$9ac100e40613ea10 as isMac, $c87311424ea30a05$export$186c6964ca17d99 as isIPhone, $c87311424ea30a05$export$7bef049ce92e4224 as isIPad, $c87311424ea30a05$export$fedb369cb70207f1 as isIOS, $c87311424ea30a05$export$e1865c3bedcd822b as isAppleDevice, $c87311424ea30a05$export$78551043582a6a98 as isWebKit, $c87311424ea30a05$export$6446a186d09e379e as isChrome, $c87311424ea30a05$export$a11b0059900ceec8 as isAndroid, $e9faafb641e167db$export$90fc3a17d93f704c as useEvent, $1dbecbe27a04f9af$export$14d238f342723f25 as useValueEffect, $2f04cbc44ee30ce0$export$53a0910f038337bd as scrollIntoView, $2f04cbc44ee30ce0$export$c826860796309d1b as scrollIntoViewport, $4507461a1b870123$re_export$clamp as clamp, $4507461a1b870123$re_export$snapValueToStep as snapValueToStep, $6a7db85432448f7f$export$60278871457622de as isVirtualClick, $6a7db85432448f7f$export$29bf1b5f2c56cf63 as isVirtualPointerEvent, $8ae05eaa5c114e9c$export$7f54fc3180508a52 as useEffectEvent, $5a387cc49350e6db$export$722debc0e56fea39 as useDeepMemo, $99facab73266f662$export$5add1d006293d136 as useFormReset};
|
|
1253
1268
|
//# sourceMappingURL=module.js.map
|
package/dist/main.js
CHANGED
|
@@ -3,9 +3,11 @@ var $1Yh1N$react = require("react");
|
|
|
3
3
|
var $1Yh1N$reactariassr = require("@react-aria/ssr");
|
|
4
4
|
var $1Yh1N$clsx = require("clsx");
|
|
5
5
|
|
|
6
|
+
|
|
6
7
|
function $parcel$export(e, n, v, s) {
|
|
7
8
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
8
9
|
}
|
|
10
|
+
|
|
9
11
|
function $parcel$interopDefault(a) {
|
|
10
12
|
return a && a.__esModule ? a.default : a;
|
|
11
13
|
}
|
|
@@ -14,6 +16,8 @@ $parcel$export(module.exports, "useId", () => $8c61827343eed941$export$f680877a3
|
|
|
14
16
|
$parcel$export(module.exports, "mergeIds", () => $8c61827343eed941$export$cd8c9cb68f842629);
|
|
15
17
|
$parcel$export(module.exports, "useSlotId", () => $8c61827343eed941$export$b4cc09c592e8fdb8);
|
|
16
18
|
$parcel$export(module.exports, "chain", () => $1e2191638e54f613$export$e08e3b67e392101e);
|
|
19
|
+
$parcel$export(module.exports, "getOwnerDocument", () => $aaa611146751592e$export$b204af158042fbac);
|
|
20
|
+
$parcel$export(module.exports, "getOwnerWindow", () => $aaa611146751592e$export$f21a1ffae260145a);
|
|
17
21
|
$parcel$export(module.exports, "mergeProps", () => $f847cd1382ea7cd4$export$9d1611c77c2fe928);
|
|
18
22
|
$parcel$export(module.exports, "mergeRefs", () => $f05dc24eafaeb7e2$export$c9058316764c140e);
|
|
19
23
|
$parcel$export(module.exports, "filterDOMProps", () => $8d15d0e1797d4238$export$457c3d6518dd4c6f);
|
|
@@ -122,6 +126,7 @@ function $1254e5bb94ac8761$export$7f54fc3180508a52(fn) {
|
|
|
122
126
|
}, [
|
|
123
127
|
fn
|
|
124
128
|
]);
|
|
129
|
+
// @ts-ignore
|
|
125
130
|
return (0, $1Yh1N$react.useCallback)((...args)=>{
|
|
126
131
|
const f = ref.current;
|
|
127
132
|
return f(...args);
|
|
@@ -163,6 +168,8 @@ function $19a2307bfabafaf1$export$14d238f342723f25(defaultValue) {
|
|
|
163
168
|
}
|
|
164
169
|
|
|
165
170
|
|
|
171
|
+
// copied from SSRProvider.tsx to reduce exports, if needed again, consider sharing
|
|
172
|
+
let $8c61827343eed941$var$canUseDOM = Boolean(typeof window !== "undefined" && window.document && window.document.createElement);
|
|
166
173
|
let $8c61827343eed941$var$idsUpdaterMap = new Map();
|
|
167
174
|
function $8c61827343eed941$export$f680877a34711e37(defaultId) {
|
|
168
175
|
let [value, setValue] = (0, $1Yh1N$react.useState)(defaultId);
|
|
@@ -171,7 +178,7 @@ function $8c61827343eed941$export$f680877a34711e37(defaultId) {
|
|
|
171
178
|
let updateValue = (0, $1Yh1N$react.useCallback)((val)=>{
|
|
172
179
|
nextId.current = val;
|
|
173
180
|
}, []);
|
|
174
|
-
$8c61827343eed941$var$idsUpdaterMap.set(res, updateValue);
|
|
181
|
+
if ($8c61827343eed941$var$canUseDOM) $8c61827343eed941$var$idsUpdaterMap.set(res, updateValue);
|
|
175
182
|
(0, $78605a5d7424e31b$export$e5c5a5f917a5871c)(()=>{
|
|
176
183
|
let r = res;
|
|
177
184
|
return ()=>{
|
|
@@ -245,6 +252,17 @@ function $8c61827343eed941$export$b4cc09c592e8fdb8(depArray = []) {
|
|
|
245
252
|
}
|
|
246
253
|
|
|
247
254
|
|
|
255
|
+
const $aaa611146751592e$export$b204af158042fbac = (el)=>{
|
|
256
|
+
var _el_ownerDocument;
|
|
257
|
+
return (_el_ownerDocument = el === null || el === void 0 ? void 0 : el.ownerDocument) !== null && _el_ownerDocument !== void 0 ? _el_ownerDocument : document;
|
|
258
|
+
};
|
|
259
|
+
const $aaa611146751592e$export$f21a1ffae260145a = (el)=>{
|
|
260
|
+
if (el && "window" in el && el.window === el) return el;
|
|
261
|
+
const doc = $aaa611146751592e$export$b204af158042fbac(el);
|
|
262
|
+
return doc.defaultView || window;
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
|
|
248
266
|
/*
|
|
249
267
|
* Copyright 2020 Adobe. All rights reserved.
|
|
250
268
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -515,7 +533,7 @@ function $4068a0fae83b6d84$export$efa8c9099e530235(link, modifiers) {
|
|
|
515
533
|
!modifiers.shiftKey;
|
|
516
534
|
}
|
|
517
535
|
function $4068a0fae83b6d84$export$95185d699e05d4d7(target, modifiers, setOpening = true) {
|
|
518
|
-
var
|
|
536
|
+
var _window_event_type, _window_event;
|
|
519
537
|
let { metaKey: metaKey, ctrlKey: ctrlKey, altKey: altKey, shiftKey: shiftKey } = modifiers;
|
|
520
538
|
// Firefox does not recognize keyboard events as a user action by default, and the popup blocker
|
|
521
539
|
// will prevent links with target="_blank" from opening. However, it does allow the event if the
|
|
@@ -546,6 +564,7 @@ function $4068a0fae83b6d84$export$95185d699e05d4d7(target, modifiers, setOpening
|
|
|
546
564
|
target.dispatchEvent(event);
|
|
547
565
|
$4068a0fae83b6d84$export$95185d699e05d4d7.isOpening = false;
|
|
548
566
|
}
|
|
567
|
+
// https://github.com/parcel-bundler/parcel/issues/8724
|
|
549
568
|
$4068a0fae83b6d84$export$95185d699e05d4d7.isOpening = false;
|
|
550
569
|
function $4068a0fae83b6d84$var$getSyntheticLink(target, open) {
|
|
551
570
|
if (target instanceof HTMLAnchorElement) open(target);
|
|
@@ -1193,7 +1212,7 @@ function $449412113267a1fe$export$c826860796309d1b(targetElement, opts) {
|
|
|
1193
1212
|
let { left: newLeft, top: newTop } = targetElement.getBoundingClientRect();
|
|
1194
1213
|
// Account for sub pixel differences from rounding
|
|
1195
1214
|
if (Math.abs(originalLeft - newLeft) > 1 || Math.abs(originalTop - newTop) > 1) {
|
|
1196
|
-
var
|
|
1215
|
+
var _opts_containingElement_scrollIntoView, _opts_containingElement, _targetElement_scrollIntoView1;
|
|
1197
1216
|
opts === null || opts === void 0 ? void 0 : (_opts_containingElement = opts.containingElement) === null || _opts_containingElement === void 0 ? void 0 : (_opts_containingElement_scrollIntoView = _opts_containingElement.scrollIntoView) === null || _opts_containingElement_scrollIntoView === void 0 ? void 0 : _opts_containingElement_scrollIntoView.call(_opts_containingElement, {
|
|
1198
1217
|
block: "center",
|
|
1199
1218
|
inline: "center"
|