@react-aria/utils 3.33.1 → 3.34.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.
Files changed (262) hide show
  1. package/dist/import.mjs +47 -43
  2. package/dist/main.js +120 -115
  3. package/dist/main.js.map +1 -1
  4. package/dist/module.js +47 -43
  5. package/dist/module.js.map +1 -1
  6. package/dist/types/src/index.d.ts +45 -0
  7. package/package.json +15 -15
  8. package/src/index.ts +45 -43
  9. package/dist/DOMFunctions.main.js +0 -57
  10. package/dist/DOMFunctions.main.js.map +0 -1
  11. package/dist/DOMFunctions.mjs +0 -49
  12. package/dist/DOMFunctions.module.js +0 -49
  13. package/dist/DOMFunctions.module.js.map +0 -1
  14. package/dist/ShadowTreeWalker.main.js +0 -200
  15. package/dist/ShadowTreeWalker.main.js.map +0 -1
  16. package/dist/ShadowTreeWalker.mjs +0 -194
  17. package/dist/ShadowTreeWalker.module.js +0 -194
  18. package/dist/ShadowTreeWalker.module.js.map +0 -1
  19. package/dist/animation.main.js +0 -97
  20. package/dist/animation.main.js.map +0 -1
  21. package/dist/animation.mjs +0 -91
  22. package/dist/animation.module.js +0 -91
  23. package/dist/animation.module.js.map +0 -1
  24. package/dist/chain.main.js +0 -26
  25. package/dist/chain.main.js.map +0 -1
  26. package/dist/chain.mjs +0 -21
  27. package/dist/chain.module.js +0 -21
  28. package/dist/chain.module.js.map +0 -1
  29. package/dist/constants.main.js +0 -23
  30. package/dist/constants.main.js.map +0 -1
  31. package/dist/constants.mjs +0 -17
  32. package/dist/constants.module.js +0 -17
  33. package/dist/constants.module.js.map +0 -1
  34. package/dist/domHelpers.main.js +0 -28
  35. package/dist/domHelpers.main.js.map +0 -1
  36. package/dist/domHelpers.mjs +0 -21
  37. package/dist/domHelpers.module.js +0 -21
  38. package/dist/domHelpers.module.js.map +0 -1
  39. package/dist/filterDOMProps.main.js +0 -88
  40. package/dist/filterDOMProps.main.js.map +0 -1
  41. package/dist/filterDOMProps.mjs +0 -83
  42. package/dist/filterDOMProps.module.js +0 -83
  43. package/dist/filterDOMProps.module.js.map +0 -1
  44. package/dist/focusWithoutScrolling.main.js +0 -72
  45. package/dist/focusWithoutScrolling.main.js.map +0 -1
  46. package/dist/focusWithoutScrolling.mjs +0 -67
  47. package/dist/focusWithoutScrolling.module.js +0 -67
  48. package/dist/focusWithoutScrolling.module.js.map +0 -1
  49. package/dist/getOffset.main.js +0 -24
  50. package/dist/getOffset.main.js.map +0 -1
  51. package/dist/getOffset.mjs +0 -19
  52. package/dist/getOffset.module.js +0 -19
  53. package/dist/getOffset.module.js.map +0 -1
  54. package/dist/getScrollParent.main.js +0 -28
  55. package/dist/getScrollParent.main.js.map +0 -1
  56. package/dist/getScrollParent.mjs +0 -23
  57. package/dist/getScrollParent.module.js +0 -23
  58. package/dist/getScrollParent.module.js.map +0 -1
  59. package/dist/getScrollParents.main.js +0 -31
  60. package/dist/getScrollParents.main.js.map +0 -1
  61. package/dist/getScrollParents.mjs +0 -26
  62. package/dist/getScrollParents.module.js +0 -26
  63. package/dist/getScrollParents.module.js.map +0 -1
  64. package/dist/inertValue.main.js +0 -19
  65. package/dist/inertValue.main.js.map +0 -1
  66. package/dist/inertValue.mjs +0 -14
  67. package/dist/inertValue.module.js +0 -14
  68. package/dist/inertValue.module.js.map +0 -1
  69. package/dist/isElementVisible.main.js +0 -45
  70. package/dist/isElementVisible.main.js.map +0 -1
  71. package/dist/isElementVisible.mjs +0 -40
  72. package/dist/isElementVisible.module.js +0 -40
  73. package/dist/isElementVisible.module.js.map +0 -1
  74. package/dist/isFocusable.main.js +0 -56
  75. package/dist/isFocusable.main.js.map +0 -1
  76. package/dist/isFocusable.mjs +0 -50
  77. package/dist/isFocusable.module.js +0 -50
  78. package/dist/isFocusable.module.js.map +0 -1
  79. package/dist/isScrollable.main.js +0 -29
  80. package/dist/isScrollable.main.js.map +0 -1
  81. package/dist/isScrollable.mjs +0 -24
  82. package/dist/isScrollable.module.js +0 -24
  83. package/dist/isScrollable.module.js.map +0 -1
  84. package/dist/isVirtualEvent.main.js +0 -41
  85. package/dist/isVirtualEvent.main.js.map +0 -1
  86. package/dist/isVirtualEvent.mjs +0 -35
  87. package/dist/isVirtualEvent.module.js +0 -35
  88. package/dist/isVirtualEvent.module.js.map +0 -1
  89. package/dist/keyboard.main.js +0 -42
  90. package/dist/keyboard.main.js.map +0 -1
  91. package/dist/keyboard.mjs +0 -36
  92. package/dist/keyboard.module.js +0 -36
  93. package/dist/keyboard.module.js.map +0 -1
  94. package/dist/mergeProps.main.js +0 -54
  95. package/dist/mergeProps.main.js.map +0 -1
  96. package/dist/mergeProps.mjs +0 -45
  97. package/dist/mergeProps.module.js +0 -45
  98. package/dist/mergeProps.module.js.map +0 -1
  99. package/dist/mergeRefs.main.js +0 -40
  100. package/dist/mergeRefs.main.js.map +0 -1
  101. package/dist/mergeRefs.mjs +0 -35
  102. package/dist/mergeRefs.module.js +0 -35
  103. package/dist/mergeRefs.module.js.map +0 -1
  104. package/dist/openLink.main.js +0 -169
  105. package/dist/openLink.main.js.map +0 -1
  106. package/dist/openLink.mjs +0 -153
  107. package/dist/openLink.module.js +0 -153
  108. package/dist/openLink.module.js.map +0 -1
  109. package/dist/platform.main.js +0 -73
  110. package/dist/platform.main.js.map +0 -1
  111. package/dist/platform.mjs +0 -60
  112. package/dist/platform.module.js +0 -60
  113. package/dist/platform.module.js.map +0 -1
  114. package/dist/runAfterTransition.main.js +0 -97
  115. package/dist/runAfterTransition.main.js.map +0 -1
  116. package/dist/runAfterTransition.mjs +0 -92
  117. package/dist/runAfterTransition.module.js +0 -92
  118. package/dist/runAfterTransition.module.js.map +0 -1
  119. package/dist/scrollIntoView.main.js +0 -138
  120. package/dist/scrollIntoView.main.js.map +0 -1
  121. package/dist/scrollIntoView.mjs +0 -132
  122. package/dist/scrollIntoView.module.js +0 -132
  123. package/dist/scrollIntoView.module.js.map +0 -1
  124. package/dist/types.d.ts +0 -299
  125. package/dist/types.d.ts.map +0 -1
  126. package/dist/useDeepMemo.main.js +0 -30
  127. package/dist/useDeepMemo.main.js.map +0 -1
  128. package/dist/useDeepMemo.mjs +0 -25
  129. package/dist/useDeepMemo.module.js +0 -25
  130. package/dist/useDeepMemo.module.js.map +0 -1
  131. package/dist/useDescription.main.js +0 -59
  132. package/dist/useDescription.main.js.map +0 -1
  133. package/dist/useDescription.mjs +0 -54
  134. package/dist/useDescription.module.js +0 -54
  135. package/dist/useDescription.module.js.map +0 -1
  136. package/dist/useDrag1D.main.js +0 -141
  137. package/dist/useDrag1D.main.js.map +0 -1
  138. package/dist/useDrag1D.mjs +0 -136
  139. package/dist/useDrag1D.module.js +0 -136
  140. package/dist/useDrag1D.module.js.map +0 -1
  141. package/dist/useEffectEvent.main.js +0 -45
  142. package/dist/useEffectEvent.main.js.map +0 -1
  143. package/dist/useEffectEvent.mjs +0 -36
  144. package/dist/useEffectEvent.module.js +0 -36
  145. package/dist/useEffectEvent.module.js.map +0 -1
  146. package/dist/useEvent.main.js +0 -41
  147. package/dist/useEvent.main.js.map +0 -1
  148. package/dist/useEvent.mjs +0 -36
  149. package/dist/useEvent.module.js +0 -36
  150. package/dist/useEvent.module.js.map +0 -1
  151. package/dist/useFormReset.main.js +0 -39
  152. package/dist/useFormReset.main.js.map +0 -1
  153. package/dist/useFormReset.mjs +0 -34
  154. package/dist/useFormReset.module.js +0 -34
  155. package/dist/useFormReset.module.js.map +0 -1
  156. package/dist/useGlobalListeners.main.js +0 -62
  157. package/dist/useGlobalListeners.main.js.map +0 -1
  158. package/dist/useGlobalListeners.mjs +0 -57
  159. package/dist/useGlobalListeners.module.js +0 -57
  160. package/dist/useGlobalListeners.module.js.map +0 -1
  161. package/dist/useId.main.js +0 -108
  162. package/dist/useId.main.js.map +0 -1
  163. package/dist/useId.mjs +0 -101
  164. package/dist/useId.module.js +0 -101
  165. package/dist/useId.module.js.map +0 -1
  166. package/dist/useLabels.main.js +0 -44
  167. package/dist/useLabels.main.js.map +0 -1
  168. package/dist/useLabels.mjs +0 -39
  169. package/dist/useLabels.module.js +0 -39
  170. package/dist/useLabels.module.js.map +0 -1
  171. package/dist/useLayoutEffect.main.js +0 -27
  172. package/dist/useLayoutEffect.main.js.map +0 -1
  173. package/dist/useLayoutEffect.mjs +0 -18
  174. package/dist/useLayoutEffect.module.js +0 -18
  175. package/dist/useLayoutEffect.module.js.map +0 -1
  176. package/dist/useLoadMore.main.js +0 -73
  177. package/dist/useLoadMore.main.js.map +0 -1
  178. package/dist/useLoadMore.mjs +0 -68
  179. package/dist/useLoadMore.module.js +0 -68
  180. package/dist/useLoadMore.module.js.map +0 -1
  181. package/dist/useLoadMoreSentinel.main.js +0 -58
  182. package/dist/useLoadMoreSentinel.main.js.map +0 -1
  183. package/dist/useLoadMoreSentinel.mjs +0 -53
  184. package/dist/useLoadMoreSentinel.module.js +0 -53
  185. package/dist/useLoadMoreSentinel.module.js.map +0 -1
  186. package/dist/useObjectRef.main.js +0 -58
  187. package/dist/useObjectRef.main.js.map +0 -1
  188. package/dist/useObjectRef.mjs +0 -53
  189. package/dist/useObjectRef.module.js +0 -53
  190. package/dist/useObjectRef.module.js.map +0 -1
  191. package/dist/useResizeObserver.main.js +0 -47
  192. package/dist/useResizeObserver.main.js.map +0 -1
  193. package/dist/useResizeObserver.mjs +0 -42
  194. package/dist/useResizeObserver.module.js +0 -42
  195. package/dist/useResizeObserver.module.js.map +0 -1
  196. package/dist/useSyncRef.main.js +0 -32
  197. package/dist/useSyncRef.main.js.map +0 -1
  198. package/dist/useSyncRef.mjs +0 -27
  199. package/dist/useSyncRef.module.js +0 -27
  200. package/dist/useSyncRef.module.js.map +0 -1
  201. package/dist/useUpdateEffect.main.js +0 -42
  202. package/dist/useUpdateEffect.main.js.map +0 -1
  203. package/dist/useUpdateEffect.mjs +0 -37
  204. package/dist/useUpdateEffect.module.js +0 -37
  205. package/dist/useUpdateEffect.module.js.map +0 -1
  206. package/dist/useUpdateLayoutEffect.main.js +0 -40
  207. package/dist/useUpdateLayoutEffect.main.js.map +0 -1
  208. package/dist/useUpdateLayoutEffect.mjs +0 -35
  209. package/dist/useUpdateLayoutEffect.module.js +0 -35
  210. package/dist/useUpdateLayoutEffect.module.js.map +0 -1
  211. package/dist/useValueEffect.main.js +0 -63
  212. package/dist/useValueEffect.main.js.map +0 -1
  213. package/dist/useValueEffect.mjs +0 -58
  214. package/dist/useValueEffect.module.js +0 -58
  215. package/dist/useValueEffect.module.js.map +0 -1
  216. package/dist/useViewportSize.main.js +0 -84
  217. package/dist/useViewportSize.main.js.map +0 -1
  218. package/dist/useViewportSize.mjs +0 -79
  219. package/dist/useViewportSize.module.js +0 -79
  220. package/dist/useViewportSize.module.js.map +0 -1
  221. package/src/animation.ts +0 -103
  222. package/src/chain.ts +0 -24
  223. package/src/constants.ts +0 -15
  224. package/src/domHelpers.ts +0 -33
  225. package/src/filterDOMProps.ts +0 -127
  226. package/src/focusWithoutScrolling.ts +0 -96
  227. package/src/getOffset.ts +0 -21
  228. package/src/getScrollParent.ts +0 -27
  229. package/src/getScrollParents.ts +0 -27
  230. package/src/inertValue.ts +0 -11
  231. package/src/isElementVisible.ts +0 -75
  232. package/src/isFocusable.ts +0 -56
  233. package/src/isScrollable.ts +0 -31
  234. package/src/isVirtualEvent.ts +0 -58
  235. package/src/keyboard.tsx +0 -48
  236. package/src/mergeProps.ts +0 -77
  237. package/src/mergeRefs.ts +0 -52
  238. package/src/openLink.tsx +0 -201
  239. package/src/platform.ts +0 -78
  240. package/src/runAfterTransition.ts +0 -124
  241. package/src/scrollIntoView.ts +0 -168
  242. package/src/shadowdom/DOMFunctions.ts +0 -100
  243. package/src/shadowdom/ShadowTreeWalker.ts +0 -319
  244. package/src/useDeepMemo.ts +0 -27
  245. package/src/useDescription.ts +0 -56
  246. package/src/useDrag1D.ts +0 -191
  247. package/src/useEffectEvent.ts +0 -30
  248. package/src/useEvent.ts +0 -37
  249. package/src/useFormReset.ts +0 -36
  250. package/src/useGlobalListeners.ts +0 -52
  251. package/src/useId.ts +0 -129
  252. package/src/useLabels.ts +0 -48
  253. package/src/useLayoutEffect.ts +0 -20
  254. package/src/useLoadMore.ts +0 -82
  255. package/src/useLoadMoreSentinel.ts +0 -63
  256. package/src/useObjectRef.ts +0 -69
  257. package/src/useResizeObserver.ts +0 -52
  258. package/src/useSyncRef.ts +0 -33
  259. package/src/useUpdateEffect.ts +0 -39
  260. package/src/useUpdateLayoutEffect.ts +0 -37
  261. package/src/useValueEffect.ts +0 -68
  262. package/src/useViewportSize.ts +0 -103
@@ -1,35 +0,0 @@
1
- import {isAndroid as $c87311424ea30a05$export$a11b0059900ceec8} from "./platform.mjs";
2
-
3
- /*
4
- * Copyright 2022 Adobe. All rights reserved.
5
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License. You may obtain a copy
7
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software distributed under
10
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
11
- * OF ANY KIND, either express or implied. See the License for the specific language
12
- * governing permissions and limitations under the License.
13
- */
14
- function $6a7db85432448f7f$export$60278871457622de(event) {
15
- // JAWS/NVDA with Firefox.
16
- if (event.pointerType === '' && event.isTrusted) return true;
17
- // Android TalkBack's detail value varies depending on the event listener providing the event so we have specific logic here instead
18
- // If pointerType is defined, event is from a click listener. For events from mousedown listener, detail === 0 is a sufficient check
19
- // to detect TalkBack virtual clicks.
20
- if ((0, $c87311424ea30a05$export$a11b0059900ceec8)() && event.pointerType) return event.type === 'click' && event.buttons === 1;
21
- return event.detail === 0 && !event.pointerType;
22
- }
23
- function $6a7db85432448f7f$export$29bf1b5f2c56cf63(event) {
24
- // If the pointer size is zero, then we assume it's from a screen reader.
25
- // Android TalkBack double tap will sometimes return a event with width and height of 1
26
- // and pointerType === 'mouse' so we need to check for a specific combination of event attributes.
27
- // Cannot use "event.pressure === 0" as the sole check due to Safari pointer events always returning pressure === 0
28
- // instead of .5, see https://bugs.webkit.org/show_bug.cgi?id=206216. event.pointerType === 'mouse' is to distingush
29
- // Talkback double tap from Windows Firefox touch screen press
30
- return !(0, $c87311424ea30a05$export$a11b0059900ceec8)() && event.width === 0 && event.height === 0 || event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === 'mouse';
31
- }
32
-
33
-
34
- export {$6a7db85432448f7f$export$60278871457622de as isVirtualClick, $6a7db85432448f7f$export$29bf1b5f2c56cf63 as isVirtualPointerEvent};
35
- //# sourceMappingURL=isVirtualEvent.module.js.map
@@ -1,35 +0,0 @@
1
- import {isAndroid as $c87311424ea30a05$export$a11b0059900ceec8} from "./platform.module.js";
2
-
3
- /*
4
- * Copyright 2022 Adobe. All rights reserved.
5
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License. You may obtain a copy
7
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software distributed under
10
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
11
- * OF ANY KIND, either express or implied. See the License for the specific language
12
- * governing permissions and limitations under the License.
13
- */
14
- function $6a7db85432448f7f$export$60278871457622de(event) {
15
- // JAWS/NVDA with Firefox.
16
- if (event.pointerType === '' && event.isTrusted) return true;
17
- // Android TalkBack's detail value varies depending on the event listener providing the event so we have specific logic here instead
18
- // If pointerType is defined, event is from a click listener. For events from mousedown listener, detail === 0 is a sufficient check
19
- // to detect TalkBack virtual clicks.
20
- if ((0, $c87311424ea30a05$export$a11b0059900ceec8)() && event.pointerType) return event.type === 'click' && event.buttons === 1;
21
- return event.detail === 0 && !event.pointerType;
22
- }
23
- function $6a7db85432448f7f$export$29bf1b5f2c56cf63(event) {
24
- // If the pointer size is zero, then we assume it's from a screen reader.
25
- // Android TalkBack double tap will sometimes return a event with width and height of 1
26
- // and pointerType === 'mouse' so we need to check for a specific combination of event attributes.
27
- // Cannot use "event.pressure === 0" as the sole check due to Safari pointer events always returning pressure === 0
28
- // instead of .5, see https://bugs.webkit.org/show_bug.cgi?id=206216. event.pointerType === 'mouse' is to distingush
29
- // Talkback double tap from Windows Firefox touch screen press
30
- return !(0, $c87311424ea30a05$export$a11b0059900ceec8)() && event.width === 0 && event.height === 0 || event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === 'mouse';
31
- }
32
-
33
-
34
- export {$6a7db85432448f7f$export$60278871457622de as isVirtualClick, $6a7db85432448f7f$export$29bf1b5f2c56cf63 as isVirtualPointerEvent};
35
- //# sourceMappingURL=isVirtualEvent.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;AAAA;;;;;;;;;;CAUC;AAeM,SAAS,0CAAe,KAAgC;IAC7D,0BAA0B;IAC1B,IAAI,AAAC,MAAuB,WAAW,KAAK,MAAM,MAAM,SAAS,EAC/D,OAAO;IAGT,oIAAoI;IACpI,oIAAoI;IACpI,qCAAqC;IACrC,IAAI,CAAA,GAAA,yCAAQ,OAAO,AAAC,MAAuB,WAAW,EACpD,OAAO,MAAM,IAAI,KAAK,WAAW,MAAM,OAAO,KAAK;IAGrD,OAAO,MAAM,MAAM,KAAK,KAAK,CAAC,AAAC,MAAuB,WAAW;AACnE;AAEO,SAAS,0CAAsB,KAAmB;IACvD,yEAAyE;IACzE,uFAAuF;IACvF,kGAAkG;IAClG,mHAAmH;IACnH,oHAAoH;IACpH,8DAA8D;IAC9D,OACE,AAAC,CAAC,CAAA,GAAA,yCAAQ,OAAO,MAAM,KAAK,KAAK,KAAK,MAAM,MAAM,KAAK,KACtD,MAAM,KAAK,KAAK,KACf,MAAM,MAAM,KAAK,KACjB,MAAM,QAAQ,KAAK,KACnB,MAAM,MAAM,KAAK,KACjB,MAAM,WAAW,KAAK;AAG5B","sources":["packages/@react-aria/utils/src/isVirtualEvent.ts"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {isAndroid} from './platform';\n\n// Original licensing for the following method can be found in the\n// NOTICE file in the root directory of this source tree.\n// See https://github.com/facebook/react/blob/3c713d513195a53788b3f8bb4b70279d68b15bcc/packages/react-interactions/events/src/dom/shared/index.js#L74-L87\n\n// Keyboards, Assistive Technologies, and element.click() all produce a \"virtual\"\n// click event. This is a method of inferring such clicks. Every browser except\n// IE 11 only sets a zero value of \"detail\" for click events that are \"virtual\".\n// However, IE 11 uses a zero value for all click events. For IE 11 we rely on\n// the quirk that it produces click events that are of type PointerEvent, and\n// where only the \"virtual\" click lacks a pointerType field.\n\nexport function isVirtualClick(event: MouseEvent | PointerEvent): boolean {\n // JAWS/NVDA with Firefox.\n if ((event as PointerEvent).pointerType === '' && event.isTrusted) {\n return true;\n }\n\n // Android TalkBack's detail value varies depending on the event listener providing the event so we have specific logic here instead\n // If pointerType is defined, event is from a click listener. For events from mousedown listener, detail === 0 is a sufficient check\n // to detect TalkBack virtual clicks.\n if (isAndroid() && (event as PointerEvent).pointerType) {\n return event.type === 'click' && event.buttons === 1;\n }\n\n return event.detail === 0 && !(event as PointerEvent).pointerType;\n}\n\nexport function isVirtualPointerEvent(event: PointerEvent): boolean {\n // If the pointer size is zero, then we assume it's from a screen reader.\n // Android TalkBack double tap will sometimes return a event with width and height of 1\n // and pointerType === 'mouse' so we need to check for a specific combination of event attributes.\n // Cannot use \"event.pressure === 0\" as the sole check due to Safari pointer events always returning pressure === 0\n // instead of .5, see https://bugs.webkit.org/show_bug.cgi?id=206216. event.pointerType === 'mouse' is to distingush\n // Talkback double tap from Windows Firefox touch screen press\n return (\n (!isAndroid() && event.width === 0 && event.height === 0) ||\n (event.width === 1 &&\n event.height === 1 &&\n event.pressure === 0 &&\n event.detail === 0 &&\n event.pointerType === 'mouse'\n )\n );\n}\n"],"names":[],"version":3,"file":"isVirtualEvent.module.js.map"}
@@ -1,42 +0,0 @@
1
- var $9e20cff0af27e8cc$exports = require("./platform.main.js");
2
-
3
-
4
- function $parcel$export(e, n, v, s) {
5
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
6
- }
7
-
8
- $parcel$export(module.exports, "isCtrlKeyPressed", () => $2308dc377e184bb0$export$16792effe837dba3);
9
- $parcel$export(module.exports, "willOpenKeyboard", () => $2308dc377e184bb0$export$c57958e35f31ed73);
10
- /*
11
- * Copyright 2024 Adobe. All rights reserved.
12
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
13
- * you may not use this file except in compliance with the License. You may obtain a copy
14
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
15
- *
16
- * Unless required by applicable law or agreed to in writing, software distributed under
17
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
18
- * OF ANY KIND, either express or implied. See the License for the specific language
19
- * governing permissions and limitations under the License.
20
- */
21
- function $2308dc377e184bb0$export$16792effe837dba3(e) {
22
- if ((0, $9e20cff0af27e8cc$exports.isMac)()) return e.metaKey;
23
- return e.ctrlKey;
24
- }
25
- // HTML input types that do not cause the software keyboard to appear.
26
- const $2308dc377e184bb0$var$nonTextInputTypes = new Set([
27
- 'checkbox',
28
- 'radio',
29
- 'range',
30
- 'color',
31
- 'file',
32
- 'image',
33
- 'button',
34
- 'submit',
35
- 'reset'
36
- ]);
37
- function $2308dc377e184bb0$export$c57958e35f31ed73(target) {
38
- return target instanceof HTMLInputElement && !$2308dc377e184bb0$var$nonTextInputTypes.has(target.type) || target instanceof HTMLTextAreaElement || target instanceof HTMLElement && target.isContentEditable;
39
- }
40
-
41
-
42
- //# sourceMappingURL=keyboard.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;AAUM,SAAS,0CAAiB,CAAQ;IACvC,IAAI,CAAA,GAAA,+BAAI,KACN,OAAO,EAAE,OAAO;IAGlB,OAAO,EAAE,OAAO;AAClB;AAEA,sEAAsE;AACtE,MAAM,0CAAoB,IAAI,IAAI;IAChC;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAEM,SAAS,0CAAiB,MAAe;IAC9C,OACE,AAAC,kBAAkB,oBAAoB,CAAC,wCAAkB,GAAG,CAAC,OAAO,IAAI,KACzE,kBAAkB,uBACjB,kBAAkB,eAAe,OAAO,iBAAiB;AAE9D","sources":["packages/@react-aria/utils/src/keyboard.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {isMac} from './platform';\n\ninterface Event {\n altKey: boolean,\n ctrlKey: boolean,\n metaKey: boolean\n}\n\nexport function isCtrlKeyPressed(e: Event): boolean {\n if (isMac()) {\n return e.metaKey;\n }\n\n return e.ctrlKey;\n}\n\n// HTML input types that do not cause the software keyboard to appear.\nconst nonTextInputTypes = new Set([\n 'checkbox',\n 'radio',\n 'range',\n 'color',\n 'file',\n 'image',\n 'button',\n 'submit',\n 'reset'\n]);\n\nexport function willOpenKeyboard(target: Element) {\n return (\n (target instanceof HTMLInputElement && !nonTextInputTypes.has(target.type)) ||\n target instanceof HTMLTextAreaElement ||\n (target instanceof HTMLElement && target.isContentEditable)\n );\n}\n"],"names":[],"version":3,"file":"keyboard.main.js.map"}
package/dist/keyboard.mjs DELETED
@@ -1,36 +0,0 @@
1
- import {isMac as $c87311424ea30a05$export$9ac100e40613ea10} from "./platform.mjs";
2
-
3
- /*
4
- * Copyright 2024 Adobe. All rights reserved.
5
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License. You may obtain a copy
7
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software distributed under
10
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
11
- * OF ANY KIND, either express or implied. See the License for the specific language
12
- * governing permissions and limitations under the License.
13
- */
14
- function $21f1aa98acb08317$export$16792effe837dba3(e) {
15
- if ((0, $c87311424ea30a05$export$9ac100e40613ea10)()) return e.metaKey;
16
- return e.ctrlKey;
17
- }
18
- // HTML input types that do not cause the software keyboard to appear.
19
- const $21f1aa98acb08317$var$nonTextInputTypes = new Set([
20
- 'checkbox',
21
- 'radio',
22
- 'range',
23
- 'color',
24
- 'file',
25
- 'image',
26
- 'button',
27
- 'submit',
28
- 'reset'
29
- ]);
30
- function $21f1aa98acb08317$export$c57958e35f31ed73(target) {
31
- return target instanceof HTMLInputElement && !$21f1aa98acb08317$var$nonTextInputTypes.has(target.type) || target instanceof HTMLTextAreaElement || target instanceof HTMLElement && target.isContentEditable;
32
- }
33
-
34
-
35
- export {$21f1aa98acb08317$export$16792effe837dba3 as isCtrlKeyPressed, $21f1aa98acb08317$export$c57958e35f31ed73 as willOpenKeyboard};
36
- //# sourceMappingURL=keyboard.module.js.map
@@ -1,36 +0,0 @@
1
- import {isMac as $c87311424ea30a05$export$9ac100e40613ea10} from "./platform.module.js";
2
-
3
- /*
4
- * Copyright 2024 Adobe. All rights reserved.
5
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License. You may obtain a copy
7
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software distributed under
10
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
11
- * OF ANY KIND, either express or implied. See the License for the specific language
12
- * governing permissions and limitations under the License.
13
- */
14
- function $21f1aa98acb08317$export$16792effe837dba3(e) {
15
- if ((0, $c87311424ea30a05$export$9ac100e40613ea10)()) return e.metaKey;
16
- return e.ctrlKey;
17
- }
18
- // HTML input types that do not cause the software keyboard to appear.
19
- const $21f1aa98acb08317$var$nonTextInputTypes = new Set([
20
- 'checkbox',
21
- 'radio',
22
- 'range',
23
- 'color',
24
- 'file',
25
- 'image',
26
- 'button',
27
- 'submit',
28
- 'reset'
29
- ]);
30
- function $21f1aa98acb08317$export$c57958e35f31ed73(target) {
31
- return target instanceof HTMLInputElement && !$21f1aa98acb08317$var$nonTextInputTypes.has(target.type) || target instanceof HTMLTextAreaElement || target instanceof HTMLElement && target.isContentEditable;
32
- }
33
-
34
-
35
- export {$21f1aa98acb08317$export$16792effe837dba3 as isCtrlKeyPressed, $21f1aa98acb08317$export$c57958e35f31ed73 as willOpenKeyboard};
36
- //# sourceMappingURL=keyboard.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;AAAA;;;;;;;;;;CAUC;AAUM,SAAS,0CAAiB,CAAQ;IACvC,IAAI,CAAA,GAAA,yCAAI,KACN,OAAO,EAAE,OAAO;IAGlB,OAAO,EAAE,OAAO;AAClB;AAEA,sEAAsE;AACtE,MAAM,0CAAoB,IAAI,IAAI;IAChC;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAEM,SAAS,0CAAiB,MAAe;IAC9C,OACE,AAAC,kBAAkB,oBAAoB,CAAC,wCAAkB,GAAG,CAAC,OAAO,IAAI,KACzE,kBAAkB,uBACjB,kBAAkB,eAAe,OAAO,iBAAiB;AAE9D","sources":["packages/@react-aria/utils/src/keyboard.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {isMac} from './platform';\n\ninterface Event {\n altKey: boolean,\n ctrlKey: boolean,\n metaKey: boolean\n}\n\nexport function isCtrlKeyPressed(e: Event): boolean {\n if (isMac()) {\n return e.metaKey;\n }\n\n return e.ctrlKey;\n}\n\n// HTML input types that do not cause the software keyboard to appear.\nconst nonTextInputTypes = new Set([\n 'checkbox',\n 'radio',\n 'range',\n 'color',\n 'file',\n 'image',\n 'button',\n 'submit',\n 'reset'\n]);\n\nexport function willOpenKeyboard(target: Element) {\n return (\n (target instanceof HTMLInputElement && !nonTextInputTypes.has(target.type)) ||\n target instanceof HTMLTextAreaElement ||\n (target instanceof HTMLElement && target.isContentEditable)\n );\n}\n"],"names":[],"version":3,"file":"keyboard.module.js.map"}
@@ -1,54 +0,0 @@
1
- var $1e2191638e54f613$exports = require("./chain.main.js");
2
- var $8c61827343eed941$exports = require("./useId.main.js");
3
- var $f05dc24eafaeb7e2$exports = require("./mergeRefs.main.js");
4
- var $eVrjB$clsx = require("clsx");
5
-
6
-
7
- function $parcel$interopDefault(a) {
8
- return a && a.__esModule ? a.default : a;
9
- }
10
-
11
- function $parcel$export(e, n, v, s) {
12
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
13
- }
14
-
15
- $parcel$export(module.exports, "mergeProps", () => $f847cd1382ea7cd4$export$9d1611c77c2fe928);
16
- /*
17
- * Copyright 2020 Adobe. All rights reserved.
18
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
19
- * you may not use this file except in compliance with the License. You may obtain a copy
20
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
21
- *
22
- * Unless required by applicable law or agreed to in writing, software distributed under
23
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
24
- * OF ANY KIND, either express or implied. See the License for the specific language
25
- * governing permissions and limitations under the License.
26
- */
27
-
28
-
29
-
30
- function $f847cd1382ea7cd4$export$9d1611c77c2fe928(...args) {
31
- // Start with a base clone of the first argument. This is a lot faster than starting
32
- // with an empty object and adding properties as we go.
33
- let result = {
34
- ...args[0]
35
- };
36
- for(let i = 1; i < args.length; i++){
37
- let props = args[i];
38
- for(let key in props){
39
- let a = result[key];
40
- let b = props[key];
41
- // Chain events
42
- if (typeof a === 'function' && typeof b === 'function' && // This is a lot faster than a regex.
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);
44
- else if ((key === 'className' || key === 'UNSAFE_className') && typeof a === 'string' && typeof b === 'string') result[key] = (0, ($parcel$interopDefault($eVrjB$clsx)))(a, b);
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);
47
- else result[key] = b !== undefined ? b : a;
48
- }
49
- }
50
- return result;
51
- }
52
-
53
-
54
- //# sourceMappingURL=mergeProps.main.js.map
@@ -1 +0,0 @@
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,45 +0,0 @@
1
- import {chain as $ff5963eb1fccf552$export$e08e3b67e392101e} from "./chain.mjs";
2
- import {mergeIds as $bdb11010cef70236$export$cd8c9cb68f842629} from "./useId.mjs";
3
- import {mergeRefs as $5dc95899b306f630$export$c9058316764c140e} from "./mergeRefs.mjs";
4
- import $7jXr9$clsx from "clsx";
5
-
6
- /*
7
- * Copyright 2020 Adobe. All rights reserved.
8
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
9
- * you may not use this file except in compliance with the License. You may obtain a copy
10
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software distributed under
13
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
14
- * OF ANY KIND, either express or implied. See the License for the specific language
15
- * governing permissions and limitations under the License.
16
- */
17
-
18
-
19
-
20
- function $3ef42575df84b30b$export$9d1611c77c2fe928(...args) {
21
- // Start with a base clone of the first argument. This is a lot faster than starting
22
- // with an empty object and adding properties as we go.
23
- let result = {
24
- ...args[0]
25
- };
26
- for(let i = 1; i < args.length; i++){
27
- let props = args[i];
28
- for(let key in props){
29
- let a = result[key];
30
- let b = props[key];
31
- // Chain events
32
- if (typeof a === 'function' && typeof b === 'function' && // This is a lot faster than a regex.
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);
34
- else if ((key === 'className' || key === 'UNSAFE_className') && typeof a === 'string' && typeof b === 'string') result[key] = (0, $7jXr9$clsx)(a, b);
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);
37
- else result[key] = b !== undefined ? b : a;
38
- }
39
- }
40
- return result;
41
- }
42
-
43
-
44
- export {$3ef42575df84b30b$export$9d1611c77c2fe928 as mergeProps};
45
- //# sourceMappingURL=mergeProps.module.js.map
@@ -1,45 +0,0 @@
1
- import {chain as $ff5963eb1fccf552$export$e08e3b67e392101e} from "./chain.module.js";
2
- import {mergeIds as $bdb11010cef70236$export$cd8c9cb68f842629} from "./useId.module.js";
3
- import {mergeRefs as $5dc95899b306f630$export$c9058316764c140e} from "./mergeRefs.module.js";
4
- import $7jXr9$clsx from "clsx";
5
-
6
- /*
7
- * Copyright 2020 Adobe. All rights reserved.
8
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
9
- * you may not use this file except in compliance with the License. You may obtain a copy
10
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software distributed under
13
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
14
- * OF ANY KIND, either express or implied. See the License for the specific language
15
- * governing permissions and limitations under the License.
16
- */
17
-
18
-
19
-
20
- function $3ef42575df84b30b$export$9d1611c77c2fe928(...args) {
21
- // Start with a base clone of the first argument. This is a lot faster than starting
22
- // with an empty object and adding properties as we go.
23
- let result = {
24
- ...args[0]
25
- };
26
- for(let i = 1; i < args.length; i++){
27
- let props = args[i];
28
- for(let key in props){
29
- let a = result[key];
30
- let b = props[key];
31
- // Chain events
32
- if (typeof a === 'function' && typeof b === 'function' && // This is a lot faster than a regex.
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);
34
- else if ((key === 'className' || key === 'UNSAFE_className') && typeof a === 'string' && typeof b === 'string') result[key] = (0, $7jXr9$clsx)(a, b);
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);
37
- else result[key] = b !== undefined ? b : a;
38
- }
39
- }
40
- return result;
41
- }
42
-
43
-
44
- export {$3ef42575df84b30b$export$9d1611c77c2fe928 as mergeProps};
45
- //# sourceMappingURL=mergeProps.module.js.map
@@ -1 +0,0 @@
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,40 +0,0 @@
1
-
2
- function $parcel$export(e, n, v, s) {
3
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
4
- }
5
-
6
- $parcel$export(module.exports, "mergeRefs", () => $f05dc24eafaeb7e2$export$c9058316764c140e);
7
- /*
8
- * Copyright 2020 Adobe. All rights reserved.
9
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
10
- * you may not use this file except in compliance with the License. You may obtain a copy
11
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing, software distributed under
14
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
15
- * OF ANY KIND, either express or implied. See the License for the specific language
16
- * governing permissions and limitations under the License.
17
- */ function $f05dc24eafaeb7e2$export$c9058316764c140e(...refs) {
18
- if (refs.length === 1 && refs[0]) return refs[0];
19
- return (value)=>{
20
- let hasCleanup = false;
21
- const cleanups = refs.map((ref)=>{
22
- const cleanup = $f05dc24eafaeb7e2$var$setRef(ref, value);
23
- hasCleanup || (hasCleanup = typeof cleanup == 'function');
24
- return cleanup;
25
- });
26
- if (hasCleanup) return ()=>{
27
- cleanups.forEach((cleanup, i)=>{
28
- if (typeof cleanup === 'function') cleanup();
29
- else $f05dc24eafaeb7e2$var$setRef(refs[i], null);
30
- });
31
- };
32
- };
33
- }
34
- function $f05dc24eafaeb7e2$var$setRef(ref, value) {
35
- if (typeof ref === 'function') return ref(value);
36
- else if (ref != null) ref.current = value;
37
- }
38
-
39
-
40
- //# sourceMappingURL=mergeRefs.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;AAAA;;;;;;;;;;CAUC,GAOM,SAAS,0CAAa,GAAG,IAA4D;IAC1F,IAAI,KAAK,MAAM,KAAK,KAAK,IAAI,CAAC,EAAE,EAC9B,OAAO,IAAI,CAAC,EAAE;IAGhB,OAAO,CAAC;QACN,IAAI,aAAa;QAEjB,MAAM,WAAW,KAAK,GAAG,CAAC,CAAA;YACxB,MAAM,UAAU,6BAAO,KAAK;YAC5B,eAAA,aAAe,OAAO,WAAW;YACjC,OAAO;QACT;QAEA,IAAI,YACF,OAAO;YACL,SAAS,OAAO,CAAC,CAAC,SAAS;gBACzB,IAAI,OAAO,YAAY,YACrB;qBAEA,6BAAO,IAAI,CAAC,EAAE,EAAE;YAEpB;QACF;IAEJ;AACF;AAEA,SAAS,6BAAU,GAAoD,EAAE,KAAQ;IAC/E,IAAI,OAAO,QAAQ,YACjB,OAAO,IAAI;SACN,IAAI,OAAO,MAChB,IAAI,OAAO,GAAG;AAElB","sources":["packages/@react-aria/utils/src/mergeRefs.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 {MutableRefObject, Ref} from 'react';\n\n/**\n * Merges multiple refs into one. Works with either callback or object refs.\n */\nexport function mergeRefs<T>(...refs: Array<Ref<T> | MutableRefObject<T> | null | undefined>): Ref<T> {\n if (refs.length === 1 && refs[0]) {\n return refs[0];\n }\n\n return (value: T | null) => {\n let hasCleanup = false;\n\n const cleanups = refs.map(ref => {\n const cleanup = setRef(ref, value);\n hasCleanup ||= typeof cleanup == 'function';\n return cleanup;\n });\n\n if (hasCleanup) {\n return () => {\n cleanups.forEach((cleanup, i) => {\n if (typeof cleanup === 'function') {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n });\n };\n }\n };\n}\n\nfunction setRef<T>(ref: Ref<T> | MutableRefObject<T> | null | undefined, value: T) {\n if (typeof ref === 'function') {\n return ref(value);\n } else if (ref != null) {\n ref.current = value;\n }\n}\n"],"names":[],"version":3,"file":"mergeRefs.main.js.map"}
@@ -1,35 +0,0 @@
1
- /*
2
- * Copyright 2020 Adobe. All rights reserved.
3
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License. You may obtain a copy
5
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
- *
7
- * Unless required by applicable law or agreed to in writing, software distributed under
8
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- * OF ANY KIND, either express or implied. See the License for the specific language
10
- * governing permissions and limitations under the License.
11
- */ function $5dc95899b306f630$export$c9058316764c140e(...refs) {
12
- if (refs.length === 1 && refs[0]) return refs[0];
13
- return (value)=>{
14
- let hasCleanup = false;
15
- const cleanups = refs.map((ref)=>{
16
- const cleanup = $5dc95899b306f630$var$setRef(ref, value);
17
- hasCleanup || (hasCleanup = typeof cleanup == 'function');
18
- return cleanup;
19
- });
20
- if (hasCleanup) return ()=>{
21
- cleanups.forEach((cleanup, i)=>{
22
- if (typeof cleanup === 'function') cleanup();
23
- else $5dc95899b306f630$var$setRef(refs[i], null);
24
- });
25
- };
26
- };
27
- }
28
- function $5dc95899b306f630$var$setRef(ref, value) {
29
- if (typeof ref === 'function') return ref(value);
30
- else if (ref != null) ref.current = value;
31
- }
32
-
33
-
34
- export {$5dc95899b306f630$export$c9058316764c140e as mergeRefs};
35
- //# sourceMappingURL=mergeRefs.module.js.map
@@ -1,35 +0,0 @@
1
- /*
2
- * Copyright 2020 Adobe. All rights reserved.
3
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License. You may obtain a copy
5
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
- *
7
- * Unless required by applicable law or agreed to in writing, software distributed under
8
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- * OF ANY KIND, either express or implied. See the License for the specific language
10
- * governing permissions and limitations under the License.
11
- */ function $5dc95899b306f630$export$c9058316764c140e(...refs) {
12
- if (refs.length === 1 && refs[0]) return refs[0];
13
- return (value)=>{
14
- let hasCleanup = false;
15
- const cleanups = refs.map((ref)=>{
16
- const cleanup = $5dc95899b306f630$var$setRef(ref, value);
17
- hasCleanup || (hasCleanup = typeof cleanup == 'function');
18
- return cleanup;
19
- });
20
- if (hasCleanup) return ()=>{
21
- cleanups.forEach((cleanup, i)=>{
22
- if (typeof cleanup === 'function') cleanup();
23
- else $5dc95899b306f630$var$setRef(refs[i], null);
24
- });
25
- };
26
- };
27
- }
28
- function $5dc95899b306f630$var$setRef(ref, value) {
29
- if (typeof ref === 'function') return ref(value);
30
- else if (ref != null) ref.current = value;
31
- }
32
-
33
-
34
- export {$5dc95899b306f630$export$c9058316764c140e as mergeRefs};
35
- //# sourceMappingURL=mergeRefs.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":"AAAA;;;;;;;;;;CAUC,GAOM,SAAS,0CAAa,GAAG,IAA4D;IAC1F,IAAI,KAAK,MAAM,KAAK,KAAK,IAAI,CAAC,EAAE,EAC9B,OAAO,IAAI,CAAC,EAAE;IAGhB,OAAO,CAAC;QACN,IAAI,aAAa;QAEjB,MAAM,WAAW,KAAK,GAAG,CAAC,CAAA;YACxB,MAAM,UAAU,6BAAO,KAAK;YAC5B,eAAA,aAAe,OAAO,WAAW;YACjC,OAAO;QACT;QAEA,IAAI,YACF,OAAO;YACL,SAAS,OAAO,CAAC,CAAC,SAAS;gBACzB,IAAI,OAAO,YAAY,YACrB;qBAEA,6BAAO,IAAI,CAAC,EAAE,EAAE;YAEpB;QACF;IAEJ;AACF;AAEA,SAAS,6BAAU,GAAoD,EAAE,KAAQ;IAC/E,IAAI,OAAO,QAAQ,YACjB,OAAO,IAAI;SACN,IAAI,OAAO,MAChB,IAAI,OAAO,GAAG;AAElB","sources":["packages/@react-aria/utils/src/mergeRefs.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 {MutableRefObject, Ref} from 'react';\n\n/**\n * Merges multiple refs into one. Works with either callback or object refs.\n */\nexport function mergeRefs<T>(...refs: Array<Ref<T> | MutableRefObject<T> | null | undefined>): Ref<T> {\n if (refs.length === 1 && refs[0]) {\n return refs[0];\n }\n\n return (value: T | null) => {\n let hasCleanup = false;\n\n const cleanups = refs.map(ref => {\n const cleanup = setRef(ref, value);\n hasCleanup ||= typeof cleanup == 'function';\n return cleanup;\n });\n\n if (hasCleanup) {\n return () => {\n cleanups.forEach((cleanup, i) => {\n if (typeof cleanup === 'function') {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n });\n };\n }\n };\n}\n\nfunction setRef<T>(ref: Ref<T> | MutableRefObject<T> | null | undefined, value: T) {\n if (typeof ref === 'function') {\n return ref(value);\n } else if (ref != null) {\n ref.current = value;\n }\n}\n"],"names":[],"version":3,"file":"mergeRefs.module.js.map"}