@react-aria/overlays 3.14.1 → 3.16.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 +21 -14
- package/dist/main.js +21 -14
- package/dist/main.js.map +1 -1
- package/dist/module.js +21 -14
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +14 -3
- package/dist/types.d.ts.map +1 -1
- package/package.json +13 -13
- package/src/Overlay.tsx +28 -8
- package/src/calculatePosition.ts +2 -2
- package/src/useOverlayPosition.ts +3 -1
- package/src/usePreventScroll.ts +6 -2
package/dist/module.js
CHANGED
|
@@ -67,7 +67,7 @@ const $edcf132a9284368a$var$TOTAL_SIZE = {
|
|
|
67
67
|
};
|
|
68
68
|
const $edcf132a9284368a$var$PARSED_PLACEMENT_CACHE = {};
|
|
69
69
|
// @ts-ignore
|
|
70
|
-
let $edcf132a9284368a$var$visualViewport = typeof
|
|
70
|
+
let $edcf132a9284368a$var$visualViewport = typeof document !== "undefined" && window.visualViewport;
|
|
71
71
|
function $edcf132a9284368a$var$getContainerDimensions(containerNode) {
|
|
72
72
|
let width = 0, height = 0, totalWidth = 0, totalHeight = 0, top = 0, left = 0;
|
|
73
73
|
let scroll = {};
|
|
@@ -236,7 +236,7 @@ function $edcf132a9284368a$export$6839422d1f33cee9(placementInput, childOffset,
|
|
|
236
236
|
};
|
|
237
237
|
}
|
|
238
238
|
function $edcf132a9284368a$export$b3ceb0cbf1056d98(opts) {
|
|
239
|
-
let { placement: placement , targetNode: targetNode , overlayNode: overlayNode , scrollNode: scrollNode , padding: padding , shouldFlip: shouldFlip , boundaryElement: boundaryElement , offset: offset , crossOffset: crossOffset , maxHeight: maxHeight , arrowSize: arrowSize , arrowBoundaryOffset: arrowBoundaryOffset = 0 } = opts;
|
|
239
|
+
let { placement: placement , targetNode: targetNode , overlayNode: overlayNode , scrollNode: scrollNode , padding: padding , shouldFlip: shouldFlip , boundaryElement: boundaryElement , offset: offset , crossOffset: crossOffset , maxHeight: maxHeight , arrowSize: arrowSize = 0 , arrowBoundaryOffset: arrowBoundaryOffset = 0 } = opts;
|
|
240
240
|
let container = overlayNode instanceof HTMLElement ? $edcf132a9284368a$var$getContainingBlock(overlayNode) : document.documentElement;
|
|
241
241
|
let isViewportContainer = container === document.documentElement;
|
|
242
242
|
const containerPositionStyle = window.getComputedStyle(container).position;
|
|
@@ -361,7 +361,7 @@ function $dd149f63282afbbf$export$18fc8428861184da(opts) {
|
|
|
361
361
|
|
|
362
362
|
|
|
363
363
|
// @ts-ignore
|
|
364
|
-
let $2a41e45df1593e64$var$visualViewport = typeof
|
|
364
|
+
let $2a41e45df1593e64$var$visualViewport = typeof document !== "undefined" && window.visualViewport;
|
|
365
365
|
function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
|
|
366
366
|
let { direction: direction } = (0, $k7QOs$useLocale)();
|
|
367
367
|
let { arrowSize: arrowSize = 0 , targetRef: targetRef , overlayRef: overlayRef , scrollRef: scrollRef = overlayRef , placement: placement = "bottom" , containerPadding: containerPadding = 12 , shouldFlip: shouldFlip = true , boundaryElement: boundaryElement = typeof document !== "undefined" ? document.body : null , offset: offset = 0 , crossOffset: crossOffset = 0 , shouldUpdatePosition: shouldUpdatePosition = true , isOpen: isOpen = true , onClose: onClose , maxHeight: maxHeight , arrowBoundaryOffset: arrowBoundaryOffset = 0 } = props;
|
|
@@ -469,6 +469,8 @@ function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
|
|
|
469
469
|
},
|
|
470
470
|
placement: position.placement,
|
|
471
471
|
arrowProps: {
|
|
472
|
+
"aria-hidden": "true",
|
|
473
|
+
role: "presentation",
|
|
472
474
|
style: {
|
|
473
475
|
left: position.arrowOffsetLeft,
|
|
474
476
|
top: position.arrowOffsetTop
|
|
@@ -636,7 +638,7 @@ function $628037886ba31236$export$f9d5c8beee7d008d(props, state, ref) {
|
|
|
636
638
|
* governing permissions and limitations under the License.
|
|
637
639
|
*/
|
|
638
640
|
// @ts-ignore
|
|
639
|
-
const $49c51c25361d4cd2$var$visualViewport = typeof
|
|
641
|
+
const $49c51c25361d4cd2$var$visualViewport = typeof document !== "undefined" && window.visualViewport;
|
|
640
642
|
// HTML input types that do not cause the software keyboard to appear.
|
|
641
643
|
const $49c51c25361d4cd2$var$nonTextInputTypes = new Set([
|
|
642
644
|
"checkbox",
|
|
@@ -711,7 +713,7 @@ function $49c51c25361d4cd2$var$preventScrollMobileSafari() {
|
|
|
711
713
|
};
|
|
712
714
|
let onTouchMove = (e)=>{
|
|
713
715
|
// Prevent scrolling the window.
|
|
714
|
-
if (scrollable === document.documentElement || scrollable === document.body) {
|
|
716
|
+
if (!scrollable || scrollable === document.documentElement || scrollable === document.body) {
|
|
715
717
|
e.preventDefault();
|
|
716
718
|
return;
|
|
717
719
|
}
|
|
@@ -722,6 +724,7 @@ function $49c51c25361d4cd2$var$preventScrollMobileSafari() {
|
|
|
722
724
|
let y = e.changedTouches[0].pageY;
|
|
723
725
|
let scrollTop = scrollable.scrollTop;
|
|
724
726
|
let bottom = scrollable.scrollHeight - scrollable.clientHeight;
|
|
727
|
+
if (bottom === 0) return;
|
|
725
728
|
if (scrollTop <= 0 && y > lastY || scrollTop >= bottom && y < lastY) e.preventDefault();
|
|
726
729
|
lastY = y;
|
|
727
730
|
};
|
|
@@ -935,7 +938,7 @@ function $f57aed4a881a3485$export$33ffd74ebf07f060(options) {
|
|
|
935
938
|
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
936
939
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
937
940
|
* governing permissions and limitations under the License.
|
|
938
|
-
*/ var $
|
|
941
|
+
*/ var $a2f21f5f14f60553$exports = {};
|
|
939
942
|
var $773d5888b972f1cf$exports = {};
|
|
940
943
|
$773d5888b972f1cf$exports = {
|
|
941
944
|
"dismiss": `تجاهل`
|
|
@@ -1140,7 +1143,7 @@ $2b2734393847c884$exports = {
|
|
|
1140
1143
|
};
|
|
1141
1144
|
|
|
1142
1145
|
|
|
1143
|
-
$
|
|
1146
|
+
$a2f21f5f14f60553$exports = {
|
|
1144
1147
|
"ar-AE": $773d5888b972f1cf$exports,
|
|
1145
1148
|
"bg-BG": $d11f19852b941573$exports,
|
|
1146
1149
|
"cs-CZ": $b983974c2ee1efb3$exports,
|
|
@@ -1184,7 +1187,7 @@ $61fe14465afefc5e$exports = {
|
|
|
1184
1187
|
|
|
1185
1188
|
function $86ea4cb521eb2e37$export$2317d149ed6f78c4(props) {
|
|
1186
1189
|
let { onDismiss: onDismiss , ...otherProps } = props;
|
|
1187
|
-
let stringFormatter = (0, $k7QOs$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($
|
|
1190
|
+
let stringFormatter = (0, $k7QOs$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($a2f21f5f14f60553$exports))));
|
|
1188
1191
|
let labels = (0, $k7QOs$useLabels)(otherProps, stringFormatter.format("dismiss"));
|
|
1189
1192
|
let onClick = ()=>{
|
|
1190
1193
|
if (onDismiss) onDismiss();
|
|
@@ -1270,9 +1273,9 @@ function $5e3802645cc19319$export$1c3ebcada18427bf(targets, root = document.body
|
|
|
1270
1273
|
visibleNodes.delete(node);
|
|
1271
1274
|
hiddenNodes.delete(node);
|
|
1272
1275
|
}
|
|
1273
|
-
for (let
|
|
1274
|
-
if ((
|
|
1275
|
-
else if (
|
|
1276
|
+
for (let node of change.addedNodes){
|
|
1277
|
+
if ((node instanceof HTMLElement || node instanceof SVGElement) && (node.dataset.liveAnnouncer === "true" || node.dataset.reactAriaTopLayer === "true")) visibleNodes.add(node);
|
|
1278
|
+
else if (node instanceof Element) walk(node);
|
|
1276
1279
|
}
|
|
1277
1280
|
}
|
|
1278
1281
|
}
|
|
@@ -1395,7 +1398,7 @@ function $f2f8a6077418541e$export$542a6fd13ac93354(props, state) {
|
|
|
1395
1398
|
const $337b884510726a0d$export$a2200b96afd16271 = /*#__PURE__*/ (0, $k7QOs$react).createContext(null);
|
|
1396
1399
|
function $337b884510726a0d$export$c6fdb837b070b4ff(props) {
|
|
1397
1400
|
let isSSR = (0, $k7QOs$useIsSSR)();
|
|
1398
|
-
let { portalContainer: portalContainer = isSSR ? null : document.body } = props;
|
|
1401
|
+
let { portalContainer: portalContainer = isSSR ? null : document.body , isExiting: isExiting } = props;
|
|
1399
1402
|
let [contain, setContain] = (0, $k7QOs$useState)(false);
|
|
1400
1403
|
let contextValue = (0, $k7QOs$useMemo)(()=>({
|
|
1401
1404
|
contain: contain,
|
|
@@ -1405,12 +1408,16 @@ function $337b884510726a0d$export$c6fdb837b070b4ff(props) {
|
|
|
1405
1408
|
setContain
|
|
1406
1409
|
]);
|
|
1407
1410
|
if (!portalContainer) return null;
|
|
1408
|
-
let contents
|
|
1411
|
+
let contents;
|
|
1412
|
+
if (!props.disableFocusManagement) contents = /*#__PURE__*/ (0, $k7QOs$react).createElement($337b884510726a0d$export$a2200b96afd16271.Provider, {
|
|
1409
1413
|
value: contextValue
|
|
1410
1414
|
}, /*#__PURE__*/ (0, $k7QOs$react).createElement((0, $k7QOs$FocusScope), {
|
|
1411
1415
|
restoreFocus: true,
|
|
1412
|
-
contain: contain
|
|
1416
|
+
contain: contain && !isExiting
|
|
1413
1417
|
}, props.children));
|
|
1418
|
+
else contents = /*#__PURE__*/ (0, $k7QOs$react).createElement($337b884510726a0d$export$a2200b96afd16271.Provider, {
|
|
1419
|
+
value: contextValue
|
|
1420
|
+
}, props.children);
|
|
1414
1421
|
return /*#__PURE__*/ (0, $k7QOs$reactdom).createPortal(contents, portalContainer);
|
|
1415
1422
|
}
|
|
1416
1423
|
function $337b884510726a0d$export$14c98a7594375490() {
|