@protonradio/proton-ui 0.11.18-beta.7 → 0.11.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Modal/Modal.cjs.js +1 -1
- package/dist/components/Modal/Modal.cjs.js.map +1 -1
- package/dist/components/Modal/Modal.es.js +59 -79
- package/dist/components/Modal/Modal.es.js.map +1 -1
- package/dist/node_modules/@react-aria/focus/dist/FocusScope.cjs.js +1 -1
- package/dist/node_modules/@react-aria/focus/dist/FocusScope.cjs.js.map +1 -1
- package/dist/node_modules/@react-aria/focus/dist/FocusScope.es.js +50 -399
- package/dist/node_modules/@react-aria/focus/dist/FocusScope.es.js.map +1 -1
- package/package.json +1 -1
- package/dist/node_modules/@react-aria/button/dist/useButton.cjs.js +0 -2
- package/dist/node_modules/@react-aria/button/dist/useButton.cjs.js.map +0 -1
- package/dist/node_modules/@react-aria/button/dist/useButton.es.js +0 -55
- package/dist/node_modules/@react-aria/button/dist/useButton.es.js.map +0 -1
- package/dist/node_modules/@react-aria/interactions/dist/useInteractOutside.cjs.js +0 -2
- package/dist/node_modules/@react-aria/interactions/dist/useInteractOutside.cjs.js.map +0 -1
- package/dist/node_modules/@react-aria/interactions/dist/useInteractOutside.es.js +0 -51
- package/dist/node_modules/@react-aria/interactions/dist/useInteractOutside.es.js.map +0 -1
- package/dist/node_modules/@react-aria/overlays/dist/ariaHideOutside.cjs.js +0 -2
- package/dist/node_modules/@react-aria/overlays/dist/ariaHideOutside.cjs.js.map +0 -1
- package/dist/node_modules/@react-aria/overlays/dist/ariaHideOutside.es.js +0 -70
- package/dist/node_modules/@react-aria/overlays/dist/ariaHideOutside.es.js.map +0 -1
- package/dist/node_modules/@react-aria/overlays/dist/useModalOverlay.cjs.js +0 -2
- package/dist/node_modules/@react-aria/overlays/dist/useModalOverlay.cjs.js.map +0 -1
- package/dist/node_modules/@react-aria/overlays/dist/useModalOverlay.es.js +0 -32
- package/dist/node_modules/@react-aria/overlays/dist/useModalOverlay.es.js.map +0 -1
- package/dist/node_modules/@react-aria/overlays/dist/useOverlay.cjs.js +0 -2
- package/dist/node_modules/@react-aria/overlays/dist/useOverlay.cjs.js.map +0 -1
- package/dist/node_modules/@react-aria/overlays/dist/useOverlay.es.js +0 -53
- package/dist/node_modules/@react-aria/overlays/dist/useOverlay.es.js.map +0 -1
- package/dist/node_modules/@react-aria/overlays/dist/usePreventScroll.cjs.js +0 -2
- package/dist/node_modules/@react-aria/overlays/dist/usePreventScroll.cjs.js.map +0 -1
- package/dist/node_modules/@react-aria/overlays/dist/usePreventScroll.es.js +0 -100
- package/dist/node_modules/@react-aria/overlays/dist/usePreventScroll.es.js.map +0 -1
- package/dist/node_modules/@react-stately/overlays/dist/useOverlayTriggerState.cjs.js +0 -2
- package/dist/node_modules/@react-stately/overlays/dist/useOverlayTriggerState.cjs.js.map +0 -1
- package/dist/node_modules/@react-stately/overlays/dist/useOverlayTriggerState.es.js +0 -30
- package/dist/node_modules/@react-stately/overlays/dist/useOverlayTriggerState.es.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FocusScope.es.js","sources":["../../../../../node_modules/@react-aria/focus/dist/FocusScope.mjs"],"sourcesContent":["import {useLayoutEffect as $cgawC$useLayoutEffect, getActiveElement as $cgawC$getActiveElement, getOwnerDocument as $cgawC$getOwnerDocument, getEventTarget as $cgawC$getEventTarget, isAndroid as $cgawC$isAndroid, isChrome as $cgawC$isChrome, isTabbable as $cgawC$isTabbable, isFocusable as $cgawC$isFocusable, createShadowTreeWalker as $cgawC$createShadowTreeWalker} from \"@react-aria/utils\";\nimport {getInteractionModality as $cgawC$getInteractionModality, focusSafely as $cgawC$focusSafely} from \"@react-aria/interactions\";\nimport $cgawC$react, {useRef as $cgawC$useRef, useContext as $cgawC$useContext, useMemo as $cgawC$useMemo, useEffect as $cgawC$useEffect} from \"react\";\n\n/*\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\nconst $9bf71ea28793e738$var$FocusContext = /*#__PURE__*/ (0, $cgawC$react).createContext(null);\nconst $9bf71ea28793e738$var$RESTORE_FOCUS_EVENT = 'react-aria-focus-scope-restore';\nlet $9bf71ea28793e738$var$activeScope = null;\nfunction $9bf71ea28793e738$export$20e40289641fbbb6(props) {\n let { children: children, contain: contain, restoreFocus: restoreFocus, autoFocus: autoFocus } = props;\n let startRef = (0, $cgawC$useRef)(null);\n let endRef = (0, $cgawC$useRef)(null);\n let scopeRef = (0, $cgawC$useRef)([]);\n let { parentNode: parentNode } = (0, $cgawC$useContext)($9bf71ea28793e738$var$FocusContext) || {};\n // Create a tree node here so we can add children to it even before it is added to the tree.\n let node = (0, $cgawC$useMemo)(()=>new $9bf71ea28793e738$var$TreeNode({\n scopeRef: scopeRef\n }), [\n scopeRef\n ]);\n (0, $cgawC$useLayoutEffect)(()=>{\n // If a new scope mounts outside the active scope, (e.g. DialogContainer launched from a menu),\n // use the active scope as the parent instead of the parent from context. Layout effects run bottom\n // up, so if the parent is not yet added to the tree, don't do this. Only the outer-most FocusScope\n // that is being added should get the activeScope as its parent.\n let parent = parentNode || $9bf71ea28793e738$export$d06fae2ee68b101e.root;\n if ($9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(parent.scopeRef) && $9bf71ea28793e738$var$activeScope && !$9bf71ea28793e738$var$isAncestorScope($9bf71ea28793e738$var$activeScope, parent.scopeRef)) {\n let activeNode = $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode($9bf71ea28793e738$var$activeScope);\n if (activeNode) parent = activeNode;\n }\n // Add the node to the parent, and to the tree.\n parent.addChild(node);\n $9bf71ea28793e738$export$d06fae2ee68b101e.addNode(node);\n }, [\n node,\n parentNode\n ]);\n (0, $cgawC$useLayoutEffect)(()=>{\n let node = $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(scopeRef);\n if (node) node.contain = !!contain;\n }, [\n contain\n ]);\n (0, $cgawC$useLayoutEffect)(()=>{\n var _startRef_current;\n // Find all rendered nodes between the sentinels and add them to the scope.\n let node = (_startRef_current = startRef.current) === null || _startRef_current === void 0 ? void 0 : _startRef_current.nextSibling;\n let nodes = [];\n let stopPropagation = (e)=>e.stopPropagation();\n while(node && node !== endRef.current){\n nodes.push(node);\n // Stop custom restore focus event from propagating to parent focus scopes.\n node.addEventListener($9bf71ea28793e738$var$RESTORE_FOCUS_EVENT, stopPropagation);\n node = node.nextSibling;\n }\n scopeRef.current = nodes;\n return ()=>{\n for (let node of nodes)node.removeEventListener($9bf71ea28793e738$var$RESTORE_FOCUS_EVENT, stopPropagation);\n };\n }, [\n children\n ]);\n $9bf71ea28793e738$var$useActiveScopeTracker(scopeRef, restoreFocus, contain);\n $9bf71ea28793e738$var$useFocusContainment(scopeRef, contain);\n $9bf71ea28793e738$var$useRestoreFocus(scopeRef, restoreFocus, contain);\n $9bf71ea28793e738$var$useAutoFocus(scopeRef, autoFocus);\n // This needs to be an effect so that activeScope is updated after the FocusScope tree is complete.\n // It cannot be a useLayoutEffect because the parent of this node hasn't been attached in the tree yet.\n (0, $cgawC$useEffect)(()=>{\n const activeElement = (0, $cgawC$getActiveElement)((0, $cgawC$getOwnerDocument)(scopeRef.current ? scopeRef.current[0] : undefined));\n let scope = null;\n if ($9bf71ea28793e738$var$isElementInScope(activeElement, scopeRef.current)) {\n // We need to traverse the focusScope tree and find the bottom most scope that\n // contains the active element and set that as the activeScope.\n for (let node of $9bf71ea28793e738$export$d06fae2ee68b101e.traverse())if (node.scopeRef && $9bf71ea28793e738$var$isElementInScope(activeElement, node.scopeRef.current)) scope = node;\n if (scope === $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(scopeRef)) $9bf71ea28793e738$var$activeScope = scope.scopeRef;\n }\n }, [\n scopeRef\n ]);\n // This layout effect cleanup is so that the tree node is removed synchronously with react before the RAF\n // in useRestoreFocus cleanup runs.\n (0, $cgawC$useLayoutEffect)(()=>{\n return ()=>{\n var _focusScopeTree_getTreeNode_parent, _focusScopeTree_getTreeNode;\n var _focusScopeTree_getTreeNode_parent_scopeRef;\n // Scope may have been re-parented.\n let parentScope = (_focusScopeTree_getTreeNode_parent_scopeRef = (_focusScopeTree_getTreeNode = $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(scopeRef)) === null || _focusScopeTree_getTreeNode === void 0 ? void 0 : (_focusScopeTree_getTreeNode_parent = _focusScopeTree_getTreeNode.parent) === null || _focusScopeTree_getTreeNode_parent === void 0 ? void 0 : _focusScopeTree_getTreeNode_parent.scopeRef) !== null && _focusScopeTree_getTreeNode_parent_scopeRef !== void 0 ? _focusScopeTree_getTreeNode_parent_scopeRef : null;\n if ((scopeRef === $9bf71ea28793e738$var$activeScope || $9bf71ea28793e738$var$isAncestorScope(scopeRef, $9bf71ea28793e738$var$activeScope)) && (!parentScope || $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(parentScope))) $9bf71ea28793e738$var$activeScope = parentScope;\n $9bf71ea28793e738$export$d06fae2ee68b101e.removeTreeNode(scopeRef);\n };\n }, [\n scopeRef\n ]);\n let focusManager = (0, $cgawC$useMemo)(()=>$9bf71ea28793e738$var$createFocusManagerForScope(scopeRef), []);\n let value = (0, $cgawC$useMemo)(()=>({\n focusManager: focusManager,\n parentNode: node\n }), [\n node,\n focusManager\n ]);\n return /*#__PURE__*/ (0, $cgawC$react).createElement($9bf71ea28793e738$var$FocusContext.Provider, {\n value: value\n }, /*#__PURE__*/ (0, $cgawC$react).createElement(\"span\", {\n \"data-focus-scope-start\": true,\n hidden: true,\n ref: startRef\n }), children, /*#__PURE__*/ (0, $cgawC$react).createElement(\"span\", {\n \"data-focus-scope-end\": true,\n hidden: true,\n ref: endRef\n }));\n}\nfunction $9bf71ea28793e738$export$10c5169755ce7bd7() {\n var _useContext;\n return (_useContext = (0, $cgawC$useContext)($9bf71ea28793e738$var$FocusContext)) === null || _useContext === void 0 ? void 0 : _useContext.focusManager;\n}\nfunction $9bf71ea28793e738$var$createFocusManagerForScope(scopeRef) {\n return {\n focusNext (opts = {}) {\n let scope = scopeRef.current;\n let { from: from, tabbable: tabbable, wrap: wrap, accept: accept } = opts;\n var _scope_;\n let node = from || (0, $cgawC$getActiveElement)((0, $cgawC$getOwnerDocument)((_scope_ = scope[0]) !== null && _scope_ !== void 0 ? _scope_ : undefined));\n let sentinel = scope[0].previousElementSibling;\n let scopeRoot = $9bf71ea28793e738$var$getScopeRoot(scope);\n let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(scopeRoot, {\n tabbable: tabbable,\n accept: accept\n }, scope);\n walker.currentNode = $9bf71ea28793e738$var$isElementInScope(node, scope) ? node : sentinel;\n let nextNode = walker.nextNode();\n if (!nextNode && wrap) {\n walker.currentNode = sentinel;\n nextNode = walker.nextNode();\n }\n if (nextNode) $9bf71ea28793e738$var$focusElement(nextNode, true);\n return nextNode;\n },\n focusPrevious (opts = {}) {\n let scope = scopeRef.current;\n let { from: from, tabbable: tabbable, wrap: wrap, accept: accept } = opts;\n var _scope_;\n let node = from || (0, $cgawC$getActiveElement)((0, $cgawC$getOwnerDocument)((_scope_ = scope[0]) !== null && _scope_ !== void 0 ? _scope_ : undefined));\n let sentinel = scope[scope.length - 1].nextElementSibling;\n let scopeRoot = $9bf71ea28793e738$var$getScopeRoot(scope);\n let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(scopeRoot, {\n tabbable: tabbable,\n accept: accept\n }, scope);\n walker.currentNode = $9bf71ea28793e738$var$isElementInScope(node, scope) ? node : sentinel;\n let previousNode = walker.previousNode();\n if (!previousNode && wrap) {\n walker.currentNode = sentinel;\n previousNode = walker.previousNode();\n }\n if (previousNode) $9bf71ea28793e738$var$focusElement(previousNode, true);\n return previousNode;\n },\n focusFirst (opts = {}) {\n let scope = scopeRef.current;\n let { tabbable: tabbable, accept: accept } = opts;\n let scopeRoot = $9bf71ea28793e738$var$getScopeRoot(scope);\n let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(scopeRoot, {\n tabbable: tabbable,\n accept: accept\n }, scope);\n walker.currentNode = scope[0].previousElementSibling;\n let nextNode = walker.nextNode();\n if (nextNode) $9bf71ea28793e738$var$focusElement(nextNode, true);\n return nextNode;\n },\n focusLast (opts = {}) {\n let scope = scopeRef.current;\n let { tabbable: tabbable, accept: accept } = opts;\n let scopeRoot = $9bf71ea28793e738$var$getScopeRoot(scope);\n let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(scopeRoot, {\n tabbable: tabbable,\n accept: accept\n }, scope);\n walker.currentNode = scope[scope.length - 1].nextElementSibling;\n let previousNode = walker.previousNode();\n if (previousNode) $9bf71ea28793e738$var$focusElement(previousNode, true);\n return previousNode;\n }\n };\n}\nfunction $9bf71ea28793e738$var$getScopeRoot(scope) {\n return scope[0].parentElement;\n}\nfunction $9bf71ea28793e738$var$shouldContainFocus(scopeRef) {\n let scope = $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode($9bf71ea28793e738$var$activeScope);\n while(scope && scope.scopeRef !== scopeRef){\n if (scope.contain) return false;\n scope = scope.parent;\n }\n return true;\n}\nfunction $9bf71ea28793e738$var$isTabbableRadio(element) {\n if (element.checked) return true;\n let radios = [];\n if (!element.form) radios = [\n ...(0, $cgawC$getOwnerDocument)(element).querySelectorAll(`input[type=\"radio\"][name=\"${CSS.escape(element.name)}\"]`)\n ].filter((radio)=>!radio.form);\n else {\n var _element_form_elements, _element_form;\n let radioList = (_element_form = element.form) === null || _element_form === void 0 ? void 0 : (_element_form_elements = _element_form.elements) === null || _element_form_elements === void 0 ? void 0 : _element_form_elements.namedItem(element.name);\n radios = [\n ...radioList !== null && radioList !== void 0 ? radioList : []\n ];\n }\n if (!radios) return false;\n let anyChecked = radios.some((radio)=>radio.checked);\n return !anyChecked;\n}\nfunction $9bf71ea28793e738$var$useFocusContainment(scopeRef, contain) {\n let focusedNode = (0, $cgawC$useRef)(undefined);\n let raf = (0, $cgawC$useRef)(undefined);\n (0, $cgawC$useLayoutEffect)(()=>{\n let scope = scopeRef.current;\n if (!contain) {\n // if contain was changed, then we should cancel any ongoing waits to pull focus back into containment\n if (raf.current) {\n cancelAnimationFrame(raf.current);\n raf.current = undefined;\n }\n return;\n }\n const ownerDocument = (0, $cgawC$getOwnerDocument)(scope ? scope[0] : undefined);\n // Handle the Tab key to contain focus within the scope\n let onKeyDown = (e)=>{\n if (e.key !== 'Tab' || e.altKey || e.ctrlKey || e.metaKey || !$9bf71ea28793e738$var$shouldContainFocus(scopeRef) || e.isComposing) return;\n let focusedElement = (0, $cgawC$getActiveElement)(ownerDocument);\n let scope = scopeRef.current;\n if (!scope || !$9bf71ea28793e738$var$isElementInScope(focusedElement, scope)) return;\n let scopeRoot = $9bf71ea28793e738$var$getScopeRoot(scope);\n let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(scopeRoot, {\n tabbable: true\n }, scope);\n if (!focusedElement) return;\n walker.currentNode = focusedElement;\n let nextElement = e.shiftKey ? walker.previousNode() : walker.nextNode();\n if (!nextElement) {\n walker.currentNode = e.shiftKey ? scope[scope.length - 1].nextElementSibling : scope[0].previousElementSibling;\n nextElement = e.shiftKey ? walker.previousNode() : walker.nextNode();\n }\n e.preventDefault();\n if (nextElement) $9bf71ea28793e738$var$focusElement(nextElement, true);\n };\n let onFocus = (e)=>{\n // If focusing an element in a child scope of the currently active scope, the child becomes active.\n // Moving out of the active scope to an ancestor is not allowed.\n if ((!$9bf71ea28793e738$var$activeScope || $9bf71ea28793e738$var$isAncestorScope($9bf71ea28793e738$var$activeScope, scopeRef)) && $9bf71ea28793e738$var$isElementInScope((0, $cgawC$getEventTarget)(e), scopeRef.current)) {\n $9bf71ea28793e738$var$activeScope = scopeRef;\n focusedNode.current = (0, $cgawC$getEventTarget)(e);\n } else if ($9bf71ea28793e738$var$shouldContainFocus(scopeRef) && !$9bf71ea28793e738$var$isElementInChildScope((0, $cgawC$getEventTarget)(e), scopeRef)) {\n // If a focus event occurs outside the active scope (e.g. user tabs from browser location bar),\n // restore focus to the previously focused node or the first tabbable element in the active scope.\n if (focusedNode.current) focusedNode.current.focus();\n else if ($9bf71ea28793e738$var$activeScope && $9bf71ea28793e738$var$activeScope.current) $9bf71ea28793e738$var$focusFirstInScope($9bf71ea28793e738$var$activeScope.current);\n } else if ($9bf71ea28793e738$var$shouldContainFocus(scopeRef)) focusedNode.current = (0, $cgawC$getEventTarget)(e);\n };\n let onBlur = (e)=>{\n // Firefox doesn't shift focus back to the Dialog properly without this\n if (raf.current) cancelAnimationFrame(raf.current);\n raf.current = requestAnimationFrame(()=>{\n // Patches infinite focus coersion loop for Android Talkback where the user isn't able to move the virtual cursor\n // if within a containing focus scope. Bug filed against Chrome: https://issuetracker.google.com/issues/384844019.\n // Note that this means focus can leave focus containing modals due to this, but it is isolated to Chrome Talkback.\n let modality = (0, $cgawC$getInteractionModality)();\n let shouldSkipFocusRestore = (modality === 'virtual' || modality === null) && (0, $cgawC$isAndroid)() && (0, $cgawC$isChrome)();\n // Use document.activeElement instead of e.relatedTarget so we can tell if user clicked into iframe\n let activeElement = (0, $cgawC$getActiveElement)(ownerDocument);\n if (!shouldSkipFocusRestore && activeElement && $9bf71ea28793e738$var$shouldContainFocus(scopeRef) && !$9bf71ea28793e738$var$isElementInChildScope(activeElement, scopeRef)) {\n $9bf71ea28793e738$var$activeScope = scopeRef;\n let target = (0, $cgawC$getEventTarget)(e);\n if (target && target.isConnected) {\n var _focusedNode_current;\n focusedNode.current = target;\n (_focusedNode_current = focusedNode.current) === null || _focusedNode_current === void 0 ? void 0 : _focusedNode_current.focus();\n } else if ($9bf71ea28793e738$var$activeScope.current) $9bf71ea28793e738$var$focusFirstInScope($9bf71ea28793e738$var$activeScope.current);\n }\n });\n };\n ownerDocument.addEventListener('keydown', onKeyDown, false);\n ownerDocument.addEventListener('focusin', onFocus, false);\n scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener('focusin', onFocus, false));\n scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener('focusout', onBlur, false));\n return ()=>{\n ownerDocument.removeEventListener('keydown', onKeyDown, false);\n ownerDocument.removeEventListener('focusin', onFocus, false);\n scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener('focusin', onFocus, false));\n scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener('focusout', onBlur, false));\n };\n }, [\n scopeRef,\n contain\n ]);\n // This is a useLayoutEffect so it is guaranteed to run before our async synthetic blur\n (0, $cgawC$useLayoutEffect)(()=>{\n return ()=>{\n if (raf.current) cancelAnimationFrame(raf.current);\n };\n }, [\n raf\n ]);\n}\nfunction $9bf71ea28793e738$var$isElementInAnyScope(element) {\n return $9bf71ea28793e738$var$isElementInChildScope(element);\n}\nfunction $9bf71ea28793e738$var$isElementInScope(element, scope) {\n if (!element) return false;\n if (!scope) return false;\n return scope.some((node)=>node.contains(element));\n}\nfunction $9bf71ea28793e738$var$isElementInChildScope(element, scope = null) {\n // If the element is within a top layer element (e.g. toasts), always allow moving focus there.\n if (element instanceof Element && element.closest('[data-react-aria-top-layer]')) return true;\n // node.contains in isElementInScope covers child scopes that are also DOM children,\n // but does not cover child scopes in portals.\n for (let { scopeRef: s } of $9bf71ea28793e738$export$d06fae2ee68b101e.traverse($9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(scope))){\n if (s && $9bf71ea28793e738$var$isElementInScope(element, s.current)) return true;\n }\n return false;\n}\nfunction $9bf71ea28793e738$export$1258395f99bf9cbf(element) {\n return $9bf71ea28793e738$var$isElementInChildScope(element, $9bf71ea28793e738$var$activeScope);\n}\nfunction $9bf71ea28793e738$var$isAncestorScope(ancestor, scope) {\n var _focusScopeTree_getTreeNode;\n let parent = (_focusScopeTree_getTreeNode = $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(scope)) === null || _focusScopeTree_getTreeNode === void 0 ? void 0 : _focusScopeTree_getTreeNode.parent;\n while(parent){\n if (parent.scopeRef === ancestor) return true;\n parent = parent.parent;\n }\n return false;\n}\nfunction $9bf71ea28793e738$var$focusElement(element, scroll = false) {\n if (element != null && !scroll) try {\n (0, $cgawC$focusSafely)(element);\n } catch {\n // ignore\n }\n else if (element != null) try {\n element.focus();\n } catch {\n // ignore\n }\n}\nfunction $9bf71ea28793e738$var$getFirstInScope(scope, tabbable = true) {\n let sentinel = scope[0].previousElementSibling;\n let scopeRoot = $9bf71ea28793e738$var$getScopeRoot(scope);\n let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(scopeRoot, {\n tabbable: tabbable\n }, scope);\n walker.currentNode = sentinel;\n let nextNode = walker.nextNode();\n // If the scope does not contain a tabbable element, use the first focusable element.\n if (tabbable && !nextNode) {\n scopeRoot = $9bf71ea28793e738$var$getScopeRoot(scope);\n walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(scopeRoot, {\n tabbable: false\n }, scope);\n walker.currentNode = sentinel;\n nextNode = walker.nextNode();\n }\n return nextNode;\n}\nfunction $9bf71ea28793e738$var$focusFirstInScope(scope, tabbable = true) {\n $9bf71ea28793e738$var$focusElement($9bf71ea28793e738$var$getFirstInScope(scope, tabbable));\n}\nfunction $9bf71ea28793e738$var$useAutoFocus(scopeRef, autoFocus) {\n const autoFocusRef = (0, $cgawC$react).useRef(autoFocus);\n (0, $cgawC$useEffect)(()=>{\n if (autoFocusRef.current) {\n $9bf71ea28793e738$var$activeScope = scopeRef;\n const ownerDocument = (0, $cgawC$getOwnerDocument)(scopeRef.current ? scopeRef.current[0] : undefined);\n if (!$9bf71ea28793e738$var$isElementInScope((0, $cgawC$getActiveElement)(ownerDocument), $9bf71ea28793e738$var$activeScope.current) && scopeRef.current) $9bf71ea28793e738$var$focusFirstInScope(scopeRef.current);\n }\n autoFocusRef.current = false;\n }, [\n scopeRef\n ]);\n}\nfunction $9bf71ea28793e738$var$useActiveScopeTracker(scopeRef, restore, contain) {\n // tracks the active scope, in case restore and contain are both false.\n // if either are true, this is tracked in useRestoreFocus or useFocusContainment.\n (0, $cgawC$useLayoutEffect)(()=>{\n if (restore || contain) return;\n let scope = scopeRef.current;\n const ownerDocument = (0, $cgawC$getOwnerDocument)(scope ? scope[0] : undefined);\n let onFocus = (e)=>{\n let target = (0, $cgawC$getEventTarget)(e);\n if ($9bf71ea28793e738$var$isElementInScope(target, scopeRef.current)) $9bf71ea28793e738$var$activeScope = scopeRef;\n else if (!$9bf71ea28793e738$var$isElementInAnyScope(target)) $9bf71ea28793e738$var$activeScope = null;\n };\n ownerDocument.addEventListener('focusin', onFocus, false);\n scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener('focusin', onFocus, false));\n return ()=>{\n ownerDocument.removeEventListener('focusin', onFocus, false);\n scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener('focusin', onFocus, false));\n };\n }, [\n scopeRef,\n restore,\n contain\n ]);\n}\nfunction $9bf71ea28793e738$var$shouldRestoreFocus(scopeRef) {\n let scope = $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode($9bf71ea28793e738$var$activeScope);\n while(scope && scope.scopeRef !== scopeRef){\n if (scope.nodeToRestore) return false;\n scope = scope.parent;\n }\n return (scope === null || scope === void 0 ? void 0 : scope.scopeRef) === scopeRef;\n}\nfunction $9bf71ea28793e738$var$useRestoreFocus(scopeRef, restoreFocus, contain) {\n // create a ref during render instead of useLayoutEffect so the active element is saved before a child with autoFocus=true mounts.\n // eslint-disable-next-line no-restricted-globals\n const nodeToRestoreRef = (0, $cgawC$useRef)(typeof document !== 'undefined' ? (0, $cgawC$getActiveElement)((0, $cgawC$getOwnerDocument)(scopeRef.current ? scopeRef.current[0] : undefined)) : null);\n // restoring scopes should all track if they are active regardless of contain, but contain already tracks it plus logic to contain the focus\n // restoring-non-containing scopes should only care if they become active so they can perform the restore\n (0, $cgawC$useLayoutEffect)(()=>{\n let scope = scopeRef.current;\n const ownerDocument = (0, $cgawC$getOwnerDocument)(scope ? scope[0] : undefined);\n if (!restoreFocus || contain) return;\n let onFocus = ()=>{\n // If focusing an element in a child scope of the currently active scope, the child becomes active.\n // Moving out of the active scope to an ancestor is not allowed.\n if ((!$9bf71ea28793e738$var$activeScope || $9bf71ea28793e738$var$isAncestorScope($9bf71ea28793e738$var$activeScope, scopeRef)) && $9bf71ea28793e738$var$isElementInScope((0, $cgawC$getActiveElement)(ownerDocument), scopeRef.current)) $9bf71ea28793e738$var$activeScope = scopeRef;\n };\n ownerDocument.addEventListener('focusin', onFocus, false);\n scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener('focusin', onFocus, false));\n return ()=>{\n ownerDocument.removeEventListener('focusin', onFocus, false);\n scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener('focusin', onFocus, false));\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n scopeRef,\n contain\n ]);\n (0, $cgawC$useLayoutEffect)(()=>{\n const ownerDocument = (0, $cgawC$getOwnerDocument)(scopeRef.current ? scopeRef.current[0] : undefined);\n if (!restoreFocus) return;\n // Handle the Tab key so that tabbing out of the scope goes to the next element\n // after the node that had focus when the scope mounted. This is important when\n // using portals for overlays, so that focus goes to the expected element when\n // tabbing out of the overlay.\n let onKeyDown = (e)=>{\n if (e.key !== 'Tab' || e.altKey || e.ctrlKey || e.metaKey || !$9bf71ea28793e738$var$shouldContainFocus(scopeRef) || e.isComposing) return;\n let focusedElement = ownerDocument.activeElement;\n if (!$9bf71ea28793e738$var$isElementInChildScope(focusedElement, scopeRef) || !$9bf71ea28793e738$var$shouldRestoreFocus(scopeRef)) return;\n let treeNode = $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(scopeRef);\n if (!treeNode) return;\n let nodeToRestore = treeNode.nodeToRestore;\n // Create a DOM tree walker that matches all tabbable elements\n let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(ownerDocument.body, {\n tabbable: true\n });\n // Find the next tabbable element after the currently focused element\n walker.currentNode = focusedElement;\n let nextElement = e.shiftKey ? walker.previousNode() : walker.nextNode();\n if (!nodeToRestore || !nodeToRestore.isConnected || nodeToRestore === ownerDocument.body) {\n nodeToRestore = undefined;\n treeNode.nodeToRestore = undefined;\n }\n // If there is no next element, or it is outside the current scope, move focus to the\n // next element after the node to restore to instead.\n if ((!nextElement || !$9bf71ea28793e738$var$isElementInChildScope(nextElement, scopeRef)) && nodeToRestore) {\n walker.currentNode = nodeToRestore;\n // Skip over elements within the scope, in case the scope immediately follows the node to restore.\n do nextElement = e.shiftKey ? walker.previousNode() : walker.nextNode();\n while ($9bf71ea28793e738$var$isElementInChildScope(nextElement, scopeRef));\n e.preventDefault();\n e.stopPropagation();\n if (nextElement) $9bf71ea28793e738$var$focusElement(nextElement, true);\n else // If there is no next element and the nodeToRestore isn't within a FocusScope (i.e. we are leaving the top level focus scope)\n // then move focus to the body.\n // Otherwise restore focus to the nodeToRestore (e.g menu within a popover -> tabbing to close the menu should move focus to menu trigger)\n if (!$9bf71ea28793e738$var$isElementInAnyScope(nodeToRestore)) focusedElement.blur();\n else $9bf71ea28793e738$var$focusElement(nodeToRestore, true);\n }\n };\n if (!contain) ownerDocument.addEventListener('keydown', onKeyDown, true);\n return ()=>{\n if (!contain) ownerDocument.removeEventListener('keydown', onKeyDown, true);\n };\n }, [\n scopeRef,\n restoreFocus,\n contain\n ]);\n // useLayoutEffect instead of useEffect so the active element is saved synchronously instead of asynchronously.\n (0, $cgawC$useLayoutEffect)(()=>{\n const ownerDocument = (0, $cgawC$getOwnerDocument)(scopeRef.current ? scopeRef.current[0] : undefined);\n if (!restoreFocus) return;\n let treeNode = $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(scopeRef);\n if (!treeNode) return;\n var _nodeToRestoreRef_current;\n treeNode.nodeToRestore = (_nodeToRestoreRef_current = nodeToRestoreRef.current) !== null && _nodeToRestoreRef_current !== void 0 ? _nodeToRestoreRef_current : undefined;\n return ()=>{\n let treeNode = $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(scopeRef);\n if (!treeNode) return;\n let nodeToRestore = treeNode.nodeToRestore;\n // if we already lost focus to the body and this was the active scope, then we should attempt to restore\n let activeElement = (0, $cgawC$getActiveElement)(ownerDocument);\n if (restoreFocus && nodeToRestore && (activeElement && $9bf71ea28793e738$var$isElementInChildScope(activeElement, scopeRef) || activeElement === ownerDocument.body && $9bf71ea28793e738$var$shouldRestoreFocus(scopeRef))) {\n // freeze the focusScopeTree so it persists after the raf, otherwise during unmount nodes are removed from it\n let clonedTree = $9bf71ea28793e738$export$d06fae2ee68b101e.clone();\n requestAnimationFrame(()=>{\n // Only restore focus if we've lost focus to the body, the alternative is that focus has been purposefully moved elsewhere\n if (ownerDocument.activeElement === ownerDocument.body) {\n // look up the tree starting with our scope to find a nodeToRestore still in the DOM\n let treeNode = clonedTree.getTreeNode(scopeRef);\n while(treeNode){\n if (treeNode.nodeToRestore && treeNode.nodeToRestore.isConnected) {\n $9bf71ea28793e738$var$restoreFocusToElement(treeNode.nodeToRestore);\n return;\n }\n treeNode = treeNode.parent;\n }\n // If no nodeToRestore was found, focus the first element in the nearest\n // ancestor scope that is still in the tree.\n treeNode = clonedTree.getTreeNode(scopeRef);\n while(treeNode){\n if (treeNode.scopeRef && treeNode.scopeRef.current && $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(treeNode.scopeRef)) {\n let node = $9bf71ea28793e738$var$getFirstInScope(treeNode.scopeRef.current, true);\n $9bf71ea28793e738$var$restoreFocusToElement(node);\n return;\n }\n treeNode = treeNode.parent;\n }\n }\n });\n }\n };\n }, [\n scopeRef,\n restoreFocus\n ]);\n}\nfunction $9bf71ea28793e738$var$restoreFocusToElement(node) {\n // Dispatch a custom event that parent elements can intercept to customize focus restoration.\n // For example, virtualized collection components reuse DOM elements, so the original element\n // might still exist in the DOM but representing a different item.\n if (node.dispatchEvent(new CustomEvent($9bf71ea28793e738$var$RESTORE_FOCUS_EVENT, {\n bubbles: true,\n cancelable: true\n }))) $9bf71ea28793e738$var$focusElement(node);\n}\nfunction $9bf71ea28793e738$export$2d6ec8fc375ceafa(root, opts, scope) {\n let filter = (opts === null || opts === void 0 ? void 0 : opts.tabbable) ? (0, $cgawC$isTabbable) : (0, $cgawC$isFocusable);\n // Ensure that root is an Element or fall back appropriately\n let rootElement = (root === null || root === void 0 ? void 0 : root.nodeType) === Node.ELEMENT_NODE ? root : null;\n // Determine the document to use\n let doc = (0, $cgawC$getOwnerDocument)(rootElement);\n // Create a TreeWalker, ensuring the root is an Element or Document\n let walker = (0, $cgawC$createShadowTreeWalker)(doc, root || doc, NodeFilter.SHOW_ELEMENT, {\n acceptNode (node) {\n var _opts_from;\n // Skip nodes inside the starting node.\n if (opts === null || opts === void 0 ? void 0 : (_opts_from = opts.from) === null || _opts_from === void 0 ? void 0 : _opts_from.contains(node)) return NodeFilter.FILTER_REJECT;\n if ((opts === null || opts === void 0 ? void 0 : opts.tabbable) && node.tagName === 'INPUT' && node.getAttribute('type') === 'radio') {\n // If the radio is in a form, we can get all the other radios by name\n if (!$9bf71ea28793e738$var$isTabbableRadio(node)) return NodeFilter.FILTER_REJECT;\n // If the radio is in the same group as the current node and none are selected, we can skip it\n if (walker.currentNode.tagName === 'INPUT' && walker.currentNode.type === 'radio' && walker.currentNode.name === node.name) return NodeFilter.FILTER_REJECT;\n }\n if (filter(node) && (!scope || $9bf71ea28793e738$var$isElementInScope(node, scope)) && (!(opts === null || opts === void 0 ? void 0 : opts.accept) || opts.accept(node))) return NodeFilter.FILTER_ACCEPT;\n return NodeFilter.FILTER_SKIP;\n }\n });\n if (opts === null || opts === void 0 ? void 0 : opts.from) walker.currentNode = opts.from;\n return walker;\n}\nfunction $9bf71ea28793e738$export$c5251b9e124bf29(ref, defaultOptions = {}) {\n return {\n focusNext (opts = {}) {\n let root = ref.current;\n if (!root) return null;\n let { from: from, tabbable: tabbable = defaultOptions.tabbable, wrap: wrap = defaultOptions.wrap, accept: accept = defaultOptions.accept } = opts;\n let node = from || (0, $cgawC$getActiveElement)((0, $cgawC$getOwnerDocument)(root));\n let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(root, {\n tabbable: tabbable,\n accept: accept\n });\n if (root.contains(node)) walker.currentNode = node;\n let nextNode = walker.nextNode();\n if (!nextNode && wrap) {\n walker.currentNode = root;\n nextNode = walker.nextNode();\n }\n if (nextNode) $9bf71ea28793e738$var$focusElement(nextNode, true);\n return nextNode;\n },\n focusPrevious (opts = defaultOptions) {\n let root = ref.current;\n if (!root) return null;\n let { from: from, tabbable: tabbable = defaultOptions.tabbable, wrap: wrap = defaultOptions.wrap, accept: accept = defaultOptions.accept } = opts;\n let node = from || (0, $cgawC$getActiveElement)((0, $cgawC$getOwnerDocument)(root));\n let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(root, {\n tabbable: tabbable,\n accept: accept\n });\n if (root.contains(node)) walker.currentNode = node;\n else {\n let next = $9bf71ea28793e738$var$last(walker);\n if (next) $9bf71ea28793e738$var$focusElement(next, true);\n return next !== null && next !== void 0 ? next : null;\n }\n let previousNode = walker.previousNode();\n if (!previousNode && wrap) {\n walker.currentNode = root;\n let lastNode = $9bf71ea28793e738$var$last(walker);\n if (!lastNode) // couldn't wrap\n return null;\n previousNode = lastNode;\n }\n if (previousNode) $9bf71ea28793e738$var$focusElement(previousNode, true);\n return previousNode !== null && previousNode !== void 0 ? previousNode : null;\n },\n focusFirst (opts = defaultOptions) {\n let root = ref.current;\n if (!root) return null;\n let { tabbable: tabbable = defaultOptions.tabbable, accept: accept = defaultOptions.accept } = opts;\n let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(root, {\n tabbable: tabbable,\n accept: accept\n });\n let nextNode = walker.nextNode();\n if (nextNode) $9bf71ea28793e738$var$focusElement(nextNode, true);\n return nextNode;\n },\n focusLast (opts = defaultOptions) {\n let root = ref.current;\n if (!root) return null;\n let { tabbable: tabbable = defaultOptions.tabbable, accept: accept = defaultOptions.accept } = opts;\n let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(root, {\n tabbable: tabbable,\n accept: accept\n });\n let next = $9bf71ea28793e738$var$last(walker);\n if (next) $9bf71ea28793e738$var$focusElement(next, true);\n return next !== null && next !== void 0 ? next : null;\n }\n };\n}\nfunction $9bf71ea28793e738$var$last(walker) {\n let next = undefined;\n let last;\n do {\n last = walker.lastChild();\n if (last) next = last;\n }while (last);\n return next;\n}\nclass $9bf71ea28793e738$var$Tree {\n get size() {\n return this.fastMap.size;\n }\n getTreeNode(data) {\n return this.fastMap.get(data);\n }\n addTreeNode(scopeRef, parent, nodeToRestore) {\n let parentNode = this.fastMap.get(parent !== null && parent !== void 0 ? parent : null);\n if (!parentNode) return;\n let node = new $9bf71ea28793e738$var$TreeNode({\n scopeRef: scopeRef\n });\n parentNode.addChild(node);\n node.parent = parentNode;\n this.fastMap.set(scopeRef, node);\n if (nodeToRestore) node.nodeToRestore = nodeToRestore;\n }\n addNode(node) {\n this.fastMap.set(node.scopeRef, node);\n }\n removeTreeNode(scopeRef) {\n // never remove the root\n if (scopeRef === null) return;\n let node = this.fastMap.get(scopeRef);\n if (!node) return;\n let parentNode = node.parent;\n // when we remove a scope, check if any sibling scopes are trying to restore focus to something inside the scope we're removing\n // if we are, then replace the siblings restore with the restore from the scope we're removing\n for (let current of this.traverse())if (current !== node && node.nodeToRestore && current.nodeToRestore && node.scopeRef && node.scopeRef.current && $9bf71ea28793e738$var$isElementInScope(current.nodeToRestore, node.scopeRef.current)) current.nodeToRestore = node.nodeToRestore;\n let children = node.children;\n if (parentNode) {\n parentNode.removeChild(node);\n if (children.size > 0) children.forEach((child)=>parentNode && parentNode.addChild(child));\n }\n this.fastMap.delete(node.scopeRef);\n }\n // Pre Order Depth First\n *traverse(node = this.root) {\n if (node.scopeRef != null) yield node;\n if (node.children.size > 0) for (let child of node.children)yield* this.traverse(child);\n }\n clone() {\n var _node_parent;\n let newTree = new $9bf71ea28793e738$var$Tree();\n var _node_parent_scopeRef;\n for (let node of this.traverse())newTree.addTreeNode(node.scopeRef, (_node_parent_scopeRef = (_node_parent = node.parent) === null || _node_parent === void 0 ? void 0 : _node_parent.scopeRef) !== null && _node_parent_scopeRef !== void 0 ? _node_parent_scopeRef : null, node.nodeToRestore);\n return newTree;\n }\n constructor(){\n this.fastMap = new Map();\n this.root = new $9bf71ea28793e738$var$TreeNode({\n scopeRef: null\n });\n this.fastMap.set(null, this.root);\n }\n}\nclass $9bf71ea28793e738$var$TreeNode {\n addChild(node) {\n this.children.add(node);\n node.parent = this;\n }\n removeChild(node) {\n this.children.delete(node);\n node.parent = undefined;\n }\n constructor(props){\n this.children = new Set();\n this.contain = false;\n this.scopeRef = props.scopeRef;\n }\n}\nlet $9bf71ea28793e738$export$d06fae2ee68b101e = new $9bf71ea28793e738$var$Tree();\n\n\nexport {$9bf71ea28793e738$export$20e40289641fbbb6 as FocusScope, $9bf71ea28793e738$export$d06fae2ee68b101e as focusScopeTree, $9bf71ea28793e738$export$10c5169755ce7bd7 as useFocusManager, $9bf71ea28793e738$export$2d6ec8fc375ceafa as getFocusableTreeWalker, $9bf71ea28793e738$export$1258395f99bf9cbf as isElementInChildOfActiveScope, $9bf71ea28793e738$export$c5251b9e124bf29 as createFocusManager};\n//# sourceMappingURL=FocusScope.module.js.map\n"],"names":["$9bf71ea28793e738$var$FocusContext","$cgawC$react","$9bf71ea28793e738$var$RESTORE_FOCUS_EVENT","$9bf71ea28793e738$var$activeScope","$9bf71ea28793e738$export$20e40289641fbbb6","props","children","contain","restoreFocus","autoFocus","startRef","$cgawC$useRef","endRef","scopeRef","parentNode","$cgawC$useContext","node","$cgawC$useMemo","$9bf71ea28793e738$var$TreeNode","$cgawC$useLayoutEffect","parent","$9bf71ea28793e738$export$d06fae2ee68b101e","$9bf71ea28793e738$var$isAncestorScope","activeNode","_startRef_current","nodes","stopPropagation","e","$9bf71ea28793e738$var$useActiveScopeTracker","$9bf71ea28793e738$var$useFocusContainment","$9bf71ea28793e738$var$useRestoreFocus","$9bf71ea28793e738$var$useAutoFocus","$cgawC$useEffect","activeElement","$cgawC$getActiveElement","$cgawC$getOwnerDocument","scope","$9bf71ea28793e738$var$isElementInScope","_focusScopeTree_getTreeNode_parent","_focusScopeTree_getTreeNode","_focusScopeTree_getTreeNode_parent_scopeRef","parentScope","focusManager","$9bf71ea28793e738$var$createFocusManagerForScope","value","opts","from","tabbable","wrap","accept","_scope_","sentinel","scopeRoot","$9bf71ea28793e738$var$getScopeRoot","walker","$9bf71ea28793e738$export$2d6ec8fc375ceafa","nextNode","$9bf71ea28793e738$var$focusElement","previousNode","$9bf71ea28793e738$var$shouldContainFocus","$9bf71ea28793e738$var$isTabbableRadio","element","radios","radio","_element_form_elements","_element_form","radioList","focusedNode","raf","ownerDocument","onKeyDown","focusedElement","nextElement","onFocus","$cgawC$getEventTarget","$9bf71ea28793e738$var$isElementInChildScope","$9bf71ea28793e738$var$focusFirstInScope","onBlur","modality","$cgawC$getInteractionModality","shouldSkipFocusRestore","$cgawC$isAndroid","$cgawC$isChrome","target","_focusedNode_current","$9bf71ea28793e738$var$isElementInAnyScope","s","$9bf71ea28793e738$export$1258395f99bf9cbf","ancestor","scroll","$cgawC$focusSafely","$9bf71ea28793e738$var$getFirstInScope","autoFocusRef","restore","$9bf71ea28793e738$var$shouldRestoreFocus","nodeToRestoreRef","treeNode","nodeToRestore","_nodeToRestoreRef_current","clonedTree","$9bf71ea28793e738$var$restoreFocusToElement","root","filter","$cgawC$isTabbable","$cgawC$isFocusable","rootElement","doc","$cgawC$createShadowTreeWalker","_opts_from","$9bf71ea28793e738$var$Tree","data","current","child","_node_parent","newTree","_node_parent_scopeRef"],"mappings":";;;;AAiBA,MAAMA,IAAuDC,gBAAAA,EAAc,cAAc,IAAI,GACvFC,IAA4C;AAClD,IAAIC,IAA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AK,QAAQ;AAAA,EACpC;AAAA;AAAA,EAED,CAAC,SAASA,IAAO,KAAK,MAAM;AAExB,QADIA,EAAK,YAAY,SAAM,MAAMA,IAC7BA,EAAK,SAAS,OAAO,EAAG,UAASgG,KAAShG,EAAK,SAAS,QAAO,KAAK,SAASgG,CAAK;AAAA,EACzF;AAAA,EACD,QAAQ;AACJ,QAAIC;AACJ,QAAIC,IAAU,IAAIL;AAClB,QAAIM;AACJ,aAASnG,KAAQ,KAAK,SAAU,EAAC,CAAAkG,EAAQ,YAAYlG,EAAK,WAAWmG,KAAyBF,IAAejG,EAAK,YAAY,QAAQiG,MAAiB,SAAS,SAASA,EAAa,cAAc,QAAQE,MAA0B,SAASA,IAAwB,MAAMnG,EAAK,aAAa;AAC/R,WAAOkG;AAAA,EACV;AAAA,EACD,cAAa;AACT,SAAK,UAAU,oBAAI,OACnB,KAAK,OAAO,IAAIhG,EAA+B;AAAA,MAC3C,UAAU;AAAA,IACtB,CAAS,GACD,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI;AAAA,EACnC;AACL;AACA,MAAMA,EAA+B;AAAA,EACjC,SAASF,GAAM;AACX,SAAK,SAAS,IAAIA,CAAI,GACtBA,EAAK,SAAS;AAAA,EACjB;AAAA,EACD,YAAYA,GAAM;AACd,SAAK,SAAS,OAAOA,CAAI,GACzBA,EAAK,SAAS;AAAA,EACjB;AAAA,EACD,YAAYX,GAAM;AACd,SAAK,WAAW,oBAAI,OACpB,KAAK,UAAU,IACf,KAAK,WAAWA,EAAM;AAAA,EACzB;AACL;AACG,IAACgB,IAA4C,IAAIwF,EAA0B;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"FocusScope.es.js","sources":["../../../../../node_modules/@react-aria/focus/dist/FocusScope.mjs"],"sourcesContent":["import {useLayoutEffect as $cgawC$useLayoutEffect, getActiveElement as $cgawC$getActiveElement, getOwnerDocument as $cgawC$getOwnerDocument, getEventTarget as $cgawC$getEventTarget, isAndroid as $cgawC$isAndroid, isChrome as $cgawC$isChrome, isTabbable as $cgawC$isTabbable, isFocusable as $cgawC$isFocusable, createShadowTreeWalker as $cgawC$createShadowTreeWalker} from \"@react-aria/utils\";\nimport {getInteractionModality as $cgawC$getInteractionModality, focusSafely as $cgawC$focusSafely} from \"@react-aria/interactions\";\nimport $cgawC$react, {useRef as $cgawC$useRef, useContext as $cgawC$useContext, useMemo as $cgawC$useMemo, useEffect as $cgawC$useEffect} from \"react\";\n\n/*\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\nconst $9bf71ea28793e738$var$FocusContext = /*#__PURE__*/ (0, $cgawC$react).createContext(null);\nconst $9bf71ea28793e738$var$RESTORE_FOCUS_EVENT = 'react-aria-focus-scope-restore';\nlet $9bf71ea28793e738$var$activeScope = null;\nfunction $9bf71ea28793e738$export$20e40289641fbbb6(props) {\n let { children: children, contain: contain, restoreFocus: restoreFocus, autoFocus: autoFocus } = props;\n let startRef = (0, $cgawC$useRef)(null);\n let endRef = (0, $cgawC$useRef)(null);\n let scopeRef = (0, $cgawC$useRef)([]);\n let { parentNode: parentNode } = (0, $cgawC$useContext)($9bf71ea28793e738$var$FocusContext) || {};\n // Create a tree node here so we can add children to it even before it is added to the tree.\n let node = (0, $cgawC$useMemo)(()=>new $9bf71ea28793e738$var$TreeNode({\n scopeRef: scopeRef\n }), [\n scopeRef\n ]);\n (0, $cgawC$useLayoutEffect)(()=>{\n // If a new scope mounts outside the active scope, (e.g. DialogContainer launched from a menu),\n // use the active scope as the parent instead of the parent from context. Layout effects run bottom\n // up, so if the parent is not yet added to the tree, don't do this. Only the outer-most FocusScope\n // that is being added should get the activeScope as its parent.\n let parent = parentNode || $9bf71ea28793e738$export$d06fae2ee68b101e.root;\n if ($9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(parent.scopeRef) && $9bf71ea28793e738$var$activeScope && !$9bf71ea28793e738$var$isAncestorScope($9bf71ea28793e738$var$activeScope, parent.scopeRef)) {\n let activeNode = $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode($9bf71ea28793e738$var$activeScope);\n if (activeNode) parent = activeNode;\n }\n // Add the node to the parent, and to the tree.\n parent.addChild(node);\n $9bf71ea28793e738$export$d06fae2ee68b101e.addNode(node);\n }, [\n node,\n parentNode\n ]);\n (0, $cgawC$useLayoutEffect)(()=>{\n let node = $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(scopeRef);\n if (node) node.contain = !!contain;\n }, [\n contain\n ]);\n (0, $cgawC$useLayoutEffect)(()=>{\n var _startRef_current;\n // Find all rendered nodes between the sentinels and add them to the scope.\n let node = (_startRef_current = startRef.current) === null || _startRef_current === void 0 ? void 0 : _startRef_current.nextSibling;\n let nodes = [];\n let stopPropagation = (e)=>e.stopPropagation();\n while(node && node !== endRef.current){\n nodes.push(node);\n // Stop custom restore focus event from propagating to parent focus scopes.\n node.addEventListener($9bf71ea28793e738$var$RESTORE_FOCUS_EVENT, stopPropagation);\n node = node.nextSibling;\n }\n scopeRef.current = nodes;\n return ()=>{\n for (let node of nodes)node.removeEventListener($9bf71ea28793e738$var$RESTORE_FOCUS_EVENT, stopPropagation);\n };\n }, [\n children\n ]);\n $9bf71ea28793e738$var$useActiveScopeTracker(scopeRef, restoreFocus, contain);\n $9bf71ea28793e738$var$useFocusContainment(scopeRef, contain);\n $9bf71ea28793e738$var$useRestoreFocus(scopeRef, restoreFocus, contain);\n $9bf71ea28793e738$var$useAutoFocus(scopeRef, autoFocus);\n // This needs to be an effect so that activeScope is updated after the FocusScope tree is complete.\n // It cannot be a useLayoutEffect because the parent of this node hasn't been attached in the tree yet.\n (0, $cgawC$useEffect)(()=>{\n const activeElement = (0, $cgawC$getActiveElement)((0, $cgawC$getOwnerDocument)(scopeRef.current ? scopeRef.current[0] : undefined));\n let scope = null;\n if ($9bf71ea28793e738$var$isElementInScope(activeElement, scopeRef.current)) {\n // We need to traverse the focusScope tree and find the bottom most scope that\n // contains the active element and set that as the activeScope.\n for (let node of $9bf71ea28793e738$export$d06fae2ee68b101e.traverse())if (node.scopeRef && $9bf71ea28793e738$var$isElementInScope(activeElement, node.scopeRef.current)) scope = node;\n if (scope === $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(scopeRef)) $9bf71ea28793e738$var$activeScope = scope.scopeRef;\n }\n }, [\n scopeRef\n ]);\n // This layout effect cleanup is so that the tree node is removed synchronously with react before the RAF\n // in useRestoreFocus cleanup runs.\n (0, $cgawC$useLayoutEffect)(()=>{\n return ()=>{\n var _focusScopeTree_getTreeNode_parent, _focusScopeTree_getTreeNode;\n var _focusScopeTree_getTreeNode_parent_scopeRef;\n // Scope may have been re-parented.\n let parentScope = (_focusScopeTree_getTreeNode_parent_scopeRef = (_focusScopeTree_getTreeNode = $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(scopeRef)) === null || _focusScopeTree_getTreeNode === void 0 ? void 0 : (_focusScopeTree_getTreeNode_parent = _focusScopeTree_getTreeNode.parent) === null || _focusScopeTree_getTreeNode_parent === void 0 ? void 0 : _focusScopeTree_getTreeNode_parent.scopeRef) !== null && _focusScopeTree_getTreeNode_parent_scopeRef !== void 0 ? _focusScopeTree_getTreeNode_parent_scopeRef : null;\n if ((scopeRef === $9bf71ea28793e738$var$activeScope || $9bf71ea28793e738$var$isAncestorScope(scopeRef, $9bf71ea28793e738$var$activeScope)) && (!parentScope || $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(parentScope))) $9bf71ea28793e738$var$activeScope = parentScope;\n $9bf71ea28793e738$export$d06fae2ee68b101e.removeTreeNode(scopeRef);\n };\n }, [\n scopeRef\n ]);\n let focusManager = (0, $cgawC$useMemo)(()=>$9bf71ea28793e738$var$createFocusManagerForScope(scopeRef), []);\n let value = (0, $cgawC$useMemo)(()=>({\n focusManager: focusManager,\n parentNode: node\n }), [\n node,\n focusManager\n ]);\n return /*#__PURE__*/ (0, $cgawC$react).createElement($9bf71ea28793e738$var$FocusContext.Provider, {\n value: value\n }, /*#__PURE__*/ (0, $cgawC$react).createElement(\"span\", {\n \"data-focus-scope-start\": true,\n hidden: true,\n ref: startRef\n }), children, /*#__PURE__*/ (0, $cgawC$react).createElement(\"span\", {\n \"data-focus-scope-end\": true,\n hidden: true,\n ref: endRef\n }));\n}\nfunction $9bf71ea28793e738$export$10c5169755ce7bd7() {\n var _useContext;\n return (_useContext = (0, $cgawC$useContext)($9bf71ea28793e738$var$FocusContext)) === null || _useContext === void 0 ? void 0 : _useContext.focusManager;\n}\nfunction $9bf71ea28793e738$var$createFocusManagerForScope(scopeRef) {\n return {\n focusNext (opts = {}) {\n let scope = scopeRef.current;\n let { from: from, tabbable: tabbable, wrap: wrap, accept: accept } = opts;\n var _scope_;\n let node = from || (0, $cgawC$getActiveElement)((0, $cgawC$getOwnerDocument)((_scope_ = scope[0]) !== null && _scope_ !== void 0 ? _scope_ : undefined));\n let sentinel = scope[0].previousElementSibling;\n let scopeRoot = $9bf71ea28793e738$var$getScopeRoot(scope);\n let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(scopeRoot, {\n tabbable: tabbable,\n accept: accept\n }, scope);\n walker.currentNode = $9bf71ea28793e738$var$isElementInScope(node, scope) ? node : sentinel;\n let nextNode = walker.nextNode();\n if (!nextNode && wrap) {\n walker.currentNode = sentinel;\n nextNode = walker.nextNode();\n }\n if (nextNode) $9bf71ea28793e738$var$focusElement(nextNode, true);\n return nextNode;\n },\n focusPrevious (opts = {}) {\n let scope = scopeRef.current;\n let { from: from, tabbable: tabbable, wrap: wrap, accept: accept } = opts;\n var _scope_;\n let node = from || (0, $cgawC$getActiveElement)((0, $cgawC$getOwnerDocument)((_scope_ = scope[0]) !== null && _scope_ !== void 0 ? _scope_ : undefined));\n let sentinel = scope[scope.length - 1].nextElementSibling;\n let scopeRoot = $9bf71ea28793e738$var$getScopeRoot(scope);\n let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(scopeRoot, {\n tabbable: tabbable,\n accept: accept\n }, scope);\n walker.currentNode = $9bf71ea28793e738$var$isElementInScope(node, scope) ? node : sentinel;\n let previousNode = walker.previousNode();\n if (!previousNode && wrap) {\n walker.currentNode = sentinel;\n previousNode = walker.previousNode();\n }\n if (previousNode) $9bf71ea28793e738$var$focusElement(previousNode, true);\n return previousNode;\n },\n focusFirst (opts = {}) {\n let scope = scopeRef.current;\n let { tabbable: tabbable, accept: accept } = opts;\n let scopeRoot = $9bf71ea28793e738$var$getScopeRoot(scope);\n let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(scopeRoot, {\n tabbable: tabbable,\n accept: accept\n }, scope);\n walker.currentNode = scope[0].previousElementSibling;\n let nextNode = walker.nextNode();\n if (nextNode) $9bf71ea28793e738$var$focusElement(nextNode, true);\n return nextNode;\n },\n focusLast (opts = {}) {\n let scope = scopeRef.current;\n let { tabbable: tabbable, accept: accept } = opts;\n let scopeRoot = $9bf71ea28793e738$var$getScopeRoot(scope);\n let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(scopeRoot, {\n tabbable: tabbable,\n accept: accept\n }, scope);\n walker.currentNode = scope[scope.length - 1].nextElementSibling;\n let previousNode = walker.previousNode();\n if (previousNode) $9bf71ea28793e738$var$focusElement(previousNode, true);\n return previousNode;\n }\n };\n}\nfunction $9bf71ea28793e738$var$getScopeRoot(scope) {\n return scope[0].parentElement;\n}\nfunction $9bf71ea28793e738$var$shouldContainFocus(scopeRef) {\n let scope = $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode($9bf71ea28793e738$var$activeScope);\n while(scope && scope.scopeRef !== scopeRef){\n if (scope.contain) return false;\n scope = scope.parent;\n }\n return true;\n}\nfunction $9bf71ea28793e738$var$isTabbableRadio(element) {\n if (element.checked) return true;\n let radios = [];\n if (!element.form) radios = [\n ...(0, $cgawC$getOwnerDocument)(element).querySelectorAll(`input[type=\"radio\"][name=\"${CSS.escape(element.name)}\"]`)\n ].filter((radio)=>!radio.form);\n else {\n var _element_form_elements, _element_form;\n let radioList = (_element_form = element.form) === null || _element_form === void 0 ? void 0 : (_element_form_elements = _element_form.elements) === null || _element_form_elements === void 0 ? void 0 : _element_form_elements.namedItem(element.name);\n radios = [\n ...radioList !== null && radioList !== void 0 ? radioList : []\n ];\n }\n if (!radios) return false;\n let anyChecked = radios.some((radio)=>radio.checked);\n return !anyChecked;\n}\nfunction $9bf71ea28793e738$var$useFocusContainment(scopeRef, contain) {\n let focusedNode = (0, $cgawC$useRef)(undefined);\n let raf = (0, $cgawC$useRef)(undefined);\n (0, $cgawC$useLayoutEffect)(()=>{\n let scope = scopeRef.current;\n if (!contain) {\n // if contain was changed, then we should cancel any ongoing waits to pull focus back into containment\n if (raf.current) {\n cancelAnimationFrame(raf.current);\n raf.current = undefined;\n }\n return;\n }\n const ownerDocument = (0, $cgawC$getOwnerDocument)(scope ? scope[0] : undefined);\n // Handle the Tab key to contain focus within the scope\n let onKeyDown = (e)=>{\n if (e.key !== 'Tab' || e.altKey || e.ctrlKey || e.metaKey || !$9bf71ea28793e738$var$shouldContainFocus(scopeRef) || e.isComposing) return;\n let focusedElement = (0, $cgawC$getActiveElement)(ownerDocument);\n let scope = scopeRef.current;\n if (!scope || !$9bf71ea28793e738$var$isElementInScope(focusedElement, scope)) return;\n let scopeRoot = $9bf71ea28793e738$var$getScopeRoot(scope);\n let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(scopeRoot, {\n tabbable: true\n }, scope);\n if (!focusedElement) return;\n walker.currentNode = focusedElement;\n let nextElement = e.shiftKey ? walker.previousNode() : walker.nextNode();\n if (!nextElement) {\n walker.currentNode = e.shiftKey ? scope[scope.length - 1].nextElementSibling : scope[0].previousElementSibling;\n nextElement = e.shiftKey ? walker.previousNode() : walker.nextNode();\n }\n e.preventDefault();\n if (nextElement) $9bf71ea28793e738$var$focusElement(nextElement, true);\n };\n let onFocus = (e)=>{\n // If focusing an element in a child scope of the currently active scope, the child becomes active.\n // Moving out of the active scope to an ancestor is not allowed.\n if ((!$9bf71ea28793e738$var$activeScope || $9bf71ea28793e738$var$isAncestorScope($9bf71ea28793e738$var$activeScope, scopeRef)) && $9bf71ea28793e738$var$isElementInScope((0, $cgawC$getEventTarget)(e), scopeRef.current)) {\n $9bf71ea28793e738$var$activeScope = scopeRef;\n focusedNode.current = (0, $cgawC$getEventTarget)(e);\n } else if ($9bf71ea28793e738$var$shouldContainFocus(scopeRef) && !$9bf71ea28793e738$var$isElementInChildScope((0, $cgawC$getEventTarget)(e), scopeRef)) {\n // If a focus event occurs outside the active scope (e.g. user tabs from browser location bar),\n // restore focus to the previously focused node or the first tabbable element in the active scope.\n if (focusedNode.current) focusedNode.current.focus();\n else if ($9bf71ea28793e738$var$activeScope && $9bf71ea28793e738$var$activeScope.current) $9bf71ea28793e738$var$focusFirstInScope($9bf71ea28793e738$var$activeScope.current);\n } else if ($9bf71ea28793e738$var$shouldContainFocus(scopeRef)) focusedNode.current = (0, $cgawC$getEventTarget)(e);\n };\n let onBlur = (e)=>{\n // Firefox doesn't shift focus back to the Dialog properly without this\n if (raf.current) cancelAnimationFrame(raf.current);\n raf.current = requestAnimationFrame(()=>{\n // Patches infinite focus coersion loop for Android Talkback where the user isn't able to move the virtual cursor\n // if within a containing focus scope. Bug filed against Chrome: https://issuetracker.google.com/issues/384844019.\n // Note that this means focus can leave focus containing modals due to this, but it is isolated to Chrome Talkback.\n let modality = (0, $cgawC$getInteractionModality)();\n let shouldSkipFocusRestore = (modality === 'virtual' || modality === null) && (0, $cgawC$isAndroid)() && (0, $cgawC$isChrome)();\n // Use document.activeElement instead of e.relatedTarget so we can tell if user clicked into iframe\n let activeElement = (0, $cgawC$getActiveElement)(ownerDocument);\n if (!shouldSkipFocusRestore && activeElement && $9bf71ea28793e738$var$shouldContainFocus(scopeRef) && !$9bf71ea28793e738$var$isElementInChildScope(activeElement, scopeRef)) {\n $9bf71ea28793e738$var$activeScope = scopeRef;\n let target = (0, $cgawC$getEventTarget)(e);\n if (target && target.isConnected) {\n var _focusedNode_current;\n focusedNode.current = target;\n (_focusedNode_current = focusedNode.current) === null || _focusedNode_current === void 0 ? void 0 : _focusedNode_current.focus();\n } else if ($9bf71ea28793e738$var$activeScope.current) $9bf71ea28793e738$var$focusFirstInScope($9bf71ea28793e738$var$activeScope.current);\n }\n });\n };\n ownerDocument.addEventListener('keydown', onKeyDown, false);\n ownerDocument.addEventListener('focusin', onFocus, false);\n scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener('focusin', onFocus, false));\n scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener('focusout', onBlur, false));\n return ()=>{\n ownerDocument.removeEventListener('keydown', onKeyDown, false);\n ownerDocument.removeEventListener('focusin', onFocus, false);\n scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener('focusin', onFocus, false));\n scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener('focusout', onBlur, false));\n };\n }, [\n scopeRef,\n contain\n ]);\n // This is a useLayoutEffect so it is guaranteed to run before our async synthetic blur\n (0, $cgawC$useLayoutEffect)(()=>{\n return ()=>{\n if (raf.current) cancelAnimationFrame(raf.current);\n };\n }, [\n raf\n ]);\n}\nfunction $9bf71ea28793e738$var$isElementInAnyScope(element) {\n return $9bf71ea28793e738$var$isElementInChildScope(element);\n}\nfunction $9bf71ea28793e738$var$isElementInScope(element, scope) {\n if (!element) return false;\n if (!scope) return false;\n return scope.some((node)=>node.contains(element));\n}\nfunction $9bf71ea28793e738$var$isElementInChildScope(element, scope = null) {\n // If the element is within a top layer element (e.g. toasts), always allow moving focus there.\n if (element instanceof Element && element.closest('[data-react-aria-top-layer]')) return true;\n // node.contains in isElementInScope covers child scopes that are also DOM children,\n // but does not cover child scopes in portals.\n for (let { scopeRef: s } of $9bf71ea28793e738$export$d06fae2ee68b101e.traverse($9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(scope))){\n if (s && $9bf71ea28793e738$var$isElementInScope(element, s.current)) return true;\n }\n return false;\n}\nfunction $9bf71ea28793e738$export$1258395f99bf9cbf(element) {\n return $9bf71ea28793e738$var$isElementInChildScope(element, $9bf71ea28793e738$var$activeScope);\n}\nfunction $9bf71ea28793e738$var$isAncestorScope(ancestor, scope) {\n var _focusScopeTree_getTreeNode;\n let parent = (_focusScopeTree_getTreeNode = $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(scope)) === null || _focusScopeTree_getTreeNode === void 0 ? void 0 : _focusScopeTree_getTreeNode.parent;\n while(parent){\n if (parent.scopeRef === ancestor) return true;\n parent = parent.parent;\n }\n return false;\n}\nfunction $9bf71ea28793e738$var$focusElement(element, scroll = false) {\n if (element != null && !scroll) try {\n (0, $cgawC$focusSafely)(element);\n } catch {\n // ignore\n }\n else if (element != null) try {\n element.focus();\n } catch {\n // ignore\n }\n}\nfunction $9bf71ea28793e738$var$getFirstInScope(scope, tabbable = true) {\n let sentinel = scope[0].previousElementSibling;\n let scopeRoot = $9bf71ea28793e738$var$getScopeRoot(scope);\n let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(scopeRoot, {\n tabbable: tabbable\n }, scope);\n walker.currentNode = sentinel;\n let nextNode = walker.nextNode();\n // If the scope does not contain a tabbable element, use the first focusable element.\n if (tabbable && !nextNode) {\n scopeRoot = $9bf71ea28793e738$var$getScopeRoot(scope);\n walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(scopeRoot, {\n tabbable: false\n }, scope);\n walker.currentNode = sentinel;\n nextNode = walker.nextNode();\n }\n return nextNode;\n}\nfunction $9bf71ea28793e738$var$focusFirstInScope(scope, tabbable = true) {\n $9bf71ea28793e738$var$focusElement($9bf71ea28793e738$var$getFirstInScope(scope, tabbable));\n}\nfunction $9bf71ea28793e738$var$useAutoFocus(scopeRef, autoFocus) {\n const autoFocusRef = (0, $cgawC$react).useRef(autoFocus);\n (0, $cgawC$useEffect)(()=>{\n if (autoFocusRef.current) {\n $9bf71ea28793e738$var$activeScope = scopeRef;\n const ownerDocument = (0, $cgawC$getOwnerDocument)(scopeRef.current ? scopeRef.current[0] : undefined);\n if (!$9bf71ea28793e738$var$isElementInScope((0, $cgawC$getActiveElement)(ownerDocument), $9bf71ea28793e738$var$activeScope.current) && scopeRef.current) $9bf71ea28793e738$var$focusFirstInScope(scopeRef.current);\n }\n autoFocusRef.current = false;\n }, [\n scopeRef\n ]);\n}\nfunction $9bf71ea28793e738$var$useActiveScopeTracker(scopeRef, restore, contain) {\n // tracks the active scope, in case restore and contain are both false.\n // if either are true, this is tracked in useRestoreFocus or useFocusContainment.\n (0, $cgawC$useLayoutEffect)(()=>{\n if (restore || contain) return;\n let scope = scopeRef.current;\n const ownerDocument = (0, $cgawC$getOwnerDocument)(scope ? scope[0] : undefined);\n let onFocus = (e)=>{\n let target = (0, $cgawC$getEventTarget)(e);\n if ($9bf71ea28793e738$var$isElementInScope(target, scopeRef.current)) $9bf71ea28793e738$var$activeScope = scopeRef;\n else if (!$9bf71ea28793e738$var$isElementInAnyScope(target)) $9bf71ea28793e738$var$activeScope = null;\n };\n ownerDocument.addEventListener('focusin', onFocus, false);\n scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener('focusin', onFocus, false));\n return ()=>{\n ownerDocument.removeEventListener('focusin', onFocus, false);\n scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener('focusin', onFocus, false));\n };\n }, [\n scopeRef,\n restore,\n contain\n ]);\n}\nfunction $9bf71ea28793e738$var$shouldRestoreFocus(scopeRef) {\n let scope = $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode($9bf71ea28793e738$var$activeScope);\n while(scope && scope.scopeRef !== scopeRef){\n if (scope.nodeToRestore) return false;\n scope = scope.parent;\n }\n return (scope === null || scope === void 0 ? void 0 : scope.scopeRef) === scopeRef;\n}\nfunction $9bf71ea28793e738$var$useRestoreFocus(scopeRef, restoreFocus, contain) {\n // create a ref during render instead of useLayoutEffect so the active element is saved before a child with autoFocus=true mounts.\n // eslint-disable-next-line no-restricted-globals\n const nodeToRestoreRef = (0, $cgawC$useRef)(typeof document !== 'undefined' ? (0, $cgawC$getActiveElement)((0, $cgawC$getOwnerDocument)(scopeRef.current ? scopeRef.current[0] : undefined)) : null);\n // restoring scopes should all track if they are active regardless of contain, but contain already tracks it plus logic to contain the focus\n // restoring-non-containing scopes should only care if they become active so they can perform the restore\n (0, $cgawC$useLayoutEffect)(()=>{\n let scope = scopeRef.current;\n const ownerDocument = (0, $cgawC$getOwnerDocument)(scope ? scope[0] : undefined);\n if (!restoreFocus || contain) return;\n let onFocus = ()=>{\n // If focusing an element in a child scope of the currently active scope, the child becomes active.\n // Moving out of the active scope to an ancestor is not allowed.\n if ((!$9bf71ea28793e738$var$activeScope || $9bf71ea28793e738$var$isAncestorScope($9bf71ea28793e738$var$activeScope, scopeRef)) && $9bf71ea28793e738$var$isElementInScope((0, $cgawC$getActiveElement)(ownerDocument), scopeRef.current)) $9bf71ea28793e738$var$activeScope = scopeRef;\n };\n ownerDocument.addEventListener('focusin', onFocus, false);\n scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener('focusin', onFocus, false));\n return ()=>{\n ownerDocument.removeEventListener('focusin', onFocus, false);\n scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener('focusin', onFocus, false));\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n scopeRef,\n contain\n ]);\n (0, $cgawC$useLayoutEffect)(()=>{\n const ownerDocument = (0, $cgawC$getOwnerDocument)(scopeRef.current ? scopeRef.current[0] : undefined);\n if (!restoreFocus) return;\n // Handle the Tab key so that tabbing out of the scope goes to the next element\n // after the node that had focus when the scope mounted. This is important when\n // using portals for overlays, so that focus goes to the expected element when\n // tabbing out of the overlay.\n let onKeyDown = (e)=>{\n if (e.key !== 'Tab' || e.altKey || e.ctrlKey || e.metaKey || !$9bf71ea28793e738$var$shouldContainFocus(scopeRef) || e.isComposing) return;\n let focusedElement = ownerDocument.activeElement;\n if (!$9bf71ea28793e738$var$isElementInChildScope(focusedElement, scopeRef) || !$9bf71ea28793e738$var$shouldRestoreFocus(scopeRef)) return;\n let treeNode = $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(scopeRef);\n if (!treeNode) return;\n let nodeToRestore = treeNode.nodeToRestore;\n // Create a DOM tree walker that matches all tabbable elements\n let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(ownerDocument.body, {\n tabbable: true\n });\n // Find the next tabbable element after the currently focused element\n walker.currentNode = focusedElement;\n let nextElement = e.shiftKey ? walker.previousNode() : walker.nextNode();\n if (!nodeToRestore || !nodeToRestore.isConnected || nodeToRestore === ownerDocument.body) {\n nodeToRestore = undefined;\n treeNode.nodeToRestore = undefined;\n }\n // If there is no next element, or it is outside the current scope, move focus to the\n // next element after the node to restore to instead.\n if ((!nextElement || !$9bf71ea28793e738$var$isElementInChildScope(nextElement, scopeRef)) && nodeToRestore) {\n walker.currentNode = nodeToRestore;\n // Skip over elements within the scope, in case the scope immediately follows the node to restore.\n do nextElement = e.shiftKey ? walker.previousNode() : walker.nextNode();\n while ($9bf71ea28793e738$var$isElementInChildScope(nextElement, scopeRef));\n e.preventDefault();\n e.stopPropagation();\n if (nextElement) $9bf71ea28793e738$var$focusElement(nextElement, true);\n else // If there is no next element and the nodeToRestore isn't within a FocusScope (i.e. we are leaving the top level focus scope)\n // then move focus to the body.\n // Otherwise restore focus to the nodeToRestore (e.g menu within a popover -> tabbing to close the menu should move focus to menu trigger)\n if (!$9bf71ea28793e738$var$isElementInAnyScope(nodeToRestore)) focusedElement.blur();\n else $9bf71ea28793e738$var$focusElement(nodeToRestore, true);\n }\n };\n if (!contain) ownerDocument.addEventListener('keydown', onKeyDown, true);\n return ()=>{\n if (!contain) ownerDocument.removeEventListener('keydown', onKeyDown, true);\n };\n }, [\n scopeRef,\n restoreFocus,\n contain\n ]);\n // useLayoutEffect instead of useEffect so the active element is saved synchronously instead of asynchronously.\n (0, $cgawC$useLayoutEffect)(()=>{\n const ownerDocument = (0, $cgawC$getOwnerDocument)(scopeRef.current ? scopeRef.current[0] : undefined);\n if (!restoreFocus) return;\n let treeNode = $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(scopeRef);\n if (!treeNode) return;\n var _nodeToRestoreRef_current;\n treeNode.nodeToRestore = (_nodeToRestoreRef_current = nodeToRestoreRef.current) !== null && _nodeToRestoreRef_current !== void 0 ? _nodeToRestoreRef_current : undefined;\n return ()=>{\n let treeNode = $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(scopeRef);\n if (!treeNode) return;\n let nodeToRestore = treeNode.nodeToRestore;\n // if we already lost focus to the body and this was the active scope, then we should attempt to restore\n let activeElement = (0, $cgawC$getActiveElement)(ownerDocument);\n if (restoreFocus && nodeToRestore && (activeElement && $9bf71ea28793e738$var$isElementInChildScope(activeElement, scopeRef) || activeElement === ownerDocument.body && $9bf71ea28793e738$var$shouldRestoreFocus(scopeRef))) {\n // freeze the focusScopeTree so it persists after the raf, otherwise during unmount nodes are removed from it\n let clonedTree = $9bf71ea28793e738$export$d06fae2ee68b101e.clone();\n requestAnimationFrame(()=>{\n // Only restore focus if we've lost focus to the body, the alternative is that focus has been purposefully moved elsewhere\n if (ownerDocument.activeElement === ownerDocument.body) {\n // look up the tree starting with our scope to find a nodeToRestore still in the DOM\n let treeNode = clonedTree.getTreeNode(scopeRef);\n while(treeNode){\n if (treeNode.nodeToRestore && treeNode.nodeToRestore.isConnected) {\n $9bf71ea28793e738$var$restoreFocusToElement(treeNode.nodeToRestore);\n return;\n }\n treeNode = treeNode.parent;\n }\n // If no nodeToRestore was found, focus the first element in the nearest\n // ancestor scope that is still in the tree.\n treeNode = clonedTree.getTreeNode(scopeRef);\n while(treeNode){\n if (treeNode.scopeRef && treeNode.scopeRef.current && $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(treeNode.scopeRef)) {\n let node = $9bf71ea28793e738$var$getFirstInScope(treeNode.scopeRef.current, true);\n $9bf71ea28793e738$var$restoreFocusToElement(node);\n return;\n }\n treeNode = treeNode.parent;\n }\n }\n });\n }\n };\n }, [\n scopeRef,\n restoreFocus\n ]);\n}\nfunction $9bf71ea28793e738$var$restoreFocusToElement(node) {\n // Dispatch a custom event that parent elements can intercept to customize focus restoration.\n // For example, virtualized collection components reuse DOM elements, so the original element\n // might still exist in the DOM but representing a different item.\n if (node.dispatchEvent(new CustomEvent($9bf71ea28793e738$var$RESTORE_FOCUS_EVENT, {\n bubbles: true,\n cancelable: true\n }))) $9bf71ea28793e738$var$focusElement(node);\n}\nfunction $9bf71ea28793e738$export$2d6ec8fc375ceafa(root, opts, scope) {\n let filter = (opts === null || opts === void 0 ? void 0 : opts.tabbable) ? (0, $cgawC$isTabbable) : (0, $cgawC$isFocusable);\n // Ensure that root is an Element or fall back appropriately\n let rootElement = (root === null || root === void 0 ? void 0 : root.nodeType) === Node.ELEMENT_NODE ? root : null;\n // Determine the document to use\n let doc = (0, $cgawC$getOwnerDocument)(rootElement);\n // Create a TreeWalker, ensuring the root is an Element or Document\n let walker = (0, $cgawC$createShadowTreeWalker)(doc, root || doc, NodeFilter.SHOW_ELEMENT, {\n acceptNode (node) {\n var _opts_from;\n // Skip nodes inside the starting node.\n if (opts === null || opts === void 0 ? void 0 : (_opts_from = opts.from) === null || _opts_from === void 0 ? void 0 : _opts_from.contains(node)) return NodeFilter.FILTER_REJECT;\n if ((opts === null || opts === void 0 ? void 0 : opts.tabbable) && node.tagName === 'INPUT' && node.getAttribute('type') === 'radio') {\n // If the radio is in a form, we can get all the other radios by name\n if (!$9bf71ea28793e738$var$isTabbableRadio(node)) return NodeFilter.FILTER_REJECT;\n // If the radio is in the same group as the current node and none are selected, we can skip it\n if (walker.currentNode.tagName === 'INPUT' && walker.currentNode.type === 'radio' && walker.currentNode.name === node.name) return NodeFilter.FILTER_REJECT;\n }\n if (filter(node) && (!scope || $9bf71ea28793e738$var$isElementInScope(node, scope)) && (!(opts === null || opts === void 0 ? void 0 : opts.accept) || opts.accept(node))) return NodeFilter.FILTER_ACCEPT;\n return NodeFilter.FILTER_SKIP;\n }\n });\n if (opts === null || opts === void 0 ? void 0 : opts.from) walker.currentNode = opts.from;\n return walker;\n}\nfunction $9bf71ea28793e738$export$c5251b9e124bf29(ref, defaultOptions = {}) {\n return {\n focusNext (opts = {}) {\n let root = ref.current;\n if (!root) return null;\n let { from: from, tabbable: tabbable = defaultOptions.tabbable, wrap: wrap = defaultOptions.wrap, accept: accept = defaultOptions.accept } = opts;\n let node = from || (0, $cgawC$getActiveElement)((0, $cgawC$getOwnerDocument)(root));\n let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(root, {\n tabbable: tabbable,\n accept: accept\n });\n if (root.contains(node)) walker.currentNode = node;\n let nextNode = walker.nextNode();\n if (!nextNode && wrap) {\n walker.currentNode = root;\n nextNode = walker.nextNode();\n }\n if (nextNode) $9bf71ea28793e738$var$focusElement(nextNode, true);\n return nextNode;\n },\n focusPrevious (opts = defaultOptions) {\n let root = ref.current;\n if (!root) return null;\n let { from: from, tabbable: tabbable = defaultOptions.tabbable, wrap: wrap = defaultOptions.wrap, accept: accept = defaultOptions.accept } = opts;\n let node = from || (0, $cgawC$getActiveElement)((0, $cgawC$getOwnerDocument)(root));\n let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(root, {\n tabbable: tabbable,\n accept: accept\n });\n if (root.contains(node)) walker.currentNode = node;\n else {\n let next = $9bf71ea28793e738$var$last(walker);\n if (next) $9bf71ea28793e738$var$focusElement(next, true);\n return next !== null && next !== void 0 ? next : null;\n }\n let previousNode = walker.previousNode();\n if (!previousNode && wrap) {\n walker.currentNode = root;\n let lastNode = $9bf71ea28793e738$var$last(walker);\n if (!lastNode) // couldn't wrap\n return null;\n previousNode = lastNode;\n }\n if (previousNode) $9bf71ea28793e738$var$focusElement(previousNode, true);\n return previousNode !== null && previousNode !== void 0 ? previousNode : null;\n },\n focusFirst (opts = defaultOptions) {\n let root = ref.current;\n if (!root) return null;\n let { tabbable: tabbable = defaultOptions.tabbable, accept: accept = defaultOptions.accept } = opts;\n let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(root, {\n tabbable: tabbable,\n accept: accept\n });\n let nextNode = walker.nextNode();\n if (nextNode) $9bf71ea28793e738$var$focusElement(nextNode, true);\n return nextNode;\n },\n focusLast (opts = defaultOptions) {\n let root = ref.current;\n if (!root) return null;\n let { tabbable: tabbable = defaultOptions.tabbable, accept: accept = defaultOptions.accept } = opts;\n let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(root, {\n tabbable: tabbable,\n accept: accept\n });\n let next = $9bf71ea28793e738$var$last(walker);\n if (next) $9bf71ea28793e738$var$focusElement(next, true);\n return next !== null && next !== void 0 ? next : null;\n }\n };\n}\nfunction $9bf71ea28793e738$var$last(walker) {\n let next = undefined;\n let last;\n do {\n last = walker.lastChild();\n if (last) next = last;\n }while (last);\n return next;\n}\nclass $9bf71ea28793e738$var$Tree {\n get size() {\n return this.fastMap.size;\n }\n getTreeNode(data) {\n return this.fastMap.get(data);\n }\n addTreeNode(scopeRef, parent, nodeToRestore) {\n let parentNode = this.fastMap.get(parent !== null && parent !== void 0 ? parent : null);\n if (!parentNode) return;\n let node = new $9bf71ea28793e738$var$TreeNode({\n scopeRef: scopeRef\n });\n parentNode.addChild(node);\n node.parent = parentNode;\n this.fastMap.set(scopeRef, node);\n if (nodeToRestore) node.nodeToRestore = nodeToRestore;\n }\n addNode(node) {\n this.fastMap.set(node.scopeRef, node);\n }\n removeTreeNode(scopeRef) {\n // never remove the root\n if (scopeRef === null) return;\n let node = this.fastMap.get(scopeRef);\n if (!node) return;\n let parentNode = node.parent;\n // when we remove a scope, check if any sibling scopes are trying to restore focus to something inside the scope we're removing\n // if we are, then replace the siblings restore with the restore from the scope we're removing\n for (let current of this.traverse())if (current !== node && node.nodeToRestore && current.nodeToRestore && node.scopeRef && node.scopeRef.current && $9bf71ea28793e738$var$isElementInScope(current.nodeToRestore, node.scopeRef.current)) current.nodeToRestore = node.nodeToRestore;\n let children = node.children;\n if (parentNode) {\n parentNode.removeChild(node);\n if (children.size > 0) children.forEach((child)=>parentNode && parentNode.addChild(child));\n }\n this.fastMap.delete(node.scopeRef);\n }\n // Pre Order Depth First\n *traverse(node = this.root) {\n if (node.scopeRef != null) yield node;\n if (node.children.size > 0) for (let child of node.children)yield* this.traverse(child);\n }\n clone() {\n var _node_parent;\n let newTree = new $9bf71ea28793e738$var$Tree();\n var _node_parent_scopeRef;\n for (let node of this.traverse())newTree.addTreeNode(node.scopeRef, (_node_parent_scopeRef = (_node_parent = node.parent) === null || _node_parent === void 0 ? void 0 : _node_parent.scopeRef) !== null && _node_parent_scopeRef !== void 0 ? _node_parent_scopeRef : null, node.nodeToRestore);\n return newTree;\n }\n constructor(){\n this.fastMap = new Map();\n this.root = new $9bf71ea28793e738$var$TreeNode({\n scopeRef: null\n });\n this.fastMap.set(null, this.root);\n }\n}\nclass $9bf71ea28793e738$var$TreeNode {\n addChild(node) {\n this.children.add(node);\n node.parent = this;\n }\n removeChild(node) {\n this.children.delete(node);\n node.parent = undefined;\n }\n constructor(props){\n this.children = new Set();\n this.contain = false;\n this.scopeRef = props.scopeRef;\n }\n}\nlet $9bf71ea28793e738$export$d06fae2ee68b101e = new $9bf71ea28793e738$var$Tree();\n\n\nexport {$9bf71ea28793e738$export$20e40289641fbbb6 as FocusScope, $9bf71ea28793e738$export$d06fae2ee68b101e as focusScopeTree, $9bf71ea28793e738$export$10c5169755ce7bd7 as useFocusManager, $9bf71ea28793e738$export$2d6ec8fc375ceafa as getFocusableTreeWalker, $9bf71ea28793e738$export$1258395f99bf9cbf as isElementInChildOfActiveScope, $9bf71ea28793e738$export$c5251b9e124bf29 as createFocusManager};\n//# sourceMappingURL=FocusScope.module.js.map\n"],"names":["$9bf71ea28793e738$var$isTabbableRadio","element","radios","$cgawC$getOwnerDocument","radio","_element_form_elements","_element_form","radioList","$9bf71ea28793e738$var$isElementInScope","scope","node","$9bf71ea28793e738$export$2d6ec8fc375ceafa","root","opts","filter","$cgawC$isTabbable","$cgawC$isFocusable","rootElement","doc","walker","$cgawC$createShadowTreeWalker","_opts_from","$9bf71ea28793e738$var$Tree","data","scopeRef","parent","nodeToRestore","parentNode","$9bf71ea28793e738$var$TreeNode","current","children","child","_node_parent","newTree","_node_parent_scopeRef","props"],"mappings":";AAmNA,SAASA,EAAsCC,GAAS;AACpD,MAAIA,EAAQ,QAAS,QAAO;AAC5B,MAAIC,IAAS,CAAA;AACb,MAAI,CAACD,EAAQ,KAAM,CAAAC,IAAS;AAAA,IACxB,GAAOC,EAAyBF,CAAO,EAAE,iBAAiB,6BAA6B,IAAI,OAAOA,EAAQ,IAAI,CAAC,IAAI;AAAA,EACtH,EAAC,OAAO,CAACG,MAAQ,CAACA,EAAM,IAAI;AAAA,OACxB;AACD,QAAIC,GAAwBC;AAC5B,QAAIC,KAAaD,IAAgBL,EAAQ,UAAU,QAAQK,MAAkB,WAAmBD,IAAyBC,EAAc,cAAc,QAAQD,MAA2B,SAAlG,SAAoHA,EAAuB,UAAUJ,EAAQ,IAAI;AACvP,IAAAC,IAAS;AAAA,MACL,GAAGK,KAAyD,CAAE;AAAA,IAC1E;AAAA,EACK;AACD,SAAKL,IAEE,CADUA,EAAO,KAAK,CAACE,MAAQA,EAAM,OAAO,IAD/B;AAGxB;AAgGA,SAASI,EAAuCP,GAASQ,GAAO;AAE5D,SADI,CAACR,KACD,CAACQ,IAAc,KACZA,EAAM,KAAK,CAACC,MAAOA,EAAK,SAAST,CAAO,CAAC;AACpD;AA6OA,SAASU,EAA0CC,GAAMC,GAAMJ,GAAO;AAClE,MAAIK,IAAUD,KAAS,QAAmCA,EAAK,WAAgBE,IAAyBC,GAEpGC,KAAeL,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IAAI;AAAA,EACnC;AACL;AACA,MAAMA,EAA+B;AAAA,EACjC,SAASlB,GAAM;AACX,SAAK,SAAS,IAAIA,CAAI,GACtBA,EAAK,SAAS;AAAA,EACjB;AAAA,EACD,YAAYA,GAAM;AACd,SAAK,SAAS,OAAOA,CAAI,GACzBA,EAAK,SAAS;AAAA,EACjB;AAAA,EACD,YAAYyB,GAAM;AACd,SAAK,WAAW,oBAAI,OACpB,KAAK,UAAU,IACf,KAAK,WAAWA,EAAM;AAAA,EACzB;AACL;AACgD,IAAIb,EAA0B;","x_google_ignoreList":[0]}
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@react-aria/utils"),v=require("../../interactions/dist/usePress.cjs.js"),C=require("../../interactions/dist/useFocusable.cjs.js");function D(e,o){let{elementType:s="button",isDisabled:r,onPress:d,onPressStart:l,onPressEnd:u,onPressUp:P,onPressChange:c,preventFocusOnPress:f,allowFocusWhenDisabled:b,onClick:m,href:g,target:h,rel:p,type:i="button"}=e,n;s==="button"?n={type:i,disabled:r,form:e.form,formAction:e.formAction,formEncType:e.formEncType,formMethod:e.formMethod,formNoValidate:e.formNoValidate,formTarget:e.formTarget,name:e.name,value:e.value}:n={role:"button",href:s==="a"&&!r?g:void 0,target:s==="a"?h:void 0,type:s==="input"?i:void 0,disabled:s==="input"?r:void 0,"aria-disabled":!r||s==="input"?void 0:r,rel:s==="a"?p:void 0};let{pressProps:y,isPressed:F}=v.usePress({onPressStart:l,onPressEnd:u,onPressChange:c,onPress:d,onPressUp:P,onClick:m,isDisabled:r,preventFocusOnPress:f,ref:o}),{focusableProps:a}=C.useFocusable(e,o);b&&(a.tabIndex=r?-1:a.tabIndex);let T=t.mergeProps(a,y,t.filterDOMProps(e,{labelable:!0}));return{isPressed:F,buttonProps:t.mergeProps(n,T,{"aria-haspopup":e["aria-haspopup"],"aria-expanded":e["aria-expanded"],"aria-controls":e["aria-controls"],"aria-pressed":e["aria-pressed"],"aria-current":e["aria-current"]})}}exports.useButton=D;
|
|
2
|
-
//# sourceMappingURL=useButton.cjs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useButton.cjs.js","sources":["../../../../../node_modules/@react-aria/button/dist/useButton.mjs"],"sourcesContent":["import {mergeProps as $bwqiF$mergeProps, filterDOMProps as $bwqiF$filterDOMProps} from \"@react-aria/utils\";\nimport {usePress as $bwqiF$usePress, useFocusable as $bwqiF$useFocusable} from \"@react-aria/interactions\";\n\n/*\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 $701a24aa0da5b062$export$ea18c227d4417cc3(props, ref) {\n let { elementType: elementType = 'button', isDisabled: isDisabled, onPress: onPress, onPressStart: onPressStart, onPressEnd: onPressEnd, onPressUp: onPressUp, onPressChange: onPressChange, preventFocusOnPress: preventFocusOnPress, allowFocusWhenDisabled: // @ts-ignore - undocumented\n allowFocusWhenDisabled, onClick: onClick, href: href, target: target, rel: rel, type: type = 'button' } = props;\n let additionalProps;\n if (elementType === 'button') additionalProps = {\n type: type,\n disabled: isDisabled,\n form: props.form,\n formAction: props.formAction,\n formEncType: props.formEncType,\n formMethod: props.formMethod,\n formNoValidate: props.formNoValidate,\n formTarget: props.formTarget,\n name: props.name,\n value: props.value\n };\n else additionalProps = {\n role: 'button',\n href: elementType === 'a' && !isDisabled ? href : undefined,\n target: elementType === 'a' ? target : undefined,\n type: elementType === 'input' ? type : undefined,\n disabled: elementType === 'input' ? isDisabled : undefined,\n 'aria-disabled': !isDisabled || elementType === 'input' ? undefined : isDisabled,\n rel: elementType === 'a' ? rel : undefined\n };\n let { pressProps: pressProps, isPressed: isPressed } = (0, $bwqiF$usePress)({\n onPressStart: onPressStart,\n onPressEnd: onPressEnd,\n onPressChange: onPressChange,\n onPress: onPress,\n onPressUp: onPressUp,\n onClick: onClick,\n isDisabled: isDisabled,\n preventFocusOnPress: preventFocusOnPress,\n ref: ref\n });\n let { focusableProps: focusableProps } = (0, $bwqiF$useFocusable)(props, ref);\n if (allowFocusWhenDisabled) focusableProps.tabIndex = isDisabled ? -1 : focusableProps.tabIndex;\n let buttonProps = (0, $bwqiF$mergeProps)(focusableProps, pressProps, (0, $bwqiF$filterDOMProps)(props, {\n labelable: true\n }));\n return {\n isPressed: isPressed,\n buttonProps: (0, $bwqiF$mergeProps)(additionalProps, buttonProps, {\n 'aria-haspopup': props['aria-haspopup'],\n 'aria-expanded': props['aria-expanded'],\n 'aria-controls': props['aria-controls'],\n 'aria-pressed': props['aria-pressed'],\n 'aria-current': props['aria-current']\n })\n };\n}\n\n\nexport {$701a24aa0da5b062$export$ea18c227d4417cc3 as useButton};\n//# sourceMappingURL=useButton.module.js.map\n"],"names":["$701a24aa0da5b062$export$ea18c227d4417cc3","props","ref","elementType","isDisabled","onPress","onPressStart","onPressEnd","onPressUp","onPressChange","preventFocusOnPress","allowFocusWhenDisabled","onClick","href","target","rel","type","additionalProps","pressProps","isPressed","$bwqiF$usePress","focusableProps","$bwqiF$useFocusable","buttonProps","$bwqiF$mergeProps","$bwqiF$filterDOMProps"],"mappings":"mOAeA,SAASA,EAA0CC,EAAOC,EAAK,CAC3D,GAAI,CAAE,YAAaC,EAAc,SAAU,WAAYC,EAAY,QAASC,EAAS,aAAcC,EAAc,WAAYC,EAAY,UAAWC,EAAW,cAAeC,EAAe,oBAAqBC,EAAqB,uBACvOC,EAAwB,QAASC,EAAS,KAAMC,EAAM,OAAQC,EAAQ,IAAKC,EAAK,KAAMC,EAAO,QAAQ,EAAKf,EACtGgB,EACAd,IAAgB,SAAUc,EAAkB,CAC5C,KAAMD,EACN,SAAUZ,EACV,KAAMH,EAAM,KACZ,WAAYA,EAAM,WAClB,YAAaA,EAAM,YACnB,WAAYA,EAAM,WAClB,eAAgBA,EAAM,eACtB,WAAYA,EAAM,WAClB,KAAMA,EAAM,KACZ,MAAOA,EAAM,KACrB,EACSgB,EAAkB,CACnB,KAAM,SACN,KAAMd,IAAgB,KAAO,CAACC,EAAaS,EAAO,OAClD,OAAQV,IAAgB,IAAMW,EAAS,OACvC,KAAMX,IAAgB,QAAUa,EAAO,OACvC,SAAUb,IAAgB,QAAUC,EAAa,OACjD,gBAAiB,CAACA,GAAcD,IAAgB,QAAU,OAAYC,EACtE,IAAKD,IAAgB,IAAMY,EAAM,MACzC,EACI,GAAI,CAAE,WAAYG,EAAY,UAAWC,CAAS,EAASC,WAAiB,CACxE,aAAcd,EACd,WAAYC,EACZ,cAAeE,EACf,QAASJ,EACT,UAAWG,EACX,QAASI,EACT,WAAYR,EACZ,oBAAqBM,EACrB,IAAKR,CACb,CAAK,EACG,CAAE,eAAgBmB,CAAgB,EAAOC,EAAAA,aAAqBrB,EAAOC,CAAG,EACxES,IAAwBU,EAAe,SAAWjB,EAAa,GAAKiB,EAAe,UACvF,IAAIE,EAAkBC,aAAmBH,EAAgBH,EAAgBO,EAAqB,eAAExB,EAAO,CACnG,UAAW,EACd,CAAA,CAAC,EACF,MAAO,CACH,UAAWkB,EACX,YAAiBK,EAAAA,WAAmBP,EAAiBM,EAAa,CAC9D,gBAAiBtB,EAAM,eAAe,EACtC,gBAAiBA,EAAM,eAAe,EACtC,gBAAiBA,EAAM,eAAe,EACtC,eAAgBA,EAAM,cAAc,EACpC,eAAgBA,EAAM,cAAc,CAChD,CAAS,CACT,CACA","x_google_ignoreList":[0]}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { mergeProps as i, filterDOMProps as C } from "@react-aria/utils";
|
|
2
|
-
import { usePress as D } from "../../interactions/dist/usePress.es.js";
|
|
3
|
-
import { useFocusable as F } from "../../interactions/dist/useFocusable.es.js";
|
|
4
|
-
function O(e, t) {
|
|
5
|
-
let { elementType: r = "button", isDisabled: a, onPress: d, onPressStart: l, onPressEnd: f, onPressUp: u, onPressChange: P, preventFocusOnPress: c, allowFocusWhenDisabled: b, onClick: m, href: p, target: h, rel: g, type: o = "button" } = e, s;
|
|
6
|
-
r === "button" ? s = {
|
|
7
|
-
type: o,
|
|
8
|
-
disabled: a,
|
|
9
|
-
form: e.form,
|
|
10
|
-
formAction: e.formAction,
|
|
11
|
-
formEncType: e.formEncType,
|
|
12
|
-
formMethod: e.formMethod,
|
|
13
|
-
formNoValidate: e.formNoValidate,
|
|
14
|
-
formTarget: e.formTarget,
|
|
15
|
-
name: e.name,
|
|
16
|
-
value: e.value
|
|
17
|
-
} : s = {
|
|
18
|
-
role: "button",
|
|
19
|
-
href: r === "a" && !a ? p : void 0,
|
|
20
|
-
target: r === "a" ? h : void 0,
|
|
21
|
-
type: r === "input" ? o : void 0,
|
|
22
|
-
disabled: r === "input" ? a : void 0,
|
|
23
|
-
"aria-disabled": !a || r === "input" ? void 0 : a,
|
|
24
|
-
rel: r === "a" ? g : void 0
|
|
25
|
-
};
|
|
26
|
-
let { pressProps: $, isPressed: x } = D({
|
|
27
|
-
onPressStart: l,
|
|
28
|
-
onPressEnd: f,
|
|
29
|
-
onPressChange: P,
|
|
30
|
-
onPress: d,
|
|
31
|
-
onPressUp: u,
|
|
32
|
-
onClick: m,
|
|
33
|
-
isDisabled: a,
|
|
34
|
-
preventFocusOnPress: c,
|
|
35
|
-
ref: t
|
|
36
|
-
}), { focusableProps: n } = F(e, t);
|
|
37
|
-
b && (n.tabIndex = a ? -1 : n.tabIndex);
|
|
38
|
-
let y = i(n, $, C(e, {
|
|
39
|
-
labelable: !0
|
|
40
|
-
}));
|
|
41
|
-
return {
|
|
42
|
-
isPressed: x,
|
|
43
|
-
buttonProps: i(s, y, {
|
|
44
|
-
"aria-haspopup": e["aria-haspopup"],
|
|
45
|
-
"aria-expanded": e["aria-expanded"],
|
|
46
|
-
"aria-controls": e["aria-controls"],
|
|
47
|
-
"aria-pressed": e["aria-pressed"],
|
|
48
|
-
"aria-current": e["aria-current"]
|
|
49
|
-
})
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
export {
|
|
53
|
-
O as useButton
|
|
54
|
-
};
|
|
55
|
-
//# sourceMappingURL=useButton.es.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useButton.es.js","sources":["../../../../../node_modules/@react-aria/button/dist/useButton.mjs"],"sourcesContent":["import {mergeProps as $bwqiF$mergeProps, filterDOMProps as $bwqiF$filterDOMProps} from \"@react-aria/utils\";\nimport {usePress as $bwqiF$usePress, useFocusable as $bwqiF$useFocusable} from \"@react-aria/interactions\";\n\n/*\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 $701a24aa0da5b062$export$ea18c227d4417cc3(props, ref) {\n let { elementType: elementType = 'button', isDisabled: isDisabled, onPress: onPress, onPressStart: onPressStart, onPressEnd: onPressEnd, onPressUp: onPressUp, onPressChange: onPressChange, preventFocusOnPress: preventFocusOnPress, allowFocusWhenDisabled: // @ts-ignore - undocumented\n allowFocusWhenDisabled, onClick: onClick, href: href, target: target, rel: rel, type: type = 'button' } = props;\n let additionalProps;\n if (elementType === 'button') additionalProps = {\n type: type,\n disabled: isDisabled,\n form: props.form,\n formAction: props.formAction,\n formEncType: props.formEncType,\n formMethod: props.formMethod,\n formNoValidate: props.formNoValidate,\n formTarget: props.formTarget,\n name: props.name,\n value: props.value\n };\n else additionalProps = {\n role: 'button',\n href: elementType === 'a' && !isDisabled ? href : undefined,\n target: elementType === 'a' ? target : undefined,\n type: elementType === 'input' ? type : undefined,\n disabled: elementType === 'input' ? isDisabled : undefined,\n 'aria-disabled': !isDisabled || elementType === 'input' ? undefined : isDisabled,\n rel: elementType === 'a' ? rel : undefined\n };\n let { pressProps: pressProps, isPressed: isPressed } = (0, $bwqiF$usePress)({\n onPressStart: onPressStart,\n onPressEnd: onPressEnd,\n onPressChange: onPressChange,\n onPress: onPress,\n onPressUp: onPressUp,\n onClick: onClick,\n isDisabled: isDisabled,\n preventFocusOnPress: preventFocusOnPress,\n ref: ref\n });\n let { focusableProps: focusableProps } = (0, $bwqiF$useFocusable)(props, ref);\n if (allowFocusWhenDisabled) focusableProps.tabIndex = isDisabled ? -1 : focusableProps.tabIndex;\n let buttonProps = (0, $bwqiF$mergeProps)(focusableProps, pressProps, (0, $bwqiF$filterDOMProps)(props, {\n labelable: true\n }));\n return {\n isPressed: isPressed,\n buttonProps: (0, $bwqiF$mergeProps)(additionalProps, buttonProps, {\n 'aria-haspopup': props['aria-haspopup'],\n 'aria-expanded': props['aria-expanded'],\n 'aria-controls': props['aria-controls'],\n 'aria-pressed': props['aria-pressed'],\n 'aria-current': props['aria-current']\n })\n };\n}\n\n\nexport {$701a24aa0da5b062$export$ea18c227d4417cc3 as useButton};\n//# sourceMappingURL=useButton.module.js.map\n"],"names":["$701a24aa0da5b062$export$ea18c227d4417cc3","props","ref","elementType","isDisabled","onPress","onPressStart","onPressEnd","onPressUp","onPressChange","preventFocusOnPress","allowFocusWhenDisabled","onClick","href","target","rel","type","additionalProps","pressProps","isPressed","$bwqiF$usePress","focusableProps","$bwqiF$useFocusable","buttonProps","$bwqiF$mergeProps","$bwqiF$filterDOMProps"],"mappings":";;;AAeA,SAASA,EAA0CC,GAAOC,GAAK;AAC3D,MAAI,EAAE,aAAaC,IAAc,UAAU,YAAYC,GAAY,SAASC,GAAS,cAAcC,GAAc,YAA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,IACH,WAAWkB;AAAA,IACX,aAAiBK,EAAmBP,GAAiBM,GAAa;AAAA,MAC9D,iBAAiBtB,EAAM,eAAe;AAAA,MACtC,iBAAiBA,EAAM,eAAe;AAAA,MACtC,iBAAiBA,EAAM,eAAe;AAAA,MACtC,gBAAgBA,EAAM,cAAc;AAAA,MACpC,gBAAgBA,EAAM,cAAc;AAAA,IAChD,CAAS;AAAA,EACT;AACA;","x_google_ignoreList":[0]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("@react-aria/utils"),m=require("react");function D(r){let{ref:n,onInteractOutside:s,isDisabled:l,onInteractOutsideStart:E}=r,v=m.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}),o=d.useEffectEvent(e=>{s&&f(e,n)&&(E&&E(e),v.current.isPointerDown=!0)}),c=d.useEffectEvent(e=>{s&&s(e)});m.useEffect(()=>{let e=v.current;if(l)return;const w=n.current,t=d.getOwnerDocument(w);if(typeof PointerEvent<"u"){let i=u=>{e.isPointerDown&&f(u,n)&&c(u),e.isPointerDown=!1};return t.addEventListener("pointerdown",o,!0),t.addEventListener("click",i,!0),()=>{t.removeEventListener("pointerdown",o,!0),t.removeEventListener("click",i,!0)}}else if(process.env.NODE_ENV==="test"){let i=a=>{e.ignoreEmulatedMouseEvents?e.ignoreEmulatedMouseEvents=!1:e.isPointerDown&&f(a,n)&&c(a),e.isPointerDown=!1},u=a=>{e.ignoreEmulatedMouseEvents=!0,e.isPointerDown&&f(a,n)&&c(a),e.isPointerDown=!1};return t.addEventListener("mousedown",o,!0),t.addEventListener("mouseup",i,!0),t.addEventListener("touchstart",o,!0),t.addEventListener("touchend",u,!0),()=>{t.removeEventListener("mousedown",o,!0),t.removeEventListener("mouseup",i,!0),t.removeEventListener("touchstart",o,!0),t.removeEventListener("touchend",u,!0)}}},[n,l,o,c])}function f(r,n){if(r.button>0)return!1;if(r.target){const s=r.target.ownerDocument;if(!s||!s.documentElement.contains(r.target)||r.target.closest("[data-react-aria-top-layer]"))return!1}return n.current?!r.composedPath().includes(n.current):!1}exports.useInteractOutside=D;
|
|
2
|
-
//# sourceMappingURL=useInteractOutside.cjs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useInteractOutside.cjs.js","sources":["../../../../../node_modules/@react-aria/interactions/dist/useInteractOutside.mjs"],"sourcesContent":["import {useEffectEvent as $ispOf$useEffectEvent, getOwnerDocument as $ispOf$getOwnerDocument} from \"@react-aria/utils\";\nimport {useRef as $ispOf$useRef, useEffect as $ispOf$useEffect} from \"react\";\n\n/*\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 */ // Portions of the code in this file are based on code from react.\n// Original licensing for the following can be found in the\n// NOTICE file in the root directory of this source tree.\n// See https://github.com/facebook/react/tree/cc7c1aece46a6b69b41958d731e0fd27c94bfc6c/packages/react-interactions\n\n\nfunction $e0b6e0b68ec7f50f$export$872b660ac5a1ff98(props) {\n let { ref: ref, onInteractOutside: onInteractOutside, isDisabled: isDisabled, onInteractOutsideStart: onInteractOutsideStart } = props;\n let stateRef = (0, $ispOf$useRef)({\n isPointerDown: false,\n ignoreEmulatedMouseEvents: false\n });\n let onPointerDown = (0, $ispOf$useEffectEvent)((e)=>{\n if (onInteractOutside && $e0b6e0b68ec7f50f$var$isValidEvent(e, ref)) {\n if (onInteractOutsideStart) onInteractOutsideStart(e);\n stateRef.current.isPointerDown = true;\n }\n });\n let triggerInteractOutside = (0, $ispOf$useEffectEvent)((e)=>{\n if (onInteractOutside) onInteractOutside(e);\n });\n (0, $ispOf$useEffect)(()=>{\n let state = stateRef.current;\n if (isDisabled) return;\n const element = ref.current;\n const documentObject = (0, $ispOf$getOwnerDocument)(element);\n // Use pointer events if available. Otherwise, fall back to mouse and touch events.\n if (typeof PointerEvent !== 'undefined') {\n let onClick = (e)=>{\n if (state.isPointerDown && $e0b6e0b68ec7f50f$var$isValidEvent(e, ref)) triggerInteractOutside(e);\n state.isPointerDown = false;\n };\n // changing these to capture phase fixed combobox\n // Use click instead of pointerup to avoid Android Chrome issue\n // https://issues.chromium.org/issues/40732224\n documentObject.addEventListener('pointerdown', onPointerDown, true);\n documentObject.addEventListener('click', onClick, true);\n return ()=>{\n documentObject.removeEventListener('pointerdown', onPointerDown, true);\n documentObject.removeEventListener('click', onClick, true);\n };\n } else if (process.env.NODE_ENV === 'test') {\n let onMouseUp = (e)=>{\n if (state.ignoreEmulatedMouseEvents) state.ignoreEmulatedMouseEvents = false;\n else if (state.isPointerDown && $e0b6e0b68ec7f50f$var$isValidEvent(e, ref)) triggerInteractOutside(e);\n state.isPointerDown = false;\n };\n let onTouchEnd = (e)=>{\n state.ignoreEmulatedMouseEvents = true;\n if (state.isPointerDown && $e0b6e0b68ec7f50f$var$isValidEvent(e, ref)) triggerInteractOutside(e);\n state.isPointerDown = false;\n };\n documentObject.addEventListener('mousedown', onPointerDown, true);\n documentObject.addEventListener('mouseup', onMouseUp, true);\n documentObject.addEventListener('touchstart', onPointerDown, true);\n documentObject.addEventListener('touchend', onTouchEnd, true);\n return ()=>{\n documentObject.removeEventListener('mousedown', onPointerDown, true);\n documentObject.removeEventListener('mouseup', onMouseUp, true);\n documentObject.removeEventListener('touchstart', onPointerDown, true);\n documentObject.removeEventListener('touchend', onTouchEnd, true);\n };\n }\n }, [\n ref,\n isDisabled,\n onPointerDown,\n triggerInteractOutside\n ]);\n}\nfunction $e0b6e0b68ec7f50f$var$isValidEvent(event, ref) {\n if (event.button > 0) return false;\n if (event.target) {\n // if the event target is no longer in the document, ignore\n const ownerDocument = event.target.ownerDocument;\n if (!ownerDocument || !ownerDocument.documentElement.contains(event.target)) return false;\n // If the target is within a top layer element (e.g. toasts), ignore.\n if (event.target.closest('[data-react-aria-top-layer]')) return false;\n }\n if (!ref.current) return false;\n // When the event source is inside a Shadow DOM, event.target is just the shadow root.\n // Using event.composedPath instead means we can get the actual element inside the shadow root.\n // This only works if the shadow root is open, there is no way to detect if it is closed.\n // If the event composed path contains the ref, interaction is inside.\n return !event.composedPath().includes(ref.current);\n}\n\n\nexport {$e0b6e0b68ec7f50f$export$872b660ac5a1ff98 as useInteractOutside};\n//# sourceMappingURL=useInteractOutside.module.js.map\n"],"names":["$e0b6e0b68ec7f50f$export$872b660ac5a1ff98","props","ref","onInteractOutside","isDisabled","onInteractOutsideStart","stateRef","$ispOf$useRef","onPointerDown","$ispOf$useEffectEvent","$e0b6e0b68ec7f50f$var$isValidEvent","triggerInteractOutside","$ispOf$useEffect","state","element","documentObject","$ispOf$getOwnerDocument","onClick","e","onMouseUp","onTouchEnd","event","ownerDocument"],"mappings":"wIAmBA,SAASA,EAA0CC,EAAO,CACtD,GAAI,CAAE,IAAKC,EAAK,kBAAmBC,EAAmB,WAAYC,EAAY,uBAAwBC,CAAwB,EAAGJ,EAC7HK,EAAeC,SAAe,CAC9B,cAAe,GACf,0BAA2B,EACnC,CAAK,EACGC,EAAoBC,iBAAwB,GAAI,CAC5CN,GAAqBO,EAAmC,EAAGR,CAAG,IAC1DG,GAAwBA,EAAuB,CAAC,EACpDC,EAAS,QAAQ,cAAgB,GAE7C,CAAK,EACGK,EAA6BF,iBAAwB,GAAI,CACrDN,GAAmBA,EAAkB,CAAC,CAClD,CAAK,EACGS,EAAgB,UAAE,IAAI,CACtB,IAAIC,EAAQP,EAAS,QACrB,GAAIF,EAAY,OAChB,MAAMU,EAAUZ,EAAI,QACda,EAAqBC,mBAAyBF,CAAO,EAE3D,GAAI,OAAO,aAAiB,IAAa,CACrC,IAAIG,EAAWC,GAAI,CACXL,EAAM,eAA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6BAA6B,EAAG,MAAO,EACnE,CACD,OAAKnB,EAAI,QAKF,CAACmB,EAAM,aAAY,EAAG,SAASnB,EAAI,OAAO,EALxB,EAM7B","x_google_ignoreList":[0]}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { useEffectEvent as m, getOwnerDocument as w } from "@react-aria/utils";
|
|
2
|
-
import { useRef as D, useEffect as p } from "react";
|
|
3
|
-
function P(r) {
|
|
4
|
-
let { ref: n, onInteractOutside: s, isDisabled: d, onInteractOutsideStart: l } = r, E = D({
|
|
5
|
-
isPointerDown: !1,
|
|
6
|
-
ignoreEmulatedMouseEvents: !1
|
|
7
|
-
}), o = m((e) => {
|
|
8
|
-
s && c(e, n) && (l && l(e), E.current.isPointerDown = !0);
|
|
9
|
-
}), f = m((e) => {
|
|
10
|
-
s && s(e);
|
|
11
|
-
});
|
|
12
|
-
p(() => {
|
|
13
|
-
let e = E.current;
|
|
14
|
-
if (d) return;
|
|
15
|
-
const v = n.current, t = w(v);
|
|
16
|
-
if (typeof PointerEvent < "u") {
|
|
17
|
-
let i = (u) => {
|
|
18
|
-
e.isPointerDown && c(u, n) && f(u), e.isPointerDown = !1;
|
|
19
|
-
};
|
|
20
|
-
return t.addEventListener("pointerdown", o, !0), t.addEventListener("click", i, !0), () => {
|
|
21
|
-
t.removeEventListener("pointerdown", o, !0), t.removeEventListener("click", i, !0);
|
|
22
|
-
};
|
|
23
|
-
} else if (process.env.NODE_ENV === "test") {
|
|
24
|
-
let i = (a) => {
|
|
25
|
-
e.ignoreEmulatedMouseEvents ? e.ignoreEmulatedMouseEvents = !1 : e.isPointerDown && c(a, n) && f(a), e.isPointerDown = !1;
|
|
26
|
-
}, u = (a) => {
|
|
27
|
-
e.ignoreEmulatedMouseEvents = !0, e.isPointerDown && c(a, n) && f(a), e.isPointerDown = !1;
|
|
28
|
-
};
|
|
29
|
-
return t.addEventListener("mousedown", o, !0), t.addEventListener("mouseup", i, !0), t.addEventListener("touchstart", o, !0), t.addEventListener("touchend", u, !0), () => {
|
|
30
|
-
t.removeEventListener("mousedown", o, !0), t.removeEventListener("mouseup", i, !0), t.removeEventListener("touchstart", o, !0), t.removeEventListener("touchend", u, !0);
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
}, [
|
|
34
|
-
n,
|
|
35
|
-
d,
|
|
36
|
-
o,
|
|
37
|
-
f
|
|
38
|
-
]);
|
|
39
|
-
}
|
|
40
|
-
function c(r, n) {
|
|
41
|
-
if (r.button > 0) return !1;
|
|
42
|
-
if (r.target) {
|
|
43
|
-
const s = r.target.ownerDocument;
|
|
44
|
-
if (!s || !s.documentElement.contains(r.target) || r.target.closest("[data-react-aria-top-layer]")) return !1;
|
|
45
|
-
}
|
|
46
|
-
return n.current ? !r.composedPath().includes(n.current) : !1;
|
|
47
|
-
}
|
|
48
|
-
export {
|
|
49
|
-
P as useInteractOutside
|
|
50
|
-
};
|
|
51
|
-
//# sourceMappingURL=useInteractOutside.es.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useInteractOutside.es.js","sources":["../../../../../node_modules/@react-aria/interactions/dist/useInteractOutside.mjs"],"sourcesContent":["import {useEffectEvent as $ispOf$useEffectEvent, getOwnerDocument as $ispOf$getOwnerDocument} from \"@react-aria/utils\";\nimport {useRef as $ispOf$useRef, useEffect as $ispOf$useEffect} from \"react\";\n\n/*\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 */ // Portions of the code in this file are based on code from react.\n// Original licensing for the following can be found in the\n// NOTICE file in the root directory of this source tree.\n// See https://github.com/facebook/react/tree/cc7c1aece46a6b69b41958d731e0fd27c94bfc6c/packages/react-interactions\n\n\nfunction $e0b6e0b68ec7f50f$export$872b660ac5a1ff98(props) {\n let { ref: ref, onInteractOutside: onInteractOutside, isDisabled: isDisabled, onInteractOutsideStart: onInteractOutsideStart } = props;\n let stateRef = (0, $ispOf$useRef)({\n isPointerDown: false,\n ignoreEmulatedMouseEvents: false\n });\n let onPointerDown = (0, $ispOf$useEffectEvent)((e)=>{\n if (onInteractOutside && $e0b6e0b68ec7f50f$var$isValidEvent(e, ref)) {\n if (onInteractOutsideStart) onInteractOutsideStart(e);\n stateRef.current.isPointerDown = true;\n }\n });\n let triggerInteractOutside = (0, $ispOf$useEffectEvent)((e)=>{\n if (onInteractOutside) onInteractOutside(e);\n });\n (0, $ispOf$useEffect)(()=>{\n let state = stateRef.current;\n if (isDisabled) return;\n const element = ref.current;\n const documentObject = (0, $ispOf$getOwnerDocument)(element);\n // Use pointer events if available. Otherwise, fall back to mouse and touch events.\n if (typeof PointerEvent !== 'undefined') {\n let onClick = (e)=>{\n if (state.isPointerDown && $e0b6e0b68ec7f50f$var$isValidEvent(e, ref)) triggerInteractOutside(e);\n state.isPointerDown = false;\n };\n // changing these to capture phase fixed combobox\n // Use click instead of pointerup to avoid Android Chrome issue\n // https://issues.chromium.org/issues/40732224\n documentObject.addEventListener('pointerdown', onPointerDown, true);\n documentObject.addEventListener('click', onClick, true);\n return ()=>{\n documentObject.removeEventListener('pointerdown', onPointerDown, true);\n documentObject.removeEventListener('click', onClick, true);\n };\n } else if (process.env.NODE_ENV === 'test') {\n let onMouseUp = (e)=>{\n if (state.ignoreEmulatedMouseEvents) state.ignoreEmulatedMouseEvents = false;\n else if (state.isPointerDown && $e0b6e0b68ec7f50f$var$isValidEvent(e, ref)) triggerInteractOutside(e);\n state.isPointerDown = false;\n };\n let onTouchEnd = (e)=>{\n state.ignoreEmulatedMouseEvents = true;\n if (state.isPointerDown && $e0b6e0b68ec7f50f$var$isValidEvent(e, ref)) triggerInteractOutside(e);\n state.isPointerDown = false;\n };\n documentObject.addEventListener('mousedown', onPointerDown, true);\n documentObject.addEventListener('mouseup', onMouseUp, true);\n documentObject.addEventListener('touchstart', onPointerDown, true);\n documentObject.addEventListener('touchend', onTouchEnd, true);\n return ()=>{\n documentObject.removeEventListener('mousedown', onPointerDown, true);\n documentObject.removeEventListener('mouseup', onMouseUp, true);\n documentObject.removeEventListener('touchstart', onPointerDown, true);\n documentObject.removeEventListener('touchend', onTouchEnd, true);\n };\n }\n }, [\n ref,\n isDisabled,\n onPointerDown,\n triggerInteractOutside\n ]);\n}\nfunction $e0b6e0b68ec7f50f$var$isValidEvent(event, ref) {\n if (event.button > 0) return false;\n if (event.target) {\n // if the event target is no longer in the document, ignore\n const ownerDocument = event.target.ownerDocument;\n if (!ownerDocument || !ownerDocument.documentElement.contains(event.target)) return false;\n // If the target is within a top layer element (e.g. toasts), ignore.\n if (event.target.closest('[data-react-aria-top-layer]')) return false;\n }\n if (!ref.current) return false;\n // When the event source is inside a Shadow DOM, event.target is just the shadow root.\n // Using event.composedPath instead means we can get the actual element inside the shadow root.\n // This only works if the shadow root is open, there is no way to detect if it is closed.\n // If the event composed path contains the ref, interaction is inside.\n return !event.composedPath().includes(ref.current);\n}\n\n\nexport {$e0b6e0b68ec7f50f$export$872b660ac5a1ff98 as useInteractOutside};\n//# sourceMappingURL=useInteractOutside.module.js.map\n"],"names":["$e0b6e0b68ec7f50f$export$872b660ac5a1ff98","props","ref","onInteractOutside","isDisabled","onInteractOutsideStart","stateRef","$ispOf$useRef","onPointerDown","$ispOf$useEffectEvent","$e0b6e0b68ec7f50f$var$isValidEvent","triggerInteractOutside","$ispOf$useEffect","state","element","documentObject","$ispOf$getOwnerDocument","onClick","e","onMouseUp","onTouchEnd","event","ownerDocument"],"mappings":";;AAmBA,SAASA,EAA0CC,GAAO;AACtD,MAAI,EAAE,KAAKC,GAAK,mBAAmBC,GAAmB,YAAYC,GAAY,wBAAwBC,EAAwB,IAAGJ,GAC7HK,IAAeC,EA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e,iBAAiB,WAAWI,GAAW,EAAI,GAC1DJ,EAAe,iBAAiB,cAAcP,GAAe,EAAI,GACjEO,EAAe,iBAAiB,YAAYK,GAAY,EAAI,GACrD,MAAI;AACP,QAAAL,EAAe,oBAAoB,aAAaP,GAAe,EAAI,GACnEO,EAAe,oBAAoB,WAAWI,GAAW,EAAI,GAC7DJ,EAAe,oBAAoB,cAAcP,GAAe,EAAI,GACpEO,EAAe,oBAAoB,YAAYK,GAAY,EAAI;AAAA,MAC/E;AAAA,IACS;AAAA,EACT,GAAO;AAAA,IACClB;AAAA,IACAE;AAAA,IACAI;AAAA,IACAG;AAAA,EACR,CAAK;AACL;AACA,SAASD,EAAmCW,GAAOnB,GAAK;AACpD,MAAImB,EAAM,SAAS,EAAG,QAAO;AAC7B,MAAIA,EAAM,QAAQ;AAEd,UAAMC,IAAgBD,EAAM,OAAO;AAGnC,QAFI,CAACC,KAAiB,CAACA,EAAc,gBAAgB,SAASD,EAAM,MAAM,KAEtEA,EAAM,OAAO,QAAQ,6BAA6B,EAAG,QAAO;AAAA,EACnE;AACD,SAAKnB,EAAI,UAKF,CAACmB,EAAM,aAAY,EAAG,SAASnB,EAAI,OAAO,IALxB;AAM7B;","x_google_ignoreList":[0]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("@react-aria/utils"),$=typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype;let d=new WeakMap,i=[];function F(s,u){let f=w.getOwnerWindow(s==null?void 0:s[0]),l=u instanceof f.Element?{root:u}:u;var v;let p=(v=l==null?void 0:l.root)!==null&&v!==void 0?v:document.body,b=(l==null?void 0:l.shouldUseInert)&&$,o=new Set(s),a=new Set,g=e=>b&&e instanceof f.HTMLElement?e.inert:e.getAttribute("aria-hidden")==="true",h=(e,t)=>{b&&e instanceof f.HTMLElement?e.inert=t:t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")},T=e=>{for(let n of e.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))o.add(n);let t=n=>{if(a.has(n)||o.has(n)||n.parentElement&&a.has(n.parentElement)&&n.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(let m of o)if(n.contains(m))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:t}),L=t(e);if(L===NodeFilter.FILTER_ACCEPT&&N(e),L!==NodeFilter.FILTER_REJECT){let n=r.nextNode();for(;n!=null;)N(n),n=r.nextNode()}},N=e=>{var t;let r=(t=d.get(e))!==null&&t!==void 0?t:0;g(e)&&r===0||(r===0&&h(e,!0),a.add(e),d.set(e,r+1))};i.length&&i[i.length-1].disconnect(),T(p);let c=new MutationObserver(e=>{for(let t of e)if(t.type==="childList"&&![...o,...a].some(r=>r.contains(t.target)))for(let r of t.addedNodes)(r instanceof HTMLElement||r instanceof SVGElement)&&(r.dataset.liveAnnouncer==="true"||r.dataset.reactAriaTopLayer==="true")?o.add(r):r instanceof Element&&T(r)});c.observe(p,{childList:!0,subtree:!0});let E={visibleNodes:o,hiddenNodes:a,observe(){c.observe(p,{childList:!0,subtree:!0})},disconnect(){c.disconnect()}};return i.push(E),()=>{c.disconnect();for(let e of a){let t=d.get(e);t!=null&&(t===1?(h(e,!1),d.delete(e)):d.set(e,t-1))}E===i[i.length-1]?(i.pop(),i.length&&i[i.length-1].observe()):i.splice(i.indexOf(E),1)}}exports.ariaHideOutside=F;
|
|
2
|
-
//# sourceMappingURL=ariaHideOutside.cjs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ariaHideOutside.cjs.js","sources":["../../../../../node_modules/@react-aria/overlays/dist/ariaHideOutside.mjs"],"sourcesContent":["import {getOwnerWindow as $fF94N$getOwnerWindow} from \"@react-aria/utils\";\n\n/*\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 */ \nconst $5e3802645cc19319$var$supportsInert = typeof HTMLElement !== 'undefined' && 'inert' in HTMLElement.prototype;\n// Keeps a ref count of all hidden elements. Added to when hiding an element, and\n// subtracted from when showing it again. When it reaches zero, aria-hidden is removed.\nlet $5e3802645cc19319$var$refCountMap = new WeakMap();\nlet $5e3802645cc19319$var$observerStack = [];\nfunction $5e3802645cc19319$export$1c3ebcada18427bf(targets, options) {\n let windowObj = (0, $fF94N$getOwnerWindow)(targets === null || targets === void 0 ? void 0 : targets[0]);\n let opts = options instanceof windowObj.Element ? {\n root: options\n } : options;\n var _opts_root;\n let root = (_opts_root = opts === null || opts === void 0 ? void 0 : opts.root) !== null && _opts_root !== void 0 ? _opts_root : document.body;\n let shouldUseInert = (opts === null || opts === void 0 ? void 0 : opts.shouldUseInert) && $5e3802645cc19319$var$supportsInert;\n let visibleNodes = new Set(targets);\n let hiddenNodes = new Set();\n let getHidden = (element)=>{\n return shouldUseInert && element instanceof windowObj.HTMLElement ? element.inert : element.getAttribute('aria-hidden') === 'true';\n };\n let setHidden = (element, hidden)=>{\n if (shouldUseInert && element instanceof windowObj.HTMLElement) element.inert = hidden;\n else if (hidden) element.setAttribute('aria-hidden', 'true');\n else element.removeAttribute('aria-hidden');\n };\n let walk = (root)=>{\n // Keep live announcer and top layer elements (e.g. toasts) visible.\n for (let element of root.querySelectorAll('[data-live-announcer], [data-react-aria-top-layer]'))visibleNodes.add(element);\n let acceptNode = (node)=>{\n // Skip this node and its children if it is one of the target nodes, or a live announcer.\n // Also skip children of already hidden nodes, as aria-hidden is recursive. An exception is\n // made for elements with role=\"row\" since VoiceOver on iOS has issues hiding elements with role=\"row\".\n // For that case we want to hide the cells inside as well (https://bugs.webkit.org/show_bug.cgi?id=222623).\n if (hiddenNodes.has(node) || visibleNodes.has(node) || node.parentElement && hiddenNodes.has(node.parentElement) && node.parentElement.getAttribute('role') !== 'row') return NodeFilter.FILTER_REJECT;\n // Skip this node but continue to children if one of the targets is inside the node.\n for (let target of visibleNodes){\n if (node.contains(target)) return NodeFilter.FILTER_SKIP;\n }\n return NodeFilter.FILTER_ACCEPT;\n };\n let walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT, {\n acceptNode: acceptNode\n });\n // TreeWalker does not include the root.\n let acceptRoot = acceptNode(root);\n if (acceptRoot === NodeFilter.FILTER_ACCEPT) hide(root);\n if (acceptRoot !== NodeFilter.FILTER_REJECT) {\n let node = walker.nextNode();\n while(node != null){\n hide(node);\n node = walker.nextNode();\n }\n }\n };\n let hide = (node)=>{\n var _refCountMap_get;\n let refCount = (_refCountMap_get = $5e3802645cc19319$var$refCountMap.get(node)) !== null && _refCountMap_get !== void 0 ? _refCountMap_get : 0;\n // If already aria-hidden, and the ref count is zero, then this element\n // was already hidden and there's nothing for us to do.\n if (getHidden(node) && refCount === 0) return;\n if (refCount === 0) setHidden(node, true);\n hiddenNodes.add(node);\n $5e3802645cc19319$var$refCountMap.set(node, refCount + 1);\n };\n // If there is already a MutationObserver listening from a previous call,\n // disconnect it so the new on takes over.\n if ($5e3802645cc19319$var$observerStack.length) $5e3802645cc19319$var$observerStack[$5e3802645cc19319$var$observerStack.length - 1].disconnect();\n walk(root);\n let observer = new MutationObserver((changes)=>{\n for (let change of changes){\n if (change.type !== 'childList') continue;\n // If the parent element of the added nodes is not within one of the targets,\n // and not already inside a hidden node, hide all of the new children.\n if (![\n ...visibleNodes,\n ...hiddenNodes\n ].some((node)=>node.contains(change.target))) for (let node of change.addedNodes){\n if ((node instanceof HTMLElement || node instanceof SVGElement) && (node.dataset.liveAnnouncer === 'true' || node.dataset.reactAriaTopLayer === 'true')) visibleNodes.add(node);\n else if (node instanceof Element) walk(node);\n }\n }\n });\n observer.observe(root, {\n childList: true,\n subtree: true\n });\n let observerWrapper = {\n visibleNodes: visibleNodes,\n hiddenNodes: hiddenNodes,\n observe () {\n observer.observe(root, {\n childList: true,\n subtree: true\n });\n },\n disconnect () {\n observer.disconnect();\n }\n };\n $5e3802645cc19319$var$observerStack.push(observerWrapper);\n return ()=>{\n observer.disconnect();\n for (let node of hiddenNodes){\n let count = $5e3802645cc19319$var$refCountMap.get(node);\n if (count == null) continue;\n if (count === 1) {\n setHidden(node, false);\n $5e3802645cc19319$var$refCountMap.delete(node);\n } else $5e3802645cc19319$var$refCountMap.set(node, count - 1);\n }\n // Remove this observer from the stack, and start the previous one.\n if (observerWrapper === $5e3802645cc19319$var$observerStack[$5e3802645cc19319$var$observerStack.length - 1]) {\n $5e3802645cc19319$var$observerStack.pop();\n if ($5e3802645cc19319$var$observerStack.length) $5e3802645cc19319$var$observerStack[$5e3802645cc19319$var$observerStack.length - 1].observe();\n } else $5e3802645cc19319$var$observerStack.splice($5e3802645cc19319$var$observerStack.indexOf(observerWrapper), 1);\n };\n}\nfunction $5e3802645cc19319$export$1020fa7f77e17884(element) {\n let observer = $5e3802645cc19319$var$observerStack[$5e3802645cc19319$var$observerStack.length - 1];\n if (observer && !observer.visibleNodes.has(element)) {\n observer.visibleNodes.add(element);\n return ()=>{\n observer.visibleNodes.delete(element);\n };\n }\n}\n\n\nexport {$5e3802645cc19319$export$1c3ebcada18427bf as ariaHideOutside, $5e3802645cc19319$export$1020fa7f77e17884 as keepVisible};\n//# sourceMappingURL=ariaHideOutside.module.js.map\n"],"names":["$5e3802645cc19319$var$supportsInert","$5e3802645cc19319$var$refCountMap","$5e3802645cc19319$var$observerStack","$5e3802645cc19319$export$1c3ebcada18427bf","targets","options","windowObj","$fF94N$getOwnerWindow","opts","_opts_root","root","shouldUseInert","visibleNodes","hiddenNodes","getHidden","element","setHidden","hidden","walk","acceptNode","node","target","walker","acceptRoot","hide","_ref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B,CAAI,EAClDW,GAAS,OACTA,IAAU,GACVf,EAAUI,EAAM,EAAK,EACrBnB,EAAkC,OAAOmB,CAAI,GAC1CnB,EAAkC,IAAImB,EAAMW,EAAQ,CAAC,EAC/D,CAEGD,IAAoB5B,EAAoCA,EAAoC,OAAS,CAAC,GACtGA,EAAoC,IAAG,EACnCA,EAAoC,QAAQA,EAAoCA,EAAoC,OAAS,CAAC,EAAE,WACjIA,EAAoC,OAAOA,EAAoC,QAAQ4B,CAAe,EAAG,CAAC,CACzH,CACA","x_google_ignoreList":[0]}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { getOwnerWindow as w } from "@react-aria/utils";
|
|
2
|
-
const $ = typeof HTMLElement < "u" && "inert" in HTMLElement.prototype;
|
|
3
|
-
let d = /* @__PURE__ */ new WeakMap(), i = [];
|
|
4
|
-
function M(s, u) {
|
|
5
|
-
let f = w(s == null ? void 0 : s[0]), l = u instanceof f.Element ? {
|
|
6
|
-
root: u
|
|
7
|
-
} : u;
|
|
8
|
-
var p;
|
|
9
|
-
let v = (p = l == null ? void 0 : l.root) !== null && p !== void 0 ? p : document.body, h = (l == null ? void 0 : l.shouldUseInert) && $, o = new Set(s), a = /* @__PURE__ */ new Set(), m = (e) => h && e instanceof f.HTMLElement ? e.inert : e.getAttribute("aria-hidden") === "true", b = (e, t) => {
|
|
10
|
-
h && e instanceof f.HTMLElement ? e.inert = t : t ? e.setAttribute("aria-hidden", "true") : e.removeAttribute("aria-hidden");
|
|
11
|
-
}, T = (e) => {
|
|
12
|
-
for (let n of e.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]")) o.add(n);
|
|
13
|
-
let t = (n) => {
|
|
14
|
-
if (a.has(n) || o.has(n) || n.parentElement && a.has(n.parentElement) && n.parentElement.getAttribute("role") !== "row") return NodeFilter.FILTER_REJECT;
|
|
15
|
-
for (let g of o)
|
|
16
|
-
if (n.contains(g)) return NodeFilter.FILTER_SKIP;
|
|
17
|
-
return NodeFilter.FILTER_ACCEPT;
|
|
18
|
-
}, r = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
19
|
-
acceptNode: t
|
|
20
|
-
}), L = t(e);
|
|
21
|
-
if (L === NodeFilter.FILTER_ACCEPT && N(e), L !== NodeFilter.FILTER_REJECT) {
|
|
22
|
-
let n = r.nextNode();
|
|
23
|
-
for (; n != null; )
|
|
24
|
-
N(n), n = r.nextNode();
|
|
25
|
-
}
|
|
26
|
-
}, N = (e) => {
|
|
27
|
-
var t;
|
|
28
|
-
let r = (t = d.get(e)) !== null && t !== void 0 ? t : 0;
|
|
29
|
-
m(e) && r === 0 || (r === 0 && b(e, !0), a.add(e), d.set(e, r + 1));
|
|
30
|
-
};
|
|
31
|
-
i.length && i[i.length - 1].disconnect(), T(v);
|
|
32
|
-
let c = new MutationObserver((e) => {
|
|
33
|
-
for (let t of e)
|
|
34
|
-
if (t.type === "childList" && ![
|
|
35
|
-
...o,
|
|
36
|
-
...a
|
|
37
|
-
].some((r) => r.contains(t.target)))
|
|
38
|
-
for (let r of t.addedNodes)
|
|
39
|
-
(r instanceof HTMLElement || r instanceof SVGElement) && (r.dataset.liveAnnouncer === "true" || r.dataset.reactAriaTopLayer === "true") ? o.add(r) : r instanceof Element && T(r);
|
|
40
|
-
});
|
|
41
|
-
c.observe(v, {
|
|
42
|
-
childList: !0,
|
|
43
|
-
subtree: !0
|
|
44
|
-
});
|
|
45
|
-
let E = {
|
|
46
|
-
visibleNodes: o,
|
|
47
|
-
hiddenNodes: a,
|
|
48
|
-
observe() {
|
|
49
|
-
c.observe(v, {
|
|
50
|
-
childList: !0,
|
|
51
|
-
subtree: !0
|
|
52
|
-
});
|
|
53
|
-
},
|
|
54
|
-
disconnect() {
|
|
55
|
-
c.disconnect();
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
return i.push(E), () => {
|
|
59
|
-
c.disconnect();
|
|
60
|
-
for (let e of a) {
|
|
61
|
-
let t = d.get(e);
|
|
62
|
-
t != null && (t === 1 ? (b(e, !1), d.delete(e)) : d.set(e, t - 1));
|
|
63
|
-
}
|
|
64
|
-
E === i[i.length - 1] ? (i.pop(), i.length && i[i.length - 1].observe()) : i.splice(i.indexOf(E), 1);
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
export {
|
|
68
|
-
M as ariaHideOutside
|
|
69
|
-
};
|
|
70
|
-
//# sourceMappingURL=ariaHideOutside.es.js.map
|