@react-spectrum/card 3.0.0-alpha.52 → 3.0.0-alpha.54

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 (240) hide show
  1. package/dist/import.mjs +6 -6
  2. package/dist/main.js +10 -10
  3. package/dist/main.js.map +1 -1
  4. package/dist/module.js +6 -6
  5. package/dist/module.js.map +1 -1
  6. package/dist/types/src/index.d.ts +9 -0
  7. package/package.json +12 -40
  8. package/src/index.ts +9 -9
  9. package/dist/BaseLayout.main.js +0 -213
  10. package/dist/BaseLayout.main.js.map +0 -1
  11. package/dist/BaseLayout.mjs +0 -208
  12. package/dist/BaseLayout.module.js +0 -208
  13. package/dist/BaseLayout.module.js.map +0 -1
  14. package/dist/Card.main.js +0 -52
  15. package/dist/Card.main.js.map +0 -1
  16. package/dist/Card.mjs +0 -43
  17. package/dist/Card.module.js +0 -43
  18. package/dist/Card.module.js.map +0 -1
  19. package/dist/CardBase.main.js +0 -205
  20. package/dist/CardBase.main.js.map +0 -1
  21. package/dist/CardBase.mjs +0 -200
  22. package/dist/CardBase.module.js +0 -200
  23. package/dist/CardBase.module.js.map +0 -1
  24. package/dist/CardView.main.js +0 -238
  25. package/dist/CardView.main.js.map +0 -1
  26. package/dist/CardView.mjs +0 -233
  27. package/dist/CardView.module.js +0 -233
  28. package/dist/CardView.module.js.map +0 -1
  29. package/dist/CardViewContext.main.js +0 -32
  30. package/dist/CardViewContext.main.js.map +0 -1
  31. package/dist/CardViewContext.mjs +0 -22
  32. package/dist/CardViewContext.module.js +0 -22
  33. package/dist/CardViewContext.module.js.map +0 -1
  34. package/dist/GalleryLayout.main.js +0 -230
  35. package/dist/GalleryLayout.main.js.map +0 -1
  36. package/dist/GalleryLayout.mjs +0 -225
  37. package/dist/GalleryLayout.module.js +0 -225
  38. package/dist/GalleryLayout.module.js.map +0 -1
  39. package/dist/GridLayout.main.js +0 -175
  40. package/dist/GridLayout.main.js.map +0 -1
  41. package/dist/GridLayout.mjs +0 -170
  42. package/dist/GridLayout.module.js +0 -170
  43. package/dist/GridLayout.module.js.map +0 -1
  44. package/dist/WaterfallLayout.main.js +0 -182
  45. package/dist/WaterfallLayout.main.js.map +0 -1
  46. package/dist/WaterfallLayout.mjs +0 -177
  47. package/dist/WaterfallLayout.module.js +0 -177
  48. package/dist/WaterfallLayout.module.js.map +0 -1
  49. package/dist/ar-AE.main.js +0 -7
  50. package/dist/ar-AE.main.js.map +0 -1
  51. package/dist/ar-AE.mjs +0 -9
  52. package/dist/ar-AE.module.js +0 -9
  53. package/dist/ar-AE.module.js.map +0 -1
  54. package/dist/bg-BG.main.js +0 -7
  55. package/dist/bg-BG.main.js.map +0 -1
  56. package/dist/bg-BG.mjs +0 -9
  57. package/dist/bg-BG.module.js +0 -9
  58. package/dist/bg-BG.module.js.map +0 -1
  59. package/dist/card.4d5d6544.css +0 -1671
  60. package/dist/card.4d5d6544.css.map +0 -1
  61. package/dist/card_vars_css.main.js +0 -116
  62. package/dist/card_vars_css.main.js.map +0 -1
  63. package/dist/card_vars_css.mjs +0 -118
  64. package/dist/card_vars_css.module.js +0 -118
  65. package/dist/card_vars_css.module.js.map +0 -1
  66. package/dist/cs-CZ.main.js +0 -7
  67. package/dist/cs-CZ.main.js.map +0 -1
  68. package/dist/cs-CZ.mjs +0 -9
  69. package/dist/cs-CZ.module.js +0 -9
  70. package/dist/cs-CZ.module.js.map +0 -1
  71. package/dist/da-DK.main.js +0 -7
  72. package/dist/da-DK.main.js.map +0 -1
  73. package/dist/da-DK.mjs +0 -9
  74. package/dist/da-DK.module.js +0 -9
  75. package/dist/da-DK.module.js.map +0 -1
  76. package/dist/de-DE.main.js +0 -7
  77. package/dist/de-DE.main.js.map +0 -1
  78. package/dist/de-DE.mjs +0 -9
  79. package/dist/de-DE.module.js +0 -9
  80. package/dist/de-DE.module.js.map +0 -1
  81. package/dist/el-GR.main.js +0 -7
  82. package/dist/el-GR.main.js.map +0 -1
  83. package/dist/el-GR.mjs +0 -9
  84. package/dist/el-GR.module.js +0 -9
  85. package/dist/el-GR.module.js.map +0 -1
  86. package/dist/en-US.main.js +0 -7
  87. package/dist/en-US.main.js.map +0 -1
  88. package/dist/en-US.mjs +0 -9
  89. package/dist/en-US.module.js +0 -9
  90. package/dist/en-US.module.js.map +0 -1
  91. package/dist/es-ES.main.js +0 -7
  92. package/dist/es-ES.main.js.map +0 -1
  93. package/dist/es-ES.mjs +0 -9
  94. package/dist/es-ES.module.js +0 -9
  95. package/dist/es-ES.module.js.map +0 -1
  96. package/dist/et-EE.main.js +0 -7
  97. package/dist/et-EE.main.js.map +0 -1
  98. package/dist/et-EE.mjs +0 -9
  99. package/dist/et-EE.module.js +0 -9
  100. package/dist/et-EE.module.js.map +0 -1
  101. package/dist/fi-FI.main.js +0 -7
  102. package/dist/fi-FI.main.js.map +0 -1
  103. package/dist/fi-FI.mjs +0 -9
  104. package/dist/fi-FI.module.js +0 -9
  105. package/dist/fi-FI.module.js.map +0 -1
  106. package/dist/fr-FR.main.js +0 -7
  107. package/dist/fr-FR.main.js.map +0 -1
  108. package/dist/fr-FR.mjs +0 -9
  109. package/dist/fr-FR.module.js +0 -9
  110. package/dist/fr-FR.module.js.map +0 -1
  111. package/dist/he-IL.main.js +0 -7
  112. package/dist/he-IL.main.js.map +0 -1
  113. package/dist/he-IL.mjs +0 -9
  114. package/dist/he-IL.module.js +0 -9
  115. package/dist/he-IL.module.js.map +0 -1
  116. package/dist/hr-HR.main.js +0 -7
  117. package/dist/hr-HR.main.js.map +0 -1
  118. package/dist/hr-HR.mjs +0 -9
  119. package/dist/hr-HR.module.js +0 -9
  120. package/dist/hr-HR.module.js.map +0 -1
  121. package/dist/hu-HU.main.js +0 -7
  122. package/dist/hu-HU.main.js.map +0 -1
  123. package/dist/hu-HU.mjs +0 -9
  124. package/dist/hu-HU.module.js +0 -9
  125. package/dist/hu-HU.module.js.map +0 -1
  126. package/dist/intlStrings.main.js +0 -108
  127. package/dist/intlStrings.main.js.map +0 -1
  128. package/dist/intlStrings.mjs +0 -110
  129. package/dist/intlStrings.module.js +0 -110
  130. package/dist/intlStrings.module.js.map +0 -1
  131. package/dist/it-IT.main.js +0 -7
  132. package/dist/it-IT.main.js.map +0 -1
  133. package/dist/it-IT.mjs +0 -9
  134. package/dist/it-IT.module.js +0 -9
  135. package/dist/it-IT.module.js.map +0 -1
  136. package/dist/ja-JP.main.js +0 -7
  137. package/dist/ja-JP.main.js.map +0 -1
  138. package/dist/ja-JP.mjs +0 -9
  139. package/dist/ja-JP.module.js +0 -9
  140. package/dist/ja-JP.module.js.map +0 -1
  141. package/dist/ko-KR.main.js +0 -7
  142. package/dist/ko-KR.main.js.map +0 -1
  143. package/dist/ko-KR.mjs +0 -9
  144. package/dist/ko-KR.module.js +0 -9
  145. package/dist/ko-KR.module.js.map +0 -1
  146. package/dist/lt-LT.main.js +0 -7
  147. package/dist/lt-LT.main.js.map +0 -1
  148. package/dist/lt-LT.mjs +0 -9
  149. package/dist/lt-LT.module.js +0 -9
  150. package/dist/lt-LT.module.js.map +0 -1
  151. package/dist/lv-LV.main.js +0 -7
  152. package/dist/lv-LV.main.js.map +0 -1
  153. package/dist/lv-LV.mjs +0 -9
  154. package/dist/lv-LV.module.js +0 -9
  155. package/dist/lv-LV.module.js.map +0 -1
  156. package/dist/nb-NO.main.js +0 -7
  157. package/dist/nb-NO.main.js.map +0 -1
  158. package/dist/nb-NO.mjs +0 -9
  159. package/dist/nb-NO.module.js +0 -9
  160. package/dist/nb-NO.module.js.map +0 -1
  161. package/dist/nl-NL.main.js +0 -7
  162. package/dist/nl-NL.main.js.map +0 -1
  163. package/dist/nl-NL.mjs +0 -9
  164. package/dist/nl-NL.module.js +0 -9
  165. package/dist/nl-NL.module.js.map +0 -1
  166. package/dist/pl-PL.main.js +0 -7
  167. package/dist/pl-PL.main.js.map +0 -1
  168. package/dist/pl-PL.mjs +0 -9
  169. package/dist/pl-PL.module.js +0 -9
  170. package/dist/pl-PL.module.js.map +0 -1
  171. package/dist/pt-BR.main.js +0 -7
  172. package/dist/pt-BR.main.js.map +0 -1
  173. package/dist/pt-BR.mjs +0 -9
  174. package/dist/pt-BR.module.js +0 -9
  175. package/dist/pt-BR.module.js.map +0 -1
  176. package/dist/pt-PT.main.js +0 -7
  177. package/dist/pt-PT.main.js.map +0 -1
  178. package/dist/pt-PT.mjs +0 -9
  179. package/dist/pt-PT.module.js +0 -9
  180. package/dist/pt-PT.module.js.map +0 -1
  181. package/dist/ro-RO.main.js +0 -7
  182. package/dist/ro-RO.main.js.map +0 -1
  183. package/dist/ro-RO.mjs +0 -9
  184. package/dist/ro-RO.module.js +0 -9
  185. package/dist/ro-RO.module.js.map +0 -1
  186. package/dist/ru-RU.main.js +0 -7
  187. package/dist/ru-RU.main.js.map +0 -1
  188. package/dist/ru-RU.mjs +0 -9
  189. package/dist/ru-RU.module.js +0 -9
  190. package/dist/ru-RU.module.js.map +0 -1
  191. package/dist/sk-SK.main.js +0 -7
  192. package/dist/sk-SK.main.js.map +0 -1
  193. package/dist/sk-SK.mjs +0 -9
  194. package/dist/sk-SK.module.js +0 -9
  195. package/dist/sk-SK.module.js.map +0 -1
  196. package/dist/sl-SI.main.js +0 -7
  197. package/dist/sl-SI.main.js.map +0 -1
  198. package/dist/sl-SI.mjs +0 -9
  199. package/dist/sl-SI.module.js +0 -9
  200. package/dist/sl-SI.module.js.map +0 -1
  201. package/dist/sr-SP.main.js +0 -7
  202. package/dist/sr-SP.main.js.map +0 -1
  203. package/dist/sr-SP.mjs +0 -9
  204. package/dist/sr-SP.module.js +0 -9
  205. package/dist/sr-SP.module.js.map +0 -1
  206. package/dist/sv-SE.main.js +0 -7
  207. package/dist/sv-SE.main.js.map +0 -1
  208. package/dist/sv-SE.mjs +0 -9
  209. package/dist/sv-SE.module.js +0 -9
  210. package/dist/sv-SE.module.js.map +0 -1
  211. package/dist/tr-TR.main.js +0 -7
  212. package/dist/tr-TR.main.js.map +0 -1
  213. package/dist/tr-TR.mjs +0 -9
  214. package/dist/tr-TR.module.js +0 -9
  215. package/dist/tr-TR.module.js.map +0 -1
  216. package/dist/types.d.ts +0 -194
  217. package/dist/types.d.ts.map +0 -1
  218. package/dist/uk-UA.main.js +0 -7
  219. package/dist/uk-UA.main.js.map +0 -1
  220. package/dist/uk-UA.mjs +0 -9
  221. package/dist/uk-UA.module.js +0 -9
  222. package/dist/uk-UA.module.js.map +0 -1
  223. package/dist/zh-CN.main.js +0 -7
  224. package/dist/zh-CN.main.js.map +0 -1
  225. package/dist/zh-CN.mjs +0 -9
  226. package/dist/zh-CN.module.js +0 -9
  227. package/dist/zh-CN.module.js.map +0 -1
  228. package/dist/zh-TW.main.js +0 -7
  229. package/dist/zh-TW.main.js.map +0 -1
  230. package/dist/zh-TW.mjs +0 -9
  231. package/dist/zh-TW.module.js +0 -9
  232. package/dist/zh-TW.module.js.map +0 -1
  233. package/src/BaseLayout.tsx +0 -290
  234. package/src/Card.tsx +0 -48
  235. package/src/CardBase.tsx +0 -188
  236. package/src/CardView.tsx +0 -250
  237. package/src/CardViewContext.tsx +0 -27
  238. package/src/GalleryLayout.tsx +0 -321
  239. package/src/GridLayout.tsx +0 -242
  240. package/src/WaterfallLayout.tsx +0 -241
package/dist/import.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import {CardView as $81a52da995c19652$export$7e52c821f7b6f422} from "./CardView.mjs";
2
- import {GalleryLayout as $c0ba81539c443916$export$8e52095834484b61} from "./GalleryLayout.mjs";
3
- import {GridLayout as $ed42fd44b9b9b664$export$7d2b12578154a735} from "./GridLayout.mjs";
4
- import {WaterfallLayout as $03278f8d0f6860bb$export$e9f7cda058ba8df8} from "./WaterfallLayout.mjs";
5
- import {Card as $d2d1c099b89e366a$export$60332b2344f7fe41} from "./Card.mjs";
1
+ import {CardView as $65456867e018cb5f$re_export$CardView} from "@adobe/react-spectrum/private/card/CardView";
2
+ import {GalleryLayout as $65456867e018cb5f$re_export$GalleryLayout} from "@adobe/react-spectrum/private/card/GalleryLayout";
3
+ import {GridLayout as $65456867e018cb5f$re_export$GridLayout} from "@adobe/react-spectrum/private/card/GridLayout";
4
+ import {WaterfallLayout as $65456867e018cb5f$re_export$WaterfallLayout} from "@adobe/react-spectrum/private/card/WaterfallLayout";
5
+ import {Card as $65456867e018cb5f$re_export$Card} from "@adobe/react-spectrum/private/card/Card";
6
6
 
7
7
  /*
8
8
  * Copyright 2021 Adobe. All rights reserved.
@@ -22,5 +22,5 @@ import {Card as $d2d1c099b89e366a$export$60332b2344f7fe41} from "./Card.mjs";
22
22
 
23
23
 
24
24
 
25
- export {$81a52da995c19652$export$7e52c821f7b6f422 as CardView, $c0ba81539c443916$export$8e52095834484b61 as GalleryLayout, $ed42fd44b9b9b664$export$7d2b12578154a735 as GridLayout, $03278f8d0f6860bb$export$e9f7cda058ba8df8 as WaterfallLayout, $d2d1c099b89e366a$export$60332b2344f7fe41 as Card};
25
+ export {$65456867e018cb5f$re_export$CardView as CardView, $65456867e018cb5f$re_export$GalleryLayout as GalleryLayout, $65456867e018cb5f$re_export$GridLayout as GridLayout, $65456867e018cb5f$re_export$WaterfallLayout as WaterfallLayout, $65456867e018cb5f$re_export$Card as Card};
26
26
  //# sourceMappingURL=module.js.map
package/dist/main.js CHANGED
@@ -1,19 +1,19 @@
1
- var $514a55f6d91f25ef$exports = require("./CardView.main.js");
2
- var $8019a3d2c7d098ea$exports = require("./GalleryLayout.main.js");
3
- var $71b727f94b595b1a$exports = require("./GridLayout.main.js");
4
- var $632abf8fbf0ad57b$exports = require("./WaterfallLayout.main.js");
5
- var $6b630ac4b78ba7f3$exports = require("./Card.main.js");
1
+ var $4xROe$adobereactspectrumprivatecardCardView = require("@adobe/react-spectrum/private/card/CardView");
2
+ var $4xROe$adobereactspectrumprivatecardGalleryLayout = require("@adobe/react-spectrum/private/card/GalleryLayout");
3
+ var $4xROe$adobereactspectrumprivatecardGridLayout = require("@adobe/react-spectrum/private/card/GridLayout");
4
+ var $4xROe$adobereactspectrumprivatecardWaterfallLayout = require("@adobe/react-spectrum/private/card/WaterfallLayout");
5
+ var $4xROe$adobereactspectrumprivatecardCard = require("@adobe/react-spectrum/private/card/Card");
6
6
 
7
7
 
8
8
  function $parcel$export(e, n, v, s) {
9
9
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
10
10
  }
11
11
 
12
- $parcel$export(module.exports, "CardView", () => $514a55f6d91f25ef$exports.CardView);
13
- $parcel$export(module.exports, "GalleryLayout", () => $8019a3d2c7d098ea$exports.GalleryLayout);
14
- $parcel$export(module.exports, "GridLayout", () => $71b727f94b595b1a$exports.GridLayout);
15
- $parcel$export(module.exports, "WaterfallLayout", () => $632abf8fbf0ad57b$exports.WaterfallLayout);
16
- $parcel$export(module.exports, "Card", () => $6b630ac4b78ba7f3$exports.Card);
12
+ $parcel$export(module.exports, "CardView", function () { return $4xROe$adobereactspectrumprivatecardCardView.CardView; });
13
+ $parcel$export(module.exports, "GalleryLayout", function () { return $4xROe$adobereactspectrumprivatecardGalleryLayout.GalleryLayout; });
14
+ $parcel$export(module.exports, "GridLayout", function () { return $4xROe$adobereactspectrumprivatecardGridLayout.GridLayout; });
15
+ $parcel$export(module.exports, "WaterfallLayout", function () { return $4xROe$adobereactspectrumprivatecardWaterfallLayout.WaterfallLayout; });
16
+ $parcel$export(module.exports, "Card", function () { return $4xROe$adobereactspectrumprivatecardCard.Card; });
17
17
  /*
18
18
  * Copyright 2021 Adobe. All rights reserved.
19
19
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/card/src/index.ts"],"sourcesContent":["/*\n * Copyright 2021 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/// <reference types=\"css-module-types\" />\n\nexport type {GalleryLayoutOptions} from './GalleryLayout';\nexport type {GridLayoutOptions} from './GridLayout';\nexport type {WaterfallLayoutOptions} from './WaterfallLayout';\n\nexport {CardView} from './CardView';\nexport {GalleryLayout} from './GalleryLayout';\nexport {GridLayout} from './GridLayout';\nexport {WaterfallLayout} from './WaterfallLayout';\nexport {Card} from './Card';\nexport type {SpectrumCardViewProps} from '@react-types/card';\n"],"names":[],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/card/src/index.ts"],"sourcesContent":["/*\n * Copyright 2021 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/// <reference types=\"css-module-types\" />\n\nexport {CardView} from '@adobe/react-spectrum/private/card/CardView';\n\nexport {GalleryLayout} from '@adobe/react-spectrum/private/card/GalleryLayout';\nexport {GridLayout} from '@adobe/react-spectrum/private/card/GridLayout';\nexport {WaterfallLayout} from '@adobe/react-spectrum/private/card/WaterfallLayout';\nexport {Card} from '@adobe/react-spectrum/private/card/Card';\nexport type {GalleryLayoutOptions} from '@adobe/react-spectrum/private/card/GalleryLayout';\nexport type {GridLayoutOptions} from '@adobe/react-spectrum/private/card/GridLayout';\nexport type {WaterfallLayoutOptions} from '@adobe/react-spectrum/private/card/WaterfallLayout';\nexport type {SpectrumCardProps, AriaCardViewProps, SpectrumCardViewProps} from '@adobe/react-spectrum/private/card/types';\n"],"names":[],"version":3,"file":"main.js.map"}
package/dist/module.js CHANGED
@@ -1,8 +1,8 @@
1
- import {CardView as $81a52da995c19652$export$7e52c821f7b6f422} from "./CardView.module.js";
2
- import {GalleryLayout as $c0ba81539c443916$export$8e52095834484b61} from "./GalleryLayout.module.js";
3
- import {GridLayout as $ed42fd44b9b9b664$export$7d2b12578154a735} from "./GridLayout.module.js";
4
- import {WaterfallLayout as $03278f8d0f6860bb$export$e9f7cda058ba8df8} from "./WaterfallLayout.module.js";
5
- import {Card as $d2d1c099b89e366a$export$60332b2344f7fe41} from "./Card.module.js";
1
+ import {CardView as $65456867e018cb5f$re_export$CardView} from "@adobe/react-spectrum/private/card/CardView";
2
+ import {GalleryLayout as $65456867e018cb5f$re_export$GalleryLayout} from "@adobe/react-spectrum/private/card/GalleryLayout";
3
+ import {GridLayout as $65456867e018cb5f$re_export$GridLayout} from "@adobe/react-spectrum/private/card/GridLayout";
4
+ import {WaterfallLayout as $65456867e018cb5f$re_export$WaterfallLayout} from "@adobe/react-spectrum/private/card/WaterfallLayout";
5
+ import {Card as $65456867e018cb5f$re_export$Card} from "@adobe/react-spectrum/private/card/Card";
6
6
 
7
7
  /*
8
8
  * Copyright 2021 Adobe. All rights reserved.
@@ -22,5 +22,5 @@ import {Card as $d2d1c099b89e366a$export$60332b2344f7fe41} from "./Card.module.j
22
22
 
23
23
 
24
24
 
25
- export {$81a52da995c19652$export$7e52c821f7b6f422 as CardView, $c0ba81539c443916$export$8e52095834484b61 as GalleryLayout, $ed42fd44b9b9b664$export$7d2b12578154a735 as GridLayout, $03278f8d0f6860bb$export$e9f7cda058ba8df8 as WaterfallLayout, $d2d1c099b89e366a$export$60332b2344f7fe41 as Card};
25
+ export {$65456867e018cb5f$re_export$CardView as CardView, $65456867e018cb5f$re_export$GalleryLayout as GalleryLayout, $65456867e018cb5f$re_export$GridLayout as GridLayout, $65456867e018cb5f$re_export$WaterfallLayout as WaterfallLayout, $65456867e018cb5f$re_export$Card as Card};
26
26
  //# sourceMappingURL=module.js.map
@@ -1 +1 @@
1
- {"mappings":";;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/card/src/index.ts"],"sourcesContent":["/*\n * Copyright 2021 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/// <reference types=\"css-module-types\" />\n\nexport type {GalleryLayoutOptions} from './GalleryLayout';\nexport type {GridLayoutOptions} from './GridLayout';\nexport type {WaterfallLayoutOptions} from './WaterfallLayout';\n\nexport {CardView} from './CardView';\nexport {GalleryLayout} from './GalleryLayout';\nexport {GridLayout} from './GridLayout';\nexport {WaterfallLayout} from './WaterfallLayout';\nexport {Card} from './Card';\nexport type {SpectrumCardViewProps} from '@react-types/card';\n"],"names":[],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/card/src/index.ts"],"sourcesContent":["/*\n * Copyright 2021 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/// <reference types=\"css-module-types\" />\n\nexport {CardView} from '@adobe/react-spectrum/private/card/CardView';\n\nexport {GalleryLayout} from '@adobe/react-spectrum/private/card/GalleryLayout';\nexport {GridLayout} from '@adobe/react-spectrum/private/card/GridLayout';\nexport {WaterfallLayout} from '@adobe/react-spectrum/private/card/WaterfallLayout';\nexport {Card} from '@adobe/react-spectrum/private/card/Card';\nexport type {GalleryLayoutOptions} from '@adobe/react-spectrum/private/card/GalleryLayout';\nexport type {GridLayoutOptions} from '@adobe/react-spectrum/private/card/GridLayout';\nexport type {WaterfallLayoutOptions} from '@adobe/react-spectrum/private/card/WaterfallLayout';\nexport type {SpectrumCardProps, AriaCardViewProps, SpectrumCardViewProps} from '@adobe/react-spectrum/private/card/types';\n"],"names":[],"version":3,"file":"module.js.map"}
@@ -0,0 +1,9 @@
1
+ export { CardView } from '@adobe/react-spectrum/private/card/CardView';
2
+ export { GalleryLayout } from '@adobe/react-spectrum/private/card/GalleryLayout';
3
+ export { GridLayout } from '@adobe/react-spectrum/private/card/GridLayout';
4
+ export { WaterfallLayout } from '@adobe/react-spectrum/private/card/WaterfallLayout';
5
+ export { Card } from '@adobe/react-spectrum/private/card/Card';
6
+ export type { GalleryLayoutOptions } from '@adobe/react-spectrum/private/card/GalleryLayout';
7
+ export type { GridLayoutOptions } from '@adobe/react-spectrum/private/card/GridLayout';
8
+ export type { WaterfallLayoutOptions } from '@adobe/react-spectrum/private/card/WaterfallLayout';
9
+ export type { SpectrumCardProps, AriaCardViewProps, SpectrumCardViewProps } from '@adobe/react-spectrum/private/card/types';
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@react-spectrum/card",
3
- "version": "3.0.0-alpha.52",
3
+ "version": "3.0.0-alpha.54",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
7
7
  "module": "dist/module.js",
8
8
  "exports": {
9
- "source": "./src/index.ts",
10
- "types": [
11
- "./dist/types.d.ts",
12
- "./src/index.ts"
13
- ],
14
- "import": "./dist/import.mjs",
15
- "require": "./dist/main.js"
9
+ ".": {
10
+ "source": "./src/index.ts",
11
+ "types": "./dist/types/src/index.d.ts",
12
+ "import": "./dist/import.mjs",
13
+ "require": "./dist/main.js"
14
+ },
15
+ "./package.json": "./package.json"
16
16
  },
17
- "types": "dist/types.d.ts",
17
+ "types": "dist/types/src/index.d.ts",
18
18
  "source": "src/index.ts",
19
19
  "files": [
20
20
  "dist",
@@ -24,50 +24,22 @@
24
24
  "*.css"
25
25
  ],
26
26
  "targets": {
27
- "main": {
28
- "includeNodeModules": [
29
- "@adobe/spectrum-css-temp"
30
- ]
31
- },
32
- "module": {
33
- "includeNodeModules": [
34
- "@adobe/spectrum-css-temp"
35
- ]
36
- }
27
+ "types": false
37
28
  },
38
29
  "repository": {
39
30
  "type": "git",
40
31
  "url": "https://github.com/adobe/react-spectrum"
41
32
  },
42
33
  "dependencies": {
43
- "@react-aria/focus": "^3.21.4",
44
- "@react-aria/grid": "^3.14.7",
45
- "@react-aria/i18n": "^3.12.15",
46
- "@react-aria/interactions": "^3.27.0",
47
- "@react-aria/utils": "^3.33.0",
48
- "@react-aria/virtualizer": "^4.1.12",
49
- "@react-spectrum/checkbox": "^3.10.6",
50
- "@react-spectrum/progress": "^3.7.22",
51
- "@react-spectrum/utils": "^3.12.11",
52
- "@react-stately/collections": "^3.12.9",
53
- "@react-stately/grid": "^3.11.8",
54
- "@react-stately/list": "^3.13.3",
55
- "@react-stately/virtualizer": "^4.4.5",
56
- "@react-types/card": "3.0.0-alpha.42",
57
- "@react-types/provider": "^3.8.14",
58
- "@react-types/shared": "^3.33.0",
34
+ "@adobe/react-spectrum": "3.47.0",
59
35
  "@swc/helpers": "^0.5.0"
60
36
  },
61
- "devDependencies": {
62
- "@adobe/spectrum-css-temp": "3.0.0-alpha.1"
63
- },
64
37
  "peerDependencies": {
65
- "@react-spectrum/provider": "^3.0.0",
66
38
  "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
67
39
  "react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
68
40
  },
69
41
  "publishConfig": {
70
42
  "access": "public"
71
43
  },
72
- "gitHead": "66e51757606b43a89ed02c574ca24517323a2ab9"
44
+ "gitHead": "a6999bdf494a2e9c0381a5881908328bdd22ddae"
73
45
  }
package/src/index.ts CHANGED
@@ -12,13 +12,13 @@
12
12
 
13
13
  /// <reference types="css-module-types" />
14
14
 
15
- export type {GalleryLayoutOptions} from './GalleryLayout';
16
- export type {GridLayoutOptions} from './GridLayout';
17
- export type {WaterfallLayoutOptions} from './WaterfallLayout';
15
+ export {CardView} from '@adobe/react-spectrum/private/card/CardView';
18
16
 
19
- export {CardView} from './CardView';
20
- export {GalleryLayout} from './GalleryLayout';
21
- export {GridLayout} from './GridLayout';
22
- export {WaterfallLayout} from './WaterfallLayout';
23
- export {Card} from './Card';
24
- export type {SpectrumCardViewProps} from '@react-types/card';
17
+ export {GalleryLayout} from '@adobe/react-spectrum/private/card/GalleryLayout';
18
+ export {GridLayout} from '@adobe/react-spectrum/private/card/GridLayout';
19
+ export {WaterfallLayout} from '@adobe/react-spectrum/private/card/WaterfallLayout';
20
+ export {Card} from '@adobe/react-spectrum/private/card/Card';
21
+ export type {GalleryLayoutOptions} from '@adobe/react-spectrum/private/card/GalleryLayout';
22
+ export type {GridLayoutOptions} from '@adobe/react-spectrum/private/card/GridLayout';
23
+ export type {WaterfallLayoutOptions} from '@adobe/react-spectrum/private/card/WaterfallLayout';
24
+ export type {SpectrumCardProps, AriaCardViewProps, SpectrumCardViewProps} from '@adobe/react-spectrum/private/card/types';
@@ -1,213 +0,0 @@
1
- var $kQhHy$reactstatelycollections = require("@react-stately/collections");
2
- var $kQhHy$reactstatelyvirtualizer = require("@react-stately/virtualizer");
3
-
4
-
5
- function $parcel$export(e, n, v, s) {
6
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
7
- }
8
-
9
- $parcel$export(module.exports, "BaseLayout", () => $5ee605f09afaa4de$export$64943d2e59d72a29);
10
- // @ts-nocheck
11
- /*
12
- * Copyright 2021 Adobe. All rights reserved.
13
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
14
- * you may not use this file except in compliance with the License. You may obtain a copy
15
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
16
- *
17
- * Unless required by applicable law or agreed to in writing, software distributed under
18
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
19
- * OF ANY KIND, either express or implied. See the License for the specific language
20
- * governing permissions and limitations under the License.
21
- */
22
-
23
- class $5ee605f09afaa4de$export$64943d2e59d72a29 extends (0, $kQhHy$reactstatelyvirtualizer.Layout) {
24
- update(invalidationContext) {
25
- var _invalidationContext_layoutOptions, _invalidationContext_layoutOptions1;
26
- this.collection = this.virtualizer.collection;
27
- this.isLoading = ((_invalidationContext_layoutOptions = invalidationContext.layoutOptions) === null || _invalidationContext_layoutOptions === void 0 ? void 0 : _invalidationContext_layoutOptions.isLoading) || false;
28
- this.direction = ((_invalidationContext_layoutOptions1 = invalidationContext.layoutOptions) === null || _invalidationContext_layoutOptions1 === void 0 ? void 0 : _invalidationContext_layoutOptions1.direction) || 'ltr';
29
- this.buildCollection(invalidationContext);
30
- // Remove layout info that doesn't exist in new collection
31
- if (this.lastCollection) {
32
- for (let key of this.lastCollection.getKeys())if (!this.collection.getItem(key)) this.layoutInfos.delete(key);
33
- if (!this.isLoading) this.layoutInfos.delete('loader');
34
- if (this.collection.size > 0) this.layoutInfos.delete('placeholder');
35
- }
36
- this.lastCollection = this.collection;
37
- }
38
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
39
- buildCollection(invalidationContext) {}
40
- getContentSize() {
41
- return this.contentSize;
42
- }
43
- getLayoutInfo(key) {
44
- return this.layoutInfos.get(key);
45
- }
46
- getVisibleLayoutInfos(rect, excludePersistedKeys = false) {
47
- let res = [];
48
- for (let layoutInfo of this.layoutInfos.values())if (this.isVisible(layoutInfo, rect, excludePersistedKeys)) res.push(layoutInfo);
49
- return res;
50
- }
51
- isVisible(layoutInfo, rect, excludePersistedKeys) {
52
- if (layoutInfo.rect.intersects(rect)) return true;
53
- if (!excludePersistedKeys) return this.virtualizer.isPersistedKey(layoutInfo.key);
54
- return false;
55
- }
56
- _findClosestLayoutInfo(target, rect) {
57
- let layoutInfos = this.getVisibleLayoutInfos(rect, true);
58
- let best = null;
59
- let bestDistance = Infinity;
60
- // Calculates distance as the distance between the center of 2 rects.
61
- for (let cur of layoutInfos)if (cur.type === 'item') {
62
- let curRect = cur.rect;
63
- let targetMidX = (target.x + target.maxX) / 2;
64
- let targetMidY = (target.y + target.maxY) / 2;
65
- let curMidX = (curRect.x + curRect.maxX) / 2;
66
- let curMidY = (curRect.y + curRect.maxY) / 2;
67
- let dist = Math.pow(targetMidX - curMidX, 2) + Math.pow(targetMidY - curMidY, 2);
68
- if (dist < bestDistance) {
69
- best = cur;
70
- bestDistance = dist;
71
- }
72
- }
73
- return best;
74
- }
75
- _findClosest(target, rect) {
76
- let best = this._findClosestLayoutInfo(target, rect);
77
- return best || null;
78
- }
79
- getKeyBelow(key) {
80
- var _this__findClosest, _getFirstItem;
81
- // Expected key is the currently focused cell so we need the parent row key
82
- let parentRowKey = this.collection.getItem(key).parentKey;
83
- let layoutInfo = this.getLayoutInfo(parentRowKey);
84
- let rect = new (0, $kQhHy$reactstatelyvirtualizer.Rect)(layoutInfo.rect.x, layoutInfo.rect.maxY + 1, layoutInfo.rect.width, this.virtualizer.visibleRect.height);
85
- let closestRow = this.collection.getItem((_this__findClosest = this._findClosest(layoutInfo.rect, rect)) === null || _this__findClosest === void 0 ? void 0 : _this__findClosest.key);
86
- return (_getFirstItem = (0, $kQhHy$reactstatelycollections.getFirstItem)((0, $kQhHy$reactstatelycollections.getChildNodes)(closestRow, this.collection))) === null || _getFirstItem === void 0 ? void 0 : _getFirstItem.key;
87
- }
88
- getKeyAbove(key) {
89
- var _this__findClosest, _getFirstItem;
90
- // Expected key is the currently focused cell so we need the parent row key
91
- let parentRowKey = this.collection.getItem(key).parentKey;
92
- let layoutInfo = this.getLayoutInfo(parentRowKey);
93
- let rect = new (0, $kQhHy$reactstatelyvirtualizer.Rect)(layoutInfo.rect.x, 0, layoutInfo.rect.width, layoutInfo.rect.y - 1);
94
- let closestRow = this.collection.getItem((_this__findClosest = this._findClosest(layoutInfo.rect, rect)) === null || _this__findClosest === void 0 ? void 0 : _this__findClosest.key);
95
- return (_getFirstItem = (0, $kQhHy$reactstatelycollections.getFirstItem)((0, $kQhHy$reactstatelycollections.getChildNodes)(closestRow, this.collection))) === null || _getFirstItem === void 0 ? void 0 : _getFirstItem.key;
96
- }
97
- getKeyRightOf(key) {
98
- // Expected key is the currently focused cell so we need the parent row key
99
- let parentRowKey = this.collection.getItem(key).parentKey;
100
- key = this.direction === 'rtl' ? this.collection.getKeyBefore(parentRowKey) : this.collection.getKeyAfter(parentRowKey);
101
- while(key != null){
102
- var _getFirstItem;
103
- let item = this.collection.getItem(key);
104
- // Don't check if item is disabled because we want to be able to focus disabled items in a grid (double check this)
105
- if (item.type === 'item') return (_getFirstItem = (0, $kQhHy$reactstatelycollections.getFirstItem)((0, $kQhHy$reactstatelycollections.getChildNodes)(item, this.collection))) === null || _getFirstItem === void 0 ? void 0 : _getFirstItem.key;
106
- key = this.direction === 'rtl' ? this.collection.getKeyBefore(key) : this.collection.getKeyAfter(key);
107
- }
108
- }
109
- getKeyLeftOf(key) {
110
- // Expected key is the currently focused cell so we need the parent row key
111
- let parentRowKey = this.collection.getItem(key).parentKey;
112
- key = this.direction === 'rtl' ? this.collection.getKeyAfter(parentRowKey) : this.collection.getKeyBefore(parentRowKey);
113
- while(key != null){
114
- var _getFirstItem;
115
- let item = this.collection.getItem(key);
116
- // Don't check if item is disabled because we want to be able to focus disabled items in a grid (double check this)
117
- if (item.type === 'item') return (_getFirstItem = (0, $kQhHy$reactstatelycollections.getFirstItem)((0, $kQhHy$reactstatelycollections.getChildNodes)(item, this.collection))) === null || _getFirstItem === void 0 ? void 0 : _getFirstItem.key;
118
- key = this.direction === 'rtl' ? this.collection.getKeyAfter(key) : this.collection.getKeyBefore(key);
119
- }
120
- }
121
- getFirstKey() {
122
- var _getFirstItem;
123
- let firstRow = this.collection.getItem(this.collection.getFirstKey());
124
- return (_getFirstItem = (0, $kQhHy$reactstatelycollections.getFirstItem)((0, $kQhHy$reactstatelycollections.getChildNodes)(firstRow, this.collection))) === null || _getFirstItem === void 0 ? void 0 : _getFirstItem.key;
125
- }
126
- getLastKey() {
127
- var _getFirstItem;
128
- let lastRow = this.collection.getItem(this.collection.getLastKey());
129
- return (_getFirstItem = (0, $kQhHy$reactstatelycollections.getFirstItem)((0, $kQhHy$reactstatelycollections.getChildNodes)(lastRow, this.collection))) === null || _getFirstItem === void 0 ? void 0 : _getFirstItem.key;
130
- }
131
- // TODO: pretty unwieldy because it needs to bounce back and forth between the parent key and the child key
132
- // Perhaps have layoutInfo store childKey as well so we don't need to do this? Or maybe make the layoutInfos be the cells instead of the rows?
133
- getKeyPageAbove(key) {
134
- // Expected key is the currently focused cell so we need the parent row key
135
- let parentRowKey = this.collection.getItem(key).parentKey;
136
- let layoutInfo = this.getLayoutInfo(parentRowKey);
137
- if (layoutInfo) {
138
- var _this_collection_getItem;
139
- let pageY = Math.max(0, layoutInfo.rect.y + layoutInfo.rect.height - this.virtualizer.visibleRect.height);
140
- // If the node is so large that it spans multiple page heights, return the key of the item immediately above
141
- // Otherwise keep going up until we exceed a single page height worth of nodes
142
- let keyAbove = (_this_collection_getItem = this.collection.getItem(this.getKeyAbove(key))) === null || _this_collection_getItem === void 0 ? void 0 : _this_collection_getItem.parentKey;
143
- layoutInfo = this.getLayoutInfo(keyAbove);
144
- if (layoutInfo && layoutInfo.rect.y > pageY) while(layoutInfo && layoutInfo.rect.y > pageY){
145
- var _getFirstItem, _this_collection_getItem1;
146
- let childKey = (_getFirstItem = (0, $kQhHy$reactstatelycollections.getFirstItem)((0, $kQhHy$reactstatelycollections.getChildNodes)(this.collection.getItem(layoutInfo.key), this.collection))) === null || _getFirstItem === void 0 ? void 0 : _getFirstItem.key;
147
- let keyAbove = (_this_collection_getItem1 = this.collection.getItem(this.getKeyAbove(childKey))) === null || _this_collection_getItem1 === void 0 ? void 0 : _this_collection_getItem1.parentKey;
148
- layoutInfo = this.getLayoutInfo(keyAbove);
149
- }
150
- if (layoutInfo) {
151
- var _getFirstItem1;
152
- let childKey = (_getFirstItem1 = (0, $kQhHy$reactstatelycollections.getFirstItem)((0, $kQhHy$reactstatelycollections.getChildNodes)(this.collection.getItem(layoutInfo.key), this.collection))) === null || _getFirstItem1 === void 0 ? void 0 : _getFirstItem1.key;
153
- return childKey;
154
- }
155
- }
156
- return this.getFirstKey();
157
- }
158
- // TODO: pretty unwieldy because it needs to bounce back and forth between the parent key and the child key
159
- // Perhaps have layoutInfo store childKey as well so we don't need to do this?
160
- getKeyPageBelow(key) {
161
- // Expected key is the currently focused cell so we need the parent row key
162
- let parentRowKey = this.collection.getItem(key).parentKey;
163
- let layoutInfo = this.getLayoutInfo(parentRowKey);
164
- if (layoutInfo) {
165
- var _this_collection_getItem;
166
- let pageY = Math.min(this.virtualizer.contentSize.height, layoutInfo.rect.y - layoutInfo.rect.height + this.virtualizer.visibleRect.height);
167
- // If the node is so large that it spans multiple page heights, return the key of the item immediately below
168
- // Otherwise keep going up until we exceed a single page height worth of nodes
169
- let keyBelow = (_this_collection_getItem = this.collection.getItem(this.getKeyBelow(key))) === null || _this_collection_getItem === void 0 ? void 0 : _this_collection_getItem.parentKey;
170
- layoutInfo = this.getLayoutInfo(keyBelow);
171
- if (layoutInfo && layoutInfo.rect.y < pageY) while(layoutInfo && layoutInfo.rect.y < pageY){
172
- var _getFirstItem, _this_collection_getItem1;
173
- let childKey = (_getFirstItem = (0, $kQhHy$reactstatelycollections.getFirstItem)((0, $kQhHy$reactstatelycollections.getChildNodes)(this.collection.getItem(layoutInfo.key), this.collection))) === null || _getFirstItem === void 0 ? void 0 : _getFirstItem.key;
174
- let keyBelow = (_this_collection_getItem1 = this.collection.getItem(this.getKeyBelow(childKey))) === null || _this_collection_getItem1 === void 0 ? void 0 : _this_collection_getItem1.parentKey;
175
- layoutInfo = this.getLayoutInfo(keyBelow);
176
- }
177
- if (layoutInfo) {
178
- var _getFirstItem1;
179
- let childKey = (_getFirstItem1 = (0, $kQhHy$reactstatelycollections.getFirstItem)((0, $kQhHy$reactstatelycollections.getChildNodes)(this.collection.getItem(layoutInfo.key), this.collection))) === null || _getFirstItem1 === void 0 ? void 0 : _getFirstItem1.key;
180
- return childKey;
181
- }
182
- }
183
- return this.getLastKey();
184
- }
185
- getKeyForSearch(search, fromKey) {
186
- if (!this.collator) return null;
187
- let collection = this.collection;
188
- let key = fromKey !== null && fromKey !== void 0 ? fromKey : this.getFirstKey();
189
- let startItem = collection.getItem(key);
190
- key = startItem.parentKey;
191
- while(key != null){
192
- let item = collection.getItem(key);
193
- if (item.textValue) {
194
- var _getFirstItem;
195
- let substring = item.textValue.slice(0, search.length);
196
- if (this.collator.compare(substring, search) === 0) return (_getFirstItem = (0, $kQhHy$reactstatelycollections.getFirstItem)((0, $kQhHy$reactstatelycollections.getChildNodes)(item, this.collection))) === null || _getFirstItem === void 0 ? void 0 : _getFirstItem.key;
197
- }
198
- key = this.collection.getKeyAfter(key);
199
- }
200
- return null;
201
- }
202
- constructor(options = {}){
203
- super(), this.disabledKeys = new Set();
204
- this.layoutInfos = new Map();
205
- this.collator = options.collator;
206
- this.lastCollection = null;
207
- this.scale = options.scale || 'medium';
208
- this.margin = options.margin || 24;
209
- }
210
- }
211
-
212
-
213
- //# sourceMappingURL=BaseLayout.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;AAAA,cAAc;AACd;;;;;;;;;;CAUC;;AAwBM,MAAM,kDAAsB,CAAA,GAAA,qCAAK;IAqBtC,OAAO,mBAA+D,EAAQ;YAE3D,oCACA;QAFjB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC,UAAU;QAC7C,IAAI,CAAC,SAAS,GAA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AnF,qCAAA,eAAuF,GAAG;gBACzG,OAAO;YACT;QACF;QAEA,OAAO,IAAI,CAAC,UAAU;IACxB;IAEA,gBAAgB,MAAc,EAAE,OAAa,EAA8B;QACzE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAChB,OAAO;QAGT,IAAI,aAAa,IAAI,CAAC,UAAU;QAChC,IAAI,MAAM,oBAAA,qBAAA,UAAW,IAAI,CAAC,WAAW;QAErC,IAAI,YAAY,WAAW,OAAO,CAAC;QACnC,MAAM,UAAU,SAAS;QAEzB,MAAO,OAAO,KAAM;YAClB,IAAI,OAAO,WAAW,OAAO,CAAC;YAC9B,IAAI,KAAK,SAAS,EAAE;oBAGT;gBAFT,IAAI,YAAY,KAAK,SAAS,CAAC,KAAK,CAAC,GAAG,OAAO,MAAM;gBACrD,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,YAAY,GAC/C,QAAO,gBAAA,CAAA,GAAA,2CAAW,EAAE,CAAA,GAAA,4CAAY,EAAE,MAAM,IAAI,CAAC,UAAU,gBAAhD,oCAAA,cAAoD,GAAG;YAElE;YAEA,MAAM,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC;QACpC;QAEA,OAAO;IACT;IAjPA,YAAY,UAA6B,CAAC,CAAC,CAAE;QAC3C,KAAK,SANP,eAAyB,IAAI;QAO3B,IAAI,CAAC,WAAW,GAAG,IAAI;QACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,QAAQ;QAChC,IAAI,CAAC,cAAc,GAAG;QACtB,IAAI,CAAC,KAAK,GAAG,QAAQ,KAAK,IAAI;QAC9B,IAAI,CAAC,MAAM,GAAG,QAAQ,MAAM,IAAI;IAClC;AA2OF","sources":["packages/@react-spectrum/card/src/BaseLayout.tsx"],"sourcesContent":["// @ts-nocheck\n/*\n * Copyright 2021 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 {Direction, Key, KeyboardDelegate, Node} from '@react-types/shared';\nimport {getChildNodes, getFirstItem} from '@react-stately/collections';\nimport {GridCollection} from '@react-stately/grid';\nimport {InvalidationContext, Layout, LayoutInfo, Rect, Size} from '@react-stately/virtualizer';\nimport {Scale} from '@react-types/provider';\n\nexport interface BaseLayoutOptions {\n collator?: Intl.Collator,\n // TODO: is this valid or is scale a spectrum specific thing that should be left out of the layouts?\n scale?: Scale,\n /**\n * The margin around the grid view between the edges and the items.\n * @default 24\n */\n margin?: number\n}\n\ninterface CardViewLayoutOptions {\n isLoading: boolean,\n direction: Direction\n}\n\nexport class BaseLayout<T> extends Layout<Node<T>, CardViewLayoutOptions> implements KeyboardDelegate {\n protected contentSize: Size;\n protected layoutInfos: Map<Key, LayoutInfo>;\n protected collator: Intl.Collator;\n protected lastCollection: GridCollection<T>;\n collection: GridCollection<T>;\n isLoading: boolean;\n disabledKeys: Set<Key> = new Set();\n direction: Direction;\n scale: Scale;\n margin: number;\n\n constructor(options: BaseLayoutOptions = {}) {\n super();\n this.layoutInfos = new Map();\n this.collator = options.collator;\n this.lastCollection = null;\n this.scale = options.scale || 'medium';\n this.margin = options.margin || 24;\n }\n\n update(invalidationContext: InvalidationContext<CardViewLayoutOptions>): void {\n this.collection = this.virtualizer.collection as GridCollection<T>;\n this.isLoading = invalidationContext.layoutOptions?.isLoading || false;\n this.direction = invalidationContext.layoutOptions?.direction || 'ltr';\n this.buildCollection(invalidationContext);\n\n // Remove layout info that doesn't exist in new collection\n if (this.lastCollection) {\n for (let key of this.lastCollection.getKeys()) {\n if (!this.collection.getItem(key)) {\n this.layoutInfos.delete(key);\n }\n }\n\n if (!this.isLoading) {\n this.layoutInfos.delete('loader');\n }\n\n if (this.collection.size > 0) {\n this.layoutInfos.delete('placeholder');\n }\n }\n\n this.lastCollection = this.collection;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n buildCollection(invalidationContext?: InvalidationContext): void {}\n\n getContentSize(): number {\n return this.contentSize;\n }\n\n getLayoutInfo(key: Key): LayoutInfo {\n return this.layoutInfos.get(key)!;\n }\n\n getVisibleLayoutInfos(rect: Rect, excludePersistedKeys = false): LayoutInfo[] {\n let res: LayoutInfo[] = [];\n\n for (let layoutInfo of this.layoutInfos.values()) {\n if (this.isVisible(layoutInfo, rect, excludePersistedKeys)) {\n res.push(layoutInfo);\n }\n }\n\n return res;\n }\n\n isVisible(layoutInfo: LayoutInfo, rect: Rect, excludePersistedKeys: boolean): boolean {\n if (layoutInfo.rect.intersects(rect)) {\n return true;\n }\n\n if (!excludePersistedKeys) {\n return this.virtualizer.isPersistedKey(layoutInfo.key);\n }\n\n return false;\n }\n\n _findClosestLayoutInfo(target: Rect, rect: Rect): LayoutInfo | null {\n let layoutInfos = this.getVisibleLayoutInfos(rect, true);\n let best = null;\n let bestDistance = Infinity;\n\n // Calculates distance as the distance between the center of 2 rects.\n for (let cur of layoutInfos) {\n if (cur.type === 'item') {\n let curRect = cur.rect;\n let targetMidX = (target.x + target.maxX) / 2;\n let targetMidY = (target.y + target.maxY) / 2;\n let curMidX = (curRect.x + curRect.maxX) / 2;\n let curMidY = (curRect.y + curRect.maxY) / 2;\n let dist = Math.pow(targetMidX - curMidX, 2) + Math.pow(targetMidY - curMidY, 2);\n if (dist < bestDistance) {\n best = cur;\n bestDistance = dist;\n }\n }\n }\n\n return best;\n }\n\n _findClosest(target: Rect, rect: Rect): LayoutInfo | null {\n let best = this._findClosestLayoutInfo(target, rect);\n return best || null;\n }\n\n getKeyBelow(key: Key): Node<T> | undefined {\n // Expected key is the currently focused cell so we need the parent row key\n let parentRowKey = this.collection.getItem(key).parentKey;\n let layoutInfo = this.getLayoutInfo(parentRowKey);\n let rect = new Rect(layoutInfo.rect.x, layoutInfo.rect.maxY + 1, layoutInfo.rect.width, this.virtualizer.visibleRect.height);\n let closestRow = this.collection.getItem(this._findClosest(layoutInfo.rect, rect)?.key);\n return getFirstItem(getChildNodes(closestRow, this.collection))?.key;\n }\n\n getKeyAbove(key: Key): Node<T> | undefined {\n // Expected key is the currently focused cell so we need the parent row key\n let parentRowKey = this.collection.getItem(key).parentKey;\n let layoutInfo = this.getLayoutInfo(parentRowKey);\n let rect = new Rect(layoutInfo.rect.x, 0, layoutInfo.rect.width, layoutInfo.rect.y - 1);\n let closestRow = this.collection.getItem(this._findClosest(layoutInfo.rect, rect)?.key);\n return getFirstItem(getChildNodes(closestRow, this.collection))?.key;\n }\n\n getKeyRightOf(key: Key): Node<T> | undefined {\n // Expected key is the currently focused cell so we need the parent row key\n let parentRowKey = this.collection.getItem(key).parentKey;\n key = this.direction === 'rtl' ? this.collection.getKeyBefore(parentRowKey) : this.collection.getKeyAfter(parentRowKey);\n\n while (key != null) {\n let item = this.collection.getItem(key);\n // Don't check if item is disabled because we want to be able to focus disabled items in a grid (double check this)\n if (item.type === 'item') {\n return getFirstItem(getChildNodes(item, this.collection))?.key;\n }\n key = this.direction === 'rtl' ? this.collection.getKeyBefore(key) : this.collection.getKeyAfter(key);\n }\n }\n\n getKeyLeftOf(key: Key): Node<T> | undefined {\n // Expected key is the currently focused cell so we need the parent row key\n let parentRowKey = this.collection.getItem(key).parentKey;\n key = this.direction === 'rtl' ? this.collection.getKeyAfter(parentRowKey) : this.collection.getKeyBefore(parentRowKey);\n while (key != null) {\n let item = this.collection.getItem(key);\n // Don't check if item is disabled because we want to be able to focus disabled items in a grid (double check this)\n if (item.type === 'item') {\n return getFirstItem(getChildNodes(item, this.collection))?.key;\n }\n\n key = this.direction === 'rtl' ? this.collection.getKeyAfter(key) : this.collection.getKeyBefore(key);\n }\n }\n\n getFirstKey(): Node<T> | undefined {\n let firstRow = this.collection.getItem(this.collection.getFirstKey());\n return getFirstItem(getChildNodes(firstRow, this.collection))?.key;\n }\n\n getLastKey(): Node<T> | undefined {\n let lastRow = this.collection.getItem(this.collection.getLastKey());\n return getFirstItem(getChildNodes(lastRow, this.collection))?.key;\n }\n\n // TODO: pretty unwieldy because it needs to bounce back and forth between the parent key and the child key\n // Perhaps have layoutInfo store childKey as well so we don't need to do this? Or maybe make the layoutInfos be the cells instead of the rows?\n getKeyPageAbove(key: Key): Node<T> | undefined {\n // Expected key is the currently focused cell so we need the parent row key\n let parentRowKey = this.collection.getItem(key).parentKey;\n let layoutInfo = this.getLayoutInfo(parentRowKey);\n\n if (layoutInfo) {\n let pageY = Math.max(0, layoutInfo.rect.y + layoutInfo.rect.height - this.virtualizer.visibleRect.height);\n // If the node is so large that it spans multiple page heights, return the key of the item immediately above\n // Otherwise keep going up until we exceed a single page height worth of nodes\n let keyAbove = this.collection.getItem(this.getKeyAbove(key))?.parentKey;\n layoutInfo = this.getLayoutInfo(keyAbove);\n\n if (layoutInfo && layoutInfo.rect.y > pageY) {\n while (layoutInfo && layoutInfo.rect.y > pageY) {\n let childKey = getFirstItem(getChildNodes(this.collection.getItem(layoutInfo.key), this.collection))?.key;\n let keyAbove = this.collection.getItem(this.getKeyAbove(childKey))?.parentKey;\n layoutInfo = this.getLayoutInfo(keyAbove);\n }\n }\n\n if (layoutInfo) {\n let childKey = getFirstItem(getChildNodes(this.collection.getItem(layoutInfo.key), this.collection))?.key;\n return childKey;\n }\n }\n\n return this.getFirstKey();\n }\n\n // TODO: pretty unwieldy because it needs to bounce back and forth between the parent key and the child key\n // Perhaps have layoutInfo store childKey as well so we don't need to do this?\n getKeyPageBelow(key: Key): Node<T> | undefined {\n // Expected key is the currently focused cell so we need the parent row key\n let parentRowKey = this.collection.getItem(key).parentKey;\n let layoutInfo = this.getLayoutInfo(parentRowKey);\n if (layoutInfo) {\n let pageY = Math.min(this.virtualizer.contentSize.height, layoutInfo.rect.y - layoutInfo.rect.height + this.virtualizer.visibleRect.height);\n // If the node is so large that it spans multiple page heights, return the key of the item immediately below\n // Otherwise keep going up until we exceed a single page height worth of nodes\n let keyBelow = this.collection.getItem(this.getKeyBelow(key))?.parentKey;\n layoutInfo = this.getLayoutInfo(keyBelow);\n if (layoutInfo && layoutInfo.rect.y < pageY) {\n while (layoutInfo && layoutInfo.rect.y < pageY) {\n let childKey = getFirstItem(getChildNodes(this.collection.getItem(layoutInfo.key), this.collection))?.key;\n let keyBelow = this.collection.getItem(this.getKeyBelow(childKey))?.parentKey;\n layoutInfo = this.getLayoutInfo(keyBelow);\n }\n }\n\n if (layoutInfo) {\n let childKey = getFirstItem(getChildNodes(this.collection.getItem(layoutInfo.key), this.collection))?.key;\n return childKey;\n }\n }\n\n return this.getLastKey();\n }\n\n getKeyForSearch(search: string, fromKey?: Key): Node<T> | undefined | null {\n if (!this.collator) {\n return null;\n }\n\n let collection = this.collection;\n let key = fromKey ?? this.getFirstKey();\n\n let startItem = collection.getItem(key);\n key = startItem.parentKey;\n\n while (key != null) {\n let item = collection.getItem(key);\n if (item.textValue) {\n let substring = item.textValue.slice(0, search.length);\n if (this.collator.compare(substring, search) === 0) {\n return getFirstItem(getChildNodes(item, this.collection))?.key;\n }\n }\n\n key = this.collection.getKeyAfter(key);\n }\n\n return null;\n }\n}\n"],"names":[],"version":3,"file":"BaseLayout.main.js.map"}