@react-aria/utils 3.20.0 → 3.21.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 +184 -62
- package/dist/main.js +186 -59
- package/dist/main.js.map +1 -1
- package/dist/module.js +184 -62
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +15 -10
- package/dist/types.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/filterDOMProps.ts +16 -3
- package/src/index.ts +1 -0
- package/src/openLink.tsx +154 -0
- package/src/platform.ts +4 -0
- package/src/useSyncRef.ts +1 -1
- package/src/useViewportSize.ts +3 -1
package/dist/import.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {clamp as $4507461a1b870123$re_export$clamp, snapValueToStep as $4507461a1b870123$re_export$snapValueToStep} from "@react-stately/utils";
|
|
2
|
-
import $12uGp$react, {useState as $12uGp$useState, useRef as $12uGp$useRef, useCallback as $12uGp$useCallback, useEffect as $12uGp$useEffect, useMemo as $12uGp$useMemo} from "react";
|
|
3
|
-
import {useSSRSafeId as $12uGp$useSSRSafeId} from "@react-aria/ssr";
|
|
2
|
+
import $12uGp$react, {useState as $12uGp$useState, useRef as $12uGp$useRef, useCallback as $12uGp$useCallback, useEffect as $12uGp$useEffect, createContext as $12uGp$createContext, useMemo as $12uGp$useMemo, useContext as $12uGp$useContext} from "react";
|
|
3
|
+
import {useSSRSafeId as $12uGp$useSSRSafeId, useIsSSR as $12uGp$useIsSSR} from "@react-aria/ssr";
|
|
4
4
|
import $12uGp$clsx from "clsx";
|
|
5
5
|
|
|
6
6
|
/*
|
|
@@ -268,11 +268,20 @@ const $65484d02dcb7eb3e$var$labelablePropNames = new Set([
|
|
|
268
268
|
"aria-describedby",
|
|
269
269
|
"aria-details"
|
|
270
270
|
]);
|
|
271
|
+
// See LinkDOMProps in dom.d.ts.
|
|
272
|
+
const $65484d02dcb7eb3e$var$linkPropNames = new Set([
|
|
273
|
+
"href",
|
|
274
|
+
"target",
|
|
275
|
+
"rel",
|
|
276
|
+
"download",
|
|
277
|
+
"ping",
|
|
278
|
+
"referrerPolicy"
|
|
279
|
+
]);
|
|
271
280
|
const $65484d02dcb7eb3e$var$propRe = /^(data-.*)$/;
|
|
272
281
|
function $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, opts = {}) {
|
|
273
|
-
let { labelable: labelable , propNames: propNames
|
|
282
|
+
let { labelable: labelable, isLink: isLink, propNames: propNames } = opts;
|
|
274
283
|
let filteredProps = {};
|
|
275
|
-
for(const prop in props)if (Object.prototype.hasOwnProperty.call(props, prop) && ($65484d02dcb7eb3e$var$DOMPropNames.has(prop) || labelable && $65484d02dcb7eb3e$var$labelablePropNames.has(prop) || (propNames === null || propNames === void 0 ? void 0 : propNames.has(prop)) || $65484d02dcb7eb3e$var$propRe.test(prop))) filteredProps[prop] = props[prop];
|
|
284
|
+
for(const prop in props)if (Object.prototype.hasOwnProperty.call(props, prop) && ($65484d02dcb7eb3e$var$DOMPropNames.has(prop) || labelable && $65484d02dcb7eb3e$var$labelablePropNames.has(prop) || isLink && $65484d02dcb7eb3e$var$linkPropNames.has(prop) || (propNames === null || propNames === void 0 ? void 0 : propNames.has(prop)) || $65484d02dcb7eb3e$var$propRe.test(prop))) filteredProps[prop] = props[prop];
|
|
276
285
|
return filteredProps;
|
|
277
286
|
}
|
|
278
287
|
|
|
@@ -335,7 +344,7 @@ function $7215afc6de606d6b$var$getScrollableElements(element) {
|
|
|
335
344
|
return scrollableElements;
|
|
336
345
|
}
|
|
337
346
|
function $7215afc6de606d6b$var$restoreScrollPosition(scrollableElements) {
|
|
338
|
-
for (let { element: element
|
|
347
|
+
for (let { element: element, scrollTop: scrollTop, scrollLeft: scrollLeft } of scrollableElements){
|
|
339
348
|
element.scrollTop = scrollTop;
|
|
340
349
|
element.scrollLeft = scrollLeft;
|
|
341
350
|
}
|
|
@@ -359,6 +368,162 @@ function $7215afc6de606d6b$var$restoreScrollPosition(scrollableElements) {
|
|
|
359
368
|
}
|
|
360
369
|
|
|
361
370
|
|
|
371
|
+
/*
|
|
372
|
+
* Copyright 2023 Adobe. All rights reserved.
|
|
373
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
374
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
375
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
376
|
+
*
|
|
377
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
378
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
379
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
380
|
+
* governing permissions and limitations under the License.
|
|
381
|
+
*/ /*
|
|
382
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
383
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
384
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
385
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
386
|
+
*
|
|
387
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
388
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
389
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
390
|
+
* governing permissions and limitations under the License.
|
|
391
|
+
*/ function $c87311424ea30a05$var$testUserAgent(re) {
|
|
392
|
+
var _window_navigator_userAgentData;
|
|
393
|
+
if (typeof window === "undefined" || window.navigator == null) return false;
|
|
394
|
+
return ((_window_navigator_userAgentData = window.navigator["userAgentData"]) === null || _window_navigator_userAgentData === void 0 ? void 0 : _window_navigator_userAgentData.brands.some((brand)=>re.test(brand.brand))) || re.test(window.navigator.userAgent);
|
|
395
|
+
}
|
|
396
|
+
function $c87311424ea30a05$var$testPlatform(re) {
|
|
397
|
+
var _window_navigator_userAgentData;
|
|
398
|
+
return typeof window !== "undefined" && window.navigator != null ? re.test(((_window_navigator_userAgentData = window.navigator["userAgentData"]) === null || _window_navigator_userAgentData === void 0 ? void 0 : _window_navigator_userAgentData.platform) || window.navigator.platform) : false;
|
|
399
|
+
}
|
|
400
|
+
function $c87311424ea30a05$export$9ac100e40613ea10() {
|
|
401
|
+
return $c87311424ea30a05$var$testPlatform(/^Mac/i);
|
|
402
|
+
}
|
|
403
|
+
function $c87311424ea30a05$export$186c6964ca17d99() {
|
|
404
|
+
return $c87311424ea30a05$var$testPlatform(/^iPhone/i);
|
|
405
|
+
}
|
|
406
|
+
function $c87311424ea30a05$export$7bef049ce92e4224() {
|
|
407
|
+
return $c87311424ea30a05$var$testPlatform(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
|
|
408
|
+
$c87311424ea30a05$export$9ac100e40613ea10() && navigator.maxTouchPoints > 1;
|
|
409
|
+
}
|
|
410
|
+
function $c87311424ea30a05$export$fedb369cb70207f1() {
|
|
411
|
+
return $c87311424ea30a05$export$186c6964ca17d99() || $c87311424ea30a05$export$7bef049ce92e4224();
|
|
412
|
+
}
|
|
413
|
+
function $c87311424ea30a05$export$e1865c3bedcd822b() {
|
|
414
|
+
return $c87311424ea30a05$export$9ac100e40613ea10() || $c87311424ea30a05$export$fedb369cb70207f1();
|
|
415
|
+
}
|
|
416
|
+
function $c87311424ea30a05$export$78551043582a6a98() {
|
|
417
|
+
return $c87311424ea30a05$var$testUserAgent(/AppleWebKit/i) && !$c87311424ea30a05$export$6446a186d09e379e();
|
|
418
|
+
}
|
|
419
|
+
function $c87311424ea30a05$export$6446a186d09e379e() {
|
|
420
|
+
return $c87311424ea30a05$var$testUserAgent(/Chrome/i);
|
|
421
|
+
}
|
|
422
|
+
function $c87311424ea30a05$export$a11b0059900ceec8() {
|
|
423
|
+
return $c87311424ea30a05$var$testUserAgent(/Android/i);
|
|
424
|
+
}
|
|
425
|
+
function $c87311424ea30a05$export$b7d78993b74f766d() {
|
|
426
|
+
return $c87311424ea30a05$var$testUserAgent(/Firefox/i);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+
const $ea8dcbcb9ea1b556$var$RouterContext = /*#__PURE__*/ (0, $12uGp$createContext)({
|
|
433
|
+
isNative: true,
|
|
434
|
+
open: $ea8dcbcb9ea1b556$var$openSyntheticLink
|
|
435
|
+
});
|
|
436
|
+
function $ea8dcbcb9ea1b556$export$323e4fc2fa4753fb(props) {
|
|
437
|
+
let { children: children, navigate: navigate } = props;
|
|
438
|
+
let ctx = (0, $12uGp$useMemo)(()=>({
|
|
439
|
+
isNative: false,
|
|
440
|
+
open: (target, modifiers)=>{
|
|
441
|
+
$ea8dcbcb9ea1b556$var$getSyntheticLink(target, (link)=>{
|
|
442
|
+
if ($ea8dcbcb9ea1b556$export$efa8c9099e530235(link, modifiers)) navigate(link.pathname + link.search + link.hash);
|
|
443
|
+
else $ea8dcbcb9ea1b556$export$95185d699e05d4d7(link, modifiers);
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
}), [
|
|
447
|
+
navigate
|
|
448
|
+
]);
|
|
449
|
+
return /*#__PURE__*/ (0, $12uGp$react).createElement($ea8dcbcb9ea1b556$var$RouterContext.Provider, {
|
|
450
|
+
value: ctx
|
|
451
|
+
}, children);
|
|
452
|
+
}
|
|
453
|
+
function $ea8dcbcb9ea1b556$export$9a302a45f65d0572() {
|
|
454
|
+
return (0, $12uGp$useContext)($ea8dcbcb9ea1b556$var$RouterContext);
|
|
455
|
+
}
|
|
456
|
+
function $ea8dcbcb9ea1b556$export$efa8c9099e530235(link, modifiers) {
|
|
457
|
+
// Use getAttribute here instead of link.target. Firefox will default link.target to "_parent" when inside an iframe.
|
|
458
|
+
let target = link.getAttribute("target");
|
|
459
|
+
return (!target || target === "_self") && link.origin === location.origin && !link.hasAttribute("download") && !modifiers.metaKey && // open in new tab (mac)
|
|
460
|
+
!modifiers.ctrlKey && // open in new tab (windows)
|
|
461
|
+
!modifiers.altKey && // download
|
|
462
|
+
!modifiers.shiftKey;
|
|
463
|
+
}
|
|
464
|
+
function $ea8dcbcb9ea1b556$export$95185d699e05d4d7(target, modifiers, setOpening = true) {
|
|
465
|
+
var _window_event, _window_event_type;
|
|
466
|
+
let { metaKey: metaKey, ctrlKey: ctrlKey, altKey: altKey, shiftKey: shiftKey } = modifiers;
|
|
467
|
+
// Firefox does not recognize keyboard events as a user action by default, and the popup blocker
|
|
468
|
+
// will prevent links with target="_blank" from opening. However, it does allow the event if the
|
|
469
|
+
// Command/Control key is held, which opens the link in a background tab. This seems like the best we can do.
|
|
470
|
+
// See https://bugzilla.mozilla.org/show_bug.cgi?id=257870 and https://bugzilla.mozilla.org/show_bug.cgi?id=746640.
|
|
471
|
+
if ((0, $c87311424ea30a05$export$b7d78993b74f766d)() && ((_window_event = window.event) === null || _window_event === void 0 ? void 0 : (_window_event_type = _window_event.type) === null || _window_event_type === void 0 ? void 0 : _window_event_type.startsWith("key")) && target.target === "_blank") {
|
|
472
|
+
if ((0, $c87311424ea30a05$export$9ac100e40613ea10)()) metaKey = true;
|
|
473
|
+
else ctrlKey = true;
|
|
474
|
+
}
|
|
475
|
+
// WebKit does not support firing click events with modifier keys, but does support keyboard events.
|
|
476
|
+
// https://github.com/WebKit/WebKit/blob/c03d0ac6e6db178f90923a0a63080b5ca210d25f/Source/WebCore/html/HTMLAnchorElement.cpp#L184
|
|
477
|
+
let event = (0, $c87311424ea30a05$export$78551043582a6a98)() && (0, $c87311424ea30a05$export$9ac100e40613ea10)() && !(0, $c87311424ea30a05$export$7bef049ce92e4224)() && true ? new KeyboardEvent("keydown", {
|
|
478
|
+
keyIdentifier: "Enter",
|
|
479
|
+
metaKey: metaKey,
|
|
480
|
+
ctrlKey: ctrlKey,
|
|
481
|
+
altKey: altKey,
|
|
482
|
+
shiftKey: shiftKey
|
|
483
|
+
}) : new MouseEvent("click", {
|
|
484
|
+
metaKey: metaKey,
|
|
485
|
+
ctrlKey: ctrlKey,
|
|
486
|
+
altKey: altKey,
|
|
487
|
+
shiftKey: shiftKey,
|
|
488
|
+
bubbles: true,
|
|
489
|
+
cancelable: true
|
|
490
|
+
});
|
|
491
|
+
$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = setOpening;
|
|
492
|
+
(0, $7215afc6de606d6b$export$de79e2c695e052f3)(target);
|
|
493
|
+
target.dispatchEvent(event);
|
|
494
|
+
$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = false;
|
|
495
|
+
}
|
|
496
|
+
$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = false;
|
|
497
|
+
function $ea8dcbcb9ea1b556$var$getSyntheticLink(target, open) {
|
|
498
|
+
if (target instanceof HTMLAnchorElement) open(target);
|
|
499
|
+
else if (target.hasAttribute("data-href")) {
|
|
500
|
+
let link = document.createElement("a");
|
|
501
|
+
link.href = target.getAttribute("data-href");
|
|
502
|
+
if (target.hasAttribute("data-target")) link.target = target.getAttribute("data-target");
|
|
503
|
+
if (target.hasAttribute("data-rel")) link.rel = target.getAttribute("data-rel");
|
|
504
|
+
if (target.hasAttribute("data-download")) link.download = target.getAttribute("data-download");
|
|
505
|
+
if (target.hasAttribute("data-ping")) link.ping = target.getAttribute("data-ping");
|
|
506
|
+
if (target.hasAttribute("data-referrer-policy")) link.referrerPolicy = target.getAttribute("data-referrer-policy");
|
|
507
|
+
target.appendChild(link);
|
|
508
|
+
open(link);
|
|
509
|
+
target.removeChild(link);
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
function $ea8dcbcb9ea1b556$var$openSyntheticLink(target, modifiers) {
|
|
513
|
+
$ea8dcbcb9ea1b556$var$getSyntheticLink(target, (link)=>$ea8dcbcb9ea1b556$export$95185d699e05d4d7(link, modifiers));
|
|
514
|
+
}
|
|
515
|
+
function $ea8dcbcb9ea1b556$export$51437d503373d223(props) {
|
|
516
|
+
return {
|
|
517
|
+
"data-href": props.href,
|
|
518
|
+
"data-target": props.target,
|
|
519
|
+
"data-rel": props.rel,
|
|
520
|
+
"data-download": props.download,
|
|
521
|
+
"data-ping": props.ping,
|
|
522
|
+
"data-referrer-policy": props.referrerPolicy
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
|
|
362
527
|
/*
|
|
363
528
|
* Copyright 2020 Adobe. All rights reserved.
|
|
364
529
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -445,7 +610,7 @@ function $bbed8b41f857bcc0$export$24490316f764c430(fn) {
|
|
|
445
610
|
const $9cc09df9fd7676be$var$draggingElements = [];
|
|
446
611
|
function $9cc09df9fd7676be$export$7bbed75feba39706(props) {
|
|
447
612
|
console.warn("useDrag1D is deprecated, please use `useMove` instead https://react-spectrum.adobe.com/react-aria/useMove.html");
|
|
448
|
-
let { containerRef: containerRef
|
|
613
|
+
let { containerRef: containerRef, reverse: reverse, orientation: orientation, onHover: onHover, onDrag: onDrag, onPositionChange: onPositionChange, onIncrement: onIncrement, onDecrement: onDecrement, onIncrementToMax: onIncrementToMax, onDecrementToMin: onDecrementToMin, onCollapseToggle: onCollapseToggle } = props;
|
|
449
614
|
let getPosition = (e)=>orientation === "horizontal" ? e.clientX : e.clientY;
|
|
450
615
|
let getNextOffset = (e)=>{
|
|
451
616
|
let containerOffset = (0, $ab71dadb03a6fb2e$export$622cea445a1c5b7d)(containerRef.current, reverse, orientation);
|
|
@@ -622,7 +787,7 @@ function $03deb23ff14920c4$export$4eaf04e54aa8eed6() {
|
|
|
622
787
|
* governing permissions and limitations under the License.
|
|
623
788
|
*/
|
|
624
789
|
function $313b98861ee5dd6c$export$d6875122194c7b44(props, defaultLabel) {
|
|
625
|
-
let { id: id
|
|
790
|
+
let { id: id, "aria-label": label, "aria-labelledby": labelledBy } = props;
|
|
626
791
|
// If there is both an aria-label and aria-labelledby,
|
|
627
792
|
// combine them by pointing to the element itself.
|
|
628
793
|
id = (0, $bdb11010cef70236$export$f680877a34711e37)(id);
|
|
@@ -708,7 +873,7 @@ function $9daab02d461809db$var$hasResizeObserver() {
|
|
|
708
873
|
return typeof window.ResizeObserver !== "undefined";
|
|
709
874
|
}
|
|
710
875
|
function $9daab02d461809db$export$683480f191c0e3ea(options) {
|
|
711
|
-
const { ref: ref
|
|
876
|
+
const { ref: ref, onResize: onResize } = options;
|
|
712
877
|
(0, $12uGp$useEffect)(()=>{
|
|
713
878
|
let element = ref === null || ref === void 0 ? void 0 : ref.current;
|
|
714
879
|
if (!element) return;
|
|
@@ -753,10 +918,7 @@ function $e7801be82b4b2a53$export$4debdb1a3f0fa79e(context, ref) {
|
|
|
753
918
|
context.ref.current = null;
|
|
754
919
|
};
|
|
755
920
|
}
|
|
756
|
-
}
|
|
757
|
-
context,
|
|
758
|
-
ref
|
|
759
|
-
]);
|
|
921
|
+
});
|
|
760
922
|
}
|
|
761
923
|
|
|
762
924
|
|
|
@@ -792,10 +954,15 @@ function $62d8ded9296f3872$export$2bb74740c4e19def(node) {
|
|
|
792
954
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
793
955
|
* governing permissions and limitations under the License.
|
|
794
956
|
*/
|
|
957
|
+
|
|
795
958
|
// @ts-ignore
|
|
796
959
|
let $5df64b3807dc15ee$var$visualViewport = typeof document !== "undefined" && window.visualViewport;
|
|
797
960
|
function $5df64b3807dc15ee$export$d699905dd57c73ca() {
|
|
798
|
-
let
|
|
961
|
+
let isSSR = (0, $12uGp$useIsSSR)();
|
|
962
|
+
let [size, setSize] = (0, $12uGp$useState)(()=>isSSR ? {
|
|
963
|
+
width: 0,
|
|
964
|
+
height: 0
|
|
965
|
+
} : $5df64b3807dc15ee$var$getViewportSize());
|
|
799
966
|
(0, $12uGp$useEffect)(()=>{
|
|
800
967
|
// Use visualViewport api to track available height even on iOS virtual keyboard opening
|
|
801
968
|
let onResize = ()=>{
|
|
@@ -871,51 +1038,6 @@ function $ef06256079686ba0$export$f8aeda7b10753fa1(description) {
|
|
|
871
1038
|
}
|
|
872
1039
|
|
|
873
1040
|
|
|
874
|
-
/*
|
|
875
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
876
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
877
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
878
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
879
|
-
*
|
|
880
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
881
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
882
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
883
|
-
* governing permissions and limitations under the License.
|
|
884
|
-
*/ function $c87311424ea30a05$var$testUserAgent(re) {
|
|
885
|
-
var _window_navigator_userAgentData;
|
|
886
|
-
if (typeof window === "undefined" || window.navigator == null) return false;
|
|
887
|
-
return ((_window_navigator_userAgentData = window.navigator["userAgentData"]) === null || _window_navigator_userAgentData === void 0 ? void 0 : _window_navigator_userAgentData.brands.some((brand)=>re.test(brand.brand))) || re.test(window.navigator.userAgent);
|
|
888
|
-
}
|
|
889
|
-
function $c87311424ea30a05$var$testPlatform(re) {
|
|
890
|
-
var _window_navigator_userAgentData;
|
|
891
|
-
return typeof window !== "undefined" && window.navigator != null ? re.test(((_window_navigator_userAgentData = window.navigator["userAgentData"]) === null || _window_navigator_userAgentData === void 0 ? void 0 : _window_navigator_userAgentData.platform) || window.navigator.platform) : false;
|
|
892
|
-
}
|
|
893
|
-
function $c87311424ea30a05$export$9ac100e40613ea10() {
|
|
894
|
-
return $c87311424ea30a05$var$testPlatform(/^Mac/i);
|
|
895
|
-
}
|
|
896
|
-
function $c87311424ea30a05$export$186c6964ca17d99() {
|
|
897
|
-
return $c87311424ea30a05$var$testPlatform(/^iPhone/i);
|
|
898
|
-
}
|
|
899
|
-
function $c87311424ea30a05$export$7bef049ce92e4224() {
|
|
900
|
-
return $c87311424ea30a05$var$testPlatform(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
|
|
901
|
-
$c87311424ea30a05$export$9ac100e40613ea10() && navigator.maxTouchPoints > 1;
|
|
902
|
-
}
|
|
903
|
-
function $c87311424ea30a05$export$fedb369cb70207f1() {
|
|
904
|
-
return $c87311424ea30a05$export$186c6964ca17d99() || $c87311424ea30a05$export$7bef049ce92e4224();
|
|
905
|
-
}
|
|
906
|
-
function $c87311424ea30a05$export$e1865c3bedcd822b() {
|
|
907
|
-
return $c87311424ea30a05$export$9ac100e40613ea10() || $c87311424ea30a05$export$fedb369cb70207f1();
|
|
908
|
-
}
|
|
909
|
-
function $c87311424ea30a05$export$78551043582a6a98() {
|
|
910
|
-
return $c87311424ea30a05$var$testUserAgent(/AppleWebKit/i) && !$c87311424ea30a05$export$6446a186d09e379e();
|
|
911
|
-
}
|
|
912
|
-
function $c87311424ea30a05$export$6446a186d09e379e() {
|
|
913
|
-
return $c87311424ea30a05$var$testUserAgent(/Chrome/i);
|
|
914
|
-
}
|
|
915
|
-
function $c87311424ea30a05$export$a11b0059900ceec8() {
|
|
916
|
-
return $c87311424ea30a05$var$testUserAgent(/Android/i);
|
|
917
|
-
}
|
|
918
|
-
|
|
919
1041
|
|
|
920
1042
|
/*
|
|
921
1043
|
* Copyright 2021 Adobe. All rights reserved.
|
|
@@ -969,7 +1091,7 @@ function $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollView, element) {
|
|
|
969
1091
|
let x = scrollView.scrollLeft;
|
|
970
1092
|
let y = scrollView.scrollTop;
|
|
971
1093
|
// Account for top/left border offsetting the scroll top/Left
|
|
972
|
-
let { borderTopWidth: borderTopWidth
|
|
1094
|
+
let { borderTopWidth: borderTopWidth, borderLeftWidth: borderLeftWidth } = getComputedStyle(scrollView);
|
|
973
1095
|
let borderAdjustedX = scrollView.scrollLeft + parseInt(borderLeftWidth, 10);
|
|
974
1096
|
let borderAdjustedY = scrollView.scrollTop + parseInt(borderTopWidth, 10);
|
|
975
1097
|
// Ignore end/bottom border via clientHeight/Width instead of offsetHeight/Width
|
|
@@ -1011,11 +1133,11 @@ function $2f04cbc44ee30ce0$export$c826860796309d1b(targetElement, opts) {
|
|
|
1011
1133
|
var // use scrollIntoView({block: 'nearest'}) instead of .focus to check if the element is fully in view or not since .focus()
|
|
1012
1134
|
// won't cause a scroll if the element is already focused and doesn't behave consistently when an element is partially out of view horizontally vs vertically
|
|
1013
1135
|
_targetElement_scrollIntoView;
|
|
1014
|
-
let { left: originalLeft
|
|
1136
|
+
let { left: originalLeft, top: originalTop } = targetElement.getBoundingClientRect();
|
|
1015
1137
|
targetElement === null || targetElement === void 0 ? void 0 : (_targetElement_scrollIntoView = targetElement.scrollIntoView) === null || _targetElement_scrollIntoView === void 0 ? void 0 : _targetElement_scrollIntoView.call(targetElement, {
|
|
1016
1138
|
block: "nearest"
|
|
1017
1139
|
});
|
|
1018
|
-
let { left: newLeft
|
|
1140
|
+
let { left: newLeft, top: newTop } = targetElement.getBoundingClientRect();
|
|
1019
1141
|
// Account for sub pixel differences from rounding
|
|
1020
1142
|
if (Math.abs(originalLeft - newLeft) > 1 || Math.abs(originalTop - newTop) > 1) {
|
|
1021
1143
|
var _opts_containingElement, _opts_containingElement_scrollIntoView, _targetElement_scrollIntoView1;
|
|
@@ -1127,5 +1249,5 @@ function $99facab73266f662$export$5add1d006293d136(ref, initialValue, onReset) {
|
|
|
1127
1249
|
|
|
1128
1250
|
|
|
1129
1251
|
|
|
1130
|
-
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, $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};
|
|
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};
|
|
1131
1253
|
//# sourceMappingURL=module.js.map
|