@react-aria/utils 3.33.0 → 3.33.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DOMFunctions.main.js +16 -3
- package/dist/DOMFunctions.main.js.map +1 -1
- package/dist/DOMFunctions.mjs +17 -5
- package/dist/DOMFunctions.module.js +17 -5
- package/dist/DOMFunctions.module.js.map +1 -1
- package/dist/getScrollParents.main.js +6 -5
- package/dist/getScrollParents.main.js.map +1 -1
- package/dist/getScrollParents.mjs +6 -5
- package/dist/getScrollParents.module.js +6 -5
- package/dist/getScrollParents.module.js.map +1 -1
- package/dist/import.mjs +2 -2
- package/dist/isScrollable.main.js +3 -0
- package/dist/isScrollable.main.js.map +1 -1
- package/dist/isScrollable.mjs +3 -0
- package/dist/isScrollable.module.js +3 -0
- package/dist/isScrollable.module.js.map +1 -1
- package/dist/main.js +1 -0
- package/dist/main.js.map +1 -1
- package/dist/module.js +2 -2
- package/dist/module.js.map +1 -1
- package/dist/runAfterTransition.main.js +13 -8
- package/dist/runAfterTransition.main.js.map +1 -1
- package/dist/runAfterTransition.mjs +13 -8
- package/dist/runAfterTransition.module.js +13 -8
- package/dist/runAfterTransition.module.js.map +1 -1
- package/dist/scrollIntoView.main.js +86 -53
- package/dist/scrollIntoView.main.js.map +1 -1
- package/dist/scrollIntoView.mjs +86 -53
- package/dist/scrollIntoView.module.js +86 -53
- package/dist/scrollIntoView.module.js.map +1 -1
- package/dist/types.d.ts +17 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/useDrag1D.main.js +2 -2
- package/dist/useDrag1D.main.js.map +1 -1
- package/dist/useDrag1D.mjs +2 -2
- package/dist/useDrag1D.module.js +2 -2
- package/dist/useDrag1D.module.js.map +1 -1
- package/dist/useViewportSize.main.js +9 -4
- package/dist/useViewportSize.main.js.map +1 -1
- package/dist/useViewportSize.mjs +9 -4
- package/dist/useViewportSize.module.js +9 -4
- package/dist/useViewportSize.module.js.map +1 -1
- package/package.json +3 -3
- package/src/getScrollParents.ts +6 -5
- package/src/index.ts +1 -1
- package/src/isScrollable.ts +6 -0
- package/src/runAfterTransition.ts +11 -8
- package/src/scrollIntoView.ts +110 -71
- package/src/shadowdom/DOMFunctions.ts +38 -9
- package/src/useDrag1D.ts +2 -2
- package/src/useViewportSize.ts +11 -4
|
@@ -9,8 +9,9 @@ function $parcel$export(e, n, v, s) {
|
|
|
9
9
|
$parcel$export(module.exports, "nodeContains", () => $d723bea02f3e2567$export$4282f70798064fe0);
|
|
10
10
|
$parcel$export(module.exports, "getActiveElement", () => $d723bea02f3e2567$export$cd4e5573fbe2b576);
|
|
11
11
|
$parcel$export(module.exports, "getEventTarget", () => $d723bea02f3e2567$export$e58f029f0fbfdb29);
|
|
12
|
+
$parcel$export(module.exports, "isFocusWithin", () => $d723bea02f3e2567$export$b4f377a2b6254582);
|
|
12
13
|
// Source: https://github.com/microsoft/tabster/blob/a89fc5d7e332d48f68d03b1ca6e344489d1c3898/src/Shadowdomize/DOMFunctions.ts#L16
|
|
13
|
-
/* eslint-disable rsp-rules/no-non-shadow-contains */
|
|
14
|
+
/* eslint-disable rsp-rules/no-non-shadow-contains, rsp-rules/safe-event-target */
|
|
14
15
|
|
|
15
16
|
function $d723bea02f3e2567$export$4282f70798064fe0(node, otherNode) {
|
|
16
17
|
if (!(0, $loak6$reactstatelyflags.shadowDOM)()) return otherNode && node ? node.contains(otherNode) : false;
|
|
@@ -34,11 +35,23 @@ const $d723bea02f3e2567$export$cd4e5573fbe2b576 = (doc = document)=>{
|
|
|
34
35
|
return activeElement;
|
|
35
36
|
};
|
|
36
37
|
function $d723bea02f3e2567$export$e58f029f0fbfdb29(event) {
|
|
37
|
-
if ((0, $loak6$reactstatelyflags.shadowDOM)() && event.target.shadowRoot) {
|
|
38
|
-
|
|
38
|
+
if ((0, $loak6$reactstatelyflags.shadowDOM)() && event.target instanceof Element && event.target.shadowRoot) {
|
|
39
|
+
var _event_composedPath_, _event_nativeEvent_composedPath_;
|
|
40
|
+
if ('composedPath' in event) return (_event_composedPath_ = event.composedPath()[0]) !== null && _event_composedPath_ !== void 0 ? _event_composedPath_ : null;
|
|
41
|
+
else if ('composedPath' in event.nativeEvent) return (_event_nativeEvent_composedPath_ = event.nativeEvent.composedPath()[0]) !== null && _event_nativeEvent_composedPath_ !== void 0 ? _event_nativeEvent_composedPath_ : null;
|
|
39
42
|
}
|
|
40
43
|
return event.target;
|
|
41
44
|
}
|
|
45
|
+
function $d723bea02f3e2567$export$b4f377a2b6254582(node) {
|
|
46
|
+
if (!node) return false;
|
|
47
|
+
// Get the active element within the node's parent shadow root (or the document). Can return null.
|
|
48
|
+
let root = node.getRootNode();
|
|
49
|
+
let ownerWindow = (0, $aaa611146751592e$exports.getOwnerWindow)(node);
|
|
50
|
+
if (!(root instanceof ownerWindow.Document || root instanceof ownerWindow.ShadowRoot)) return false;
|
|
51
|
+
let activeElement = root.activeElement;
|
|
52
|
+
// Check if the active element is within this node. These nodes are within the same shadow root.
|
|
53
|
+
return activeElement != null && node.contains(activeElement);
|
|
54
|
+
}
|
|
42
55
|
|
|
43
56
|
|
|
44
57
|
//# sourceMappingURL=DOMFunctions.main.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;;;;AAAA,kIAAkI;AAClI,gFAAgF;;AASzE,SAAS,0CACd,IAAuC,EACvC,SAA4C;IAE5C,IAAI,CAAC,CAAA,GAAA,kCAAQ,KACX,OAAO,aAAa,OAAO,KAAK,QAAQ,CAAC,aAAa;IAGxD,IAAI,CAAC,QAAQ,CAAC,WACZ,OAAO;IAGT,IAAI,cAAqD;IAEzD,MAAO,gBAAgB,KAAM;QAC3B,IAAI,gBAAgB,MAClB,OAAO;QAGT,IAAI,AAAC,YAAgC,OAAO,KAAK,UAC/C,AAAC,YAAgC,YAAY,EAC7C,qBAAqB;QACrB,cAAc,AAAC,YAAgC,YAAY,CAAE,UAAU;aAClE,IAAI,CAAA,GAAA,sCAAW,EAAE,cACtB,4BAA4B;QAC5B,cAAc,YAAY,IAAI;aAE9B,cAAc,YAAY,UAAU;IAExC;IAEA,OAAO;AACT;AAKO,MAAM,4CAAmB,CAAC,MAAgB,QAAQ;QAOvD;IANA,IAAI,CAAC,CAAA,GAAA,kCAAQ,KACX,OAAO,IAAI,aAAa;IAE1B,IAAI,gBAAgC,IAAI,aAAa;IAErD,MAAO,iBAAiB,gBAAgB,mBACxC,4BAAA,cAAc,UAAU,cAAxB,gDAAA,0BAA0B,aAAa,EACrC,gBAAgB,cAAc,UAAU,CAAC,aAAa;IAGxD,OAAO;AACT;AAUO,SAAS,0CAAiD,KAAQ;IACvE,IAAI,CAAA,GAAA,kCAAQ,OAAQ,MAAM,MAAM,YAAY,WAAY,MAAM,MAAM,CAAC,UAAU,EAAE;YAErE,sBAEA;QAHV,IAAI,kBAAkB,OACpB,OAAQ,CAAA,uBAAA,MAAM,YAAY,EAAE,CAAC,EAAE,cAAvB,kCAAA,uBAA2B;aAC9B,IAAI,kBAAkB,MAAM,WAAW,EAC5C,OAAQ,CAAA,mCAAA,MAAM,WAAW,CAAC,YAAY,EAAE,CAAC,EAAE,cAAnC,8CAAA,mCAAuC;IAEnD;IACA,OAAO,MAAM,MAAM;AACrB;AAOO,SAAS,0CAAc,IAAgC;IAC5D,IAAI,CAAC,MACH,OAAO;IAET,kGAAkG;IAClG,IAAI,OAAO,KAAK,WAAW;IAC3B,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;IACjC,IAAI,CAAE,CAAA,gBAAgB,YAAY,QAAQ,IAAI,gBAAgB,YAAY,UAAU,AAAD,GACjF,OAAO;IAET,IAAI,gBAAgB,KAAK,aAAa;IAEtC,gGAAgG;IAChG,OAAO,iBAAiB,QAAQ,KAAK,QAAQ,CAAC;AAChD","sources":["packages/@react-aria/utils/src/shadowdom/DOMFunctions.ts"],"sourcesContent":["// Source: https://github.com/microsoft/tabster/blob/a89fc5d7e332d48f68d03b1ca6e344489d1c3898/src/Shadowdomize/DOMFunctions.ts#L16\n/* eslint-disable rsp-rules/no-non-shadow-contains, rsp-rules/safe-event-target */\n\nimport {getOwnerWindow, isShadowRoot} from '../domHelpers';\nimport {shadowDOM} from '@react-stately/flags';\nimport type {SyntheticEvent} from 'react';\n\n/**\n * ShadowDOM safe version of Node.contains.\n */\nexport function nodeContains(\n node: Node | Element | null | undefined,\n otherNode: Node | Element | null | undefined\n): boolean {\n if (!shadowDOM()) {\n return otherNode && node ? node.contains(otherNode) : false;\n }\n\n if (!node || !otherNode) {\n return false;\n }\n\n let currentNode: HTMLElement | Node | null | undefined = otherNode;\n\n while (currentNode !== null) {\n if (currentNode === node) {\n return true;\n }\n\n if ((currentNode as HTMLSlotElement).tagName === 'SLOT' &&\n (currentNode as HTMLSlotElement).assignedSlot) {\n // Element is slotted\n currentNode = (currentNode as HTMLSlotElement).assignedSlot!.parentNode;\n } else if (isShadowRoot(currentNode)) {\n // Element is in shadow root\n currentNode = currentNode.host;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n\n return false;\n}\n\n/**\n * ShadowDOM safe version of document.activeElement.\n */\nexport const getActiveElement = (doc: Document = document): Element | null => {\n if (!shadowDOM()) {\n return doc.activeElement;\n }\n let activeElement: Element | null = doc.activeElement;\n\n while (activeElement && 'shadowRoot' in activeElement &&\n activeElement.shadowRoot?.activeElement) {\n activeElement = activeElement.shadowRoot.activeElement;\n }\n\n return activeElement;\n};\n\n// Type helper to extract the target element type from an event\ntype EventTargetType<T> = T extends SyntheticEvent<infer E, any> ? E : EventTarget;\n\n// Possibly we can improve the types for this using https://github.com/adobe/react-spectrum/pull/8991/changes#diff-2d491c0c91701d28d08e1cf9fcadbdb21a030b67ab681460c9934140f29127b8R68 but it was more changes than I\n// wanted to make to fix the function.\n/**\n * ShadowDOM safe version of event.target.\n */\nexport function getEventTarget<T extends Event | SyntheticEvent>(event: T): EventTargetType<T> {\n if (shadowDOM() && (event.target instanceof Element) && event.target.shadowRoot) {\n if ('composedPath' in event) {\n return (event.composedPath()[0] ?? null) as EventTargetType<T>;\n } else if ('composedPath' in event.nativeEvent) {\n return (event.nativeEvent.composedPath()[0] ?? null) as EventTargetType<T>;\n }\n }\n return event.target as EventTargetType<T>;\n}\n\n/**\n * ShadowDOM safe fast version of node.contains(document.activeElement).\n * @param node\n * @returns\n */\nexport function isFocusWithin(node: Element | null | undefined): boolean {\n if (!node) {\n return false;\n }\n // Get the active element within the node's parent shadow root (or the document). Can return null.\n let root = node.getRootNode();\n let ownerWindow = getOwnerWindow(node);\n if (!(root instanceof ownerWindow.Document || root instanceof ownerWindow.ShadowRoot)) {\n return false;\n }\n let activeElement = root.activeElement;\n\n // Check if the active element is within this node. These nodes are within the same shadow root.\n return activeElement != null && node.contains(activeElement);\n}\n"],"names":[],"version":3,"file":"DOMFunctions.main.js.map"}
|
package/dist/DOMFunctions.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {isShadowRoot as $431fbd86ca7dc216$export$af51f0f06c0f328a} from "./domHelpers.mjs";
|
|
1
|
+
import {getOwnerWindow as $431fbd86ca7dc216$export$f21a1ffae260145a, isShadowRoot as $431fbd86ca7dc216$export$af51f0f06c0f328a} from "./domHelpers.mjs";
|
|
2
2
|
import {shadowDOM as $lcSu5$shadowDOM} from "@react-stately/flags";
|
|
3
3
|
|
|
4
4
|
// Source: https://github.com/microsoft/tabster/blob/a89fc5d7e332d48f68d03b1ca6e344489d1c3898/src/Shadowdomize/DOMFunctions.ts#L16
|
|
5
|
-
/* eslint-disable rsp-rules/no-non-shadow-contains */
|
|
5
|
+
/* eslint-disable rsp-rules/no-non-shadow-contains, rsp-rules/safe-event-target */
|
|
6
6
|
|
|
7
7
|
function $d4ee10de306f2510$export$4282f70798064fe0(node, otherNode) {
|
|
8
8
|
if (!(0, $lcSu5$shadowDOM)()) return otherNode && node ? node.contains(otherNode) : false;
|
|
@@ -26,12 +26,24 @@ const $d4ee10de306f2510$export$cd4e5573fbe2b576 = (doc = document)=>{
|
|
|
26
26
|
return activeElement;
|
|
27
27
|
};
|
|
28
28
|
function $d4ee10de306f2510$export$e58f029f0fbfdb29(event) {
|
|
29
|
-
if ((0, $lcSu5$shadowDOM)() && event.target.shadowRoot) {
|
|
30
|
-
|
|
29
|
+
if ((0, $lcSu5$shadowDOM)() && event.target instanceof Element && event.target.shadowRoot) {
|
|
30
|
+
var _event_composedPath_, _event_nativeEvent_composedPath_;
|
|
31
|
+
if ('composedPath' in event) return (_event_composedPath_ = event.composedPath()[0]) !== null && _event_composedPath_ !== void 0 ? _event_composedPath_ : null;
|
|
32
|
+
else if ('composedPath' in event.nativeEvent) return (_event_nativeEvent_composedPath_ = event.nativeEvent.composedPath()[0]) !== null && _event_nativeEvent_composedPath_ !== void 0 ? _event_nativeEvent_composedPath_ : null;
|
|
31
33
|
}
|
|
32
34
|
return event.target;
|
|
33
35
|
}
|
|
36
|
+
function $d4ee10de306f2510$export$b4f377a2b6254582(node) {
|
|
37
|
+
if (!node) return false;
|
|
38
|
+
// Get the active element within the node's parent shadow root (or the document). Can return null.
|
|
39
|
+
let root = node.getRootNode();
|
|
40
|
+
let ownerWindow = (0, $431fbd86ca7dc216$export$f21a1ffae260145a)(node);
|
|
41
|
+
if (!(root instanceof ownerWindow.Document || root instanceof ownerWindow.ShadowRoot)) return false;
|
|
42
|
+
let activeElement = root.activeElement;
|
|
43
|
+
// Check if the active element is within this node. These nodes are within the same shadow root.
|
|
44
|
+
return activeElement != null && node.contains(activeElement);
|
|
45
|
+
}
|
|
34
46
|
|
|
35
47
|
|
|
36
|
-
export {$d4ee10de306f2510$export$4282f70798064fe0 as nodeContains, $d4ee10de306f2510$export$cd4e5573fbe2b576 as getActiveElement, $d4ee10de306f2510$export$e58f029f0fbfdb29 as getEventTarget};
|
|
48
|
+
export {$d4ee10de306f2510$export$4282f70798064fe0 as nodeContains, $d4ee10de306f2510$export$cd4e5573fbe2b576 as getActiveElement, $d4ee10de306f2510$export$e58f029f0fbfdb29 as getEventTarget, $d4ee10de306f2510$export$b4f377a2b6254582 as isFocusWithin};
|
|
37
49
|
//# sourceMappingURL=DOMFunctions.module.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {isShadowRoot as $431fbd86ca7dc216$export$af51f0f06c0f328a} from "./domHelpers.module.js";
|
|
1
|
+
import {getOwnerWindow as $431fbd86ca7dc216$export$f21a1ffae260145a, isShadowRoot as $431fbd86ca7dc216$export$af51f0f06c0f328a} from "./domHelpers.module.js";
|
|
2
2
|
import {shadowDOM as $lcSu5$shadowDOM} from "@react-stately/flags";
|
|
3
3
|
|
|
4
4
|
// Source: https://github.com/microsoft/tabster/blob/a89fc5d7e332d48f68d03b1ca6e344489d1c3898/src/Shadowdomize/DOMFunctions.ts#L16
|
|
5
|
-
/* eslint-disable rsp-rules/no-non-shadow-contains */
|
|
5
|
+
/* eslint-disable rsp-rules/no-non-shadow-contains, rsp-rules/safe-event-target */
|
|
6
6
|
|
|
7
7
|
function $d4ee10de306f2510$export$4282f70798064fe0(node, otherNode) {
|
|
8
8
|
if (!(0, $lcSu5$shadowDOM)()) return otherNode && node ? node.contains(otherNode) : false;
|
|
@@ -26,12 +26,24 @@ const $d4ee10de306f2510$export$cd4e5573fbe2b576 = (doc = document)=>{
|
|
|
26
26
|
return activeElement;
|
|
27
27
|
};
|
|
28
28
|
function $d4ee10de306f2510$export$e58f029f0fbfdb29(event) {
|
|
29
|
-
if ((0, $lcSu5$shadowDOM)() && event.target.shadowRoot) {
|
|
30
|
-
|
|
29
|
+
if ((0, $lcSu5$shadowDOM)() && event.target instanceof Element && event.target.shadowRoot) {
|
|
30
|
+
var _event_composedPath_, _event_nativeEvent_composedPath_;
|
|
31
|
+
if ('composedPath' in event) return (_event_composedPath_ = event.composedPath()[0]) !== null && _event_composedPath_ !== void 0 ? _event_composedPath_ : null;
|
|
32
|
+
else if ('composedPath' in event.nativeEvent) return (_event_nativeEvent_composedPath_ = event.nativeEvent.composedPath()[0]) !== null && _event_nativeEvent_composedPath_ !== void 0 ? _event_nativeEvent_composedPath_ : null;
|
|
31
33
|
}
|
|
32
34
|
return event.target;
|
|
33
35
|
}
|
|
36
|
+
function $d4ee10de306f2510$export$b4f377a2b6254582(node) {
|
|
37
|
+
if (!node) return false;
|
|
38
|
+
// Get the active element within the node's parent shadow root (or the document). Can return null.
|
|
39
|
+
let root = node.getRootNode();
|
|
40
|
+
let ownerWindow = (0, $431fbd86ca7dc216$export$f21a1ffae260145a)(node);
|
|
41
|
+
if (!(root instanceof ownerWindow.Document || root instanceof ownerWindow.ShadowRoot)) return false;
|
|
42
|
+
let activeElement = root.activeElement;
|
|
43
|
+
// Check if the active element is within this node. These nodes are within the same shadow root.
|
|
44
|
+
return activeElement != null && node.contains(activeElement);
|
|
45
|
+
}
|
|
34
46
|
|
|
35
47
|
|
|
36
|
-
export {$d4ee10de306f2510$export$4282f70798064fe0 as nodeContains, $d4ee10de306f2510$export$cd4e5573fbe2b576 as getActiveElement, $d4ee10de306f2510$export$e58f029f0fbfdb29 as getEventTarget};
|
|
48
|
+
export {$d4ee10de306f2510$export$4282f70798064fe0 as nodeContains, $d4ee10de306f2510$export$cd4e5573fbe2b576 as getActiveElement, $d4ee10de306f2510$export$e58f029f0fbfdb29 as getEventTarget, $d4ee10de306f2510$export$b4f377a2b6254582 as isFocusWithin};
|
|
37
49
|
//# sourceMappingURL=DOMFunctions.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;AAAA,kIAAkI;AAClI,
|
|
1
|
+
{"mappings":";;;AAAA,kIAAkI;AAClI,gFAAgF;;AASzE,SAAS,0CACd,IAAuC,EACvC,SAA4C;IAE5C,IAAI,CAAC,CAAA,GAAA,gBAAQ,KACX,OAAO,aAAa,OAAO,KAAK,QAAQ,CAAC,aAAa;IAGxD,IAAI,CAAC,QAAQ,CAAC,WACZ,OAAO;IAGT,IAAI,cAAqD;IAEzD,MAAO,gBAAgB,KAAM;QAC3B,IAAI,gBAAgB,MAClB,OAAO;QAGT,IAAI,AAAC,YAAgC,OAAO,KAAK,UAC/C,AAAC,YAAgC,YAAY,EAC7C,qBAAqB;QACrB,cAAc,AAAC,YAAgC,YAAY,CAAE,UAAU;aAClE,IAAI,CAAA,GAAA,yCAAW,EAAE,cACtB,4BAA4B;QAC5B,cAAc,YAAY,IAAI;aAE9B,cAAc,YAAY,UAAU;IAExC;IAEA,OAAO;AACT;AAKO,MAAM,4CAAmB,CAAC,MAAgB,QAAQ;QAOvD;IANA,IAAI,CAAC,CAAA,GAAA,gBAAQ,KACX,OAAO,IAAI,aAAa;IAE1B,IAAI,gBAAgC,IAAI,aAAa;IAErD,MAAO,iBAAiB,gBAAgB,mBACxC,4BAAA,cAAc,UAAU,cAAxB,gDAAA,0BAA0B,aAAa,EACrC,gBAAgB,cAAc,UAAU,CAAC,aAAa;IAGxD,OAAO;AACT;AAUO,SAAS,0CAAiD,KAAQ;IACvE,IAAI,CAAA,GAAA,gBAAQ,OAAQ,MAAM,MAAM,YAAY,WAAY,MAAM,MAAM,CAAC,UAAU,EAAE;YAErE,sBAEA;QAHV,IAAI,kBAAkB,OACpB,OAAQ,CAAA,uBAAA,MAAM,YAAY,EAAE,CAAC,EAAE,cAAvB,kCAAA,uBAA2B;aAC9B,IAAI,kBAAkB,MAAM,WAAW,EAC5C,OAAQ,CAAA,mCAAA,MAAM,WAAW,CAAC,YAAY,EAAE,CAAC,EAAE,cAAnC,8CAAA,mCAAuC;IAEnD;IACA,OAAO,MAAM,MAAM;AACrB;AAOO,SAAS,0CAAc,IAAgC;IAC5D,IAAI,CAAC,MACH,OAAO;IAET,kGAAkG;IAClG,IAAI,OAAO,KAAK,WAAW;IAC3B,IAAI,cAAc,CAAA,GAAA,yCAAa,EAAE;IACjC,IAAI,CAAE,CAAA,gBAAgB,YAAY,QAAQ,IAAI,gBAAgB,YAAY,UAAU,AAAD,GACjF,OAAO;IAET,IAAI,gBAAgB,KAAK,aAAa;IAEtC,gGAAgG;IAChG,OAAO,iBAAiB,QAAQ,KAAK,QAAQ,CAAC;AAChD","sources":["packages/@react-aria/utils/src/shadowdom/DOMFunctions.ts"],"sourcesContent":["// Source: https://github.com/microsoft/tabster/blob/a89fc5d7e332d48f68d03b1ca6e344489d1c3898/src/Shadowdomize/DOMFunctions.ts#L16\n/* eslint-disable rsp-rules/no-non-shadow-contains, rsp-rules/safe-event-target */\n\nimport {getOwnerWindow, isShadowRoot} from '../domHelpers';\nimport {shadowDOM} from '@react-stately/flags';\nimport type {SyntheticEvent} from 'react';\n\n/**\n * ShadowDOM safe version of Node.contains.\n */\nexport function nodeContains(\n node: Node | Element | null | undefined,\n otherNode: Node | Element | null | undefined\n): boolean {\n if (!shadowDOM()) {\n return otherNode && node ? node.contains(otherNode) : false;\n }\n\n if (!node || !otherNode) {\n return false;\n }\n\n let currentNode: HTMLElement | Node | null | undefined = otherNode;\n\n while (currentNode !== null) {\n if (currentNode === node) {\n return true;\n }\n\n if ((currentNode as HTMLSlotElement).tagName === 'SLOT' &&\n (currentNode as HTMLSlotElement).assignedSlot) {\n // Element is slotted\n currentNode = (currentNode as HTMLSlotElement).assignedSlot!.parentNode;\n } else if (isShadowRoot(currentNode)) {\n // Element is in shadow root\n currentNode = currentNode.host;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n\n return false;\n}\n\n/**\n * ShadowDOM safe version of document.activeElement.\n */\nexport const getActiveElement = (doc: Document = document): Element | null => {\n if (!shadowDOM()) {\n return doc.activeElement;\n }\n let activeElement: Element | null = doc.activeElement;\n\n while (activeElement && 'shadowRoot' in activeElement &&\n activeElement.shadowRoot?.activeElement) {\n activeElement = activeElement.shadowRoot.activeElement;\n }\n\n return activeElement;\n};\n\n// Type helper to extract the target element type from an event\ntype EventTargetType<T> = T extends SyntheticEvent<infer E, any> ? E : EventTarget;\n\n// Possibly we can improve the types for this using https://github.com/adobe/react-spectrum/pull/8991/changes#diff-2d491c0c91701d28d08e1cf9fcadbdb21a030b67ab681460c9934140f29127b8R68 but it was more changes than I\n// wanted to make to fix the function.\n/**\n * ShadowDOM safe version of event.target.\n */\nexport function getEventTarget<T extends Event | SyntheticEvent>(event: T): EventTargetType<T> {\n if (shadowDOM() && (event.target instanceof Element) && event.target.shadowRoot) {\n if ('composedPath' in event) {\n return (event.composedPath()[0] ?? null) as EventTargetType<T>;\n } else if ('composedPath' in event.nativeEvent) {\n return (event.nativeEvent.composedPath()[0] ?? null) as EventTargetType<T>;\n }\n }\n return event.target as EventTargetType<T>;\n}\n\n/**\n * ShadowDOM safe fast version of node.contains(document.activeElement).\n * @param node\n * @returns\n */\nexport function isFocusWithin(node: Element | null | undefined): boolean {\n if (!node) {\n return false;\n }\n // Get the active element within the node's parent shadow root (or the document). Can return null.\n let root = node.getRootNode();\n let ownerWindow = getOwnerWindow(node);\n if (!(root instanceof ownerWindow.Document || root instanceof ownerWindow.ShadowRoot)) {\n return false;\n }\n let activeElement = root.activeElement;\n\n // Check if the active element is within this node. These nodes are within the same shadow root.\n return activeElement != null && node.contains(activeElement);\n}\n"],"names":[],"version":3,"file":"DOMFunctions.module.js.map"}
|
|
@@ -18,12 +18,13 @@ $parcel$export(module.exports, "getScrollParents", () => $49f0d9486c2408aa$expor
|
|
|
18
18
|
* governing permissions and limitations under the License.
|
|
19
19
|
*/
|
|
20
20
|
function $49f0d9486c2408aa$export$94ed1c92c7beeb22(node, checkForOverflow) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
let parentElements = [];
|
|
22
|
+
let root = document.scrollingElement || document.documentElement;
|
|
23
|
+
do {
|
|
24
|
+
if ((0, $9a54e9cd5db23b5d$exports.isScrollable)(node, checkForOverflow)) parentElements.push(node);
|
|
24
25
|
node = node.parentElement;
|
|
25
|
-
}
|
|
26
|
-
return
|
|
26
|
+
}while (node && node !== root);
|
|
27
|
+
return parentElements;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;AAIM,SAAS,0CAAiB,IAAa,EAAE,gBAA0B;IACxE,
|
|
1
|
+
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;AAIM,SAAS,0CAAiB,IAAa,EAAE,gBAA0B;IACxE,IAAI,iBAA4B,EAAE;IAClC,IAAI,OAAO,SAAS,gBAAgB,IAAI,SAAS,eAAe;IAEhE,GAAG;QACD,IAAI,CAAA,GAAA,sCAAW,EAAE,MAAM,mBACrB,eAAe,IAAI,CAAC;QAEtB,OAAO,KAAK,aAAa;IAC3B,QAAS,QAAQ,SAAS,MAAM;IAEhC,OAAO;AACT","sources":["packages/@react-aria/utils/src/getScrollParents.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {isScrollable} from './isScrollable';\n\nexport function getScrollParents(node: Element, checkForOverflow?: boolean): Element[] {\n let parentElements: Element[] = [];\n let root = document.scrollingElement || document.documentElement;\n\n do {\n if (isScrollable(node, checkForOverflow)) {\n parentElements.push(node);\n }\n node = node.parentElement as Element;\n } while (node && node !== root);\n\n return parentElements;\n}\n"],"names":[],"version":3,"file":"getScrollParents.main.js.map"}
|
|
@@ -12,12 +12,13 @@ import {isScrollable as $cc38e7bd3fc7b213$export$2bb74740c4e19def} from "./isScr
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
function $a40c673dc9f6d9c7$export$94ed1c92c7beeb22(node, checkForOverflow) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
let parentElements = [];
|
|
16
|
+
let root = document.scrollingElement || document.documentElement;
|
|
17
|
+
do {
|
|
18
|
+
if ((0, $cc38e7bd3fc7b213$export$2bb74740c4e19def)(node, checkForOverflow)) parentElements.push(node);
|
|
18
19
|
node = node.parentElement;
|
|
19
|
-
}
|
|
20
|
-
return
|
|
20
|
+
}while (node && node !== root);
|
|
21
|
+
return parentElements;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
|
|
@@ -12,12 +12,13 @@ import {isScrollable as $cc38e7bd3fc7b213$export$2bb74740c4e19def} from "./isScr
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
function $a40c673dc9f6d9c7$export$94ed1c92c7beeb22(node, checkForOverflow) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
let parentElements = [];
|
|
16
|
+
let root = document.scrollingElement || document.documentElement;
|
|
17
|
+
do {
|
|
18
|
+
if ((0, $cc38e7bd3fc7b213$export$2bb74740c4e19def)(node, checkForOverflow)) parentElements.push(node);
|
|
18
19
|
node = node.parentElement;
|
|
19
|
-
}
|
|
20
|
-
return
|
|
20
|
+
}while (node && node !== root);
|
|
21
|
+
return parentElements;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;AAAA;;;;;;;;;;CAUC;AAIM,SAAS,0CAAiB,IAAa,EAAE,gBAA0B;IACxE,
|
|
1
|
+
{"mappings":";;AAAA;;;;;;;;;;CAUC;AAIM,SAAS,0CAAiB,IAAa,EAAE,gBAA0B;IACxE,IAAI,iBAA4B,EAAE;IAClC,IAAI,OAAO,SAAS,gBAAgB,IAAI,SAAS,eAAe;IAEhE,GAAG;QACD,IAAI,CAAA,GAAA,yCAAW,EAAE,MAAM,mBACrB,eAAe,IAAI,CAAC;QAEtB,OAAO,KAAK,aAAa;IAC3B,QAAS,QAAQ,SAAS,MAAM;IAEhC,OAAO;AACT","sources":["packages/@react-aria/utils/src/getScrollParents.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {isScrollable} from './isScrollable';\n\nexport function getScrollParents(node: Element, checkForOverflow?: boolean): Element[] {\n let parentElements: Element[] = [];\n let root = document.scrollingElement || document.documentElement;\n\n do {\n if (isScrollable(node, checkForOverflow)) {\n parentElements.push(node);\n }\n node = node.parentElement as Element;\n } while (node && node !== root);\n\n return parentElements;\n}\n"],"names":[],"version":3,"file":"getScrollParents.module.js.map"}
|
package/dist/import.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {mergeIds as $bdb11010cef70236$export$cd8c9cb68f842629, useId as $bdb11010cef70236$export$f680877a34711e37, useSlotId as $bdb11010cef70236$export$b4cc09c592e8fdb8} from "./useId.mjs";
|
|
2
2
|
import {chain as $ff5963eb1fccf552$export$e08e3b67e392101e} from "./chain.mjs";
|
|
3
3
|
import {createShadowTreeWalker as $dfc540311bf7f109$export$4d0f8be8b12a7ef6, ShadowTreeWalker as $dfc540311bf7f109$export$63eb3ababa9c55c4} from "./ShadowTreeWalker.mjs";
|
|
4
|
-
import {getActiveElement as $d4ee10de306f2510$export$cd4e5573fbe2b576, getEventTarget as $d4ee10de306f2510$export$e58f029f0fbfdb29, nodeContains as $d4ee10de306f2510$export$4282f70798064fe0} from "./DOMFunctions.mjs";
|
|
4
|
+
import {getActiveElement as $d4ee10de306f2510$export$cd4e5573fbe2b576, getEventTarget as $d4ee10de306f2510$export$e58f029f0fbfdb29, isFocusWithin as $d4ee10de306f2510$export$b4f377a2b6254582, nodeContains as $d4ee10de306f2510$export$4282f70798064fe0} from "./DOMFunctions.mjs";
|
|
5
5
|
import {getOwnerDocument as $431fbd86ca7dc216$export$b204af158042fbac, getOwnerWindow as $431fbd86ca7dc216$export$f21a1ffae260145a, isShadowRoot as $431fbd86ca7dc216$export$af51f0f06c0f328a} from "./domHelpers.mjs";
|
|
6
6
|
import {mergeProps as $3ef42575df84b30b$export$9d1611c77c2fe928} from "./mergeProps.mjs";
|
|
7
7
|
import {mergeRefs as $5dc95899b306f630$export$c9058316764c140e} from "./mergeRefs.mjs";
|
|
@@ -95,5 +95,5 @@ import {clamp as $4507461a1b870123$re_export$clamp, snapValueToStep as $4507461a
|
|
|
95
95
|
|
|
96
96
|
|
|
97
97
|
|
|
98
|
-
export {$bdb11010cef70236$export$f680877a34711e37 as useId, $bdb11010cef70236$export$cd8c9cb68f842629 as mergeIds, $bdb11010cef70236$export$b4cc09c592e8fdb8 as useSlotId, $ff5963eb1fccf552$export$e08e3b67e392101e as chain, $dfc540311bf7f109$export$4d0f8be8b12a7ef6 as createShadowTreeWalker, $dfc540311bf7f109$export$63eb3ababa9c55c4 as ShadowTreeWalker, $d4ee10de306f2510$export$cd4e5573fbe2b576 as getActiveElement, $d4ee10de306f2510$export$e58f029f0fbfdb29 as getEventTarget, $d4ee10de306f2510$export$4282f70798064fe0 as nodeContains, $431fbd86ca7dc216$export$b204af158042fbac as getOwnerDocument, $431fbd86ca7dc216$export$f21a1ffae260145a as getOwnerWindow, $431fbd86ca7dc216$export$af51f0f06c0f328a as isShadowRoot, $3ef42575df84b30b$export$9d1611c77c2fe928 as mergeProps, $5dc95899b306f630$export$c9058316764c140e as mergeRefs, $65484d02dcb7eb3e$export$457c3d6518dd4c6f as filterDOMProps, $7215afc6de606d6b$export$de79e2c695e052f3 as focusWithoutScrolling, $ab71dadb03a6fb2e$export$622cea445a1c5b7d as getOffset, $ea8dcbcb9ea1b556$export$95185d699e05d4d7 as openLink, $ea8dcbcb9ea1b556$export$51437d503373d223 as getSyntheticLinkProps, $ea8dcbcb9ea1b556$export$bdc77b0c0a3a85d6 as useSyntheticLinkProps, $ea8dcbcb9ea1b556$export$323e4fc2fa4753fb as RouterProvider, $ea8dcbcb9ea1b556$export$efa8c9099e530235 as shouldClientNavigate, $ea8dcbcb9ea1b556$export$9a302a45f65d0572 as useRouter, $ea8dcbcb9ea1b556$export$7e924b3091a3bd18 as useLinkProps, $ea8dcbcb9ea1b556$export$13aea1a3cb5e3f1f as handleLinkClick, $bbed8b41f857bcc0$export$24490316f764c430 as runAfterTransition, $9cc09df9fd7676be$export$7bbed75feba39706 as useDrag1D, $03deb23ff14920c4$export$4eaf04e54aa8eed6 as useGlobalListeners, $313b98861ee5dd6c$export$d6875122194c7b44 as useLabels, $df56164dff5785e2$export$4338b53315abf666 as useObjectRef, $4f58c5f72bcf79f7$export$496315a1608d9602 as useUpdateEffect, $ca9b37712f007381$export$72ef708ab07251f1 as useUpdateLayoutEffect, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c as useLayoutEffect, $9daab02d461809db$export$683480f191c0e3ea as useResizeObserver, $e7801be82b4b2a53$export$4debdb1a3f0fa79e as useSyncRef, $62d8ded9296f3872$export$cfa2225e87938781 as getScrollParent, $a40c673dc9f6d9c7$export$94ed1c92c7beeb22 as getScrollParents, $cc38e7bd3fc7b213$export$2bb74740c4e19def as isScrollable, $5df64b3807dc15ee$export$d699905dd57c73ca as useViewportSize, $ef06256079686ba0$export$f8aeda7b10753fa1 as useDescription, $c87311424ea30a05$export$9ac100e40613ea10 as isMac, $c87311424ea30a05$export$186c6964ca17d99 as isIPhone, $c87311424ea30a05$export$7bef049ce92e4224 as isIPad, $c87311424ea30a05$export$fedb369cb70207f1 as isIOS, $c87311424ea30a05$export$e1865c3bedcd822b as isAppleDevice, $c87311424ea30a05$export$78551043582a6a98 as isWebKit, $c87311424ea30a05$export$6446a186d09e379e as isChrome, $c87311424ea30a05$export$a11b0059900ceec8 as isAndroid, $c87311424ea30a05$export$b7d78993b74f766d as isFirefox, $e9faafb641e167db$export$90fc3a17d93f704c as useEvent, $1dbecbe27a04f9af$export$14d238f342723f25 as useValueEffect, $2f04cbc44ee30ce0$export$53a0910f038337bd as scrollIntoView, $2f04cbc44ee30ce0$export$c826860796309d1b as scrollIntoViewport, $4507461a1b870123$re_export$clamp as clamp, $4507461a1b870123$re_export$snapValueToStep as snapValueToStep, $6a7db85432448f7f$export$60278871457622de as isVirtualClick, $6a7db85432448f7f$export$29bf1b5f2c56cf63 as isVirtualPointerEvent, $8ae05eaa5c114e9c$export$7f54fc3180508a52 as useEffectEvent, $5a387cc49350e6db$export$722debc0e56fea39 as useDeepMemo, $99facab73266f662$export$5add1d006293d136 as useFormReset, $26f7f3da73fcd9d6$export$7717c92ee915373e as useLoadMore, $a5fa973c1850dd36$export$ccaea96c28e8b9e7 as useLoadMoreSentinel, $a5fa973c1850dd36$export$ccaea96c28e8b9e7 as UNSTABLE_useLoadMoreSentinel, $cdc5a6778b766db2$export$a9d04c5684123369 as inertValue, $5671b20cf9b562b2$export$447a38995de2c711 as CLEAR_FOCUS_EVENT, $5671b20cf9b562b2$export$831c820ad60f9d12 as FOCUS_EVENT, $21f1aa98acb08317$export$16792effe837dba3 as isCtrlKeyPressed, $21f1aa98acb08317$export$c57958e35f31ed73 as willOpenKeyboard, $d3f049242431219c$export$6d3443f2c48bfc20 as useEnterAnimation, $d3f049242431219c$export$45fda7c47f93fd48 as useExitAnimation, $b4b717babfbb907b$export$4c063cf1350e6fed as isFocusable, $b4b717babfbb907b$export$bebd5a1431fec25d as isTabbable};
|
|
98
|
+
export {$bdb11010cef70236$export$f680877a34711e37 as useId, $bdb11010cef70236$export$cd8c9cb68f842629 as mergeIds, $bdb11010cef70236$export$b4cc09c592e8fdb8 as useSlotId, $ff5963eb1fccf552$export$e08e3b67e392101e as chain, $dfc540311bf7f109$export$4d0f8be8b12a7ef6 as createShadowTreeWalker, $dfc540311bf7f109$export$63eb3ababa9c55c4 as ShadowTreeWalker, $d4ee10de306f2510$export$cd4e5573fbe2b576 as getActiveElement, $d4ee10de306f2510$export$e58f029f0fbfdb29 as getEventTarget, $d4ee10de306f2510$export$4282f70798064fe0 as nodeContains, $d4ee10de306f2510$export$b4f377a2b6254582 as isFocusWithin, $431fbd86ca7dc216$export$b204af158042fbac as getOwnerDocument, $431fbd86ca7dc216$export$f21a1ffae260145a as getOwnerWindow, $431fbd86ca7dc216$export$af51f0f06c0f328a as isShadowRoot, $3ef42575df84b30b$export$9d1611c77c2fe928 as mergeProps, $5dc95899b306f630$export$c9058316764c140e as mergeRefs, $65484d02dcb7eb3e$export$457c3d6518dd4c6f as filterDOMProps, $7215afc6de606d6b$export$de79e2c695e052f3 as focusWithoutScrolling, $ab71dadb03a6fb2e$export$622cea445a1c5b7d as getOffset, $ea8dcbcb9ea1b556$export$95185d699e05d4d7 as openLink, $ea8dcbcb9ea1b556$export$51437d503373d223 as getSyntheticLinkProps, $ea8dcbcb9ea1b556$export$bdc77b0c0a3a85d6 as useSyntheticLinkProps, $ea8dcbcb9ea1b556$export$323e4fc2fa4753fb as RouterProvider, $ea8dcbcb9ea1b556$export$efa8c9099e530235 as shouldClientNavigate, $ea8dcbcb9ea1b556$export$9a302a45f65d0572 as useRouter, $ea8dcbcb9ea1b556$export$7e924b3091a3bd18 as useLinkProps, $ea8dcbcb9ea1b556$export$13aea1a3cb5e3f1f as handleLinkClick, $bbed8b41f857bcc0$export$24490316f764c430 as runAfterTransition, $9cc09df9fd7676be$export$7bbed75feba39706 as useDrag1D, $03deb23ff14920c4$export$4eaf04e54aa8eed6 as useGlobalListeners, $313b98861ee5dd6c$export$d6875122194c7b44 as useLabels, $df56164dff5785e2$export$4338b53315abf666 as useObjectRef, $4f58c5f72bcf79f7$export$496315a1608d9602 as useUpdateEffect, $ca9b37712f007381$export$72ef708ab07251f1 as useUpdateLayoutEffect, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c as useLayoutEffect, $9daab02d461809db$export$683480f191c0e3ea as useResizeObserver, $e7801be82b4b2a53$export$4debdb1a3f0fa79e as useSyncRef, $62d8ded9296f3872$export$cfa2225e87938781 as getScrollParent, $a40c673dc9f6d9c7$export$94ed1c92c7beeb22 as getScrollParents, $cc38e7bd3fc7b213$export$2bb74740c4e19def as isScrollable, $5df64b3807dc15ee$export$d699905dd57c73ca as useViewportSize, $ef06256079686ba0$export$f8aeda7b10753fa1 as useDescription, $c87311424ea30a05$export$9ac100e40613ea10 as isMac, $c87311424ea30a05$export$186c6964ca17d99 as isIPhone, $c87311424ea30a05$export$7bef049ce92e4224 as isIPad, $c87311424ea30a05$export$fedb369cb70207f1 as isIOS, $c87311424ea30a05$export$e1865c3bedcd822b as isAppleDevice, $c87311424ea30a05$export$78551043582a6a98 as isWebKit, $c87311424ea30a05$export$6446a186d09e379e as isChrome, $c87311424ea30a05$export$a11b0059900ceec8 as isAndroid, $c87311424ea30a05$export$b7d78993b74f766d as isFirefox, $e9faafb641e167db$export$90fc3a17d93f704c as useEvent, $1dbecbe27a04f9af$export$14d238f342723f25 as useValueEffect, $2f04cbc44ee30ce0$export$53a0910f038337bd as scrollIntoView, $2f04cbc44ee30ce0$export$c826860796309d1b as scrollIntoViewport, $4507461a1b870123$re_export$clamp as clamp, $4507461a1b870123$re_export$snapValueToStep as snapValueToStep, $6a7db85432448f7f$export$60278871457622de as isVirtualClick, $6a7db85432448f7f$export$29bf1b5f2c56cf63 as isVirtualPointerEvent, $8ae05eaa5c114e9c$export$7f54fc3180508a52 as useEffectEvent, $5a387cc49350e6db$export$722debc0e56fea39 as useDeepMemo, $99facab73266f662$export$5add1d006293d136 as useFormReset, $26f7f3da73fcd9d6$export$7717c92ee915373e as useLoadMore, $a5fa973c1850dd36$export$ccaea96c28e8b9e7 as useLoadMoreSentinel, $a5fa973c1850dd36$export$ccaea96c28e8b9e7 as UNSTABLE_useLoadMoreSentinel, $cdc5a6778b766db2$export$a9d04c5684123369 as inertValue, $5671b20cf9b562b2$export$447a38995de2c711 as CLEAR_FOCUS_EVENT, $5671b20cf9b562b2$export$831c820ad60f9d12 as FOCUS_EVENT, $21f1aa98acb08317$export$16792effe837dba3 as isCtrlKeyPressed, $21f1aa98acb08317$export$c57958e35f31ed73 as willOpenKeyboard, $d3f049242431219c$export$6d3443f2c48bfc20 as useEnterAnimation, $d3f049242431219c$export$45fda7c47f93fd48 as useExitAnimation, $b4b717babfbb907b$export$4c063cf1350e6fed as isFocusable, $b4b717babfbb907b$export$bebd5a1431fec25d as isTabbable};
|
|
99
99
|
//# sourceMappingURL=module.js.map
|
|
@@ -17,7 +17,10 @@ $parcel$export(module.exports, "isScrollable", () => $9a54e9cd5db23b5d$export$2b
|
|
|
17
17
|
*/ function $9a54e9cd5db23b5d$export$2bb74740c4e19def(node, checkForOverflow) {
|
|
18
18
|
if (!node) return false;
|
|
19
19
|
let style = window.getComputedStyle(node);
|
|
20
|
+
let root = document.scrollingElement || document.documentElement;
|
|
20
21
|
let isScrollable = /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY);
|
|
22
|
+
// Root element has `visible` overflow by default, but is scrollable nonetheless.
|
|
23
|
+
if (node === root && style.overflow !== 'hidden') isScrollable = true;
|
|
21
24
|
if (isScrollable && checkForOverflow) isScrollable = node.scrollHeight !== node.clientHeight || node.scrollWidth !== node.clientWidth;
|
|
22
25
|
return isScrollable;
|
|
23
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC,GAEM,SAAS,0CAAa,IAAoB,EAAE,gBAA0B;IAC3E,IAAI,CAAC,MACH,OAAO;IAET,IAAI,QAAQ,OAAO,gBAAgB,CAAC;IACpC,IAAI,eAAe,gBAAgB,IAAI,CAAC,MAAM,QAAQ,GAAG,MAAM,SAAS,GAAG,MAAM,SAAS;IAE1F,IAAI,gBAAgB,kBAClB,eAAe,KAAK,YAAY,KAAK,KAAK,YAAY,IAAI,KAAK,WAAW,KAAK,KAAK,WAAW;IAGjG,OAAO;AACT","sources":["packages/@react-aria/utils/src/isScrollable.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport function isScrollable(node: Element | null, checkForOverflow?: boolean): boolean {\n if (!node) {\n return false;\n }\n let style = window.getComputedStyle(node);\n let isScrollable = /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY);\n\n if (isScrollable && checkForOverflow) {\n isScrollable = node.scrollHeight !== node.clientHeight || node.scrollWidth !== node.clientWidth;\n }\n\n return isScrollable;\n}\n"],"names":[],"version":3,"file":"isScrollable.main.js.map"}
|
|
1
|
+
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC,GAEM,SAAS,0CAAa,IAAoB,EAAE,gBAA0B;IAC3E,IAAI,CAAC,MACH,OAAO;IAET,IAAI,QAAQ,OAAO,gBAAgB,CAAC;IACpC,IAAI,OAAO,SAAS,gBAAgB,IAAI,SAAS,eAAe;IAChE,IAAI,eAAe,gBAAgB,IAAI,CAAC,MAAM,QAAQ,GAAG,MAAM,SAAS,GAAG,MAAM,SAAS;IAE1F,iFAAiF;IACjF,IAAI,SAAS,QAAQ,MAAM,QAAQ,KAAK,UACtC,eAAe;IAGjB,IAAI,gBAAgB,kBAClB,eAAe,KAAK,YAAY,KAAK,KAAK,YAAY,IAAI,KAAK,WAAW,KAAK,KAAK,WAAW;IAGjG,OAAO;AACT","sources":["packages/@react-aria/utils/src/isScrollable.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport function isScrollable(node: Element | null, checkForOverflow?: boolean): boolean {\n if (!node) {\n return false;\n }\n let style = window.getComputedStyle(node);\n let root = document.scrollingElement || document.documentElement;\n let isScrollable = /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY);\n\n // Root element has `visible` overflow by default, but is scrollable nonetheless.\n if (node === root && style.overflow !== 'hidden') {\n isScrollable = true;\n }\n\n if (isScrollable && checkForOverflow) {\n isScrollable = node.scrollHeight !== node.clientHeight || node.scrollWidth !== node.clientWidth;\n }\n\n return isScrollable;\n}\n"],"names":[],"version":3,"file":"isScrollable.main.js.map"}
|
package/dist/isScrollable.mjs
CHANGED
|
@@ -11,7 +11,10 @@
|
|
|
11
11
|
*/ function $cc38e7bd3fc7b213$export$2bb74740c4e19def(node, checkForOverflow) {
|
|
12
12
|
if (!node) return false;
|
|
13
13
|
let style = window.getComputedStyle(node);
|
|
14
|
+
let root = document.scrollingElement || document.documentElement;
|
|
14
15
|
let isScrollable = /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY);
|
|
16
|
+
// Root element has `visible` overflow by default, but is scrollable nonetheless.
|
|
17
|
+
if (node === root && style.overflow !== 'hidden') isScrollable = true;
|
|
15
18
|
if (isScrollable && checkForOverflow) isScrollable = node.scrollHeight !== node.clientHeight || node.scrollWidth !== node.clientWidth;
|
|
16
19
|
return isScrollable;
|
|
17
20
|
}
|
|
@@ -11,7 +11,10 @@
|
|
|
11
11
|
*/ function $cc38e7bd3fc7b213$export$2bb74740c4e19def(node, checkForOverflow) {
|
|
12
12
|
if (!node) return false;
|
|
13
13
|
let style = window.getComputedStyle(node);
|
|
14
|
+
let root = document.scrollingElement || document.documentElement;
|
|
14
15
|
let isScrollable = /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY);
|
|
16
|
+
// Root element has `visible` overflow by default, but is scrollable nonetheless.
|
|
17
|
+
if (node === root && style.overflow !== 'hidden') isScrollable = true;
|
|
15
18
|
if (isScrollable && checkForOverflow) isScrollable = node.scrollHeight !== node.clientHeight || node.scrollWidth !== node.clientWidth;
|
|
16
19
|
return isScrollable;
|
|
17
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAAA;;;;;;;;;;CAUC,GAEM,SAAS,0CAAa,IAAoB,EAAE,gBAA0B;IAC3E,IAAI,CAAC,MACH,OAAO;IAET,IAAI,QAAQ,OAAO,gBAAgB,CAAC;IACpC,IAAI,eAAe,gBAAgB,IAAI,CAAC,MAAM,QAAQ,GAAG,MAAM,SAAS,GAAG,MAAM,SAAS;IAE1F,IAAI,gBAAgB,kBAClB,eAAe,KAAK,YAAY,KAAK,KAAK,YAAY,IAAI,KAAK,WAAW,KAAK,KAAK,WAAW;IAGjG,OAAO;AACT","sources":["packages/@react-aria/utils/src/isScrollable.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport function isScrollable(node: Element | null, checkForOverflow?: boolean): boolean {\n if (!node) {\n return false;\n }\n let style = window.getComputedStyle(node);\n let isScrollable = /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY);\n\n if (isScrollable && checkForOverflow) {\n isScrollable = node.scrollHeight !== node.clientHeight || node.scrollWidth !== node.clientWidth;\n }\n\n return isScrollable;\n}\n"],"names":[],"version":3,"file":"isScrollable.module.js.map"}
|
|
1
|
+
{"mappings":"AAAA;;;;;;;;;;CAUC,GAEM,SAAS,0CAAa,IAAoB,EAAE,gBAA0B;IAC3E,IAAI,CAAC,MACH,OAAO;IAET,IAAI,QAAQ,OAAO,gBAAgB,CAAC;IACpC,IAAI,OAAO,SAAS,gBAAgB,IAAI,SAAS,eAAe;IAChE,IAAI,eAAe,gBAAgB,IAAI,CAAC,MAAM,QAAQ,GAAG,MAAM,SAAS,GAAG,MAAM,SAAS;IAE1F,iFAAiF;IACjF,IAAI,SAAS,QAAQ,MAAM,QAAQ,KAAK,UACtC,eAAe;IAGjB,IAAI,gBAAgB,kBAClB,eAAe,KAAK,YAAY,KAAK,KAAK,YAAY,IAAI,KAAK,WAAW,KAAK,KAAK,WAAW;IAGjG,OAAO;AACT","sources":["packages/@react-aria/utils/src/isScrollable.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport function isScrollable(node: Element | null, checkForOverflow?: boolean): boolean {\n if (!node) {\n return false;\n }\n let style = window.getComputedStyle(node);\n let root = document.scrollingElement || document.documentElement;\n let isScrollable = /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY);\n\n // Root element has `visible` overflow by default, but is scrollable nonetheless.\n if (node === root && style.overflow !== 'hidden') {\n isScrollable = true;\n }\n\n if (isScrollable && checkForOverflow) {\n isScrollable = node.scrollHeight !== node.clientHeight || node.scrollWidth !== node.clientWidth;\n }\n\n return isScrollable;\n}\n"],"names":[],"version":3,"file":"isScrollable.module.js.map"}
|
package/dist/main.js
CHANGED
|
@@ -55,6 +55,7 @@ $parcel$export(module.exports, "ShadowTreeWalker", () => $8e13b2545651735a$expor
|
|
|
55
55
|
$parcel$export(module.exports, "getActiveElement", () => $d723bea02f3e2567$exports.getActiveElement);
|
|
56
56
|
$parcel$export(module.exports, "getEventTarget", () => $d723bea02f3e2567$exports.getEventTarget);
|
|
57
57
|
$parcel$export(module.exports, "nodeContains", () => $d723bea02f3e2567$exports.nodeContains);
|
|
58
|
+
$parcel$export(module.exports, "isFocusWithin", () => $d723bea02f3e2567$exports.isFocusWithin);
|
|
58
59
|
$parcel$export(module.exports, "getOwnerDocument", () => $aaa611146751592e$exports.getOwnerDocument);
|
|
59
60
|
$parcel$export(module.exports, "getOwnerWindow", () => $aaa611146751592e$exports.getOwnerWindow);
|
|
60
61
|
$parcel$export(module.exports, "isShadowRoot", () => $aaa611146751592e$exports.isShadowRoot);
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/utils/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nexport {useId, mergeIds, useSlotId} from './useId';\nexport {chain} from './chain';\nexport {createShadowTreeWalker, ShadowTreeWalker} from './shadowdom/ShadowTreeWalker';\nexport {getActiveElement, getEventTarget, nodeContains, isFocusWithin} from './shadowdom/DOMFunctions';\nexport {getOwnerDocument, getOwnerWindow, isShadowRoot} from './domHelpers';\nexport {mergeProps} from './mergeProps';\nexport {mergeRefs} from './mergeRefs';\nexport {filterDOMProps} from './filterDOMProps';\nexport {focusWithoutScrolling} from './focusWithoutScrolling';\nexport {getOffset} from './getOffset';\nexport {openLink, getSyntheticLinkProps, useSyntheticLinkProps, RouterProvider, shouldClientNavigate, useRouter, useLinkProps, handleLinkClick} from './openLink';\nexport {runAfterTransition} from './runAfterTransition';\nexport {useDrag1D} from './useDrag1D';\nexport {useGlobalListeners} from './useGlobalListeners';\nexport {useLabels} from './useLabels';\nexport {useObjectRef} from './useObjectRef';\nexport {useUpdateEffect} from './useUpdateEffect';\nexport {useUpdateLayoutEffect} from './useUpdateLayoutEffect';\nexport {useLayoutEffect} from './useLayoutEffect';\nexport {useResizeObserver} from './useResizeObserver';\nexport {useSyncRef} from './useSyncRef';\nexport {getScrollParent} from './getScrollParent';\nexport {getScrollParents} from './getScrollParents';\nexport {isScrollable} from './isScrollable';\nexport {useViewportSize} from './useViewportSize';\nexport {useDescription} from './useDescription';\nexport {isMac, isIPhone, isIPad, isIOS, isAppleDevice, isWebKit, isChrome, isAndroid, isFirefox} from './platform';\nexport {useEvent} from './useEvent';\nexport {useValueEffect} from './useValueEffect';\nexport {scrollIntoView, scrollIntoViewport} from './scrollIntoView';\nexport {clamp, snapValueToStep} from '@react-stately/utils';\nexport {isVirtualClick, isVirtualPointerEvent} from './isVirtualEvent';\nexport {useEffectEvent} from './useEffectEvent';\nexport {useDeepMemo} from './useDeepMemo';\nexport {useFormReset} from './useFormReset';\nexport {useLoadMore} from './useLoadMore';\nexport {useLoadMoreSentinel, useLoadMoreSentinel as UNSTABLE_useLoadMoreSentinel} from './useLoadMoreSentinel';\nexport {inertValue} from './inertValue';\nexport {CLEAR_FOCUS_EVENT, FOCUS_EVENT} from './constants';\nexport {isCtrlKeyPressed, willOpenKeyboard} from './keyboard';\nexport {useEnterAnimation, useExitAnimation} from './animation';\nexport {isFocusable, isTabbable} from './isFocusable';\n\nexport type {LoadMoreSentinelProps} from './useLoadMoreSentinel';\n"],"names":[],"version":3,"file":"main.js.map"}
|
package/dist/module.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {mergeIds as $bdb11010cef70236$export$cd8c9cb68f842629, useId as $bdb11010cef70236$export$f680877a34711e37, useSlotId as $bdb11010cef70236$export$b4cc09c592e8fdb8} from "./useId.module.js";
|
|
2
2
|
import {chain as $ff5963eb1fccf552$export$e08e3b67e392101e} from "./chain.module.js";
|
|
3
3
|
import {createShadowTreeWalker as $dfc540311bf7f109$export$4d0f8be8b12a7ef6, ShadowTreeWalker as $dfc540311bf7f109$export$63eb3ababa9c55c4} from "./ShadowTreeWalker.module.js";
|
|
4
|
-
import {getActiveElement as $d4ee10de306f2510$export$cd4e5573fbe2b576, getEventTarget as $d4ee10de306f2510$export$e58f029f0fbfdb29, nodeContains as $d4ee10de306f2510$export$4282f70798064fe0} from "./DOMFunctions.module.js";
|
|
4
|
+
import {getActiveElement as $d4ee10de306f2510$export$cd4e5573fbe2b576, getEventTarget as $d4ee10de306f2510$export$e58f029f0fbfdb29, isFocusWithin as $d4ee10de306f2510$export$b4f377a2b6254582, nodeContains as $d4ee10de306f2510$export$4282f70798064fe0} from "./DOMFunctions.module.js";
|
|
5
5
|
import {getOwnerDocument as $431fbd86ca7dc216$export$b204af158042fbac, getOwnerWindow as $431fbd86ca7dc216$export$f21a1ffae260145a, isShadowRoot as $431fbd86ca7dc216$export$af51f0f06c0f328a} from "./domHelpers.module.js";
|
|
6
6
|
import {mergeProps as $3ef42575df84b30b$export$9d1611c77c2fe928} from "./mergeProps.module.js";
|
|
7
7
|
import {mergeRefs as $5dc95899b306f630$export$c9058316764c140e} from "./mergeRefs.module.js";
|
|
@@ -95,5 +95,5 @@ import {clamp as $4507461a1b870123$re_export$clamp, snapValueToStep as $4507461a
|
|
|
95
95
|
|
|
96
96
|
|
|
97
97
|
|
|
98
|
-
export {$bdb11010cef70236$export$f680877a34711e37 as useId, $bdb11010cef70236$export$cd8c9cb68f842629 as mergeIds, $bdb11010cef70236$export$b4cc09c592e8fdb8 as useSlotId, $ff5963eb1fccf552$export$e08e3b67e392101e as chain, $dfc540311bf7f109$export$4d0f8be8b12a7ef6 as createShadowTreeWalker, $dfc540311bf7f109$export$63eb3ababa9c55c4 as ShadowTreeWalker, $d4ee10de306f2510$export$cd4e5573fbe2b576 as getActiveElement, $d4ee10de306f2510$export$e58f029f0fbfdb29 as getEventTarget, $d4ee10de306f2510$export$4282f70798064fe0 as nodeContains, $431fbd86ca7dc216$export$b204af158042fbac as getOwnerDocument, $431fbd86ca7dc216$export$f21a1ffae260145a as getOwnerWindow, $431fbd86ca7dc216$export$af51f0f06c0f328a as isShadowRoot, $3ef42575df84b30b$export$9d1611c77c2fe928 as mergeProps, $5dc95899b306f630$export$c9058316764c140e as mergeRefs, $65484d02dcb7eb3e$export$457c3d6518dd4c6f as filterDOMProps, $7215afc6de606d6b$export$de79e2c695e052f3 as focusWithoutScrolling, $ab71dadb03a6fb2e$export$622cea445a1c5b7d as getOffset, $ea8dcbcb9ea1b556$export$95185d699e05d4d7 as openLink, $ea8dcbcb9ea1b556$export$51437d503373d223 as getSyntheticLinkProps, $ea8dcbcb9ea1b556$export$bdc77b0c0a3a85d6 as useSyntheticLinkProps, $ea8dcbcb9ea1b556$export$323e4fc2fa4753fb as RouterProvider, $ea8dcbcb9ea1b556$export$efa8c9099e530235 as shouldClientNavigate, $ea8dcbcb9ea1b556$export$9a302a45f65d0572 as useRouter, $ea8dcbcb9ea1b556$export$7e924b3091a3bd18 as useLinkProps, $ea8dcbcb9ea1b556$export$13aea1a3cb5e3f1f as handleLinkClick, $bbed8b41f857bcc0$export$24490316f764c430 as runAfterTransition, $9cc09df9fd7676be$export$7bbed75feba39706 as useDrag1D, $03deb23ff14920c4$export$4eaf04e54aa8eed6 as useGlobalListeners, $313b98861ee5dd6c$export$d6875122194c7b44 as useLabels, $df56164dff5785e2$export$4338b53315abf666 as useObjectRef, $4f58c5f72bcf79f7$export$496315a1608d9602 as useUpdateEffect, $ca9b37712f007381$export$72ef708ab07251f1 as useUpdateLayoutEffect, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c as useLayoutEffect, $9daab02d461809db$export$683480f191c0e3ea as useResizeObserver, $e7801be82b4b2a53$export$4debdb1a3f0fa79e as useSyncRef, $62d8ded9296f3872$export$cfa2225e87938781 as getScrollParent, $a40c673dc9f6d9c7$export$94ed1c92c7beeb22 as getScrollParents, $cc38e7bd3fc7b213$export$2bb74740c4e19def as isScrollable, $5df64b3807dc15ee$export$d699905dd57c73ca as useViewportSize, $ef06256079686ba0$export$f8aeda7b10753fa1 as useDescription, $c87311424ea30a05$export$9ac100e40613ea10 as isMac, $c87311424ea30a05$export$186c6964ca17d99 as isIPhone, $c87311424ea30a05$export$7bef049ce92e4224 as isIPad, $c87311424ea30a05$export$fedb369cb70207f1 as isIOS, $c87311424ea30a05$export$e1865c3bedcd822b as isAppleDevice, $c87311424ea30a05$export$78551043582a6a98 as isWebKit, $c87311424ea30a05$export$6446a186d09e379e as isChrome, $c87311424ea30a05$export$a11b0059900ceec8 as isAndroid, $c87311424ea30a05$export$b7d78993b74f766d as isFirefox, $e9faafb641e167db$export$90fc3a17d93f704c as useEvent, $1dbecbe27a04f9af$export$14d238f342723f25 as useValueEffect, $2f04cbc44ee30ce0$export$53a0910f038337bd as scrollIntoView, $2f04cbc44ee30ce0$export$c826860796309d1b as scrollIntoViewport, $4507461a1b870123$re_export$clamp as clamp, $4507461a1b870123$re_export$snapValueToStep as snapValueToStep, $6a7db85432448f7f$export$60278871457622de as isVirtualClick, $6a7db85432448f7f$export$29bf1b5f2c56cf63 as isVirtualPointerEvent, $8ae05eaa5c114e9c$export$7f54fc3180508a52 as useEffectEvent, $5a387cc49350e6db$export$722debc0e56fea39 as useDeepMemo, $99facab73266f662$export$5add1d006293d136 as useFormReset, $26f7f3da73fcd9d6$export$7717c92ee915373e as useLoadMore, $a5fa973c1850dd36$export$ccaea96c28e8b9e7 as useLoadMoreSentinel, $a5fa973c1850dd36$export$ccaea96c28e8b9e7 as UNSTABLE_useLoadMoreSentinel, $cdc5a6778b766db2$export$a9d04c5684123369 as inertValue, $5671b20cf9b562b2$export$447a38995de2c711 as CLEAR_FOCUS_EVENT, $5671b20cf9b562b2$export$831c820ad60f9d12 as FOCUS_EVENT, $21f1aa98acb08317$export$16792effe837dba3 as isCtrlKeyPressed, $21f1aa98acb08317$export$c57958e35f31ed73 as willOpenKeyboard, $d3f049242431219c$export$6d3443f2c48bfc20 as useEnterAnimation, $d3f049242431219c$export$45fda7c47f93fd48 as useExitAnimation, $b4b717babfbb907b$export$4c063cf1350e6fed as isFocusable, $b4b717babfbb907b$export$bebd5a1431fec25d as isTabbable};
|
|
98
|
+
export {$bdb11010cef70236$export$f680877a34711e37 as useId, $bdb11010cef70236$export$cd8c9cb68f842629 as mergeIds, $bdb11010cef70236$export$b4cc09c592e8fdb8 as useSlotId, $ff5963eb1fccf552$export$e08e3b67e392101e as chain, $dfc540311bf7f109$export$4d0f8be8b12a7ef6 as createShadowTreeWalker, $dfc540311bf7f109$export$63eb3ababa9c55c4 as ShadowTreeWalker, $d4ee10de306f2510$export$cd4e5573fbe2b576 as getActiveElement, $d4ee10de306f2510$export$e58f029f0fbfdb29 as getEventTarget, $d4ee10de306f2510$export$4282f70798064fe0 as nodeContains, $d4ee10de306f2510$export$b4f377a2b6254582 as isFocusWithin, $431fbd86ca7dc216$export$b204af158042fbac as getOwnerDocument, $431fbd86ca7dc216$export$f21a1ffae260145a as getOwnerWindow, $431fbd86ca7dc216$export$af51f0f06c0f328a as isShadowRoot, $3ef42575df84b30b$export$9d1611c77c2fe928 as mergeProps, $5dc95899b306f630$export$c9058316764c140e as mergeRefs, $65484d02dcb7eb3e$export$457c3d6518dd4c6f as filterDOMProps, $7215afc6de606d6b$export$de79e2c695e052f3 as focusWithoutScrolling, $ab71dadb03a6fb2e$export$622cea445a1c5b7d as getOffset, $ea8dcbcb9ea1b556$export$95185d699e05d4d7 as openLink, $ea8dcbcb9ea1b556$export$51437d503373d223 as getSyntheticLinkProps, $ea8dcbcb9ea1b556$export$bdc77b0c0a3a85d6 as useSyntheticLinkProps, $ea8dcbcb9ea1b556$export$323e4fc2fa4753fb as RouterProvider, $ea8dcbcb9ea1b556$export$efa8c9099e530235 as shouldClientNavigate, $ea8dcbcb9ea1b556$export$9a302a45f65d0572 as useRouter, $ea8dcbcb9ea1b556$export$7e924b3091a3bd18 as useLinkProps, $ea8dcbcb9ea1b556$export$13aea1a3cb5e3f1f as handleLinkClick, $bbed8b41f857bcc0$export$24490316f764c430 as runAfterTransition, $9cc09df9fd7676be$export$7bbed75feba39706 as useDrag1D, $03deb23ff14920c4$export$4eaf04e54aa8eed6 as useGlobalListeners, $313b98861ee5dd6c$export$d6875122194c7b44 as useLabels, $df56164dff5785e2$export$4338b53315abf666 as useObjectRef, $4f58c5f72bcf79f7$export$496315a1608d9602 as useUpdateEffect, $ca9b37712f007381$export$72ef708ab07251f1 as useUpdateLayoutEffect, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c as useLayoutEffect, $9daab02d461809db$export$683480f191c0e3ea as useResizeObserver, $e7801be82b4b2a53$export$4debdb1a3f0fa79e as useSyncRef, $62d8ded9296f3872$export$cfa2225e87938781 as getScrollParent, $a40c673dc9f6d9c7$export$94ed1c92c7beeb22 as getScrollParents, $cc38e7bd3fc7b213$export$2bb74740c4e19def as isScrollable, $5df64b3807dc15ee$export$d699905dd57c73ca as useViewportSize, $ef06256079686ba0$export$f8aeda7b10753fa1 as useDescription, $c87311424ea30a05$export$9ac100e40613ea10 as isMac, $c87311424ea30a05$export$186c6964ca17d99 as isIPhone, $c87311424ea30a05$export$7bef049ce92e4224 as isIPad, $c87311424ea30a05$export$fedb369cb70207f1 as isIOS, $c87311424ea30a05$export$e1865c3bedcd822b as isAppleDevice, $c87311424ea30a05$export$78551043582a6a98 as isWebKit, $c87311424ea30a05$export$6446a186d09e379e as isChrome, $c87311424ea30a05$export$a11b0059900ceec8 as isAndroid, $c87311424ea30a05$export$b7d78993b74f766d as isFirefox, $e9faafb641e167db$export$90fc3a17d93f704c as useEvent, $1dbecbe27a04f9af$export$14d238f342723f25 as useValueEffect, $2f04cbc44ee30ce0$export$53a0910f038337bd as scrollIntoView, $2f04cbc44ee30ce0$export$c826860796309d1b as scrollIntoViewport, $4507461a1b870123$re_export$clamp as clamp, $4507461a1b870123$re_export$snapValueToStep as snapValueToStep, $6a7db85432448f7f$export$60278871457622de as isVirtualClick, $6a7db85432448f7f$export$29bf1b5f2c56cf63 as isVirtualPointerEvent, $8ae05eaa5c114e9c$export$7f54fc3180508a52 as useEffectEvent, $5a387cc49350e6db$export$722debc0e56fea39 as useDeepMemo, $99facab73266f662$export$5add1d006293d136 as useFormReset, $26f7f3da73fcd9d6$export$7717c92ee915373e as useLoadMore, $a5fa973c1850dd36$export$ccaea96c28e8b9e7 as useLoadMoreSentinel, $a5fa973c1850dd36$export$ccaea96c28e8b9e7 as UNSTABLE_useLoadMoreSentinel, $cdc5a6778b766db2$export$a9d04c5684123369 as inertValue, $5671b20cf9b562b2$export$447a38995de2c711 as CLEAR_FOCUS_EVENT, $5671b20cf9b562b2$export$831c820ad60f9d12 as FOCUS_EVENT, $21f1aa98acb08317$export$16792effe837dba3 as isCtrlKeyPressed, $21f1aa98acb08317$export$c57958e35f31ed73 as willOpenKeyboard, $d3f049242431219c$export$6d3443f2c48bfc20 as useEnterAnimation, $d3f049242431219c$export$45fda7c47f93fd48 as useExitAnimation, $b4b717babfbb907b$export$4c063cf1350e6fed as isFocusable, $b4b717babfbb907b$export$bebd5a1431fec25d as isTabbable};
|
|
99
99
|
//# sourceMappingURL=module.js.map
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/utils/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nexport {useId, mergeIds, useSlotId} from './useId';\nexport {chain} from './chain';\nexport {createShadowTreeWalker, ShadowTreeWalker} from './shadowdom/ShadowTreeWalker';\nexport {getActiveElement, getEventTarget, nodeContains} from './shadowdom/DOMFunctions';\nexport {getOwnerDocument, getOwnerWindow, isShadowRoot} from './domHelpers';\nexport {mergeProps} from './mergeProps';\nexport {mergeRefs} from './mergeRefs';\nexport {filterDOMProps} from './filterDOMProps';\nexport {focusWithoutScrolling} from './focusWithoutScrolling';\nexport {getOffset} from './getOffset';\nexport {openLink, getSyntheticLinkProps, useSyntheticLinkProps, RouterProvider, shouldClientNavigate, useRouter, useLinkProps, handleLinkClick} from './openLink';\nexport {runAfterTransition} from './runAfterTransition';\nexport {useDrag1D} from './useDrag1D';\nexport {useGlobalListeners} from './useGlobalListeners';\nexport {useLabels} from './useLabels';\nexport {useObjectRef} from './useObjectRef';\nexport {useUpdateEffect} from './useUpdateEffect';\nexport {useUpdateLayoutEffect} from './useUpdateLayoutEffect';\nexport {useLayoutEffect} from './useLayoutEffect';\nexport {useResizeObserver} from './useResizeObserver';\nexport {useSyncRef} from './useSyncRef';\nexport {getScrollParent} from './getScrollParent';\nexport {getScrollParents} from './getScrollParents';\nexport {isScrollable} from './isScrollable';\nexport {useViewportSize} from './useViewportSize';\nexport {useDescription} from './useDescription';\nexport {isMac, isIPhone, isIPad, isIOS, isAppleDevice, isWebKit, isChrome, isAndroid, isFirefox} from './platform';\nexport {useEvent} from './useEvent';\nexport {useValueEffect} from './useValueEffect';\nexport {scrollIntoView, scrollIntoViewport} from './scrollIntoView';\nexport {clamp, snapValueToStep} from '@react-stately/utils';\nexport {isVirtualClick, isVirtualPointerEvent} from './isVirtualEvent';\nexport {useEffectEvent} from './useEffectEvent';\nexport {useDeepMemo} from './useDeepMemo';\nexport {useFormReset} from './useFormReset';\nexport {useLoadMore} from './useLoadMore';\nexport {useLoadMoreSentinel, useLoadMoreSentinel as UNSTABLE_useLoadMoreSentinel} from './useLoadMoreSentinel';\nexport {inertValue} from './inertValue';\nexport {CLEAR_FOCUS_EVENT, FOCUS_EVENT} from './constants';\nexport {isCtrlKeyPressed, willOpenKeyboard} from './keyboard';\nexport {useEnterAnimation, useExitAnimation} from './animation';\nexport {isFocusable, isTabbable} from './isFocusable';\n\nexport type {LoadMoreSentinelProps} from './useLoadMoreSentinel';\n"],"names":[],"version":3,"file":"module.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/utils/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nexport {useId, mergeIds, useSlotId} from './useId';\nexport {chain} from './chain';\nexport {createShadowTreeWalker, ShadowTreeWalker} from './shadowdom/ShadowTreeWalker';\nexport {getActiveElement, getEventTarget, nodeContains, isFocusWithin} from './shadowdom/DOMFunctions';\nexport {getOwnerDocument, getOwnerWindow, isShadowRoot} from './domHelpers';\nexport {mergeProps} from './mergeProps';\nexport {mergeRefs} from './mergeRefs';\nexport {filterDOMProps} from './filterDOMProps';\nexport {focusWithoutScrolling} from './focusWithoutScrolling';\nexport {getOffset} from './getOffset';\nexport {openLink, getSyntheticLinkProps, useSyntheticLinkProps, RouterProvider, shouldClientNavigate, useRouter, useLinkProps, handleLinkClick} from './openLink';\nexport {runAfterTransition} from './runAfterTransition';\nexport {useDrag1D} from './useDrag1D';\nexport {useGlobalListeners} from './useGlobalListeners';\nexport {useLabels} from './useLabels';\nexport {useObjectRef} from './useObjectRef';\nexport {useUpdateEffect} from './useUpdateEffect';\nexport {useUpdateLayoutEffect} from './useUpdateLayoutEffect';\nexport {useLayoutEffect} from './useLayoutEffect';\nexport {useResizeObserver} from './useResizeObserver';\nexport {useSyncRef} from './useSyncRef';\nexport {getScrollParent} from './getScrollParent';\nexport {getScrollParents} from './getScrollParents';\nexport {isScrollable} from './isScrollable';\nexport {useViewportSize} from './useViewportSize';\nexport {useDescription} from './useDescription';\nexport {isMac, isIPhone, isIPad, isIOS, isAppleDevice, isWebKit, isChrome, isAndroid, isFirefox} from './platform';\nexport {useEvent} from './useEvent';\nexport {useValueEffect} from './useValueEffect';\nexport {scrollIntoView, scrollIntoViewport} from './scrollIntoView';\nexport {clamp, snapValueToStep} from '@react-stately/utils';\nexport {isVirtualClick, isVirtualPointerEvent} from './isVirtualEvent';\nexport {useEffectEvent} from './useEffectEvent';\nexport {useDeepMemo} from './useDeepMemo';\nexport {useFormReset} from './useFormReset';\nexport {useLoadMore} from './useLoadMore';\nexport {useLoadMoreSentinel, useLoadMoreSentinel as UNSTABLE_useLoadMoreSentinel} from './useLoadMoreSentinel';\nexport {inertValue} from './inertValue';\nexport {CLEAR_FOCUS_EVENT, FOCUS_EVENT} from './constants';\nexport {isCtrlKeyPressed, willOpenKeyboard} from './keyboard';\nexport {useEnterAnimation, useExitAnimation} from './animation';\nexport {isFocusable, isTabbable} from './isFocusable';\n\nexport type {LoadMoreSentinelProps} from './useLoadMoreSentinel';\n"],"names":[],"version":3,"file":"module.js.map"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
var $d723bea02f3e2567$exports = require("./DOMFunctions.main.js");
|
|
2
|
+
|
|
1
3
|
|
|
2
4
|
function $parcel$export(e, n, v, s) {
|
|
3
5
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
@@ -20,6 +22,7 @@ $parcel$export(module.exports, "runAfterTransition", () => $e8117ebcab55be6a$exp
|
|
|
20
22
|
// bugs, e.g. Chrome sometimes fires both transitionend and transitioncancel rather
|
|
21
23
|
// than one or the other. So we need to track what's actually transitioning so that
|
|
22
24
|
// we can ignore these duplicate events.
|
|
25
|
+
|
|
23
26
|
let $e8117ebcab55be6a$var$transitionsByElement = new Map();
|
|
24
27
|
// A list of callbacks to call once there are no transitioning elements.
|
|
25
28
|
let $e8117ebcab55be6a$var$transitionCallbacks = new Set();
|
|
@@ -29,31 +32,33 @@ function $e8117ebcab55be6a$var$setupGlobalEvents() {
|
|
|
29
32
|
return 'propertyName' in event;
|
|
30
33
|
}
|
|
31
34
|
let onTransitionStart = (e)=>{
|
|
32
|
-
|
|
35
|
+
let eventTarget = (0, $d723bea02f3e2567$exports.getEventTarget)(e);
|
|
36
|
+
if (!isTransitionEvent(e) || !eventTarget) return;
|
|
33
37
|
// Add the transitioning property to the list for this element.
|
|
34
|
-
let transitions = $e8117ebcab55be6a$var$transitionsByElement.get(
|
|
38
|
+
let transitions = $e8117ebcab55be6a$var$transitionsByElement.get(eventTarget);
|
|
35
39
|
if (!transitions) {
|
|
36
40
|
transitions = new Set();
|
|
37
|
-
$e8117ebcab55be6a$var$transitionsByElement.set(
|
|
41
|
+
$e8117ebcab55be6a$var$transitionsByElement.set(eventTarget, transitions);
|
|
38
42
|
// The transitioncancel event must be registered on the element itself, rather than as a global
|
|
39
43
|
// event. This enables us to handle when the node is deleted from the document while it is transitioning.
|
|
40
44
|
// In that case, the cancel event would have nowhere to bubble to so we need to handle it directly.
|
|
41
|
-
|
|
45
|
+
eventTarget.addEventListener('transitioncancel', onTransitionEnd, {
|
|
42
46
|
once: true
|
|
43
47
|
});
|
|
44
48
|
}
|
|
45
49
|
transitions.add(e.propertyName);
|
|
46
50
|
};
|
|
47
51
|
let onTransitionEnd = (e)=>{
|
|
48
|
-
|
|
52
|
+
let eventTarget = (0, $d723bea02f3e2567$exports.getEventTarget)(e);
|
|
53
|
+
if (!isTransitionEvent(e) || !eventTarget) return;
|
|
49
54
|
// Remove property from list of transitioning properties.
|
|
50
|
-
let properties = $e8117ebcab55be6a$var$transitionsByElement.get(
|
|
55
|
+
let properties = $e8117ebcab55be6a$var$transitionsByElement.get(eventTarget);
|
|
51
56
|
if (!properties) return;
|
|
52
57
|
properties.delete(e.propertyName);
|
|
53
58
|
// If empty, remove transitioncancel event, and remove the element from the list of transitioning elements.
|
|
54
59
|
if (properties.size === 0) {
|
|
55
|
-
|
|
56
|
-
$e8117ebcab55be6a$var$transitionsByElement.delete(
|
|
60
|
+
eventTarget.removeEventListener('transitioncancel', onTransitionEnd);
|
|
61
|
+
$e8117ebcab55be6a$var$transitionsByElement.delete(eventTarget);
|
|
57
62
|
}
|
|
58
63
|
// If no transitioning elements, call all of the queued callbacks.
|
|
59
64
|
if ($e8117ebcab55be6a$var$transitionsByElement.size === 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,uEAAuE;AACvE,6EAA6E;AAC7E,iFAAiF;AACjF,mFAAmF;AACnF,mFAAmF;AACnF,wCAAwC;;AAExC,IAAI,6CAAuB,IAAI;AAE/B,wEAAwE;AACxE,IAAI,4CAAsB,IAAI;AAE9B,SAAS;IACP,IAAI,OAAO,WAAW,aACpB;IAGF,SAAS,kBAAkB,KAAY;QACrC,OAAO,kBAAkB;IAC3B;IAEA,IAAI,oBAAoB,CAAC;QACvB,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QACjC,IAAI,CAAC,kBAAkB,MAAM,CAAC,aAC5B;QAEF,+DAA+D;QAC/D,IAAI,cAAc,2CAAqB,GAAG,CAAC;QAC3C,IAAI,CAAC,aAAa;YAChB,cAAc,IAAI;YAClB,2CAAqB,GAAG,CAAC,aAAa;YAEtC,+FAA+F;YAC/F,yGAAyG;YACzG,mGAAmG;YACnG,YAAY,gBAAgB,CAAC,oBAAoB,iBAAiB;gBAChE,MAAM;YACR;QACF;QAEA,YAAY,GAAG,CAAC,EAAE,YAAY;IAChC;IAEA,IAAI,kBAAkB,CAAC;QACrB,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QACjC,IAAI,CAAC,kBAAkB,MAAM,CAAC,aAC5B;QAEF,yDAAyD;QACzD,IAAI,aAAa,2CAAqB,GAAG,CAAC;QAC1C,IAAI,CAAC,YACH;QAGF,WAAW,MAAM,CAAC,EAAE,YAAY;QAEhC,2GAA2G;QAC3G,IAAI,WAAW,IAAI,KAAK,GAAG;YACzB,YAAY,mBAAmB,CAAC,oBAAoB;YACpD,2CAAqB,MAAM,CAAC;QAC9B;QAEA,kEAAkE;QAClE,IAAI,2CAAqB,IAAI,KAAK,GAAG;YACnC,KAAK,IAAI,MAAM,0CACb;YAGF,0CAAoB,KAAK;QAC3B;IACF;IAEA,SAAS,IAAI,CAAC,gBAAgB,CAAC,iBAAiB;IAChD,SAAS,IAAI,CAAC,gBAAgB,CAAC,iBAAiB;AAClD;AAEA,IAAI,OAAO,aAAa;IACtB,IAAI,SAAS,UAAU,KAAK,WAC1B;SAEA,SAAS,gBAAgB,CAAC,oBAAoB;;AAIlD;;;;CAIC,GACD,SAAS;IACP,KAAK,MAAM,CAAC,YAAY,IAAI,2CAC1B,sFAAsF;IACtF,kFAAkF;IAClF,IAAI,iBAAiB,eAAe,CAAC,YAAY,WAAW,EAC1D,2CAAqB,MAAM,CAAC;AAGlC;AAEO,SAAS,0CAAmB,EAAc;IAC/C,4EAA4E;IAC5E,sBAAsB;QACpB;QACA,gEAAgE;QAChE,+EAA+E;QAC/E,IAAI,2CAAqB,IAAI,KAAK,GAChC;aAEA,0CAAoB,GAAG,CAAC;IAE5B;AACF","sources":["packages/@react-aria/utils/src/runAfterTransition.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// We store a global list of elements that are currently transitioning,\n// mapped to a set of CSS properties that are transitioning for that element.\n// This is necessary rather than a simple count of transitions because of browser\n// bugs, e.g. Chrome sometimes fires both transitionend and transitioncancel rather\n// than one or the other. So we need to track what's actually transitioning so that\n// we can ignore these duplicate events.\nimport {getEventTarget} from './shadowdom/DOMFunctions';\nlet transitionsByElement = new Map<EventTarget, Set<string>>();\n\n// A list of callbacks to call once there are no transitioning elements.\nlet transitionCallbacks = new Set<() => void>();\n\nfunction setupGlobalEvents() {\n if (typeof window === 'undefined') {\n return;\n }\n\n function isTransitionEvent(event: Event): event is TransitionEvent {\n return 'propertyName' in event;\n }\n\n let onTransitionStart = (e: Event) => {\n let eventTarget = getEventTarget(e);\n if (!isTransitionEvent(e) || !eventTarget) {\n return;\n }\n // Add the transitioning property to the list for this element.\n let transitions = transitionsByElement.get(eventTarget);\n if (!transitions) {\n transitions = new Set();\n transitionsByElement.set(eventTarget, transitions);\n\n // The transitioncancel event must be registered on the element itself, rather than as a global\n // event. This enables us to handle when the node is deleted from the document while it is transitioning.\n // In that case, the cancel event would have nowhere to bubble to so we need to handle it directly.\n eventTarget.addEventListener('transitioncancel', onTransitionEnd, {\n once: true\n });\n }\n\n transitions.add(e.propertyName);\n };\n\n let onTransitionEnd = (e: Event) => {\n let eventTarget = getEventTarget(e);\n if (!isTransitionEvent(e) || !eventTarget) {\n return;\n }\n // Remove property from list of transitioning properties.\n let properties = transitionsByElement.get(eventTarget);\n if (!properties) {\n return;\n }\n\n properties.delete(e.propertyName);\n\n // If empty, remove transitioncancel event, and remove the element from the list of transitioning elements.\n if (properties.size === 0) {\n eventTarget.removeEventListener('transitioncancel', onTransitionEnd);\n transitionsByElement.delete(eventTarget);\n }\n\n // If no transitioning elements, call all of the queued callbacks.\n if (transitionsByElement.size === 0) {\n for (let cb of transitionCallbacks) {\n cb();\n }\n\n transitionCallbacks.clear();\n }\n };\n\n document.body.addEventListener('transitionrun', onTransitionStart);\n document.body.addEventListener('transitionend', onTransitionEnd);\n}\n\nif (typeof document !== 'undefined') {\n if (document.readyState !== 'loading') {\n setupGlobalEvents();\n } else {\n document.addEventListener('DOMContentLoaded', setupGlobalEvents);\n }\n}\n\n/**\n * Cleans up any elements that are no longer in the document.\n * This is necessary because we can't rely on transitionend events to fire\n * for elements that are removed from the document while transitioning.\n */\nfunction cleanupDetachedElements() {\n for (const [eventTarget] of transitionsByElement) {\n // Similar to `eventTarget instanceof Element && !eventTarget.isConnected`, but avoids\n // the explicit instanceof check, since it may be different in different contexts.\n if ('isConnected' in eventTarget && !eventTarget.isConnected) {\n transitionsByElement.delete(eventTarget);\n }\n }\n}\n\nexport function runAfterTransition(fn: () => void): void {\n // Wait one frame to see if an animation starts, e.g. a transition on mount.\n requestAnimationFrame(() => {\n cleanupDetachedElements();\n // If no transitions are running, call the function immediately.\n // Otherwise, add it to a list of callbacks to run at the end of the animation.\n if (transitionsByElement.size === 0) {\n fn();\n } else {\n transitionCallbacks.add(fn);\n }\n });\n}\n"],"names":[],"version":3,"file":"runAfterTransition.main.js.map"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import {getEventTarget as $d4ee10de306f2510$export$e58f029f0fbfdb29} from "./DOMFunctions.mjs";
|
|
2
|
+
|
|
1
3
|
/*
|
|
2
4
|
* Copyright 2020 Adobe. All rights reserved.
|
|
3
5
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -14,6 +16,7 @@
|
|
|
14
16
|
// bugs, e.g. Chrome sometimes fires both transitionend and transitioncancel rather
|
|
15
17
|
// than one or the other. So we need to track what's actually transitioning so that
|
|
16
18
|
// we can ignore these duplicate events.
|
|
19
|
+
|
|
17
20
|
let $bbed8b41f857bcc0$var$transitionsByElement = new Map();
|
|
18
21
|
// A list of callbacks to call once there are no transitioning elements.
|
|
19
22
|
let $bbed8b41f857bcc0$var$transitionCallbacks = new Set();
|
|
@@ -23,31 +26,33 @@ function $bbed8b41f857bcc0$var$setupGlobalEvents() {
|
|
|
23
26
|
return 'propertyName' in event;
|
|
24
27
|
}
|
|
25
28
|
let onTransitionStart = (e)=>{
|
|
26
|
-
|
|
29
|
+
let eventTarget = (0, $d4ee10de306f2510$export$e58f029f0fbfdb29)(e);
|
|
30
|
+
if (!isTransitionEvent(e) || !eventTarget) return;
|
|
27
31
|
// Add the transitioning property to the list for this element.
|
|
28
|
-
let transitions = $bbed8b41f857bcc0$var$transitionsByElement.get(
|
|
32
|
+
let transitions = $bbed8b41f857bcc0$var$transitionsByElement.get(eventTarget);
|
|
29
33
|
if (!transitions) {
|
|
30
34
|
transitions = new Set();
|
|
31
|
-
$bbed8b41f857bcc0$var$transitionsByElement.set(
|
|
35
|
+
$bbed8b41f857bcc0$var$transitionsByElement.set(eventTarget, transitions);
|
|
32
36
|
// The transitioncancel event must be registered on the element itself, rather than as a global
|
|
33
37
|
// event. This enables us to handle when the node is deleted from the document while it is transitioning.
|
|
34
38
|
// In that case, the cancel event would have nowhere to bubble to so we need to handle it directly.
|
|
35
|
-
|
|
39
|
+
eventTarget.addEventListener('transitioncancel', onTransitionEnd, {
|
|
36
40
|
once: true
|
|
37
41
|
});
|
|
38
42
|
}
|
|
39
43
|
transitions.add(e.propertyName);
|
|
40
44
|
};
|
|
41
45
|
let onTransitionEnd = (e)=>{
|
|
42
|
-
|
|
46
|
+
let eventTarget = (0, $d4ee10de306f2510$export$e58f029f0fbfdb29)(e);
|
|
47
|
+
if (!isTransitionEvent(e) || !eventTarget) return;
|
|
43
48
|
// Remove property from list of transitioning properties.
|
|
44
|
-
let properties = $bbed8b41f857bcc0$var$transitionsByElement.get(
|
|
49
|
+
let properties = $bbed8b41f857bcc0$var$transitionsByElement.get(eventTarget);
|
|
45
50
|
if (!properties) return;
|
|
46
51
|
properties.delete(e.propertyName);
|
|
47
52
|
// If empty, remove transitioncancel event, and remove the element from the list of transitioning elements.
|
|
48
53
|
if (properties.size === 0) {
|
|
49
|
-
|
|
50
|
-
$bbed8b41f857bcc0$var$transitionsByElement.delete(
|
|
54
|
+
eventTarget.removeEventListener('transitioncancel', onTransitionEnd);
|
|
55
|
+
$bbed8b41f857bcc0$var$transitionsByElement.delete(eventTarget);
|
|
51
56
|
}
|
|
52
57
|
// If no transitioning elements, call all of the queued callbacks.
|
|
53
58
|
if ($bbed8b41f857bcc0$var$transitionsByElement.size === 0) {
|