@react-aria/utils 3.20.0 → 3.21.1

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/main.js CHANGED
@@ -19,6 +19,11 @@ $parcel$export(module.exports, "mergeRefs", () => $f05dc24eafaeb7e2$export$c9058
19
19
  $parcel$export(module.exports, "filterDOMProps", () => $8d15d0e1797d4238$export$457c3d6518dd4c6f);
20
20
  $parcel$export(module.exports, "focusWithoutScrolling", () => $1117b6c0d4c4c164$export$de79e2c695e052f3);
21
21
  $parcel$export(module.exports, "getOffset", () => $16ec41ef3e36c19c$export$622cea445a1c5b7d);
22
+ $parcel$export(module.exports, "openLink", () => $4068a0fae83b6d84$export$95185d699e05d4d7);
23
+ $parcel$export(module.exports, "getSyntheticLinkProps", () => $4068a0fae83b6d84$export$51437d503373d223);
24
+ $parcel$export(module.exports, "RouterProvider", () => $4068a0fae83b6d84$export$323e4fc2fa4753fb);
25
+ $parcel$export(module.exports, "shouldClientNavigate", () => $4068a0fae83b6d84$export$efa8c9099e530235);
26
+ $parcel$export(module.exports, "useRouter", () => $4068a0fae83b6d84$export$9a302a45f65d0572);
22
27
  $parcel$export(module.exports, "runAfterTransition", () => $e8117ebcab55be6a$export$24490316f764c430);
23
28
  $parcel$export(module.exports, "useDrag1D", () => $28ed3fb20343b78b$export$7bbed75feba39706);
24
29
  $parcel$export(module.exports, "useGlobalListeners", () => $4571ff54ac709100$export$4eaf04e54aa8eed6);
@@ -316,11 +321,20 @@ const $8d15d0e1797d4238$var$labelablePropNames = new Set([
316
321
  "aria-describedby",
317
322
  "aria-details"
318
323
  ]);
324
+ // See LinkDOMProps in dom.d.ts.
325
+ const $8d15d0e1797d4238$var$linkPropNames = new Set([
326
+ "href",
327
+ "target",
328
+ "rel",
329
+ "download",
330
+ "ping",
331
+ "referrerPolicy"
332
+ ]);
319
333
  const $8d15d0e1797d4238$var$propRe = /^(data-.*)$/;
320
334
  function $8d15d0e1797d4238$export$457c3d6518dd4c6f(props, opts = {}) {
321
- let { labelable: labelable , propNames: propNames } = opts;
335
+ let { labelable: labelable, isLink: isLink, propNames: propNames } = opts;
322
336
  let filteredProps = {};
323
- for(const prop in props)if (Object.prototype.hasOwnProperty.call(props, prop) && ($8d15d0e1797d4238$var$DOMPropNames.has(prop) || labelable && $8d15d0e1797d4238$var$labelablePropNames.has(prop) || (propNames === null || propNames === void 0 ? void 0 : propNames.has(prop)) || $8d15d0e1797d4238$var$propRe.test(prop))) filteredProps[prop] = props[prop];
337
+ for(const prop in props)if (Object.prototype.hasOwnProperty.call(props, prop) && ($8d15d0e1797d4238$var$DOMPropNames.has(prop) || labelable && $8d15d0e1797d4238$var$labelablePropNames.has(prop) || isLink && $8d15d0e1797d4238$var$linkPropNames.has(prop) || (propNames === null || propNames === void 0 ? void 0 : propNames.has(prop)) || $8d15d0e1797d4238$var$propRe.test(prop))) filteredProps[prop] = props[prop];
324
338
  return filteredProps;
325
339
  }
326
340
 
@@ -383,7 +397,7 @@ function $1117b6c0d4c4c164$var$getScrollableElements(element) {
383
397
  return scrollableElements;
384
398
  }
385
399
  function $1117b6c0d4c4c164$var$restoreScrollPosition(scrollableElements) {
386
- for (let { element: element , scrollTop: scrollTop , scrollLeft: scrollLeft } of scrollableElements){
400
+ for (let { element: element, scrollTop: scrollTop, scrollLeft: scrollLeft } of scrollableElements){
387
401
  element.scrollTop = scrollTop;
388
402
  element.scrollLeft = scrollLeft;
389
403
  }
@@ -407,6 +421,163 @@ function $1117b6c0d4c4c164$var$restoreScrollPosition(scrollableElements) {
407
421
  }
408
422
 
409
423
 
424
+ /*
425
+ * Copyright 2023 Adobe. All rights reserved.
426
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
427
+ * you may not use this file except in compliance with the License. You may obtain a copy
428
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
429
+ *
430
+ * Unless required by applicable law or agreed to in writing, software distributed under
431
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
432
+ * OF ANY KIND, either express or implied. See the License for the specific language
433
+ * governing permissions and limitations under the License.
434
+ */ /*
435
+ * Copyright 2020 Adobe. All rights reserved.
436
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
437
+ * you may not use this file except in compliance with the License. You may obtain a copy
438
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
439
+ *
440
+ * Unless required by applicable law or agreed to in writing, software distributed under
441
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
442
+ * OF ANY KIND, either express or implied. See the License for the specific language
443
+ * governing permissions and limitations under the License.
444
+ */ function $9e20cff0af27e8cc$var$testUserAgent(re) {
445
+ var _window_navigator_userAgentData;
446
+ if (typeof window === "undefined" || window.navigator == null) return false;
447
+ 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);
448
+ }
449
+ function $9e20cff0af27e8cc$var$testPlatform(re) {
450
+ var _window_navigator_userAgentData;
451
+ 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;
452
+ }
453
+ function $9e20cff0af27e8cc$export$9ac100e40613ea10() {
454
+ return $9e20cff0af27e8cc$var$testPlatform(/^Mac/i);
455
+ }
456
+ function $9e20cff0af27e8cc$export$186c6964ca17d99() {
457
+ return $9e20cff0af27e8cc$var$testPlatform(/^iPhone/i);
458
+ }
459
+ function $9e20cff0af27e8cc$export$7bef049ce92e4224() {
460
+ return $9e20cff0af27e8cc$var$testPlatform(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
461
+ $9e20cff0af27e8cc$export$9ac100e40613ea10() && navigator.maxTouchPoints > 1;
462
+ }
463
+ function $9e20cff0af27e8cc$export$fedb369cb70207f1() {
464
+ return $9e20cff0af27e8cc$export$186c6964ca17d99() || $9e20cff0af27e8cc$export$7bef049ce92e4224();
465
+ }
466
+ function $9e20cff0af27e8cc$export$e1865c3bedcd822b() {
467
+ return $9e20cff0af27e8cc$export$9ac100e40613ea10() || $9e20cff0af27e8cc$export$fedb369cb70207f1();
468
+ }
469
+ function $9e20cff0af27e8cc$export$78551043582a6a98() {
470
+ return $9e20cff0af27e8cc$var$testUserAgent(/AppleWebKit/i) && !$9e20cff0af27e8cc$export$6446a186d09e379e();
471
+ }
472
+ function $9e20cff0af27e8cc$export$6446a186d09e379e() {
473
+ return $9e20cff0af27e8cc$var$testUserAgent(/Chrome/i);
474
+ }
475
+ function $9e20cff0af27e8cc$export$a11b0059900ceec8() {
476
+ return $9e20cff0af27e8cc$var$testUserAgent(/Android/i);
477
+ }
478
+ function $9e20cff0af27e8cc$export$b7d78993b74f766d() {
479
+ return $9e20cff0af27e8cc$var$testUserAgent(/Firefox/i);
480
+ }
481
+
482
+
483
+
484
+
485
+ const $4068a0fae83b6d84$var$RouterContext = /*#__PURE__*/ (0, $1Yh1N$react.createContext)({
486
+ isNative: true,
487
+ open: $4068a0fae83b6d84$var$openSyntheticLink
488
+ });
489
+ function $4068a0fae83b6d84$export$323e4fc2fa4753fb(props) {
490
+ let { children: children, navigate: navigate } = props;
491
+ let ctx = (0, $1Yh1N$react.useMemo)(()=>({
492
+ isNative: false,
493
+ open: (target, modifiers)=>{
494
+ $4068a0fae83b6d84$var$getSyntheticLink(target, (link)=>{
495
+ if ($4068a0fae83b6d84$export$efa8c9099e530235(link, modifiers)) navigate(link.pathname + link.search + link.hash);
496
+ else $4068a0fae83b6d84$export$95185d699e05d4d7(link, modifiers);
497
+ });
498
+ }
499
+ }), [
500
+ navigate
501
+ ]);
502
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($1Yh1N$react))).createElement($4068a0fae83b6d84$var$RouterContext.Provider, {
503
+ value: ctx
504
+ }, children);
505
+ }
506
+ function $4068a0fae83b6d84$export$9a302a45f65d0572() {
507
+ return (0, $1Yh1N$react.useContext)($4068a0fae83b6d84$var$RouterContext);
508
+ }
509
+ function $4068a0fae83b6d84$export$efa8c9099e530235(link, modifiers) {
510
+ // Use getAttribute here instead of link.target. Firefox will default link.target to "_parent" when inside an iframe.
511
+ let target = link.getAttribute("target");
512
+ return (!target || target === "_self") && link.origin === location.origin && !link.hasAttribute("download") && !modifiers.metaKey && // open in new tab (mac)
513
+ !modifiers.ctrlKey && // open in new tab (windows)
514
+ !modifiers.altKey && // download
515
+ !modifiers.shiftKey;
516
+ }
517
+ function $4068a0fae83b6d84$export$95185d699e05d4d7(target, modifiers, setOpening = true) {
518
+ var _window_event, _window_event_type;
519
+ let { metaKey: metaKey, ctrlKey: ctrlKey, altKey: altKey, shiftKey: shiftKey } = modifiers;
520
+ // Firefox does not recognize keyboard events as a user action by default, and the popup blocker
521
+ // will prevent links with target="_blank" from opening. However, it does allow the event if the
522
+ // Command/Control key is held, which opens the link in a background tab. This seems like the best we can do.
523
+ // See https://bugzilla.mozilla.org/show_bug.cgi?id=257870 and https://bugzilla.mozilla.org/show_bug.cgi?id=746640.
524
+ if ((0, $9e20cff0af27e8cc$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") {
525
+ if ((0, $9e20cff0af27e8cc$export$9ac100e40613ea10)()) metaKey = true;
526
+ else ctrlKey = true;
527
+ }
528
+ // WebKit does not support firing click events with modifier keys, but does support keyboard events.
529
+ // https://github.com/WebKit/WebKit/blob/c03d0ac6e6db178f90923a0a63080b5ca210d25f/Source/WebCore/html/HTMLAnchorElement.cpp#L184
530
+ let event = (0, $9e20cff0af27e8cc$export$78551043582a6a98)() && (0, $9e20cff0af27e8cc$export$9ac100e40613ea10)() && !(0, $9e20cff0af27e8cc$export$7bef049ce92e4224)() && true ? new KeyboardEvent("keydown", {
531
+ keyIdentifier: "Enter",
532
+ metaKey: metaKey,
533
+ ctrlKey: ctrlKey,
534
+ altKey: altKey,
535
+ shiftKey: shiftKey
536
+ }) : new MouseEvent("click", {
537
+ metaKey: metaKey,
538
+ ctrlKey: ctrlKey,
539
+ altKey: altKey,
540
+ shiftKey: shiftKey,
541
+ bubbles: true,
542
+ cancelable: true
543
+ });
544
+ $4068a0fae83b6d84$export$95185d699e05d4d7.isOpening = setOpening;
545
+ (0, $1117b6c0d4c4c164$export$de79e2c695e052f3)(target);
546
+ target.dispatchEvent(event);
547
+ $4068a0fae83b6d84$export$95185d699e05d4d7.isOpening = false;
548
+ }
549
+ // https://github.com/parcel-bundler/parcel/issues/8724
550
+ $4068a0fae83b6d84$export$95185d699e05d4d7.isOpening = false;
551
+ function $4068a0fae83b6d84$var$getSyntheticLink(target, open) {
552
+ if (target instanceof HTMLAnchorElement) open(target);
553
+ else if (target.hasAttribute("data-href")) {
554
+ let link = document.createElement("a");
555
+ link.href = target.getAttribute("data-href");
556
+ if (target.hasAttribute("data-target")) link.target = target.getAttribute("data-target");
557
+ if (target.hasAttribute("data-rel")) link.rel = target.getAttribute("data-rel");
558
+ if (target.hasAttribute("data-download")) link.download = target.getAttribute("data-download");
559
+ if (target.hasAttribute("data-ping")) link.ping = target.getAttribute("data-ping");
560
+ if (target.hasAttribute("data-referrer-policy")) link.referrerPolicy = target.getAttribute("data-referrer-policy");
561
+ target.appendChild(link);
562
+ open(link);
563
+ target.removeChild(link);
564
+ }
565
+ }
566
+ function $4068a0fae83b6d84$var$openSyntheticLink(target, modifiers) {
567
+ $4068a0fae83b6d84$var$getSyntheticLink(target, (link)=>$4068a0fae83b6d84$export$95185d699e05d4d7(link, modifiers));
568
+ }
569
+ function $4068a0fae83b6d84$export$51437d503373d223(props) {
570
+ return {
571
+ "data-href": props.href,
572
+ "data-target": props.target,
573
+ "data-rel": props.rel,
574
+ "data-download": props.download,
575
+ "data-ping": props.ping,
576
+ "data-referrer-policy": props.referrerPolicy
577
+ };
578
+ }
579
+
580
+
410
581
  /*
411
582
  * Copyright 2020 Adobe. All rights reserved.
412
583
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -493,7 +664,7 @@ function $e8117ebcab55be6a$export$24490316f764c430(fn) {
493
664
  const $28ed3fb20343b78b$var$draggingElements = [];
494
665
  function $28ed3fb20343b78b$export$7bbed75feba39706(props) {
495
666
  console.warn("useDrag1D is deprecated, please use `useMove` instead https://react-spectrum.adobe.com/react-aria/useMove.html");
496
- let { containerRef: containerRef , reverse: reverse , orientation: orientation , onHover: onHover , onDrag: onDrag , onPositionChange: onPositionChange , onIncrement: onIncrement , onDecrement: onDecrement , onIncrementToMax: onIncrementToMax , onDecrementToMin: onDecrementToMin , onCollapseToggle: onCollapseToggle } = props;
667
+ let { containerRef: containerRef, reverse: reverse, orientation: orientation, onHover: onHover, onDrag: onDrag, onPositionChange: onPositionChange, onIncrement: onIncrement, onDecrement: onDecrement, onIncrementToMax: onIncrementToMax, onDecrementToMin: onDecrementToMin, onCollapseToggle: onCollapseToggle } = props;
497
668
  let getPosition = (e)=>orientation === "horizontal" ? e.clientX : e.clientY;
498
669
  let getNextOffset = (e)=>{
499
670
  let containerOffset = (0, $16ec41ef3e36c19c$export$622cea445a1c5b7d)(containerRef.current, reverse, orientation);
@@ -670,7 +841,7 @@ function $4571ff54ac709100$export$4eaf04e54aa8eed6() {
670
841
  * governing permissions and limitations under the License.
671
842
  */
672
843
  function $6ec78bde395c477d$export$d6875122194c7b44(props, defaultLabel) {
673
- let { id: id , "aria-label": label , "aria-labelledby": labelledBy } = props;
844
+ let { id: id, "aria-label": label, "aria-labelledby": labelledBy } = props;
674
845
  // If there is both an aria-label and aria-labelledby,
675
846
  // combine them by pointing to the element itself.
676
847
  id = (0, $8c61827343eed941$export$f680877a34711e37)(id);
@@ -756,7 +927,7 @@ function $37733e1652f47193$var$hasResizeObserver() {
756
927
  return typeof window.ResizeObserver !== "undefined";
757
928
  }
758
929
  function $37733e1652f47193$export$683480f191c0e3ea(options) {
759
- const { ref: ref , onResize: onResize } = options;
930
+ const { ref: ref, onResize: onResize } = options;
760
931
  (0, $1Yh1N$react.useEffect)(()=>{
761
932
  let element = ref === null || ref === void 0 ? void 0 : ref.current;
762
933
  if (!element) return;
@@ -801,10 +972,7 @@ function $6fc733991a9f977c$export$4debdb1a3f0fa79e(context, ref) {
801
972
  context.ref.current = null;
802
973
  };
803
974
  }
804
- }, [
805
- context,
806
- ref
807
- ]);
975
+ });
808
976
  }
809
977
 
810
978
 
@@ -840,10 +1008,15 @@ function $d796e7157ac96470$export$2bb74740c4e19def(node) {
840
1008
  * OF ANY KIND, either express or implied. See the License for the specific language
841
1009
  * governing permissions and limitations under the License.
842
1010
  */
1011
+
843
1012
  // @ts-ignore
844
1013
  let $8b24bab62f5c65ad$var$visualViewport = typeof document !== "undefined" && window.visualViewport;
845
1014
  function $8b24bab62f5c65ad$export$d699905dd57c73ca() {
846
- let [size, setSize] = (0, $1Yh1N$react.useState)(()=>$8b24bab62f5c65ad$var$getViewportSize());
1015
+ let isSSR = (0, $1Yh1N$reactariassr.useIsSSR)();
1016
+ let [size, setSize] = (0, $1Yh1N$react.useState)(()=>isSSR ? {
1017
+ width: 0,
1018
+ height: 0
1019
+ } : $8b24bab62f5c65ad$var$getViewportSize());
847
1020
  (0, $1Yh1N$react.useEffect)(()=>{
848
1021
  // Use visualViewport api to track available height even on iOS virtual keyboard opening
849
1022
  let onResize = ()=>{
@@ -919,51 +1092,6 @@ function $34da4502ea8120db$export$f8aeda7b10753fa1(description) {
919
1092
  }
920
1093
 
921
1094
 
922
- /*
923
- * Copyright 2020 Adobe. All rights reserved.
924
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
925
- * you may not use this file except in compliance with the License. You may obtain a copy
926
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
927
- *
928
- * Unless required by applicable law or agreed to in writing, software distributed under
929
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
930
- * OF ANY KIND, either express or implied. See the License for the specific language
931
- * governing permissions and limitations under the License.
932
- */ function $9e20cff0af27e8cc$var$testUserAgent(re) {
933
- var _window_navigator_userAgentData;
934
- if (typeof window === "undefined" || window.navigator == null) return false;
935
- 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);
936
- }
937
- function $9e20cff0af27e8cc$var$testPlatform(re) {
938
- var _window_navigator_userAgentData;
939
- 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;
940
- }
941
- function $9e20cff0af27e8cc$export$9ac100e40613ea10() {
942
- return $9e20cff0af27e8cc$var$testPlatform(/^Mac/i);
943
- }
944
- function $9e20cff0af27e8cc$export$186c6964ca17d99() {
945
- return $9e20cff0af27e8cc$var$testPlatform(/^iPhone/i);
946
- }
947
- function $9e20cff0af27e8cc$export$7bef049ce92e4224() {
948
- return $9e20cff0af27e8cc$var$testPlatform(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
949
- $9e20cff0af27e8cc$export$9ac100e40613ea10() && navigator.maxTouchPoints > 1;
950
- }
951
- function $9e20cff0af27e8cc$export$fedb369cb70207f1() {
952
- return $9e20cff0af27e8cc$export$186c6964ca17d99() || $9e20cff0af27e8cc$export$7bef049ce92e4224();
953
- }
954
- function $9e20cff0af27e8cc$export$e1865c3bedcd822b() {
955
- return $9e20cff0af27e8cc$export$9ac100e40613ea10() || $9e20cff0af27e8cc$export$fedb369cb70207f1();
956
- }
957
- function $9e20cff0af27e8cc$export$78551043582a6a98() {
958
- return $9e20cff0af27e8cc$var$testUserAgent(/AppleWebKit/i) && !$9e20cff0af27e8cc$export$6446a186d09e379e();
959
- }
960
- function $9e20cff0af27e8cc$export$6446a186d09e379e() {
961
- return $9e20cff0af27e8cc$var$testUserAgent(/Chrome/i);
962
- }
963
- function $9e20cff0af27e8cc$export$a11b0059900ceec8() {
964
- return $9e20cff0af27e8cc$var$testUserAgent(/Android/i);
965
- }
966
-
967
1095
 
968
1096
  /*
969
1097
  * Copyright 2021 Adobe. All rights reserved.
@@ -1017,7 +1145,7 @@ function $449412113267a1fe$export$53a0910f038337bd(scrollView, element) {
1017
1145
  let x = scrollView.scrollLeft;
1018
1146
  let y = scrollView.scrollTop;
1019
1147
  // Account for top/left border offsetting the scroll top/Left
1020
- let { borderTopWidth: borderTopWidth , borderLeftWidth: borderLeftWidth } = getComputedStyle(scrollView);
1148
+ let { borderTopWidth: borderTopWidth, borderLeftWidth: borderLeftWidth } = getComputedStyle(scrollView);
1021
1149
  let borderAdjustedX = scrollView.scrollLeft + parseInt(borderLeftWidth, 10);
1022
1150
  let borderAdjustedY = scrollView.scrollTop + parseInt(borderTopWidth, 10);
1023
1151
  // Ignore end/bottom border via clientHeight/Width instead of offsetHeight/Width
@@ -1059,11 +1187,11 @@ function $449412113267a1fe$export$c826860796309d1b(targetElement, opts) {
1059
1187
  var // use scrollIntoView({block: 'nearest'}) instead of .focus to check if the element is fully in view or not since .focus()
1060
1188
  // 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
1061
1189
  _targetElement_scrollIntoView;
1062
- let { left: originalLeft , top: originalTop } = targetElement.getBoundingClientRect();
1190
+ let { left: originalLeft, top: originalTop } = targetElement.getBoundingClientRect();
1063
1191
  targetElement === null || targetElement === void 0 ? void 0 : (_targetElement_scrollIntoView = targetElement.scrollIntoView) === null || _targetElement_scrollIntoView === void 0 ? void 0 : _targetElement_scrollIntoView.call(targetElement, {
1064
1192
  block: "nearest"
1065
1193
  });
1066
- let { left: newLeft , top: newTop } = targetElement.getBoundingClientRect();
1194
+ let { left: newLeft, top: newTop } = targetElement.getBoundingClientRect();
1067
1195
  // Account for sub pixel differences from rounding
1068
1196
  if (Math.abs(originalLeft - newLeft) > 1 || Math.abs(originalTop - newTop) > 1) {
1069
1197
  var _opts_containingElement, _opts_containingElement_scrollIntoView, _targetElement_scrollIntoView1;