@react-aria/aria-modal-polyfill 3.7.10-nightly.4623 → 3.7.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/import.mjs +4 -4
- package/dist/main.js +4 -4
- package/dist/module.js +4 -4
- package/package.json +2 -2
package/dist/import.mjs
CHANGED
|
@@ -11,8 +11,8 @@ import {hideOthers as $hRMXz$hideOthers} from "aria-hidden";
|
|
|
11
11
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
|
-
const $0ba7c906f8d7a5d9$var$currentDocument = typeof document !==
|
|
15
|
-
function $0ba7c906f8d7a5d9$export$11dddb85aae73809(selector =
|
|
14
|
+
const $0ba7c906f8d7a5d9$var$currentDocument = typeof document !== 'undefined' ? document : undefined;
|
|
15
|
+
function $0ba7c906f8d7a5d9$export$11dddb85aae73809(selector = 'body', { document: document1 = $0ba7c906f8d7a5d9$var$currentDocument } = {}) {
|
|
16
16
|
/**
|
|
17
17
|
* Listen for additions to the child list of the selected element (defaults to body). This is where providers render modal portals.
|
|
18
18
|
* When one is added, see if there is a modal inside it, if there is, then hide everything else from screen readers.
|
|
@@ -31,7 +31,7 @@ function $0ba7c906f8d7a5d9$export$11dddb85aae73809(selector = "body", { document
|
|
|
31
31
|
let observer = new MutationObserver((mutationRecord)=>{
|
|
32
32
|
const liveAnnouncer = document1.querySelector('[data-live-announcer="true"]');
|
|
33
33
|
for (let mutation of mutationRecord){
|
|
34
|
-
if (mutation.type ===
|
|
34
|
+
if (mutation.type === 'childList' && mutation.addedNodes.length > 0) {
|
|
35
35
|
let addNode = Array.from(mutation.addedNodes).find((node)=>{
|
|
36
36
|
var _node_querySelector;
|
|
37
37
|
return (_node_querySelector = node.querySelector) === null || _node_querySelector === void 0 ? void 0 : _node_querySelector.call(node, '[aria-modal="true"], [data-ismodal="true"]');
|
|
@@ -48,7 +48,7 @@ function $0ba7c906f8d7a5d9$export$11dddb85aae73809(selector = "body", { document
|
|
|
48
48
|
];
|
|
49
49
|
undo = (0, $hRMXz$hideOthers)(others);
|
|
50
50
|
}
|
|
51
|
-
} else if (mutation.type ===
|
|
51
|
+
} else if (mutation.type === 'childList' && mutation.removedNodes.length > 0) {
|
|
52
52
|
let removedNodes = Array.from(mutation.removedNodes);
|
|
53
53
|
let nodeIndexRemove = modalContainers.findIndex((container)=>removedNodes.includes(container));
|
|
54
54
|
if (nodeIndexRemove >= 0) {
|
package/dist/main.js
CHANGED
|
@@ -17,8 +17,8 @@ $parcel$export(module.exports, "watchModals", () => $5670f73d6b18f643$export$11d
|
|
|
17
17
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
18
18
|
* governing permissions and limitations under the License.
|
|
19
19
|
*/
|
|
20
|
-
const $5670f73d6b18f643$var$currentDocument = typeof document !==
|
|
21
|
-
function $5670f73d6b18f643$export$11dddb85aae73809(selector =
|
|
20
|
+
const $5670f73d6b18f643$var$currentDocument = typeof document !== 'undefined' ? document : undefined;
|
|
21
|
+
function $5670f73d6b18f643$export$11dddb85aae73809(selector = 'body', { document: document1 = $5670f73d6b18f643$var$currentDocument } = {}) {
|
|
22
22
|
/**
|
|
23
23
|
* Listen for additions to the child list of the selected element (defaults to body). This is where providers render modal portals.
|
|
24
24
|
* When one is added, see if there is a modal inside it, if there is, then hide everything else from screen readers.
|
|
@@ -37,7 +37,7 @@ function $5670f73d6b18f643$export$11dddb85aae73809(selector = "body", { document
|
|
|
37
37
|
let observer = new MutationObserver((mutationRecord)=>{
|
|
38
38
|
const liveAnnouncer = document1.querySelector('[data-live-announcer="true"]');
|
|
39
39
|
for (let mutation of mutationRecord){
|
|
40
|
-
if (mutation.type ===
|
|
40
|
+
if (mutation.type === 'childList' && mutation.addedNodes.length > 0) {
|
|
41
41
|
let addNode = Array.from(mutation.addedNodes).find((node)=>{
|
|
42
42
|
var _node_querySelector;
|
|
43
43
|
return (_node_querySelector = node.querySelector) === null || _node_querySelector === void 0 ? void 0 : _node_querySelector.call(node, '[aria-modal="true"], [data-ismodal="true"]');
|
|
@@ -54,7 +54,7 @@ function $5670f73d6b18f643$export$11dddb85aae73809(selector = "body", { document
|
|
|
54
54
|
];
|
|
55
55
|
undo = (0, $26G9B$ariahidden.hideOthers)(others);
|
|
56
56
|
}
|
|
57
|
-
} else if (mutation.type ===
|
|
57
|
+
} else if (mutation.type === 'childList' && mutation.removedNodes.length > 0) {
|
|
58
58
|
let removedNodes = Array.from(mutation.removedNodes);
|
|
59
59
|
let nodeIndexRemove = modalContainers.findIndex((container)=>removedNodes.includes(container));
|
|
60
60
|
if (nodeIndexRemove >= 0) {
|
package/dist/module.js
CHANGED
|
@@ -11,8 +11,8 @@ import {hideOthers as $hRMXz$hideOthers} from "aria-hidden";
|
|
|
11
11
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
|
-
const $0ba7c906f8d7a5d9$var$currentDocument = typeof document !==
|
|
15
|
-
function $0ba7c906f8d7a5d9$export$11dddb85aae73809(selector =
|
|
14
|
+
const $0ba7c906f8d7a5d9$var$currentDocument = typeof document !== 'undefined' ? document : undefined;
|
|
15
|
+
function $0ba7c906f8d7a5d9$export$11dddb85aae73809(selector = 'body', { document: document1 = $0ba7c906f8d7a5d9$var$currentDocument } = {}) {
|
|
16
16
|
/**
|
|
17
17
|
* Listen for additions to the child list of the selected element (defaults to body). This is where providers render modal portals.
|
|
18
18
|
* When one is added, see if there is a modal inside it, if there is, then hide everything else from screen readers.
|
|
@@ -31,7 +31,7 @@ function $0ba7c906f8d7a5d9$export$11dddb85aae73809(selector = "body", { document
|
|
|
31
31
|
let observer = new MutationObserver((mutationRecord)=>{
|
|
32
32
|
const liveAnnouncer = document1.querySelector('[data-live-announcer="true"]');
|
|
33
33
|
for (let mutation of mutationRecord){
|
|
34
|
-
if (mutation.type ===
|
|
34
|
+
if (mutation.type === 'childList' && mutation.addedNodes.length > 0) {
|
|
35
35
|
let addNode = Array.from(mutation.addedNodes).find((node)=>{
|
|
36
36
|
var _node_querySelector;
|
|
37
37
|
return (_node_querySelector = node.querySelector) === null || _node_querySelector === void 0 ? void 0 : _node_querySelector.call(node, '[aria-modal="true"], [data-ismodal="true"]');
|
|
@@ -48,7 +48,7 @@ function $0ba7c906f8d7a5d9$export$11dddb85aae73809(selector = "body", { document
|
|
|
48
48
|
];
|
|
49
49
|
undo = (0, $hRMXz$hideOthers)(others);
|
|
50
50
|
}
|
|
51
|
-
} else if (mutation.type ===
|
|
51
|
+
} else if (mutation.type === 'childList' && mutation.removedNodes.length > 0) {
|
|
52
52
|
let removedNodes = Array.from(mutation.removedNodes);
|
|
53
53
|
let nodeIndexRemove = modalContainers.findIndex((container)=>removedNodes.includes(container));
|
|
54
54
|
if (nodeIndexRemove >= 0) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-aria/aria-modal-polyfill",
|
|
3
|
-
"version": "3.7.10
|
|
3
|
+
"version": "3.7.10",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "b77d7d594dff4dcfb5359bffbcfd18142b146433"
|
|
35
35
|
}
|