@react-aria/utils 3.32.0 → 3.33.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.
@@ -10,7 +10,7 @@ $parcel$export(module.exports, "nodeContains", () => $d723bea02f3e2567$export$42
10
10
  $parcel$export(module.exports, "getActiveElement", () => $d723bea02f3e2567$export$cd4e5573fbe2b576);
11
11
  $parcel$export(module.exports, "getEventTarget", () => $d723bea02f3e2567$export$e58f029f0fbfdb29);
12
12
  // Source: https://github.com/microsoft/tabster/blob/a89fc5d7e332d48f68d03b1ca6e344489d1c3898/src/Shadowdomize/DOMFunctions.ts#L16
13
-
13
+ /* eslint-disable rsp-rules/no-non-shadow-contains */
14
14
 
15
15
  function $d723bea02f3e2567$export$4282f70798064fe0(node, otherNode) {
16
16
  if (!(0, $loak6$reactstatelyflags.shadowDOM)()) return otherNode && node ? node.contains(otherNode) : false;
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;AAAA,kIAAkI;;;AAQ3H,SAAS,0CACd,IAA6B,EAC7B,SAAkC;IAElC,IAAI,CAAC,CAAA,GAAA,kCAAQ,KACX,OAAO,aAAa,OAAO,KAAK,QAAQ,CAAC,aAAa;IAGxD,IAAI,CAAC,QAAQ,CAAC,WACZ,OAAO;IAGT,IAAI,cAAqD;IAEzD,MAAO,gBAAgB,KAAM;QAC3B,IAAI,gBAAgB,MAClB,OAAO;QAGT,IAAI,AAAC,YAAgC,OAAO,KAAK,UAC/C,AAAC,YAAgC,YAAY,EAC7C,qBAAqB;QACrB,cAAc,AAAC,YAAgC,YAAY,CAAE,UAAU;aAClE,IAAI,CAAA,GAAA,sCAAW,EAAE,cACtB,4BAA4B;QAC5B,cAAc,YAAY,IAAI;aAE9B,cAAc,YAAY,UAAU;IAExC;IAEA,OAAO;AACT;AAKO,MAAM,4CAAmB,CAAC,MAAgB,QAAQ;QAOvD;IANA,IAAI,CAAC,CAAA,GAAA,kCAAQ,KACX,OAAO,IAAI,aAAa;IAE1B,IAAI,gBAAgC,IAAI,aAAa;IAErD,MAAO,iBAAiB,gBAAgB,mBACxC,4BAAA,cAAc,UAAU,cAAxB,gDAAA,0BAA0B,aAAa,EACrC,gBAAgB,cAAc,UAAU,CAAC,aAAa;IAGxD,OAAO;AACT;AAKO,SAAS,0CAAgC,KAAQ;IACtD,IAAI,CAAA,GAAA,kCAAQ,OAAO,AAAC,MAAM,MAAM,CAAiB,UAAU,EAAE;QAC3D,IAAI,MAAM,YAAY,EACpB,OAAO,MAAM,YAAY,EAAE,CAAC,EAAE;IAElC;IACA,OAAO,MAAM,MAAM;AACrB","sources":["packages/@react-aria/utils/src/shadowdom/DOMFunctions.ts"],"sourcesContent":["// Source: https://github.com/microsoft/tabster/blob/a89fc5d7e332d48f68d03b1ca6e344489d1c3898/src/Shadowdomize/DOMFunctions.ts#L16\n\nimport {isShadowRoot} from '../domHelpers';\nimport {shadowDOM} from '@react-stately/flags';\n\n/**\n * ShadowDOM safe version of Node.contains.\n */\nexport function nodeContains(\n node: Node | null | undefined,\n otherNode: Node | null | undefined\n): boolean {\n if (!shadowDOM()) {\n return otherNode && node ? node.contains(otherNode) : false;\n }\n\n if (!node || !otherNode) {\n return false;\n }\n\n let currentNode: HTMLElement | Node | null | undefined = otherNode;\n\n while (currentNode !== null) {\n if (currentNode === node) {\n return true;\n }\n\n if ((currentNode as HTMLSlotElement).tagName === 'SLOT' &&\n (currentNode as HTMLSlotElement).assignedSlot) {\n // Element is slotted\n currentNode = (currentNode as HTMLSlotElement).assignedSlot!.parentNode;\n } else if (isShadowRoot(currentNode)) {\n // Element is in shadow root\n currentNode = currentNode.host;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n\n return false;\n}\n\n/**\n * ShadowDOM safe version of document.activeElement.\n */\nexport const getActiveElement = (doc: Document = document): Element | null => {\n if (!shadowDOM()) {\n return doc.activeElement;\n }\n let activeElement: Element | null = doc.activeElement;\n\n while (activeElement && 'shadowRoot' in activeElement &&\n activeElement.shadowRoot?.activeElement) {\n activeElement = activeElement.shadowRoot.activeElement;\n }\n\n return activeElement;\n};\n\n/**\n * ShadowDOM safe version of event.target.\n */\nexport function getEventTarget<T extends Event>(event: T): Element {\n if (shadowDOM() && (event.target as HTMLElement).shadowRoot) {\n if (event.composedPath) {\n return event.composedPath()[0] as Element;\n }\n }\n return event.target as Element;\n}\n"],"names":[],"version":3,"file":"DOMFunctions.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;AAAA,kIAAkI;AAClI,mDAAmD;;AAQ5C,SAAS,0CACd,IAA6B,EAC7B,SAAkC;IAElC,IAAI,CAAC,CAAA,GAAA,kCAAQ,KACX,OAAO,aAAa,OAAO,KAAK,QAAQ,CAAC,aAAa;IAGxD,IAAI,CAAC,QAAQ,CAAC,WACZ,OAAO;IAGT,IAAI,cAAqD;IAEzD,MAAO,gBAAgB,KAAM;QAC3B,IAAI,gBAAgB,MAClB,OAAO;QAGT,IAAI,AAAC,YAAgC,OAAO,KAAK,UAC/C,AAAC,YAAgC,YAAY,EAC7C,qBAAqB;QACrB,cAAc,AAAC,YAAgC,YAAY,CAAE,UAAU;aAClE,IAAI,CAAA,GAAA,sCAAW,EAAE,cACtB,4BAA4B;QAC5B,cAAc,YAAY,IAAI;aAE9B,cAAc,YAAY,UAAU;IAExC;IAEA,OAAO;AACT;AAKO,MAAM,4CAAmB,CAAC,MAAgB,QAAQ;QAOvD;IANA,IAAI,CAAC,CAAA,GAAA,kCAAQ,KACX,OAAO,IAAI,aAAa;IAE1B,IAAI,gBAAgC,IAAI,aAAa;IAErD,MAAO,iBAAiB,gBAAgB,mBACxC,4BAAA,cAAc,UAAU,cAAxB,gDAAA,0BAA0B,aAAa,EACrC,gBAAgB,cAAc,UAAU,CAAC,aAAa;IAGxD,OAAO;AACT;AAKO,SAAS,0CAAgC,KAAQ;IACtD,IAAI,CAAA,GAAA,kCAAQ,OAAO,AAAC,MAAM,MAAM,CAAiB,UAAU,EAAE;QAC3D,IAAI,MAAM,YAAY,EACpB,OAAO,MAAM,YAAY,EAAE,CAAC,EAAE;IAElC;IACA,OAAO,MAAM,MAAM;AACrB","sources":["packages/@react-aria/utils/src/shadowdom/DOMFunctions.ts"],"sourcesContent":["// Source: https://github.com/microsoft/tabster/blob/a89fc5d7e332d48f68d03b1ca6e344489d1c3898/src/Shadowdomize/DOMFunctions.ts#L16\n/* eslint-disable rsp-rules/no-non-shadow-contains */\n\nimport {isShadowRoot} from '../domHelpers';\nimport {shadowDOM} from '@react-stately/flags';\n\n/**\n * ShadowDOM safe version of Node.contains.\n */\nexport function nodeContains(\n node: Node | null | undefined,\n otherNode: Node | null | undefined\n): boolean {\n if (!shadowDOM()) {\n return otherNode && node ? node.contains(otherNode) : false;\n }\n\n if (!node || !otherNode) {\n return false;\n }\n\n let currentNode: HTMLElement | Node | null | undefined = otherNode;\n\n while (currentNode !== null) {\n if (currentNode === node) {\n return true;\n }\n\n if ((currentNode as HTMLSlotElement).tagName === 'SLOT' &&\n (currentNode as HTMLSlotElement).assignedSlot) {\n // Element is slotted\n currentNode = (currentNode as HTMLSlotElement).assignedSlot!.parentNode;\n } else if (isShadowRoot(currentNode)) {\n // Element is in shadow root\n currentNode = currentNode.host;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n\n return false;\n}\n\n/**\n * ShadowDOM safe version of document.activeElement.\n */\nexport const getActiveElement = (doc: Document = document): Element | null => {\n if (!shadowDOM()) {\n return doc.activeElement;\n }\n let activeElement: Element | null = doc.activeElement;\n\n while (activeElement && 'shadowRoot' in activeElement &&\n activeElement.shadowRoot?.activeElement) {\n activeElement = activeElement.shadowRoot.activeElement;\n }\n\n return activeElement;\n};\n\n/**\n * ShadowDOM safe version of event.target.\n */\nexport function getEventTarget<T extends Event>(event: T): Element {\n if (shadowDOM() && (event.target as HTMLElement).shadowRoot) {\n if (event.composedPath) {\n return event.composedPath()[0] as Element;\n }\n }\n return event.target as Element;\n}\n"],"names":[],"version":3,"file":"DOMFunctions.main.js.map"}
@@ -2,7 +2,7 @@ import {isShadowRoot as $431fbd86ca7dc216$export$af51f0f06c0f328a} from "./domHe
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
-
5
+ /* eslint-disable rsp-rules/no-non-shadow-contains */
6
6
 
7
7
  function $d4ee10de306f2510$export$4282f70798064fe0(node, otherNode) {
8
8
  if (!(0, $lcSu5$shadowDOM)()) return otherNode && node ? node.contains(otherNode) : false;
@@ -2,7 +2,7 @@ import {isShadowRoot as $431fbd86ca7dc216$export$af51f0f06c0f328a} from "./domHe
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
-
5
+ /* eslint-disable rsp-rules/no-non-shadow-contains */
6
6
 
7
7
  function $d4ee10de306f2510$export$4282f70798064fe0(node, otherNode) {
8
8
  if (!(0, $lcSu5$shadowDOM)()) return otherNode && node ? node.contains(otherNode) : false;
@@ -1 +1 @@
1
- {"mappings":";;;AAAA,kIAAkI;;;AAQ3H,SAAS,0CACd,IAA6B,EAC7B,SAAkC;IAElC,IAAI,CAAC,CAAA,GAAA,gBAAQ,KACX,OAAO,aAAa,OAAO,KAAK,QAAQ,CAAC,aAAa;IAGxD,IAAI,CAAC,QAAQ,CAAC,WACZ,OAAO;IAGT,IAAI,cAAqD;IAEzD,MAAO,gBAAgB,KAAM;QAC3B,IAAI,gBAAgB,MAClB,OAAO;QAGT,IAAI,AAAC,YAAgC,OAAO,KAAK,UAC/C,AAAC,YAAgC,YAAY,EAC7C,qBAAqB;QACrB,cAAc,AAAC,YAAgC,YAAY,CAAE,UAAU;aAClE,IAAI,CAAA,GAAA,yCAAW,EAAE,cACtB,4BAA4B;QAC5B,cAAc,YAAY,IAAI;aAE9B,cAAc,YAAY,UAAU;IAExC;IAEA,OAAO;AACT;AAKO,MAAM,4CAAmB,CAAC,MAAgB,QAAQ;QAOvD;IANA,IAAI,CAAC,CAAA,GAAA,gBAAQ,KACX,OAAO,IAAI,aAAa;IAE1B,IAAI,gBAAgC,IAAI,aAAa;IAErD,MAAO,iBAAiB,gBAAgB,mBACxC,4BAAA,cAAc,UAAU,cAAxB,gDAAA,0BAA0B,aAAa,EACrC,gBAAgB,cAAc,UAAU,CAAC,aAAa;IAGxD,OAAO;AACT;AAKO,SAAS,0CAAgC,KAAQ;IACtD,IAAI,CAAA,GAAA,gBAAQ,OAAO,AAAC,MAAM,MAAM,CAAiB,UAAU,EAAE;QAC3D,IAAI,MAAM,YAAY,EACpB,OAAO,MAAM,YAAY,EAAE,CAAC,EAAE;IAElC;IACA,OAAO,MAAM,MAAM;AACrB","sources":["packages/@react-aria/utils/src/shadowdom/DOMFunctions.ts"],"sourcesContent":["// Source: https://github.com/microsoft/tabster/blob/a89fc5d7e332d48f68d03b1ca6e344489d1c3898/src/Shadowdomize/DOMFunctions.ts#L16\n\nimport {isShadowRoot} from '../domHelpers';\nimport {shadowDOM} from '@react-stately/flags';\n\n/**\n * ShadowDOM safe version of Node.contains.\n */\nexport function nodeContains(\n node: Node | null | undefined,\n otherNode: Node | null | undefined\n): boolean {\n if (!shadowDOM()) {\n return otherNode && node ? node.contains(otherNode) : false;\n }\n\n if (!node || !otherNode) {\n return false;\n }\n\n let currentNode: HTMLElement | Node | null | undefined = otherNode;\n\n while (currentNode !== null) {\n if (currentNode === node) {\n return true;\n }\n\n if ((currentNode as HTMLSlotElement).tagName === 'SLOT' &&\n (currentNode as HTMLSlotElement).assignedSlot) {\n // Element is slotted\n currentNode = (currentNode as HTMLSlotElement).assignedSlot!.parentNode;\n } else if (isShadowRoot(currentNode)) {\n // Element is in shadow root\n currentNode = currentNode.host;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n\n return false;\n}\n\n/**\n * ShadowDOM safe version of document.activeElement.\n */\nexport const getActiveElement = (doc: Document = document): Element | null => {\n if (!shadowDOM()) {\n return doc.activeElement;\n }\n let activeElement: Element | null = doc.activeElement;\n\n while (activeElement && 'shadowRoot' in activeElement &&\n activeElement.shadowRoot?.activeElement) {\n activeElement = activeElement.shadowRoot.activeElement;\n }\n\n return activeElement;\n};\n\n/**\n * ShadowDOM safe version of event.target.\n */\nexport function getEventTarget<T extends Event>(event: T): Element {\n if (shadowDOM() && (event.target as HTMLElement).shadowRoot) {\n if (event.composedPath) {\n return event.composedPath()[0] as Element;\n }\n }\n return event.target as Element;\n}\n"],"names":[],"version":3,"file":"DOMFunctions.module.js.map"}
1
+ {"mappings":";;;AAAA,kIAAkI;AAClI,mDAAmD;;AAQ5C,SAAS,0CACd,IAA6B,EAC7B,SAAkC;IAElC,IAAI,CAAC,CAAA,GAAA,gBAAQ,KACX,OAAO,aAAa,OAAO,KAAK,QAAQ,CAAC,aAAa;IAGxD,IAAI,CAAC,QAAQ,CAAC,WACZ,OAAO;IAGT,IAAI,cAAqD;IAEzD,MAAO,gBAAgB,KAAM;QAC3B,IAAI,gBAAgB,MAClB,OAAO;QAGT,IAAI,AAAC,YAAgC,OAAO,KAAK,UAC/C,AAAC,YAAgC,YAAY,EAC7C,qBAAqB;QACrB,cAAc,AAAC,YAAgC,YAAY,CAAE,UAAU;aAClE,IAAI,CAAA,GAAA,yCAAW,EAAE,cACtB,4BAA4B;QAC5B,cAAc,YAAY,IAAI;aAE9B,cAAc,YAAY,UAAU;IAExC;IAEA,OAAO;AACT;AAKO,MAAM,4CAAmB,CAAC,MAAgB,QAAQ;QAOvD;IANA,IAAI,CAAC,CAAA,GAAA,gBAAQ,KACX,OAAO,IAAI,aAAa;IAE1B,IAAI,gBAAgC,IAAI,aAAa;IAErD,MAAO,iBAAiB,gBAAgB,mBACxC,4BAAA,cAAc,UAAU,cAAxB,gDAAA,0BAA0B,aAAa,EACrC,gBAAgB,cAAc,UAAU,CAAC,aAAa;IAGxD,OAAO;AACT;AAKO,SAAS,0CAAgC,KAAQ;IACtD,IAAI,CAAA,GAAA,gBAAQ,OAAO,AAAC,MAAM,MAAM,CAAiB,UAAU,EAAE;QAC3D,IAAI,MAAM,YAAY,EACpB,OAAO,MAAM,YAAY,EAAE,CAAC,EAAE;IAElC;IACA,OAAO,MAAM,MAAM;AACrB","sources":["packages/@react-aria/utils/src/shadowdom/DOMFunctions.ts"],"sourcesContent":["// Source: https://github.com/microsoft/tabster/blob/a89fc5d7e332d48f68d03b1ca6e344489d1c3898/src/Shadowdomize/DOMFunctions.ts#L16\n/* eslint-disable rsp-rules/no-non-shadow-contains */\n\nimport {isShadowRoot} from '../domHelpers';\nimport {shadowDOM} from '@react-stately/flags';\n\n/**\n * ShadowDOM safe version of Node.contains.\n */\nexport function nodeContains(\n node: Node | null | undefined,\n otherNode: Node | null | undefined\n): boolean {\n if (!shadowDOM()) {\n return otherNode && node ? node.contains(otherNode) : false;\n }\n\n if (!node || !otherNode) {\n return false;\n }\n\n let currentNode: HTMLElement | Node | null | undefined = otherNode;\n\n while (currentNode !== null) {\n if (currentNode === node) {\n return true;\n }\n\n if ((currentNode as HTMLSlotElement).tagName === 'SLOT' &&\n (currentNode as HTMLSlotElement).assignedSlot) {\n // Element is slotted\n currentNode = (currentNode as HTMLSlotElement).assignedSlot!.parentNode;\n } else if (isShadowRoot(currentNode)) {\n // Element is in shadow root\n currentNode = currentNode.host;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n\n return false;\n}\n\n/**\n * ShadowDOM safe version of document.activeElement.\n */\nexport const getActiveElement = (doc: Document = document): Element | null => {\n if (!shadowDOM()) {\n return doc.activeElement;\n }\n let activeElement: Element | null = doc.activeElement;\n\n while (activeElement && 'shadowRoot' in activeElement &&\n activeElement.shadowRoot?.activeElement) {\n activeElement = activeElement.shadowRoot.activeElement;\n }\n\n return activeElement;\n};\n\n/**\n * ShadowDOM safe version of event.target.\n */\nexport function getEventTarget<T extends Event>(event: T): Element {\n if (shadowDOM() && (event.target as HTMLElement).shadowRoot) {\n if (event.composedPath) {\n return event.composedPath()[0] as Element;\n }\n }\n return event.target as Element;\n}\n"],"names":[],"version":3,"file":"DOMFunctions.module.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;AAAO,MAAM,4CAAmB,CAAC;QACxB;IAAP,OAAO,CAAA,oBAAA,eAAA,yBAAA,GAAI,aAAa,cAAjB,+BAAA,oBAAqB;AAC9B;AAEO,MAAM,4CAAiB,CAC5B;IAEA,IAAI,MAAM,YAAY,MAAM,GAAG,MAAM,KAAK,IACxC,OAAO;IAGT,MAAM,MAAM,0CAAiB;IAC7B,OAAO,IAAI,WAAW,IAAI;AAC5B;AAEA;;CAEC,GACD,SAAS,6BAAO,KAAc;IAC5B,OAAO,UAAU,QACf,OAAO,UAAU,YACjB,cAAc,SACd,OAAO,AAAC,MAAe,QAAQ,KAAK;AACxC;AAKO,SAAS,0CAAa,IAAiB;IAC5C,OAAO,6BAAO,SACZ,KAAK,QAAQ,KAAK,KAAK,sBAAsB,IAC7C,UAAU;AACd","sources":["packages/@react-aria/utils/src/domHelpers.ts"],"sourcesContent":["export const getOwnerDocument = (el: Element | null | undefined): Document => {\n return el?.ownerDocument ?? document;\n};\n\nexport const getOwnerWindow = (\n el: (Window & typeof global) | Element | null | undefined\n): Window & typeof global => {\n if (el && 'window' in el && el.window === el) {\n return el;\n }\n\n const doc = getOwnerDocument(el as Element | null | undefined);\n return doc.defaultView || window;\n};\n\n/**\n * Type guard that checks if a value is a Node. Verifies the presence and type of the nodeType property.\n */\nfunction isNode(value: unknown): value is Node {\n return value !== null &&\n typeof value === 'object' &&\n 'nodeType' in value &&\n typeof (value as Node).nodeType === 'number';\n}\n/**\n * Type guard that checks if a node is a ShadowRoot. Uses nodeType and host property checks to\n * distinguish ShadowRoot from other DocumentFragments.\n */\nexport function isShadowRoot(node: Node | null): node is ShadowRoot {\n return isNode(node) &&\n node.nodeType === Node.DOCUMENT_FRAGMENT_NODE &&\n 'host' in node;\n}\n"],"names":[],"version":3,"file":"domHelpers.main.js.map"}
1
+ {"mappings":";;;;;;;;AAAO,MAAM,4CAAmB,CAAC;QACxB;IAAP,OAAO,CAAA,oBAAA,eAAA,yBAAA,GAAI,aAAa,cAAjB,+BAAA,oBAAqB;AAC9B;AAEO,MAAM,4CAAiB,CAC5B;IAEA,IAAI,MAAM,YAAY,MAAM,GAAG,MAAM,KAAK,IACxC,OAAO;IAGT,MAAM,MAAM,0CAAiB;IAC7B,OAAO,IAAI,WAAW,IAAI;AAC5B;AAEA;;CAEC,GACD,SAAS,6BAAO,KAAc;IAC5B,OAAO,UAAU,QACf,OAAO,UAAU,YACjB,cAAc,SACd,OAAO,AAAC,MAAe,QAAQ,KAAK;AACxC;AAKO,SAAS,0CAAa,IAAiB;IAC5C,OAAO,6BAAO,SACZ,KAAK,QAAQ,KAAK,KAAK,sBAAsB,IAC7C,UAAU;AACd","sources":["packages/@react-aria/utils/src/domHelpers.ts"],"sourcesContent":["export const getOwnerDocument = (el: Element | null | undefined): Document => {\n return el?.ownerDocument ?? document;\n};\n\nexport const getOwnerWindow = (\n el: (Window & typeof globalThis) | Element | null | undefined\n): Window & typeof globalThis => {\n if (el && 'window' in el && el.window === el) {\n return el;\n }\n\n const doc = getOwnerDocument(el as Element | null | undefined);\n return doc.defaultView || window;\n};\n\n/**\n * Type guard that checks if a value is a Node. Verifies the presence and type of the nodeType property.\n */\nfunction isNode(value: unknown): value is Node {\n return value !== null &&\n typeof value === 'object' &&\n 'nodeType' in value &&\n typeof (value as Node).nodeType === 'number';\n}\n/**\n * Type guard that checks if a node is a ShadowRoot. Uses nodeType and host property checks to\n * distinguish ShadowRoot from other DocumentFragments.\n */\nexport function isShadowRoot(node: Node | null): node is ShadowRoot {\n return isNode(node) &&\n node.nodeType === Node.DOCUMENT_FRAGMENT_NODE &&\n 'host' in node;\n}\n"],"names":[],"version":3,"file":"domHelpers.main.js.map"}
@@ -1 +1 @@
1
- {"mappings":"AAAO,MAAM,4CAAmB,CAAC;QACxB;IAAP,OAAO,CAAA,oBAAA,eAAA,yBAAA,GAAI,aAAa,cAAjB,+BAAA,oBAAqB;AAC9B;AAEO,MAAM,4CAAiB,CAC5B;IAEA,IAAI,MAAM,YAAY,MAAM,GAAG,MAAM,KAAK,IACxC,OAAO;IAGT,MAAM,MAAM,0CAAiB;IAC7B,OAAO,IAAI,WAAW,IAAI;AAC5B;AAEA;;CAEC,GACD,SAAS,6BAAO,KAAc;IAC5B,OAAO,UAAU,QACf,OAAO,UAAU,YACjB,cAAc,SACd,OAAO,AAAC,MAAe,QAAQ,KAAK;AACxC;AAKO,SAAS,0CAAa,IAAiB;IAC5C,OAAO,6BAAO,SACZ,KAAK,QAAQ,KAAK,KAAK,sBAAsB,IAC7C,UAAU;AACd","sources":["packages/@react-aria/utils/src/domHelpers.ts"],"sourcesContent":["export const getOwnerDocument = (el: Element | null | undefined): Document => {\n return el?.ownerDocument ?? document;\n};\n\nexport const getOwnerWindow = (\n el: (Window & typeof global) | Element | null | undefined\n): Window & typeof global => {\n if (el && 'window' in el && el.window === el) {\n return el;\n }\n\n const doc = getOwnerDocument(el as Element | null | undefined);\n return doc.defaultView || window;\n};\n\n/**\n * Type guard that checks if a value is a Node. Verifies the presence and type of the nodeType property.\n */\nfunction isNode(value: unknown): value is Node {\n return value !== null &&\n typeof value === 'object' &&\n 'nodeType' in value &&\n typeof (value as Node).nodeType === 'number';\n}\n/**\n * Type guard that checks if a node is a ShadowRoot. Uses nodeType and host property checks to\n * distinguish ShadowRoot from other DocumentFragments.\n */\nexport function isShadowRoot(node: Node | null): node is ShadowRoot {\n return isNode(node) &&\n node.nodeType === Node.DOCUMENT_FRAGMENT_NODE &&\n 'host' in node;\n}\n"],"names":[],"version":3,"file":"domHelpers.module.js.map"}
1
+ {"mappings":"AAAO,MAAM,4CAAmB,CAAC;QACxB;IAAP,OAAO,CAAA,oBAAA,eAAA,yBAAA,GAAI,aAAa,cAAjB,+BAAA,oBAAqB;AAC9B;AAEO,MAAM,4CAAiB,CAC5B;IAEA,IAAI,MAAM,YAAY,MAAM,GAAG,MAAM,KAAK,IACxC,OAAO;IAGT,MAAM,MAAM,0CAAiB;IAC7B,OAAO,IAAI,WAAW,IAAI;AAC5B;AAEA;;CAEC,GACD,SAAS,6BAAO,KAAc;IAC5B,OAAO,UAAU,QACf,OAAO,UAAU,YACjB,cAAc,SACd,OAAO,AAAC,MAAe,QAAQ,KAAK;AACxC;AAKO,SAAS,0CAAa,IAAiB;IAC5C,OAAO,6BAAO,SACZ,KAAK,QAAQ,KAAK,KAAK,sBAAsB,IAC7C,UAAU;AACd","sources":["packages/@react-aria/utils/src/domHelpers.ts"],"sourcesContent":["export const getOwnerDocument = (el: Element | null | undefined): Document => {\n return el?.ownerDocument ?? document;\n};\n\nexport const getOwnerWindow = (\n el: (Window & typeof globalThis) | Element | null | undefined\n): Window & typeof globalThis => {\n if (el && 'window' in el && el.window === el) {\n return el;\n }\n\n const doc = getOwnerDocument(el as Element | null | undefined);\n return doc.defaultView || window;\n};\n\n/**\n * Type guard that checks if a value is a Node. Verifies the presence and type of the nodeType property.\n */\nfunction isNode(value: unknown): value is Node {\n return value !== null &&\n typeof value === 'object' &&\n 'nodeType' in value &&\n typeof (value as Node).nodeType === 'number';\n}\n/**\n * Type guard that checks if a node is a ShadowRoot. Uses nodeType and host property checks to\n * distinguish ShadowRoot from other DocumentFragments.\n */\nexport function isShadowRoot(node: Node | null): node is ShadowRoot {\n return isNode(node) &&\n node.nodeType === Node.DOCUMENT_FRAGMENT_NODE &&\n 'host' in node;\n}\n"],"names":[],"version":3,"file":"domHelpers.module.js.map"}
@@ -1,5 +1,6 @@
1
1
  var $1e2191638e54f613$exports = require("./chain.main.js");
2
2
  var $8c61827343eed941$exports = require("./useId.main.js");
3
+ var $f05dc24eafaeb7e2$exports = require("./mergeRefs.main.js");
3
4
  var $eVrjB$clsx = require("clsx");
4
5
 
5
6
 
@@ -25,6 +26,7 @@ $parcel$export(module.exports, "mergeProps", () => $f847cd1382ea7cd4$export$9d16
25
26
  */
26
27
 
27
28
 
29
+
28
30
  function $f847cd1382ea7cd4$export$9d1611c77c2fe928(...args) {
29
31
  // Start with a base clone of the first argument. This is a lot faster than starting
30
32
  // with an empty object and adding properties as we go.
@@ -41,6 +43,7 @@ function $f847cd1382ea7cd4$export$9d1611c77c2fe928(...args) {
41
43
  key[0] === 'o' && key[1] === 'n' && key.charCodeAt(2) >= /* 'A' */ 65 && key.charCodeAt(2) <= /* 'Z' */ 90) result[key] = (0, $1e2191638e54f613$exports.chain)(a, b);
42
44
  else if ((key === 'className' || key === 'UNSAFE_className') && typeof a === 'string' && typeof b === 'string') result[key] = (0, ($parcel$interopDefault($eVrjB$clsx)))(a, b);
43
45
  else if (key === 'id' && a && b) result.id = (0, $8c61827343eed941$exports.mergeIds)(a, b);
46
+ else if (key === 'ref' && a && b) result.ref = (0, $f05dc24eafaeb7e2$exports.mergeRefs)(a, b);
44
47
  else result[key] = b !== undefined ? b : a;
45
48
  }
46
49
  }
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAwBM,SAAS,0CAAiC,GAAG,IAAO;IACzD,oFAAoF;IACpF,uDAAuD;IACvD,IAAI,SAAgB;QAAC,GAAG,IAAI,CAAC,EAAE;IAAA;IAC/B,IAAK,IAAI,IAAI,GAAG,IAAI,KAAK,MAAM,EAAE,IAAK;QACpC,IAAI,QAAQ,IAAI,CAAC,EAAE;QACnB,IAAK,IAAI,OAAO,MAAO;YACrB,IAAI,IAAI,MAAM,CAAC,IAAI;YACnB,IAAI,IAAI,KAAK,CAAC,IAAI;YAElB,eAAe;YACf,IACE,OAAO,MAAM,cACb,OAAO,MAAM,cACb,qCAAqC;YACrC,GAAG,CAAC,EAAE,KAAK,OACX,GAAG,CAAC,EAAE,KAAK,OACX,IAAI,UAAU,CAAC,MAAM,OAAO,GAAG,MAC/B,IAAI,UAAU,CAAC,MAAM,OAAO,GAAG,IAE/B,MAAM,CAAC,IAAI,GAAG,CAAA,GAAA,+BAAI,EAAE,GAAG;iBAGlB,IACL,AAAC,CAAA,QAAQ,eAAe,QAAQ,kBAAiB,KACjD,OAAO,MAAM,YACb,OAAO,MAAM,UAEb,MAAM,CAAC,IAAI,GAAG,CAAA,GAAA,qCAAG,EAAE,GAAG;iBACjB,IAAI,QAAQ,QAAQ,KAAK,GAC9B,OAAO,EAAE,GAAG,CAAA,GAAA,kCAAO,EAAE,GAAG;iBAGxB,MAAM,CAAC,IAAI,GAAG,MAAM,YAAY,IAAI;QAExC;IACF;IAEA,OAAO;AACT","sources":["packages/@react-aria/utils/src/mergeProps.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {chain} from './chain';\nimport clsx from 'clsx';\nimport {mergeIds} from './useId';\n\ninterface Props {\n [key: string]: any\n}\n\ntype PropsArg = Props | null | undefined;\n\n// taken from: https://stackoverflow.com/questions/51603250/typescript-3-parameter-list-intersection-type/51604379#51604379\ntype TupleTypes<T> = { [P in keyof T]: T[P] } extends { [key: number]: infer V } ? NullToObject<V> : never;\ntype NullToObject<T> = T extends (null | undefined) ? {} : T;\n\ntype UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;\n\n/**\n * Merges multiple props objects together. Event handlers are chained,\n * classNames are combined, and ids are deduplicated.\n * For all other props, the last prop object overrides all previous ones.\n * @param args - Multiple sets of props to merge together.\n */\nexport function mergeProps<T extends PropsArg[]>(...args: T): UnionToIntersection<TupleTypes<T>> {\n // Start with a base clone of the first argument. This is a lot faster than starting\n // with an empty object and adding properties as we go.\n let result: Props = {...args[0]};\n for (let i = 1; i < args.length; i++) {\n let props = args[i];\n for (let key in props) {\n let a = result[key];\n let b = props[key];\n\n // Chain events\n if (\n typeof a === 'function' &&\n typeof b === 'function' &&\n // This is a lot faster than a regex.\n key[0] === 'o' &&\n key[1] === 'n' &&\n key.charCodeAt(2) >= /* 'A' */ 65 &&\n key.charCodeAt(2) <= /* 'Z' */ 90\n ) {\n result[key] = chain(a, b);\n\n // Merge classnames, sometimes classNames are empty string which eval to false, so we just need to do a type check\n } else if (\n (key === 'className' || key === 'UNSAFE_className') &&\n typeof a === 'string' &&\n typeof b === 'string'\n ) {\n result[key] = clsx(a, b);\n } else if (key === 'id' && a && b) {\n result.id = mergeIds(a, b);\n // Override others\n } else {\n result[key] = b !== undefined ? b : a;\n }\n }\n }\n\n return result as UnionToIntersection<TupleTypes<T>>;\n}\n"],"names":[],"version":3,"file":"mergeProps.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAyBM,SAAS,0CAAiC,GAAG,IAAO;IACzD,oFAAoF;IACpF,uDAAuD;IACvD,IAAI,SAAgB;QAAC,GAAG,IAAI,CAAC,EAAE;IAAA;IAC/B,IAAK,IAAI,IAAI,GAAG,IAAI,KAAK,MAAM,EAAE,IAAK;QACpC,IAAI,QAAQ,IAAI,CAAC,EAAE;QACnB,IAAK,IAAI,OAAO,MAAO;YACrB,IAAI,IAAI,MAAM,CAAC,IAAI;YACnB,IAAI,IAAI,KAAK,CAAC,IAAI;YAElB,eAAe;YACf,IACE,OAAO,MAAM,cACb,OAAO,MAAM,cACb,qCAAqC;YACrC,GAAG,CAAC,EAAE,KAAK,OACX,GAAG,CAAC,EAAE,KAAK,OACX,IAAI,UAAU,CAAC,MAAM,OAAO,GAAG,MAC/B,IAAI,UAAU,CAAC,MAAM,OAAO,GAAG,IAE/B,MAAM,CAAC,IAAI,GAAG,CAAA,GAAA,+BAAI,EAAE,GAAG;iBAGlB,IACL,AAAC,CAAA,QAAQ,eAAe,QAAQ,kBAAiB,KACjD,OAAO,MAAM,YACb,OAAO,MAAM,UAEb,MAAM,CAAC,IAAI,GAAG,CAAA,GAAA,qCAAG,EAAE,GAAG;iBACjB,IAAI,QAAQ,QAAQ,KAAK,GAC9B,OAAO,EAAE,GAAG,CAAA,GAAA,kCAAO,EAAE,GAAG;iBACnB,IAAI,QAAQ,SAAS,KAAK,GAC/B,OAAO,GAAG,GAAG,CAAA,GAAA,mCAAQ,EAAE,GAAG;iBAG1B,MAAM,CAAC,IAAI,GAAG,MAAM,YAAY,IAAI;QAExC;IACF;IAEA,OAAO;AACT","sources":["packages/@react-aria/utils/src/mergeProps.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {chain} from './chain';\nimport clsx from 'clsx';\nimport {mergeIds} from './useId';\nimport {mergeRefs} from './mergeRefs';\n\ninterface Props {\n [key: string]: any\n}\n\ntype PropsArg = Props | null | undefined;\n\n// taken from: https://stackoverflow.com/questions/51603250/typescript-3-parameter-list-intersection-type/51604379#51604379\ntype TupleTypes<T> = { [P in keyof T]: T[P] } extends { [key: number]: infer V } ? NullToObject<V> : never;\ntype NullToObject<T> = T extends (null | undefined) ? {} : T;\n\ntype UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;\n\n/**\n * Merges multiple props objects together. Event handlers are chained,\n * classNames are combined, ids are deduplicated, and refs are merged.\n * For all other props, the last prop object overrides all previous ones.\n * @param args - Multiple sets of props to merge together.\n */\nexport function mergeProps<T extends PropsArg[]>(...args: T): UnionToIntersection<TupleTypes<T>> {\n // Start with a base clone of the first argument. This is a lot faster than starting\n // with an empty object and adding properties as we go.\n let result: Props = {...args[0]};\n for (let i = 1; i < args.length; i++) {\n let props = args[i];\n for (let key in props) {\n let a = result[key];\n let b = props[key];\n\n // Chain events\n if (\n typeof a === 'function' &&\n typeof b === 'function' &&\n // This is a lot faster than a regex.\n key[0] === 'o' &&\n key[1] === 'n' &&\n key.charCodeAt(2) >= /* 'A' */ 65 &&\n key.charCodeAt(2) <= /* 'Z' */ 90\n ) {\n result[key] = chain(a, b);\n\n // Merge classnames, sometimes classNames are empty string which eval to false, so we just need to do a type check\n } else if (\n (key === 'className' || key === 'UNSAFE_className') &&\n typeof a === 'string' &&\n typeof b === 'string'\n ) {\n result[key] = clsx(a, b);\n } else if (key === 'id' && a && b) {\n result.id = mergeIds(a, b);\n } else if (key === 'ref' && a && b) {\n result.ref = mergeRefs(a, b);\n // Override others\n } else {\n result[key] = b !== undefined ? b : a;\n }\n }\n }\n\n return result as UnionToIntersection<TupleTypes<T>>;\n}\n"],"names":[],"version":3,"file":"mergeProps.main.js.map"}
@@ -1,5 +1,6 @@
1
1
  import {chain as $ff5963eb1fccf552$export$e08e3b67e392101e} from "./chain.mjs";
2
2
  import {mergeIds as $bdb11010cef70236$export$cd8c9cb68f842629} from "./useId.mjs";
3
+ import {mergeRefs as $5dc95899b306f630$export$c9058316764c140e} from "./mergeRefs.mjs";
3
4
  import $7jXr9$clsx from "clsx";
4
5
 
5
6
  /*
@@ -15,6 +16,7 @@ import $7jXr9$clsx from "clsx";
15
16
  */
16
17
 
17
18
 
19
+
18
20
  function $3ef42575df84b30b$export$9d1611c77c2fe928(...args) {
19
21
  // Start with a base clone of the first argument. This is a lot faster than starting
20
22
  // with an empty object and adding properties as we go.
@@ -31,6 +33,7 @@ function $3ef42575df84b30b$export$9d1611c77c2fe928(...args) {
31
33
  key[0] === 'o' && key[1] === 'n' && key.charCodeAt(2) >= /* 'A' */ 65 && key.charCodeAt(2) <= /* 'Z' */ 90) result[key] = (0, $ff5963eb1fccf552$export$e08e3b67e392101e)(a, b);
32
34
  else if ((key === 'className' || key === 'UNSAFE_className') && typeof a === 'string' && typeof b === 'string') result[key] = (0, $7jXr9$clsx)(a, b);
33
35
  else if (key === 'id' && a && b) result.id = (0, $bdb11010cef70236$export$cd8c9cb68f842629)(a, b);
36
+ else if (key === 'ref' && a && b) result.ref = (0, $5dc95899b306f630$export$c9058316764c140e)(a, b);
34
37
  else result[key] = b !== undefined ? b : a;
35
38
  }
36
39
  }
@@ -1,5 +1,6 @@
1
1
  import {chain as $ff5963eb1fccf552$export$e08e3b67e392101e} from "./chain.module.js";
2
2
  import {mergeIds as $bdb11010cef70236$export$cd8c9cb68f842629} from "./useId.module.js";
3
+ import {mergeRefs as $5dc95899b306f630$export$c9058316764c140e} from "./mergeRefs.module.js";
3
4
  import $7jXr9$clsx from "clsx";
4
5
 
5
6
  /*
@@ -15,6 +16,7 @@ import $7jXr9$clsx from "clsx";
15
16
  */
16
17
 
17
18
 
19
+
18
20
  function $3ef42575df84b30b$export$9d1611c77c2fe928(...args) {
19
21
  // Start with a base clone of the first argument. This is a lot faster than starting
20
22
  // with an empty object and adding properties as we go.
@@ -31,6 +33,7 @@ function $3ef42575df84b30b$export$9d1611c77c2fe928(...args) {
31
33
  key[0] === 'o' && key[1] === 'n' && key.charCodeAt(2) >= /* 'A' */ 65 && key.charCodeAt(2) <= /* 'Z' */ 90) result[key] = (0, $ff5963eb1fccf552$export$e08e3b67e392101e)(a, b);
32
34
  else if ((key === 'className' || key === 'UNSAFE_className') && typeof a === 'string' && typeof b === 'string') result[key] = (0, $7jXr9$clsx)(a, b);
33
35
  else if (key === 'id' && a && b) result.id = (0, $bdb11010cef70236$export$cd8c9cb68f842629)(a, b);
36
+ else if (key === 'ref' && a && b) result.ref = (0, $5dc95899b306f630$export$c9058316764c140e)(a, b);
34
37
  else result[key] = b !== undefined ? b : a;
35
38
  }
36
39
  }
@@ -1 +1 @@
1
- {"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAwBM,SAAS,0CAAiC,GAAG,IAAO;IACzD,oFAAoF;IACpF,uDAAuD;IACvD,IAAI,SAAgB;QAAC,GAAG,IAAI,CAAC,EAAE;IAAA;IAC/B,IAAK,IAAI,IAAI,GAAG,IAAI,KAAK,MAAM,EAAE,IAAK;QACpC,IAAI,QAAQ,IAAI,CAAC,EAAE;QACnB,IAAK,IAAI,OAAO,MAAO;YACrB,IAAI,IAAI,MAAM,CAAC,IAAI;YACnB,IAAI,IAAI,KAAK,CAAC,IAAI;YAElB,eAAe;YACf,IACE,OAAO,MAAM,cACb,OAAO,MAAM,cACb,qCAAqC;YACrC,GAAG,CAAC,EAAE,KAAK,OACX,GAAG,CAAC,EAAE,KAAK,OACX,IAAI,UAAU,CAAC,MAAM,OAAO,GAAG,MAC/B,IAAI,UAAU,CAAC,MAAM,OAAO,GAAG,IAE/B,MAAM,CAAC,IAAI,GAAG,CAAA,GAAA,yCAAI,EAAE,GAAG;iBAGlB,IACL,AAAC,CAAA,QAAQ,eAAe,QAAQ,kBAAiB,KACjD,OAAO,MAAM,YACb,OAAO,MAAM,UAEb,MAAM,CAAC,IAAI,GAAG,CAAA,GAAA,WAAG,EAAE,GAAG;iBACjB,IAAI,QAAQ,QAAQ,KAAK,GAC9B,OAAO,EAAE,GAAG,CAAA,GAAA,yCAAO,EAAE,GAAG;iBAGxB,MAAM,CAAC,IAAI,GAAG,MAAM,YAAY,IAAI;QAExC;IACF;IAEA,OAAO;AACT","sources":["packages/@react-aria/utils/src/mergeProps.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {chain} from './chain';\nimport clsx from 'clsx';\nimport {mergeIds} from './useId';\n\ninterface Props {\n [key: string]: any\n}\n\ntype PropsArg = Props | null | undefined;\n\n// taken from: https://stackoverflow.com/questions/51603250/typescript-3-parameter-list-intersection-type/51604379#51604379\ntype TupleTypes<T> = { [P in keyof T]: T[P] } extends { [key: number]: infer V } ? NullToObject<V> : never;\ntype NullToObject<T> = T extends (null | undefined) ? {} : T;\n\ntype UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;\n\n/**\n * Merges multiple props objects together. Event handlers are chained,\n * classNames are combined, and ids are deduplicated.\n * For all other props, the last prop object overrides all previous ones.\n * @param args - Multiple sets of props to merge together.\n */\nexport function mergeProps<T extends PropsArg[]>(...args: T): UnionToIntersection<TupleTypes<T>> {\n // Start with a base clone of the first argument. This is a lot faster than starting\n // with an empty object and adding properties as we go.\n let result: Props = {...args[0]};\n for (let i = 1; i < args.length; i++) {\n let props = args[i];\n for (let key in props) {\n let a = result[key];\n let b = props[key];\n\n // Chain events\n if (\n typeof a === 'function' &&\n typeof b === 'function' &&\n // This is a lot faster than a regex.\n key[0] === 'o' &&\n key[1] === 'n' &&\n key.charCodeAt(2) >= /* 'A' */ 65 &&\n key.charCodeAt(2) <= /* 'Z' */ 90\n ) {\n result[key] = chain(a, b);\n\n // Merge classnames, sometimes classNames are empty string which eval to false, so we just need to do a type check\n } else if (\n (key === 'className' || key === 'UNSAFE_className') &&\n typeof a === 'string' &&\n typeof b === 'string'\n ) {\n result[key] = clsx(a, b);\n } else if (key === 'id' && a && b) {\n result.id = mergeIds(a, b);\n // Override others\n } else {\n result[key] = b !== undefined ? b : a;\n }\n }\n }\n\n return result as UnionToIntersection<TupleTypes<T>>;\n}\n"],"names":[],"version":3,"file":"mergeProps.module.js.map"}
1
+ {"mappings":";;;;;AAAA;;;;;;;;;;CAUC;;;;AAyBM,SAAS,0CAAiC,GAAG,IAAO;IACzD,oFAAoF;IACpF,uDAAuD;IACvD,IAAI,SAAgB;QAAC,GAAG,IAAI,CAAC,EAAE;IAAA;IAC/B,IAAK,IAAI,IAAI,GAAG,IAAI,KAAK,MAAM,EAAE,IAAK;QACpC,IAAI,QAAQ,IAAI,CAAC,EAAE;QACnB,IAAK,IAAI,OAAO,MAAO;YACrB,IAAI,IAAI,MAAM,CAAC,IAAI;YACnB,IAAI,IAAI,KAAK,CAAC,IAAI;YAElB,eAAe;YACf,IACE,OAAO,MAAM,cACb,OAAO,MAAM,cACb,qCAAqC;YACrC,GAAG,CAAC,EAAE,KAAK,OACX,GAAG,CAAC,EAAE,KAAK,OACX,IAAI,UAAU,CAAC,MAAM,OAAO,GAAG,MAC/B,IAAI,UAAU,CAAC,MAAM,OAAO,GAAG,IAE/B,MAAM,CAAC,IAAI,GAAG,CAAA,GAAA,yCAAI,EAAE,GAAG;iBAGlB,IACL,AAAC,CAAA,QAAQ,eAAe,QAAQ,kBAAiB,KACjD,OAAO,MAAM,YACb,OAAO,MAAM,UAEb,MAAM,CAAC,IAAI,GAAG,CAAA,GAAA,WAAG,EAAE,GAAG;iBACjB,IAAI,QAAQ,QAAQ,KAAK,GAC9B,OAAO,EAAE,GAAG,CAAA,GAAA,yCAAO,EAAE,GAAG;iBACnB,IAAI,QAAQ,SAAS,KAAK,GAC/B,OAAO,GAAG,GAAG,CAAA,GAAA,yCAAQ,EAAE,GAAG;iBAG1B,MAAM,CAAC,IAAI,GAAG,MAAM,YAAY,IAAI;QAExC;IACF;IAEA,OAAO;AACT","sources":["packages/@react-aria/utils/src/mergeProps.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {chain} from './chain';\nimport clsx from 'clsx';\nimport {mergeIds} from './useId';\nimport {mergeRefs} from './mergeRefs';\n\ninterface Props {\n [key: string]: any\n}\n\ntype PropsArg = Props | null | undefined;\n\n// taken from: https://stackoverflow.com/questions/51603250/typescript-3-parameter-list-intersection-type/51604379#51604379\ntype TupleTypes<T> = { [P in keyof T]: T[P] } extends { [key: number]: infer V } ? NullToObject<V> : never;\ntype NullToObject<T> = T extends (null | undefined) ? {} : T;\n\ntype UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;\n\n/**\n * Merges multiple props objects together. Event handlers are chained,\n * classNames are combined, ids are deduplicated, and refs are merged.\n * For all other props, the last prop object overrides all previous ones.\n * @param args - Multiple sets of props to merge together.\n */\nexport function mergeProps<T extends PropsArg[]>(...args: T): UnionToIntersection<TupleTypes<T>> {\n // Start with a base clone of the first argument. This is a lot faster than starting\n // with an empty object and adding properties as we go.\n let result: Props = {...args[0]};\n for (let i = 1; i < args.length; i++) {\n let props = args[i];\n for (let key in props) {\n let a = result[key];\n let b = props[key];\n\n // Chain events\n if (\n typeof a === 'function' &&\n typeof b === 'function' &&\n // This is a lot faster than a regex.\n key[0] === 'o' &&\n key[1] === 'n' &&\n key.charCodeAt(2) >= /* 'A' */ 65 &&\n key.charCodeAt(2) <= /* 'Z' */ 90\n ) {\n result[key] = chain(a, b);\n\n // Merge classnames, sometimes classNames are empty string which eval to false, so we just need to do a type check\n } else if (\n (key === 'className' || key === 'UNSAFE_className') &&\n typeof a === 'string' &&\n typeof b === 'string'\n ) {\n result[key] = clsx(a, b);\n } else if (key === 'id' && a && b) {\n result.id = mergeIds(a, b);\n } else if (key === 'ref' && a && b) {\n result.ref = mergeRefs(a, b);\n // Override others\n } else {\n result[key] = b !== undefined ? b : a;\n }\n }\n }\n\n return result as UnionToIntersection<TupleTypes<T>>;\n}\n"],"names":[],"version":3,"file":"mergeProps.module.js.map"}
@@ -1,4 +1,5 @@
1
1
  var $49f0d9486c2408aa$exports = require("./getScrollParents.main.js");
2
+ var $d723bea02f3e2567$exports = require("./DOMFunctions.main.js");
2
3
 
3
4
 
4
5
  function $parcel$export(e, n, v, s) {
@@ -18,6 +19,7 @@ $parcel$export(module.exports, "scrollIntoViewport", () => $449412113267a1fe$exp
18
19
  * OF ANY KIND, either express or implied. See the License for the specific language
19
20
  * governing permissions and limitations under the License.
20
21
  */
22
+
21
23
  function $449412113267a1fe$export$53a0910f038337bd(scrollView, element) {
22
24
  let offsetX = $449412113267a1fe$var$relativeOffset(scrollView, element, 'left');
23
25
  let offsetY = $449412113267a1fe$var$relativeOffset(scrollView, element, 'top');
@@ -54,7 +56,7 @@ function $449412113267a1fe$export$53a0910f038337bd(scrollView, element) {
54
56
  while(child.offsetParent){
55
57
  sum += child[prop];
56
58
  if (child.offsetParent === ancestor) break;
57
- else if (child.offsetParent.contains(ancestor)) {
59
+ else if ((0, $d723bea02f3e2567$exports.nodeContains)(child.offsetParent, ancestor)) {
58
60
  // If the ancestor is not `position:relative`, then we stop at
59
61
  // _its_ offset parent, and we subtract off _its_ offset, so that
60
62
  // we end up with the proper offset from child to ancestor.
@@ -66,7 +68,7 @@ function $449412113267a1fe$export$53a0910f038337bd(scrollView, element) {
66
68
  return sum;
67
69
  }
68
70
  function $449412113267a1fe$export$c826860796309d1b(targetElement, opts) {
69
- if (targetElement && document.contains(targetElement)) {
71
+ if (targetElement && (0, $d723bea02f3e2567$exports.nodeContains)(document, targetElement)) {
70
72
  let root = document.scrollingElement || document.documentElement;
71
73
  let isScrollPrevented = window.getComputedStyle(root).overflow === 'hidden';
72
74
  // If scrolling is not currently prevented then we aren’t in a overlay nor is a overlay open, just use element.scrollIntoView to bring the element into view
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;AAAA;;;;;;;;;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AAI,gBAAgB,cACvB,0CAAe,cAA6B;QAEhD;IACF;AACF","sources":["packages/@react-aria/utils/src/scrollIntoView.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {getScrollParents} from './getScrollParents';\n\ninterface ScrollIntoViewportOpts {\n /** The optional containing element of the target to be centered in the viewport. */\n containingElement?: Element | null\n}\n\n/**\n * Scrolls `scrollView` so that `element` is visible.\n * Similar to `element.scrollIntoView({block: 'nearest'})` (not supported in Edge),\n * but doesn't affect parents above `scrollView`.\n */\nexport function scrollIntoView(scrollView: HTMLElement, element: HTMLElement): void {\n let offsetX = relativeOffset(scrollView, element, 'left');\n let offsetY = relativeOffset(scrollView, element, 'top');\n let width = element.offsetWidth;\n let height = element.offsetHeight;\n let x = scrollView.scrollLeft;\n let y = scrollView.scrollTop;\n\n // Account for top/left border offsetting the scroll top/Left + scroll padding\n let {\n borderTopWidth,\n borderLeftWidth,\n scrollPaddingTop,\n scrollPaddingRight,\n scrollPaddingBottom,\n scrollPaddingLeft\n } = getComputedStyle(scrollView);\n\n let borderAdjustedX = x + parseInt(borderLeftWidth, 10);\n let borderAdjustedY = y + parseInt(borderTopWidth, 10);\n // Ignore end/bottom border via clientHeight/Width instead of offsetHeight/Width\n let maxX = borderAdjustedX + scrollView.clientWidth;\n let maxY = borderAdjustedY + scrollView.clientHeight;\n\n // Get scroll padding values as pixels - defaults to 0 if no scroll padding\n // is used.\n let scrollPaddingTopNumber = parseInt(scrollPaddingTop, 10) || 0;\n let scrollPaddingBottomNumber = parseInt(scrollPaddingBottom, 10) || 0;\n let scrollPaddingRightNumber = parseInt(scrollPaddingRight, 10) || 0;\n let scrollPaddingLeftNumber = parseInt(scrollPaddingLeft, 10) || 0;\n\n if (offsetX <= x + scrollPaddingLeftNumber) {\n x = offsetX - parseInt(borderLeftWidth, 10) - scrollPaddingLeftNumber;\n } else if (offsetX + width > maxX - scrollPaddingRightNumber) {\n x += offsetX + width - maxX + scrollPaddingRightNumber;\n }\n if (offsetY <= borderAdjustedY + scrollPaddingTopNumber) {\n y = offsetY - parseInt(borderTopWidth, 10) - scrollPaddingTopNumber;\n } else if (offsetY + height > maxY - scrollPaddingBottomNumber) {\n y += offsetY + height - maxY + scrollPaddingBottomNumber;\n }\n\n scrollView.scrollLeft = x;\n scrollView.scrollTop = y;\n}\n\n/**\n * Computes the offset left or top from child to ancestor by accumulating\n * offsetLeft or offsetTop through intervening offsetParents.\n */\nfunction relativeOffset(ancestor: HTMLElement, child: HTMLElement, axis: 'left'|'top') {\n const prop = axis === 'left' ? 'offsetLeft' : 'offsetTop';\n let sum = 0;\n while (child.offsetParent) {\n sum += child[prop];\n if (child.offsetParent === ancestor) {\n // Stop once we have found the ancestor we are interested in.\n break;\n } else if (child.offsetParent.contains(ancestor)) {\n // If the ancestor is not `position:relative`, then we stop at\n // _its_ offset parent, and we subtract off _its_ offset, so that\n // we end up with the proper offset from child to ancestor.\n sum -= ancestor[prop];\n break;\n }\n child = child.offsetParent as HTMLElement;\n }\n return sum;\n}\n\n/**\n * Scrolls the `targetElement` so it is visible in the viewport. Accepts an optional `opts.containingElement`\n * that will be centered in the viewport prior to scrolling the targetElement into view. If scrolling is prevented on\n * the body (e.g. targetElement is in a popover), this will only scroll the scroll parents of the targetElement up to but not including the body itself.\n */\nexport function scrollIntoViewport(targetElement: Element | null, opts?: ScrollIntoViewportOpts): void {\n if (targetElement && document.contains(targetElement)) {\n let root = document.scrollingElement || document.documentElement;\n let isScrollPrevented = window.getComputedStyle(root).overflow === 'hidden';\n // If scrolling is not currently prevented then we aren’t in a overlay nor is a overlay open, just use element.scrollIntoView to bring the element into view\n if (!isScrollPrevented) {\n let {left: originalLeft, top: originalTop} = targetElement.getBoundingClientRect();\n\n // use scrollIntoView({block: 'nearest'}) instead of .focus to check if the element is fully in view or not since .focus()\n // won't cause a scroll if the element is already focused and doesn't behave consistently when an element is partially out of view horizontally vs vertically\n targetElement?.scrollIntoView?.({block: 'nearest'});\n let {left: newLeft, top: newTop} = targetElement.getBoundingClientRect();\n // Account for sub pixel differences from rounding\n if ((Math.abs(originalLeft - newLeft) > 1) || (Math.abs(originalTop - newTop) > 1)) {\n opts?.containingElement?.scrollIntoView?.({block: 'center', inline: 'center'});\n targetElement.scrollIntoView?.({block: 'nearest'});\n }\n } else {\n let scrollParents = getScrollParents(targetElement);\n // If scrolling is prevented, we don't want to scroll the body since it might move the overlay partially offscreen and the user can't scroll it back into view.\n if (!isScrollPrevented) {\n scrollParents.push(root);\n }\n for (let scrollParent of scrollParents) {\n scrollIntoView(scrollParent as HTMLElement, targetElement as HTMLElement);\n }\n }\n }\n}\n"],"names":[],"version":3,"file":"scrollIntoView.main.js.map"}
1
+ {"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAeM,SAAS,0CAAe,UAAuB,EAAE,OAAoB;IAC1E,IAAI,UAAU,qCAAe,YAAY,SAAS;IAClD,IAAI,UAAU,qCAAe,YAAY,SAAS;IAClD,IAAI,QAAQ,QAAQ,WAAW;IAC/B,IAAI,SAAS,QAAQ,YAAY;IACjC,IAAI,IAAI,WAAW,UAAU;IAC7B,IAAI,IAAI,WAAW,SAAS;IAE5B,8EAA8E;IAC9E,IAAI,kBACF,cAAc,mBACd,eAAe,oBACf,gBAAgB,sBAChB,kBAAkB,uBAClB,mBAAmB,qBACnB,iBAAiB,EAClB,GAAG,iBAAiB;IAErB,IAAI,kBAAkB,IAAI,SAAS,iBAAiB;IACpD,IAAI,kBAAkB,IAAI,SAAS,gBAAgB;IACnD,gFAAgF;IAChF,IAAI,OAAO,kBAAkB,WAA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HAA0H;YAC1H,6JAA6J;YAC7J;YAJA,IAAI,EAAC,MAAM,YAAY,EAAE,KAAK,WAAW,EAAC,GAAG,cAAc,qBAAqB;YAIhF,0BAAA,qCAAA,gCAAA,cAAe,cAAc,cAA7B,oDAAA,mCAAA,eAAgC;gBAAC,OAAO;YAAS;YACjD,IAAI,EAAC,MAAM,OAAO,EAAE,KAAK,MAAM,EAAC,GAAG,cAAc,qBAAqB;YACtE,kDAAkD;YAClD,IAAI,AAAC,KAAK,GAAG,CAAC,eAAe,WAAW,KAAO,KAAK,GAAG,CAAC,cAAc,UAAU,GAAI;oBAClF,wCAAA,yBACA;gBADA,iBAAA,4BAAA,0BAAA,KAAM,iBAAiB,cAAvB,+CAAA,yCAAA,wBAAyB,cAAc,cAAvC,6DAAA,4CAAA,yBAA0C;oBAAC,OAAO;oBAAU,QAAQ;gBAAQ;iBAC5E,iCAAA,cAAc,cAAc,cAA5B,qDAAA,oCAAA,eAA+B;oBAAC,OAAO;gBAAS;YAClD;QACF,OAAO;YACL,IAAI,gBAAgB,CAAA,GAAA,0CAAe,EAAE;YACrC,+JAA+J;YAC/J,IAAI,CAAC,mBACH,cAAc,IAAI,CAAC;YAErB,KAAK,IAAI,gBAAgB,cACvB,0CAAe,cAA6B;QAEhD;IACF;AACF","sources":["packages/@react-aria/utils/src/scrollIntoView.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {getScrollParents} from './getScrollParents';\nimport {nodeContains} from './shadowdom/DOMFunctions';\n\ninterface ScrollIntoViewportOpts {\n /** The optional containing element of the target to be centered in the viewport. */\n containingElement?: Element | null\n}\n\n/**\n * Scrolls `scrollView` so that `element` is visible.\n * Similar to `element.scrollIntoView({block: 'nearest'})` (not supported in Edge),\n * but doesn't affect parents above `scrollView`.\n */\nexport function scrollIntoView(scrollView: HTMLElement, element: HTMLElement): void {\n let offsetX = relativeOffset(scrollView, element, 'left');\n let offsetY = relativeOffset(scrollView, element, 'top');\n let width = element.offsetWidth;\n let height = element.offsetHeight;\n let x = scrollView.scrollLeft;\n let y = scrollView.scrollTop;\n\n // Account for top/left border offsetting the scroll top/Left + scroll padding\n let {\n borderTopWidth,\n borderLeftWidth,\n scrollPaddingTop,\n scrollPaddingRight,\n scrollPaddingBottom,\n scrollPaddingLeft\n } = getComputedStyle(scrollView);\n\n let borderAdjustedX = x + parseInt(borderLeftWidth, 10);\n let borderAdjustedY = y + parseInt(borderTopWidth, 10);\n // Ignore end/bottom border via clientHeight/Width instead of offsetHeight/Width\n let maxX = borderAdjustedX + scrollView.clientWidth;\n let maxY = borderAdjustedY + scrollView.clientHeight;\n\n // Get scroll padding values as pixels - defaults to 0 if no scroll padding\n // is used.\n let scrollPaddingTopNumber = parseInt(scrollPaddingTop, 10) || 0;\n let scrollPaddingBottomNumber = parseInt(scrollPaddingBottom, 10) || 0;\n let scrollPaddingRightNumber = parseInt(scrollPaddingRight, 10) || 0;\n let scrollPaddingLeftNumber = parseInt(scrollPaddingLeft, 10) || 0;\n\n if (offsetX <= x + scrollPaddingLeftNumber) {\n x = offsetX - parseInt(borderLeftWidth, 10) - scrollPaddingLeftNumber;\n } else if (offsetX + width > maxX - scrollPaddingRightNumber) {\n x += offsetX + width - maxX + scrollPaddingRightNumber;\n }\n if (offsetY <= borderAdjustedY + scrollPaddingTopNumber) {\n y = offsetY - parseInt(borderTopWidth, 10) - scrollPaddingTopNumber;\n } else if (offsetY + height > maxY - scrollPaddingBottomNumber) {\n y += offsetY + height - maxY + scrollPaddingBottomNumber;\n }\n\n scrollView.scrollLeft = x;\n scrollView.scrollTop = y;\n}\n\n/**\n * Computes the offset left or top from child to ancestor by accumulating\n * offsetLeft or offsetTop through intervening offsetParents.\n */\nfunction relativeOffset(ancestor: HTMLElement, child: HTMLElement, axis: 'left'|'top') {\n const prop = axis === 'left' ? 'offsetLeft' : 'offsetTop';\n let sum = 0;\n while (child.offsetParent) {\n sum += child[prop];\n if (child.offsetParent === ancestor) {\n // Stop once we have found the ancestor we are interested in.\n break;\n } else if (nodeContains(child.offsetParent, ancestor)) {\n // If the ancestor is not `position:relative`, then we stop at\n // _its_ offset parent, and we subtract off _its_ offset, so that\n // we end up with the proper offset from child to ancestor.\n sum -= ancestor[prop];\n break;\n }\n child = child.offsetParent as HTMLElement;\n }\n return sum;\n}\n\n/**\n * Scrolls the `targetElement` so it is visible in the viewport. Accepts an optional `opts.containingElement`\n * that will be centered in the viewport prior to scrolling the targetElement into view. If scrolling is prevented on\n * the body (e.g. targetElement is in a popover), this will only scroll the scroll parents of the targetElement up to but not including the body itself.\n */\nexport function scrollIntoViewport(targetElement: Element | null, opts?: ScrollIntoViewportOpts): void {\n if (targetElement && nodeContains(document, targetElement)) {\n let root = document.scrollingElement || document.documentElement;\n let isScrollPrevented = window.getComputedStyle(root).overflow === 'hidden';\n // If scrolling is not currently prevented then we aren’t in a overlay nor is a overlay open, just use element.scrollIntoView to bring the element into view\n if (!isScrollPrevented) {\n let {left: originalLeft, top: originalTop} = targetElement.getBoundingClientRect();\n\n // use scrollIntoView({block: 'nearest'}) instead of .focus to check if the element is fully in view or not since .focus()\n // won't cause a scroll if the element is already focused and doesn't behave consistently when an element is partially out of view horizontally vs vertically\n targetElement?.scrollIntoView?.({block: 'nearest'});\n let {left: newLeft, top: newTop} = targetElement.getBoundingClientRect();\n // Account for sub pixel differences from rounding\n if ((Math.abs(originalLeft - newLeft) > 1) || (Math.abs(originalTop - newTop) > 1)) {\n opts?.containingElement?.scrollIntoView?.({block: 'center', inline: 'center'});\n targetElement.scrollIntoView?.({block: 'nearest'});\n }\n } else {\n let scrollParents = getScrollParents(targetElement);\n // If scrolling is prevented, we don't want to scroll the body since it might move the overlay partially offscreen and the user can't scroll it back into view.\n if (!isScrollPrevented) {\n scrollParents.push(root);\n }\n for (let scrollParent of scrollParents) {\n scrollIntoView(scrollParent as HTMLElement, targetElement as HTMLElement);\n }\n }\n }\n}\n"],"names":[],"version":3,"file":"scrollIntoView.main.js.map"}
@@ -1,4 +1,5 @@
1
1
  import {getScrollParents as $a40c673dc9f6d9c7$export$94ed1c92c7beeb22} from "./getScrollParents.mjs";
2
+ import {nodeContains as $d4ee10de306f2510$export$4282f70798064fe0} from "./DOMFunctions.mjs";
2
3
 
3
4
  /*
4
5
  * Copyright 2020 Adobe. All rights reserved.
@@ -11,6 +12,7 @@ import {getScrollParents as $a40c673dc9f6d9c7$export$94ed1c92c7beeb22} from "./g
11
12
  * OF ANY KIND, either express or implied. See the License for the specific language
12
13
  * governing permissions and limitations under the License.
13
14
  */
15
+
14
16
  function $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollView, element) {
15
17
  let offsetX = $2f04cbc44ee30ce0$var$relativeOffset(scrollView, element, 'left');
16
18
  let offsetY = $2f04cbc44ee30ce0$var$relativeOffset(scrollView, element, 'top');
@@ -47,7 +49,7 @@ function $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollView, element) {
47
49
  while(child.offsetParent){
48
50
  sum += child[prop];
49
51
  if (child.offsetParent === ancestor) break;
50
- else if (child.offsetParent.contains(ancestor)) {
52
+ else if ((0, $d4ee10de306f2510$export$4282f70798064fe0)(child.offsetParent, ancestor)) {
51
53
  // If the ancestor is not `position:relative`, then we stop at
52
54
  // _its_ offset parent, and we subtract off _its_ offset, so that
53
55
  // we end up with the proper offset from child to ancestor.
@@ -59,7 +61,7 @@ function $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollView, element) {
59
61
  return sum;
60
62
  }
61
63
  function $2f04cbc44ee30ce0$export$c826860796309d1b(targetElement, opts) {
62
- if (targetElement && document.contains(targetElement)) {
64
+ if (targetElement && (0, $d4ee10de306f2510$export$4282f70798064fe0)(document, targetElement)) {
63
65
  let root = document.scrollingElement || document.documentElement;
64
66
  let isScrollPrevented = window.getComputedStyle(root).overflow === 'hidden';
65
67
  // If scrolling is not currently prevented then we aren’t in a overlay nor is a overlay open, just use element.scrollIntoView to bring the element into view
@@ -1,4 +1,5 @@
1
1
  import {getScrollParents as $a40c673dc9f6d9c7$export$94ed1c92c7beeb22} from "./getScrollParents.module.js";
2
+ import {nodeContains as $d4ee10de306f2510$export$4282f70798064fe0} from "./DOMFunctions.module.js";
2
3
 
3
4
  /*
4
5
  * Copyright 2020 Adobe. All rights reserved.
@@ -11,6 +12,7 @@ import {getScrollParents as $a40c673dc9f6d9c7$export$94ed1c92c7beeb22} from "./g
11
12
  * OF ANY KIND, either express or implied. See the License for the specific language
12
13
  * governing permissions and limitations under the License.
13
14
  */
15
+
14
16
  function $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollView, element) {
15
17
  let offsetX = $2f04cbc44ee30ce0$var$relativeOffset(scrollView, element, 'left');
16
18
  let offsetY = $2f04cbc44ee30ce0$var$relativeOffset(scrollView, element, 'top');
@@ -47,7 +49,7 @@ function $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollView, element) {
47
49
  while(child.offsetParent){
48
50
  sum += child[prop];
49
51
  if (child.offsetParent === ancestor) break;
50
- else if (child.offsetParent.contains(ancestor)) {
52
+ else if ((0, $d4ee10de306f2510$export$4282f70798064fe0)(child.offsetParent, ancestor)) {
51
53
  // If the ancestor is not `position:relative`, then we stop at
52
54
  // _its_ offset parent, and we subtract off _its_ offset, so that
53
55
  // we end up with the proper offset from child to ancestor.
@@ -59,7 +61,7 @@ function $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollView, element) {
59
61
  return sum;
60
62
  }
61
63
  function $2f04cbc44ee30ce0$export$c826860796309d1b(targetElement, opts) {
62
- if (targetElement && document.contains(targetElement)) {
64
+ if (targetElement && (0, $d4ee10de306f2510$export$4282f70798064fe0)(document, targetElement)) {
63
65
  let root = document.scrollingElement || document.documentElement;
64
66
  let isScrollPrevented = window.getComputedStyle(root).overflow === 'hidden';
65
67
  // If scrolling is not currently prevented then we aren’t in a overlay nor is a overlay open, just use element.scrollIntoView to bring the element into view
@@ -1 +1 @@
1
- {"mappings":";;AAAA;;;;;;;;;;CAUC;AAcM,SAAS,0CAAe,UAAuB,EAAE,OAAoB;IAC1E,IAAI,UAAU,qCAAe,YAAY,SAAS;IAClD,IAAI,UAAU,qCAAe,YAAY,SAAS;IAClD,IAAI,QAAQ,QAAQ,WAAW;IAC/B,IAAI,SAAS,QAAQ,YAAY;IACjC,IAAI,IAAI,WAAW,UAAU;IAC7B,IAAI,IAAI,WAAW,SAAS;IAE5B,8EAA8E;IAC9E,IAAI,kBACF,cAAc,mBACd,eAAe,oBACf,gBAAgB,sBAChB,kBAAkB,uBAClB,mBAAmB,qBACnB,iBAAiB,EAClB,GAAG,iBAAiB;IAErB,IAAI,kBAAkB,IAAI,SAAS,iBAAiB;IACpD,IAAI,kBAAkB,IAAI,SAAS,gBAAgB;IACnD,gFAAgF;IAChF,IAAI,OAAO,kBAAkB,WAAW,WAAW;IACnD,IAAI,OAAO,kBAAkB,WAAW,YAAY;IAEpD,2EAA2E;IAC3E,WAAW;IACX,IAAI,yBAAyB,SAAS,kBAAkB,OAAO;IAC/D,IAAI,4BAA4B,SAAS,qBAAqB,OAAO;IACrE,IAAI,2BAA2B,SAAS,oBAAoB,OAAO;IACnE,IAAI,0BAA0B,SAAS,mBAAmB,OAAO;IAEjE,IAAI,WAAW,IAAI,yBACjB,IAAI,UAAU,SAAS,iBAAiB,MAAM;SACzC,IAAI,UAAU,QAAQ,OAAO,0BAClC,KAAK,UAAU,QAAQ,OAAO;IAEhC,IAAI,WAAW,kBAAkB,wBAC/B,IAAI,UAAU,SAAS,gBAAgB,MAAM;SACxC,IAAI,UAAU,SAAS,OAAO,2BACnC,KAAK,UAAU,SAAS,OAAO;IAGjC,WAAW,UAAU,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5E,iCAAA,cAAc,cAAc,cAA5B,qDAAA,oCAAA,eAA+B;oBAAC,OAAO;gBAAS;YAClD;QACF,OAAO;YACL,IAAI,gBAAgB,CAAA,GAAA,yCAAe,EAAE;YACrC,+JAA+J;YAC/J,IAAI,CAAC,mBACH,cAAc,IAAI,CAAC;YAErB,KAAK,IAAI,gBAAgB,cACvB,0CAAe,cAA6B;QAEhD;IACF;AACF","sources":["packages/@react-aria/utils/src/scrollIntoView.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {getScrollParents} from './getScrollParents';\n\ninterface ScrollIntoViewportOpts {\n /** The optional containing element of the target to be centered in the viewport. */\n containingElement?: Element | null\n}\n\n/**\n * Scrolls `scrollView` so that `element` is visible.\n * Similar to `element.scrollIntoView({block: 'nearest'})` (not supported in Edge),\n * but doesn't affect parents above `scrollView`.\n */\nexport function scrollIntoView(scrollView: HTMLElement, element: HTMLElement): void {\n let offsetX = relativeOffset(scrollView, element, 'left');\n let offsetY = relativeOffset(scrollView, element, 'top');\n let width = element.offsetWidth;\n let height = element.offsetHeight;\n let x = scrollView.scrollLeft;\n let y = scrollView.scrollTop;\n\n // Account for top/left border offsetting the scroll top/Left + scroll padding\n let {\n borderTopWidth,\n borderLeftWidth,\n scrollPaddingTop,\n scrollPaddingRight,\n scrollPaddingBottom,\n scrollPaddingLeft\n } = getComputedStyle(scrollView);\n\n let borderAdjustedX = x + parseInt(borderLeftWidth, 10);\n let borderAdjustedY = y + parseInt(borderTopWidth, 10);\n // Ignore end/bottom border via clientHeight/Width instead of offsetHeight/Width\n let maxX = borderAdjustedX + scrollView.clientWidth;\n let maxY = borderAdjustedY + scrollView.clientHeight;\n\n // Get scroll padding values as pixels - defaults to 0 if no scroll padding\n // is used.\n let scrollPaddingTopNumber = parseInt(scrollPaddingTop, 10) || 0;\n let scrollPaddingBottomNumber = parseInt(scrollPaddingBottom, 10) || 0;\n let scrollPaddingRightNumber = parseInt(scrollPaddingRight, 10) || 0;\n let scrollPaddingLeftNumber = parseInt(scrollPaddingLeft, 10) || 0;\n\n if (offsetX <= x + scrollPaddingLeftNumber) {\n x = offsetX - parseInt(borderLeftWidth, 10) - scrollPaddingLeftNumber;\n } else if (offsetX + width > maxX - scrollPaddingRightNumber) {\n x += offsetX + width - maxX + scrollPaddingRightNumber;\n }\n if (offsetY <= borderAdjustedY + scrollPaddingTopNumber) {\n y = offsetY - parseInt(borderTopWidth, 10) - scrollPaddingTopNumber;\n } else if (offsetY + height > maxY - scrollPaddingBottomNumber) {\n y += offsetY + height - maxY + scrollPaddingBottomNumber;\n }\n\n scrollView.scrollLeft = x;\n scrollView.scrollTop = y;\n}\n\n/**\n * Computes the offset left or top from child to ancestor by accumulating\n * offsetLeft or offsetTop through intervening offsetParents.\n */\nfunction relativeOffset(ancestor: HTMLElement, child: HTMLElement, axis: 'left'|'top') {\n const prop = axis === 'left' ? 'offsetLeft' : 'offsetTop';\n let sum = 0;\n while (child.offsetParent) {\n sum += child[prop];\n if (child.offsetParent === ancestor) {\n // Stop once we have found the ancestor we are interested in.\n break;\n } else if (child.offsetParent.contains(ancestor)) {\n // If the ancestor is not `position:relative`, then we stop at\n // _its_ offset parent, and we subtract off _its_ offset, so that\n // we end up with the proper offset from child to ancestor.\n sum -= ancestor[prop];\n break;\n }\n child = child.offsetParent as HTMLElement;\n }\n return sum;\n}\n\n/**\n * Scrolls the `targetElement` so it is visible in the viewport. Accepts an optional `opts.containingElement`\n * that will be centered in the viewport prior to scrolling the targetElement into view. If scrolling is prevented on\n * the body (e.g. targetElement is in a popover), this will only scroll the scroll parents of the targetElement up to but not including the body itself.\n */\nexport function scrollIntoViewport(targetElement: Element | null, opts?: ScrollIntoViewportOpts): void {\n if (targetElement && document.contains(targetElement)) {\n let root = document.scrollingElement || document.documentElement;\n let isScrollPrevented = window.getComputedStyle(root).overflow === 'hidden';\n // If scrolling is not currently prevented then we aren’t in a overlay nor is a overlay open, just use element.scrollIntoView to bring the element into view\n if (!isScrollPrevented) {\n let {left: originalLeft, top: originalTop} = targetElement.getBoundingClientRect();\n\n // use scrollIntoView({block: 'nearest'}) instead of .focus to check if the element is fully in view or not since .focus()\n // won't cause a scroll if the element is already focused and doesn't behave consistently when an element is partially out of view horizontally vs vertically\n targetElement?.scrollIntoView?.({block: 'nearest'});\n let {left: newLeft, top: newTop} = targetElement.getBoundingClientRect();\n // Account for sub pixel differences from rounding\n if ((Math.abs(originalLeft - newLeft) > 1) || (Math.abs(originalTop - newTop) > 1)) {\n opts?.containingElement?.scrollIntoView?.({block: 'center', inline: 'center'});\n targetElement.scrollIntoView?.({block: 'nearest'});\n }\n } else {\n let scrollParents = getScrollParents(targetElement);\n // If scrolling is prevented, we don't want to scroll the body since it might move the overlay partially offscreen and the user can't scroll it back into view.\n if (!isScrollPrevented) {\n scrollParents.push(root);\n }\n for (let scrollParent of scrollParents) {\n scrollIntoView(scrollParent as HTMLElement, targetElement as HTMLElement);\n }\n }\n }\n}\n"],"names":[],"version":3,"file":"scrollIntoView.module.js.map"}
1
+ {"mappings":";;;AAAA;;;;;;;;;;CAUC;;AAeM,SAAS,0CAAe,UAAuB,EAAE,OAAoB;IAC1E,IAAI,UAAU,qCAAe,YAAY,SAAS;IAClD,IAAI,UAAU,qCAAe,YAAY,SAAS;IAClD,IAAI,QAAQ,QAAQ,WAAW;IAC/B,IAAI,SAAS,QAAQ,YAAY;IACjC,IAAI,IAAI,WAAW,UAAU;IAC7B,IAAI,IAAI,WAAW,SAAS;IAE5B,8EAA8E;IAC9E,IAAI,kBACF,cAAc,mBACd,eAAe,oBACf,gBAAg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AAA,yCAAW,EAAE,UAAU,gBAAgB;QAC1D,IAAI,OAAO,SAAS,gBAAgB,IAAI,SAAS,eAAe;QAChE,IAAI,oBAAoB,OAAO,gBAAgB,CAAC,MAAM,QAAQ,KAAK;QACnE,4JAA4J;QAC5J,IAAI,CAAC,mBAAmB;gBAGtB,0HAA0H;YAC1H,6JAA6J;YAC7J;YAJA,IAAI,EAAC,MAAM,YAAY,EAAE,KAAK,WAAW,EAAC,GAAG,cAAc,qBAAqB;YAIhF,0BAAA,qCAAA,gCAAA,cAAe,cAAc,cAA7B,oDAAA,mCAAA,eAAgC;gBAAC,OAAO;YAAS;YACjD,IAAI,EAAC,MAAM,OAAO,EAAE,KAAK,MAAM,EAAC,GAAG,cAAc,qBAAqB;YACtE,kDAAkD;YAClD,IAAI,AAAC,KAAK,GAAG,CAAC,eAAe,WAAW,KAAO,KAAK,GAAG,CAAC,cAAc,UAAU,GAAI;oBAClF,wCAAA,yBACA;gBADA,iBAAA,4BAAA,0BAAA,KAAM,iBAAiB,cAAvB,+CAAA,yCAAA,wBAAyB,cAAc,cAAvC,6DAAA,4CAAA,yBAA0C;oBAAC,OAAO;oBAAU,QAAQ;gBAAQ;iBAC5E,iCAAA,cAAc,cAAc,cAA5B,qDAAA,oCAAA,eAA+B;oBAAC,OAAO;gBAAS;YAClD;QACF,OAAO;YACL,IAAI,gBAAgB,CAAA,GAAA,yCAAe,EAAE;YACrC,+JAA+J;YAC/J,IAAI,CAAC,mBACH,cAAc,IAAI,CAAC;YAErB,KAAK,IAAI,gBAAgB,cACvB,0CAAe,cAA6B;QAEhD;IACF;AACF","sources":["packages/@react-aria/utils/src/scrollIntoView.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {getScrollParents} from './getScrollParents';\nimport {nodeContains} from './shadowdom/DOMFunctions';\n\ninterface ScrollIntoViewportOpts {\n /** The optional containing element of the target to be centered in the viewport. */\n containingElement?: Element | null\n}\n\n/**\n * Scrolls `scrollView` so that `element` is visible.\n * Similar to `element.scrollIntoView({block: 'nearest'})` (not supported in Edge),\n * but doesn't affect parents above `scrollView`.\n */\nexport function scrollIntoView(scrollView: HTMLElement, element: HTMLElement): void {\n let offsetX = relativeOffset(scrollView, element, 'left');\n let offsetY = relativeOffset(scrollView, element, 'top');\n let width = element.offsetWidth;\n let height = element.offsetHeight;\n let x = scrollView.scrollLeft;\n let y = scrollView.scrollTop;\n\n // Account for top/left border offsetting the scroll top/Left + scroll padding\n let {\n borderTopWidth,\n borderLeftWidth,\n scrollPaddingTop,\n scrollPaddingRight,\n scrollPaddingBottom,\n scrollPaddingLeft\n } = getComputedStyle(scrollView);\n\n let borderAdjustedX = x + parseInt(borderLeftWidth, 10);\n let borderAdjustedY = y + parseInt(borderTopWidth, 10);\n // Ignore end/bottom border via clientHeight/Width instead of offsetHeight/Width\n let maxX = borderAdjustedX + scrollView.clientWidth;\n let maxY = borderAdjustedY + scrollView.clientHeight;\n\n // Get scroll padding values as pixels - defaults to 0 if no scroll padding\n // is used.\n let scrollPaddingTopNumber = parseInt(scrollPaddingTop, 10) || 0;\n let scrollPaddingBottomNumber = parseInt(scrollPaddingBottom, 10) || 0;\n let scrollPaddingRightNumber = parseInt(scrollPaddingRight, 10) || 0;\n let scrollPaddingLeftNumber = parseInt(scrollPaddingLeft, 10) || 0;\n\n if (offsetX <= x + scrollPaddingLeftNumber) {\n x = offsetX - parseInt(borderLeftWidth, 10) - scrollPaddingLeftNumber;\n } else if (offsetX + width > maxX - scrollPaddingRightNumber) {\n x += offsetX + width - maxX + scrollPaddingRightNumber;\n }\n if (offsetY <= borderAdjustedY + scrollPaddingTopNumber) {\n y = offsetY - parseInt(borderTopWidth, 10) - scrollPaddingTopNumber;\n } else if (offsetY + height > maxY - scrollPaddingBottomNumber) {\n y += offsetY + height - maxY + scrollPaddingBottomNumber;\n }\n\n scrollView.scrollLeft = x;\n scrollView.scrollTop = y;\n}\n\n/**\n * Computes the offset left or top from child to ancestor by accumulating\n * offsetLeft or offsetTop through intervening offsetParents.\n */\nfunction relativeOffset(ancestor: HTMLElement, child: HTMLElement, axis: 'left'|'top') {\n const prop = axis === 'left' ? 'offsetLeft' : 'offsetTop';\n let sum = 0;\n while (child.offsetParent) {\n sum += child[prop];\n if (child.offsetParent === ancestor) {\n // Stop once we have found the ancestor we are interested in.\n break;\n } else if (nodeContains(child.offsetParent, ancestor)) {\n // If the ancestor is not `position:relative`, then we stop at\n // _its_ offset parent, and we subtract off _its_ offset, so that\n // we end up with the proper offset from child to ancestor.\n sum -= ancestor[prop];\n break;\n }\n child = child.offsetParent as HTMLElement;\n }\n return sum;\n}\n\n/**\n * Scrolls the `targetElement` so it is visible in the viewport. Accepts an optional `opts.containingElement`\n * that will be centered in the viewport prior to scrolling the targetElement into view. If scrolling is prevented on\n * the body (e.g. targetElement is in a popover), this will only scroll the scroll parents of the targetElement up to but not including the body itself.\n */\nexport function scrollIntoViewport(targetElement: Element | null, opts?: ScrollIntoViewportOpts): void {\n if (targetElement && nodeContains(document, targetElement)) {\n let root = document.scrollingElement || document.documentElement;\n let isScrollPrevented = window.getComputedStyle(root).overflow === 'hidden';\n // If scrolling is not currently prevented then we aren’t in a overlay nor is a overlay open, just use element.scrollIntoView to bring the element into view\n if (!isScrollPrevented) {\n let {left: originalLeft, top: originalTop} = targetElement.getBoundingClientRect();\n\n // use scrollIntoView({block: 'nearest'}) instead of .focus to check if the element is fully in view or not since .focus()\n // won't cause a scroll if the element is already focused and doesn't behave consistently when an element is partially out of view horizontally vs vertically\n targetElement?.scrollIntoView?.({block: 'nearest'});\n let {left: newLeft, top: newTop} = targetElement.getBoundingClientRect();\n // Account for sub pixel differences from rounding\n if ((Math.abs(originalLeft - newLeft) > 1) || (Math.abs(originalTop - newTop) > 1)) {\n opts?.containingElement?.scrollIntoView?.({block: 'center', inline: 'center'});\n targetElement.scrollIntoView?.({block: 'nearest'});\n }\n } else {\n let scrollParents = getScrollParents(targetElement);\n // If scrolling is prevented, we don't want to scroll the body since it might move the overlay partially offscreen and the user can't scroll it back into view.\n if (!isScrollPrevented) {\n scrollParents.push(root);\n }\n for (let scrollParent of scrollParents) {\n scrollIntoView(scrollParent as HTMLElement, targetElement as HTMLElement);\n }\n }\n }\n}\n"],"names":[],"version":3,"file":"scrollIntoView.module.js.map"}
package/dist/types.d.ts CHANGED
@@ -22,7 +22,7 @@ export function useSlotId(depArray?: ReadonlyArray<any>): string;
22
22
  */
23
23
  export function chain(...callbacks: any[]): (...args: any[]) => void;
24
24
  export const getOwnerDocument: (el: Element | null | undefined) => Document;
25
- export const getOwnerWindow: (el: (Window & typeof global) | Element | null | undefined) => Window & typeof global;
25
+ export const getOwnerWindow: (el: (Window & typeof globalThis) | Element | null | undefined) => Window & typeof globalThis;
26
26
  /**
27
27
  * Type guard that checks if a node is a ShadowRoot. Uses nodeType and host property checks to
28
28
  * distinguish ShadowRoot from other DocumentFragments.
@@ -69,6 +69,10 @@ export class ShadowTreeWalker implements TreeWalker {
69
69
  * ShadowDOM safe version of document.createTreeWalker.
70
70
  */
71
71
  export function createShadowTreeWalker(doc: Document, root: Node, whatToShow?: number, filter?: NodeFilter | null): TreeWalker;
72
+ /**
73
+ * Merges multiple refs into one. Works with either callback or object refs.
74
+ */
75
+ export function mergeRefs<T>(...refs: Array<Ref<T> | MutableRefObject<T> | null | undefined>): Ref<T>;
72
76
  interface Props {
73
77
  [key: string]: any;
74
78
  }
@@ -82,15 +86,11 @@ type NullToObject<T> = T extends (null | undefined) ? {} : T;
82
86
  type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
83
87
  /**
84
88
  * Merges multiple props objects together. Event handlers are chained,
85
- * classNames are combined, and ids are deduplicated.
89
+ * classNames are combined, ids are deduplicated, and refs are merged.
86
90
  * For all other props, the last prop object overrides all previous ones.
87
91
  * @param args - Multiple sets of props to merge together.
88
92
  */
89
93
  export function mergeProps<T extends PropsArg[]>(...args: T): UnionToIntersection<TupleTypes<T>>;
90
- /**
91
- * Merges multiple refs into one. Works with either callback or object refs.
92
- */
93
- export function mergeRefs<T>(...refs: Array<Ref<T> | MutableRefObject<T> | null | undefined>): Ref<T>;
94
94
  interface Options {
95
95
  /**
96
96
  * If labelling associated aria properties should be included in the filter.
@@ -1 +1 @@
1
- {"mappings":";;AAiBA,OAAO,MAAM,iBAAiB,OAAO,MAAM,eAE/B,CAAC;ACgBb;;;GAGG;AACH,sBAAsB,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CA4ChD;AAED;;;GAGG;AACH,yBAAyB,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAkBzD;AAED;;;;GAIG;AACH,0BAA0B,QAAQ,GAAE,aAAa,CAAC,GAAG,CAAM,GAAG,MAAM,CAcnE;ACpHD;;GAEG;AACH,sBAAsB,GAAG,SAAS,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAQnE;ACvBD,OAAO,MAAM,mBAAoB,IAAI,OAAO,GAAG,IAAI,GAAG,SAAS,KAAG,QAEjE,CAAC;AAEF,OAAO,MAAM,iBACX,IAAI,CAAC,MAAM,GAAG,OAAO,MAAM,CAAC,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,KACxD,MAAM,GAAG,OAAO,MAOlB,CAAC;AAWF;;;GAGG;AACH,6BAA6B,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,IAAI,UAAU,CAIlE;AC3BD;;GAEG;AACH,6BACE,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,EAC7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D,OAAO,MAAM,4CAA4C,CAAC;AAC1D,OAAO,MAAM,gCAAgC,CAAC;ACE9C,kCAAkC,GAAG,EAAE,YAAU,WAAW,GAAG,IAAI,CAAC,EAAE,OAAO,GAAE,OAAc,GAAG,OAAO,CAsBtG;AAED,iCAAiC,GAAG,EAAE,YAAU,WAAW,GAAG,IAAI,CAAC,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,CA+B7F;AEnCD,4BAA4B,OAAO,EAAE,OAAO,GAAG,OAAO,CAErD;AAED,2BAA2B,OAAO,EAAE,OAAO,GAAG,OAAO,CAEpD;ACDD,OAAO,EAAC,KAAK,EAAE,eAAe,EAAC,MAAM,sBAAsB,CAAC","sources":["packages/@react-aria/utils/src/packages/@react-aria/utils/src/useLayoutEffect.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useId.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/chain.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/domHelpers.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/shadowdom/DOMFunctions.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/shadowdom/ShadowTreeWalker.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/mergeProps.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/mergeRefs.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/filterDOMProps.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/focusWithoutScrolling.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/getOffset.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/platform.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/openLink.tsx","packages/@react-aria/utils/src/packages/@react-aria/utils/src/runAfterTransition.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useDrag1D.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useGlobalListeners.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useLabels.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useObjectRef.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useEffectEvent.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useUpdateEffect.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useUpdateLayoutEffect.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useResizeObserver.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useSyncRef.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/isScrollable.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/getScrollParent.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/getScrollParents.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/keyboard.tsx","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useViewportSize.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useDescription.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useEvent.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useValueEffect.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/scrollIntoView.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/isVirtualEvent.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useDeepMemo.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useFormReset.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useLoadMore.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useLoadMoreSentinel.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/inertValue.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/constants.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/animation.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/isElementVisible.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/isFocusable.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/index.ts","packages/@react-aria/utils/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nexport {useId, mergeIds, useSlotId} from './useId';\nexport {chain} from './chain';\nexport {createShadowTreeWalker, ShadowTreeWalker} from './shadowdom/ShadowTreeWalker';\nexport {getActiveElement, getEventTarget, nodeContains} from './shadowdom/DOMFunctions';\nexport {getOwnerDocument, getOwnerWindow, isShadowRoot} from './domHelpers';\nexport {mergeProps} from './mergeProps';\nexport {mergeRefs} from './mergeRefs';\nexport {filterDOMProps} from './filterDOMProps';\nexport {focusWithoutScrolling} from './focusWithoutScrolling';\nexport {getOffset} from './getOffset';\nexport {openLink, getSyntheticLinkProps, useSyntheticLinkProps, RouterProvider, shouldClientNavigate, useRouter, useLinkProps, handleLinkClick} from './openLink';\nexport {runAfterTransition} from './runAfterTransition';\nexport {useDrag1D} from './useDrag1D';\nexport {useGlobalListeners} from './useGlobalListeners';\nexport {useLabels} from './useLabels';\nexport {useObjectRef} from './useObjectRef';\nexport {useUpdateEffect} from './useUpdateEffect';\nexport {useUpdateLayoutEffect} from './useUpdateLayoutEffect';\nexport {useLayoutEffect} from './useLayoutEffect';\nexport {useResizeObserver} from './useResizeObserver';\nexport {useSyncRef} from './useSyncRef';\nexport {getScrollParent} from './getScrollParent';\nexport {getScrollParents} from './getScrollParents';\nexport {isScrollable} from './isScrollable';\nexport {useViewportSize} from './useViewportSize';\nexport {useDescription} from './useDescription';\nexport {isMac, isIPhone, isIPad, isIOS, isAppleDevice, isWebKit, isChrome, isAndroid, isFirefox} from './platform';\nexport {useEvent} from './useEvent';\nexport {useValueEffect} from './useValueEffect';\nexport {scrollIntoView, scrollIntoViewport} from './scrollIntoView';\nexport {clamp, snapValueToStep} from '@react-stately/utils';\nexport {isVirtualClick, isVirtualPointerEvent} from './isVirtualEvent';\nexport {useEffectEvent} from './useEffectEvent';\nexport {useDeepMemo} from './useDeepMemo';\nexport {useFormReset} from './useFormReset';\nexport {useLoadMore} from './useLoadMore';\nexport {useLoadMoreSentinel, useLoadMoreSentinel as UNSTABLE_useLoadMoreSentinel} from './useLoadMoreSentinel';\nexport {inertValue} from './inertValue';\nexport {CLEAR_FOCUS_EVENT, FOCUS_EVENT} from './constants';\nexport {isCtrlKeyPressed, willOpenKeyboard} from './keyboard';\nexport {useEnterAnimation, useExitAnimation} from './animation';\nexport {isFocusable, isTabbable} from './isFocusable';\n\nexport type {LoadMoreSentinelProps} from './useLoadMoreSentinel';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
1
+ {"mappings":";;AAiBA,OAAO,MAAM,iBAAiB,OAAO,MAAM,eAE/B,CAAC;ACgBb;;;GAGG;AACH,sBAAsB,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CA4ChD;AAED;;;GAGG;AACH,yBAAyB,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAkBzD;AAED;;;;GAIG;AACH,0BAA0B,QAAQ,GAAE,aAAa,CAAC,GAAG,CAAM,GAAG,MAAM,CAcnE;ACpHD;;GAEG;AACH,sBAAsB,GAAG,SAAS,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAQnE;ACvBD,OAAO,MAAM,mBAAoB,IAAI,OAAO,GAAG,IAAI,GAAG,SAAS,KAAG,QAEjE,CAAC;AAEF,OAAO,MAAM,iBACX,IAAI,CAAC,MAAM,GAAG,OAAO,UAAU,CAAC,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,K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;CACtB;AAED,6CAAoC,KAAK,EAAE,qBAAqB,EAAE,GAAG,EAAE,YAAU,WAAW,GAAG,IAAI,CAAC,GAAG,IAAI,CAgC1G;AC5DD,2BAA2B,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAQxE;ACGD,OAAO,MAAM,4CAA4C,CAAC;AAC1D,OAAO,MAAM,gCAAgC,CAAC;ACE9C,kCAAkC,GAAG,EAAE,YAAU,WAAW,GAAG,IAAI,CAAC,EAAE,OAAO,GAAE,OAAc,GAAG,OAAO,CAsBtG;AAED,iCAAiC,GAAG,EAAE,YAAU,WAAW,GAAG,IAAI,CAAC,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,CA+B7F;AEnCD,4BAA4B,OAAO,EAAE,OAAO,GAAG,OAAO,CAErD;AAED,2BAA2B,OAAO,EAAE,OAAO,GAAG,OAAO,CAEpD;ACDD,OAAO,EAAC,KAAK,EAAE,eAAe,EAAC,MAAM,sBAAsB,CAAC","sources":["packages/@react-aria/utils/src/packages/@react-aria/utils/src/useLayoutEffect.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useId.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/chain.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/domHelpers.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/shadowdom/DOMFunctions.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/shadowdom/ShadowTreeWalker.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/mergeRefs.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/mergeProps.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/filterDOMProps.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/focusWithoutScrolling.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/getOffset.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/platform.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/openLink.tsx","packages/@react-aria/utils/src/packages/@react-aria/utils/src/runAfterTransition.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useDrag1D.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useGlobalListeners.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useLabels.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useObjectRef.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useEffectEvent.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useUpdateEffect.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useUpdateLayoutEffect.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useResizeObserver.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useSyncRef.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/isScrollable.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/getScrollParent.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/getScrollParents.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/keyboard.tsx","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useViewportSize.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useDescription.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useEvent.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useValueEffect.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/scrollIntoView.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/isVirtualEvent.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useDeepMemo.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useFormReset.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useLoadMore.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/useLoadMoreSentinel.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/inertValue.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/constants.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/animation.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/isElementVisible.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/isFocusable.ts","packages/@react-aria/utils/src/packages/@react-aria/utils/src/index.ts","packages/@react-aria/utils/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nexport {useId, mergeIds, useSlotId} from './useId';\nexport {chain} from './chain';\nexport {createShadowTreeWalker, ShadowTreeWalker} from './shadowdom/ShadowTreeWalker';\nexport {getActiveElement, getEventTarget, nodeContains} from './shadowdom/DOMFunctions';\nexport {getOwnerDocument, getOwnerWindow, isShadowRoot} from './domHelpers';\nexport {mergeProps} from './mergeProps';\nexport {mergeRefs} from './mergeRefs';\nexport {filterDOMProps} from './filterDOMProps';\nexport {focusWithoutScrolling} from './focusWithoutScrolling';\nexport {getOffset} from './getOffset';\nexport {openLink, getSyntheticLinkProps, useSyntheticLinkProps, RouterProvider, shouldClientNavigate, useRouter, useLinkProps, handleLinkClick} from './openLink';\nexport {runAfterTransition} from './runAfterTransition';\nexport {useDrag1D} from './useDrag1D';\nexport {useGlobalListeners} from './useGlobalListeners';\nexport {useLabels} from './useLabels';\nexport {useObjectRef} from './useObjectRef';\nexport {useUpdateEffect} from './useUpdateEffect';\nexport {useUpdateLayoutEffect} from './useUpdateLayoutEffect';\nexport {useLayoutEffect} from './useLayoutEffect';\nexport {useResizeObserver} from './useResizeObserver';\nexport {useSyncRef} from './useSyncRef';\nexport {getScrollParent} from './getScrollParent';\nexport {getScrollParents} from './getScrollParents';\nexport {isScrollable} from './isScrollable';\nexport {useViewportSize} from './useViewportSize';\nexport {useDescription} from './useDescription';\nexport {isMac, isIPhone, isIPad, isIOS, isAppleDevice, isWebKit, isChrome, isAndroid, isFirefox} from './platform';\nexport {useEvent} from './useEvent';\nexport {useValueEffect} from './useValueEffect';\nexport {scrollIntoView, scrollIntoViewport} from './scrollIntoView';\nexport {clamp, snapValueToStep} from '@react-stately/utils';\nexport {isVirtualClick, isVirtualPointerEvent} from './isVirtualEvent';\nexport {useEffectEvent} from './useEffectEvent';\nexport {useDeepMemo} from './useDeepMemo';\nexport {useFormReset} from './useFormReset';\nexport {useLoadMore} from './useLoadMore';\nexport {useLoadMoreSentinel, useLoadMoreSentinel as UNSTABLE_useLoadMoreSentinel} from './useLoadMoreSentinel';\nexport {inertValue} from './inertValue';\nexport {CLEAR_FOCUS_EVENT, FOCUS_EVENT} from './constants';\nexport {isCtrlKeyPressed, willOpenKeyboard} from './keyboard';\nexport {useEnterAnimation, useExitAnimation} from './animation';\nexport {isFocusable, isTabbable} from './isFocusable';\n\nexport type {LoadMoreSentinelProps} from './useLoadMoreSentinel';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
@@ -1,4 +1,5 @@
1
1
  var $16ec41ef3e36c19c$exports = require("./getOffset.main.js");
2
+ var $d723bea02f3e2567$exports = require("./DOMFunctions.main.js");
2
3
  var $hK8r3$react = require("react");
3
4
 
4
5
 
@@ -19,6 +20,7 @@ $parcel$export(module.exports, "useDrag1D", () => $28ed3fb20343b78b$export$7bbed
19
20
  * governing permissions and limitations under the License.
20
21
  */ /* eslint-disable rulesdir/pure-render */
21
22
 
23
+
22
24
  // Keep track of elements that we are currently handling dragging for via useDrag1D.
23
25
  // If there's an ancestor and a descendant both using useDrag1D(), and the user starts
24
26
  // dragging the descendant, we don't want useDrag1D events to fire for the ancestor.
@@ -68,7 +70,7 @@ function $28ed3fb20343b78b$export$7bbed75feba39706(props) {
68
70
  const target = e.currentTarget;
69
71
  // If we're already handling dragging on a descendant with useDrag1D, then
70
72
  // we don't want to handle the drag motion on this target as well.
71
- if ($28ed3fb20343b78b$var$draggingElements.some((elt)=>target.contains(elt))) return;
73
+ if ($28ed3fb20343b78b$var$draggingElements.some((elt)=>(0, $d723bea02f3e2567$exports.nodeContains)(target, elt))) return;
72
74
  $28ed3fb20343b78b$var$draggingElements.push(target);
73
75
  window.addEventListener('mousemove', onMouseDragged, false);
74
76
  window.addEventListener('mouseup', onMouseUp, false);
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC,GAEA,uCAAuC;;AAoBxC,oFAAoF;AACpF,sFAAsF;AACtF,oFAAoF;AACpF,MAAM,yCAAkC,EAAE;AAOnC,SAAS,0CAAU,KAAqB;IAC7C,QAAQ,IAAI,CAAC;IACb,IAAI,gBAAC,YAAY,WAAE,OAAO,eAAE,WAAW,WAAE,OAAO,UAAE,MAAM,oBAAE,gBAAgB,eAAE,WAAW,eAAE,WAAW,oBAAE,gBAAgB,oBAAE,gBAAgB,oBAAE,gBAAgB,EAAC,GAAG;IAC9J,IAAI,cAAc,CAAC,IAAM,gBAAgB,eAAe,EAAE,OAAO,GAAG,EAAE,OAAO;IAC7E,IAAI,gBAAgB,CAAC;QACnB,IAAI,kBAAkB,CAAA,GAAA,mCAAQ,EAAE,aAAa,OAAO,EAAE,SAAS;QAC/D,IAAI,cAAc,YAAY;QAC9B,IAAI,aAAa,UAAU,kBAAkB,cAAc,cAAc;QACzE,OAAO;IACT;IACA,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAE;IACtB,IAAI,eAAe,CAAA,GAAA,mBAAK,EAAE;IAE1B,kFAAkF;IAClF,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAE;0BAAC;gBAAkB;IAAM;IAC/C,SAAS,OAAO,CAAC,MAAM,GAAG;IAC1B,SAAS,OAAO,CAAC,g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AAI,gBAAgB,cAAc;oBAChC,EAAE,cAAc;oBAChB,IAAI,eAAe,CAAC,SAClB;yBACK,IAAI,eAAe,SACxB;gBAEJ;gBACA;YACF,KAAK;YACL,KAAK;gBACH,IAAI,gBAAgB,YAAY;oBAC9B,EAAE,cAAc;oBAChB,IAAI,eAAe,CAAC,SAClB;yBACK,IAAI,eAAe,SACxB;gBAEJ;gBACA;YACF,KAAK;YACL,KAAK;gBACH,IAAI,gBAAgB,cAAc;oBAChC,EAAE,cAAc;oBAChB,IAAI,eAAe,CAAC,SAClB;yBACK,IAAI,eAAe,SACxB;gBAEJ;gBACA;YACF,KAAK;YACL,KAAK;gBACH,IAAI,gBAAgB,YAAY;oBAC9B,EAAE,cAAc;oBAChB,IAAI,eAAe,CAAC,SAClB;yBACK,IAAI,eAAe,SACxB;gBAEJ;gBACA;YACF,KAAK;gBACH,EAAE,cAAc;gBAChB,IAAI,kBACF;gBAEF;YACF,KAAK;gBACH,EAAE,cAAc;gBAChB,IAAI,kBACF;gBAEF;YACF,KAAK;gBACH,EAAE,cAAc;gBAChB,IAAI,kBACF;gBAEF;QACJ;IACF;IAEA,OAAO;qBAAC;sBAAa;oBAAc;mBAAY;IAAS;AAC1D","sources":["packages/@react-aria/utils/src/useDrag1D.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n /* eslint-disable rulesdir/pure-render */\n\nimport {getOffset} from './getOffset';\nimport {Orientation} from '@react-types/shared';\nimport React, {HTMLAttributes, MutableRefObject, useRef} from 'react';\n\ninterface UseDrag1DProps {\n containerRef: MutableRefObject<HTMLElement>,\n reverse?: boolean,\n orientation?: Orientation,\n onHover?: (hovered: boolean) => void,\n onDrag?: (dragging: boolean) => void,\n onPositionChange?: (position: number) => void,\n onIncrement?: () => void,\n onDecrement?: () => void,\n onIncrementToMax?: () => void,\n onDecrementToMin?: () => void,\n onCollapseToggle?: () => void\n}\n\n// Keep track of elements that we are currently handling dragging for via useDrag1D.\n// If there's an ancestor and a descendant both using useDrag1D(), and the user starts\n// dragging the descendant, we don't want useDrag1D events to fire for the ancestor.\nconst draggingElements: HTMLElement[] = [];\n\n// created for splitview, this should be reusable for things like sliders/dials\n// It also handles keyboard events on the target allowing for increment/decrement by a given stepsize as well as minifying/maximizing and toggling between minified and previous size\n// It can also take a 'reverse' param to say if we should measure from the right/bottom instead of the top/left\n// It can also handle either a vertical or horizontal movement, but not both at the same time\n\nexport function useDrag1D(props: UseDrag1DProps): HTMLAttributes<HTMLElement> {\n console.warn('useDrag1D is deprecated, please use `useMove` instead https://react-spectrum.adobe.com/react-aria/useMove.html');\n let {containerRef, reverse, orientation, onHover, onDrag, onPositionChange, onIncrement, onDecrement, onIncrementToMax, onDecrementToMin, onCollapseToggle} = props;\n let getPosition = (e) => orientation === 'horizontal' ? e.clientX : e.clientY;\n let getNextOffset = (e: MouseEvent) => {\n let containerOffset = getOffset(containerRef.current, reverse, orientation);\n let mouseOffset = getPosition(e);\n let nextOffset = reverse ? containerOffset - mouseOffset : mouseOffset - containerOffset;\n return nextOffset;\n };\n let dragging = useRef(false);\n let prevPosition = useRef(0);\n\n // Keep track of the current handlers in a ref so that the events can access them.\n let handlers = useRef({onPositionChange, onDrag});\n handlers.current.onDrag = onDrag;\n handlers.current.onPositionChange = onPositionChange;\n\n let onMouseDragged = (e: MouseEvent) => {\n e.preventDefault();\n let nextOffset = getNextOffset(e);\n if (!dragging.current) {\n dragging.current = true;\n if (handlers.current.onDrag) {\n handlers.current.onDrag(true);\n }\n if (handlers.current.onPositionChange) {\n handlers.current.onPositionChange(nextOffset);\n }\n }\n if (prevPosition.current === nextOffset) {\n return;\n }\n prevPosition.current = nextOffset;\n if (onPositionChange) {\n onPositionChange(nextOffset);\n }\n };\n\n let onMouseUp = (e: MouseEvent) => {\n const target = e.target as HTMLElement;\n dragging.current = false;\n let nextOffset = getNextOffset(e);\n if (handlers.current.onDrag) {\n handlers.current.onDrag(false);\n }\n if (handlers.current.onPositionChange) {\n handlers.current.onPositionChange(nextOffset);\n }\n\n draggingElements.splice(draggingElements.indexOf(target), 1);\n window.removeEventListener('mouseup', onMouseUp, false);\n window.removeEventListener('mousemove', onMouseDragged, false);\n };\n\n let onMouseDown = (e: React.MouseEvent<HTMLElement>) => {\n const target = e.currentTarget;\n // If we're already handling dragging on a descendant with useDrag1D, then\n // we don't want to handle the drag motion on this target as well.\n if (draggingElements.some(elt => target.contains(elt))) {\n return;\n }\n draggingElements.push(target);\n window.addEventListener('mousemove', onMouseDragged, false);\n window.addEventListener('mouseup', onMouseUp, false);\n };\n\n let onMouseEnter = () => {\n if (onHover) {\n onHover(true);\n }\n };\n\n let onMouseOut = () => {\n if (onHover) {\n onHover(false);\n }\n };\n\n let onKeyDown = (e) => {\n switch (e.key) {\n case 'Left':\n case 'ArrowLeft':\n if (orientation === 'horizontal') {\n e.preventDefault();\n if (onDecrement && !reverse) {\n onDecrement();\n } else if (onIncrement && reverse) {\n onIncrement();\n }\n }\n break;\n case 'Up':\n case 'ArrowUp':\n if (orientation === 'vertical') {\n e.preventDefault();\n if (onDecrement && !reverse) {\n onDecrement();\n } else if (onIncrement && reverse) {\n onIncrement();\n }\n }\n break;\n case 'Right':\n case 'ArrowRight':\n if (orientation === 'horizontal') {\n e.preventDefault();\n if (onIncrement && !reverse) {\n onIncrement();\n } else if (onDecrement && reverse) {\n onDecrement();\n }\n }\n break;\n case 'Down':\n case 'ArrowDown':\n if (orientation === 'vertical') {\n e.preventDefault();\n if (onIncrement && !reverse) {\n onIncrement();\n } else if (onDecrement && reverse) {\n onDecrement();\n }\n }\n break;\n case 'Home':\n e.preventDefault();\n if (onDecrementToMin) {\n onDecrementToMin();\n }\n break;\n case 'End':\n e.preventDefault();\n if (onIncrementToMax) {\n onIncrementToMax();\n }\n break;\n case 'Enter':\n e.preventDefault();\n if (onCollapseToggle) {\n onCollapseToggle();\n }\n break;\n }\n };\n\n return {onMouseDown, onMouseEnter, onMouseOut, onKeyDown};\n}\n"],"names":[],"version":3,"file":"useDrag1D.main.js.map"}
1
+ {"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAEA,uCAAuC;;;AAqBxC,oFAAoF;AACpF,sFAAsF;AACtF,oFAAoF;AACpF,MAAM,yCAAkC,EAAE;AAOnC,SAAS,0CAAU,KAAqB;IAC7C,QAAQ,IAAI,CAAC;IACb,IAAI,gBAAC,YAAY,WAAE,OAAO,eAAE,WAAW,WAAE,OAAO,UAAE,MAAM,oBAAE,gBAAgB,eAAE,WAAW,eAAE,WAAW,oBAAE,gBAAgB,oBAAE,gBAAgB,oBAAE,gBAAgB,EAAC,GAAG;IAC9J,IAAI,cAAc,CAAC,IAAM,gBAAgB,eAAe,EAAE,OAAO,GAAG,EAAE,OAAO;IAC7E,IAAI,gBAAgB,CAAC;QACnB,IAAI,kBAAkB,CAAA,GAAA,mCAAQ,EAAE,aAAa,OAAO,EAAE,SAAS;QAC/D,IAAI,cAAc,YAAY;QAC9B,IAAI,aAAa,UAAU,kBAAkB,cAAc,cAAc;QACzE,OAAO;IACT;IACA,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAE;IACtB,IAAI,eAAe,CAAA,GAAA,mBAAK,EAAE;IAE1B,kFAAkF;IAClF,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAE;0BAAC;gBAAkB;IAAM;IAC/C,SAAS,OAAO,CAAC,MAAM,GAAG;IAC1B,SAAS,OAAO,CAAC,gBAAgB,GAAG;IAEpC,IAAI,iBAAiB,CAAC;QACpB,EAAE,cAAc;QAChB,IAAI,aAAa,cAAc;QAC/B,IAAI,CAAC,SAAS,OAAO,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gBACA;YACF,KAAK;YACL,KAAK;gBACH,IAAI,gBAAgB,YAAY;oBAC9B,EAAE,cAAc;oBAChB,IAAI,eAAe,CAAC,SAClB;yBACK,IAAI,eAAe,SACxB;gBAEJ;gBACA;YACF,KAAK;YACL,KAAK;gBACH,IAAI,gBAAgB,cAAc;oBAChC,EAAE,cAAc;oBAChB,IAAI,eAAe,CAAC,SAClB;yBACK,IAAI,eAAe,SACxB;gBAEJ;gBACA;YACF,KAAK;YACL,KAAK;gBACH,IAAI,gBAAgB,YAAY;oBAC9B,EAAE,cAAc;oBAChB,IAAI,eAAe,CAAC,SAClB;yBACK,IAAI,eAAe,SACxB;gBAEJ;gBACA;YACF,KAAK;gBACH,EAAE,cAAc;gBAChB,IAAI,kBACF;gBAEF;YACF,KAAK;gBACH,EAAE,cAAc;gBAChB,IAAI,kBACF;gBAEF;YACF,KAAK;gBACH,EAAE,cAAc;gBAChB,IAAI,kBACF;gBAEF;QACJ;IACF;IAEA,OAAO;qBAAC;sBAAa;oBAAc;mBAAY;IAAS;AAC1D","sources":["packages/@react-aria/utils/src/useDrag1D.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n /* eslint-disable rulesdir/pure-render */\n\nimport {getOffset} from './getOffset';\nimport {nodeContains} from './shadowdom/DOMFunctions';\nimport {Orientation} from '@react-types/shared';\nimport React, {HTMLAttributes, MutableRefObject, useRef} from 'react';\n\ninterface UseDrag1DProps {\n containerRef: MutableRefObject<HTMLElement>,\n reverse?: boolean,\n orientation?: Orientation,\n onHover?: (hovered: boolean) => void,\n onDrag?: (dragging: boolean) => void,\n onPositionChange?: (position: number) => void,\n onIncrement?: () => void,\n onDecrement?: () => void,\n onIncrementToMax?: () => void,\n onDecrementToMin?: () => void,\n onCollapseToggle?: () => void\n}\n\n// Keep track of elements that we are currently handling dragging for via useDrag1D.\n// If there's an ancestor and a descendant both using useDrag1D(), and the user starts\n// dragging the descendant, we don't want useDrag1D events to fire for the ancestor.\nconst draggingElements: HTMLElement[] = [];\n\n// created for splitview, this should be reusable for things like sliders/dials\n// It also handles keyboard events on the target allowing for increment/decrement by a given stepsize as well as minifying/maximizing and toggling between minified and previous size\n// It can also take a 'reverse' param to say if we should measure from the right/bottom instead of the top/left\n// It can also handle either a vertical or horizontal movement, but not both at the same time\n\nexport function useDrag1D(props: UseDrag1DProps): HTMLAttributes<HTMLElement> {\n console.warn('useDrag1D is deprecated, please use `useMove` instead https://react-spectrum.adobe.com/react-aria/useMove.html');\n let {containerRef, reverse, orientation, onHover, onDrag, onPositionChange, onIncrement, onDecrement, onIncrementToMax, onDecrementToMin, onCollapseToggle} = props;\n let getPosition = (e) => orientation === 'horizontal' ? e.clientX : e.clientY;\n let getNextOffset = (e: MouseEvent) => {\n let containerOffset = getOffset(containerRef.current, reverse, orientation);\n let mouseOffset = getPosition(e);\n let nextOffset = reverse ? containerOffset - mouseOffset : mouseOffset - containerOffset;\n return nextOffset;\n };\n let dragging = useRef(false);\n let prevPosition = useRef(0);\n\n // Keep track of the current handlers in a ref so that the events can access them.\n let handlers = useRef({onPositionChange, onDrag});\n handlers.current.onDrag = onDrag;\n handlers.current.onPositionChange = onPositionChange;\n\n let onMouseDragged = (e: MouseEvent) => {\n e.preventDefault();\n let nextOffset = getNextOffset(e);\n if (!dragging.current) {\n dragging.current = true;\n if (handlers.current.onDrag) {\n handlers.current.onDrag(true);\n }\n if (handlers.current.onPositionChange) {\n handlers.current.onPositionChange(nextOffset);\n }\n }\n if (prevPosition.current === nextOffset) {\n return;\n }\n prevPosition.current = nextOffset;\n if (onPositionChange) {\n onPositionChange(nextOffset);\n }\n };\n\n let onMouseUp = (e: MouseEvent) => {\n const target = e.target as HTMLElement;\n dragging.current = false;\n let nextOffset = getNextOffset(e);\n if (handlers.current.onDrag) {\n handlers.current.onDrag(false);\n }\n if (handlers.current.onPositionChange) {\n handlers.current.onPositionChange(nextOffset);\n }\n\n draggingElements.splice(draggingElements.indexOf(target), 1);\n window.removeEventListener('mouseup', onMouseUp, false);\n window.removeEventListener('mousemove', onMouseDragged, false);\n };\n\n let onMouseDown = (e: React.MouseEvent<HTMLElement>) => {\n const target = e.currentTarget;\n // If we're already handling dragging on a descendant with useDrag1D, then\n // we don't want to handle the drag motion on this target as well.\n if (draggingElements.some(elt => nodeContains(target, elt))) {\n return;\n }\n draggingElements.push(target);\n window.addEventListener('mousemove', onMouseDragged, false);\n window.addEventListener('mouseup', onMouseUp, false);\n };\n\n let onMouseEnter = () => {\n if (onHover) {\n onHover(true);\n }\n };\n\n let onMouseOut = () => {\n if (onHover) {\n onHover(false);\n }\n };\n\n let onKeyDown = (e) => {\n switch (e.key) {\n case 'Left':\n case 'ArrowLeft':\n if (orientation === 'horizontal') {\n e.preventDefault();\n if (onDecrement && !reverse) {\n onDecrement();\n } else if (onIncrement && reverse) {\n onIncrement();\n }\n }\n break;\n case 'Up':\n case 'ArrowUp':\n if (orientation === 'vertical') {\n e.preventDefault();\n if (onDecrement && !reverse) {\n onDecrement();\n } else if (onIncrement && reverse) {\n onIncrement();\n }\n }\n break;\n case 'Right':\n case 'ArrowRight':\n if (orientation === 'horizontal') {\n e.preventDefault();\n if (onIncrement && !reverse) {\n onIncrement();\n } else if (onDecrement && reverse) {\n onDecrement();\n }\n }\n break;\n case 'Down':\n case 'ArrowDown':\n if (orientation === 'vertical') {\n e.preventDefault();\n if (onIncrement && !reverse) {\n onIncrement();\n } else if (onDecrement && reverse) {\n onDecrement();\n }\n }\n break;\n case 'Home':\n e.preventDefault();\n if (onDecrementToMin) {\n onDecrementToMin();\n }\n break;\n case 'End':\n e.preventDefault();\n if (onIncrementToMax) {\n onIncrementToMax();\n }\n break;\n case 'Enter':\n e.preventDefault();\n if (onCollapseToggle) {\n onCollapseToggle();\n }\n break;\n }\n };\n\n return {onMouseDown, onMouseEnter, onMouseOut, onKeyDown};\n}\n"],"names":[],"version":3,"file":"useDrag1D.main.js.map"}
@@ -1,4 +1,5 @@
1
1
  import {getOffset as $ab71dadb03a6fb2e$export$622cea445a1c5b7d} from "./getOffset.mjs";
2
+ import {nodeContains as $d4ee10de306f2510$export$4282f70798064fe0} from "./DOMFunctions.mjs";
2
3
  import {useRef as $1rnCS$useRef} from "react";
3
4
 
4
5
  /*
@@ -13,6 +14,7 @@ import {useRef as $1rnCS$useRef} from "react";
13
14
  * governing permissions and limitations under the License.
14
15
  */ /* eslint-disable rulesdir/pure-render */
15
16
 
17
+
16
18
  // Keep track of elements that we are currently handling dragging for via useDrag1D.
17
19
  // If there's an ancestor and a descendant both using useDrag1D(), and the user starts
18
20
  // dragging the descendant, we don't want useDrag1D events to fire for the ancestor.
@@ -62,7 +64,7 @@ function $9cc09df9fd7676be$export$7bbed75feba39706(props) {
62
64
  const target = e.currentTarget;
63
65
  // If we're already handling dragging on a descendant with useDrag1D, then
64
66
  // we don't want to handle the drag motion on this target as well.
65
- if ($9cc09df9fd7676be$var$draggingElements.some((elt)=>target.contains(elt))) return;
67
+ if ($9cc09df9fd7676be$var$draggingElements.some((elt)=>(0, $d4ee10de306f2510$export$4282f70798064fe0)(target, elt))) return;
66
68
  $9cc09df9fd7676be$var$draggingElements.push(target);
67
69
  window.addEventListener('mousemove', onMouseDragged, false);
68
70
  window.addEventListener('mouseup', onMouseUp, false);
@@ -1,4 +1,5 @@
1
1
  import {getOffset as $ab71dadb03a6fb2e$export$622cea445a1c5b7d} from "./getOffset.module.js";
2
+ import {nodeContains as $d4ee10de306f2510$export$4282f70798064fe0} from "./DOMFunctions.module.js";
2
3
  import {useRef as $1rnCS$useRef} from "react";
3
4
 
4
5
  /*
@@ -13,6 +14,7 @@ import {useRef as $1rnCS$useRef} from "react";
13
14
  * governing permissions and limitations under the License.
14
15
  */ /* eslint-disable rulesdir/pure-render */
15
16
 
17
+
16
18
  // Keep track of elements that we are currently handling dragging for via useDrag1D.
17
19
  // If there's an ancestor and a descendant both using useDrag1D(), and the user starts
18
20
  // dragging the descendant, we don't want useDrag1D events to fire for the ancestor.
@@ -62,7 +64,7 @@ function $9cc09df9fd7676be$export$7bbed75feba39706(props) {
62
64
  const target = e.currentTarget;
63
65
  // If we're already handling dragging on a descendant with useDrag1D, then
64
66
  // we don't want to handle the drag motion on this target as well.
65
- if ($9cc09df9fd7676be$var$draggingElements.some((elt)=>target.contains(elt))) return;
67
+ if ($9cc09df9fd7676be$var$draggingElements.some((elt)=>(0, $d4ee10de306f2510$export$4282f70798064fe0)(target, elt))) return;
66
68
  $9cc09df9fd7676be$var$draggingElements.push(target);
67
69
  window.addEventListener('mousemove', onMouseDragged, false);
68
70
  window.addEventListener('mouseup', onMouseUp, false);
@@ -1 +1 @@
1
- {"mappings":";;;AAAA;;;;;;;;;;CAUC,GAEA,uCAAuC;;AAoBxC,oFAAoF;AACpF,sFAAsF;AACtF,oFAAoF;AACpF,MAAM,yCAAkC,EAAE;AAOnC,SAAS,0CAAU,KAAqB;IAC7C,QAAQ,IAAI,CAAC;IACb,IAAI,gBAAC,YAAY,WAAE,OAAO,eAAE,WAAW,WAAE,OAAO,UAAE,MAAM,oBAAE,gBAAgB,eAAE,WAAW,eAAE,WAAW,oBAAE,gBAAgB,oBAAE,gBAAgB,oBAAE,gBAAgB,EAAC,GAAG;IAC9J,IAAI,cAAc,CAAC,IAAM,gBAAgB,eAAe,EAAE,OAAO,GAAG,EAAE,OAAO;IAC7E,IAAI,gBAAgB,CAAC;QACnB,IAAI,kBAAkB,CAAA,GAAA,yCAAQ,EAAE,aAAa,OAAO,EAAE,SAAS;QAC/D,IAAI,cAAc,YAAY;QAC9B,IAAI,aAAa,UAAU,kBAAkB,cAAc,cAAc;QACzE,OAA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aAAa,gBAAgB;QACrD,OAAO,gBAAgB,CAAC,WAAW,WAAW;IAChD;IAEA,IAAI,eAAe;QACjB,IAAI,SACF,QAAQ;IAEZ;IAEA,IAAI,aAAa;QACf,IAAI,SACF,QAAQ;IAEZ;IAEA,IAAI,YAAY,CAAC;QACf,OAAQ,EAAE,GAAG;YACX,KAAK;YACL,KAAK;gBACH,IAAI,gBAAgB,cAAc;oBAChC,EAAE,cAAc;oBAChB,IAAI,eAAe,CAAC,SAClB;yBACK,IAAI,eAAe,SACxB;gBAEJ;gBACA;YACF,KAAK;YACL,KAAK;gBACH,IAAI,gBAAgB,YAAY;oBAC9B,EAAE,cAAc;oBAChB,IAAI,eAAe,CAAC,SAClB;yBACK,IAAI,eAAe,SACxB;gBAEJ;gBACA;YACF,KAAK;YACL,KAAK;gBACH,IAAI,gBAAgB,cAAc;oBAChC,EAAE,cAAc;oBAChB,IAAI,eAAe,CAAC,SAClB;yBACK,IAAI,eAAe,SACxB;gBAEJ;gBACA;YACF,KAAK;YACL,KAAK;gBACH,IAAI,gBAAgB,YAAY;oBAC9B,EAAE,cAAc;oBAChB,IAAI,eAAe,CAAC,SAClB;yBACK,IAAI,eAAe,SACxB;gBAEJ;gBACA;YACF,KAAK;gBACH,EAAE,cAAc;gBAChB,IAAI,kBACF;gBAEF;YACF,KAAK;gBACH,EAAE,cAAc;gBAChB,IAAI,kBACF;gBAEF;YACF,KAAK;gBACH,EAAE,cAAc;gBAChB,IAAI,kBACF;gBAEF;QACJ;IACF;IAEA,OAAO;qBAAC;sBAAa;oBAAc;mBAAY;IAAS;AAC1D","sources":["packages/@react-aria/utils/src/useDrag1D.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n /* eslint-disable rulesdir/pure-render */\n\nimport {getOffset} from './getOffset';\nimport {Orientation} from '@react-types/shared';\nimport React, {HTMLAttributes, MutableRefObject, useRef} from 'react';\n\ninterface UseDrag1DProps {\n containerRef: MutableRefObject<HTMLElement>,\n reverse?: boolean,\n orientation?: Orientation,\n onHover?: (hovered: boolean) => void,\n onDrag?: (dragging: boolean) => void,\n onPositionChange?: (position: number) => void,\n onIncrement?: () => void,\n onDecrement?: () => void,\n onIncrementToMax?: () => void,\n onDecrementToMin?: () => void,\n onCollapseToggle?: () => void\n}\n\n// Keep track of elements that we are currently handling dragging for via useDrag1D.\n// If there's an ancestor and a descendant both using useDrag1D(), and the user starts\n// dragging the descendant, we don't want useDrag1D events to fire for the ancestor.\nconst draggingElements: HTMLElement[] = [];\n\n// created for splitview, this should be reusable for things like sliders/dials\n// It also handles keyboard events on the target allowing for increment/decrement by a given stepsize as well as minifying/maximizing and toggling between minified and previous size\n// It can also take a 'reverse' param to say if we should measure from the right/bottom instead of the top/left\n// It can also handle either a vertical or horizontal movement, but not both at the same time\n\nexport function useDrag1D(props: UseDrag1DProps): HTMLAttributes<HTMLElement> {\n console.warn('useDrag1D is deprecated, please use `useMove` instead https://react-spectrum.adobe.com/react-aria/useMove.html');\n let {containerRef, reverse, orientation, onHover, onDrag, onPositionChange, onIncrement, onDecrement, onIncrementToMax, onDecrementToMin, onCollapseToggle} = props;\n let getPosition = (e) => orientation === 'horizontal' ? e.clientX : e.clientY;\n let getNextOffset = (e: MouseEvent) => {\n let containerOffset = getOffset(containerRef.current, reverse, orientation);\n let mouseOffset = getPosition(e);\n let nextOffset = reverse ? containerOffset - mouseOffset : mouseOffset - containerOffset;\n return nextOffset;\n };\n let dragging = useRef(false);\n let prevPosition = useRef(0);\n\n // Keep track of the current handlers in a ref so that the events can access them.\n let handlers = useRef({onPositionChange, onDrag});\n handlers.current.onDrag = onDrag;\n handlers.current.onPositionChange = onPositionChange;\n\n let onMouseDragged = (e: MouseEvent) => {\n e.preventDefault();\n let nextOffset = getNextOffset(e);\n if (!dragging.current) {\n dragging.current = true;\n if (handlers.current.onDrag) {\n handlers.current.onDrag(true);\n }\n if (handlers.current.onPositionChange) {\n handlers.current.onPositionChange(nextOffset);\n }\n }\n if (prevPosition.current === nextOffset) {\n return;\n }\n prevPosition.current = nextOffset;\n if (onPositionChange) {\n onPositionChange(nextOffset);\n }\n };\n\n let onMouseUp = (e: MouseEvent) => {\n const target = e.target as HTMLElement;\n dragging.current = false;\n let nextOffset = getNextOffset(e);\n if (handlers.current.onDrag) {\n handlers.current.onDrag(false);\n }\n if (handlers.current.onPositionChange) {\n handlers.current.onPositionChange(nextOffset);\n }\n\n draggingElements.splice(draggingElements.indexOf(target), 1);\n window.removeEventListener('mouseup', onMouseUp, false);\n window.removeEventListener('mousemove', onMouseDragged, false);\n };\n\n let onMouseDown = (e: React.MouseEvent<HTMLElement>) => {\n const target = e.currentTarget;\n // If we're already handling dragging on a descendant with useDrag1D, then\n // we don't want to handle the drag motion on this target as well.\n if (draggingElements.some(elt => target.contains(elt))) {\n return;\n }\n draggingElements.push(target);\n window.addEventListener('mousemove', onMouseDragged, false);\n window.addEventListener('mouseup', onMouseUp, false);\n };\n\n let onMouseEnter = () => {\n if (onHover) {\n onHover(true);\n }\n };\n\n let onMouseOut = () => {\n if (onHover) {\n onHover(false);\n }\n };\n\n let onKeyDown = (e) => {\n switch (e.key) {\n case 'Left':\n case 'ArrowLeft':\n if (orientation === 'horizontal') {\n e.preventDefault();\n if (onDecrement && !reverse) {\n onDecrement();\n } else if (onIncrement && reverse) {\n onIncrement();\n }\n }\n break;\n case 'Up':\n case 'ArrowUp':\n if (orientation === 'vertical') {\n e.preventDefault();\n if (onDecrement && !reverse) {\n onDecrement();\n } else if (onIncrement && reverse) {\n onIncrement();\n }\n }\n break;\n case 'Right':\n case 'ArrowRight':\n if (orientation === 'horizontal') {\n e.preventDefault();\n if (onIncrement && !reverse) {\n onIncrement();\n } else if (onDecrement && reverse) {\n onDecrement();\n }\n }\n break;\n case 'Down':\n case 'ArrowDown':\n if (orientation === 'vertical') {\n e.preventDefault();\n if (onIncrement && !reverse) {\n onIncrement();\n } else if (onDecrement && reverse) {\n onDecrement();\n }\n }\n break;\n case 'Home':\n e.preventDefault();\n if (onDecrementToMin) {\n onDecrementToMin();\n }\n break;\n case 'End':\n e.preventDefault();\n if (onIncrementToMax) {\n onIncrementToMax();\n }\n break;\n case 'Enter':\n e.preventDefault();\n if (onCollapseToggle) {\n onCollapseToggle();\n }\n break;\n }\n };\n\n return {onMouseDown, onMouseEnter, onMouseOut, onKeyDown};\n}\n"],"names":[],"version":3,"file":"useDrag1D.module.js.map"}
1
+ {"mappings":";;;;AAAA;;;;;;;;;;CAUC,GAEA,uCAAuC;;;AAqBxC,oFAAoF;AACpF,sFAAsF;AACtF,oFAAoF;AACpF,MAAM,yCAAkC,EAAE;AAOnC,SAAS,0CAAU,KAAqB;IAC7C,QAAQ,IAAI,CAAC;IACb,IAAI,gBAAC,YAAY,WAAE,OAAO,eAAE,WAAW,WAAE,OAAO,UAAE,MAAM,oBAAE,gBAAgB,eAAE,WAAW,eAAE,WAAW,oBAAE,gBAAgB,oBAAE,gBAAgB,oBAAE,gBAAgB,EAAC,GAAG;IAC9J,IAAI,cAAc,CAAC,IAAM,gBAAgB,eAAe,EAAE,OAAO,GAAG,EAAE,OAAO;IAC7E,IAAI,gBAAgB,CAAC;QACnB,IAAI,kBAAkB,CAAA,GAAA,yCAAQ,EAAE,aAAa,OAAO,EAAE,SAAS;QAC/D,IAAI,cAAc,YAAY;QAC9B,IAAI,aAAa,UAAU,kBAAkB,cAAc,cAAc;QACzE,OAAO;IACT;IACA,IAAI,WAAW,CAAA,GAAA,aAAK,EAAE;IACtB,IAAI,eAAe,CAAA,GAAA,aAAK,EAAE;IAE1B,kFAAkF;IAClF,IAAI,WAAW,C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,IAAI,aAAa;QACf,IAAI,SACF,QAAQ;IAEZ;IAEA,IAAI,YAAY,CAAC;QACf,OAAQ,EAAE,GAAG;YACX,KAAK;YACL,KAAK;gBACH,IAAI,gBAAgB,cAAc;oBAChC,EAAE,cAAc;oBAChB,IAAI,eAAe,CAAC,SAClB;yBACK,IAAI,eAAe,SACxB;gBAEJ;gBACA;YACF,KAAK;YACL,KAAK;gBACH,IAAI,gBAAgB,YAAY;oBAC9B,EAAE,cAAc;oBAChB,IAAI,eAAe,CAAC,SAClB;yBACK,IAAI,eAAe,SACxB;gBAEJ;gBACA;YACF,KAAK;YACL,KAAK;gBACH,IAAI,gBAAgB,cAAc;oBAChC,EAAE,cAAc;oBAChB,IAAI,eAAe,CAAC,SAClB;yBACK,IAAI,eAAe,SACxB;gBAEJ;gBACA;YACF,KAAK;YACL,KAAK;gBACH,IAAI,gBAAgB,YAAY;oBAC9B,EAAE,cAAc;oBAChB,IAAI,eAAe,CAAC,SAClB;yBACK,IAAI,eAAe,SACxB;gBAEJ;gBACA;YACF,KAAK;gBACH,EAAE,cAAc;gBAChB,IAAI,kBACF;gBAEF;YACF,KAAK;gBACH,EAAE,cAAc;gBAChB,IAAI,kBACF;gBAEF;YACF,KAAK;gBACH,EAAE,cAAc;gBAChB,IAAI,kBACF;gBAEF;QACJ;IACF;IAEA,OAAO;qBAAC;sBAAa;oBAAc;mBAAY;IAAS;AAC1D","sources":["packages/@react-aria/utils/src/useDrag1D.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n /* eslint-disable rulesdir/pure-render */\n\nimport {getOffset} from './getOffset';\nimport {nodeContains} from './shadowdom/DOMFunctions';\nimport {Orientation} from '@react-types/shared';\nimport React, {HTMLAttributes, MutableRefObject, useRef} from 'react';\n\ninterface UseDrag1DProps {\n containerRef: MutableRefObject<HTMLElement>,\n reverse?: boolean,\n orientation?: Orientation,\n onHover?: (hovered: boolean) => void,\n onDrag?: (dragging: boolean) => void,\n onPositionChange?: (position: number) => void,\n onIncrement?: () => void,\n onDecrement?: () => void,\n onIncrementToMax?: () => void,\n onDecrementToMin?: () => void,\n onCollapseToggle?: () => void\n}\n\n// Keep track of elements that we are currently handling dragging for via useDrag1D.\n// If there's an ancestor and a descendant both using useDrag1D(), and the user starts\n// dragging the descendant, we don't want useDrag1D events to fire for the ancestor.\nconst draggingElements: HTMLElement[] = [];\n\n// created for splitview, this should be reusable for things like sliders/dials\n// It also handles keyboard events on the target allowing for increment/decrement by a given stepsize as well as minifying/maximizing and toggling between minified and previous size\n// It can also take a 'reverse' param to say if we should measure from the right/bottom instead of the top/left\n// It can also handle either a vertical or horizontal movement, but not both at the same time\n\nexport function useDrag1D(props: UseDrag1DProps): HTMLAttributes<HTMLElement> {\n console.warn('useDrag1D is deprecated, please use `useMove` instead https://react-spectrum.adobe.com/react-aria/useMove.html');\n let {containerRef, reverse, orientation, onHover, onDrag, onPositionChange, onIncrement, onDecrement, onIncrementToMax, onDecrementToMin, onCollapseToggle} = props;\n let getPosition = (e) => orientation === 'horizontal' ? e.clientX : e.clientY;\n let getNextOffset = (e: MouseEvent) => {\n let containerOffset = getOffset(containerRef.current, reverse, orientation);\n let mouseOffset = getPosition(e);\n let nextOffset = reverse ? containerOffset - mouseOffset : mouseOffset - containerOffset;\n return nextOffset;\n };\n let dragging = useRef(false);\n let prevPosition = useRef(0);\n\n // Keep track of the current handlers in a ref so that the events can access them.\n let handlers = useRef({onPositionChange, onDrag});\n handlers.current.onDrag = onDrag;\n handlers.current.onPositionChange = onPositionChange;\n\n let onMouseDragged = (e: MouseEvent) => {\n e.preventDefault();\n let nextOffset = getNextOffset(e);\n if (!dragging.current) {\n dragging.current = true;\n if (handlers.current.onDrag) {\n handlers.current.onDrag(true);\n }\n if (handlers.current.onPositionChange) {\n handlers.current.onPositionChange(nextOffset);\n }\n }\n if (prevPosition.current === nextOffset) {\n return;\n }\n prevPosition.current = nextOffset;\n if (onPositionChange) {\n onPositionChange(nextOffset);\n }\n };\n\n let onMouseUp = (e: MouseEvent) => {\n const target = e.target as HTMLElement;\n dragging.current = false;\n let nextOffset = getNextOffset(e);\n if (handlers.current.onDrag) {\n handlers.current.onDrag(false);\n }\n if (handlers.current.onPositionChange) {\n handlers.current.onPositionChange(nextOffset);\n }\n\n draggingElements.splice(draggingElements.indexOf(target), 1);\n window.removeEventListener('mouseup', onMouseUp, false);\n window.removeEventListener('mousemove', onMouseDragged, false);\n };\n\n let onMouseDown = (e: React.MouseEvent<HTMLElement>) => {\n const target = e.currentTarget;\n // If we're already handling dragging on a descendant with useDrag1D, then\n // we don't want to handle the drag motion on this target as well.\n if (draggingElements.some(elt => nodeContains(target, elt))) {\n return;\n }\n draggingElements.push(target);\n window.addEventListener('mousemove', onMouseDragged, false);\n window.addEventListener('mouseup', onMouseUp, false);\n };\n\n let onMouseEnter = () => {\n if (onHover) {\n onHover(true);\n }\n };\n\n let onMouseOut = () => {\n if (onHover) {\n onHover(false);\n }\n };\n\n let onKeyDown = (e) => {\n switch (e.key) {\n case 'Left':\n case 'ArrowLeft':\n if (orientation === 'horizontal') {\n e.preventDefault();\n if (onDecrement && !reverse) {\n onDecrement();\n } else if (onIncrement && reverse) {\n onIncrement();\n }\n }\n break;\n case 'Up':\n case 'ArrowUp':\n if (orientation === 'vertical') {\n e.preventDefault();\n if (onDecrement && !reverse) {\n onDecrement();\n } else if (onIncrement && reverse) {\n onIncrement();\n }\n }\n break;\n case 'Right':\n case 'ArrowRight':\n if (orientation === 'horizontal') {\n e.preventDefault();\n if (onIncrement && !reverse) {\n onIncrement();\n } else if (onDecrement && reverse) {\n onDecrement();\n }\n }\n break;\n case 'Down':\n case 'ArrowDown':\n if (orientation === 'vertical') {\n e.preventDefault();\n if (onIncrement && !reverse) {\n onIncrement();\n } else if (onDecrement && reverse) {\n onDecrement();\n }\n }\n break;\n case 'Home':\n e.preventDefault();\n if (onDecrementToMin) {\n onDecrementToMin();\n }\n break;\n case 'End':\n e.preventDefault();\n if (onIncrementToMax) {\n onIncrementToMax();\n }\n break;\n case 'Enter':\n e.preventDefault();\n if (onCollapseToggle) {\n onCollapseToggle();\n }\n break;\n }\n };\n\n return {onMouseDown, onMouseEnter, onMouseOut, onKeyDown};\n}\n"],"names":[],"version":3,"file":"useDrag1D.module.js.map"}
@@ -29,16 +29,18 @@ function $8b24bab62f5c65ad$export$d699905dd57c73ca() {
29
29
  height: 0
30
30
  } : $8b24bab62f5c65ad$var$getViewportSize());
31
31
  (0, $4gIVO$react.useEffect)(()=>{
32
- // Use visualViewport api to track available height even on iOS virtual keyboard opening
33
- let onResize = ()=>{
34
- // Ignore updates when zoomed.
35
- if ($8b24bab62f5c65ad$var$visualViewport && $8b24bab62f5c65ad$var$visualViewport.scale > 1) return;
32
+ let updateSize = (newSize)=>{
36
33
  setSize((size)=>{
37
- let newSize = $8b24bab62f5c65ad$var$getViewportSize();
38
34
  if (newSize.width === size.width && newSize.height === size.height) return size;
39
35
  return newSize;
40
36
  });
41
37
  };
38
+ // Use visualViewport api to track available height even on iOS virtual keyboard opening
39
+ let onResize = ()=>{
40
+ // Ignore updates when zoomed.
41
+ if ($8b24bab62f5c65ad$var$visualViewport && $8b24bab62f5c65ad$var$visualViewport.scale > 1) return;
42
+ updateSize($8b24bab62f5c65ad$var$getViewportSize());
43
+ };
42
44
  // When closing the keyboard, iOS does not fire the visual viewport resize event until the animation is complete.
43
45
  // We can anticipate this and resize early by handling the blur event and using the layout size.
44
46
  let frame;
@@ -46,16 +48,13 @@ function $8b24bab62f5c65ad$export$d699905dd57c73ca() {
46
48
  if ($8b24bab62f5c65ad$var$visualViewport && $8b24bab62f5c65ad$var$visualViewport.scale > 1) return;
47
49
  if ((0, $2308dc377e184bb0$exports.willOpenKeyboard)(e.target)) // Wait one frame to see if a new element gets focused.
48
50
  frame = requestAnimationFrame(()=>{
49
- if (!document.activeElement || !(0, $2308dc377e184bb0$exports.willOpenKeyboard)(document.activeElement)) setSize((size)=>{
50
- let newSize = {
51
- width: window.innerWidth,
52
- height: window.innerHeight
53
- };
54
- if (newSize.width === size.width && newSize.height === size.height) return size;
55
- return newSize;
51
+ if (!document.activeElement || !(0, $2308dc377e184bb0$exports.willOpenKeyboard)(document.activeElement)) updateSize({
52
+ width: document.documentElement.clientWidth,
53
+ height: document.documentElement.clientHeight
56
54
  });
57
55
  });
58
56
  };
57
+ updateSize($8b24bab62f5c65ad$var$getViewportSize());
59
58
  window.addEventListener('blur', onBlur, true);
60
59
  if (!$8b24bab62f5c65ad$var$visualViewport) window.addEventListener('resize', onResize);
61
60
  else $8b24bab62f5c65ad$var$visualViewport.addEventListener('resize', onResize);
@@ -71,8 +70,8 @@ function $8b24bab62f5c65ad$export$d699905dd57c73ca() {
71
70
  function $8b24bab62f5c65ad$var$getViewportSize() {
72
71
  return {
73
72
  // Multiply by the visualViewport scale to get the "natural" size, unaffected by pinch zooming.
74
- width: $8b24bab62f5c65ad$var$visualViewport ? $8b24bab62f5c65ad$var$visualViewport.width * $8b24bab62f5c65ad$var$visualViewport.scale : window.innerWidth,
75
- height: $8b24bab62f5c65ad$var$visualViewport ? $8b24bab62f5c65ad$var$visualViewport.height * $8b24bab62f5c65ad$var$visualViewport.scale : window.innerHeight
73
+ width: $8b24bab62f5c65ad$var$visualViewport ? $8b24bab62f5c65ad$var$visualViewport.width * $8b24bab62f5c65ad$var$visualViewport.scale : document.documentElement.clientWidth,
74
+ height: $8b24bab62f5c65ad$var$visualViewport ? $8b24bab62f5c65ad$var$visualViewport.height * $8b24bab62f5c65ad$var$visualViewport.scale : document.documentElement.clientHeight
76
75
  };
77
76
  }
78
77
 
@@ -1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Q,QAAQ;YAC3C,IAAI,CAAC,sCACH,OAAO,mBAAmB,CAAC,UAAU;iBAErC,qCAAe,mBAAmB,CAAC,UAAU;QAEjD;IACF,GAAG,EAAE;IAEL,OAAO;AACT;AAEA,SAAS;IACP,OAAO;QACL,+FAA+F;QAC/F,OAAO,uCAAiB,qCAAe,KAAK,GAAG,qCAAe,KAAK,GAAG,OAAO,UAAU;QACvF,QAAQ,uCAAiB,qCAAe,MAAM,GAAG,qCAAe,KAAK,GAAG,OAAO,WAAW;IAC5F;AACF","sources":["packages/@react-aria/utils/src/useViewportSize.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {useEffect, useState} from 'react';\nimport {useIsSSR} from '@react-aria/ssr';\nimport {willOpenKeyboard} from './keyboard';\n\ninterface ViewportSize {\n width: number,\n height: number\n}\n\nlet visualViewport = typeof document !== 'undefined' && window.visualViewport;\n\nexport function useViewportSize(): ViewportSize {\n let isSSR = useIsSSR();\n let [size, setSize] = useState(() => isSSR ? {width: 0, height: 0} : getViewportSize());\n\n useEffect(() => {\n // Use visualViewport api to track available height even on iOS virtual keyboard opening\n let onResize = () => {\n // Ignore updates when zoomed.\n if (visualViewport && visualViewport.scale > 1) {\n return;\n }\n\n setSize(size => {\n let newSize = getViewportSize();\n if (newSize.width === size.width && newSize.height === size.height) {\n return size;\n }\n return newSize;\n });\n };\n\n // When closing the keyboard, iOS does not fire the visual viewport resize event until the animation is complete.\n // We can anticipate this and resize early by handling the blur event and using the layout size.\n let frame: number;\n let onBlur = (e: FocusEvent) => {\n if (visualViewport && visualViewport.scale > 1) {\n return;\n }\n\n if (willOpenKeyboard(e.target as Element)) {\n // Wait one frame to see if a new element gets focused.\n frame = requestAnimationFrame(() => {\n if (!document.activeElement || !willOpenKeyboard(document.activeElement)) {\n setSize(size => {\n let newSize = {width: window.innerWidth, height: window.innerHeight};\n if (newSize.width === size.width && newSize.height === size.height) {\n return size;\n }\n return newSize;\n });\n }\n });\n }\n };\n\n window.addEventListener('blur', onBlur, true);\n\n if (!visualViewport) {\n window.addEventListener('resize', onResize);\n } else {\n visualViewport.addEventListener('resize', onResize);\n }\n\n return () => {\n cancelAnimationFrame(frame);\n window.removeEventListener('blur', onBlur, true);\n if (!visualViewport) {\n window.removeEventListener('resize', onResize);\n } else {\n visualViewport.removeEventListener('resize', onResize);\n }\n };\n }, []);\n\n return size;\n}\n\nfunction getViewportSize(): ViewportSize {\n return {\n // Multiply by the visualViewport scale to get the \"natural\" size, unaffected by pinch zooming.\n width: visualViewport ? visualViewport.width * visualViewport.scale : window.innerWidth,\n height: visualViewport ? visualViewport.height * visualViewport.scale : window.innerHeight\n };\n}\n"],"names":[],"version":3,"file":"useViewportSize.main.js.map"}
1
+ {"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAWD,IAAI,uCAAiB,OAAO,aAAa,eAAe,OAAO,cAAc;AAEtE,SAAS;IACd,IAAI,QAAQ,CAAA,GAAA,4BAAO;IACnB,IAAI,CAAC,MAAM,QAAQ,GAAG,CAAA,GAAA,qBAAO,EAAE,IAAM,QAAQ;YAAC,OAAO;YAAG,QAAQ;QAAC,IAAI;IAErE,CAAA,GAAA,sBAAQ,EAAE;QACR,IAAI,aAAa,CAAC;YAChB,QAAQ,CAAA;gBACN,IAAI,QAAQ,KAAK,KAAK,KAAK,KAAK,IAAI,QAAQ,MAAM,KAAK,KAAK,MAAM,EAChE,OAAO;gBAET,OAAO;YACT;QACF;QAEA,wFAAwF;QACxF,IAAI,WAAW;YACb,8BAA8B;YAC9B,IAAI,wCAAkB,qCAAe,KAAK,GAAG,GAC3C;YAGF,WAAW;QACb;QAEA,iHAAiH;QACjH,gGAAgG;QAChG,IAAI;QACJ,IAAI,SAAS,CAAC;YACZ,IAAI,wCAAkB,qCAAe,KAAK,GAAG,GAC3C;YAGF,IAAI,CAAA,GAAA,0CAAe,EAAE,EAAE,MAAM,GAC3B,uDAAuD;YACvD,QAAQ,sBAAsB;gBAC5B,IAAI,CAAC,SAAS,aAAa,IAAI,CAAC,CAAA,GAAA,0CAAe,EAAE,SAAS,aAAa,GACrE,WAAW;oBAAC,OAAO,SAAS,eAAe,CAAC,WAAW;oBAAE,QAAQ,SAAS,eAAe,CAAC,YAAY;gBAAA;YAE1G;QAEJ;QAEA,WAAW;QAEX,OAAO,gBAAgB,CAAC,QAAQ,QAAQ;QAExC,IAAI,CAAC,sCACH,OAAO,gBAAgB,CAAC,UAAU;aAElC,qCAAe,gBAAgB,CAAC,UAAU;QAG5C,OAAO;YACL,qBAAqB;YACrB,OAAO,mBAAmB,CAAC,QAAQ,QAAQ;YAC3C,IAAI,CAAC,sCACH,OAAO,mBAAmB,CAAC,UAAU;iBAErC,qCAAe,mBAAmB,CAAC,UAAU;QAEjD;IACF,GAAG,EAAE;IAEL,OAAO;AACT;AAEA,SAAS;IACP,OAAO;QACL,+FAA+F;QAC/F,OAAO,uCAAiB,qCAAe,KAAK,GAAG,qCAAe,KAAK,GAAG,SAAS,eAAe,CAAC,WAAW;QAC1G,QAAQ,uCAAiB,qCAAe,MAAM,GAAG,qCAAe,KAAK,GAAG,SAAS,eAAe,CAAC,YAAY;IAC/G;AACF","sources":["packages/@react-aria/utils/src/useViewportSize.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {useEffect, useState} from 'react';\nimport {useIsSSR} from '@react-aria/ssr';\nimport {willOpenKeyboard} from './keyboard';\n\ninterface ViewportSize {\n width: number,\n height: number\n}\n\nlet visualViewport = typeof document !== 'undefined' && window.visualViewport;\n\nexport function useViewportSize(): ViewportSize {\n let isSSR = useIsSSR();\n let [size, setSize] = useState(() => isSSR ? {width: 0, height: 0} : getViewportSize());\n\n useEffect(() => {\n let updateSize = (newSize: ViewportSize) => {\n setSize(size => {\n if (newSize.width === size.width && newSize.height === size.height) {\n return size;\n }\n return newSize;\n });\n };\n\n // Use visualViewport api to track available height even on iOS virtual keyboard opening\n let onResize = () => {\n // Ignore updates when zoomed.\n if (visualViewport && visualViewport.scale > 1) {\n return;\n }\n\n updateSize(getViewportSize());\n };\n\n // When closing the keyboard, iOS does not fire the visual viewport resize event until the animation is complete.\n // We can anticipate this and resize early by handling the blur event and using the layout size.\n let frame: number;\n let onBlur = (e: FocusEvent) => {\n if (visualViewport && visualViewport.scale > 1) {\n return;\n }\n\n if (willOpenKeyboard(e.target as Element)) {\n // Wait one frame to see if a new element gets focused.\n frame = requestAnimationFrame(() => {\n if (!document.activeElement || !willOpenKeyboard(document.activeElement)) {\n updateSize({width: document.documentElement.clientWidth, height: document.documentElement.clientHeight});\n }\n });\n }\n };\n\n updateSize(getViewportSize());\n\n window.addEventListener('blur', onBlur, true);\n\n if (!visualViewport) {\n window.addEventListener('resize', onResize);\n } else {\n visualViewport.addEventListener('resize', onResize);\n }\n\n return () => {\n cancelAnimationFrame(frame);\n window.removeEventListener('blur', onBlur, true);\n if (!visualViewport) {\n window.removeEventListener('resize', onResize);\n } else {\n visualViewport.removeEventListener('resize', onResize);\n }\n };\n }, []);\n\n return size;\n}\n\nfunction getViewportSize(): ViewportSize {\n return {\n // Multiply by the visualViewport scale to get the \"natural\" size, unaffected by pinch zooming.\n width: visualViewport ? visualViewport.width * visualViewport.scale : document.documentElement.clientWidth,\n height: visualViewport ? visualViewport.height * visualViewport.scale : document.documentElement.clientHeight\n };\n}\n"],"names":[],"version":3,"file":"useViewportSize.main.js.map"}
@@ -23,16 +23,18 @@ function $5df64b3807dc15ee$export$d699905dd57c73ca() {
23
23
  height: 0
24
24
  } : $5df64b3807dc15ee$var$getViewportSize());
25
25
  (0, $fuDHA$useEffect)(()=>{
26
- // Use visualViewport api to track available height even on iOS virtual keyboard opening
27
- let onResize = ()=>{
28
- // Ignore updates when zoomed.
29
- if ($5df64b3807dc15ee$var$visualViewport && $5df64b3807dc15ee$var$visualViewport.scale > 1) return;
26
+ let updateSize = (newSize)=>{
30
27
  setSize((size)=>{
31
- let newSize = $5df64b3807dc15ee$var$getViewportSize();
32
28
  if (newSize.width === size.width && newSize.height === size.height) return size;
33
29
  return newSize;
34
30
  });
35
31
  };
32
+ // Use visualViewport api to track available height even on iOS virtual keyboard opening
33
+ let onResize = ()=>{
34
+ // Ignore updates when zoomed.
35
+ if ($5df64b3807dc15ee$var$visualViewport && $5df64b3807dc15ee$var$visualViewport.scale > 1) return;
36
+ updateSize($5df64b3807dc15ee$var$getViewportSize());
37
+ };
36
38
  // When closing the keyboard, iOS does not fire the visual viewport resize event until the animation is complete.
37
39
  // We can anticipate this and resize early by handling the blur event and using the layout size.
38
40
  let frame;
@@ -40,16 +42,13 @@ function $5df64b3807dc15ee$export$d699905dd57c73ca() {
40
42
  if ($5df64b3807dc15ee$var$visualViewport && $5df64b3807dc15ee$var$visualViewport.scale > 1) return;
41
43
  if ((0, $21f1aa98acb08317$export$c57958e35f31ed73)(e.target)) // Wait one frame to see if a new element gets focused.
42
44
  frame = requestAnimationFrame(()=>{
43
- if (!document.activeElement || !(0, $21f1aa98acb08317$export$c57958e35f31ed73)(document.activeElement)) setSize((size)=>{
44
- let newSize = {
45
- width: window.innerWidth,
46
- height: window.innerHeight
47
- };
48
- if (newSize.width === size.width && newSize.height === size.height) return size;
49
- return newSize;
45
+ if (!document.activeElement || !(0, $21f1aa98acb08317$export$c57958e35f31ed73)(document.activeElement)) updateSize({
46
+ width: document.documentElement.clientWidth,
47
+ height: document.documentElement.clientHeight
50
48
  });
51
49
  });
52
50
  };
51
+ updateSize($5df64b3807dc15ee$var$getViewportSize());
53
52
  window.addEventListener('blur', onBlur, true);
54
53
  if (!$5df64b3807dc15ee$var$visualViewport) window.addEventListener('resize', onResize);
55
54
  else $5df64b3807dc15ee$var$visualViewport.addEventListener('resize', onResize);
@@ -65,8 +64,8 @@ function $5df64b3807dc15ee$export$d699905dd57c73ca() {
65
64
  function $5df64b3807dc15ee$var$getViewportSize() {
66
65
  return {
67
66
  // Multiply by the visualViewport scale to get the "natural" size, unaffected by pinch zooming.
68
- width: $5df64b3807dc15ee$var$visualViewport ? $5df64b3807dc15ee$var$visualViewport.width * $5df64b3807dc15ee$var$visualViewport.scale : window.innerWidth,
69
- height: $5df64b3807dc15ee$var$visualViewport ? $5df64b3807dc15ee$var$visualViewport.height * $5df64b3807dc15ee$var$visualViewport.scale : window.innerHeight
67
+ width: $5df64b3807dc15ee$var$visualViewport ? $5df64b3807dc15ee$var$visualViewport.width * $5df64b3807dc15ee$var$visualViewport.scale : document.documentElement.clientWidth,
68
+ height: $5df64b3807dc15ee$var$visualViewport ? $5df64b3807dc15ee$var$visualViewport.height * $5df64b3807dc15ee$var$visualViewport.scale : document.documentElement.clientHeight
70
69
  };
71
70
  }
72
71
 
@@ -23,16 +23,18 @@ function $5df64b3807dc15ee$export$d699905dd57c73ca() {
23
23
  height: 0
24
24
  } : $5df64b3807dc15ee$var$getViewportSize());
25
25
  (0, $fuDHA$useEffect)(()=>{
26
- // Use visualViewport api to track available height even on iOS virtual keyboard opening
27
- let onResize = ()=>{
28
- // Ignore updates when zoomed.
29
- if ($5df64b3807dc15ee$var$visualViewport && $5df64b3807dc15ee$var$visualViewport.scale > 1) return;
26
+ let updateSize = (newSize)=>{
30
27
  setSize((size)=>{
31
- let newSize = $5df64b3807dc15ee$var$getViewportSize();
32
28
  if (newSize.width === size.width && newSize.height === size.height) return size;
33
29
  return newSize;
34
30
  });
35
31
  };
32
+ // Use visualViewport api to track available height even on iOS virtual keyboard opening
33
+ let onResize = ()=>{
34
+ // Ignore updates when zoomed.
35
+ if ($5df64b3807dc15ee$var$visualViewport && $5df64b3807dc15ee$var$visualViewport.scale > 1) return;
36
+ updateSize($5df64b3807dc15ee$var$getViewportSize());
37
+ };
36
38
  // When closing the keyboard, iOS does not fire the visual viewport resize event until the animation is complete.
37
39
  // We can anticipate this and resize early by handling the blur event and using the layout size.
38
40
  let frame;
@@ -40,16 +42,13 @@ function $5df64b3807dc15ee$export$d699905dd57c73ca() {
40
42
  if ($5df64b3807dc15ee$var$visualViewport && $5df64b3807dc15ee$var$visualViewport.scale > 1) return;
41
43
  if ((0, $21f1aa98acb08317$export$c57958e35f31ed73)(e.target)) // Wait one frame to see if a new element gets focused.
42
44
  frame = requestAnimationFrame(()=>{
43
- if (!document.activeElement || !(0, $21f1aa98acb08317$export$c57958e35f31ed73)(document.activeElement)) setSize((size)=>{
44
- let newSize = {
45
- width: window.innerWidth,
46
- height: window.innerHeight
47
- };
48
- if (newSize.width === size.width && newSize.height === size.height) return size;
49
- return newSize;
45
+ if (!document.activeElement || !(0, $21f1aa98acb08317$export$c57958e35f31ed73)(document.activeElement)) updateSize({
46
+ width: document.documentElement.clientWidth,
47
+ height: document.documentElement.clientHeight
50
48
  });
51
49
  });
52
50
  };
51
+ updateSize($5df64b3807dc15ee$var$getViewportSize());
53
52
  window.addEventListener('blur', onBlur, true);
54
53
  if (!$5df64b3807dc15ee$var$visualViewport) window.addEventListener('resize', onResize);
55
54
  else $5df64b3807dc15ee$var$visualViewport.addEventListener('resize', onResize);
@@ -65,8 +64,8 @@ function $5df64b3807dc15ee$export$d699905dd57c73ca() {
65
64
  function $5df64b3807dc15ee$var$getViewportSize() {
66
65
  return {
67
66
  // Multiply by the visualViewport scale to get the "natural" size, unaffected by pinch zooming.
68
- width: $5df64b3807dc15ee$var$visualViewport ? $5df64b3807dc15ee$var$visualViewport.width * $5df64b3807dc15ee$var$visualViewport.scale : window.innerWidth,
69
- height: $5df64b3807dc15ee$var$visualViewport ? $5df64b3807dc15ee$var$visualViewport.height * $5df64b3807dc15ee$var$visualViewport.scale : window.innerHeight
67
+ width: $5df64b3807dc15ee$var$visualViewport ? $5df64b3807dc15ee$var$visualViewport.width * $5df64b3807dc15ee$var$visualViewport.scale : document.documentElement.clientWidth,
68
+ height: $5df64b3807dc15ee$var$visualViewport ? $5df64b3807dc15ee$var$visualViewport.height * $5df64b3807dc15ee$var$visualViewport.scale : document.documentElement.clientHeight
70
69
  };
71
70
  }
72
71
 
@@ -1 +1 @@
1
- {"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAWD,IAAI,uCAAiB,OAAO,aAAa,eAAe,OAAO,cAAc;AAEtE,SAAS;IACd,IAAI,QAAQ,CAAA,GAAA,eAAO;IACnB,IAAI,CAAC,MAAM,QAAQ,GAAG,CAAA,GAAA,eAAO,EAAE,IAAM,QAAQ;YAAC,OAAO;YAAG,QAAQ;QAAC,IAAI;IAErE,CAAA,GAAA,gBAAQ,EAAE;QACR,wFAAwF;QACxF,IAAI,WAAW;YACb,8BAA8B;YAC9B,IAAI,wCAAkB,qCAAe,KAAK,GAAG,GAC3C;YAGF,QAAQ,CAAA;gBACN,IAAI,UAAU;gBACd,IAAI,QAAQ,KAAK,KAAK,KAAK,KAAK,IAAI,QAAQ,MAAM,KAAK,KAAK,MAAM,EAChE,OAAO;gBAET,OAAO;YACT;QACF;QAEA,iHAAiH;QACjH,gGAAgG;QAChG,IAAI;QACJ,IAAI,SAAS,CAAC;YACZ,IAAI,wCAAkB,qCAAe,KAAK,GAAG,GAC3C;YAGF,IAAI,CAAA,GAAA,yCAAe,EAAE,EAAE,MAAM,GAC3B,uDAAuD;YACvD,QAAQ,sBAAsB;gBAC5B,IAAI,CAAC,SAAS,aAAa,IAAI,CAAC,CAAA,GAAA,yCAAe,EAAE,SAAS,aAAa,GACrE,QAAQ,CAAA;oBACN,IAAI,UAAU;wBAAC,OAAO,OAAO,UAAU;wBAAE,QAAQ,OAAO,WAAW;oBAAA;oBACnE,IAAI,QAAQ,KAAK,KAAK,KAAK,KAAK,IAAI,QAAQ,MAAM,KAAK,KAAK,MAAM,EAChE,OAAO;oBAET,OAAO;gBACT;YAEJ;QAEJ;QAEA,OAAO,gBAAgB,CAAC,QAAQ,QAAQ;QAExC,IAAI,CAAC,sCACH,OAAO,gBAAgB,CAAC,UAAU;aAElC,qCAAe,gBAAgB,CAAC,UAAU;QAG5C,OAAO;YACL,qBAAqB;YACrB,OAAO,mBAAmB,CAAC,QAAQ,QAAQ;YAC3C,IAAI,CAAC,sCACH,OAAO,mBAAmB,CAAC,UAAU;iBAErC,qCAAe,mBAAmB,CAAC,UAAU;QAEjD;IACF,GAAG,EAAE;IAEL,OAAO;AACT;AAEA,SAAS;IACP,OAAO;QACL,+FAA+F;QAC/F,OAAO,uCAAiB,qCAAe,KAAK,GAAG,qCAAe,KAAK,GAAG,OAAO,UAAU;QACvF,QAAQ,uCAAiB,qCAAe,MAAM,GAAG,qCAAe,KAAK,GAAG,OAAO,WAAW;IAC5F;AACF","sources":["packages/@react-aria/utils/src/useViewportSize.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {useEffect, useState} from 'react';\nimport {useIsSSR} from '@react-aria/ssr';\nimport {willOpenKeyboard} from './keyboard';\n\ninterface ViewportSize {\n width: number,\n height: number\n}\n\nlet visualViewport = typeof document !== 'undefined' && window.visualViewport;\n\nexport function useViewportSize(): ViewportSize {\n let isSSR = useIsSSR();\n let [size, setSize] = useState(() => isSSR ? {width: 0, height: 0} : getViewportSize());\n\n useEffect(() => {\n // Use visualViewport api to track available height even on iOS virtual keyboard opening\n let onResize = () => {\n // Ignore updates when zoomed.\n if (visualViewport && visualViewport.scale > 1) {\n return;\n }\n\n setSize(size => {\n let newSize = getViewportSize();\n if (newSize.width === size.width && newSize.height === size.height) {\n return size;\n }\n return newSize;\n });\n };\n\n // When closing the keyboard, iOS does not fire the visual viewport resize event until the animation is complete.\n // We can anticipate this and resize early by handling the blur event and using the layout size.\n let frame: number;\n let onBlur = (e: FocusEvent) => {\n if (visualViewport && visualViewport.scale > 1) {\n return;\n }\n\n if (willOpenKeyboard(e.target as Element)) {\n // Wait one frame to see if a new element gets focused.\n frame = requestAnimationFrame(() => {\n if (!document.activeElement || !willOpenKeyboard(document.activeElement)) {\n setSize(size => {\n let newSize = {width: window.innerWidth, height: window.innerHeight};\n if (newSize.width === size.width && newSize.height === size.height) {\n return size;\n }\n return newSize;\n });\n }\n });\n }\n };\n\n window.addEventListener('blur', onBlur, true);\n\n if (!visualViewport) {\n window.addEventListener('resize', onResize);\n } else {\n visualViewport.addEventListener('resize', onResize);\n }\n\n return () => {\n cancelAnimationFrame(frame);\n window.removeEventListener('blur', onBlur, true);\n if (!visualViewport) {\n window.removeEventListener('resize', onResize);\n } else {\n visualViewport.removeEventListener('resize', onResize);\n }\n };\n }, []);\n\n return size;\n}\n\nfunction getViewportSize(): ViewportSize {\n return {\n // Multiply by the visualViewport scale to get the \"natural\" size, unaffected by pinch zooming.\n width: visualViewport ? visualViewport.width * visualViewport.scale : window.innerWidth,\n height: visualViewport ? visualViewport.height * visualViewport.scale : window.innerHeight\n };\n}\n"],"names":[],"version":3,"file":"useViewportSize.module.js.map"}
1
+ {"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAWD,IAAI,uCAAiB,OAAO,aAAa,eAAe,OAAO,c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AAO,uCAAiB,qCAAe,KAAK,GAAG,qCAAe,KAAK,GAAG,SAAS,eAAe,CAAC,WAAW;QAC1G,QAAQ,uCAAiB,qCAAe,MAAM,GAAG,qCAAe,KAAK,GAAG,SAAS,eAAe,CAAC,YAAY;IAC/G;AACF","sources":["packages/@react-aria/utils/src/useViewportSize.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {useEffect, useState} from 'react';\nimport {useIsSSR} from '@react-aria/ssr';\nimport {willOpenKeyboard} from './keyboard';\n\ninterface ViewportSize {\n width: number,\n height: number\n}\n\nlet visualViewport = typeof document !== 'undefined' && window.visualViewport;\n\nexport function useViewportSize(): ViewportSize {\n let isSSR = useIsSSR();\n let [size, setSize] = useState(() => isSSR ? {width: 0, height: 0} : getViewportSize());\n\n useEffect(() => {\n let updateSize = (newSize: ViewportSize) => {\n setSize(size => {\n if (newSize.width === size.width && newSize.height === size.height) {\n return size;\n }\n return newSize;\n });\n };\n\n // Use visualViewport api to track available height even on iOS virtual keyboard opening\n let onResize = () => {\n // Ignore updates when zoomed.\n if (visualViewport && visualViewport.scale > 1) {\n return;\n }\n\n updateSize(getViewportSize());\n };\n\n // When closing the keyboard, iOS does not fire the visual viewport resize event until the animation is complete.\n // We can anticipate this and resize early by handling the blur event and using the layout size.\n let frame: number;\n let onBlur = (e: FocusEvent) => {\n if (visualViewport && visualViewport.scale > 1) {\n return;\n }\n\n if (willOpenKeyboard(e.target as Element)) {\n // Wait one frame to see if a new element gets focused.\n frame = requestAnimationFrame(() => {\n if (!document.activeElement || !willOpenKeyboard(document.activeElement)) {\n updateSize({width: document.documentElement.clientWidth, height: document.documentElement.clientHeight});\n }\n });\n }\n };\n\n updateSize(getViewportSize());\n\n window.addEventListener('blur', onBlur, true);\n\n if (!visualViewport) {\n window.addEventListener('resize', onResize);\n } else {\n visualViewport.addEventListener('resize', onResize);\n }\n\n return () => {\n cancelAnimationFrame(frame);\n window.removeEventListener('blur', onBlur, true);\n if (!visualViewport) {\n window.removeEventListener('resize', onResize);\n } else {\n visualViewport.removeEventListener('resize', onResize);\n }\n };\n }, []);\n\n return size;\n}\n\nfunction getViewportSize(): ViewportSize {\n return {\n // Multiply by the visualViewport scale to get the \"natural\" size, unaffected by pinch zooming.\n width: visualViewport ? visualViewport.width * visualViewport.scale : document.documentElement.clientWidth,\n height: visualViewport ? visualViewport.height * visualViewport.scale : document.documentElement.clientHeight\n };\n}\n"],"names":[],"version":3,"file":"useViewportSize.module.js.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-aria/utils",
3
- "version": "3.32.0",
3
+ "version": "3.33.0",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -29,7 +29,7 @@
29
29
  "@react-aria/ssr": "^3.9.10",
30
30
  "@react-stately/flags": "^3.1.2",
31
31
  "@react-stately/utils": "^3.11.0",
32
- "@react-types/shared": "^3.32.1",
32
+ "@react-types/shared": "^3.33.0",
33
33
  "@swc/helpers": "^0.5.0",
34
34
  "clsx": "^2.0.0"
35
35
  },
@@ -40,5 +40,5 @@
40
40
  "publishConfig": {
41
41
  "access": "public"
42
42
  },
43
- "gitHead": "4d838da5bfe36abb35aed166995a9ef63825370f"
43
+ "gitHead": "66e51757606b43a89ed02c574ca24517323a2ab9"
44
44
  }
package/src/domHelpers.ts CHANGED
@@ -3,8 +3,8 @@ export const getOwnerDocument = (el: Element | null | undefined): Document => {
3
3
  };
4
4
 
5
5
  export const getOwnerWindow = (
6
- el: (Window & typeof global) | Element | null | undefined
7
- ): Window & typeof global => {
6
+ el: (Window & typeof globalThis) | Element | null | undefined
7
+ ): Window & typeof globalThis => {
8
8
  if (el && 'window' in el && el.window === el) {
9
9
  return el;
10
10
  }
package/src/mergeProps.ts CHANGED
@@ -13,6 +13,7 @@
13
13
  import {chain} from './chain';
14
14
  import clsx from 'clsx';
15
15
  import {mergeIds} from './useId';
16
+ import {mergeRefs} from './mergeRefs';
16
17
 
17
18
  interface Props {
18
19
  [key: string]: any
@@ -28,7 +29,7 @@ type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (
28
29
 
29
30
  /**
30
31
  * Merges multiple props objects together. Event handlers are chained,
31
- * classNames are combined, and ids are deduplicated.
32
+ * classNames are combined, ids are deduplicated, and refs are merged.
32
33
  * For all other props, the last prop object overrides all previous ones.
33
34
  * @param args - Multiple sets of props to merge together.
34
35
  */
@@ -63,6 +64,8 @@ export function mergeProps<T extends PropsArg[]>(...args: T): UnionToIntersectio
63
64
  result[key] = clsx(a, b);
64
65
  } else if (key === 'id' && a && b) {
65
66
  result.id = mergeIds(a, b);
67
+ } else if (key === 'ref' && a && b) {
68
+ result.ref = mergeRefs(a, b);
66
69
  // Override others
67
70
  } else {
68
71
  result[key] = b !== undefined ? b : a;
@@ -11,6 +11,7 @@
11
11
  */
12
12
 
13
13
  import {getScrollParents} from './getScrollParents';
14
+ import {nodeContains} from './shadowdom/DOMFunctions';
14
15
 
15
16
  interface ScrollIntoViewportOpts {
16
17
  /** The optional containing element of the target to be centered in the viewport. */
@@ -80,7 +81,7 @@ function relativeOffset(ancestor: HTMLElement, child: HTMLElement, axis: 'left'|
80
81
  if (child.offsetParent === ancestor) {
81
82
  // Stop once we have found the ancestor we are interested in.
82
83
  break;
83
- } else if (child.offsetParent.contains(ancestor)) {
84
+ } else if (nodeContains(child.offsetParent, ancestor)) {
84
85
  // If the ancestor is not `position:relative`, then we stop at
85
86
  // _its_ offset parent, and we subtract off _its_ offset, so that
86
87
  // we end up with the proper offset from child to ancestor.
@@ -98,7 +99,7 @@ function relativeOffset(ancestor: HTMLElement, child: HTMLElement, axis: 'left'|
98
99
  * the body (e.g. targetElement is in a popover), this will only scroll the scroll parents of the targetElement up to but not including the body itself.
99
100
  */
100
101
  export function scrollIntoViewport(targetElement: Element | null, opts?: ScrollIntoViewportOpts): void {
101
- if (targetElement && document.contains(targetElement)) {
102
+ if (targetElement && nodeContains(document, targetElement)) {
102
103
  let root = document.scrollingElement || document.documentElement;
103
104
  let isScrollPrevented = window.getComputedStyle(root).overflow === 'hidden';
104
105
  // If scrolling is not currently prevented then we aren’t in a overlay nor is a overlay open, just use element.scrollIntoView to bring the element into view
@@ -1,4 +1,5 @@
1
1
  // Source: https://github.com/microsoft/tabster/blob/a89fc5d7e332d48f68d03b1ca6e344489d1c3898/src/Shadowdomize/DOMFunctions.ts#L16
2
+ /* eslint-disable rsp-rules/no-non-shadow-contains */
2
3
 
3
4
  import {isShadowRoot} from '../domHelpers';
4
5
  import {shadowDOM} from '@react-stately/flags';
package/src/useDrag1D.ts CHANGED
@@ -13,6 +13,7 @@
13
13
  /* eslint-disable rulesdir/pure-render */
14
14
 
15
15
  import {getOffset} from './getOffset';
16
+ import {nodeContains} from './shadowdom/DOMFunctions';
16
17
  import {Orientation} from '@react-types/shared';
17
18
  import React, {HTMLAttributes, MutableRefObject, useRef} from 'react';
18
19
 
@@ -99,7 +100,7 @@ export function useDrag1D(props: UseDrag1DProps): HTMLAttributes<HTMLElement> {
99
100
  const target = e.currentTarget;
100
101
  // If we're already handling dragging on a descendant with useDrag1D, then
101
102
  // we don't want to handle the drag motion on this target as well.
102
- if (draggingElements.some(elt => target.contains(elt))) {
103
+ if (draggingElements.some(elt => nodeContains(target, elt))) {
103
104
  return;
104
105
  }
105
106
  draggingElements.push(target);
@@ -26,6 +26,15 @@ export function useViewportSize(): ViewportSize {
26
26
  let [size, setSize] = useState(() => isSSR ? {width: 0, height: 0} : getViewportSize());
27
27
 
28
28
  useEffect(() => {
29
+ let updateSize = (newSize: ViewportSize) => {
30
+ setSize(size => {
31
+ if (newSize.width === size.width && newSize.height === size.height) {
32
+ return size;
33
+ }
34
+ return newSize;
35
+ });
36
+ };
37
+
29
38
  // Use visualViewport api to track available height even on iOS virtual keyboard opening
30
39
  let onResize = () => {
31
40
  // Ignore updates when zoomed.
@@ -33,13 +42,7 @@ export function useViewportSize(): ViewportSize {
33
42
  return;
34
43
  }
35
44
 
36
- setSize(size => {
37
- let newSize = getViewportSize();
38
- if (newSize.width === size.width && newSize.height === size.height) {
39
- return size;
40
- }
41
- return newSize;
42
- });
45
+ updateSize(getViewportSize());
43
46
  };
44
47
 
45
48
  // When closing the keyboard, iOS does not fire the visual viewport resize event until the animation is complete.
@@ -54,18 +57,14 @@ export function useViewportSize(): ViewportSize {
54
57
  // Wait one frame to see if a new element gets focused.
55
58
  frame = requestAnimationFrame(() => {
56
59
  if (!document.activeElement || !willOpenKeyboard(document.activeElement)) {
57
- setSize(size => {
58
- let newSize = {width: window.innerWidth, height: window.innerHeight};
59
- if (newSize.width === size.width && newSize.height === size.height) {
60
- return size;
61
- }
62
- return newSize;
63
- });
60
+ updateSize({width: document.documentElement.clientWidth, height: document.documentElement.clientHeight});
64
61
  }
65
62
  });
66
63
  }
67
64
  };
68
65
 
66
+ updateSize(getViewportSize());
67
+
69
68
  window.addEventListener('blur', onBlur, true);
70
69
 
71
70
  if (!visualViewport) {
@@ -91,7 +90,7 @@ export function useViewportSize(): ViewportSize {
91
90
  function getViewportSize(): ViewportSize {
92
91
  return {
93
92
  // Multiply by the visualViewport scale to get the "natural" size, unaffected by pinch zooming.
94
- width: visualViewport ? visualViewport.width * visualViewport.scale : window.innerWidth,
95
- height: visualViewport ? visualViewport.height * visualViewport.scale : window.innerHeight
93
+ width: visualViewport ? visualViewport.width * visualViewport.scale : document.documentElement.clientWidth,
94
+ height: visualViewport ? visualViewport.height * visualViewport.scale : document.documentElement.clientHeight
96
95
  };
97
96
  }