@react-aria/overlays 3.21.1 → 3.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DismissButton.main.js +51 -0
- package/dist/DismissButton.main.js.map +1 -0
- package/dist/DismissButton.mjs +46 -0
- package/dist/DismissButton.module.js +46 -0
- package/dist/DismissButton.module.js.map +1 -0
- package/dist/Overlay.main.js +73 -0
- package/dist/Overlay.main.js.map +1 -0
- package/dist/Overlay.mjs +63 -0
- package/dist/Overlay.module.js +63 -0
- package/dist/Overlay.module.js.map +1 -0
- package/dist/PortalProvider.main.js +41 -0
- package/dist/PortalProvider.main.js.map +1 -0
- package/dist/PortalProvider.mjs +31 -0
- package/dist/PortalProvider.module.js +31 -0
- package/dist/PortalProvider.module.js.map +1 -0
- package/dist/ar-AE.mjs +1 -1
- package/dist/ariaHideOutside.main.js +121 -0
- package/dist/ariaHideOutside.main.js.map +1 -0
- package/dist/ariaHideOutside.mjs +116 -0
- package/dist/ariaHideOutside.module.js +116 -0
- package/dist/ariaHideOutside.module.js.map +1 -0
- package/dist/bg-BG.mjs +1 -1
- package/dist/calculatePosition.main.js +355 -0
- package/dist/calculatePosition.main.js.map +1 -0
- package/dist/calculatePosition.mjs +350 -0
- package/dist/calculatePosition.module.js +350 -0
- package/dist/calculatePosition.module.js.map +1 -0
- package/dist/cs-CZ.mjs +1 -1
- package/dist/da-DK.mjs +1 -1
- package/dist/de-DE.mjs +1 -1
- package/dist/el-GR.mjs +1 -1
- package/dist/en-US.mjs +1 -1
- package/dist/es-ES.mjs +1 -1
- package/dist/et-EE.mjs +1 -1
- package/dist/fi-FI.mjs +1 -1
- package/dist/fr-FR.mjs +1 -1
- package/dist/he-IL.mjs +1 -1
- package/dist/hr-HR.mjs +1 -1
- package/dist/hu-HU.mjs +1 -1
- package/dist/import.mjs +12 -1397
- package/dist/intlStrings.main.js +108 -0
- package/dist/intlStrings.main.js.map +1 -0
- package/dist/intlStrings.mjs +110 -0
- package/dist/intlStrings.module.js +110 -0
- package/dist/intlStrings.module.js.map +1 -0
- package/dist/it-IT.mjs +1 -1
- package/dist/ja-JP.mjs +1 -1
- package/dist/ko-KR.mjs +1 -1
- package/dist/lt-LT.mjs +1 -1
- package/dist/lv-LV.mjs +1 -1
- package/dist/main.js +28 -1411
- package/dist/main.js.map +1 -1
- package/dist/module.js +12 -1397
- package/dist/module.js.map +1 -1
- package/dist/nb-NO.mjs +1 -1
- package/dist/nl-NL.mjs +1 -1
- package/dist/pl-PL.mjs +1 -1
- package/dist/pt-BR.mjs +1 -1
- package/dist/pt-PT.mjs +1 -1
- package/dist/ro-RO.mjs +1 -1
- package/dist/ru-RU.mjs +1 -1
- package/dist/sk-SK.mjs +1 -1
- package/dist/sl-SI.mjs +1 -1
- package/dist/sr-SP.mjs +1 -1
- package/dist/sv-SE.mjs +1 -1
- package/dist/tr-TR.mjs +1 -1
- package/dist/types.d.ts +8 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/uk-UA.mjs +1 -1
- package/dist/useCloseOnScroll.main.js +46 -0
- package/dist/useCloseOnScroll.main.js.map +1 -0
- package/dist/useCloseOnScroll.mjs +40 -0
- package/dist/useCloseOnScroll.module.js +40 -0
- package/dist/useCloseOnScroll.module.js.map +1 -0
- package/dist/useModal.main.js +114 -0
- package/dist/useModal.main.js.map +1 -0
- package/dist/useModal.mjs +101 -0
- package/dist/useModal.module.js +101 -0
- package/dist/useModal.module.js.map +1 -0
- package/dist/useModalOverlay.main.js +55 -0
- package/dist/useModalOverlay.main.js.map +1 -0
- package/dist/useModalOverlay.mjs +50 -0
- package/dist/useModalOverlay.module.js +50 -0
- package/dist/useModalOverlay.module.js.map +1 -0
- package/dist/useOverlay.main.js +105 -0
- package/dist/useOverlay.main.js.map +1 -0
- package/dist/useOverlay.mjs +100 -0
- package/dist/useOverlay.module.js +100 -0
- package/dist/useOverlay.module.js.map +1 -0
- package/dist/useOverlayPosition.main.js +181 -0
- package/dist/useOverlayPosition.main.js.map +1 -0
- package/dist/useOverlayPosition.mjs +176 -0
- package/dist/useOverlayPosition.module.js +176 -0
- package/dist/useOverlayPosition.module.js.map +1 -0
- package/dist/useOverlayTrigger.main.js +54 -0
- package/dist/useOverlayTrigger.main.js.map +1 -0
- package/dist/useOverlayTrigger.mjs +49 -0
- package/dist/useOverlayTrigger.module.js +49 -0
- package/dist/useOverlayTrigger.module.js.map +1 -0
- package/dist/usePopover.main.js +66 -0
- package/dist/usePopover.main.js.map +1 -0
- package/dist/usePopover.mjs +61 -0
- package/dist/usePopover.module.js +61 -0
- package/dist/usePopover.module.js.map +1 -0
- package/dist/usePreventScroll.main.js +226 -0
- package/dist/usePreventScroll.main.js.map +1 -0
- package/dist/usePreventScroll.mjs +221 -0
- package/dist/usePreventScroll.module.js +221 -0
- package/dist/usePreventScroll.module.js.map +1 -0
- package/dist/zh-CN.mjs +1 -1
- package/dist/zh-TW.mjs +1 -1
- package/package.json +12 -12
- package/src/Overlay.tsx +6 -0
- package/src/PortalProvider.tsx +34 -0
- package/src/index.ts +1 -0
- package/src/useModalOverlay.ts +2 -2
- package/src/useOverlay.ts +1 -1
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
var $btuAB$react = require("react");
|
|
2
|
+
var $btuAB$reactdom = require("react-dom");
|
|
3
|
+
var $btuAB$reactariassr = require("@react-aria/ssr");
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
function $parcel$interopDefault(a) {
|
|
7
|
+
return a && a.__esModule ? a.default : a;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function $parcel$export(e, n, v, s) {
|
|
11
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
$parcel$export(module.exports, "ModalProvider", () => $0775ea8ea6a0565e$export$178405afcd8c5eb);
|
|
15
|
+
$parcel$export(module.exports, "useModalProvider", () => $0775ea8ea6a0565e$export$d9aaed4c3ece1bc0);
|
|
16
|
+
$parcel$export(module.exports, "OverlayProvider", () => $0775ea8ea6a0565e$export$bf688221f59024e5);
|
|
17
|
+
$parcel$export(module.exports, "OverlayContainer", () => $0775ea8ea6a0565e$export$b47c3594eab58386);
|
|
18
|
+
$parcel$export(module.exports, "useModal", () => $0775ea8ea6a0565e$export$33ffd74ebf07f060);
|
|
19
|
+
/*
|
|
20
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
21
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
22
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
23
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
24
|
+
*
|
|
25
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
26
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
27
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
28
|
+
* governing permissions and limitations under the License.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
const $0775ea8ea6a0565e$var$Context = /*#__PURE__*/ (0, ($parcel$interopDefault($btuAB$react))).createContext(null);
|
|
33
|
+
function $0775ea8ea6a0565e$export$178405afcd8c5eb(props) {
|
|
34
|
+
let { children: children } = props;
|
|
35
|
+
let parent = (0, $btuAB$react.useContext)($0775ea8ea6a0565e$var$Context);
|
|
36
|
+
let [modalCount, setModalCount] = (0, $btuAB$react.useState)(0);
|
|
37
|
+
let context = (0, $btuAB$react.useMemo)(()=>({
|
|
38
|
+
parent: parent,
|
|
39
|
+
modalCount: modalCount,
|
|
40
|
+
addModal () {
|
|
41
|
+
setModalCount((count)=>count + 1);
|
|
42
|
+
if (parent) parent.addModal();
|
|
43
|
+
},
|
|
44
|
+
removeModal () {
|
|
45
|
+
setModalCount((count)=>count - 1);
|
|
46
|
+
if (parent) parent.removeModal();
|
|
47
|
+
}
|
|
48
|
+
}), [
|
|
49
|
+
parent,
|
|
50
|
+
modalCount
|
|
51
|
+
]);
|
|
52
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($btuAB$react))).createElement($0775ea8ea6a0565e$var$Context.Provider, {
|
|
53
|
+
value: context
|
|
54
|
+
}, children);
|
|
55
|
+
}
|
|
56
|
+
function $0775ea8ea6a0565e$export$d9aaed4c3ece1bc0() {
|
|
57
|
+
let context = (0, $btuAB$react.useContext)($0775ea8ea6a0565e$var$Context);
|
|
58
|
+
return {
|
|
59
|
+
modalProviderProps: {
|
|
60
|
+
"aria-hidden": context && context.modalCount > 0 ? true : null
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Creates a root node that will be aria-hidden if there are other modals open.
|
|
66
|
+
*/ function $0775ea8ea6a0565e$var$OverlayContainerDOM(props) {
|
|
67
|
+
let { modalProviderProps: modalProviderProps } = $0775ea8ea6a0565e$export$d9aaed4c3ece1bc0();
|
|
68
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($btuAB$react))).createElement("div", {
|
|
69
|
+
"data-overlay-container": true,
|
|
70
|
+
...props,
|
|
71
|
+
...modalProviderProps
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
function $0775ea8ea6a0565e$export$bf688221f59024e5(props) {
|
|
75
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($btuAB$react))).createElement($0775ea8ea6a0565e$export$178405afcd8c5eb, null, /*#__PURE__*/ (0, ($parcel$interopDefault($btuAB$react))).createElement($0775ea8ea6a0565e$var$OverlayContainerDOM, props));
|
|
76
|
+
}
|
|
77
|
+
function $0775ea8ea6a0565e$export$b47c3594eab58386(props) {
|
|
78
|
+
let isSSR = (0, $btuAB$reactariassr.useIsSSR)();
|
|
79
|
+
let { portalContainer: portalContainer = isSSR ? null : document.body, ...rest } = props;
|
|
80
|
+
(0, ($parcel$interopDefault($btuAB$react))).useEffect(()=>{
|
|
81
|
+
if (portalContainer === null || portalContainer === void 0 ? void 0 : portalContainer.closest("[data-overlay-container]")) throw new Error("An OverlayContainer must not be inside another container. Please change the portalContainer prop.");
|
|
82
|
+
}, [
|
|
83
|
+
portalContainer
|
|
84
|
+
]);
|
|
85
|
+
if (!portalContainer) return null;
|
|
86
|
+
let contents = /*#__PURE__*/ (0, ($parcel$interopDefault($btuAB$react))).createElement($0775ea8ea6a0565e$export$bf688221f59024e5, rest);
|
|
87
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($btuAB$reactdom))).createPortal(contents, portalContainer);
|
|
88
|
+
}
|
|
89
|
+
function $0775ea8ea6a0565e$export$33ffd74ebf07f060(options) {
|
|
90
|
+
// Add aria-hidden to all parent providers on mount, and restore on unmount.
|
|
91
|
+
let context = (0, $btuAB$react.useContext)($0775ea8ea6a0565e$var$Context);
|
|
92
|
+
if (!context) throw new Error("Modal is not contained within a provider");
|
|
93
|
+
(0, $btuAB$react.useEffect)(()=>{
|
|
94
|
+
if ((options === null || options === void 0 ? void 0 : options.isDisabled) || !context || !context.parent) return;
|
|
95
|
+
// The immediate context is from the provider containing this modal, so we only
|
|
96
|
+
// want to trigger aria-hidden on its parents not on the modal provider itself.
|
|
97
|
+
context.parent.addModal();
|
|
98
|
+
return ()=>{
|
|
99
|
+
if (context && context.parent) context.parent.removeModal();
|
|
100
|
+
};
|
|
101
|
+
}, [
|
|
102
|
+
context,
|
|
103
|
+
context.parent,
|
|
104
|
+
options === null || options === void 0 ? void 0 : options.isDisabled
|
|
105
|
+
]);
|
|
106
|
+
return {
|
|
107
|
+
modalProps: {
|
|
108
|
+
"data-ismodal": !(options === null || options === void 0 ? void 0 : options.isDisabled)
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
//# sourceMappingURL=useModal.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAkBD,MAAM,8CAAU,CAAA,GAAA,sCAAI,EAAE,aAAa,CAAsB;AAUlD,SAAS,yCAAc,KAAyB;IACrD,IAAI,YAAC,QAAQ,EAAC,GAAG;IACjB,IAAI,SAAS,CAAA,GAAA,uBAAS,EAAE;IACxB,IAAI,CAAC,YAAY,cAAc,GAAG,CAAA,GAAA,qBAAO,EAAE;IAC3C,IAAI,UAAU,CAAA,GAAA,oBAAM,EAAE,IAAO,CAAA;oBAC3B;wBACA;YACA;gBACE,cAAc,CAAA,QAAS,QAAQ;gBAC/B,IAAI,QACF,OAAO,QAAQ;YAEnB;YACA;gBACE,cAAc,CAAA,QAAS,QAAQ;gBAC/B,IAAI,QACF,OAAO,WAAW;YAEtB;QACF,CAAA,GAAI;QAAC;QAAQ;KAAW;IAExB,qBACE,0DAAC,8BAAQ,QAAQ;QAAC,OAAO;OACtB;AAGP;AAaO,SAAS;IACd,IAAI,UAAU,CAAA,GAAA,uBAAS,EAAE;IACzB,OAAO;QACL,oBAAoB;YAClB,eAAe,WAAW,QAAQ,UAAU,GAAG,IAAI,OAAO;QAC5D;IACF;AACF;AAEA;;CAEC,GACD,SAAS,0CAAoB,KAAyB;IACpD,IAAI,sBAAC,kBAAkB,EAAC,GAAG;IAC3B,qBAAO,0DAAC;QAAI,0BAAA;QAAwB,GAAG,KAAK;QAAG,GAAG,kBAAkB;;AACtE;AAUO,SAAS,0CAAgB,KAAyB;IACvD,qBACE,0DAAC,8DACC,0DAAC,2CAAwB;AAG/B;AAiBO,SAAS,0CAAiB,KAA4B;IAC3D,IAAI,QAAQ,CAAA,GAAA,4BAAO;IACnB,IAAI,mBAAC,kBAAkB,QAAQ,OAAO,SAAS,IAAI,EAAE,GAAG,MAAK,GAAG;IAEhE,CAAA,GAAA,sCAAI,EAAE,SAAS,CAAC;QACd,IAAI,4BAAA,sCAAA,gBAAiB,OAAO,CAAC,6BAC3B,MAAM,IAAI,MAAM;IAEpB,GAAG;QAAC;KAAgB;IAEpB,IAAI,CAAC,iBACH,OAAO;IAGT,IAAI,yBAAW,0DAAC,2CAAoB;IACpC,qBAAO,CAAA,GAAA,yCAAO,EAAE,YAAY,CAAC,UAAU;AACzC;AAsBO,SAAS,0CAAS,OAA0B;IACjD,4EAA4E;IAC5E,IAAI,UAAU,CAAA,GAAA,uBAAS,EAAE;IACzB,IAAI,CAAC,SACH,MAAM,IAAI,MAAM;IAGlB,CAAA,GAAA,sBAAQ,EAAE;QACR,IAAI,CAAA,oBAAA,8BAAA,QAAS,UAAU,KAAI,CAAC,WAAW,CAAC,QAAQ,MAAM,EACpD;QAGF,+EAA+E;QAC/E,+EAA+E;QAC/E,QAAQ,MAAM,CAAC,QAAQ;QACvB,OAAO;YACL,IAAI,WAAW,QAAQ,MAAM,EAC3B,QAAQ,MAAM,CAAC,WAAW;QAE9B;IACF,GAAG;QAAC;QAAS,QAAQ,MAAM;QAAE,oBAAA,8BAAA,QAAS,UAAU;KAAC;IAEjD,OAAO;QACL,YAAY;YACV,gBAAgB,EAAC,oBAAA,8BAAA,QAAS,UAAU;QACtC;IACF;AACF","sources":["packages/@react-aria/overlays/src/useModal.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMAttributes} from '@react-types/shared';\nimport React, {AriaAttributes, ReactNode, useContext, useEffect, useMemo, useState} from 'react';\nimport ReactDOM from 'react-dom';\nimport {useIsSSR} from '@react-aria/ssr';\n\nexport interface ModalProviderProps extends DOMAttributes {\n children: ReactNode\n}\n\ninterface ModalContext {\n parent: ModalContext | null,\n modalCount: number,\n addModal: () => void,\n removeModal: () => void\n}\n\nconst Context = React.createContext<ModalContext | null>(null);\n\n/**\n * Each ModalProvider tracks how many modals are open in its subtree. On mount, the modals\n * trigger `addModal` to increment the count, and trigger `removeModal` on unmount to decrement it.\n * This is done recursively so that all parent providers are incremented and decremented.\n * If the modal count is greater than zero, we add `aria-hidden` to this provider to hide its\n * subtree from screen readers. This is done using React context in order to account for things\n * like portals, which can cause the React tree and the DOM tree to differ significantly in structure.\n */\nexport function ModalProvider(props: ModalProviderProps) {\n let {children} = props;\n let parent = useContext(Context);\n let [modalCount, setModalCount] = useState(0);\n let context = useMemo(() => ({\n parent,\n modalCount,\n addModal() {\n setModalCount(count => count + 1);\n if (parent) {\n parent.addModal();\n }\n },\n removeModal() {\n setModalCount(count => count - 1);\n if (parent) {\n parent.removeModal();\n }\n }\n }), [parent, modalCount]);\n\n return (\n <Context.Provider value={context}>\n {children}\n </Context.Provider>\n );\n}\n\nexport interface ModalProviderAria {\n /**\n * Props to be spread on the container element.\n */\n modalProviderProps: AriaAttributes\n}\n\n/**\n * Used to determine if the tree should be aria-hidden based on how many\n * modals are open.\n */\nexport function useModalProvider(): ModalProviderAria {\n let context = useContext(Context);\n return {\n modalProviderProps: {\n 'aria-hidden': context && context.modalCount > 0 ? true : null\n }\n };\n}\n\n/**\n * Creates a root node that will be aria-hidden if there are other modals open.\n */\nfunction OverlayContainerDOM(props: ModalProviderProps) {\n let {modalProviderProps} = useModalProvider();\n return <div data-overlay-container {...props} {...modalProviderProps} />;\n}\n\n/**\n * An OverlayProvider acts as a container for the top-level application.\n * Any application that uses modal dialogs or other overlays should\n * be wrapped in a `<OverlayProvider>`. This is used to ensure that\n * the main content of the application is hidden from screen readers\n * if a modal or other overlay is opened. Only the top-most modal or\n * overlay should be accessible at once.\n */\nexport function OverlayProvider(props: ModalProviderProps) {\n return (\n <ModalProvider>\n <OverlayContainerDOM {...props} />\n </ModalProvider>\n );\n}\n\nexport interface OverlayContainerProps extends ModalProviderProps {\n /**\n * The container element in which the overlay portal will be placed.\n * @default document.body\n */\n portalContainer?: Element\n}\n\n/**\n * A container for overlays like modals and popovers. Renders the overlay\n * into a Portal which is placed at the end of the document body.\n * Also ensures that the overlay is hidden from screen readers if a\n * nested modal is opened. Only the top-most modal or overlay should\n * be accessible at once.\n */\nexport function OverlayContainer(props: OverlayContainerProps): React.ReactPortal {\n let isSSR = useIsSSR();\n let {portalContainer = isSSR ? null : document.body, ...rest} = props;\n\n React.useEffect(() => {\n if (portalContainer?.closest('[data-overlay-container]')) {\n throw new Error('An OverlayContainer must not be inside another container. Please change the portalContainer prop.');\n }\n }, [portalContainer]);\n\n if (!portalContainer) {\n return null;\n }\n\n let contents = <OverlayProvider {...rest} />;\n return ReactDOM.createPortal(contents, portalContainer);\n}\n\ninterface ModalAriaProps extends DOMAttributes {\n /** Data attribute marks the dom node as a modal for the aria-modal-polyfill. */\n 'data-ismodal': boolean\n}\n\nexport interface AriaModalOptions {\n isDisabled?: boolean\n}\n\nexport interface ModalAria {\n /** Props for the modal content element. */\n modalProps: ModalAriaProps\n}\n\n/**\n * Hides content outside the current `<OverlayContainer>` from screen readers\n * on mount and restores it on unmount. Typically used by modal dialogs and\n * other types of overlays to ensure that only the top-most modal is\n * accessible at once.\n */\nexport function useModal(options?: AriaModalOptions): ModalAria {\n // Add aria-hidden to all parent providers on mount, and restore on unmount.\n let context = useContext(Context);\n if (!context) {\n throw new Error('Modal is not contained within a provider');\n }\n\n useEffect(() => {\n if (options?.isDisabled || !context || !context.parent) {\n return;\n }\n\n // The immediate context is from the provider containing this modal, so we only\n // want to trigger aria-hidden on its parents not on the modal provider itself.\n context.parent.addModal();\n return () => {\n if (context && context.parent) {\n context.parent.removeModal();\n }\n };\n }, [context, context.parent, options?.isDisabled]);\n\n return {\n modalProps: {\n 'data-ismodal': !options?.isDisabled\n }\n };\n}\n"],"names":[],"version":3,"file":"useModal.main.js.map"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import $4AOtR$react, {useContext as $4AOtR$useContext, useState as $4AOtR$useState, useMemo as $4AOtR$useMemo, useEffect as $4AOtR$useEffect} from "react";
|
|
2
|
+
import $4AOtR$reactdom from "react-dom";
|
|
3
|
+
import {useIsSSR as $4AOtR$useIsSSR} from "@react-aria/ssr";
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
7
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
9
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
12
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
13
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
14
|
+
* governing permissions and limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
const $f57aed4a881a3485$var$Context = /*#__PURE__*/ (0, $4AOtR$react).createContext(null);
|
|
19
|
+
function $f57aed4a881a3485$export$178405afcd8c5eb(props) {
|
|
20
|
+
let { children: children } = props;
|
|
21
|
+
let parent = (0, $4AOtR$useContext)($f57aed4a881a3485$var$Context);
|
|
22
|
+
let [modalCount, setModalCount] = (0, $4AOtR$useState)(0);
|
|
23
|
+
let context = (0, $4AOtR$useMemo)(()=>({
|
|
24
|
+
parent: parent,
|
|
25
|
+
modalCount: modalCount,
|
|
26
|
+
addModal () {
|
|
27
|
+
setModalCount((count)=>count + 1);
|
|
28
|
+
if (parent) parent.addModal();
|
|
29
|
+
},
|
|
30
|
+
removeModal () {
|
|
31
|
+
setModalCount((count)=>count - 1);
|
|
32
|
+
if (parent) parent.removeModal();
|
|
33
|
+
}
|
|
34
|
+
}), [
|
|
35
|
+
parent,
|
|
36
|
+
modalCount
|
|
37
|
+
]);
|
|
38
|
+
return /*#__PURE__*/ (0, $4AOtR$react).createElement($f57aed4a881a3485$var$Context.Provider, {
|
|
39
|
+
value: context
|
|
40
|
+
}, children);
|
|
41
|
+
}
|
|
42
|
+
function $f57aed4a881a3485$export$d9aaed4c3ece1bc0() {
|
|
43
|
+
let context = (0, $4AOtR$useContext)($f57aed4a881a3485$var$Context);
|
|
44
|
+
return {
|
|
45
|
+
modalProviderProps: {
|
|
46
|
+
"aria-hidden": context && context.modalCount > 0 ? true : null
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Creates a root node that will be aria-hidden if there are other modals open.
|
|
52
|
+
*/ function $f57aed4a881a3485$var$OverlayContainerDOM(props) {
|
|
53
|
+
let { modalProviderProps: modalProviderProps } = $f57aed4a881a3485$export$d9aaed4c3ece1bc0();
|
|
54
|
+
return /*#__PURE__*/ (0, $4AOtR$react).createElement("div", {
|
|
55
|
+
"data-overlay-container": true,
|
|
56
|
+
...props,
|
|
57
|
+
...modalProviderProps
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
function $f57aed4a881a3485$export$bf688221f59024e5(props) {
|
|
61
|
+
return /*#__PURE__*/ (0, $4AOtR$react).createElement($f57aed4a881a3485$export$178405afcd8c5eb, null, /*#__PURE__*/ (0, $4AOtR$react).createElement($f57aed4a881a3485$var$OverlayContainerDOM, props));
|
|
62
|
+
}
|
|
63
|
+
function $f57aed4a881a3485$export$b47c3594eab58386(props) {
|
|
64
|
+
let isSSR = (0, $4AOtR$useIsSSR)();
|
|
65
|
+
let { portalContainer: portalContainer = isSSR ? null : document.body, ...rest } = props;
|
|
66
|
+
(0, $4AOtR$react).useEffect(()=>{
|
|
67
|
+
if (portalContainer === null || portalContainer === void 0 ? void 0 : portalContainer.closest("[data-overlay-container]")) throw new Error("An OverlayContainer must not be inside another container. Please change the portalContainer prop.");
|
|
68
|
+
}, [
|
|
69
|
+
portalContainer
|
|
70
|
+
]);
|
|
71
|
+
if (!portalContainer) return null;
|
|
72
|
+
let contents = /*#__PURE__*/ (0, $4AOtR$react).createElement($f57aed4a881a3485$export$bf688221f59024e5, rest);
|
|
73
|
+
return /*#__PURE__*/ (0, $4AOtR$reactdom).createPortal(contents, portalContainer);
|
|
74
|
+
}
|
|
75
|
+
function $f57aed4a881a3485$export$33ffd74ebf07f060(options) {
|
|
76
|
+
// Add aria-hidden to all parent providers on mount, and restore on unmount.
|
|
77
|
+
let context = (0, $4AOtR$useContext)($f57aed4a881a3485$var$Context);
|
|
78
|
+
if (!context) throw new Error("Modal is not contained within a provider");
|
|
79
|
+
(0, $4AOtR$useEffect)(()=>{
|
|
80
|
+
if ((options === null || options === void 0 ? void 0 : options.isDisabled) || !context || !context.parent) return;
|
|
81
|
+
// The immediate context is from the provider containing this modal, so we only
|
|
82
|
+
// want to trigger aria-hidden on its parents not on the modal provider itself.
|
|
83
|
+
context.parent.addModal();
|
|
84
|
+
return ()=>{
|
|
85
|
+
if (context && context.parent) context.parent.removeModal();
|
|
86
|
+
};
|
|
87
|
+
}, [
|
|
88
|
+
context,
|
|
89
|
+
context.parent,
|
|
90
|
+
options === null || options === void 0 ? void 0 : options.isDisabled
|
|
91
|
+
]);
|
|
92
|
+
return {
|
|
93
|
+
modalProps: {
|
|
94
|
+
"data-ismodal": !(options === null || options === void 0 ? void 0 : options.isDisabled)
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
export {$f57aed4a881a3485$export$178405afcd8c5eb as ModalProvider, $f57aed4a881a3485$export$d9aaed4c3ece1bc0 as useModalProvider, $f57aed4a881a3485$export$bf688221f59024e5 as OverlayProvider, $f57aed4a881a3485$export$b47c3594eab58386 as OverlayContainer, $f57aed4a881a3485$export$33ffd74ebf07f060 as useModal};
|
|
101
|
+
//# sourceMappingURL=useModal.mjs.map
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import $4AOtR$react, {useContext as $4AOtR$useContext, useState as $4AOtR$useState, useMemo as $4AOtR$useMemo, useEffect as $4AOtR$useEffect} from "react";
|
|
2
|
+
import $4AOtR$reactdom from "react-dom";
|
|
3
|
+
import {useIsSSR as $4AOtR$useIsSSR} from "@react-aria/ssr";
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
7
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
9
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
12
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
13
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
14
|
+
* governing permissions and limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
const $f57aed4a881a3485$var$Context = /*#__PURE__*/ (0, $4AOtR$react).createContext(null);
|
|
19
|
+
function $f57aed4a881a3485$export$178405afcd8c5eb(props) {
|
|
20
|
+
let { children: children } = props;
|
|
21
|
+
let parent = (0, $4AOtR$useContext)($f57aed4a881a3485$var$Context);
|
|
22
|
+
let [modalCount, setModalCount] = (0, $4AOtR$useState)(0);
|
|
23
|
+
let context = (0, $4AOtR$useMemo)(()=>({
|
|
24
|
+
parent: parent,
|
|
25
|
+
modalCount: modalCount,
|
|
26
|
+
addModal () {
|
|
27
|
+
setModalCount((count)=>count + 1);
|
|
28
|
+
if (parent) parent.addModal();
|
|
29
|
+
},
|
|
30
|
+
removeModal () {
|
|
31
|
+
setModalCount((count)=>count - 1);
|
|
32
|
+
if (parent) parent.removeModal();
|
|
33
|
+
}
|
|
34
|
+
}), [
|
|
35
|
+
parent,
|
|
36
|
+
modalCount
|
|
37
|
+
]);
|
|
38
|
+
return /*#__PURE__*/ (0, $4AOtR$react).createElement($f57aed4a881a3485$var$Context.Provider, {
|
|
39
|
+
value: context
|
|
40
|
+
}, children);
|
|
41
|
+
}
|
|
42
|
+
function $f57aed4a881a3485$export$d9aaed4c3ece1bc0() {
|
|
43
|
+
let context = (0, $4AOtR$useContext)($f57aed4a881a3485$var$Context);
|
|
44
|
+
return {
|
|
45
|
+
modalProviderProps: {
|
|
46
|
+
"aria-hidden": context && context.modalCount > 0 ? true : null
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Creates a root node that will be aria-hidden if there are other modals open.
|
|
52
|
+
*/ function $f57aed4a881a3485$var$OverlayContainerDOM(props) {
|
|
53
|
+
let { modalProviderProps: modalProviderProps } = $f57aed4a881a3485$export$d9aaed4c3ece1bc0();
|
|
54
|
+
return /*#__PURE__*/ (0, $4AOtR$react).createElement("div", {
|
|
55
|
+
"data-overlay-container": true,
|
|
56
|
+
...props,
|
|
57
|
+
...modalProviderProps
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
function $f57aed4a881a3485$export$bf688221f59024e5(props) {
|
|
61
|
+
return /*#__PURE__*/ (0, $4AOtR$react).createElement($f57aed4a881a3485$export$178405afcd8c5eb, null, /*#__PURE__*/ (0, $4AOtR$react).createElement($f57aed4a881a3485$var$OverlayContainerDOM, props));
|
|
62
|
+
}
|
|
63
|
+
function $f57aed4a881a3485$export$b47c3594eab58386(props) {
|
|
64
|
+
let isSSR = (0, $4AOtR$useIsSSR)();
|
|
65
|
+
let { portalContainer: portalContainer = isSSR ? null : document.body, ...rest } = props;
|
|
66
|
+
(0, $4AOtR$react).useEffect(()=>{
|
|
67
|
+
if (portalContainer === null || portalContainer === void 0 ? void 0 : portalContainer.closest("[data-overlay-container]")) throw new Error("An OverlayContainer must not be inside another container. Please change the portalContainer prop.");
|
|
68
|
+
}, [
|
|
69
|
+
portalContainer
|
|
70
|
+
]);
|
|
71
|
+
if (!portalContainer) return null;
|
|
72
|
+
let contents = /*#__PURE__*/ (0, $4AOtR$react).createElement($f57aed4a881a3485$export$bf688221f59024e5, rest);
|
|
73
|
+
return /*#__PURE__*/ (0, $4AOtR$reactdom).createPortal(contents, portalContainer);
|
|
74
|
+
}
|
|
75
|
+
function $f57aed4a881a3485$export$33ffd74ebf07f060(options) {
|
|
76
|
+
// Add aria-hidden to all parent providers on mount, and restore on unmount.
|
|
77
|
+
let context = (0, $4AOtR$useContext)($f57aed4a881a3485$var$Context);
|
|
78
|
+
if (!context) throw new Error("Modal is not contained within a provider");
|
|
79
|
+
(0, $4AOtR$useEffect)(()=>{
|
|
80
|
+
if ((options === null || options === void 0 ? void 0 : options.isDisabled) || !context || !context.parent) return;
|
|
81
|
+
// The immediate context is from the provider containing this modal, so we only
|
|
82
|
+
// want to trigger aria-hidden on its parents not on the modal provider itself.
|
|
83
|
+
context.parent.addModal();
|
|
84
|
+
return ()=>{
|
|
85
|
+
if (context && context.parent) context.parent.removeModal();
|
|
86
|
+
};
|
|
87
|
+
}, [
|
|
88
|
+
context,
|
|
89
|
+
context.parent,
|
|
90
|
+
options === null || options === void 0 ? void 0 : options.isDisabled
|
|
91
|
+
]);
|
|
92
|
+
return {
|
|
93
|
+
modalProps: {
|
|
94
|
+
"data-ismodal": !(options === null || options === void 0 ? void 0 : options.isDisabled)
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
export {$f57aed4a881a3485$export$178405afcd8c5eb as ModalProvider, $f57aed4a881a3485$export$d9aaed4c3ece1bc0 as useModalProvider, $f57aed4a881a3485$export$bf688221f59024e5 as OverlayProvider, $f57aed4a881a3485$export$b47c3594eab58386 as OverlayContainer, $f57aed4a881a3485$export$33ffd74ebf07f060 as useModal};
|
|
101
|
+
//# sourceMappingURL=useModal.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAkBD,MAAM,8CAAU,CAAA,GAAA,YAAI,EAAE,aAAa,CAAsB;AAUlD,SAAS,yCAAc,KAAyB;IACrD,IAAI,YAAC,QAAQ,EAAC,GAAG;IACjB,IAAI,SAAS,CAAA,GAAA,iBAAS,EAAE;IACxB,IAAI,CAAC,YAAY,cAAc,GAAG,CAAA,GAAA,eAAO,EAAE;IAC3C,IAAI,UAAU,CAAA,GAAA,cAAM,EAAE,IAAO,CAAA;oBAC3B;wBACA;YACA;gBACE,cAAc,CAAA,QAAS,QAAQ;gBAC/B,IAAI,QACF,OAAO,QAAQ;YAEnB;YACA;gBACE,cAAc,CAAA,QAAS,QAAQ;gBAC/B,IAAI,QACF,OAAO,WAAW;YAEtB;QACF,CAAA,GAAI;QAAC;QAAQ;KAAW;IAExB,qBACE,gCAAC,8BAAQ,QAAQ;QAAC,OAAO;OACtB;AAGP;AAaO,SAAS;IACd,IAAI,UAAU,CAAA,GAAA,iBAAS,EAAE;IACzB,OAAO;QACL,oBAAoB;YAClB,eAAe,WAAW,QAAQ,UAAU,GAAG,IAAI,OAAO;QAC5D;IACF;AACF;AAEA;;CAEC,GACD,SAAS,0CAAoB,KAAyB;IACpD,IAAI,sBAAC,kBAAkB,EAAC,GAAG;IAC3B,qBAAO,gCAAC;QAAI,0BAAA;QAAwB,GAAG,KAAK;QAAG,GAAG,kBAAkB;;AACtE;AAUO,SAAS,0CAAgB,KAAyB;IACvD,qBACE,gCAAC,8DACC,gCAAC,2CAAwB;AAG/B;AAiBO,SAAS,0CAAiB,KAA4B;IAC3D,IAAI,QAAQ,CAAA,GAAA,eAAO;IACnB,IAAI,mBAAC,kBAAkB,QAAQ,OAAO,SAAS,IAAI,EAAE,GAAG,MAAK,GAAG;IAEhE,CAAA,GAAA,YAAI,EAAE,SAAS,CAAC;QACd,IAAI,4BAAA,sCAAA,gBAAiB,OAAO,CAAC,6BAC3B,MAAM,IAAI,MAAM;IAEpB,GAAG;QAAC;KAAgB;IAEpB,IAAI,CAAC,iBACH,OAAO;IAGT,IAAI,yBAAW,gCAAC,2CAAoB;IACpC,qBAAO,CAAA,GAAA,eAAO,EAAE,YAAY,CAAC,UAAU;AACzC;AAsBO,SAAS,0CAAS,OAA0B;IACjD,4EAA4E;IAC5E,IAAI,UAAU,CAAA,GAAA,iBAAS,EAAE;IACzB,IAAI,CAAC,SACH,MAAM,IAAI,MAAM;IAGlB,CAAA,GAAA,gBAAQ,EAAE;QACR,IAAI,CAAA,oBAAA,8BAAA,QAAS,UAAU,KAAI,CAAC,WAAW,CAAC,QAAQ,MAAM,EACpD;QAGF,+EAA+E;QAC/E,+EAA+E;QAC/E,QAAQ,MAAM,CAAC,QAAQ;QACvB,OAAO;YACL,IAAI,WAAW,QAAQ,MAAM,EAC3B,QAAQ,MAAM,CAAC,WAAW;QAE9B;IACF,GAAG;QAAC;QAAS,QAAQ,MAAM;QAAE,oBAAA,8BAAA,QAAS,UAAU;KAAC;IAEjD,OAAO;QACL,YAAY;YACV,gBAAgB,EAAC,oBAAA,8BAAA,QAAS,UAAU;QACtC;IACF;AACF","sources":["packages/@react-aria/overlays/src/useModal.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMAttributes} from '@react-types/shared';\nimport React, {AriaAttributes, ReactNode, useContext, useEffect, useMemo, useState} from 'react';\nimport ReactDOM from 'react-dom';\nimport {useIsSSR} from '@react-aria/ssr';\n\nexport interface ModalProviderProps extends DOMAttributes {\n children: ReactNode\n}\n\ninterface ModalContext {\n parent: ModalContext | null,\n modalCount: number,\n addModal: () => void,\n removeModal: () => void\n}\n\nconst Context = React.createContext<ModalContext | null>(null);\n\n/**\n * Each ModalProvider tracks how many modals are open in its subtree. On mount, the modals\n * trigger `addModal` to increment the count, and trigger `removeModal` on unmount to decrement it.\n * This is done recursively so that all parent providers are incremented and decremented.\n * If the modal count is greater than zero, we add `aria-hidden` to this provider to hide its\n * subtree from screen readers. This is done using React context in order to account for things\n * like portals, which can cause the React tree and the DOM tree to differ significantly in structure.\n */\nexport function ModalProvider(props: ModalProviderProps) {\n let {children} = props;\n let parent = useContext(Context);\n let [modalCount, setModalCount] = useState(0);\n let context = useMemo(() => ({\n parent,\n modalCount,\n addModal() {\n setModalCount(count => count + 1);\n if (parent) {\n parent.addModal();\n }\n },\n removeModal() {\n setModalCount(count => count - 1);\n if (parent) {\n parent.removeModal();\n }\n }\n }), [parent, modalCount]);\n\n return (\n <Context.Provider value={context}>\n {children}\n </Context.Provider>\n );\n}\n\nexport interface ModalProviderAria {\n /**\n * Props to be spread on the container element.\n */\n modalProviderProps: AriaAttributes\n}\n\n/**\n * Used to determine if the tree should be aria-hidden based on how many\n * modals are open.\n */\nexport function useModalProvider(): ModalProviderAria {\n let context = useContext(Context);\n return {\n modalProviderProps: {\n 'aria-hidden': context && context.modalCount > 0 ? true : null\n }\n };\n}\n\n/**\n * Creates a root node that will be aria-hidden if there are other modals open.\n */\nfunction OverlayContainerDOM(props: ModalProviderProps) {\n let {modalProviderProps} = useModalProvider();\n return <div data-overlay-container {...props} {...modalProviderProps} />;\n}\n\n/**\n * An OverlayProvider acts as a container for the top-level application.\n * Any application that uses modal dialogs or other overlays should\n * be wrapped in a `<OverlayProvider>`. This is used to ensure that\n * the main content of the application is hidden from screen readers\n * if a modal or other overlay is opened. Only the top-most modal or\n * overlay should be accessible at once.\n */\nexport function OverlayProvider(props: ModalProviderProps) {\n return (\n <ModalProvider>\n <OverlayContainerDOM {...props} />\n </ModalProvider>\n );\n}\n\nexport interface OverlayContainerProps extends ModalProviderProps {\n /**\n * The container element in which the overlay portal will be placed.\n * @default document.body\n */\n portalContainer?: Element\n}\n\n/**\n * A container for overlays like modals and popovers. Renders the overlay\n * into a Portal which is placed at the end of the document body.\n * Also ensures that the overlay is hidden from screen readers if a\n * nested modal is opened. Only the top-most modal or overlay should\n * be accessible at once.\n */\nexport function OverlayContainer(props: OverlayContainerProps): React.ReactPortal {\n let isSSR = useIsSSR();\n let {portalContainer = isSSR ? null : document.body, ...rest} = props;\n\n React.useEffect(() => {\n if (portalContainer?.closest('[data-overlay-container]')) {\n throw new Error('An OverlayContainer must not be inside another container. Please change the portalContainer prop.');\n }\n }, [portalContainer]);\n\n if (!portalContainer) {\n return null;\n }\n\n let contents = <OverlayProvider {...rest} />;\n return ReactDOM.createPortal(contents, portalContainer);\n}\n\ninterface ModalAriaProps extends DOMAttributes {\n /** Data attribute marks the dom node as a modal for the aria-modal-polyfill. */\n 'data-ismodal': boolean\n}\n\nexport interface AriaModalOptions {\n isDisabled?: boolean\n}\n\nexport interface ModalAria {\n /** Props for the modal content element. */\n modalProps: ModalAriaProps\n}\n\n/**\n * Hides content outside the current `<OverlayContainer>` from screen readers\n * on mount and restores it on unmount. Typically used by modal dialogs and\n * other types of overlays to ensure that only the top-most modal is\n * accessible at once.\n */\nexport function useModal(options?: AriaModalOptions): ModalAria {\n // Add aria-hidden to all parent providers on mount, and restore on unmount.\n let context = useContext(Context);\n if (!context) {\n throw new Error('Modal is not contained within a provider');\n }\n\n useEffect(() => {\n if (options?.isDisabled || !context || !context.parent) {\n return;\n }\n\n // The immediate context is from the provider containing this modal, so we only\n // want to trigger aria-hidden on its parents not on the modal provider itself.\n context.parent.addModal();\n return () => {\n if (context && context.parent) {\n context.parent.removeModal();\n }\n };\n }, [context, context.parent, options?.isDisabled]);\n\n return {\n modalProps: {\n 'data-ismodal': !options?.isDisabled\n }\n };\n}\n"],"names":[],"version":3,"file":"useModal.module.js.map"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
var $08ef1685902b6011$exports = require("./ariaHideOutside.main.js");
|
|
2
|
+
var $82711f9cb668ecdb$exports = require("./useOverlay.main.js");
|
|
3
|
+
var $745edbb83ab4296f$exports = require("./Overlay.main.js");
|
|
4
|
+
var $5c2f5cd01815d369$exports = require("./usePreventScroll.main.js");
|
|
5
|
+
var $9ziDi$reactariautils = require("@react-aria/utils");
|
|
6
|
+
var $9ziDi$react = require("react");
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
function $parcel$export(e, n, v, s) {
|
|
10
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
$parcel$export(module.exports, "useModalOverlay", () => $11b7e0b04b421e95$export$dbc0f175b25fb0fb);
|
|
14
|
+
/*
|
|
15
|
+
* Copyright 2022 Adobe. All rights reserved.
|
|
16
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
17
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
18
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
19
|
+
*
|
|
20
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
21
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
22
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
23
|
+
* governing permissions and limitations under the License.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
function $11b7e0b04b421e95$export$dbc0f175b25fb0fb(props, state, ref) {
|
|
31
|
+
let { overlayProps: overlayProps, underlayProps: underlayProps } = (0, $82711f9cb668ecdb$exports.useOverlay)({
|
|
32
|
+
...props,
|
|
33
|
+
isOpen: state.isOpen,
|
|
34
|
+
onClose: state.close
|
|
35
|
+
}, ref);
|
|
36
|
+
(0, $5c2f5cd01815d369$exports.usePreventScroll)({
|
|
37
|
+
isDisabled: !state.isOpen
|
|
38
|
+
});
|
|
39
|
+
(0, $745edbb83ab4296f$exports.useOverlayFocusContain)();
|
|
40
|
+
(0, $9ziDi$react.useEffect)(()=>{
|
|
41
|
+
if (state.isOpen) return (0, $08ef1685902b6011$exports.ariaHideOutside)([
|
|
42
|
+
ref.current
|
|
43
|
+
]);
|
|
44
|
+
}, [
|
|
45
|
+
state.isOpen,
|
|
46
|
+
ref
|
|
47
|
+
]);
|
|
48
|
+
return {
|
|
49
|
+
modalProps: (0, $9ziDi$reactariautils.mergeProps)(overlayProps),
|
|
50
|
+
underlayProps: underlayProps
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
//# sourceMappingURL=useModalOverlay.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAmCM,SAAS,0CAAgB,KAA4B,EAAE,KAA0B,EAAE,GAA2B;IACnH,IAAI,gBAAC,YAAY,iBAAE,aAAa,EAAC,GAAG,CAAA,GAAA,oCAAS,EAAE;QAC7C,GAAG,KAAK;QACR,QAAQ,MAAM,MAAM;QACpB,SAAS,MAAM,KAAK;IACtB,GAAG;IAEH,CAAA,GAAA,0CAAe,EAAE;QACf,YAAY,CAAC,MAAM,MAAM;IAC3B;IAEA,CAAA,GAAA,gDAAqB;IAErB,CAAA,GAAA,sBAAQ,EAAE;QACR,IAAI,MAAM,MAAM,EACd,OAAO,CAAA,GAAA,yCAAc,EAAE;YAAC,IAAI,OAAO;SAAC;IAExC,GAAG;QAAC,MAAM,MAAM;QAAE;KAAI;IAEtB,OAAO;QACL,YAAY,CAAA,GAAA,gCAAS,EAAE;uBACvB;IACF;AACF","sources":["packages/@react-aria/overlays/src/useModalOverlay.ts"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ariaHideOutside} from './ariaHideOutside';\nimport {AriaOverlayProps, useOverlay} from './useOverlay';\nimport {DOMAttributes} from '@react-types/shared';\nimport {mergeProps} from '@react-aria/utils';\nimport {OverlayTriggerState} from '@react-stately/overlays';\nimport {RefObject, useEffect} from 'react';\nimport {useOverlayFocusContain} from './Overlay';\nimport {usePreventScroll} from './usePreventScroll';\n\nexport interface AriaModalOverlayProps extends Pick<AriaOverlayProps, 'shouldCloseOnInteractOutside'> {\n /**\n * Whether to close the modal when the user interacts outside it.\n * @default false\n */\n isDismissable?: boolean,\n /**\n * Whether pressing the escape key to close the modal should be disabled.\n * @default false\n */\n isKeyboardDismissDisabled?: boolean\n}\n\nexport interface ModalOverlayAria {\n /** Props for the modal element. */\n modalProps: DOMAttributes,\n /** Props for the underlay element. */\n underlayProps: DOMAttributes\n}\n\n/**\n * Provides the behavior and accessibility implementation for a modal component.\n * A modal is an overlay element which blocks interaction with elements outside it.\n */\nexport function useModalOverlay(props: AriaModalOverlayProps, state: OverlayTriggerState, ref: RefObject<HTMLElement>): ModalOverlayAria {\n let {overlayProps, underlayProps} = useOverlay({\n ...props,\n isOpen: state.isOpen,\n onClose: state.close\n }, ref);\n\n usePreventScroll({\n isDisabled: !state.isOpen\n });\n\n useOverlayFocusContain();\n\n useEffect(() => {\n if (state.isOpen) {\n return ariaHideOutside([ref.current]);\n }\n }, [state.isOpen, ref]);\n\n return {\n modalProps: mergeProps(overlayProps),\n underlayProps\n };\n}\n"],"names":[],"version":3,"file":"useModalOverlay.main.js.map"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import {ariaHideOutside as $5e3802645cc19319$export$1c3ebcada18427bf} from "./ariaHideOutside.mjs";
|
|
2
|
+
import {useOverlay as $a11501f3d1d39e6c$export$ea8f71083e90600f} from "./useOverlay.mjs";
|
|
3
|
+
import {useOverlayFocusContain as $337b884510726a0d$export$14c98a7594375490} from "./Overlay.mjs";
|
|
4
|
+
import {usePreventScroll as $49c51c25361d4cd2$export$ee0f7cc6afcd1c18} from "./usePreventScroll.mjs";
|
|
5
|
+
import {mergeProps as $7Dhkr$mergeProps} from "@react-aria/utils";
|
|
6
|
+
import {useEffect as $7Dhkr$useEffect} from "react";
|
|
7
|
+
|
|
8
|
+
/*
|
|
9
|
+
* Copyright 2022 Adobe. All rights reserved.
|
|
10
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
11
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
12
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
*
|
|
14
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
15
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
16
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
17
|
+
* governing permissions and limitations under the License.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
function $8ac8429251c45e4b$export$dbc0f175b25fb0fb(props, state, ref) {
|
|
25
|
+
let { overlayProps: overlayProps, underlayProps: underlayProps } = (0, $a11501f3d1d39e6c$export$ea8f71083e90600f)({
|
|
26
|
+
...props,
|
|
27
|
+
isOpen: state.isOpen,
|
|
28
|
+
onClose: state.close
|
|
29
|
+
}, ref);
|
|
30
|
+
(0, $49c51c25361d4cd2$export$ee0f7cc6afcd1c18)({
|
|
31
|
+
isDisabled: !state.isOpen
|
|
32
|
+
});
|
|
33
|
+
(0, $337b884510726a0d$export$14c98a7594375490)();
|
|
34
|
+
(0, $7Dhkr$useEffect)(()=>{
|
|
35
|
+
if (state.isOpen) return (0, $5e3802645cc19319$export$1c3ebcada18427bf)([
|
|
36
|
+
ref.current
|
|
37
|
+
]);
|
|
38
|
+
}, [
|
|
39
|
+
state.isOpen,
|
|
40
|
+
ref
|
|
41
|
+
]);
|
|
42
|
+
return {
|
|
43
|
+
modalProps: (0, $7Dhkr$mergeProps)(overlayProps),
|
|
44
|
+
underlayProps: underlayProps
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
export {$8ac8429251c45e4b$export$dbc0f175b25fb0fb as useModalOverlay};
|
|
50
|
+
//# sourceMappingURL=useModalOverlay.mjs.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import {ariaHideOutside as $5e3802645cc19319$export$1c3ebcada18427bf} from "./ariaHideOutside.module.js";
|
|
2
|
+
import {useOverlay as $a11501f3d1d39e6c$export$ea8f71083e90600f} from "./useOverlay.module.js";
|
|
3
|
+
import {useOverlayFocusContain as $337b884510726a0d$export$14c98a7594375490} from "./Overlay.module.js";
|
|
4
|
+
import {usePreventScroll as $49c51c25361d4cd2$export$ee0f7cc6afcd1c18} from "./usePreventScroll.module.js";
|
|
5
|
+
import {mergeProps as $7Dhkr$mergeProps} from "@react-aria/utils";
|
|
6
|
+
import {useEffect as $7Dhkr$useEffect} from "react";
|
|
7
|
+
|
|
8
|
+
/*
|
|
9
|
+
* Copyright 2022 Adobe. All rights reserved.
|
|
10
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
11
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
12
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
*
|
|
14
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
15
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
16
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
17
|
+
* governing permissions and limitations under the License.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
function $8ac8429251c45e4b$export$dbc0f175b25fb0fb(props, state, ref) {
|
|
25
|
+
let { overlayProps: overlayProps, underlayProps: underlayProps } = (0, $a11501f3d1d39e6c$export$ea8f71083e90600f)({
|
|
26
|
+
...props,
|
|
27
|
+
isOpen: state.isOpen,
|
|
28
|
+
onClose: state.close
|
|
29
|
+
}, ref);
|
|
30
|
+
(0, $49c51c25361d4cd2$export$ee0f7cc6afcd1c18)({
|
|
31
|
+
isDisabled: !state.isOpen
|
|
32
|
+
});
|
|
33
|
+
(0, $337b884510726a0d$export$14c98a7594375490)();
|
|
34
|
+
(0, $7Dhkr$useEffect)(()=>{
|
|
35
|
+
if (state.isOpen) return (0, $5e3802645cc19319$export$1c3ebcada18427bf)([
|
|
36
|
+
ref.current
|
|
37
|
+
]);
|
|
38
|
+
}, [
|
|
39
|
+
state.isOpen,
|
|
40
|
+
ref
|
|
41
|
+
]);
|
|
42
|
+
return {
|
|
43
|
+
modalProps: (0, $7Dhkr$mergeProps)(overlayProps),
|
|
44
|
+
underlayProps: underlayProps
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
export {$8ac8429251c45e4b$export$dbc0f175b25fb0fb as useModalOverlay};
|
|
50
|
+
//# sourceMappingURL=useModalOverlay.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAmCM,SAAS,0CAAgB,KAA4B,EAAE,KAA0B,EAAE,GAA2B;IACnH,IAAI,gBAAC,YAAY,iBAAE,aAAa,EAAC,GAAG,CAAA,GAAA,yCAAS,EAAE;QAC7C,GAAG,KAAK;QACR,QAAQ,MAAM,MAAM;QACpB,SAAS,MAAM,KAAK;IACtB,GAAG;IAEH,CAAA,GAAA,yCAAe,EAAE;QACf,YAAY,CAAC,MAAM,MAAM;IAC3B;IAEA,CAAA,GAAA,yCAAqB;IAErB,CAAA,GAAA,gBAAQ,EAAE;QACR,IAAI,MAAM,MAAM,EACd,OAAO,CAAA,GAAA,yCAAc,EAAE;YAAC,IAAI,OAAO;SAAC;IAExC,GAAG;QAAC,MAAM,MAAM;QAAE;KAAI;IAEtB,OAAO;QACL,YAAY,CAAA,GAAA,iBAAS,EAAE;uBACvB;IACF;AACF","sources":["packages/@react-aria/overlays/src/useModalOverlay.ts"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ariaHideOutside} from './ariaHideOutside';\nimport {AriaOverlayProps, useOverlay} from './useOverlay';\nimport {DOMAttributes} from '@react-types/shared';\nimport {mergeProps} from '@react-aria/utils';\nimport {OverlayTriggerState} from '@react-stately/overlays';\nimport {RefObject, useEffect} from 'react';\nimport {useOverlayFocusContain} from './Overlay';\nimport {usePreventScroll} from './usePreventScroll';\n\nexport interface AriaModalOverlayProps extends Pick<AriaOverlayProps, 'shouldCloseOnInteractOutside'> {\n /**\n * Whether to close the modal when the user interacts outside it.\n * @default false\n */\n isDismissable?: boolean,\n /**\n * Whether pressing the escape key to close the modal should be disabled.\n * @default false\n */\n isKeyboardDismissDisabled?: boolean\n}\n\nexport interface ModalOverlayAria {\n /** Props for the modal element. */\n modalProps: DOMAttributes,\n /** Props for the underlay element. */\n underlayProps: DOMAttributes\n}\n\n/**\n * Provides the behavior and accessibility implementation for a modal component.\n * A modal is an overlay element which blocks interaction with elements outside it.\n */\nexport function useModalOverlay(props: AriaModalOverlayProps, state: OverlayTriggerState, ref: RefObject<HTMLElement>): ModalOverlayAria {\n let {overlayProps, underlayProps} = useOverlay({\n ...props,\n isOpen: state.isOpen,\n onClose: state.close\n }, ref);\n\n usePreventScroll({\n isDisabled: !state.isOpen\n });\n\n useOverlayFocusContain();\n\n useEffect(() => {\n if (state.isOpen) {\n return ariaHideOutside([ref.current]);\n }\n }, [state.isOpen, ref]);\n\n return {\n modalProps: mergeProps(overlayProps),\n underlayProps\n };\n}\n"],"names":[],"version":3,"file":"useModalOverlay.module.js.map"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
var $eQbp7$reactariafocus = require("@react-aria/focus");
|
|
2
|
+
var $eQbp7$react = require("react");
|
|
3
|
+
var $eQbp7$reactariainteractions = require("@react-aria/interactions");
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
function $parcel$export(e, n, v, s) {
|
|
7
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
$parcel$export(module.exports, "useOverlay", () => $82711f9cb668ecdb$export$ea8f71083e90600f);
|
|
11
|
+
/*
|
|
12
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
13
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
14
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
15
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
+
*
|
|
17
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
18
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
19
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
20
|
+
* governing permissions and limitations under the License.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
const $82711f9cb668ecdb$var$visibleOverlays = [];
|
|
25
|
+
function $82711f9cb668ecdb$export$ea8f71083e90600f(props, ref) {
|
|
26
|
+
let { onClose: onClose, shouldCloseOnBlur: shouldCloseOnBlur, isOpen: isOpen, isDismissable: isDismissable = false, isKeyboardDismissDisabled: isKeyboardDismissDisabled = false, shouldCloseOnInteractOutside: shouldCloseOnInteractOutside } = props;
|
|
27
|
+
// Add the overlay ref to the stack of visible overlays on mount, and remove on unmount.
|
|
28
|
+
(0, $eQbp7$react.useEffect)(()=>{
|
|
29
|
+
if (isOpen) $82711f9cb668ecdb$var$visibleOverlays.push(ref);
|
|
30
|
+
return ()=>{
|
|
31
|
+
let index = $82711f9cb668ecdb$var$visibleOverlays.indexOf(ref);
|
|
32
|
+
if (index >= 0) $82711f9cb668ecdb$var$visibleOverlays.splice(index, 1);
|
|
33
|
+
};
|
|
34
|
+
}, [
|
|
35
|
+
isOpen,
|
|
36
|
+
ref
|
|
37
|
+
]);
|
|
38
|
+
// Only hide the overlay when it is the topmost visible overlay in the stack
|
|
39
|
+
let onHide = ()=>{
|
|
40
|
+
if ($82711f9cb668ecdb$var$visibleOverlays[$82711f9cb668ecdb$var$visibleOverlays.length - 1] === ref && onClose) onClose();
|
|
41
|
+
};
|
|
42
|
+
let onInteractOutsideStart = (e)=>{
|
|
43
|
+
if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(e.target)) {
|
|
44
|
+
if ($82711f9cb668ecdb$var$visibleOverlays[$82711f9cb668ecdb$var$visibleOverlays.length - 1] === ref) {
|
|
45
|
+
e.stopPropagation();
|
|
46
|
+
e.preventDefault();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
let onInteractOutside = (e)=>{
|
|
51
|
+
if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(e.target)) {
|
|
52
|
+
if ($82711f9cb668ecdb$var$visibleOverlays[$82711f9cb668ecdb$var$visibleOverlays.length - 1] === ref) {
|
|
53
|
+
e.stopPropagation();
|
|
54
|
+
e.preventDefault();
|
|
55
|
+
}
|
|
56
|
+
onHide();
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
// Handle the escape key
|
|
60
|
+
let onKeyDown = (e)=>{
|
|
61
|
+
if (e.key === "Escape" && !isKeyboardDismissDisabled && !e.nativeEvent.isComposing) {
|
|
62
|
+
e.stopPropagation();
|
|
63
|
+
e.preventDefault();
|
|
64
|
+
onHide();
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
// Handle clicking outside the overlay to close it
|
|
68
|
+
(0, $eQbp7$reactariainteractions.useInteractOutside)({
|
|
69
|
+
ref: ref,
|
|
70
|
+
onInteractOutside: isDismissable && isOpen ? onInteractOutside : null,
|
|
71
|
+
onInteractOutsideStart: onInteractOutsideStart
|
|
72
|
+
});
|
|
73
|
+
let { focusWithinProps: focusWithinProps } = (0, $eQbp7$reactariainteractions.useFocusWithin)({
|
|
74
|
+
isDisabled: !shouldCloseOnBlur,
|
|
75
|
+
onBlurWithin: (e)=>{
|
|
76
|
+
// Do not close if relatedTarget is null, which means focus is lost to the body.
|
|
77
|
+
// That can happen when switching tabs, or due to a VoiceOver/Chrome bug with Control+Option+Arrow navigation.
|
|
78
|
+
// Clicking on the body to close the overlay should already be handled by useInteractOutside.
|
|
79
|
+
// https://github.com/adobe/react-spectrum/issues/4130
|
|
80
|
+
// https://github.com/adobe/react-spectrum/issues/4922
|
|
81
|
+
//
|
|
82
|
+
// If focus is moving into a child focus scope (e.g. menu inside a dialog),
|
|
83
|
+
// do not close the outer overlay. At this point, the active scope should
|
|
84
|
+
// still be the outer overlay, since blur events run before focus.
|
|
85
|
+
if (!e.relatedTarget || (0, $eQbp7$reactariafocus.isElementInChildOfActiveScope)(e.relatedTarget)) return;
|
|
86
|
+
if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(e.relatedTarget)) onClose();
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
let onPointerDownUnderlay = (e)=>{
|
|
90
|
+
// fixes a firefox issue that starts text selection https://bugzilla.mozilla.org/show_bug.cgi?id=1675846
|
|
91
|
+
if (e.target === e.currentTarget) e.preventDefault();
|
|
92
|
+
};
|
|
93
|
+
return {
|
|
94
|
+
overlayProps: {
|
|
95
|
+
onKeyDown: onKeyDown,
|
|
96
|
+
...focusWithinProps
|
|
97
|
+
},
|
|
98
|
+
underlayProps: {
|
|
99
|
+
onPointerDown: onPointerDownUnderlay
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
//# sourceMappingURL=useOverlay.main.js.map
|