Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@react-aria/utils

Package Overview
Dependencies
Maintainers
2
Versions
1337
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-aria/utils - npm Package Compare versions

Comparing version
3.0.0-nightly-8d310eb29-260114
to
3.0.0-nightly-8e585dfb4-260513
+45
dist/types/src/index.d.ts
export { CLEAR_FOCUS_EVENT, FOCUS_EVENT } from 'react-aria/private/utils/constants';
export { isMac, isIPhone, isIPad, isIOS, isAppleDevice, isWebKit, isChrome, isAndroid, isFirefox } from 'react-aria/private/utils/platform';
export { openLink, getSyntheticLinkProps, useSyntheticLinkProps, RouterProvider, shouldClientNavigate, useRouter, useLinkProps, handleLinkClick } from 'react-aria/private/utils/openLink';
export { useId } from 'react-aria/useId';
export { mergeIds, useSlotId } from 'react-aria/private/utils/useId';
export { chain } from 'react-aria/chain';
export { createShadowTreeWalker, ShadowTreeWalker } from 'react-aria/private/utils/shadowdom/ShadowTreeWalker';
export { getActiveElement, getEventTarget, nodeContains, isFocusWithin } from 'react-aria/private/utils/shadowdom/DOMFunctions';
export { getOwnerDocument, getOwnerWindow, isShadowRoot } from 'react-aria/private/utils/domHelpers';
export { mergeProps } from 'react-aria/mergeProps';
export { mergeRefs } from 'react-aria/mergeRefs';
export { filterDOMProps } from 'react-aria/filterDOMProps';
export { focusWithoutScrolling } from 'react-aria/private/utils/focusWithoutScrolling';
export { getOffset } from 'react-aria/private/utils/getOffset';
export { runAfterTransition } from 'react-aria/private/utils/runAfterTransition';
export { useDrag1D } from 'react-aria/private/utils/useDrag1D';
export { useGlobalListeners } from 'react-aria/private/utils/useGlobalListeners';
export { useLabels } from 'react-aria/private/utils/useLabels';
export { useObjectRef } from 'react-aria/useObjectRef';
export { useUpdateEffect } from 'react-aria/private/utils/useUpdateEffect';
export { useUpdateLayoutEffect } from 'react-aria/private/utils/useUpdateLayoutEffect';
export { useLayoutEffect } from 'react-aria/private/utils/useLayoutEffect';
export { useResizeObserver } from 'react-aria/private/utils/useResizeObserver';
export { useSyncRef } from 'react-aria/private/utils/useSyncRef';
export { getScrollParent } from 'react-aria/private/utils/getScrollParent';
export { getScrollParents } from 'react-aria/private/utils/getScrollParents';
export { isScrollable } from 'react-aria/private/utils/isScrollable';
export { useViewportSize } from 'react-aria/private/utils/useViewportSize';
export { useDescription } from 'react-aria/private/utils/useDescription';
export { useEvent } from 'react-aria/private/utils/useEvent';
export { useValueEffect } from 'react-aria/private/utils/useValueEffect';
export { scrollIntoView, scrollIntoViewport } from 'react-aria/private/utils/scrollIntoView';
export { isVirtualClick, isVirtualPointerEvent } from 'react-aria/private/utils/isVirtualEvent';
export { useEffectEvent } from 'react-aria/private/utils/useEffectEvent';
export { useDeepMemo } from 'react-aria/private/utils/useDeepMemo';
export { useFormReset } from 'react-aria/private/utils/useFormReset';
export { useLoadMore } from 'react-aria/private/utils/useLoadMore';
export { useLoadMoreSentinel, useLoadMoreSentinel as UNSTABLE_useLoadMoreSentinel } from 'react-aria/private/utils/useLoadMoreSentinel';
export { inertValue } from 'react-aria/private/utils/inertValue';
export { isCtrlKeyPressed, willOpenKeyboard } from 'react-aria/private/utils/keyboard';
export { useEnterAnimation, useExitAnimation } from 'react-aria/private/utils/animation';
export { isFocusable, isTabbable } from 'react-aria/private/utils/isFocusable';
export { getNonce } from 'react-aria/private/utils/getNonce';
export type { LoadMoreSentinelProps } from 'react-aria/private/utils/useLoadMoreSentinel';
export { clamp, snapValueToStep } from 'react-stately/private/utils/number';
+47
-43

@@ -1,43 +0,45 @@

import {mergeIds as $bdb11010cef70236$export$cd8c9cb68f842629, useId as $bdb11010cef70236$export$f680877a34711e37, useSlotId as $bdb11010cef70236$export$b4cc09c592e8fdb8} from "./useId.mjs";
import {chain as $ff5963eb1fccf552$export$e08e3b67e392101e} from "./chain.mjs";
import {createShadowTreeWalker as $dfc540311bf7f109$export$4d0f8be8b12a7ef6, ShadowTreeWalker as $dfc540311bf7f109$export$63eb3ababa9c55c4} from "./ShadowTreeWalker.mjs";
import {getActiveElement as $d4ee10de306f2510$export$cd4e5573fbe2b576, getEventTarget as $d4ee10de306f2510$export$e58f029f0fbfdb29, nodeContains as $d4ee10de306f2510$export$4282f70798064fe0} from "./DOMFunctions.mjs";
import {getOwnerDocument as $431fbd86ca7dc216$export$b204af158042fbac, getOwnerWindow as $431fbd86ca7dc216$export$f21a1ffae260145a, isShadowRoot as $431fbd86ca7dc216$export$af51f0f06c0f328a} from "./domHelpers.mjs";
import {mergeProps as $3ef42575df84b30b$export$9d1611c77c2fe928} from "./mergeProps.mjs";
import {mergeRefs as $5dc95899b306f630$export$c9058316764c140e} from "./mergeRefs.mjs";
import {filterDOMProps as $65484d02dcb7eb3e$export$457c3d6518dd4c6f} from "./filterDOMProps.mjs";
import {focusWithoutScrolling as $7215afc6de606d6b$export$de79e2c695e052f3} from "./focusWithoutScrolling.mjs";
import {getOffset as $ab71dadb03a6fb2e$export$622cea445a1c5b7d} from "./getOffset.mjs";
import {getSyntheticLinkProps as $ea8dcbcb9ea1b556$export$51437d503373d223, handleLinkClick as $ea8dcbcb9ea1b556$export$13aea1a3cb5e3f1f, openLink as $ea8dcbcb9ea1b556$export$95185d699e05d4d7, RouterProvider as $ea8dcbcb9ea1b556$export$323e4fc2fa4753fb, shouldClientNavigate as $ea8dcbcb9ea1b556$export$efa8c9099e530235, useLinkProps as $ea8dcbcb9ea1b556$export$7e924b3091a3bd18, useRouter as $ea8dcbcb9ea1b556$export$9a302a45f65d0572, useSyntheticLinkProps as $ea8dcbcb9ea1b556$export$bdc77b0c0a3a85d6} from "./openLink.mjs";
import {runAfterTransition as $bbed8b41f857bcc0$export$24490316f764c430} from "./runAfterTransition.mjs";
import {useDrag1D as $9cc09df9fd7676be$export$7bbed75feba39706} from "./useDrag1D.mjs";
import {useGlobalListeners as $03deb23ff14920c4$export$4eaf04e54aa8eed6} from "./useGlobalListeners.mjs";
import {useLabels as $313b98861ee5dd6c$export$d6875122194c7b44} from "./useLabels.mjs";
import {useObjectRef as $df56164dff5785e2$export$4338b53315abf666} from "./useObjectRef.mjs";
import {useUpdateEffect as $4f58c5f72bcf79f7$export$496315a1608d9602} from "./useUpdateEffect.mjs";
import {useUpdateLayoutEffect as $ca9b37712f007381$export$72ef708ab07251f1} from "./useUpdateLayoutEffect.mjs";
import {useLayoutEffect as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c} from "./useLayoutEffect.mjs";
import {useResizeObserver as $9daab02d461809db$export$683480f191c0e3ea} from "./useResizeObserver.mjs";
import {useSyncRef as $e7801be82b4b2a53$export$4debdb1a3f0fa79e} from "./useSyncRef.mjs";
import {getScrollParent as $62d8ded9296f3872$export$cfa2225e87938781} from "./getScrollParent.mjs";
import {getScrollParents as $a40c673dc9f6d9c7$export$94ed1c92c7beeb22} from "./getScrollParents.mjs";
import {isScrollable as $cc38e7bd3fc7b213$export$2bb74740c4e19def} from "./isScrollable.mjs";
import {useViewportSize as $5df64b3807dc15ee$export$d699905dd57c73ca} from "./useViewportSize.mjs";
import {useDescription as $ef06256079686ba0$export$f8aeda7b10753fa1} from "./useDescription.mjs";
import {isAndroid as $c87311424ea30a05$export$a11b0059900ceec8, isAppleDevice as $c87311424ea30a05$export$e1865c3bedcd822b, isChrome as $c87311424ea30a05$export$6446a186d09e379e, isFirefox as $c87311424ea30a05$export$b7d78993b74f766d, isIOS as $c87311424ea30a05$export$fedb369cb70207f1, isIPad as $c87311424ea30a05$export$7bef049ce92e4224, isIPhone as $c87311424ea30a05$export$186c6964ca17d99, isMac as $c87311424ea30a05$export$9ac100e40613ea10, isWebKit as $c87311424ea30a05$export$78551043582a6a98} from "./platform.mjs";
import {useEvent as $e9faafb641e167db$export$90fc3a17d93f704c} from "./useEvent.mjs";
import {useValueEffect as $1dbecbe27a04f9af$export$14d238f342723f25} from "./useValueEffect.mjs";
import {scrollIntoView as $2f04cbc44ee30ce0$export$53a0910f038337bd, scrollIntoViewport as $2f04cbc44ee30ce0$export$c826860796309d1b} from "./scrollIntoView.mjs";
import {isVirtualClick as $6a7db85432448f7f$export$60278871457622de, isVirtualPointerEvent as $6a7db85432448f7f$export$29bf1b5f2c56cf63} from "./isVirtualEvent.mjs";
import {useEffectEvent as $8ae05eaa5c114e9c$export$7f54fc3180508a52} from "./useEffectEvent.mjs";
import {useDeepMemo as $5a387cc49350e6db$export$722debc0e56fea39} from "./useDeepMemo.mjs";
import {useFormReset as $99facab73266f662$export$5add1d006293d136} from "./useFormReset.mjs";
import {useLoadMore as $26f7f3da73fcd9d6$export$7717c92ee915373e} from "./useLoadMore.mjs";
import {useLoadMoreSentinel as $a5fa973c1850dd36$export$ccaea96c28e8b9e7} from "./useLoadMoreSentinel.mjs";
import {inertValue as $cdc5a6778b766db2$export$a9d04c5684123369} from "./inertValue.mjs";
import {CLEAR_FOCUS_EVENT as $5671b20cf9b562b2$export$447a38995de2c711, FOCUS_EVENT as $5671b20cf9b562b2$export$831c820ad60f9d12} from "./constants.mjs";
import {isCtrlKeyPressed as $21f1aa98acb08317$export$16792effe837dba3, willOpenKeyboard as $21f1aa98acb08317$export$c57958e35f31ed73} from "./keyboard.mjs";
import {useEnterAnimation as $d3f049242431219c$export$6d3443f2c48bfc20, useExitAnimation as $d3f049242431219c$export$45fda7c47f93fd48} from "./animation.mjs";
import {isFocusable as $b4b717babfbb907b$export$4c063cf1350e6fed, isTabbable as $b4b717babfbb907b$export$bebd5a1431fec25d} from "./isFocusable.mjs";
import {clamp as $4507461a1b870123$re_export$clamp, snapValueToStep as $4507461a1b870123$re_export$snapValueToStep} from "@react-stately/utils";
import {CLEAR_FOCUS_EVENT as $a8ea2faf2ebe4d2f$re_export$CLEAR_FOCUS_EVENT, FOCUS_EVENT as $a8ea2faf2ebe4d2f$re_export$FOCUS_EVENT} from "react-aria/private/utils/constants";
import {isMac as $a8ea2faf2ebe4d2f$re_export$isMac, isIPhone as $a8ea2faf2ebe4d2f$re_export$isIPhone, isIPad as $a8ea2faf2ebe4d2f$re_export$isIPad, isIOS as $a8ea2faf2ebe4d2f$re_export$isIOS, isAppleDevice as $a8ea2faf2ebe4d2f$re_export$isAppleDevice, isWebKit as $a8ea2faf2ebe4d2f$re_export$isWebKit, isChrome as $a8ea2faf2ebe4d2f$re_export$isChrome, isAndroid as $a8ea2faf2ebe4d2f$re_export$isAndroid, isFirefox as $a8ea2faf2ebe4d2f$re_export$isFirefox} from "react-aria/private/utils/platform";
import {openLink as $a8ea2faf2ebe4d2f$re_export$openLink, getSyntheticLinkProps as $a8ea2faf2ebe4d2f$re_export$getSyntheticLinkProps, useSyntheticLinkProps as $a8ea2faf2ebe4d2f$re_export$useSyntheticLinkProps, RouterProvider as $a8ea2faf2ebe4d2f$re_export$RouterProvider, shouldClientNavigate as $a8ea2faf2ebe4d2f$re_export$shouldClientNavigate, useRouter as $a8ea2faf2ebe4d2f$re_export$useRouter, useLinkProps as $a8ea2faf2ebe4d2f$re_export$useLinkProps, handleLinkClick as $a8ea2faf2ebe4d2f$re_export$handleLinkClick} from "react-aria/private/utils/openLink";
import {useId as $a8ea2faf2ebe4d2f$re_export$useId} from "react-aria/useId";
import {mergeIds as $a8ea2faf2ebe4d2f$re_export$mergeIds, useSlotId as $a8ea2faf2ebe4d2f$re_export$useSlotId} from "react-aria/private/utils/useId";
import {chain as $a8ea2faf2ebe4d2f$re_export$chain} from "react-aria/chain";
import {createShadowTreeWalker as $a8ea2faf2ebe4d2f$re_export$createShadowTreeWalker, ShadowTreeWalker as $a8ea2faf2ebe4d2f$re_export$ShadowTreeWalker} from "react-aria/private/utils/shadowdom/ShadowTreeWalker";
import {getActiveElement as $a8ea2faf2ebe4d2f$re_export$getActiveElement, getEventTarget as $a8ea2faf2ebe4d2f$re_export$getEventTarget, nodeContains as $a8ea2faf2ebe4d2f$re_export$nodeContains, isFocusWithin as $a8ea2faf2ebe4d2f$re_export$isFocusWithin} from "react-aria/private/utils/shadowdom/DOMFunctions";
import {getOwnerDocument as $a8ea2faf2ebe4d2f$re_export$getOwnerDocument, getOwnerWindow as $a8ea2faf2ebe4d2f$re_export$getOwnerWindow, isShadowRoot as $a8ea2faf2ebe4d2f$re_export$isShadowRoot} from "react-aria/private/utils/domHelpers";
import {mergeProps as $a8ea2faf2ebe4d2f$re_export$mergeProps} from "react-aria/mergeProps";
import {mergeRefs as $a8ea2faf2ebe4d2f$re_export$mergeRefs} from "react-aria/mergeRefs";
import {filterDOMProps as $a8ea2faf2ebe4d2f$re_export$filterDOMProps} from "react-aria/filterDOMProps";
import {focusWithoutScrolling as $a8ea2faf2ebe4d2f$re_export$focusWithoutScrolling} from "react-aria/private/utils/focusWithoutScrolling";
import {getOffset as $a8ea2faf2ebe4d2f$re_export$getOffset} from "react-aria/private/utils/getOffset";
import {runAfterTransition as $a8ea2faf2ebe4d2f$re_export$runAfterTransition} from "react-aria/private/utils/runAfterTransition";
import {useDrag1D as $a8ea2faf2ebe4d2f$re_export$useDrag1D} from "react-aria/private/utils/useDrag1D";
import {useGlobalListeners as $a8ea2faf2ebe4d2f$re_export$useGlobalListeners} from "react-aria/private/utils/useGlobalListeners";
import {useLabels as $a8ea2faf2ebe4d2f$re_export$useLabels} from "react-aria/private/utils/useLabels";
import {useObjectRef as $a8ea2faf2ebe4d2f$re_export$useObjectRef} from "react-aria/useObjectRef";
import {useUpdateEffect as $a8ea2faf2ebe4d2f$re_export$useUpdateEffect} from "react-aria/private/utils/useUpdateEffect";
import {useUpdateLayoutEffect as $a8ea2faf2ebe4d2f$re_export$useUpdateLayoutEffect} from "react-aria/private/utils/useUpdateLayoutEffect";
import {useLayoutEffect as $a8ea2faf2ebe4d2f$re_export$useLayoutEffect} from "react-aria/private/utils/useLayoutEffect";
import {useResizeObserver as $a8ea2faf2ebe4d2f$re_export$useResizeObserver} from "react-aria/private/utils/useResizeObserver";
import {useSyncRef as $a8ea2faf2ebe4d2f$re_export$useSyncRef} from "react-aria/private/utils/useSyncRef";
import {getScrollParent as $a8ea2faf2ebe4d2f$re_export$getScrollParent} from "react-aria/private/utils/getScrollParent";
import {getScrollParents as $a8ea2faf2ebe4d2f$re_export$getScrollParents} from "react-aria/private/utils/getScrollParents";
import {isScrollable as $a8ea2faf2ebe4d2f$re_export$isScrollable} from "react-aria/private/utils/isScrollable";
import {useViewportSize as $a8ea2faf2ebe4d2f$re_export$useViewportSize} from "react-aria/private/utils/useViewportSize";
import {useDescription as $a8ea2faf2ebe4d2f$re_export$useDescription} from "react-aria/private/utils/useDescription";
import {useEvent as $a8ea2faf2ebe4d2f$re_export$useEvent} from "react-aria/private/utils/useEvent";
import {useValueEffect as $a8ea2faf2ebe4d2f$re_export$useValueEffect} from "react-aria/private/utils/useValueEffect";
import {scrollIntoView as $a8ea2faf2ebe4d2f$re_export$scrollIntoView, scrollIntoViewport as $a8ea2faf2ebe4d2f$re_export$scrollIntoViewport} from "react-aria/private/utils/scrollIntoView";
import {isVirtualClick as $a8ea2faf2ebe4d2f$re_export$isVirtualClick, isVirtualPointerEvent as $a8ea2faf2ebe4d2f$re_export$isVirtualPointerEvent} from "react-aria/private/utils/isVirtualEvent";
import {useEffectEvent as $a8ea2faf2ebe4d2f$re_export$useEffectEvent} from "react-aria/private/utils/useEffectEvent";
import {useDeepMemo as $a8ea2faf2ebe4d2f$re_export$useDeepMemo} from "react-aria/private/utils/useDeepMemo";
import {useFormReset as $a8ea2faf2ebe4d2f$re_export$useFormReset} from "react-aria/private/utils/useFormReset";
import {useLoadMore as $a8ea2faf2ebe4d2f$re_export$useLoadMore} from "react-aria/private/utils/useLoadMore";
import {useLoadMoreSentinel as $a8ea2faf2ebe4d2f$re_export$useLoadMoreSentinel} from "react-aria/private/utils/useLoadMoreSentinel";
import {inertValue as $a8ea2faf2ebe4d2f$re_export$inertValue} from "react-aria/private/utils/inertValue";
import {isCtrlKeyPressed as $a8ea2faf2ebe4d2f$re_export$isCtrlKeyPressed, willOpenKeyboard as $a8ea2faf2ebe4d2f$re_export$willOpenKeyboard} from "react-aria/private/utils/keyboard";
import {useEnterAnimation as $a8ea2faf2ebe4d2f$re_export$useEnterAnimation, useExitAnimation as $a8ea2faf2ebe4d2f$re_export$useExitAnimation} from "react-aria/private/utils/animation";
import {isFocusable as $a8ea2faf2ebe4d2f$re_export$isFocusable, isTabbable as $a8ea2faf2ebe4d2f$re_export$isTabbable} from "react-aria/private/utils/isFocusable";
import {getNonce as $a8ea2faf2ebe4d2f$re_export$getNonce} from "react-aria/private/utils/getNonce";
import {clamp as $a8ea2faf2ebe4d2f$re_export$clamp, snapValueToStep as $a8ea2faf2ebe4d2f$re_export$snapValueToStep} from "react-stately/private/utils/number";

@@ -98,3 +100,5 @@ /*

export {$bdb11010cef70236$export$f680877a34711e37 as useId, $bdb11010cef70236$export$cd8c9cb68f842629 as mergeIds, $bdb11010cef70236$export$b4cc09c592e8fdb8 as useSlotId, $ff5963eb1fccf552$export$e08e3b67e392101e as chain, $dfc540311bf7f109$export$4d0f8be8b12a7ef6 as createShadowTreeWalker, $dfc540311bf7f109$export$63eb3ababa9c55c4 as ShadowTreeWalker, $d4ee10de306f2510$export$cd4e5573fbe2b576 as getActiveElement, $d4ee10de306f2510$export$e58f029f0fbfdb29 as getEventTarget, $d4ee10de306f2510$export$4282f70798064fe0 as nodeContains, $431fbd86ca7dc216$export$b204af158042fbac as getOwnerDocument, $431fbd86ca7dc216$export$f21a1ffae260145a as getOwnerWindow, $431fbd86ca7dc216$export$af51f0f06c0f328a as isShadowRoot, $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$bdc77b0c0a3a85d6 as useSyntheticLinkProps, $ea8dcbcb9ea1b556$export$323e4fc2fa4753fb as RouterProvider, $ea8dcbcb9ea1b556$export$efa8c9099e530235 as shouldClientNavigate, $ea8dcbcb9ea1b556$export$9a302a45f65d0572 as useRouter, $ea8dcbcb9ea1b556$export$7e924b3091a3bd18 as useLinkProps, $ea8dcbcb9ea1b556$export$13aea1a3cb5e3f1f as handleLinkClick, $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, $ca9b37712f007381$export$72ef708ab07251f1 as useUpdateLayoutEffect, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c as useLayoutEffect, $9daab02d461809db$export$683480f191c0e3ea as useResizeObserver, $e7801be82b4b2a53$export$4debdb1a3f0fa79e as useSyncRef, $62d8ded9296f3872$export$cfa2225e87938781 as getScrollParent, $a40c673dc9f6d9c7$export$94ed1c92c7beeb22 as getScrollParents, $cc38e7bd3fc7b213$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, $c87311424ea30a05$export$b7d78993b74f766d as isFirefox, $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, $26f7f3da73fcd9d6$export$7717c92ee915373e as useLoadMore, $a5fa973c1850dd36$export$ccaea96c28e8b9e7 as useLoadMoreSentinel, $a5fa973c1850dd36$export$ccaea96c28e8b9e7 as UNSTABLE_useLoadMoreSentinel, $cdc5a6778b766db2$export$a9d04c5684123369 as inertValue, $5671b20cf9b562b2$export$447a38995de2c711 as CLEAR_FOCUS_EVENT, $5671b20cf9b562b2$export$831c820ad60f9d12 as FOCUS_EVENT, $21f1aa98acb08317$export$16792effe837dba3 as isCtrlKeyPressed, $21f1aa98acb08317$export$c57958e35f31ed73 as willOpenKeyboard, $d3f049242431219c$export$6d3443f2c48bfc20 as useEnterAnimation, $d3f049242431219c$export$45fda7c47f93fd48 as useExitAnimation, $b4b717babfbb907b$export$4c063cf1350e6fed as isFocusable, $b4b717babfbb907b$export$bebd5a1431fec25d as isTabbable};
export {$a8ea2faf2ebe4d2f$re_export$CLEAR_FOCUS_EVENT as CLEAR_FOCUS_EVENT, $a8ea2faf2ebe4d2f$re_export$FOCUS_EVENT as FOCUS_EVENT, $a8ea2faf2ebe4d2f$re_export$isMac as isMac, $a8ea2faf2ebe4d2f$re_export$isIPhone as isIPhone, $a8ea2faf2ebe4d2f$re_export$isIPad as isIPad, $a8ea2faf2ebe4d2f$re_export$isIOS as isIOS, $a8ea2faf2ebe4d2f$re_export$isAppleDevice as isAppleDevice, $a8ea2faf2ebe4d2f$re_export$isWebKit as isWebKit, $a8ea2faf2ebe4d2f$re_export$isChrome as isChrome, $a8ea2faf2ebe4d2f$re_export$isAndroid as isAndroid, $a8ea2faf2ebe4d2f$re_export$isFirefox as isFirefox, $a8ea2faf2ebe4d2f$re_export$openLink as openLink, $a8ea2faf2ebe4d2f$re_export$getSyntheticLinkProps as getSyntheticLinkProps, $a8ea2faf2ebe4d2f$re_export$useSyntheticLinkProps as useSyntheticLinkProps, $a8ea2faf2ebe4d2f$re_export$RouterProvider as RouterProvider, $a8ea2faf2ebe4d2f$re_export$shouldClientNavigate as shouldClientNavigate, $a8ea2faf2ebe4d2f$re_export$useRouter as useRouter, $a8ea2faf2ebe4d2f$re_export$useLinkProps as useLinkProps, $a8ea2faf2ebe4d2f$re_export$handleLinkClick as handleLinkClick, $a8ea2faf2ebe4d2f$re_export$useId as useId, $a8ea2faf2ebe4d2f$re_export$mergeIds as mergeIds, $a8ea2faf2ebe4d2f$re_export$useSlotId as useSlotId, $a8ea2faf2ebe4d2f$re_export$chain as chain, $a8ea2faf2ebe4d2f$re_export$createShadowTreeWalker as createShadowTreeWalker, $a8ea2faf2ebe4d2f$re_export$ShadowTreeWalker as ShadowTreeWalker, $a8ea2faf2ebe4d2f$re_export$getActiveElement as getActiveElement, $a8ea2faf2ebe4d2f$re_export$getEventTarget as getEventTarget, $a8ea2faf2ebe4d2f$re_export$nodeContains as nodeContains, $a8ea2faf2ebe4d2f$re_export$isFocusWithin as isFocusWithin, $a8ea2faf2ebe4d2f$re_export$getOwnerDocument as getOwnerDocument, $a8ea2faf2ebe4d2f$re_export$getOwnerWindow as getOwnerWindow, $a8ea2faf2ebe4d2f$re_export$isShadowRoot as isShadowRoot, $a8ea2faf2ebe4d2f$re_export$mergeProps as mergeProps, $a8ea2faf2ebe4d2f$re_export$mergeRefs as mergeRefs, $a8ea2faf2ebe4d2f$re_export$filterDOMProps as filterDOMProps, $a8ea2faf2ebe4d2f$re_export$focusWithoutScrolling as focusWithoutScrolling, $a8ea2faf2ebe4d2f$re_export$getOffset as getOffset, $a8ea2faf2ebe4d2f$re_export$runAfterTransition as runAfterTransition, $a8ea2faf2ebe4d2f$re_export$useDrag1D as useDrag1D, $a8ea2faf2ebe4d2f$re_export$useGlobalListeners as useGlobalListeners, $a8ea2faf2ebe4d2f$re_export$useLabels as useLabels, $a8ea2faf2ebe4d2f$re_export$useObjectRef as useObjectRef, $a8ea2faf2ebe4d2f$re_export$useUpdateEffect as useUpdateEffect, $a8ea2faf2ebe4d2f$re_export$useUpdateLayoutEffect as useUpdateLayoutEffect, $a8ea2faf2ebe4d2f$re_export$useLayoutEffect as useLayoutEffect, $a8ea2faf2ebe4d2f$re_export$useResizeObserver as useResizeObserver, $a8ea2faf2ebe4d2f$re_export$useSyncRef as useSyncRef, $a8ea2faf2ebe4d2f$re_export$getScrollParent as getScrollParent, $a8ea2faf2ebe4d2f$re_export$getScrollParents as getScrollParents, $a8ea2faf2ebe4d2f$re_export$isScrollable as isScrollable, $a8ea2faf2ebe4d2f$re_export$useViewportSize as useViewportSize, $a8ea2faf2ebe4d2f$re_export$useDescription as useDescription, $a8ea2faf2ebe4d2f$re_export$useEvent as useEvent, $a8ea2faf2ebe4d2f$re_export$useValueEffect as useValueEffect, $a8ea2faf2ebe4d2f$re_export$scrollIntoView as scrollIntoView, $a8ea2faf2ebe4d2f$re_export$scrollIntoViewport as scrollIntoViewport, $a8ea2faf2ebe4d2f$re_export$isVirtualClick as isVirtualClick, $a8ea2faf2ebe4d2f$re_export$isVirtualPointerEvent as isVirtualPointerEvent, $a8ea2faf2ebe4d2f$re_export$useEffectEvent as useEffectEvent, $a8ea2faf2ebe4d2f$re_export$useDeepMemo as useDeepMemo, $a8ea2faf2ebe4d2f$re_export$useFormReset as useFormReset, $a8ea2faf2ebe4d2f$re_export$useLoadMore as useLoadMore, $a8ea2faf2ebe4d2f$re_export$useLoadMoreSentinel as useLoadMoreSentinel, $a8ea2faf2ebe4d2f$re_export$useLoadMoreSentinel as UNSTABLE_useLoadMoreSentinel, $a8ea2faf2ebe4d2f$re_export$inertValue as inertValue, $a8ea2faf2ebe4d2f$re_export$isCtrlKeyPressed as isCtrlKeyPressed, $a8ea2faf2ebe4d2f$re_export$willOpenKeyboard as willOpenKeyboard, $a8ea2faf2ebe4d2f$re_export$useEnterAnimation as useEnterAnimation, $a8ea2faf2ebe4d2f$re_export$useExitAnimation as useExitAnimation, $a8ea2faf2ebe4d2f$re_export$isFocusable as isFocusable, $a8ea2faf2ebe4d2f$re_export$isTabbable as isTabbable, $a8ea2faf2ebe4d2f$re_export$getNonce as getNonce, $a8ea2faf2ebe4d2f$re_export$clamp as clamp, $a8ea2faf2ebe4d2f$re_export$snapValueToStep as snapValueToStep};
//# sourceMappingURL=module.js.map
+120
-114

@@ -1,43 +0,45 @@

var $8c61827343eed941$exports = require("./useId.main.js");
var $1e2191638e54f613$exports = require("./chain.main.js");
var $8e13b2545651735a$exports = require("./ShadowTreeWalker.main.js");
var $d723bea02f3e2567$exports = require("./DOMFunctions.main.js");
var $aaa611146751592e$exports = require("./domHelpers.main.js");
var $f847cd1382ea7cd4$exports = require("./mergeProps.main.js");
var $f05dc24eafaeb7e2$exports = require("./mergeRefs.main.js");
var $8d15d0e1797d4238$exports = require("./filterDOMProps.main.js");
var $1117b6c0d4c4c164$exports = require("./focusWithoutScrolling.main.js");
var $16ec41ef3e36c19c$exports = require("./getOffset.main.js");
var $4068a0fae83b6d84$exports = require("./openLink.main.js");
var $e8117ebcab55be6a$exports = require("./runAfterTransition.main.js");
var $28ed3fb20343b78b$exports = require("./useDrag1D.main.js");
var $4571ff54ac709100$exports = require("./useGlobalListeners.main.js");
var $6ec78bde395c477d$exports = require("./useLabels.main.js");
var $475b35fe72ba49b3$exports = require("./useObjectRef.main.js");
var $29293a6f5c75b37e$exports = require("./useUpdateEffect.main.js");
var $0fa310503218f75f$exports = require("./useUpdateLayoutEffect.main.js");
var $78605a5d7424e31b$exports = require("./useLayoutEffect.main.js");
var $37733e1652f47193$exports = require("./useResizeObserver.main.js");
var $6fc733991a9f977c$exports = require("./useSyncRef.main.js");
var $d796e7157ac96470$exports = require("./getScrollParent.main.js");
var $49f0d9486c2408aa$exports = require("./getScrollParents.main.js");
var $9a54e9cd5db23b5d$exports = require("./isScrollable.main.js");
var $8b24bab62f5c65ad$exports = require("./useViewportSize.main.js");
var $34da4502ea8120db$exports = require("./useDescription.main.js");
var $9e20cff0af27e8cc$exports = require("./platform.main.js");
var $2a8c0bb1629926c8$exports = require("./useEvent.main.js");
var $19a2307bfabafaf1$exports = require("./useValueEffect.main.js");
var $449412113267a1fe$exports = require("./scrollIntoView.main.js");
var $577e795361f19be9$exports = require("./isVirtualEvent.main.js");
var $1254e5bb94ac8761$exports = require("./useEffectEvent.main.js");
var $20e6e72fbf5dc81e$exports = require("./useDeepMemo.main.js");
var $1f205e845604a423$exports = require("./useFormReset.main.js");
var $faa6ccd6fb62f877$exports = require("./useLoadMore.main.js");
var $f6a4874a7c582761$exports = require("./useLoadMoreSentinel.main.js");
var $13915169b1e4142c$exports = require("./inertValue.main.js");
var $a0850d0add29d276$exports = require("./constants.main.js");
var $2308dc377e184bb0$exports = require("./keyboard.main.js");
var $5bd06107f98811f5$exports = require("./animation.main.js");
var $506b33fd893eab7d$exports = require("./isFocusable.main.js");
var $1Yh1N$reactstatelyutils = require("@react-stately/utils");
var $j4lFd$reactariaprivateutilsconstants = require("react-aria/private/utils/constants");
var $j4lFd$reactariaprivateutilsplatform = require("react-aria/private/utils/platform");
var $j4lFd$reactariaprivateutilsopenLink = require("react-aria/private/utils/openLink");
var $j4lFd$reactariauseId = require("react-aria/useId");
var $j4lFd$reactariaprivateutilsuseId = require("react-aria/private/utils/useId");
var $j4lFd$reactariachain = require("react-aria/chain");
var $j4lFd$reactariaprivateutilsshadowdomShadowTreeWalker = require("react-aria/private/utils/shadowdom/ShadowTreeWalker");
var $j4lFd$reactariaprivateutilsshadowdomDOMFunctions = require("react-aria/private/utils/shadowdom/DOMFunctions");
var $j4lFd$reactariaprivateutilsdomHelpers = require("react-aria/private/utils/domHelpers");
var $j4lFd$reactariamergeProps = require("react-aria/mergeProps");
var $j4lFd$reactariamergeRefs = require("react-aria/mergeRefs");
var $j4lFd$reactariafilterDOMProps = require("react-aria/filterDOMProps");
var $j4lFd$reactariaprivateutilsfocusWithoutScrolling = require("react-aria/private/utils/focusWithoutScrolling");
var $j4lFd$reactariaprivateutilsgetOffset = require("react-aria/private/utils/getOffset");
var $j4lFd$reactariaprivateutilsrunAfterTransition = require("react-aria/private/utils/runAfterTransition");
var $j4lFd$reactariaprivateutilsuseDrag1D = require("react-aria/private/utils/useDrag1D");
var $j4lFd$reactariaprivateutilsuseGlobalListeners = require("react-aria/private/utils/useGlobalListeners");
var $j4lFd$reactariaprivateutilsuseLabels = require("react-aria/private/utils/useLabels");
var $j4lFd$reactariauseObjectRef = require("react-aria/useObjectRef");
var $j4lFd$reactariaprivateutilsuseUpdateEffect = require("react-aria/private/utils/useUpdateEffect");
var $j4lFd$reactariaprivateutilsuseUpdateLayoutEffect = require("react-aria/private/utils/useUpdateLayoutEffect");
var $j4lFd$reactariaprivateutilsuseLayoutEffect = require("react-aria/private/utils/useLayoutEffect");
var $j4lFd$reactariaprivateutilsuseResizeObserver = require("react-aria/private/utils/useResizeObserver");
var $j4lFd$reactariaprivateutilsuseSyncRef = require("react-aria/private/utils/useSyncRef");
var $j4lFd$reactariaprivateutilsgetScrollParent = require("react-aria/private/utils/getScrollParent");
var $j4lFd$reactariaprivateutilsgetScrollParents = require("react-aria/private/utils/getScrollParents");
var $j4lFd$reactariaprivateutilsisScrollable = require("react-aria/private/utils/isScrollable");
var $j4lFd$reactariaprivateutilsuseViewportSize = require("react-aria/private/utils/useViewportSize");
var $j4lFd$reactariaprivateutilsuseDescription = require("react-aria/private/utils/useDescription");
var $j4lFd$reactariaprivateutilsuseEvent = require("react-aria/private/utils/useEvent");
var $j4lFd$reactariaprivateutilsuseValueEffect = require("react-aria/private/utils/useValueEffect");
var $j4lFd$reactariaprivateutilsscrollIntoView = require("react-aria/private/utils/scrollIntoView");
var $j4lFd$reactariaprivateutilsisVirtualEvent = require("react-aria/private/utils/isVirtualEvent");
var $j4lFd$reactariaprivateutilsuseEffectEvent = require("react-aria/private/utils/useEffectEvent");
var $j4lFd$reactariaprivateutilsuseDeepMemo = require("react-aria/private/utils/useDeepMemo");
var $j4lFd$reactariaprivateutilsuseFormReset = require("react-aria/private/utils/useFormReset");
var $j4lFd$reactariaprivateutilsuseLoadMore = require("react-aria/private/utils/useLoadMore");
var $j4lFd$reactariaprivateutilsuseLoadMoreSentinel = require("react-aria/private/utils/useLoadMoreSentinel");
var $j4lFd$reactariaprivateutilsinertValue = require("react-aria/private/utils/inertValue");
var $j4lFd$reactariaprivateutilskeyboard = require("react-aria/private/utils/keyboard");
var $j4lFd$reactariaprivateutilsanimation = require("react-aria/private/utils/animation");
var $j4lFd$reactariaprivateutilsisFocusable = require("react-aria/private/utils/isFocusable");
var $j4lFd$reactariaprivateutilsgetNonce = require("react-aria/private/utils/getNonce");
var $j4lFd$reactstatelyprivateutilsnumber = require("react-stately/private/utils/number");

@@ -49,74 +51,76 @@

$parcel$export(module.exports, "useId", () => $8c61827343eed941$exports.useId);
$parcel$export(module.exports, "mergeIds", () => $8c61827343eed941$exports.mergeIds);
$parcel$export(module.exports, "useSlotId", () => $8c61827343eed941$exports.useSlotId);
$parcel$export(module.exports, "chain", () => $1e2191638e54f613$exports.chain);
$parcel$export(module.exports, "createShadowTreeWalker", () => $8e13b2545651735a$exports.createShadowTreeWalker);
$parcel$export(module.exports, "ShadowTreeWalker", () => $8e13b2545651735a$exports.ShadowTreeWalker);
$parcel$export(module.exports, "getActiveElement", () => $d723bea02f3e2567$exports.getActiveElement);
$parcel$export(module.exports, "getEventTarget", () => $d723bea02f3e2567$exports.getEventTarget);
$parcel$export(module.exports, "nodeContains", () => $d723bea02f3e2567$exports.nodeContains);
$parcel$export(module.exports, "getOwnerDocument", () => $aaa611146751592e$exports.getOwnerDocument);
$parcel$export(module.exports, "getOwnerWindow", () => $aaa611146751592e$exports.getOwnerWindow);
$parcel$export(module.exports, "isShadowRoot", () => $aaa611146751592e$exports.isShadowRoot);
$parcel$export(module.exports, "mergeProps", () => $f847cd1382ea7cd4$exports.mergeProps);
$parcel$export(module.exports, "mergeRefs", () => $f05dc24eafaeb7e2$exports.mergeRefs);
$parcel$export(module.exports, "filterDOMProps", () => $8d15d0e1797d4238$exports.filterDOMProps);
$parcel$export(module.exports, "focusWithoutScrolling", () => $1117b6c0d4c4c164$exports.focusWithoutScrolling);
$parcel$export(module.exports, "getOffset", () => $16ec41ef3e36c19c$exports.getOffset);
$parcel$export(module.exports, "openLink", () => $4068a0fae83b6d84$exports.openLink);
$parcel$export(module.exports, "getSyntheticLinkProps", () => $4068a0fae83b6d84$exports.getSyntheticLinkProps);
$parcel$export(module.exports, "useSyntheticLinkProps", () => $4068a0fae83b6d84$exports.useSyntheticLinkProps);
$parcel$export(module.exports, "RouterProvider", () => $4068a0fae83b6d84$exports.RouterProvider);
$parcel$export(module.exports, "shouldClientNavigate", () => $4068a0fae83b6d84$exports.shouldClientNavigate);
$parcel$export(module.exports, "useRouter", () => $4068a0fae83b6d84$exports.useRouter);
$parcel$export(module.exports, "useLinkProps", () => $4068a0fae83b6d84$exports.useLinkProps);
$parcel$export(module.exports, "handleLinkClick", () => $4068a0fae83b6d84$exports.handleLinkClick);
$parcel$export(module.exports, "runAfterTransition", () => $e8117ebcab55be6a$exports.runAfterTransition);
$parcel$export(module.exports, "useDrag1D", () => $28ed3fb20343b78b$exports.useDrag1D);
$parcel$export(module.exports, "useGlobalListeners", () => $4571ff54ac709100$exports.useGlobalListeners);
$parcel$export(module.exports, "useLabels", () => $6ec78bde395c477d$exports.useLabels);
$parcel$export(module.exports, "useObjectRef", () => $475b35fe72ba49b3$exports.useObjectRef);
$parcel$export(module.exports, "useUpdateEffect", () => $29293a6f5c75b37e$exports.useUpdateEffect);
$parcel$export(module.exports, "useUpdateLayoutEffect", () => $0fa310503218f75f$exports.useUpdateLayoutEffect);
$parcel$export(module.exports, "useLayoutEffect", () => $78605a5d7424e31b$exports.useLayoutEffect);
$parcel$export(module.exports, "useResizeObserver", () => $37733e1652f47193$exports.useResizeObserver);
$parcel$export(module.exports, "useSyncRef", () => $6fc733991a9f977c$exports.useSyncRef);
$parcel$export(module.exports, "getScrollParent", () => $d796e7157ac96470$exports.getScrollParent);
$parcel$export(module.exports, "getScrollParents", () => $49f0d9486c2408aa$exports.getScrollParents);
$parcel$export(module.exports, "isScrollable", () => $9a54e9cd5db23b5d$exports.isScrollable);
$parcel$export(module.exports, "useViewportSize", () => $8b24bab62f5c65ad$exports.useViewportSize);
$parcel$export(module.exports, "useDescription", () => $34da4502ea8120db$exports.useDescription);
$parcel$export(module.exports, "isMac", () => $9e20cff0af27e8cc$exports.isMac);
$parcel$export(module.exports, "isIPhone", () => $9e20cff0af27e8cc$exports.isIPhone);
$parcel$export(module.exports, "isIPad", () => $9e20cff0af27e8cc$exports.isIPad);
$parcel$export(module.exports, "isIOS", () => $9e20cff0af27e8cc$exports.isIOS);
$parcel$export(module.exports, "isAppleDevice", () => $9e20cff0af27e8cc$exports.isAppleDevice);
$parcel$export(module.exports, "isWebKit", () => $9e20cff0af27e8cc$exports.isWebKit);
$parcel$export(module.exports, "isChrome", () => $9e20cff0af27e8cc$exports.isChrome);
$parcel$export(module.exports, "isAndroid", () => $9e20cff0af27e8cc$exports.isAndroid);
$parcel$export(module.exports, "isFirefox", () => $9e20cff0af27e8cc$exports.isFirefox);
$parcel$export(module.exports, "useEvent", () => $2a8c0bb1629926c8$exports.useEvent);
$parcel$export(module.exports, "useValueEffect", () => $19a2307bfabafaf1$exports.useValueEffect);
$parcel$export(module.exports, "scrollIntoView", () => $449412113267a1fe$exports.scrollIntoView);
$parcel$export(module.exports, "scrollIntoViewport", () => $449412113267a1fe$exports.scrollIntoViewport);
$parcel$export(module.exports, "clamp", () => $1Yh1N$reactstatelyutils.clamp);
$parcel$export(module.exports, "snapValueToStep", () => $1Yh1N$reactstatelyutils.snapValueToStep);
$parcel$export(module.exports, "isVirtualClick", () => $577e795361f19be9$exports.isVirtualClick);
$parcel$export(module.exports, "isVirtualPointerEvent", () => $577e795361f19be9$exports.isVirtualPointerEvent);
$parcel$export(module.exports, "useEffectEvent", () => $1254e5bb94ac8761$exports.useEffectEvent);
$parcel$export(module.exports, "useDeepMemo", () => $20e6e72fbf5dc81e$exports.useDeepMemo);
$parcel$export(module.exports, "useFormReset", () => $1f205e845604a423$exports.useFormReset);
$parcel$export(module.exports, "useLoadMore", () => $faa6ccd6fb62f877$exports.useLoadMore);
$parcel$export(module.exports, "useLoadMoreSentinel", () => $f6a4874a7c582761$exports.useLoadMoreSentinel);
$parcel$export(module.exports, "UNSTABLE_useLoadMoreSentinel", () => $f6a4874a7c582761$exports.useLoadMoreSentinel);
$parcel$export(module.exports, "inertValue", () => $13915169b1e4142c$exports.inertValue);
$parcel$export(module.exports, "CLEAR_FOCUS_EVENT", () => $a0850d0add29d276$exports.CLEAR_FOCUS_EVENT);
$parcel$export(module.exports, "FOCUS_EVENT", () => $a0850d0add29d276$exports.FOCUS_EVENT);
$parcel$export(module.exports, "isCtrlKeyPressed", () => $2308dc377e184bb0$exports.isCtrlKeyPressed);
$parcel$export(module.exports, "willOpenKeyboard", () => $2308dc377e184bb0$exports.willOpenKeyboard);
$parcel$export(module.exports, "useEnterAnimation", () => $5bd06107f98811f5$exports.useEnterAnimation);
$parcel$export(module.exports, "useExitAnimation", () => $5bd06107f98811f5$exports.useExitAnimation);
$parcel$export(module.exports, "isFocusable", () => $506b33fd893eab7d$exports.isFocusable);
$parcel$export(module.exports, "isTabbable", () => $506b33fd893eab7d$exports.isTabbable);
$parcel$export(module.exports, "CLEAR_FOCUS_EVENT", function () { return $j4lFd$reactariaprivateutilsconstants.CLEAR_FOCUS_EVENT; });
$parcel$export(module.exports, "FOCUS_EVENT", function () { return $j4lFd$reactariaprivateutilsconstants.FOCUS_EVENT; });
$parcel$export(module.exports, "isMac", function () { return $j4lFd$reactariaprivateutilsplatform.isMac; });
$parcel$export(module.exports, "isIPhone", function () { return $j4lFd$reactariaprivateutilsplatform.isIPhone; });
$parcel$export(module.exports, "isIPad", function () { return $j4lFd$reactariaprivateutilsplatform.isIPad; });
$parcel$export(module.exports, "isIOS", function () { return $j4lFd$reactariaprivateutilsplatform.isIOS; });
$parcel$export(module.exports, "isAppleDevice", function () { return $j4lFd$reactariaprivateutilsplatform.isAppleDevice; });
$parcel$export(module.exports, "isWebKit", function () { return $j4lFd$reactariaprivateutilsplatform.isWebKit; });
$parcel$export(module.exports, "isChrome", function () { return $j4lFd$reactariaprivateutilsplatform.isChrome; });
$parcel$export(module.exports, "isAndroid", function () { return $j4lFd$reactariaprivateutilsplatform.isAndroid; });
$parcel$export(module.exports, "isFirefox", function () { return $j4lFd$reactariaprivateutilsplatform.isFirefox; });
$parcel$export(module.exports, "openLink", function () { return $j4lFd$reactariaprivateutilsopenLink.openLink; });
$parcel$export(module.exports, "getSyntheticLinkProps", function () { return $j4lFd$reactariaprivateutilsopenLink.getSyntheticLinkProps; });
$parcel$export(module.exports, "useSyntheticLinkProps", function () { return $j4lFd$reactariaprivateutilsopenLink.useSyntheticLinkProps; });
$parcel$export(module.exports, "RouterProvider", function () { return $j4lFd$reactariaprivateutilsopenLink.RouterProvider; });
$parcel$export(module.exports, "shouldClientNavigate", function () { return $j4lFd$reactariaprivateutilsopenLink.shouldClientNavigate; });
$parcel$export(module.exports, "useRouter", function () { return $j4lFd$reactariaprivateutilsopenLink.useRouter; });
$parcel$export(module.exports, "useLinkProps", function () { return $j4lFd$reactariaprivateutilsopenLink.useLinkProps; });
$parcel$export(module.exports, "handleLinkClick", function () { return $j4lFd$reactariaprivateutilsopenLink.handleLinkClick; });
$parcel$export(module.exports, "useId", function () { return $j4lFd$reactariauseId.useId; });
$parcel$export(module.exports, "mergeIds", function () { return $j4lFd$reactariaprivateutilsuseId.mergeIds; });
$parcel$export(module.exports, "useSlotId", function () { return $j4lFd$reactariaprivateutilsuseId.useSlotId; });
$parcel$export(module.exports, "chain", function () { return $j4lFd$reactariachain.chain; });
$parcel$export(module.exports, "createShadowTreeWalker", function () { return $j4lFd$reactariaprivateutilsshadowdomShadowTreeWalker.createShadowTreeWalker; });
$parcel$export(module.exports, "ShadowTreeWalker", function () { return $j4lFd$reactariaprivateutilsshadowdomShadowTreeWalker.ShadowTreeWalker; });
$parcel$export(module.exports, "getActiveElement", function () { return $j4lFd$reactariaprivateutilsshadowdomDOMFunctions.getActiveElement; });
$parcel$export(module.exports, "getEventTarget", function () { return $j4lFd$reactariaprivateutilsshadowdomDOMFunctions.getEventTarget; });
$parcel$export(module.exports, "nodeContains", function () { return $j4lFd$reactariaprivateutilsshadowdomDOMFunctions.nodeContains; });
$parcel$export(module.exports, "isFocusWithin", function () { return $j4lFd$reactariaprivateutilsshadowdomDOMFunctions.isFocusWithin; });
$parcel$export(module.exports, "getOwnerDocument", function () { return $j4lFd$reactariaprivateutilsdomHelpers.getOwnerDocument; });
$parcel$export(module.exports, "getOwnerWindow", function () { return $j4lFd$reactariaprivateutilsdomHelpers.getOwnerWindow; });
$parcel$export(module.exports, "isShadowRoot", function () { return $j4lFd$reactariaprivateutilsdomHelpers.isShadowRoot; });
$parcel$export(module.exports, "mergeProps", function () { return $j4lFd$reactariamergeProps.mergeProps; });
$parcel$export(module.exports, "mergeRefs", function () { return $j4lFd$reactariamergeRefs.mergeRefs; });
$parcel$export(module.exports, "filterDOMProps", function () { return $j4lFd$reactariafilterDOMProps.filterDOMProps; });
$parcel$export(module.exports, "focusWithoutScrolling", function () { return $j4lFd$reactariaprivateutilsfocusWithoutScrolling.focusWithoutScrolling; });
$parcel$export(module.exports, "getOffset", function () { return $j4lFd$reactariaprivateutilsgetOffset.getOffset; });
$parcel$export(module.exports, "runAfterTransition", function () { return $j4lFd$reactariaprivateutilsrunAfterTransition.runAfterTransition; });
$parcel$export(module.exports, "useDrag1D", function () { return $j4lFd$reactariaprivateutilsuseDrag1D.useDrag1D; });
$parcel$export(module.exports, "useGlobalListeners", function () { return $j4lFd$reactariaprivateutilsuseGlobalListeners.useGlobalListeners; });
$parcel$export(module.exports, "useLabels", function () { return $j4lFd$reactariaprivateutilsuseLabels.useLabels; });
$parcel$export(module.exports, "useObjectRef", function () { return $j4lFd$reactariauseObjectRef.useObjectRef; });
$parcel$export(module.exports, "useUpdateEffect", function () { return $j4lFd$reactariaprivateutilsuseUpdateEffect.useUpdateEffect; });
$parcel$export(module.exports, "useUpdateLayoutEffect", function () { return $j4lFd$reactariaprivateutilsuseUpdateLayoutEffect.useUpdateLayoutEffect; });
$parcel$export(module.exports, "useLayoutEffect", function () { return $j4lFd$reactariaprivateutilsuseLayoutEffect.useLayoutEffect; });
$parcel$export(module.exports, "useResizeObserver", function () { return $j4lFd$reactariaprivateutilsuseResizeObserver.useResizeObserver; });
$parcel$export(module.exports, "useSyncRef", function () { return $j4lFd$reactariaprivateutilsuseSyncRef.useSyncRef; });
$parcel$export(module.exports, "getScrollParent", function () { return $j4lFd$reactariaprivateutilsgetScrollParent.getScrollParent; });
$parcel$export(module.exports, "getScrollParents", function () { return $j4lFd$reactariaprivateutilsgetScrollParents.getScrollParents; });
$parcel$export(module.exports, "isScrollable", function () { return $j4lFd$reactariaprivateutilsisScrollable.isScrollable; });
$parcel$export(module.exports, "useViewportSize", function () { return $j4lFd$reactariaprivateutilsuseViewportSize.useViewportSize; });
$parcel$export(module.exports, "useDescription", function () { return $j4lFd$reactariaprivateutilsuseDescription.useDescription; });
$parcel$export(module.exports, "useEvent", function () { return $j4lFd$reactariaprivateutilsuseEvent.useEvent; });
$parcel$export(module.exports, "useValueEffect", function () { return $j4lFd$reactariaprivateutilsuseValueEffect.useValueEffect; });
$parcel$export(module.exports, "scrollIntoView", function () { return $j4lFd$reactariaprivateutilsscrollIntoView.scrollIntoView; });
$parcel$export(module.exports, "scrollIntoViewport", function () { return $j4lFd$reactariaprivateutilsscrollIntoView.scrollIntoViewport; });
$parcel$export(module.exports, "isVirtualClick", function () { return $j4lFd$reactariaprivateutilsisVirtualEvent.isVirtualClick; });
$parcel$export(module.exports, "isVirtualPointerEvent", function () { return $j4lFd$reactariaprivateutilsisVirtualEvent.isVirtualPointerEvent; });
$parcel$export(module.exports, "useEffectEvent", function () { return $j4lFd$reactariaprivateutilsuseEffectEvent.useEffectEvent; });
$parcel$export(module.exports, "useDeepMemo", function () { return $j4lFd$reactariaprivateutilsuseDeepMemo.useDeepMemo; });
$parcel$export(module.exports, "useFormReset", function () { return $j4lFd$reactariaprivateutilsuseFormReset.useFormReset; });
$parcel$export(module.exports, "useLoadMore", function () { return $j4lFd$reactariaprivateutilsuseLoadMore.useLoadMore; });
$parcel$export(module.exports, "useLoadMoreSentinel", function () { return $j4lFd$reactariaprivateutilsuseLoadMoreSentinel.useLoadMoreSentinel; });
$parcel$export(module.exports, "UNSTABLE_useLoadMoreSentinel", function () { return $j4lFd$reactariaprivateutilsuseLoadMoreSentinel.useLoadMoreSentinel; });
$parcel$export(module.exports, "inertValue", function () { return $j4lFd$reactariaprivateutilsinertValue.inertValue; });
$parcel$export(module.exports, "isCtrlKeyPressed", function () { return $j4lFd$reactariaprivateutilskeyboard.isCtrlKeyPressed; });
$parcel$export(module.exports, "willOpenKeyboard", function () { return $j4lFd$reactariaprivateutilskeyboard.willOpenKeyboard; });
$parcel$export(module.exports, "useEnterAnimation", function () { return $j4lFd$reactariaprivateutilsanimation.useEnterAnimation; });
$parcel$export(module.exports, "useExitAnimation", function () { return $j4lFd$reactariaprivateutilsanimation.useExitAnimation; });
$parcel$export(module.exports, "isFocusable", function () { return $j4lFd$reactariaprivateutilsisFocusable.isFocusable; });
$parcel$export(module.exports, "isTabbable", function () { return $j4lFd$reactariaprivateutilsisFocusable.isTabbable; });
$parcel$export(module.exports, "getNonce", function () { return $j4lFd$reactariaprivateutilsgetNonce.getNonce; });
$parcel$export(module.exports, "clamp", function () { return $j4lFd$reactstatelyprivateutilsnumber.clamp; });
$parcel$export(module.exports, "snapValueToStep", function () { return $j4lFd$reactstatelyprivateutilsnumber.snapValueToStep; });
/*

@@ -176,2 +180,4 @@ * Copyright 2020 Adobe. All rights reserved.

//# sourceMappingURL=main.js.map

@@ -1,1 +0,1 @@

{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/utils/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nexport {useId, mergeIds, useSlotId} from './useId';\nexport {chain} from './chain';\nexport {createShadowTreeWalker, ShadowTreeWalker} from './shadowdom/ShadowTreeWalker';\nexport {getActiveElement, getEventTarget, nodeContains} from './shadowdom/DOMFunctions';\nexport {getOwnerDocument, getOwnerWindow, isShadowRoot} from './domHelpers';\nexport {mergeProps} from './mergeProps';\nexport {mergeRefs} from './mergeRefs';\nexport {filterDOMProps} from './filterDOMProps';\nexport {focusWithoutScrolling} from './focusWithoutScrolling';\nexport {getOffset} from './getOffset';\nexport {openLink, getSyntheticLinkProps, useSyntheticLinkProps, RouterProvider, shouldClientNavigate, useRouter, useLinkProps, handleLinkClick} from './openLink';\nexport {runAfterTransition} from './runAfterTransition';\nexport {useDrag1D} from './useDrag1D';\nexport {useGlobalListeners} from './useGlobalListeners';\nexport {useLabels} from './useLabels';\nexport {useObjectRef} from './useObjectRef';\nexport {useUpdateEffect} from './useUpdateEffect';\nexport {useUpdateLayoutEffect} from './useUpdateLayoutEffect';\nexport {useLayoutEffect} from './useLayoutEffect';\nexport {useResizeObserver} from './useResizeObserver';\nexport {useSyncRef} from './useSyncRef';\nexport {getScrollParent} from './getScrollParent';\nexport {getScrollParents} from './getScrollParents';\nexport {isScrollable} from './isScrollable';\nexport {useViewportSize} from './useViewportSize';\nexport {useDescription} from './useDescription';\nexport {isMac, isIPhone, isIPad, isIOS, isAppleDevice, isWebKit, isChrome, isAndroid, isFirefox} from './platform';\nexport {useEvent} from './useEvent';\nexport {useValueEffect} from './useValueEffect';\nexport {scrollIntoView, scrollIntoViewport} from './scrollIntoView';\nexport {clamp, snapValueToStep} from '@react-stately/utils';\nexport {isVirtualClick, isVirtualPointerEvent} from './isVirtualEvent';\nexport {useEffectEvent} from './useEffectEvent';\nexport {useDeepMemo} from './useDeepMemo';\nexport {useFormReset} from './useFormReset';\nexport {useLoadMore} from './useLoadMore';\nexport {useLoadMoreSentinel, useLoadMoreSentinel as UNSTABLE_useLoadMoreSentinel} from './useLoadMoreSentinel';\nexport {inertValue} from './inertValue';\nexport {CLEAR_FOCUS_EVENT, FOCUS_EVENT} from './constants';\nexport {isCtrlKeyPressed, willOpenKeyboard} from './keyboard';\nexport {useEnterAnimation, useExitAnimation} from './animation';\nexport {isFocusable, isTabbable} from './isFocusable';\n\nexport type {LoadMoreSentinelProps} from './useLoadMoreSentinel';\n"],"names":[],"version":3,"file":"main.js.map"}
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/utils/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nexport {CLEAR_FOCUS_EVENT, FOCUS_EVENT} from 'react-aria/private/utils/constants';\n\nexport {\n isMac,\n isIPhone,\n isIPad,\n isIOS,\n isAppleDevice,\n isWebKit,\n isChrome,\n isAndroid,\n isFirefox\n} from 'react-aria/private/utils/platform';\nexport {\n openLink,\n getSyntheticLinkProps,\n useSyntheticLinkProps,\n RouterProvider,\n shouldClientNavigate,\n useRouter,\n useLinkProps,\n handleLinkClick\n} from 'react-aria/private/utils/openLink';\nexport {useId} from 'react-aria/useId';\nexport {mergeIds, useSlotId} from 'react-aria/private/utils/useId';\nexport {chain} from 'react-aria/chain';\nexport {\n createShadowTreeWalker,\n ShadowTreeWalker\n} from 'react-aria/private/utils/shadowdom/ShadowTreeWalker';\nexport {\n getActiveElement,\n getEventTarget,\n nodeContains,\n isFocusWithin\n} from 'react-aria/private/utils/shadowdom/DOMFunctions';\nexport {getOwnerDocument, getOwnerWindow, isShadowRoot} from 'react-aria/private/utils/domHelpers';\nexport {mergeProps} from 'react-aria/mergeProps';\nexport {mergeRefs} from 'react-aria/mergeRefs';\nexport {filterDOMProps} from 'react-aria/filterDOMProps';\nexport {focusWithoutScrolling} from 'react-aria/private/utils/focusWithoutScrolling';\nexport {getOffset} from 'react-aria/private/utils/getOffset';\nexport {runAfterTransition} from 'react-aria/private/utils/runAfterTransition';\nexport {useDrag1D} from 'react-aria/private/utils/useDrag1D';\nexport {useGlobalListeners} from 'react-aria/private/utils/useGlobalListeners';\nexport {useLabels} from 'react-aria/private/utils/useLabels';\nexport {useObjectRef} from 'react-aria/useObjectRef';\nexport {useUpdateEffect} from 'react-aria/private/utils/useUpdateEffect';\nexport {useUpdateLayoutEffect} from 'react-aria/private/utils/useUpdateLayoutEffect';\nexport {useLayoutEffect} from 'react-aria/private/utils/useLayoutEffect';\nexport {useResizeObserver} from 'react-aria/private/utils/useResizeObserver';\nexport {useSyncRef} from 'react-aria/private/utils/useSyncRef';\nexport {getScrollParent} from 'react-aria/private/utils/getScrollParent';\nexport {getScrollParents} from 'react-aria/private/utils/getScrollParents';\nexport {isScrollable} from 'react-aria/private/utils/isScrollable';\nexport {useViewportSize} from 'react-aria/private/utils/useViewportSize';\nexport {useDescription} from 'react-aria/private/utils/useDescription';\nexport {useEvent} from 'react-aria/private/utils/useEvent';\nexport {useValueEffect} from 'react-aria/private/utils/useValueEffect';\nexport {scrollIntoView, scrollIntoViewport} from 'react-aria/private/utils/scrollIntoView';\nexport {isVirtualClick, isVirtualPointerEvent} from 'react-aria/private/utils/isVirtualEvent';\nexport {useEffectEvent} from 'react-aria/private/utils/useEffectEvent';\nexport {useDeepMemo} from 'react-aria/private/utils/useDeepMemo';\nexport {useFormReset} from 'react-aria/private/utils/useFormReset';\nexport {useLoadMore} from 'react-aria/private/utils/useLoadMore';\nexport {\n useLoadMoreSentinel,\n useLoadMoreSentinel as UNSTABLE_useLoadMoreSentinel\n} from 'react-aria/private/utils/useLoadMoreSentinel';\nexport {inertValue} from 'react-aria/private/utils/inertValue';\nexport {isCtrlKeyPressed, willOpenKeyboard} from 'react-aria/private/utils/keyboard';\nexport {useEnterAnimation, useExitAnimation} from 'react-aria/private/utils/animation';\nexport {isFocusable, isTabbable} from 'react-aria/private/utils/isFocusable';\nexport {getNonce} from 'react-aria/private/utils/getNonce';\nexport type {LoadMoreSentinelProps} from 'react-aria/private/utils/useLoadMoreSentinel';\nexport {clamp, snapValueToStep} from 'react-stately/private/utils/number';\n"],"names":[],"version":3,"file":"main.js.map"}

@@ -1,43 +0,45 @@

import {mergeIds as $bdb11010cef70236$export$cd8c9cb68f842629, useId as $bdb11010cef70236$export$f680877a34711e37, useSlotId as $bdb11010cef70236$export$b4cc09c592e8fdb8} from "./useId.module.js";
import {chain as $ff5963eb1fccf552$export$e08e3b67e392101e} from "./chain.module.js";
import {createShadowTreeWalker as $dfc540311bf7f109$export$4d0f8be8b12a7ef6, ShadowTreeWalker as $dfc540311bf7f109$export$63eb3ababa9c55c4} from "./ShadowTreeWalker.module.js";
import {getActiveElement as $d4ee10de306f2510$export$cd4e5573fbe2b576, getEventTarget as $d4ee10de306f2510$export$e58f029f0fbfdb29, nodeContains as $d4ee10de306f2510$export$4282f70798064fe0} from "./DOMFunctions.module.js";
import {getOwnerDocument as $431fbd86ca7dc216$export$b204af158042fbac, getOwnerWindow as $431fbd86ca7dc216$export$f21a1ffae260145a, isShadowRoot as $431fbd86ca7dc216$export$af51f0f06c0f328a} from "./domHelpers.module.js";
import {mergeProps as $3ef42575df84b30b$export$9d1611c77c2fe928} from "./mergeProps.module.js";
import {mergeRefs as $5dc95899b306f630$export$c9058316764c140e} from "./mergeRefs.module.js";
import {filterDOMProps as $65484d02dcb7eb3e$export$457c3d6518dd4c6f} from "./filterDOMProps.module.js";
import {focusWithoutScrolling as $7215afc6de606d6b$export$de79e2c695e052f3} from "./focusWithoutScrolling.module.js";
import {getOffset as $ab71dadb03a6fb2e$export$622cea445a1c5b7d} from "./getOffset.module.js";
import {getSyntheticLinkProps as $ea8dcbcb9ea1b556$export$51437d503373d223, handleLinkClick as $ea8dcbcb9ea1b556$export$13aea1a3cb5e3f1f, openLink as $ea8dcbcb9ea1b556$export$95185d699e05d4d7, RouterProvider as $ea8dcbcb9ea1b556$export$323e4fc2fa4753fb, shouldClientNavigate as $ea8dcbcb9ea1b556$export$efa8c9099e530235, useLinkProps as $ea8dcbcb9ea1b556$export$7e924b3091a3bd18, useRouter as $ea8dcbcb9ea1b556$export$9a302a45f65d0572, useSyntheticLinkProps as $ea8dcbcb9ea1b556$export$bdc77b0c0a3a85d6} from "./openLink.module.js";
import {runAfterTransition as $bbed8b41f857bcc0$export$24490316f764c430} from "./runAfterTransition.module.js";
import {useDrag1D as $9cc09df9fd7676be$export$7bbed75feba39706} from "./useDrag1D.module.js";
import {useGlobalListeners as $03deb23ff14920c4$export$4eaf04e54aa8eed6} from "./useGlobalListeners.module.js";
import {useLabels as $313b98861ee5dd6c$export$d6875122194c7b44} from "./useLabels.module.js";
import {useObjectRef as $df56164dff5785e2$export$4338b53315abf666} from "./useObjectRef.module.js";
import {useUpdateEffect as $4f58c5f72bcf79f7$export$496315a1608d9602} from "./useUpdateEffect.module.js";
import {useUpdateLayoutEffect as $ca9b37712f007381$export$72ef708ab07251f1} from "./useUpdateLayoutEffect.module.js";
import {useLayoutEffect as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c} from "./useLayoutEffect.module.js";
import {useResizeObserver as $9daab02d461809db$export$683480f191c0e3ea} from "./useResizeObserver.module.js";
import {useSyncRef as $e7801be82b4b2a53$export$4debdb1a3f0fa79e} from "./useSyncRef.module.js";
import {getScrollParent as $62d8ded9296f3872$export$cfa2225e87938781} from "./getScrollParent.module.js";
import {getScrollParents as $a40c673dc9f6d9c7$export$94ed1c92c7beeb22} from "./getScrollParents.module.js";
import {isScrollable as $cc38e7bd3fc7b213$export$2bb74740c4e19def} from "./isScrollable.module.js";
import {useViewportSize as $5df64b3807dc15ee$export$d699905dd57c73ca} from "./useViewportSize.module.js";
import {useDescription as $ef06256079686ba0$export$f8aeda7b10753fa1} from "./useDescription.module.js";
import {isAndroid as $c87311424ea30a05$export$a11b0059900ceec8, isAppleDevice as $c87311424ea30a05$export$e1865c3bedcd822b, isChrome as $c87311424ea30a05$export$6446a186d09e379e, isFirefox as $c87311424ea30a05$export$b7d78993b74f766d, isIOS as $c87311424ea30a05$export$fedb369cb70207f1, isIPad as $c87311424ea30a05$export$7bef049ce92e4224, isIPhone as $c87311424ea30a05$export$186c6964ca17d99, isMac as $c87311424ea30a05$export$9ac100e40613ea10, isWebKit as $c87311424ea30a05$export$78551043582a6a98} from "./platform.module.js";
import {useEvent as $e9faafb641e167db$export$90fc3a17d93f704c} from "./useEvent.module.js";
import {useValueEffect as $1dbecbe27a04f9af$export$14d238f342723f25} from "./useValueEffect.module.js";
import {scrollIntoView as $2f04cbc44ee30ce0$export$53a0910f038337bd, scrollIntoViewport as $2f04cbc44ee30ce0$export$c826860796309d1b} from "./scrollIntoView.module.js";
import {isVirtualClick as $6a7db85432448f7f$export$60278871457622de, isVirtualPointerEvent as $6a7db85432448f7f$export$29bf1b5f2c56cf63} from "./isVirtualEvent.module.js";
import {useEffectEvent as $8ae05eaa5c114e9c$export$7f54fc3180508a52} from "./useEffectEvent.module.js";
import {useDeepMemo as $5a387cc49350e6db$export$722debc0e56fea39} from "./useDeepMemo.module.js";
import {useFormReset as $99facab73266f662$export$5add1d006293d136} from "./useFormReset.module.js";
import {useLoadMore as $26f7f3da73fcd9d6$export$7717c92ee915373e} from "./useLoadMore.module.js";
import {useLoadMoreSentinel as $a5fa973c1850dd36$export$ccaea96c28e8b9e7} from "./useLoadMoreSentinel.module.js";
import {inertValue as $cdc5a6778b766db2$export$a9d04c5684123369} from "./inertValue.module.js";
import {CLEAR_FOCUS_EVENT as $5671b20cf9b562b2$export$447a38995de2c711, FOCUS_EVENT as $5671b20cf9b562b2$export$831c820ad60f9d12} from "./constants.module.js";
import {isCtrlKeyPressed as $21f1aa98acb08317$export$16792effe837dba3, willOpenKeyboard as $21f1aa98acb08317$export$c57958e35f31ed73} from "./keyboard.module.js";
import {useEnterAnimation as $d3f049242431219c$export$6d3443f2c48bfc20, useExitAnimation as $d3f049242431219c$export$45fda7c47f93fd48} from "./animation.module.js";
import {isFocusable as $b4b717babfbb907b$export$4c063cf1350e6fed, isTabbable as $b4b717babfbb907b$export$bebd5a1431fec25d} from "./isFocusable.module.js";
import {clamp as $4507461a1b870123$re_export$clamp, snapValueToStep as $4507461a1b870123$re_export$snapValueToStep} from "@react-stately/utils";
import {CLEAR_FOCUS_EVENT as $a8ea2faf2ebe4d2f$re_export$CLEAR_FOCUS_EVENT, FOCUS_EVENT as $a8ea2faf2ebe4d2f$re_export$FOCUS_EVENT} from "react-aria/private/utils/constants";
import {isMac as $a8ea2faf2ebe4d2f$re_export$isMac, isIPhone as $a8ea2faf2ebe4d2f$re_export$isIPhone, isIPad as $a8ea2faf2ebe4d2f$re_export$isIPad, isIOS as $a8ea2faf2ebe4d2f$re_export$isIOS, isAppleDevice as $a8ea2faf2ebe4d2f$re_export$isAppleDevice, isWebKit as $a8ea2faf2ebe4d2f$re_export$isWebKit, isChrome as $a8ea2faf2ebe4d2f$re_export$isChrome, isAndroid as $a8ea2faf2ebe4d2f$re_export$isAndroid, isFirefox as $a8ea2faf2ebe4d2f$re_export$isFirefox} from "react-aria/private/utils/platform";
import {openLink as $a8ea2faf2ebe4d2f$re_export$openLink, getSyntheticLinkProps as $a8ea2faf2ebe4d2f$re_export$getSyntheticLinkProps, useSyntheticLinkProps as $a8ea2faf2ebe4d2f$re_export$useSyntheticLinkProps, RouterProvider as $a8ea2faf2ebe4d2f$re_export$RouterProvider, shouldClientNavigate as $a8ea2faf2ebe4d2f$re_export$shouldClientNavigate, useRouter as $a8ea2faf2ebe4d2f$re_export$useRouter, useLinkProps as $a8ea2faf2ebe4d2f$re_export$useLinkProps, handleLinkClick as $a8ea2faf2ebe4d2f$re_export$handleLinkClick} from "react-aria/private/utils/openLink";
import {useId as $a8ea2faf2ebe4d2f$re_export$useId} from "react-aria/useId";
import {mergeIds as $a8ea2faf2ebe4d2f$re_export$mergeIds, useSlotId as $a8ea2faf2ebe4d2f$re_export$useSlotId} from "react-aria/private/utils/useId";
import {chain as $a8ea2faf2ebe4d2f$re_export$chain} from "react-aria/chain";
import {createShadowTreeWalker as $a8ea2faf2ebe4d2f$re_export$createShadowTreeWalker, ShadowTreeWalker as $a8ea2faf2ebe4d2f$re_export$ShadowTreeWalker} from "react-aria/private/utils/shadowdom/ShadowTreeWalker";
import {getActiveElement as $a8ea2faf2ebe4d2f$re_export$getActiveElement, getEventTarget as $a8ea2faf2ebe4d2f$re_export$getEventTarget, nodeContains as $a8ea2faf2ebe4d2f$re_export$nodeContains, isFocusWithin as $a8ea2faf2ebe4d2f$re_export$isFocusWithin} from "react-aria/private/utils/shadowdom/DOMFunctions";
import {getOwnerDocument as $a8ea2faf2ebe4d2f$re_export$getOwnerDocument, getOwnerWindow as $a8ea2faf2ebe4d2f$re_export$getOwnerWindow, isShadowRoot as $a8ea2faf2ebe4d2f$re_export$isShadowRoot} from "react-aria/private/utils/domHelpers";
import {mergeProps as $a8ea2faf2ebe4d2f$re_export$mergeProps} from "react-aria/mergeProps";
import {mergeRefs as $a8ea2faf2ebe4d2f$re_export$mergeRefs} from "react-aria/mergeRefs";
import {filterDOMProps as $a8ea2faf2ebe4d2f$re_export$filterDOMProps} from "react-aria/filterDOMProps";
import {focusWithoutScrolling as $a8ea2faf2ebe4d2f$re_export$focusWithoutScrolling} from "react-aria/private/utils/focusWithoutScrolling";
import {getOffset as $a8ea2faf2ebe4d2f$re_export$getOffset} from "react-aria/private/utils/getOffset";
import {runAfterTransition as $a8ea2faf2ebe4d2f$re_export$runAfterTransition} from "react-aria/private/utils/runAfterTransition";
import {useDrag1D as $a8ea2faf2ebe4d2f$re_export$useDrag1D} from "react-aria/private/utils/useDrag1D";
import {useGlobalListeners as $a8ea2faf2ebe4d2f$re_export$useGlobalListeners} from "react-aria/private/utils/useGlobalListeners";
import {useLabels as $a8ea2faf2ebe4d2f$re_export$useLabels} from "react-aria/private/utils/useLabels";
import {useObjectRef as $a8ea2faf2ebe4d2f$re_export$useObjectRef} from "react-aria/useObjectRef";
import {useUpdateEffect as $a8ea2faf2ebe4d2f$re_export$useUpdateEffect} from "react-aria/private/utils/useUpdateEffect";
import {useUpdateLayoutEffect as $a8ea2faf2ebe4d2f$re_export$useUpdateLayoutEffect} from "react-aria/private/utils/useUpdateLayoutEffect";
import {useLayoutEffect as $a8ea2faf2ebe4d2f$re_export$useLayoutEffect} from "react-aria/private/utils/useLayoutEffect";
import {useResizeObserver as $a8ea2faf2ebe4d2f$re_export$useResizeObserver} from "react-aria/private/utils/useResizeObserver";
import {useSyncRef as $a8ea2faf2ebe4d2f$re_export$useSyncRef} from "react-aria/private/utils/useSyncRef";
import {getScrollParent as $a8ea2faf2ebe4d2f$re_export$getScrollParent} from "react-aria/private/utils/getScrollParent";
import {getScrollParents as $a8ea2faf2ebe4d2f$re_export$getScrollParents} from "react-aria/private/utils/getScrollParents";
import {isScrollable as $a8ea2faf2ebe4d2f$re_export$isScrollable} from "react-aria/private/utils/isScrollable";
import {useViewportSize as $a8ea2faf2ebe4d2f$re_export$useViewportSize} from "react-aria/private/utils/useViewportSize";
import {useDescription as $a8ea2faf2ebe4d2f$re_export$useDescription} from "react-aria/private/utils/useDescription";
import {useEvent as $a8ea2faf2ebe4d2f$re_export$useEvent} from "react-aria/private/utils/useEvent";
import {useValueEffect as $a8ea2faf2ebe4d2f$re_export$useValueEffect} from "react-aria/private/utils/useValueEffect";
import {scrollIntoView as $a8ea2faf2ebe4d2f$re_export$scrollIntoView, scrollIntoViewport as $a8ea2faf2ebe4d2f$re_export$scrollIntoViewport} from "react-aria/private/utils/scrollIntoView";
import {isVirtualClick as $a8ea2faf2ebe4d2f$re_export$isVirtualClick, isVirtualPointerEvent as $a8ea2faf2ebe4d2f$re_export$isVirtualPointerEvent} from "react-aria/private/utils/isVirtualEvent";
import {useEffectEvent as $a8ea2faf2ebe4d2f$re_export$useEffectEvent} from "react-aria/private/utils/useEffectEvent";
import {useDeepMemo as $a8ea2faf2ebe4d2f$re_export$useDeepMemo} from "react-aria/private/utils/useDeepMemo";
import {useFormReset as $a8ea2faf2ebe4d2f$re_export$useFormReset} from "react-aria/private/utils/useFormReset";
import {useLoadMore as $a8ea2faf2ebe4d2f$re_export$useLoadMore} from "react-aria/private/utils/useLoadMore";
import {useLoadMoreSentinel as $a8ea2faf2ebe4d2f$re_export$useLoadMoreSentinel} from "react-aria/private/utils/useLoadMoreSentinel";
import {inertValue as $a8ea2faf2ebe4d2f$re_export$inertValue} from "react-aria/private/utils/inertValue";
import {isCtrlKeyPressed as $a8ea2faf2ebe4d2f$re_export$isCtrlKeyPressed, willOpenKeyboard as $a8ea2faf2ebe4d2f$re_export$willOpenKeyboard} from "react-aria/private/utils/keyboard";
import {useEnterAnimation as $a8ea2faf2ebe4d2f$re_export$useEnterAnimation, useExitAnimation as $a8ea2faf2ebe4d2f$re_export$useExitAnimation} from "react-aria/private/utils/animation";
import {isFocusable as $a8ea2faf2ebe4d2f$re_export$isFocusable, isTabbable as $a8ea2faf2ebe4d2f$re_export$isTabbable} from "react-aria/private/utils/isFocusable";
import {getNonce as $a8ea2faf2ebe4d2f$re_export$getNonce} from "react-aria/private/utils/getNonce";
import {clamp as $a8ea2faf2ebe4d2f$re_export$clamp, snapValueToStep as $a8ea2faf2ebe4d2f$re_export$snapValueToStep} from "react-stately/private/utils/number";

@@ -98,3 +100,5 @@ /*

export {$bdb11010cef70236$export$f680877a34711e37 as useId, $bdb11010cef70236$export$cd8c9cb68f842629 as mergeIds, $bdb11010cef70236$export$b4cc09c592e8fdb8 as useSlotId, $ff5963eb1fccf552$export$e08e3b67e392101e as chain, $dfc540311bf7f109$export$4d0f8be8b12a7ef6 as createShadowTreeWalker, $dfc540311bf7f109$export$63eb3ababa9c55c4 as ShadowTreeWalker, $d4ee10de306f2510$export$cd4e5573fbe2b576 as getActiveElement, $d4ee10de306f2510$export$e58f029f0fbfdb29 as getEventTarget, $d4ee10de306f2510$export$4282f70798064fe0 as nodeContains, $431fbd86ca7dc216$export$b204af158042fbac as getOwnerDocument, $431fbd86ca7dc216$export$f21a1ffae260145a as getOwnerWindow, $431fbd86ca7dc216$export$af51f0f06c0f328a as isShadowRoot, $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$bdc77b0c0a3a85d6 as useSyntheticLinkProps, $ea8dcbcb9ea1b556$export$323e4fc2fa4753fb as RouterProvider, $ea8dcbcb9ea1b556$export$efa8c9099e530235 as shouldClientNavigate, $ea8dcbcb9ea1b556$export$9a302a45f65d0572 as useRouter, $ea8dcbcb9ea1b556$export$7e924b3091a3bd18 as useLinkProps, $ea8dcbcb9ea1b556$export$13aea1a3cb5e3f1f as handleLinkClick, $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, $ca9b37712f007381$export$72ef708ab07251f1 as useUpdateLayoutEffect, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c as useLayoutEffect, $9daab02d461809db$export$683480f191c0e3ea as useResizeObserver, $e7801be82b4b2a53$export$4debdb1a3f0fa79e as useSyncRef, $62d8ded9296f3872$export$cfa2225e87938781 as getScrollParent, $a40c673dc9f6d9c7$export$94ed1c92c7beeb22 as getScrollParents, $cc38e7bd3fc7b213$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, $c87311424ea30a05$export$b7d78993b74f766d as isFirefox, $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, $26f7f3da73fcd9d6$export$7717c92ee915373e as useLoadMore, $a5fa973c1850dd36$export$ccaea96c28e8b9e7 as useLoadMoreSentinel, $a5fa973c1850dd36$export$ccaea96c28e8b9e7 as UNSTABLE_useLoadMoreSentinel, $cdc5a6778b766db2$export$a9d04c5684123369 as inertValue, $5671b20cf9b562b2$export$447a38995de2c711 as CLEAR_FOCUS_EVENT, $5671b20cf9b562b2$export$831c820ad60f9d12 as FOCUS_EVENT, $21f1aa98acb08317$export$16792effe837dba3 as isCtrlKeyPressed, $21f1aa98acb08317$export$c57958e35f31ed73 as willOpenKeyboard, $d3f049242431219c$export$6d3443f2c48bfc20 as useEnterAnimation, $d3f049242431219c$export$45fda7c47f93fd48 as useExitAnimation, $b4b717babfbb907b$export$4c063cf1350e6fed as isFocusable, $b4b717babfbb907b$export$bebd5a1431fec25d as isTabbable};
export {$a8ea2faf2ebe4d2f$re_export$CLEAR_FOCUS_EVENT as CLEAR_FOCUS_EVENT, $a8ea2faf2ebe4d2f$re_export$FOCUS_EVENT as FOCUS_EVENT, $a8ea2faf2ebe4d2f$re_export$isMac as isMac, $a8ea2faf2ebe4d2f$re_export$isIPhone as isIPhone, $a8ea2faf2ebe4d2f$re_export$isIPad as isIPad, $a8ea2faf2ebe4d2f$re_export$isIOS as isIOS, $a8ea2faf2ebe4d2f$re_export$isAppleDevice as isAppleDevice, $a8ea2faf2ebe4d2f$re_export$isWebKit as isWebKit, $a8ea2faf2ebe4d2f$re_export$isChrome as isChrome, $a8ea2faf2ebe4d2f$re_export$isAndroid as isAndroid, $a8ea2faf2ebe4d2f$re_export$isFirefox as isFirefox, $a8ea2faf2ebe4d2f$re_export$openLink as openLink, $a8ea2faf2ebe4d2f$re_export$getSyntheticLinkProps as getSyntheticLinkProps, $a8ea2faf2ebe4d2f$re_export$useSyntheticLinkProps as useSyntheticLinkProps, $a8ea2faf2ebe4d2f$re_export$RouterProvider as RouterProvider, $a8ea2faf2ebe4d2f$re_export$shouldClientNavigate as shouldClientNavigate, $a8ea2faf2ebe4d2f$re_export$useRouter as useRouter, $a8ea2faf2ebe4d2f$re_export$useLinkProps as useLinkProps, $a8ea2faf2ebe4d2f$re_export$handleLinkClick as handleLinkClick, $a8ea2faf2ebe4d2f$re_export$useId as useId, $a8ea2faf2ebe4d2f$re_export$mergeIds as mergeIds, $a8ea2faf2ebe4d2f$re_export$useSlotId as useSlotId, $a8ea2faf2ebe4d2f$re_export$chain as chain, $a8ea2faf2ebe4d2f$re_export$createShadowTreeWalker as createShadowTreeWalker, $a8ea2faf2ebe4d2f$re_export$ShadowTreeWalker as ShadowTreeWalker, $a8ea2faf2ebe4d2f$re_export$getActiveElement as getActiveElement, $a8ea2faf2ebe4d2f$re_export$getEventTarget as getEventTarget, $a8ea2faf2ebe4d2f$re_export$nodeContains as nodeContains, $a8ea2faf2ebe4d2f$re_export$isFocusWithin as isFocusWithin, $a8ea2faf2ebe4d2f$re_export$getOwnerDocument as getOwnerDocument, $a8ea2faf2ebe4d2f$re_export$getOwnerWindow as getOwnerWindow, $a8ea2faf2ebe4d2f$re_export$isShadowRoot as isShadowRoot, $a8ea2faf2ebe4d2f$re_export$mergeProps as mergeProps, $a8ea2faf2ebe4d2f$re_export$mergeRefs as mergeRefs, $a8ea2faf2ebe4d2f$re_export$filterDOMProps as filterDOMProps, $a8ea2faf2ebe4d2f$re_export$focusWithoutScrolling as focusWithoutScrolling, $a8ea2faf2ebe4d2f$re_export$getOffset as getOffset, $a8ea2faf2ebe4d2f$re_export$runAfterTransition as runAfterTransition, $a8ea2faf2ebe4d2f$re_export$useDrag1D as useDrag1D, $a8ea2faf2ebe4d2f$re_export$useGlobalListeners as useGlobalListeners, $a8ea2faf2ebe4d2f$re_export$useLabels as useLabels, $a8ea2faf2ebe4d2f$re_export$useObjectRef as useObjectRef, $a8ea2faf2ebe4d2f$re_export$useUpdateEffect as useUpdateEffect, $a8ea2faf2ebe4d2f$re_export$useUpdateLayoutEffect as useUpdateLayoutEffect, $a8ea2faf2ebe4d2f$re_export$useLayoutEffect as useLayoutEffect, $a8ea2faf2ebe4d2f$re_export$useResizeObserver as useResizeObserver, $a8ea2faf2ebe4d2f$re_export$useSyncRef as useSyncRef, $a8ea2faf2ebe4d2f$re_export$getScrollParent as getScrollParent, $a8ea2faf2ebe4d2f$re_export$getScrollParents as getScrollParents, $a8ea2faf2ebe4d2f$re_export$isScrollable as isScrollable, $a8ea2faf2ebe4d2f$re_export$useViewportSize as useViewportSize, $a8ea2faf2ebe4d2f$re_export$useDescription as useDescription, $a8ea2faf2ebe4d2f$re_export$useEvent as useEvent, $a8ea2faf2ebe4d2f$re_export$useValueEffect as useValueEffect, $a8ea2faf2ebe4d2f$re_export$scrollIntoView as scrollIntoView, $a8ea2faf2ebe4d2f$re_export$scrollIntoViewport as scrollIntoViewport, $a8ea2faf2ebe4d2f$re_export$isVirtualClick as isVirtualClick, $a8ea2faf2ebe4d2f$re_export$isVirtualPointerEvent as isVirtualPointerEvent, $a8ea2faf2ebe4d2f$re_export$useEffectEvent as useEffectEvent, $a8ea2faf2ebe4d2f$re_export$useDeepMemo as useDeepMemo, $a8ea2faf2ebe4d2f$re_export$useFormReset as useFormReset, $a8ea2faf2ebe4d2f$re_export$useLoadMore as useLoadMore, $a8ea2faf2ebe4d2f$re_export$useLoadMoreSentinel as useLoadMoreSentinel, $a8ea2faf2ebe4d2f$re_export$useLoadMoreSentinel as UNSTABLE_useLoadMoreSentinel, $a8ea2faf2ebe4d2f$re_export$inertValue as inertValue, $a8ea2faf2ebe4d2f$re_export$isCtrlKeyPressed as isCtrlKeyPressed, $a8ea2faf2ebe4d2f$re_export$willOpenKeyboard as willOpenKeyboard, $a8ea2faf2ebe4d2f$re_export$useEnterAnimation as useEnterAnimation, $a8ea2faf2ebe4d2f$re_export$useExitAnimation as useExitAnimation, $a8ea2faf2ebe4d2f$re_export$isFocusable as isFocusable, $a8ea2faf2ebe4d2f$re_export$isTabbable as isTabbable, $a8ea2faf2ebe4d2f$re_export$getNonce as getNonce, $a8ea2faf2ebe4d2f$re_export$clamp as clamp, $a8ea2faf2ebe4d2f$re_export$snapValueToStep as snapValueToStep};
//# sourceMappingURL=module.js.map

@@ -1,1 +0,1 @@

{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/utils/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nexport {useId, mergeIds, useSlotId} from './useId';\nexport {chain} from './chain';\nexport {createShadowTreeWalker, ShadowTreeWalker} from './shadowdom/ShadowTreeWalker';\nexport {getActiveElement, getEventTarget, nodeContains} from './shadowdom/DOMFunctions';\nexport {getOwnerDocument, getOwnerWindow, isShadowRoot} from './domHelpers';\nexport {mergeProps} from './mergeProps';\nexport {mergeRefs} from './mergeRefs';\nexport {filterDOMProps} from './filterDOMProps';\nexport {focusWithoutScrolling} from './focusWithoutScrolling';\nexport {getOffset} from './getOffset';\nexport {openLink, getSyntheticLinkProps, useSyntheticLinkProps, RouterProvider, shouldClientNavigate, useRouter, useLinkProps, handleLinkClick} from './openLink';\nexport {runAfterTransition} from './runAfterTransition';\nexport {useDrag1D} from './useDrag1D';\nexport {useGlobalListeners} from './useGlobalListeners';\nexport {useLabels} from './useLabels';\nexport {useObjectRef} from './useObjectRef';\nexport {useUpdateEffect} from './useUpdateEffect';\nexport {useUpdateLayoutEffect} from './useUpdateLayoutEffect';\nexport {useLayoutEffect} from './useLayoutEffect';\nexport {useResizeObserver} from './useResizeObserver';\nexport {useSyncRef} from './useSyncRef';\nexport {getScrollParent} from './getScrollParent';\nexport {getScrollParents} from './getScrollParents';\nexport {isScrollable} from './isScrollable';\nexport {useViewportSize} from './useViewportSize';\nexport {useDescription} from './useDescription';\nexport {isMac, isIPhone, isIPad, isIOS, isAppleDevice, isWebKit, isChrome, isAndroid, isFirefox} from './platform';\nexport {useEvent} from './useEvent';\nexport {useValueEffect} from './useValueEffect';\nexport {scrollIntoView, scrollIntoViewport} from './scrollIntoView';\nexport {clamp, snapValueToStep} from '@react-stately/utils';\nexport {isVirtualClick, isVirtualPointerEvent} from './isVirtualEvent';\nexport {useEffectEvent} from './useEffectEvent';\nexport {useDeepMemo} from './useDeepMemo';\nexport {useFormReset} from './useFormReset';\nexport {useLoadMore} from './useLoadMore';\nexport {useLoadMoreSentinel, useLoadMoreSentinel as UNSTABLE_useLoadMoreSentinel} from './useLoadMoreSentinel';\nexport {inertValue} from './inertValue';\nexport {CLEAR_FOCUS_EVENT, FOCUS_EVENT} from './constants';\nexport {isCtrlKeyPressed, willOpenKeyboard} from './keyboard';\nexport {useEnterAnimation, useExitAnimation} from './animation';\nexport {isFocusable, isTabbable} from './isFocusable';\n\nexport type {LoadMoreSentinelProps} from './useLoadMoreSentinel';\n"],"names":[],"version":3,"file":"module.js.map"}
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/utils/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nexport {CLEAR_FOCUS_EVENT, FOCUS_EVENT} from 'react-aria/private/utils/constants';\n\nexport {\n isMac,\n isIPhone,\n isIPad,\n isIOS,\n isAppleDevice,\n isWebKit,\n isChrome,\n isAndroid,\n isFirefox\n} from 'react-aria/private/utils/platform';\nexport {\n openLink,\n getSyntheticLinkProps,\n useSyntheticLinkProps,\n RouterProvider,\n shouldClientNavigate,\n useRouter,\n useLinkProps,\n handleLinkClick\n} from 'react-aria/private/utils/openLink';\nexport {useId} from 'react-aria/useId';\nexport {mergeIds, useSlotId} from 'react-aria/private/utils/useId';\nexport {chain} from 'react-aria/chain';\nexport {\n createShadowTreeWalker,\n ShadowTreeWalker\n} from 'react-aria/private/utils/shadowdom/ShadowTreeWalker';\nexport {\n getActiveElement,\n getEventTarget,\n nodeContains,\n isFocusWithin\n} from 'react-aria/private/utils/shadowdom/DOMFunctions';\nexport {getOwnerDocument, getOwnerWindow, isShadowRoot} from 'react-aria/private/utils/domHelpers';\nexport {mergeProps} from 'react-aria/mergeProps';\nexport {mergeRefs} from 'react-aria/mergeRefs';\nexport {filterDOMProps} from 'react-aria/filterDOMProps';\nexport {focusWithoutScrolling} from 'react-aria/private/utils/focusWithoutScrolling';\nexport {getOffset} from 'react-aria/private/utils/getOffset';\nexport {runAfterTransition} from 'react-aria/private/utils/runAfterTransition';\nexport {useDrag1D} from 'react-aria/private/utils/useDrag1D';\nexport {useGlobalListeners} from 'react-aria/private/utils/useGlobalListeners';\nexport {useLabels} from 'react-aria/private/utils/useLabels';\nexport {useObjectRef} from 'react-aria/useObjectRef';\nexport {useUpdateEffect} from 'react-aria/private/utils/useUpdateEffect';\nexport {useUpdateLayoutEffect} from 'react-aria/private/utils/useUpdateLayoutEffect';\nexport {useLayoutEffect} from 'react-aria/private/utils/useLayoutEffect';\nexport {useResizeObserver} from 'react-aria/private/utils/useResizeObserver';\nexport {useSyncRef} from 'react-aria/private/utils/useSyncRef';\nexport {getScrollParent} from 'react-aria/private/utils/getScrollParent';\nexport {getScrollParents} from 'react-aria/private/utils/getScrollParents';\nexport {isScrollable} from 'react-aria/private/utils/isScrollable';\nexport {useViewportSize} from 'react-aria/private/utils/useViewportSize';\nexport {useDescription} from 'react-aria/private/utils/useDescription';\nexport {useEvent} from 'react-aria/private/utils/useEvent';\nexport {useValueEffect} from 'react-aria/private/utils/useValueEffect';\nexport {scrollIntoView, scrollIntoViewport} from 'react-aria/private/utils/scrollIntoView';\nexport {isVirtualClick, isVirtualPointerEvent} from 'react-aria/private/utils/isVirtualEvent';\nexport {useEffectEvent} from 'react-aria/private/utils/useEffectEvent';\nexport {useDeepMemo} from 'react-aria/private/utils/useDeepMemo';\nexport {useFormReset} from 'react-aria/private/utils/useFormReset';\nexport {useLoadMore} from 'react-aria/private/utils/useLoadMore';\nexport {\n useLoadMoreSentinel,\n useLoadMoreSentinel as UNSTABLE_useLoadMoreSentinel\n} from 'react-aria/private/utils/useLoadMoreSentinel';\nexport {inertValue} from 'react-aria/private/utils/inertValue';\nexport {isCtrlKeyPressed, willOpenKeyboard} from 'react-aria/private/utils/keyboard';\nexport {useEnterAnimation, useExitAnimation} from 'react-aria/private/utils/animation';\nexport {isFocusable, isTabbable} from 'react-aria/private/utils/isFocusable';\nexport {getNonce} from 'react-aria/private/utils/getNonce';\nexport type {LoadMoreSentinelProps} from 'react-aria/private/utils/useLoadMoreSentinel';\nexport {clamp, snapValueToStep} from 'react-stately/private/utils/number';\n"],"names":[],"version":3,"file":"module.js.map"}
{
"name": "@react-aria/utils",
"version": "3.0.0-nightly-8d310eb29-260114",
"version": "3.0.0-nightly-8e585dfb4-260513",
"description": "Spectrum UI components in React",
"license": "Apache-2.0",
"main": "dist/main.js",
"module": "dist/module.js",
"exports": {
"source": "./src/index.ts",
"types": [
"./dist/types.d.ts",
"./src/index.ts"
],
"import": "./dist/import.mjs",
"require": "./dist/main.js"
"repository": {
"type": "git",
"url": "https://github.com/adobe/react-spectrum"
},
"types": "dist/types.d.ts",
"source": "src/index.ts",

@@ -24,14 +16,26 @@ "files": [

"sideEffects": false,
"repository": {
"type": "git",
"url": "https://github.com/adobe/react-spectrum"
"main": "dist/main.js",
"module": "dist/module.js",
"types": "dist/types/src/index.d.ts",
"exports": {
".": {
"source": "./src/index.ts",
"types": "./dist/types/src/index.d.ts",
"import": "./dist/import.mjs",
"require": "./dist/main.js"
},
"./package.json": "./package.json"
},
"publishConfig": {
"access": "public"
},
"dependencies": {
"@react-aria/ssr": "3.0.0-nightly-8d310eb29-260114",
"@react-stately/flags": "3.0.0-nightly-8d310eb29-260114",
"@react-stately/utils": "3.0.0-nightly-8d310eb29-260114",
"@react-types/shared": "3.0.0-nightly-8d310eb29-260114",
"@swc/helpers": "^0.5.0",
"clsx": "^2.0.0"
"react-aria": "3.0.0-nightly-8e585dfb4-260513",
"react-stately": "3.0.0-nightly-8e585dfb4-260513"
},
"devDependencies": {
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
},
"peerDependencies": {

@@ -41,5 +45,5 @@ "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",

},
"publishConfig": {
"access": "public"
"targets": {
"types": false
}
}

@@ -12,45 +12,77 @@ /*

*/
export {useId, mergeIds, useSlotId} from './useId';
export {chain} from './chain';
export {createShadowTreeWalker, ShadowTreeWalker} from './shadowdom/ShadowTreeWalker';
export {getActiveElement, getEventTarget, nodeContains} from './shadowdom/DOMFunctions';
export {getOwnerDocument, getOwnerWindow, isShadowRoot} from './domHelpers';
export {mergeProps} from './mergeProps';
export {mergeRefs} from './mergeRefs';
export {filterDOMProps} from './filterDOMProps';
export {focusWithoutScrolling} from './focusWithoutScrolling';
export {getOffset} from './getOffset';
export {openLink, getSyntheticLinkProps, useSyntheticLinkProps, RouterProvider, shouldClientNavigate, useRouter, useLinkProps, handleLinkClick} from './openLink';
export {runAfterTransition} from './runAfterTransition';
export {useDrag1D} from './useDrag1D';
export {useGlobalListeners} from './useGlobalListeners';
export {useLabels} from './useLabels';
export {useObjectRef} from './useObjectRef';
export {useUpdateEffect} from './useUpdateEffect';
export {useUpdateLayoutEffect} from './useUpdateLayoutEffect';
export {useLayoutEffect} from './useLayoutEffect';
export {useResizeObserver} from './useResizeObserver';
export {useSyncRef} from './useSyncRef';
export {getScrollParent} from './getScrollParent';
export {getScrollParents} from './getScrollParents';
export {isScrollable} from './isScrollable';
export {useViewportSize} from './useViewportSize';
export {useDescription} from './useDescription';
export {isMac, isIPhone, isIPad, isIOS, isAppleDevice, isWebKit, isChrome, isAndroid, isFirefox} from './platform';
export {useEvent} from './useEvent';
export {useValueEffect} from './useValueEffect';
export {scrollIntoView, scrollIntoViewport} from './scrollIntoView';
export {clamp, snapValueToStep} from '@react-stately/utils';
export {isVirtualClick, isVirtualPointerEvent} from './isVirtualEvent';
export {useEffectEvent} from './useEffectEvent';
export {useDeepMemo} from './useDeepMemo';
export {useFormReset} from './useFormReset';
export {useLoadMore} from './useLoadMore';
export {useLoadMoreSentinel, useLoadMoreSentinel as UNSTABLE_useLoadMoreSentinel} from './useLoadMoreSentinel';
export {inertValue} from './inertValue';
export {CLEAR_FOCUS_EVENT, FOCUS_EVENT} from './constants';
export {isCtrlKeyPressed, willOpenKeyboard} from './keyboard';
export {useEnterAnimation, useExitAnimation} from './animation';
export {isFocusable, isTabbable} from './isFocusable';
export {CLEAR_FOCUS_EVENT, FOCUS_EVENT} from 'react-aria/private/utils/constants';
export type {LoadMoreSentinelProps} from './useLoadMoreSentinel';
export {
isMac,
isIPhone,
isIPad,
isIOS,
isAppleDevice,
isWebKit,
isChrome,
isAndroid,
isFirefox
} from 'react-aria/private/utils/platform';
export {
openLink,
getSyntheticLinkProps,
useSyntheticLinkProps,
RouterProvider,
shouldClientNavigate,
useRouter,
useLinkProps,
handleLinkClick
} from 'react-aria/private/utils/openLink';
export {useId} from 'react-aria/useId';
export {mergeIds, useSlotId} from 'react-aria/private/utils/useId';
export {chain} from 'react-aria/chain';
export {
createShadowTreeWalker,
ShadowTreeWalker
} from 'react-aria/private/utils/shadowdom/ShadowTreeWalker';
export {
getActiveElement,
getEventTarget,
nodeContains,
isFocusWithin
} from 'react-aria/private/utils/shadowdom/DOMFunctions';
export {getOwnerDocument, getOwnerWindow, isShadowRoot} from 'react-aria/private/utils/domHelpers';
export {mergeProps} from 'react-aria/mergeProps';
export {mergeRefs} from 'react-aria/mergeRefs';
export {filterDOMProps} from 'react-aria/filterDOMProps';
export {focusWithoutScrolling} from 'react-aria/private/utils/focusWithoutScrolling';
export {getOffset} from 'react-aria/private/utils/getOffset';
export {runAfterTransition} from 'react-aria/private/utils/runAfterTransition';
export {useDrag1D} from 'react-aria/private/utils/useDrag1D';
export {useGlobalListeners} from 'react-aria/private/utils/useGlobalListeners';
export {useLabels} from 'react-aria/private/utils/useLabels';
export {useObjectRef} from 'react-aria/useObjectRef';
export {useUpdateEffect} from 'react-aria/private/utils/useUpdateEffect';
export {useUpdateLayoutEffect} from 'react-aria/private/utils/useUpdateLayoutEffect';
export {useLayoutEffect} from 'react-aria/private/utils/useLayoutEffect';
export {useResizeObserver} from 'react-aria/private/utils/useResizeObserver';
export {useSyncRef} from 'react-aria/private/utils/useSyncRef';
export {getScrollParent} from 'react-aria/private/utils/getScrollParent';
export {getScrollParents} from 'react-aria/private/utils/getScrollParents';
export {isScrollable} from 'react-aria/private/utils/isScrollable';
export {useViewportSize} from 'react-aria/private/utils/useViewportSize';
export {useDescription} from 'react-aria/private/utils/useDescription';
export {useEvent} from 'react-aria/private/utils/useEvent';
export {useValueEffect} from 'react-aria/private/utils/useValueEffect';
export {scrollIntoView, scrollIntoViewport} from 'react-aria/private/utils/scrollIntoView';
export {isVirtualClick, isVirtualPointerEvent} from 'react-aria/private/utils/isVirtualEvent';
export {useEffectEvent} from 'react-aria/private/utils/useEffectEvent';
export {useDeepMemo} from 'react-aria/private/utils/useDeepMemo';
export {useFormReset} from 'react-aria/private/utils/useFormReset';
export {useLoadMore} from 'react-aria/private/utils/useLoadMore';
export {
useLoadMoreSentinel,
useLoadMoreSentinel as UNSTABLE_useLoadMoreSentinel
} from 'react-aria/private/utils/useLoadMoreSentinel';
export {inertValue} from 'react-aria/private/utils/inertValue';
export {isCtrlKeyPressed, willOpenKeyboard} from 'react-aria/private/utils/keyboard';
export {useEnterAnimation, useExitAnimation} from 'react-aria/private/utils/animation';
export {isFocusable, isTabbable} from 'react-aria/private/utils/isFocusable';
export {getNonce} from 'react-aria/private/utils/getNonce';
export type {LoadMoreSentinelProps} from 'react-aria/private/utils/useLoadMoreSentinel';
export {clamp, snapValueToStep} from 'react-stately/private/utils/number';
var $78605a5d7424e31b$exports = require("./useLayoutEffect.main.js");
var $bsryd$reactdom = require("react-dom");
var $bsryd$react = require("react");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useEnterAnimation", () => $5bd06107f98811f5$export$6d3443f2c48bfc20);
$parcel$export(module.exports, "useExitAnimation", () => $5bd06107f98811f5$export$45fda7c47f93fd48);
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $5bd06107f98811f5$export$6d3443f2c48bfc20(ref, isReady = true) {
let [isEntering, setEntering] = (0, $bsryd$react.useState)(true);
let isAnimationReady = isEntering && isReady;
// There are two cases for entry animations:
// 1. CSS @keyframes. The `animation` property is set during the isEntering state, and it is removed after the animation finishes.
// 2. CSS transitions. The initial styles are applied during the isEntering state, and removed immediately, causing the transition to occur.
//
// In the second case, cancel any transitions that were triggered prior to the isEntering = false state (when the transition is supposed to start).
// This can happen when isReady starts as false (e.g. popovers prior to placement calculation).
(0, $78605a5d7424e31b$exports.useLayoutEffect)(()=>{
if (isAnimationReady && ref.current && 'getAnimations' in ref.current) {
for (let animation of ref.current.getAnimations())if (animation instanceof CSSTransition) animation.cancel();
}
}, [
ref,
isAnimationReady
]);
$5bd06107f98811f5$var$useAnimation(ref, isAnimationReady, (0, $bsryd$react.useCallback)(()=>setEntering(false), []));
return isAnimationReady;
}
function $5bd06107f98811f5$export$45fda7c47f93fd48(ref, isOpen) {
let [exitState, setExitState] = (0, $bsryd$react.useState)(isOpen ? 'open' : 'closed');
switch(exitState){
case 'open':
// If isOpen becomes false, set the state to exiting.
if (!isOpen) setExitState('exiting');
break;
case 'closed':
case 'exiting':
// If we are exiting and isOpen becomes true, the animation was interrupted.
// Reset the state to open.
if (isOpen) setExitState('open');
break;
}
let isExiting = exitState === 'exiting';
$5bd06107f98811f5$var$useAnimation(ref, isExiting, (0, $bsryd$react.useCallback)(()=>{
// Set the state to closed, which will cause the element to be unmounted.
setExitState((state)=>state === 'exiting' ? 'closed' : state);
}, []));
return isExiting;
}
function $5bd06107f98811f5$var$useAnimation(ref, isActive, onEnd) {
(0, $78605a5d7424e31b$exports.useLayoutEffect)(()=>{
if (isActive && ref.current) {
if (!('getAnimations' in ref.current)) {
// JSDOM
onEnd();
return;
}
let animations = ref.current.getAnimations();
if (animations.length === 0) {
onEnd();
return;
}
let canceled = false;
Promise.all(animations.map((a)=>a.finished)).then(()=>{
if (!canceled) (0, $bsryd$reactdom.flushSync)(()=>{
onEnd();
});
}).catch(()=>{});
return ()=>{
canceled = true;
};
}
}, [
ref,
isActive,
onEnd
]);
}
//# sourceMappingURL=animation.main.js.map
{"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAMM,SAAS,0CAAkB,GAAkC,EAAE,UAAmB,IAAI;IAC3F,IAAI,CAAC,YAAY,YAAY,GAAG,CAAA,GAAA,qBAAO,EAAE;IACzC,IAAI,mBAAmB,cAAc;IAErC,4CAA4C;IAC5C,kIAAkI;IAClI,4IAA4I;IAC5I,EAAE;IACF,mJAAmJ;IACnJ,+FAA+F;IAC/F,CAAA,GAAA,yCAAc,EAAE;QACd,IAAI,oBAAoB,IAAI,OAAO,IAAI,mBAAmB,IAAI,OAAO,EAAE;YACrE,KAAK,IAAI,aAAa,IAAI,OAAO,CAAC,aAAa,GAC7C,IAAI,qBAAqB,eACvB,UAAU,MAAM;QAGtB;IACF,GAAG;QAAC;QAAK;KAAiB;IAE1B,mCAAa,KAAK,kBAAkB,CAAA,GAAA,wBAAU,EAAE,IAAM,YAAY,QAAQ,EAAE;IAC5E,OAAO;AACT;AAEO,SAAS,0CAAiB,GAAkC,EAAE,MAAe;IAClF,IAAI,CAAC,WAAW,aAAa,GAAG,CAAA,GAAA,qBAAO,EAAiC,SAAS,SAAS;IAE1F,OAAQ;QACN,KAAK;YACH,qDAAqD;YACrD,IAAI,CAAC,QACH,aAAa;YAEf;QACF,KAAK;QACL,KAAK;YACH,4EAA4E;YAC5E,2BAA2B;YAC3B,IAAI,QACF,aAAa;YAEf;IACJ;IAEA,IAAI,YAAY,cAAc;IAC9B,mCACE,KACA,WACA,CAAA,GAAA,wBAAU,EAAE;QACV,yEAAyE;QACzE,aAAa,CAAA,QAAS,UAAU,YAAY,WAAW;IACzD,GAAG,EAAE;IAGP,OAAO;AACT;AAEA,SAAS,mCAAa,GAAkC,EAAE,QAAiB,EAAE,KAAiB;IAC5F,CAAA,GAAA,yCAAc,EAAE;QACd,IAAI,YAAY,IAAI,OAAO,EAAE;YAC3B,IAAI,CAAE,CAAA,mBAAmB,IAAI,OAAO,AAAD,GAAI;gBACrC,QAAQ;gBACR;gBACA;YACF;YAEA,IAAI,aAAa,IAAI,OAAO,CAAC,aAAa;YAC1C,IAAI,WAAW,MAAM,KAAK,GAAG;gBAC3B;gBACA;YACF;YAEA,IAAI,WAAW;YACf,QAAQ,GAAG,CAAC,WAAW,GAAG,CAAC,CAAA,IAAK,EAAE,QAAQ,GAAG,IAAI,CAAC;gBAChD,IAAI,CAAC,UACH,CAAA,GAAA,yBAAQ,EAAE;oBACR;gBACF;YAEJ,GAAG,KAAK,CAAC,KAAO;YAEhB,OAAO;gBACL,WAAW;YACb;QACF;IACF,GAAG;QAAC;QAAK;QAAU;KAAM;AAC3B","sources":["packages/@react-aria/utils/src/animation.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {flushSync} from 'react-dom';\nimport {RefObject, useCallback, useState} from 'react';\nimport {useLayoutEffect} from './useLayoutEffect';\n\nexport function useEnterAnimation(ref: RefObject<HTMLElement | null>, isReady: boolean = true): boolean {\n let [isEntering, setEntering] = useState(true);\n let isAnimationReady = isEntering && isReady;\n\n // There are two cases for entry animations:\n // 1. CSS @keyframes. The `animation` property is set during the isEntering state, and it is removed after the animation finishes.\n // 2. CSS transitions. The initial styles are applied during the isEntering state, and removed immediately, causing the transition to occur.\n //\n // In the second case, cancel any transitions that were triggered prior to the isEntering = false state (when the transition is supposed to start).\n // This can happen when isReady starts as false (e.g. popovers prior to placement calculation).\n useLayoutEffect(() => {\n if (isAnimationReady && ref.current && 'getAnimations' in ref.current) {\n for (let animation of ref.current.getAnimations()) {\n if (animation instanceof CSSTransition) {\n animation.cancel();\n }\n }\n }\n }, [ref, isAnimationReady]);\n\n useAnimation(ref, isAnimationReady, useCallback(() => setEntering(false), []));\n return isAnimationReady;\n}\n\nexport function useExitAnimation(ref: RefObject<HTMLElement | null>, isOpen: boolean): boolean {\n let [exitState, setExitState] = useState<'closed' | 'open' | 'exiting'>(isOpen ? 'open' : 'closed');\n\n switch (exitState) {\n case 'open':\n // If isOpen becomes false, set the state to exiting.\n if (!isOpen) {\n setExitState('exiting');\n }\n break;\n case 'closed':\n case 'exiting':\n // If we are exiting and isOpen becomes true, the animation was interrupted.\n // Reset the state to open.\n if (isOpen) {\n setExitState('open');\n }\n break;\n }\n\n let isExiting = exitState === 'exiting';\n useAnimation(\n ref,\n isExiting,\n useCallback(() => {\n // Set the state to closed, which will cause the element to be unmounted.\n setExitState(state => state === 'exiting' ? 'closed' : state);\n }, [])\n );\n\n return isExiting;\n}\n\nfunction useAnimation(ref: RefObject<HTMLElement | null>, isActive: boolean, onEnd: () => void): void {\n useLayoutEffect(() => {\n if (isActive && ref.current) {\n if (!('getAnimations' in ref.current)) {\n // JSDOM\n onEnd();\n return;\n }\n\n let animations = ref.current.getAnimations();\n if (animations.length === 0) {\n onEnd();\n return;\n }\n\n let canceled = false;\n Promise.all(animations.map(a => a.finished)).then(() => {\n if (!canceled) {\n flushSync(() => {\n onEnd();\n });\n }\n }).catch(() => {});\n\n return () => {\n canceled = true;\n };\n }\n }, [ref, isActive, onEnd]);\n}\n"],"names":[],"version":3,"file":"animation.main.js.map"}
import {useLayoutEffect as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c} from "./useLayoutEffect.mjs";
import {flushSync as $jJMAe$flushSync} from "react-dom";
import {useState as $jJMAe$useState, useCallback as $jJMAe$useCallback} from "react";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $d3f049242431219c$export$6d3443f2c48bfc20(ref, isReady = true) {
let [isEntering, setEntering] = (0, $jJMAe$useState)(true);
let isAnimationReady = isEntering && isReady;
// There are two cases for entry animations:
// 1. CSS @keyframes. The `animation` property is set during the isEntering state, and it is removed after the animation finishes.
// 2. CSS transitions. The initial styles are applied during the isEntering state, and removed immediately, causing the transition to occur.
//
// In the second case, cancel any transitions that were triggered prior to the isEntering = false state (when the transition is supposed to start).
// This can happen when isReady starts as false (e.g. popovers prior to placement calculation).
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
if (isAnimationReady && ref.current && 'getAnimations' in ref.current) {
for (let animation of ref.current.getAnimations())if (animation instanceof CSSTransition) animation.cancel();
}
}, [
ref,
isAnimationReady
]);
$d3f049242431219c$var$useAnimation(ref, isAnimationReady, (0, $jJMAe$useCallback)(()=>setEntering(false), []));
return isAnimationReady;
}
function $d3f049242431219c$export$45fda7c47f93fd48(ref, isOpen) {
let [exitState, setExitState] = (0, $jJMAe$useState)(isOpen ? 'open' : 'closed');
switch(exitState){
case 'open':
// If isOpen becomes false, set the state to exiting.
if (!isOpen) setExitState('exiting');
break;
case 'closed':
case 'exiting':
// If we are exiting and isOpen becomes true, the animation was interrupted.
// Reset the state to open.
if (isOpen) setExitState('open');
break;
}
let isExiting = exitState === 'exiting';
$d3f049242431219c$var$useAnimation(ref, isExiting, (0, $jJMAe$useCallback)(()=>{
// Set the state to closed, which will cause the element to be unmounted.
setExitState((state)=>state === 'exiting' ? 'closed' : state);
}, []));
return isExiting;
}
function $d3f049242431219c$var$useAnimation(ref, isActive, onEnd) {
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
if (isActive && ref.current) {
if (!('getAnimations' in ref.current)) {
// JSDOM
onEnd();
return;
}
let animations = ref.current.getAnimations();
if (animations.length === 0) {
onEnd();
return;
}
let canceled = false;
Promise.all(animations.map((a)=>a.finished)).then(()=>{
if (!canceled) (0, $jJMAe$flushSync)(()=>{
onEnd();
});
}).catch(()=>{});
return ()=>{
canceled = true;
};
}
}, [
ref,
isActive,
onEnd
]);
}
export {$d3f049242431219c$export$6d3443f2c48bfc20 as useEnterAnimation, $d3f049242431219c$export$45fda7c47f93fd48 as useExitAnimation};
//# sourceMappingURL=animation.module.js.map
import {useLayoutEffect as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c} from "./useLayoutEffect.module.js";
import {flushSync as $jJMAe$flushSync} from "react-dom";
import {useState as $jJMAe$useState, useCallback as $jJMAe$useCallback} from "react";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $d3f049242431219c$export$6d3443f2c48bfc20(ref, isReady = true) {
let [isEntering, setEntering] = (0, $jJMAe$useState)(true);
let isAnimationReady = isEntering && isReady;
// There are two cases for entry animations:
// 1. CSS @keyframes. The `animation` property is set during the isEntering state, and it is removed after the animation finishes.
// 2. CSS transitions. The initial styles are applied during the isEntering state, and removed immediately, causing the transition to occur.
//
// In the second case, cancel any transitions that were triggered prior to the isEntering = false state (when the transition is supposed to start).
// This can happen when isReady starts as false (e.g. popovers prior to placement calculation).
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
if (isAnimationReady && ref.current && 'getAnimations' in ref.current) {
for (let animation of ref.current.getAnimations())if (animation instanceof CSSTransition) animation.cancel();
}
}, [
ref,
isAnimationReady
]);
$d3f049242431219c$var$useAnimation(ref, isAnimationReady, (0, $jJMAe$useCallback)(()=>setEntering(false), []));
return isAnimationReady;
}
function $d3f049242431219c$export$45fda7c47f93fd48(ref, isOpen) {
let [exitState, setExitState] = (0, $jJMAe$useState)(isOpen ? 'open' : 'closed');
switch(exitState){
case 'open':
// If isOpen becomes false, set the state to exiting.
if (!isOpen) setExitState('exiting');
break;
case 'closed':
case 'exiting':
// If we are exiting and isOpen becomes true, the animation was interrupted.
// Reset the state to open.
if (isOpen) setExitState('open');
break;
}
let isExiting = exitState === 'exiting';
$d3f049242431219c$var$useAnimation(ref, isExiting, (0, $jJMAe$useCallback)(()=>{
// Set the state to closed, which will cause the element to be unmounted.
setExitState((state)=>state === 'exiting' ? 'closed' : state);
}, []));
return isExiting;
}
function $d3f049242431219c$var$useAnimation(ref, isActive, onEnd) {
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
if (isActive && ref.current) {
if (!('getAnimations' in ref.current)) {
// JSDOM
onEnd();
return;
}
let animations = ref.current.getAnimations();
if (animations.length === 0) {
onEnd();
return;
}
let canceled = false;
Promise.all(animations.map((a)=>a.finished)).then(()=>{
if (!canceled) (0, $jJMAe$flushSync)(()=>{
onEnd();
});
}).catch(()=>{});
return ()=>{
canceled = true;
};
}
}, [
ref,
isActive,
onEnd
]);
}
export {$d3f049242431219c$export$6d3443f2c48bfc20 as useEnterAnimation, $d3f049242431219c$export$45fda7c47f93fd48 as useExitAnimation};
//# sourceMappingURL=animation.module.js.map
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAMM,SAAS,0CAAkB,GAAkC,EAAE,UAAmB,IAAI;IAC3F,IAAI,CAAC,YAAY,YAAY,GAAG,CAAA,GAAA,eAAO,EAAE;IACzC,IAAI,mBAAmB,cAAc;IAErC,4CAA4C;IAC5C,kIAAkI;IAClI,4IAA4I;IAC5I,EAAE;IACF,mJAAmJ;IACnJ,+FAA+F;IAC/F,CAAA,GAAA,yCAAc,EAAE;QACd,IAAI,oBAAoB,IAAI,OAAO,IAAI,mBAAmB,IAAI,OAAO,EAAE;YACrE,KAAK,IAAI,aAAa,IAAI,OAAO,CAAC,aAAa,GAC7C,IAAI,qBAAqB,eACvB,UAAU,MAAM;QAGtB;IACF,GAAG;QAAC;QAAK;KAAiB;IAE1B,mCAAa,KAAK,kBAAkB,CAAA,GAAA,kBAAU,EAAE,IAAM,YAAY,QAAQ,EAAE;IAC5E,OAAO;AACT;AAEO,SAAS,0CAAiB,GAAkC,EAAE,MAAe;IAClF,IAAI,CAAC,WAAW,aAAa,GAAG,CAAA,GAAA,eAAO,EAAiC,SAAS,SAAS;IAE1F,OAAQ;QACN,KAAK;YACH,qDAAqD;YACrD,IAAI,CAAC,QACH,aAAa;YAEf;QACF,KAAK;QACL,KAAK;YACH,4EAA4E;YAC5E,2BAA2B;YAC3B,IAAI,QACF,aAAa;YAEf;IACJ;IAEA,IAAI,YAAY,cAAc;IAC9B,mCACE,KACA,WACA,CAAA,GAAA,kBAAU,EAAE;QACV,yEAAyE;QACzE,aAAa,CAAA,QAAS,UAAU,YAAY,WAAW;IACzD,GAAG,EAAE;IAGP,OAAO;AACT;AAEA,SAAS,mCAAa,GAAkC,EAAE,QAAiB,EAAE,KAAiB;IAC5F,CAAA,GAAA,yCAAc,EAAE;QACd,IAAI,YAAY,IAAI,OAAO,EAAE;YAC3B,IAAI,CAAE,CAAA,mBAAmB,IAAI,OAAO,AAAD,GAAI;gBACrC,QAAQ;gBACR;gBACA;YACF;YAEA,IAAI,aAAa,IAAI,OAAO,CAAC,aAAa;YAC1C,IAAI,WAAW,MAAM,KAAK,GAAG;gBAC3B;gBACA;YACF;YAEA,IAAI,WAAW;YACf,QAAQ,GAAG,CAAC,WAAW,GAAG,CAAC,CAAA,IAAK,EAAE,QAAQ,GAAG,IAAI,CAAC;gBAChD,IAAI,CAAC,UACH,CAAA,GAAA,gBAAQ,EAAE;oBACR;gBACF;YAEJ,GAAG,KAAK,CAAC,KAAO;YAEhB,OAAO;gBACL,WAAW;YACb;QACF;IACF,GAAG;QAAC;QAAK;QAAU;KAAM;AAC3B","sources":["packages/@react-aria/utils/src/animation.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {flushSync} from 'react-dom';\nimport {RefObject, useCallback, useState} from 'react';\nimport {useLayoutEffect} from './useLayoutEffect';\n\nexport function useEnterAnimation(ref: RefObject<HTMLElement | null>, isReady: boolean = true): boolean {\n let [isEntering, setEntering] = useState(true);\n let isAnimationReady = isEntering && isReady;\n\n // There are two cases for entry animations:\n // 1. CSS @keyframes. The `animation` property is set during the isEntering state, and it is removed after the animation finishes.\n // 2. CSS transitions. The initial styles are applied during the isEntering state, and removed immediately, causing the transition to occur.\n //\n // In the second case, cancel any transitions that were triggered prior to the isEntering = false state (when the transition is supposed to start).\n // This can happen when isReady starts as false (e.g. popovers prior to placement calculation).\n useLayoutEffect(() => {\n if (isAnimationReady && ref.current && 'getAnimations' in ref.current) {\n for (let animation of ref.current.getAnimations()) {\n if (animation instanceof CSSTransition) {\n animation.cancel();\n }\n }\n }\n }, [ref, isAnimationReady]);\n\n useAnimation(ref, isAnimationReady, useCallback(() => setEntering(false), []));\n return isAnimationReady;\n}\n\nexport function useExitAnimation(ref: RefObject<HTMLElement | null>, isOpen: boolean): boolean {\n let [exitState, setExitState] = useState<'closed' | 'open' | 'exiting'>(isOpen ? 'open' : 'closed');\n\n switch (exitState) {\n case 'open':\n // If isOpen becomes false, set the state to exiting.\n if (!isOpen) {\n setExitState('exiting');\n }\n break;\n case 'closed':\n case 'exiting':\n // If we are exiting and isOpen becomes true, the animation was interrupted.\n // Reset the state to open.\n if (isOpen) {\n setExitState('open');\n }\n break;\n }\n\n let isExiting = exitState === 'exiting';\n useAnimation(\n ref,\n isExiting,\n useCallback(() => {\n // Set the state to closed, which will cause the element to be unmounted.\n setExitState(state => state === 'exiting' ? 'closed' : state);\n }, [])\n );\n\n return isExiting;\n}\n\nfunction useAnimation(ref: RefObject<HTMLElement | null>, isActive: boolean, onEnd: () => void): void {\n useLayoutEffect(() => {\n if (isActive && ref.current) {\n if (!('getAnimations' in ref.current)) {\n // JSDOM\n onEnd();\n return;\n }\n\n let animations = ref.current.getAnimations();\n if (animations.length === 0) {\n onEnd();\n return;\n }\n\n let canceled = false;\n Promise.all(animations.map(a => a.finished)).then(() => {\n if (!canceled) {\n flushSync(() => {\n onEnd();\n });\n }\n }).catch(() => {});\n\n return () => {\n canceled = true;\n };\n }\n }, [ref, isActive, onEnd]);\n}\n"],"names":[],"version":3,"file":"animation.module.js.map"}
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "chain", () => $1e2191638e54f613$export$e08e3b67e392101e);
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ /**
* Calls all functions in the order they were chained with the same arguments.
*/ function $1e2191638e54f613$export$e08e3b67e392101e(...callbacks) {
return (...args)=>{
for (let callback of callbacks)if (typeof callback === 'function') callback(...args);
};
}
//# sourceMappingURL=chain.main.js.map
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC,GAED;;CAEC,GACM,SAAS,0CAAM,GAAG,SAAgB;IACvC,OAAO,CAAC,GAAG;QACT,KAAK,IAAI,YAAY,UACnB,IAAI,OAAO,aAAa,YACtB,YAAY;IAGlB;AACF","sources":["packages/@react-aria/utils/src/chain.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/**\n * Calls all functions in the order they were chained with the same arguments.\n */\nexport function chain(...callbacks: any[]): (...args: any[]) => void {\n return (...args: any[]) => {\n for (let callback of callbacks) {\n if (typeof callback === 'function') {\n callback(...args);\n }\n }\n };\n}\n"],"names":[],"version":3,"file":"chain.main.js.map"}
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ /**
* Calls all functions in the order they were chained with the same arguments.
*/ function $ff5963eb1fccf552$export$e08e3b67e392101e(...callbacks) {
return (...args)=>{
for (let callback of callbacks)if (typeof callback === 'function') callback(...args);
};
}
export {$ff5963eb1fccf552$export$e08e3b67e392101e as chain};
//# sourceMappingURL=chain.module.js.map
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ /**
* Calls all functions in the order they were chained with the same arguments.
*/ function $ff5963eb1fccf552$export$e08e3b67e392101e(...callbacks) {
return (...args)=>{
for (let callback of callbacks)if (typeof callback === 'function') callback(...args);
};
}
export {$ff5963eb1fccf552$export$e08e3b67e392101e as chain};
//# sourceMappingURL=chain.module.js.map
{"mappings":"AAAA;;;;;;;;;;CAUC,GAED;;CAEC,GACM,SAAS,0CAAM,GAAG,SAAgB;IACvC,OAAO,CAAC,GAAG;QACT,KAAK,IAAI,YAAY,UACnB,IAAI,OAAO,aAAa,YACtB,YAAY;IAGlB;AACF","sources":["packages/@react-aria/utils/src/chain.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/**\n * Calls all functions in the order they were chained with the same arguments.\n */\nexport function chain(...callbacks: any[]): (...args: any[]) => void {\n return (...args: any[]) => {\n for (let callback of callbacks) {\n if (typeof callback === 'function') {\n callback(...args);\n }\n }\n };\n}\n"],"names":[],"version":3,"file":"chain.module.js.map"}
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "CLEAR_FOCUS_EVENT", () => $a0850d0add29d276$export$447a38995de2c711);
$parcel$export(module.exports, "FOCUS_EVENT", () => $a0850d0add29d276$export$831c820ad60f9d12);
/*
* Copyright 2024 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ // Custom event names for updating the autocomplete's aria-activedecendant.
const $a0850d0add29d276$export$447a38995de2c711 = 'react-aria-clear-focus';
const $a0850d0add29d276$export$831c820ad60f9d12 = 'react-aria-focus';
//# sourceMappingURL=constants.main.js.map
{"mappings":";;;;;;;AAAA;;;;;;;;;;CAUC,GAED,2EAA2E;AACpE,MAAM,4CAAoB;AAC1B,MAAM,4CAAc","sources":["packages/@react-aria/utils/src/constants.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Custom event names for updating the autocomplete's aria-activedecendant.\nexport const CLEAR_FOCUS_EVENT = 'react-aria-clear-focus';\nexport const FOCUS_EVENT = 'react-aria-focus';\n"],"names":[],"version":3,"file":"constants.main.js.map"}
/*
* Copyright 2024 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ // Custom event names for updating the autocomplete's aria-activedecendant.
const $5671b20cf9b562b2$export$447a38995de2c711 = 'react-aria-clear-focus';
const $5671b20cf9b562b2$export$831c820ad60f9d12 = 'react-aria-focus';
export {$5671b20cf9b562b2$export$447a38995de2c711 as CLEAR_FOCUS_EVENT, $5671b20cf9b562b2$export$831c820ad60f9d12 as FOCUS_EVENT};
//# sourceMappingURL=constants.module.js.map
/*
* Copyright 2024 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ // Custom event names for updating the autocomplete's aria-activedecendant.
const $5671b20cf9b562b2$export$447a38995de2c711 = 'react-aria-clear-focus';
const $5671b20cf9b562b2$export$831c820ad60f9d12 = 'react-aria-focus';
export {$5671b20cf9b562b2$export$447a38995de2c711 as CLEAR_FOCUS_EVENT, $5671b20cf9b562b2$export$831c820ad60f9d12 as FOCUS_EVENT};
//# sourceMappingURL=constants.module.js.map
{"mappings":"AAAA;;;;;;;;;;CAUC,GAED,2EAA2E;AACpE,MAAM,4CAAoB;AAC1B,MAAM,4CAAc","sources":["packages/@react-aria/utils/src/constants.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Custom event names for updating the autocomplete's aria-activedecendant.\nexport const CLEAR_FOCUS_EVENT = 'react-aria-clear-focus';\nexport const FOCUS_EVENT = 'react-aria-focus';\n"],"names":[],"version":3,"file":"constants.module.js.map"}
var $aaa611146751592e$exports = require("./domHelpers.main.js");
var $loak6$reactstatelyflags = require("@react-stately/flags");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "nodeContains", () => $d723bea02f3e2567$export$4282f70798064fe0);
$parcel$export(module.exports, "getActiveElement", () => $d723bea02f3e2567$export$cd4e5573fbe2b576);
$parcel$export(module.exports, "getEventTarget", () => $d723bea02f3e2567$export$e58f029f0fbfdb29);
// Source: https://github.com/microsoft/tabster/blob/a89fc5d7e332d48f68d03b1ca6e344489d1c3898/src/Shadowdomize/DOMFunctions.ts#L16
function $d723bea02f3e2567$export$4282f70798064fe0(node, otherNode) {
if (!(0, $loak6$reactstatelyflags.shadowDOM)()) return otherNode && node ? node.contains(otherNode) : false;
if (!node || !otherNode) return false;
let currentNode = otherNode;
while(currentNode !== null){
if (currentNode === node) return true;
if (currentNode.tagName === 'SLOT' && currentNode.assignedSlot) // Element is slotted
currentNode = currentNode.assignedSlot.parentNode;
else if ((0, $aaa611146751592e$exports.isShadowRoot)(currentNode)) // Element is in shadow root
currentNode = currentNode.host;
else currentNode = currentNode.parentNode;
}
return false;
}
const $d723bea02f3e2567$export$cd4e5573fbe2b576 = (doc = document)=>{
var _activeElement_shadowRoot;
if (!(0, $loak6$reactstatelyflags.shadowDOM)()) return doc.activeElement;
let activeElement = doc.activeElement;
while(activeElement && 'shadowRoot' in activeElement && ((_activeElement_shadowRoot = activeElement.shadowRoot) === null || _activeElement_shadowRoot === void 0 ? void 0 : _activeElement_shadowRoot.activeElement))activeElement = activeElement.shadowRoot.activeElement;
return activeElement;
};
function $d723bea02f3e2567$export$e58f029f0fbfdb29(event) {
if ((0, $loak6$reactstatelyflags.shadowDOM)() && event.target.shadowRoot) {
if (event.composedPath) return event.composedPath()[0];
}
return event.target;
}
//# sourceMappingURL=DOMFunctions.main.js.map
{"mappings":";;;;;;;;;;;AAAA,kIAAkI;;;AAQ3H,SAAS,0CACd,IAA6B,EAC7B,SAAkC;IAElC,IAAI,CAAC,CAAA,GAAA,kCAAQ,KACX,OAAO,aAAa,OAAO,KAAK,QAAQ,CAAC,aAAa;IAGxD,IAAI,CAAC,QAAQ,CAAC,WACZ,OAAO;IAGT,IAAI,cAAqD;IAEzD,MAAO,gBAAgB,KAAM;QAC3B,IAAI,gBAAgB,MAClB,OAAO;QAGT,IAAI,AAAC,YAAgC,OAAO,KAAK,UAC/C,AAAC,YAAgC,YAAY,EAC7C,qBAAqB;QACrB,cAAc,AAAC,YAAgC,YAAY,CAAE,UAAU;aAClE,IAAI,CAAA,GAAA,sCAAW,EAAE,cACtB,4BAA4B;QAC5B,cAAc,YAAY,IAAI;aAE9B,cAAc,YAAY,UAAU;IAExC;IAEA,OAAO;AACT;AAKO,MAAM,4CAAmB,CAAC,MAAgB,QAAQ;QAOvD;IANA,IAAI,CAAC,CAAA,GAAA,kCAAQ,KACX,OAAO,IAAI,aAAa;IAE1B,IAAI,gBAAgC,IAAI,aAAa;IAErD,MAAO,iBAAiB,gBAAgB,mBACxC,4BAAA,cAAc,UAAU,cAAxB,gDAAA,0BAA0B,aAAa,EACrC,gBAAgB,cAAc,UAAU,CAAC,aAAa;IAGxD,OAAO;AACT;AAKO,SAAS,0CAAgC,KAAQ;IACtD,IAAI,CAAA,GAAA,kCAAQ,OAAO,AAAC,MAAM,MAAM,CAAiB,UAAU,EAAE;QAC3D,IAAI,MAAM,YAAY,EACpB,OAAO,MAAM,YAAY,EAAE,CAAC,EAAE;IAElC;IACA,OAAO,MAAM,MAAM;AACrB","sources":["packages/@react-aria/utils/src/shadowdom/DOMFunctions.ts"],"sourcesContent":["// Source: https://github.com/microsoft/tabster/blob/a89fc5d7e332d48f68d03b1ca6e344489d1c3898/src/Shadowdomize/DOMFunctions.ts#L16\n\nimport {isShadowRoot} from '../domHelpers';\nimport {shadowDOM} from '@react-stately/flags';\n\n/**\n * ShadowDOM safe version of Node.contains.\n */\nexport function nodeContains(\n node: Node | null | undefined,\n otherNode: Node | null | undefined\n): boolean {\n if (!shadowDOM()) {\n return otherNode && node ? node.contains(otherNode) : false;\n }\n\n if (!node || !otherNode) {\n return false;\n }\n\n let currentNode: HTMLElement | Node | null | undefined = otherNode;\n\n while (currentNode !== null) {\n if (currentNode === node) {\n return true;\n }\n\n if ((currentNode as HTMLSlotElement).tagName === 'SLOT' &&\n (currentNode as HTMLSlotElement).assignedSlot) {\n // Element is slotted\n currentNode = (currentNode as HTMLSlotElement).assignedSlot!.parentNode;\n } else if (isShadowRoot(currentNode)) {\n // Element is in shadow root\n currentNode = currentNode.host;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n\n return false;\n}\n\n/**\n * ShadowDOM safe version of document.activeElement.\n */\nexport const getActiveElement = (doc: Document = document): Element | null => {\n if (!shadowDOM()) {\n return doc.activeElement;\n }\n let activeElement: Element | null = doc.activeElement;\n\n while (activeElement && 'shadowRoot' in activeElement &&\n activeElement.shadowRoot?.activeElement) {\n activeElement = activeElement.shadowRoot.activeElement;\n }\n\n return activeElement;\n};\n\n/**\n * ShadowDOM safe version of event.target.\n */\nexport function getEventTarget<T extends Event>(event: T): Element {\n if (shadowDOM() && (event.target as HTMLElement).shadowRoot) {\n if (event.composedPath) {\n return event.composedPath()[0] as Element;\n }\n }\n return event.target as Element;\n}\n"],"names":[],"version":3,"file":"DOMFunctions.main.js.map"}
import {isShadowRoot as $431fbd86ca7dc216$export$af51f0f06c0f328a} from "./domHelpers.mjs";
import {shadowDOM as $lcSu5$shadowDOM} from "@react-stately/flags";
// Source: https://github.com/microsoft/tabster/blob/a89fc5d7e332d48f68d03b1ca6e344489d1c3898/src/Shadowdomize/DOMFunctions.ts#L16
function $d4ee10de306f2510$export$4282f70798064fe0(node, otherNode) {
if (!(0, $lcSu5$shadowDOM)()) return otherNode && node ? node.contains(otherNode) : false;
if (!node || !otherNode) return false;
let currentNode = otherNode;
while(currentNode !== null){
if (currentNode === node) return true;
if (currentNode.tagName === 'SLOT' && currentNode.assignedSlot) // Element is slotted
currentNode = currentNode.assignedSlot.parentNode;
else if ((0, $431fbd86ca7dc216$export$af51f0f06c0f328a)(currentNode)) // Element is in shadow root
currentNode = currentNode.host;
else currentNode = currentNode.parentNode;
}
return false;
}
const $d4ee10de306f2510$export$cd4e5573fbe2b576 = (doc = document)=>{
var _activeElement_shadowRoot;
if (!(0, $lcSu5$shadowDOM)()) return doc.activeElement;
let activeElement = doc.activeElement;
while(activeElement && 'shadowRoot' in activeElement && ((_activeElement_shadowRoot = activeElement.shadowRoot) === null || _activeElement_shadowRoot === void 0 ? void 0 : _activeElement_shadowRoot.activeElement))activeElement = activeElement.shadowRoot.activeElement;
return activeElement;
};
function $d4ee10de306f2510$export$e58f029f0fbfdb29(event) {
if ((0, $lcSu5$shadowDOM)() && event.target.shadowRoot) {
if (event.composedPath) return event.composedPath()[0];
}
return event.target;
}
export {$d4ee10de306f2510$export$4282f70798064fe0 as nodeContains, $d4ee10de306f2510$export$cd4e5573fbe2b576 as getActiveElement, $d4ee10de306f2510$export$e58f029f0fbfdb29 as getEventTarget};
//# sourceMappingURL=DOMFunctions.module.js.map
import {isShadowRoot as $431fbd86ca7dc216$export$af51f0f06c0f328a} from "./domHelpers.module.js";
import {shadowDOM as $lcSu5$shadowDOM} from "@react-stately/flags";
// Source: https://github.com/microsoft/tabster/blob/a89fc5d7e332d48f68d03b1ca6e344489d1c3898/src/Shadowdomize/DOMFunctions.ts#L16
function $d4ee10de306f2510$export$4282f70798064fe0(node, otherNode) {
if (!(0, $lcSu5$shadowDOM)()) return otherNode && node ? node.contains(otherNode) : false;
if (!node || !otherNode) return false;
let currentNode = otherNode;
while(currentNode !== null){
if (currentNode === node) return true;
if (currentNode.tagName === 'SLOT' && currentNode.assignedSlot) // Element is slotted
currentNode = currentNode.assignedSlot.parentNode;
else if ((0, $431fbd86ca7dc216$export$af51f0f06c0f328a)(currentNode)) // Element is in shadow root
currentNode = currentNode.host;
else currentNode = currentNode.parentNode;
}
return false;
}
const $d4ee10de306f2510$export$cd4e5573fbe2b576 = (doc = document)=>{
var _activeElement_shadowRoot;
if (!(0, $lcSu5$shadowDOM)()) return doc.activeElement;
let activeElement = doc.activeElement;
while(activeElement && 'shadowRoot' in activeElement && ((_activeElement_shadowRoot = activeElement.shadowRoot) === null || _activeElement_shadowRoot === void 0 ? void 0 : _activeElement_shadowRoot.activeElement))activeElement = activeElement.shadowRoot.activeElement;
return activeElement;
};
function $d4ee10de306f2510$export$e58f029f0fbfdb29(event) {
if ((0, $lcSu5$shadowDOM)() && event.target.shadowRoot) {
if (event.composedPath) return event.composedPath()[0];
}
return event.target;
}
export {$d4ee10de306f2510$export$4282f70798064fe0 as nodeContains, $d4ee10de306f2510$export$cd4e5573fbe2b576 as getActiveElement, $d4ee10de306f2510$export$e58f029f0fbfdb29 as getEventTarget};
//# sourceMappingURL=DOMFunctions.module.js.map
{"mappings":";;;AAAA,kIAAkI;;;AAQ3H,SAAS,0CACd,IAA6B,EAC7B,SAAkC;IAElC,IAAI,CAAC,CAAA,GAAA,gBAAQ,KACX,OAAO,aAAa,OAAO,KAAK,QAAQ,CAAC,aAAa;IAGxD,IAAI,CAAC,QAAQ,CAAC,WACZ,OAAO;IAGT,IAAI,cAAqD;IAEzD,MAAO,gBAAgB,KAAM;QAC3B,IAAI,gBAAgB,MAClB,OAAO;QAGT,IAAI,AAAC,YAAgC,OAAO,KAAK,UAC/C,AAAC,YAAgC,YAAY,EAC7C,qBAAqB;QACrB,cAAc,AAAC,YAAgC,YAAY,CAAE,UAAU;aAClE,IAAI,CAAA,GAAA,yCAAW,EAAE,cACtB,4BAA4B;QAC5B,cAAc,YAAY,IAAI;aAE9B,cAAc,YAAY,UAAU;IAExC;IAEA,OAAO;AACT;AAKO,MAAM,4CAAmB,CAAC,MAAgB,QAAQ;QAOvD;IANA,IAAI,CAAC,CAAA,GAAA,gBAAQ,KACX,OAAO,IAAI,aAAa;IAE1B,IAAI,gBAAgC,IAAI,aAAa;IAErD,MAAO,iBAAiB,gBAAgB,mBACxC,4BAAA,cAAc,UAAU,cAAxB,gDAAA,0BAA0B,aAAa,EACrC,gBAAgB,cAAc,UAAU,CAAC,aAAa;IAGxD,OAAO;AACT;AAKO,SAAS,0CAAgC,KAAQ;IACtD,IAAI,CAAA,GAAA,gBAAQ,OAAO,AAAC,MAAM,MAAM,CAAiB,UAAU,EAAE;QAC3D,IAAI,MAAM,YAAY,EACpB,OAAO,MAAM,YAAY,EAAE,CAAC,EAAE;IAElC;IACA,OAAO,MAAM,MAAM;AACrB","sources":["packages/@react-aria/utils/src/shadowdom/DOMFunctions.ts"],"sourcesContent":["// Source: https://github.com/microsoft/tabster/blob/a89fc5d7e332d48f68d03b1ca6e344489d1c3898/src/Shadowdomize/DOMFunctions.ts#L16\n\nimport {isShadowRoot} from '../domHelpers';\nimport {shadowDOM} from '@react-stately/flags';\n\n/**\n * ShadowDOM safe version of Node.contains.\n */\nexport function nodeContains(\n node: Node | null | undefined,\n otherNode: Node | null | undefined\n): boolean {\n if (!shadowDOM()) {\n return otherNode && node ? node.contains(otherNode) : false;\n }\n\n if (!node || !otherNode) {\n return false;\n }\n\n let currentNode: HTMLElement | Node | null | undefined = otherNode;\n\n while (currentNode !== null) {\n if (currentNode === node) {\n return true;\n }\n\n if ((currentNode as HTMLSlotElement).tagName === 'SLOT' &&\n (currentNode as HTMLSlotElement).assignedSlot) {\n // Element is slotted\n currentNode = (currentNode as HTMLSlotElement).assignedSlot!.parentNode;\n } else if (isShadowRoot(currentNode)) {\n // Element is in shadow root\n currentNode = currentNode.host;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n\n return false;\n}\n\n/**\n * ShadowDOM safe version of document.activeElement.\n */\nexport const getActiveElement = (doc: Document = document): Element | null => {\n if (!shadowDOM()) {\n return doc.activeElement;\n }\n let activeElement: Element | null = doc.activeElement;\n\n while (activeElement && 'shadowRoot' in activeElement &&\n activeElement.shadowRoot?.activeElement) {\n activeElement = activeElement.shadowRoot.activeElement;\n }\n\n return activeElement;\n};\n\n/**\n * ShadowDOM safe version of event.target.\n */\nexport function getEventTarget<T extends Event>(event: T): Element {\n if (shadowDOM() && (event.target as HTMLElement).shadowRoot) {\n if (event.composedPath) {\n return event.composedPath()[0] as Element;\n }\n }\n return event.target as Element;\n}\n"],"names":[],"version":3,"file":"DOMFunctions.module.js.map"}
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "getOwnerDocument", () => $aaa611146751592e$export$b204af158042fbac);
$parcel$export(module.exports, "getOwnerWindow", () => $aaa611146751592e$export$f21a1ffae260145a);
$parcel$export(module.exports, "isShadowRoot", () => $aaa611146751592e$export$af51f0f06c0f328a);
const $aaa611146751592e$export$b204af158042fbac = (el)=>{
var _el_ownerDocument;
return (_el_ownerDocument = el === null || el === void 0 ? void 0 : el.ownerDocument) !== null && _el_ownerDocument !== void 0 ? _el_ownerDocument : document;
};
const $aaa611146751592e$export$f21a1ffae260145a = (el)=>{
if (el && 'window' in el && el.window === el) return el;
const doc = $aaa611146751592e$export$b204af158042fbac(el);
return doc.defaultView || window;
};
/**
* Type guard that checks if a value is a Node. Verifies the presence and type of the nodeType property.
*/ function $aaa611146751592e$var$isNode(value) {
return value !== null && typeof value === 'object' && 'nodeType' in value && typeof value.nodeType === 'number';
}
function $aaa611146751592e$export$af51f0f06c0f328a(node) {
return $aaa611146751592e$var$isNode(node) && node.nodeType === Node.DOCUMENT_FRAGMENT_NODE && 'host' in node;
}
//# sourceMappingURL=domHelpers.main.js.map
{"mappings":";;;;;;;;AAAO,MAAM,4CAAmB,CAAC;QACxB;IAAP,OAAO,CAAA,oBAAA,eAAA,yBAAA,GAAI,aAAa,cAAjB,+BAAA,oBAAqB;AAC9B;AAEO,MAAM,4CAAiB,CAC5B;IAEA,IAAI,MAAM,YAAY,MAAM,GAAG,MAAM,KAAK,IACxC,OAAO;IAGT,MAAM,MAAM,0CAAiB;IAC7B,OAAO,IAAI,WAAW,IAAI;AAC5B;AAEA;;CAEC,GACD,SAAS,6BAAO,KAAc;IAC5B,OAAO,UAAU,QACf,OAAO,UAAU,YACjB,cAAc,SACd,OAAO,AAAC,MAAe,QAAQ,KAAK;AACxC;AAKO,SAAS,0CAAa,IAAiB;IAC5C,OAAO,6BAAO,SACZ,KAAK,QAAQ,KAAK,KAAK,sBAAsB,IAC7C,UAAU;AACd","sources":["packages/@react-aria/utils/src/domHelpers.ts"],"sourcesContent":["export const getOwnerDocument = (el: Element | null | undefined): Document => {\n return el?.ownerDocument ?? document;\n};\n\nexport const getOwnerWindow = (\n el: (Window & typeof globalThis) | Element | null | undefined\n): Window & typeof globalThis => {\n if (el && 'window' in el && el.window === el) {\n return el;\n }\n\n const doc = getOwnerDocument(el as Element | null | undefined);\n return doc.defaultView || window;\n};\n\n/**\n * Type guard that checks if a value is a Node. Verifies the presence and type of the nodeType property.\n */\nfunction isNode(value: unknown): value is Node {\n return value !== null &&\n typeof value === 'object' &&\n 'nodeType' in value &&\n typeof (value as Node).nodeType === 'number';\n}\n/**\n * Type guard that checks if a node is a ShadowRoot. Uses nodeType and host property checks to\n * distinguish ShadowRoot from other DocumentFragments.\n */\nexport function isShadowRoot(node: Node | null): node is ShadowRoot {\n return isNode(node) &&\n node.nodeType === Node.DOCUMENT_FRAGMENT_NODE &&\n 'host' in node;\n}\n"],"names":[],"version":3,"file":"domHelpers.main.js.map"}
const $431fbd86ca7dc216$export$b204af158042fbac = (el)=>{
var _el_ownerDocument;
return (_el_ownerDocument = el === null || el === void 0 ? void 0 : el.ownerDocument) !== null && _el_ownerDocument !== void 0 ? _el_ownerDocument : document;
};
const $431fbd86ca7dc216$export$f21a1ffae260145a = (el)=>{
if (el && 'window' in el && el.window === el) return el;
const doc = $431fbd86ca7dc216$export$b204af158042fbac(el);
return doc.defaultView || window;
};
/**
* Type guard that checks if a value is a Node. Verifies the presence and type of the nodeType property.
*/ function $431fbd86ca7dc216$var$isNode(value) {
return value !== null && typeof value === 'object' && 'nodeType' in value && typeof value.nodeType === 'number';
}
function $431fbd86ca7dc216$export$af51f0f06c0f328a(node) {
return $431fbd86ca7dc216$var$isNode(node) && node.nodeType === Node.DOCUMENT_FRAGMENT_NODE && 'host' in node;
}
export {$431fbd86ca7dc216$export$b204af158042fbac as getOwnerDocument, $431fbd86ca7dc216$export$f21a1ffae260145a as getOwnerWindow, $431fbd86ca7dc216$export$af51f0f06c0f328a as isShadowRoot};
//# sourceMappingURL=domHelpers.module.js.map
const $431fbd86ca7dc216$export$b204af158042fbac = (el)=>{
var _el_ownerDocument;
return (_el_ownerDocument = el === null || el === void 0 ? void 0 : el.ownerDocument) !== null && _el_ownerDocument !== void 0 ? _el_ownerDocument : document;
};
const $431fbd86ca7dc216$export$f21a1ffae260145a = (el)=>{
if (el && 'window' in el && el.window === el) return el;
const doc = $431fbd86ca7dc216$export$b204af158042fbac(el);
return doc.defaultView || window;
};
/**
* Type guard that checks if a value is a Node. Verifies the presence and type of the nodeType property.
*/ function $431fbd86ca7dc216$var$isNode(value) {
return value !== null && typeof value === 'object' && 'nodeType' in value && typeof value.nodeType === 'number';
}
function $431fbd86ca7dc216$export$af51f0f06c0f328a(node) {
return $431fbd86ca7dc216$var$isNode(node) && node.nodeType === Node.DOCUMENT_FRAGMENT_NODE && 'host' in node;
}
export {$431fbd86ca7dc216$export$b204af158042fbac as getOwnerDocument, $431fbd86ca7dc216$export$f21a1ffae260145a as getOwnerWindow, $431fbd86ca7dc216$export$af51f0f06c0f328a as isShadowRoot};
//# sourceMappingURL=domHelpers.module.js.map
{"mappings":"AAAO,MAAM,4CAAmB,CAAC;QACxB;IAAP,OAAO,CAAA,oBAAA,eAAA,yBAAA,GAAI,aAAa,cAAjB,+BAAA,oBAAqB;AAC9B;AAEO,MAAM,4CAAiB,CAC5B;IAEA,IAAI,MAAM,YAAY,MAAM,GAAG,MAAM,KAAK,IACxC,OAAO;IAGT,MAAM,MAAM,0CAAiB;IAC7B,OAAO,IAAI,WAAW,IAAI;AAC5B;AAEA;;CAEC,GACD,SAAS,6BAAO,KAAc;IAC5B,OAAO,UAAU,QACf,OAAO,UAAU,YACjB,cAAc,SACd,OAAO,AAAC,MAAe,QAAQ,KAAK;AACxC;AAKO,SAAS,0CAAa,IAAiB;IAC5C,OAAO,6BAAO,SACZ,KAAK,QAAQ,KAAK,KAAK,sBAAsB,IAC7C,UAAU;AACd","sources":["packages/@react-aria/utils/src/domHelpers.ts"],"sourcesContent":["export const getOwnerDocument = (el: Element | null | undefined): Document => {\n return el?.ownerDocument ?? document;\n};\n\nexport const getOwnerWindow = (\n el: (Window & typeof globalThis) | Element | null | undefined\n): Window & typeof globalThis => {\n if (el && 'window' in el && el.window === el) {\n return el;\n }\n\n const doc = getOwnerDocument(el as Element | null | undefined);\n return doc.defaultView || window;\n};\n\n/**\n * Type guard that checks if a value is a Node. Verifies the presence and type of the nodeType property.\n */\nfunction isNode(value: unknown): value is Node {\n return value !== null &&\n typeof value === 'object' &&\n 'nodeType' in value &&\n typeof (value as Node).nodeType === 'number';\n}\n/**\n * Type guard that checks if a node is a ShadowRoot. Uses nodeType and host property checks to\n * distinguish ShadowRoot from other DocumentFragments.\n */\nexport function isShadowRoot(node: Node | null): node is ShadowRoot {\n return isNode(node) &&\n node.nodeType === Node.DOCUMENT_FRAGMENT_NODE &&\n 'host' in node;\n}\n"],"names":[],"version":3,"file":"domHelpers.module.js.map"}
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "filterDOMProps", () => $8d15d0e1797d4238$export$457c3d6518dd4c6f);
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ const $8d15d0e1797d4238$var$DOMPropNames = new Set([
'id'
]);
const $8d15d0e1797d4238$var$labelablePropNames = new Set([
'aria-label',
'aria-labelledby',
'aria-describedby',
'aria-details'
]);
// See LinkDOMProps in dom.d.ts.
const $8d15d0e1797d4238$var$linkPropNames = new Set([
'href',
'hrefLang',
'target',
'rel',
'download',
'ping',
'referrerPolicy'
]);
const $8d15d0e1797d4238$var$globalAttrs = new Set([
'dir',
'lang',
'hidden',
'inert',
'translate'
]);
const $8d15d0e1797d4238$var$globalEvents = new Set([
'onClick',
'onAuxClick',
'onContextMenu',
'onDoubleClick',
'onMouseDown',
'onMouseEnter',
'onMouseLeave',
'onMouseMove',
'onMouseOut',
'onMouseOver',
'onMouseUp',
'onTouchCancel',
'onTouchEnd',
'onTouchMove',
'onTouchStart',
'onPointerDown',
'onPointerMove',
'onPointerUp',
'onPointerCancel',
'onPointerEnter',
'onPointerLeave',
'onPointerOver',
'onPointerOut',
'onGotPointerCapture',
'onLostPointerCapture',
'onScroll',
'onWheel',
'onAnimationStart',
'onAnimationEnd',
'onAnimationIteration',
'onTransitionCancel',
'onTransitionEnd',
'onTransitionRun',
'onTransitionStart'
]);
const $8d15d0e1797d4238$var$propRe = /^(data-.*)$/;
function $8d15d0e1797d4238$export$457c3d6518dd4c6f(props, opts = {}) {
let { labelable: labelable, isLink: isLink, global: global, events: events = global, propNames: propNames } = opts;
let filteredProps = {};
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) || global && $8d15d0e1797d4238$var$globalAttrs.has(prop) || events && ($8d15d0e1797d4238$var$globalEvents.has(prop) || prop.endsWith('Capture') && $8d15d0e1797d4238$var$globalEvents.has(prop.slice(0, -7))) || (propNames === null || propNames === void 0 ? void 0 : propNames.has(prop)) || $8d15d0e1797d4238$var$propRe.test(prop))) filteredProps[prop] = props[prop];
return filteredProps;
}
//# sourceMappingURL=filterDOMProps.main.js.map
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC,GAID,MAAM,qCAAe,IAAI,IAAI;IAC3B;CACD;AAED,MAAM,2CAAqB,IAAI,IAAI;IACjC;IACA;IACA;IACA;CACD;AAED,gCAAgC;AAChC,MAAM,sCAAgB,IAAI,IAAI;IAC5B;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAED,MAAM,oCAAc,IAAI,IAAI;IAC1B;IACA;IACA;IACA;IACA;CACD;AAED,MAAM,qCAAe,IAAI,IAAI;IAC3B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAmBD,MAAM,+BAAS;AAOR,SAAS,0CAAe,KAAwE,EAAE,OAAgB,CAAC,CAAC;IACzH,IAAI,aAAC,SAAS,UAAE,MAAM,UAAE,MAAM,UAAE,SAAS,mBAAQ,SAAS,EAAC,GAAG;IAC9D,IAAI,gBAAgB,CAAC;IAErB,IAAK,MAAM,QAAQ,MACjB,IACE,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,SAC1C,CAAA,mCAAa,GAAG,CAAC,SAChB,aAAa,yCAAmB,GAAG,CAAC,SACpC,UAAU,oCAAc,GAAG,CAAC,SAC5B,UAAU,kCAAY,GAAG,CAAC,SAC1B,UAAW,CAAA,mCAAa,GAAG,CAAC,SAAU,KAAK,QAAQ,CAAC,cAAc,mCAAa,GAAG,CAAC,KAAK,KAAK,CAAC,GAAG,IAAI,MACtG,sBAAA,gCAAA,UAAW,GAAG,CAAC,UACf,6BAAO,IAAI,CAAC,KAAI,GAGlB,aAAa,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK;IAIrC,OAAO;AACT","sources":["packages/@react-aria/utils/src/filterDOMProps.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMProps, GlobalDOMAttributes, LinkDOMProps} from '@react-types/shared';\n\nconst DOMPropNames = new Set([\n 'id'\n]);\n\nconst labelablePropNames = new Set([\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-details'\n]);\n\n// See LinkDOMProps in dom.d.ts.\nconst linkPropNames = new Set([\n 'href',\n 'hrefLang',\n 'target',\n 'rel',\n 'download',\n 'ping',\n 'referrerPolicy'\n]);\n\nconst globalAttrs = new Set([\n 'dir',\n 'lang',\n 'hidden',\n 'inert',\n 'translate'\n]);\n\nconst globalEvents = new Set([\n 'onClick',\n 'onAuxClick',\n 'onContextMenu',\n 'onDoubleClick',\n 'onMouseDown',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseMove',\n 'onMouseOut',\n 'onMouseOver',\n 'onMouseUp',\n 'onTouchCancel',\n 'onTouchEnd',\n 'onTouchMove',\n 'onTouchStart',\n 'onPointerDown',\n 'onPointerMove',\n 'onPointerUp',\n 'onPointerCancel',\n 'onPointerEnter',\n 'onPointerLeave',\n 'onPointerOver',\n 'onPointerOut',\n 'onGotPointerCapture',\n 'onLostPointerCapture',\n 'onScroll',\n 'onWheel',\n 'onAnimationStart',\n 'onAnimationEnd',\n 'onAnimationIteration',\n 'onTransitionCancel',\n 'onTransitionEnd',\n 'onTransitionRun',\n 'onTransitionStart'\n]);\n\ninterface Options {\n /**\n * If labelling associated aria properties should be included in the filter.\n */\n labelable?: boolean,\n /** Whether the element is a link and should include DOM props for <a> elements. */\n isLink?: boolean,\n /** Whether to include global DOM attributes. */\n global?: boolean,\n /** Whether to include DOM events. */\n events?: boolean,\n /**\n * A Set of other property names that should be included in the filter.\n */\n propNames?: Set<string>\n}\n\nconst propRe = /^(data-.*)$/;\n\n/**\n * Filters out all props that aren't valid DOM props or defined via override prop obj.\n * @param props - The component props to be filtered.\n * @param opts - Props to override.\n */\nexport function filterDOMProps(props: DOMProps & AriaLabelingProps & LinkDOMProps & GlobalDOMAttributes, opts: Options = {}): DOMProps & AriaLabelingProps & GlobalDOMAttributes {\n let {labelable, isLink, global, events = global, propNames} = opts;\n let filteredProps = {};\n\n for (const prop in props) {\n if (\n Object.prototype.hasOwnProperty.call(props, prop) && (\n DOMPropNames.has(prop) ||\n (labelable && labelablePropNames.has(prop)) ||\n (isLink && linkPropNames.has(prop)) ||\n (global && globalAttrs.has(prop)) ||\n (events && (globalEvents.has(prop) || (prop.endsWith('Capture') && globalEvents.has(prop.slice(0, -7))))) ||\n propNames?.has(prop) ||\n propRe.test(prop)\n )\n ) {\n filteredProps[prop] = props[prop];\n }\n }\n\n return filteredProps;\n}\n"],"names":[],"version":3,"file":"filterDOMProps.main.js.map"}
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ const $65484d02dcb7eb3e$var$DOMPropNames = new Set([
'id'
]);
const $65484d02dcb7eb3e$var$labelablePropNames = new Set([
'aria-label',
'aria-labelledby',
'aria-describedby',
'aria-details'
]);
// See LinkDOMProps in dom.d.ts.
const $65484d02dcb7eb3e$var$linkPropNames = new Set([
'href',
'hrefLang',
'target',
'rel',
'download',
'ping',
'referrerPolicy'
]);
const $65484d02dcb7eb3e$var$globalAttrs = new Set([
'dir',
'lang',
'hidden',
'inert',
'translate'
]);
const $65484d02dcb7eb3e$var$globalEvents = new Set([
'onClick',
'onAuxClick',
'onContextMenu',
'onDoubleClick',
'onMouseDown',
'onMouseEnter',
'onMouseLeave',
'onMouseMove',
'onMouseOut',
'onMouseOver',
'onMouseUp',
'onTouchCancel',
'onTouchEnd',
'onTouchMove',
'onTouchStart',
'onPointerDown',
'onPointerMove',
'onPointerUp',
'onPointerCancel',
'onPointerEnter',
'onPointerLeave',
'onPointerOver',
'onPointerOut',
'onGotPointerCapture',
'onLostPointerCapture',
'onScroll',
'onWheel',
'onAnimationStart',
'onAnimationEnd',
'onAnimationIteration',
'onTransitionCancel',
'onTransitionEnd',
'onTransitionRun',
'onTransitionStart'
]);
const $65484d02dcb7eb3e$var$propRe = /^(data-.*)$/;
function $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, opts = {}) {
let { labelable: labelable, isLink: isLink, global: global, events: events = global, propNames: propNames } = opts;
let filteredProps = {};
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) || global && $65484d02dcb7eb3e$var$globalAttrs.has(prop) || events && ($65484d02dcb7eb3e$var$globalEvents.has(prop) || prop.endsWith('Capture') && $65484d02dcb7eb3e$var$globalEvents.has(prop.slice(0, -7))) || (propNames === null || propNames === void 0 ? void 0 : propNames.has(prop)) || $65484d02dcb7eb3e$var$propRe.test(prop))) filteredProps[prop] = props[prop];
return filteredProps;
}
export {$65484d02dcb7eb3e$export$457c3d6518dd4c6f as filterDOMProps};
//# sourceMappingURL=filterDOMProps.module.js.map
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ const $65484d02dcb7eb3e$var$DOMPropNames = new Set([
'id'
]);
const $65484d02dcb7eb3e$var$labelablePropNames = new Set([
'aria-label',
'aria-labelledby',
'aria-describedby',
'aria-details'
]);
// See LinkDOMProps in dom.d.ts.
const $65484d02dcb7eb3e$var$linkPropNames = new Set([
'href',
'hrefLang',
'target',
'rel',
'download',
'ping',
'referrerPolicy'
]);
const $65484d02dcb7eb3e$var$globalAttrs = new Set([
'dir',
'lang',
'hidden',
'inert',
'translate'
]);
const $65484d02dcb7eb3e$var$globalEvents = new Set([
'onClick',
'onAuxClick',
'onContextMenu',
'onDoubleClick',
'onMouseDown',
'onMouseEnter',
'onMouseLeave',
'onMouseMove',
'onMouseOut',
'onMouseOver',
'onMouseUp',
'onTouchCancel',
'onTouchEnd',
'onTouchMove',
'onTouchStart',
'onPointerDown',
'onPointerMove',
'onPointerUp',
'onPointerCancel',
'onPointerEnter',
'onPointerLeave',
'onPointerOver',
'onPointerOut',
'onGotPointerCapture',
'onLostPointerCapture',
'onScroll',
'onWheel',
'onAnimationStart',
'onAnimationEnd',
'onAnimationIteration',
'onTransitionCancel',
'onTransitionEnd',
'onTransitionRun',
'onTransitionStart'
]);
const $65484d02dcb7eb3e$var$propRe = /^(data-.*)$/;
function $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, opts = {}) {
let { labelable: labelable, isLink: isLink, global: global, events: events = global, propNames: propNames } = opts;
let filteredProps = {};
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) || global && $65484d02dcb7eb3e$var$globalAttrs.has(prop) || events && ($65484d02dcb7eb3e$var$globalEvents.has(prop) || prop.endsWith('Capture') && $65484d02dcb7eb3e$var$globalEvents.has(prop.slice(0, -7))) || (propNames === null || propNames === void 0 ? void 0 : propNames.has(prop)) || $65484d02dcb7eb3e$var$propRe.test(prop))) filteredProps[prop] = props[prop];
return filteredProps;
}
export {$65484d02dcb7eb3e$export$457c3d6518dd4c6f as filterDOMProps};
//# sourceMappingURL=filterDOMProps.module.js.map
{"mappings":"AAAA;;;;;;;;;;CAUC,GAID,MAAM,qCAAe,IAAI,IAAI;IAC3B;CACD;AAED,MAAM,2CAAqB,IAAI,IAAI;IACjC;IACA;IACA;IACA;CACD;AAED,gCAAgC;AAChC,MAAM,sCAAgB,IAAI,IAAI;IAC5B;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAED,MAAM,oCAAc,IAAI,IAAI;IAC1B;IACA;IACA;IACA;IACA;CACD;AAED,MAAM,qCAAe,IAAI,IAAI;IAC3B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAmBD,MAAM,+BAAS;AAOR,SAAS,0CAAe,KAAwE,EAAE,OAAgB,CAAC,CAAC;IACzH,IAAI,aAAC,SAAS,UAAE,MAAM,UAAE,MAAM,UAAE,SAAS,mBAAQ,SAAS,EAAC,GAAG;IAC9D,IAAI,gBAAgB,CAAC;IAErB,IAAK,MAAM,QAAQ,MACjB,IACE,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,SAC1C,CAAA,mCAAa,GAAG,CAAC,SAChB,aAAa,yCAAmB,GAAG,CAAC,SACpC,UAAU,oCAAc,GAAG,CAAC,SAC5B,UAAU,kCAAY,GAAG,CAAC,SAC1B,UAAW,CAAA,mCAAa,GAAG,CAAC,SAAU,KAAK,QAAQ,CAAC,cAAc,mCAAa,GAAG,CAAC,KAAK,KAAK,CAAC,GAAG,IAAI,MACtG,sBAAA,gCAAA,UAAW,GAAG,CAAC,UACf,6BAAO,IAAI,CAAC,KAAI,GAGlB,aAAa,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK;IAIrC,OAAO;AACT","sources":["packages/@react-aria/utils/src/filterDOMProps.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMProps, GlobalDOMAttributes, LinkDOMProps} from '@react-types/shared';\n\nconst DOMPropNames = new Set([\n 'id'\n]);\n\nconst labelablePropNames = new Set([\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-details'\n]);\n\n// See LinkDOMProps in dom.d.ts.\nconst linkPropNames = new Set([\n 'href',\n 'hrefLang',\n 'target',\n 'rel',\n 'download',\n 'ping',\n 'referrerPolicy'\n]);\n\nconst globalAttrs = new Set([\n 'dir',\n 'lang',\n 'hidden',\n 'inert',\n 'translate'\n]);\n\nconst globalEvents = new Set([\n 'onClick',\n 'onAuxClick',\n 'onContextMenu',\n 'onDoubleClick',\n 'onMouseDown',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseMove',\n 'onMouseOut',\n 'onMouseOver',\n 'onMouseUp',\n 'onTouchCancel',\n 'onTouchEnd',\n 'onTouchMove',\n 'onTouchStart',\n 'onPointerDown',\n 'onPointerMove',\n 'onPointerUp',\n 'onPointerCancel',\n 'onPointerEnter',\n 'onPointerLeave',\n 'onPointerOver',\n 'onPointerOut',\n 'onGotPointerCapture',\n 'onLostPointerCapture',\n 'onScroll',\n 'onWheel',\n 'onAnimationStart',\n 'onAnimationEnd',\n 'onAnimationIteration',\n 'onTransitionCancel',\n 'onTransitionEnd',\n 'onTransitionRun',\n 'onTransitionStart'\n]);\n\ninterface Options {\n /**\n * If labelling associated aria properties should be included in the filter.\n */\n labelable?: boolean,\n /** Whether the element is a link and should include DOM props for <a> elements. */\n isLink?: boolean,\n /** Whether to include global DOM attributes. */\n global?: boolean,\n /** Whether to include DOM events. */\n events?: boolean,\n /**\n * A Set of other property names that should be included in the filter.\n */\n propNames?: Set<string>\n}\n\nconst propRe = /^(data-.*)$/;\n\n/**\n * Filters out all props that aren't valid DOM props or defined via override prop obj.\n * @param props - The component props to be filtered.\n * @param opts - Props to override.\n */\nexport function filterDOMProps(props: DOMProps & AriaLabelingProps & LinkDOMProps & GlobalDOMAttributes, opts: Options = {}): DOMProps & AriaLabelingProps & GlobalDOMAttributes {\n let {labelable, isLink, global, events = global, propNames} = opts;\n let filteredProps = {};\n\n for (const prop in props) {\n if (\n Object.prototype.hasOwnProperty.call(props, prop) && (\n DOMPropNames.has(prop) ||\n (labelable && labelablePropNames.has(prop)) ||\n (isLink && linkPropNames.has(prop)) ||\n (global && globalAttrs.has(prop)) ||\n (events && (globalEvents.has(prop) || (prop.endsWith('Capture') && globalEvents.has(prop.slice(0, -7))))) ||\n propNames?.has(prop) ||\n propRe.test(prop)\n )\n ) {\n filteredProps[prop] = props[prop];\n }\n }\n\n return filteredProps;\n}\n"],"names":[],"version":3,"file":"filterDOMProps.module.js.map"}
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "focusWithoutScrolling", () => $1117b6c0d4c4c164$export$de79e2c695e052f3);
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ function $1117b6c0d4c4c164$export$de79e2c695e052f3(element) {
if ($1117b6c0d4c4c164$var$supportsPreventScroll()) element.focus({
preventScroll: true
});
else {
let scrollableElements = $1117b6c0d4c4c164$var$getScrollableElements(element);
element.focus();
$1117b6c0d4c4c164$var$restoreScrollPosition(scrollableElements);
}
}
let $1117b6c0d4c4c164$var$supportsPreventScrollCached = null;
function $1117b6c0d4c4c164$var$supportsPreventScroll() {
if ($1117b6c0d4c4c164$var$supportsPreventScrollCached == null) {
$1117b6c0d4c4c164$var$supportsPreventScrollCached = false;
try {
let focusElem = document.createElement('div');
focusElem.focus({
get preventScroll () {
$1117b6c0d4c4c164$var$supportsPreventScrollCached = true;
return true;
}
});
} catch {
// Ignore
}
}
return $1117b6c0d4c4c164$var$supportsPreventScrollCached;
}
function $1117b6c0d4c4c164$var$getScrollableElements(element) {
let parent = element.parentNode;
let scrollableElements = [];
let rootScrollingElement = document.scrollingElement || document.documentElement;
while(parent instanceof HTMLElement && parent !== rootScrollingElement){
if (parent.offsetHeight < parent.scrollHeight || parent.offsetWidth < parent.scrollWidth) scrollableElements.push({
element: parent,
scrollTop: parent.scrollTop,
scrollLeft: parent.scrollLeft
});
parent = parent.parentNode;
}
if (rootScrollingElement instanceof HTMLElement) scrollableElements.push({
element: rootScrollingElement,
scrollTop: rootScrollingElement.scrollTop,
scrollLeft: rootScrollingElement.scrollLeft
});
return scrollableElements;
}
function $1117b6c0d4c4c164$var$restoreScrollPosition(scrollableElements) {
for (let { element: element, scrollTop: scrollTop, scrollLeft: scrollLeft } of scrollableElements){
element.scrollTop = scrollTop;
element.scrollLeft = scrollLeft;
}
}
//# sourceMappingURL=focusWithoutScrolling.main.js.map
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC,GAoBM,SAAS,0CAAsB,OAAyB;IAC7D,IAAI,+CACF,QAAQ,KAAK,CAAC;QAAC,eAAe;IAAI;SAC7B;QACL,IAAI,qBAAqB,4CAAsB;QAC/C,QAAQ,KAAK;QACb,4CAAsB;IACxB;AACF;AAEA,IAAI,oDAA8C;AAClD,SAAS;IACP,IAAI,qDAA+B,MAAM;QACvC,oDAA8B;QAC9B,IAAI;YACF,IAAI,YAAY,SAAS,aAAa,CAAC;YACvC,UAAU,KAAK,CAAC;gBACd,IAAI,iBAAgB;oBAClB,oDAA8B;oBAC9B,OAAO;gBACT;YACF;QACF,EAAE,OAAM;QACN,SAAS;QACX;IACF;IAEA,OAAO;AACT;AAEA,SAAS,4CAAsB,OAAyB;IACtD,IAAI,SAAS,QAAQ,UAAU;IAC/B,IAAI,qBAA0C,EAAE;IAChD,IAAI,uBAAuB,SAAS,gBAAgB,IAAI,SAAS,eAAe;IAEhF,MAAO,kBAAkB,eAAe,WAAW,qBAAsB;QACvE,IACE,OAAO,YAAY,GAAG,OAAO,YAAY,IACzC,OAAO,WAAW,GAAG,OAAO,WAAW,EAEvC,mBAAmB,IAAI,CAAC;YACtB,SAAS;YACT,WAAW,OAAO,SAAS;YAC3B,YAAY,OAAO,UAAU;QAC/B;QAEF,SAAS,OAAO,UAAU;IAC5B;IAEA,IAAI,gCAAgC,aAClC,mBAAmB,IAAI,CAAC;QACtB,SAAS;QACT,WAAW,qBAAqB,SAAS;QACzC,YAAY,qBAAqB,UAAU;IAC7C;IAGF,OAAO;AACT;AAEA,SAAS,4CAAsB,kBAAuC;IACpE,KAAK,IAAI,WAAC,OAAO,aAAE,SAAS,cAAE,UAAU,EAAC,IAAI,mBAAoB;QAC/D,QAAQ,SAAS,GAAG;QACpB,QAAQ,UAAU,GAAG;IACvB;AACF","sources":["packages/@react-aria/utils/src/focusWithoutScrolling.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {FocusableElement} from '@react-types/shared';\n\n// This is a polyfill for element.focus({preventScroll: true});\n// Currently necessary for Safari and old Edge:\n// https://caniuse.com/#feat=mdn-api_htmlelement_focus_preventscroll_option\n// See https://bugs.webkit.org/show_bug.cgi?id=178583\n//\n\n// Original licensing for the following methods can be found in the\n// NOTICE file in the root directory of this source tree.\n// See https://github.com/calvellido/focus-options-polyfill\n\ninterface ScrollableElement {\n element: HTMLElement,\n scrollTop: number,\n scrollLeft: number\n}\n\nexport function focusWithoutScrolling(element: FocusableElement): void {\n if (supportsPreventScroll()) {\n element.focus({preventScroll: true});\n } else {\n let scrollableElements = getScrollableElements(element);\n element.focus();\n restoreScrollPosition(scrollableElements);\n }\n}\n\nlet supportsPreventScrollCached: boolean | null = null;\nfunction supportsPreventScroll() {\n if (supportsPreventScrollCached == null) {\n supportsPreventScrollCached = false;\n try {\n let focusElem = document.createElement('div');\n focusElem.focus({\n get preventScroll() {\n supportsPreventScrollCached = true;\n return true;\n }\n });\n } catch {\n // Ignore\n }\n }\n\n return supportsPreventScrollCached;\n}\n\nfunction getScrollableElements(element: FocusableElement): ScrollableElement[] {\n let parent = element.parentNode;\n let scrollableElements: ScrollableElement[] = [];\n let rootScrollingElement = document.scrollingElement || document.documentElement;\n\n while (parent instanceof HTMLElement && parent !== rootScrollingElement) {\n if (\n parent.offsetHeight < parent.scrollHeight ||\n parent.offsetWidth < parent.scrollWidth\n ) {\n scrollableElements.push({\n element: parent,\n scrollTop: parent.scrollTop,\n scrollLeft: parent.scrollLeft\n });\n }\n parent = parent.parentNode;\n }\n\n if (rootScrollingElement instanceof HTMLElement) {\n scrollableElements.push({\n element: rootScrollingElement,\n scrollTop: rootScrollingElement.scrollTop,\n scrollLeft: rootScrollingElement.scrollLeft\n });\n }\n\n return scrollableElements;\n}\n\nfunction restoreScrollPosition(scrollableElements: ScrollableElement[]) {\n for (let {element, scrollTop, scrollLeft} of scrollableElements) {\n element.scrollTop = scrollTop;\n element.scrollLeft = scrollLeft;\n }\n}\n"],"names":[],"version":3,"file":"focusWithoutScrolling.main.js.map"}
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ function $7215afc6de606d6b$export$de79e2c695e052f3(element) {
if ($7215afc6de606d6b$var$supportsPreventScroll()) element.focus({
preventScroll: true
});
else {
let scrollableElements = $7215afc6de606d6b$var$getScrollableElements(element);
element.focus();
$7215afc6de606d6b$var$restoreScrollPosition(scrollableElements);
}
}
let $7215afc6de606d6b$var$supportsPreventScrollCached = null;
function $7215afc6de606d6b$var$supportsPreventScroll() {
if ($7215afc6de606d6b$var$supportsPreventScrollCached == null) {
$7215afc6de606d6b$var$supportsPreventScrollCached = false;
try {
let focusElem = document.createElement('div');
focusElem.focus({
get preventScroll () {
$7215afc6de606d6b$var$supportsPreventScrollCached = true;
return true;
}
});
} catch {
// Ignore
}
}
return $7215afc6de606d6b$var$supportsPreventScrollCached;
}
function $7215afc6de606d6b$var$getScrollableElements(element) {
let parent = element.parentNode;
let scrollableElements = [];
let rootScrollingElement = document.scrollingElement || document.documentElement;
while(parent instanceof HTMLElement && parent !== rootScrollingElement){
if (parent.offsetHeight < parent.scrollHeight || parent.offsetWidth < parent.scrollWidth) scrollableElements.push({
element: parent,
scrollTop: parent.scrollTop,
scrollLeft: parent.scrollLeft
});
parent = parent.parentNode;
}
if (rootScrollingElement instanceof HTMLElement) scrollableElements.push({
element: rootScrollingElement,
scrollTop: rootScrollingElement.scrollTop,
scrollLeft: rootScrollingElement.scrollLeft
});
return scrollableElements;
}
function $7215afc6de606d6b$var$restoreScrollPosition(scrollableElements) {
for (let { element: element, scrollTop: scrollTop, scrollLeft: scrollLeft } of scrollableElements){
element.scrollTop = scrollTop;
element.scrollLeft = scrollLeft;
}
}
export {$7215afc6de606d6b$export$de79e2c695e052f3 as focusWithoutScrolling};
//# sourceMappingURL=focusWithoutScrolling.module.js.map
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ function $7215afc6de606d6b$export$de79e2c695e052f3(element) {
if ($7215afc6de606d6b$var$supportsPreventScroll()) element.focus({
preventScroll: true
});
else {
let scrollableElements = $7215afc6de606d6b$var$getScrollableElements(element);
element.focus();
$7215afc6de606d6b$var$restoreScrollPosition(scrollableElements);
}
}
let $7215afc6de606d6b$var$supportsPreventScrollCached = null;
function $7215afc6de606d6b$var$supportsPreventScroll() {
if ($7215afc6de606d6b$var$supportsPreventScrollCached == null) {
$7215afc6de606d6b$var$supportsPreventScrollCached = false;
try {
let focusElem = document.createElement('div');
focusElem.focus({
get preventScroll () {
$7215afc6de606d6b$var$supportsPreventScrollCached = true;
return true;
}
});
} catch {
// Ignore
}
}
return $7215afc6de606d6b$var$supportsPreventScrollCached;
}
function $7215afc6de606d6b$var$getScrollableElements(element) {
let parent = element.parentNode;
let scrollableElements = [];
let rootScrollingElement = document.scrollingElement || document.documentElement;
while(parent instanceof HTMLElement && parent !== rootScrollingElement){
if (parent.offsetHeight < parent.scrollHeight || parent.offsetWidth < parent.scrollWidth) scrollableElements.push({
element: parent,
scrollTop: parent.scrollTop,
scrollLeft: parent.scrollLeft
});
parent = parent.parentNode;
}
if (rootScrollingElement instanceof HTMLElement) scrollableElements.push({
element: rootScrollingElement,
scrollTop: rootScrollingElement.scrollTop,
scrollLeft: rootScrollingElement.scrollLeft
});
return scrollableElements;
}
function $7215afc6de606d6b$var$restoreScrollPosition(scrollableElements) {
for (let { element: element, scrollTop: scrollTop, scrollLeft: scrollLeft } of scrollableElements){
element.scrollTop = scrollTop;
element.scrollLeft = scrollLeft;
}
}
export {$7215afc6de606d6b$export$de79e2c695e052f3 as focusWithoutScrolling};
//# sourceMappingURL=focusWithoutScrolling.module.js.map
{"mappings":"AAAA;;;;;;;;;;CAUC,GAoBM,SAAS,0CAAsB,OAAyB;IAC7D,IAAI,+CACF,QAAQ,KAAK,CAAC;QAAC,eAAe;IAAI;SAC7B;QACL,IAAI,qBAAqB,4CAAsB;QAC/C,QAAQ,KAAK;QACb,4CAAsB;IACxB;AACF;AAEA,IAAI,oDAA8C;AAClD,SAAS;IACP,IAAI,qDAA+B,MAAM;QACvC,oDAA8B;QAC9B,IAAI;YACF,IAAI,YAAY,SAAS,aAAa,CAAC;YACvC,UAAU,KAAK,CAAC;gBACd,IAAI,iBAAgB;oBAClB,oDAA8B;oBAC9B,OAAO;gBACT;YACF;QACF,EAAE,OAAM;QACN,SAAS;QACX;IACF;IAEA,OAAO;AACT;AAEA,SAAS,4CAAsB,OAAyB;IACtD,IAAI,SAAS,QAAQ,UAAU;IAC/B,IAAI,qBAA0C,EAAE;IAChD,IAAI,uBAAuB,SAAS,gBAAgB,IAAI,SAAS,eAAe;IAEhF,MAAO,kBAAkB,eAAe,WAAW,qBAAsB;QACvE,IACE,OAAO,YAAY,GAAG,OAAO,YAAY,IACzC,OAAO,WAAW,GAAG,OAAO,WAAW,EAEvC,mBAAmB,IAAI,CAAC;YACtB,SAAS;YACT,WAAW,OAAO,SAAS;YAC3B,YAAY,OAAO,UAAU;QAC/B;QAEF,SAAS,OAAO,UAAU;IAC5B;IAEA,IAAI,gCAAgC,aAClC,mBAAmB,IAAI,CAAC;QACtB,SAAS;QACT,WAAW,qBAAqB,SAAS;QACzC,YAAY,qBAAqB,UAAU;IAC7C;IAGF,OAAO;AACT;AAEA,SAAS,4CAAsB,kBAAuC;IACpE,KAAK,IAAI,WAAC,OAAO,aAAE,SAAS,cAAE,UAAU,EAAC,IAAI,mBAAoB;QAC/D,QAAQ,SAAS,GAAG;QACpB,QAAQ,UAAU,GAAG;IACvB;AACF","sources":["packages/@react-aria/utils/src/focusWithoutScrolling.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {FocusableElement} from '@react-types/shared';\n\n// This is a polyfill for element.focus({preventScroll: true});\n// Currently necessary for Safari and old Edge:\n// https://caniuse.com/#feat=mdn-api_htmlelement_focus_preventscroll_option\n// See https://bugs.webkit.org/show_bug.cgi?id=178583\n//\n\n// Original licensing for the following methods can be found in the\n// NOTICE file in the root directory of this source tree.\n// See https://github.com/calvellido/focus-options-polyfill\n\ninterface ScrollableElement {\n element: HTMLElement,\n scrollTop: number,\n scrollLeft: number\n}\n\nexport function focusWithoutScrolling(element: FocusableElement): void {\n if (supportsPreventScroll()) {\n element.focus({preventScroll: true});\n } else {\n let scrollableElements = getScrollableElements(element);\n element.focus();\n restoreScrollPosition(scrollableElements);\n }\n}\n\nlet supportsPreventScrollCached: boolean | null = null;\nfunction supportsPreventScroll() {\n if (supportsPreventScrollCached == null) {\n supportsPreventScrollCached = false;\n try {\n let focusElem = document.createElement('div');\n focusElem.focus({\n get preventScroll() {\n supportsPreventScrollCached = true;\n return true;\n }\n });\n } catch {\n // Ignore\n }\n }\n\n return supportsPreventScrollCached;\n}\n\nfunction getScrollableElements(element: FocusableElement): ScrollableElement[] {\n let parent = element.parentNode;\n let scrollableElements: ScrollableElement[] = [];\n let rootScrollingElement = document.scrollingElement || document.documentElement;\n\n while (parent instanceof HTMLElement && parent !== rootScrollingElement) {\n if (\n parent.offsetHeight < parent.scrollHeight ||\n parent.offsetWidth < parent.scrollWidth\n ) {\n scrollableElements.push({\n element: parent,\n scrollTop: parent.scrollTop,\n scrollLeft: parent.scrollLeft\n });\n }\n parent = parent.parentNode;\n }\n\n if (rootScrollingElement instanceof HTMLElement) {\n scrollableElements.push({\n element: rootScrollingElement,\n scrollTop: rootScrollingElement.scrollTop,\n scrollLeft: rootScrollingElement.scrollLeft\n });\n }\n\n return scrollableElements;\n}\n\nfunction restoreScrollPosition(scrollableElements: ScrollableElement[]) {\n for (let {element, scrollTop, scrollLeft} of scrollableElements) {\n element.scrollTop = scrollTop;\n element.scrollLeft = scrollLeft;\n }\n}\n"],"names":[],"version":3,"file":"focusWithoutScrolling.module.js.map"}
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "getOffset", () => $16ec41ef3e36c19c$export$622cea445a1c5b7d);
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ function $16ec41ef3e36c19c$export$622cea445a1c5b7d(element, reverse, orientation = 'horizontal') {
let rect = element.getBoundingClientRect();
if (reverse) return orientation === 'horizontal' ? rect.right : rect.bottom;
return orientation === 'horizontal' ? rect.left : rect.top;
}
//# sourceMappingURL=getOffset.main.js.map
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC,GAIM,SAAS,0CAAU,OAAoB,EAAE,OAAiB,EAAE,cAA2B,YAAY;IACxG,IAAI,OAAO,QAAQ,qBAAqB;IACxC,IAAI,SACF,OAAO,gBAAgB,eAAe,KAAK,KAAK,GAAG,KAAK,MAAM;IAEhE,OAAO,gBAAgB,eAAe,KAAK,IAAI,GAAG,KAAK,GAAG;AAC5D","sources":["packages/@react-aria/utils/src/getOffset.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Orientation} from '@react-types/shared';\n\nexport function getOffset(element: HTMLElement, reverse?: boolean, orientation: Orientation = 'horizontal'): number {\n let rect = element.getBoundingClientRect();\n if (reverse) {\n return orientation === 'horizontal' ? rect.right : rect.bottom;\n }\n return orientation === 'horizontal' ? rect.left : rect.top;\n}\n"],"names":[],"version":3,"file":"getOffset.main.js.map"}
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ function $ab71dadb03a6fb2e$export$622cea445a1c5b7d(element, reverse, orientation = 'horizontal') {
let rect = element.getBoundingClientRect();
if (reverse) return orientation === 'horizontal' ? rect.right : rect.bottom;
return orientation === 'horizontal' ? rect.left : rect.top;
}
export {$ab71dadb03a6fb2e$export$622cea445a1c5b7d as getOffset};
//# sourceMappingURL=getOffset.module.js.map
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ function $ab71dadb03a6fb2e$export$622cea445a1c5b7d(element, reverse, orientation = 'horizontal') {
let rect = element.getBoundingClientRect();
if (reverse) return orientation === 'horizontal' ? rect.right : rect.bottom;
return orientation === 'horizontal' ? rect.left : rect.top;
}
export {$ab71dadb03a6fb2e$export$622cea445a1c5b7d as getOffset};
//# sourceMappingURL=getOffset.module.js.map
{"mappings":"AAAA;;;;;;;;;;CAUC,GAIM,SAAS,0CAAU,OAAoB,EAAE,OAAiB,EAAE,cAA2B,YAAY;IACxG,IAAI,OAAO,QAAQ,qBAAqB;IACxC,IAAI,SACF,OAAO,gBAAgB,eAAe,KAAK,KAAK,GAAG,KAAK,MAAM;IAEhE,OAAO,gBAAgB,eAAe,KAAK,IAAI,GAAG,KAAK,GAAG;AAC5D","sources":["packages/@react-aria/utils/src/getOffset.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Orientation} from '@react-types/shared';\n\nexport function getOffset(element: HTMLElement, reverse?: boolean, orientation: Orientation = 'horizontal'): number {\n let rect = element.getBoundingClientRect();\n if (reverse) {\n return orientation === 'horizontal' ? rect.right : rect.bottom;\n }\n return orientation === 'horizontal' ? rect.left : rect.top;\n}\n"],"names":[],"version":3,"file":"getOffset.module.js.map"}
var $9a54e9cd5db23b5d$exports = require("./isScrollable.main.js");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "getScrollParent", () => $d796e7157ac96470$export$cfa2225e87938781);
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $d796e7157ac96470$export$cfa2225e87938781(node, checkForOverflow) {
let scrollableNode = node;
if ((0, $9a54e9cd5db23b5d$exports.isScrollable)(scrollableNode, checkForOverflow)) scrollableNode = scrollableNode.parentElement;
while(scrollableNode && !(0, $9a54e9cd5db23b5d$exports.isScrollable)(scrollableNode, checkForOverflow))scrollableNode = scrollableNode.parentElement;
return scrollableNode || document.scrollingElement || document.documentElement;
}
//# sourceMappingURL=getScrollParent.main.js.map
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;AAIM,SAAS,0CAAgB,IAAa,EAAE,gBAA0B;IACvE,IAAI,iBAAiC;IACrC,IAAI,CAAA,GAAA,sCAAW,EAAE,gBAAgB,mBAC/B,iBAAiB,eAAe,aAAa;IAG/C,MAAO,kBAAkB,CAAC,CAAA,GAAA,sCAAW,EAAE,gBAAgB,kBACrD,iBAAiB,eAAe,aAAa;IAG/C,OAAO,kBAAkB,SAAS,gBAAgB,IAAI,SAAS,eAAe;AAChF","sources":["packages/@react-aria/utils/src/getScrollParent.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {isScrollable} from './isScrollable';\n\nexport function getScrollParent(node: Element, checkForOverflow?: boolean): Element {\n let scrollableNode: Element | null = node;\n if (isScrollable(scrollableNode, checkForOverflow)) {\n scrollableNode = scrollableNode.parentElement;\n }\n\n while (scrollableNode && !isScrollable(scrollableNode, checkForOverflow)) {\n scrollableNode = scrollableNode.parentElement;\n }\n\n return scrollableNode || document.scrollingElement || document.documentElement;\n}\n\n"],"names":[],"version":3,"file":"getScrollParent.main.js.map"}
import {isScrollable as $cc38e7bd3fc7b213$export$2bb74740c4e19def} from "./isScrollable.mjs";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $62d8ded9296f3872$export$cfa2225e87938781(node, checkForOverflow) {
let scrollableNode = node;
if ((0, $cc38e7bd3fc7b213$export$2bb74740c4e19def)(scrollableNode, checkForOverflow)) scrollableNode = scrollableNode.parentElement;
while(scrollableNode && !(0, $cc38e7bd3fc7b213$export$2bb74740c4e19def)(scrollableNode, checkForOverflow))scrollableNode = scrollableNode.parentElement;
return scrollableNode || document.scrollingElement || document.documentElement;
}
export {$62d8ded9296f3872$export$cfa2225e87938781 as getScrollParent};
//# sourceMappingURL=getScrollParent.module.js.map
import {isScrollable as $cc38e7bd3fc7b213$export$2bb74740c4e19def} from "./isScrollable.module.js";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $62d8ded9296f3872$export$cfa2225e87938781(node, checkForOverflow) {
let scrollableNode = node;
if ((0, $cc38e7bd3fc7b213$export$2bb74740c4e19def)(scrollableNode, checkForOverflow)) scrollableNode = scrollableNode.parentElement;
while(scrollableNode && !(0, $cc38e7bd3fc7b213$export$2bb74740c4e19def)(scrollableNode, checkForOverflow))scrollableNode = scrollableNode.parentElement;
return scrollableNode || document.scrollingElement || document.documentElement;
}
export {$62d8ded9296f3872$export$cfa2225e87938781 as getScrollParent};
//# sourceMappingURL=getScrollParent.module.js.map
{"mappings":";;AAAA;;;;;;;;;;CAUC;AAIM,SAAS,0CAAgB,IAAa,EAAE,gBAA0B;IACvE,IAAI,iBAAiC;IACrC,IAAI,CAAA,GAAA,yCAAW,EAAE,gBAAgB,mBAC/B,iBAAiB,eAAe,aAAa;IAG/C,MAAO,kBAAkB,CAAC,CAAA,GAAA,yCAAW,EAAE,gBAAgB,kBACrD,iBAAiB,eAAe,aAAa;IAG/C,OAAO,kBAAkB,SAAS,gBAAgB,IAAI,SAAS,eAAe;AAChF","sources":["packages/@react-aria/utils/src/getScrollParent.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {isScrollable} from './isScrollable';\n\nexport function getScrollParent(node: Element, checkForOverflow?: boolean): Element {\n let scrollableNode: Element | null = node;\n if (isScrollable(scrollableNode, checkForOverflow)) {\n scrollableNode = scrollableNode.parentElement;\n }\n\n while (scrollableNode && !isScrollable(scrollableNode, checkForOverflow)) {\n scrollableNode = scrollableNode.parentElement;\n }\n\n return scrollableNode || document.scrollingElement || document.documentElement;\n}\n\n"],"names":[],"version":3,"file":"getScrollParent.module.js.map"}
var $9a54e9cd5db23b5d$exports = require("./isScrollable.main.js");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "getScrollParents", () => $49f0d9486c2408aa$export$94ed1c92c7beeb22);
/*
* Copyright 2024 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $49f0d9486c2408aa$export$94ed1c92c7beeb22(node, checkForOverflow) {
const scrollParents = [];
while(node && node !== document.documentElement){
if ((0, $9a54e9cd5db23b5d$exports.isScrollable)(node, checkForOverflow)) scrollParents.push(node);
node = node.parentElement;
}
return scrollParents;
}
//# sourceMappingURL=getScrollParents.main.js.map
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;AAIM,SAAS,0CAAiB,IAAa,EAAE,gBAA0B;IACxE,MAAM,gBAA2B,EAAE;IAEnC,MAAO,QAAQ,SAAS,SAAS,eAAe,CAAE;QAChD,IAAI,CAAA,GAAA,sCAAW,EAAE,MAAM,mBACrB,cAAc,IAAI,CAAC;QAErB,OAAO,KAAK,aAAa;IAC3B;IAEA,OAAO;AACT","sources":["packages/@react-aria/utils/src/getScrollParents.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {isScrollable} from './isScrollable';\n\nexport function getScrollParents(node: Element, checkForOverflow?: boolean): Element[] {\n const scrollParents: Element[] = [];\n\n while (node && node !== document.documentElement) {\n if (isScrollable(node, checkForOverflow)) {\n scrollParents.push(node);\n }\n node = node.parentElement as Element;\n }\n\n return scrollParents;\n}\n"],"names":[],"version":3,"file":"getScrollParents.main.js.map"}
import {isScrollable as $cc38e7bd3fc7b213$export$2bb74740c4e19def} from "./isScrollable.mjs";
/*
* Copyright 2024 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $a40c673dc9f6d9c7$export$94ed1c92c7beeb22(node, checkForOverflow) {
const scrollParents = [];
while(node && node !== document.documentElement){
if ((0, $cc38e7bd3fc7b213$export$2bb74740c4e19def)(node, checkForOverflow)) scrollParents.push(node);
node = node.parentElement;
}
return scrollParents;
}
export {$a40c673dc9f6d9c7$export$94ed1c92c7beeb22 as getScrollParents};
//# sourceMappingURL=getScrollParents.module.js.map
import {isScrollable as $cc38e7bd3fc7b213$export$2bb74740c4e19def} from "./isScrollable.module.js";
/*
* Copyright 2024 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $a40c673dc9f6d9c7$export$94ed1c92c7beeb22(node, checkForOverflow) {
const scrollParents = [];
while(node && node !== document.documentElement){
if ((0, $cc38e7bd3fc7b213$export$2bb74740c4e19def)(node, checkForOverflow)) scrollParents.push(node);
node = node.parentElement;
}
return scrollParents;
}
export {$a40c673dc9f6d9c7$export$94ed1c92c7beeb22 as getScrollParents};
//# sourceMappingURL=getScrollParents.module.js.map
{"mappings":";;AAAA;;;;;;;;;;CAUC;AAIM,SAAS,0CAAiB,IAAa,EAAE,gBAA0B;IACxE,MAAM,gBAA2B,EAAE;IAEnC,MAAO,QAAQ,SAAS,SAAS,eAAe,CAAE;QAChD,IAAI,CAAA,GAAA,yCAAW,EAAE,MAAM,mBACrB,cAAc,IAAI,CAAC;QAErB,OAAO,KAAK,aAAa;IAC3B;IAEA,OAAO;AACT","sources":["packages/@react-aria/utils/src/getScrollParents.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {isScrollable} from './isScrollable';\n\nexport function getScrollParents(node: Element, checkForOverflow?: boolean): Element[] {\n const scrollParents: Element[] = [];\n\n while (node && node !== document.documentElement) {\n if (isScrollable(node, checkForOverflow)) {\n scrollParents.push(node);\n }\n node = node.parentElement as Element;\n }\n\n return scrollParents;\n}\n"],"names":[],"version":3,"file":"getScrollParents.module.js.map"}
var $2Y3Ap$react = require("react");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "inertValue", () => $13915169b1e4142c$export$a9d04c5684123369);
function $13915169b1e4142c$export$a9d04c5684123369(value) {
const pieces = (0, $2Y3Ap$react.version).split('.');
const major = parseInt(pieces[0], 10);
if (major >= 19) return value;
// compatibility with React < 19
return value ? 'true' : undefined;
}
//# sourceMappingURL=inertValue.main.js.map
{"mappings":";;;;;;;;;AAEO,SAAS,0CAAW,KAAe;IACxC,MAAM,SAAS,CAAA,GAAA,oBAAM,EAAE,KAAK,CAAC;IAC7B,MAAM,QAAQ,SAAS,MAAM,CAAC,EAAE,EAAE;IAClC,IAAI,SAAS,IACX,OAAO;IAET,gCAAgC;IAChC,OAAO,QAAQ,SAAS;AAC1B","sources":["packages/@react-aria/utils/src/inertValue.ts"],"sourcesContent":["import {version} from 'react';\n\nexport function inertValue(value?: boolean): string | boolean | undefined {\n const pieces = version.split('.');\n const major = parseInt(pieces[0], 10);\n if (major >= 19) {\n return value;\n }\n // compatibility with React < 19\n return value ? 'true' : undefined;\n}\n"],"names":[],"version":3,"file":"inertValue.main.js.map"}
import {version as $iulvE$version} from "react";
function $cdc5a6778b766db2$export$a9d04c5684123369(value) {
const pieces = (0, $iulvE$version).split('.');
const major = parseInt(pieces[0], 10);
if (major >= 19) return value;
// compatibility with React < 19
return value ? 'true' : undefined;
}
export {$cdc5a6778b766db2$export$a9d04c5684123369 as inertValue};
//# sourceMappingURL=inertValue.module.js.map
import {version as $iulvE$version} from "react";
function $cdc5a6778b766db2$export$a9d04c5684123369(value) {
const pieces = (0, $iulvE$version).split('.');
const major = parseInt(pieces[0], 10);
if (major >= 19) return value;
// compatibility with React < 19
return value ? 'true' : undefined;
}
export {$cdc5a6778b766db2$export$a9d04c5684123369 as inertValue};
//# sourceMappingURL=inertValue.module.js.map
{"mappings":";;;AAEO,SAAS,0CAAW,KAAe;IACxC,MAAM,SAAS,CAAA,GAAA,cAAM,EAAE,KAAK,CAAC;IAC7B,MAAM,QAAQ,SAAS,MAAM,CAAC,EAAE,EAAE;IAClC,IAAI,SAAS,IACX,OAAO;IAET,gCAAgC;IAChC,OAAO,QAAQ,SAAS;AAC1B","sources":["packages/@react-aria/utils/src/inertValue.ts"],"sourcesContent":["import {version} from 'react';\n\nexport function inertValue(value?: boolean): string | boolean | undefined {\n const pieces = version.split('.');\n const major = parseInt(pieces[0], 10);\n if (major >= 19) {\n return value;\n }\n // compatibility with React < 19\n return value ? 'true' : undefined;\n}\n"],"names":[],"version":3,"file":"inertValue.module.js.map"}
var $aaa611146751592e$exports = require("./domHelpers.main.js");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "isElementVisible", () => $a333d78d58ab4731$export$e989c0fffaa6b27a);
/*
* Copyright 2021 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
const $a333d78d58ab4731$var$supportsCheckVisibility = typeof Element !== 'undefined' && 'checkVisibility' in Element.prototype;
function $a333d78d58ab4731$var$isStyleVisible(element) {
const windowObject = (0, $aaa611146751592e$exports.getOwnerWindow)(element);
if (!(element instanceof windowObject.HTMLElement) && !(element instanceof windowObject.SVGElement)) return false;
let { display: display, visibility: visibility } = element.style;
let isVisible = display !== 'none' && visibility !== 'hidden' && visibility !== 'collapse';
if (isVisible) {
const { getComputedStyle: getComputedStyle } = element.ownerDocument.defaultView;
let { display: computedDisplay, visibility: computedVisibility } = getComputedStyle(element);
isVisible = computedDisplay !== 'none' && computedVisibility !== 'hidden' && computedVisibility !== 'collapse';
}
return isVisible;
}
function $a333d78d58ab4731$var$isAttributeVisible(element, childElement) {
return !element.hasAttribute('hidden') && // Ignore HiddenSelect when tree walking.
!element.hasAttribute('data-react-aria-prevent-focus') && (element.nodeName === 'DETAILS' && childElement && childElement.nodeName !== 'SUMMARY' ? element.hasAttribute('open') : true);
}
function $a333d78d58ab4731$export$e989c0fffaa6b27a(element, childElement) {
if ($a333d78d58ab4731$var$supportsCheckVisibility) return element.checkVisibility({
visibilityProperty: true
}) && !element.closest('[data-react-aria-prevent-focus]');
return element.nodeName !== '#comment' && $a333d78d58ab4731$var$isStyleVisible(element) && $a333d78d58ab4731$var$isAttributeVisible(element, childElement) && (!element.parentElement || $a333d78d58ab4731$export$e989c0fffaa6b27a(element.parentElement, element));
}
//# sourceMappingURL=isElementVisible.main.js.map
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;AAID,MAAM,gDAA0B,OAAO,YAAY,eAAe,qBAAqB,QAAQ,SAAS;AAExG,SAAS,qCAAe,OAAgB;IACtC,MAAM,eAAe,CAAA,GAAA,wCAAa,EAAE;IACpC,IAAI,CAAE,CAAA,mBAAmB,aAAa,WAAW,AAAD,KAAM,CAAE,CAAA,mBAAmB,aAAa,UAAU,AAAD,GAC/F,OAAO;IAGT,IAAI,WAAC,OAAO,cAAE,UAAU,EAAC,GAAG,QAAQ,KAAK;IAEzC,IAAI,YACF,YAAY,UACZ,eAAe,YACf,eAAe;IAGjB,IAAI,WAAW;QACb,MAAM,oBAAC,gBAAgB,EAAC,GAAG,QAAQ,aAAa,CAAC,WAAW;QAC5D,IAAI,EAAC,SAAS,eAAe,EAAE,YAAY,kBAAkB,EAAC,GAAG,iBAAiB;QAElF,YACE,oBAAoB,UACpB,uBAAuB,YACvB,uBAAuB;IAE3B;IAEA,OAAO;AACT;AAEA,SAAS,yCAAmB,OAAgB,EAAE,YAAsB;IAClE,OACE,CAAC,QAAQ,YAAY,CAAC,aACtB,yCAAyC;IACzC,CAAC,QAAQ,YAAY,CAAC,oCACrB,CAAA,QAAQ,QAAQ,KAAK,aACpB,gBACA,aAAa,QAAQ,KAAK,YACxB,QAAQ,YAAY,CAAC,UACrB,IAAG;AAEX;AAQO,SAAS,0CAAiB,OAAgB,EAAE,YAAsB;IACvE,IAAI,+CACF,OAAO,QAAQ,eAAe,CAAC;QAAC,oBAAoB;IAAI,MAAM,CAAC,QAAQ,OAAO,CAAC;IAGjF,OACE,QAAQ,QAAQ,KAAK,cACrB,qCAAe,YACf,yCAAmB,SAAS,iBAC3B,CAAA,CAAC,QAAQ,aAAa,IAAI,0CAAiB,QAAQ,aAAa,EAAE,QAAO;AAE9E","sources":["packages/@react-aria/utils/src/isElementVisible.ts"],"sourcesContent":["/*\n * Copyright 2021 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {getOwnerWindow} from './domHelpers';\n\nconst supportsCheckVisibility = typeof Element !== 'undefined' && 'checkVisibility' in Element.prototype;\n\nfunction isStyleVisible(element: Element) {\n const windowObject = getOwnerWindow(element);\n if (!(element instanceof windowObject.HTMLElement) && !(element instanceof windowObject.SVGElement)) {\n return false;\n }\n\n let {display, visibility} = element.style;\n\n let isVisible = (\n display !== 'none' &&\n visibility !== 'hidden' &&\n visibility !== 'collapse'\n );\n\n if (isVisible) {\n const {getComputedStyle} = element.ownerDocument.defaultView as unknown as Window;\n let {display: computedDisplay, visibility: computedVisibility} = getComputedStyle(element);\n\n isVisible = (\n computedDisplay !== 'none' &&\n computedVisibility !== 'hidden' &&\n computedVisibility !== 'collapse'\n );\n }\n\n return isVisible;\n}\n\nfunction isAttributeVisible(element: Element, childElement?: Element) {\n return (\n !element.hasAttribute('hidden') &&\n // Ignore HiddenSelect when tree walking.\n !element.hasAttribute('data-react-aria-prevent-focus') &&\n (element.nodeName === 'DETAILS' &&\n childElement &&\n childElement.nodeName !== 'SUMMARY'\n ? element.hasAttribute('open')\n : true)\n );\n}\n\n/**\n * Adapted from https://github.com/testing-library/jest-dom and\n * https://github.com/vuejs/vue-test-utils-next/.\n * Licensed under the MIT License.\n * @param element - Element to evaluate for display or visibility.\n */\nexport function isElementVisible(element: Element, childElement?: Element): boolean {\n if (supportsCheckVisibility) {\n return element.checkVisibility({visibilityProperty: true}) && !element.closest('[data-react-aria-prevent-focus]');\n }\n\n return (\n element.nodeName !== '#comment' &&\n isStyleVisible(element) &&\n isAttributeVisible(element, childElement) &&\n (!element.parentElement || isElementVisible(element.parentElement, element))\n );\n}\n"],"names":[],"version":3,"file":"isElementVisible.main.js.map"}
import {getOwnerWindow as $431fbd86ca7dc216$export$f21a1ffae260145a} from "./domHelpers.mjs";
/*
* Copyright 2021 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
const $7d2416ea0959daaa$var$supportsCheckVisibility = typeof Element !== 'undefined' && 'checkVisibility' in Element.prototype;
function $7d2416ea0959daaa$var$isStyleVisible(element) {
const windowObject = (0, $431fbd86ca7dc216$export$f21a1ffae260145a)(element);
if (!(element instanceof windowObject.HTMLElement) && !(element instanceof windowObject.SVGElement)) return false;
let { display: display, visibility: visibility } = element.style;
let isVisible = display !== 'none' && visibility !== 'hidden' && visibility !== 'collapse';
if (isVisible) {
const { getComputedStyle: getComputedStyle } = element.ownerDocument.defaultView;
let { display: computedDisplay, visibility: computedVisibility } = getComputedStyle(element);
isVisible = computedDisplay !== 'none' && computedVisibility !== 'hidden' && computedVisibility !== 'collapse';
}
return isVisible;
}
function $7d2416ea0959daaa$var$isAttributeVisible(element, childElement) {
return !element.hasAttribute('hidden') && // Ignore HiddenSelect when tree walking.
!element.hasAttribute('data-react-aria-prevent-focus') && (element.nodeName === 'DETAILS' && childElement && childElement.nodeName !== 'SUMMARY' ? element.hasAttribute('open') : true);
}
function $7d2416ea0959daaa$export$e989c0fffaa6b27a(element, childElement) {
if ($7d2416ea0959daaa$var$supportsCheckVisibility) return element.checkVisibility({
visibilityProperty: true
}) && !element.closest('[data-react-aria-prevent-focus]');
return element.nodeName !== '#comment' && $7d2416ea0959daaa$var$isStyleVisible(element) && $7d2416ea0959daaa$var$isAttributeVisible(element, childElement) && (!element.parentElement || $7d2416ea0959daaa$export$e989c0fffaa6b27a(element.parentElement, element));
}
export {$7d2416ea0959daaa$export$e989c0fffaa6b27a as isElementVisible};
//# sourceMappingURL=isElementVisible.module.js.map
import {getOwnerWindow as $431fbd86ca7dc216$export$f21a1ffae260145a} from "./domHelpers.module.js";
/*
* Copyright 2021 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
const $7d2416ea0959daaa$var$supportsCheckVisibility = typeof Element !== 'undefined' && 'checkVisibility' in Element.prototype;
function $7d2416ea0959daaa$var$isStyleVisible(element) {
const windowObject = (0, $431fbd86ca7dc216$export$f21a1ffae260145a)(element);
if (!(element instanceof windowObject.HTMLElement) && !(element instanceof windowObject.SVGElement)) return false;
let { display: display, visibility: visibility } = element.style;
let isVisible = display !== 'none' && visibility !== 'hidden' && visibility !== 'collapse';
if (isVisible) {
const { getComputedStyle: getComputedStyle } = element.ownerDocument.defaultView;
let { display: computedDisplay, visibility: computedVisibility } = getComputedStyle(element);
isVisible = computedDisplay !== 'none' && computedVisibility !== 'hidden' && computedVisibility !== 'collapse';
}
return isVisible;
}
function $7d2416ea0959daaa$var$isAttributeVisible(element, childElement) {
return !element.hasAttribute('hidden') && // Ignore HiddenSelect when tree walking.
!element.hasAttribute('data-react-aria-prevent-focus') && (element.nodeName === 'DETAILS' && childElement && childElement.nodeName !== 'SUMMARY' ? element.hasAttribute('open') : true);
}
function $7d2416ea0959daaa$export$e989c0fffaa6b27a(element, childElement) {
if ($7d2416ea0959daaa$var$supportsCheckVisibility) return element.checkVisibility({
visibilityProperty: true
}) && !element.closest('[data-react-aria-prevent-focus]');
return element.nodeName !== '#comment' && $7d2416ea0959daaa$var$isStyleVisible(element) && $7d2416ea0959daaa$var$isAttributeVisible(element, childElement) && (!element.parentElement || $7d2416ea0959daaa$export$e989c0fffaa6b27a(element.parentElement, element));
}
export {$7d2416ea0959daaa$export$e989c0fffaa6b27a as isElementVisible};
//# sourceMappingURL=isElementVisible.module.js.map
{"mappings":";;AAAA;;;;;;;;;;CAUC;AAID,MAAM,gDAA0B,OAAO,YAAY,eAAe,qBAAqB,QAAQ,SAAS;AAExG,SAAS,qCAAe,OAAgB;IACtC,MAAM,eAAe,CAAA,GAAA,yCAAa,EAAE;IACpC,IAAI,CAAE,CAAA,mBAAmB,aAAa,WAAW,AAAD,KAAM,CAAE,CAAA,mBAAmB,aAAa,UAAU,AAAD,GAC/F,OAAO;IAGT,IAAI,WAAC,OAAO,cAAE,UAAU,EAAC,GAAG,QAAQ,KAAK;IAEzC,IAAI,YACF,YAAY,UACZ,eAAe,YACf,eAAe;IAGjB,IAAI,WAAW;QACb,MAAM,oBAAC,gBAAgB,EAAC,GAAG,QAAQ,aAAa,CAAC,WAAW;QAC5D,IAAI,EAAC,SAAS,eAAe,EAAE,YAAY,kBAAkB,EAAC,GAAG,iBAAiB;QAElF,YACE,oBAAoB,UACpB,uBAAuB,YACvB,uBAAuB;IAE3B;IAEA,OAAO;AACT;AAEA,SAAS,yCAAmB,OAAgB,EAAE,YAAsB;IAClE,OACE,CAAC,QAAQ,YAAY,CAAC,aACtB,yCAAyC;IACzC,CAAC,QAAQ,YAAY,CAAC,oCACrB,CAAA,QAAQ,QAAQ,KAAK,aACpB,gBACA,aAAa,QAAQ,KAAK,YACxB,QAAQ,YAAY,CAAC,UACrB,IAAG;AAEX;AAQO,SAAS,0CAAiB,OAAgB,EAAE,YAAsB;IACvE,IAAI,+CACF,OAAO,QAAQ,eAAe,CAAC;QAAC,oBAAoB;IAAI,MAAM,CAAC,QAAQ,OAAO,CAAC;IAGjF,OACE,QAAQ,QAAQ,KAAK,cACrB,qCAAe,YACf,yCAAmB,SAAS,iBAC3B,CAAA,CAAC,QAAQ,aAAa,IAAI,0CAAiB,QAAQ,aAAa,EAAE,QAAO;AAE9E","sources":["packages/@react-aria/utils/src/isElementVisible.ts"],"sourcesContent":["/*\n * Copyright 2021 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {getOwnerWindow} from './domHelpers';\n\nconst supportsCheckVisibility = typeof Element !== 'undefined' && 'checkVisibility' in Element.prototype;\n\nfunction isStyleVisible(element: Element) {\n const windowObject = getOwnerWindow(element);\n if (!(element instanceof windowObject.HTMLElement) && !(element instanceof windowObject.SVGElement)) {\n return false;\n }\n\n let {display, visibility} = element.style;\n\n let isVisible = (\n display !== 'none' &&\n visibility !== 'hidden' &&\n visibility !== 'collapse'\n );\n\n if (isVisible) {\n const {getComputedStyle} = element.ownerDocument.defaultView as unknown as Window;\n let {display: computedDisplay, visibility: computedVisibility} = getComputedStyle(element);\n\n isVisible = (\n computedDisplay !== 'none' &&\n computedVisibility !== 'hidden' &&\n computedVisibility !== 'collapse'\n );\n }\n\n return isVisible;\n}\n\nfunction isAttributeVisible(element: Element, childElement?: Element) {\n return (\n !element.hasAttribute('hidden') &&\n // Ignore HiddenSelect when tree walking.\n !element.hasAttribute('data-react-aria-prevent-focus') &&\n (element.nodeName === 'DETAILS' &&\n childElement &&\n childElement.nodeName !== 'SUMMARY'\n ? element.hasAttribute('open')\n : true)\n );\n}\n\n/**\n * Adapted from https://github.com/testing-library/jest-dom and\n * https://github.com/vuejs/vue-test-utils-next/.\n * Licensed under the MIT License.\n * @param element - Element to evaluate for display or visibility.\n */\nexport function isElementVisible(element: Element, childElement?: Element): boolean {\n if (supportsCheckVisibility) {\n return element.checkVisibility({visibilityProperty: true}) && !element.closest('[data-react-aria-prevent-focus]');\n }\n\n return (\n element.nodeName !== '#comment' &&\n isStyleVisible(element) &&\n isAttributeVisible(element, childElement) &&\n (!element.parentElement || isElementVisible(element.parentElement, element))\n );\n}\n"],"names":[],"version":3,"file":"isElementVisible.module.js.map"}
var $a333d78d58ab4731$exports = require("./isElementVisible.main.js");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "isFocusable", () => $506b33fd893eab7d$export$4c063cf1350e6fed);
$parcel$export(module.exports, "isTabbable", () => $506b33fd893eab7d$export$bebd5a1431fec25d);
/*
* Copyright 2025 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
const $506b33fd893eab7d$var$focusableElements = [
'input:not([disabled]):not([type=hidden])',
'select:not([disabled])',
'textarea:not([disabled])',
'button:not([disabled])',
'a[href]',
'area[href]',
'summary',
'iframe',
'object',
'embed',
'audio[controls]',
'video[controls]',
'[contenteditable]:not([contenteditable^="false"])',
'permission'
];
const $506b33fd893eab7d$var$FOCUSABLE_ELEMENT_SELECTOR = $506b33fd893eab7d$var$focusableElements.join(':not([hidden]),') + ',[tabindex]:not([disabled]):not([hidden])';
$506b33fd893eab7d$var$focusableElements.push('[tabindex]:not([tabindex="-1"]):not([disabled])');
const $506b33fd893eab7d$var$TABBABLE_ELEMENT_SELECTOR = $506b33fd893eab7d$var$focusableElements.join(':not([hidden]):not([tabindex="-1"]),');
function $506b33fd893eab7d$export$4c063cf1350e6fed(element) {
return element.matches($506b33fd893eab7d$var$FOCUSABLE_ELEMENT_SELECTOR) && (0, $a333d78d58ab4731$exports.isElementVisible)(element) && !$506b33fd893eab7d$var$isInert(element);
}
function $506b33fd893eab7d$export$bebd5a1431fec25d(element) {
return element.matches($506b33fd893eab7d$var$TABBABLE_ELEMENT_SELECTOR) && (0, $a333d78d58ab4731$exports.isElementVisible)(element) && !$506b33fd893eab7d$var$isInert(element);
}
function $506b33fd893eab7d$var$isInert(element) {
let node = element;
while(node != null){
if (node instanceof node.ownerDocument.defaultView.HTMLElement && node.inert) return true;
node = node.parentElement;
}
return false;
}
//# sourceMappingURL=isFocusable.main.js.map
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;AAID,MAAM,0CAAoB;IACxB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAED,MAAM,mDAA6B,wCAAkB,IAAI,CAAC,qBAAqB;AAE/E,wCAAkB,IAAI,CAAC;AACvB,MAAM,kDAA4B,wCAAkB,IAAI,CAAC;AAElD,SAAS,0CAAY,OAAgB;IAC1C,OAAO,QAAQ,OAAO,CAAC,qDAA+B,CAAA,GAAA,0CAAe,EAAE,YAAY,CAAC,8BAAQ;AAC9F;AAEO,SAAS,0CAAW,OAAgB;IACzC,OAAO,QAAQ,OAAO,CAAC,oDAA8B,CAAA,GAAA,0CAAe,EAAE,YAAY,CAAC,8BAAQ;AAC7F;AAEA,SAAS,8BAAQ,OAAgB;IAC/B,IAAI,OAAuB;IAC3B,MAAO,QAAQ,KAAM;QACnB,IAAI,gBAAgB,KAAK,aAAa,CAAC,WAAW,CAAE,WAAW,IAAI,KAAK,KAAK,EAC3E,OAAO;QAGT,OAAO,KAAK,aAAa;IAC3B;IAEA,OAAO;AACT","sources":["packages/@react-aria/utils/src/isFocusable.ts"],"sourcesContent":["/*\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {isElementVisible} from './isElementVisible';\n\nconst focusableElements = [\n 'input:not([disabled]):not([type=hidden])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n 'button:not([disabled])',\n 'a[href]',\n 'area[href]',\n 'summary',\n 'iframe',\n 'object',\n 'embed',\n 'audio[controls]',\n 'video[controls]',\n '[contenteditable]:not([contenteditable^=\"false\"])',\n 'permission'\n];\n\nconst FOCUSABLE_ELEMENT_SELECTOR = focusableElements.join(':not([hidden]),') + ',[tabindex]:not([disabled]):not([hidden])';\n\nfocusableElements.push('[tabindex]:not([tabindex=\"-1\"]):not([disabled])');\nconst TABBABLE_ELEMENT_SELECTOR = focusableElements.join(':not([hidden]):not([tabindex=\"-1\"]),');\n\nexport function isFocusable(element: Element): boolean {\n return element.matches(FOCUSABLE_ELEMENT_SELECTOR) && isElementVisible(element) && !isInert(element);\n}\n\nexport function isTabbable(element: Element): boolean {\n return element.matches(TABBABLE_ELEMENT_SELECTOR) && isElementVisible(element) && !isInert(element);\n}\n\nfunction isInert(element: Element): boolean {\n let node: Element | null = element;\n while (node != null) {\n if (node instanceof node.ownerDocument.defaultView!.HTMLElement && node.inert) {\n return true;\n }\n\n node = node.parentElement;\n }\n\n return false;\n}\n"],"names":[],"version":3,"file":"isFocusable.main.js.map"}
import {isElementVisible as $7d2416ea0959daaa$export$e989c0fffaa6b27a} from "./isElementVisible.mjs";
/*
* Copyright 2025 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
const $b4b717babfbb907b$var$focusableElements = [
'input:not([disabled]):not([type=hidden])',
'select:not([disabled])',
'textarea:not([disabled])',
'button:not([disabled])',
'a[href]',
'area[href]',
'summary',
'iframe',
'object',
'embed',
'audio[controls]',
'video[controls]',
'[contenteditable]:not([contenteditable^="false"])',
'permission'
];
const $b4b717babfbb907b$var$FOCUSABLE_ELEMENT_SELECTOR = $b4b717babfbb907b$var$focusableElements.join(':not([hidden]),') + ',[tabindex]:not([disabled]):not([hidden])';
$b4b717babfbb907b$var$focusableElements.push('[tabindex]:not([tabindex="-1"]):not([disabled])');
const $b4b717babfbb907b$var$TABBABLE_ELEMENT_SELECTOR = $b4b717babfbb907b$var$focusableElements.join(':not([hidden]):not([tabindex="-1"]),');
function $b4b717babfbb907b$export$4c063cf1350e6fed(element) {
return element.matches($b4b717babfbb907b$var$FOCUSABLE_ELEMENT_SELECTOR) && (0, $7d2416ea0959daaa$export$e989c0fffaa6b27a)(element) && !$b4b717babfbb907b$var$isInert(element);
}
function $b4b717babfbb907b$export$bebd5a1431fec25d(element) {
return element.matches($b4b717babfbb907b$var$TABBABLE_ELEMENT_SELECTOR) && (0, $7d2416ea0959daaa$export$e989c0fffaa6b27a)(element) && !$b4b717babfbb907b$var$isInert(element);
}
function $b4b717babfbb907b$var$isInert(element) {
let node = element;
while(node != null){
if (node instanceof node.ownerDocument.defaultView.HTMLElement && node.inert) return true;
node = node.parentElement;
}
return false;
}
export {$b4b717babfbb907b$export$4c063cf1350e6fed as isFocusable, $b4b717babfbb907b$export$bebd5a1431fec25d as isTabbable};
//# sourceMappingURL=isFocusable.module.js.map
import {isElementVisible as $7d2416ea0959daaa$export$e989c0fffaa6b27a} from "./isElementVisible.module.js";
/*
* Copyright 2025 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
const $b4b717babfbb907b$var$focusableElements = [
'input:not([disabled]):not([type=hidden])',
'select:not([disabled])',
'textarea:not([disabled])',
'button:not([disabled])',
'a[href]',
'area[href]',
'summary',
'iframe',
'object',
'embed',
'audio[controls]',
'video[controls]',
'[contenteditable]:not([contenteditable^="false"])',
'permission'
];
const $b4b717babfbb907b$var$FOCUSABLE_ELEMENT_SELECTOR = $b4b717babfbb907b$var$focusableElements.join(':not([hidden]),') + ',[tabindex]:not([disabled]):not([hidden])';
$b4b717babfbb907b$var$focusableElements.push('[tabindex]:not([tabindex="-1"]):not([disabled])');
const $b4b717babfbb907b$var$TABBABLE_ELEMENT_SELECTOR = $b4b717babfbb907b$var$focusableElements.join(':not([hidden]):not([tabindex="-1"]),');
function $b4b717babfbb907b$export$4c063cf1350e6fed(element) {
return element.matches($b4b717babfbb907b$var$FOCUSABLE_ELEMENT_SELECTOR) && (0, $7d2416ea0959daaa$export$e989c0fffaa6b27a)(element) && !$b4b717babfbb907b$var$isInert(element);
}
function $b4b717babfbb907b$export$bebd5a1431fec25d(element) {
return element.matches($b4b717babfbb907b$var$TABBABLE_ELEMENT_SELECTOR) && (0, $7d2416ea0959daaa$export$e989c0fffaa6b27a)(element) && !$b4b717babfbb907b$var$isInert(element);
}
function $b4b717babfbb907b$var$isInert(element) {
let node = element;
while(node != null){
if (node instanceof node.ownerDocument.defaultView.HTMLElement && node.inert) return true;
node = node.parentElement;
}
return false;
}
export {$b4b717babfbb907b$export$4c063cf1350e6fed as isFocusable, $b4b717babfbb907b$export$bebd5a1431fec25d as isTabbable};
//# sourceMappingURL=isFocusable.module.js.map
{"mappings":";;AAAA;;;;;;;;;;CAUC;AAID,MAAM,0CAAoB;IACxB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAED,MAAM,mDAA6B,wCAAkB,IAAI,CAAC,qBAAqB;AAE/E,wCAAkB,IAAI,CAAC;AACvB,MAAM,kDAA4B,wCAAkB,IAAI,CAAC;AAElD,SAAS,0CAAY,OAAgB;IAC1C,OAAO,QAAQ,OAAO,CAAC,qDAA+B,CAAA,GAAA,yCAAe,EAAE,YAAY,CAAC,8BAAQ;AAC9F;AAEO,SAAS,0CAAW,OAAgB;IACzC,OAAO,QAAQ,OAAO,CAAC,oDAA8B,CAAA,GAAA,yCAAe,EAAE,YAAY,CAAC,8BAAQ;AAC7F;AAEA,SAAS,8BAAQ,OAAgB;IAC/B,IAAI,OAAuB;IAC3B,MAAO,QAAQ,KAAM;QACnB,IAAI,gBAAgB,KAAK,aAAa,CAAC,WAAW,CAAE,WAAW,IAAI,KAAK,KAAK,EAC3E,OAAO;QAGT,OAAO,KAAK,aAAa;IAC3B;IAEA,OAAO;AACT","sources":["packages/@react-aria/utils/src/isFocusable.ts"],"sourcesContent":["/*\n * Copyright 2025 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {isElementVisible} from './isElementVisible';\n\nconst focusableElements = [\n 'input:not([disabled]):not([type=hidden])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n 'button:not([disabled])',\n 'a[href]',\n 'area[href]',\n 'summary',\n 'iframe',\n 'object',\n 'embed',\n 'audio[controls]',\n 'video[controls]',\n '[contenteditable]:not([contenteditable^=\"false\"])',\n 'permission'\n];\n\nconst FOCUSABLE_ELEMENT_SELECTOR = focusableElements.join(':not([hidden]),') + ',[tabindex]:not([disabled]):not([hidden])';\n\nfocusableElements.push('[tabindex]:not([tabindex=\"-1\"]):not([disabled])');\nconst TABBABLE_ELEMENT_SELECTOR = focusableElements.join(':not([hidden]):not([tabindex=\"-1\"]),');\n\nexport function isFocusable(element: Element): boolean {\n return element.matches(FOCUSABLE_ELEMENT_SELECTOR) && isElementVisible(element) && !isInert(element);\n}\n\nexport function isTabbable(element: Element): boolean {\n return element.matches(TABBABLE_ELEMENT_SELECTOR) && isElementVisible(element) && !isInert(element);\n}\n\nfunction isInert(element: Element): boolean {\n let node: Element | null = element;\n while (node != null) {\n if (node instanceof node.ownerDocument.defaultView!.HTMLElement && node.inert) {\n return true;\n }\n\n node = node.parentElement;\n }\n\n return false;\n}\n"],"names":[],"version":3,"file":"isFocusable.module.js.map"}
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "isScrollable", () => $9a54e9cd5db23b5d$export$2bb74740c4e19def);
/*
* Copyright 2024 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ function $9a54e9cd5db23b5d$export$2bb74740c4e19def(node, checkForOverflow) {
if (!node) return false;
let style = window.getComputedStyle(node);
let isScrollable = /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY);
if (isScrollable && checkForOverflow) isScrollable = node.scrollHeight !== node.clientHeight || node.scrollWidth !== node.clientWidth;
return isScrollable;
}
//# sourceMappingURL=isScrollable.main.js.map
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC,GAEM,SAAS,0CAAa,IAAoB,EAAE,gBAA0B;IAC3E,IAAI,CAAC,MACH,OAAO;IAET,IAAI,QAAQ,OAAO,gBAAgB,CAAC;IACpC,IAAI,eAAe,gBAAgB,IAAI,CAAC,MAAM,QAAQ,GAAG,MAAM,SAAS,GAAG,MAAM,SAAS;IAE1F,IAAI,gBAAgB,kBAClB,eAAe,KAAK,YAAY,KAAK,KAAK,YAAY,IAAI,KAAK,WAAW,KAAK,KAAK,WAAW;IAGjG,OAAO;AACT","sources":["packages/@react-aria/utils/src/isScrollable.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport function isScrollable(node: Element | null, checkForOverflow?: boolean): boolean {\n if (!node) {\n return false;\n }\n let style = window.getComputedStyle(node);\n let isScrollable = /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY);\n\n if (isScrollable && checkForOverflow) {\n isScrollable = node.scrollHeight !== node.clientHeight || node.scrollWidth !== node.clientWidth;\n }\n\n return isScrollable;\n}\n"],"names":[],"version":3,"file":"isScrollable.main.js.map"}
/*
* Copyright 2024 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ function $cc38e7bd3fc7b213$export$2bb74740c4e19def(node, checkForOverflow) {
if (!node) return false;
let style = window.getComputedStyle(node);
let isScrollable = /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY);
if (isScrollable && checkForOverflow) isScrollable = node.scrollHeight !== node.clientHeight || node.scrollWidth !== node.clientWidth;
return isScrollable;
}
export {$cc38e7bd3fc7b213$export$2bb74740c4e19def as isScrollable};
//# sourceMappingURL=isScrollable.module.js.map
/*
* Copyright 2024 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ function $cc38e7bd3fc7b213$export$2bb74740c4e19def(node, checkForOverflow) {
if (!node) return false;
let style = window.getComputedStyle(node);
let isScrollable = /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY);
if (isScrollable && checkForOverflow) isScrollable = node.scrollHeight !== node.clientHeight || node.scrollWidth !== node.clientWidth;
return isScrollable;
}
export {$cc38e7bd3fc7b213$export$2bb74740c4e19def as isScrollable};
//# sourceMappingURL=isScrollable.module.js.map
{"mappings":"AAAA;;;;;;;;;;CAUC,GAEM,SAAS,0CAAa,IAAoB,EAAE,gBAA0B;IAC3E,IAAI,CAAC,MACH,OAAO;IAET,IAAI,QAAQ,OAAO,gBAAgB,CAAC;IACpC,IAAI,eAAe,gBAAgB,IAAI,CAAC,MAAM,QAAQ,GAAG,MAAM,SAAS,GAAG,MAAM,SAAS;IAE1F,IAAI,gBAAgB,kBAClB,eAAe,KAAK,YAAY,KAAK,KAAK,YAAY,IAAI,KAAK,WAAW,KAAK,KAAK,WAAW;IAGjG,OAAO;AACT","sources":["packages/@react-aria/utils/src/isScrollable.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport function isScrollable(node: Element | null, checkForOverflow?: boolean): boolean {\n if (!node) {\n return false;\n }\n let style = window.getComputedStyle(node);\n let isScrollable = /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY);\n\n if (isScrollable && checkForOverflow) {\n isScrollable = node.scrollHeight !== node.clientHeight || node.scrollWidth !== node.clientWidth;\n }\n\n return isScrollable;\n}\n"],"names":[],"version":3,"file":"isScrollable.module.js.map"}
var $9e20cff0af27e8cc$exports = require("./platform.main.js");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "isVirtualClick", () => $577e795361f19be9$export$60278871457622de);
$parcel$export(module.exports, "isVirtualPointerEvent", () => $577e795361f19be9$export$29bf1b5f2c56cf63);
/*
* Copyright 2022 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $577e795361f19be9$export$60278871457622de(event) {
// JAWS/NVDA with Firefox.
if (event.pointerType === '' && event.isTrusted) return true;
// Android TalkBack's detail value varies depending on the event listener providing the event so we have specific logic here instead
// If pointerType is defined, event is from a click listener. For events from mousedown listener, detail === 0 is a sufficient check
// to detect TalkBack virtual clicks.
if ((0, $9e20cff0af27e8cc$exports.isAndroid)() && event.pointerType) return event.type === 'click' && event.buttons === 1;
return event.detail === 0 && !event.pointerType;
}
function $577e795361f19be9$export$29bf1b5f2c56cf63(event) {
// If the pointer size is zero, then we assume it's from a screen reader.
// Android TalkBack double tap will sometimes return a event with width and height of 1
// and pointerType === 'mouse' so we need to check for a specific combination of event attributes.
// Cannot use "event.pressure === 0" as the sole check due to Safari pointer events always returning pressure === 0
// instead of .5, see https://bugs.webkit.org/show_bug.cgi?id=206216. event.pointerType === 'mouse' is to distingush
// Talkback double tap from Windows Firefox touch screen press
return !(0, $9e20cff0af27e8cc$exports.isAndroid)() && event.width === 0 && event.height === 0 || event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === 'mouse';
}
//# sourceMappingURL=isVirtualEvent.main.js.map
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;AAeM,SAAS,0CAAe,KAAgC;IAC7D,0BAA0B;IAC1B,IAAI,AAAC,MAAuB,WAAW,KAAK,MAAM,MAAM,SAAS,EAC/D,OAAO;IAGT,oIAAoI;IACpI,oIAAoI;IACpI,qCAAqC;IACrC,IAAI,CAAA,GAAA,mCAAQ,OAAO,AAAC,MAAuB,WAAW,EACpD,OAAO,MAAM,IAAI,KAAK,WAAW,MAAM,OAAO,KAAK;IAGrD,OAAO,MAAM,MAAM,KAAK,KAAK,CAAC,AAAC,MAAuB,WAAW;AACnE;AAEO,SAAS,0CAAsB,KAAmB;IACvD,yEAAyE;IACzE,uFAAuF;IACvF,kGAAkG;IAClG,mHAAmH;IACnH,oHAAoH;IACpH,8DAA8D;IAC9D,OACE,AAAC,CAAC,CAAA,GAAA,mCAAQ,OAAO,MAAM,KAAK,KAAK,KAAK,MAAM,MAAM,KAAK,KACtD,MAAM,KAAK,KAAK,KACf,MAAM,MAAM,KAAK,KACjB,MAAM,QAAQ,KAAK,KACnB,MAAM,MAAM,KAAK,KACjB,MAAM,WAAW,KAAK;AAG5B","sources":["packages/@react-aria/utils/src/isVirtualEvent.ts"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {isAndroid} from './platform';\n\n// Original licensing for the following method can be found in the\n// NOTICE file in the root directory of this source tree.\n// See https://github.com/facebook/react/blob/3c713d513195a53788b3f8bb4b70279d68b15bcc/packages/react-interactions/events/src/dom/shared/index.js#L74-L87\n\n// Keyboards, Assistive Technologies, and element.click() all produce a \"virtual\"\n// click event. This is a method of inferring such clicks. Every browser except\n// IE 11 only sets a zero value of \"detail\" for click events that are \"virtual\".\n// However, IE 11 uses a zero value for all click events. For IE 11 we rely on\n// the quirk that it produces click events that are of type PointerEvent, and\n// where only the \"virtual\" click lacks a pointerType field.\n\nexport function isVirtualClick(event: MouseEvent | PointerEvent): boolean {\n // JAWS/NVDA with Firefox.\n if ((event as PointerEvent).pointerType === '' && event.isTrusted) {\n return true;\n }\n\n // Android TalkBack's detail value varies depending on the event listener providing the event so we have specific logic here instead\n // If pointerType is defined, event is from a click listener. For events from mousedown listener, detail === 0 is a sufficient check\n // to detect TalkBack virtual clicks.\n if (isAndroid() && (event as PointerEvent).pointerType) {\n return event.type === 'click' && event.buttons === 1;\n }\n\n return event.detail === 0 && !(event as PointerEvent).pointerType;\n}\n\nexport function isVirtualPointerEvent(event: PointerEvent): boolean {\n // If the pointer size is zero, then we assume it's from a screen reader.\n // Android TalkBack double tap will sometimes return a event with width and height of 1\n // and pointerType === 'mouse' so we need to check for a specific combination of event attributes.\n // Cannot use \"event.pressure === 0\" as the sole check due to Safari pointer events always returning pressure === 0\n // instead of .5, see https://bugs.webkit.org/show_bug.cgi?id=206216. event.pointerType === 'mouse' is to distingush\n // Talkback double tap from Windows Firefox touch screen press\n return (\n (!isAndroid() && event.width === 0 && event.height === 0) ||\n (event.width === 1 &&\n event.height === 1 &&\n event.pressure === 0 &&\n event.detail === 0 &&\n event.pointerType === 'mouse'\n )\n );\n}\n"],"names":[],"version":3,"file":"isVirtualEvent.main.js.map"}
import {isAndroid as $c87311424ea30a05$export$a11b0059900ceec8} from "./platform.mjs";
/*
* Copyright 2022 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $6a7db85432448f7f$export$60278871457622de(event) {
// JAWS/NVDA with Firefox.
if (event.pointerType === '' && event.isTrusted) return true;
// Android TalkBack's detail value varies depending on the event listener providing the event so we have specific logic here instead
// If pointerType is defined, event is from a click listener. For events from mousedown listener, detail === 0 is a sufficient check
// to detect TalkBack virtual clicks.
if ((0, $c87311424ea30a05$export$a11b0059900ceec8)() && event.pointerType) return event.type === 'click' && event.buttons === 1;
return event.detail === 0 && !event.pointerType;
}
function $6a7db85432448f7f$export$29bf1b5f2c56cf63(event) {
// If the pointer size is zero, then we assume it's from a screen reader.
// Android TalkBack double tap will sometimes return a event with width and height of 1
// and pointerType === 'mouse' so we need to check for a specific combination of event attributes.
// Cannot use "event.pressure === 0" as the sole check due to Safari pointer events always returning pressure === 0
// instead of .5, see https://bugs.webkit.org/show_bug.cgi?id=206216. event.pointerType === 'mouse' is to distingush
// Talkback double tap from Windows Firefox touch screen press
return !(0, $c87311424ea30a05$export$a11b0059900ceec8)() && event.width === 0 && event.height === 0 || event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === 'mouse';
}
export {$6a7db85432448f7f$export$60278871457622de as isVirtualClick, $6a7db85432448f7f$export$29bf1b5f2c56cf63 as isVirtualPointerEvent};
//# sourceMappingURL=isVirtualEvent.module.js.map
import {isAndroid as $c87311424ea30a05$export$a11b0059900ceec8} from "./platform.module.js";
/*
* Copyright 2022 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $6a7db85432448f7f$export$60278871457622de(event) {
// JAWS/NVDA with Firefox.
if (event.pointerType === '' && event.isTrusted) return true;
// Android TalkBack's detail value varies depending on the event listener providing the event so we have specific logic here instead
// If pointerType is defined, event is from a click listener. For events from mousedown listener, detail === 0 is a sufficient check
// to detect TalkBack virtual clicks.
if ((0, $c87311424ea30a05$export$a11b0059900ceec8)() && event.pointerType) return event.type === 'click' && event.buttons === 1;
return event.detail === 0 && !event.pointerType;
}
function $6a7db85432448f7f$export$29bf1b5f2c56cf63(event) {
// If the pointer size is zero, then we assume it's from a screen reader.
// Android TalkBack double tap will sometimes return a event with width and height of 1
// and pointerType === 'mouse' so we need to check for a specific combination of event attributes.
// Cannot use "event.pressure === 0" as the sole check due to Safari pointer events always returning pressure === 0
// instead of .5, see https://bugs.webkit.org/show_bug.cgi?id=206216. event.pointerType === 'mouse' is to distingush
// Talkback double tap from Windows Firefox touch screen press
return !(0, $c87311424ea30a05$export$a11b0059900ceec8)() && event.width === 0 && event.height === 0 || event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === 'mouse';
}
export {$6a7db85432448f7f$export$60278871457622de as isVirtualClick, $6a7db85432448f7f$export$29bf1b5f2c56cf63 as isVirtualPointerEvent};
//# sourceMappingURL=isVirtualEvent.module.js.map
{"mappings":";;AAAA;;;;;;;;;;CAUC;AAeM,SAAS,0CAAe,KAAgC;IAC7D,0BAA0B;IAC1B,IAAI,AAAC,MAAuB,WAAW,KAAK,MAAM,MAAM,SAAS,EAC/D,OAAO;IAGT,oIAAoI;IACpI,oIAAoI;IACpI,qCAAqC;IACrC,IAAI,CAAA,GAAA,yCAAQ,OAAO,AAAC,MAAuB,WAAW,EACpD,OAAO,MAAM,IAAI,KAAK,WAAW,MAAM,OAAO,KAAK;IAGrD,OAAO,MAAM,MAAM,KAAK,KAAK,CAAC,AAAC,MAAuB,WAAW;AACnE;AAEO,SAAS,0CAAsB,KAAmB;IACvD,yEAAyE;IACzE,uFAAuF;IACvF,kGAAkG;IAClG,mHAAmH;IACnH,oHAAoH;IACpH,8DAA8D;IAC9D,OACE,AAAC,CAAC,CAAA,GAAA,yCAAQ,OAAO,MAAM,KAAK,KAAK,KAAK,MAAM,MAAM,KAAK,KACtD,MAAM,KAAK,KAAK,KACf,MAAM,MAAM,KAAK,KACjB,MAAM,QAAQ,KAAK,KACnB,MAAM,MAAM,KAAK,KACjB,MAAM,WAAW,KAAK;AAG5B","sources":["packages/@react-aria/utils/src/isVirtualEvent.ts"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {isAndroid} from './platform';\n\n// Original licensing for the following method can be found in the\n// NOTICE file in the root directory of this source tree.\n// See https://github.com/facebook/react/blob/3c713d513195a53788b3f8bb4b70279d68b15bcc/packages/react-interactions/events/src/dom/shared/index.js#L74-L87\n\n// Keyboards, Assistive Technologies, and element.click() all produce a \"virtual\"\n// click event. This is a method of inferring such clicks. Every browser except\n// IE 11 only sets a zero value of \"detail\" for click events that are \"virtual\".\n// However, IE 11 uses a zero value for all click events. For IE 11 we rely on\n// the quirk that it produces click events that are of type PointerEvent, and\n// where only the \"virtual\" click lacks a pointerType field.\n\nexport function isVirtualClick(event: MouseEvent | PointerEvent): boolean {\n // JAWS/NVDA with Firefox.\n if ((event as PointerEvent).pointerType === '' && event.isTrusted) {\n return true;\n }\n\n // Android TalkBack's detail value varies depending on the event listener providing the event so we have specific logic here instead\n // If pointerType is defined, event is from a click listener. For events from mousedown listener, detail === 0 is a sufficient check\n // to detect TalkBack virtual clicks.\n if (isAndroid() && (event as PointerEvent).pointerType) {\n return event.type === 'click' && event.buttons === 1;\n }\n\n return event.detail === 0 && !(event as PointerEvent).pointerType;\n}\n\nexport function isVirtualPointerEvent(event: PointerEvent): boolean {\n // If the pointer size is zero, then we assume it's from a screen reader.\n // Android TalkBack double tap will sometimes return a event with width and height of 1\n // and pointerType === 'mouse' so we need to check for a specific combination of event attributes.\n // Cannot use \"event.pressure === 0\" as the sole check due to Safari pointer events always returning pressure === 0\n // instead of .5, see https://bugs.webkit.org/show_bug.cgi?id=206216. event.pointerType === 'mouse' is to distingush\n // Talkback double tap from Windows Firefox touch screen press\n return (\n (!isAndroid() && event.width === 0 && event.height === 0) ||\n (event.width === 1 &&\n event.height === 1 &&\n event.pressure === 0 &&\n event.detail === 0 &&\n event.pointerType === 'mouse'\n )\n );\n}\n"],"names":[],"version":3,"file":"isVirtualEvent.module.js.map"}
var $9e20cff0af27e8cc$exports = require("./platform.main.js");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "isCtrlKeyPressed", () => $2308dc377e184bb0$export$16792effe837dba3);
$parcel$export(module.exports, "willOpenKeyboard", () => $2308dc377e184bb0$export$c57958e35f31ed73);
/*
* Copyright 2024 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $2308dc377e184bb0$export$16792effe837dba3(e) {
if ((0, $9e20cff0af27e8cc$exports.isMac)()) return e.metaKey;
return e.ctrlKey;
}
// HTML input types that do not cause the software keyboard to appear.
const $2308dc377e184bb0$var$nonTextInputTypes = new Set([
'checkbox',
'radio',
'range',
'color',
'file',
'image',
'button',
'submit',
'reset'
]);
function $2308dc377e184bb0$export$c57958e35f31ed73(target) {
return target instanceof HTMLInputElement && !$2308dc377e184bb0$var$nonTextInputTypes.has(target.type) || target instanceof HTMLTextAreaElement || target instanceof HTMLElement && target.isContentEditable;
}
//# sourceMappingURL=keyboard.main.js.map
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;AAUM,SAAS,0CAAiB,CAAQ;IACvC,IAAI,CAAA,GAAA,+BAAI,KACN,OAAO,EAAE,OAAO;IAGlB,OAAO,EAAE,OAAO;AAClB;AAEA,sEAAsE;AACtE,MAAM,0CAAoB,IAAI,IAAI;IAChC;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAEM,SAAS,0CAAiB,MAAe;IAC9C,OACE,AAAC,kBAAkB,oBAAoB,CAAC,wCAAkB,GAAG,CAAC,OAAO,IAAI,KACzE,kBAAkB,uBACjB,kBAAkB,eAAe,OAAO,iBAAiB;AAE9D","sources":["packages/@react-aria/utils/src/keyboard.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {isMac} from './platform';\n\ninterface Event {\n altKey: boolean,\n ctrlKey: boolean,\n metaKey: boolean\n}\n\nexport function isCtrlKeyPressed(e: Event): boolean {\n if (isMac()) {\n return e.metaKey;\n }\n\n return e.ctrlKey;\n}\n\n// HTML input types that do not cause the software keyboard to appear.\nconst nonTextInputTypes = new Set([\n 'checkbox',\n 'radio',\n 'range',\n 'color',\n 'file',\n 'image',\n 'button',\n 'submit',\n 'reset'\n]);\n\nexport function willOpenKeyboard(target: Element) {\n return (\n (target instanceof HTMLInputElement && !nonTextInputTypes.has(target.type)) ||\n target instanceof HTMLTextAreaElement ||\n (target instanceof HTMLElement && target.isContentEditable)\n );\n}\n"],"names":[],"version":3,"file":"keyboard.main.js.map"}
import {isMac as $c87311424ea30a05$export$9ac100e40613ea10} from "./platform.mjs";
/*
* Copyright 2024 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $21f1aa98acb08317$export$16792effe837dba3(e) {
if ((0, $c87311424ea30a05$export$9ac100e40613ea10)()) return e.metaKey;
return e.ctrlKey;
}
// HTML input types that do not cause the software keyboard to appear.
const $21f1aa98acb08317$var$nonTextInputTypes = new Set([
'checkbox',
'radio',
'range',
'color',
'file',
'image',
'button',
'submit',
'reset'
]);
function $21f1aa98acb08317$export$c57958e35f31ed73(target) {
return target instanceof HTMLInputElement && !$21f1aa98acb08317$var$nonTextInputTypes.has(target.type) || target instanceof HTMLTextAreaElement || target instanceof HTMLElement && target.isContentEditable;
}
export {$21f1aa98acb08317$export$16792effe837dba3 as isCtrlKeyPressed, $21f1aa98acb08317$export$c57958e35f31ed73 as willOpenKeyboard};
//# sourceMappingURL=keyboard.module.js.map
import {isMac as $c87311424ea30a05$export$9ac100e40613ea10} from "./platform.module.js";
/*
* Copyright 2024 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $21f1aa98acb08317$export$16792effe837dba3(e) {
if ((0, $c87311424ea30a05$export$9ac100e40613ea10)()) return e.metaKey;
return e.ctrlKey;
}
// HTML input types that do not cause the software keyboard to appear.
const $21f1aa98acb08317$var$nonTextInputTypes = new Set([
'checkbox',
'radio',
'range',
'color',
'file',
'image',
'button',
'submit',
'reset'
]);
function $21f1aa98acb08317$export$c57958e35f31ed73(target) {
return target instanceof HTMLInputElement && !$21f1aa98acb08317$var$nonTextInputTypes.has(target.type) || target instanceof HTMLTextAreaElement || target instanceof HTMLElement && target.isContentEditable;
}
export {$21f1aa98acb08317$export$16792effe837dba3 as isCtrlKeyPressed, $21f1aa98acb08317$export$c57958e35f31ed73 as willOpenKeyboard};
//# sourceMappingURL=keyboard.module.js.map
{"mappings":";;AAAA;;;;;;;;;;CAUC;AAUM,SAAS,0CAAiB,CAAQ;IACvC,IAAI,CAAA,GAAA,yCAAI,KACN,OAAO,EAAE,OAAO;IAGlB,OAAO,EAAE,OAAO;AAClB;AAEA,sEAAsE;AACtE,MAAM,0CAAoB,IAAI,IAAI;IAChC;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAEM,SAAS,0CAAiB,MAAe;IAC9C,OACE,AAAC,kBAAkB,oBAAoB,CAAC,wCAAkB,GAAG,CAAC,OAAO,IAAI,KACzE,kBAAkB,uBACjB,kBAAkB,eAAe,OAAO,iBAAiB;AAE9D","sources":["packages/@react-aria/utils/src/keyboard.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {isMac} from './platform';\n\ninterface Event {\n altKey: boolean,\n ctrlKey: boolean,\n metaKey: boolean\n}\n\nexport function isCtrlKeyPressed(e: Event): boolean {\n if (isMac()) {\n return e.metaKey;\n }\n\n return e.ctrlKey;\n}\n\n// HTML input types that do not cause the software keyboard to appear.\nconst nonTextInputTypes = new Set([\n 'checkbox',\n 'radio',\n 'range',\n 'color',\n 'file',\n 'image',\n 'button',\n 'submit',\n 'reset'\n]);\n\nexport function willOpenKeyboard(target: Element) {\n return (\n (target instanceof HTMLInputElement && !nonTextInputTypes.has(target.type)) ||\n target instanceof HTMLTextAreaElement ||\n (target instanceof HTMLElement && target.isContentEditable)\n );\n}\n"],"names":[],"version":3,"file":"keyboard.module.js.map"}
var $1e2191638e54f613$exports = require("./chain.main.js");
var $8c61827343eed941$exports = require("./useId.main.js");
var $eVrjB$clsx = require("clsx");
function $parcel$interopDefault(a) {
return a && a.__esModule ? a.default : a;
}
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "mergeProps", () => $f847cd1382ea7cd4$export$9d1611c77c2fe928);
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $f847cd1382ea7cd4$export$9d1611c77c2fe928(...args) {
// Start with a base clone of the first argument. This is a lot faster than starting
// with an empty object and adding properties as we go.
let result = {
...args[0]
};
for(let i = 1; i < args.length; i++){
let props = args[i];
for(let key in props){
let a = result[key];
let b = props[key];
// Chain events
if (typeof a === 'function' && typeof b === 'function' && // This is a lot faster than a regex.
key[0] === 'o' && key[1] === 'n' && key.charCodeAt(2) >= /* 'A' */ 65 && key.charCodeAt(2) <= /* 'Z' */ 90) result[key] = (0, $1e2191638e54f613$exports.chain)(a, b);
else if ((key === 'className' || key === 'UNSAFE_className') && typeof a === 'string' && typeof b === 'string') result[key] = (0, ($parcel$interopDefault($eVrjB$clsx)))(a, b);
else if (key === 'id' && a && b) result.id = (0, $8c61827343eed941$exports.mergeIds)(a, b);
else result[key] = b !== undefined ? b : a;
}
}
return result;
}
//# sourceMappingURL=mergeProps.main.js.map
{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAwBM,SAAS,0CAAiC,GAAG,IAAO;IACzD,oFAAoF;IACpF,uDAAuD;IACvD,IAAI,SAAgB;QAAC,GAAG,IAAI,CAAC,EAAE;IAAA;IAC/B,IAAK,IAAI,IAAI,GAAG,IAAI,KAAK,MAAM,EAAE,IAAK;QACpC,IAAI,QAAQ,IAAI,CAAC,EAAE;QACnB,IAAK,IAAI,OAAO,MAAO;YACrB,IAAI,IAAI,MAAM,CAAC,IAAI;YACnB,IAAI,IAAI,KAAK,CAAC,IAAI;YAElB,eAAe;YACf,IACE,OAAO,MAAM,cACb,OAAO,MAAM,cACb,qCAAqC;YACrC,GAAG,CAAC,EAAE,KAAK,OACX,GAAG,CAAC,EAAE,KAAK,OACX,IAAI,UAAU,CAAC,MAAM,OAAO,GAAG,MAC/B,IAAI,UAAU,CAAC,MAAM,OAAO,GAAG,IAE/B,MAAM,CAAC,IAAI,GAAG,CAAA,GAAA,+BAAI,EAAE,GAAG;iBAGlB,IACL,AAAC,CAAA,QAAQ,eAAe,QAAQ,kBAAiB,KACjD,OAAO,MAAM,YACb,OAAO,MAAM,UAEb,MAAM,CAAC,IAAI,GAAG,CAAA,GAAA,qCAAG,EAAE,GAAG;iBACjB,IAAI,QAAQ,QAAQ,KAAK,GAC9B,OAAO,EAAE,GAAG,CAAA,GAAA,kCAAO,EAAE,GAAG;iBAGxB,MAAM,CAAC,IAAI,GAAG,MAAM,YAAY,IAAI;QAExC;IACF;IAEA,OAAO;AACT","sources":["packages/@react-aria/utils/src/mergeProps.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {chain} from './chain';\nimport clsx from 'clsx';\nimport {mergeIds} from './useId';\n\ninterface Props {\n [key: string]: any\n}\n\ntype PropsArg = Props | null | undefined;\n\n// taken from: https://stackoverflow.com/questions/51603250/typescript-3-parameter-list-intersection-type/51604379#51604379\ntype TupleTypes<T> = { [P in keyof T]: T[P] } extends { [key: number]: infer V } ? NullToObject<V> : never;\ntype NullToObject<T> = T extends (null | undefined) ? {} : T;\n\ntype UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;\n\n/**\n * Merges multiple props objects together. Event handlers are chained,\n * classNames are combined, and ids are deduplicated.\n * For all other props, the last prop object overrides all previous ones.\n * @param args - Multiple sets of props to merge together.\n */\nexport function mergeProps<T extends PropsArg[]>(...args: T): UnionToIntersection<TupleTypes<T>> {\n // Start with a base clone of the first argument. This is a lot faster than starting\n // with an empty object and adding properties as we go.\n let result: Props = {...args[0]};\n for (let i = 1; i < args.length; i++) {\n let props = args[i];\n for (let key in props) {\n let a = result[key];\n let b = props[key];\n\n // Chain events\n if (\n typeof a === 'function' &&\n typeof b === 'function' &&\n // This is a lot faster than a regex.\n key[0] === 'o' &&\n key[1] === 'n' &&\n key.charCodeAt(2) >= /* 'A' */ 65 &&\n key.charCodeAt(2) <= /* 'Z' */ 90\n ) {\n result[key] = chain(a, b);\n\n // Merge classnames, sometimes classNames are empty string which eval to false, so we just need to do a type check\n } else if (\n (key === 'className' || key === 'UNSAFE_className') &&\n typeof a === 'string' &&\n typeof b === 'string'\n ) {\n result[key] = clsx(a, b);\n } else if (key === 'id' && a && b) {\n result.id = mergeIds(a, b);\n // Override others\n } else {\n result[key] = b !== undefined ? b : a;\n }\n }\n }\n\n return result as UnionToIntersection<TupleTypes<T>>;\n}\n"],"names":[],"version":3,"file":"mergeProps.main.js.map"}
import {chain as $ff5963eb1fccf552$export$e08e3b67e392101e} from "./chain.mjs";
import {mergeIds as $bdb11010cef70236$export$cd8c9cb68f842629} from "./useId.mjs";
import $7jXr9$clsx from "clsx";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $3ef42575df84b30b$export$9d1611c77c2fe928(...args) {
// Start with a base clone of the first argument. This is a lot faster than starting
// with an empty object and adding properties as we go.
let result = {
...args[0]
};
for(let i = 1; i < args.length; i++){
let props = args[i];
for(let key in props){
let a = result[key];
let b = props[key];
// Chain events
if (typeof a === 'function' && typeof b === 'function' && // This is a lot faster than a regex.
key[0] === 'o' && key[1] === 'n' && key.charCodeAt(2) >= /* 'A' */ 65 && key.charCodeAt(2) <= /* 'Z' */ 90) result[key] = (0, $ff5963eb1fccf552$export$e08e3b67e392101e)(a, b);
else if ((key === 'className' || key === 'UNSAFE_className') && typeof a === 'string' && typeof b === 'string') result[key] = (0, $7jXr9$clsx)(a, b);
else if (key === 'id' && a && b) result.id = (0, $bdb11010cef70236$export$cd8c9cb68f842629)(a, b);
else result[key] = b !== undefined ? b : a;
}
}
return result;
}
export {$3ef42575df84b30b$export$9d1611c77c2fe928 as mergeProps};
//# sourceMappingURL=mergeProps.module.js.map
import {chain as $ff5963eb1fccf552$export$e08e3b67e392101e} from "./chain.module.js";
import {mergeIds as $bdb11010cef70236$export$cd8c9cb68f842629} from "./useId.module.js";
import $7jXr9$clsx from "clsx";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $3ef42575df84b30b$export$9d1611c77c2fe928(...args) {
// Start with a base clone of the first argument. This is a lot faster than starting
// with an empty object and adding properties as we go.
let result = {
...args[0]
};
for(let i = 1; i < args.length; i++){
let props = args[i];
for(let key in props){
let a = result[key];
let b = props[key];
// Chain events
if (typeof a === 'function' && typeof b === 'function' && // This is a lot faster than a regex.
key[0] === 'o' && key[1] === 'n' && key.charCodeAt(2) >= /* 'A' */ 65 && key.charCodeAt(2) <= /* 'Z' */ 90) result[key] = (0, $ff5963eb1fccf552$export$e08e3b67e392101e)(a, b);
else if ((key === 'className' || key === 'UNSAFE_className') && typeof a === 'string' && typeof b === 'string') result[key] = (0, $7jXr9$clsx)(a, b);
else if (key === 'id' && a && b) result.id = (0, $bdb11010cef70236$export$cd8c9cb68f842629)(a, b);
else result[key] = b !== undefined ? b : a;
}
}
return result;
}
export {$3ef42575df84b30b$export$9d1611c77c2fe928 as mergeProps};
//# sourceMappingURL=mergeProps.module.js.map
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAwBM,SAAS,0CAAiC,GAAG,IAAO;IACzD,oFAAoF;IACpF,uDAAuD;IACvD,IAAI,SAAgB;QAAC,GAAG,IAAI,CAAC,EAAE;IAAA;IAC/B,IAAK,IAAI,IAAI,GAAG,IAAI,KAAK,MAAM,EAAE,IAAK;QACpC,IAAI,QAAQ,IAAI,CAAC,EAAE;QACnB,IAAK,IAAI,OAAO,MAAO;YACrB,IAAI,IAAI,MAAM,CAAC,IAAI;YACnB,IAAI,IAAI,KAAK,CAAC,IAAI;YAElB,eAAe;YACf,IACE,OAAO,MAAM,cACb,OAAO,MAAM,cACb,qCAAqC;YACrC,GAAG,CAAC,EAAE,KAAK,OACX,GAAG,CAAC,EAAE,KAAK,OACX,IAAI,UAAU,CAAC,MAAM,OAAO,GAAG,MAC/B,IAAI,UAAU,CAAC,MAAM,OAAO,GAAG,IAE/B,MAAM,CAAC,IAAI,GAAG,CAAA,GAAA,yCAAI,EAAE,GAAG;iBAGlB,IACL,AAAC,CAAA,QAAQ,eAAe,QAAQ,kBAAiB,KACjD,OAAO,MAAM,YACb,OAAO,MAAM,UAEb,MAAM,CAAC,IAAI,GAAG,CAAA,GAAA,WAAG,EAAE,GAAG;iBACjB,IAAI,QAAQ,QAAQ,KAAK,GAC9B,OAAO,EAAE,GAAG,CAAA,GAAA,yCAAO,EAAE,GAAG;iBAGxB,MAAM,CAAC,IAAI,GAAG,MAAM,YAAY,IAAI;QAExC;IACF;IAEA,OAAO;AACT","sources":["packages/@react-aria/utils/src/mergeProps.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {chain} from './chain';\nimport clsx from 'clsx';\nimport {mergeIds} from './useId';\n\ninterface Props {\n [key: string]: any\n}\n\ntype PropsArg = Props | null | undefined;\n\n// taken from: https://stackoverflow.com/questions/51603250/typescript-3-parameter-list-intersection-type/51604379#51604379\ntype TupleTypes<T> = { [P in keyof T]: T[P] } extends { [key: number]: infer V } ? NullToObject<V> : never;\ntype NullToObject<T> = T extends (null | undefined) ? {} : T;\n\ntype UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;\n\n/**\n * Merges multiple props objects together. Event handlers are chained,\n * classNames are combined, and ids are deduplicated.\n * For all other props, the last prop object overrides all previous ones.\n * @param args - Multiple sets of props to merge together.\n */\nexport function mergeProps<T extends PropsArg[]>(...args: T): UnionToIntersection<TupleTypes<T>> {\n // Start with a base clone of the first argument. This is a lot faster than starting\n // with an empty object and adding properties as we go.\n let result: Props = {...args[0]};\n for (let i = 1; i < args.length; i++) {\n let props = args[i];\n for (let key in props) {\n let a = result[key];\n let b = props[key];\n\n // Chain events\n if (\n typeof a === 'function' &&\n typeof b === 'function' &&\n // This is a lot faster than a regex.\n key[0] === 'o' &&\n key[1] === 'n' &&\n key.charCodeAt(2) >= /* 'A' */ 65 &&\n key.charCodeAt(2) <= /* 'Z' */ 90\n ) {\n result[key] = chain(a, b);\n\n // Merge classnames, sometimes classNames are empty string which eval to false, so we just need to do a type check\n } else if (\n (key === 'className' || key === 'UNSAFE_className') &&\n typeof a === 'string' &&\n typeof b === 'string'\n ) {\n result[key] = clsx(a, b);\n } else if (key === 'id' && a && b) {\n result.id = mergeIds(a, b);\n // Override others\n } else {\n result[key] = b !== undefined ? b : a;\n }\n }\n }\n\n return result as UnionToIntersection<TupleTypes<T>>;\n}\n"],"names":[],"version":3,"file":"mergeProps.module.js.map"}
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "mergeRefs", () => $f05dc24eafaeb7e2$export$c9058316764c140e);
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ function $f05dc24eafaeb7e2$export$c9058316764c140e(...refs) {
if (refs.length === 1 && refs[0]) return refs[0];
return (value)=>{
let hasCleanup = false;
const cleanups = refs.map((ref)=>{
const cleanup = $f05dc24eafaeb7e2$var$setRef(ref, value);
hasCleanup || (hasCleanup = typeof cleanup == 'function');
return cleanup;
});
if (hasCleanup) return ()=>{
cleanups.forEach((cleanup, i)=>{
if (typeof cleanup === 'function') cleanup();
else $f05dc24eafaeb7e2$var$setRef(refs[i], null);
});
};
};
}
function $f05dc24eafaeb7e2$var$setRef(ref, value) {
if (typeof ref === 'function') return ref(value);
else if (ref != null) ref.current = value;
}
//# sourceMappingURL=mergeRefs.main.js.map
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC,GAOM,SAAS,0CAAa,GAAG,IAA4D;IAC1F,IAAI,KAAK,MAAM,KAAK,KAAK,IAAI,CAAC,EAAE,EAC9B,OAAO,IAAI,CAAC,EAAE;IAGhB,OAAO,CAAC;QACN,IAAI,aAAa;QAEjB,MAAM,WAAW,KAAK,GAAG,CAAC,CAAA;YACxB,MAAM,UAAU,6BAAO,KAAK;YAC5B,eAAA,aAAe,OAAO,WAAW;YACjC,OAAO;QACT;QAEA,IAAI,YACF,OAAO;YACL,SAAS,OAAO,CAAC,CAAC,SAAS;gBACzB,IAAI,OAAO,YAAY,YACrB;qBAEA,6BAAO,IAAI,CAAC,EAAE,EAAE;YAEpB;QACF;IAEJ;AACF;AAEA,SAAS,6BAAU,GAAoD,EAAE,KAAQ;IAC/E,IAAI,OAAO,QAAQ,YACjB,OAAO,IAAI;SACN,IAAI,OAAO,MAChB,IAAI,OAAO,GAAG;AAElB","sources":["packages/@react-aria/utils/src/mergeRefs.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {MutableRefObject, Ref} from 'react';\n\n/**\n * Merges multiple refs into one. Works with either callback or object refs.\n */\nexport function mergeRefs<T>(...refs: Array<Ref<T> | MutableRefObject<T> | null | undefined>): Ref<T> {\n if (refs.length === 1 && refs[0]) {\n return refs[0];\n }\n\n return (value: T | null) => {\n let hasCleanup = false;\n\n const cleanups = refs.map(ref => {\n const cleanup = setRef(ref, value);\n hasCleanup ||= typeof cleanup == 'function';\n return cleanup;\n });\n\n if (hasCleanup) {\n return () => {\n cleanups.forEach((cleanup, i) => {\n if (typeof cleanup === 'function') {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n });\n };\n }\n };\n}\n\nfunction setRef<T>(ref: Ref<T> | MutableRefObject<T> | null | undefined, value: T) {\n if (typeof ref === 'function') {\n return ref(value);\n } else if (ref != null) {\n ref.current = value;\n }\n}\n"],"names":[],"version":3,"file":"mergeRefs.main.js.map"}
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ function $5dc95899b306f630$export$c9058316764c140e(...refs) {
if (refs.length === 1 && refs[0]) return refs[0];
return (value)=>{
let hasCleanup = false;
const cleanups = refs.map((ref)=>{
const cleanup = $5dc95899b306f630$var$setRef(ref, value);
hasCleanup || (hasCleanup = typeof cleanup == 'function');
return cleanup;
});
if (hasCleanup) return ()=>{
cleanups.forEach((cleanup, i)=>{
if (typeof cleanup === 'function') cleanup();
else $5dc95899b306f630$var$setRef(refs[i], null);
});
};
};
}
function $5dc95899b306f630$var$setRef(ref, value) {
if (typeof ref === 'function') return ref(value);
else if (ref != null) ref.current = value;
}
export {$5dc95899b306f630$export$c9058316764c140e as mergeRefs};
//# sourceMappingURL=mergeRefs.module.js.map
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ function $5dc95899b306f630$export$c9058316764c140e(...refs) {
if (refs.length === 1 && refs[0]) return refs[0];
return (value)=>{
let hasCleanup = false;
const cleanups = refs.map((ref)=>{
const cleanup = $5dc95899b306f630$var$setRef(ref, value);
hasCleanup || (hasCleanup = typeof cleanup == 'function');
return cleanup;
});
if (hasCleanup) return ()=>{
cleanups.forEach((cleanup, i)=>{
if (typeof cleanup === 'function') cleanup();
else $5dc95899b306f630$var$setRef(refs[i], null);
});
};
};
}
function $5dc95899b306f630$var$setRef(ref, value) {
if (typeof ref === 'function') return ref(value);
else if (ref != null) ref.current = value;
}
export {$5dc95899b306f630$export$c9058316764c140e as mergeRefs};
//# sourceMappingURL=mergeRefs.module.js.map
{"mappings":"AAAA;;;;;;;;;;CAUC,GAOM,SAAS,0CAAa,GAAG,IAA4D;IAC1F,IAAI,KAAK,MAAM,KAAK,KAAK,IAAI,CAAC,EAAE,EAC9B,OAAO,IAAI,CAAC,EAAE;IAGhB,OAAO,CAAC;QACN,IAAI,aAAa;QAEjB,MAAM,WAAW,KAAK,GAAG,CAAC,CAAA;YACxB,MAAM,UAAU,6BAAO,KAAK;YAC5B,eAAA,aAAe,OAAO,WAAW;YACjC,OAAO;QACT;QAEA,IAAI,YACF,OAAO;YACL,SAAS,OAAO,CAAC,CAAC,SAAS;gBACzB,IAAI,OAAO,YAAY,YACrB;qBAEA,6BAAO,IAAI,CAAC,EAAE,EAAE;YAEpB;QACF;IAEJ;AACF;AAEA,SAAS,6BAAU,GAAoD,EAAE,KAAQ;IAC/E,IAAI,OAAO,QAAQ,YACjB,OAAO,IAAI;SACN,IAAI,OAAO,MAChB,IAAI,OAAO,GAAG;AAElB","sources":["packages/@react-aria/utils/src/mergeRefs.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {MutableRefObject, Ref} from 'react';\n\n/**\n * Merges multiple refs into one. Works with either callback or object refs.\n */\nexport function mergeRefs<T>(...refs: Array<Ref<T> | MutableRefObject<T> | null | undefined>): Ref<T> {\n if (refs.length === 1 && refs[0]) {\n return refs[0];\n }\n\n return (value: T | null) => {\n let hasCleanup = false;\n\n const cleanups = refs.map(ref => {\n const cleanup = setRef(ref, value);\n hasCleanup ||= typeof cleanup == 'function';\n return cleanup;\n });\n\n if (hasCleanup) {\n return () => {\n cleanups.forEach((cleanup, i) => {\n if (typeof cleanup === 'function') {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n });\n };\n }\n };\n}\n\nfunction setRef<T>(ref: Ref<T> | MutableRefObject<T> | null | undefined, value: T) {\n if (typeof ref === 'function') {\n return ref(value);\n } else if (ref != null) {\n ref.current = value;\n }\n}\n"],"names":[],"version":3,"file":"mergeRefs.module.js.map"}
var $1117b6c0d4c4c164$exports = require("./focusWithoutScrolling.main.js");
var $9e20cff0af27e8cc$exports = require("./platform.main.js");
var $6kLG7$react = require("react");
function $parcel$interopDefault(a) {
return a && a.__esModule ? a.default : a;
}
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "RouterProvider", () => $4068a0fae83b6d84$export$323e4fc2fa4753fb);
$parcel$export(module.exports, "shouldClientNavigate", () => $4068a0fae83b6d84$export$efa8c9099e530235);
$parcel$export(module.exports, "openLink", () => $4068a0fae83b6d84$export$95185d699e05d4d7);
$parcel$export(module.exports, "useRouter", () => $4068a0fae83b6d84$export$9a302a45f65d0572);
$parcel$export(module.exports, "useSyntheticLinkProps", () => $4068a0fae83b6d84$export$bdc77b0c0a3a85d6);
$parcel$export(module.exports, "getSyntheticLinkProps", () => $4068a0fae83b6d84$export$51437d503373d223);
$parcel$export(module.exports, "useLinkProps", () => $4068a0fae83b6d84$export$7e924b3091a3bd18);
$parcel$export(module.exports, "handleLinkClick", () => $4068a0fae83b6d84$export$13aea1a3cb5e3f1f);
/*
* Copyright 2023 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
const $4068a0fae83b6d84$var$RouterContext = /*#__PURE__*/ (0, $6kLG7$react.createContext)({
isNative: true,
open: $4068a0fae83b6d84$var$openSyntheticLink,
useHref: (href)=>href
});
function $4068a0fae83b6d84$export$323e4fc2fa4753fb(props) {
let { children: children, navigate: navigate, useHref: useHref } = props;
let ctx = (0, $6kLG7$react.useMemo)(()=>({
isNative: false,
open: (target, modifiers, href, routerOptions)=>{
$4068a0fae83b6d84$var$getSyntheticLink(target, (link)=>{
if ($4068a0fae83b6d84$export$efa8c9099e530235(link, modifiers)) navigate(href, routerOptions);
else $4068a0fae83b6d84$export$95185d699e05d4d7(link, modifiers);
});
},
useHref: useHref || ((href)=>href)
}), [
navigate,
useHref
]);
return /*#__PURE__*/ (0, ($parcel$interopDefault($6kLG7$react))).createElement($4068a0fae83b6d84$var$RouterContext.Provider, {
value: ctx
}, children);
}
function $4068a0fae83b6d84$export$9a302a45f65d0572() {
return (0, $6kLG7$react.useContext)($4068a0fae83b6d84$var$RouterContext);
}
function $4068a0fae83b6d84$export$efa8c9099e530235(link, modifiers) {
// Use getAttribute here instead of link.target. Firefox will default link.target to "_parent" when inside an iframe.
let target = link.getAttribute('target');
return (!target || target === '_self') && link.origin === location.origin && !link.hasAttribute('download') && !modifiers.metaKey && // open in new tab (mac)
!modifiers.ctrlKey && // open in new tab (windows)
!modifiers.altKey && // download
!modifiers.shiftKey;
}
function $4068a0fae83b6d84$export$95185d699e05d4d7(target, modifiers, setOpening = true) {
var _window_event_type, _window_event;
let { metaKey: metaKey, ctrlKey: ctrlKey, altKey: altKey, shiftKey: shiftKey } = modifiers;
// Firefox does not recognize keyboard events as a user action by default, and the popup blocker
// will prevent links with target="_blank" from opening. However, it does allow the event if the
// Command/Control key is held, which opens the link in a background tab. This seems like the best we can do.
// See https://bugzilla.mozilla.org/show_bug.cgi?id=257870 and https://bugzilla.mozilla.org/show_bug.cgi?id=746640.
if ((0, $9e20cff0af27e8cc$exports.isFirefox)() && ((_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') {
if ((0, $9e20cff0af27e8cc$exports.isMac)()) metaKey = true;
else ctrlKey = true;
}
// WebKit does not support firing click events with modifier keys, but does support keyboard events.
// https://github.com/WebKit/WebKit/blob/c03d0ac6e6db178f90923a0a63080b5ca210d25f/Source/WebCore/html/HTMLAnchorElement.cpp#L184
let event = (0, $9e20cff0af27e8cc$exports.isWebKit)() && (0, $9e20cff0af27e8cc$exports.isMac)() && !(0, $9e20cff0af27e8cc$exports.isIPad)() && process.env.NODE_ENV !== 'test' ? new KeyboardEvent('keydown', {
keyIdentifier: 'Enter',
metaKey: metaKey,
ctrlKey: ctrlKey,
altKey: altKey,
shiftKey: shiftKey
}) : new MouseEvent('click', {
metaKey: metaKey,
ctrlKey: ctrlKey,
altKey: altKey,
shiftKey: shiftKey,
detail: 1,
bubbles: true,
cancelable: true
});
$4068a0fae83b6d84$export$95185d699e05d4d7.isOpening = setOpening;
(0, $1117b6c0d4c4c164$exports.focusWithoutScrolling)(target);
target.dispatchEvent(event);
$4068a0fae83b6d84$export$95185d699e05d4d7.isOpening = false;
}
// https://github.com/parcel-bundler/parcel/issues/8724
$4068a0fae83b6d84$export$95185d699e05d4d7.isOpening = false;
function $4068a0fae83b6d84$var$getSyntheticLink(target, open) {
if (target instanceof HTMLAnchorElement) open(target);
else if (target.hasAttribute('data-href')) {
let link = document.createElement('a');
link.href = target.getAttribute('data-href');
if (target.hasAttribute('data-target')) link.target = target.getAttribute('data-target');
if (target.hasAttribute('data-rel')) link.rel = target.getAttribute('data-rel');
if (target.hasAttribute('data-download')) link.download = target.getAttribute('data-download');
if (target.hasAttribute('data-ping')) link.ping = target.getAttribute('data-ping');
if (target.hasAttribute('data-referrer-policy')) link.referrerPolicy = target.getAttribute('data-referrer-policy');
target.appendChild(link);
open(link);
target.removeChild(link);
}
}
function $4068a0fae83b6d84$var$openSyntheticLink(target, modifiers) {
$4068a0fae83b6d84$var$getSyntheticLink(target, (link)=>$4068a0fae83b6d84$export$95185d699e05d4d7(link, modifiers));
}
function $4068a0fae83b6d84$export$bdc77b0c0a3a85d6(props) {
let router = $4068a0fae83b6d84$export$9a302a45f65d0572();
var _props_href;
const href = router.useHref((_props_href = props.href) !== null && _props_href !== void 0 ? _props_href : '');
return {
'data-href': props.href ? href : undefined,
'data-target': props.target,
'data-rel': props.rel,
'data-download': props.download,
'data-ping': props.ping,
'data-referrer-policy': props.referrerPolicy
};
}
function $4068a0fae83b6d84$export$51437d503373d223(props) {
return {
'data-href': props.href,
'data-target': props.target,
'data-rel': props.rel,
'data-download': props.download,
'data-ping': props.ping,
'data-referrer-policy': props.referrerPolicy
};
}
function $4068a0fae83b6d84$export$7e924b3091a3bd18(props) {
let router = $4068a0fae83b6d84$export$9a302a45f65d0572();
var _props_href;
const href = router.useHref((_props_href = props === null || props === void 0 ? void 0 : props.href) !== null && _props_href !== void 0 ? _props_href : '');
return {
href: (props === null || props === void 0 ? void 0 : props.href) ? href : undefined,
target: props === null || props === void 0 ? void 0 : props.target,
rel: props === null || props === void 0 ? void 0 : props.rel,
download: props === null || props === void 0 ? void 0 : props.download,
ping: props === null || props === void 0 ? void 0 : props.ping,
referrerPolicy: props === null || props === void 0 ? void 0 : props.referrerPolicy
};
}
function $4068a0fae83b6d84$export$13aea1a3cb5e3f1f(e, router, href, routerOptions) {
// If a custom router is provided, prevent default and forward if this link should client navigate.
if (!router.isNative && e.currentTarget instanceof HTMLAnchorElement && e.currentTarget.href && // If props are applied to a router Link component, it may have already prevented default.
!e.isDefaultPrevented() && $4068a0fae83b6d84$export$efa8c9099e530235(e.currentTarget, e) && href) {
e.preventDefault();
router.open(e.currentTarget, e, href, routerOptions);
}
}
//# sourceMappingURL=openLink.main.js.map
{"mappings":"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","sources":["packages/@react-aria/utils/src/openLink.tsx"],"sourcesContent":["/*\n * Copyright 2023 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {focusWithoutScrolling, isMac, isWebKit} from './index';\nimport {Href, LinkDOMProps, RouterOptions} from '@react-types/shared';\nimport {isFirefox, isIPad} from './platform';\nimport React, {createContext, DOMAttributes, JSX, MouseEvent as ReactMouseEvent, ReactNode, useContext, useMemo} from 'react';\n\ninterface Router {\n isNative: boolean,\n open: (target: Element, modifiers: Modifiers, href: Href, routerOptions: RouterOptions | undefined) => void,\n useHref: (href: Href) => string\n}\n\nconst RouterContext = createContext<Router>({\n isNative: true,\n open: openSyntheticLink,\n useHref: (href) => href\n});\n\ninterface RouterProviderProps {\n navigate: (path: Href, routerOptions: RouterOptions | undefined) => void,\n useHref?: (href: Href) => string,\n children: ReactNode\n}\n\n/**\n * A RouterProvider accepts a `navigate` function from a framework or client side router,\n * and provides it to all nested React Aria links to enable client side navigation.\n */\nexport function RouterProvider(props: RouterProviderProps): JSX.Element {\n let {children, navigate, useHref} = props;\n\n let ctx = useMemo(() => ({\n isNative: false,\n open: (target: Element, modifiers: Modifiers, href: Href, routerOptions: RouterOptions | undefined) => {\n getSyntheticLink(target, link => {\n if (shouldClientNavigate(link, modifiers)) {\n navigate(href, routerOptions);\n } else {\n openLink(link, modifiers);\n }\n });\n },\n useHref: useHref || ((href) => href)\n }), [navigate, useHref]);\n\n return (\n <RouterContext.Provider value={ctx}>\n {children}\n </RouterContext.Provider>\n );\n}\n\nexport function useRouter(): Router {\n return useContext(RouterContext);\n}\n\ninterface Modifiers {\n metaKey?: boolean,\n ctrlKey?: boolean,\n altKey?: boolean,\n shiftKey?: boolean\n}\n\nexport function shouldClientNavigate(link: HTMLAnchorElement, modifiers: Modifiers): boolean {\n // Use getAttribute here instead of link.target. Firefox will default link.target to \"_parent\" when inside an iframe.\n let target = link.getAttribute('target');\n return (\n (!target || target === '_self') &&\n link.origin === location.origin &&\n !link.hasAttribute('download') &&\n !modifiers.metaKey && // open in new tab (mac)\n !modifiers.ctrlKey && // open in new tab (windows)\n !modifiers.altKey && // download\n !modifiers.shiftKey\n );\n}\n\nexport function openLink(target: HTMLAnchorElement, modifiers: Modifiers, setOpening = true): void {\n let {metaKey, ctrlKey, altKey, shiftKey} = modifiers;\n\n // Firefox does not recognize keyboard events as a user action by default, and the popup blocker\n // will prevent links with target=\"_blank\" from opening. However, it does allow the event if the\n // Command/Control key is held, which opens the link in a background tab. This seems like the best we can do.\n // See https://bugzilla.mozilla.org/show_bug.cgi?id=257870 and https://bugzilla.mozilla.org/show_bug.cgi?id=746640.\n if (isFirefox() && window.event?.type?.startsWith('key') && target.target === '_blank') {\n if (isMac()) {\n metaKey = true;\n } else {\n ctrlKey = true;\n }\n }\n\n // WebKit does not support firing click events with modifier keys, but does support keyboard events.\n // https://github.com/WebKit/WebKit/blob/c03d0ac6e6db178f90923a0a63080b5ca210d25f/Source/WebCore/html/HTMLAnchorElement.cpp#L184\n let event = isWebKit() && isMac() && !isIPad() && process.env.NODE_ENV !== 'test'\n // @ts-ignore - keyIdentifier is a non-standard property, but it's what webkit expects\n ? new KeyboardEvent('keydown', {keyIdentifier: 'Enter', metaKey, ctrlKey, altKey, shiftKey})\n : new MouseEvent('click', {metaKey, ctrlKey, altKey, shiftKey, detail: 1, bubbles: true, cancelable: true});\n (openLink as any).isOpening = setOpening;\n focusWithoutScrolling(target);\n target.dispatchEvent(event);\n (openLink as any).isOpening = false;\n}\n// https://github.com/parcel-bundler/parcel/issues/8724\n(openLink as any).isOpening = false;\n\nfunction getSyntheticLink(target: Element, open: (link: HTMLAnchorElement) => void) {\n if (target instanceof HTMLAnchorElement) {\n open(target);\n } else if (target.hasAttribute('data-href')) {\n let link = document.createElement('a');\n link.href = target.getAttribute('data-href')!;\n if (target.hasAttribute('data-target')) {\n link.target = target.getAttribute('data-target')!;\n }\n if (target.hasAttribute('data-rel')) {\n link.rel = target.getAttribute('data-rel')!;\n }\n if (target.hasAttribute('data-download')) {\n link.download = target.getAttribute('data-download')!;\n }\n if (target.hasAttribute('data-ping')) {\n link.ping = target.getAttribute('data-ping')!;\n }\n if (target.hasAttribute('data-referrer-policy')) {\n link.referrerPolicy = target.getAttribute('data-referrer-policy')!;\n }\n target.appendChild(link);\n open(link);\n target.removeChild(link);\n }\n}\n\nfunction openSyntheticLink(target: Element, modifiers: Modifiers) {\n getSyntheticLink(target, link => openLink(link, modifiers));\n}\n\nexport function useSyntheticLinkProps(props: LinkDOMProps): DOMAttributes<HTMLElement> {\n let router = useRouter();\n const href = router.useHref(props.href ?? '');\n return {\n 'data-href': props.href ? href : undefined,\n 'data-target': props.target,\n 'data-rel': props.rel,\n 'data-download': props.download,\n 'data-ping': props.ping,\n 'data-referrer-policy': props.referrerPolicy\n } as DOMAttributes<HTMLElement>;\n}\n\n/** @deprecated - For backward compatibility. */\nexport function getSyntheticLinkProps(props: LinkDOMProps): DOMAttributes<HTMLElement> {\n return {\n 'data-href': props.href,\n 'data-target': props.target,\n 'data-rel': props.rel,\n 'data-download': props.download,\n 'data-ping': props.ping,\n 'data-referrer-policy': props.referrerPolicy\n } as DOMAttributes<HTMLElement>;\n}\n\nexport function useLinkProps(props?: LinkDOMProps): LinkDOMProps {\n let router = useRouter();\n const href = router.useHref(props?.href ?? '');\n return {\n href: props?.href ? href : undefined,\n target: props?.target,\n rel: props?.rel,\n download: props?.download,\n ping: props?.ping,\n referrerPolicy: props?.referrerPolicy\n };\n}\n\nexport function handleLinkClick(e: ReactMouseEvent, router: Router, href: Href | undefined, routerOptions: RouterOptions | undefined): void {\n // If a custom router is provided, prevent default and forward if this link should client navigate.\n if (\n !router.isNative &&\n e.currentTarget instanceof HTMLAnchorElement &&\n e.currentTarget.href &&\n // If props are applied to a router Link component, it may have already prevented default.\n !e.isDefaultPrevented() &&\n shouldClientNavigate(e.currentTarget, e) &&\n href\n ) {\n e.preventDefault();\n router.open(e.currentTarget, e, href, routerOptions);\n }\n}\n"],"names":[],"version":3,"file":"openLink.main.js.map"}
import {focusWithoutScrolling as $7215afc6de606d6b$export$de79e2c695e052f3} from "./focusWithoutScrolling.mjs";
import {isMac as $c87311424ea30a05$export$9ac100e40613ea10, isWebKit as $c87311424ea30a05$export$78551043582a6a98, isFirefox as $c87311424ea30a05$export$b7d78993b74f766d, isIPad as $c87311424ea30a05$export$7bef049ce92e4224} from "./platform.mjs";
import $g3jFn$react, {createContext as $g3jFn$createContext, useMemo as $g3jFn$useMemo, useContext as $g3jFn$useContext} from "react";
/*
* Copyright 2023 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
const $ea8dcbcb9ea1b556$var$RouterContext = /*#__PURE__*/ (0, $g3jFn$createContext)({
isNative: true,
open: $ea8dcbcb9ea1b556$var$openSyntheticLink,
useHref: (href)=>href
});
function $ea8dcbcb9ea1b556$export$323e4fc2fa4753fb(props) {
let { children: children, navigate: navigate, useHref: useHref } = props;
let ctx = (0, $g3jFn$useMemo)(()=>({
isNative: false,
open: (target, modifiers, href, routerOptions)=>{
$ea8dcbcb9ea1b556$var$getSyntheticLink(target, (link)=>{
if ($ea8dcbcb9ea1b556$export$efa8c9099e530235(link, modifiers)) navigate(href, routerOptions);
else $ea8dcbcb9ea1b556$export$95185d699e05d4d7(link, modifiers);
});
},
useHref: useHref || ((href)=>href)
}), [
navigate,
useHref
]);
return /*#__PURE__*/ (0, $g3jFn$react).createElement($ea8dcbcb9ea1b556$var$RouterContext.Provider, {
value: ctx
}, children);
}
function $ea8dcbcb9ea1b556$export$9a302a45f65d0572() {
return (0, $g3jFn$useContext)($ea8dcbcb9ea1b556$var$RouterContext);
}
function $ea8dcbcb9ea1b556$export$efa8c9099e530235(link, modifiers) {
// Use getAttribute here instead of link.target. Firefox will default link.target to "_parent" when inside an iframe.
let target = link.getAttribute('target');
return (!target || target === '_self') && link.origin === location.origin && !link.hasAttribute('download') && !modifiers.metaKey && // open in new tab (mac)
!modifiers.ctrlKey && // open in new tab (windows)
!modifiers.altKey && // download
!modifiers.shiftKey;
}
function $ea8dcbcb9ea1b556$export$95185d699e05d4d7(target, modifiers, setOpening = true) {
var _window_event_type, _window_event;
let { metaKey: metaKey, ctrlKey: ctrlKey, altKey: altKey, shiftKey: shiftKey } = modifiers;
// Firefox does not recognize keyboard events as a user action by default, and the popup blocker
// will prevent links with target="_blank" from opening. However, it does allow the event if the
// Command/Control key is held, which opens the link in a background tab. This seems like the best we can do.
// See https://bugzilla.mozilla.org/show_bug.cgi?id=257870 and https://bugzilla.mozilla.org/show_bug.cgi?id=746640.
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') {
if ((0, $c87311424ea30a05$export$9ac100e40613ea10)()) metaKey = true;
else ctrlKey = true;
}
// WebKit does not support firing click events with modifier keys, but does support keyboard events.
// https://github.com/WebKit/WebKit/blob/c03d0ac6e6db178f90923a0a63080b5ca210d25f/Source/WebCore/html/HTMLAnchorElement.cpp#L184
let event = (0, $c87311424ea30a05$export$78551043582a6a98)() && (0, $c87311424ea30a05$export$9ac100e40613ea10)() && !(0, $c87311424ea30a05$export$7bef049ce92e4224)() && process.env.NODE_ENV !== 'test' ? new KeyboardEvent('keydown', {
keyIdentifier: 'Enter',
metaKey: metaKey,
ctrlKey: ctrlKey,
altKey: altKey,
shiftKey: shiftKey
}) : new MouseEvent('click', {
metaKey: metaKey,
ctrlKey: ctrlKey,
altKey: altKey,
shiftKey: shiftKey,
detail: 1,
bubbles: true,
cancelable: true
});
$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = setOpening;
(0, $7215afc6de606d6b$export$de79e2c695e052f3)(target);
target.dispatchEvent(event);
$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = false;
}
// https://github.com/parcel-bundler/parcel/issues/8724
$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = false;
function $ea8dcbcb9ea1b556$var$getSyntheticLink(target, open) {
if (target instanceof HTMLAnchorElement) open(target);
else if (target.hasAttribute('data-href')) {
let link = document.createElement('a');
link.href = target.getAttribute('data-href');
if (target.hasAttribute('data-target')) link.target = target.getAttribute('data-target');
if (target.hasAttribute('data-rel')) link.rel = target.getAttribute('data-rel');
if (target.hasAttribute('data-download')) link.download = target.getAttribute('data-download');
if (target.hasAttribute('data-ping')) link.ping = target.getAttribute('data-ping');
if (target.hasAttribute('data-referrer-policy')) link.referrerPolicy = target.getAttribute('data-referrer-policy');
target.appendChild(link);
open(link);
target.removeChild(link);
}
}
function $ea8dcbcb9ea1b556$var$openSyntheticLink(target, modifiers) {
$ea8dcbcb9ea1b556$var$getSyntheticLink(target, (link)=>$ea8dcbcb9ea1b556$export$95185d699e05d4d7(link, modifiers));
}
function $ea8dcbcb9ea1b556$export$bdc77b0c0a3a85d6(props) {
let router = $ea8dcbcb9ea1b556$export$9a302a45f65d0572();
var _props_href;
const href = router.useHref((_props_href = props.href) !== null && _props_href !== void 0 ? _props_href : '');
return {
'data-href': props.href ? href : undefined,
'data-target': props.target,
'data-rel': props.rel,
'data-download': props.download,
'data-ping': props.ping,
'data-referrer-policy': props.referrerPolicy
};
}
function $ea8dcbcb9ea1b556$export$51437d503373d223(props) {
return {
'data-href': props.href,
'data-target': props.target,
'data-rel': props.rel,
'data-download': props.download,
'data-ping': props.ping,
'data-referrer-policy': props.referrerPolicy
};
}
function $ea8dcbcb9ea1b556$export$7e924b3091a3bd18(props) {
let router = $ea8dcbcb9ea1b556$export$9a302a45f65d0572();
var _props_href;
const href = router.useHref((_props_href = props === null || props === void 0 ? void 0 : props.href) !== null && _props_href !== void 0 ? _props_href : '');
return {
href: (props === null || props === void 0 ? void 0 : props.href) ? href : undefined,
target: props === null || props === void 0 ? void 0 : props.target,
rel: props === null || props === void 0 ? void 0 : props.rel,
download: props === null || props === void 0 ? void 0 : props.download,
ping: props === null || props === void 0 ? void 0 : props.ping,
referrerPolicy: props === null || props === void 0 ? void 0 : props.referrerPolicy
};
}
function $ea8dcbcb9ea1b556$export$13aea1a3cb5e3f1f(e, router, href, routerOptions) {
// If a custom router is provided, prevent default and forward if this link should client navigate.
if (!router.isNative && e.currentTarget instanceof HTMLAnchorElement && e.currentTarget.href && // If props are applied to a router Link component, it may have already prevented default.
!e.isDefaultPrevented() && $ea8dcbcb9ea1b556$export$efa8c9099e530235(e.currentTarget, e) && href) {
e.preventDefault();
router.open(e.currentTarget, e, href, routerOptions);
}
}
export {$ea8dcbcb9ea1b556$export$323e4fc2fa4753fb as RouterProvider, $ea8dcbcb9ea1b556$export$efa8c9099e530235 as shouldClientNavigate, $ea8dcbcb9ea1b556$export$95185d699e05d4d7 as openLink, $ea8dcbcb9ea1b556$export$9a302a45f65d0572 as useRouter, $ea8dcbcb9ea1b556$export$bdc77b0c0a3a85d6 as useSyntheticLinkProps, $ea8dcbcb9ea1b556$export$51437d503373d223 as getSyntheticLinkProps, $ea8dcbcb9ea1b556$export$7e924b3091a3bd18 as useLinkProps, $ea8dcbcb9ea1b556$export$13aea1a3cb5e3f1f as handleLinkClick};
//# sourceMappingURL=openLink.module.js.map
import {focusWithoutScrolling as $7215afc6de606d6b$export$de79e2c695e052f3} from "./focusWithoutScrolling.module.js";
import {isMac as $c87311424ea30a05$export$9ac100e40613ea10, isWebKit as $c87311424ea30a05$export$78551043582a6a98, isFirefox as $c87311424ea30a05$export$b7d78993b74f766d, isIPad as $c87311424ea30a05$export$7bef049ce92e4224} from "./platform.module.js";
import $g3jFn$react, {createContext as $g3jFn$createContext, useMemo as $g3jFn$useMemo, useContext as $g3jFn$useContext} from "react";
/*
* Copyright 2023 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
const $ea8dcbcb9ea1b556$var$RouterContext = /*#__PURE__*/ (0, $g3jFn$createContext)({
isNative: true,
open: $ea8dcbcb9ea1b556$var$openSyntheticLink,
useHref: (href)=>href
});
function $ea8dcbcb9ea1b556$export$323e4fc2fa4753fb(props) {
let { children: children, navigate: navigate, useHref: useHref } = props;
let ctx = (0, $g3jFn$useMemo)(()=>({
isNative: false,
open: (target, modifiers, href, routerOptions)=>{
$ea8dcbcb9ea1b556$var$getSyntheticLink(target, (link)=>{
if ($ea8dcbcb9ea1b556$export$efa8c9099e530235(link, modifiers)) navigate(href, routerOptions);
else $ea8dcbcb9ea1b556$export$95185d699e05d4d7(link, modifiers);
});
},
useHref: useHref || ((href)=>href)
}), [
navigate,
useHref
]);
return /*#__PURE__*/ (0, $g3jFn$react).createElement($ea8dcbcb9ea1b556$var$RouterContext.Provider, {
value: ctx
}, children);
}
function $ea8dcbcb9ea1b556$export$9a302a45f65d0572() {
return (0, $g3jFn$useContext)($ea8dcbcb9ea1b556$var$RouterContext);
}
function $ea8dcbcb9ea1b556$export$efa8c9099e530235(link, modifiers) {
// Use getAttribute here instead of link.target. Firefox will default link.target to "_parent" when inside an iframe.
let target = link.getAttribute('target');
return (!target || target === '_self') && link.origin === location.origin && !link.hasAttribute('download') && !modifiers.metaKey && // open in new tab (mac)
!modifiers.ctrlKey && // open in new tab (windows)
!modifiers.altKey && // download
!modifiers.shiftKey;
}
function $ea8dcbcb9ea1b556$export$95185d699e05d4d7(target, modifiers, setOpening = true) {
var _window_event_type, _window_event;
let { metaKey: metaKey, ctrlKey: ctrlKey, altKey: altKey, shiftKey: shiftKey } = modifiers;
// Firefox does not recognize keyboard events as a user action by default, and the popup blocker
// will prevent links with target="_blank" from opening. However, it does allow the event if the
// Command/Control key is held, which opens the link in a background tab. This seems like the best we can do.
// See https://bugzilla.mozilla.org/show_bug.cgi?id=257870 and https://bugzilla.mozilla.org/show_bug.cgi?id=746640.
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') {
if ((0, $c87311424ea30a05$export$9ac100e40613ea10)()) metaKey = true;
else ctrlKey = true;
}
// WebKit does not support firing click events with modifier keys, but does support keyboard events.
// https://github.com/WebKit/WebKit/blob/c03d0ac6e6db178f90923a0a63080b5ca210d25f/Source/WebCore/html/HTMLAnchorElement.cpp#L184
let event = (0, $c87311424ea30a05$export$78551043582a6a98)() && (0, $c87311424ea30a05$export$9ac100e40613ea10)() && !(0, $c87311424ea30a05$export$7bef049ce92e4224)() && process.env.NODE_ENV !== 'test' ? new KeyboardEvent('keydown', {
keyIdentifier: 'Enter',
metaKey: metaKey,
ctrlKey: ctrlKey,
altKey: altKey,
shiftKey: shiftKey
}) : new MouseEvent('click', {
metaKey: metaKey,
ctrlKey: ctrlKey,
altKey: altKey,
shiftKey: shiftKey,
detail: 1,
bubbles: true,
cancelable: true
});
$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = setOpening;
(0, $7215afc6de606d6b$export$de79e2c695e052f3)(target);
target.dispatchEvent(event);
$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = false;
}
// https://github.com/parcel-bundler/parcel/issues/8724
$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = false;
function $ea8dcbcb9ea1b556$var$getSyntheticLink(target, open) {
if (target instanceof HTMLAnchorElement) open(target);
else if (target.hasAttribute('data-href')) {
let link = document.createElement('a');
link.href = target.getAttribute('data-href');
if (target.hasAttribute('data-target')) link.target = target.getAttribute('data-target');
if (target.hasAttribute('data-rel')) link.rel = target.getAttribute('data-rel');
if (target.hasAttribute('data-download')) link.download = target.getAttribute('data-download');
if (target.hasAttribute('data-ping')) link.ping = target.getAttribute('data-ping');
if (target.hasAttribute('data-referrer-policy')) link.referrerPolicy = target.getAttribute('data-referrer-policy');
target.appendChild(link);
open(link);
target.removeChild(link);
}
}
function $ea8dcbcb9ea1b556$var$openSyntheticLink(target, modifiers) {
$ea8dcbcb9ea1b556$var$getSyntheticLink(target, (link)=>$ea8dcbcb9ea1b556$export$95185d699e05d4d7(link, modifiers));
}
function $ea8dcbcb9ea1b556$export$bdc77b0c0a3a85d6(props) {
let router = $ea8dcbcb9ea1b556$export$9a302a45f65d0572();
var _props_href;
const href = router.useHref((_props_href = props.href) !== null && _props_href !== void 0 ? _props_href : '');
return {
'data-href': props.href ? href : undefined,
'data-target': props.target,
'data-rel': props.rel,
'data-download': props.download,
'data-ping': props.ping,
'data-referrer-policy': props.referrerPolicy
};
}
function $ea8dcbcb9ea1b556$export$51437d503373d223(props) {
return {
'data-href': props.href,
'data-target': props.target,
'data-rel': props.rel,
'data-download': props.download,
'data-ping': props.ping,
'data-referrer-policy': props.referrerPolicy
};
}
function $ea8dcbcb9ea1b556$export$7e924b3091a3bd18(props) {
let router = $ea8dcbcb9ea1b556$export$9a302a45f65d0572();
var _props_href;
const href = router.useHref((_props_href = props === null || props === void 0 ? void 0 : props.href) !== null && _props_href !== void 0 ? _props_href : '');
return {
href: (props === null || props === void 0 ? void 0 : props.href) ? href : undefined,
target: props === null || props === void 0 ? void 0 : props.target,
rel: props === null || props === void 0 ? void 0 : props.rel,
download: props === null || props === void 0 ? void 0 : props.download,
ping: props === null || props === void 0 ? void 0 : props.ping,
referrerPolicy: props === null || props === void 0 ? void 0 : props.referrerPolicy
};
}
function $ea8dcbcb9ea1b556$export$13aea1a3cb5e3f1f(e, router, href, routerOptions) {
// If a custom router is provided, prevent default and forward if this link should client navigate.
if (!router.isNative && e.currentTarget instanceof HTMLAnchorElement && e.currentTarget.href && // If props are applied to a router Link component, it may have already prevented default.
!e.isDefaultPrevented() && $ea8dcbcb9ea1b556$export$efa8c9099e530235(e.currentTarget, e) && href) {
e.preventDefault();
router.open(e.currentTarget, e, href, routerOptions);
}
}
export {$ea8dcbcb9ea1b556$export$323e4fc2fa4753fb as RouterProvider, $ea8dcbcb9ea1b556$export$efa8c9099e530235 as shouldClientNavigate, $ea8dcbcb9ea1b556$export$95185d699e05d4d7 as openLink, $ea8dcbcb9ea1b556$export$9a302a45f65d0572 as useRouter, $ea8dcbcb9ea1b556$export$bdc77b0c0a3a85d6 as useSyntheticLinkProps, $ea8dcbcb9ea1b556$export$51437d503373d223 as getSyntheticLinkProps, $ea8dcbcb9ea1b556$export$7e924b3091a3bd18 as useLinkProps, $ea8dcbcb9ea1b556$export$13aea1a3cb5e3f1f as handleLinkClick};
//# sourceMappingURL=openLink.module.js.map
{"mappings":"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","sources":["packages/@react-aria/utils/src/openLink.tsx"],"sourcesContent":["/*\n * Copyright 2023 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {focusWithoutScrolling, isMac, isWebKit} from './index';\nimport {Href, LinkDOMProps, RouterOptions} from '@react-types/shared';\nimport {isFirefox, isIPad} from './platform';\nimport React, {createContext, DOMAttributes, JSX, MouseEvent as ReactMouseEvent, ReactNode, useContext, useMemo} from 'react';\n\ninterface Router {\n isNative: boolean,\n open: (target: Element, modifiers: Modifiers, href: Href, routerOptions: RouterOptions | undefined) => void,\n useHref: (href: Href) => string\n}\n\nconst RouterContext = createContext<Router>({\n isNative: true,\n open: openSyntheticLink,\n useHref: (href) => href\n});\n\ninterface RouterProviderProps {\n navigate: (path: Href, routerOptions: RouterOptions | undefined) => void,\n useHref?: (href: Href) => string,\n children: ReactNode\n}\n\n/**\n * A RouterProvider accepts a `navigate` function from a framework or client side router,\n * and provides it to all nested React Aria links to enable client side navigation.\n */\nexport function RouterProvider(props: RouterProviderProps): JSX.Element {\n let {children, navigate, useHref} = props;\n\n let ctx = useMemo(() => ({\n isNative: false,\n open: (target: Element, modifiers: Modifiers, href: Href, routerOptions: RouterOptions | undefined) => {\n getSyntheticLink(target, link => {\n if (shouldClientNavigate(link, modifiers)) {\n navigate(href, routerOptions);\n } else {\n openLink(link, modifiers);\n }\n });\n },\n useHref: useHref || ((href) => href)\n }), [navigate, useHref]);\n\n return (\n <RouterContext.Provider value={ctx}>\n {children}\n </RouterContext.Provider>\n );\n}\n\nexport function useRouter(): Router {\n return useContext(RouterContext);\n}\n\ninterface Modifiers {\n metaKey?: boolean,\n ctrlKey?: boolean,\n altKey?: boolean,\n shiftKey?: boolean\n}\n\nexport function shouldClientNavigate(link: HTMLAnchorElement, modifiers: Modifiers): boolean {\n // Use getAttribute here instead of link.target. Firefox will default link.target to \"_parent\" when inside an iframe.\n let target = link.getAttribute('target');\n return (\n (!target || target === '_self') &&\n link.origin === location.origin &&\n !link.hasAttribute('download') &&\n !modifiers.metaKey && // open in new tab (mac)\n !modifiers.ctrlKey && // open in new tab (windows)\n !modifiers.altKey && // download\n !modifiers.shiftKey\n );\n}\n\nexport function openLink(target: HTMLAnchorElement, modifiers: Modifiers, setOpening = true): void {\n let {metaKey, ctrlKey, altKey, shiftKey} = modifiers;\n\n // Firefox does not recognize keyboard events as a user action by default, and the popup blocker\n // will prevent links with target=\"_blank\" from opening. However, it does allow the event if the\n // Command/Control key is held, which opens the link in a background tab. This seems like the best we can do.\n // See https://bugzilla.mozilla.org/show_bug.cgi?id=257870 and https://bugzilla.mozilla.org/show_bug.cgi?id=746640.\n if (isFirefox() && window.event?.type?.startsWith('key') && target.target === '_blank') {\n if (isMac()) {\n metaKey = true;\n } else {\n ctrlKey = true;\n }\n }\n\n // WebKit does not support firing click events with modifier keys, but does support keyboard events.\n // https://github.com/WebKit/WebKit/blob/c03d0ac6e6db178f90923a0a63080b5ca210d25f/Source/WebCore/html/HTMLAnchorElement.cpp#L184\n let event = isWebKit() && isMac() && !isIPad() && process.env.NODE_ENV !== 'test'\n // @ts-ignore - keyIdentifier is a non-standard property, but it's what webkit expects\n ? new KeyboardEvent('keydown', {keyIdentifier: 'Enter', metaKey, ctrlKey, altKey, shiftKey})\n : new MouseEvent('click', {metaKey, ctrlKey, altKey, shiftKey, detail: 1, bubbles: true, cancelable: true});\n (openLink as any).isOpening = setOpening;\n focusWithoutScrolling(target);\n target.dispatchEvent(event);\n (openLink as any).isOpening = false;\n}\n// https://github.com/parcel-bundler/parcel/issues/8724\n(openLink as any).isOpening = false;\n\nfunction getSyntheticLink(target: Element, open: (link: HTMLAnchorElement) => void) {\n if (target instanceof HTMLAnchorElement) {\n open(target);\n } else if (target.hasAttribute('data-href')) {\n let link = document.createElement('a');\n link.href = target.getAttribute('data-href')!;\n if (target.hasAttribute('data-target')) {\n link.target = target.getAttribute('data-target')!;\n }\n if (target.hasAttribute('data-rel')) {\n link.rel = target.getAttribute('data-rel')!;\n }\n if (target.hasAttribute('data-download')) {\n link.download = target.getAttribute('data-download')!;\n }\n if (target.hasAttribute('data-ping')) {\n link.ping = target.getAttribute('data-ping')!;\n }\n if (target.hasAttribute('data-referrer-policy')) {\n link.referrerPolicy = target.getAttribute('data-referrer-policy')!;\n }\n target.appendChild(link);\n open(link);\n target.removeChild(link);\n }\n}\n\nfunction openSyntheticLink(target: Element, modifiers: Modifiers) {\n getSyntheticLink(target, link => openLink(link, modifiers));\n}\n\nexport function useSyntheticLinkProps(props: LinkDOMProps): DOMAttributes<HTMLElement> {\n let router = useRouter();\n const href = router.useHref(props.href ?? '');\n return {\n 'data-href': props.href ? href : undefined,\n 'data-target': props.target,\n 'data-rel': props.rel,\n 'data-download': props.download,\n 'data-ping': props.ping,\n 'data-referrer-policy': props.referrerPolicy\n } as DOMAttributes<HTMLElement>;\n}\n\n/** @deprecated - For backward compatibility. */\nexport function getSyntheticLinkProps(props: LinkDOMProps): DOMAttributes<HTMLElement> {\n return {\n 'data-href': props.href,\n 'data-target': props.target,\n 'data-rel': props.rel,\n 'data-download': props.download,\n 'data-ping': props.ping,\n 'data-referrer-policy': props.referrerPolicy\n } as DOMAttributes<HTMLElement>;\n}\n\nexport function useLinkProps(props?: LinkDOMProps): LinkDOMProps {\n let router = useRouter();\n const href = router.useHref(props?.href ?? '');\n return {\n href: props?.href ? href : undefined,\n target: props?.target,\n rel: props?.rel,\n download: props?.download,\n ping: props?.ping,\n referrerPolicy: props?.referrerPolicy\n };\n}\n\nexport function handleLinkClick(e: ReactMouseEvent, router: Router, href: Href | undefined, routerOptions: RouterOptions | undefined): void {\n // If a custom router is provided, prevent default and forward if this link should client navigate.\n if (\n !router.isNative &&\n e.currentTarget instanceof HTMLAnchorElement &&\n e.currentTarget.href &&\n // If props are applied to a router Link component, it may have already prevented default.\n !e.isDefaultPrevented() &&\n shouldClientNavigate(e.currentTarget, e) &&\n href\n ) {\n e.preventDefault();\n router.open(e.currentTarget, e, href, routerOptions);\n }\n}\n"],"names":[],"version":3,"file":"openLink.module.js.map"}
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "isMac", () => $9e20cff0af27e8cc$export$9ac100e40613ea10);
$parcel$export(module.exports, "isIPhone", () => $9e20cff0af27e8cc$export$186c6964ca17d99);
$parcel$export(module.exports, "isIPad", () => $9e20cff0af27e8cc$export$7bef049ce92e4224);
$parcel$export(module.exports, "isIOS", () => $9e20cff0af27e8cc$export$fedb369cb70207f1);
$parcel$export(module.exports, "isAppleDevice", () => $9e20cff0af27e8cc$export$e1865c3bedcd822b);
$parcel$export(module.exports, "isWebKit", () => $9e20cff0af27e8cc$export$78551043582a6a98);
$parcel$export(module.exports, "isChrome", () => $9e20cff0af27e8cc$export$6446a186d09e379e);
$parcel$export(module.exports, "isAndroid", () => $9e20cff0af27e8cc$export$a11b0059900ceec8);
$parcel$export(module.exports, "isFirefox", () => $9e20cff0af27e8cc$export$b7d78993b74f766d);
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ function $9e20cff0af27e8cc$var$testUserAgent(re) {
var _window_navigator_userAgentData;
if (typeof window === 'undefined' || window.navigator == null) return false;
let brands = (_window_navigator_userAgentData = window.navigator['userAgentData']) === null || _window_navigator_userAgentData === void 0 ? void 0 : _window_navigator_userAgentData.brands;
return Array.isArray(brands) && brands.some((brand)=>re.test(brand.brand)) || re.test(window.navigator.userAgent);
}
function $9e20cff0af27e8cc$var$testPlatform(re) {
var _window_navigator_userAgentData;
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;
}
function $9e20cff0af27e8cc$var$cached(fn) {
if (process.env.NODE_ENV === 'test') return fn;
let res = null;
return ()=>{
if (res == null) res = fn();
return res;
};
}
const $9e20cff0af27e8cc$export$9ac100e40613ea10 = $9e20cff0af27e8cc$var$cached(function() {
return $9e20cff0af27e8cc$var$testPlatform(/^Mac/i);
});
const $9e20cff0af27e8cc$export$186c6964ca17d99 = $9e20cff0af27e8cc$var$cached(function() {
return $9e20cff0af27e8cc$var$testPlatform(/^iPhone/i);
});
const $9e20cff0af27e8cc$export$7bef049ce92e4224 = $9e20cff0af27e8cc$var$cached(function() {
return $9e20cff0af27e8cc$var$testPlatform(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
$9e20cff0af27e8cc$export$9ac100e40613ea10() && navigator.maxTouchPoints > 1;
});
const $9e20cff0af27e8cc$export$fedb369cb70207f1 = $9e20cff0af27e8cc$var$cached(function() {
return $9e20cff0af27e8cc$export$186c6964ca17d99() || $9e20cff0af27e8cc$export$7bef049ce92e4224();
});
const $9e20cff0af27e8cc$export$e1865c3bedcd822b = $9e20cff0af27e8cc$var$cached(function() {
return $9e20cff0af27e8cc$export$9ac100e40613ea10() || $9e20cff0af27e8cc$export$fedb369cb70207f1();
});
const $9e20cff0af27e8cc$export$78551043582a6a98 = $9e20cff0af27e8cc$var$cached(function() {
return $9e20cff0af27e8cc$var$testUserAgent(/AppleWebKit/i) && !$9e20cff0af27e8cc$export$6446a186d09e379e();
});
const $9e20cff0af27e8cc$export$6446a186d09e379e = $9e20cff0af27e8cc$var$cached(function() {
return $9e20cff0af27e8cc$var$testUserAgent(/Chrome/i);
});
const $9e20cff0af27e8cc$export$a11b0059900ceec8 = $9e20cff0af27e8cc$var$cached(function() {
return $9e20cff0af27e8cc$var$testUserAgent(/Android/i);
});
const $9e20cff0af27e8cc$export$b7d78993b74f766d = $9e20cff0af27e8cc$var$cached(function() {
return $9e20cff0af27e8cc$var$testUserAgent(/Firefox/i);
});
//# sourceMappingURL=platform.main.js.map
{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,SAAS,oCAAc,EAAU;QAIlB;IAHb,IAAI,OAAO,WAAW,eAAe,OAAO,SAAS,IAAI,MACvD,OAAO;IAET,IAAI,UAAS,kCAAA,OAAO,SAAS,CAAC,gBAAgB,cAAjC,sDAAA,gCAAmC,MAAM;IACtD,OAAO,MAAM,OAAO,CAAC,WAAW,OAAO,IAAI,CAAC,CAAC,QAA4C,GAAG,IAAI,CAAC,MAAM,KAAK,MAC1G,GAAG,IAAI,CAAC,OAAO,SAAS,CAAC,SAAS;AACtC;AAEA,SAAS,mCAAa,EAAU;QAElB;IADZ,OAAO,OAAO,WAAW,eAAe,OAAO,SAAS,IAAI,OACxD,GAAG,IAAI,CAAC,EAAA,kCAAA,OAAO,SAAS,CAAC,gBAAgB,cAAjC,sDAAA,gCAAmC,QAAQ,KAAI,OAAO,SAAS,CAAC,QAAQ,IAChF;AACN;AAEA,SAAS,6BAAO,EAAiB;IAC/B,IAAI,QAAQ,GAAG,CAAC,QAAQ,KAAK,QAC3B,OAAO;IAGT,IAAI,MAAsB;IAC1B,OAAO;QACL,IAAI,OAAO,MACT,MAAM;QAER,OAAO;IACT;AACF;AAEO,MAAM,4CAAuB,6BAAO;IACzC,OAAO,mCAAa;AACtB;AAEO,MAAM,2CAA0B,6BAAO;IAC5C,OAAO,mCAAa;AACtB;AAEO,MAAM,4CAAwB,6BAAO;IAC1C,OAAO,mCAAa,aAClB,yFAAyF;IACxF,+CAAW,UAAU,cAAc,GAAG;AAC3C;AAEO,MAAM,4CAAuB,6BAAO;IACzC,OAAO,8CAAc;AACvB;AAEO,MAAM,4CAA+B,6BAAO;IACjD,OAAO,+CAAW;AACpB;AAEO,MAAM,4CAA0B,6BAAO;IAC5C,OAAO,oCAAc,mBAAmB,CAAC;AAC3C;AAEO,MAAM,4CAA0B,6BAAO;IAC5C,OAAO,oCAAc;AACvB;AAEO,MAAM,4CAA2B,6BAAO;IAC7C,OAAO,oCAAc;AACvB;AAEO,MAAM,4CAA2B,6BAAO;IAC7C,OAAO,oCAAc;AACvB","sources":["packages/@react-aria/utils/src/platform.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nfunction testUserAgent(re: RegExp) {\n if (typeof window === 'undefined' || window.navigator == null) {\n return false;\n }\n let brands = window.navigator['userAgentData']?.brands;\n return Array.isArray(brands) && brands.some((brand: {brand: string, version: string}) => re.test(brand.brand)) ||\n re.test(window.navigator.userAgent);\n}\n\nfunction testPlatform(re: RegExp) {\n return typeof window !== 'undefined' && window.navigator != null\n ? re.test(window.navigator['userAgentData']?.platform || window.navigator.platform)\n : false;\n}\n\nfunction cached(fn: () => boolean) {\n if (process.env.NODE_ENV === 'test') {\n return fn;\n }\n\n let res: boolean | null = null;\n return () => {\n if (res == null) {\n res = fn();\n }\n return res;\n };\n}\n\nexport const isMac: () => boolean = cached(function () {\n return testPlatform(/^Mac/i);\n});\n\nexport const isIPhone: () => boolean = cached(function () {\n return testPlatform(/^iPhone/i);\n});\n\nexport const isIPad: () => boolean = cached(function () {\n return testPlatform(/^iPad/i) ||\n // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.\n (isMac() && navigator.maxTouchPoints > 1);\n});\n\nexport const isIOS: () => boolean = cached(function () {\n return isIPhone() || isIPad();\n});\n\nexport const isAppleDevice: () => boolean = cached(function () {\n return isMac() || isIOS();\n});\n\nexport const isWebKit: () => boolean = cached(function () {\n return testUserAgent(/AppleWebKit/i) && !isChrome();\n});\n\nexport const isChrome: () => boolean = cached(function () {\n return testUserAgent(/Chrome/i);\n});\n\nexport const isAndroid: () => boolean = cached(function () {\n return testUserAgent(/Android/i);\n});\n\nexport const isFirefox: () => boolean = cached(function () {\n return testUserAgent(/Firefox/i);\n});\n"],"names":[],"version":3,"file":"platform.main.js.map"}
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ function $c87311424ea30a05$var$testUserAgent(re) {
var _window_navigator_userAgentData;
if (typeof window === 'undefined' || window.navigator == null) return false;
let brands = (_window_navigator_userAgentData = window.navigator['userAgentData']) === null || _window_navigator_userAgentData === void 0 ? void 0 : _window_navigator_userAgentData.brands;
return Array.isArray(brands) && brands.some((brand)=>re.test(brand.brand)) || re.test(window.navigator.userAgent);
}
function $c87311424ea30a05$var$testPlatform(re) {
var _window_navigator_userAgentData;
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;
}
function $c87311424ea30a05$var$cached(fn) {
if (process.env.NODE_ENV === 'test') return fn;
let res = null;
return ()=>{
if (res == null) res = fn();
return res;
};
}
const $c87311424ea30a05$export$9ac100e40613ea10 = $c87311424ea30a05$var$cached(function() {
return $c87311424ea30a05$var$testPlatform(/^Mac/i);
});
const $c87311424ea30a05$export$186c6964ca17d99 = $c87311424ea30a05$var$cached(function() {
return $c87311424ea30a05$var$testPlatform(/^iPhone/i);
});
const $c87311424ea30a05$export$7bef049ce92e4224 = $c87311424ea30a05$var$cached(function() {
return $c87311424ea30a05$var$testPlatform(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
$c87311424ea30a05$export$9ac100e40613ea10() && navigator.maxTouchPoints > 1;
});
const $c87311424ea30a05$export$fedb369cb70207f1 = $c87311424ea30a05$var$cached(function() {
return $c87311424ea30a05$export$186c6964ca17d99() || $c87311424ea30a05$export$7bef049ce92e4224();
});
const $c87311424ea30a05$export$e1865c3bedcd822b = $c87311424ea30a05$var$cached(function() {
return $c87311424ea30a05$export$9ac100e40613ea10() || $c87311424ea30a05$export$fedb369cb70207f1();
});
const $c87311424ea30a05$export$78551043582a6a98 = $c87311424ea30a05$var$cached(function() {
return $c87311424ea30a05$var$testUserAgent(/AppleWebKit/i) && !$c87311424ea30a05$export$6446a186d09e379e();
});
const $c87311424ea30a05$export$6446a186d09e379e = $c87311424ea30a05$var$cached(function() {
return $c87311424ea30a05$var$testUserAgent(/Chrome/i);
});
const $c87311424ea30a05$export$a11b0059900ceec8 = $c87311424ea30a05$var$cached(function() {
return $c87311424ea30a05$var$testUserAgent(/Android/i);
});
const $c87311424ea30a05$export$b7d78993b74f766d = $c87311424ea30a05$var$cached(function() {
return $c87311424ea30a05$var$testUserAgent(/Firefox/i);
});
export {$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, $c87311424ea30a05$export$b7d78993b74f766d as isFirefox};
//# sourceMappingURL=platform.module.js.map
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ function $c87311424ea30a05$var$testUserAgent(re) {
var _window_navigator_userAgentData;
if (typeof window === 'undefined' || window.navigator == null) return false;
let brands = (_window_navigator_userAgentData = window.navigator['userAgentData']) === null || _window_navigator_userAgentData === void 0 ? void 0 : _window_navigator_userAgentData.brands;
return Array.isArray(brands) && brands.some((brand)=>re.test(brand.brand)) || re.test(window.navigator.userAgent);
}
function $c87311424ea30a05$var$testPlatform(re) {
var _window_navigator_userAgentData;
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;
}
function $c87311424ea30a05$var$cached(fn) {
if (process.env.NODE_ENV === 'test') return fn;
let res = null;
return ()=>{
if (res == null) res = fn();
return res;
};
}
const $c87311424ea30a05$export$9ac100e40613ea10 = $c87311424ea30a05$var$cached(function() {
return $c87311424ea30a05$var$testPlatform(/^Mac/i);
});
const $c87311424ea30a05$export$186c6964ca17d99 = $c87311424ea30a05$var$cached(function() {
return $c87311424ea30a05$var$testPlatform(/^iPhone/i);
});
const $c87311424ea30a05$export$7bef049ce92e4224 = $c87311424ea30a05$var$cached(function() {
return $c87311424ea30a05$var$testPlatform(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
$c87311424ea30a05$export$9ac100e40613ea10() && navigator.maxTouchPoints > 1;
});
const $c87311424ea30a05$export$fedb369cb70207f1 = $c87311424ea30a05$var$cached(function() {
return $c87311424ea30a05$export$186c6964ca17d99() || $c87311424ea30a05$export$7bef049ce92e4224();
});
const $c87311424ea30a05$export$e1865c3bedcd822b = $c87311424ea30a05$var$cached(function() {
return $c87311424ea30a05$export$9ac100e40613ea10() || $c87311424ea30a05$export$fedb369cb70207f1();
});
const $c87311424ea30a05$export$78551043582a6a98 = $c87311424ea30a05$var$cached(function() {
return $c87311424ea30a05$var$testUserAgent(/AppleWebKit/i) && !$c87311424ea30a05$export$6446a186d09e379e();
});
const $c87311424ea30a05$export$6446a186d09e379e = $c87311424ea30a05$var$cached(function() {
return $c87311424ea30a05$var$testUserAgent(/Chrome/i);
});
const $c87311424ea30a05$export$a11b0059900ceec8 = $c87311424ea30a05$var$cached(function() {
return $c87311424ea30a05$var$testUserAgent(/Android/i);
});
const $c87311424ea30a05$export$b7d78993b74f766d = $c87311424ea30a05$var$cached(function() {
return $c87311424ea30a05$var$testUserAgent(/Firefox/i);
});
export {$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, $c87311424ea30a05$export$b7d78993b74f766d as isFirefox};
//# sourceMappingURL=platform.module.js.map
{"mappings":"AAAA;;;;;;;;;;CAUC,GAED,SAAS,oCAAc,EAAU;QAIlB;IAHb,IAAI,OAAO,WAAW,eAAe,OAAO,SAAS,IAAI,MACvD,OAAO;IAET,IAAI,UAAS,kCAAA,OAAO,SAAS,CAAC,gBAAgB,cAAjC,sDAAA,gCAAmC,MAAM;IACtD,OAAO,MAAM,OAAO,CAAC,WAAW,OAAO,IAAI,CAAC,CAAC,QAA4C,GAAG,IAAI,CAAC,MAAM,KAAK,MAC1G,GAAG,IAAI,CAAC,OAAO,SAAS,CAAC,SAAS;AACtC;AAEA,SAAS,mCAAa,EAAU;QAElB;IADZ,OAAO,OAAO,WAAW,eAAe,OAAO,SAAS,IAAI,OACxD,GAAG,IAAI,CAAC,EAAA,kCAAA,OAAO,SAAS,CAAC,gBAAgB,cAAjC,sDAAA,gCAAmC,QAAQ,KAAI,OAAO,SAAS,CAAC,QAAQ,IAChF;AACN;AAEA,SAAS,6BAAO,EAAiB;IAC/B,IAAI,QAAQ,GAAG,CAAC,QAAQ,KAAK,QAC3B,OAAO;IAGT,IAAI,MAAsB;IAC1B,OAAO;QACL,IAAI,OAAO,MACT,MAAM;QAER,OAAO;IACT;AACF;AAEO,MAAM,4CAAuB,6BAAO;IACzC,OAAO,mCAAa;AACtB;AAEO,MAAM,2CAA0B,6BAAO;IAC5C,OAAO,mCAAa;AACtB;AAEO,MAAM,4CAAwB,6BAAO;IAC1C,OAAO,mCAAa,aAClB,yFAAyF;IACxF,+CAAW,UAAU,cAAc,GAAG;AAC3C;AAEO,MAAM,4CAAuB,6BAAO;IACzC,OAAO,8CAAc;AACvB;AAEO,MAAM,4CAA+B,6BAAO;IACjD,OAAO,+CAAW;AACpB;AAEO,MAAM,4CAA0B,6BAAO;IAC5C,OAAO,oCAAc,mBAAmB,CAAC;AAC3C;AAEO,MAAM,4CAA0B,6BAAO;IAC5C,OAAO,oCAAc;AACvB;AAEO,MAAM,4CAA2B,6BAAO;IAC7C,OAAO,oCAAc;AACvB;AAEO,MAAM,4CAA2B,6BAAO;IAC7C,OAAO,oCAAc;AACvB","sources":["packages/@react-aria/utils/src/platform.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nfunction testUserAgent(re: RegExp) {\n if (typeof window === 'undefined' || window.navigator == null) {\n return false;\n }\n let brands = window.navigator['userAgentData']?.brands;\n return Array.isArray(brands) && brands.some((brand: {brand: string, version: string}) => re.test(brand.brand)) ||\n re.test(window.navigator.userAgent);\n}\n\nfunction testPlatform(re: RegExp) {\n return typeof window !== 'undefined' && window.navigator != null\n ? re.test(window.navigator['userAgentData']?.platform || window.navigator.platform)\n : false;\n}\n\nfunction cached(fn: () => boolean) {\n if (process.env.NODE_ENV === 'test') {\n return fn;\n }\n\n let res: boolean | null = null;\n return () => {\n if (res == null) {\n res = fn();\n }\n return res;\n };\n}\n\nexport const isMac: () => boolean = cached(function () {\n return testPlatform(/^Mac/i);\n});\n\nexport const isIPhone: () => boolean = cached(function () {\n return testPlatform(/^iPhone/i);\n});\n\nexport const isIPad: () => boolean = cached(function () {\n return testPlatform(/^iPad/i) ||\n // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.\n (isMac() && navigator.maxTouchPoints > 1);\n});\n\nexport const isIOS: () => boolean = cached(function () {\n return isIPhone() || isIPad();\n});\n\nexport const isAppleDevice: () => boolean = cached(function () {\n return isMac() || isIOS();\n});\n\nexport const isWebKit: () => boolean = cached(function () {\n return testUserAgent(/AppleWebKit/i) && !isChrome();\n});\n\nexport const isChrome: () => boolean = cached(function () {\n return testUserAgent(/Chrome/i);\n});\n\nexport const isAndroid: () => boolean = cached(function () {\n return testUserAgent(/Android/i);\n});\n\nexport const isFirefox: () => boolean = cached(function () {\n return testUserAgent(/Firefox/i);\n});\n"],"names":[],"version":3,"file":"platform.module.js.map"}
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "runAfterTransition", () => $e8117ebcab55be6a$export$24490316f764c430);
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ // We store a global list of elements that are currently transitioning,
// mapped to a set of CSS properties that are transitioning for that element.
// This is necessary rather than a simple count of transitions because of browser
// bugs, e.g. Chrome sometimes fires both transitionend and transitioncancel rather
// than one or the other. So we need to track what's actually transitioning so that
// we can ignore these duplicate events.
let $e8117ebcab55be6a$var$transitionsByElement = new Map();
// A list of callbacks to call once there are no transitioning elements.
let $e8117ebcab55be6a$var$transitionCallbacks = new Set();
function $e8117ebcab55be6a$var$setupGlobalEvents() {
if (typeof window === 'undefined') return;
function isTransitionEvent(event) {
return 'propertyName' in event;
}
let onTransitionStart = (e)=>{
if (!isTransitionEvent(e) || !e.target) return;
// Add the transitioning property to the list for this element.
let transitions = $e8117ebcab55be6a$var$transitionsByElement.get(e.target);
if (!transitions) {
transitions = new Set();
$e8117ebcab55be6a$var$transitionsByElement.set(e.target, transitions);
// The transitioncancel event must be registered on the element itself, rather than as a global
// event. This enables us to handle when the node is deleted from the document while it is transitioning.
// In that case, the cancel event would have nowhere to bubble to so we need to handle it directly.
e.target.addEventListener('transitioncancel', onTransitionEnd, {
once: true
});
}
transitions.add(e.propertyName);
};
let onTransitionEnd = (e)=>{
if (!isTransitionEvent(e) || !e.target) return;
// Remove property from list of transitioning properties.
let properties = $e8117ebcab55be6a$var$transitionsByElement.get(e.target);
if (!properties) return;
properties.delete(e.propertyName);
// If empty, remove transitioncancel event, and remove the element from the list of transitioning elements.
if (properties.size === 0) {
e.target.removeEventListener('transitioncancel', onTransitionEnd);
$e8117ebcab55be6a$var$transitionsByElement.delete(e.target);
}
// If no transitioning elements, call all of the queued callbacks.
if ($e8117ebcab55be6a$var$transitionsByElement.size === 0) {
for (let cb of $e8117ebcab55be6a$var$transitionCallbacks)cb();
$e8117ebcab55be6a$var$transitionCallbacks.clear();
}
};
document.body.addEventListener('transitionrun', onTransitionStart);
document.body.addEventListener('transitionend', onTransitionEnd);
}
if (typeof document !== 'undefined') {
if (document.readyState !== 'loading') $e8117ebcab55be6a$var$setupGlobalEvents();
else document.addEventListener('DOMContentLoaded', $e8117ebcab55be6a$var$setupGlobalEvents);
}
/**
* Cleans up any elements that are no longer in the document.
* This is necessary because we can't rely on transitionend events to fire
* for elements that are removed from the document while transitioning.
*/ function $e8117ebcab55be6a$var$cleanupDetachedElements() {
for (const [eventTarget] of $e8117ebcab55be6a$var$transitionsByElement)// Similar to `eventTarget instanceof Element && !eventTarget.isConnected`, but avoids
// the explicit instanceof check, since it may be different in different contexts.
if ('isConnected' in eventTarget && !eventTarget.isConnected) $e8117ebcab55be6a$var$transitionsByElement.delete(eventTarget);
}
function $e8117ebcab55be6a$export$24490316f764c430(fn) {
// Wait one frame to see if an animation starts, e.g. a transition on mount.
requestAnimationFrame(()=>{
$e8117ebcab55be6a$var$cleanupDetachedElements();
// If no transitions are running, call the function immediately.
// Otherwise, add it to a list of callbacks to run at the end of the animation.
if ($e8117ebcab55be6a$var$transitionsByElement.size === 0) fn();
else $e8117ebcab55be6a$var$transitionCallbacks.add(fn);
});
}
//# sourceMappingURL=runAfterTransition.main.js.map
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC,GAED,uEAAuE;AACvE,6EAA6E;AAC7E,iFAAiF;AACjF,mFAAmF;AACnF,mFAAmF;AACnF,wCAAwC;AACxC,IAAI,6CAAuB,IAAI;AAE/B,wEAAwE;AACxE,IAAI,4CAAsB,IAAI;AAE9B,SAAS;IACP,IAAI,OAAO,WAAW,aACpB;IAGF,SAAS,kBAAkB,KAAY;QACrC,OAAO,kBAAkB;IAC3B;IAEA,IAAI,oBAAoB,CAAC;QACvB,IAAI,CAAC,kBAAkB,MAAM,CAAC,EAAE,MAAM,EACpC;QAEF,+DAA+D;QAC/D,IAAI,cAAc,2CAAqB,GAAG,CAAC,EAAE,MAAM;QACnD,IAAI,CAAC,aAAa;YAChB,cAAc,IAAI;YAClB,2CAAqB,GAAG,CAAC,EAAE,MAAM,EAAE;YAEnC,+FAA+F;YAC/F,yGAAyG;YACzG,mGAAmG;YACnG,EAAE,MAAM,CAAC,gBAAgB,CAAC,oBAAoB,iBAAiB;gBAC7D,MAAM;YACR;QACF;QAEA,YAAY,GAAG,CAAC,EAAE,YAAY;IAChC;IAEA,IAAI,kBAAkB,CAAC;QACrB,IAAI,CAAC,kBAAkB,MAAM,CAAC,EAAE,MAAM,EACpC;QAEF,yDAAyD;QACzD,IAAI,aAAa,2CAAqB,GAAG,CAAC,EAAE,MAAM;QAClD,IAAI,CAAC,YACH;QAGF,WAAW,MAAM,CAAC,EAAE,YAAY;QAEhC,2GAA2G;QAC3G,IAAI,WAAW,IAAI,KAAK,GAAG;YACzB,EAAE,MAAM,CAAC,mBAAmB,CAAC,oBAAoB;YACjD,2CAAqB,MAAM,CAAC,EAAE,MAAM;QACtC;QAEA,kEAAkE;QAClE,IAAI,2CAAqB,IAAI,KAAK,GAAG;YACnC,KAAK,IAAI,MAAM,0CACb;YAGF,0CAAoB,KAAK;QAC3B;IACF;IAEA,SAAS,IAAI,CAAC,gBAAgB,CAAC,iBAAiB;IAChD,SAAS,IAAI,CAAC,gBAAgB,CAAC,iBAAiB;AAClD;AAEA,IAAI,OAAO,aAAa;IACtB,IAAI,SAAS,UAAU,KAAK,WAC1B;SAEA,SAAS,gBAAgB,CAAC,oBAAoB;;AAIlD;;;;CAIC,GACD,SAAS;IACP,KAAK,MAAM,CAAC,YAAY,IAAI,2CAC1B,sFAAsF;IACtF,kFAAkF;IAClF,IAAI,iBAAiB,eAAe,CAAC,YAAY,WAAW,EAC1D,2CAAqB,MAAM,CAAC;AAGlC;AAEO,SAAS,0CAAmB,EAAc;IAC/C,4EAA4E;IAC5E,sBAAsB;QACpB;QACA,gEAAgE;QAChE,+EAA+E;QAC/E,IAAI,2CAAqB,IAAI,KAAK,GAChC;aAEA,0CAAoB,GAAG,CAAC;IAE5B;AACF","sources":["packages/@react-aria/utils/src/runAfterTransition.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// We store a global list of elements that are currently transitioning,\n// mapped to a set of CSS properties that are transitioning for that element.\n// This is necessary rather than a simple count of transitions because of browser\n// bugs, e.g. Chrome sometimes fires both transitionend and transitioncancel rather\n// than one or the other. So we need to track what's actually transitioning so that\n// we can ignore these duplicate events.\nlet transitionsByElement = new Map<EventTarget, Set<string>>();\n\n// A list of callbacks to call once there are no transitioning elements.\nlet transitionCallbacks = new Set<() => void>();\n\nfunction setupGlobalEvents() {\n if (typeof window === 'undefined') {\n return;\n }\n\n function isTransitionEvent(event: Event): event is TransitionEvent {\n return 'propertyName' in event;\n }\n\n let onTransitionStart = (e: Event) => {\n if (!isTransitionEvent(e) || !e.target) {\n return;\n }\n // Add the transitioning property to the list for this element.\n let transitions = transitionsByElement.get(e.target);\n if (!transitions) {\n transitions = new Set();\n transitionsByElement.set(e.target, transitions);\n\n // The transitioncancel event must be registered on the element itself, rather than as a global\n // event. This enables us to handle when the node is deleted from the document while it is transitioning.\n // In that case, the cancel event would have nowhere to bubble to so we need to handle it directly.\n e.target.addEventListener('transitioncancel', onTransitionEnd, {\n once: true\n });\n }\n\n transitions.add(e.propertyName);\n };\n\n let onTransitionEnd = (e: Event) => {\n if (!isTransitionEvent(e) || !e.target) {\n return;\n }\n // Remove property from list of transitioning properties.\n let properties = transitionsByElement.get(e.target);\n if (!properties) {\n return;\n }\n\n properties.delete(e.propertyName);\n\n // If empty, remove transitioncancel event, and remove the element from the list of transitioning elements.\n if (properties.size === 0) {\n e.target.removeEventListener('transitioncancel', onTransitionEnd);\n transitionsByElement.delete(e.target);\n }\n\n // If no transitioning elements, call all of the queued callbacks.\n if (transitionsByElement.size === 0) {\n for (let cb of transitionCallbacks) {\n cb();\n }\n\n transitionCallbacks.clear();\n }\n };\n\n document.body.addEventListener('transitionrun', onTransitionStart);\n document.body.addEventListener('transitionend', onTransitionEnd);\n}\n\nif (typeof document !== 'undefined') {\n if (document.readyState !== 'loading') {\n setupGlobalEvents();\n } else {\n document.addEventListener('DOMContentLoaded', setupGlobalEvents);\n }\n}\n\n/**\n * Cleans up any elements that are no longer in the document.\n * This is necessary because we can't rely on transitionend events to fire\n * for elements that are removed from the document while transitioning.\n */\nfunction cleanupDetachedElements() {\n for (const [eventTarget] of transitionsByElement) {\n // Similar to `eventTarget instanceof Element && !eventTarget.isConnected`, but avoids\n // the explicit instanceof check, since it may be different in different contexts.\n if ('isConnected' in eventTarget && !eventTarget.isConnected) {\n transitionsByElement.delete(eventTarget);\n }\n }\n}\n\nexport function runAfterTransition(fn: () => void): void {\n // Wait one frame to see if an animation starts, e.g. a transition on mount.\n requestAnimationFrame(() => {\n cleanupDetachedElements();\n // If no transitions are running, call the function immediately.\n // Otherwise, add it to a list of callbacks to run at the end of the animation.\n if (transitionsByElement.size === 0) {\n fn();\n } else {\n transitionCallbacks.add(fn);\n }\n });\n}\n"],"names":[],"version":3,"file":"runAfterTransition.main.js.map"}
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ // We store a global list of elements that are currently transitioning,
// mapped to a set of CSS properties that are transitioning for that element.
// This is necessary rather than a simple count of transitions because of browser
// bugs, e.g. Chrome sometimes fires both transitionend and transitioncancel rather
// than one or the other. So we need to track what's actually transitioning so that
// we can ignore these duplicate events.
let $bbed8b41f857bcc0$var$transitionsByElement = new Map();
// A list of callbacks to call once there are no transitioning elements.
let $bbed8b41f857bcc0$var$transitionCallbacks = new Set();
function $bbed8b41f857bcc0$var$setupGlobalEvents() {
if (typeof window === 'undefined') return;
function isTransitionEvent(event) {
return 'propertyName' in event;
}
let onTransitionStart = (e)=>{
if (!isTransitionEvent(e) || !e.target) return;
// Add the transitioning property to the list for this element.
let transitions = $bbed8b41f857bcc0$var$transitionsByElement.get(e.target);
if (!transitions) {
transitions = new Set();
$bbed8b41f857bcc0$var$transitionsByElement.set(e.target, transitions);
// The transitioncancel event must be registered on the element itself, rather than as a global
// event. This enables us to handle when the node is deleted from the document while it is transitioning.
// In that case, the cancel event would have nowhere to bubble to so we need to handle it directly.
e.target.addEventListener('transitioncancel', onTransitionEnd, {
once: true
});
}
transitions.add(e.propertyName);
};
let onTransitionEnd = (e)=>{
if (!isTransitionEvent(e) || !e.target) return;
// Remove property from list of transitioning properties.
let properties = $bbed8b41f857bcc0$var$transitionsByElement.get(e.target);
if (!properties) return;
properties.delete(e.propertyName);
// If empty, remove transitioncancel event, and remove the element from the list of transitioning elements.
if (properties.size === 0) {
e.target.removeEventListener('transitioncancel', onTransitionEnd);
$bbed8b41f857bcc0$var$transitionsByElement.delete(e.target);
}
// If no transitioning elements, call all of the queued callbacks.
if ($bbed8b41f857bcc0$var$transitionsByElement.size === 0) {
for (let cb of $bbed8b41f857bcc0$var$transitionCallbacks)cb();
$bbed8b41f857bcc0$var$transitionCallbacks.clear();
}
};
document.body.addEventListener('transitionrun', onTransitionStart);
document.body.addEventListener('transitionend', onTransitionEnd);
}
if (typeof document !== 'undefined') {
if (document.readyState !== 'loading') $bbed8b41f857bcc0$var$setupGlobalEvents();
else document.addEventListener('DOMContentLoaded', $bbed8b41f857bcc0$var$setupGlobalEvents);
}
/**
* Cleans up any elements that are no longer in the document.
* This is necessary because we can't rely on transitionend events to fire
* for elements that are removed from the document while transitioning.
*/ function $bbed8b41f857bcc0$var$cleanupDetachedElements() {
for (const [eventTarget] of $bbed8b41f857bcc0$var$transitionsByElement)// Similar to `eventTarget instanceof Element && !eventTarget.isConnected`, but avoids
// the explicit instanceof check, since it may be different in different contexts.
if ('isConnected' in eventTarget && !eventTarget.isConnected) $bbed8b41f857bcc0$var$transitionsByElement.delete(eventTarget);
}
function $bbed8b41f857bcc0$export$24490316f764c430(fn) {
// Wait one frame to see if an animation starts, e.g. a transition on mount.
requestAnimationFrame(()=>{
$bbed8b41f857bcc0$var$cleanupDetachedElements();
// If no transitions are running, call the function immediately.
// Otherwise, add it to a list of callbacks to run at the end of the animation.
if ($bbed8b41f857bcc0$var$transitionsByElement.size === 0) fn();
else $bbed8b41f857bcc0$var$transitionCallbacks.add(fn);
});
}
export {$bbed8b41f857bcc0$export$24490316f764c430 as runAfterTransition};
//# sourceMappingURL=runAfterTransition.module.js.map
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ // We store a global list of elements that are currently transitioning,
// mapped to a set of CSS properties that are transitioning for that element.
// This is necessary rather than a simple count of transitions because of browser
// bugs, e.g. Chrome sometimes fires both transitionend and transitioncancel rather
// than one or the other. So we need to track what's actually transitioning so that
// we can ignore these duplicate events.
let $bbed8b41f857bcc0$var$transitionsByElement = new Map();
// A list of callbacks to call once there are no transitioning elements.
let $bbed8b41f857bcc0$var$transitionCallbacks = new Set();
function $bbed8b41f857bcc0$var$setupGlobalEvents() {
if (typeof window === 'undefined') return;
function isTransitionEvent(event) {
return 'propertyName' in event;
}
let onTransitionStart = (e)=>{
if (!isTransitionEvent(e) || !e.target) return;
// Add the transitioning property to the list for this element.
let transitions = $bbed8b41f857bcc0$var$transitionsByElement.get(e.target);
if (!transitions) {
transitions = new Set();
$bbed8b41f857bcc0$var$transitionsByElement.set(e.target, transitions);
// The transitioncancel event must be registered on the element itself, rather than as a global
// event. This enables us to handle when the node is deleted from the document while it is transitioning.
// In that case, the cancel event would have nowhere to bubble to so we need to handle it directly.
e.target.addEventListener('transitioncancel', onTransitionEnd, {
once: true
});
}
transitions.add(e.propertyName);
};
let onTransitionEnd = (e)=>{
if (!isTransitionEvent(e) || !e.target) return;
// Remove property from list of transitioning properties.
let properties = $bbed8b41f857bcc0$var$transitionsByElement.get(e.target);
if (!properties) return;
properties.delete(e.propertyName);
// If empty, remove transitioncancel event, and remove the element from the list of transitioning elements.
if (properties.size === 0) {
e.target.removeEventListener('transitioncancel', onTransitionEnd);
$bbed8b41f857bcc0$var$transitionsByElement.delete(e.target);
}
// If no transitioning elements, call all of the queued callbacks.
if ($bbed8b41f857bcc0$var$transitionsByElement.size === 0) {
for (let cb of $bbed8b41f857bcc0$var$transitionCallbacks)cb();
$bbed8b41f857bcc0$var$transitionCallbacks.clear();
}
};
document.body.addEventListener('transitionrun', onTransitionStart);
document.body.addEventListener('transitionend', onTransitionEnd);
}
if (typeof document !== 'undefined') {
if (document.readyState !== 'loading') $bbed8b41f857bcc0$var$setupGlobalEvents();
else document.addEventListener('DOMContentLoaded', $bbed8b41f857bcc0$var$setupGlobalEvents);
}
/**
* Cleans up any elements that are no longer in the document.
* This is necessary because we can't rely on transitionend events to fire
* for elements that are removed from the document while transitioning.
*/ function $bbed8b41f857bcc0$var$cleanupDetachedElements() {
for (const [eventTarget] of $bbed8b41f857bcc0$var$transitionsByElement)// Similar to `eventTarget instanceof Element && !eventTarget.isConnected`, but avoids
// the explicit instanceof check, since it may be different in different contexts.
if ('isConnected' in eventTarget && !eventTarget.isConnected) $bbed8b41f857bcc0$var$transitionsByElement.delete(eventTarget);
}
function $bbed8b41f857bcc0$export$24490316f764c430(fn) {
// Wait one frame to see if an animation starts, e.g. a transition on mount.
requestAnimationFrame(()=>{
$bbed8b41f857bcc0$var$cleanupDetachedElements();
// If no transitions are running, call the function immediately.
// Otherwise, add it to a list of callbacks to run at the end of the animation.
if ($bbed8b41f857bcc0$var$transitionsByElement.size === 0) fn();
else $bbed8b41f857bcc0$var$transitionCallbacks.add(fn);
});
}
export {$bbed8b41f857bcc0$export$24490316f764c430 as runAfterTransition};
//# sourceMappingURL=runAfterTransition.module.js.map
{"mappings":"AAAA;;;;;;;;;;CAUC,GAED,uEAAuE;AACvE,6EAA6E;AAC7E,iFAAiF;AACjF,mFAAmF;AACnF,mFAAmF;AACnF,wCAAwC;AACxC,IAAI,6CAAuB,IAAI;AAE/B,wEAAwE;AACxE,IAAI,4CAAsB,IAAI;AAE9B,SAAS;IACP,IAAI,OAAO,WAAW,aACpB;IAGF,SAAS,kBAAkB,KAAY;QACrC,OAAO,kBAAkB;IAC3B;IAEA,IAAI,oBAAoB,CAAC;QACvB,IAAI,CAAC,kBAAkB,MAAM,CAAC,EAAE,MAAM,EACpC;QAEF,+DAA+D;QAC/D,IAAI,cAAc,2CAAqB,GAAG,CAAC,EAAE,MAAM;QACnD,IAAI,CAAC,aAAa;YAChB,cAAc,IAAI;YAClB,2CAAqB,GAAG,CAAC,EAAE,MAAM,EAAE;YAEnC,+FAA+F;YAC/F,yGAAyG;YACzG,mGAAmG;YACnG,EAAE,MAAM,CAAC,gBAAgB,CAAC,oBAAoB,iBAAiB;gBAC7D,MAAM;YACR;QACF;QAEA,YAAY,GAAG,CAAC,EAAE,YAAY;IAChC;IAEA,IAAI,kBAAkB,CAAC;QACrB,IAAI,CAAC,kBAAkB,MAAM,CAAC,EAAE,MAAM,EACpC;QAEF,yDAAyD;QACzD,IAAI,aAAa,2CAAqB,GAAG,CAAC,EAAE,MAAM;QAClD,IAAI,CAAC,YACH;QAGF,WAAW,MAAM,CAAC,EAAE,YAAY;QAEhC,2GAA2G;QAC3G,IAAI,WAAW,IAAI,KAAK,GAAG;YACzB,EAAE,MAAM,CAAC,mBAAmB,CAAC,oBAAoB;YACjD,2CAAqB,MAAM,CAAC,EAAE,MAAM;QACtC;QAEA,kEAAkE;QAClE,IAAI,2CAAqB,IAAI,KAAK,GAAG;YACnC,KAAK,IAAI,MAAM,0CACb;YAGF,0CAAoB,KAAK;QAC3B;IACF;IAEA,SAAS,IAAI,CAAC,gBAAgB,CAAC,iBAAiB;IAChD,SAAS,IAAI,CAAC,gBAAgB,CAAC,iBAAiB;AAClD;AAEA,IAAI,OAAO,aAAa;IACtB,IAAI,SAAS,UAAU,KAAK,WAC1B;SAEA,SAAS,gBAAgB,CAAC,oBAAoB;;AAIlD;;;;CAIC,GACD,SAAS;IACP,KAAK,MAAM,CAAC,YAAY,IAAI,2CAC1B,sFAAsF;IACtF,kFAAkF;IAClF,IAAI,iBAAiB,eAAe,CAAC,YAAY,WAAW,EAC1D,2CAAqB,MAAM,CAAC;AAGlC;AAEO,SAAS,0CAAmB,EAAc;IAC/C,4EAA4E;IAC5E,sBAAsB;QACpB;QACA,gEAAgE;QAChE,+EAA+E;QAC/E,IAAI,2CAAqB,IAAI,KAAK,GAChC;aAEA,0CAAoB,GAAG,CAAC;IAE5B;AACF","sources":["packages/@react-aria/utils/src/runAfterTransition.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// We store a global list of elements that are currently transitioning,\n// mapped to a set of CSS properties that are transitioning for that element.\n// This is necessary rather than a simple count of transitions because of browser\n// bugs, e.g. Chrome sometimes fires both transitionend and transitioncancel rather\n// than one or the other. So we need to track what's actually transitioning so that\n// we can ignore these duplicate events.\nlet transitionsByElement = new Map<EventTarget, Set<string>>();\n\n// A list of callbacks to call once there are no transitioning elements.\nlet transitionCallbacks = new Set<() => void>();\n\nfunction setupGlobalEvents() {\n if (typeof window === 'undefined') {\n return;\n }\n\n function isTransitionEvent(event: Event): event is TransitionEvent {\n return 'propertyName' in event;\n }\n\n let onTransitionStart = (e: Event) => {\n if (!isTransitionEvent(e) || !e.target) {\n return;\n }\n // Add the transitioning property to the list for this element.\n let transitions = transitionsByElement.get(e.target);\n if (!transitions) {\n transitions = new Set();\n transitionsByElement.set(e.target, transitions);\n\n // The transitioncancel event must be registered on the element itself, rather than as a global\n // event. This enables us to handle when the node is deleted from the document while it is transitioning.\n // In that case, the cancel event would have nowhere to bubble to so we need to handle it directly.\n e.target.addEventListener('transitioncancel', onTransitionEnd, {\n once: true\n });\n }\n\n transitions.add(e.propertyName);\n };\n\n let onTransitionEnd = (e: Event) => {\n if (!isTransitionEvent(e) || !e.target) {\n return;\n }\n // Remove property from list of transitioning properties.\n let properties = transitionsByElement.get(e.target);\n if (!properties) {\n return;\n }\n\n properties.delete(e.propertyName);\n\n // If empty, remove transitioncancel event, and remove the element from the list of transitioning elements.\n if (properties.size === 0) {\n e.target.removeEventListener('transitioncancel', onTransitionEnd);\n transitionsByElement.delete(e.target);\n }\n\n // If no transitioning elements, call all of the queued callbacks.\n if (transitionsByElement.size === 0) {\n for (let cb of transitionCallbacks) {\n cb();\n }\n\n transitionCallbacks.clear();\n }\n };\n\n document.body.addEventListener('transitionrun', onTransitionStart);\n document.body.addEventListener('transitionend', onTransitionEnd);\n}\n\nif (typeof document !== 'undefined') {\n if (document.readyState !== 'loading') {\n setupGlobalEvents();\n } else {\n document.addEventListener('DOMContentLoaded', setupGlobalEvents);\n }\n}\n\n/**\n * Cleans up any elements that are no longer in the document.\n * This is necessary because we can't rely on transitionend events to fire\n * for elements that are removed from the document while transitioning.\n */\nfunction cleanupDetachedElements() {\n for (const [eventTarget] of transitionsByElement) {\n // Similar to `eventTarget instanceof Element && !eventTarget.isConnected`, but avoids\n // the explicit instanceof check, since it may be different in different contexts.\n if ('isConnected' in eventTarget && !eventTarget.isConnected) {\n transitionsByElement.delete(eventTarget);\n }\n }\n}\n\nexport function runAfterTransition(fn: () => void): void {\n // Wait one frame to see if an animation starts, e.g. a transition on mount.\n requestAnimationFrame(() => {\n cleanupDetachedElements();\n // If no transitions are running, call the function immediately.\n // Otherwise, add it to a list of callbacks to run at the end of the animation.\n if (transitionsByElement.size === 0) {\n fn();\n } else {\n transitionCallbacks.add(fn);\n }\n });\n}\n"],"names":[],"version":3,"file":"runAfterTransition.module.js.map"}
var $49f0d9486c2408aa$exports = require("./getScrollParents.main.js");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "scrollIntoView", () => $449412113267a1fe$export$53a0910f038337bd);
$parcel$export(module.exports, "scrollIntoViewport", () => $449412113267a1fe$export$c826860796309d1b);
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $449412113267a1fe$export$53a0910f038337bd(scrollView, element) {
let offsetX = $449412113267a1fe$var$relativeOffset(scrollView, element, 'left');
let offsetY = $449412113267a1fe$var$relativeOffset(scrollView, element, 'top');
let width = element.offsetWidth;
let height = element.offsetHeight;
let x = scrollView.scrollLeft;
let y = scrollView.scrollTop;
// Account for top/left border offsetting the scroll top/Left + scroll padding
let { borderTopWidth: borderTopWidth, borderLeftWidth: borderLeftWidth, scrollPaddingTop: scrollPaddingTop, scrollPaddingRight: scrollPaddingRight, scrollPaddingBottom: scrollPaddingBottom, scrollPaddingLeft: scrollPaddingLeft } = getComputedStyle(scrollView);
let borderAdjustedX = x + parseInt(borderLeftWidth, 10);
let borderAdjustedY = y + parseInt(borderTopWidth, 10);
// Ignore end/bottom border via clientHeight/Width instead of offsetHeight/Width
let maxX = borderAdjustedX + scrollView.clientWidth;
let maxY = borderAdjustedY + scrollView.clientHeight;
// Get scroll padding values as pixels - defaults to 0 if no scroll padding
// is used.
let scrollPaddingTopNumber = parseInt(scrollPaddingTop, 10) || 0;
let scrollPaddingBottomNumber = parseInt(scrollPaddingBottom, 10) || 0;
let scrollPaddingRightNumber = parseInt(scrollPaddingRight, 10) || 0;
let scrollPaddingLeftNumber = parseInt(scrollPaddingLeft, 10) || 0;
if (offsetX <= x + scrollPaddingLeftNumber) x = offsetX - parseInt(borderLeftWidth, 10) - scrollPaddingLeftNumber;
else if (offsetX + width > maxX - scrollPaddingRightNumber) x += offsetX + width - maxX + scrollPaddingRightNumber;
if (offsetY <= borderAdjustedY + scrollPaddingTopNumber) y = offsetY - parseInt(borderTopWidth, 10) - scrollPaddingTopNumber;
else if (offsetY + height > maxY - scrollPaddingBottomNumber) y += offsetY + height - maxY + scrollPaddingBottomNumber;
scrollView.scrollLeft = x;
scrollView.scrollTop = y;
}
/**
* Computes the offset left or top from child to ancestor by accumulating
* offsetLeft or offsetTop through intervening offsetParents.
*/ function $449412113267a1fe$var$relativeOffset(ancestor, child, axis) {
const prop = axis === 'left' ? 'offsetLeft' : 'offsetTop';
let sum = 0;
while(child.offsetParent){
sum += child[prop];
if (child.offsetParent === ancestor) break;
else if (child.offsetParent.contains(ancestor)) {
// If the ancestor is not `position:relative`, then we stop at
// _its_ offset parent, and we subtract off _its_ offset, so that
// we end up with the proper offset from child to ancestor.
sum -= ancestor[prop];
break;
}
child = child.offsetParent;
}
return sum;
}
function $449412113267a1fe$export$c826860796309d1b(targetElement, opts) {
if (targetElement && document.contains(targetElement)) {
let root = document.scrollingElement || document.documentElement;
let isScrollPrevented = window.getComputedStyle(root).overflow === 'hidden';
// If scrolling is not currently prevented then we aren’t in a overlay nor is a overlay open, just use element.scrollIntoView to bring the element into view
if (!isScrollPrevented) {
var // use scrollIntoView({block: 'nearest'}) instead of .focus to check if the element is fully in view or not since .focus()
// 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
_targetElement_scrollIntoView;
let { left: originalLeft, top: originalTop } = targetElement.getBoundingClientRect();
targetElement === null || targetElement === void 0 ? void 0 : (_targetElement_scrollIntoView = targetElement.scrollIntoView) === null || _targetElement_scrollIntoView === void 0 ? void 0 : _targetElement_scrollIntoView.call(targetElement, {
block: 'nearest'
});
let { left: newLeft, top: newTop } = targetElement.getBoundingClientRect();
// Account for sub pixel differences from rounding
if (Math.abs(originalLeft - newLeft) > 1 || Math.abs(originalTop - newTop) > 1) {
var _opts_containingElement_scrollIntoView, _opts_containingElement, _targetElement_scrollIntoView1;
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, {
block: 'center',
inline: 'center'
});
(_targetElement_scrollIntoView1 = targetElement.scrollIntoView) === null || _targetElement_scrollIntoView1 === void 0 ? void 0 : _targetElement_scrollIntoView1.call(targetElement, {
block: 'nearest'
});
}
} else {
let scrollParents = (0, $49f0d9486c2408aa$exports.getScrollParents)(targetElement);
// If scrolling is prevented, we don't want to scroll the body since it might move the overlay partially offscreen and the user can't scroll it back into view.
if (!isScrollPrevented) scrollParents.push(root);
for (let scrollParent of scrollParents)$449412113267a1fe$export$53a0910f038337bd(scrollParent, targetElement);
}
}
}
//# sourceMappingURL=scrollIntoView.main.js.map
{"mappings":"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","sources":["packages/@react-aria/utils/src/scrollIntoView.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {getScrollParents} from './getScrollParents';\n\ninterface ScrollIntoViewportOpts {\n /** The optional containing element of the target to be centered in the viewport. */\n containingElement?: Element | null\n}\n\n/**\n * Scrolls `scrollView` so that `element` is visible.\n * Similar to `element.scrollIntoView({block: 'nearest'})` (not supported in Edge),\n * but doesn't affect parents above `scrollView`.\n */\nexport function scrollIntoView(scrollView: HTMLElement, element: HTMLElement): void {\n let offsetX = relativeOffset(scrollView, element, 'left');\n let offsetY = relativeOffset(scrollView, element, 'top');\n let width = element.offsetWidth;\n let height = element.offsetHeight;\n let x = scrollView.scrollLeft;\n let y = scrollView.scrollTop;\n\n // Account for top/left border offsetting the scroll top/Left + scroll padding\n let {\n borderTopWidth,\n borderLeftWidth,\n scrollPaddingTop,\n scrollPaddingRight,\n scrollPaddingBottom,\n scrollPaddingLeft\n } = getComputedStyle(scrollView);\n\n let borderAdjustedX = x + parseInt(borderLeftWidth, 10);\n let borderAdjustedY = y + parseInt(borderTopWidth, 10);\n // Ignore end/bottom border via clientHeight/Width instead of offsetHeight/Width\n let maxX = borderAdjustedX + scrollView.clientWidth;\n let maxY = borderAdjustedY + scrollView.clientHeight;\n\n // Get scroll padding values as pixels - defaults to 0 if no scroll padding\n // is used.\n let scrollPaddingTopNumber = parseInt(scrollPaddingTop, 10) || 0;\n let scrollPaddingBottomNumber = parseInt(scrollPaddingBottom, 10) || 0;\n let scrollPaddingRightNumber = parseInt(scrollPaddingRight, 10) || 0;\n let scrollPaddingLeftNumber = parseInt(scrollPaddingLeft, 10) || 0;\n\n if (offsetX <= x + scrollPaddingLeftNumber) {\n x = offsetX - parseInt(borderLeftWidth, 10) - scrollPaddingLeftNumber;\n } else if (offsetX + width > maxX - scrollPaddingRightNumber) {\n x += offsetX + width - maxX + scrollPaddingRightNumber;\n }\n if (offsetY <= borderAdjustedY + scrollPaddingTopNumber) {\n y = offsetY - parseInt(borderTopWidth, 10) - scrollPaddingTopNumber;\n } else if (offsetY + height > maxY - scrollPaddingBottomNumber) {\n y += offsetY + height - maxY + scrollPaddingBottomNumber;\n }\n\n scrollView.scrollLeft = x;\n scrollView.scrollTop = y;\n}\n\n/**\n * Computes the offset left or top from child to ancestor by accumulating\n * offsetLeft or offsetTop through intervening offsetParents.\n */\nfunction relativeOffset(ancestor: HTMLElement, child: HTMLElement, axis: 'left'|'top') {\n const prop = axis === 'left' ? 'offsetLeft' : 'offsetTop';\n let sum = 0;\n while (child.offsetParent) {\n sum += child[prop];\n if (child.offsetParent === ancestor) {\n // Stop once we have found the ancestor we are interested in.\n break;\n } else if (child.offsetParent.contains(ancestor)) {\n // If the ancestor is not `position:relative`, then we stop at\n // _its_ offset parent, and we subtract off _its_ offset, so that\n // we end up with the proper offset from child to ancestor.\n sum -= ancestor[prop];\n break;\n }\n child = child.offsetParent as HTMLElement;\n }\n return sum;\n}\n\n/**\n * Scrolls the `targetElement` so it is visible in the viewport. Accepts an optional `opts.containingElement`\n * that will be centered in the viewport prior to scrolling the targetElement into view. If scrolling is prevented on\n * the body (e.g. targetElement is in a popover), this will only scroll the scroll parents of the targetElement up to but not including the body itself.\n */\nexport function scrollIntoViewport(targetElement: Element | null, opts?: ScrollIntoViewportOpts): void {\n if (targetElement && document.contains(targetElement)) {\n let root = document.scrollingElement || document.documentElement;\n let isScrollPrevented = window.getComputedStyle(root).overflow === 'hidden';\n // If scrolling is not currently prevented then we aren’t in a overlay nor is a overlay open, just use element.scrollIntoView to bring the element into view\n if (!isScrollPrevented) {\n let {left: originalLeft, top: originalTop} = targetElement.getBoundingClientRect();\n\n // use scrollIntoView({block: 'nearest'}) instead of .focus to check if the element is fully in view or not since .focus()\n // 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\n targetElement?.scrollIntoView?.({block: 'nearest'});\n let {left: newLeft, top: newTop} = targetElement.getBoundingClientRect();\n // Account for sub pixel differences from rounding\n if ((Math.abs(originalLeft - newLeft) > 1) || (Math.abs(originalTop - newTop) > 1)) {\n opts?.containingElement?.scrollIntoView?.({block: 'center', inline: 'center'});\n targetElement.scrollIntoView?.({block: 'nearest'});\n }\n } else {\n let scrollParents = getScrollParents(targetElement);\n // If scrolling is prevented, we don't want to scroll the body since it might move the overlay partially offscreen and the user can't scroll it back into view.\n if (!isScrollPrevented) {\n scrollParents.push(root);\n }\n for (let scrollParent of scrollParents) {\n scrollIntoView(scrollParent as HTMLElement, targetElement as HTMLElement);\n }\n }\n }\n}\n"],"names":[],"version":3,"file":"scrollIntoView.main.js.map"}
import {getScrollParents as $a40c673dc9f6d9c7$export$94ed1c92c7beeb22} from "./getScrollParents.mjs";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollView, element) {
let offsetX = $2f04cbc44ee30ce0$var$relativeOffset(scrollView, element, 'left');
let offsetY = $2f04cbc44ee30ce0$var$relativeOffset(scrollView, element, 'top');
let width = element.offsetWidth;
let height = element.offsetHeight;
let x = scrollView.scrollLeft;
let y = scrollView.scrollTop;
// Account for top/left border offsetting the scroll top/Left + scroll padding
let { borderTopWidth: borderTopWidth, borderLeftWidth: borderLeftWidth, scrollPaddingTop: scrollPaddingTop, scrollPaddingRight: scrollPaddingRight, scrollPaddingBottom: scrollPaddingBottom, scrollPaddingLeft: scrollPaddingLeft } = getComputedStyle(scrollView);
let borderAdjustedX = x + parseInt(borderLeftWidth, 10);
let borderAdjustedY = y + parseInt(borderTopWidth, 10);
// Ignore end/bottom border via clientHeight/Width instead of offsetHeight/Width
let maxX = borderAdjustedX + scrollView.clientWidth;
let maxY = borderAdjustedY + scrollView.clientHeight;
// Get scroll padding values as pixels - defaults to 0 if no scroll padding
// is used.
let scrollPaddingTopNumber = parseInt(scrollPaddingTop, 10) || 0;
let scrollPaddingBottomNumber = parseInt(scrollPaddingBottom, 10) || 0;
let scrollPaddingRightNumber = parseInt(scrollPaddingRight, 10) || 0;
let scrollPaddingLeftNumber = parseInt(scrollPaddingLeft, 10) || 0;
if (offsetX <= x + scrollPaddingLeftNumber) x = offsetX - parseInt(borderLeftWidth, 10) - scrollPaddingLeftNumber;
else if (offsetX + width > maxX - scrollPaddingRightNumber) x += offsetX + width - maxX + scrollPaddingRightNumber;
if (offsetY <= borderAdjustedY + scrollPaddingTopNumber) y = offsetY - parseInt(borderTopWidth, 10) - scrollPaddingTopNumber;
else if (offsetY + height > maxY - scrollPaddingBottomNumber) y += offsetY + height - maxY + scrollPaddingBottomNumber;
scrollView.scrollLeft = x;
scrollView.scrollTop = y;
}
/**
* Computes the offset left or top from child to ancestor by accumulating
* offsetLeft or offsetTop through intervening offsetParents.
*/ function $2f04cbc44ee30ce0$var$relativeOffset(ancestor, child, axis) {
const prop = axis === 'left' ? 'offsetLeft' : 'offsetTop';
let sum = 0;
while(child.offsetParent){
sum += child[prop];
if (child.offsetParent === ancestor) break;
else if (child.offsetParent.contains(ancestor)) {
// If the ancestor is not `position:relative`, then we stop at
// _its_ offset parent, and we subtract off _its_ offset, so that
// we end up with the proper offset from child to ancestor.
sum -= ancestor[prop];
break;
}
child = child.offsetParent;
}
return sum;
}
function $2f04cbc44ee30ce0$export$c826860796309d1b(targetElement, opts) {
if (targetElement && document.contains(targetElement)) {
let root = document.scrollingElement || document.documentElement;
let isScrollPrevented = window.getComputedStyle(root).overflow === 'hidden';
// If scrolling is not currently prevented then we aren’t in a overlay nor is a overlay open, just use element.scrollIntoView to bring the element into view
if (!isScrollPrevented) {
var // use scrollIntoView({block: 'nearest'}) instead of .focus to check if the element is fully in view or not since .focus()
// 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
_targetElement_scrollIntoView;
let { left: originalLeft, top: originalTop } = targetElement.getBoundingClientRect();
targetElement === null || targetElement === void 0 ? void 0 : (_targetElement_scrollIntoView = targetElement.scrollIntoView) === null || _targetElement_scrollIntoView === void 0 ? void 0 : _targetElement_scrollIntoView.call(targetElement, {
block: 'nearest'
});
let { left: newLeft, top: newTop } = targetElement.getBoundingClientRect();
// Account for sub pixel differences from rounding
if (Math.abs(originalLeft - newLeft) > 1 || Math.abs(originalTop - newTop) > 1) {
var _opts_containingElement_scrollIntoView, _opts_containingElement, _targetElement_scrollIntoView1;
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, {
block: 'center',
inline: 'center'
});
(_targetElement_scrollIntoView1 = targetElement.scrollIntoView) === null || _targetElement_scrollIntoView1 === void 0 ? void 0 : _targetElement_scrollIntoView1.call(targetElement, {
block: 'nearest'
});
}
} else {
let scrollParents = (0, $a40c673dc9f6d9c7$export$94ed1c92c7beeb22)(targetElement);
// If scrolling is prevented, we don't want to scroll the body since it might move the overlay partially offscreen and the user can't scroll it back into view.
if (!isScrollPrevented) scrollParents.push(root);
for (let scrollParent of scrollParents)$2f04cbc44ee30ce0$export$53a0910f038337bd(scrollParent, targetElement);
}
}
}
export {$2f04cbc44ee30ce0$export$53a0910f038337bd as scrollIntoView, $2f04cbc44ee30ce0$export$c826860796309d1b as scrollIntoViewport};
//# sourceMappingURL=scrollIntoView.module.js.map
import {getScrollParents as $a40c673dc9f6d9c7$export$94ed1c92c7beeb22} from "./getScrollParents.module.js";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollView, element) {
let offsetX = $2f04cbc44ee30ce0$var$relativeOffset(scrollView, element, 'left');
let offsetY = $2f04cbc44ee30ce0$var$relativeOffset(scrollView, element, 'top');
let width = element.offsetWidth;
let height = element.offsetHeight;
let x = scrollView.scrollLeft;
let y = scrollView.scrollTop;
// Account for top/left border offsetting the scroll top/Left + scroll padding
let { borderTopWidth: borderTopWidth, borderLeftWidth: borderLeftWidth, scrollPaddingTop: scrollPaddingTop, scrollPaddingRight: scrollPaddingRight, scrollPaddingBottom: scrollPaddingBottom, scrollPaddingLeft: scrollPaddingLeft } = getComputedStyle(scrollView);
let borderAdjustedX = x + parseInt(borderLeftWidth, 10);
let borderAdjustedY = y + parseInt(borderTopWidth, 10);
// Ignore end/bottom border via clientHeight/Width instead of offsetHeight/Width
let maxX = borderAdjustedX + scrollView.clientWidth;
let maxY = borderAdjustedY + scrollView.clientHeight;
// Get scroll padding values as pixels - defaults to 0 if no scroll padding
// is used.
let scrollPaddingTopNumber = parseInt(scrollPaddingTop, 10) || 0;
let scrollPaddingBottomNumber = parseInt(scrollPaddingBottom, 10) || 0;
let scrollPaddingRightNumber = parseInt(scrollPaddingRight, 10) || 0;
let scrollPaddingLeftNumber = parseInt(scrollPaddingLeft, 10) || 0;
if (offsetX <= x + scrollPaddingLeftNumber) x = offsetX - parseInt(borderLeftWidth, 10) - scrollPaddingLeftNumber;
else if (offsetX + width > maxX - scrollPaddingRightNumber) x += offsetX + width - maxX + scrollPaddingRightNumber;
if (offsetY <= borderAdjustedY + scrollPaddingTopNumber) y = offsetY - parseInt(borderTopWidth, 10) - scrollPaddingTopNumber;
else if (offsetY + height > maxY - scrollPaddingBottomNumber) y += offsetY + height - maxY + scrollPaddingBottomNumber;
scrollView.scrollLeft = x;
scrollView.scrollTop = y;
}
/**
* Computes the offset left or top from child to ancestor by accumulating
* offsetLeft or offsetTop through intervening offsetParents.
*/ function $2f04cbc44ee30ce0$var$relativeOffset(ancestor, child, axis) {
const prop = axis === 'left' ? 'offsetLeft' : 'offsetTop';
let sum = 0;
while(child.offsetParent){
sum += child[prop];
if (child.offsetParent === ancestor) break;
else if (child.offsetParent.contains(ancestor)) {
// If the ancestor is not `position:relative`, then we stop at
// _its_ offset parent, and we subtract off _its_ offset, so that
// we end up with the proper offset from child to ancestor.
sum -= ancestor[prop];
break;
}
child = child.offsetParent;
}
return sum;
}
function $2f04cbc44ee30ce0$export$c826860796309d1b(targetElement, opts) {
if (targetElement && document.contains(targetElement)) {
let root = document.scrollingElement || document.documentElement;
let isScrollPrevented = window.getComputedStyle(root).overflow === 'hidden';
// If scrolling is not currently prevented then we aren’t in a overlay nor is a overlay open, just use element.scrollIntoView to bring the element into view
if (!isScrollPrevented) {
var // use scrollIntoView({block: 'nearest'}) instead of .focus to check if the element is fully in view or not since .focus()
// 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
_targetElement_scrollIntoView;
let { left: originalLeft, top: originalTop } = targetElement.getBoundingClientRect();
targetElement === null || targetElement === void 0 ? void 0 : (_targetElement_scrollIntoView = targetElement.scrollIntoView) === null || _targetElement_scrollIntoView === void 0 ? void 0 : _targetElement_scrollIntoView.call(targetElement, {
block: 'nearest'
});
let { left: newLeft, top: newTop } = targetElement.getBoundingClientRect();
// Account for sub pixel differences from rounding
if (Math.abs(originalLeft - newLeft) > 1 || Math.abs(originalTop - newTop) > 1) {
var _opts_containingElement_scrollIntoView, _opts_containingElement, _targetElement_scrollIntoView1;
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, {
block: 'center',
inline: 'center'
});
(_targetElement_scrollIntoView1 = targetElement.scrollIntoView) === null || _targetElement_scrollIntoView1 === void 0 ? void 0 : _targetElement_scrollIntoView1.call(targetElement, {
block: 'nearest'
});
}
} else {
let scrollParents = (0, $a40c673dc9f6d9c7$export$94ed1c92c7beeb22)(targetElement);
// If scrolling is prevented, we don't want to scroll the body since it might move the overlay partially offscreen and the user can't scroll it back into view.
if (!isScrollPrevented) scrollParents.push(root);
for (let scrollParent of scrollParents)$2f04cbc44ee30ce0$export$53a0910f038337bd(scrollParent, targetElement);
}
}
}
export {$2f04cbc44ee30ce0$export$53a0910f038337bd as scrollIntoView, $2f04cbc44ee30ce0$export$c826860796309d1b as scrollIntoViewport};
//# sourceMappingURL=scrollIntoView.module.js.map
{"mappings":"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","sources":["packages/@react-aria/utils/src/scrollIntoView.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {getScrollParents} from './getScrollParents';\n\ninterface ScrollIntoViewportOpts {\n /** The optional containing element of the target to be centered in the viewport. */\n containingElement?: Element | null\n}\n\n/**\n * Scrolls `scrollView` so that `element` is visible.\n * Similar to `element.scrollIntoView({block: 'nearest'})` (not supported in Edge),\n * but doesn't affect parents above `scrollView`.\n */\nexport function scrollIntoView(scrollView: HTMLElement, element: HTMLElement): void {\n let offsetX = relativeOffset(scrollView, element, 'left');\n let offsetY = relativeOffset(scrollView, element, 'top');\n let width = element.offsetWidth;\n let height = element.offsetHeight;\n let x = scrollView.scrollLeft;\n let y = scrollView.scrollTop;\n\n // Account for top/left border offsetting the scroll top/Left + scroll padding\n let {\n borderTopWidth,\n borderLeftWidth,\n scrollPaddingTop,\n scrollPaddingRight,\n scrollPaddingBottom,\n scrollPaddingLeft\n } = getComputedStyle(scrollView);\n\n let borderAdjustedX = x + parseInt(borderLeftWidth, 10);\n let borderAdjustedY = y + parseInt(borderTopWidth, 10);\n // Ignore end/bottom border via clientHeight/Width instead of offsetHeight/Width\n let maxX = borderAdjustedX + scrollView.clientWidth;\n let maxY = borderAdjustedY + scrollView.clientHeight;\n\n // Get scroll padding values as pixels - defaults to 0 if no scroll padding\n // is used.\n let scrollPaddingTopNumber = parseInt(scrollPaddingTop, 10) || 0;\n let scrollPaddingBottomNumber = parseInt(scrollPaddingBottom, 10) || 0;\n let scrollPaddingRightNumber = parseInt(scrollPaddingRight, 10) || 0;\n let scrollPaddingLeftNumber = parseInt(scrollPaddingLeft, 10) || 0;\n\n if (offsetX <= x + scrollPaddingLeftNumber) {\n x = offsetX - parseInt(borderLeftWidth, 10) - scrollPaddingLeftNumber;\n } else if (offsetX + width > maxX - scrollPaddingRightNumber) {\n x += offsetX + width - maxX + scrollPaddingRightNumber;\n }\n if (offsetY <= borderAdjustedY + scrollPaddingTopNumber) {\n y = offsetY - parseInt(borderTopWidth, 10) - scrollPaddingTopNumber;\n } else if (offsetY + height > maxY - scrollPaddingBottomNumber) {\n y += offsetY + height - maxY + scrollPaddingBottomNumber;\n }\n\n scrollView.scrollLeft = x;\n scrollView.scrollTop = y;\n}\n\n/**\n * Computes the offset left or top from child to ancestor by accumulating\n * offsetLeft or offsetTop through intervening offsetParents.\n */\nfunction relativeOffset(ancestor: HTMLElement, child: HTMLElement, axis: 'left'|'top') {\n const prop = axis === 'left' ? 'offsetLeft' : 'offsetTop';\n let sum = 0;\n while (child.offsetParent) {\n sum += child[prop];\n if (child.offsetParent === ancestor) {\n // Stop once we have found the ancestor we are interested in.\n break;\n } else if (child.offsetParent.contains(ancestor)) {\n // If the ancestor is not `position:relative`, then we stop at\n // _its_ offset parent, and we subtract off _its_ offset, so that\n // we end up with the proper offset from child to ancestor.\n sum -= ancestor[prop];\n break;\n }\n child = child.offsetParent as HTMLElement;\n }\n return sum;\n}\n\n/**\n * Scrolls the `targetElement` so it is visible in the viewport. Accepts an optional `opts.containingElement`\n * that will be centered in the viewport prior to scrolling the targetElement into view. If scrolling is prevented on\n * the body (e.g. targetElement is in a popover), this will only scroll the scroll parents of the targetElement up to but not including the body itself.\n */\nexport function scrollIntoViewport(targetElement: Element | null, opts?: ScrollIntoViewportOpts): void {\n if (targetElement && document.contains(targetElement)) {\n let root = document.scrollingElement || document.documentElement;\n let isScrollPrevented = window.getComputedStyle(root).overflow === 'hidden';\n // If scrolling is not currently prevented then we aren’t in a overlay nor is a overlay open, just use element.scrollIntoView to bring the element into view\n if (!isScrollPrevented) {\n let {left: originalLeft, top: originalTop} = targetElement.getBoundingClientRect();\n\n // use scrollIntoView({block: 'nearest'}) instead of .focus to check if the element is fully in view or not since .focus()\n // 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\n targetElement?.scrollIntoView?.({block: 'nearest'});\n let {left: newLeft, top: newTop} = targetElement.getBoundingClientRect();\n // Account for sub pixel differences from rounding\n if ((Math.abs(originalLeft - newLeft) > 1) || (Math.abs(originalTop - newTop) > 1)) {\n opts?.containingElement?.scrollIntoView?.({block: 'center', inline: 'center'});\n targetElement.scrollIntoView?.({block: 'nearest'});\n }\n } else {\n let scrollParents = getScrollParents(targetElement);\n // If scrolling is prevented, we don't want to scroll the body since it might move the overlay partially offscreen and the user can't scroll it back into view.\n if (!isScrollPrevented) {\n scrollParents.push(root);\n }\n for (let scrollParent of scrollParents) {\n scrollIntoView(scrollParent as HTMLElement, targetElement as HTMLElement);\n }\n }\n }\n}\n"],"names":[],"version":3,"file":"scrollIntoView.module.js.map"}
var $d723bea02f3e2567$exports = require("./DOMFunctions.main.js");
var $hdE3O$reactstatelyflags = require("@react-stately/flags");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "ShadowTreeWalker", () => $8e13b2545651735a$export$63eb3ababa9c55c4);
$parcel$export(module.exports, "createShadowTreeWalker", () => $8e13b2545651735a$export$4d0f8be8b12a7ef6);
// https://github.com/microsoft/tabster/blob/a89fc5d7e332d48f68d03b1ca6e344489d1c3898/src/Shadowdomize/ShadowTreeWalker.ts
class $8e13b2545651735a$export$63eb3ababa9c55c4 {
get currentNode() {
return this._currentNode;
}
set currentNode(node) {
if (!(0, $d723bea02f3e2567$exports.nodeContains)(this.root, node)) throw new Error('Cannot set currentNode to a node that is not contained by the root node.');
const walkers = [];
let curNode = node;
let currentWalkerCurrentNode = node;
this._currentNode = node;
while(curNode && curNode !== this.root)if (curNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
const shadowRoot = curNode;
const walker = this._doc.createTreeWalker(shadowRoot, this.whatToShow, {
acceptNode: this._acceptNode
});
walkers.push(walker);
walker.currentNode = currentWalkerCurrentNode;
this._currentSetFor.add(walker);
curNode = currentWalkerCurrentNode = shadowRoot.host;
} else curNode = curNode.parentNode;
const walker = this._doc.createTreeWalker(this.root, this.whatToShow, {
acceptNode: this._acceptNode
});
walkers.push(walker);
walker.currentNode = currentWalkerCurrentNode;
this._currentSetFor.add(walker);
this._walkerStack = walkers;
}
get doc() {
return this._doc;
}
firstChild() {
let currentNode = this.currentNode;
let newNode = this.nextNode();
if (!(0, $d723bea02f3e2567$exports.nodeContains)(currentNode, newNode)) {
this.currentNode = currentNode;
return null;
}
if (newNode) this.currentNode = newNode;
return newNode;
}
lastChild() {
let walker = this._walkerStack[0];
let newNode = walker.lastChild();
if (newNode) this.currentNode = newNode;
return newNode;
}
nextNode() {
const nextNode = this._walkerStack[0].nextNode();
if (nextNode) {
const shadowRoot = nextNode.shadowRoot;
if (shadowRoot) {
var _this_filter;
let nodeResult;
if (typeof this.filter === 'function') nodeResult = this.filter(nextNode);
else if ((_this_filter = this.filter) === null || _this_filter === void 0 ? void 0 : _this_filter.acceptNode) nodeResult = this.filter.acceptNode(nextNode);
if (nodeResult === NodeFilter.FILTER_ACCEPT) {
this.currentNode = nextNode;
return nextNode;
}
// _acceptNode should have added new walker for this shadow,
// go in recursively.
let newNode = this.nextNode();
if (newNode) this.currentNode = newNode;
return newNode;
}
if (nextNode) this.currentNode = nextNode;
return nextNode;
} else {
if (this._walkerStack.length > 1) {
this._walkerStack.shift();
let newNode = this.nextNode();
if (newNode) this.currentNode = newNode;
return newNode;
} else return null;
}
}
previousNode() {
const currentWalker = this._walkerStack[0];
if (currentWalker.currentNode === currentWalker.root) {
if (this._currentSetFor.has(currentWalker)) {
this._currentSetFor.delete(currentWalker);
if (this._walkerStack.length > 1) {
this._walkerStack.shift();
let newNode = this.previousNode();
if (newNode) this.currentNode = newNode;
return newNode;
} else return null;
}
return null;
}
const previousNode = currentWalker.previousNode();
if (previousNode) {
const shadowRoot = previousNode.shadowRoot;
if (shadowRoot) {
var _this_filter;
let nodeResult;
if (typeof this.filter === 'function') nodeResult = this.filter(previousNode);
else if ((_this_filter = this.filter) === null || _this_filter === void 0 ? void 0 : _this_filter.acceptNode) nodeResult = this.filter.acceptNode(previousNode);
if (nodeResult === NodeFilter.FILTER_ACCEPT) {
if (previousNode) this.currentNode = previousNode;
return previousNode;
}
// _acceptNode should have added new walker for this shadow,
// go in recursively.
let newNode = this.lastChild();
if (newNode) this.currentNode = newNode;
return newNode;
}
if (previousNode) this.currentNode = previousNode;
return previousNode;
} else {
if (this._walkerStack.length > 1) {
this._walkerStack.shift();
let newNode = this.previousNode();
if (newNode) this.currentNode = newNode;
return newNode;
} else return null;
}
}
/**
* @deprecated
*/ nextSibling() {
// if (__DEV__) {
// throw new Error("Method not implemented.");
// }
return null;
}
/**
* @deprecated
*/ previousSibling() {
// if (__DEV__) {
// throw new Error("Method not implemented.");
// }
return null;
}
/**
* @deprecated
*/ parentNode() {
// if (__DEV__) {
// throw new Error("Method not implemented.");
// }
return null;
}
constructor(doc, root, whatToShow, filter){
this._walkerStack = [];
this._currentSetFor = new Set();
this._acceptNode = (node)=>{
if (node.nodeType === Node.ELEMENT_NODE) {
const shadowRoot = node.shadowRoot;
if (shadowRoot) {
const walker = this._doc.createTreeWalker(shadowRoot, this.whatToShow, {
acceptNode: this._acceptNode
});
this._walkerStack.unshift(walker);
return NodeFilter.FILTER_ACCEPT;
} else {
var _this_filter;
if (typeof this.filter === 'function') return this.filter(node);
else if ((_this_filter = this.filter) === null || _this_filter === void 0 ? void 0 : _this_filter.acceptNode) return this.filter.acceptNode(node);
else if (this.filter === null) return NodeFilter.FILTER_ACCEPT;
}
}
return NodeFilter.FILTER_SKIP;
};
this._doc = doc;
this.root = root;
this.filter = filter !== null && filter !== void 0 ? filter : null;
this.whatToShow = whatToShow !== null && whatToShow !== void 0 ? whatToShow : NodeFilter.SHOW_ALL;
this._currentNode = root;
this._walkerStack.unshift(doc.createTreeWalker(root, whatToShow, this._acceptNode));
const shadowRoot = root.shadowRoot;
if (shadowRoot) {
const walker = this._doc.createTreeWalker(shadowRoot, this.whatToShow, {
acceptNode: this._acceptNode
});
this._walkerStack.unshift(walker);
}
}
}
function $8e13b2545651735a$export$4d0f8be8b12a7ef6(doc, root, whatToShow, filter) {
if ((0, $hdE3O$reactstatelyflags.shadowDOM)()) return new $8e13b2545651735a$export$63eb3ababa9c55c4(doc, root, whatToShow, filter);
return doc.createTreeWalker(root, whatToShow, filter);
}
//# sourceMappingURL=ShadowTreeWalker.main.js.map
{"mappings":"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","sources":["packages/@react-aria/utils/src/shadowdom/ShadowTreeWalker.ts"],"sourcesContent":["// https://github.com/microsoft/tabster/blob/a89fc5d7e332d48f68d03b1ca6e344489d1c3898/src/Shadowdomize/ShadowTreeWalker.ts\n\nimport {nodeContains} from './DOMFunctions';\nimport {shadowDOM} from '@react-stately/flags';\n\nexport class ShadowTreeWalker implements TreeWalker {\n public readonly filter: NodeFilter | null;\n public readonly root: Node;\n public readonly whatToShow: number;\n\n private _doc: Document;\n private _walkerStack: Array<TreeWalker> = [];\n private _currentNode: Node;\n private _currentSetFor: Set<TreeWalker> = new Set();\n\n constructor(\n doc: Document,\n root: Node,\n whatToShow?: number,\n filter?: NodeFilter | null\n ) {\n this._doc = doc;\n this.root = root;\n this.filter = filter ?? null;\n this.whatToShow = whatToShow ?? NodeFilter.SHOW_ALL;\n this._currentNode = root;\n\n this._walkerStack.unshift(\n doc.createTreeWalker(root, whatToShow, this._acceptNode)\n );\n\n const shadowRoot = (root as Element).shadowRoot;\n\n if (shadowRoot) {\n const walker = this._doc.createTreeWalker(\n shadowRoot,\n this.whatToShow,\n {acceptNode: this._acceptNode}\n );\n\n this._walkerStack.unshift(walker);\n }\n }\n\n private _acceptNode = (node: Node): number => {\n if (node.nodeType === Node.ELEMENT_NODE) {\n const shadowRoot = (node as Element).shadowRoot;\n\n if (shadowRoot) {\n const walker = this._doc.createTreeWalker(\n shadowRoot,\n this.whatToShow,\n {acceptNode: this._acceptNode}\n );\n\n this._walkerStack.unshift(walker);\n\n return NodeFilter.FILTER_ACCEPT;\n } else {\n if (typeof this.filter === 'function') {\n return this.filter(node);\n } else if (this.filter?.acceptNode) {\n return this.filter.acceptNode(node);\n } else if (this.filter === null) {\n return NodeFilter.FILTER_ACCEPT;\n }\n }\n }\n\n return NodeFilter.FILTER_SKIP;\n };\n\n public get currentNode(): Node {\n return this._currentNode;\n }\n\n public set currentNode(node: Node) {\n if (!nodeContains(this.root, node)) {\n throw new Error(\n 'Cannot set currentNode to a node that is not contained by the root node.'\n );\n }\n\n const walkers: TreeWalker[] = [];\n let curNode: Node | null | undefined = node;\n let currentWalkerCurrentNode = node;\n\n this._currentNode = node;\n\n while (curNode && curNode !== this.root) {\n if (curNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n const shadowRoot = curNode as ShadowRoot;\n\n const walker = this._doc.createTreeWalker(\n shadowRoot,\n this.whatToShow,\n {acceptNode: this._acceptNode}\n );\n\n walkers.push(walker);\n\n walker.currentNode = currentWalkerCurrentNode;\n\n this._currentSetFor.add(walker);\n\n curNode = currentWalkerCurrentNode = shadowRoot.host;\n } else {\n curNode = curNode.parentNode;\n }\n }\n\n const walker = this._doc.createTreeWalker(\n this.root,\n this.whatToShow,\n {acceptNode: this._acceptNode}\n );\n\n walkers.push(walker);\n\n walker.currentNode = currentWalkerCurrentNode;\n\n this._currentSetFor.add(walker);\n\n this._walkerStack = walkers;\n }\n\n public get doc(): Document {\n return this._doc;\n }\n\n public firstChild(): Node | null {\n let currentNode = this.currentNode;\n let newNode = this.nextNode();\n if (!nodeContains(currentNode, newNode)) {\n this.currentNode = currentNode;\n return null;\n }\n if (newNode) {\n this.currentNode = newNode;\n }\n return newNode;\n }\n\n public lastChild(): Node | null {\n let walker = this._walkerStack[0];\n let newNode = walker.lastChild();\n if (newNode) {\n this.currentNode = newNode;\n }\n return newNode;\n }\n\n public nextNode(): Node | null {\n const nextNode = this._walkerStack[0].nextNode();\n\n if (nextNode) {\n const shadowRoot = (nextNode as Element).shadowRoot;\n\n if (shadowRoot) {\n let nodeResult: number | undefined;\n\n if (typeof this.filter === 'function') {\n nodeResult = this.filter(nextNode);\n } else if (this.filter?.acceptNode) {\n nodeResult = this.filter.acceptNode(nextNode);\n }\n\n if (nodeResult === NodeFilter.FILTER_ACCEPT) {\n this.currentNode = nextNode;\n return nextNode;\n }\n\n // _acceptNode should have added new walker for this shadow,\n // go in recursively.\n let newNode = this.nextNode();\n if (newNode) {\n this.currentNode = newNode;\n }\n return newNode;\n }\n\n if (nextNode) {\n this.currentNode = nextNode;\n }\n return nextNode;\n } else {\n if (this._walkerStack.length > 1) {\n this._walkerStack.shift();\n\n let newNode = this.nextNode();\n if (newNode) {\n this.currentNode = newNode;\n }\n return newNode;\n } else {\n return null;\n }\n }\n }\n\n public previousNode(): Node | null {\n const currentWalker = this._walkerStack[0];\n\n if (currentWalker.currentNode === currentWalker.root) {\n if (this._currentSetFor.has(currentWalker)) {\n this._currentSetFor.delete(currentWalker);\n\n if (this._walkerStack.length > 1) {\n this._walkerStack.shift();\n let newNode = this.previousNode();\n if (newNode) {\n this.currentNode = newNode;\n }\n return newNode;\n } else {\n return null;\n }\n }\n\n return null;\n }\n\n const previousNode = currentWalker.previousNode();\n\n if (previousNode) {\n const shadowRoot = (previousNode as Element).shadowRoot;\n\n if (shadowRoot) {\n let nodeResult: number | undefined;\n\n if (typeof this.filter === 'function') {\n nodeResult = this.filter(previousNode);\n } else if (this.filter?.acceptNode) {\n nodeResult = this.filter.acceptNode(previousNode);\n }\n\n if (nodeResult === NodeFilter.FILTER_ACCEPT) {\n if (previousNode) {\n this.currentNode = previousNode;\n }\n return previousNode;\n }\n\n // _acceptNode should have added new walker for this shadow,\n // go in recursively.\n let newNode = this.lastChild();\n if (newNode) {\n this.currentNode = newNode;\n }\n return newNode;\n }\n\n if (previousNode) {\n this.currentNode = previousNode;\n }\n return previousNode;\n } else {\n if (this._walkerStack.length > 1) {\n this._walkerStack.shift();\n\n let newNode = this.previousNode();\n if (newNode) {\n this.currentNode = newNode;\n }\n return newNode;\n } else {\n return null;\n }\n }\n }\n\n /**\n * @deprecated\n */\n public nextSibling(): Node | null {\n // if (__DEV__) {\n // throw new Error(\"Method not implemented.\");\n // }\n\n return null;\n }\n\n /**\n * @deprecated\n */\n public previousSibling(): Node | null {\n // if (__DEV__) {\n // throw new Error(\"Method not implemented.\");\n // }\n\n return null;\n }\n\n /**\n * @deprecated\n */\n public parentNode(): Node | null {\n // if (__DEV__) {\n // throw new Error(\"Method not implemented.\");\n // }\n\n return null;\n }\n}\n\n/**\n * ShadowDOM safe version of document.createTreeWalker.\n */\nexport function createShadowTreeWalker(\n doc: Document,\n root: Node,\n whatToShow?: number,\n filter?: NodeFilter | null\n): TreeWalker {\n if (shadowDOM()) {\n return new ShadowTreeWalker(doc, root, whatToShow, filter);\n }\n return doc.createTreeWalker(root, whatToShow, filter);\n}\n"],"names":[],"version":3,"file":"ShadowTreeWalker.main.js.map"}
import {nodeContains as $d4ee10de306f2510$export$4282f70798064fe0} from "./DOMFunctions.mjs";
import {shadowDOM as $bJKXg$shadowDOM} from "@react-stately/flags";
// https://github.com/microsoft/tabster/blob/a89fc5d7e332d48f68d03b1ca6e344489d1c3898/src/Shadowdomize/ShadowTreeWalker.ts
class $dfc540311bf7f109$export$63eb3ababa9c55c4 {
get currentNode() {
return this._currentNode;
}
set currentNode(node) {
if (!(0, $d4ee10de306f2510$export$4282f70798064fe0)(this.root, node)) throw new Error('Cannot set currentNode to a node that is not contained by the root node.');
const walkers = [];
let curNode = node;
let currentWalkerCurrentNode = node;
this._currentNode = node;
while(curNode && curNode !== this.root)if (curNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
const shadowRoot = curNode;
const walker = this._doc.createTreeWalker(shadowRoot, this.whatToShow, {
acceptNode: this._acceptNode
});
walkers.push(walker);
walker.currentNode = currentWalkerCurrentNode;
this._currentSetFor.add(walker);
curNode = currentWalkerCurrentNode = shadowRoot.host;
} else curNode = curNode.parentNode;
const walker = this._doc.createTreeWalker(this.root, this.whatToShow, {
acceptNode: this._acceptNode
});
walkers.push(walker);
walker.currentNode = currentWalkerCurrentNode;
this._currentSetFor.add(walker);
this._walkerStack = walkers;
}
get doc() {
return this._doc;
}
firstChild() {
let currentNode = this.currentNode;
let newNode = this.nextNode();
if (!(0, $d4ee10de306f2510$export$4282f70798064fe0)(currentNode, newNode)) {
this.currentNode = currentNode;
return null;
}
if (newNode) this.currentNode = newNode;
return newNode;
}
lastChild() {
let walker = this._walkerStack[0];
let newNode = walker.lastChild();
if (newNode) this.currentNode = newNode;
return newNode;
}
nextNode() {
const nextNode = this._walkerStack[0].nextNode();
if (nextNode) {
const shadowRoot = nextNode.shadowRoot;
if (shadowRoot) {
var _this_filter;
let nodeResult;
if (typeof this.filter === 'function') nodeResult = this.filter(nextNode);
else if ((_this_filter = this.filter) === null || _this_filter === void 0 ? void 0 : _this_filter.acceptNode) nodeResult = this.filter.acceptNode(nextNode);
if (nodeResult === NodeFilter.FILTER_ACCEPT) {
this.currentNode = nextNode;
return nextNode;
}
// _acceptNode should have added new walker for this shadow,
// go in recursively.
let newNode = this.nextNode();
if (newNode) this.currentNode = newNode;
return newNode;
}
if (nextNode) this.currentNode = nextNode;
return nextNode;
} else {
if (this._walkerStack.length > 1) {
this._walkerStack.shift();
let newNode = this.nextNode();
if (newNode) this.currentNode = newNode;
return newNode;
} else return null;
}
}
previousNode() {
const currentWalker = this._walkerStack[0];
if (currentWalker.currentNode === currentWalker.root) {
if (this._currentSetFor.has(currentWalker)) {
this._currentSetFor.delete(currentWalker);
if (this._walkerStack.length > 1) {
this._walkerStack.shift();
let newNode = this.previousNode();
if (newNode) this.currentNode = newNode;
return newNode;
} else return null;
}
return null;
}
const previousNode = currentWalker.previousNode();
if (previousNode) {
const shadowRoot = previousNode.shadowRoot;
if (shadowRoot) {
var _this_filter;
let nodeResult;
if (typeof this.filter === 'function') nodeResult = this.filter(previousNode);
else if ((_this_filter = this.filter) === null || _this_filter === void 0 ? void 0 : _this_filter.acceptNode) nodeResult = this.filter.acceptNode(previousNode);
if (nodeResult === NodeFilter.FILTER_ACCEPT) {
if (previousNode) this.currentNode = previousNode;
return previousNode;
}
// _acceptNode should have added new walker for this shadow,
// go in recursively.
let newNode = this.lastChild();
if (newNode) this.currentNode = newNode;
return newNode;
}
if (previousNode) this.currentNode = previousNode;
return previousNode;
} else {
if (this._walkerStack.length > 1) {
this._walkerStack.shift();
let newNode = this.previousNode();
if (newNode) this.currentNode = newNode;
return newNode;
} else return null;
}
}
/**
* @deprecated
*/ nextSibling() {
// if (__DEV__) {
// throw new Error("Method not implemented.");
// }
return null;
}
/**
* @deprecated
*/ previousSibling() {
// if (__DEV__) {
// throw new Error("Method not implemented.");
// }
return null;
}
/**
* @deprecated
*/ parentNode() {
// if (__DEV__) {
// throw new Error("Method not implemented.");
// }
return null;
}
constructor(doc, root, whatToShow, filter){
this._walkerStack = [];
this._currentSetFor = new Set();
this._acceptNode = (node)=>{
if (node.nodeType === Node.ELEMENT_NODE) {
const shadowRoot = node.shadowRoot;
if (shadowRoot) {
const walker = this._doc.createTreeWalker(shadowRoot, this.whatToShow, {
acceptNode: this._acceptNode
});
this._walkerStack.unshift(walker);
return NodeFilter.FILTER_ACCEPT;
} else {
var _this_filter;
if (typeof this.filter === 'function') return this.filter(node);
else if ((_this_filter = this.filter) === null || _this_filter === void 0 ? void 0 : _this_filter.acceptNode) return this.filter.acceptNode(node);
else if (this.filter === null) return NodeFilter.FILTER_ACCEPT;
}
}
return NodeFilter.FILTER_SKIP;
};
this._doc = doc;
this.root = root;
this.filter = filter !== null && filter !== void 0 ? filter : null;
this.whatToShow = whatToShow !== null && whatToShow !== void 0 ? whatToShow : NodeFilter.SHOW_ALL;
this._currentNode = root;
this._walkerStack.unshift(doc.createTreeWalker(root, whatToShow, this._acceptNode));
const shadowRoot = root.shadowRoot;
if (shadowRoot) {
const walker = this._doc.createTreeWalker(shadowRoot, this.whatToShow, {
acceptNode: this._acceptNode
});
this._walkerStack.unshift(walker);
}
}
}
function $dfc540311bf7f109$export$4d0f8be8b12a7ef6(doc, root, whatToShow, filter) {
if ((0, $bJKXg$shadowDOM)()) return new $dfc540311bf7f109$export$63eb3ababa9c55c4(doc, root, whatToShow, filter);
return doc.createTreeWalker(root, whatToShow, filter);
}
export {$dfc540311bf7f109$export$63eb3ababa9c55c4 as ShadowTreeWalker, $dfc540311bf7f109$export$4d0f8be8b12a7ef6 as createShadowTreeWalker};
//# sourceMappingURL=ShadowTreeWalker.module.js.map
import {nodeContains as $d4ee10de306f2510$export$4282f70798064fe0} from "./DOMFunctions.module.js";
import {shadowDOM as $bJKXg$shadowDOM} from "@react-stately/flags";
// https://github.com/microsoft/tabster/blob/a89fc5d7e332d48f68d03b1ca6e344489d1c3898/src/Shadowdomize/ShadowTreeWalker.ts
class $dfc540311bf7f109$export$63eb3ababa9c55c4 {
get currentNode() {
return this._currentNode;
}
set currentNode(node) {
if (!(0, $d4ee10de306f2510$export$4282f70798064fe0)(this.root, node)) throw new Error('Cannot set currentNode to a node that is not contained by the root node.');
const walkers = [];
let curNode = node;
let currentWalkerCurrentNode = node;
this._currentNode = node;
while(curNode && curNode !== this.root)if (curNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
const shadowRoot = curNode;
const walker = this._doc.createTreeWalker(shadowRoot, this.whatToShow, {
acceptNode: this._acceptNode
});
walkers.push(walker);
walker.currentNode = currentWalkerCurrentNode;
this._currentSetFor.add(walker);
curNode = currentWalkerCurrentNode = shadowRoot.host;
} else curNode = curNode.parentNode;
const walker = this._doc.createTreeWalker(this.root, this.whatToShow, {
acceptNode: this._acceptNode
});
walkers.push(walker);
walker.currentNode = currentWalkerCurrentNode;
this._currentSetFor.add(walker);
this._walkerStack = walkers;
}
get doc() {
return this._doc;
}
firstChild() {
let currentNode = this.currentNode;
let newNode = this.nextNode();
if (!(0, $d4ee10de306f2510$export$4282f70798064fe0)(currentNode, newNode)) {
this.currentNode = currentNode;
return null;
}
if (newNode) this.currentNode = newNode;
return newNode;
}
lastChild() {
let walker = this._walkerStack[0];
let newNode = walker.lastChild();
if (newNode) this.currentNode = newNode;
return newNode;
}
nextNode() {
const nextNode = this._walkerStack[0].nextNode();
if (nextNode) {
const shadowRoot = nextNode.shadowRoot;
if (shadowRoot) {
var _this_filter;
let nodeResult;
if (typeof this.filter === 'function') nodeResult = this.filter(nextNode);
else if ((_this_filter = this.filter) === null || _this_filter === void 0 ? void 0 : _this_filter.acceptNode) nodeResult = this.filter.acceptNode(nextNode);
if (nodeResult === NodeFilter.FILTER_ACCEPT) {
this.currentNode = nextNode;
return nextNode;
}
// _acceptNode should have added new walker for this shadow,
// go in recursively.
let newNode = this.nextNode();
if (newNode) this.currentNode = newNode;
return newNode;
}
if (nextNode) this.currentNode = nextNode;
return nextNode;
} else {
if (this._walkerStack.length > 1) {
this._walkerStack.shift();
let newNode = this.nextNode();
if (newNode) this.currentNode = newNode;
return newNode;
} else return null;
}
}
previousNode() {
const currentWalker = this._walkerStack[0];
if (currentWalker.currentNode === currentWalker.root) {
if (this._currentSetFor.has(currentWalker)) {
this._currentSetFor.delete(currentWalker);
if (this._walkerStack.length > 1) {
this._walkerStack.shift();
let newNode = this.previousNode();
if (newNode) this.currentNode = newNode;
return newNode;
} else return null;
}
return null;
}
const previousNode = currentWalker.previousNode();
if (previousNode) {
const shadowRoot = previousNode.shadowRoot;
if (shadowRoot) {
var _this_filter;
let nodeResult;
if (typeof this.filter === 'function') nodeResult = this.filter(previousNode);
else if ((_this_filter = this.filter) === null || _this_filter === void 0 ? void 0 : _this_filter.acceptNode) nodeResult = this.filter.acceptNode(previousNode);
if (nodeResult === NodeFilter.FILTER_ACCEPT) {
if (previousNode) this.currentNode = previousNode;
return previousNode;
}
// _acceptNode should have added new walker for this shadow,
// go in recursively.
let newNode = this.lastChild();
if (newNode) this.currentNode = newNode;
return newNode;
}
if (previousNode) this.currentNode = previousNode;
return previousNode;
} else {
if (this._walkerStack.length > 1) {
this._walkerStack.shift();
let newNode = this.previousNode();
if (newNode) this.currentNode = newNode;
return newNode;
} else return null;
}
}
/**
* @deprecated
*/ nextSibling() {
// if (__DEV__) {
// throw new Error("Method not implemented.");
// }
return null;
}
/**
* @deprecated
*/ previousSibling() {
// if (__DEV__) {
// throw new Error("Method not implemented.");
// }
return null;
}
/**
* @deprecated
*/ parentNode() {
// if (__DEV__) {
// throw new Error("Method not implemented.");
// }
return null;
}
constructor(doc, root, whatToShow, filter){
this._walkerStack = [];
this._currentSetFor = new Set();
this._acceptNode = (node)=>{
if (node.nodeType === Node.ELEMENT_NODE) {
const shadowRoot = node.shadowRoot;
if (shadowRoot) {
const walker = this._doc.createTreeWalker(shadowRoot, this.whatToShow, {
acceptNode: this._acceptNode
});
this._walkerStack.unshift(walker);
return NodeFilter.FILTER_ACCEPT;
} else {
var _this_filter;
if (typeof this.filter === 'function') return this.filter(node);
else if ((_this_filter = this.filter) === null || _this_filter === void 0 ? void 0 : _this_filter.acceptNode) return this.filter.acceptNode(node);
else if (this.filter === null) return NodeFilter.FILTER_ACCEPT;
}
}
return NodeFilter.FILTER_SKIP;
};
this._doc = doc;
this.root = root;
this.filter = filter !== null && filter !== void 0 ? filter : null;
this.whatToShow = whatToShow !== null && whatToShow !== void 0 ? whatToShow : NodeFilter.SHOW_ALL;
this._currentNode = root;
this._walkerStack.unshift(doc.createTreeWalker(root, whatToShow, this._acceptNode));
const shadowRoot = root.shadowRoot;
if (shadowRoot) {
const walker = this._doc.createTreeWalker(shadowRoot, this.whatToShow, {
acceptNode: this._acceptNode
});
this._walkerStack.unshift(walker);
}
}
}
function $dfc540311bf7f109$export$4d0f8be8b12a7ef6(doc, root, whatToShow, filter) {
if ((0, $bJKXg$shadowDOM)()) return new $dfc540311bf7f109$export$63eb3ababa9c55c4(doc, root, whatToShow, filter);
return doc.createTreeWalker(root, whatToShow, filter);
}
export {$dfc540311bf7f109$export$63eb3ababa9c55c4 as ShadowTreeWalker, $dfc540311bf7f109$export$4d0f8be8b12a7ef6 as createShadowTreeWalker};
//# sourceMappingURL=ShadowTreeWalker.module.js.map
{"mappings":"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","sources":["packages/@react-aria/utils/src/shadowdom/ShadowTreeWalker.ts"],"sourcesContent":["// https://github.com/microsoft/tabster/blob/a89fc5d7e332d48f68d03b1ca6e344489d1c3898/src/Shadowdomize/ShadowTreeWalker.ts\n\nimport {nodeContains} from './DOMFunctions';\nimport {shadowDOM} from '@react-stately/flags';\n\nexport class ShadowTreeWalker implements TreeWalker {\n public readonly filter: NodeFilter | null;\n public readonly root: Node;\n public readonly whatToShow: number;\n\n private _doc: Document;\n private _walkerStack: Array<TreeWalker> = [];\n private _currentNode: Node;\n private _currentSetFor: Set<TreeWalker> = new Set();\n\n constructor(\n doc: Document,\n root: Node,\n whatToShow?: number,\n filter?: NodeFilter | null\n ) {\n this._doc = doc;\n this.root = root;\n this.filter = filter ?? null;\n this.whatToShow = whatToShow ?? NodeFilter.SHOW_ALL;\n this._currentNode = root;\n\n this._walkerStack.unshift(\n doc.createTreeWalker(root, whatToShow, this._acceptNode)\n );\n\n const shadowRoot = (root as Element).shadowRoot;\n\n if (shadowRoot) {\n const walker = this._doc.createTreeWalker(\n shadowRoot,\n this.whatToShow,\n {acceptNode: this._acceptNode}\n );\n\n this._walkerStack.unshift(walker);\n }\n }\n\n private _acceptNode = (node: Node): number => {\n if (node.nodeType === Node.ELEMENT_NODE) {\n const shadowRoot = (node as Element).shadowRoot;\n\n if (shadowRoot) {\n const walker = this._doc.createTreeWalker(\n shadowRoot,\n this.whatToShow,\n {acceptNode: this._acceptNode}\n );\n\n this._walkerStack.unshift(walker);\n\n return NodeFilter.FILTER_ACCEPT;\n } else {\n if (typeof this.filter === 'function') {\n return this.filter(node);\n } else if (this.filter?.acceptNode) {\n return this.filter.acceptNode(node);\n } else if (this.filter === null) {\n return NodeFilter.FILTER_ACCEPT;\n }\n }\n }\n\n return NodeFilter.FILTER_SKIP;\n };\n\n public get currentNode(): Node {\n return this._currentNode;\n }\n\n public set currentNode(node: Node) {\n if (!nodeContains(this.root, node)) {\n throw new Error(\n 'Cannot set currentNode to a node that is not contained by the root node.'\n );\n }\n\n const walkers: TreeWalker[] = [];\n let curNode: Node | null | undefined = node;\n let currentWalkerCurrentNode = node;\n\n this._currentNode = node;\n\n while (curNode && curNode !== this.root) {\n if (curNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n const shadowRoot = curNode as ShadowRoot;\n\n const walker = this._doc.createTreeWalker(\n shadowRoot,\n this.whatToShow,\n {acceptNode: this._acceptNode}\n );\n\n walkers.push(walker);\n\n walker.currentNode = currentWalkerCurrentNode;\n\n this._currentSetFor.add(walker);\n\n curNode = currentWalkerCurrentNode = shadowRoot.host;\n } else {\n curNode = curNode.parentNode;\n }\n }\n\n const walker = this._doc.createTreeWalker(\n this.root,\n this.whatToShow,\n {acceptNode: this._acceptNode}\n );\n\n walkers.push(walker);\n\n walker.currentNode = currentWalkerCurrentNode;\n\n this._currentSetFor.add(walker);\n\n this._walkerStack = walkers;\n }\n\n public get doc(): Document {\n return this._doc;\n }\n\n public firstChild(): Node | null {\n let currentNode = this.currentNode;\n let newNode = this.nextNode();\n if (!nodeContains(currentNode, newNode)) {\n this.currentNode = currentNode;\n return null;\n }\n if (newNode) {\n this.currentNode = newNode;\n }\n return newNode;\n }\n\n public lastChild(): Node | null {\n let walker = this._walkerStack[0];\n let newNode = walker.lastChild();\n if (newNode) {\n this.currentNode = newNode;\n }\n return newNode;\n }\n\n public nextNode(): Node | null {\n const nextNode = this._walkerStack[0].nextNode();\n\n if (nextNode) {\n const shadowRoot = (nextNode as Element).shadowRoot;\n\n if (shadowRoot) {\n let nodeResult: number | undefined;\n\n if (typeof this.filter === 'function') {\n nodeResult = this.filter(nextNode);\n } else if (this.filter?.acceptNode) {\n nodeResult = this.filter.acceptNode(nextNode);\n }\n\n if (nodeResult === NodeFilter.FILTER_ACCEPT) {\n this.currentNode = nextNode;\n return nextNode;\n }\n\n // _acceptNode should have added new walker for this shadow,\n // go in recursively.\n let newNode = this.nextNode();\n if (newNode) {\n this.currentNode = newNode;\n }\n return newNode;\n }\n\n if (nextNode) {\n this.currentNode = nextNode;\n }\n return nextNode;\n } else {\n if (this._walkerStack.length > 1) {\n this._walkerStack.shift();\n\n let newNode = this.nextNode();\n if (newNode) {\n this.currentNode = newNode;\n }\n return newNode;\n } else {\n return null;\n }\n }\n }\n\n public previousNode(): Node | null {\n const currentWalker = this._walkerStack[0];\n\n if (currentWalker.currentNode === currentWalker.root) {\n if (this._currentSetFor.has(currentWalker)) {\n this._currentSetFor.delete(currentWalker);\n\n if (this._walkerStack.length > 1) {\n this._walkerStack.shift();\n let newNode = this.previousNode();\n if (newNode) {\n this.currentNode = newNode;\n }\n return newNode;\n } else {\n return null;\n }\n }\n\n return null;\n }\n\n const previousNode = currentWalker.previousNode();\n\n if (previousNode) {\n const shadowRoot = (previousNode as Element).shadowRoot;\n\n if (shadowRoot) {\n let nodeResult: number | undefined;\n\n if (typeof this.filter === 'function') {\n nodeResult = this.filter(previousNode);\n } else if (this.filter?.acceptNode) {\n nodeResult = this.filter.acceptNode(previousNode);\n }\n\n if (nodeResult === NodeFilter.FILTER_ACCEPT) {\n if (previousNode) {\n this.currentNode = previousNode;\n }\n return previousNode;\n }\n\n // _acceptNode should have added new walker for this shadow,\n // go in recursively.\n let newNode = this.lastChild();\n if (newNode) {\n this.currentNode = newNode;\n }\n return newNode;\n }\n\n if (previousNode) {\n this.currentNode = previousNode;\n }\n return previousNode;\n } else {\n if (this._walkerStack.length > 1) {\n this._walkerStack.shift();\n\n let newNode = this.previousNode();\n if (newNode) {\n this.currentNode = newNode;\n }\n return newNode;\n } else {\n return null;\n }\n }\n }\n\n /**\n * @deprecated\n */\n public nextSibling(): Node | null {\n // if (__DEV__) {\n // throw new Error(\"Method not implemented.\");\n // }\n\n return null;\n }\n\n /**\n * @deprecated\n */\n public previousSibling(): Node | null {\n // if (__DEV__) {\n // throw new Error(\"Method not implemented.\");\n // }\n\n return null;\n }\n\n /**\n * @deprecated\n */\n public parentNode(): Node | null {\n // if (__DEV__) {\n // throw new Error(\"Method not implemented.\");\n // }\n\n return null;\n }\n}\n\n/**\n * ShadowDOM safe version of document.createTreeWalker.\n */\nexport function createShadowTreeWalker(\n doc: Document,\n root: Node,\n whatToShow?: number,\n filter?: NodeFilter | null\n): TreeWalker {\n if (shadowDOM()) {\n return new ShadowTreeWalker(doc, root, whatToShow, filter);\n }\n return doc.createTreeWalker(root, whatToShow, filter);\n}\n"],"names":[],"version":3,"file":"ShadowTreeWalker.module.js.map"}
import React, { MutableRefObject, Ref, DOMAttributes, JSX, MouseEvent, ReactNode, HTMLAttributes, EffectCallback, Dispatch, RefObject as _RefObject1 } from "react";
import { AriaLabelingProps, DOMProps, GlobalDOMAttributes, LinkDOMProps, FocusableElement, Orientation, Href, RouterOptions, RefObject, AsyncLoadable, Collection } from "@react-types/shared";
export const useLayoutEffect: typeof React.useLayoutEffect;
/**
* If a default is not provided, generate an id.
* @param defaultId - Default component id.
*/
export function useId(defaultId?: string): string;
/**
* Merges two ids.
* Different ids will trigger a side-effect and re-render components hooked up with `useId`.
*/
export function mergeIds(idA: string, idB: string): string;
/**
* Used to generate an id, and after render, check if that id is rendered so we know
* if we can use it in places such as labelledby.
* @param depArray - When to recalculate if the id is in the DOM.
*/
export function useSlotId(depArray?: ReadonlyArray<any>): string;
/**
* Calls all functions in the order they were chained with the same arguments.
*/
export function chain(...callbacks: any[]): (...args: any[]) => void;
export const getOwnerDocument: (el: Element | null | undefined) => Document;
export const getOwnerWindow: (el: (Window & typeof globalThis) | Element | null | undefined) => Window & typeof globalThis;
/**
* Type guard that checks if a node is a ShadowRoot. Uses nodeType and host property checks to
* distinguish ShadowRoot from other DocumentFragments.
*/
export function isShadowRoot(node: Node | null): node is ShadowRoot;
/**
* ShadowDOM safe version of Node.contains.
*/
export function nodeContains(node: Node | null | undefined, otherNode: Node | null | undefined): boolean;
/**
* ShadowDOM safe version of document.activeElement.
*/
export const getActiveElement: (doc?: Document) => Element | null;
/**
* ShadowDOM safe version of event.target.
*/
export function getEventTarget<T extends Event>(event: T): Element;
export class ShadowTreeWalker implements TreeWalker {
readonly filter: NodeFilter | null;
readonly root: Node;
readonly whatToShow: number;
constructor(doc: Document, root: Node, whatToShow?: number, filter?: NodeFilter | null);
get currentNode(): Node;
set currentNode(node: Node);
get doc(): Document;
firstChild(): Node | null;
lastChild(): Node | null;
nextNode(): Node | null;
previousNode(): Node | null;
/**
* @deprecated
*/
nextSibling(): Node | null;
/**
* @deprecated
*/
previousSibling(): Node | null;
/**
* @deprecated
*/
parentNode(): Node | null;
}
/**
* ShadowDOM safe version of document.createTreeWalker.
*/
export function createShadowTreeWalker(doc: Document, root: Node, whatToShow?: number, filter?: NodeFilter | null): TreeWalker;
interface Props {
[key: string]: any;
}
type PropsArg = Props | null | undefined;
type TupleTypes<T> = {
[P in keyof T]: T[P];
} extends {
[key: number]: infer V;
} ? NullToObject<V> : never;
type NullToObject<T> = T extends (null | undefined) ? {} : T;
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
/**
* Merges multiple props objects together. Event handlers are chained,
* classNames are combined, and ids are deduplicated.
* For all other props, the last prop object overrides all previous ones.
* @param args - Multiple sets of props to merge together.
*/
export function mergeProps<T extends PropsArg[]>(...args: T): UnionToIntersection<TupleTypes<T>>;
/**
* Merges multiple refs into one. Works with either callback or object refs.
*/
export function mergeRefs<T>(...refs: Array<Ref<T> | MutableRefObject<T> | null | undefined>): Ref<T>;
interface Options {
/**
* If labelling associated aria properties should be included in the filter.
*/
labelable?: boolean;
/** Whether the element is a link and should include DOM props for <a> elements. */
isLink?: boolean;
/** Whether to include global DOM attributes. */
global?: boolean;
/** Whether to include DOM events. */
events?: boolean;
/**
* A Set of other property names that should be included in the filter.
*/
propNames?: Set<string>;
}
/**
* Filters out all props that aren't valid DOM props or defined via override prop obj.
* @param props - The component props to be filtered.
* @param opts - Props to override.
*/
export function filterDOMProps(props: DOMProps & AriaLabelingProps & LinkDOMProps & GlobalDOMAttributes, opts?: Options): DOMProps & AriaLabelingProps & GlobalDOMAttributes;
export function focusWithoutScrolling(element: FocusableElement): void;
export function getOffset(element: HTMLElement, reverse?: boolean, orientation?: Orientation): number;
export const isMac: () => boolean;
export const isIPhone: () => boolean;
export const isIPad: () => boolean;
export const isIOS: () => boolean;
export const isAppleDevice: () => boolean;
export const isWebKit: () => boolean;
export const isChrome: () => boolean;
export const isAndroid: () => boolean;
export const isFirefox: () => boolean;
interface Router {
isNative: boolean;
open: (target: Element, modifiers: Modifiers, href: Href, routerOptions: RouterOptions | undefined) => void;
useHref: (href: Href) => string;
}
interface RouterProviderProps {
navigate: (path: Href, routerOptions: RouterOptions | undefined) => void;
useHref?: (href: Href) => string;
children: ReactNode;
}
/**
* A RouterProvider accepts a `navigate` function from a framework or client side router,
* and provides it to all nested React Aria links to enable client side navigation.
*/
export function RouterProvider(props: RouterProviderProps): JSX.Element;
export function useRouter(): Router;
interface Modifiers {
metaKey?: boolean;
ctrlKey?: boolean;
altKey?: boolean;
shiftKey?: boolean;
}
export function shouldClientNavigate(link: HTMLAnchorElement, modifiers: Modifiers): boolean;
export function openLink(target: HTMLAnchorElement, modifiers: Modifiers, setOpening?: boolean): void;
export function useSyntheticLinkProps(props: LinkDOMProps): DOMAttributes<HTMLElement>;
/** @deprecated - For backward compatibility. */
export function getSyntheticLinkProps(props: LinkDOMProps): DOMAttributes<HTMLElement>;
export function useLinkProps(props?: LinkDOMProps): LinkDOMProps;
export function handleLinkClick(e: MouseEvent, router: Router, href: Href | undefined, routerOptions: RouterOptions | undefined): void;
export function runAfterTransition(fn: () => void): void;
interface UseDrag1DProps {
containerRef: MutableRefObject<HTMLElement>;
reverse?: boolean;
orientation?: Orientation;
onHover?: (hovered: boolean) => void;
onDrag?: (dragging: boolean) => void;
onPositionChange?: (position: number) => void;
onIncrement?: () => void;
onDecrement?: () => void;
onIncrementToMax?: () => void;
onDecrementToMin?: () => void;
onCollapseToggle?: () => void;
}
export function useDrag1D(props: UseDrag1DProps): HTMLAttributes<HTMLElement>;
interface GlobalListeners {
addGlobalListener<K extends keyof WindowEventMap>(el: Window, type: K, listener: (this: Document, ev: WindowEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addGlobalListener<K extends keyof DocumentEventMap>(el: EventTarget, type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addGlobalListener(el: EventTarget, type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeGlobalListener<K extends keyof DocumentEventMap>(el: EventTarget, type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
removeGlobalListener(el: EventTarget, type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
removeAllGlobalListeners(): void;
}
export function useGlobalListeners(): GlobalListeners;
/**
* Merges aria-label and aria-labelledby into aria-labelledby when both exist.
* @param props - Aria label props.
* @param defaultLabel - Default value for aria-label when not present.
*/
export function useLabels(props: DOMProps & AriaLabelingProps, defaultLabel?: string): DOMProps & AriaLabelingProps;
/**
* Offers an object ref for a given callback ref or an object ref. Especially
* helfpul when passing forwarded refs (created using `React.forwardRef`) to
* React Aria hooks.
*
* @param ref The original ref intended to be used.
* @returns An object ref that updates the given ref.
* @see https://react.dev/reference/react/forwardRef
*/
export function useObjectRef<T>(ref?: ((instance: T | null) => (() => void) | void) | MutableRefObject<T | null> | null): MutableRefObject<T | null>;
export function useEffectEvent<T extends Function>(fn: T): T;
export function useUpdateEffect(cb: EffectCallback, dependencies: any[]): void;
export function useUpdateLayoutEffect(effect: EffectCallback, dependencies: any[]): void;
type useResizeObserverOptionsType<T> = {
ref: RefObject<T | undefined | null> | undefined;
box?: ResizeObserverBoxOptions;
onResize: () => void;
};
export function useResizeObserver<T extends Element>(options: useResizeObserverOptionsType<T>): void;
interface ContextValue<T> {
ref?: MutableRefObject<T | null>;
}
export function useSyncRef<T>(context?: ContextValue<T> | null, ref?: RefObject<T | null>): void;
export function isScrollable(node: Element | null, checkForOverflow?: boolean): boolean;
export function getScrollParent(node: Element, checkForOverflow?: boolean): Element;
export function getScrollParents(node: Element, checkForOverflow?: boolean): Element[];
interface Event {
altKey: boolean;
ctrlKey: boolean;
metaKey: boolean;
}
export function isCtrlKeyPressed(e: Event): boolean;
export function willOpenKeyboard(target: Element): boolean;
interface ViewportSize {
width: number;
height: number;
}
export function useViewportSize(): ViewportSize;
export function useDescription(description?: string): AriaLabelingProps;
export function useEvent<K extends keyof GlobalEventHandlersEventMap>(ref: RefObject<EventTarget | null>, event: K | (string & {}), handler?: (this: Document, ev: GlobalEventHandlersEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
type SetValueAction<S> = (prev: S) => Generator<any, void, unknown>;
export function useValueEffect<S>(defaultValue: S | (() => S)): [S, Dispatch<SetValueAction<S>>];
interface ScrollIntoViewportOpts {
/** The optional containing element of the target to be centered in the viewport. */
containingElement?: Element | null;
}
/**
* Scrolls `scrollView` so that `element` is visible.
* Similar to `element.scrollIntoView({block: 'nearest'})` (not supported in Edge),
* but doesn't affect parents above `scrollView`.
*/
export function scrollIntoView(scrollView: HTMLElement, element: HTMLElement): void;
/**
* Scrolls the `targetElement` so it is visible in the viewport. Accepts an optional `opts.containingElement`
* that will be centered in the viewport prior to scrolling the targetElement into view. If scrolling is prevented on
* the body (e.g. targetElement is in a popover), this will only scroll the scroll parents of the targetElement up to but not including the body itself.
*/
export function scrollIntoViewport(targetElement: Element | null, opts?: ScrollIntoViewportOpts): void;
export function isVirtualClick(event: MouseEvent | PointerEvent): boolean;
export function isVirtualPointerEvent(event: PointerEvent): boolean;
export function useDeepMemo<T>(value: T, isEqual: (a: T, b: T) => boolean): T;
export function useFormReset<T>(ref: RefObject<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement | null> | undefined, initialValue: T, onReset: (value: T) => void): void;
interface LoadMoreProps {
/** Whether data is currently being loaded. */
isLoading?: boolean;
/** Handler that is called when more items should be loaded, e.g. while scrolling near the bottom. */
onLoadMore?: () => void;
/**
* The amount of offset from the bottom of your scrollable region that should trigger load more.
* Uses a percentage value relative to the scroll body's client height. Load more is then triggered
* when your current scroll position's distance from the bottom of the currently loaded list of items is less than
* or equal to the provided value. (e.g. 1 = 100% of the scroll region's height).
* @default 1
*/
scrollOffset?: number;
/** The data currently loaded. */
items?: any;
}
export function useLoadMore(props: LoadMoreProps, ref: _RefObject1<HTMLElement | null>): void;
export interface LoadMoreSentinelProps extends Omit<AsyncLoadable, 'isLoading'> {
collection: Collection<any>;
/**
* The amount of offset from the bottom of your scrollable region that should trigger load more.
* Uses a percentage value relative to the scroll body's client height. Load more is then triggered
* when your current scroll position's distance from the bottom of the currently loaded list of items is less than
* or equal to the provided value. (e.g. 1 = 100% of the scroll region's height).
* @default 1
*/
scrollOffset?: number;
}
export function UNSTABLE_useLoadMoreSentinel(props: LoadMoreSentinelProps, ref: _RefObject1<HTMLElement | null>): void;
export function inertValue(value?: boolean): string | boolean | undefined;
export const CLEAR_FOCUS_EVENT = "react-aria-clear-focus";
export const FOCUS_EVENT = "react-aria-focus";
export function useEnterAnimation(ref: _RefObject1<HTMLElement | null>, isReady?: boolean): boolean;
export function useExitAnimation(ref: _RefObject1<HTMLElement | null>, isOpen: boolean): boolean;
export function isFocusable(element: Element): boolean;
export function isTabbable(element: Element): boolean;
export { clamp, snapValueToStep } from '@react-stately/utils';
//# sourceMappingURL=types.d.ts.map
{"mappings":"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","sources":["packages/@react-aria/utils/src/packages/@react-aria/utils/src/useLayoutEffect.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useId.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/chain.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/domHelpers.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/shadowdom/DOMFunctions.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/shadowdom/ShadowTreeWalker.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/mergeProps.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/mergeRefs.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/filterDOMProps.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/focusWithoutScrolling.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/getOffset.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/platform.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/openLink.tsx","packages/@react-aria/utils/src/packages/@react-aria/utils/src/runAfterTransition.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useDrag1D.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useGlobalListeners.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useLabels.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useObjectRef.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useEffectEvent.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useUpdateEffect.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useUpdateLayoutEffect.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useResizeObserver.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useSyncRef.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/isScrollable.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/getScrollParent.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/getScrollParents.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/keyboard.tsx","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useViewportSize.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useDescription.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useEvent.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useValueEffect.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/scrollIntoView.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/isVirtualEvent.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useDeepMemo.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useFormReset.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useLoadMore.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useLoadMoreSentinel.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/inertValue.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/constants.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/animation.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/isElementVisible.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/isFocusable.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/index.ts","packages/@react-aria/utils/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nexport {useId, mergeIds, useSlotId} from './useId';\nexport {chain} from './chain';\nexport {createShadowTreeWalker, ShadowTreeWalker} from './shadowdom/ShadowTreeWalker';\nexport {getActiveElement, getEventTarget, nodeContains} from './shadowdom/DOMFunctions';\nexport {getOwnerDocument, getOwnerWindow, isShadowRoot} from './domHelpers';\nexport {mergeProps} from './mergeProps';\nexport {mergeRefs} from './mergeRefs';\nexport {filterDOMProps} from './filterDOMProps';\nexport {focusWithoutScrolling} from './focusWithoutScrolling';\nexport {getOffset} from './getOffset';\nexport {openLink, getSyntheticLinkProps, useSyntheticLinkProps, RouterProvider, shouldClientNavigate, useRouter, useLinkProps, handleLinkClick} from './openLink';\nexport {runAfterTransition} from './runAfterTransition';\nexport {useDrag1D} from './useDrag1D';\nexport {useGlobalListeners} from './useGlobalListeners';\nexport {useLabels} from './useLabels';\nexport {useObjectRef} from './useObjectRef';\nexport {useUpdateEffect} from './useUpdateEffect';\nexport {useUpdateLayoutEffect} from './useUpdateLayoutEffect';\nexport {useLayoutEffect} from './useLayoutEffect';\nexport {useResizeObserver} from './useResizeObserver';\nexport {useSyncRef} from './useSyncRef';\nexport {getScrollParent} from './getScrollParent';\nexport {getScrollParents} from './getScrollParents';\nexport {isScrollable} from './isScrollable';\nexport {useViewportSize} from './useViewportSize';\nexport {useDescription} from './useDescription';\nexport {isMac, isIPhone, isIPad, isIOS, isAppleDevice, isWebKit, isChrome, isAndroid, isFirefox} from './platform';\nexport {useEvent} from './useEvent';\nexport {useValueEffect} from './useValueEffect';\nexport {scrollIntoView, scrollIntoViewport} from './scrollIntoView';\nexport {clamp, snapValueToStep} from '@react-stately/utils';\nexport {isVirtualClick, isVirtualPointerEvent} from './isVirtualEvent';\nexport {useEffectEvent} from './useEffectEvent';\nexport {useDeepMemo} from './useDeepMemo';\nexport {useFormReset} from './useFormReset';\nexport {useLoadMore} from './useLoadMore';\nexport {useLoadMoreSentinel, useLoadMoreSentinel as UNSTABLE_useLoadMoreSentinel} from './useLoadMoreSentinel';\nexport {inertValue} from './inertValue';\nexport {CLEAR_FOCUS_EVENT, FOCUS_EVENT} from './constants';\nexport {isCtrlKeyPressed, willOpenKeyboard} from './keyboard';\nexport {useEnterAnimation, useExitAnimation} from './animation';\nexport {isFocusable, isTabbable} from './isFocusable';\n\nexport type {LoadMoreSentinelProps} from './useLoadMoreSentinel';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
var $4FGhO$react = require("react");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useDeepMemo", () => $20e6e72fbf5dc81e$export$722debc0e56fea39);
/*
* Copyright 2023 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ /* eslint-disable rulesdir/pure-render */
function $20e6e72fbf5dc81e$export$722debc0e56fea39(value, isEqual) {
// Using a ref during render is ok here because it's only an optimization – both values are equivalent.
// If a render is thrown away, it'll still work the same no matter if the next render is the same or not.
let lastValue = (0, $4FGhO$react.useRef)(null);
if (value && lastValue.current && isEqual(value, lastValue.current)) value = lastValue.current;
lastValue.current = value;
return value;
}
//# sourceMappingURL=useDeepMemo.main.js.map
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,uCAAuC;AAIhC,SAAS,0CAAe,KAAQ,EAAE,OAAgC;IACvE,uGAAuG;IACvG,yGAAyG;IACzG,IAAI,YAAY,CAAA,GAAA,mBAAK,EAAY;IACjC,IAAI,SAAS,UAAU,OAAO,IAAI,QAAQ,OAAO,UAAU,OAAO,GAChE,QAAQ,UAAU,OAAO;IAG3B,UAAU,OAAO,GAAG;IACpB,OAAO;AACT","sources":["packages/@react-aria/utils/src/useDeepMemo.ts"],"sourcesContent":["/*\n * Copyright 2023 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/* eslint-disable rulesdir/pure-render */\n\nimport {useRef} from 'react';\n\nexport function useDeepMemo<T>(value: T, isEqual: (a: T, b: T) => boolean): T {\n // Using a ref during render is ok here because it's only an optimization – both values are equivalent.\n // If a render is thrown away, it'll still work the same no matter if the next render is the same or not.\n let lastValue = useRef<T | null>(null);\n if (value && lastValue.current && isEqual(value, lastValue.current)) {\n value = lastValue.current;\n }\n\n lastValue.current = value;\n return value;\n}\n"],"names":[],"version":3,"file":"useDeepMemo.main.js.map"}
import {useRef as $jtQ6z$useRef} from "react";
/*
* Copyright 2023 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ /* eslint-disable rulesdir/pure-render */
function $5a387cc49350e6db$export$722debc0e56fea39(value, isEqual) {
// Using a ref during render is ok here because it's only an optimization – both values are equivalent.
// If a render is thrown away, it'll still work the same no matter if the next render is the same or not.
let lastValue = (0, $jtQ6z$useRef)(null);
if (value && lastValue.current && isEqual(value, lastValue.current)) value = lastValue.current;
lastValue.current = value;
return value;
}
export {$5a387cc49350e6db$export$722debc0e56fea39 as useDeepMemo};
//# sourceMappingURL=useDeepMemo.module.js.map
import {useRef as $jtQ6z$useRef} from "react";
/*
* Copyright 2023 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ /* eslint-disable rulesdir/pure-render */
function $5a387cc49350e6db$export$722debc0e56fea39(value, isEqual) {
// Using a ref during render is ok here because it's only an optimization – both values are equivalent.
// If a render is thrown away, it'll still work the same no matter if the next render is the same or not.
let lastValue = (0, $jtQ6z$useRef)(null);
if (value && lastValue.current && isEqual(value, lastValue.current)) value = lastValue.current;
lastValue.current = value;
return value;
}
export {$5a387cc49350e6db$export$722debc0e56fea39 as useDeepMemo};
//# sourceMappingURL=useDeepMemo.module.js.map
{"mappings":";;AAAA;;;;;;;;;;CAUC,GAED,uCAAuC;AAIhC,SAAS,0CAAe,KAAQ,EAAE,OAAgC;IACvE,uGAAuG;IACvG,yGAAyG;IACzG,IAAI,YAAY,CAAA,GAAA,aAAK,EAAY;IACjC,IAAI,SAAS,UAAU,OAAO,IAAI,QAAQ,OAAO,UAAU,OAAO,GAChE,QAAQ,UAAU,OAAO;IAG3B,UAAU,OAAO,GAAG;IACpB,OAAO;AACT","sources":["packages/@react-aria/utils/src/useDeepMemo.ts"],"sourcesContent":["/*\n * Copyright 2023 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/* eslint-disable rulesdir/pure-render */\n\nimport {useRef} from 'react';\n\nexport function useDeepMemo<T>(value: T, isEqual: (a: T, b: T) => boolean): T {\n // Using a ref during render is ok here because it's only an optimization – both values are equivalent.\n // If a render is thrown away, it'll still work the same no matter if the next render is the same or not.\n let lastValue = useRef<T | null>(null);\n if (value && lastValue.current && isEqual(value, lastValue.current)) {\n value = lastValue.current;\n }\n\n lastValue.current = value;\n return value;\n}\n"],"names":[],"version":3,"file":"useDeepMemo.module.js.map"}
var $78605a5d7424e31b$exports = require("./useLayoutEffect.main.js");
var $7PjpK$react = require("react");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useDescription", () => $34da4502ea8120db$export$f8aeda7b10753fa1);
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
let $34da4502ea8120db$var$descriptionId = 0;
const $34da4502ea8120db$var$descriptionNodes = new Map();
function $34da4502ea8120db$export$f8aeda7b10753fa1(description) {
let [id, setId] = (0, $7PjpK$react.useState)();
(0, $78605a5d7424e31b$exports.useLayoutEffect)(()=>{
if (!description) return;
let desc = $34da4502ea8120db$var$descriptionNodes.get(description);
if (!desc) {
let id = `react-aria-description-${$34da4502ea8120db$var$descriptionId++}`;
setId(id);
let node = document.createElement('div');
node.id = id;
node.style.display = 'none';
node.textContent = description;
document.body.appendChild(node);
desc = {
refCount: 0,
element: node
};
$34da4502ea8120db$var$descriptionNodes.set(description, desc);
} else setId(desc.element.id);
desc.refCount++;
return ()=>{
if (desc && --desc.refCount === 0) {
desc.element.remove();
$34da4502ea8120db$var$descriptionNodes.delete(description);
}
};
}, [
description
]);
return {
'aria-describedby': description ? id : undefined
};
}
//# sourceMappingURL=useDescription.main.js.map
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAMD,IAAI,sCAAgB;AACpB,MAAM,yCAAmB,IAAI;AAEtB,SAAS,0CAAe,WAAoB;IACjD,IAAI,CAAC,IAAI,MAAM,GAAG,CAAA,GAAA,qBAAO;IAEzB,CAAA,GAAA,yCAAc,EAAE;QACd,IAAI,CAAC,aACH;QAGF,IAAI,OAAO,uCAAiB,GAAG,CAAC;QAChC,IAAI,CAAC,MAAM;YACT,IAAI,KAAK,CAAC,uBAAuB,EAAE,uCAAiB;YACpD,MAAM;YAEN,IAAI,OAAO,SAAS,aAAa,CAAC;YAClC,KAAK,EAAE,GAAG;YACV,KAAK,KAAK,CAAC,OAAO,GAAG;YACrB,KAAK,WAAW,GAAG;YACnB,SAAS,IAAI,CAAC,WAAW,CAAC;YAC1B,OAAO;gBAAC,UAAU;gBAAG,SAAS;YAAI;YAClC,uCAAiB,GAAG,CAAC,aAAa;QACpC,OACE,MAAM,KAAK,OAAO,CAAC,EAAE;QAGvB,KAAK,QAAQ;QACb,OAAO;YACL,IAAI,QAAQ,EAAE,KAAK,QAAQ,KAAK,GAAG;gBACjC,KAAK,OAAO,CAAC,MAAM;gBACnB,uCAAiB,MAAM,CAAC;YAC1B;QACF;IACF,GAAG;QAAC;KAAY;IAEhB,OAAO;QACL,oBAAoB,cAAc,KAAK;IACzC;AACF","sources":["packages/@react-aria/utils/src/useDescription.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps} from '@react-types/shared';\nimport {useLayoutEffect} from './useLayoutEffect';\nimport {useState} from 'react';\n\nlet descriptionId = 0;\nconst descriptionNodes = new Map<string, {refCount: number, element: Element}>();\n\nexport function useDescription(description?: string): AriaLabelingProps {\n let [id, setId] = useState<string | undefined>();\n\n useLayoutEffect(() => {\n if (!description) {\n return;\n }\n\n let desc = descriptionNodes.get(description);\n if (!desc) {\n let id = `react-aria-description-${descriptionId++}`;\n setId(id);\n\n let node = document.createElement('div');\n node.id = id;\n node.style.display = 'none';\n node.textContent = description;\n document.body.appendChild(node);\n desc = {refCount: 0, element: node};\n descriptionNodes.set(description, desc);\n } else {\n setId(desc.element.id);\n }\n\n desc.refCount++;\n return () => {\n if (desc && --desc.refCount === 0) {\n desc.element.remove();\n descriptionNodes.delete(description);\n }\n };\n }, [description]);\n\n return {\n 'aria-describedby': description ? id : undefined\n };\n}\n"],"names":[],"version":3,"file":"useDescription.main.js.map"}
import {useLayoutEffect as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c} from "./useLayoutEffect.mjs";
import {useState as $hQ5Hp$useState} from "react";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
let $ef06256079686ba0$var$descriptionId = 0;
const $ef06256079686ba0$var$descriptionNodes = new Map();
function $ef06256079686ba0$export$f8aeda7b10753fa1(description) {
let [id, setId] = (0, $hQ5Hp$useState)();
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
if (!description) return;
let desc = $ef06256079686ba0$var$descriptionNodes.get(description);
if (!desc) {
let id = `react-aria-description-${$ef06256079686ba0$var$descriptionId++}`;
setId(id);
let node = document.createElement('div');
node.id = id;
node.style.display = 'none';
node.textContent = description;
document.body.appendChild(node);
desc = {
refCount: 0,
element: node
};
$ef06256079686ba0$var$descriptionNodes.set(description, desc);
} else setId(desc.element.id);
desc.refCount++;
return ()=>{
if (desc && --desc.refCount === 0) {
desc.element.remove();
$ef06256079686ba0$var$descriptionNodes.delete(description);
}
};
}, [
description
]);
return {
'aria-describedby': description ? id : undefined
};
}
export {$ef06256079686ba0$export$f8aeda7b10753fa1 as useDescription};
//# sourceMappingURL=useDescription.module.js.map
import {useLayoutEffect as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c} from "./useLayoutEffect.module.js";
import {useState as $hQ5Hp$useState} from "react";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
let $ef06256079686ba0$var$descriptionId = 0;
const $ef06256079686ba0$var$descriptionNodes = new Map();
function $ef06256079686ba0$export$f8aeda7b10753fa1(description) {
let [id, setId] = (0, $hQ5Hp$useState)();
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
if (!description) return;
let desc = $ef06256079686ba0$var$descriptionNodes.get(description);
if (!desc) {
let id = `react-aria-description-${$ef06256079686ba0$var$descriptionId++}`;
setId(id);
let node = document.createElement('div');
node.id = id;
node.style.display = 'none';
node.textContent = description;
document.body.appendChild(node);
desc = {
refCount: 0,
element: node
};
$ef06256079686ba0$var$descriptionNodes.set(description, desc);
} else setId(desc.element.id);
desc.refCount++;
return ()=>{
if (desc && --desc.refCount === 0) {
desc.element.remove();
$ef06256079686ba0$var$descriptionNodes.delete(description);
}
};
}, [
description
]);
return {
'aria-describedby': description ? id : undefined
};
}
export {$ef06256079686ba0$export$f8aeda7b10753fa1 as useDescription};
//# sourceMappingURL=useDescription.module.js.map
{"mappings":";;;AAAA;;;;;;;;;;CAUC;;AAMD,IAAI,sCAAgB;AACpB,MAAM,yCAAmB,IAAI;AAEtB,SAAS,0CAAe,WAAoB;IACjD,IAAI,CAAC,IAAI,MAAM,GAAG,CAAA,GAAA,eAAO;IAEzB,CAAA,GAAA,yCAAc,EAAE;QACd,IAAI,CAAC,aACH;QAGF,IAAI,OAAO,uCAAiB,GAAG,CAAC;QAChC,IAAI,CAAC,MAAM;YACT,IAAI,KAAK,CAAC,uBAAuB,EAAE,uCAAiB;YACpD,MAAM;YAEN,IAAI,OAAO,SAAS,aAAa,CAAC;YAClC,KAAK,EAAE,GAAG;YACV,KAAK,KAAK,CAAC,OAAO,GAAG;YACrB,KAAK,WAAW,GAAG;YACnB,SAAS,IAAI,CAAC,WAAW,CAAC;YAC1B,OAAO;gBAAC,UAAU;gBAAG,SAAS;YAAI;YAClC,uCAAiB,GAAG,CAAC,aAAa;QACpC,OACE,MAAM,KAAK,OAAO,CAAC,EAAE;QAGvB,KAAK,QAAQ;QACb,OAAO;YACL,IAAI,QAAQ,EAAE,KAAK,QAAQ,KAAK,GAAG;gBACjC,KAAK,OAAO,CAAC,MAAM;gBACnB,uCAAiB,MAAM,CAAC;YAC1B;QACF;IACF,GAAG;QAAC;KAAY;IAEhB,OAAO;QACL,oBAAoB,cAAc,KAAK;IACzC;AACF","sources":["packages/@react-aria/utils/src/useDescription.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps} from '@react-types/shared';\nimport {useLayoutEffect} from './useLayoutEffect';\nimport {useState} from 'react';\n\nlet descriptionId = 0;\nconst descriptionNodes = new Map<string, {refCount: number, element: Element}>();\n\nexport function useDescription(description?: string): AriaLabelingProps {\n let [id, setId] = useState<string | undefined>();\n\n useLayoutEffect(() => {\n if (!description) {\n return;\n }\n\n let desc = descriptionNodes.get(description);\n if (!desc) {\n let id = `react-aria-description-${descriptionId++}`;\n setId(id);\n\n let node = document.createElement('div');\n node.id = id;\n node.style.display = 'none';\n node.textContent = description;\n document.body.appendChild(node);\n desc = {refCount: 0, element: node};\n descriptionNodes.set(description, desc);\n } else {\n setId(desc.element.id);\n }\n\n desc.refCount++;\n return () => {\n if (desc && --desc.refCount === 0) {\n desc.element.remove();\n descriptionNodes.delete(description);\n }\n };\n }, [description]);\n\n return {\n 'aria-describedby': description ? id : undefined\n };\n}\n"],"names":[],"version":3,"file":"useDescription.module.js.map"}
var $16ec41ef3e36c19c$exports = require("./getOffset.main.js");
var $hK8r3$react = require("react");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useDrag1D", () => $28ed3fb20343b78b$export$7bbed75feba39706);
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ /* eslint-disable rulesdir/pure-render */
// Keep track of elements that we are currently handling dragging for via useDrag1D.
// If there's an ancestor and a descendant both using useDrag1D(), and the user starts
// dragging the descendant, we don't want useDrag1D events to fire for the ancestor.
const $28ed3fb20343b78b$var$draggingElements = [];
function $28ed3fb20343b78b$export$7bbed75feba39706(props) {
console.warn('useDrag1D is deprecated, please use `useMove` instead https://react-spectrum.adobe.com/react-aria/useMove.html');
let { containerRef: containerRef, reverse: reverse, orientation: orientation, onHover: onHover, onDrag: onDrag, onPositionChange: onPositionChange, onIncrement: onIncrement, onDecrement: onDecrement, onIncrementToMax: onIncrementToMax, onDecrementToMin: onDecrementToMin, onCollapseToggle: onCollapseToggle } = props;
let getPosition = (e)=>orientation === 'horizontal' ? e.clientX : e.clientY;
let getNextOffset = (e)=>{
let containerOffset = (0, $16ec41ef3e36c19c$exports.getOffset)(containerRef.current, reverse, orientation);
let mouseOffset = getPosition(e);
let nextOffset = reverse ? containerOffset - mouseOffset : mouseOffset - containerOffset;
return nextOffset;
};
let dragging = (0, $hK8r3$react.useRef)(false);
let prevPosition = (0, $hK8r3$react.useRef)(0);
// Keep track of the current handlers in a ref so that the events can access them.
let handlers = (0, $hK8r3$react.useRef)({
onPositionChange: onPositionChange,
onDrag: onDrag
});
handlers.current.onDrag = onDrag;
handlers.current.onPositionChange = onPositionChange;
let onMouseDragged = (e)=>{
e.preventDefault();
let nextOffset = getNextOffset(e);
if (!dragging.current) {
dragging.current = true;
if (handlers.current.onDrag) handlers.current.onDrag(true);
if (handlers.current.onPositionChange) handlers.current.onPositionChange(nextOffset);
}
if (prevPosition.current === nextOffset) return;
prevPosition.current = nextOffset;
if (onPositionChange) onPositionChange(nextOffset);
};
let onMouseUp = (e)=>{
const target = e.target;
dragging.current = false;
let nextOffset = getNextOffset(e);
if (handlers.current.onDrag) handlers.current.onDrag(false);
if (handlers.current.onPositionChange) handlers.current.onPositionChange(nextOffset);
$28ed3fb20343b78b$var$draggingElements.splice($28ed3fb20343b78b$var$draggingElements.indexOf(target), 1);
window.removeEventListener('mouseup', onMouseUp, false);
window.removeEventListener('mousemove', onMouseDragged, false);
};
let onMouseDown = (e)=>{
const target = e.currentTarget;
// If we're already handling dragging on a descendant with useDrag1D, then
// we don't want to handle the drag motion on this target as well.
if ($28ed3fb20343b78b$var$draggingElements.some((elt)=>target.contains(elt))) return;
$28ed3fb20343b78b$var$draggingElements.push(target);
window.addEventListener('mousemove', onMouseDragged, false);
window.addEventListener('mouseup', onMouseUp, false);
};
let onMouseEnter = ()=>{
if (onHover) onHover(true);
};
let onMouseOut = ()=>{
if (onHover) onHover(false);
};
let onKeyDown = (e)=>{
switch(e.key){
case 'Left':
case 'ArrowLeft':
if (orientation === 'horizontal') {
e.preventDefault();
if (onDecrement && !reverse) onDecrement();
else if (onIncrement && reverse) onIncrement();
}
break;
case 'Up':
case 'ArrowUp':
if (orientation === 'vertical') {
e.preventDefault();
if (onDecrement && !reverse) onDecrement();
else if (onIncrement && reverse) onIncrement();
}
break;
case 'Right':
case 'ArrowRight':
if (orientation === 'horizontal') {
e.preventDefault();
if (onIncrement && !reverse) onIncrement();
else if (onDecrement && reverse) onDecrement();
}
break;
case 'Down':
case 'ArrowDown':
if (orientation === 'vertical') {
e.preventDefault();
if (onIncrement && !reverse) onIncrement();
else if (onDecrement && reverse) onDecrement();
}
break;
case 'Home':
e.preventDefault();
if (onDecrementToMin) onDecrementToMin();
break;
case 'End':
e.preventDefault();
if (onIncrementToMax) onIncrementToMax();
break;
case 'Enter':
e.preventDefault();
if (onCollapseToggle) onCollapseToggle();
break;
}
};
return {
onMouseDown: onMouseDown,
onMouseEnter: onMouseEnter,
onMouseOut: onMouseOut,
onKeyDown: onKeyDown
};
}
//# sourceMappingURL=useDrag1D.main.js.map
{"mappings":"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","sources":["packages/@react-aria/utils/src/useDrag1D.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n /* eslint-disable rulesdir/pure-render */\n\nimport {getOffset} from './getOffset';\nimport {Orientation} from '@react-types/shared';\nimport React, {HTMLAttributes, MutableRefObject, useRef} from 'react';\n\ninterface UseDrag1DProps {\n containerRef: MutableRefObject<HTMLElement>,\n reverse?: boolean,\n orientation?: Orientation,\n onHover?: (hovered: boolean) => void,\n onDrag?: (dragging: boolean) => void,\n onPositionChange?: (position: number) => void,\n onIncrement?: () => void,\n onDecrement?: () => void,\n onIncrementToMax?: () => void,\n onDecrementToMin?: () => void,\n onCollapseToggle?: () => void\n}\n\n// Keep track of elements that we are currently handling dragging for via useDrag1D.\n// If there's an ancestor and a descendant both using useDrag1D(), and the user starts\n// dragging the descendant, we don't want useDrag1D events to fire for the ancestor.\nconst draggingElements: HTMLElement[] = [];\n\n// created for splitview, this should be reusable for things like sliders/dials\n// It also handles keyboard events on the target allowing for increment/decrement by a given stepsize as well as minifying/maximizing and toggling between minified and previous size\n// It can also take a 'reverse' param to say if we should measure from the right/bottom instead of the top/left\n// It can also handle either a vertical or horizontal movement, but not both at the same time\n\nexport function useDrag1D(props: UseDrag1DProps): HTMLAttributes<HTMLElement> {\n console.warn('useDrag1D is deprecated, please use `useMove` instead https://react-spectrum.adobe.com/react-aria/useMove.html');\n let {containerRef, reverse, orientation, onHover, onDrag, onPositionChange, onIncrement, onDecrement, onIncrementToMax, onDecrementToMin, onCollapseToggle} = props;\n let getPosition = (e) => orientation === 'horizontal' ? e.clientX : e.clientY;\n let getNextOffset = (e: MouseEvent) => {\n let containerOffset = getOffset(containerRef.current, reverse, orientation);\n let mouseOffset = getPosition(e);\n let nextOffset = reverse ? containerOffset - mouseOffset : mouseOffset - containerOffset;\n return nextOffset;\n };\n let dragging = useRef(false);\n let prevPosition = useRef(0);\n\n // Keep track of the current handlers in a ref so that the events can access them.\n let handlers = useRef({onPositionChange, onDrag});\n handlers.current.onDrag = onDrag;\n handlers.current.onPositionChange = onPositionChange;\n\n let onMouseDragged = (e: MouseEvent) => {\n e.preventDefault();\n let nextOffset = getNextOffset(e);\n if (!dragging.current) {\n dragging.current = true;\n if (handlers.current.onDrag) {\n handlers.current.onDrag(true);\n }\n if (handlers.current.onPositionChange) {\n handlers.current.onPositionChange(nextOffset);\n }\n }\n if (prevPosition.current === nextOffset) {\n return;\n }\n prevPosition.current = nextOffset;\n if (onPositionChange) {\n onPositionChange(nextOffset);\n }\n };\n\n let onMouseUp = (e: MouseEvent) => {\n const target = e.target as HTMLElement;\n dragging.current = false;\n let nextOffset = getNextOffset(e);\n if (handlers.current.onDrag) {\n handlers.current.onDrag(false);\n }\n if (handlers.current.onPositionChange) {\n handlers.current.onPositionChange(nextOffset);\n }\n\n draggingElements.splice(draggingElements.indexOf(target), 1);\n window.removeEventListener('mouseup', onMouseUp, false);\n window.removeEventListener('mousemove', onMouseDragged, false);\n };\n\n let onMouseDown = (e: React.MouseEvent<HTMLElement>) => {\n const target = e.currentTarget;\n // If we're already handling dragging on a descendant with useDrag1D, then\n // we don't want to handle the drag motion on this target as well.\n if (draggingElements.some(elt => target.contains(elt))) {\n return;\n }\n draggingElements.push(target);\n window.addEventListener('mousemove', onMouseDragged, false);\n window.addEventListener('mouseup', onMouseUp, false);\n };\n\n let onMouseEnter = () => {\n if (onHover) {\n onHover(true);\n }\n };\n\n let onMouseOut = () => {\n if (onHover) {\n onHover(false);\n }\n };\n\n let onKeyDown = (e) => {\n switch (e.key) {\n case 'Left':\n case 'ArrowLeft':\n if (orientation === 'horizontal') {\n e.preventDefault();\n if (onDecrement && !reverse) {\n onDecrement();\n } else if (onIncrement && reverse) {\n onIncrement();\n }\n }\n break;\n case 'Up':\n case 'ArrowUp':\n if (orientation === 'vertical') {\n e.preventDefault();\n if (onDecrement && !reverse) {\n onDecrement();\n } else if (onIncrement && reverse) {\n onIncrement();\n }\n }\n break;\n case 'Right':\n case 'ArrowRight':\n if (orientation === 'horizontal') {\n e.preventDefault();\n if (onIncrement && !reverse) {\n onIncrement();\n } else if (onDecrement && reverse) {\n onDecrement();\n }\n }\n break;\n case 'Down':\n case 'ArrowDown':\n if (orientation === 'vertical') {\n e.preventDefault();\n if (onIncrement && !reverse) {\n onIncrement();\n } else if (onDecrement && reverse) {\n onDecrement();\n }\n }\n break;\n case 'Home':\n e.preventDefault();\n if (onDecrementToMin) {\n onDecrementToMin();\n }\n break;\n case 'End':\n e.preventDefault();\n if (onIncrementToMax) {\n onIncrementToMax();\n }\n break;\n case 'Enter':\n e.preventDefault();\n if (onCollapseToggle) {\n onCollapseToggle();\n }\n break;\n }\n };\n\n return {onMouseDown, onMouseEnter, onMouseOut, onKeyDown};\n}\n"],"names":[],"version":3,"file":"useDrag1D.main.js.map"}
import {getOffset as $ab71dadb03a6fb2e$export$622cea445a1c5b7d} from "./getOffset.mjs";
import {useRef as $1rnCS$useRef} from "react";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ /* eslint-disable rulesdir/pure-render */
// Keep track of elements that we are currently handling dragging for via useDrag1D.
// If there's an ancestor and a descendant both using useDrag1D(), and the user starts
// dragging the descendant, we don't want useDrag1D events to fire for the ancestor.
const $9cc09df9fd7676be$var$draggingElements = [];
function $9cc09df9fd7676be$export$7bbed75feba39706(props) {
console.warn('useDrag1D is deprecated, please use `useMove` instead https://react-spectrum.adobe.com/react-aria/useMove.html');
let { containerRef: containerRef, reverse: reverse, orientation: orientation, onHover: onHover, onDrag: onDrag, onPositionChange: onPositionChange, onIncrement: onIncrement, onDecrement: onDecrement, onIncrementToMax: onIncrementToMax, onDecrementToMin: onDecrementToMin, onCollapseToggle: onCollapseToggle } = props;
let getPosition = (e)=>orientation === 'horizontal' ? e.clientX : e.clientY;
let getNextOffset = (e)=>{
let containerOffset = (0, $ab71dadb03a6fb2e$export$622cea445a1c5b7d)(containerRef.current, reverse, orientation);
let mouseOffset = getPosition(e);
let nextOffset = reverse ? containerOffset - mouseOffset : mouseOffset - containerOffset;
return nextOffset;
};
let dragging = (0, $1rnCS$useRef)(false);
let prevPosition = (0, $1rnCS$useRef)(0);
// Keep track of the current handlers in a ref so that the events can access them.
let handlers = (0, $1rnCS$useRef)({
onPositionChange: onPositionChange,
onDrag: onDrag
});
handlers.current.onDrag = onDrag;
handlers.current.onPositionChange = onPositionChange;
let onMouseDragged = (e)=>{
e.preventDefault();
let nextOffset = getNextOffset(e);
if (!dragging.current) {
dragging.current = true;
if (handlers.current.onDrag) handlers.current.onDrag(true);
if (handlers.current.onPositionChange) handlers.current.onPositionChange(nextOffset);
}
if (prevPosition.current === nextOffset) return;
prevPosition.current = nextOffset;
if (onPositionChange) onPositionChange(nextOffset);
};
let onMouseUp = (e)=>{
const target = e.target;
dragging.current = false;
let nextOffset = getNextOffset(e);
if (handlers.current.onDrag) handlers.current.onDrag(false);
if (handlers.current.onPositionChange) handlers.current.onPositionChange(nextOffset);
$9cc09df9fd7676be$var$draggingElements.splice($9cc09df9fd7676be$var$draggingElements.indexOf(target), 1);
window.removeEventListener('mouseup', onMouseUp, false);
window.removeEventListener('mousemove', onMouseDragged, false);
};
let onMouseDown = (e)=>{
const target = e.currentTarget;
// If we're already handling dragging on a descendant with useDrag1D, then
// we don't want to handle the drag motion on this target as well.
if ($9cc09df9fd7676be$var$draggingElements.some((elt)=>target.contains(elt))) return;
$9cc09df9fd7676be$var$draggingElements.push(target);
window.addEventListener('mousemove', onMouseDragged, false);
window.addEventListener('mouseup', onMouseUp, false);
};
let onMouseEnter = ()=>{
if (onHover) onHover(true);
};
let onMouseOut = ()=>{
if (onHover) onHover(false);
};
let onKeyDown = (e)=>{
switch(e.key){
case 'Left':
case 'ArrowLeft':
if (orientation === 'horizontal') {
e.preventDefault();
if (onDecrement && !reverse) onDecrement();
else if (onIncrement && reverse) onIncrement();
}
break;
case 'Up':
case 'ArrowUp':
if (orientation === 'vertical') {
e.preventDefault();
if (onDecrement && !reverse) onDecrement();
else if (onIncrement && reverse) onIncrement();
}
break;
case 'Right':
case 'ArrowRight':
if (orientation === 'horizontal') {
e.preventDefault();
if (onIncrement && !reverse) onIncrement();
else if (onDecrement && reverse) onDecrement();
}
break;
case 'Down':
case 'ArrowDown':
if (orientation === 'vertical') {
e.preventDefault();
if (onIncrement && !reverse) onIncrement();
else if (onDecrement && reverse) onDecrement();
}
break;
case 'Home':
e.preventDefault();
if (onDecrementToMin) onDecrementToMin();
break;
case 'End':
e.preventDefault();
if (onIncrementToMax) onIncrementToMax();
break;
case 'Enter':
e.preventDefault();
if (onCollapseToggle) onCollapseToggle();
break;
}
};
return {
onMouseDown: onMouseDown,
onMouseEnter: onMouseEnter,
onMouseOut: onMouseOut,
onKeyDown: onKeyDown
};
}
export {$9cc09df9fd7676be$export$7bbed75feba39706 as useDrag1D};
//# sourceMappingURL=useDrag1D.module.js.map
import {getOffset as $ab71dadb03a6fb2e$export$622cea445a1c5b7d} from "./getOffset.module.js";
import {useRef as $1rnCS$useRef} from "react";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/ /* eslint-disable rulesdir/pure-render */
// Keep track of elements that we are currently handling dragging for via useDrag1D.
// If there's an ancestor and a descendant both using useDrag1D(), and the user starts
// dragging the descendant, we don't want useDrag1D events to fire for the ancestor.
const $9cc09df9fd7676be$var$draggingElements = [];
function $9cc09df9fd7676be$export$7bbed75feba39706(props) {
console.warn('useDrag1D is deprecated, please use `useMove` instead https://react-spectrum.adobe.com/react-aria/useMove.html');
let { containerRef: containerRef, reverse: reverse, orientation: orientation, onHover: onHover, onDrag: onDrag, onPositionChange: onPositionChange, onIncrement: onIncrement, onDecrement: onDecrement, onIncrementToMax: onIncrementToMax, onDecrementToMin: onDecrementToMin, onCollapseToggle: onCollapseToggle } = props;
let getPosition = (e)=>orientation === 'horizontal' ? e.clientX : e.clientY;
let getNextOffset = (e)=>{
let containerOffset = (0, $ab71dadb03a6fb2e$export$622cea445a1c5b7d)(containerRef.current, reverse, orientation);
let mouseOffset = getPosition(e);
let nextOffset = reverse ? containerOffset - mouseOffset : mouseOffset - containerOffset;
return nextOffset;
};
let dragging = (0, $1rnCS$useRef)(false);
let prevPosition = (0, $1rnCS$useRef)(0);
// Keep track of the current handlers in a ref so that the events can access them.
let handlers = (0, $1rnCS$useRef)({
onPositionChange: onPositionChange,
onDrag: onDrag
});
handlers.current.onDrag = onDrag;
handlers.current.onPositionChange = onPositionChange;
let onMouseDragged = (e)=>{
e.preventDefault();
let nextOffset = getNextOffset(e);
if (!dragging.current) {
dragging.current = true;
if (handlers.current.onDrag) handlers.current.onDrag(true);
if (handlers.current.onPositionChange) handlers.current.onPositionChange(nextOffset);
}
if (prevPosition.current === nextOffset) return;
prevPosition.current = nextOffset;
if (onPositionChange) onPositionChange(nextOffset);
};
let onMouseUp = (e)=>{
const target = e.target;
dragging.current = false;
let nextOffset = getNextOffset(e);
if (handlers.current.onDrag) handlers.current.onDrag(false);
if (handlers.current.onPositionChange) handlers.current.onPositionChange(nextOffset);
$9cc09df9fd7676be$var$draggingElements.splice($9cc09df9fd7676be$var$draggingElements.indexOf(target), 1);
window.removeEventListener('mouseup', onMouseUp, false);
window.removeEventListener('mousemove', onMouseDragged, false);
};
let onMouseDown = (e)=>{
const target = e.currentTarget;
// If we're already handling dragging on a descendant with useDrag1D, then
// we don't want to handle the drag motion on this target as well.
if ($9cc09df9fd7676be$var$draggingElements.some((elt)=>target.contains(elt))) return;
$9cc09df9fd7676be$var$draggingElements.push(target);
window.addEventListener('mousemove', onMouseDragged, false);
window.addEventListener('mouseup', onMouseUp, false);
};
let onMouseEnter = ()=>{
if (onHover) onHover(true);
};
let onMouseOut = ()=>{
if (onHover) onHover(false);
};
let onKeyDown = (e)=>{
switch(e.key){
case 'Left':
case 'ArrowLeft':
if (orientation === 'horizontal') {
e.preventDefault();
if (onDecrement && !reverse) onDecrement();
else if (onIncrement && reverse) onIncrement();
}
break;
case 'Up':
case 'ArrowUp':
if (orientation === 'vertical') {
e.preventDefault();
if (onDecrement && !reverse) onDecrement();
else if (onIncrement && reverse) onIncrement();
}
break;
case 'Right':
case 'ArrowRight':
if (orientation === 'horizontal') {
e.preventDefault();
if (onIncrement && !reverse) onIncrement();
else if (onDecrement && reverse) onDecrement();
}
break;
case 'Down':
case 'ArrowDown':
if (orientation === 'vertical') {
e.preventDefault();
if (onIncrement && !reverse) onIncrement();
else if (onDecrement && reverse) onDecrement();
}
break;
case 'Home':
e.preventDefault();
if (onDecrementToMin) onDecrementToMin();
break;
case 'End':
e.preventDefault();
if (onIncrementToMax) onIncrementToMax();
break;
case 'Enter':
e.preventDefault();
if (onCollapseToggle) onCollapseToggle();
break;
}
};
return {
onMouseDown: onMouseDown,
onMouseEnter: onMouseEnter,
onMouseOut: onMouseOut,
onKeyDown: onKeyDown
};
}
export {$9cc09df9fd7676be$export$7bbed75feba39706 as useDrag1D};
//# sourceMappingURL=useDrag1D.module.js.map
{"mappings":"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","sources":["packages/@react-aria/utils/src/useDrag1D.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n /* eslint-disable rulesdir/pure-render */\n\nimport {getOffset} from './getOffset';\nimport {Orientation} from '@react-types/shared';\nimport React, {HTMLAttributes, MutableRefObject, useRef} from 'react';\n\ninterface UseDrag1DProps {\n containerRef: MutableRefObject<HTMLElement>,\n reverse?: boolean,\n orientation?: Orientation,\n onHover?: (hovered: boolean) => void,\n onDrag?: (dragging: boolean) => void,\n onPositionChange?: (position: number) => void,\n onIncrement?: () => void,\n onDecrement?: () => void,\n onIncrementToMax?: () => void,\n onDecrementToMin?: () => void,\n onCollapseToggle?: () => void\n}\n\n// Keep track of elements that we are currently handling dragging for via useDrag1D.\n// If there's an ancestor and a descendant both using useDrag1D(), and the user starts\n// dragging the descendant, we don't want useDrag1D events to fire for the ancestor.\nconst draggingElements: HTMLElement[] = [];\n\n// created for splitview, this should be reusable for things like sliders/dials\n// It also handles keyboard events on the target allowing for increment/decrement by a given stepsize as well as minifying/maximizing and toggling between minified and previous size\n// It can also take a 'reverse' param to say if we should measure from the right/bottom instead of the top/left\n// It can also handle either a vertical or horizontal movement, but not both at the same time\n\nexport function useDrag1D(props: UseDrag1DProps): HTMLAttributes<HTMLElement> {\n console.warn('useDrag1D is deprecated, please use `useMove` instead https://react-spectrum.adobe.com/react-aria/useMove.html');\n let {containerRef, reverse, orientation, onHover, onDrag, onPositionChange, onIncrement, onDecrement, onIncrementToMax, onDecrementToMin, onCollapseToggle} = props;\n let getPosition = (e) => orientation === 'horizontal' ? e.clientX : e.clientY;\n let getNextOffset = (e: MouseEvent) => {\n let containerOffset = getOffset(containerRef.current, reverse, orientation);\n let mouseOffset = getPosition(e);\n let nextOffset = reverse ? containerOffset - mouseOffset : mouseOffset - containerOffset;\n return nextOffset;\n };\n let dragging = useRef(false);\n let prevPosition = useRef(0);\n\n // Keep track of the current handlers in a ref so that the events can access them.\n let handlers = useRef({onPositionChange, onDrag});\n handlers.current.onDrag = onDrag;\n handlers.current.onPositionChange = onPositionChange;\n\n let onMouseDragged = (e: MouseEvent) => {\n e.preventDefault();\n let nextOffset = getNextOffset(e);\n if (!dragging.current) {\n dragging.current = true;\n if (handlers.current.onDrag) {\n handlers.current.onDrag(true);\n }\n if (handlers.current.onPositionChange) {\n handlers.current.onPositionChange(nextOffset);\n }\n }\n if (prevPosition.current === nextOffset) {\n return;\n }\n prevPosition.current = nextOffset;\n if (onPositionChange) {\n onPositionChange(nextOffset);\n }\n };\n\n let onMouseUp = (e: MouseEvent) => {\n const target = e.target as HTMLElement;\n dragging.current = false;\n let nextOffset = getNextOffset(e);\n if (handlers.current.onDrag) {\n handlers.current.onDrag(false);\n }\n if (handlers.current.onPositionChange) {\n handlers.current.onPositionChange(nextOffset);\n }\n\n draggingElements.splice(draggingElements.indexOf(target), 1);\n window.removeEventListener('mouseup', onMouseUp, false);\n window.removeEventListener('mousemove', onMouseDragged, false);\n };\n\n let onMouseDown = (e: React.MouseEvent<HTMLElement>) => {\n const target = e.currentTarget;\n // If we're already handling dragging on a descendant with useDrag1D, then\n // we don't want to handle the drag motion on this target as well.\n if (draggingElements.some(elt => target.contains(elt))) {\n return;\n }\n draggingElements.push(target);\n window.addEventListener('mousemove', onMouseDragged, false);\n window.addEventListener('mouseup', onMouseUp, false);\n };\n\n let onMouseEnter = () => {\n if (onHover) {\n onHover(true);\n }\n };\n\n let onMouseOut = () => {\n if (onHover) {\n onHover(false);\n }\n };\n\n let onKeyDown = (e) => {\n switch (e.key) {\n case 'Left':\n case 'ArrowLeft':\n if (orientation === 'horizontal') {\n e.preventDefault();\n if (onDecrement && !reverse) {\n onDecrement();\n } else if (onIncrement && reverse) {\n onIncrement();\n }\n }\n break;\n case 'Up':\n case 'ArrowUp':\n if (orientation === 'vertical') {\n e.preventDefault();\n if (onDecrement && !reverse) {\n onDecrement();\n } else if (onIncrement && reverse) {\n onIncrement();\n }\n }\n break;\n case 'Right':\n case 'ArrowRight':\n if (orientation === 'horizontal') {\n e.preventDefault();\n if (onIncrement && !reverse) {\n onIncrement();\n } else if (onDecrement && reverse) {\n onDecrement();\n }\n }\n break;\n case 'Down':\n case 'ArrowDown':\n if (orientation === 'vertical') {\n e.preventDefault();\n if (onIncrement && !reverse) {\n onIncrement();\n } else if (onDecrement && reverse) {\n onDecrement();\n }\n }\n break;\n case 'Home':\n e.preventDefault();\n if (onDecrementToMin) {\n onDecrementToMin();\n }\n break;\n case 'End':\n e.preventDefault();\n if (onIncrementToMax) {\n onIncrementToMax();\n }\n break;\n case 'Enter':\n e.preventDefault();\n if (onCollapseToggle) {\n onCollapseToggle();\n }\n break;\n }\n };\n\n return {onMouseDown, onMouseEnter, onMouseOut, onKeyDown};\n}\n"],"names":[],"version":3,"file":"useDrag1D.module.js.map"}
var $78605a5d7424e31b$exports = require("./useLayoutEffect.main.js");
var $gErir$react = require("react");
function $parcel$interopDefault(a) {
return a && a.__esModule ? a.default : a;
}
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useEffectEvent", () => $1254e5bb94ac8761$export$7f54fc3180508a52);
/*
* Copyright 2023 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
var $1254e5bb94ac8761$var$_React_useInsertionEffect;
// Use the earliest effect type possible. useInsertionEffect runs during the mutation phase,
// before all layout effects, but is available only in React 18 and later.
const $1254e5bb94ac8761$var$useEarlyEffect = ($1254e5bb94ac8761$var$_React_useInsertionEffect = (0, ($parcel$interopDefault($gErir$react)))['useInsertionEffect']) !== null && $1254e5bb94ac8761$var$_React_useInsertionEffect !== void 0 ? $1254e5bb94ac8761$var$_React_useInsertionEffect : (0, $78605a5d7424e31b$exports.useLayoutEffect);
var $1254e5bb94ac8761$var$_React_useEffectEvent;
// Starting with React 19.2, this hook has been internalized.
const $1254e5bb94ac8761$var$useModernEffectEvent = ($1254e5bb94ac8761$var$_React_useEffectEvent = (0, ($parcel$interopDefault($gErir$react)))['useEffectEvent']) !== null && $1254e5bb94ac8761$var$_React_useEffectEvent !== void 0 ? $1254e5bb94ac8761$var$_React_useEffectEvent : $1254e5bb94ac8761$var$useLegacyEffectEvent;
function $1254e5bb94ac8761$var$useLegacyEffectEvent(fn) {
const ref = (0, $gErir$react.useRef)(null);
$1254e5bb94ac8761$var$useEarlyEffect(()=>{
ref.current = fn;
}, [
fn
]);
// @ts-ignore
return (0, $gErir$react.useCallback)((...args)=>{
const f = ref.current;
return f === null || f === void 0 ? void 0 : f(...args);
}, []);
}
function $1254e5bb94ac8761$export$7f54fc3180508a52(fn) {
return $1254e5bb94ac8761$var$useModernEffectEvent(fn);
}
//# sourceMappingURL=useEffectEvent.main.js.map
{"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;IAOsB;AAFvB,4FAA4F;AAC5F,0EAA0E;AAC1E,MAAM,uCAAiB,CAAA,kDAAA,CAAA,GAAA,sCAAI,CAAC,CAAC,qBAAqB,cAA3B,6DAAA,kDAA+B,CAAA,GAAA,yCAAc;IAGvC;AAD7B,6DAA6D;AAC7D,MAAM,6CAAuB,CAAA,8CAAA,CAAA,GAAA,sCAAI,CAAC,CAAC,iBAAiB,cAAvB,yDAAA,8CAA2B;AAExD,SAAS,2CAAyC,EAAM;IACtD,MAAM,MAAM,CAAA,GAAA,mBAAK,EAAwB;IACzC,qCAAe;QACb,IAAI,OAAO,GAAG;IAChB,GAAG;QAAC;KAAG;IACP,aAAa;IACb,OAAO,CAAA,GAAA,wBAAU,EAAK,CAAC,GAAG;QACxB,MAAM,IAAI,IAAI,OAAO;QACrB,OAAO,cAAA,wBAAA,KAAO;IAChB,GAAG,EAAE;AACP;AAEO,SAAS,0CAAmC,EAAK;IACtD,OAAO,2CAAqB;AAC9B","sources":["packages/@react-aria/utils/src/useEffectEvent.ts"],"sourcesContent":["/*\n * Copyright 2023 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport React, {useCallback, useRef} from 'react';\nimport {useLayoutEffect} from './useLayoutEffect';\n\n// Use the earliest effect type possible. useInsertionEffect runs during the mutation phase,\n// before all layout effects, but is available only in React 18 and later.\nconst useEarlyEffect = React['useInsertionEffect'] ?? useLayoutEffect;\n\n// Starting with React 19.2, this hook has been internalized.\nconst useModernEffectEvent = React['useEffectEvent'] ?? useLegacyEffectEvent;\n\nfunction useLegacyEffectEvent<T extends Function>(fn?: T): T {\n const ref = useRef<T | null | undefined>(null);\n useEarlyEffect(() => {\n ref.current = fn;\n }, [fn]);\n // @ts-ignore\n return useCallback<T>((...args) => {\n const f = ref.current!;\n return f?.(...args);\n }, []);\n}\n\nexport function useEffectEvent<T extends Function>(fn: T): T {\n return useModernEffectEvent(fn);\n}\n"],"names":[],"version":3,"file":"useEffectEvent.main.js.map"}
import {useLayoutEffect as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c} from "./useLayoutEffect.mjs";
import $lmaYr$react, {useRef as $lmaYr$useRef, useCallback as $lmaYr$useCallback} from "react";
/*
* Copyright 2023 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
var $8ae05eaa5c114e9c$var$_React_useInsertionEffect;
// Use the earliest effect type possible. useInsertionEffect runs during the mutation phase,
// before all layout effects, but is available only in React 18 and later.
const $8ae05eaa5c114e9c$var$useEarlyEffect = ($8ae05eaa5c114e9c$var$_React_useInsertionEffect = (0, $lmaYr$react)['useInsertionEffect']) !== null && $8ae05eaa5c114e9c$var$_React_useInsertionEffect !== void 0 ? $8ae05eaa5c114e9c$var$_React_useInsertionEffect : (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c);
var $8ae05eaa5c114e9c$var$_React_useEffectEvent;
// Starting with React 19.2, this hook has been internalized.
const $8ae05eaa5c114e9c$var$useModernEffectEvent = ($8ae05eaa5c114e9c$var$_React_useEffectEvent = (0, $lmaYr$react)['useEffectEvent']) !== null && $8ae05eaa5c114e9c$var$_React_useEffectEvent !== void 0 ? $8ae05eaa5c114e9c$var$_React_useEffectEvent : $8ae05eaa5c114e9c$var$useLegacyEffectEvent;
function $8ae05eaa5c114e9c$var$useLegacyEffectEvent(fn) {
const ref = (0, $lmaYr$useRef)(null);
$8ae05eaa5c114e9c$var$useEarlyEffect(()=>{
ref.current = fn;
}, [
fn
]);
// @ts-ignore
return (0, $lmaYr$useCallback)((...args)=>{
const f = ref.current;
return f === null || f === void 0 ? void 0 : f(...args);
}, []);
}
function $8ae05eaa5c114e9c$export$7f54fc3180508a52(fn) {
return $8ae05eaa5c114e9c$var$useModernEffectEvent(fn);
}
export {$8ae05eaa5c114e9c$export$7f54fc3180508a52 as useEffectEvent};
//# sourceMappingURL=useEffectEvent.module.js.map
import {useLayoutEffect as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c} from "./useLayoutEffect.module.js";
import $lmaYr$react, {useRef as $lmaYr$useRef, useCallback as $lmaYr$useCallback} from "react";
/*
* Copyright 2023 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
var $8ae05eaa5c114e9c$var$_React_useInsertionEffect;
// Use the earliest effect type possible. useInsertionEffect runs during the mutation phase,
// before all layout effects, but is available only in React 18 and later.
const $8ae05eaa5c114e9c$var$useEarlyEffect = ($8ae05eaa5c114e9c$var$_React_useInsertionEffect = (0, $lmaYr$react)['useInsertionEffect']) !== null && $8ae05eaa5c114e9c$var$_React_useInsertionEffect !== void 0 ? $8ae05eaa5c114e9c$var$_React_useInsertionEffect : (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c);
var $8ae05eaa5c114e9c$var$_React_useEffectEvent;
// Starting with React 19.2, this hook has been internalized.
const $8ae05eaa5c114e9c$var$useModernEffectEvent = ($8ae05eaa5c114e9c$var$_React_useEffectEvent = (0, $lmaYr$react)['useEffectEvent']) !== null && $8ae05eaa5c114e9c$var$_React_useEffectEvent !== void 0 ? $8ae05eaa5c114e9c$var$_React_useEffectEvent : $8ae05eaa5c114e9c$var$useLegacyEffectEvent;
function $8ae05eaa5c114e9c$var$useLegacyEffectEvent(fn) {
const ref = (0, $lmaYr$useRef)(null);
$8ae05eaa5c114e9c$var$useEarlyEffect(()=>{
ref.current = fn;
}, [
fn
]);
// @ts-ignore
return (0, $lmaYr$useCallback)((...args)=>{
const f = ref.current;
return f === null || f === void 0 ? void 0 : f(...args);
}, []);
}
function $8ae05eaa5c114e9c$export$7f54fc3180508a52(fn) {
return $8ae05eaa5c114e9c$var$useModernEffectEvent(fn);
}
export {$8ae05eaa5c114e9c$export$7f54fc3180508a52 as useEffectEvent};
//# sourceMappingURL=useEffectEvent.module.js.map
{"mappings":";;;AAAA;;;;;;;;;;CAUC;;IAOsB;AAFvB,4FAA4F;AAC5F,0EAA0E;AAC1E,MAAM,uCAAiB,CAAA,kDAAA,CAAA,GAAA,YAAI,CAAC,CAAC,qBAAqB,cAA3B,6DAAA,kDAA+B,CAAA,GAAA,yCAAc;IAGvC;AAD7B,6DAA6D;AAC7D,MAAM,6CAAuB,CAAA,8CAAA,CAAA,GAAA,YAAI,CAAC,CAAC,iBAAiB,cAAvB,yDAAA,8CAA2B;AAExD,SAAS,2CAAyC,EAAM;IACtD,MAAM,MAAM,CAAA,GAAA,aAAK,EAAwB;IACzC,qCAAe;QACb,IAAI,OAAO,GAAG;IAChB,GAAG;QAAC;KAAG;IACP,aAAa;IACb,OAAO,CAAA,GAAA,kBAAU,EAAK,CAAC,GAAG;QACxB,MAAM,IAAI,IAAI,OAAO;QACrB,OAAO,cAAA,wBAAA,KAAO;IAChB,GAAG,EAAE;AACP;AAEO,SAAS,0CAAmC,EAAK;IACtD,OAAO,2CAAqB;AAC9B","sources":["packages/@react-aria/utils/src/useEffectEvent.ts"],"sourcesContent":["/*\n * Copyright 2023 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport React, {useCallback, useRef} from 'react';\nimport {useLayoutEffect} from './useLayoutEffect';\n\n// Use the earliest effect type possible. useInsertionEffect runs during the mutation phase,\n// before all layout effects, but is available only in React 18 and later.\nconst useEarlyEffect = React['useInsertionEffect'] ?? useLayoutEffect;\n\n// Starting with React 19.2, this hook has been internalized.\nconst useModernEffectEvent = React['useEffectEvent'] ?? useLegacyEffectEvent;\n\nfunction useLegacyEffectEvent<T extends Function>(fn?: T): T {\n const ref = useRef<T | null | undefined>(null);\n useEarlyEffect(() => {\n ref.current = fn;\n }, [fn]);\n // @ts-ignore\n return useCallback<T>((...args) => {\n const f = ref.current!;\n return f?.(...args);\n }, []);\n}\n\nexport function useEffectEvent<T extends Function>(fn: T): T {\n return useModernEffectEvent(fn);\n}\n"],"names":[],"version":3,"file":"useEffectEvent.module.js.map"}
var $1254e5bb94ac8761$exports = require("./useEffectEvent.main.js");
var $8UjJN$react = require("react");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useEvent", () => $2a8c0bb1629926c8$export$90fc3a17d93f704c);
/*
* Copyright 2021 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $2a8c0bb1629926c8$export$90fc3a17d93f704c(ref, event, handler, options) {
let noop = (0, $8UjJN$react.useCallback)(()=>{}, []);
let handleEvent = (0, $1254e5bb94ac8761$exports.useEffectEvent)(handler !== null && handler !== void 0 ? handler : noop);
let isDisabled = handler == null;
(0, $8UjJN$react.useEffect)(()=>{
if (isDisabled || !ref.current) return;
let element = ref.current;
element.addEventListener(event, handleEvent, options);
return ()=>{
element.removeEventListener(event, handleEvent, options);
};
}, [
ref,
event,
options,
isDisabled
]);
}
//# sourceMappingURL=useEvent.main.js.map
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAMM,SAAS,0CACd,GAAkC,EAClC,KAAwB,EACxB,OAAqE,EACrE,OAA2C;IAE3C,IAAI,OAAO,CAAA,GAAA,wBAAU,EAAE,KAAO,GAAG,EAAE;IACnC,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE,oBAAA,qBAAA,UAAW;IAC5C,IAAI,aAAa,WAAW;IAE5B,CAAA,GAAA,sBAAQ,EAAE;QACR,IAAI,cAAc,CAAC,IAAI,OAAO,EAC5B;QAGF,IAAI,UAAU,IAAI,OAAO;QACzB,QAAQ,gBAAgB,CAAC,OAAO,aAA8B;QAC9D,OAAO;YACL,QAAQ,mBAAmB,CAAC,OAAO,aAA8B;QACnE;IACF,GAAG;QAAC;QAAK;QAAO;QAAS;KAAW;AACtC","sources":["packages/@react-aria/utils/src/useEvent.ts"],"sourcesContent":["/*\n * Copyright 2021 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {RefObject} from '@react-types/shared';\nimport {useCallback, useEffect} from 'react';\nimport {useEffectEvent} from './useEffectEvent';\n\nexport function useEvent<K extends keyof GlobalEventHandlersEventMap>(\n ref: RefObject<EventTarget | null>,\n event: K | (string & {}),\n handler?: (this: Document, ev: GlobalEventHandlersEventMap[K]) => any,\n options?: boolean | AddEventListenerOptions\n): void {\n let noop = useCallback(() => {}, []);\n let handleEvent = useEffectEvent(handler ?? noop);\n let isDisabled = handler == null;\n\n useEffect(() => {\n if (isDisabled || !ref.current) {\n return;\n }\n\n let element = ref.current;\n element.addEventListener(event, handleEvent as EventListener, options);\n return () => {\n element.removeEventListener(event, handleEvent as EventListener, options);\n };\n }, [ref, event, options, isDisabled]);\n}\n"],"names":[],"version":3,"file":"useEvent.main.js.map"}
import {useEffectEvent as $8ae05eaa5c114e9c$export$7f54fc3180508a52} from "./useEffectEvent.mjs";
import {useCallback as $ceQd6$useCallback, useEffect as $ceQd6$useEffect} from "react";
/*
* Copyright 2021 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $e9faafb641e167db$export$90fc3a17d93f704c(ref, event, handler, options) {
let noop = (0, $ceQd6$useCallback)(()=>{}, []);
let handleEvent = (0, $8ae05eaa5c114e9c$export$7f54fc3180508a52)(handler !== null && handler !== void 0 ? handler : noop);
let isDisabled = handler == null;
(0, $ceQd6$useEffect)(()=>{
if (isDisabled || !ref.current) return;
let element = ref.current;
element.addEventListener(event, handleEvent, options);
return ()=>{
element.removeEventListener(event, handleEvent, options);
};
}, [
ref,
event,
options,
isDisabled
]);
}
export {$e9faafb641e167db$export$90fc3a17d93f704c as useEvent};
//# sourceMappingURL=useEvent.module.js.map
import {useEffectEvent as $8ae05eaa5c114e9c$export$7f54fc3180508a52} from "./useEffectEvent.module.js";
import {useCallback as $ceQd6$useCallback, useEffect as $ceQd6$useEffect} from "react";
/*
* Copyright 2021 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $e9faafb641e167db$export$90fc3a17d93f704c(ref, event, handler, options) {
let noop = (0, $ceQd6$useCallback)(()=>{}, []);
let handleEvent = (0, $8ae05eaa5c114e9c$export$7f54fc3180508a52)(handler !== null && handler !== void 0 ? handler : noop);
let isDisabled = handler == null;
(0, $ceQd6$useEffect)(()=>{
if (isDisabled || !ref.current) return;
let element = ref.current;
element.addEventListener(event, handleEvent, options);
return ()=>{
element.removeEventListener(event, handleEvent, options);
};
}, [
ref,
event,
options,
isDisabled
]);
}
export {$e9faafb641e167db$export$90fc3a17d93f704c as useEvent};
//# sourceMappingURL=useEvent.module.js.map
{"mappings":";;;AAAA;;;;;;;;;;CAUC;;AAMM,SAAS,0CACd,GAAkC,EAClC,KAAwB,EACxB,OAAqE,EACrE,OAA2C;IAE3C,IAAI,OAAO,CAAA,GAAA,kBAAU,EAAE,KAAO,GAAG,EAAE;IACnC,IAAI,cAAc,CAAA,GAAA,yCAAa,EAAE,oBAAA,qBAAA,UAAW;IAC5C,IAAI,aAAa,WAAW;IAE5B,CAAA,GAAA,gBAAQ,EAAE;QACR,IAAI,cAAc,CAAC,IAAI,OAAO,EAC5B;QAGF,IAAI,UAAU,IAAI,OAAO;QACzB,QAAQ,gBAAgB,CAAC,OAAO,aAA8B;QAC9D,OAAO;YACL,QAAQ,mBAAmB,CAAC,OAAO,aAA8B;QACnE;IACF,GAAG;QAAC;QAAK;QAAO;QAAS;KAAW;AACtC","sources":["packages/@react-aria/utils/src/useEvent.ts"],"sourcesContent":["/*\n * Copyright 2021 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {RefObject} from '@react-types/shared';\nimport {useCallback, useEffect} from 'react';\nimport {useEffectEvent} from './useEffectEvent';\n\nexport function useEvent<K extends keyof GlobalEventHandlersEventMap>(\n ref: RefObject<EventTarget | null>,\n event: K | (string & {}),\n handler?: (this: Document, ev: GlobalEventHandlersEventMap[K]) => any,\n options?: boolean | AddEventListenerOptions\n): void {\n let noop = useCallback(() => {}, []);\n let handleEvent = useEffectEvent(handler ?? noop);\n let isDisabled = handler == null;\n\n useEffect(() => {\n if (isDisabled || !ref.current) {\n return;\n }\n\n let element = ref.current;\n element.addEventListener(event, handleEvent as EventListener, options);\n return () => {\n element.removeEventListener(event, handleEvent as EventListener, options);\n };\n }, [ref, event, options, isDisabled]);\n}\n"],"names":[],"version":3,"file":"useEvent.module.js.map"}
var $1254e5bb94ac8761$exports = require("./useEffectEvent.main.js");
var $81vbz$react = require("react");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useFormReset", () => $1f205e845604a423$export$5add1d006293d136);
/*
* Copyright 2023 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $1f205e845604a423$export$5add1d006293d136(ref, initialValue, onReset) {
let handleReset = (0, $1254e5bb94ac8761$exports.useEffectEvent)(()=>{
if (onReset) onReset(initialValue);
});
(0, $81vbz$react.useEffect)(()=>{
var _ref_current;
let form = ref === null || ref === void 0 ? void 0 : (_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.form;
form === null || form === void 0 ? void 0 : form.addEventListener('reset', handleReset);
return ()=>{
form === null || form === void 0 ? void 0 : form.removeEventListener('reset', handleReset);
};
}, [
ref
]);
}
//# sourceMappingURL=useFormReset.main.js.map
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAMM,SAAS,0CACd,GAA6F,EAC7F,YAAe,EACf,OAA2B;IAE3B,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,IAAI,SACF,QAAQ;IAEZ;IAEA,CAAA,GAAA,sBAAQ,EAAE;YACG;QAAX,IAAI,OAAO,gBAAA,2BAAA,eAAA,IAAK,OAAO,cAAZ,mCAAA,aAAc,IAAI;QAE7B,iBAAA,2BAAA,KAAM,gBAAgB,CAAC,SAAS;QAChC,OAAO;YACL,iBAAA,2BAAA,KAAM,mBAAmB,CAAC,SAAS;QACrC;IACF,GAAG;QAAC;KAAI;AACV","sources":["packages/@react-aria/utils/src/useFormReset.ts"],"sourcesContent":["/*\n * Copyright 2023 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {RefObject} from '@react-types/shared';\nimport {useEffect} from 'react';\nimport {useEffectEvent} from './useEffectEvent';\n\nexport function useFormReset<T>(\n ref: RefObject<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement | null> | undefined,\n initialValue: T,\n onReset: (value: T) => void\n): void {\n let handleReset = useEffectEvent(() => {\n if (onReset) {\n onReset(initialValue);\n }\n });\n\n useEffect(() => {\n let form = ref?.current?.form;\n\n form?.addEventListener('reset', handleReset);\n return () => {\n form?.removeEventListener('reset', handleReset);\n };\n }, [ref]);\n}\n"],"names":[],"version":3,"file":"useFormReset.main.js.map"}
import {useEffectEvent as $8ae05eaa5c114e9c$export$7f54fc3180508a52} from "./useEffectEvent.mjs";
import {useEffect as $8rM3G$useEffect} from "react";
/*
* Copyright 2023 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $99facab73266f662$export$5add1d006293d136(ref, initialValue, onReset) {
let handleReset = (0, $8ae05eaa5c114e9c$export$7f54fc3180508a52)(()=>{
if (onReset) onReset(initialValue);
});
(0, $8rM3G$useEffect)(()=>{
var _ref_current;
let form = ref === null || ref === void 0 ? void 0 : (_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.form;
form === null || form === void 0 ? void 0 : form.addEventListener('reset', handleReset);
return ()=>{
form === null || form === void 0 ? void 0 : form.removeEventListener('reset', handleReset);
};
}, [
ref
]);
}
export {$99facab73266f662$export$5add1d006293d136 as useFormReset};
//# sourceMappingURL=useFormReset.module.js.map
import {useEffectEvent as $8ae05eaa5c114e9c$export$7f54fc3180508a52} from "./useEffectEvent.module.js";
import {useEffect as $8rM3G$useEffect} from "react";
/*
* Copyright 2023 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $99facab73266f662$export$5add1d006293d136(ref, initialValue, onReset) {
let handleReset = (0, $8ae05eaa5c114e9c$export$7f54fc3180508a52)(()=>{
if (onReset) onReset(initialValue);
});
(0, $8rM3G$useEffect)(()=>{
var _ref_current;
let form = ref === null || ref === void 0 ? void 0 : (_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.form;
form === null || form === void 0 ? void 0 : form.addEventListener('reset', handleReset);
return ()=>{
form === null || form === void 0 ? void 0 : form.removeEventListener('reset', handleReset);
};
}, [
ref
]);
}
export {$99facab73266f662$export$5add1d006293d136 as useFormReset};
//# sourceMappingURL=useFormReset.module.js.map
{"mappings":";;;AAAA;;;;;;;;;;CAUC;;AAMM,SAAS,0CACd,GAA6F,EAC7F,YAAe,EACf,OAA2B;IAE3B,IAAI,cAAc,CAAA,GAAA,yCAAa,EAAE;QAC/B,IAAI,SACF,QAAQ;IAEZ;IAEA,CAAA,GAAA,gBAAQ,EAAE;YACG;QAAX,IAAI,OAAO,gBAAA,2BAAA,eAAA,IAAK,OAAO,cAAZ,mCAAA,aAAc,IAAI;QAE7B,iBAAA,2BAAA,KAAM,gBAAgB,CAAC,SAAS;QAChC,OAAO;YACL,iBAAA,2BAAA,KAAM,mBAAmB,CAAC,SAAS;QACrC;IACF,GAAG;QAAC;KAAI;AACV","sources":["packages/@react-aria/utils/src/useFormReset.ts"],"sourcesContent":["/*\n * Copyright 2023 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {RefObject} from '@react-types/shared';\nimport {useEffect} from 'react';\nimport {useEffectEvent} from './useEffectEvent';\n\nexport function useFormReset<T>(\n ref: RefObject<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement | null> | undefined,\n initialValue: T,\n onReset: (value: T) => void\n): void {\n let handleReset = useEffectEvent(() => {\n if (onReset) {\n onReset(initialValue);\n }\n });\n\n useEffect(() => {\n let form = ref?.current?.form;\n\n form?.addEventListener('reset', handleReset);\n return () => {\n form?.removeEventListener('reset', handleReset);\n };\n }, [ref]);\n}\n"],"names":[],"version":3,"file":"useFormReset.module.js.map"}
var $eHdSW$react = require("react");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useGlobalListeners", () => $4571ff54ac709100$export$4eaf04e54aa8eed6);
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $4571ff54ac709100$export$4eaf04e54aa8eed6() {
let globalListeners = (0, $eHdSW$react.useRef)(new Map());
let addGlobalListener = (0, $eHdSW$react.useCallback)((eventTarget, type, listener, options)=>{
// Make sure we remove the listener after it is called with the `once` option.
let fn = (options === null || options === void 0 ? void 0 : options.once) ? (...args)=>{
globalListeners.current.delete(listener);
listener(...args);
} : listener;
globalListeners.current.set(listener, {
type: type,
eventTarget: eventTarget,
fn: fn,
options: options
});
eventTarget.addEventListener(type, fn, options);
}, []);
let removeGlobalListener = (0, $eHdSW$react.useCallback)((eventTarget, type, listener, options)=>{
var _globalListeners_current_get;
let fn = ((_globalListeners_current_get = globalListeners.current.get(listener)) === null || _globalListeners_current_get === void 0 ? void 0 : _globalListeners_current_get.fn) || listener;
eventTarget.removeEventListener(type, fn, options);
globalListeners.current.delete(listener);
}, []);
let removeAllGlobalListeners = (0, $eHdSW$react.useCallback)(()=>{
globalListeners.current.forEach((value, key)=>{
removeGlobalListener(value.eventTarget, value.type, key, value.options);
});
}, [
removeGlobalListener
]);
(0, $eHdSW$react.useEffect)(()=>{
return removeAllGlobalListeners;
}, [
removeAllGlobalListeners
]);
return {
addGlobalListener: addGlobalListener,
removeGlobalListener: removeGlobalListener,
removeAllGlobalListeners: removeAllGlobalListeners
};
}
//# sourceMappingURL=useGlobalListeners.main.js.map
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;AAaM,SAAS;IACd,IAAI,kBAAkB,CAAA,GAAA,mBAAK,EAAE,IAAI;IACjC,IAAI,oBAAoB,CAAA,GAAA,wBAAU,EAAE,CAAC,aAAa,MAAM,UAAU;QAChE,8EAA8E;QAC9E,IAAI,KAAK,CAAA,oBAAA,8BAAA,QAAS,IAAI,IAAG,CAAC,GAAG;YAC3B,gBAAgB,OAAO,CAAC,MAAM,CAAC;YAC/B,YAAY;QACd,IAAI;QACJ,gBAAgB,OAAO,CAAC,GAAG,CAAC,UAAU;kBAAC;yBAAM;gBAAa;qBAAI;QAAO;QACrE,YAAY,gBAAgB,CAAC,MAAM,IAAI;IACzC,GAAG,EAAE;IACL,IAAI,uBAAuB,CAAA,GAAA,wBAAU,EAAE,CAAC,aAAa,MAAM,UAAU;YAC1D;QAAT,IAAI,KAAK,EAAA,+BAAA,gBAAgB,OAAO,CAAC,GAAG,CAAC,uBAA5B,mDAAA,6BAAuC,EAAE,KAAI;QACtD,YAAY,mBAAmB,CAAC,MAAM,IAAI;QAC1C,gBAAgB,OAAO,CAAC,MAAM,CAAC;IACjC,GAAG,EAAE;IACL,IAAI,2BAA2B,CAAA,GAAA,wBAAU,EAAE;QACzC,gBAAgB,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO;YACtC,qBAAqB,MAAM,WAAW,EAAE,MAAM,IAAI,EAAE,KAAK,MAAM,OAAO;QACxE;IACF,GAAG;QAAC;KAAqB;IAGzB,CAAA,GAAA,sBAAQ,EAAE;QACR,OAAO;IACT,GAAG;QAAC;KAAyB;IAE7B,OAAO;2BAAC;8BAAmB;kCAAsB;IAAwB;AAC3E","sources":["packages/@react-aria/utils/src/useGlobalListeners.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {useCallback, useEffect, useRef} from 'react';\n\ninterface GlobalListeners {\n addGlobalListener<K extends keyof WindowEventMap>(el: Window, type: K, listener: (this: Document, ev: WindowEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void,\n addGlobalListener<K extends keyof DocumentEventMap>(el: EventTarget, type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void,\n addGlobalListener(el: EventTarget, type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void,\n removeGlobalListener<K extends keyof DocumentEventMap>(el: EventTarget, type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void,\n removeGlobalListener(el: EventTarget, type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void,\n removeAllGlobalListeners(): void\n}\n\nexport function useGlobalListeners(): GlobalListeners {\n let globalListeners = useRef(new Map());\n let addGlobalListener = useCallback((eventTarget, type, listener, options) => {\n // Make sure we remove the listener after it is called with the `once` option.\n let fn = options?.once ? (...args) => {\n globalListeners.current.delete(listener);\n listener(...args);\n } : listener;\n globalListeners.current.set(listener, {type, eventTarget, fn, options});\n eventTarget.addEventListener(type, fn, options);\n }, []);\n let removeGlobalListener = useCallback((eventTarget, type, listener, options) => {\n let fn = globalListeners.current.get(listener)?.fn || listener;\n eventTarget.removeEventListener(type, fn, options);\n globalListeners.current.delete(listener);\n }, []);\n let removeAllGlobalListeners = useCallback(() => {\n globalListeners.current.forEach((value, key) => {\n removeGlobalListener(value.eventTarget, value.type, key, value.options);\n });\n }, [removeGlobalListener]);\n\n \n useEffect(() => {\n return removeAllGlobalListeners;\n }, [removeAllGlobalListeners]);\n\n return {addGlobalListener, removeGlobalListener, removeAllGlobalListeners};\n}\n"],"names":[],"version":3,"file":"useGlobalListeners.main.js.map"}
import {useRef as $lPAwt$useRef, useCallback as $lPAwt$useCallback, useEffect as $lPAwt$useEffect} from "react";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $03deb23ff14920c4$export$4eaf04e54aa8eed6() {
let globalListeners = (0, $lPAwt$useRef)(new Map());
let addGlobalListener = (0, $lPAwt$useCallback)((eventTarget, type, listener, options)=>{
// Make sure we remove the listener after it is called with the `once` option.
let fn = (options === null || options === void 0 ? void 0 : options.once) ? (...args)=>{
globalListeners.current.delete(listener);
listener(...args);
} : listener;
globalListeners.current.set(listener, {
type: type,
eventTarget: eventTarget,
fn: fn,
options: options
});
eventTarget.addEventListener(type, fn, options);
}, []);
let removeGlobalListener = (0, $lPAwt$useCallback)((eventTarget, type, listener, options)=>{
var _globalListeners_current_get;
let fn = ((_globalListeners_current_get = globalListeners.current.get(listener)) === null || _globalListeners_current_get === void 0 ? void 0 : _globalListeners_current_get.fn) || listener;
eventTarget.removeEventListener(type, fn, options);
globalListeners.current.delete(listener);
}, []);
let removeAllGlobalListeners = (0, $lPAwt$useCallback)(()=>{
globalListeners.current.forEach((value, key)=>{
removeGlobalListener(value.eventTarget, value.type, key, value.options);
});
}, [
removeGlobalListener
]);
(0, $lPAwt$useEffect)(()=>{
return removeAllGlobalListeners;
}, [
removeAllGlobalListeners
]);
return {
addGlobalListener: addGlobalListener,
removeGlobalListener: removeGlobalListener,
removeAllGlobalListeners: removeAllGlobalListeners
};
}
export {$03deb23ff14920c4$export$4eaf04e54aa8eed6 as useGlobalListeners};
//# sourceMappingURL=useGlobalListeners.module.js.map
import {useRef as $lPAwt$useRef, useCallback as $lPAwt$useCallback, useEffect as $lPAwt$useEffect} from "react";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $03deb23ff14920c4$export$4eaf04e54aa8eed6() {
let globalListeners = (0, $lPAwt$useRef)(new Map());
let addGlobalListener = (0, $lPAwt$useCallback)((eventTarget, type, listener, options)=>{
// Make sure we remove the listener after it is called with the `once` option.
let fn = (options === null || options === void 0 ? void 0 : options.once) ? (...args)=>{
globalListeners.current.delete(listener);
listener(...args);
} : listener;
globalListeners.current.set(listener, {
type: type,
eventTarget: eventTarget,
fn: fn,
options: options
});
eventTarget.addEventListener(type, fn, options);
}, []);
let removeGlobalListener = (0, $lPAwt$useCallback)((eventTarget, type, listener, options)=>{
var _globalListeners_current_get;
let fn = ((_globalListeners_current_get = globalListeners.current.get(listener)) === null || _globalListeners_current_get === void 0 ? void 0 : _globalListeners_current_get.fn) || listener;
eventTarget.removeEventListener(type, fn, options);
globalListeners.current.delete(listener);
}, []);
let removeAllGlobalListeners = (0, $lPAwt$useCallback)(()=>{
globalListeners.current.forEach((value, key)=>{
removeGlobalListener(value.eventTarget, value.type, key, value.options);
});
}, [
removeGlobalListener
]);
(0, $lPAwt$useEffect)(()=>{
return removeAllGlobalListeners;
}, [
removeAllGlobalListeners
]);
return {
addGlobalListener: addGlobalListener,
removeGlobalListener: removeGlobalListener,
removeAllGlobalListeners: removeAllGlobalListeners
};
}
export {$03deb23ff14920c4$export$4eaf04e54aa8eed6 as useGlobalListeners};
//# sourceMappingURL=useGlobalListeners.module.js.map
{"mappings":";;AAAA;;;;;;;;;;CAUC;AAaM,SAAS;IACd,IAAI,kBAAkB,CAAA,GAAA,aAAK,EAAE,IAAI;IACjC,IAAI,oBAAoB,CAAA,GAAA,kBAAU,EAAE,CAAC,aAAa,MAAM,UAAU;QAChE,8EAA8E;QAC9E,IAAI,KAAK,CAAA,oBAAA,8BAAA,QAAS,IAAI,IAAG,CAAC,GAAG;YAC3B,gBAAgB,OAAO,CAAC,MAAM,CAAC;YAC/B,YAAY;QACd,IAAI;QACJ,gBAAgB,OAAO,CAAC,GAAG,CAAC,UAAU;kBAAC;yBAAM;gBAAa;qBAAI;QAAO;QACrE,YAAY,gBAAgB,CAAC,MAAM,IAAI;IACzC,GAAG,EAAE;IACL,IAAI,uBAAuB,CAAA,GAAA,kBAAU,EAAE,CAAC,aAAa,MAAM,UAAU;YAC1D;QAAT,IAAI,KAAK,EAAA,+BAAA,gBAAgB,OAAO,CAAC,GAAG,CAAC,uBAA5B,mDAAA,6BAAuC,EAAE,KAAI;QACtD,YAAY,mBAAmB,CAAC,MAAM,IAAI;QAC1C,gBAAgB,OAAO,CAAC,MAAM,CAAC;IACjC,GAAG,EAAE;IACL,IAAI,2BAA2B,CAAA,GAAA,kBAAU,EAAE;QACzC,gBAAgB,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO;YACtC,qBAAqB,MAAM,WAAW,EAAE,MAAM,IAAI,EAAE,KAAK,MAAM,OAAO;QACxE;IACF,GAAG;QAAC;KAAqB;IAGzB,CAAA,GAAA,gBAAQ,EAAE;QACR,OAAO;IACT,GAAG;QAAC;KAAyB;IAE7B,OAAO;2BAAC;8BAAmB;kCAAsB;IAAwB;AAC3E","sources":["packages/@react-aria/utils/src/useGlobalListeners.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {useCallback, useEffect, useRef} from 'react';\n\ninterface GlobalListeners {\n addGlobalListener<K extends keyof WindowEventMap>(el: Window, type: K, listener: (this: Document, ev: WindowEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void,\n addGlobalListener<K extends keyof DocumentEventMap>(el: EventTarget, type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void,\n addGlobalListener(el: EventTarget, type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void,\n removeGlobalListener<K extends keyof DocumentEventMap>(el: EventTarget, type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void,\n removeGlobalListener(el: EventTarget, type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void,\n removeAllGlobalListeners(): void\n}\n\nexport function useGlobalListeners(): GlobalListeners {\n let globalListeners = useRef(new Map());\n let addGlobalListener = useCallback((eventTarget, type, listener, options) => {\n // Make sure we remove the listener after it is called with the `once` option.\n let fn = options?.once ? (...args) => {\n globalListeners.current.delete(listener);\n listener(...args);\n } : listener;\n globalListeners.current.set(listener, {type, eventTarget, fn, options});\n eventTarget.addEventListener(type, fn, options);\n }, []);\n let removeGlobalListener = useCallback((eventTarget, type, listener, options) => {\n let fn = globalListeners.current.get(listener)?.fn || listener;\n eventTarget.removeEventListener(type, fn, options);\n globalListeners.current.delete(listener);\n }, []);\n let removeAllGlobalListeners = useCallback(() => {\n globalListeners.current.forEach((value, key) => {\n removeGlobalListener(value.eventTarget, value.type, key, value.options);\n });\n }, [removeGlobalListener]);\n\n \n useEffect(() => {\n return removeAllGlobalListeners;\n }, [removeAllGlobalListeners]);\n\n return {addGlobalListener, removeGlobalListener, removeAllGlobalListeners};\n}\n"],"names":[],"version":3,"file":"useGlobalListeners.module.js.map"}
var $78605a5d7424e31b$exports = require("./useLayoutEffect.main.js");
var $19a2307bfabafaf1$exports = require("./useValueEffect.main.js");
var $dG5aF$react = require("react");
var $dG5aF$reactariassr = require("@react-aria/ssr");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useId", () => $8c61827343eed941$export$f680877a34711e37);
$parcel$export(module.exports, "mergeIds", () => $8c61827343eed941$export$cd8c9cb68f842629);
$parcel$export(module.exports, "useSlotId", () => $8c61827343eed941$export$b4cc09c592e8fdb8);
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
// copied from SSRProvider.tsx to reduce exports, if needed again, consider sharing
let $8c61827343eed941$var$canUseDOM = Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);
let $8c61827343eed941$export$d41a04c74483c6ef = new Map();
// This allows us to clean up the idsUpdaterMap when the id is no longer used.
// Map is a strong reference, so unused ids wouldn't be cleaned up otherwise.
// This can happen in suspended components where mount/unmount is not called.
let $8c61827343eed941$var$registry;
if (typeof FinalizationRegistry !== 'undefined') $8c61827343eed941$var$registry = new FinalizationRegistry((heldValue)=>{
$8c61827343eed941$export$d41a04c74483c6ef.delete(heldValue);
});
function $8c61827343eed941$export$f680877a34711e37(defaultId) {
let [value, setValue] = (0, $dG5aF$react.useState)(defaultId);
let nextId = (0, $dG5aF$react.useRef)(null);
let res = (0, $dG5aF$reactariassr.useSSRSafeId)(value);
let cleanupRef = (0, $dG5aF$react.useRef)(null);
if ($8c61827343eed941$var$registry) $8c61827343eed941$var$registry.register(cleanupRef, res);
if ($8c61827343eed941$var$canUseDOM) {
const cacheIdRef = $8c61827343eed941$export$d41a04c74483c6ef.get(res);
if (cacheIdRef && !cacheIdRef.includes(nextId)) cacheIdRef.push(nextId);
else $8c61827343eed941$export$d41a04c74483c6ef.set(res, [
nextId
]);
}
(0, $78605a5d7424e31b$exports.useLayoutEffect)(()=>{
let r = res;
return ()=>{
// In Suspense, the cleanup function may be not called
// when it is though, also remove it from the finalization registry.
if ($8c61827343eed941$var$registry) $8c61827343eed941$var$registry.unregister(cleanupRef);
$8c61827343eed941$export$d41a04c74483c6ef.delete(r);
};
}, [
res
]);
// This cannot cause an infinite loop because the ref is always cleaned up.
// eslint-disable-next-line
(0, $dG5aF$react.useEffect)(()=>{
let newId = nextId.current;
if (newId) setValue(newId);
return ()=>{
if (newId) nextId.current = null;
};
});
return res;
}
function $8c61827343eed941$export$cd8c9cb68f842629(idA, idB) {
if (idA === idB) return idA;
let setIdsA = $8c61827343eed941$export$d41a04c74483c6ef.get(idA);
if (setIdsA) {
setIdsA.forEach((ref)=>ref.current = idB);
return idB;
}
let setIdsB = $8c61827343eed941$export$d41a04c74483c6ef.get(idB);
if (setIdsB) {
setIdsB.forEach((ref)=>ref.current = idA);
return idA;
}
return idB;
}
function $8c61827343eed941$export$b4cc09c592e8fdb8(depArray = []) {
let id = $8c61827343eed941$export$f680877a34711e37();
let [resolvedId, setResolvedId] = (0, $19a2307bfabafaf1$exports.useValueEffect)(id);
let updateId = (0, $dG5aF$react.useCallback)(()=>{
setResolvedId(function*() {
yield id;
yield document.getElementById(id) ? id : undefined;
});
}, [
id,
setResolvedId
]);
(0, $78605a5d7424e31b$exports.useLayoutEffect)(updateId, [
id,
updateId,
...depArray
]);
return resolvedId;
}
//# sourceMappingURL=useId.main.js.map
{"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAOD,mFAAmF;AACnF,IAAI,kCAAY,QACd,OAAO,WAAW,eAClB,OAAO,QAAQ,IACf,OAAO,QAAQ,CAAC,aAAa;AAGxB,IAAI,4CAA2D,IAAI;AAC1E,8EAA8E;AAC9E,6EAA6E;AAC7E,6EAA6E;AAC7E,IAAI;AACJ,IAAI,OAAO,yBAAyB,aAClC,iCAAW,IAAI,qBAA6B,CAAC;IAC3C,0CAAc,MAAM,CAAC;AACvB;AAOK,SAAS,0CAAM,SAAkB;IACtC,IAAI,CAAC,OAAO,SAAS,GAAG,CAAA,GAAA,qBAAO,EAAE;IACjC,IAAI,SAAS,CAAA,GAAA,mBAAK,EAAE;IAEpB,IAAI,MAAM,CAAA,GAAA,gCAAW,EAAE;IACvB,IAAI,aAAa,CAAA,GAAA,mBAAK,EAAE;IAExB,IAAI,gCACF,+BAAS,QAAQ,CAAC,YAAY;IAGhC,IAAI,iCAAW;QACb,MAAM,aAAa,0CAAc,GAAG,CAAC;QACrC,IAAI,cAAc,CAAC,WAAW,QAAQ,CAAC,SACrC,WAAW,IAAI,CAAC;aAEhB,0CAAc,GAAG,CAAC,KAAK;YAAC;SAAO;IAEnC;IAEA,CAAA,GAAA,yCAAc,EAAE;QACd,IAAI,IAAI;QACR,OAAO;YACL,sDAAsD;YACtD,oEAAoE;YACpE,IAAI,gCACF,+BAAS,UAAU,CAAC;YAEtB,0CAAc,MAAM,CAAC;QACvB;IACF,GAAG;QAAC;KAAI;IAER,2EAA2E;IAC3E,2BAA2B;IAC3B,CAAA,GAAA,sBAAQ,EAAE;QACR,IAAI,QAAQ,OAAO,OAAO;QAC1B,IAAI,OAAS,SAAS;QAEtB,OAAO;YACL,IAAI,OAAS,OAAO,OAAO,GAAG;QAChC;IACF;IAEA,OAAO;AACT;AAMO,SAAS,0CAAS,GAAW,EAAE,GAAW;IAC/C,IAAI,QAAQ,KACV,OAAO;IAGT,IAAI,UAAU,0CAAc,GAAG,CAAC;IAChC,IAAI,SAAS;QACX,QAAQ,OAAO,CAAC,CAAA,MAAQ,IAAI,OAAO,GAAG;QACtC,OAAO;IACT;IAEA,IAAI,UAAU,0CAAc,GAAG,CAAC;IAChC,IAAI,SAAS;QACX,QAAQ,OAAO,CAAC,CAAC,MAAS,IAAI,OAAO,GAAG;QACxC,OAAO;IACT;IAEA,OAAO;AACT;AAOO,SAAS,0CAAU,WAA+B,EAAE;IACzD,IAAI,KAAK;IACT,IAAI,CAAC,YAAY,cAAc,GAAG,CAAA,GAAA,wCAAa,EAAE;IACjD,IAAI,WAAW,CAAA,GAAA,wBAAU,EAAE;QACzB,cAAc;YACZ,MAAM;YAEN,MAAM,SAAS,cAAc,CAAC,MAAM,KAAK;QAC3C;IACF,GAAG;QAAC;QAAI;KAAc;IAEtB,CAAA,GAAA,yCAAc,EAAE,UAAU;QAAC;QAAI;WAAa;KAAS;IAErD,OAAO;AACT","sources":["packages/@react-aria/utils/src/useId.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {useCallback, useEffect, useRef, useState} from 'react';\nimport {useLayoutEffect} from './useLayoutEffect';\nimport {useSSRSafeId} from '@react-aria/ssr';\nimport {useValueEffect} from './';\n\n// copied from SSRProvider.tsx to reduce exports, if needed again, consider sharing\nlet canUseDOM = Boolean(\n typeof window !== 'undefined' &&\n window.document &&\n window.document.createElement\n);\n\nexport let idsUpdaterMap: Map<string, { current: string | null }[]> = new Map();\n// This allows us to clean up the idsUpdaterMap when the id is no longer used.\n// Map is a strong reference, so unused ids wouldn't be cleaned up otherwise.\n// This can happen in suspended components where mount/unmount is not called.\nlet registry;\nif (typeof FinalizationRegistry !== 'undefined') {\n registry = new FinalizationRegistry<string>((heldValue) => {\n idsUpdaterMap.delete(heldValue);\n });\n}\n\n/**\n * If a default is not provided, generate an id.\n * @param defaultId - Default component id.\n */\nexport function useId(defaultId?: string): string {\n let [value, setValue] = useState(defaultId);\n let nextId = useRef(null);\n\n let res = useSSRSafeId(value);\n let cleanupRef = useRef(null);\n\n if (registry) {\n registry.register(cleanupRef, res);\n }\n\n if (canUseDOM) {\n const cacheIdRef = idsUpdaterMap.get(res);\n if (cacheIdRef && !cacheIdRef.includes(nextId)) {\n cacheIdRef.push(nextId);\n } else {\n idsUpdaterMap.set(res, [nextId]);\n }\n }\n\n useLayoutEffect(() => {\n let r = res;\n return () => {\n // In Suspense, the cleanup function may be not called\n // when it is though, also remove it from the finalization registry.\n if (registry) {\n registry.unregister(cleanupRef);\n }\n idsUpdaterMap.delete(r);\n };\n }, [res]);\n\n // This cannot cause an infinite loop because the ref is always cleaned up.\n // eslint-disable-next-line\n useEffect(() => {\n let newId = nextId.current;\n if (newId) { setValue(newId); }\n\n return () => {\n if (newId) { nextId.current = null; }\n };\n });\n\n return res;\n}\n\n/**\n * Merges two ids.\n * Different ids will trigger a side-effect and re-render components hooked up with `useId`.\n */\nexport function mergeIds(idA: string, idB: string): string {\n if (idA === idB) {\n return idA;\n }\n\n let setIdsA = idsUpdaterMap.get(idA);\n if (setIdsA) {\n setIdsA.forEach(ref => (ref.current = idB));\n return idB;\n }\n\n let setIdsB = idsUpdaterMap.get(idB);\n if (setIdsB) {\n setIdsB.forEach((ref) => (ref.current = idA));\n return idA;\n }\n\n return idB;\n}\n\n/**\n * Used to generate an id, and after render, check if that id is rendered so we know\n * if we can use it in places such as labelledby.\n * @param depArray - When to recalculate if the id is in the DOM.\n */\nexport function useSlotId(depArray: ReadonlyArray<any> = []): string {\n let id = useId();\n let [resolvedId, setResolvedId] = useValueEffect(id);\n let updateId = useCallback(() => {\n setResolvedId(function *() {\n yield id;\n\n yield document.getElementById(id) ? id : undefined;\n });\n }, [id, setResolvedId]);\n\n useLayoutEffect(updateId, [id, updateId, ...depArray]);\n\n return resolvedId;\n}\n"],"names":[],"version":3,"file":"useId.main.js.map"}
import {useLayoutEffect as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c} from "./useLayoutEffect.mjs";
import {useValueEffect as $1dbecbe27a04f9af$export$14d238f342723f25} from "./useValueEffect.mjs";
import {useState as $eKkEp$useState, useRef as $eKkEp$useRef, useEffect as $eKkEp$useEffect, useCallback as $eKkEp$useCallback} from "react";
import {useSSRSafeId as $eKkEp$useSSRSafeId} from "@react-aria/ssr";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
// copied from SSRProvider.tsx to reduce exports, if needed again, consider sharing
let $bdb11010cef70236$var$canUseDOM = Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);
let $bdb11010cef70236$export$d41a04c74483c6ef = new Map();
// This allows us to clean up the idsUpdaterMap when the id is no longer used.
// Map is a strong reference, so unused ids wouldn't be cleaned up otherwise.
// This can happen in suspended components where mount/unmount is not called.
let $bdb11010cef70236$var$registry;
if (typeof FinalizationRegistry !== 'undefined') $bdb11010cef70236$var$registry = new FinalizationRegistry((heldValue)=>{
$bdb11010cef70236$export$d41a04c74483c6ef.delete(heldValue);
});
function $bdb11010cef70236$export$f680877a34711e37(defaultId) {
let [value, setValue] = (0, $eKkEp$useState)(defaultId);
let nextId = (0, $eKkEp$useRef)(null);
let res = (0, $eKkEp$useSSRSafeId)(value);
let cleanupRef = (0, $eKkEp$useRef)(null);
if ($bdb11010cef70236$var$registry) $bdb11010cef70236$var$registry.register(cleanupRef, res);
if ($bdb11010cef70236$var$canUseDOM) {
const cacheIdRef = $bdb11010cef70236$export$d41a04c74483c6ef.get(res);
if (cacheIdRef && !cacheIdRef.includes(nextId)) cacheIdRef.push(nextId);
else $bdb11010cef70236$export$d41a04c74483c6ef.set(res, [
nextId
]);
}
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
let r = res;
return ()=>{
// In Suspense, the cleanup function may be not called
// when it is though, also remove it from the finalization registry.
if ($bdb11010cef70236$var$registry) $bdb11010cef70236$var$registry.unregister(cleanupRef);
$bdb11010cef70236$export$d41a04c74483c6ef.delete(r);
};
}, [
res
]);
// This cannot cause an infinite loop because the ref is always cleaned up.
// eslint-disable-next-line
(0, $eKkEp$useEffect)(()=>{
let newId = nextId.current;
if (newId) setValue(newId);
return ()=>{
if (newId) nextId.current = null;
};
});
return res;
}
function $bdb11010cef70236$export$cd8c9cb68f842629(idA, idB) {
if (idA === idB) return idA;
let setIdsA = $bdb11010cef70236$export$d41a04c74483c6ef.get(idA);
if (setIdsA) {
setIdsA.forEach((ref)=>ref.current = idB);
return idB;
}
let setIdsB = $bdb11010cef70236$export$d41a04c74483c6ef.get(idB);
if (setIdsB) {
setIdsB.forEach((ref)=>ref.current = idA);
return idA;
}
return idB;
}
function $bdb11010cef70236$export$b4cc09c592e8fdb8(depArray = []) {
let id = $bdb11010cef70236$export$f680877a34711e37();
let [resolvedId, setResolvedId] = (0, $1dbecbe27a04f9af$export$14d238f342723f25)(id);
let updateId = (0, $eKkEp$useCallback)(()=>{
setResolvedId(function*() {
yield id;
yield document.getElementById(id) ? id : undefined;
});
}, [
id,
setResolvedId
]);
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(updateId, [
id,
updateId,
...depArray
]);
return resolvedId;
}
export {$bdb11010cef70236$export$d41a04c74483c6ef as idsUpdaterMap, $bdb11010cef70236$export$f680877a34711e37 as useId, $bdb11010cef70236$export$cd8c9cb68f842629 as mergeIds, $bdb11010cef70236$export$b4cc09c592e8fdb8 as useSlotId};
//# sourceMappingURL=useId.module.js.map
import {useLayoutEffect as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c} from "./useLayoutEffect.module.js";
import {useValueEffect as $1dbecbe27a04f9af$export$14d238f342723f25} from "./useValueEffect.module.js";
import {useState as $eKkEp$useState, useRef as $eKkEp$useRef, useEffect as $eKkEp$useEffect, useCallback as $eKkEp$useCallback} from "react";
import {useSSRSafeId as $eKkEp$useSSRSafeId} from "@react-aria/ssr";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
// copied from SSRProvider.tsx to reduce exports, if needed again, consider sharing
let $bdb11010cef70236$var$canUseDOM = Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);
let $bdb11010cef70236$export$d41a04c74483c6ef = new Map();
// This allows us to clean up the idsUpdaterMap when the id is no longer used.
// Map is a strong reference, so unused ids wouldn't be cleaned up otherwise.
// This can happen in suspended components where mount/unmount is not called.
let $bdb11010cef70236$var$registry;
if (typeof FinalizationRegistry !== 'undefined') $bdb11010cef70236$var$registry = new FinalizationRegistry((heldValue)=>{
$bdb11010cef70236$export$d41a04c74483c6ef.delete(heldValue);
});
function $bdb11010cef70236$export$f680877a34711e37(defaultId) {
let [value, setValue] = (0, $eKkEp$useState)(defaultId);
let nextId = (0, $eKkEp$useRef)(null);
let res = (0, $eKkEp$useSSRSafeId)(value);
let cleanupRef = (0, $eKkEp$useRef)(null);
if ($bdb11010cef70236$var$registry) $bdb11010cef70236$var$registry.register(cleanupRef, res);
if ($bdb11010cef70236$var$canUseDOM) {
const cacheIdRef = $bdb11010cef70236$export$d41a04c74483c6ef.get(res);
if (cacheIdRef && !cacheIdRef.includes(nextId)) cacheIdRef.push(nextId);
else $bdb11010cef70236$export$d41a04c74483c6ef.set(res, [
nextId
]);
}
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
let r = res;
return ()=>{
// In Suspense, the cleanup function may be not called
// when it is though, also remove it from the finalization registry.
if ($bdb11010cef70236$var$registry) $bdb11010cef70236$var$registry.unregister(cleanupRef);
$bdb11010cef70236$export$d41a04c74483c6ef.delete(r);
};
}, [
res
]);
// This cannot cause an infinite loop because the ref is always cleaned up.
// eslint-disable-next-line
(0, $eKkEp$useEffect)(()=>{
let newId = nextId.current;
if (newId) setValue(newId);
return ()=>{
if (newId) nextId.current = null;
};
});
return res;
}
function $bdb11010cef70236$export$cd8c9cb68f842629(idA, idB) {
if (idA === idB) return idA;
let setIdsA = $bdb11010cef70236$export$d41a04c74483c6ef.get(idA);
if (setIdsA) {
setIdsA.forEach((ref)=>ref.current = idB);
return idB;
}
let setIdsB = $bdb11010cef70236$export$d41a04c74483c6ef.get(idB);
if (setIdsB) {
setIdsB.forEach((ref)=>ref.current = idA);
return idA;
}
return idB;
}
function $bdb11010cef70236$export$b4cc09c592e8fdb8(depArray = []) {
let id = $bdb11010cef70236$export$f680877a34711e37();
let [resolvedId, setResolvedId] = (0, $1dbecbe27a04f9af$export$14d238f342723f25)(id);
let updateId = (0, $eKkEp$useCallback)(()=>{
setResolvedId(function*() {
yield id;
yield document.getElementById(id) ? id : undefined;
});
}, [
id,
setResolvedId
]);
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(updateId, [
id,
updateId,
...depArray
]);
return resolvedId;
}
export {$bdb11010cef70236$export$d41a04c74483c6ef as idsUpdaterMap, $bdb11010cef70236$export$f680877a34711e37 as useId, $bdb11010cef70236$export$cd8c9cb68f842629 as mergeIds, $bdb11010cef70236$export$b4cc09c592e8fdb8 as useSlotId};
//# sourceMappingURL=useId.module.js.map
{"mappings":";;;;;AAAA;;;;;;;;;;CAUC;;;;AAOD,mFAAmF;AACnF,IAAI,kCAAY,QACd,OAAO,WAAW,eAClB,OAAO,QAAQ,IACf,OAAO,QAAQ,CAAC,aAAa;AAGxB,IAAI,4CAA2D,IAAI;AAC1E,8EAA8E;AAC9E,6EAA6E;AAC7E,6EAA6E;AAC7E,IAAI;AACJ,IAAI,OAAO,yBAAyB,aAClC,iCAAW,IAAI,qBAA6B,CAAC;IAC3C,0CAAc,MAAM,CAAC;AACvB;AAOK,SAAS,0CAAM,SAAkB;IACtC,IAAI,CAAC,OAAO,SAAS,GAAG,CAAA,GAAA,eAAO,EAAE;IACjC,IAAI,SAAS,CAAA,GAAA,aAAK,EAAE;IAEpB,IAAI,MAAM,CAAA,GAAA,mBAAW,EAAE;IACvB,IAAI,aAAa,CAAA,GAAA,aAAK,EAAE;IAExB,IAAI,gCACF,+BAAS,QAAQ,CAAC,YAAY;IAGhC,IAAI,iCAAW;QACb,MAAM,aAAa,0CAAc,GAAG,CAAC;QACrC,IAAI,cAAc,CAAC,WAAW,QAAQ,CAAC,SACrC,WAAW,IAAI,CAAC;aAEhB,0CAAc,GAAG,CAAC,KAAK;YAAC;SAAO;IAEnC;IAEA,CAAA,GAAA,yCAAc,EAAE;QACd,IAAI,IAAI;QACR,OAAO;YACL,sDAAsD;YACtD,oEAAoE;YACpE,IAAI,gCACF,+BAAS,UAAU,CAAC;YAEtB,0CAAc,MAAM,CAAC;QACvB;IACF,GAAG;QAAC;KAAI;IAER,2EAA2E;IAC3E,2BAA2B;IAC3B,CAAA,GAAA,gBAAQ,EAAE;QACR,IAAI,QAAQ,OAAO,OAAO;QAC1B,IAAI,OAAS,SAAS;QAEtB,OAAO;YACL,IAAI,OAAS,OAAO,OAAO,GAAG;QAChC;IACF;IAEA,OAAO;AACT;AAMO,SAAS,0CAAS,GAAW,EAAE,GAAW;IAC/C,IAAI,QAAQ,KACV,OAAO;IAGT,IAAI,UAAU,0CAAc,GAAG,CAAC;IAChC,IAAI,SAAS;QACX,QAAQ,OAAO,CAAC,CAAA,MAAQ,IAAI,OAAO,GAAG;QACtC,OAAO;IACT;IAEA,IAAI,UAAU,0CAAc,GAAG,CAAC;IAChC,IAAI,SAAS;QACX,QAAQ,OAAO,CAAC,CAAC,MAAS,IAAI,OAAO,GAAG;QACxC,OAAO;IACT;IAEA,OAAO;AACT;AAOO,SAAS,0CAAU,WAA+B,EAAE;IACzD,IAAI,KAAK;IACT,IAAI,CAAC,YAAY,cAAc,GAAG,CAAA,GAAA,yCAAa,EAAE;IACjD,IAAI,WAAW,CAAA,GAAA,kBAAU,EAAE;QACzB,cAAc;YACZ,MAAM;YAEN,MAAM,SAAS,cAAc,CAAC,MAAM,KAAK;QAC3C;IACF,GAAG;QAAC;QAAI;KAAc;IAEtB,CAAA,GAAA,yCAAc,EAAE,UAAU;QAAC;QAAI;WAAa;KAAS;IAErD,OAAO;AACT","sources":["packages/@react-aria/utils/src/useId.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {useCallback, useEffect, useRef, useState} from 'react';\nimport {useLayoutEffect} from './useLayoutEffect';\nimport {useSSRSafeId} from '@react-aria/ssr';\nimport {useValueEffect} from './';\n\n// copied from SSRProvider.tsx to reduce exports, if needed again, consider sharing\nlet canUseDOM = Boolean(\n typeof window !== 'undefined' &&\n window.document &&\n window.document.createElement\n);\n\nexport let idsUpdaterMap: Map<string, { current: string | null }[]> = new Map();\n// This allows us to clean up the idsUpdaterMap when the id is no longer used.\n// Map is a strong reference, so unused ids wouldn't be cleaned up otherwise.\n// This can happen in suspended components where mount/unmount is not called.\nlet registry;\nif (typeof FinalizationRegistry !== 'undefined') {\n registry = new FinalizationRegistry<string>((heldValue) => {\n idsUpdaterMap.delete(heldValue);\n });\n}\n\n/**\n * If a default is not provided, generate an id.\n * @param defaultId - Default component id.\n */\nexport function useId(defaultId?: string): string {\n let [value, setValue] = useState(defaultId);\n let nextId = useRef(null);\n\n let res = useSSRSafeId(value);\n let cleanupRef = useRef(null);\n\n if (registry) {\n registry.register(cleanupRef, res);\n }\n\n if (canUseDOM) {\n const cacheIdRef = idsUpdaterMap.get(res);\n if (cacheIdRef && !cacheIdRef.includes(nextId)) {\n cacheIdRef.push(nextId);\n } else {\n idsUpdaterMap.set(res, [nextId]);\n }\n }\n\n useLayoutEffect(() => {\n let r = res;\n return () => {\n // In Suspense, the cleanup function may be not called\n // when it is though, also remove it from the finalization registry.\n if (registry) {\n registry.unregister(cleanupRef);\n }\n idsUpdaterMap.delete(r);\n };\n }, [res]);\n\n // This cannot cause an infinite loop because the ref is always cleaned up.\n // eslint-disable-next-line\n useEffect(() => {\n let newId = nextId.current;\n if (newId) { setValue(newId); }\n\n return () => {\n if (newId) { nextId.current = null; }\n };\n });\n\n return res;\n}\n\n/**\n * Merges two ids.\n * Different ids will trigger a side-effect and re-render components hooked up with `useId`.\n */\nexport function mergeIds(idA: string, idB: string): string {\n if (idA === idB) {\n return idA;\n }\n\n let setIdsA = idsUpdaterMap.get(idA);\n if (setIdsA) {\n setIdsA.forEach(ref => (ref.current = idB));\n return idB;\n }\n\n let setIdsB = idsUpdaterMap.get(idB);\n if (setIdsB) {\n setIdsB.forEach((ref) => (ref.current = idA));\n return idA;\n }\n\n return idB;\n}\n\n/**\n * Used to generate an id, and after render, check if that id is rendered so we know\n * if we can use it in places such as labelledby.\n * @param depArray - When to recalculate if the id is in the DOM.\n */\nexport function useSlotId(depArray: ReadonlyArray<any> = []): string {\n let id = useId();\n let [resolvedId, setResolvedId] = useValueEffect(id);\n let updateId = useCallback(() => {\n setResolvedId(function *() {\n yield id;\n\n yield document.getElementById(id) ? id : undefined;\n });\n }, [id, setResolvedId]);\n\n useLayoutEffect(updateId, [id, updateId, ...depArray]);\n\n return resolvedId;\n}\n"],"names":[],"version":3,"file":"useId.module.js.map"}
var $8c61827343eed941$exports = require("./useId.main.js");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useLabels", () => $6ec78bde395c477d$export$d6875122194c7b44);
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $6ec78bde395c477d$export$d6875122194c7b44(props, defaultLabel) {
let { id: id, 'aria-label': label, 'aria-labelledby': labelledBy } = props;
// If there is both an aria-label and aria-labelledby,
// combine them by pointing to the element itself.
id = (0, $8c61827343eed941$exports.useId)(id);
if (labelledBy && label) {
let ids = new Set([
id,
...labelledBy.trim().split(/\s+/)
]);
labelledBy = [
...ids
].join(' ');
} else if (labelledBy) labelledBy = labelledBy.trim().split(/\s+/).join(' ');
// If no labels are provided, use the default
if (!label && !labelledBy && defaultLabel) label = defaultLabel;
return {
id: id,
'aria-label': label,
'aria-labelledby': labelledBy
};
}
//# sourceMappingURL=useLabels.main.js.map
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;AAUM,SAAS,0CAAU,KAAmC,EAAE,YAAqB;IAClF,IAAI,MACF,EAAE,EACF,cAAc,KAAK,EACnB,mBAAmB,UAAU,EAC9B,GAAG;IAEJ,sDAAsD;IACtD,kDAAkD;IAClD,KAAK,CAAA,GAAA,+BAAI,EAAE;IACX,IAAI,cAAc,OAAO;QACvB,IAAI,MAAM,IAAI,IAAI;YAAC;eAAO,WAAW,IAAI,GAAG,KAAK,CAAC;SAAO;QACzD,aAAa;eAAI;SAAI,CAAC,IAAI,CAAC;IAC7B,OAAO,IAAI,YACT,aAAa,WAAW,IAAI,GAAG,KAAK,CAAC,OAAO,IAAI,CAAC;IAGnD,6CAA6C;IAC7C,IAAI,CAAC,SAAS,CAAC,cAAc,cAC3B,QAAQ;IAGV,OAAO;YACL;QACA,cAAc;QACd,mBAAmB;IACrB;AACF","sources":["packages/@react-aria/utils/src/useLabels.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMProps} from '@react-types/shared';\nimport {useId} from './useId';\n\n/**\n * Merges aria-label and aria-labelledby into aria-labelledby when both exist.\n * @param props - Aria label props.\n * @param defaultLabel - Default value for aria-label when not present.\n */\nexport function useLabels(props: DOMProps & AriaLabelingProps, defaultLabel?: string): DOMProps & AriaLabelingProps {\n let {\n id,\n 'aria-label': label,\n 'aria-labelledby': labelledBy\n } = props;\n\n // If there is both an aria-label and aria-labelledby,\n // combine them by pointing to the element itself.\n id = useId(id);\n if (labelledBy && label) {\n let ids = new Set([id, ...labelledBy.trim().split(/\\s+/)]);\n labelledBy = [...ids].join(' ');\n } else if (labelledBy) {\n labelledBy = labelledBy.trim().split(/\\s+/).join(' ');\n }\n\n // If no labels are provided, use the default\n if (!label && !labelledBy && defaultLabel) {\n label = defaultLabel;\n }\n\n return {\n id,\n 'aria-label': label,\n 'aria-labelledby': labelledBy\n };\n}\n"],"names":[],"version":3,"file":"useLabels.main.js.map"}
import {useId as $bdb11010cef70236$export$f680877a34711e37} from "./useId.mjs";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $313b98861ee5dd6c$export$d6875122194c7b44(props, defaultLabel) {
let { id: id, 'aria-label': label, 'aria-labelledby': labelledBy } = props;
// If there is both an aria-label and aria-labelledby,
// combine them by pointing to the element itself.
id = (0, $bdb11010cef70236$export$f680877a34711e37)(id);
if (labelledBy && label) {
let ids = new Set([
id,
...labelledBy.trim().split(/\s+/)
]);
labelledBy = [
...ids
].join(' ');
} else if (labelledBy) labelledBy = labelledBy.trim().split(/\s+/).join(' ');
// If no labels are provided, use the default
if (!label && !labelledBy && defaultLabel) label = defaultLabel;
return {
id: id,
'aria-label': label,
'aria-labelledby': labelledBy
};
}
export {$313b98861ee5dd6c$export$d6875122194c7b44 as useLabels};
//# sourceMappingURL=useLabels.module.js.map
import {useId as $bdb11010cef70236$export$f680877a34711e37} from "./useId.module.js";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $313b98861ee5dd6c$export$d6875122194c7b44(props, defaultLabel) {
let { id: id, 'aria-label': label, 'aria-labelledby': labelledBy } = props;
// If there is both an aria-label and aria-labelledby,
// combine them by pointing to the element itself.
id = (0, $bdb11010cef70236$export$f680877a34711e37)(id);
if (labelledBy && label) {
let ids = new Set([
id,
...labelledBy.trim().split(/\s+/)
]);
labelledBy = [
...ids
].join(' ');
} else if (labelledBy) labelledBy = labelledBy.trim().split(/\s+/).join(' ');
// If no labels are provided, use the default
if (!label && !labelledBy && defaultLabel) label = defaultLabel;
return {
id: id,
'aria-label': label,
'aria-labelledby': labelledBy
};
}
export {$313b98861ee5dd6c$export$d6875122194c7b44 as useLabels};
//# sourceMappingURL=useLabels.module.js.map
{"mappings":";;AAAA;;;;;;;;;;CAUC;AAUM,SAAS,0CAAU,KAAmC,EAAE,YAAqB;IAClF,IAAI,MACF,EAAE,EACF,cAAc,KAAK,EACnB,mBAAmB,UAAU,EAC9B,GAAG;IAEJ,sDAAsD;IACtD,kDAAkD;IAClD,KAAK,CAAA,GAAA,yCAAI,EAAE;IACX,IAAI,cAAc,OAAO;QACvB,IAAI,MAAM,IAAI,IAAI;YAAC;eAAO,WAAW,IAAI,GAAG,KAAK,CAAC;SAAO;QACzD,aAAa;eAAI;SAAI,CAAC,IAAI,CAAC;IAC7B,OAAO,IAAI,YACT,aAAa,WAAW,IAAI,GAAG,KAAK,CAAC,OAAO,IAAI,CAAC;IAGnD,6CAA6C;IAC7C,IAAI,CAAC,SAAS,CAAC,cAAc,cAC3B,QAAQ;IAGV,OAAO;YACL;QACA,cAAc;QACd,mBAAmB;IACrB;AACF","sources":["packages/@react-aria/utils/src/useLabels.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMProps} from '@react-types/shared';\nimport {useId} from './useId';\n\n/**\n * Merges aria-label and aria-labelledby into aria-labelledby when both exist.\n * @param props - Aria label props.\n * @param defaultLabel - Default value for aria-label when not present.\n */\nexport function useLabels(props: DOMProps & AriaLabelingProps, defaultLabel?: string): DOMProps & AriaLabelingProps {\n let {\n id,\n 'aria-label': label,\n 'aria-labelledby': labelledBy\n } = props;\n\n // If there is both an aria-label and aria-labelledby,\n // combine them by pointing to the element itself.\n id = useId(id);\n if (labelledBy && label) {\n let ids = new Set([id, ...labelledBy.trim().split(/\\s+/)]);\n labelledBy = [...ids].join(' ');\n } else if (labelledBy) {\n labelledBy = labelledBy.trim().split(/\\s+/).join(' ');\n }\n\n // If no labels are provided, use the default\n if (!label && !labelledBy && defaultLabel) {\n label = defaultLabel;\n }\n\n return {\n id,\n 'aria-label': label,\n 'aria-labelledby': labelledBy\n };\n}\n"],"names":[],"version":3,"file":"useLabels.module.js.map"}
var $ezjoC$react = require("react");
function $parcel$interopDefault(a) {
return a && a.__esModule ? a.default : a;
}
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useLayoutEffect", () => $78605a5d7424e31b$export$e5c5a5f917a5871c);
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
const $78605a5d7424e31b$export$e5c5a5f917a5871c = typeof document !== 'undefined' ? (0, ($parcel$interopDefault($ezjoC$react))).useLayoutEffect : ()=>{};
//# sourceMappingURL=useLayoutEffect.main.js.map
{"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;AAOM,MAAM,4CAAgD,OAAO,aAAa,cAC7E,CAAA,GAAA,sCAAI,EAAE,eAAe,GACrB,KAAO","sources":["packages/@react-aria/utils/src/useLayoutEffect.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport React from 'react';\n\n// During SSR, React emits a warning when calling useLayoutEffect.\n// Since neither useLayoutEffect nor useEffect run on the server,\n// we can suppress this by replace it with a noop on the server.\nexport const useLayoutEffect: typeof React.useLayoutEffect = typeof document !== 'undefined'\n ? React.useLayoutEffect\n : () => {};\n"],"names":[],"version":3,"file":"useLayoutEffect.main.js.map"}
import $HgANd$react from "react";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
const $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c = typeof document !== 'undefined' ? (0, $HgANd$react).useLayoutEffect : ()=>{};
export {$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c as useLayoutEffect};
//# sourceMappingURL=useLayoutEffect.module.js.map
import $HgANd$react from "react";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
const $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c = typeof document !== 'undefined' ? (0, $HgANd$react).useLayoutEffect : ()=>{};
export {$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c as useLayoutEffect};
//# sourceMappingURL=useLayoutEffect.module.js.map
{"mappings":";;AAAA;;;;;;;;;;CAUC;AAOM,MAAM,4CAAgD,OAAO,aAAa,cAC7E,CAAA,GAAA,YAAI,EAAE,eAAe,GACrB,KAAO","sources":["packages/@react-aria/utils/src/useLayoutEffect.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport React from 'react';\n\n// During SSR, React emits a warning when calling useLayoutEffect.\n// Since neither useLayoutEffect nor useEffect run on the server,\n// we can suppress this by replace it with a noop on the server.\nexport const useLayoutEffect: typeof React.useLayoutEffect = typeof document !== 'undefined'\n ? React.useLayoutEffect\n : () => {};\n"],"names":[],"version":3,"file":"useLayoutEffect.module.js.map"}
var $2a8c0bb1629926c8$exports = require("./useEvent.main.js");
var $78605a5d7424e31b$exports = require("./useLayoutEffect.main.js");
var $4Zukt$react = require("react");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useLoadMore", () => $faa6ccd6fb62f877$export$7717c92ee915373e);
/*
* Copyright 2024 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $faa6ccd6fb62f877$export$7717c92ee915373e(props, ref) {
let { isLoading: isLoading, onLoadMore: onLoadMore, scrollOffset: scrollOffset = 1, items: items } = props;
// Handle scrolling, and call onLoadMore when nearing the bottom.
let isLoadingRef = (0, $4Zukt$react.useRef)(isLoading);
let prevProps = (0, $4Zukt$react.useRef)(props);
let onScroll = (0, $4Zukt$react.useCallback)(()=>{
if (ref.current && !isLoadingRef.current && onLoadMore) {
let shouldLoadMore = ref.current.scrollHeight - ref.current.scrollTop - ref.current.clientHeight < ref.current.clientHeight * scrollOffset;
if (shouldLoadMore) {
isLoadingRef.current = true;
onLoadMore();
}
}
}, [
onLoadMore,
ref,
scrollOffset
]);
let lastItems = (0, $4Zukt$react.useRef)(items);
(0, $78605a5d7424e31b$exports.useLayoutEffect)(()=>{
// Only update isLoadingRef if props object actually changed,
// not if a local state change occurred.
if (props !== prevProps.current) {
isLoadingRef.current = isLoading;
prevProps.current = props;
}
// TODO: Eventually this hook will move back into RAC during which we will accept the collection as a option to this hook.
// We will only load more if the collection has changed after the last load to prevent multiple onLoadMore from being called
// while the data from the last onLoadMore is being processed by RAC collection.
let shouldLoadMore = (ref === null || ref === void 0 ? void 0 : ref.current) && !isLoadingRef.current && onLoadMore && (!items || items !== lastItems.current) && ref.current.clientHeight === ref.current.scrollHeight;
if (shouldLoadMore) {
isLoadingRef.current = true;
onLoadMore === null || onLoadMore === void 0 ? void 0 : onLoadMore();
}
lastItems.current = items;
}, [
isLoading,
onLoadMore,
props,
ref,
items
]);
// TODO: maybe this should still just return scroll props?
// Test against case where the ref isn't defined when this is called
// Think this was a problem when trying to attach to the scrollable body of the table in OnLoadMoreTableBodyScroll
(0, $2a8c0bb1629926c8$exports.useEvent)(ref, 'scroll', onScroll);
}
//# sourceMappingURL=useLoadMore.main.js.map
{"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAwBM,SAAS,0CAAY,KAAoB,EAAE,GAAkC;IAClF,IAAI,aAAC,SAAS,cAAE,UAAU,gBAAE,eAAe,UAAG,KAAK,EAAC,GAAG;IAEvD,iEAAiE;IACjE,IAAI,eAAe,CAAA,GAAA,mBAAK,EAAE;IAC1B,IAAI,YAAY,CAAA,GAAA,mBAAK,EAAE;IACvB,IAAI,WAAW,CAAA,GAAA,wBAAU,EAAE;QACzB,IAAI,IAAI,OAAO,IAAI,CAAC,aAAa,OAAO,IAAI,YAAY;YACtD,IAAI,iBAAiB,IAAI,OAAO,CAAC,YAAY,GAAG,IAAI,OAAO,CAAC,SAAS,GAAG,IAAI,OAAO,CAAC,YAAY,GAAG,IAAI,OAAO,CAAC,YAAY,GAAG;YAE9H,IAAI,gBAAgB;gBAClB,aAAa,OAAO,GAAG;gBACvB;YACF;QACF;IACF,GAAG;QAAC;QAAY;QAAK;KAAa;IAElC,IAAI,YAAY,CAAA,GAAA,mBAAK,EAAE;IACvB,CAAA,GAAA,yCAAc,EAAE;QACd,6DAA6D;QAC7D,wCAAwC;QACxC,IAAI,UAAU,UAAU,OAAO,EAAE;YAC/B,aAAa,OAAO,GAAG;YACvB,UAAU,OAAO,GAAG;QACtB;QAEA,0HAA0H;QAC1H,4HAA4H;QAC5H,gFAAgF;QAChF,IAAI,iBAAiB,CAAA,gBAAA,0BAAA,IAAK,OAAO,KAC5B,CAAC,aAAa,OAAO,IACrB,cACC,CAAA,CAAC,SAAS,UAAU,UAAU,OAAO,AAAD,KACrC,IAAI,OAAO,CAAC,YAAY,KAAK,IAAI,OAAO,CAAC,YAAY;QAE1D,IAAI,gBAAgB;YAClB,aAAa,OAAO,GAAG;YACvB,uBAAA,iCAAA;QACF;QAEA,UAAU,OAAO,GAAG;IACtB,GAAG;QAAC;QAAW;QAAY;QAAO;QAAK;KAAM;IAE7C,0DAA0D;IAC1D,oEAAoE;IACpE,kHAAkH;IAClH,CAAA,GAAA,kCAAO,EAAE,KAAK,UAAU;AAC1B","sources":["packages/@react-aria/utils/src/useLoadMore.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {RefObject, useCallback, useRef} from 'react';\nimport {useEvent} from './useEvent';\n\nimport {useLayoutEffect} from './useLayoutEffect';\n\nexport interface LoadMoreProps {\n /** Whether data is currently being loaded. */\n isLoading?: boolean,\n /** Handler that is called when more items should be loaded, e.g. while scrolling near the bottom. */\n onLoadMore?: () => void,\n /**\n * The amount of offset from the bottom of your scrollable region that should trigger load more.\n * Uses a percentage value relative to the scroll body's client height. Load more is then triggered\n * when your current scroll position's distance from the bottom of the currently loaded list of items is less than\n * or equal to the provided value. (e.g. 1 = 100% of the scroll region's height).\n * @default 1\n */\n scrollOffset?: number,\n /** The data currently loaded. */\n items?: any\n}\n\nexport function useLoadMore(props: LoadMoreProps, ref: RefObject<HTMLElement | null>): void {\n let {isLoading, onLoadMore, scrollOffset = 1, items} = props;\n\n // Handle scrolling, and call onLoadMore when nearing the bottom.\n let isLoadingRef = useRef(isLoading);\n let prevProps = useRef(props);\n let onScroll = useCallback(() => {\n if (ref.current && !isLoadingRef.current && onLoadMore) {\n let shouldLoadMore = ref.current.scrollHeight - ref.current.scrollTop - ref.current.clientHeight < ref.current.clientHeight * scrollOffset;\n\n if (shouldLoadMore) {\n isLoadingRef.current = true;\n onLoadMore();\n }\n }\n }, [onLoadMore, ref, scrollOffset]);\n\n let lastItems = useRef(items);\n useLayoutEffect(() => {\n // Only update isLoadingRef if props object actually changed,\n // not if a local state change occurred.\n if (props !== prevProps.current) {\n isLoadingRef.current = isLoading;\n prevProps.current = props;\n }\n\n // TODO: Eventually this hook will move back into RAC during which we will accept the collection as a option to this hook.\n // We will only load more if the collection has changed after the last load to prevent multiple onLoadMore from being called\n // while the data from the last onLoadMore is being processed by RAC collection.\n let shouldLoadMore = ref?.current\n && !isLoadingRef.current\n && onLoadMore\n && (!items || items !== lastItems.current)\n && ref.current.clientHeight === ref.current.scrollHeight;\n\n if (shouldLoadMore) {\n isLoadingRef.current = true;\n onLoadMore?.();\n }\n\n lastItems.current = items;\n }, [isLoading, onLoadMore, props, ref, items]);\n\n // TODO: maybe this should still just return scroll props?\n // Test against case where the ref isn't defined when this is called\n // Think this was a problem when trying to attach to the scrollable body of the table in OnLoadMoreTableBodyScroll\n useEvent(ref, 'scroll', onScroll);\n}\n"],"names":[],"version":3,"file":"useLoadMore.main.js.map"}
import {useEvent as $e9faafb641e167db$export$90fc3a17d93f704c} from "./useEvent.mjs";
import {useLayoutEffect as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c} from "./useLayoutEffect.mjs";
import {useRef as $hDRkU$useRef, useCallback as $hDRkU$useCallback} from "react";
/*
* Copyright 2024 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $26f7f3da73fcd9d6$export$7717c92ee915373e(props, ref) {
let { isLoading: isLoading, onLoadMore: onLoadMore, scrollOffset: scrollOffset = 1, items: items } = props;
// Handle scrolling, and call onLoadMore when nearing the bottom.
let isLoadingRef = (0, $hDRkU$useRef)(isLoading);
let prevProps = (0, $hDRkU$useRef)(props);
let onScroll = (0, $hDRkU$useCallback)(()=>{
if (ref.current && !isLoadingRef.current && onLoadMore) {
let shouldLoadMore = ref.current.scrollHeight - ref.current.scrollTop - ref.current.clientHeight < ref.current.clientHeight * scrollOffset;
if (shouldLoadMore) {
isLoadingRef.current = true;
onLoadMore();
}
}
}, [
onLoadMore,
ref,
scrollOffset
]);
let lastItems = (0, $hDRkU$useRef)(items);
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
// Only update isLoadingRef if props object actually changed,
// not if a local state change occurred.
if (props !== prevProps.current) {
isLoadingRef.current = isLoading;
prevProps.current = props;
}
// TODO: Eventually this hook will move back into RAC during which we will accept the collection as a option to this hook.
// We will only load more if the collection has changed after the last load to prevent multiple onLoadMore from being called
// while the data from the last onLoadMore is being processed by RAC collection.
let shouldLoadMore = (ref === null || ref === void 0 ? void 0 : ref.current) && !isLoadingRef.current && onLoadMore && (!items || items !== lastItems.current) && ref.current.clientHeight === ref.current.scrollHeight;
if (shouldLoadMore) {
isLoadingRef.current = true;
onLoadMore === null || onLoadMore === void 0 ? void 0 : onLoadMore();
}
lastItems.current = items;
}, [
isLoading,
onLoadMore,
props,
ref,
items
]);
// TODO: maybe this should still just return scroll props?
// Test against case where the ref isn't defined when this is called
// Think this was a problem when trying to attach to the scrollable body of the table in OnLoadMoreTableBodyScroll
(0, $e9faafb641e167db$export$90fc3a17d93f704c)(ref, 'scroll', onScroll);
}
export {$26f7f3da73fcd9d6$export$7717c92ee915373e as useLoadMore};
//# sourceMappingURL=useLoadMore.module.js.map
import {useEvent as $e9faafb641e167db$export$90fc3a17d93f704c} from "./useEvent.module.js";
import {useLayoutEffect as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c} from "./useLayoutEffect.module.js";
import {useRef as $hDRkU$useRef, useCallback as $hDRkU$useCallback} from "react";
/*
* Copyright 2024 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $26f7f3da73fcd9d6$export$7717c92ee915373e(props, ref) {
let { isLoading: isLoading, onLoadMore: onLoadMore, scrollOffset: scrollOffset = 1, items: items } = props;
// Handle scrolling, and call onLoadMore when nearing the bottom.
let isLoadingRef = (0, $hDRkU$useRef)(isLoading);
let prevProps = (0, $hDRkU$useRef)(props);
let onScroll = (0, $hDRkU$useCallback)(()=>{
if (ref.current && !isLoadingRef.current && onLoadMore) {
let shouldLoadMore = ref.current.scrollHeight - ref.current.scrollTop - ref.current.clientHeight < ref.current.clientHeight * scrollOffset;
if (shouldLoadMore) {
isLoadingRef.current = true;
onLoadMore();
}
}
}, [
onLoadMore,
ref,
scrollOffset
]);
let lastItems = (0, $hDRkU$useRef)(items);
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
// Only update isLoadingRef if props object actually changed,
// not if a local state change occurred.
if (props !== prevProps.current) {
isLoadingRef.current = isLoading;
prevProps.current = props;
}
// TODO: Eventually this hook will move back into RAC during which we will accept the collection as a option to this hook.
// We will only load more if the collection has changed after the last load to prevent multiple onLoadMore from being called
// while the data from the last onLoadMore is being processed by RAC collection.
let shouldLoadMore = (ref === null || ref === void 0 ? void 0 : ref.current) && !isLoadingRef.current && onLoadMore && (!items || items !== lastItems.current) && ref.current.clientHeight === ref.current.scrollHeight;
if (shouldLoadMore) {
isLoadingRef.current = true;
onLoadMore === null || onLoadMore === void 0 ? void 0 : onLoadMore();
}
lastItems.current = items;
}, [
isLoading,
onLoadMore,
props,
ref,
items
]);
// TODO: maybe this should still just return scroll props?
// Test against case where the ref isn't defined when this is called
// Think this was a problem when trying to attach to the scrollable body of the table in OnLoadMoreTableBodyScroll
(0, $e9faafb641e167db$export$90fc3a17d93f704c)(ref, 'scroll', onScroll);
}
export {$26f7f3da73fcd9d6$export$7717c92ee915373e as useLoadMore};
//# sourceMappingURL=useLoadMore.module.js.map
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAwBM,SAAS,0CAAY,KAAoB,EAAE,GAAkC;IAClF,IAAI,aAAC,SAAS,cAAE,UAAU,gBAAE,eAAe,UAAG,KAAK,EAAC,GAAG;IAEvD,iEAAiE;IACjE,IAAI,eAAe,CAAA,GAAA,aAAK,EAAE;IAC1B,IAAI,YAAY,CAAA,GAAA,aAAK,EAAE;IACvB,IAAI,WAAW,CAAA,GAAA,kBAAU,EAAE;QACzB,IAAI,IAAI,OAAO,IAAI,CAAC,aAAa,OAAO,IAAI,YAAY;YACtD,IAAI,iBAAiB,IAAI,OAAO,CAAC,YAAY,GAAG,IAAI,OAAO,CAAC,SAAS,GAAG,IAAI,OAAO,CAAC,YAAY,GAAG,IAAI,OAAO,CAAC,YAAY,GAAG;YAE9H,IAAI,gBAAgB;gBAClB,aAAa,OAAO,GAAG;gBACvB;YACF;QACF;IACF,GAAG;QAAC;QAAY;QAAK;KAAa;IAElC,IAAI,YAAY,CAAA,GAAA,aAAK,EAAE;IACvB,CAAA,GAAA,yCAAc,EAAE;QACd,6DAA6D;QAC7D,wCAAwC;QACxC,IAAI,UAAU,UAAU,OAAO,EAAE;YAC/B,aAAa,OAAO,GAAG;YACvB,UAAU,OAAO,GAAG;QACtB;QAEA,0HAA0H;QAC1H,4HAA4H;QAC5H,gFAAgF;QAChF,IAAI,iBAAiB,CAAA,gBAAA,0BAAA,IAAK,OAAO,KAC5B,CAAC,aAAa,OAAO,IACrB,cACC,CAAA,CAAC,SAAS,UAAU,UAAU,OAAO,AAAD,KACrC,IAAI,OAAO,CAAC,YAAY,KAAK,IAAI,OAAO,CAAC,YAAY;QAE1D,IAAI,gBAAgB;YAClB,aAAa,OAAO,GAAG;YACvB,uBAAA,iCAAA;QACF;QAEA,UAAU,OAAO,GAAG;IACtB,GAAG;QAAC;QAAW;QAAY;QAAO;QAAK;KAAM;IAE7C,0DAA0D;IAC1D,oEAAoE;IACpE,kHAAkH;IAClH,CAAA,GAAA,yCAAO,EAAE,KAAK,UAAU;AAC1B","sources":["packages/@react-aria/utils/src/useLoadMore.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {RefObject, useCallback, useRef} from 'react';\nimport {useEvent} from './useEvent';\n\nimport {useLayoutEffect} from './useLayoutEffect';\n\nexport interface LoadMoreProps {\n /** Whether data is currently being loaded. */\n isLoading?: boolean,\n /** Handler that is called when more items should be loaded, e.g. while scrolling near the bottom. */\n onLoadMore?: () => void,\n /**\n * The amount of offset from the bottom of your scrollable region that should trigger load more.\n * Uses a percentage value relative to the scroll body's client height. Load more is then triggered\n * when your current scroll position's distance from the bottom of the currently loaded list of items is less than\n * or equal to the provided value. (e.g. 1 = 100% of the scroll region's height).\n * @default 1\n */\n scrollOffset?: number,\n /** The data currently loaded. */\n items?: any\n}\n\nexport function useLoadMore(props: LoadMoreProps, ref: RefObject<HTMLElement | null>): void {\n let {isLoading, onLoadMore, scrollOffset = 1, items} = props;\n\n // Handle scrolling, and call onLoadMore when nearing the bottom.\n let isLoadingRef = useRef(isLoading);\n let prevProps = useRef(props);\n let onScroll = useCallback(() => {\n if (ref.current && !isLoadingRef.current && onLoadMore) {\n let shouldLoadMore = ref.current.scrollHeight - ref.current.scrollTop - ref.current.clientHeight < ref.current.clientHeight * scrollOffset;\n\n if (shouldLoadMore) {\n isLoadingRef.current = true;\n onLoadMore();\n }\n }\n }, [onLoadMore, ref, scrollOffset]);\n\n let lastItems = useRef(items);\n useLayoutEffect(() => {\n // Only update isLoadingRef if props object actually changed,\n // not if a local state change occurred.\n if (props !== prevProps.current) {\n isLoadingRef.current = isLoading;\n prevProps.current = props;\n }\n\n // TODO: Eventually this hook will move back into RAC during which we will accept the collection as a option to this hook.\n // We will only load more if the collection has changed after the last load to prevent multiple onLoadMore from being called\n // while the data from the last onLoadMore is being processed by RAC collection.\n let shouldLoadMore = ref?.current\n && !isLoadingRef.current\n && onLoadMore\n && (!items || items !== lastItems.current)\n && ref.current.clientHeight === ref.current.scrollHeight;\n\n if (shouldLoadMore) {\n isLoadingRef.current = true;\n onLoadMore?.();\n }\n\n lastItems.current = items;\n }, [isLoading, onLoadMore, props, ref, items]);\n\n // TODO: maybe this should still just return scroll props?\n // Test against case where the ref isn't defined when this is called\n // Think this was a problem when trying to attach to the scrollable body of the table in OnLoadMoreTableBodyScroll\n useEvent(ref, 'scroll', onScroll);\n}\n"],"names":[],"version":3,"file":"useLoadMore.module.js.map"}
var $d796e7157ac96470$exports = require("./getScrollParent.main.js");
var $1254e5bb94ac8761$exports = require("./useEffectEvent.main.js");
var $78605a5d7424e31b$exports = require("./useLayoutEffect.main.js");
var $8Ncyo$react = require("react");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useLoadMoreSentinel", () => $f6a4874a7c582761$export$ccaea96c28e8b9e7);
/*
* Copyright 2024 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $f6a4874a7c582761$export$ccaea96c28e8b9e7(props, ref) {
let { collection: collection, onLoadMore: onLoadMore, scrollOffset: scrollOffset = 1 } = props;
let sentinelObserver = (0, $8Ncyo$react.useRef)(null);
let triggerLoadMore = (0, $1254e5bb94ac8761$exports.useEffectEvent)((entries)=>{
// Use "isIntersecting" over an equality check of 0 since it seems like there is cases where
// a intersection ratio of 0 can be reported when isIntersecting is actually true
for (let entry of entries)// Note that this will be called if the collection changes, even if onLoadMore was already called and is being processed.
// Up to user discretion as to how to handle these multiple onLoadMore calls
if (entry.isIntersecting && onLoadMore) onLoadMore();
});
(0, $78605a5d7424e31b$exports.useLayoutEffect)(()=>{
if (ref.current) {
// Tear down and set up a new IntersectionObserver when the collection changes so that we can properly trigger additional loadMores if there is room for more items
// Need to do this tear down and set up since using a large rootMargin will mean the observer's callback isn't called even when scrolling the item into view beause its visibility hasn't actually changed
// https://codesandbox.io/p/sandbox/magical-swanson-dhgp89?file=%2Fsrc%2FApp.js%3A21%2C21
sentinelObserver.current = new IntersectionObserver(triggerLoadMore, {
root: (0, $d796e7157ac96470$exports.getScrollParent)(ref === null || ref === void 0 ? void 0 : ref.current),
rootMargin: `0px ${100 * scrollOffset}% ${100 * scrollOffset}% ${100 * scrollOffset}%`
});
sentinelObserver.current.observe(ref.current);
}
return ()=>{
if (sentinelObserver.current) sentinelObserver.current.disconnect();
};
}, [
collection,
ref,
scrollOffset
]);
}
//# sourceMappingURL=useLoadMoreSentinel.main.js.map
{"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAoBM,SAAS,0CAAoB,KAA4B,EAAE,GAAkC;IAClG,IAAI,cAAC,UAAU,cAAE,UAAU,gBAAE,eAAe,GAAE,GAAG;IAEjD,IAAI,mBAAmB,CAAA,GAAA,mBAAK,EAAwB;IAEpD,IAAI,kBAAkB,CAAA,GAAA,wCAAa,EAAE,CAAC;QACpC,4FAA4F;QAC5F,iFAAiF;QACjF,KAAK,IAAI,SAAS,QAChB,yHAAyH;QACzH,4EAA4E;QAC5E,IAAI,MAAM,cAAc,IAAI,YAC1B;IAGN;IAEA,CAAA,GAAA,yCAAc,EAAE;QACd,IAAI,IAAI,OAAO,EAAE;YACf,mKAAmK;YACnK,0MAA0M;YAC1M,yFAAyF;YACzF,iBAAiB,OAAO,GAAG,IAAI,qBAAqB,iBAAiB;gBAAC,MAAM,CAAA,GAAA,yCAAc,EAAE,gBAAA,0BAAA,IAAK,OAAO;gBAAkB,YAAY,CAAC,IAAI,EAAE,MAAM,aAAa,EAAE,EAAE,MAAM,aAAa,EAAE,EAAE,MAAM,aAAa,CAAC,CAAC;YAAA;YAChN,iBAAiB,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO;QAC9C;QAEA,OAAO;YACL,IAAI,iBAAiB,OAAO,EAC1B,iBAAiB,OAAO,CAAC,UAAU;QAEvC;IACF,GAAG;QAAC;QAAY;QAAK;KAAa;AACpC","sources":["packages/@react-aria/utils/src/useLoadMoreSentinel.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type {AsyncLoadable, Collection} from '@react-types/shared';\nimport {getScrollParent} from './getScrollParent';\nimport {RefObject, useRef} from 'react';\nimport {useEffectEvent} from './useEffectEvent';\nimport {useLayoutEffect} from './useLayoutEffect';\n\nexport interface LoadMoreSentinelProps extends Omit<AsyncLoadable, 'isLoading'> {\n collection: Collection<any>,\n /**\n * The amount of offset from the bottom of your scrollable region that should trigger load more.\n * Uses a percentage value relative to the scroll body's client height. Load more is then triggered\n * when your current scroll position's distance from the bottom of the currently loaded list of items is less than\n * or equal to the provided value. (e.g. 1 = 100% of the scroll region's height).\n * @default 1\n */\n scrollOffset?: number\n}\n\nexport function useLoadMoreSentinel(props: LoadMoreSentinelProps, ref: RefObject<HTMLElement | null>): void {\n let {collection, onLoadMore, scrollOffset = 1} = props;\n\n let sentinelObserver = useRef<IntersectionObserver>(null);\n\n let triggerLoadMore = useEffectEvent((entries: IntersectionObserverEntry[]) => {\n // Use \"isIntersecting\" over an equality check of 0 since it seems like there is cases where\n // a intersection ratio of 0 can be reported when isIntersecting is actually true\n for (let entry of entries) {\n // Note that this will be called if the collection changes, even if onLoadMore was already called and is being processed.\n // Up to user discretion as to how to handle these multiple onLoadMore calls\n if (entry.isIntersecting && onLoadMore) {\n onLoadMore();\n }\n }\n });\n\n useLayoutEffect(() => {\n if (ref.current) {\n // Tear down and set up a new IntersectionObserver when the collection changes so that we can properly trigger additional loadMores if there is room for more items\n // Need to do this tear down and set up since using a large rootMargin will mean the observer's callback isn't called even when scrolling the item into view beause its visibility hasn't actually changed\n // https://codesandbox.io/p/sandbox/magical-swanson-dhgp89?file=%2Fsrc%2FApp.js%3A21%2C21\n sentinelObserver.current = new IntersectionObserver(triggerLoadMore, {root: getScrollParent(ref?.current) as HTMLElement, rootMargin: `0px ${100 * scrollOffset}% ${100 * scrollOffset}% ${100 * scrollOffset}%`});\n sentinelObserver.current.observe(ref.current);\n }\n\n return () => {\n if (sentinelObserver.current) {\n sentinelObserver.current.disconnect();\n }\n };\n }, [collection, ref, scrollOffset]);\n}\n"],"names":[],"version":3,"file":"useLoadMoreSentinel.main.js.map"}
import {getScrollParent as $62d8ded9296f3872$export$cfa2225e87938781} from "./getScrollParent.mjs";
import {useEffectEvent as $8ae05eaa5c114e9c$export$7f54fc3180508a52} from "./useEffectEvent.mjs";
import {useLayoutEffect as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c} from "./useLayoutEffect.mjs";
import {useRef as $7FoZl$useRef} from "react";
/*
* Copyright 2024 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $a5fa973c1850dd36$export$ccaea96c28e8b9e7(props, ref) {
let { collection: collection, onLoadMore: onLoadMore, scrollOffset: scrollOffset = 1 } = props;
let sentinelObserver = (0, $7FoZl$useRef)(null);
let triggerLoadMore = (0, $8ae05eaa5c114e9c$export$7f54fc3180508a52)((entries)=>{
// Use "isIntersecting" over an equality check of 0 since it seems like there is cases where
// a intersection ratio of 0 can be reported when isIntersecting is actually true
for (let entry of entries)// Note that this will be called if the collection changes, even if onLoadMore was already called and is being processed.
// Up to user discretion as to how to handle these multiple onLoadMore calls
if (entry.isIntersecting && onLoadMore) onLoadMore();
});
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
if (ref.current) {
// Tear down and set up a new IntersectionObserver when the collection changes so that we can properly trigger additional loadMores if there is room for more items
// Need to do this tear down and set up since using a large rootMargin will mean the observer's callback isn't called even when scrolling the item into view beause its visibility hasn't actually changed
// https://codesandbox.io/p/sandbox/magical-swanson-dhgp89?file=%2Fsrc%2FApp.js%3A21%2C21
sentinelObserver.current = new IntersectionObserver(triggerLoadMore, {
root: (0, $62d8ded9296f3872$export$cfa2225e87938781)(ref === null || ref === void 0 ? void 0 : ref.current),
rootMargin: `0px ${100 * scrollOffset}% ${100 * scrollOffset}% ${100 * scrollOffset}%`
});
sentinelObserver.current.observe(ref.current);
}
return ()=>{
if (sentinelObserver.current) sentinelObserver.current.disconnect();
};
}, [
collection,
ref,
scrollOffset
]);
}
export {$a5fa973c1850dd36$export$ccaea96c28e8b9e7 as useLoadMoreSentinel};
//# sourceMappingURL=useLoadMoreSentinel.module.js.map
import {getScrollParent as $62d8ded9296f3872$export$cfa2225e87938781} from "./getScrollParent.module.js";
import {useEffectEvent as $8ae05eaa5c114e9c$export$7f54fc3180508a52} from "./useEffectEvent.module.js";
import {useLayoutEffect as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c} from "./useLayoutEffect.module.js";
import {useRef as $7FoZl$useRef} from "react";
/*
* Copyright 2024 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $a5fa973c1850dd36$export$ccaea96c28e8b9e7(props, ref) {
let { collection: collection, onLoadMore: onLoadMore, scrollOffset: scrollOffset = 1 } = props;
let sentinelObserver = (0, $7FoZl$useRef)(null);
let triggerLoadMore = (0, $8ae05eaa5c114e9c$export$7f54fc3180508a52)((entries)=>{
// Use "isIntersecting" over an equality check of 0 since it seems like there is cases where
// a intersection ratio of 0 can be reported when isIntersecting is actually true
for (let entry of entries)// Note that this will be called if the collection changes, even if onLoadMore was already called and is being processed.
// Up to user discretion as to how to handle these multiple onLoadMore calls
if (entry.isIntersecting && onLoadMore) onLoadMore();
});
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
if (ref.current) {
// Tear down and set up a new IntersectionObserver when the collection changes so that we can properly trigger additional loadMores if there is room for more items
// Need to do this tear down and set up since using a large rootMargin will mean the observer's callback isn't called even when scrolling the item into view beause its visibility hasn't actually changed
// https://codesandbox.io/p/sandbox/magical-swanson-dhgp89?file=%2Fsrc%2FApp.js%3A21%2C21
sentinelObserver.current = new IntersectionObserver(triggerLoadMore, {
root: (0, $62d8ded9296f3872$export$cfa2225e87938781)(ref === null || ref === void 0 ? void 0 : ref.current),
rootMargin: `0px ${100 * scrollOffset}% ${100 * scrollOffset}% ${100 * scrollOffset}%`
});
sentinelObserver.current.observe(ref.current);
}
return ()=>{
if (sentinelObserver.current) sentinelObserver.current.disconnect();
};
}, [
collection,
ref,
scrollOffset
]);
}
export {$a5fa973c1850dd36$export$ccaea96c28e8b9e7 as useLoadMoreSentinel};
//# sourceMappingURL=useLoadMoreSentinel.module.js.map
{"mappings":";;;;;AAAA;;;;;;;;;;CAUC;;;;AAoBM,SAAS,0CAAoB,KAA4B,EAAE,GAAkC;IAClG,IAAI,cAAC,UAAU,cAAE,UAAU,gBAAE,eAAe,GAAE,GAAG;IAEjD,IAAI,mBAAmB,CAAA,GAAA,aAAK,EAAwB;IAEpD,IAAI,kBAAkB,CAAA,GAAA,yCAAa,EAAE,CAAC;QACpC,4FAA4F;QAC5F,iFAAiF;QACjF,KAAK,IAAI,SAAS,QAChB,yHAAyH;QACzH,4EAA4E;QAC5E,IAAI,MAAM,cAAc,IAAI,YAC1B;IAGN;IAEA,CAAA,GAAA,yCAAc,EAAE;QACd,IAAI,IAAI,OAAO,EAAE;YACf,mKAAmK;YACnK,0MAA0M;YAC1M,yFAAyF;YACzF,iBAAiB,OAAO,GAAG,IAAI,qBAAqB,iBAAiB;gBAAC,MAAM,CAAA,GAAA,yCAAc,EAAE,gBAAA,0BAAA,IAAK,OAAO;gBAAkB,YAAY,CAAC,IAAI,EAAE,MAAM,aAAa,EAAE,EAAE,MAAM,aAAa,EAAE,EAAE,MAAM,aAAa,CAAC,CAAC;YAAA;YAChN,iBAAiB,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO;QAC9C;QAEA,OAAO;YACL,IAAI,iBAAiB,OAAO,EAC1B,iBAAiB,OAAO,CAAC,UAAU;QAEvC;IACF,GAAG;QAAC;QAAY;QAAK;KAAa;AACpC","sources":["packages/@react-aria/utils/src/useLoadMoreSentinel.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type {AsyncLoadable, Collection} from '@react-types/shared';\nimport {getScrollParent} from './getScrollParent';\nimport {RefObject, useRef} from 'react';\nimport {useEffectEvent} from './useEffectEvent';\nimport {useLayoutEffect} from './useLayoutEffect';\n\nexport interface LoadMoreSentinelProps extends Omit<AsyncLoadable, 'isLoading'> {\n collection: Collection<any>,\n /**\n * The amount of offset from the bottom of your scrollable region that should trigger load more.\n * Uses a percentage value relative to the scroll body's client height. Load more is then triggered\n * when your current scroll position's distance from the bottom of the currently loaded list of items is less than\n * or equal to the provided value. (e.g. 1 = 100% of the scroll region's height).\n * @default 1\n */\n scrollOffset?: number\n}\n\nexport function useLoadMoreSentinel(props: LoadMoreSentinelProps, ref: RefObject<HTMLElement | null>): void {\n let {collection, onLoadMore, scrollOffset = 1} = props;\n\n let sentinelObserver = useRef<IntersectionObserver>(null);\n\n let triggerLoadMore = useEffectEvent((entries: IntersectionObserverEntry[]) => {\n // Use \"isIntersecting\" over an equality check of 0 since it seems like there is cases where\n // a intersection ratio of 0 can be reported when isIntersecting is actually true\n for (let entry of entries) {\n // Note that this will be called if the collection changes, even if onLoadMore was already called and is being processed.\n // Up to user discretion as to how to handle these multiple onLoadMore calls\n if (entry.isIntersecting && onLoadMore) {\n onLoadMore();\n }\n }\n });\n\n useLayoutEffect(() => {\n if (ref.current) {\n // Tear down and set up a new IntersectionObserver when the collection changes so that we can properly trigger additional loadMores if there is room for more items\n // Need to do this tear down and set up since using a large rootMargin will mean the observer's callback isn't called even when scrolling the item into view beause its visibility hasn't actually changed\n // https://codesandbox.io/p/sandbox/magical-swanson-dhgp89?file=%2Fsrc%2FApp.js%3A21%2C21\n sentinelObserver.current = new IntersectionObserver(triggerLoadMore, {root: getScrollParent(ref?.current) as HTMLElement, rootMargin: `0px ${100 * scrollOffset}% ${100 * scrollOffset}% ${100 * scrollOffset}%`});\n sentinelObserver.current.observe(ref.current);\n }\n\n return () => {\n if (sentinelObserver.current) {\n sentinelObserver.current.disconnect();\n }\n };\n }, [collection, ref, scrollOffset]);\n}\n"],"names":[],"version":3,"file":"useLoadMoreSentinel.module.js.map"}
var $eMoU1$react = require("react");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useObjectRef", () => $475b35fe72ba49b3$export$4338b53315abf666);
/*
* Copyright 2021 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $475b35fe72ba49b3$export$4338b53315abf666(ref) {
const objRef = (0, $eMoU1$react.useRef)(null);
const cleanupRef = (0, $eMoU1$react.useRef)(undefined);
const refEffect = (0, $eMoU1$react.useCallback)((instance)=>{
if (typeof ref === 'function') {
const refCallback = ref;
const refCleanup = refCallback(instance);
return ()=>{
if (typeof refCleanup === 'function') refCleanup();
else refCallback(null);
};
} else if (ref) {
ref.current = instance;
return ()=>{
ref.current = null;
};
}
}, [
ref
]);
return (0, $eMoU1$react.useMemo)(()=>({
get current () {
return objRef.current;
},
set current (value){
objRef.current = value;
if (cleanupRef.current) {
cleanupRef.current();
cleanupRef.current = undefined;
}
if (value != null) cleanupRef.current = refEffect(value);
}
}), [
refEffect
]);
}
//# sourceMappingURL=useObjectRef.main.js.map
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;AAaM,SAAS,0CAAgB,GAAuF;IACrH,MAAM,SAAqC,CAAA,GAAA,mBAAK,EAAK;IACrD,MAAM,aAAoD,CAAA,GAAA,mBAAK,EAAE;IAEjE,MAAM,YAAY,CAAA,GAAA,wBAAU,EAC1B,CAAC;QACC,IAAI,OAAO,QAAQ,YAAY;YAC7B,MAAM,cAAc;YACpB,MAAM,aAAa,YAAY;YAC/B,OAAO;gBACL,IAAI,OAAO,eAAe,YACxB;qBAEA,YAAY;YAEhB;QACF,OAAO,IAAI,KAAK;YACd,IAAI,OAAO,GAAG;YACd,OAAO;gBACL,IAAI,OAAO,GAAG;YAChB;QACF;IACF,GACA;QAAC;KAAI;IAGP,OAAO,CAAA,GAAA,oBAAM,EACX,IAAO,CAAA;YACL,IAAI,WAAU;gBACZ,OAAO,OAAO,OAAO;YACvB;YACA,IAAI,SAAQ,MAAO;gBACjB,OAAO,OAAO,GAAG;gBACjB,IAAI,WAAW,OAAO,EAAE;oBACtB,WAAW,OAAO;oBAClB,WAAW,OAAO,GAAG;gBACvB;gBAEA,IAAI,SAAS,MACX,WAAW,OAAO,GAAG,UAAU;YAEnC;QACF,CAAA,GACA;QAAC;KAAU;AAEf","sources":["packages/@react-aria/utils/src/useObjectRef.ts"],"sourcesContent":["/*\n * Copyright 2021 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {MutableRefObject, useCallback, useMemo, useRef} from 'react';\n\n/**\n * Offers an object ref for a given callback ref or an object ref. Especially\n * helfpul when passing forwarded refs (created using `React.forwardRef`) to\n * React Aria hooks.\n *\n * @param ref The original ref intended to be used.\n * @returns An object ref that updates the given ref.\n * @see https://react.dev/reference/react/forwardRef\n */\nexport function useObjectRef<T>(ref?: ((instance: T | null) => (() => void) | void) | MutableRefObject<T | null> | null): MutableRefObject<T | null> {\n const objRef: MutableRefObject<T | null> = useRef<T>(null);\n const cleanupRef: MutableRefObject<(() => void) | void> = useRef(undefined);\n\n const refEffect = useCallback(\n (instance: T | null) => {\n if (typeof ref === 'function') {\n const refCallback = ref;\n const refCleanup = refCallback(instance);\n return () => {\n if (typeof refCleanup === 'function') {\n refCleanup();\n } else {\n refCallback(null);\n }\n };\n } else if (ref) {\n ref.current = instance;\n return () => {\n ref.current = null;\n };\n }\n },\n [ref]\n );\n\n return useMemo(\n () => ({\n get current() {\n return objRef.current;\n },\n set current(value) {\n objRef.current = value;\n if (cleanupRef.current) {\n cleanupRef.current();\n cleanupRef.current = undefined;\n }\n\n if (value != null) {\n cleanupRef.current = refEffect(value);\n }\n }\n }),\n [refEffect]\n );\n}\n"],"names":[],"version":3,"file":"useObjectRef.main.js.map"}
import {useRef as $gbmns$useRef, useCallback as $gbmns$useCallback, useMemo as $gbmns$useMemo} from "react";
/*
* Copyright 2021 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $df56164dff5785e2$export$4338b53315abf666(ref) {
const objRef = (0, $gbmns$useRef)(null);
const cleanupRef = (0, $gbmns$useRef)(undefined);
const refEffect = (0, $gbmns$useCallback)((instance)=>{
if (typeof ref === 'function') {
const refCallback = ref;
const refCleanup = refCallback(instance);
return ()=>{
if (typeof refCleanup === 'function') refCleanup();
else refCallback(null);
};
} else if (ref) {
ref.current = instance;
return ()=>{
ref.current = null;
};
}
}, [
ref
]);
return (0, $gbmns$useMemo)(()=>({
get current () {
return objRef.current;
},
set current (value){
objRef.current = value;
if (cleanupRef.current) {
cleanupRef.current();
cleanupRef.current = undefined;
}
if (value != null) cleanupRef.current = refEffect(value);
}
}), [
refEffect
]);
}
export {$df56164dff5785e2$export$4338b53315abf666 as useObjectRef};
//# sourceMappingURL=useObjectRef.module.js.map
import {useRef as $gbmns$useRef, useCallback as $gbmns$useCallback, useMemo as $gbmns$useMemo} from "react";
/*
* Copyright 2021 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $df56164dff5785e2$export$4338b53315abf666(ref) {
const objRef = (0, $gbmns$useRef)(null);
const cleanupRef = (0, $gbmns$useRef)(undefined);
const refEffect = (0, $gbmns$useCallback)((instance)=>{
if (typeof ref === 'function') {
const refCallback = ref;
const refCleanup = refCallback(instance);
return ()=>{
if (typeof refCleanup === 'function') refCleanup();
else refCallback(null);
};
} else if (ref) {
ref.current = instance;
return ()=>{
ref.current = null;
};
}
}, [
ref
]);
return (0, $gbmns$useMemo)(()=>({
get current () {
return objRef.current;
},
set current (value){
objRef.current = value;
if (cleanupRef.current) {
cleanupRef.current();
cleanupRef.current = undefined;
}
if (value != null) cleanupRef.current = refEffect(value);
}
}), [
refEffect
]);
}
export {$df56164dff5785e2$export$4338b53315abf666 as useObjectRef};
//# sourceMappingURL=useObjectRef.module.js.map
{"mappings":";;AAAA;;;;;;;;;;CAUC;AAaM,SAAS,0CAAgB,GAAuF;IACrH,MAAM,SAAqC,CAAA,GAAA,aAAK,EAAK;IACrD,MAAM,aAAoD,CAAA,GAAA,aAAK,EAAE;IAEjE,MAAM,YAAY,CAAA,GAAA,kBAAU,EAC1B,CAAC;QACC,IAAI,OAAO,QAAQ,YAAY;YAC7B,MAAM,cAAc;YACpB,MAAM,aAAa,YAAY;YAC/B,OAAO;gBACL,IAAI,OAAO,eAAe,YACxB;qBAEA,YAAY;YAEhB;QACF,OAAO,IAAI,KAAK;YACd,IAAI,OAAO,GAAG;YACd,OAAO;gBACL,IAAI,OAAO,GAAG;YAChB;QACF;IACF,GACA;QAAC;KAAI;IAGP,OAAO,CAAA,GAAA,cAAM,EACX,IAAO,CAAA;YACL,IAAI,WAAU;gBACZ,OAAO,OAAO,OAAO;YACvB;YACA,IAAI,SAAQ,MAAO;gBACjB,OAAO,OAAO,GAAG;gBACjB,IAAI,WAAW,OAAO,EAAE;oBACtB,WAAW,OAAO;oBAClB,WAAW,OAAO,GAAG;gBACvB;gBAEA,IAAI,SAAS,MACX,WAAW,OAAO,GAAG,UAAU;YAEnC;QACF,CAAA,GACA;QAAC;KAAU;AAEf","sources":["packages/@react-aria/utils/src/useObjectRef.ts"],"sourcesContent":["/*\n * Copyright 2021 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {MutableRefObject, useCallback, useMemo, useRef} from 'react';\n\n/**\n * Offers an object ref for a given callback ref or an object ref. Especially\n * helfpul when passing forwarded refs (created using `React.forwardRef`) to\n * React Aria hooks.\n *\n * @param ref The original ref intended to be used.\n * @returns An object ref that updates the given ref.\n * @see https://react.dev/reference/react/forwardRef\n */\nexport function useObjectRef<T>(ref?: ((instance: T | null) => (() => void) | void) | MutableRefObject<T | null> | null): MutableRefObject<T | null> {\n const objRef: MutableRefObject<T | null> = useRef<T>(null);\n const cleanupRef: MutableRefObject<(() => void) | void> = useRef(undefined);\n\n const refEffect = useCallback(\n (instance: T | null) => {\n if (typeof ref === 'function') {\n const refCallback = ref;\n const refCleanup = refCallback(instance);\n return () => {\n if (typeof refCleanup === 'function') {\n refCleanup();\n } else {\n refCallback(null);\n }\n };\n } else if (ref) {\n ref.current = instance;\n return () => {\n ref.current = null;\n };\n }\n },\n [ref]\n );\n\n return useMemo(\n () => ({\n get current() {\n return objRef.current;\n },\n set current(value) {\n objRef.current = value;\n if (cleanupRef.current) {\n cleanupRef.current();\n cleanupRef.current = undefined;\n }\n\n if (value != null) {\n cleanupRef.current = refEffect(value);\n }\n }\n }),\n [refEffect]\n );\n}\n"],"names":[],"version":3,"file":"useObjectRef.module.js.map"}
var $1254e5bb94ac8761$exports = require("./useEffectEvent.main.js");
var $aM4zL$react = require("react");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useResizeObserver", () => $37733e1652f47193$export$683480f191c0e3ea);
function $37733e1652f47193$var$hasResizeObserver() {
return typeof window.ResizeObserver !== 'undefined';
}
function $37733e1652f47193$export$683480f191c0e3ea(options) {
// Only call onResize from inside the effect, otherwise we'll void our assumption that
// useEffectEvents are safe to pass in.
const { ref: ref, box: box, onResize: onResize } = options;
let onResizeEvent = (0, $1254e5bb94ac8761$exports.useEffectEvent)(onResize);
(0, $aM4zL$react.useEffect)(()=>{
let element = ref === null || ref === void 0 ? void 0 : ref.current;
if (!element) return;
if (!$37733e1652f47193$var$hasResizeObserver()) {
window.addEventListener('resize', onResizeEvent, false);
return ()=>{
window.removeEventListener('resize', onResizeEvent, false);
};
} else {
const resizeObserverInstance = new window.ResizeObserver((entries)=>{
if (!entries.length) return;
onResizeEvent();
});
resizeObserverInstance.observe(element, {
box: box
});
return ()=>{
if (element) resizeObserverInstance.unobserve(element);
};
}
}, [
ref,
box
]);
}
//# sourceMappingURL=useResizeObserver.main.js.map
{"mappings":";;;;;;;;;;;AAKA,SAAS;IACP,OAAO,OAAO,OAAO,cAAc,KAAK;AAC1C;AAQO,SAAS,0CAAqC,OAAwC;IAC3F,sFAAsF;IACtF,uCAAuC;IACvC,MAAM,OAAC,GAAG,OAAE,GAAG,YAAE,QAAQ,EAAC,GAAG;IAC7B,IAAI,gBAAgB,CAAA,GAAA,wCAAa,EAAE;IAEnC,CAAA,GAAA,sBAAQ,EAAE;QACR,IAAI,UAAU,gBAAA,0BAAA,IAAK,OAAO;QAC1B,IAAI,CAAC,SACH;QAGF,IAAI,CAAC,2CAAqB;YACxB,OAAO,gBAAgB,CAAC,UAAU,eAAe;YACjD,OAAO;gBACL,OAAO,mBAAmB,CAAC,UAAU,eAAe;YACtD;QACF,OAAO;YAEL,MAAM,yBAAyB,IAAI,OAAO,cAAc,CAAC,CAAC;gBACxD,IAAI,CAAC,QAAQ,MAAM,EACjB;gBAGF;YACF;YACA,uBAAuB,OAAO,CAAC,SAAS;qBAAC;YAAG;YAE5C,OAAO;gBACL,IAAI,SACF,uBAAuB,SAAS,CAAC;YAErC;QACF;IAEF,GAAG;QAAC;QAAK;KAAI;AACf","sources":["packages/@react-aria/utils/src/useResizeObserver.ts"],"sourcesContent":["\nimport {RefObject} from '@react-types/shared';\nimport {useEffect} from 'react';\nimport {useEffectEvent} from './useEffectEvent';\n\nfunction hasResizeObserver() {\n return typeof window.ResizeObserver !== 'undefined';\n}\n\ntype useResizeObserverOptionsType<T> = {\n ref: RefObject<T | undefined | null> | undefined,\n box?: ResizeObserverBoxOptions,\n onResize: () => void\n}\n\nexport function useResizeObserver<T extends Element>(options: useResizeObserverOptionsType<T>): void {\n // Only call onResize from inside the effect, otherwise we'll void our assumption that\n // useEffectEvents are safe to pass in.\n const {ref, box, onResize} = options;\n let onResizeEvent = useEffectEvent(onResize);\n\n useEffect(() => {\n let element = ref?.current;\n if (!element) {\n return;\n }\n\n if (!hasResizeObserver()) {\n window.addEventListener('resize', onResizeEvent, false);\n return () => {\n window.removeEventListener('resize', onResizeEvent, false);\n };\n } else {\n\n const resizeObserverInstance = new window.ResizeObserver((entries) => {\n if (!entries.length) {\n return;\n }\n\n onResizeEvent();\n });\n resizeObserverInstance.observe(element, {box});\n\n return () => {\n if (element) {\n resizeObserverInstance.unobserve(element);\n }\n };\n }\n\n }, [ref, box]);\n}\n"],"names":[],"version":3,"file":"useResizeObserver.main.js.map"}
import {useEffectEvent as $8ae05eaa5c114e9c$export$7f54fc3180508a52} from "./useEffectEvent.mjs";
import {useEffect as $Vsl8o$useEffect} from "react";
function $9daab02d461809db$var$hasResizeObserver() {
return typeof window.ResizeObserver !== 'undefined';
}
function $9daab02d461809db$export$683480f191c0e3ea(options) {
// Only call onResize from inside the effect, otherwise we'll void our assumption that
// useEffectEvents are safe to pass in.
const { ref: ref, box: box, onResize: onResize } = options;
let onResizeEvent = (0, $8ae05eaa5c114e9c$export$7f54fc3180508a52)(onResize);
(0, $Vsl8o$useEffect)(()=>{
let element = ref === null || ref === void 0 ? void 0 : ref.current;
if (!element) return;
if (!$9daab02d461809db$var$hasResizeObserver()) {
window.addEventListener('resize', onResizeEvent, false);
return ()=>{
window.removeEventListener('resize', onResizeEvent, false);
};
} else {
const resizeObserverInstance = new window.ResizeObserver((entries)=>{
if (!entries.length) return;
onResizeEvent();
});
resizeObserverInstance.observe(element, {
box: box
});
return ()=>{
if (element) resizeObserverInstance.unobserve(element);
};
}
}, [
ref,
box
]);
}
export {$9daab02d461809db$export$683480f191c0e3ea as useResizeObserver};
//# sourceMappingURL=useResizeObserver.module.js.map
import {useEffectEvent as $8ae05eaa5c114e9c$export$7f54fc3180508a52} from "./useEffectEvent.module.js";
import {useEffect as $Vsl8o$useEffect} from "react";
function $9daab02d461809db$var$hasResizeObserver() {
return typeof window.ResizeObserver !== 'undefined';
}
function $9daab02d461809db$export$683480f191c0e3ea(options) {
// Only call onResize from inside the effect, otherwise we'll void our assumption that
// useEffectEvents are safe to pass in.
const { ref: ref, box: box, onResize: onResize } = options;
let onResizeEvent = (0, $8ae05eaa5c114e9c$export$7f54fc3180508a52)(onResize);
(0, $Vsl8o$useEffect)(()=>{
let element = ref === null || ref === void 0 ? void 0 : ref.current;
if (!element) return;
if (!$9daab02d461809db$var$hasResizeObserver()) {
window.addEventListener('resize', onResizeEvent, false);
return ()=>{
window.removeEventListener('resize', onResizeEvent, false);
};
} else {
const resizeObserverInstance = new window.ResizeObserver((entries)=>{
if (!entries.length) return;
onResizeEvent();
});
resizeObserverInstance.observe(element, {
box: box
});
return ()=>{
if (element) resizeObserverInstance.unobserve(element);
};
}
}, [
ref,
box
]);
}
export {$9daab02d461809db$export$683480f191c0e3ea as useResizeObserver};
//# sourceMappingURL=useResizeObserver.module.js.map
{"mappings":";;;;;AAKA,SAAS;IACP,OAAO,OAAO,OAAO,cAAc,KAAK;AAC1C;AAQO,SAAS,0CAAqC,OAAwC;IAC3F,sFAAsF;IACtF,uCAAuC;IACvC,MAAM,OAAC,GAAG,OAAE,GAAG,YAAE,QAAQ,EAAC,GAAG;IAC7B,IAAI,gBAAgB,CAAA,GAAA,yCAAa,EAAE;IAEnC,CAAA,GAAA,gBAAQ,EAAE;QACR,IAAI,UAAU,gBAAA,0BAAA,IAAK,OAAO;QAC1B,IAAI,CAAC,SACH;QAGF,IAAI,CAAC,2CAAqB;YACxB,OAAO,gBAAgB,CAAC,UAAU,eAAe;YACjD,OAAO;gBACL,OAAO,mBAAmB,CAAC,UAAU,eAAe;YACtD;QACF,OAAO;YAEL,MAAM,yBAAyB,IAAI,OAAO,cAAc,CAAC,CAAC;gBACxD,IAAI,CAAC,QAAQ,MAAM,EACjB;gBAGF;YACF;YACA,uBAAuB,OAAO,CAAC,SAAS;qBAAC;YAAG;YAE5C,OAAO;gBACL,IAAI,SACF,uBAAuB,SAAS,CAAC;YAErC;QACF;IAEF,GAAG;QAAC;QAAK;KAAI;AACf","sources":["packages/@react-aria/utils/src/useResizeObserver.ts"],"sourcesContent":["\nimport {RefObject} from '@react-types/shared';\nimport {useEffect} from 'react';\nimport {useEffectEvent} from './useEffectEvent';\n\nfunction hasResizeObserver() {\n return typeof window.ResizeObserver !== 'undefined';\n}\n\ntype useResizeObserverOptionsType<T> = {\n ref: RefObject<T | undefined | null> | undefined,\n box?: ResizeObserverBoxOptions,\n onResize: () => void\n}\n\nexport function useResizeObserver<T extends Element>(options: useResizeObserverOptionsType<T>): void {\n // Only call onResize from inside the effect, otherwise we'll void our assumption that\n // useEffectEvents are safe to pass in.\n const {ref, box, onResize} = options;\n let onResizeEvent = useEffectEvent(onResize);\n\n useEffect(() => {\n let element = ref?.current;\n if (!element) {\n return;\n }\n\n if (!hasResizeObserver()) {\n window.addEventListener('resize', onResizeEvent, false);\n return () => {\n window.removeEventListener('resize', onResizeEvent, false);\n };\n } else {\n\n const resizeObserverInstance = new window.ResizeObserver((entries) => {\n if (!entries.length) {\n return;\n }\n\n onResizeEvent();\n });\n resizeObserverInstance.observe(element, {box});\n\n return () => {\n if (element) {\n resizeObserverInstance.unobserve(element);\n }\n };\n }\n\n }, [ref, box]);\n}\n"],"names":[],"version":3,"file":"useResizeObserver.module.js.map"}
var $78605a5d7424e31b$exports = require("./useLayoutEffect.main.js");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useSyncRef", () => $6fc733991a9f977c$export$4debdb1a3f0fa79e);
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $6fc733991a9f977c$export$4debdb1a3f0fa79e(context, ref) {
(0, $78605a5d7424e31b$exports.useLayoutEffect)(()=>{
if (context && context.ref && ref) {
context.ref.current = ref.current;
return ()=>{
if (context.ref) context.ref.current = null;
};
}
});
}
//# sourceMappingURL=useSyncRef.main.js.map
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;AAWM,SAAS,0CAAc,OAAgC,EAAE,GAAyB;IACvF,CAAA,GAAA,yCAAc,EAAE;QACd,IAAI,WAAW,QAAQ,GAAG,IAAI,KAAK;YACjC,QAAQ,GAAG,CAAC,OAAO,GAAG,IAAI,OAAO;YACjC,OAAO;gBACL,IAAI,QAAQ,GAAG,EACb,QAAQ,GAAG,CAAC,OAAO,GAAG;YAE1B;QACF;IACF;AACF","sources":["packages/@react-aria/utils/src/useSyncRef.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {MutableRefObject} from 'react';\nimport {RefObject} from '@react-types/shared';\nimport {useLayoutEffect} from './';\n\ninterface ContextValue<T> {\n ref?: MutableRefObject<T | null>\n}\n\n// Syncs ref from context with ref passed to hook\nexport function useSyncRef<T>(context?: ContextValue<T> | null, ref?: RefObject<T | null>): void {\n useLayoutEffect(() => {\n if (context && context.ref && ref) {\n context.ref.current = ref.current;\n return () => {\n if (context.ref) {\n context.ref.current = null;\n }\n };\n }\n });\n}\n"],"names":[],"version":3,"file":"useSyncRef.main.js.map"}
import {useLayoutEffect as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c} from "./useLayoutEffect.mjs";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $e7801be82b4b2a53$export$4debdb1a3f0fa79e(context, ref) {
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
if (context && context.ref && ref) {
context.ref.current = ref.current;
return ()=>{
if (context.ref) context.ref.current = null;
};
}
});
}
export {$e7801be82b4b2a53$export$4debdb1a3f0fa79e as useSyncRef};
//# sourceMappingURL=useSyncRef.module.js.map
import {useLayoutEffect as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c} from "./useLayoutEffect.module.js";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $e7801be82b4b2a53$export$4debdb1a3f0fa79e(context, ref) {
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
if (context && context.ref && ref) {
context.ref.current = ref.current;
return ()=>{
if (context.ref) context.ref.current = null;
};
}
});
}
export {$e7801be82b4b2a53$export$4debdb1a3f0fa79e as useSyncRef};
//# sourceMappingURL=useSyncRef.module.js.map
{"mappings":";;AAAA;;;;;;;;;;CAUC;AAWM,SAAS,0CAAc,OAAgC,EAAE,GAAyB;IACvF,CAAA,GAAA,yCAAc,EAAE;QACd,IAAI,WAAW,QAAQ,GAAG,IAAI,KAAK;YACjC,QAAQ,GAAG,CAAC,OAAO,GAAG,IAAI,OAAO;YACjC,OAAO;gBACL,IAAI,QAAQ,GAAG,EACb,QAAQ,GAAG,CAAC,OAAO,GAAG;YAE1B;QACF;IACF;AACF","sources":["packages/@react-aria/utils/src/useSyncRef.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {MutableRefObject} from 'react';\nimport {RefObject} from '@react-types/shared';\nimport {useLayoutEffect} from './';\n\ninterface ContextValue<T> {\n ref?: MutableRefObject<T | null>\n}\n\n// Syncs ref from context with ref passed to hook\nexport function useSyncRef<T>(context?: ContextValue<T> | null, ref?: RefObject<T | null>): void {\n useLayoutEffect(() => {\n if (context && context.ref && ref) {\n context.ref.current = ref.current;\n return () => {\n if (context.ref) {\n context.ref.current = null;\n }\n };\n }\n });\n}\n"],"names":[],"version":3,"file":"useSyncRef.module.js.map"}
var $1254e5bb94ac8761$exports = require("./useEffectEvent.main.js");
var $cagC1$react = require("react");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useUpdateEffect", () => $29293a6f5c75b37e$export$496315a1608d9602);
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $29293a6f5c75b37e$export$496315a1608d9602(cb, dependencies) {
const isInitialMount = (0, $cagC1$react.useRef)(true);
const lastDeps = (0, $cagC1$react.useRef)(null);
let cbEvent = (0, $1254e5bb94ac8761$exports.useEffectEvent)(cb);
(0, $cagC1$react.useEffect)(()=>{
isInitialMount.current = true;
return ()=>{
isInitialMount.current = false;
};
}, []);
(0, $cagC1$react.useEffect)(()=>{
let prevDeps = lastDeps.current;
if (isInitialMount.current) isInitialMount.current = false;
else if (!prevDeps || dependencies.some((dep, i)=>!Object.is(dep, prevDeps[i]))) cbEvent();
lastDeps.current = dependencies;
// eslint-disable-next-line react-hooks/exhaustive-deps
}, dependencies);
}
//# sourceMappingURL=useUpdateEffect.main.js.map
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAMM,SAAS,0CAAgB,EAAkB,EAAE,YAAmB;IACrE,MAAM,iBAAiB,CAAA,GAAA,mBAAK,EAAE;IAC9B,MAAM,WAAW,CAAA,GAAA,mBAAK,EAAgB;IACtC,IAAI,UAAU,CAAA,GAAA,wCAAa,EAAE;IAE7B,CAAA,GAAA,sBAAQ,EAAE;QACR,eAAe,OAAO,GAAG;QACzB,OAAO;YACL,eAAe,OAAO,GAAG;QAC3B;IACF,GAAG,EAAE;IAEL,CAAA,GAAA,sBAAQ,EAAE;QACR,IAAI,WAAW,SAAS,OAAO;QAC/B,IAAI,eAAe,OAAO,EACxB,eAAe,OAAO,GAAG;aACpB,IAAI,CAAC,YAAY,aAAa,IAAI,CAAC,CAAC,KAAK,IAAM,CAAC,OAAO,EAAE,CAAC,KAAK,QAAQ,CAAC,EAAE,IAC/E;QAEF,SAAS,OAAO,GAAG;IACrB,uDAAuD;IACvD,GAAG;AACL","sources":["packages/@react-aria/utils/src/useUpdateEffect.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {EffectCallback, useEffect, useRef} from 'react';\nimport {useEffectEvent} from './useEffectEvent';\n\n// Like useEffect, but only called for updates after the initial render.\nexport function useUpdateEffect(cb: EffectCallback, dependencies: any[]): void {\n const isInitialMount = useRef(true);\n const lastDeps = useRef<any[] | null>(null);\n let cbEvent = useEffectEvent(cb);\n\n useEffect(() => {\n isInitialMount.current = true;\n return () => {\n isInitialMount.current = false;\n };\n }, []);\n\n useEffect(() => {\n let prevDeps = lastDeps.current;\n if (isInitialMount.current) {\n isInitialMount.current = false;\n } else if (!prevDeps || dependencies.some((dep, i) => !Object.is(dep, prevDeps[i]))) {\n cbEvent();\n }\n lastDeps.current = dependencies;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, dependencies);\n}\n"],"names":[],"version":3,"file":"useUpdateEffect.main.js.map"}
import {useEffectEvent as $8ae05eaa5c114e9c$export$7f54fc3180508a52} from "./useEffectEvent.mjs";
import {useRef as $9vW05$useRef, useEffect as $9vW05$useEffect} from "react";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $4f58c5f72bcf79f7$export$496315a1608d9602(cb, dependencies) {
const isInitialMount = (0, $9vW05$useRef)(true);
const lastDeps = (0, $9vW05$useRef)(null);
let cbEvent = (0, $8ae05eaa5c114e9c$export$7f54fc3180508a52)(cb);
(0, $9vW05$useEffect)(()=>{
isInitialMount.current = true;
return ()=>{
isInitialMount.current = false;
};
}, []);
(0, $9vW05$useEffect)(()=>{
let prevDeps = lastDeps.current;
if (isInitialMount.current) isInitialMount.current = false;
else if (!prevDeps || dependencies.some((dep, i)=>!Object.is(dep, prevDeps[i]))) cbEvent();
lastDeps.current = dependencies;
// eslint-disable-next-line react-hooks/exhaustive-deps
}, dependencies);
}
export {$4f58c5f72bcf79f7$export$496315a1608d9602 as useUpdateEffect};
//# sourceMappingURL=useUpdateEffect.module.js.map
import {useEffectEvent as $8ae05eaa5c114e9c$export$7f54fc3180508a52} from "./useEffectEvent.module.js";
import {useRef as $9vW05$useRef, useEffect as $9vW05$useEffect} from "react";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $4f58c5f72bcf79f7$export$496315a1608d9602(cb, dependencies) {
const isInitialMount = (0, $9vW05$useRef)(true);
const lastDeps = (0, $9vW05$useRef)(null);
let cbEvent = (0, $8ae05eaa5c114e9c$export$7f54fc3180508a52)(cb);
(0, $9vW05$useEffect)(()=>{
isInitialMount.current = true;
return ()=>{
isInitialMount.current = false;
};
}, []);
(0, $9vW05$useEffect)(()=>{
let prevDeps = lastDeps.current;
if (isInitialMount.current) isInitialMount.current = false;
else if (!prevDeps || dependencies.some((dep, i)=>!Object.is(dep, prevDeps[i]))) cbEvent();
lastDeps.current = dependencies;
// eslint-disable-next-line react-hooks/exhaustive-deps
}, dependencies);
}
export {$4f58c5f72bcf79f7$export$496315a1608d9602 as useUpdateEffect};
//# sourceMappingURL=useUpdateEffect.module.js.map
{"mappings":";;;AAAA;;;;;;;;;;CAUC;;AAMM,SAAS,0CAAgB,EAAkB,EAAE,YAAmB;IACrE,MAAM,iBAAiB,CAAA,GAAA,aAAK,EAAE;IAC9B,MAAM,WAAW,CAAA,GAAA,aAAK,EAAgB;IACtC,IAAI,UAAU,CAAA,GAAA,yCAAa,EAAE;IAE7B,CAAA,GAAA,gBAAQ,EAAE;QACR,eAAe,OAAO,GAAG;QACzB,OAAO;YACL,eAAe,OAAO,GAAG;QAC3B;IACF,GAAG,EAAE;IAEL,CAAA,GAAA,gBAAQ,EAAE;QACR,IAAI,WAAW,SAAS,OAAO;QAC/B,IAAI,eAAe,OAAO,EACxB,eAAe,OAAO,GAAG;aACpB,IAAI,CAAC,YAAY,aAAa,IAAI,CAAC,CAAC,KAAK,IAAM,CAAC,OAAO,EAAE,CAAC,KAAK,QAAQ,CAAC,EAAE,IAC/E;QAEF,SAAS,OAAO,GAAG;IACrB,uDAAuD;IACvD,GAAG;AACL","sources":["packages/@react-aria/utils/src/useUpdateEffect.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {EffectCallback, useEffect, useRef} from 'react';\nimport {useEffectEvent} from './useEffectEvent';\n\n// Like useEffect, but only called for updates after the initial render.\nexport function useUpdateEffect(cb: EffectCallback, dependencies: any[]): void {\n const isInitialMount = useRef(true);\n const lastDeps = useRef<any[] | null>(null);\n let cbEvent = useEffectEvent(cb);\n\n useEffect(() => {\n isInitialMount.current = true;\n return () => {\n isInitialMount.current = false;\n };\n }, []);\n\n useEffect(() => {\n let prevDeps = lastDeps.current;\n if (isInitialMount.current) {\n isInitialMount.current = false;\n } else if (!prevDeps || dependencies.some((dep, i) => !Object.is(dep, prevDeps[i]))) {\n cbEvent();\n }\n lastDeps.current = dependencies;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, dependencies);\n}\n"],"names":[],"version":3,"file":"useUpdateEffect.module.js.map"}
var $78605a5d7424e31b$exports = require("./useLayoutEffect.main.js");
var $ah9Dz$react = require("react");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useUpdateLayoutEffect", () => $0fa310503218f75f$export$72ef708ab07251f1);
/*
* Copyright 2024 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $0fa310503218f75f$export$72ef708ab07251f1(effect, dependencies) {
const isInitialMount = (0, $ah9Dz$react.useRef)(true);
const lastDeps = (0, $ah9Dz$react.useRef)(null);
(0, $78605a5d7424e31b$exports.useLayoutEffect)(()=>{
isInitialMount.current = true;
return ()=>{
isInitialMount.current = false;
};
}, []);
(0, $78605a5d7424e31b$exports.useLayoutEffect)(()=>{
if (isInitialMount.current) isInitialMount.current = false;
else if (!lastDeps.current || dependencies.some((dep, i)=>!Object.is(dep, lastDeps[i]))) effect();
lastDeps.current = dependencies;
// eslint-disable-next-line react-hooks/exhaustive-deps
}, dependencies);
}
//# sourceMappingURL=useUpdateLayoutEffect.main.js.map
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAMM,SAAS,0CAAsB,MAAsB,EAAE,YAAmB;IAC/E,MAAM,iBAAiB,CAAA,GAAA,mBAAK,EAAE;IAC9B,MAAM,WAAW,CAAA,GAAA,mBAAK,EAAgB;IAEtC,CAAA,GAAA,yCAAc,EAAE;QACd,eAAe,OAAO,GAAG;QACzB,OAAO;YACL,eAAe,OAAO,GAAG;QAC3B;IACF,GAAG,EAAE;IAEL,CAAA,GAAA,yCAAc,EAAE;QACd,IAAI,eAAe,OAAO,EACxB,eAAe,OAAO,GAAG;aACpB,IAAI,CAAC,SAAS,OAAO,IAAI,aAAa,IAAI,CAAC,CAAC,KAAK,IAAM,CAAC,OAAO,EAAE,CAAC,KAAK,QAAQ,CAAC,EAAE,IACvF;QAEF,SAAS,OAAO,GAAG;IACnB,uDAAuD;IACzD,GAAG;AACL","sources":["packages/@react-aria/utils/src/useUpdateLayoutEffect.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {EffectCallback, useRef} from 'react';\nimport {useLayoutEffect} from './useLayoutEffect';\n\n// Like useLayoutEffect, but only called for updates after the initial render.\nexport function useUpdateLayoutEffect(effect: EffectCallback, dependencies: any[]): void {\n const isInitialMount = useRef(true);\n const lastDeps = useRef<any[] | null>(null);\n\n useLayoutEffect(() => {\n isInitialMount.current = true;\n return () => {\n isInitialMount.current = false;\n };\n }, []);\n\n useLayoutEffect(() => {\n if (isInitialMount.current) {\n isInitialMount.current = false;\n } else if (!lastDeps.current || dependencies.some((dep, i) => !Object.is(dep, lastDeps[i]))) {\n effect();\n }\n lastDeps.current = dependencies;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, dependencies);\n}\n"],"names":[],"version":3,"file":"useUpdateLayoutEffect.main.js.map"}
import {useLayoutEffect as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c} from "./useLayoutEffect.mjs";
import {useRef as $azsE2$useRef} from "react";
/*
* Copyright 2024 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $ca9b37712f007381$export$72ef708ab07251f1(effect, dependencies) {
const isInitialMount = (0, $azsE2$useRef)(true);
const lastDeps = (0, $azsE2$useRef)(null);
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
isInitialMount.current = true;
return ()=>{
isInitialMount.current = false;
};
}, []);
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
if (isInitialMount.current) isInitialMount.current = false;
else if (!lastDeps.current || dependencies.some((dep, i)=>!Object.is(dep, lastDeps[i]))) effect();
lastDeps.current = dependencies;
// eslint-disable-next-line react-hooks/exhaustive-deps
}, dependencies);
}
export {$ca9b37712f007381$export$72ef708ab07251f1 as useUpdateLayoutEffect};
//# sourceMappingURL=useUpdateLayoutEffect.module.js.map
import {useLayoutEffect as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c} from "./useLayoutEffect.module.js";
import {useRef as $azsE2$useRef} from "react";
/*
* Copyright 2024 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $ca9b37712f007381$export$72ef708ab07251f1(effect, dependencies) {
const isInitialMount = (0, $azsE2$useRef)(true);
const lastDeps = (0, $azsE2$useRef)(null);
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
isInitialMount.current = true;
return ()=>{
isInitialMount.current = false;
};
}, []);
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
if (isInitialMount.current) isInitialMount.current = false;
else if (!lastDeps.current || dependencies.some((dep, i)=>!Object.is(dep, lastDeps[i]))) effect();
lastDeps.current = dependencies;
// eslint-disable-next-line react-hooks/exhaustive-deps
}, dependencies);
}
export {$ca9b37712f007381$export$72ef708ab07251f1 as useUpdateLayoutEffect};
//# sourceMappingURL=useUpdateLayoutEffect.module.js.map
{"mappings":";;;AAAA;;;;;;;;;;CAUC;;AAMM,SAAS,0CAAsB,MAAsB,EAAE,YAAmB;IAC/E,MAAM,iBAAiB,CAAA,GAAA,aAAK,EAAE;IAC9B,MAAM,WAAW,CAAA,GAAA,aAAK,EAAgB;IAEtC,CAAA,GAAA,yCAAc,EAAE;QACd,eAAe,OAAO,GAAG;QACzB,OAAO;YACL,eAAe,OAAO,GAAG;QAC3B;IACF,GAAG,EAAE;IAEL,CAAA,GAAA,yCAAc,EAAE;QACd,IAAI,eAAe,OAAO,EACxB,eAAe,OAAO,GAAG;aACpB,IAAI,CAAC,SAAS,OAAO,IAAI,aAAa,IAAI,CAAC,CAAC,KAAK,IAAM,CAAC,OAAO,EAAE,CAAC,KAAK,QAAQ,CAAC,EAAE,IACvF;QAEF,SAAS,OAAO,GAAG;IACnB,uDAAuD;IACzD,GAAG;AACL","sources":["packages/@react-aria/utils/src/useUpdateLayoutEffect.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {EffectCallback, useRef} from 'react';\nimport {useLayoutEffect} from './useLayoutEffect';\n\n// Like useLayoutEffect, but only called for updates after the initial render.\nexport function useUpdateLayoutEffect(effect: EffectCallback, dependencies: any[]): void {\n const isInitialMount = useRef(true);\n const lastDeps = useRef<any[] | null>(null);\n\n useLayoutEffect(() => {\n isInitialMount.current = true;\n return () => {\n isInitialMount.current = false;\n };\n }, []);\n\n useLayoutEffect(() => {\n if (isInitialMount.current) {\n isInitialMount.current = false;\n } else if (!lastDeps.current || dependencies.some((dep, i) => !Object.is(dep, lastDeps[i]))) {\n effect();\n }\n lastDeps.current = dependencies;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, dependencies);\n}\n"],"names":[],"version":3,"file":"useUpdateLayoutEffect.module.js.map"}
var $78605a5d7424e31b$exports = require("./useLayoutEffect.main.js");
var $fymK9$react = require("react");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useValueEffect", () => $19a2307bfabafaf1$export$14d238f342723f25);
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $19a2307bfabafaf1$export$14d238f342723f25(defaultValue) {
let [value, setValue] = (0, $fymK9$react.useState)(defaultValue);
// Keep an up to date copy of value in a ref so we can access the current value in the generator.
// This allows us to maintain a stable queue function.
let currValue = (0, $fymK9$react.useRef)(value);
let effect = (0, $fymK9$react.useRef)(null);
// Store the function in a ref so we can always access the current version
// which has the proper `value` in scope.
let nextRef = (0, $fymK9$react.useRef)(()=>{
if (!effect.current) return;
// Run the generator to the next yield.
let newValue = effect.current.next();
// If the generator is done, reset the effect.
if (newValue.done) {
effect.current = null;
return;
}
// If the value is the same as the current value,
// then continue to the next yield. Otherwise,
// set the value in state and wait for the next layout effect.
if (currValue.current === newValue.value) nextRef.current();
else setValue(newValue.value);
});
(0, $78605a5d7424e31b$exports.useLayoutEffect)(()=>{
currValue.current = value;
// If there is an effect currently running, continue to the next yield.
if (effect.current) nextRef.current();
});
let queue = (0, $fymK9$react.useCallback)((fn)=>{
effect.current = fn(currValue.current);
nextRef.current();
}, [
nextRef
]);
return [
value,
queue
];
}
//# sourceMappingURL=useValueEffect.main.js.map
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAWM,SAAS,0CAAkB,YAA2B;IAC3D,IAAI,CAAC,OAAO,SAAS,GAAG,CAAA,GAAA,qBAAO,EAAE;IACjC,iGAAiG;IACjG,sDAAsD;IACtD,IAAI,YAAY,CAAA,GAAA,mBAAK,EAAE;IACvB,IAAI,SAAyC,CAAA,GAAA,mBAAK,EAAuB;IAEzE,0EAA0E;IAC1E,yCAAyC;IACzC,IAAI,UAAU,CAAA,GAAA,mBAAK,EAAE;QACnB,IAAI,CAAC,OAAO,OAAO,EACjB;QAEF,uCAAuC;QACvC,IAAI,WAAW,OAAO,OAAO,CAAC,IAAI;QAElC,8CAA8C;QAC9C,IAAI,SAAS,IAAI,EAAE;YACjB,OAAO,OAAO,GAAG;YACjB;QACF;QAEA,iDAAiD;QACjD,8CAA8C;QAC9C,8DAA8D;QAC9D,IAAI,UAAU,OAAO,KAAK,SAAS,KAAK,EACtC,QAAQ,OAAO;aAEf,SAAS,SAAS,KAAK;IAE3B;IAEA,CAAA,GAAA,yCAAc,EAAE;QACd,UAAU,OAAO,GAAG;QACpB,uEAAuE;QACvE,IAAI,OAAO,OAAO,EAChB,QAAQ,OAAO;IAEnB;IAEA,IAAI,QAAQ,CAAA,GAAA,wBAAU,EAAE,CAAA;QACtB,OAAO,OAAO,GAAG,GAAG,UAAU,OAAO;QACrC,QAAQ,OAAO;IACjB,GAAG;QAAC;KAAQ;IAEZ,OAAO;QAAC;QAAO;KAAM;AACvB","sources":["packages/@react-aria/utils/src/useValueEffect.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Dispatch, RefObject, useCallback, useRef, useState} from 'react';\nimport {useLayoutEffect} from './';\n\ntype SetValueAction<S> = (prev: S) => Generator<any, void, unknown>;\n\n// This hook works like `useState`, but when setting the value, you pass a generator function\n// that can yield multiple values. Each yielded value updates the state and waits for the next\n// layout effect, then continues the generator. This allows sequential updates to state to be\n// written linearly.\nexport function useValueEffect<S>(defaultValue: S | (() => S)): [S, Dispatch<SetValueAction<S>>] {\n let [value, setValue] = useState(defaultValue);\n // Keep an up to date copy of value in a ref so we can access the current value in the generator.\n // This allows us to maintain a stable queue function.\n let currValue = useRef(value);\n let effect: RefObject<Generator<S> | null> = useRef<Generator<S> | null>(null);\n\n // Store the function in a ref so we can always access the current version\n // which has the proper `value` in scope.\n let nextRef = useRef(() => {\n if (!effect.current) {\n return;\n }\n // Run the generator to the next yield.\n let newValue = effect.current.next();\n\n // If the generator is done, reset the effect.\n if (newValue.done) {\n effect.current = null;\n return;\n }\n\n // If the value is the same as the current value,\n // then continue to the next yield. Otherwise,\n // set the value in state and wait for the next layout effect.\n if (currValue.current === newValue.value) {\n nextRef.current();\n } else {\n setValue(newValue.value);\n }\n });\n\n useLayoutEffect(() => {\n currValue.current = value;\n // If there is an effect currently running, continue to the next yield.\n if (effect.current) {\n nextRef.current();\n }\n });\n\n let queue = useCallback(fn => {\n effect.current = fn(currValue.current);\n nextRef.current();\n }, [nextRef]);\n\n return [value, queue];\n}\n"],"names":[],"version":3,"file":"useValueEffect.main.js.map"}
import {useLayoutEffect as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c} from "./useLayoutEffect.mjs";
import {useState as $fCAlL$useState, useRef as $fCAlL$useRef, useCallback as $fCAlL$useCallback} from "react";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $1dbecbe27a04f9af$export$14d238f342723f25(defaultValue) {
let [value, setValue] = (0, $fCAlL$useState)(defaultValue);
// Keep an up to date copy of value in a ref so we can access the current value in the generator.
// This allows us to maintain a stable queue function.
let currValue = (0, $fCAlL$useRef)(value);
let effect = (0, $fCAlL$useRef)(null);
// Store the function in a ref so we can always access the current version
// which has the proper `value` in scope.
let nextRef = (0, $fCAlL$useRef)(()=>{
if (!effect.current) return;
// Run the generator to the next yield.
let newValue = effect.current.next();
// If the generator is done, reset the effect.
if (newValue.done) {
effect.current = null;
return;
}
// If the value is the same as the current value,
// then continue to the next yield. Otherwise,
// set the value in state and wait for the next layout effect.
if (currValue.current === newValue.value) nextRef.current();
else setValue(newValue.value);
});
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
currValue.current = value;
// If there is an effect currently running, continue to the next yield.
if (effect.current) nextRef.current();
});
let queue = (0, $fCAlL$useCallback)((fn)=>{
effect.current = fn(currValue.current);
nextRef.current();
}, [
nextRef
]);
return [
value,
queue
];
}
export {$1dbecbe27a04f9af$export$14d238f342723f25 as useValueEffect};
//# sourceMappingURL=useValueEffect.module.js.map
import {useLayoutEffect as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c} from "./useLayoutEffect.module.js";
import {useState as $fCAlL$useState, useRef as $fCAlL$useRef, useCallback as $fCAlL$useCallback} from "react";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $1dbecbe27a04f9af$export$14d238f342723f25(defaultValue) {
let [value, setValue] = (0, $fCAlL$useState)(defaultValue);
// Keep an up to date copy of value in a ref so we can access the current value in the generator.
// This allows us to maintain a stable queue function.
let currValue = (0, $fCAlL$useRef)(value);
let effect = (0, $fCAlL$useRef)(null);
// Store the function in a ref so we can always access the current version
// which has the proper `value` in scope.
let nextRef = (0, $fCAlL$useRef)(()=>{
if (!effect.current) return;
// Run the generator to the next yield.
let newValue = effect.current.next();
// If the generator is done, reset the effect.
if (newValue.done) {
effect.current = null;
return;
}
// If the value is the same as the current value,
// then continue to the next yield. Otherwise,
// set the value in state and wait for the next layout effect.
if (currValue.current === newValue.value) nextRef.current();
else setValue(newValue.value);
});
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
currValue.current = value;
// If there is an effect currently running, continue to the next yield.
if (effect.current) nextRef.current();
});
let queue = (0, $fCAlL$useCallback)((fn)=>{
effect.current = fn(currValue.current);
nextRef.current();
}, [
nextRef
]);
return [
value,
queue
];
}
export {$1dbecbe27a04f9af$export$14d238f342723f25 as useValueEffect};
//# sourceMappingURL=useValueEffect.module.js.map
{"mappings":";;;AAAA;;;;;;;;;;CAUC;;AAWM,SAAS,0CAAkB,YAA2B;IAC3D,IAAI,CAAC,OAAO,SAAS,GAAG,CAAA,GAAA,eAAO,EAAE;IACjC,iGAAiG;IACjG,sDAAsD;IACtD,IAAI,YAAY,CAAA,GAAA,aAAK,EAAE;IACvB,IAAI,SAAyC,CAAA,GAAA,aAAK,EAAuB;IAEzE,0EAA0E;IAC1E,yCAAyC;IACzC,IAAI,UAAU,CAAA,GAAA,aAAK,EAAE;QACnB,IAAI,CAAC,OAAO,OAAO,EACjB;QAEF,uCAAuC;QACvC,IAAI,WAAW,OAAO,OAAO,CAAC,IAAI;QAElC,8CAA8C;QAC9C,IAAI,SAAS,IAAI,EAAE;YACjB,OAAO,OAAO,GAAG;YACjB;QACF;QAEA,iDAAiD;QACjD,8CAA8C;QAC9C,8DAA8D;QAC9D,IAAI,UAAU,OAAO,KAAK,SAAS,KAAK,EACtC,QAAQ,OAAO;aAEf,SAAS,SAAS,KAAK;IAE3B;IAEA,CAAA,GAAA,yCAAc,EAAE;QACd,UAAU,OAAO,GAAG;QACpB,uEAAuE;QACvE,IAAI,OAAO,OAAO,EAChB,QAAQ,OAAO;IAEnB;IAEA,IAAI,QAAQ,CAAA,GAAA,kBAAU,EAAE,CAAA;QACtB,OAAO,OAAO,GAAG,GAAG,UAAU,OAAO;QACrC,QAAQ,OAAO;IACjB,GAAG;QAAC;KAAQ;IAEZ,OAAO;QAAC;QAAO;KAAM;AACvB","sources":["packages/@react-aria/utils/src/useValueEffect.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Dispatch, RefObject, useCallback, useRef, useState} from 'react';\nimport {useLayoutEffect} from './';\n\ntype SetValueAction<S> = (prev: S) => Generator<any, void, unknown>;\n\n// This hook works like `useState`, but when setting the value, you pass a generator function\n// that can yield multiple values. Each yielded value updates the state and waits for the next\n// layout effect, then continues the generator. This allows sequential updates to state to be\n// written linearly.\nexport function useValueEffect<S>(defaultValue: S | (() => S)): [S, Dispatch<SetValueAction<S>>] {\n let [value, setValue] = useState(defaultValue);\n // Keep an up to date copy of value in a ref so we can access the current value in the generator.\n // This allows us to maintain a stable queue function.\n let currValue = useRef(value);\n let effect: RefObject<Generator<S> | null> = useRef<Generator<S> | null>(null);\n\n // Store the function in a ref so we can always access the current version\n // which has the proper `value` in scope.\n let nextRef = useRef(() => {\n if (!effect.current) {\n return;\n }\n // Run the generator to the next yield.\n let newValue = effect.current.next();\n\n // If the generator is done, reset the effect.\n if (newValue.done) {\n effect.current = null;\n return;\n }\n\n // If the value is the same as the current value,\n // then continue to the next yield. Otherwise,\n // set the value in state and wait for the next layout effect.\n if (currValue.current === newValue.value) {\n nextRef.current();\n } else {\n setValue(newValue.value);\n }\n });\n\n useLayoutEffect(() => {\n currValue.current = value;\n // If there is an effect currently running, continue to the next yield.\n if (effect.current) {\n nextRef.current();\n }\n });\n\n let queue = useCallback(fn => {\n effect.current = fn(currValue.current);\n nextRef.current();\n }, [nextRef]);\n\n return [value, queue];\n}\n"],"names":[],"version":3,"file":"useValueEffect.module.js.map"}
var $2308dc377e184bb0$exports = require("./keyboard.main.js");
var $4gIVO$react = require("react");
var $4gIVO$reactariassr = require("@react-aria/ssr");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useViewportSize", () => $8b24bab62f5c65ad$export$d699905dd57c73ca);
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
let $8b24bab62f5c65ad$var$visualViewport = typeof document !== 'undefined' && window.visualViewport;
function $8b24bab62f5c65ad$export$d699905dd57c73ca() {
let isSSR = (0, $4gIVO$reactariassr.useIsSSR)();
let [size, setSize] = (0, $4gIVO$react.useState)(()=>isSSR ? {
width: 0,
height: 0
} : $8b24bab62f5c65ad$var$getViewportSize());
(0, $4gIVO$react.useEffect)(()=>{
let updateSize = (newSize)=>{
setSize((size)=>{
if (newSize.width === size.width && newSize.height === size.height) return size;
return newSize;
});
};
// Use visualViewport api to track available height even on iOS virtual keyboard opening
let onResize = ()=>{
// Ignore updates when zoomed.
if ($8b24bab62f5c65ad$var$visualViewport && $8b24bab62f5c65ad$var$visualViewport.scale > 1) return;
updateSize($8b24bab62f5c65ad$var$getViewportSize());
};
// When closing the keyboard, iOS does not fire the visual viewport resize event until the animation is complete.
// We can anticipate this and resize early by handling the blur event and using the layout size.
let frame;
let onBlur = (e)=>{
if ($8b24bab62f5c65ad$var$visualViewport && $8b24bab62f5c65ad$var$visualViewport.scale > 1) return;
if ((0, $2308dc377e184bb0$exports.willOpenKeyboard)(e.target)) // Wait one frame to see if a new element gets focused.
frame = requestAnimationFrame(()=>{
if (!document.activeElement || !(0, $2308dc377e184bb0$exports.willOpenKeyboard)(document.activeElement)) updateSize({
width: window.innerWidth,
height: window.innerHeight
});
});
};
updateSize($8b24bab62f5c65ad$var$getViewportSize());
window.addEventListener('blur', onBlur, true);
if (!$8b24bab62f5c65ad$var$visualViewport) window.addEventListener('resize', onResize);
else $8b24bab62f5c65ad$var$visualViewport.addEventListener('resize', onResize);
return ()=>{
cancelAnimationFrame(frame);
window.removeEventListener('blur', onBlur, true);
if (!$8b24bab62f5c65ad$var$visualViewport) window.removeEventListener('resize', onResize);
else $8b24bab62f5c65ad$var$visualViewport.removeEventListener('resize', onResize);
};
}, []);
return size;
}
function $8b24bab62f5c65ad$var$getViewportSize() {
return {
// Multiply by the visualViewport scale to get the "natural" size, unaffected by pinch zooming.
width: $8b24bab62f5c65ad$var$visualViewport ? $8b24bab62f5c65ad$var$visualViewport.width * $8b24bab62f5c65ad$var$visualViewport.scale : window.innerWidth,
height: $8b24bab62f5c65ad$var$visualViewport ? $8b24bab62f5c65ad$var$visualViewport.height * $8b24bab62f5c65ad$var$visualViewport.scale : window.innerHeight
};
}
//# sourceMappingURL=useViewportSize.main.js.map
{"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAWD,IAAI,uCAAiB,OAAO,aAAa,eAAe,OAAO,cAAc;AAEtE,SAAS;IACd,IAAI,QAAQ,CAAA,GAAA,4BAAO;IACnB,IAAI,CAAC,MAAM,QAAQ,GAAG,CAAA,GAAA,qBAAO,EAAE,IAAM,QAAQ;YAAC,OAAO;YAAG,QAAQ;QAAC,IAAI;IAErE,CAAA,GAAA,sBAAQ,EAAE;QACR,IAAI,aAAa,CAAC;YAChB,QAAQ,CAAA;gBACN,IAAI,QAAQ,KAAK,KAAK,KAAK,KAAK,IAAI,QAAQ,MAAM,KAAK,KAAK,MAAM,EAChE,OAAO;gBAET,OAAO;YACT;QACF;QAEA,wFAAwF;QACxF,IAAI,WAAW;YACb,8BAA8B;YAC9B,IAAI,wCAAkB,qCAAe,KAAK,GAAG,GAC3C;YAGF,WAAW;QACb;QAEA,iHAAiH;QACjH,gGAAgG;QAChG,IAAI;QACJ,IAAI,SAAS,CAAC;YACZ,IAAI,wCAAkB,qCAAe,KAAK,GAAG,GAC3C;YAGF,IAAI,CAAA,GAAA,0CAAe,EAAE,EAAE,MAAM,GAC3B,uDAAuD;YACvD,QAAQ,sBAAsB;gBAC5B,IAAI,CAAC,SAAS,aAAa,IAAI,CAAC,CAAA,GAAA,0CAAe,EAAE,SAAS,aAAa,GACrE,WAAW;oBAAC,OAAO,OAAO,UAAU;oBAAE,QAAQ,OAAO,WAAW;gBAAA;YAEpE;QAEJ;QAEA,WAAW;QAEX,OAAO,gBAAgB,CAAC,QAAQ,QAAQ;QAExC,IAAI,CAAC,sCACH,OAAO,gBAAgB,CAAC,UAAU;aAElC,qCAAe,gBAAgB,CAAC,UAAU;QAG5C,OAAO;YACL,qBAAqB;YACrB,OAAO,mBAAmB,CAAC,QAAQ,QAAQ;YAC3C,IAAI,CAAC,sCACH,OAAO,mBAAmB,CAAC,UAAU;iBAErC,qCAAe,mBAAmB,CAAC,UAAU;QAEjD;IACF,GAAG,EAAE;IAEL,OAAO;AACT;AAEA,SAAS;IACP,OAAO;QACL,+FAA+F;QAC/F,OAAO,uCAAiB,qCAAe,KAAK,GAAG,qCAAe,KAAK,GAAG,OAAO,UAAU;QACvF,QAAQ,uCAAiB,qCAAe,MAAM,GAAG,qCAAe,KAAK,GAAG,OAAO,WAAW;IAC5F;AACF","sources":["packages/@react-aria/utils/src/useViewportSize.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {useEffect, useState} from 'react';\nimport {useIsSSR} from '@react-aria/ssr';\nimport {willOpenKeyboard} from './keyboard';\n\ninterface ViewportSize {\n width: number,\n height: number\n}\n\nlet visualViewport = typeof document !== 'undefined' && window.visualViewport;\n\nexport function useViewportSize(): ViewportSize {\n let isSSR = useIsSSR();\n let [size, setSize] = useState(() => isSSR ? {width: 0, height: 0} : getViewportSize());\n\n useEffect(() => {\n let updateSize = (newSize: ViewportSize) => {\n setSize(size => {\n if (newSize.width === size.width && newSize.height === size.height) {\n return size;\n }\n return newSize;\n });\n };\n\n // Use visualViewport api to track available height even on iOS virtual keyboard opening\n let onResize = () => {\n // Ignore updates when zoomed.\n if (visualViewport && visualViewport.scale > 1) {\n return;\n }\n\n updateSize(getViewportSize());\n };\n\n // When closing the keyboard, iOS does not fire the visual viewport resize event until the animation is complete.\n // We can anticipate this and resize early by handling the blur event and using the layout size.\n let frame: number;\n let onBlur = (e: FocusEvent) => {\n if (visualViewport && visualViewport.scale > 1) {\n return;\n }\n\n if (willOpenKeyboard(e.target as Element)) {\n // Wait one frame to see if a new element gets focused.\n frame = requestAnimationFrame(() => {\n if (!document.activeElement || !willOpenKeyboard(document.activeElement)) {\n updateSize({width: window.innerWidth, height: window.innerHeight});\n }\n });\n }\n };\n\n updateSize(getViewportSize());\n\n window.addEventListener('blur', onBlur, true);\n\n if (!visualViewport) {\n window.addEventListener('resize', onResize);\n } else {\n visualViewport.addEventListener('resize', onResize);\n }\n\n return () => {\n cancelAnimationFrame(frame);\n window.removeEventListener('blur', onBlur, true);\n if (!visualViewport) {\n window.removeEventListener('resize', onResize);\n } else {\n visualViewport.removeEventListener('resize', onResize);\n }\n };\n }, []);\n\n return size;\n}\n\nfunction getViewportSize(): ViewportSize {\n return {\n // Multiply by the visualViewport scale to get the \"natural\" size, unaffected by pinch zooming.\n width: visualViewport ? visualViewport.width * visualViewport.scale : window.innerWidth,\n height: visualViewport ? visualViewport.height * visualViewport.scale : window.innerHeight\n };\n}\n"],"names":[],"version":3,"file":"useViewportSize.main.js.map"}
import {willOpenKeyboard as $21f1aa98acb08317$export$c57958e35f31ed73} from "./keyboard.mjs";
import {useState as $fuDHA$useState, useEffect as $fuDHA$useEffect} from "react";
import {useIsSSR as $fuDHA$useIsSSR} from "@react-aria/ssr";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
let $5df64b3807dc15ee$var$visualViewport = typeof document !== 'undefined' && window.visualViewport;
function $5df64b3807dc15ee$export$d699905dd57c73ca() {
let isSSR = (0, $fuDHA$useIsSSR)();
let [size, setSize] = (0, $fuDHA$useState)(()=>isSSR ? {
width: 0,
height: 0
} : $5df64b3807dc15ee$var$getViewportSize());
(0, $fuDHA$useEffect)(()=>{
let updateSize = (newSize)=>{
setSize((size)=>{
if (newSize.width === size.width && newSize.height === size.height) return size;
return newSize;
});
};
// Use visualViewport api to track available height even on iOS virtual keyboard opening
let onResize = ()=>{
// Ignore updates when zoomed.
if ($5df64b3807dc15ee$var$visualViewport && $5df64b3807dc15ee$var$visualViewport.scale > 1) return;
updateSize($5df64b3807dc15ee$var$getViewportSize());
};
// When closing the keyboard, iOS does not fire the visual viewport resize event until the animation is complete.
// We can anticipate this and resize early by handling the blur event and using the layout size.
let frame;
let onBlur = (e)=>{
if ($5df64b3807dc15ee$var$visualViewport && $5df64b3807dc15ee$var$visualViewport.scale > 1) return;
if ((0, $21f1aa98acb08317$export$c57958e35f31ed73)(e.target)) // Wait one frame to see if a new element gets focused.
frame = requestAnimationFrame(()=>{
if (!document.activeElement || !(0, $21f1aa98acb08317$export$c57958e35f31ed73)(document.activeElement)) updateSize({
width: window.innerWidth,
height: window.innerHeight
});
});
};
updateSize($5df64b3807dc15ee$var$getViewportSize());
window.addEventListener('blur', onBlur, true);
if (!$5df64b3807dc15ee$var$visualViewport) window.addEventListener('resize', onResize);
else $5df64b3807dc15ee$var$visualViewport.addEventListener('resize', onResize);
return ()=>{
cancelAnimationFrame(frame);
window.removeEventListener('blur', onBlur, true);
if (!$5df64b3807dc15ee$var$visualViewport) window.removeEventListener('resize', onResize);
else $5df64b3807dc15ee$var$visualViewport.removeEventListener('resize', onResize);
};
}, []);
return size;
}
function $5df64b3807dc15ee$var$getViewportSize() {
return {
// Multiply by the visualViewport scale to get the "natural" size, unaffected by pinch zooming.
width: $5df64b3807dc15ee$var$visualViewport ? $5df64b3807dc15ee$var$visualViewport.width * $5df64b3807dc15ee$var$visualViewport.scale : window.innerWidth,
height: $5df64b3807dc15ee$var$visualViewport ? $5df64b3807dc15ee$var$visualViewport.height * $5df64b3807dc15ee$var$visualViewport.scale : window.innerHeight
};
}
export {$5df64b3807dc15ee$export$d699905dd57c73ca as useViewportSize};
//# sourceMappingURL=useViewportSize.module.js.map
import {willOpenKeyboard as $21f1aa98acb08317$export$c57958e35f31ed73} from "./keyboard.module.js";
import {useState as $fuDHA$useState, useEffect as $fuDHA$useEffect} from "react";
import {useIsSSR as $fuDHA$useIsSSR} from "@react-aria/ssr";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
let $5df64b3807dc15ee$var$visualViewport = typeof document !== 'undefined' && window.visualViewport;
function $5df64b3807dc15ee$export$d699905dd57c73ca() {
let isSSR = (0, $fuDHA$useIsSSR)();
let [size, setSize] = (0, $fuDHA$useState)(()=>isSSR ? {
width: 0,
height: 0
} : $5df64b3807dc15ee$var$getViewportSize());
(0, $fuDHA$useEffect)(()=>{
let updateSize = (newSize)=>{
setSize((size)=>{
if (newSize.width === size.width && newSize.height === size.height) return size;
return newSize;
});
};
// Use visualViewport api to track available height even on iOS virtual keyboard opening
let onResize = ()=>{
// Ignore updates when zoomed.
if ($5df64b3807dc15ee$var$visualViewport && $5df64b3807dc15ee$var$visualViewport.scale > 1) return;
updateSize($5df64b3807dc15ee$var$getViewportSize());
};
// When closing the keyboard, iOS does not fire the visual viewport resize event until the animation is complete.
// We can anticipate this and resize early by handling the blur event and using the layout size.
let frame;
let onBlur = (e)=>{
if ($5df64b3807dc15ee$var$visualViewport && $5df64b3807dc15ee$var$visualViewport.scale > 1) return;
if ((0, $21f1aa98acb08317$export$c57958e35f31ed73)(e.target)) // Wait one frame to see if a new element gets focused.
frame = requestAnimationFrame(()=>{
if (!document.activeElement || !(0, $21f1aa98acb08317$export$c57958e35f31ed73)(document.activeElement)) updateSize({
width: window.innerWidth,
height: window.innerHeight
});
});
};
updateSize($5df64b3807dc15ee$var$getViewportSize());
window.addEventListener('blur', onBlur, true);
if (!$5df64b3807dc15ee$var$visualViewport) window.addEventListener('resize', onResize);
else $5df64b3807dc15ee$var$visualViewport.addEventListener('resize', onResize);
return ()=>{
cancelAnimationFrame(frame);
window.removeEventListener('blur', onBlur, true);
if (!$5df64b3807dc15ee$var$visualViewport) window.removeEventListener('resize', onResize);
else $5df64b3807dc15ee$var$visualViewport.removeEventListener('resize', onResize);
};
}, []);
return size;
}
function $5df64b3807dc15ee$var$getViewportSize() {
return {
// Multiply by the visualViewport scale to get the "natural" size, unaffected by pinch zooming.
width: $5df64b3807dc15ee$var$visualViewport ? $5df64b3807dc15ee$var$visualViewport.width * $5df64b3807dc15ee$var$visualViewport.scale : window.innerWidth,
height: $5df64b3807dc15ee$var$visualViewport ? $5df64b3807dc15ee$var$visualViewport.height * $5df64b3807dc15ee$var$visualViewport.scale : window.innerHeight
};
}
export {$5df64b3807dc15ee$export$d699905dd57c73ca as useViewportSize};
//# sourceMappingURL=useViewportSize.module.js.map
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAWD,IAAI,uCAAiB,OAAO,aAAa,eAAe,OAAO,cAAc;AAEtE,SAAS;IACd,IAAI,QAAQ,CAAA,GAAA,eAAO;IACnB,IAAI,CAAC,MAAM,QAAQ,GAAG,CAAA,GAAA,eAAO,EAAE,IAAM,QAAQ;YAAC,OAAO;YAAG,QAAQ;QAAC,IAAI;IAErE,CAAA,GAAA,gBAAQ,EAAE;QACR,IAAI,aAAa,CAAC;YAChB,QAAQ,CAAA;gBACN,IAAI,QAAQ,KAAK,KAAK,KAAK,KAAK,IAAI,QAAQ,MAAM,KAAK,KAAK,MAAM,EAChE,OAAO;gBAET,OAAO;YACT;QACF;QAEA,wFAAwF;QACxF,IAAI,WAAW;YACb,8BAA8B;YAC9B,IAAI,wCAAkB,qCAAe,KAAK,GAAG,GAC3C;YAGF,WAAW;QACb;QAEA,iHAAiH;QACjH,gGAAgG;QAChG,IAAI;QACJ,IAAI,SAAS,CAAC;YACZ,IAAI,wCAAkB,qCAAe,KAAK,GAAG,GAC3C;YAGF,IAAI,CAAA,GAAA,yCAAe,EAAE,EAAE,MAAM,GAC3B,uDAAuD;YACvD,QAAQ,sBAAsB;gBAC5B,IAAI,CAAC,SAAS,aAAa,IAAI,CAAC,CAAA,GAAA,yCAAe,EAAE,SAAS,aAAa,GACrE,WAAW;oBAAC,OAAO,OAAO,UAAU;oBAAE,QAAQ,OAAO,WAAW;gBAAA;YAEpE;QAEJ;QAEA,WAAW;QAEX,OAAO,gBAAgB,CAAC,QAAQ,QAAQ;QAExC,IAAI,CAAC,sCACH,OAAO,gBAAgB,CAAC,UAAU;aAElC,qCAAe,gBAAgB,CAAC,UAAU;QAG5C,OAAO;YACL,qBAAqB;YACrB,OAAO,mBAAmB,CAAC,QAAQ,QAAQ;YAC3C,IAAI,CAAC,sCACH,OAAO,mBAAmB,CAAC,UAAU;iBAErC,qCAAe,mBAAmB,CAAC,UAAU;QAEjD;IACF,GAAG,EAAE;IAEL,OAAO;AACT;AAEA,SAAS;IACP,OAAO;QACL,+FAA+F;QAC/F,OAAO,uCAAiB,qCAAe,KAAK,GAAG,qCAAe,KAAK,GAAG,OAAO,UAAU;QACvF,QAAQ,uCAAiB,qCAAe,MAAM,GAAG,qCAAe,KAAK,GAAG,OAAO,WAAW;IAC5F;AACF","sources":["packages/@react-aria/utils/src/useViewportSize.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {useEffect, useState} from 'react';\nimport {useIsSSR} from '@react-aria/ssr';\nimport {willOpenKeyboard} from './keyboard';\n\ninterface ViewportSize {\n width: number,\n height: number\n}\n\nlet visualViewport = typeof document !== 'undefined' && window.visualViewport;\n\nexport function useViewportSize(): ViewportSize {\n let isSSR = useIsSSR();\n let [size, setSize] = useState(() => isSSR ? {width: 0, height: 0} : getViewportSize());\n\n useEffect(() => {\n let updateSize = (newSize: ViewportSize) => {\n setSize(size => {\n if (newSize.width === size.width && newSize.height === size.height) {\n return size;\n }\n return newSize;\n });\n };\n\n // Use visualViewport api to track available height even on iOS virtual keyboard opening\n let onResize = () => {\n // Ignore updates when zoomed.\n if (visualViewport && visualViewport.scale > 1) {\n return;\n }\n\n updateSize(getViewportSize());\n };\n\n // When closing the keyboard, iOS does not fire the visual viewport resize event until the animation is complete.\n // We can anticipate this and resize early by handling the blur event and using the layout size.\n let frame: number;\n let onBlur = (e: FocusEvent) => {\n if (visualViewport && visualViewport.scale > 1) {\n return;\n }\n\n if (willOpenKeyboard(e.target as Element)) {\n // Wait one frame to see if a new element gets focused.\n frame = requestAnimationFrame(() => {\n if (!document.activeElement || !willOpenKeyboard(document.activeElement)) {\n updateSize({width: window.innerWidth, height: window.innerHeight});\n }\n });\n }\n };\n\n updateSize(getViewportSize());\n\n window.addEventListener('blur', onBlur, true);\n\n if (!visualViewport) {\n window.addEventListener('resize', onResize);\n } else {\n visualViewport.addEventListener('resize', onResize);\n }\n\n return () => {\n cancelAnimationFrame(frame);\n window.removeEventListener('blur', onBlur, true);\n if (!visualViewport) {\n window.removeEventListener('resize', onResize);\n } else {\n visualViewport.removeEventListener('resize', onResize);\n }\n };\n }, []);\n\n return size;\n}\n\nfunction getViewportSize(): ViewportSize {\n return {\n // Multiply by the visualViewport scale to get the \"natural\" size, unaffected by pinch zooming.\n width: visualViewport ? visualViewport.width * visualViewport.scale : window.innerWidth,\n height: visualViewport ? visualViewport.height * visualViewport.scale : window.innerHeight\n };\n}\n"],"names":[],"version":3,"file":"useViewportSize.module.js.map"}
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {flushSync} from 'react-dom';
import {RefObject, useCallback, useState} from 'react';
import {useLayoutEffect} from './useLayoutEffect';
export function useEnterAnimation(ref: RefObject<HTMLElement | null>, isReady: boolean = true): boolean {
let [isEntering, setEntering] = useState(true);
let isAnimationReady = isEntering && isReady;
// There are two cases for entry animations:
// 1. CSS @keyframes. The `animation` property is set during the isEntering state, and it is removed after the animation finishes.
// 2. CSS transitions. The initial styles are applied during the isEntering state, and removed immediately, causing the transition to occur.
//
// In the second case, cancel any transitions that were triggered prior to the isEntering = false state (when the transition is supposed to start).
// This can happen when isReady starts as false (e.g. popovers prior to placement calculation).
useLayoutEffect(() => {
if (isAnimationReady && ref.current && 'getAnimations' in ref.current) {
for (let animation of ref.current.getAnimations()) {
if (animation instanceof CSSTransition) {
animation.cancel();
}
}
}
}, [ref, isAnimationReady]);
useAnimation(ref, isAnimationReady, useCallback(() => setEntering(false), []));
return isAnimationReady;
}
export function useExitAnimation(ref: RefObject<HTMLElement | null>, isOpen: boolean): boolean {
let [exitState, setExitState] = useState<'closed' | 'open' | 'exiting'>(isOpen ? 'open' : 'closed');
switch (exitState) {
case 'open':
// If isOpen becomes false, set the state to exiting.
if (!isOpen) {
setExitState('exiting');
}
break;
case 'closed':
case 'exiting':
// If we are exiting and isOpen becomes true, the animation was interrupted.
// Reset the state to open.
if (isOpen) {
setExitState('open');
}
break;
}
let isExiting = exitState === 'exiting';
useAnimation(
ref,
isExiting,
useCallback(() => {
// Set the state to closed, which will cause the element to be unmounted.
setExitState(state => state === 'exiting' ? 'closed' : state);
}, [])
);
return isExiting;
}
function useAnimation(ref: RefObject<HTMLElement | null>, isActive: boolean, onEnd: () => void): void {
useLayoutEffect(() => {
if (isActive && ref.current) {
if (!('getAnimations' in ref.current)) {
// JSDOM
onEnd();
return;
}
let animations = ref.current.getAnimations();
if (animations.length === 0) {
onEnd();
return;
}
let canceled = false;
Promise.all(animations.map(a => a.finished)).then(() => {
if (!canceled) {
flushSync(() => {
onEnd();
});
}
}).catch(() => {});
return () => {
canceled = true;
};
}
}, [ref, isActive, onEnd]);
}
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
/**
* Calls all functions in the order they were chained with the same arguments.
*/
export function chain(...callbacks: any[]): (...args: any[]) => void {
return (...args: any[]) => {
for (let callback of callbacks) {
if (typeof callback === 'function') {
callback(...args);
}
}
};
}
/*
* Copyright 2024 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
// Custom event names for updating the autocomplete's aria-activedecendant.
export const CLEAR_FOCUS_EVENT = 'react-aria-clear-focus';
export const FOCUS_EVENT = 'react-aria-focus';
export const getOwnerDocument = (el: Element | null | undefined): Document => {
return el?.ownerDocument ?? document;
};
export const getOwnerWindow = (
el: (Window & typeof globalThis) | Element | null | undefined
): Window & typeof globalThis => {
if (el && 'window' in el && el.window === el) {
return el;
}
const doc = getOwnerDocument(el as Element | null | undefined);
return doc.defaultView || window;
};
/**
* Type guard that checks if a value is a Node. Verifies the presence and type of the nodeType property.
*/
function isNode(value: unknown): value is Node {
return value !== null &&
typeof value === 'object' &&
'nodeType' in value &&
typeof (value as Node).nodeType === 'number';
}
/**
* Type guard that checks if a node is a ShadowRoot. Uses nodeType and host property checks to
* distinguish ShadowRoot from other DocumentFragments.
*/
export function isShadowRoot(node: Node | null): node is ShadowRoot {
return isNode(node) &&
node.nodeType === Node.DOCUMENT_FRAGMENT_NODE &&
'host' in node;
}
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {AriaLabelingProps, DOMProps, GlobalDOMAttributes, LinkDOMProps} from '@react-types/shared';
const DOMPropNames = new Set([
'id'
]);
const labelablePropNames = new Set([
'aria-label',
'aria-labelledby',
'aria-describedby',
'aria-details'
]);
// See LinkDOMProps in dom.d.ts.
const linkPropNames = new Set([
'href',
'hrefLang',
'target',
'rel',
'download',
'ping',
'referrerPolicy'
]);
const globalAttrs = new Set([
'dir',
'lang',
'hidden',
'inert',
'translate'
]);
const globalEvents = new Set([
'onClick',
'onAuxClick',
'onContextMenu',
'onDoubleClick',
'onMouseDown',
'onMouseEnter',
'onMouseLeave',
'onMouseMove',
'onMouseOut',
'onMouseOver',
'onMouseUp',
'onTouchCancel',
'onTouchEnd',
'onTouchMove',
'onTouchStart',
'onPointerDown',
'onPointerMove',
'onPointerUp',
'onPointerCancel',
'onPointerEnter',
'onPointerLeave',
'onPointerOver',
'onPointerOut',
'onGotPointerCapture',
'onLostPointerCapture',
'onScroll',
'onWheel',
'onAnimationStart',
'onAnimationEnd',
'onAnimationIteration',
'onTransitionCancel',
'onTransitionEnd',
'onTransitionRun',
'onTransitionStart'
]);
interface Options {
/**
* If labelling associated aria properties should be included in the filter.
*/
labelable?: boolean,
/** Whether the element is a link and should include DOM props for <a> elements. */
isLink?: boolean,
/** Whether to include global DOM attributes. */
global?: boolean,
/** Whether to include DOM events. */
events?: boolean,
/**
* A Set of other property names that should be included in the filter.
*/
propNames?: Set<string>
}
const propRe = /^(data-.*)$/;
/**
* Filters out all props that aren't valid DOM props or defined via override prop obj.
* @param props - The component props to be filtered.
* @param opts - Props to override.
*/
export function filterDOMProps(props: DOMProps & AriaLabelingProps & LinkDOMProps & GlobalDOMAttributes, opts: Options = {}): DOMProps & AriaLabelingProps & GlobalDOMAttributes {
let {labelable, isLink, global, events = global, propNames} = opts;
let filteredProps = {};
for (const prop in props) {
if (
Object.prototype.hasOwnProperty.call(props, prop) && (
DOMPropNames.has(prop) ||
(labelable && labelablePropNames.has(prop)) ||
(isLink && linkPropNames.has(prop)) ||
(global && globalAttrs.has(prop)) ||
(events && (globalEvents.has(prop) || (prop.endsWith('Capture') && globalEvents.has(prop.slice(0, -7))))) ||
propNames?.has(prop) ||
propRe.test(prop)
)
) {
filteredProps[prop] = props[prop];
}
}
return filteredProps;
}
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {FocusableElement} from '@react-types/shared';
// This is a polyfill for element.focus({preventScroll: true});
// Currently necessary for Safari and old Edge:
// https://caniuse.com/#feat=mdn-api_htmlelement_focus_preventscroll_option
// See https://bugs.webkit.org/show_bug.cgi?id=178583
//
// Original licensing for the following methods can be found in the
// NOTICE file in the root directory of this source tree.
// See https://github.com/calvellido/focus-options-polyfill
interface ScrollableElement {
element: HTMLElement,
scrollTop: number,
scrollLeft: number
}
export function focusWithoutScrolling(element: FocusableElement): void {
if (supportsPreventScroll()) {
element.focus({preventScroll: true});
} else {
let scrollableElements = getScrollableElements(element);
element.focus();
restoreScrollPosition(scrollableElements);
}
}
let supportsPreventScrollCached: boolean | null = null;
function supportsPreventScroll() {
if (supportsPreventScrollCached == null) {
supportsPreventScrollCached = false;
try {
let focusElem = document.createElement('div');
focusElem.focus({
get preventScroll() {
supportsPreventScrollCached = true;
return true;
}
});
} catch {
// Ignore
}
}
return supportsPreventScrollCached;
}
function getScrollableElements(element: FocusableElement): ScrollableElement[] {
let parent = element.parentNode;
let scrollableElements: ScrollableElement[] = [];
let rootScrollingElement = document.scrollingElement || document.documentElement;
while (parent instanceof HTMLElement && parent !== rootScrollingElement) {
if (
parent.offsetHeight < parent.scrollHeight ||
parent.offsetWidth < parent.scrollWidth
) {
scrollableElements.push({
element: parent,
scrollTop: parent.scrollTop,
scrollLeft: parent.scrollLeft
});
}
parent = parent.parentNode;
}
if (rootScrollingElement instanceof HTMLElement) {
scrollableElements.push({
element: rootScrollingElement,
scrollTop: rootScrollingElement.scrollTop,
scrollLeft: rootScrollingElement.scrollLeft
});
}
return scrollableElements;
}
function restoreScrollPosition(scrollableElements: ScrollableElement[]) {
for (let {element, scrollTop, scrollLeft} of scrollableElements) {
element.scrollTop = scrollTop;
element.scrollLeft = scrollLeft;
}
}
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {Orientation} from '@react-types/shared';
export function getOffset(element: HTMLElement, reverse?: boolean, orientation: Orientation = 'horizontal'): number {
let rect = element.getBoundingClientRect();
if (reverse) {
return orientation === 'horizontal' ? rect.right : rect.bottom;
}
return orientation === 'horizontal' ? rect.left : rect.top;
}
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {isScrollable} from './isScrollable';
export function getScrollParent(node: Element, checkForOverflow?: boolean): Element {
let scrollableNode: Element | null = node;
if (isScrollable(scrollableNode, checkForOverflow)) {
scrollableNode = scrollableNode.parentElement;
}
while (scrollableNode && !isScrollable(scrollableNode, checkForOverflow)) {
scrollableNode = scrollableNode.parentElement;
}
return scrollableNode || document.scrollingElement || document.documentElement;
}
/*
* Copyright 2024 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {isScrollable} from './isScrollable';
export function getScrollParents(node: Element, checkForOverflow?: boolean): Element[] {
const scrollParents: Element[] = [];
while (node && node !== document.documentElement) {
if (isScrollable(node, checkForOverflow)) {
scrollParents.push(node);
}
node = node.parentElement as Element;
}
return scrollParents;
}
import {version} from 'react';
export function inertValue(value?: boolean): string | boolean | undefined {
const pieces = version.split('.');
const major = parseInt(pieces[0], 10);
if (major >= 19) {
return value;
}
// compatibility with React < 19
return value ? 'true' : undefined;
}
/*
* Copyright 2021 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {getOwnerWindow} from './domHelpers';
const supportsCheckVisibility = typeof Element !== 'undefined' && 'checkVisibility' in Element.prototype;
function isStyleVisible(element: Element) {
const windowObject = getOwnerWindow(element);
if (!(element instanceof windowObject.HTMLElement) && !(element instanceof windowObject.SVGElement)) {
return false;
}
let {display, visibility} = element.style;
let isVisible = (
display !== 'none' &&
visibility !== 'hidden' &&
visibility !== 'collapse'
);
if (isVisible) {
const {getComputedStyle} = element.ownerDocument.defaultView as unknown as Window;
let {display: computedDisplay, visibility: computedVisibility} = getComputedStyle(element);
isVisible = (
computedDisplay !== 'none' &&
computedVisibility !== 'hidden' &&
computedVisibility !== 'collapse'
);
}
return isVisible;
}
function isAttributeVisible(element: Element, childElement?: Element) {
return (
!element.hasAttribute('hidden') &&
// Ignore HiddenSelect when tree walking.
!element.hasAttribute('data-react-aria-prevent-focus') &&
(element.nodeName === 'DETAILS' &&
childElement &&
childElement.nodeName !== 'SUMMARY'
? element.hasAttribute('open')
: true)
);
}
/**
* Adapted from https://github.com/testing-library/jest-dom and
* https://github.com/vuejs/vue-test-utils-next/.
* Licensed under the MIT License.
* @param element - Element to evaluate for display or visibility.
*/
export function isElementVisible(element: Element, childElement?: Element): boolean {
if (supportsCheckVisibility) {
return element.checkVisibility({visibilityProperty: true}) && !element.closest('[data-react-aria-prevent-focus]');
}
return (
element.nodeName !== '#comment' &&
isStyleVisible(element) &&
isAttributeVisible(element, childElement) &&
(!element.parentElement || isElementVisible(element.parentElement, element))
);
}
/*
* Copyright 2025 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {isElementVisible} from './isElementVisible';
const focusableElements = [
'input:not([disabled]):not([type=hidden])',
'select:not([disabled])',
'textarea:not([disabled])',
'button:not([disabled])',
'a[href]',
'area[href]',
'summary',
'iframe',
'object',
'embed',
'audio[controls]',
'video[controls]',
'[contenteditable]:not([contenteditable^="false"])',
'permission'
];
const FOCUSABLE_ELEMENT_SELECTOR = focusableElements.join(':not([hidden]),') + ',[tabindex]:not([disabled]):not([hidden])';
focusableElements.push('[tabindex]:not([tabindex="-1"]):not([disabled])');
const TABBABLE_ELEMENT_SELECTOR = focusableElements.join(':not([hidden]):not([tabindex="-1"]),');
export function isFocusable(element: Element): boolean {
return element.matches(FOCUSABLE_ELEMENT_SELECTOR) && isElementVisible(element) && !isInert(element);
}
export function isTabbable(element: Element): boolean {
return element.matches(TABBABLE_ELEMENT_SELECTOR) && isElementVisible(element) && !isInert(element);
}
function isInert(element: Element): boolean {
let node: Element | null = element;
while (node != null) {
if (node instanceof node.ownerDocument.defaultView!.HTMLElement && node.inert) {
return true;
}
node = node.parentElement;
}
return false;
}
/*
* Copyright 2024 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
export function isScrollable(node: Element | null, checkForOverflow?: boolean): boolean {
if (!node) {
return false;
}
let style = window.getComputedStyle(node);
let isScrollable = /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY);
if (isScrollable && checkForOverflow) {
isScrollable = node.scrollHeight !== node.clientHeight || node.scrollWidth !== node.clientWidth;
}
return isScrollable;
}
/*
* Copyright 2022 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {isAndroid} from './platform';
// Original licensing for the following method can be found in the
// NOTICE file in the root directory of this source tree.
// See https://github.com/facebook/react/blob/3c713d513195a53788b3f8bb4b70279d68b15bcc/packages/react-interactions/events/src/dom/shared/index.js#L74-L87
// Keyboards, Assistive Technologies, and element.click() all produce a "virtual"
// click event. This is a method of inferring such clicks. Every browser except
// IE 11 only sets a zero value of "detail" for click events that are "virtual".
// However, IE 11 uses a zero value for all click events. For IE 11 we rely on
// the quirk that it produces click events that are of type PointerEvent, and
// where only the "virtual" click lacks a pointerType field.
export function isVirtualClick(event: MouseEvent | PointerEvent): boolean {
// JAWS/NVDA with Firefox.
if ((event as PointerEvent).pointerType === '' && event.isTrusted) {
return true;
}
// Android TalkBack's detail value varies depending on the event listener providing the event so we have specific logic here instead
// If pointerType is defined, event is from a click listener. For events from mousedown listener, detail === 0 is a sufficient check
// to detect TalkBack virtual clicks.
if (isAndroid() && (event as PointerEvent).pointerType) {
return event.type === 'click' && event.buttons === 1;
}
return event.detail === 0 && !(event as PointerEvent).pointerType;
}
export function isVirtualPointerEvent(event: PointerEvent): boolean {
// If the pointer size is zero, then we assume it's from a screen reader.
// Android TalkBack double tap will sometimes return a event with width and height of 1
// and pointerType === 'mouse' so we need to check for a specific combination of event attributes.
// Cannot use "event.pressure === 0" as the sole check due to Safari pointer events always returning pressure === 0
// instead of .5, see https://bugs.webkit.org/show_bug.cgi?id=206216. event.pointerType === 'mouse' is to distingush
// Talkback double tap from Windows Firefox touch screen press
return (
(!isAndroid() && event.width === 0 && event.height === 0) ||
(event.width === 1 &&
event.height === 1 &&
event.pressure === 0 &&
event.detail === 0 &&
event.pointerType === 'mouse'
)
);
}
/*
* Copyright 2024 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {isMac} from './platform';
interface Event {
altKey: boolean,
ctrlKey: boolean,
metaKey: boolean
}
export function isCtrlKeyPressed(e: Event): boolean {
if (isMac()) {
return e.metaKey;
}
return e.ctrlKey;
}
// HTML input types that do not cause the software keyboard to appear.
const nonTextInputTypes = new Set([
'checkbox',
'radio',
'range',
'color',
'file',
'image',
'button',
'submit',
'reset'
]);
export function willOpenKeyboard(target: Element) {
return (
(target instanceof HTMLInputElement && !nonTextInputTypes.has(target.type)) ||
target instanceof HTMLTextAreaElement ||
(target instanceof HTMLElement && target.isContentEditable)
);
}
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {chain} from './chain';
import clsx from 'clsx';
import {mergeIds} from './useId';
interface Props {
[key: string]: any
}
type PropsArg = Props | null | undefined;
// taken from: https://stackoverflow.com/questions/51603250/typescript-3-parameter-list-intersection-type/51604379#51604379
type TupleTypes<T> = { [P in keyof T]: T[P] } extends { [key: number]: infer V } ? NullToObject<V> : never;
type NullToObject<T> = T extends (null | undefined) ? {} : T;
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
/**
* Merges multiple props objects together. Event handlers are chained,
* classNames are combined, and ids are deduplicated.
* For all other props, the last prop object overrides all previous ones.
* @param args - Multiple sets of props to merge together.
*/
export function mergeProps<T extends PropsArg[]>(...args: T): UnionToIntersection<TupleTypes<T>> {
// Start with a base clone of the first argument. This is a lot faster than starting
// with an empty object and adding properties as we go.
let result: Props = {...args[0]};
for (let i = 1; i < args.length; i++) {
let props = args[i];
for (let key in props) {
let a = result[key];
let b = props[key];
// Chain events
if (
typeof a === 'function' &&
typeof b === 'function' &&
// This is a lot faster than a regex.
key[0] === 'o' &&
key[1] === 'n' &&
key.charCodeAt(2) >= /* 'A' */ 65 &&
key.charCodeAt(2) <= /* 'Z' */ 90
) {
result[key] = chain(a, b);
// Merge classnames, sometimes classNames are empty string which eval to false, so we just need to do a type check
} else if (
(key === 'className' || key === 'UNSAFE_className') &&
typeof a === 'string' &&
typeof b === 'string'
) {
result[key] = clsx(a, b);
} else if (key === 'id' && a && b) {
result.id = mergeIds(a, b);
// Override others
} else {
result[key] = b !== undefined ? b : a;
}
}
}
return result as UnionToIntersection<TupleTypes<T>>;
}
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {MutableRefObject, Ref} from 'react';
/**
* Merges multiple refs into one. Works with either callback or object refs.
*/
export function mergeRefs<T>(...refs: Array<Ref<T> | MutableRefObject<T> | null | undefined>): Ref<T> {
if (refs.length === 1 && refs[0]) {
return refs[0];
}
return (value: T | null) => {
let hasCleanup = false;
const cleanups = refs.map(ref => {
const cleanup = setRef(ref, value);
hasCleanup ||= typeof cleanup == 'function';
return cleanup;
});
if (hasCleanup) {
return () => {
cleanups.forEach((cleanup, i) => {
if (typeof cleanup === 'function') {
cleanup();
} else {
setRef(refs[i], null);
}
});
};
}
};
}
function setRef<T>(ref: Ref<T> | MutableRefObject<T> | null | undefined, value: T) {
if (typeof ref === 'function') {
return ref(value);
} else if (ref != null) {
ref.current = value;
}
}
/*
* Copyright 2023 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {focusWithoutScrolling, isMac, isWebKit} from './index';
import {Href, LinkDOMProps, RouterOptions} from '@react-types/shared';
import {isFirefox, isIPad} from './platform';
import React, {createContext, DOMAttributes, JSX, MouseEvent as ReactMouseEvent, ReactNode, useContext, useMemo} from 'react';
interface Router {
isNative: boolean,
open: (target: Element, modifiers: Modifiers, href: Href, routerOptions: RouterOptions | undefined) => void,
useHref: (href: Href) => string
}
const RouterContext = createContext<Router>({
isNative: true,
open: openSyntheticLink,
useHref: (href) => href
});
interface RouterProviderProps {
navigate: (path: Href, routerOptions: RouterOptions | undefined) => void,
useHref?: (href: Href) => string,
children: ReactNode
}
/**
* A RouterProvider accepts a `navigate` function from a framework or client side router,
* and provides it to all nested React Aria links to enable client side navigation.
*/
export function RouterProvider(props: RouterProviderProps): JSX.Element {
let {children, navigate, useHref} = props;
let ctx = useMemo(() => ({
isNative: false,
open: (target: Element, modifiers: Modifiers, href: Href, routerOptions: RouterOptions | undefined) => {
getSyntheticLink(target, link => {
if (shouldClientNavigate(link, modifiers)) {
navigate(href, routerOptions);
} else {
openLink(link, modifiers);
}
});
},
useHref: useHref || ((href) => href)
}), [navigate, useHref]);
return (
<RouterContext.Provider value={ctx}>
{children}
</RouterContext.Provider>
);
}
export function useRouter(): Router {
return useContext(RouterContext);
}
interface Modifiers {
metaKey?: boolean,
ctrlKey?: boolean,
altKey?: boolean,
shiftKey?: boolean
}
export function shouldClientNavigate(link: HTMLAnchorElement, modifiers: Modifiers): boolean {
// Use getAttribute here instead of link.target. Firefox will default link.target to "_parent" when inside an iframe.
let target = link.getAttribute('target');
return (
(!target || target === '_self') &&
link.origin === location.origin &&
!link.hasAttribute('download') &&
!modifiers.metaKey && // open in new tab (mac)
!modifiers.ctrlKey && // open in new tab (windows)
!modifiers.altKey && // download
!modifiers.shiftKey
);
}
export function openLink(target: HTMLAnchorElement, modifiers: Modifiers, setOpening = true): void {
let {metaKey, ctrlKey, altKey, shiftKey} = modifiers;
// Firefox does not recognize keyboard events as a user action by default, and the popup blocker
// will prevent links with target="_blank" from opening. However, it does allow the event if the
// Command/Control key is held, which opens the link in a background tab. This seems like the best we can do.
// See https://bugzilla.mozilla.org/show_bug.cgi?id=257870 and https://bugzilla.mozilla.org/show_bug.cgi?id=746640.
if (isFirefox() && window.event?.type?.startsWith('key') && target.target === '_blank') {
if (isMac()) {
metaKey = true;
} else {
ctrlKey = true;
}
}
// WebKit does not support firing click events with modifier keys, but does support keyboard events.
// https://github.com/WebKit/WebKit/blob/c03d0ac6e6db178f90923a0a63080b5ca210d25f/Source/WebCore/html/HTMLAnchorElement.cpp#L184
let event = isWebKit() && isMac() && !isIPad() && process.env.NODE_ENV !== 'test'
// @ts-ignore - keyIdentifier is a non-standard property, but it's what webkit expects
? new KeyboardEvent('keydown', {keyIdentifier: 'Enter', metaKey, ctrlKey, altKey, shiftKey})
: new MouseEvent('click', {metaKey, ctrlKey, altKey, shiftKey, detail: 1, bubbles: true, cancelable: true});
(openLink as any).isOpening = setOpening;
focusWithoutScrolling(target);
target.dispatchEvent(event);
(openLink as any).isOpening = false;
}
// https://github.com/parcel-bundler/parcel/issues/8724
(openLink as any).isOpening = false;
function getSyntheticLink(target: Element, open: (link: HTMLAnchorElement) => void) {
if (target instanceof HTMLAnchorElement) {
open(target);
} else if (target.hasAttribute('data-href')) {
let link = document.createElement('a');
link.href = target.getAttribute('data-href')!;
if (target.hasAttribute('data-target')) {
link.target = target.getAttribute('data-target')!;
}
if (target.hasAttribute('data-rel')) {
link.rel = target.getAttribute('data-rel')!;
}
if (target.hasAttribute('data-download')) {
link.download = target.getAttribute('data-download')!;
}
if (target.hasAttribute('data-ping')) {
link.ping = target.getAttribute('data-ping')!;
}
if (target.hasAttribute('data-referrer-policy')) {
link.referrerPolicy = target.getAttribute('data-referrer-policy')!;
}
target.appendChild(link);
open(link);
target.removeChild(link);
}
}
function openSyntheticLink(target: Element, modifiers: Modifiers) {
getSyntheticLink(target, link => openLink(link, modifiers));
}
export function useSyntheticLinkProps(props: LinkDOMProps): DOMAttributes<HTMLElement> {
let router = useRouter();
const href = router.useHref(props.href ?? '');
return {
'data-href': props.href ? href : undefined,
'data-target': props.target,
'data-rel': props.rel,
'data-download': props.download,
'data-ping': props.ping,
'data-referrer-policy': props.referrerPolicy
} as DOMAttributes<HTMLElement>;
}
/** @deprecated - For backward compatibility. */
export function getSyntheticLinkProps(props: LinkDOMProps): DOMAttributes<HTMLElement> {
return {
'data-href': props.href,
'data-target': props.target,
'data-rel': props.rel,
'data-download': props.download,
'data-ping': props.ping,
'data-referrer-policy': props.referrerPolicy
} as DOMAttributes<HTMLElement>;
}
export function useLinkProps(props?: LinkDOMProps): LinkDOMProps {
let router = useRouter();
const href = router.useHref(props?.href ?? '');
return {
href: props?.href ? href : undefined,
target: props?.target,
rel: props?.rel,
download: props?.download,
ping: props?.ping,
referrerPolicy: props?.referrerPolicy
};
}
export function handleLinkClick(e: ReactMouseEvent, router: Router, href: Href | undefined, routerOptions: RouterOptions | undefined): void {
// If a custom router is provided, prevent default and forward if this link should client navigate.
if (
!router.isNative &&
e.currentTarget instanceof HTMLAnchorElement &&
e.currentTarget.href &&
// If props are applied to a router Link component, it may have already prevented default.
!e.isDefaultPrevented() &&
shouldClientNavigate(e.currentTarget, e) &&
href
) {
e.preventDefault();
router.open(e.currentTarget, e, href, routerOptions);
}
}
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function testUserAgent(re: RegExp) {
if (typeof window === 'undefined' || window.navigator == null) {
return false;
}
let brands = window.navigator['userAgentData']?.brands;
return Array.isArray(brands) && brands.some((brand: {brand: string, version: string}) => re.test(brand.brand)) ||
re.test(window.navigator.userAgent);
}
function testPlatform(re: RegExp) {
return typeof window !== 'undefined' && window.navigator != null
? re.test(window.navigator['userAgentData']?.platform || window.navigator.platform)
: false;
}
function cached(fn: () => boolean) {
if (process.env.NODE_ENV === 'test') {
return fn;
}
let res: boolean | null = null;
return () => {
if (res == null) {
res = fn();
}
return res;
};
}
export const isMac: () => boolean = cached(function () {
return testPlatform(/^Mac/i);
});
export const isIPhone: () => boolean = cached(function () {
return testPlatform(/^iPhone/i);
});
export const isIPad: () => boolean = cached(function () {
return testPlatform(/^iPad/i) ||
// iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
(isMac() && navigator.maxTouchPoints > 1);
});
export const isIOS: () => boolean = cached(function () {
return isIPhone() || isIPad();
});
export const isAppleDevice: () => boolean = cached(function () {
return isMac() || isIOS();
});
export const isWebKit: () => boolean = cached(function () {
return testUserAgent(/AppleWebKit/i) && !isChrome();
});
export const isChrome: () => boolean = cached(function () {
return testUserAgent(/Chrome/i);
});
export const isAndroid: () => boolean = cached(function () {
return testUserAgent(/Android/i);
});
export const isFirefox: () => boolean = cached(function () {
return testUserAgent(/Firefox/i);
});
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
// We store a global list of elements that are currently transitioning,
// mapped to a set of CSS properties that are transitioning for that element.
// This is necessary rather than a simple count of transitions because of browser
// bugs, e.g. Chrome sometimes fires both transitionend and transitioncancel rather
// than one or the other. So we need to track what's actually transitioning so that
// we can ignore these duplicate events.
let transitionsByElement = new Map<EventTarget, Set<string>>();
// A list of callbacks to call once there are no transitioning elements.
let transitionCallbacks = new Set<() => void>();
function setupGlobalEvents() {
if (typeof window === 'undefined') {
return;
}
function isTransitionEvent(event: Event): event is TransitionEvent {
return 'propertyName' in event;
}
let onTransitionStart = (e: Event) => {
if (!isTransitionEvent(e) || !e.target) {
return;
}
// Add the transitioning property to the list for this element.
let transitions = transitionsByElement.get(e.target);
if (!transitions) {
transitions = new Set();
transitionsByElement.set(e.target, transitions);
// The transitioncancel event must be registered on the element itself, rather than as a global
// event. This enables us to handle when the node is deleted from the document while it is transitioning.
// In that case, the cancel event would have nowhere to bubble to so we need to handle it directly.
e.target.addEventListener('transitioncancel', onTransitionEnd, {
once: true
});
}
transitions.add(e.propertyName);
};
let onTransitionEnd = (e: Event) => {
if (!isTransitionEvent(e) || !e.target) {
return;
}
// Remove property from list of transitioning properties.
let properties = transitionsByElement.get(e.target);
if (!properties) {
return;
}
properties.delete(e.propertyName);
// If empty, remove transitioncancel event, and remove the element from the list of transitioning elements.
if (properties.size === 0) {
e.target.removeEventListener('transitioncancel', onTransitionEnd);
transitionsByElement.delete(e.target);
}
// If no transitioning elements, call all of the queued callbacks.
if (transitionsByElement.size === 0) {
for (let cb of transitionCallbacks) {
cb();
}
transitionCallbacks.clear();
}
};
document.body.addEventListener('transitionrun', onTransitionStart);
document.body.addEventListener('transitionend', onTransitionEnd);
}
if (typeof document !== 'undefined') {
if (document.readyState !== 'loading') {
setupGlobalEvents();
} else {
document.addEventListener('DOMContentLoaded', setupGlobalEvents);
}
}
/**
* Cleans up any elements that are no longer in the document.
* This is necessary because we can't rely on transitionend events to fire
* for elements that are removed from the document while transitioning.
*/
function cleanupDetachedElements() {
for (const [eventTarget] of transitionsByElement) {
// Similar to `eventTarget instanceof Element && !eventTarget.isConnected`, but avoids
// the explicit instanceof check, since it may be different in different contexts.
if ('isConnected' in eventTarget && !eventTarget.isConnected) {
transitionsByElement.delete(eventTarget);
}
}
}
export function runAfterTransition(fn: () => void): void {
// Wait one frame to see if an animation starts, e.g. a transition on mount.
requestAnimationFrame(() => {
cleanupDetachedElements();
// If no transitions are running, call the function immediately.
// Otherwise, add it to a list of callbacks to run at the end of the animation.
if (transitionsByElement.size === 0) {
fn();
} else {
transitionCallbacks.add(fn);
}
});
}
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {getScrollParents} from './getScrollParents';
interface ScrollIntoViewportOpts {
/** The optional containing element of the target to be centered in the viewport. */
containingElement?: Element | null
}
/**
* Scrolls `scrollView` so that `element` is visible.
* Similar to `element.scrollIntoView({block: 'nearest'})` (not supported in Edge),
* but doesn't affect parents above `scrollView`.
*/
export function scrollIntoView(scrollView: HTMLElement, element: HTMLElement): void {
let offsetX = relativeOffset(scrollView, element, 'left');
let offsetY = relativeOffset(scrollView, element, 'top');
let width = element.offsetWidth;
let height = element.offsetHeight;
let x = scrollView.scrollLeft;
let y = scrollView.scrollTop;
// Account for top/left border offsetting the scroll top/Left + scroll padding
let {
borderTopWidth,
borderLeftWidth,
scrollPaddingTop,
scrollPaddingRight,
scrollPaddingBottom,
scrollPaddingLeft
} = getComputedStyle(scrollView);
let borderAdjustedX = x + parseInt(borderLeftWidth, 10);
let borderAdjustedY = y + parseInt(borderTopWidth, 10);
// Ignore end/bottom border via clientHeight/Width instead of offsetHeight/Width
let maxX = borderAdjustedX + scrollView.clientWidth;
let maxY = borderAdjustedY + scrollView.clientHeight;
// Get scroll padding values as pixels - defaults to 0 if no scroll padding
// is used.
let scrollPaddingTopNumber = parseInt(scrollPaddingTop, 10) || 0;
let scrollPaddingBottomNumber = parseInt(scrollPaddingBottom, 10) || 0;
let scrollPaddingRightNumber = parseInt(scrollPaddingRight, 10) || 0;
let scrollPaddingLeftNumber = parseInt(scrollPaddingLeft, 10) || 0;
if (offsetX <= x + scrollPaddingLeftNumber) {
x = offsetX - parseInt(borderLeftWidth, 10) - scrollPaddingLeftNumber;
} else if (offsetX + width > maxX - scrollPaddingRightNumber) {
x += offsetX + width - maxX + scrollPaddingRightNumber;
}
if (offsetY <= borderAdjustedY + scrollPaddingTopNumber) {
y = offsetY - parseInt(borderTopWidth, 10) - scrollPaddingTopNumber;
} else if (offsetY + height > maxY - scrollPaddingBottomNumber) {
y += offsetY + height - maxY + scrollPaddingBottomNumber;
}
scrollView.scrollLeft = x;
scrollView.scrollTop = y;
}
/**
* Computes the offset left or top from child to ancestor by accumulating
* offsetLeft or offsetTop through intervening offsetParents.
*/
function relativeOffset(ancestor: HTMLElement, child: HTMLElement, axis: 'left'|'top') {
const prop = axis === 'left' ? 'offsetLeft' : 'offsetTop';
let sum = 0;
while (child.offsetParent) {
sum += child[prop];
if (child.offsetParent === ancestor) {
// Stop once we have found the ancestor we are interested in.
break;
} else if (child.offsetParent.contains(ancestor)) {
// If the ancestor is not `position:relative`, then we stop at
// _its_ offset parent, and we subtract off _its_ offset, so that
// we end up with the proper offset from child to ancestor.
sum -= ancestor[prop];
break;
}
child = child.offsetParent as HTMLElement;
}
return sum;
}
/**
* Scrolls the `targetElement` so it is visible in the viewport. Accepts an optional `opts.containingElement`
* that will be centered in the viewport prior to scrolling the targetElement into view. If scrolling is prevented on
* the body (e.g. targetElement is in a popover), this will only scroll the scroll parents of the targetElement up to but not including the body itself.
*/
export function scrollIntoViewport(targetElement: Element | null, opts?: ScrollIntoViewportOpts): void {
if (targetElement && document.contains(targetElement)) {
let root = document.scrollingElement || document.documentElement;
let isScrollPrevented = window.getComputedStyle(root).overflow === 'hidden';
// If scrolling is not currently prevented then we aren’t in a overlay nor is a overlay open, just use element.scrollIntoView to bring the element into view
if (!isScrollPrevented) {
let {left: originalLeft, top: originalTop} = targetElement.getBoundingClientRect();
// use scrollIntoView({block: 'nearest'}) instead of .focus to check if the element is fully in view or not since .focus()
// 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
targetElement?.scrollIntoView?.({block: 'nearest'});
let {left: newLeft, top: newTop} = targetElement.getBoundingClientRect();
// Account for sub pixel differences from rounding
if ((Math.abs(originalLeft - newLeft) > 1) || (Math.abs(originalTop - newTop) > 1)) {
opts?.containingElement?.scrollIntoView?.({block: 'center', inline: 'center'});
targetElement.scrollIntoView?.({block: 'nearest'});
}
} else {
let scrollParents = getScrollParents(targetElement);
// If scrolling is prevented, we don't want to scroll the body since it might move the overlay partially offscreen and the user can't scroll it back into view.
if (!isScrollPrevented) {
scrollParents.push(root);
}
for (let scrollParent of scrollParents) {
scrollIntoView(scrollParent as HTMLElement, targetElement as HTMLElement);
}
}
}
}
// Source: https://github.com/microsoft/tabster/blob/a89fc5d7e332d48f68d03b1ca6e344489d1c3898/src/Shadowdomize/DOMFunctions.ts#L16
import {isShadowRoot} from '../domHelpers';
import {shadowDOM} from '@react-stately/flags';
/**
* ShadowDOM safe version of Node.contains.
*/
export function nodeContains(
node: Node | null | undefined,
otherNode: Node | null | undefined
): boolean {
if (!shadowDOM()) {
return otherNode && node ? node.contains(otherNode) : false;
}
if (!node || !otherNode) {
return false;
}
let currentNode: HTMLElement | Node | null | undefined = otherNode;
while (currentNode !== null) {
if (currentNode === node) {
return true;
}
if ((currentNode as HTMLSlotElement).tagName === 'SLOT' &&
(currentNode as HTMLSlotElement).assignedSlot) {
// Element is slotted
currentNode = (currentNode as HTMLSlotElement).assignedSlot!.parentNode;
} else if (isShadowRoot(currentNode)) {
// Element is in shadow root
currentNode = currentNode.host;
} else {
currentNode = currentNode.parentNode;
}
}
return false;
}
/**
* ShadowDOM safe version of document.activeElement.
*/
export const getActiveElement = (doc: Document = document): Element | null => {
if (!shadowDOM()) {
return doc.activeElement;
}
let activeElement: Element | null = doc.activeElement;
while (activeElement && 'shadowRoot' in activeElement &&
activeElement.shadowRoot?.activeElement) {
activeElement = activeElement.shadowRoot.activeElement;
}
return activeElement;
};
/**
* ShadowDOM safe version of event.target.
*/
export function getEventTarget<T extends Event>(event: T): Element {
if (shadowDOM() && (event.target as HTMLElement).shadowRoot) {
if (event.composedPath) {
return event.composedPath()[0] as Element;
}
}
return event.target as Element;
}
// https://github.com/microsoft/tabster/blob/a89fc5d7e332d48f68d03b1ca6e344489d1c3898/src/Shadowdomize/ShadowTreeWalker.ts
import {nodeContains} from './DOMFunctions';
import {shadowDOM} from '@react-stately/flags';
export class ShadowTreeWalker implements TreeWalker {
public readonly filter: NodeFilter | null;
public readonly root: Node;
public readonly whatToShow: number;
private _doc: Document;
private _walkerStack: Array<TreeWalker> = [];
private _currentNode: Node;
private _currentSetFor: Set<TreeWalker> = new Set();
constructor(
doc: Document,
root: Node,
whatToShow?: number,
filter?: NodeFilter | null
) {
this._doc = doc;
this.root = root;
this.filter = filter ?? null;
this.whatToShow = whatToShow ?? NodeFilter.SHOW_ALL;
this._currentNode = root;
this._walkerStack.unshift(
doc.createTreeWalker(root, whatToShow, this._acceptNode)
);
const shadowRoot = (root as Element).shadowRoot;
if (shadowRoot) {
const walker = this._doc.createTreeWalker(
shadowRoot,
this.whatToShow,
{acceptNode: this._acceptNode}
);
this._walkerStack.unshift(walker);
}
}
private _acceptNode = (node: Node): number => {
if (node.nodeType === Node.ELEMENT_NODE) {
const shadowRoot = (node as Element).shadowRoot;
if (shadowRoot) {
const walker = this._doc.createTreeWalker(
shadowRoot,
this.whatToShow,
{acceptNode: this._acceptNode}
);
this._walkerStack.unshift(walker);
return NodeFilter.FILTER_ACCEPT;
} else {
if (typeof this.filter === 'function') {
return this.filter(node);
} else if (this.filter?.acceptNode) {
return this.filter.acceptNode(node);
} else if (this.filter === null) {
return NodeFilter.FILTER_ACCEPT;
}
}
}
return NodeFilter.FILTER_SKIP;
};
public get currentNode(): Node {
return this._currentNode;
}
public set currentNode(node: Node) {
if (!nodeContains(this.root, node)) {
throw new Error(
'Cannot set currentNode to a node that is not contained by the root node.'
);
}
const walkers: TreeWalker[] = [];
let curNode: Node | null | undefined = node;
let currentWalkerCurrentNode = node;
this._currentNode = node;
while (curNode && curNode !== this.root) {
if (curNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
const shadowRoot = curNode as ShadowRoot;
const walker = this._doc.createTreeWalker(
shadowRoot,
this.whatToShow,
{acceptNode: this._acceptNode}
);
walkers.push(walker);
walker.currentNode = currentWalkerCurrentNode;
this._currentSetFor.add(walker);
curNode = currentWalkerCurrentNode = shadowRoot.host;
} else {
curNode = curNode.parentNode;
}
}
const walker = this._doc.createTreeWalker(
this.root,
this.whatToShow,
{acceptNode: this._acceptNode}
);
walkers.push(walker);
walker.currentNode = currentWalkerCurrentNode;
this._currentSetFor.add(walker);
this._walkerStack = walkers;
}
public get doc(): Document {
return this._doc;
}
public firstChild(): Node | null {
let currentNode = this.currentNode;
let newNode = this.nextNode();
if (!nodeContains(currentNode, newNode)) {
this.currentNode = currentNode;
return null;
}
if (newNode) {
this.currentNode = newNode;
}
return newNode;
}
public lastChild(): Node | null {
let walker = this._walkerStack[0];
let newNode = walker.lastChild();
if (newNode) {
this.currentNode = newNode;
}
return newNode;
}
public nextNode(): Node | null {
const nextNode = this._walkerStack[0].nextNode();
if (nextNode) {
const shadowRoot = (nextNode as Element).shadowRoot;
if (shadowRoot) {
let nodeResult: number | undefined;
if (typeof this.filter === 'function') {
nodeResult = this.filter(nextNode);
} else if (this.filter?.acceptNode) {
nodeResult = this.filter.acceptNode(nextNode);
}
if (nodeResult === NodeFilter.FILTER_ACCEPT) {
this.currentNode = nextNode;
return nextNode;
}
// _acceptNode should have added new walker for this shadow,
// go in recursively.
let newNode = this.nextNode();
if (newNode) {
this.currentNode = newNode;
}
return newNode;
}
if (nextNode) {
this.currentNode = nextNode;
}
return nextNode;
} else {
if (this._walkerStack.length > 1) {
this._walkerStack.shift();
let newNode = this.nextNode();
if (newNode) {
this.currentNode = newNode;
}
return newNode;
} else {
return null;
}
}
}
public previousNode(): Node | null {
const currentWalker = this._walkerStack[0];
if (currentWalker.currentNode === currentWalker.root) {
if (this._currentSetFor.has(currentWalker)) {
this._currentSetFor.delete(currentWalker);
if (this._walkerStack.length > 1) {
this._walkerStack.shift();
let newNode = this.previousNode();
if (newNode) {
this.currentNode = newNode;
}
return newNode;
} else {
return null;
}
}
return null;
}
const previousNode = currentWalker.previousNode();
if (previousNode) {
const shadowRoot = (previousNode as Element).shadowRoot;
if (shadowRoot) {
let nodeResult: number | undefined;
if (typeof this.filter === 'function') {
nodeResult = this.filter(previousNode);
} else if (this.filter?.acceptNode) {
nodeResult = this.filter.acceptNode(previousNode);
}
if (nodeResult === NodeFilter.FILTER_ACCEPT) {
if (previousNode) {
this.currentNode = previousNode;
}
return previousNode;
}
// _acceptNode should have added new walker for this shadow,
// go in recursively.
let newNode = this.lastChild();
if (newNode) {
this.currentNode = newNode;
}
return newNode;
}
if (previousNode) {
this.currentNode = previousNode;
}
return previousNode;
} else {
if (this._walkerStack.length > 1) {
this._walkerStack.shift();
let newNode = this.previousNode();
if (newNode) {
this.currentNode = newNode;
}
return newNode;
} else {
return null;
}
}
}
/**
* @deprecated
*/
public nextSibling(): Node | null {
// if (__DEV__) {
// throw new Error("Method not implemented.");
// }
return null;
}
/**
* @deprecated
*/
public previousSibling(): Node | null {
// if (__DEV__) {
// throw new Error("Method not implemented.");
// }
return null;
}
/**
* @deprecated
*/
public parentNode(): Node | null {
// if (__DEV__) {
// throw new Error("Method not implemented.");
// }
return null;
}
}
/**
* ShadowDOM safe version of document.createTreeWalker.
*/
export function createShadowTreeWalker(
doc: Document,
root: Node,
whatToShow?: number,
filter?: NodeFilter | null
): TreeWalker {
if (shadowDOM()) {
return new ShadowTreeWalker(doc, root, whatToShow, filter);
}
return doc.createTreeWalker(root, whatToShow, filter);
}
/*
* Copyright 2023 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
/* eslint-disable rulesdir/pure-render */
import {useRef} from 'react';
export function useDeepMemo<T>(value: T, isEqual: (a: T, b: T) => boolean): T {
// Using a ref during render is ok here because it's only an optimization – both values are equivalent.
// If a render is thrown away, it'll still work the same no matter if the next render is the same or not.
let lastValue = useRef<T | null>(null);
if (value && lastValue.current && isEqual(value, lastValue.current)) {
value = lastValue.current;
}
lastValue.current = value;
return value;
}
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {AriaLabelingProps} from '@react-types/shared';
import {useLayoutEffect} from './useLayoutEffect';
import {useState} from 'react';
let descriptionId = 0;
const descriptionNodes = new Map<string, {refCount: number, element: Element}>();
export function useDescription(description?: string): AriaLabelingProps {
let [id, setId] = useState<string | undefined>();
useLayoutEffect(() => {
if (!description) {
return;
}
let desc = descriptionNodes.get(description);
if (!desc) {
let id = `react-aria-description-${descriptionId++}`;
setId(id);
let node = document.createElement('div');
node.id = id;
node.style.display = 'none';
node.textContent = description;
document.body.appendChild(node);
desc = {refCount: 0, element: node};
descriptionNodes.set(description, desc);
} else {
setId(desc.element.id);
}
desc.refCount++;
return () => {
if (desc && --desc.refCount === 0) {
desc.element.remove();
descriptionNodes.delete(description);
}
};
}, [description]);
return {
'aria-describedby': description ? id : undefined
};
}
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
/* eslint-disable rulesdir/pure-render */
import {getOffset} from './getOffset';
import {Orientation} from '@react-types/shared';
import React, {HTMLAttributes, MutableRefObject, useRef} from 'react';
interface UseDrag1DProps {
containerRef: MutableRefObject<HTMLElement>,
reverse?: boolean,
orientation?: Orientation,
onHover?: (hovered: boolean) => void,
onDrag?: (dragging: boolean) => void,
onPositionChange?: (position: number) => void,
onIncrement?: () => void,
onDecrement?: () => void,
onIncrementToMax?: () => void,
onDecrementToMin?: () => void,
onCollapseToggle?: () => void
}
// Keep track of elements that we are currently handling dragging for via useDrag1D.
// If there's an ancestor and a descendant both using useDrag1D(), and the user starts
// dragging the descendant, we don't want useDrag1D events to fire for the ancestor.
const draggingElements: HTMLElement[] = [];
// created for splitview, this should be reusable for things like sliders/dials
// It also handles keyboard events on the target allowing for increment/decrement by a given stepsize as well as minifying/maximizing and toggling between minified and previous size
// It can also take a 'reverse' param to say if we should measure from the right/bottom instead of the top/left
// It can also handle either a vertical or horizontal movement, but not both at the same time
export function useDrag1D(props: UseDrag1DProps): HTMLAttributes<HTMLElement> {
console.warn('useDrag1D is deprecated, please use `useMove` instead https://react-spectrum.adobe.com/react-aria/useMove.html');
let {containerRef, reverse, orientation, onHover, onDrag, onPositionChange, onIncrement, onDecrement, onIncrementToMax, onDecrementToMin, onCollapseToggle} = props;
let getPosition = (e) => orientation === 'horizontal' ? e.clientX : e.clientY;
let getNextOffset = (e: MouseEvent) => {
let containerOffset = getOffset(containerRef.current, reverse, orientation);
let mouseOffset = getPosition(e);
let nextOffset = reverse ? containerOffset - mouseOffset : mouseOffset - containerOffset;
return nextOffset;
};
let dragging = useRef(false);
let prevPosition = useRef(0);
// Keep track of the current handlers in a ref so that the events can access them.
let handlers = useRef({onPositionChange, onDrag});
handlers.current.onDrag = onDrag;
handlers.current.onPositionChange = onPositionChange;
let onMouseDragged = (e: MouseEvent) => {
e.preventDefault();
let nextOffset = getNextOffset(e);
if (!dragging.current) {
dragging.current = true;
if (handlers.current.onDrag) {
handlers.current.onDrag(true);
}
if (handlers.current.onPositionChange) {
handlers.current.onPositionChange(nextOffset);
}
}
if (prevPosition.current === nextOffset) {
return;
}
prevPosition.current = nextOffset;
if (onPositionChange) {
onPositionChange(nextOffset);
}
};
let onMouseUp = (e: MouseEvent) => {
const target = e.target as HTMLElement;
dragging.current = false;
let nextOffset = getNextOffset(e);
if (handlers.current.onDrag) {
handlers.current.onDrag(false);
}
if (handlers.current.onPositionChange) {
handlers.current.onPositionChange(nextOffset);
}
draggingElements.splice(draggingElements.indexOf(target), 1);
window.removeEventListener('mouseup', onMouseUp, false);
window.removeEventListener('mousemove', onMouseDragged, false);
};
let onMouseDown = (e: React.MouseEvent<HTMLElement>) => {
const target = e.currentTarget;
// If we're already handling dragging on a descendant with useDrag1D, then
// we don't want to handle the drag motion on this target as well.
if (draggingElements.some(elt => target.contains(elt))) {
return;
}
draggingElements.push(target);
window.addEventListener('mousemove', onMouseDragged, false);
window.addEventListener('mouseup', onMouseUp, false);
};
let onMouseEnter = () => {
if (onHover) {
onHover(true);
}
};
let onMouseOut = () => {
if (onHover) {
onHover(false);
}
};
let onKeyDown = (e) => {
switch (e.key) {
case 'Left':
case 'ArrowLeft':
if (orientation === 'horizontal') {
e.preventDefault();
if (onDecrement && !reverse) {
onDecrement();
} else if (onIncrement && reverse) {
onIncrement();
}
}
break;
case 'Up':
case 'ArrowUp':
if (orientation === 'vertical') {
e.preventDefault();
if (onDecrement && !reverse) {
onDecrement();
} else if (onIncrement && reverse) {
onIncrement();
}
}
break;
case 'Right':
case 'ArrowRight':
if (orientation === 'horizontal') {
e.preventDefault();
if (onIncrement && !reverse) {
onIncrement();
} else if (onDecrement && reverse) {
onDecrement();
}
}
break;
case 'Down':
case 'ArrowDown':
if (orientation === 'vertical') {
e.preventDefault();
if (onIncrement && !reverse) {
onIncrement();
} else if (onDecrement && reverse) {
onDecrement();
}
}
break;
case 'Home':
e.preventDefault();
if (onDecrementToMin) {
onDecrementToMin();
}
break;
case 'End':
e.preventDefault();
if (onIncrementToMax) {
onIncrementToMax();
}
break;
case 'Enter':
e.preventDefault();
if (onCollapseToggle) {
onCollapseToggle();
}
break;
}
};
return {onMouseDown, onMouseEnter, onMouseOut, onKeyDown};
}
/*
* Copyright 2023 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import React, {useCallback, useRef} from 'react';
import {useLayoutEffect} from './useLayoutEffect';
// Use the earliest effect type possible. useInsertionEffect runs during the mutation phase,
// before all layout effects, but is available only in React 18 and later.
const useEarlyEffect = React['useInsertionEffect'] ?? useLayoutEffect;
// Starting with React 19.2, this hook has been internalized.
const useModernEffectEvent = React['useEffectEvent'] ?? useLegacyEffectEvent;
function useLegacyEffectEvent<T extends Function>(fn?: T): T {
const ref = useRef<T | null | undefined>(null);
useEarlyEffect(() => {
ref.current = fn;
}, [fn]);
// @ts-ignore
return useCallback<T>((...args) => {
const f = ref.current!;
return f?.(...args);
}, []);
}
export function useEffectEvent<T extends Function>(fn: T): T {
return useModernEffectEvent(fn);
}
/*
* Copyright 2021 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {RefObject} from '@react-types/shared';
import {useCallback, useEffect} from 'react';
import {useEffectEvent} from './useEffectEvent';
export function useEvent<K extends keyof GlobalEventHandlersEventMap>(
ref: RefObject<EventTarget | null>,
event: K | (string & {}),
handler?: (this: Document, ev: GlobalEventHandlersEventMap[K]) => any,
options?: boolean | AddEventListenerOptions
): void {
let noop = useCallback(() => {}, []);
let handleEvent = useEffectEvent(handler ?? noop);
let isDisabled = handler == null;
useEffect(() => {
if (isDisabled || !ref.current) {
return;
}
let element = ref.current;
element.addEventListener(event, handleEvent as EventListener, options);
return () => {
element.removeEventListener(event, handleEvent as EventListener, options);
};
}, [ref, event, options, isDisabled]);
}
/*
* Copyright 2023 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {RefObject} from '@react-types/shared';
import {useEffect} from 'react';
import {useEffectEvent} from './useEffectEvent';
export function useFormReset<T>(
ref: RefObject<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement | null> | undefined,
initialValue: T,
onReset: (value: T) => void
): void {
let handleReset = useEffectEvent(() => {
if (onReset) {
onReset(initialValue);
}
});
useEffect(() => {
let form = ref?.current?.form;
form?.addEventListener('reset', handleReset);
return () => {
form?.removeEventListener('reset', handleReset);
};
}, [ref]);
}
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {useCallback, useEffect, useRef} from 'react';
interface GlobalListeners {
addGlobalListener<K extends keyof WindowEventMap>(el: Window, type: K, listener: (this: Document, ev: WindowEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void,
addGlobalListener<K extends keyof DocumentEventMap>(el: EventTarget, type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void,
addGlobalListener(el: EventTarget, type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void,
removeGlobalListener<K extends keyof DocumentEventMap>(el: EventTarget, type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void,
removeGlobalListener(el: EventTarget, type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void,
removeAllGlobalListeners(): void
}
export function useGlobalListeners(): GlobalListeners {
let globalListeners = useRef(new Map());
let addGlobalListener = useCallback((eventTarget, type, listener, options) => {
// Make sure we remove the listener after it is called with the `once` option.
let fn = options?.once ? (...args) => {
globalListeners.current.delete(listener);
listener(...args);
} : listener;
globalListeners.current.set(listener, {type, eventTarget, fn, options});
eventTarget.addEventListener(type, fn, options);
}, []);
let removeGlobalListener = useCallback((eventTarget, type, listener, options) => {
let fn = globalListeners.current.get(listener)?.fn || listener;
eventTarget.removeEventListener(type, fn, options);
globalListeners.current.delete(listener);
}, []);
let removeAllGlobalListeners = useCallback(() => {
globalListeners.current.forEach((value, key) => {
removeGlobalListener(value.eventTarget, value.type, key, value.options);
});
}, [removeGlobalListener]);
useEffect(() => {
return removeAllGlobalListeners;
}, [removeAllGlobalListeners]);
return {addGlobalListener, removeGlobalListener, removeAllGlobalListeners};
}
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {useCallback, useEffect, useRef, useState} from 'react';
import {useLayoutEffect} from './useLayoutEffect';
import {useSSRSafeId} from '@react-aria/ssr';
import {useValueEffect} from './';
// copied from SSRProvider.tsx to reduce exports, if needed again, consider sharing
let canUseDOM = Boolean(
typeof window !== 'undefined' &&
window.document &&
window.document.createElement
);
export let idsUpdaterMap: Map<string, { current: string | null }[]> = new Map();
// This allows us to clean up the idsUpdaterMap when the id is no longer used.
// Map is a strong reference, so unused ids wouldn't be cleaned up otherwise.
// This can happen in suspended components where mount/unmount is not called.
let registry;
if (typeof FinalizationRegistry !== 'undefined') {
registry = new FinalizationRegistry<string>((heldValue) => {
idsUpdaterMap.delete(heldValue);
});
}
/**
* If a default is not provided, generate an id.
* @param defaultId - Default component id.
*/
export function useId(defaultId?: string): string {
let [value, setValue] = useState(defaultId);
let nextId = useRef(null);
let res = useSSRSafeId(value);
let cleanupRef = useRef(null);
if (registry) {
registry.register(cleanupRef, res);
}
if (canUseDOM) {
const cacheIdRef = idsUpdaterMap.get(res);
if (cacheIdRef && !cacheIdRef.includes(nextId)) {
cacheIdRef.push(nextId);
} else {
idsUpdaterMap.set(res, [nextId]);
}
}
useLayoutEffect(() => {
let r = res;
return () => {
// In Suspense, the cleanup function may be not called
// when it is though, also remove it from the finalization registry.
if (registry) {
registry.unregister(cleanupRef);
}
idsUpdaterMap.delete(r);
};
}, [res]);
// This cannot cause an infinite loop because the ref is always cleaned up.
// eslint-disable-next-line
useEffect(() => {
let newId = nextId.current;
if (newId) { setValue(newId); }
return () => {
if (newId) { nextId.current = null; }
};
});
return res;
}
/**
* Merges two ids.
* Different ids will trigger a side-effect and re-render components hooked up with `useId`.
*/
export function mergeIds(idA: string, idB: string): string {
if (idA === idB) {
return idA;
}
let setIdsA = idsUpdaterMap.get(idA);
if (setIdsA) {
setIdsA.forEach(ref => (ref.current = idB));
return idB;
}
let setIdsB = idsUpdaterMap.get(idB);
if (setIdsB) {
setIdsB.forEach((ref) => (ref.current = idA));
return idA;
}
return idB;
}
/**
* Used to generate an id, and after render, check if that id is rendered so we know
* if we can use it in places such as labelledby.
* @param depArray - When to recalculate if the id is in the DOM.
*/
export function useSlotId(depArray: ReadonlyArray<any> = []): string {
let id = useId();
let [resolvedId, setResolvedId] = useValueEffect(id);
let updateId = useCallback(() => {
setResolvedId(function *() {
yield id;
yield document.getElementById(id) ? id : undefined;
});
}, [id, setResolvedId]);
useLayoutEffect(updateId, [id, updateId, ...depArray]);
return resolvedId;
}
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {AriaLabelingProps, DOMProps} from '@react-types/shared';
import {useId} from './useId';
/**
* Merges aria-label and aria-labelledby into aria-labelledby when both exist.
* @param props - Aria label props.
* @param defaultLabel - Default value for aria-label when not present.
*/
export function useLabels(props: DOMProps & AriaLabelingProps, defaultLabel?: string): DOMProps & AriaLabelingProps {
let {
id,
'aria-label': label,
'aria-labelledby': labelledBy
} = props;
// If there is both an aria-label and aria-labelledby,
// combine them by pointing to the element itself.
id = useId(id);
if (labelledBy && label) {
let ids = new Set([id, ...labelledBy.trim().split(/\s+/)]);
labelledBy = [...ids].join(' ');
} else if (labelledBy) {
labelledBy = labelledBy.trim().split(/\s+/).join(' ');
}
// If no labels are provided, use the default
if (!label && !labelledBy && defaultLabel) {
label = defaultLabel;
}
return {
id,
'aria-label': label,
'aria-labelledby': labelledBy
};
}
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import React from 'react';
// During SSR, React emits a warning when calling useLayoutEffect.
// Since neither useLayoutEffect nor useEffect run on the server,
// we can suppress this by replace it with a noop on the server.
export const useLayoutEffect: typeof React.useLayoutEffect = typeof document !== 'undefined'
? React.useLayoutEffect
: () => {};
/*
* Copyright 2024 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {RefObject, useCallback, useRef} from 'react';
import {useEvent} from './useEvent';
import {useLayoutEffect} from './useLayoutEffect';
export interface LoadMoreProps {
/** Whether data is currently being loaded. */
isLoading?: boolean,
/** Handler that is called when more items should be loaded, e.g. while scrolling near the bottom. */
onLoadMore?: () => void,
/**
* The amount of offset from the bottom of your scrollable region that should trigger load more.
* Uses a percentage value relative to the scroll body's client height. Load more is then triggered
* when your current scroll position's distance from the bottom of the currently loaded list of items is less than
* or equal to the provided value. (e.g. 1 = 100% of the scroll region's height).
* @default 1
*/
scrollOffset?: number,
/** The data currently loaded. */
items?: any
}
export function useLoadMore(props: LoadMoreProps, ref: RefObject<HTMLElement | null>): void {
let {isLoading, onLoadMore, scrollOffset = 1, items} = props;
// Handle scrolling, and call onLoadMore when nearing the bottom.
let isLoadingRef = useRef(isLoading);
let prevProps = useRef(props);
let onScroll = useCallback(() => {
if (ref.current && !isLoadingRef.current && onLoadMore) {
let shouldLoadMore = ref.current.scrollHeight - ref.current.scrollTop - ref.current.clientHeight < ref.current.clientHeight * scrollOffset;
if (shouldLoadMore) {
isLoadingRef.current = true;
onLoadMore();
}
}
}, [onLoadMore, ref, scrollOffset]);
let lastItems = useRef(items);
useLayoutEffect(() => {
// Only update isLoadingRef if props object actually changed,
// not if a local state change occurred.
if (props !== prevProps.current) {
isLoadingRef.current = isLoading;
prevProps.current = props;
}
// TODO: Eventually this hook will move back into RAC during which we will accept the collection as a option to this hook.
// We will only load more if the collection has changed after the last load to prevent multiple onLoadMore from being called
// while the data from the last onLoadMore is being processed by RAC collection.
let shouldLoadMore = ref?.current
&& !isLoadingRef.current
&& onLoadMore
&& (!items || items !== lastItems.current)
&& ref.current.clientHeight === ref.current.scrollHeight;
if (shouldLoadMore) {
isLoadingRef.current = true;
onLoadMore?.();
}
lastItems.current = items;
}, [isLoading, onLoadMore, props, ref, items]);
// TODO: maybe this should still just return scroll props?
// Test against case where the ref isn't defined when this is called
// Think this was a problem when trying to attach to the scrollable body of the table in OnLoadMoreTableBodyScroll
useEvent(ref, 'scroll', onScroll);
}
/*
* Copyright 2024 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import type {AsyncLoadable, Collection} from '@react-types/shared';
import {getScrollParent} from './getScrollParent';
import {RefObject, useRef} from 'react';
import {useEffectEvent} from './useEffectEvent';
import {useLayoutEffect} from './useLayoutEffect';
export interface LoadMoreSentinelProps extends Omit<AsyncLoadable, 'isLoading'> {
collection: Collection<any>,
/**
* The amount of offset from the bottom of your scrollable region that should trigger load more.
* Uses a percentage value relative to the scroll body's client height. Load more is then triggered
* when your current scroll position's distance from the bottom of the currently loaded list of items is less than
* or equal to the provided value. (e.g. 1 = 100% of the scroll region's height).
* @default 1
*/
scrollOffset?: number
}
export function useLoadMoreSentinel(props: LoadMoreSentinelProps, ref: RefObject<HTMLElement | null>): void {
let {collection, onLoadMore, scrollOffset = 1} = props;
let sentinelObserver = useRef<IntersectionObserver>(null);
let triggerLoadMore = useEffectEvent((entries: IntersectionObserverEntry[]) => {
// Use "isIntersecting" over an equality check of 0 since it seems like there is cases where
// a intersection ratio of 0 can be reported when isIntersecting is actually true
for (let entry of entries) {
// Note that this will be called if the collection changes, even if onLoadMore was already called and is being processed.
// Up to user discretion as to how to handle these multiple onLoadMore calls
if (entry.isIntersecting && onLoadMore) {
onLoadMore();
}
}
});
useLayoutEffect(() => {
if (ref.current) {
// Tear down and set up a new IntersectionObserver when the collection changes so that we can properly trigger additional loadMores if there is room for more items
// Need to do this tear down and set up since using a large rootMargin will mean the observer's callback isn't called even when scrolling the item into view beause its visibility hasn't actually changed
// https://codesandbox.io/p/sandbox/magical-swanson-dhgp89?file=%2Fsrc%2FApp.js%3A21%2C21
sentinelObserver.current = new IntersectionObserver(triggerLoadMore, {root: getScrollParent(ref?.current) as HTMLElement, rootMargin: `0px ${100 * scrollOffset}% ${100 * scrollOffset}% ${100 * scrollOffset}%`});
sentinelObserver.current.observe(ref.current);
}
return () => {
if (sentinelObserver.current) {
sentinelObserver.current.disconnect();
}
};
}, [collection, ref, scrollOffset]);
}
/*
* Copyright 2021 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {MutableRefObject, useCallback, useMemo, useRef} from 'react';
/**
* Offers an object ref for a given callback ref or an object ref. Especially
* helfpul when passing forwarded refs (created using `React.forwardRef`) to
* React Aria hooks.
*
* @param ref The original ref intended to be used.
* @returns An object ref that updates the given ref.
* @see https://react.dev/reference/react/forwardRef
*/
export function useObjectRef<T>(ref?: ((instance: T | null) => (() => void) | void) | MutableRefObject<T | null> | null): MutableRefObject<T | null> {
const objRef: MutableRefObject<T | null> = useRef<T>(null);
const cleanupRef: MutableRefObject<(() => void) | void> = useRef(undefined);
const refEffect = useCallback(
(instance: T | null) => {
if (typeof ref === 'function') {
const refCallback = ref;
const refCleanup = refCallback(instance);
return () => {
if (typeof refCleanup === 'function') {
refCleanup();
} else {
refCallback(null);
}
};
} else if (ref) {
ref.current = instance;
return () => {
ref.current = null;
};
}
},
[ref]
);
return useMemo(
() => ({
get current() {
return objRef.current;
},
set current(value) {
objRef.current = value;
if (cleanupRef.current) {
cleanupRef.current();
cleanupRef.current = undefined;
}
if (value != null) {
cleanupRef.current = refEffect(value);
}
}
}),
[refEffect]
);
}
import {RefObject} from '@react-types/shared';
import {useEffect} from 'react';
import {useEffectEvent} from './useEffectEvent';
function hasResizeObserver() {
return typeof window.ResizeObserver !== 'undefined';
}
type useResizeObserverOptionsType<T> = {
ref: RefObject<T | undefined | null> | undefined,
box?: ResizeObserverBoxOptions,
onResize: () => void
}
export function useResizeObserver<T extends Element>(options: useResizeObserverOptionsType<T>): void {
// Only call onResize from inside the effect, otherwise we'll void our assumption that
// useEffectEvents are safe to pass in.
const {ref, box, onResize} = options;
let onResizeEvent = useEffectEvent(onResize);
useEffect(() => {
let element = ref?.current;
if (!element) {
return;
}
if (!hasResizeObserver()) {
window.addEventListener('resize', onResizeEvent, false);
return () => {
window.removeEventListener('resize', onResizeEvent, false);
};
} else {
const resizeObserverInstance = new window.ResizeObserver((entries) => {
if (!entries.length) {
return;
}
onResizeEvent();
});
resizeObserverInstance.observe(element, {box});
return () => {
if (element) {
resizeObserverInstance.unobserve(element);
}
};
}
}, [ref, box]);
}
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {MutableRefObject} from 'react';
import {RefObject} from '@react-types/shared';
import {useLayoutEffect} from './';
interface ContextValue<T> {
ref?: MutableRefObject<T | null>
}
// Syncs ref from context with ref passed to hook
export function useSyncRef<T>(context?: ContextValue<T> | null, ref?: RefObject<T | null>): void {
useLayoutEffect(() => {
if (context && context.ref && ref) {
context.ref.current = ref.current;
return () => {
if (context.ref) {
context.ref.current = null;
}
};
}
});
}
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {EffectCallback, useEffect, useRef} from 'react';
import {useEffectEvent} from './useEffectEvent';
// Like useEffect, but only called for updates after the initial render.
export function useUpdateEffect(cb: EffectCallback, dependencies: any[]): void {
const isInitialMount = useRef(true);
const lastDeps = useRef<any[] | null>(null);
let cbEvent = useEffectEvent(cb);
useEffect(() => {
isInitialMount.current = true;
return () => {
isInitialMount.current = false;
};
}, []);
useEffect(() => {
let prevDeps = lastDeps.current;
if (isInitialMount.current) {
isInitialMount.current = false;
} else if (!prevDeps || dependencies.some((dep, i) => !Object.is(dep, prevDeps[i]))) {
cbEvent();
}
lastDeps.current = dependencies;
// eslint-disable-next-line react-hooks/exhaustive-deps
}, dependencies);
}
/*
* Copyright 2024 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {EffectCallback, useRef} from 'react';
import {useLayoutEffect} from './useLayoutEffect';
// Like useLayoutEffect, but only called for updates after the initial render.
export function useUpdateLayoutEffect(effect: EffectCallback, dependencies: any[]): void {
const isInitialMount = useRef(true);
const lastDeps = useRef<any[] | null>(null);
useLayoutEffect(() => {
isInitialMount.current = true;
return () => {
isInitialMount.current = false;
};
}, []);
useLayoutEffect(() => {
if (isInitialMount.current) {
isInitialMount.current = false;
} else if (!lastDeps.current || dependencies.some((dep, i) => !Object.is(dep, lastDeps[i]))) {
effect();
}
lastDeps.current = dependencies;
// eslint-disable-next-line react-hooks/exhaustive-deps
}, dependencies);
}
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {Dispatch, RefObject, useCallback, useRef, useState} from 'react';
import {useLayoutEffect} from './';
type SetValueAction<S> = (prev: S) => Generator<any, void, unknown>;
// This hook works like `useState`, but when setting the value, you pass a generator function
// that can yield multiple values. Each yielded value updates the state and waits for the next
// layout effect, then continues the generator. This allows sequential updates to state to be
// written linearly.
export function useValueEffect<S>(defaultValue: S | (() => S)): [S, Dispatch<SetValueAction<S>>] {
let [value, setValue] = useState(defaultValue);
// Keep an up to date copy of value in a ref so we can access the current value in the generator.
// This allows us to maintain a stable queue function.
let currValue = useRef(value);
let effect: RefObject<Generator<S> | null> = useRef<Generator<S> | null>(null);
// Store the function in a ref so we can always access the current version
// which has the proper `value` in scope.
let nextRef = useRef(() => {
if (!effect.current) {
return;
}
// Run the generator to the next yield.
let newValue = effect.current.next();
// If the generator is done, reset the effect.
if (newValue.done) {
effect.current = null;
return;
}
// If the value is the same as the current value,
// then continue to the next yield. Otherwise,
// set the value in state and wait for the next layout effect.
if (currValue.current === newValue.value) {
nextRef.current();
} else {
setValue(newValue.value);
}
});
useLayoutEffect(() => {
currValue.current = value;
// If there is an effect currently running, continue to the next yield.
if (effect.current) {
nextRef.current();
}
});
let queue = useCallback(fn => {
effect.current = fn(currValue.current);
nextRef.current();
}, [nextRef]);
return [value, queue];
}
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {useEffect, useState} from 'react';
import {useIsSSR} from '@react-aria/ssr';
import {willOpenKeyboard} from './keyboard';
interface ViewportSize {
width: number,
height: number
}
let visualViewport = typeof document !== 'undefined' && window.visualViewport;
export function useViewportSize(): ViewportSize {
let isSSR = useIsSSR();
let [size, setSize] = useState(() => isSSR ? {width: 0, height: 0} : getViewportSize());
useEffect(() => {
let updateSize = (newSize: ViewportSize) => {
setSize(size => {
if (newSize.width === size.width && newSize.height === size.height) {
return size;
}
return newSize;
});
};
// Use visualViewport api to track available height even on iOS virtual keyboard opening
let onResize = () => {
// Ignore updates when zoomed.
if (visualViewport && visualViewport.scale > 1) {
return;
}
updateSize(getViewportSize());
};
// When closing the keyboard, iOS does not fire the visual viewport resize event until the animation is complete.
// We can anticipate this and resize early by handling the blur event and using the layout size.
let frame: number;
let onBlur = (e: FocusEvent) => {
if (visualViewport && visualViewport.scale > 1) {
return;
}
if (willOpenKeyboard(e.target as Element)) {
// Wait one frame to see if a new element gets focused.
frame = requestAnimationFrame(() => {
if (!document.activeElement || !willOpenKeyboard(document.activeElement)) {
updateSize({width: window.innerWidth, height: window.innerHeight});
}
});
}
};
updateSize(getViewportSize());
window.addEventListener('blur', onBlur, true);
if (!visualViewport) {
window.addEventListener('resize', onResize);
} else {
visualViewport.addEventListener('resize', onResize);
}
return () => {
cancelAnimationFrame(frame);
window.removeEventListener('blur', onBlur, true);
if (!visualViewport) {
window.removeEventListener('resize', onResize);
} else {
visualViewport.removeEventListener('resize', onResize);
}
};
}, []);
return size;
}
function getViewportSize(): ViewportSize {
return {
// Multiply by the visualViewport scale to get the "natural" size, unaffected by pinch zooming.
width: visualViewport ? visualViewport.width * visualViewport.scale : window.innerWidth,
height: visualViewport ? visualViewport.height * visualViewport.scale : window.innerHeight
};
}