@react-spectrum/card 3.0.0-alpha.4 → 3.0.0-alpha.41

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/BaseLayout.main.js +213 -0
  2. package/dist/BaseLayout.main.js.map +1 -0
  3. package/dist/BaseLayout.mjs +208 -0
  4. package/dist/BaseLayout.module.js +208 -0
  5. package/dist/BaseLayout.module.js.map +1 -0
  6. package/dist/Card.main.js +52 -0
  7. package/dist/Card.main.js.map +1 -0
  8. package/dist/Card.mjs +43 -0
  9. package/dist/Card.module.js +43 -0
  10. package/dist/Card.module.js.map +1 -0
  11. package/dist/CardBase.main.js +203 -0
  12. package/dist/CardBase.main.js.map +1 -0
  13. package/dist/CardBase.mjs +198 -0
  14. package/dist/CardBase.module.js +198 -0
  15. package/dist/CardBase.module.js.map +1 -0
  16. package/dist/CardView.main.js +238 -0
  17. package/dist/CardView.main.js.map +1 -0
  18. package/dist/CardView.mjs +233 -0
  19. package/dist/CardView.module.js +233 -0
  20. package/dist/CardView.module.js.map +1 -0
  21. package/dist/CardViewContext.main.js +32 -0
  22. package/dist/CardViewContext.main.js.map +1 -0
  23. package/dist/CardViewContext.mjs +22 -0
  24. package/dist/CardViewContext.module.js +22 -0
  25. package/dist/CardViewContext.module.js.map +1 -0
  26. package/dist/GalleryLayout.main.js +230 -0
  27. package/dist/GalleryLayout.main.js.map +1 -0
  28. package/dist/GalleryLayout.mjs +225 -0
  29. package/dist/GalleryLayout.module.js +225 -0
  30. package/dist/GalleryLayout.module.js.map +1 -0
  31. package/dist/GridLayout.main.js +175 -0
  32. package/dist/GridLayout.main.js.map +1 -0
  33. package/dist/GridLayout.mjs +170 -0
  34. package/dist/GridLayout.module.js +170 -0
  35. package/dist/GridLayout.module.js.map +1 -0
  36. package/dist/WaterfallLayout.main.js +182 -0
  37. package/dist/WaterfallLayout.main.js.map +1 -0
  38. package/dist/WaterfallLayout.mjs +177 -0
  39. package/dist/WaterfallLayout.module.js +177 -0
  40. package/dist/WaterfallLayout.module.js.map +1 -0
  41. package/dist/ar-AE.main.js +7 -0
  42. package/dist/ar-AE.main.js.map +1 -0
  43. package/dist/ar-AE.mjs +9 -0
  44. package/dist/ar-AE.module.js +9 -0
  45. package/dist/ar-AE.module.js.map +1 -0
  46. package/dist/bg-BG.main.js +7 -0
  47. package/dist/bg-BG.main.js.map +1 -0
  48. package/dist/bg-BG.mjs +9 -0
  49. package/dist/bg-BG.module.js +9 -0
  50. package/dist/bg-BG.module.js.map +1 -0
  51. package/dist/card_vars_css.main.js +116 -0
  52. package/dist/card_vars_css.main.js.map +1 -0
  53. package/dist/card_vars_css.mjs +118 -0
  54. package/dist/card_vars_css.module.js +118 -0
  55. package/dist/card_vars_css.module.js.map +1 -0
  56. package/dist/cs-CZ.main.js +7 -0
  57. package/dist/cs-CZ.main.js.map +1 -0
  58. package/dist/cs-CZ.mjs +9 -0
  59. package/dist/cs-CZ.module.js +9 -0
  60. package/dist/cs-CZ.module.js.map +1 -0
  61. package/dist/da-DK.main.js +7 -0
  62. package/dist/da-DK.main.js.map +1 -0
  63. package/dist/da-DK.mjs +9 -0
  64. package/dist/da-DK.module.js +9 -0
  65. package/dist/da-DK.module.js.map +1 -0
  66. package/dist/de-DE.main.js +7 -0
  67. package/dist/de-DE.main.js.map +1 -0
  68. package/dist/de-DE.mjs +9 -0
  69. package/dist/de-DE.module.js +9 -0
  70. package/dist/de-DE.module.js.map +1 -0
  71. package/dist/el-GR.main.js +7 -0
  72. package/dist/el-GR.main.js.map +1 -0
  73. package/dist/el-GR.mjs +9 -0
  74. package/dist/el-GR.module.js +9 -0
  75. package/dist/el-GR.module.js.map +1 -0
  76. package/dist/en-US.main.js +7 -0
  77. package/dist/en-US.main.js.map +1 -0
  78. package/dist/en-US.mjs +9 -0
  79. package/dist/en-US.module.js +9 -0
  80. package/dist/en-US.module.js.map +1 -0
  81. package/dist/es-ES.main.js +7 -0
  82. package/dist/es-ES.main.js.map +1 -0
  83. package/dist/es-ES.mjs +9 -0
  84. package/dist/es-ES.module.js +9 -0
  85. package/dist/es-ES.module.js.map +1 -0
  86. package/dist/et-EE.main.js +7 -0
  87. package/dist/et-EE.main.js.map +1 -0
  88. package/dist/et-EE.mjs +9 -0
  89. package/dist/et-EE.module.js +9 -0
  90. package/dist/et-EE.module.js.map +1 -0
  91. package/dist/fi-FI.main.js +7 -0
  92. package/dist/fi-FI.main.js.map +1 -0
  93. package/dist/fi-FI.mjs +9 -0
  94. package/dist/fi-FI.module.js +9 -0
  95. package/dist/fi-FI.module.js.map +1 -0
  96. package/dist/fr-FR.main.js +7 -0
  97. package/dist/fr-FR.main.js.map +1 -0
  98. package/dist/fr-FR.mjs +9 -0
  99. package/dist/fr-FR.module.js +9 -0
  100. package/dist/fr-FR.module.js.map +1 -0
  101. package/dist/he-IL.main.js +7 -0
  102. package/dist/he-IL.main.js.map +1 -0
  103. package/dist/he-IL.mjs +9 -0
  104. package/dist/he-IL.module.js +9 -0
  105. package/dist/he-IL.module.js.map +1 -0
  106. package/dist/hr-HR.main.js +7 -0
  107. package/dist/hr-HR.main.js.map +1 -0
  108. package/dist/hr-HR.mjs +9 -0
  109. package/dist/hr-HR.module.js +9 -0
  110. package/dist/hr-HR.module.js.map +1 -0
  111. package/dist/hu-HU.main.js +7 -0
  112. package/dist/hu-HU.main.js.map +1 -0
  113. package/dist/hu-HU.mjs +9 -0
  114. package/dist/hu-HU.module.js +9 -0
  115. package/dist/hu-HU.module.js.map +1 -0
  116. package/dist/import.mjs +26 -0
  117. package/dist/intlStrings.main.js +108 -0
  118. package/dist/intlStrings.main.js.map +1 -0
  119. package/dist/intlStrings.mjs +110 -0
  120. package/dist/intlStrings.module.js +110 -0
  121. package/dist/intlStrings.module.js.map +1 -0
  122. package/dist/it-IT.main.js +7 -0
  123. package/dist/it-IT.main.js.map +1 -0
  124. package/dist/it-IT.mjs +9 -0
  125. package/dist/it-IT.module.js +9 -0
  126. package/dist/it-IT.module.js.map +1 -0
  127. package/dist/ja-JP.main.js +7 -0
  128. package/dist/ja-JP.main.js.map +1 -0
  129. package/dist/ja-JP.mjs +9 -0
  130. package/dist/ja-JP.module.js +9 -0
  131. package/dist/ja-JP.module.js.map +1 -0
  132. package/dist/ko-KR.main.js +7 -0
  133. package/dist/ko-KR.main.js.map +1 -0
  134. package/dist/ko-KR.mjs +9 -0
  135. package/dist/ko-KR.module.js +9 -0
  136. package/dist/ko-KR.module.js.map +1 -0
  137. package/dist/lt-LT.main.js +7 -0
  138. package/dist/lt-LT.main.js.map +1 -0
  139. package/dist/lt-LT.mjs +9 -0
  140. package/dist/lt-LT.module.js +9 -0
  141. package/dist/lt-LT.module.js.map +1 -0
  142. package/dist/lv-LV.main.js +7 -0
  143. package/dist/lv-LV.main.js.map +1 -0
  144. package/dist/lv-LV.mjs +9 -0
  145. package/dist/lv-LV.module.js +9 -0
  146. package/dist/lv-LV.module.js.map +1 -0
  147. package/dist/main.js +21 -1447
  148. package/dist/main.js.map +1 -1
  149. package/dist/module.js +17 -1432
  150. package/dist/module.js.map +1 -1
  151. package/dist/nb-NO.main.js +7 -0
  152. package/dist/nb-NO.main.js.map +1 -0
  153. package/dist/nb-NO.mjs +9 -0
  154. package/dist/nb-NO.module.js +9 -0
  155. package/dist/nb-NO.module.js.map +1 -0
  156. package/dist/nl-NL.main.js +7 -0
  157. package/dist/nl-NL.main.js.map +1 -0
  158. package/dist/nl-NL.mjs +9 -0
  159. package/dist/nl-NL.module.js +9 -0
  160. package/dist/nl-NL.module.js.map +1 -0
  161. package/dist/pl-PL.main.js +7 -0
  162. package/dist/pl-PL.main.js.map +1 -0
  163. package/dist/pl-PL.mjs +9 -0
  164. package/dist/pl-PL.module.js +9 -0
  165. package/dist/pl-PL.module.js.map +1 -0
  166. package/dist/pt-BR.main.js +7 -0
  167. package/dist/pt-BR.main.js.map +1 -0
  168. package/dist/pt-BR.mjs +9 -0
  169. package/dist/pt-BR.module.js +9 -0
  170. package/dist/pt-BR.module.js.map +1 -0
  171. package/dist/pt-PT.main.js +7 -0
  172. package/dist/pt-PT.main.js.map +1 -0
  173. package/dist/pt-PT.mjs +9 -0
  174. package/dist/pt-PT.module.js +9 -0
  175. package/dist/pt-PT.module.js.map +1 -0
  176. package/dist/ro-RO.main.js +7 -0
  177. package/dist/ro-RO.main.js.map +1 -0
  178. package/dist/ro-RO.mjs +9 -0
  179. package/dist/ro-RO.module.js +9 -0
  180. package/dist/ro-RO.module.js.map +1 -0
  181. package/dist/ru-RU.main.js +7 -0
  182. package/dist/ru-RU.main.js.map +1 -0
  183. package/dist/ru-RU.mjs +9 -0
  184. package/dist/ru-RU.module.js +9 -0
  185. package/dist/ru-RU.module.js.map +1 -0
  186. package/dist/sk-SK.main.js +7 -0
  187. package/dist/sk-SK.main.js.map +1 -0
  188. package/dist/sk-SK.mjs +9 -0
  189. package/dist/sk-SK.module.js +9 -0
  190. package/dist/sk-SK.module.js.map +1 -0
  191. package/dist/sl-SI.main.js +7 -0
  192. package/dist/sl-SI.main.js.map +1 -0
  193. package/dist/sl-SI.mjs +9 -0
  194. package/dist/sl-SI.module.js +9 -0
  195. package/dist/sl-SI.module.js.map +1 -0
  196. package/dist/sr-SP.main.js +7 -0
  197. package/dist/sr-SP.main.js.map +1 -0
  198. package/dist/sr-SP.mjs +9 -0
  199. package/dist/sr-SP.module.js +9 -0
  200. package/dist/sr-SP.module.js.map +1 -0
  201. package/dist/sv-SE.main.js +7 -0
  202. package/dist/sv-SE.main.js.map +1 -0
  203. package/dist/sv-SE.mjs +9 -0
  204. package/dist/sv-SE.module.js +9 -0
  205. package/dist/sv-SE.module.js.map +1 -0
  206. package/dist/tr-TR.main.js +7 -0
  207. package/dist/tr-TR.main.js.map +1 -0
  208. package/dist/tr-TR.mjs +9 -0
  209. package/dist/tr-TR.module.js +9 -0
  210. package/dist/tr-TR.module.js.map +1 -0
  211. package/dist/types.d.ts +38 -36
  212. package/dist/types.d.ts.map +1 -1
  213. package/dist/uk-UA.main.js +7 -0
  214. package/dist/uk-UA.main.js.map +1 -0
  215. package/dist/uk-UA.mjs +9 -0
  216. package/dist/uk-UA.module.js +9 -0
  217. package/dist/uk-UA.module.js.map +1 -0
  218. package/dist/vars.02438011.css +1671 -0
  219. package/dist/vars.02438011.css.map +1 -0
  220. package/dist/zh-CN.main.js +7 -0
  221. package/dist/zh-CN.main.js.map +1 -0
  222. package/dist/zh-CN.mjs +9 -0
  223. package/dist/zh-CN.module.js +9 -0
  224. package/dist/zh-CN.module.js.map +1 -0
  225. package/dist/zh-TW.main.js +7 -0
  226. package/dist/zh-TW.main.js.map +1 -0
  227. package/dist/zh-TW.mjs +9 -0
  228. package/dist/zh-TW.module.js +9 -0
  229. package/dist/zh-TW.module.js.map +1 -0
  230. package/package.json +26 -23
  231. package/src/BaseLayout.tsx +36 -32
  232. package/src/Card.tsx +1 -0
  233. package/src/CardBase.tsx +9 -11
  234. package/src/CardView.tsx +71 -51
  235. package/src/CardViewContext.tsx +1 -0
  236. package/src/GalleryLayout.tsx +4 -2
  237. package/src/GridLayout.tsx +7 -39
  238. package/src/WaterfallLayout.tsx +8 -5
  239. package/src/index.ts +10 -5
  240. package/dist/main.css +0 -1
package/dist/main.js CHANGED
@@ -1,1461 +1,35 @@
1
- require("./main.css");
2
- var $jpY3B$reactspectrumutils = require("@react-spectrum/utils");
3
- var $jpY3B$reactstatelygrid = require("@react-stately/grid");
4
- var $jpY3B$reactspectrumprogress = require("@react-spectrum/progress");
5
- var $jpY3B$react = require("react");
6
- var $jpY3B$reactariai18n = require("@react-aria/i18n");
7
- var $jpY3B$reactariagrid = require("@react-aria/grid");
8
- var $jpY3B$reactstatelylist = require("@react-stately/list");
9
- var $jpY3B$reactspectrumprovider = require("@react-spectrum/provider");
10
- var $jpY3B$reactariavirtualizer = require("@react-aria/virtualizer");
11
- var $jpY3B$reactspectrumcheckbox = require("@react-spectrum/checkbox");
12
- var $jpY3B$reactariautils = require("@react-aria/utils");
13
- var $jpY3B$reactariafocus = require("@react-aria/focus");
14
- var $jpY3B$reactariainteractions = require("@react-aria/interactions");
15
- var $jpY3B$reactstatelyvirtualizer = require("@react-stately/virtualizer");
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");
16
6
 
17
- function $parcel$exportWildcard(dest, source) {
18
- Object.keys(source).forEach(function(key) {
19
- if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
20
- return;
21
- }
22
7
 
23
- Object.defineProperty(dest, key, {
24
- enumerable: true,
25
- get: function get() {
26
- return source[key];
27
- }
28
- });
29
- });
30
-
31
- return dest;
32
- }
33
- function $parcel$interopDefault(a) {
34
- return a && a.__esModule ? a.default : a;
35
- }
36
8
  function $parcel$export(e, n, v, s) {
37
9
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
38
10
  }
39
- var $514a55f6d91f25ef$exports = {};
40
-
41
- $parcel$export($514a55f6d91f25ef$exports, "CardView", () => $514a55f6d91f25ef$export$7e52c821f7b6f422);
42
-
43
-
44
-
45
-
46
-
47
-
48
- var $71570f0038472fa2$exports = {};
49
-
50
- $parcel$export($71570f0038472fa2$exports, "spectrum-Card", () => $71570f0038472fa2$export$4e5e9f191b1edb8, (v) => $71570f0038472fa2$export$4e5e9f191b1edb8 = v);
51
- $parcel$export($71570f0038472fa2$exports, "spectrum-Card-heading", () => $71570f0038472fa2$export$92758a4a0e8d19e4, (v) => $71570f0038472fa2$export$92758a4a0e8d19e4 = v);
52
- $parcel$export($71570f0038472fa2$exports, "spectrum-Card-checkboxWrapper", () => $71570f0038472fa2$export$33977546b63e0df9, (v) => $71570f0038472fa2$export$33977546b63e0df9 = v);
53
- $parcel$export($71570f0038472fa2$exports, "spectrum-Card-checkbox", () => $71570f0038472fa2$export$842da5d48b8f6db2, (v) => $71570f0038472fa2$export$842da5d48b8f6db2 = v);
54
- $parcel$export($71570f0038472fa2$exports, "is-selected", () => $71570f0038472fa2$export$1e0fb04f31d3c22a, (v) => $71570f0038472fa2$export$1e0fb04f31d3c22a = v);
55
- $parcel$export($71570f0038472fa2$exports, "focus-ring", () => $71570f0038472fa2$export$f39a09f249340e2a, (v) => $71570f0038472fa2$export$f39a09f249340e2a = v);
56
- $parcel$export($71570f0038472fa2$exports, "is-hovered", () => $71570f0038472fa2$export$b8813cd5d7824ce7, (v) => $71570f0038472fa2$export$b8813cd5d7824ce7 = v);
57
- $parcel$export($71570f0038472fa2$exports, "spectrum-Card-grid", () => $71570f0038472fa2$export$b3dd760d2dfde29e, (v) => $71570f0038472fa2$export$b3dd760d2dfde29e = v);
58
- $parcel$export($71570f0038472fa2$exports, "spectrum-Card-decoration", () => $71570f0038472fa2$export$48252dc130b62514, (v) => $71570f0038472fa2$export$48252dc130b62514 = v);
59
- $parcel$export($71570f0038472fa2$exports, "spectrum-Card-image", () => $71570f0038472fa2$export$8d5fea71dc66db80, (v) => $71570f0038472fa2$export$8d5fea71dc66db80 = v);
60
- $parcel$export($71570f0038472fa2$exports, "spectrum-Card-illustration", () => $71570f0038472fa2$export$13dd3510ae7a8399, (v) => $71570f0038472fa2$export$13dd3510ae7a8399 = v);
61
- $parcel$export($71570f0038472fa2$exports, "spectrum-Card-avatar", () => $71570f0038472fa2$export$159930c59efb6273, (v) => $71570f0038472fa2$export$159930c59efb6273 = v);
62
- $parcel$export($71570f0038472fa2$exports, "spectrum-Card-detail", () => $71570f0038472fa2$export$16715af38fbd9819, (v) => $71570f0038472fa2$export$16715af38fbd9819 = v);
63
- $parcel$export($71570f0038472fa2$exports, "spectrum-Card-content", () => $71570f0038472fa2$export$d946625b97e8aa17, (v) => $71570f0038472fa2$export$d946625b97e8aa17 = v);
64
- $parcel$export($71570f0038472fa2$exports, "spectrum-Card--waterfall", () => $71570f0038472fa2$export$d9c7209e0e4f7e4d, (v) => $71570f0038472fa2$export$d9c7209e0e4f7e4d = v);
65
- $parcel$export($71570f0038472fa2$exports, "spectrum-Card--default", () => $71570f0038472fa2$export$c7a022df9e10a238, (v) => $71570f0038472fa2$export$c7a022df9e10a238 = v);
66
- $parcel$export($71570f0038472fa2$exports, "spectrum-Card--noPreview", () => $71570f0038472fa2$export$b77922bc0320c9e4, (v) => $71570f0038472fa2$export$b77922bc0320c9e4 = v);
67
- $parcel$export($71570f0038472fa2$exports, "spectrum-Card--grid", () => $71570f0038472fa2$export$59739ab951d2dcc7, (v) => $71570f0038472fa2$export$59739ab951d2dcc7 = v);
68
- $parcel$export($71570f0038472fa2$exports, "spectrum-Card--noLayout", () => $71570f0038472fa2$export$a03d836e6ef3e749, (v) => $71570f0038472fa2$export$a03d836e6ef3e749 = v);
69
- $parcel$export($71570f0038472fa2$exports, "spectrum-Card--isQuiet", () => $71570f0038472fa2$export$92ad04b5ac9296ea, (v) => $71570f0038472fa2$export$92ad04b5ac9296ea = v);
70
- $parcel$export($71570f0038472fa2$exports, "spectrum-Card--gallery", () => $71570f0038472fa2$export$ccd8ffc36bd10cc, (v) => $71570f0038472fa2$export$ccd8ffc36bd10cc = v);
71
- $parcel$export($71570f0038472fa2$exports, "spectrum-Card--horizontal", () => $71570f0038472fa2$export$1c52334407225704, (v) => $71570f0038472fa2$export$1c52334407225704 = v);
72
- $parcel$export($71570f0038472fa2$exports, "is-focused", () => $71570f0038472fa2$export$e7dc768d35940237, (v) => $71570f0038472fa2$export$e7dc768d35940237 = v);
73
- $parcel$export($71570f0038472fa2$exports, "spectrum-CardView", () => $71570f0038472fa2$export$2f34e9e3e0b89d95, (v) => $71570f0038472fa2$export$2f34e9e3e0b89d95 = v);
74
- $parcel$export($71570f0038472fa2$exports, "spectrum-CardView-centeredWrapper", () => $71570f0038472fa2$export$7fc89689fcfab196, (v) => $71570f0038472fa2$export$7fc89689fcfab196 = v);
75
- $parcel$export($71570f0038472fa2$exports, "spectrum-CardView-row", () => $71570f0038472fa2$export$4746ac09daa215ae, (v) => $71570f0038472fa2$export$4746ac09daa215ae = v);
76
- $parcel$export($71570f0038472fa2$exports, "is-drop-target", () => $71570f0038472fa2$export$d8467f38d2d00bd0, (v) => $71570f0038472fa2$export$d8467f38d2d00bd0 = v);
77
- var $71570f0038472fa2$export$4e5e9f191b1edb8;
78
- var $71570f0038472fa2$export$92758a4a0e8d19e4;
79
- var $71570f0038472fa2$export$33977546b63e0df9;
80
- var $71570f0038472fa2$export$842da5d48b8f6db2;
81
- var $71570f0038472fa2$export$1e0fb04f31d3c22a;
82
- var $71570f0038472fa2$export$f39a09f249340e2a;
83
- var $71570f0038472fa2$export$b8813cd5d7824ce7;
84
- var $71570f0038472fa2$export$b3dd760d2dfde29e;
85
- var $71570f0038472fa2$export$48252dc130b62514;
86
- var $71570f0038472fa2$export$8d5fea71dc66db80;
87
- var $71570f0038472fa2$export$13dd3510ae7a8399;
88
- var $71570f0038472fa2$export$159930c59efb6273;
89
- var $71570f0038472fa2$export$16715af38fbd9819;
90
- var $71570f0038472fa2$export$d946625b97e8aa17;
91
- var $71570f0038472fa2$export$d9c7209e0e4f7e4d;
92
- var $71570f0038472fa2$export$c7a022df9e10a238;
93
- var $71570f0038472fa2$export$b77922bc0320c9e4;
94
- var $71570f0038472fa2$export$59739ab951d2dcc7;
95
- var $71570f0038472fa2$export$a03d836e6ef3e749;
96
- var $71570f0038472fa2$export$92ad04b5ac9296ea;
97
- var $71570f0038472fa2$export$ccd8ffc36bd10cc;
98
- var $71570f0038472fa2$export$1c52334407225704;
99
- var $71570f0038472fa2$export$e7dc768d35940237;
100
- var $71570f0038472fa2$export$2f34e9e3e0b89d95;
101
- var $71570f0038472fa2$export$7fc89689fcfab196;
102
- var $71570f0038472fa2$export$4746ac09daa215ae;
103
- var $71570f0038472fa2$export$d8467f38d2d00bd0;
104
- $71570f0038472fa2$export$4e5e9f191b1edb8 = "spectrum-Card_6fdf9f";
105
- $71570f0038472fa2$export$92758a4a0e8d19e4 = "spectrum-Card-heading_6fdf9f";
106
- $71570f0038472fa2$export$33977546b63e0df9 = "spectrum-Card-checkboxWrapper_6fdf9f";
107
- $71570f0038472fa2$export$842da5d48b8f6db2 = "spectrum-Card-checkbox_6fdf9f";
108
- $71570f0038472fa2$export$1e0fb04f31d3c22a = "is-selected_6fdf9f";
109
- $71570f0038472fa2$export$f39a09f249340e2a = "focus-ring_6fdf9f";
110
- $71570f0038472fa2$export$b8813cd5d7824ce7 = "is-hovered_6fdf9f";
111
- $71570f0038472fa2$export$b3dd760d2dfde29e = "spectrum-Card-grid_6fdf9f";
112
- $71570f0038472fa2$export$48252dc130b62514 = "spectrum-Card-decoration_6fdf9f";
113
- $71570f0038472fa2$export$8d5fea71dc66db80 = "spectrum-Card-image_6fdf9f";
114
- $71570f0038472fa2$export$13dd3510ae7a8399 = "spectrum-Card-illustration_6fdf9f";
115
- $71570f0038472fa2$export$159930c59efb6273 = "spectrum-Card-avatar_6fdf9f";
116
- $71570f0038472fa2$export$16715af38fbd9819 = "spectrum-Card-detail_6fdf9f";
117
- $71570f0038472fa2$export$d946625b97e8aa17 = "spectrum-Card-content_6fdf9f";
118
- $71570f0038472fa2$export$d9c7209e0e4f7e4d = "spectrum-Card--waterfall_6fdf9f";
119
- $71570f0038472fa2$export$c7a022df9e10a238 = "spectrum-Card--default_6fdf9f";
120
- $71570f0038472fa2$export$b77922bc0320c9e4 = "spectrum-Card--noPreview_6fdf9f";
121
- $71570f0038472fa2$export$59739ab951d2dcc7 = "spectrum-Card--grid_6fdf9f";
122
- $71570f0038472fa2$export$a03d836e6ef3e749 = "spectrum-Card--noLayout_6fdf9f";
123
- $71570f0038472fa2$export$92ad04b5ac9296ea = "spectrum-Card--isQuiet_6fdf9f";
124
- $71570f0038472fa2$export$ccd8ffc36bd10cc = "spectrum-Card--gallery_6fdf9f";
125
- $71570f0038472fa2$export$1c52334407225704 = "spectrum-Card--horizontal_6fdf9f";
126
- $71570f0038472fa2$export$e7dc768d35940237 = "is-focused_6fdf9f";
127
- $71570f0038472fa2$export$2f34e9e3e0b89d95 = "spectrum-CardView_6fdf9f";
128
- $71570f0038472fa2$export$7fc89689fcfab196 = "spectrum-CardView-centeredWrapper_6fdf9f";
129
- $71570f0038472fa2$export$4746ac09daa215ae = "spectrum-CardView-row_6fdf9f";
130
- $71570f0038472fa2$export$d8467f38d2d00bd0 = "is-drop-target_6fdf9f";
131
-
132
-
133
-
134
- const $e57ab98cef2f01a5$export$64992ac69f286e5c = /*#__PURE__*/ ($parcel$interopDefault($jpY3B$react)).createContext(null);
135
- function $e57ab98cef2f01a5$export$fea0b38586ec8f13() {
136
- return $jpY3B$react.useContext($e57ab98cef2f01a5$export$64992ac69f286e5c);
137
- }
138
-
139
-
140
-
141
-
142
- function $7888205ff7de382f$var$CardBase(props, ref) {
143
- props = $jpY3B$reactspectrumprovider.useProviderProps(props);
144
- let context = $e57ab98cef2f01a5$export$fea0b38586ec8f13() || {
145
- }; // we can call again here, won't change from Card.tsx
146
- let { state: state } = context;
147
- let manager = state === null || state === void 0 ? void 0 : state.selectionManager;
148
- let { isQuiet: isQuiet , orientation: orientation = 'vertical' , articleProps: articleProps = {
149
- } , item: item , layout: layout , children: children } = props;
150
- let key = item === null || item === void 0 ? void 0 : item.key;
151
- let isSelected = manager === null || manager === void 0 ? void 0 : manager.isSelected(key);
152
- let isDisabled = state === null || state === void 0 ? void 0 : state.disabledKeys.has(key);
153
- let onChange = ()=>{
154
- return manager === null || manager === void 0 ? void 0 : manager.select(key);
155
- };
156
- let { styleProps: styleProps } = $jpY3B$reactspectrumutils.useStyleProps(props);
157
- let { cardProps: cardProps , titleProps: titleProps , contentProps: contentProps } = $7888205ff7de382f$var$useCard(props);
158
- let domRef = $jpY3B$reactspectrumutils.useDOMRef(ref);
159
- let gridRef = $jpY3B$react.useRef();
160
- let checkboxRef = $jpY3B$react.useRef(null);
161
- // cards are only interactive if there is a selection manager and it allows selection
162
- let { hoverProps: hoverProps , isHovered: isHovered } = $jpY3B$reactariainteractions.useHover({
163
- isDisabled: manager === undefined || (manager === null || manager === void 0 ? void 0 : manager.selectionMode) === 'none' || isDisabled
164
- });
165
- let [isFocused, setIsFocused] = $jpY3B$react.useState(false);
166
- let { focusWithinProps: focusWithinProps } = $jpY3B$reactariainteractions.useFocusWithin({
167
- onFocusWithinChange: setIsFocused,
168
- isDisabled: isDisabled
169
- });
170
- // ToDo: see css for comment about avatar under selector .spectrum-Card--noLayout.spectrum-Card--default
171
- let hasPreviewImage = $jpY3B$reactspectrumutils.useHasChild(`.${(/*@__PURE__*/$parcel$interopDefault($71570f0038472fa2$exports))['spectrum-Card-image']}`, gridRef);
172
- let hasPreviewIllustration = $jpY3B$reactspectrumutils.useHasChild(`.${(/*@__PURE__*/$parcel$interopDefault($71570f0038472fa2$exports))['spectrum-Card-illustration']}`, gridRef);
173
- let hasPreview = hasPreviewImage || hasPreviewIllustration;
174
- // this is for horizontal cards
175
- let [height, setHeight] = $jpY3B$react.useState(NaN);
176
- let updateHeight = $jpY3B$react.useCallback(()=>{
177
- if (orientation !== 'horizontal') return;
178
- let cardHeight = gridRef.current.getBoundingClientRect().height;
179
- setHeight(cardHeight);
180
- }, [
181
- orientation,
182
- gridRef,
183
- setHeight
184
- ]);
185
- $jpY3B$reactariautils.useResizeObserver({
186
- ref: gridRef,
187
- onResize: updateHeight
188
- });
189
- let aspectRatioEnforce = undefined;
190
- if (orientation === 'horizontal' && !isNaN(height)) aspectRatioEnforce = {
191
- height: `${height}px`,
192
- width: `${height}px`
193
- };
194
- let slots = $jpY3B$react.useMemo(()=>({
195
- image: {
196
- UNSAFE_className: $jpY3B$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($71570f0038472fa2$exports)), 'spectrum-Card-image'),
197
- objectFit: orientation === 'horizontal' ? 'cover' : 'contain',
198
- alt: '',
199
- ...aspectRatioEnforce
200
- },
201
- illustration: {
202
- UNSAFE_className: $jpY3B$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($71570f0038472fa2$exports)), 'spectrum-Card-illustration'),
203
- ...aspectRatioEnforce
204
- },
205
- avatar: {
206
- UNSAFE_className: $jpY3B$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($71570f0038472fa2$exports)), 'spectrum-Card-avatar'),
207
- size: 'avatar-size-400'
208
- },
209
- heading: {
210
- UNSAFE_className: $jpY3B$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($71570f0038472fa2$exports)), 'spectrum-Card-heading'),
211
- ...titleProps
212
- },
213
- content: {
214
- UNSAFE_className: $jpY3B$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($71570f0038472fa2$exports)), 'spectrum-Card-content'),
215
- ...contentProps
216
- },
217
- detail: {
218
- UNSAFE_className: $jpY3B$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($71570f0038472fa2$exports)), 'spectrum-Card-detail')
219
- }
220
- })
221
- , [
222
- titleProps,
223
- contentProps,
224
- height,
225
- isQuiet,
226
- orientation
227
- ]);
228
- $jpY3B$reactariautils.useLayoutEffect(()=>{
229
- if (gridRef === null || gridRef === void 0 ? void 0 : gridRef.current) {
230
- let walker = $jpY3B$reactariafocus.getFocusableTreeWalker(gridRef.current);
231
- let nextNode = walker.nextNode();
232
- while(nextNode != null){
233
- if (checkboxRef.current && !checkboxRef.current.UNSAFE_getDOMNode().contains(nextNode)) {
234
- console.warn('Card does not support focusable elements, please contact the team regarding your use case.');
235
- break;
236
- }
237
- nextNode = walker.nextNode();
238
- }
239
- }
240
- }, [
241
- children
242
- ]);
243
- return(/*#__PURE__*/ ($parcel$interopDefault($jpY3B$react)).createElement($jpY3B$reactariafocus.FocusRing, {
244
- focusRingClass: $jpY3B$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($71570f0038472fa2$exports)), 'focus-ring')
245
- }, /*#__PURE__*/ ($parcel$interopDefault($jpY3B$react)).createElement("article", {
246
- ...styleProps,
247
- ...$jpY3B$reactariautils.mergeProps(cardProps, focusWithinProps, hoverProps, $jpY3B$reactariautils.filterDOMProps(props), articleProps),
248
- ref: domRef,
249
- className: $jpY3B$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($71570f0038472fa2$exports)), 'spectrum-Card', {
250
- 'spectrum-Card--default': !isQuiet && orientation !== 'horizontal',
251
- 'spectrum-Card--isQuiet': isQuiet && orientation !== 'horizontal',
252
- 'spectrum-Card--horizontal': orientation === 'horizontal',
253
- 'spectrum-Card--noPreview': !hasPreview,
254
- 'is-hovered': isHovered,
255
- 'is-focused': isFocused,
256
- 'is-selected': isSelected,
257
- 'spectrum-Card--waterfall': layout === 'waterfall',
258
- 'spectrum-Card--gallery': layout === 'gallery',
259
- 'spectrum-Card--grid': layout === 'grid',
260
- 'spectrum-Card--noLayout': layout !== 'waterfall' && layout !== 'gallery' && layout !== 'grid'
261
- }, styleProps.className)
262
- }, /*#__PURE__*/ ($parcel$interopDefault($jpY3B$react)).createElement("div", {
263
- ref: gridRef,
264
- className: $jpY3B$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($71570f0038472fa2$exports)), 'spectrum-Card-grid')
265
- }, manager && manager.selectionMode !== 'none' && /*#__PURE__*/ ($parcel$interopDefault($jpY3B$react)).createElement("div", {
266
- className: $jpY3B$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($71570f0038472fa2$exports)), 'spectrum-Card-checkboxWrapper')
267
- }, /*#__PURE__*/ ($parcel$interopDefault($jpY3B$react)).createElement($jpY3B$reactspectrumcheckbox.Checkbox, {
268
- ref: checkboxRef,
269
- isDisabled: isDisabled,
270
- excludeFromTabOrder: true,
271
- isSelected: isSelected,
272
- onChange: onChange,
273
- UNSAFE_className: $jpY3B$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($71570f0038472fa2$exports)), 'spectrum-Card-checkbox'),
274
- isEmphasized: true,
275
- "aria-label": "select"
276
- })), /*#__PURE__*/ ($parcel$interopDefault($jpY3B$react)).createElement($jpY3B$reactspectrumutils.SlotProvider, {
277
- slots: slots
278
- }, children), /*#__PURE__*/ ($parcel$interopDefault($jpY3B$react)).createElement("div", {
279
- className: $jpY3B$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($71570f0038472fa2$exports)), 'spectrum-Card-decoration')
280
- })))));
281
- }
282
- function $7888205ff7de382f$var$useCard(props) {
283
- let titleId = $jpY3B$reactariautils.useSlotId();
284
- let descriptionId = $jpY3B$reactariautils.useSlotId();
285
- let titleProps = $jpY3B$react.useMemo(()=>({
286
- id: titleId
287
- })
288
- , [
289
- titleId
290
- ]);
291
- let contentProps = $jpY3B$react.useMemo(()=>({
292
- id: descriptionId
293
- })
294
- , [
295
- descriptionId
296
- ]);
297
- return {
298
- cardProps: {
299
- ...$jpY3B$reactariautils.filterDOMProps(props),
300
- 'aria-labelledby': titleId,
301
- 'aria-describedby': descriptionId,
302
- tabIndex: 0
303
- },
304
- titleProps: titleProps,
305
- contentProps: contentProps
306
- };
307
- }
308
- /**
309
- * TODO: Add description of component here.
310
- */ const $7888205ff7de382f$export$7a6ccaf429ad93a8 = /*#__PURE__*/ ($parcel$interopDefault($jpY3B$react)).forwardRef($7888205ff7de382f$var$CardBase);
311
-
312
-
313
-
314
-
315
-
316
- var $dc38f0b958ac5018$exports = {};
317
- var $b0d49dbc72f937a2$exports = {};
318
- $b0d49dbc72f937a2$exports = JSON.parse("{\"loading\":\"جارٍ التحميل...\",\"loadingMore\":\"جارٍ تحميل المزيد...\"}");
319
-
320
-
321
- var $ce0dd82398fba411$exports = {};
322
- $ce0dd82398fba411$exports = JSON.parse("{\"loading\":\"Зареждане...\",\"loadingMore\":\"Зареждане на още...\"}");
323
-
324
-
325
- var $1086444b40892e5d$exports = {};
326
- $1086444b40892e5d$exports = JSON.parse("{\"loading\":\"Načítání...\",\"loadingMore\":\"Načítání dalších...\"}");
327
-
328
-
329
- var $26f9bd87c0446842$exports = {};
330
- $26f9bd87c0446842$exports = JSON.parse("{\"loading\":\"Indlæser ...\",\"loadingMore\":\"Indlæser flere ...\"}");
331
-
332
-
333
- var $5922ace8d8eedc34$exports = {};
334
- $5922ace8d8eedc34$exports = JSON.parse("{\"loading\":\"Laden...\",\"loadingMore\":\"Mehr laden ...\"}");
335
-
336
-
337
- var $0dff680a5aaa08a6$exports = {};
338
- $0dff680a5aaa08a6$exports = JSON.parse("{\"loading\":\"Φόρτωση...\",\"loadingMore\":\"Φόρτωση περισσότερων...\"}");
339
-
340
-
341
- var $40f72ebe96160fe5$exports = {};
342
- $40f72ebe96160fe5$exports = JSON.parse("{\"loading\":\"Loading…\",\"loadingMore\":\"Loading more…\"}");
343
-
344
-
345
- var $fd3d037364cca31d$exports = {};
346
- $fd3d037364cca31d$exports = JSON.parse("{\"loading\":\"Cargando…\",\"loadingMore\":\"Cargando más…\"}");
347
-
348
-
349
- var $aeb59a17c296301b$exports = {};
350
- $aeb59a17c296301b$exports = JSON.parse("{\"loading\":\"Laadimine...\",\"loadingMore\":\"Laadi rohkem...\"}");
351
-
352
-
353
- var $8725562d6e87d608$exports = {};
354
- $8725562d6e87d608$exports = JSON.parse("{\"loading\":\"Ladataan…\",\"loadingMore\":\"Ladataan lisää…\"}");
355
-
356
-
357
- var $5b8a7cd61bd67f0d$exports = {};
358
- $5b8a7cd61bd67f0d$exports = JSON.parse("{\"loading\":\"Chargement...\",\"loadingMore\":\"Chargement supplémentaire...\"}");
359
-
360
-
361
- var $904fdf1c66b8e1ae$exports = {};
362
- $904fdf1c66b8e1ae$exports = JSON.parse("{\"loading\":\"טוען...\",\"loadingMore\":\"טוען עוד...\"}");
363
-
364
-
365
- var $e321e496e49645f3$exports = {};
366
- $e321e496e49645f3$exports = JSON.parse("{\"loading\":\"Učitavam...\",\"loadingMore\":\"Učitavam još...\"}");
367
-
368
-
369
- var $5fb9f79f322fc149$exports = {};
370
- $5fb9f79f322fc149$exports = JSON.parse("{\"loading\":\"Betöltés folyamatban…\",\"loadingMore\":\"Továbbiak betöltése folyamatban…\"}");
371
-
372
-
373
- var $87d8922713b63bdb$exports = {};
374
- $87d8922713b63bdb$exports = JSON.parse("{\"loading\":\"Caricamento...\",\"loadingMore\":\"Caricamento altri...\"}");
375
-
376
-
377
- var $57201e032f548603$exports = {};
378
- $57201e032f548603$exports = JSON.parse("{\"loading\":\"読み込み中...\",\"loadingMore\":\"さらに読み込み中...\"}");
379
-
380
-
381
- var $74aa6884e1ef4030$exports = {};
382
- $74aa6884e1ef4030$exports = JSON.parse("{\"loading\":\"로드 중\",\"loadingMore\":\"추가 로드 중\"}");
383
-
384
-
385
- var $50cefda6a03c058b$exports = {};
386
- $50cefda6a03c058b$exports = JSON.parse("{\"loading\":\"Įkeliama...\",\"loadingMore\":\"Įkeliama daugiau...\"}");
387
-
388
-
389
- var $3d08f75b6bbe5354$exports = {};
390
- $3d08f75b6bbe5354$exports = JSON.parse("{\"loading\":\"Notiek ielāde...\",\"loadingMore\":\"Tiek ielādēts vēl...\"}");
391
-
392
-
393
- var $c59f7b2f9755472b$exports = {};
394
- $c59f7b2f9755472b$exports = JSON.parse("{\"loading\":\"Laster inn ...\",\"loadingMore\":\"Laster inn flere ...\"}");
395
-
396
-
397
- var $d81bf728da4b1c33$exports = {};
398
- $d81bf728da4b1c33$exports = JSON.parse("{\"loading\":\"Laden...\",\"loadingMore\":\"Meer laden...\"}");
399
-
400
-
401
- var $f323a42ea1486c2f$exports = {};
402
- $f323a42ea1486c2f$exports = JSON.parse("{\"loading\":\"Ładowanie...\",\"loadingMore\":\"Wczytywanie większej liczby...\"}");
403
-
404
-
405
- var $2b2937248d390105$exports = {};
406
- $2b2937248d390105$exports = JSON.parse("{\"loading\":\"Carregando...\",\"loadingMore\":\"Carregando mais...\"}");
407
-
408
-
409
- var $156cd72030936350$exports = {};
410
- $156cd72030936350$exports = JSON.parse("{\"loading\":\"A carregar...\",\"loadingMore\":\"A carregar mais...\"}");
411
-
412
-
413
- var $5964cf64325251a3$exports = {};
414
- $5964cf64325251a3$exports = JSON.parse("{\"loading\":\"Se încarcă...\",\"loadingMore\":\"Se încarcă mai multe...\"}");
415
-
416
-
417
- var $71b3c908be47dc7e$exports = {};
418
- $71b3c908be47dc7e$exports = JSON.parse("{\"loading\":\"Загрузка...\",\"loadingMore\":\"Дополнительная загрузка...\"}");
419
-
420
-
421
- var $815155759d865560$exports = {};
422
- $815155759d865560$exports = JSON.parse("{\"loading\":\"Načítava sa...\",\"loadingMore\":\"Načítava sa viac...\"}");
423
-
424
-
425
- var $d5deb2faae807da5$exports = {};
426
- $d5deb2faae807da5$exports = JSON.parse("{\"loading\":\"Nalaganje...\",\"loadingMore\":\"Nalaganje več vsebine...\"}");
427
-
428
-
429
- var $42e52cb34b81b4af$exports = {};
430
- $42e52cb34b81b4af$exports = JSON.parse("{\"loading\":\"Učitavam...\",\"loadingMore\":\"Učitavam još...\"}");
431
-
432
-
433
- var $f278e5fd270ba60f$exports = {};
434
- $f278e5fd270ba60f$exports = JSON.parse("{\"loading\":\"Läser in...\",\"loadingMore\":\"Läser in mer...\"}");
435
-
436
-
437
- var $523e0ad61eab5c5d$exports = {};
438
- $523e0ad61eab5c5d$exports = JSON.parse("{\"loading\":\"Yükleniyor...\",\"loadingMore\":\"Daha fazla yükleniyor...\"}");
439
-
440
-
441
- var $a58cff5745fe89a6$exports = {};
442
- $a58cff5745fe89a6$exports = JSON.parse("{\"loading\":\"Завантаження…\",\"loadingMore\":\"Завантаження інших об’єктів...\"}");
443
-
444
-
445
- var $2c1c50c48e046fcb$exports = {};
446
- $2c1c50c48e046fcb$exports = JSON.parse("{\"loading\":\"正在加载...\",\"loadingMore\":\"正在加载更多...\"}");
447
-
448
-
449
- var $d20ec5c21f83badd$exports = {};
450
- $d20ec5c21f83badd$exports = JSON.parse("{\"loading\":\"正在載入\",\"loadingMore\":\"正在載入更多…\"}");
451
-
452
-
453
- $dc38f0b958ac5018$exports = {
454
- "ar-AE": $b0d49dbc72f937a2$exports,
455
- "bg-BG": $ce0dd82398fba411$exports,
456
- "cs-CZ": $1086444b40892e5d$exports,
457
- "da-DK": $26f9bd87c0446842$exports,
458
- "de-DE": $5922ace8d8eedc34$exports,
459
- "el-GR": $0dff680a5aaa08a6$exports,
460
- "en-US": $40f72ebe96160fe5$exports,
461
- "es-ES": $fd3d037364cca31d$exports,
462
- "et-EE": $aeb59a17c296301b$exports,
463
- "fi-FI": $8725562d6e87d608$exports,
464
- "fr-FR": $5b8a7cd61bd67f0d$exports,
465
- "he-IL": $904fdf1c66b8e1ae$exports,
466
- "hr-HR": $e321e496e49645f3$exports,
467
- "hu-HU": $5fb9f79f322fc149$exports,
468
- "it-IT": $87d8922713b63bdb$exports,
469
- "ja-JP": $57201e032f548603$exports,
470
- "ko-KR": $74aa6884e1ef4030$exports,
471
- "lt-LT": $50cefda6a03c058b$exports,
472
- "lv-LV": $3d08f75b6bbe5354$exports,
473
- "nb-NO": $c59f7b2f9755472b$exports,
474
- "nl-NL": $d81bf728da4b1c33$exports,
475
- "pl-PL": $f323a42ea1486c2f$exports,
476
- "pt-BR": $2b2937248d390105$exports,
477
- "pt-PT": $156cd72030936350$exports,
478
- "ro-RO": $5964cf64325251a3$exports,
479
- "ru-RU": $71b3c908be47dc7e$exports,
480
- "sk-SK": $815155759d865560$exports,
481
- "sl-SI": $d5deb2faae807da5$exports,
482
- "sr-SP": $42e52cb34b81b4af$exports,
483
- "sv-SE": $f278e5fd270ba60f$exports,
484
- "tr-TR": $523e0ad61eab5c5d$exports,
485
- "uk-UA": $a58cff5745fe89a6$exports,
486
- "zh-CN": $2c1c50c48e046fcb$exports,
487
- "zh-TW": $d20ec5c21f83badd$exports
488
- };
489
-
490
-
491
-
492
-
493
-
494
-
495
-
496
-
497
-
498
-
499
- function $514a55f6d91f25ef$var$CardView(props, ref) {
500
- let { scale: scale } = $jpY3B$reactspectrumprovider.useProvider();
501
- let { styleProps: styleProps } = $jpY3B$reactspectrumutils.useStyleProps(props);
502
- let domRef = $jpY3B$reactspectrumutils.useDOMRef(ref);
503
- let { isQuiet: isQuiet , renderEmptyState: renderEmptyState , layout: layout , loadingState: loadingState , onLoadMore: onLoadMore , cardOrientation: cardOrientation = 'vertical' } = props;
504
- let collator = $jpY3B$reactariai18n.useCollator({
505
- usage: 'search',
506
- sensitivity: 'base'
507
- });
508
- let isLoading = loadingState === 'loading' || loadingState === 'loadingMore';
509
- let cardViewLayout = $jpY3B$react.useMemo(()=>typeof layout === 'function' ? new layout({
510
- collator: collator,
511
- cardOrientation: cardOrientation,
512
- scale: scale
513
- }) : layout
514
- , [
515
- layout,
516
- collator,
517
- cardOrientation,
518
- scale
519
- ]);
520
- let layoutType = cardViewLayout.layoutType;
521
- let formatMessage = $jpY3B$reactariai18n.useMessageFormatter((/*@__PURE__*/$parcel$interopDefault($dc38f0b958ac5018$exports)));
522
- let { direction: direction } = $jpY3B$reactariai18n.useLocale();
523
- let { collection: collection } = $jpY3B$reactstatelylist.useListState(props);
524
- let gridCollection = $jpY3B$react.useMemo(()=>new $jpY3B$reactstatelygrid.GridCollection({
525
- columnCount: 1,
526
- items: [
527
- ...collection
528
- ].map((item)=>({
529
- // Makes the Grid row use the keys the user provides to the cards so that selection change via interactions returns the card keys
530
- ...item,
531
- hasChildNodes: true,
532
- childNodes: [
533
- {
534
- key: `cell-${item.key}`,
535
- type: 'cell',
536
- value: null,
537
- level: 0,
538
- rendered: null,
539
- textValue: item.textValue,
540
- hasChildNodes: false,
541
- childNodes: []
542
- }
543
- ]
544
- })
545
- )
546
- })
547
- , [
548
- collection
549
- ]);
550
- let state = $jpY3B$reactstatelygrid.useGridState({
551
- ...props,
552
- selectionMode: cardOrientation === 'horizontal' && layoutType === 'grid' ? 'none' : props.selectionMode,
553
- collection: gridCollection,
554
- focusMode: 'cell'
555
- });
556
- cardViewLayout.collection = gridCollection;
557
- cardViewLayout.disabledKeys = state.disabledKeys;
558
- cardViewLayout.isLoading = isLoading;
559
- cardViewLayout.direction = direction;
560
- let { gridProps: gridProps } = $jpY3B$reactariagrid.useGrid({
561
- ...props,
562
- isVirtualized: true,
563
- keyboardDelegate: cardViewLayout
564
- }, state, domRef);
565
- let renderWrapper = (parent, reusableView)=>/*#__PURE__*/ ($parcel$interopDefault($jpY3B$react)).createElement($jpY3B$reactariavirtualizer.VirtualizerItem, {
566
- key: reusableView.key,
567
- reusableView: reusableView,
568
- parent: parent
569
- })
570
- ;
571
- let focusedKey = state.selectionManager.focusedKey;
572
- let focusedItem = gridCollection.getItem(state.selectionManager.focusedKey);
573
- if ((focusedItem === null || focusedItem === void 0 ? void 0 : focusedItem.parentKey) != null) focusedKey = focusedItem.parentKey;
574
- let margin = cardViewLayout.margin || 0;
575
- let virtualizer = cardViewLayout.virtualizer;
576
- let scrollToItem = $jpY3B$react.useCallback((key)=>{
577
- virtualizer && virtualizer.scrollToItem(key, {
578
- duration: 0,
579
- offsetY: margin
580
- });
581
- }, [
582
- margin,
583
- virtualizer
584
- ]);
585
- // TODO: does aria-row count and aria-col count need to be modified? Perhaps aria-col count needs to be omitted
586
- return(/*#__PURE__*/ ($parcel$interopDefault($jpY3B$react)).createElement($e57ab98cef2f01a5$export$64992ac69f286e5c.Provider, {
587
- value: {
588
- state: state,
589
- isQuiet: isQuiet,
590
- layout: cardViewLayout,
591
- cardOrientation: cardOrientation
592
- }
593
- }, /*#__PURE__*/ ($parcel$interopDefault($jpY3B$react)).createElement($jpY3B$reactariavirtualizer.Virtualizer, {
594
- ...gridProps,
595
- ...styleProps,
596
- className: $jpY3B$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($71570f0038472fa2$exports)), 'spectrum-CardView'),
597
- ref: domRef,
598
- focusedKey: focusedKey,
599
- scrollDirection: "vertical",
600
- layout: cardViewLayout,
601
- collection: gridCollection,
602
- isLoading: isLoading,
603
- onLoadMore: onLoadMore,
604
- renderWrapper: renderWrapper,
605
- transitionDuration: isLoading ? 160 : 220,
606
- scrollToItem: scrollToItem
607
- }, (type, item)=>{
608
- if (type === 'item') return(/*#__PURE__*/ ($parcel$interopDefault($jpY3B$react)).createElement($514a55f6d91f25ef$var$InternalCard, {
609
- item: item
610
- }));
611
- else if (type === 'loader') return(/*#__PURE__*/ ($parcel$interopDefault($jpY3B$react)).createElement($514a55f6d91f25ef$var$CenteredWrapper, null, /*#__PURE__*/ ($parcel$interopDefault($jpY3B$react)).createElement($jpY3B$reactspectrumprogress.ProgressCircle, {
612
- isIndeterminate: true,
613
- "aria-label": state.collection.size > 0 ? formatMessage('loadingMore') : formatMessage('loading')
614
- })));
615
- else if (type === 'placeholder') {
616
- let emptyState = renderEmptyState ? renderEmptyState() : null;
617
- if (emptyState == null) return null;
618
- return(/*#__PURE__*/ ($parcel$interopDefault($jpY3B$react)).createElement($514a55f6d91f25ef$var$CenteredWrapper, null, emptyState));
619
- }
620
- })));
621
- }
622
- function $514a55f6d91f25ef$var$CenteredWrapper({ children: children }) {
623
- let { state: state } = $e57ab98cef2f01a5$export$fea0b38586ec8f13();
624
- return(/*#__PURE__*/ ($parcel$interopDefault($jpY3B$react)).createElement("div", {
625
- role: "row",
626
- "aria-rowindex": state.collection.size + 1,
627
- className: $jpY3B$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($71570f0038472fa2$exports)), 'spectrum-CardView-centeredWrapper')
628
- }, /*#__PURE__*/ ($parcel$interopDefault($jpY3B$react)).createElement("div", {
629
- role: "gridcell"
630
- }, children)));
631
- }
632
- function $514a55f6d91f25ef$var$InternalCard(props) {
633
- let { item: item } = props;
634
- let cellNode = [
635
- ...item.childNodes
636
- ][0];
637
- let { state: state , cardOrientation: cardOrientation , isQuiet: isQuiet , layout: layout } = $e57ab98cef2f01a5$export$fea0b38586ec8f13();
638
- let layoutType = layout.layoutType;
639
- let rowRef = $jpY3B$react.useRef();
640
- let cellRef = $jpY3B$react.useRef();
641
- let unwrappedRef = $jpY3B$reactspectrumutils.useUnwrapDOMRef(cellRef);
642
- let { rowProps: rowProps } = $jpY3B$reactariagrid.useGridRow({
643
- node: item,
644
- isVirtualized: true
645
- }, state, rowRef);
646
- let { gridCellProps: gridCellProps } = $jpY3B$reactariagrid.useGridCell({
647
- node: cellNode,
648
- focusMode: 'cell'
649
- }, state, unwrappedRef);
650
- if (layoutType === 'grid' || layoutType === 'gallery') isQuiet = true;
651
- if (layoutType !== 'grid') cardOrientation = 'vertical';
652
- // We don't want to focus the checkbox (or any other focusable elements) within the Card
653
- // when pressing the arrow keys so we delete the key down handler here. Arrow key navigation between
654
- // the cards in the CardView is handled by useGrid => useSelectableCollection instead.
655
- delete gridCellProps.onKeyDownCapture;
656
- return(/*#__PURE__*/ ($parcel$interopDefault($jpY3B$react)).createElement("div", {
657
- ...rowProps,
658
- ref: rowRef,
659
- className: $jpY3B$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($71570f0038472fa2$exports)), 'spectrum-CardView-row')
660
- }, /*#__PURE__*/ ($parcel$interopDefault($jpY3B$react)).createElement($7888205ff7de382f$export$7a6ccaf429ad93a8, {
661
- ref: cellRef,
662
- articleProps: gridCellProps,
663
- isQuiet: isQuiet,
664
- orientation: cardOrientation,
665
- item: item,
666
- layout: layoutType
667
- }, item.rendered)));
668
- }
669
- /**
670
- * TODO: Add description of component here.
671
- */ const $514a55f6d91f25ef$export$7e52c821f7b6f422 = /*#__PURE__*/ ($parcel$interopDefault($jpY3B$react)).forwardRef($514a55f6d91f25ef$var$CardView);
672
-
673
-
674
- var $8019a3d2c7d098ea$exports = {};
675
-
676
- $parcel$export($8019a3d2c7d098ea$exports, "GalleryLayout", () => $8019a3d2c7d098ea$export$8e52095834484b61);
677
-
678
- class $5ee605f09afaa4de$export$64943d2e59d72a29 extends $jpY3B$reactstatelyvirtualizer.Layout {
679
- validate(invalidationContext) {
680
- this.collection = this.virtualizer.collection;
681
- this.buildCollection(invalidationContext);
682
- // Remove layout info that doesn't exist in new collection
683
- if (this.lastCollection) {
684
- for (let key of this.lastCollection.getKeys())if (!this.collection.getItem(key)) this.layoutInfos.delete(key);
685
- if (!this.isLoading) this.layoutInfos.delete('loader');
686
- if (this.collection.size > 0) this.layoutInfos.delete('placeholder');
687
- }
688
- this.lastCollection = this.collection;
689
- }
690
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
691
- buildCollection(invalidationContext) {
692
- }
693
- getContentSize() {
694
- return this.contentSize;
695
- }
696
- getLayoutInfo(key) {
697
- return this.layoutInfos.get(key);
698
- }
699
- getVisibleLayoutInfos(rect) {
700
- let res = [];
701
- for (let layoutInfo of this.layoutInfos.values())if (this.isVisible(layoutInfo, rect)) res.push(layoutInfo);
702
- return res;
703
- }
704
- isVisible(layoutInfo, rect) {
705
- return layoutInfo.rect.intersects(rect);
706
- }
707
- getInitialLayoutInfo(layoutInfo) {
708
- layoutInfo.opacity = 0;
709
- layoutInfo.transform = 'scale3d(0.8, 0.8, 0.8)';
710
- return layoutInfo;
711
- }
712
- getFinalLayoutInfo(layoutInfo) {
713
- layoutInfo.opacity = 0;
714
- layoutInfo.transform = 'scale3d(0.8, 0.8, 0.8)';
715
- return layoutInfo;
716
- }
717
- _findClosestLayoutInfo(target, rect) {
718
- let layoutInfos = this.getVisibleLayoutInfos(rect);
719
- let best = null;
720
- let bestDistance = Infinity;
721
- // Calculates distance as the distance between the center of 2 rects.
722
- for (let cur of layoutInfos)if (cur.type === 'item') {
723
- let curRect = cur.rect;
724
- let targetMidX = (target.x + target.maxX) / 2;
725
- let targetMidY = (target.y + target.maxY) / 2;
726
- let curMidX = (curRect.x + curRect.maxX) / 2;
727
- let curMidY = (curRect.y + curRect.maxY) / 2;
728
- let dist = Math.pow(targetMidX - curMidX, 2) + Math.pow(targetMidY - curMidY, 2);
729
- if (dist < bestDistance) {
730
- best = cur;
731
- bestDistance = dist;
732
- }
733
- }
734
- return best;
735
- }
736
- _findClosest(target, rect) {
737
- let best = this._findClosestLayoutInfo(target, rect);
738
- return best || null;
739
- }
740
- getKeyBelow(key) {
741
- var ref, ref1;
742
- // Expected key is the currently focused cell so we need the parent row key
743
- let parentRowKey = this.collection.getItem(key).parentKey;
744
- let layoutInfo = this.getLayoutInfo(parentRowKey);
745
- let rect = new $jpY3B$reactstatelyvirtualizer.Rect(layoutInfo.rect.x, layoutInfo.rect.maxY + 1, layoutInfo.rect.width, this.virtualizer.visibleRect.height);
746
- let closestRow = this.collection.getItem((ref = this._findClosest(layoutInfo.rect, rect)) === null || ref === void 0 ? void 0 : ref.key);
747
- return (ref1 = closestRow === null || closestRow === void 0 ? void 0 : closestRow.childNodes[0]) === null || ref1 === void 0 ? void 0 : ref1.key;
748
- }
749
- getKeyAbove(key) {
750
- var ref, ref2;
751
- // Expected key is the currently focused cell so we need the parent row key
752
- let parentRowKey = this.collection.getItem(key).parentKey;
753
- let layoutInfo = this.getLayoutInfo(parentRowKey);
754
- let rect = new $jpY3B$reactstatelyvirtualizer.Rect(layoutInfo.rect.x, 0, layoutInfo.rect.width, layoutInfo.rect.y - 1);
755
- let closestRow = this.collection.getItem((ref = this._findClosest(layoutInfo.rect, rect)) === null || ref === void 0 ? void 0 : ref.key);
756
- return (ref2 = closestRow === null || closestRow === void 0 ? void 0 : closestRow.childNodes[0]) === null || ref2 === void 0 ? void 0 : ref2.key;
757
- }
758
- getKeyRightOf(key) {
759
- // Expected key is the currently focused cell so we need the parent row key
760
- let parentRowKey = this.collection.getItem(key).parentKey;
761
- key = this.direction === 'rtl' ? this.collection.getKeyBefore(parentRowKey) : this.collection.getKeyAfter(parentRowKey);
762
- while(key != null){
763
- let item = this.collection.getItem(key);
764
- // Don't check if item is disabled because we want to be able to focus disabled items in a grid (double check this)
765
- if (item.type === 'item') return item.childNodes[0].key;
766
- key = this.direction === 'rtl' ? this.collection.getKeyBefore(key) : this.collection.getKeyAfter(key);
767
- }
768
- }
769
- getKeyLeftOf(key) {
770
- // Expected key is the currently focused cell so we need the parent row key
771
- let parentRowKey = this.collection.getItem(key).parentKey;
772
- key = this.direction === 'rtl' ? this.collection.getKeyAfter(parentRowKey) : this.collection.getKeyBefore(parentRowKey);
773
- while(key != null){
774
- let item = this.collection.getItem(key);
775
- // Don't check if item is disabled because we want to be able to focus disabled items in a grid (double check this)
776
- if (item.type === 'item') return item.childNodes[0].key;
777
- key = this.direction === 'rtl' ? this.collection.getKeyAfter(key) : this.collection.getKeyBefore(key);
778
- }
779
- }
780
- getFirstKey() {
781
- let firstRow = this.collection.getItem(this.collection.getFirstKey());
782
- return firstRow.childNodes[0].key;
783
- }
784
- getLastKey() {
785
- let lastRow = this.collection.getItem(this.collection.getLastKey());
786
- return lastRow.childNodes[0].key;
787
- }
788
- // TODO: pretty unwieldy because it needs to bounce back and forth between the parent key and the child key
789
- // 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?
790
- getKeyPageAbove(key) {
791
- // Expected key is the currently focused cell so we need the parent row key
792
- let parentRowKey = this.collection.getItem(key).parentKey;
793
- let layoutInfo = this.getLayoutInfo(parentRowKey);
794
- if (layoutInfo) {
795
- var ref;
796
- let pageY = Math.max(0, layoutInfo.rect.y + layoutInfo.rect.height - this.virtualizer.visibleRect.height);
797
- // If the node is so large that it spans multiple page heights, return the key of the item immediately above
798
- // Otherwise keep going up until we exceed a single page height worth of nodes
799
- let keyAbove = (ref = this.collection.getItem(this.getKeyAbove(key))) === null || ref === void 0 ? void 0 : ref.parentKey;
800
- layoutInfo = this.getLayoutInfo(keyAbove);
801
- if (layoutInfo && layoutInfo.rect.y > pageY) while(layoutInfo && layoutInfo.rect.y > pageY){
802
- var ref3;
803
- let childKey = this.collection.getItem(layoutInfo.key).childNodes[0].key;
804
- let keyAbove = (ref3 = this.collection.getItem(this.getKeyAbove(childKey))) === null || ref3 === void 0 ? void 0 : ref3.parentKey;
805
- layoutInfo = this.getLayoutInfo(keyAbove);
806
- }
807
- if (layoutInfo) {
808
- let childKey = this.collection.getItem(layoutInfo.key).childNodes[0].key;
809
- return childKey;
810
- }
811
- }
812
- return this.getFirstKey();
813
- }
814
- // TODO: pretty unwieldy because it needs to bounce back and forth between the parent key and the child key
815
- // Perhaps have layoutInfo store childKey as well so we don't need to do this?
816
- getKeyPageBelow(key) {
817
- // Expected key is the currently focused cell so we need the parent row key
818
- let parentRowKey = this.collection.getItem(key).parentKey;
819
- let layoutInfo = this.getLayoutInfo(parentRowKey);
820
- if (layoutInfo) {
821
- var ref;
822
- let pageY = Math.min(this.virtualizer.contentSize.height, layoutInfo.rect.y - layoutInfo.rect.height + this.virtualizer.visibleRect.height);
823
- // If the node is so large that it spans multiple page heights, return the key of the item immediately below
824
- // Otherwise keep going up until we exceed a single page height worth of nodes
825
- let keyBelow = (ref = this.collection.getItem(this.getKeyBelow(key))) === null || ref === void 0 ? void 0 : ref.parentKey;
826
- layoutInfo = this.getLayoutInfo(keyBelow);
827
- if (layoutInfo && layoutInfo.rect.y < pageY) while(layoutInfo && layoutInfo.rect.y < pageY){
828
- var ref4;
829
- let childKey = this.collection.getItem(layoutInfo.key).childNodes[0].key;
830
- let keyBelow = (ref4 = this.collection.getItem(this.getKeyBelow(childKey))) === null || ref4 === void 0 ? void 0 : ref4.parentKey;
831
- layoutInfo = this.getLayoutInfo(keyBelow);
832
- }
833
- if (layoutInfo) {
834
- let childKey = this.collection.getItem(layoutInfo.key).childNodes[0].key;
835
- return childKey;
836
- }
837
- }
838
- return this.getLastKey();
839
- }
840
- getKeyForSearch(search, fromKey) {
841
- if (!this.collator) return null;
842
- let collection = this.collection;
843
- let key = fromKey !== null && fromKey !== void 0 ? fromKey : this.getFirstKey();
844
- let startItem = collection.getItem(key);
845
- key = startItem.parentKey;
846
- while(key != null){
847
- let item = collection.getItem(key);
848
- if (item.textValue) {
849
- let substring = item.textValue.slice(0, search.length);
850
- if (this.collator.compare(substring, search) === 0) return [
851
- ...item.childNodes
852
- ][0].key;
853
- }
854
- key = this.collection.getKeyAfter(key);
855
- }
856
- return null;
857
- }
858
- constructor(options = {
859
- }){
860
- super();
861
- this.disabledKeys = new Set();
862
- this.layoutInfos = new Map();
863
- this.collator = options.collator;
864
- this.lastCollection = null;
865
- this.scale = options.scale || 'medium';
866
- this.margin = options.margin || 24;
867
- }
868
- }
869
-
870
-
871
-
872
- const $8019a3d2c7d098ea$var$DEFAULT_OPTIONS = {
873
- S: {
874
- idealRowHeight: 112,
875
- minItemSize: new $jpY3B$reactstatelyvirtualizer.Size(96, 96),
876
- itemSpacing: new $jpY3B$reactstatelyvirtualizer.Size(8, 16),
877
- itemPadding: 24,
878
- dropSpacing: 50,
879
- margin: 8
880
- },
881
- L: {
882
- idealRowHeight: 208,
883
- minItemSize: new $jpY3B$reactstatelyvirtualizer.Size(136, 136),
884
- itemSpacing: new $jpY3B$reactstatelyvirtualizer.Size(18, 18),
885
- itemPadding: {
886
- 'medium': 78,
887
- 'large': 99
888
- },
889
- dropSpacing: 100,
890
- margin: 24
891
- }
892
- };
893
- class $8019a3d2c7d098ea$export$8e52095834484b61 extends $5ee605f09afaa4de$export$64943d2e59d72a29 {
894
- get layoutType() {
895
- return 'gallery';
896
- }
897
- /**
898
- * Takes a row of widths and if there are any widths smaller than the min-width, leech width starting from
899
- * the widest in the row until it can't give anymore, then move to the second widest and so forth.
900
- * Do this until all assets meet the min-width.
901
- * */ _distributeWidths(widths) {
902
- // create a copy of the widths array and sort it largest to smallest
903
- let sortedWidths = widths.concat().sort((a, b)=>a[1] > b[1] ? -1 : 1
904
- );
905
- for (let width of widths)// for each width, if it's smaller than the min width
906
- if (width[1] < this.minItemSize.width) {
907
- // then figure out how much smaller
908
- let delta = this.minItemSize.width - width[1];
909
- for (let item of sortedWidths)// go from the largest width in the row to the smallest
910
- // if the width is greater than the min width
911
- if (widths[item[0]][1] > this.minItemSize.width) {
912
- // subtract the delta from the width, if it's still greater than the min width
913
- // then we have finished, subtract the delta permanently from that width
914
- if (widths[item[0]][1] - delta > this.minItemSize.width) {
915
- widths[item[0]][1] -= delta;
916
- delta = 0;
917
- break;
918
- } else {
919
- // otherwise, we take as much as we can from the current width and then move on to
920
- // the next largest and take some width from it
921
- let maxChange = widths[item[0]][1] - this.minItemSize.width;
922
- delta -= maxChange;
923
- widths[item[0]][1] -= maxChange;
924
- }
925
- }
926
- if (delta > 0) return false;
927
- // force the width to be the min width that we just rebalanced for
928
- width[1] = this.minItemSize.width;
929
- }
930
- return true;
931
- }
932
- buildCollection() {
933
- let visibleWidth = this.virtualizer.visibleRect.width;
934
- let visibleHeight = this.virtualizer.visibleRect.height;
935
- let y = this.margin;
936
- let availableWidth = visibleWidth - this.margin * 2;
937
- // If avaliable width is not greater than 0, skip node layout calculations
938
- if (availableWidth > 0) {
939
- // Compute aspect ratios for all of the items, and the total width if all items were on in a single row.
940
- let ratios = [];
941
- let totalWidth = 0;
942
- let minRatio = this.minItemSize.width / this.minItemSize.height;
943
- let maxRatio = availableWidth / this.minItemSize.height;
944
- for (let node of this.collection){
945
- let ratio = node.props.width / node.props.height;
946
- if (ratio < minRatio) ratio = minRatio;
947
- else if (ratio > maxRatio && ratio !== minRatio) ratio = maxRatio;
948
- let itemWidth = ratio * this.minItemSize.height;
949
- ratios.push(ratio);
950
- totalWidth += itemWidth;
951
- }
952
- totalWidth += this.itemSpacing.width * (this.collection.size - 1);
953
- // Determine how many rows we'll need, and partition the items into rows
954
- // using the aspect ratios as weights.
955
- let rows = Math.max(1, Math.ceil(totalWidth / availableWidth));
956
- // if the available width can't hold two items, then every item will get its own row
957
- // this leads to a faster run through linear partition and more dependable output for small row widths
958
- if (availableWidth <= this.minItemSize.width * 2 + this.itemPadding * 2) rows = this.collection.size;
959
- let weightedRatios = ratios.map((ratio)=>ratio < this.threshold ? ratio + 0.5 * (1 / ratio) : ratio
960
- );
961
- let partition = $8019a3d2c7d098ea$var$linearPartition(weightedRatios, rows);
962
- let index = 0;
963
- for (let row of partition){
964
- // Compute the total weight for this row
965
- let totalWeight = 0;
966
- for(let j = index; j < index + row.length; j++)totalWeight += ratios[j];
967
- // Determine the row height based on the total available width and weight of this row.
968
- let bestRowHeight = (availableWidth - (row.length - 1) * this.itemSpacing.width) / totalWeight;
969
- // if this is the last row and the row height is >2x the ideal row height, then cap to the ideal height
970
- // probably doing this because if the last row has one extremely tall image, then the row becomes huge
971
- // though that can happen anywhere if a row has lots of tall images... so i'm not sure why this one matters
972
- if (row === partition[partition.length - 1] && bestRowHeight > this.idealRowHeight * 2) bestRowHeight = this.idealRowHeight;
973
- let itemHeight = Math.round(bestRowHeight) + this.itemPadding;
974
- let x = this.margin;
975
- // if any items are going to end up too small, add a bit of width to them and subtract it from wider objects
976
- let widths = [];
977
- for(let j1 = index; j1 < index + row.length; j1++){
978
- let width = Math.round(bestRowHeight * ratios[j1]);
979
- widths.push([
980
- j1 - index,
981
- width
982
- ]);
983
- }
984
- this._distributeWidths(widths);
985
- // Create items for this row.
986
- for(let j2 = index; j2 < index + row.length; j2++){
987
- let node = this.collection.rows[j2];
988
- let itemWidth = Math.max(widths[j2 - index][1], this.minItemSize.width);
989
- let rect = new $jpY3B$reactstatelyvirtualizer.Rect(x, y, itemWidth, itemHeight);
990
- let layoutInfo = new $jpY3B$reactstatelyvirtualizer.LayoutInfo(node.type, node.key, rect);
991
- layoutInfo.allowOverflow = true;
992
- this.layoutInfos.set(node.key, layoutInfo);
993
- x += itemWidth + this.itemSpacing.width;
994
- }
995
- y += itemHeight + this.itemSpacing.height;
996
- index += row.length;
997
- }
998
- if (this.isLoading) {
999
- let loaderY = y;
1000
- let loaderHeight = 60;
1001
- // If there aren't any items, make loader take all avaliable room and remove margin from y calculation
1002
- // so it doesn't scroll
1003
- if (this.collection.size === 0) {
1004
- loaderY = 0;
1005
- loaderHeight = visibleHeight || 60;
1006
- }
1007
- let rect = new $jpY3B$reactstatelyvirtualizer.Rect(0, loaderY, visibleWidth, loaderHeight);
1008
- let loader = new $jpY3B$reactstatelyvirtualizer.LayoutInfo('loader', 'loader', rect);
1009
- this.layoutInfos.set('loader', loader);
1010
- y = loader.rect.maxY;
1011
- }
1012
- if (this.collection.size === 0 && !this.isLoading) {
1013
- let rect = new $jpY3B$reactstatelyvirtualizer.Rect(0, 0, visibleWidth, visibleHeight);
1014
- let placeholder = new $jpY3B$reactstatelyvirtualizer.LayoutInfo('placeholder', 'placeholder', rect);
1015
- this.layoutInfos.set('placeholder', placeholder);
1016
- y = placeholder.rect.maxY;
1017
- }
1018
- }
1019
- this.contentSize = new $jpY3B$reactstatelyvirtualizer.Size(visibleWidth, y);
1020
- }
1021
- constructor(options = {
1022
- }){
1023
- super(options);
1024
- let cardSize = 'L';
1025
- this.idealRowHeight = options.idealRowHeight || $8019a3d2c7d098ea$var$DEFAULT_OPTIONS[cardSize].idealRowHeight;
1026
- this.itemSpacing = options.itemSpacing || $8019a3d2c7d098ea$var$DEFAULT_OPTIONS[cardSize].itemSpacing;
1027
- this.itemPadding = options.itemPadding != null ? options.itemPadding : $8019a3d2c7d098ea$var$DEFAULT_OPTIONS[cardSize].itemPadding[this.scale];
1028
- this.minItemSize = options.minItemSize || $8019a3d2c7d098ea$var$DEFAULT_OPTIONS[cardSize].minItemSize;
1029
- this.threshold = options.threshold || 1;
1030
- this.margin = options.margin != null ? options.margin : $8019a3d2c7d098ea$var$DEFAULT_OPTIONS[cardSize].margin;
1031
- }
1032
- }
1033
- // https://www8.cs.umu.se/kurser/TDBA77/VT06/algorithms/BOOK/BOOK2/NODE45.HTM
1034
- function $8019a3d2c7d098ea$var$linearPartition(seq, k) {
1035
- let n = seq.length;
1036
- if (k <= 0) return [];
1037
- if (k >= n) return seq.map((x)=>[
1038
- x
1039
- ]
1040
- );
1041
- if (n === 1) return [
1042
- seq
1043
- ];
1044
- let table = Array(n).fill(0).map(()=>Array(k).fill(0)
1045
- );
1046
- let solution = Array(n - 1).fill(0).map(()=>Array(k - 1).fill(0)
1047
- );
1048
- for(let i = 0; i < n; i++)table[i][0] = seq[i] + (i > 0 ? table[i - 1][0] : 0);
1049
- for(let i1 = 0; i1 < k; i1++)table[0][i1] = seq[0];
1050
- for(let i2 = 1; i2 < n; i2++)for(let j = 1; j < k; j++){
1051
- let currentMin = 0;
1052
- let minX = Infinity;
1053
- for(let x = 0; x < i2; x++){
1054
- let c1 = table[x][j - 1];
1055
- let c2 = table[i2][0] - table[x][0];
1056
- let cost = Math.max(c1, c2);
1057
- if (!x || cost < currentMin) {
1058
- currentMin = cost;
1059
- minX = x;
1060
- }
1061
- }
1062
- table[i2][j] = currentMin;
1063
- solution[i2 - 1][j - 1] = minX;
1064
- }
1065
- n = n - 1;
1066
- k = k - 2;
1067
- let result = [];
1068
- while(k >= 0){
1069
- if (n >= 1) {
1070
- let row = [];
1071
- for(let i = solution[n - 1][k] + 1; i < n + 1; i++)row.push(seq[i]);
1072
- result.unshift(row);
1073
- n = solution[n - 1][k];
1074
- }
1075
- k--;
1076
- }
1077
- let row = [];
1078
- for(let i3 = 0; i3 < n + 1; i3++)row.push(seq[i3]);
1079
- result.unshift(row);
1080
- return result;
1081
- }
1082
-
1083
-
1084
- var $71b727f94b595b1a$exports = {};
1085
-
1086
- $parcel$export($71b727f94b595b1a$exports, "GridLayout", () => $71b727f94b595b1a$export$7d2b12578154a735);
1087
-
1088
-
1089
- const $71b727f94b595b1a$var$DEFAULT_OPTIONS = {
1090
- S: {
1091
- itemPadding: 20,
1092
- minItemSize: {
1093
- 'vertical': new $jpY3B$reactstatelyvirtualizer.Size(96, 96)
1094
- },
1095
- maxItemSize: new $jpY3B$reactstatelyvirtualizer.Size(Infinity, Infinity),
1096
- margin: 8,
1097
- minSpace: new $jpY3B$reactstatelyvirtualizer.Size(6, 6),
1098
- maxColumns: Infinity,
1099
- dropSpacing: 50
1100
- },
1101
- L: {
1102
- itemPadding: {
1103
- 'vertical': {
1104
- 'medium': 78,
1105
- 'large': 98
1106
- },
1107
- 'horizontal': {
1108
- 'medium': 150,
1109
- 'large': 170
1110
- }
1111
- },
1112
- minItemSize: {
1113
- 'vertical': new $jpY3B$reactstatelyvirtualizer.Size(208, 208),
1114
- 'horizontal': new $jpY3B$reactstatelyvirtualizer.Size(102, 102)
1115
- },
1116
- maxItemSize: new $jpY3B$reactstatelyvirtualizer.Size(Infinity, Infinity),
1117
- margin: 24,
1118
- minSpace: new $jpY3B$reactstatelyvirtualizer.Size(18, 18),
1119
- maxColumns: Infinity,
1120
- dropSpacing: 100
1121
- }
1122
- };
1123
- class $71b727f94b595b1a$export$7d2b12578154a735 extends $5ee605f09afaa4de$export$64943d2e59d72a29 {
1124
- get layoutType() {
1125
- return 'grid';
1126
- }
1127
- getIndexAtPoint(x, y, allowInsertingAtEnd = false) {
1128
- let itemHeight = this.itemSize.height + this.minSpace.height;
1129
- let itemWidth = this.itemSize.width + this.horizontalSpacing;
1130
- return Math.max(0, Math.min(this.collection.size - (allowInsertingAtEnd ? 0 : 1), Math.floor(y / itemHeight) * this.numColumns + Math.floor((x - this.horizontalSpacing) / itemWidth)));
1131
- }
1132
- getVisibleLayoutInfos(rect) {
1133
- let res = [];
1134
- let numItems = this.collection.size;
1135
- if (numItems <= 0 || !this.itemSize) // If there aren't any items in the collection, we are in a loader/placeholder state. Return those layoutInfos as
1136
- // the currently visible items
1137
- {
1138
- if (this.layoutInfos.size > 0) {
1139
- for (let layoutInfo of this.layoutInfos.values())if (this.isVisible(layoutInfo, rect)) res.push(layoutInfo);
1140
- }
1141
- } else {
1142
- // The approach from v2 uses indexes where other v3 layouts iterate through every node/root node. This feels more efficient
1143
- let firstVisibleItem = this.getIndexAtPoint(rect.x, rect.y);
1144
- let lastVisibleItem = this.getIndexAtPoint(rect.maxX, rect.maxY);
1145
- for(let index = firstVisibleItem; index <= lastVisibleItem; index++){
1146
- let keyFromIndex = this.collection.rows[index].key;
1147
- let layoutInfo = this.layoutInfos.get(keyFromIndex);
1148
- if (layoutInfo && this.isVisible(layoutInfo, rect)) res.push(layoutInfo);
1149
- }
1150
- // Check if loader is in view and add to res if so
1151
- let loader = this.layoutInfos.get('loader');
1152
- if (loader && this.isVisible(loader, rect)) res.push(loader);
1153
- }
1154
- return res;
1155
- }
1156
- buildCollection() {
1157
- let visibleWidth = this.virtualizer.visibleRect.width;
1158
- let visibleHeight = this.virtualizer.visibleRect.height;
1159
- let horizontalItemPadding = this.cardOrientation === 'horizontal' ? this.itemPadding : 0;
1160
- let verticalItemPadding = this.cardOrientation === 'vertical' ? this.itemPadding : 0;
1161
- let minCardWidth = this.minItemSize.width + horizontalItemPadding;
1162
- // Compute the number of rows and columns needed to display the content
1163
- let availableWidth = visibleWidth - this.margin * 2;
1164
- let columns = Math.floor((availableWidth + this.minSpace.width) / (minCardWidth + this.minSpace.width));
1165
- this.numColumns = Math.max(1, Math.min(this.maxColumns, columns));
1166
- this.numRows = Math.ceil(this.collection.size / this.numColumns);
1167
- // Compute the available width (minus the space between items)
1168
- let width = availableWidth - this.minSpace.width * Math.max(0, this.numColumns - 1);
1169
- // Compute the item width based on the space available
1170
- let itemWidth = Math.floor(width / this.numColumns);
1171
- itemWidth = Math.max(minCardWidth, Math.min(this.maxItemSize.width, itemWidth));
1172
- // Compute the item height, which is proportional to the item width
1173
- let t = (itemWidth - minCardWidth) / minCardWidth;
1174
- let itemHeight = Math.floor(this.minItemSize.height + this.minItemSize.height * t);
1175
- itemHeight = Math.max(this.minItemSize.height, Math.min(this.maxItemSize.height, itemHeight)) + verticalItemPadding;
1176
- this.itemSize = new $jpY3B$reactstatelyvirtualizer.Size(itemWidth, itemHeight);
1177
- // Compute the horizontal spacing and content height
1178
- this.horizontalSpacing = this.numColumns < 2 ? 0 : Math.floor((availableWidth - this.numColumns * this.itemSize.width) / (this.numColumns - 1));
1179
- let y = this.margin;
1180
- let index = 0;
1181
- for (let node of this.collection){
1182
- let layoutInfo = this.buildChild(node, y, index);
1183
- y = layoutInfo.rect.maxY;
1184
- index++;
1185
- }
1186
- if (this.isLoading) {
1187
- let loaderY = y;
1188
- let loaderHeight = 60;
1189
- // If there aren't any items, make loader take all avaliable room and remove margin from y calculation
1190
- // so it doesn't scroll
1191
- if (this.collection.size === 0) {
1192
- loaderY = 0;
1193
- loaderHeight = visibleHeight || 60;
1194
- }
1195
- let rect = new $jpY3B$reactstatelyvirtualizer.Rect(0, loaderY, visibleWidth, loaderHeight);
1196
- let loader = new $jpY3B$reactstatelyvirtualizer.LayoutInfo('loader', 'loader', rect);
1197
- this.layoutInfos.set('loader', loader);
1198
- y = loader.rect.maxY;
1199
- }
1200
- if (this.collection.size === 0 && !this.isLoading) {
1201
- let rect = new $jpY3B$reactstatelyvirtualizer.Rect(0, 0, visibleWidth, visibleHeight);
1202
- let placeholder = new $jpY3B$reactstatelyvirtualizer.LayoutInfo('placeholder', 'placeholder', rect);
1203
- this.layoutInfos.set('placeholder', placeholder);
1204
- y = placeholder.rect.maxY;
1205
- }
1206
- this.contentSize = new $jpY3B$reactstatelyvirtualizer.Size(visibleWidth, y);
1207
- }
1208
- buildChild(node, y, index) {
1209
- let row = Math.floor(index / this.numColumns);
1210
- let column = index % this.numColumns;
1211
- let x = this.margin + column * (this.itemSize.width + this.horizontalSpacing);
1212
- y = this.margin + row * (this.itemSize.height + this.minSpace.height);
1213
- let rect = new $jpY3B$reactstatelyvirtualizer.Rect(x, y, this.itemSize.width, this.itemSize.height);
1214
- // TODO: Perhaps have it so that the child key for each row is stored with the layoutInfo?
1215
- let layoutInfo = new $jpY3B$reactstatelyvirtualizer.LayoutInfo(node.type, node.key, rect);
1216
- layoutInfo.allowOverflow = true;
1217
- this.layoutInfos.set(node.key, layoutInfo);
1218
- return layoutInfo;
1219
- }
1220
- // Since the collection doesn't represent the visual layout, need to calculate what row and column the current key is in,
1221
- // then return the key that occupies the row + column below. This can be done by figuring out how many cards exist per column then dividing the
1222
- // collection contents by that number (which will give us the row distribution)
1223
- getKeyBelow(key) {
1224
- var ref;
1225
- // Expected key is the currently focused cell so we need the parent row key
1226
- let parentRowKey = this.collection.getItem(key).parentKey;
1227
- let indexRowBelow;
1228
- let index = this.collection.rows.findIndex((card)=>card.key === parentRowKey
1229
- );
1230
- if (index !== -1) indexRowBelow = index + this.numColumns;
1231
- else return null;
1232
- return ((ref = this.collection.rows[indexRowBelow]) === null || ref === void 0 ? void 0 : ref.childNodes[0].key) || null;
1233
- }
1234
- getKeyAbove(key) {
1235
- var ref;
1236
- // Expected key is the currently focused cell so we need the parent row key
1237
- let parentRowKey = this.collection.getItem(key).parentKey;
1238
- let indexRowAbove;
1239
- let index = this.collection.rows.findIndex((card)=>card.key === parentRowKey
1240
- );
1241
- if (index !== -1) indexRowAbove = index - this.numColumns;
1242
- else return null;
1243
- return ((ref = this.collection.rows[indexRowAbove]) === null || ref === void 0 ? void 0 : ref.childNodes[0].key) || null;
1244
- }
1245
- constructor(options = {
1246
- }){
1247
- super(options);
1248
- let cardSize = 'L';
1249
- this.cardOrientation = options.cardOrientation || 'vertical';
1250
- this.minItemSize = options.minItemSize || $71b727f94b595b1a$var$DEFAULT_OPTIONS[cardSize].minItemSize[this.cardOrientation];
1251
- this.maxItemSize = options.maxItemSize || $71b727f94b595b1a$var$DEFAULT_OPTIONS[cardSize].maxItemSize;
1252
- this.margin = options.margin != null ? options.margin : $71b727f94b595b1a$var$DEFAULT_OPTIONS[cardSize].margin;
1253
- this.minSpace = options.minSpace || $71b727f94b595b1a$var$DEFAULT_OPTIONS[cardSize].minSpace;
1254
- this.maxColumns = options.maxColumns || $71b727f94b595b1a$var$DEFAULT_OPTIONS[cardSize].maxColumns;
1255
- this.itemPadding = options.itemPadding != null ? options.itemPadding : $71b727f94b595b1a$var$DEFAULT_OPTIONS[cardSize].itemPadding[this.cardOrientation][this.scale];
1256
- this.itemSize = null;
1257
- this.numColumns = 0;
1258
- this.numRows = 0;
1259
- this.horizontalSpacing = 0;
1260
- }
1261
- }
1262
-
1263
-
1264
- var $632abf8fbf0ad57b$exports = {};
1265
-
1266
- $parcel$export($632abf8fbf0ad57b$exports, "WaterfallLayout", () => $632abf8fbf0ad57b$export$e9f7cda058ba8df8);
1267
-
1268
-
1269
- class $632abf8fbf0ad57b$export$e9f7cda058ba8df8 extends $5ee605f09afaa4de$export$64943d2e59d72a29 {
1270
- get layoutType() {
1271
- return 'waterfall';
1272
- }
1273
- buildCollection(invalidationContext) {
1274
- // Compute the number of columns needed to display the content
1275
- let visibleWidth = this.virtualizer.visibleRect.width;
1276
- let availableWidth = visibleWidth - this.margin * 2;
1277
- let columns = Math.floor((availableWidth + this.minSpace.width) / (this.minItemSize.width + this.minSpace.width));
1278
- this.numColumns = Math.max(1, Math.min(this.maxColumns, columns));
1279
- // Compute the available width (minus the space between items)
1280
- let width = availableWidth - this.minSpace.width * (this.numColumns - 1);
1281
- // Compute the item width based on the space available
1282
- let itemWidth = Math.round(width / this.numColumns);
1283
- itemWidth = Math.max(this.minItemSize.width, Math.min(this.maxItemSize.width, itemWidth));
1284
- this.itemWidth = itemWidth;
1285
- // Compute the horizontal spacing
1286
- // if only one column, we cannot divide by zero, so set it to 1
1287
- let horizontalSpacing = Math.round((availableWidth - this.numColumns * itemWidth) / Math.max(1, this.numColumns - 1));
1288
- this.horizontalSpacing = horizontalSpacing;
1289
- // Setup an array of column heights
1290
- let columnHeights = Array(this.numColumns).fill(this.margin);
1291
- for (let node of this.collection){
1292
- let key = node.key;
1293
- // Compute the height of the item. Use the existing height if available,
1294
- // otherwise call the delegate to estimate the size.
1295
- let oldLayoutInfo = this.layoutInfos.get(key);
1296
- let height;
1297
- let estimatedSize = true;
1298
- if (oldLayoutInfo) {
1299
- height = oldLayoutInfo.rect.height;
1300
- estimatedSize = invalidationContext.sizeChanged || oldLayoutInfo.estimatedSize;
1301
- } else if (node.props.width && node.props.height) {
1302
- let nodeWidth = node.props.width;
1303
- let nodeHeight = node.props.height;
1304
- let scaledHeight = Math.round(nodeHeight * (itemWidth / nodeWidth));
1305
- height = Math.max(this.minItemSize.height, Math.min(this.maxItemSize.height, scaledHeight));
1306
- } else height = itemWidth;
1307
- // Figure out which column to place the item in, and compute its position.
1308
- let column = this.getNextColumnIndex(columnHeights);
1309
- let x = this.margin + column * (itemWidth + horizontalSpacing);
1310
- let y = columnHeights[column];
1311
- let rect = new $jpY3B$reactstatelyvirtualizer.Rect(x, y, itemWidth, height);
1312
- let layoutInfo = new $jpY3B$reactstatelyvirtualizer.LayoutInfo(node.type, key, rect);
1313
- layoutInfo.estimatedSize = estimatedSize;
1314
- layoutInfo.allowOverflow = true;
1315
- this.layoutInfos.set(key, layoutInfo);
1316
- // TODO: From v2 figure out this bit, when does this get called and what to replace this.collectionView._transaction with?
1317
- // Removing it from v2 doesn't seem to do anything?
1318
- // if (layoutInfo.estimatedSize && !invalidationContext.contentChanged && !this.collectionView._transaction) {
1319
- // this.updateItemSize(new IndexPath(section, i));
1320
- // }
1321
- columnHeights[column] += layoutInfo.rect.height + this.minSpace.height;
1322
- }
1323
- // Reset all columns to the maximum for the next section
1324
- let maxHeight = Math.max.apply(Math, columnHeights) - this.minSpace.height + this.margin;
1325
- columnHeights.fill(maxHeight);
1326
- let y = columnHeights[0];
1327
- if (this.isLoading) {
1328
- let loaderY = y;
1329
- let loaderHeight = 60;
1330
- // If there aren't any items, make loader take all avaliable room and remove margin from y calculation
1331
- // so it doesn't scroll
1332
- if (this.collection.size === 0) {
1333
- loaderY = 0;
1334
- loaderHeight = this.virtualizer.visibleRect.height || 60;
1335
- }
1336
- let rect = new $jpY3B$reactstatelyvirtualizer.Rect(0, loaderY, this.virtualizer.visibleRect.width, loaderHeight);
1337
- let loader = new $jpY3B$reactstatelyvirtualizer.LayoutInfo('loader', 'loader', rect);
1338
- this.layoutInfos.set('loader', loader);
1339
- y = loader.rect.maxY;
1340
- }
1341
- if (this.collection.size === 0 && !this.isLoading) {
1342
- let rect = new $jpY3B$reactstatelyvirtualizer.Rect(0, 0, this.virtualizer.visibleRect.width, this.virtualizer.visibleRect.height);
1343
- let placeholder = new $jpY3B$reactstatelyvirtualizer.LayoutInfo('placeholder', 'placeholder', rect);
1344
- this.layoutInfos.set('placeholder', placeholder);
1345
- y = placeholder.rect.maxY;
1346
- }
1347
- this.contentSize = new $jpY3B$reactstatelyvirtualizer.Size(this.virtualizer.visibleRect.width, y);
1348
- }
1349
- updateItemSize(key, size) {
1350
- let layoutInfo = this.layoutInfos.get(key);
1351
- if (!size || !layoutInfo) return false;
1352
- if (size.height !== layoutInfo.rect.height) {
1353
- // TODO: also not sure about copying layout info vs mutating it. Listlayout does the below
1354
- // but I feel that is because it actually maintained a layoutNode map cache which this doesn't have
1355
- let newLayoutInfo = layoutInfo.copy();
1356
- newLayoutInfo.rect.height = size.height < 600 ? size.height : 600;
1357
- newLayoutInfo.estimatedSize = false;
1358
- this.layoutInfos.set(key, newLayoutInfo);
1359
- return true;
1360
- }
1361
- return false;
1362
- }
1363
- getNextColumnIndex(columnHeights) {
1364
- let minIndex = 0;
1365
- for(let i = 0; i < columnHeights.length; i++)if (columnHeights[i] < columnHeights[minIndex]) minIndex = i;
1366
- return minIndex;
1367
- }
1368
- getClosestRight(key) {
1369
- var ref, ref1, ref2;
1370
- let layoutInfo = this.getLayoutInfo(key);
1371
- // Refactored from v2. Current strategy is to find the closest card in the adjacent column.
1372
- // This prevent the issue where it was possible that the closest layoutInfo would be two columns over due to the middle card being exceptionally tall
1373
- // and thus the top corner to top corner distance was massive.
1374
- // First look for a card to the immediate right of the current card. If we can't find any, look for the nearest card in the entire column to the right of the card
1375
- let rect = new $jpY3B$reactstatelyvirtualizer.Rect(layoutInfo.rect.maxX + 1, layoutInfo.rect.y, layoutInfo.rect.width + this.horizontalSpacing, layoutInfo.rect.height);
1376
- key = (ref = this._findClosest(layoutInfo.rect, rect)) === null || ref === void 0 ? void 0 : ref.key;
1377
- if (!key) {
1378
- var ref3;
1379
- rect = new $jpY3B$reactstatelyvirtualizer.Rect(layoutInfo.rect.maxX + 1, 0, layoutInfo.rect.width + this.horizontalSpacing, this.virtualizer.contentSize.height);
1380
- key = (ref3 = this._findClosest(layoutInfo.rect, rect)) === null || ref3 === void 0 ? void 0 : ref3.key;
1381
- }
1382
- return (ref2 = (ref1 = this.collection.getItem(key)) === null || ref1 === void 0 ? void 0 : ref1.childNodes[0]) === null || ref2 === void 0 ? void 0 : ref2.key;
1383
- }
1384
- getClosestLeft(key) {
1385
- var ref, ref4, ref5;
1386
- let layoutInfo = this.getLayoutInfo(key);
1387
- // First look for a card to the immediate left of the current card. If we can't find any, look for the nearest card in the entire column to the left of the card
1388
- let rect = new $jpY3B$reactstatelyvirtualizer.Rect(layoutInfo.rect.x - layoutInfo.rect.width - this.horizontalSpacing - 1, layoutInfo.rect.y, layoutInfo.rect.width + this.horizontalSpacing, layoutInfo.rect.height);
1389
- key = (ref = this._findClosest(layoutInfo.rect, rect)) === null || ref === void 0 ? void 0 : ref.key;
1390
- if (!key) {
1391
- var ref6;
1392
- rect = new $jpY3B$reactstatelyvirtualizer.Rect(layoutInfo.rect.x - layoutInfo.rect.width - this.horizontalSpacing - 1, 0, layoutInfo.rect.width + this.horizontalSpacing, this.virtualizer.contentSize.height);
1393
- key = (ref6 = this._findClosest(layoutInfo.rect, rect)) === null || ref6 === void 0 ? void 0 : ref6.key;
1394
- }
1395
- return (ref5 = (ref4 = this.collection.getItem(key)) === null || ref4 === void 0 ? void 0 : ref4.childNodes[0]) === null || ref5 === void 0 ? void 0 : ref5.key;
1396
- }
1397
- getKeyRightOf(key) {
1398
- // Expected key is the currently focused cell so we need the parent row key
1399
- let parentRowKey = this.collection.getItem(key).parentKey;
1400
- return this.direction === 'rtl' ? this.getClosestLeft(parentRowKey) : this.getClosestRight(parentRowKey);
1401
- }
1402
- getKeyLeftOf(key) {
1403
- // Expected key is the currently focused cell so we need the parent row key
1404
- let parentRowKey = this.collection.getItem(key).parentKey;
1405
- return this.direction === 'rtl' ? this.getClosestRight(parentRowKey) : this.getClosestLeft(parentRowKey);
1406
- }
1407
- constructor(options = {
1408
- }){
1409
- // TODO: WaterfallLayout doesn't use card size in v2, but perhaps it should support it? Perhaps it would modify
1410
- // minItemSize defaults or other things
1411
- super(options);
1412
- this.minItemSize = options.minItemSize || new $jpY3B$reactstatelyvirtualizer.Size(240, 136);
1413
- this.maxItemSize = options.maxItemSize || new $jpY3B$reactstatelyvirtualizer.Size(Infinity, Infinity);
1414
- this.margin = options.margin != null ? options.margin : 24;
1415
- this.minSpace = options.minSpace || new $jpY3B$reactstatelyvirtualizer.Size(18, 18);
1416
- this.maxColumns = options.maxColumns || Infinity;
1417
- this.itemWidth = 0;
1418
- this.numColumns = 0;
1419
- this.lastCollection = null;
1420
- this.collator = options.collator;
1421
- }
1422
- }
1423
-
1424
-
1425
- var $6b630ac4b78ba7f3$exports = {};
1426
11
 
1427
- $parcel$export($6b630ac4b78ba7f3$exports, "Card", () => $6b630ac4b78ba7f3$export$60332b2344f7fe41);
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);
17
+ /*
18
+ * Copyright 2021 Adobe. All rights reserved.
19
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
20
+ * you may not use this file except in compliance with the License. You may obtain a copy
21
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
22
+ *
23
+ * Unless required by applicable law or agreed to in writing, software distributed under
24
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
25
+ * OF ANY KIND, either express or implied. See the License for the specific language
26
+ * governing permissions and limitations under the License.
27
+ */ /// <reference types="css-module-types" />
1428
28
 
1429
29
 
1430
30
 
1431
- let $6b630ac4b78ba7f3$var$Card = /*#__PURE__*/ $jpY3B$react.forwardRef((props, ref)=>{
1432
- let context = $e57ab98cef2f01a5$export$fea0b38586ec8f13();
1433
- if (context !== null) return null;
1434
- else return(/*#__PURE__*/ ($parcel$interopDefault($jpY3B$react)).createElement($7888205ff7de382f$export$7a6ccaf429ad93a8, {
1435
- ...props,
1436
- ref: ref
1437
- }));
1438
- });
1439
- // @ts-ignore
1440
- $6b630ac4b78ba7f3$var$Card.getCollectionNode = function* getCollectionNode(props) {
1441
- let { children: children , textValue: textValue } = props;
1442
- yield {
1443
- type: 'item',
1444
- props: props,
1445
- rendered: children,
1446
- 'aria-label': props['aria-label'],
1447
- hasChildNodes: false,
1448
- textValue: textValue
1449
- };
1450
- };
1451
- let $6b630ac4b78ba7f3$export$60332b2344f7fe41 = $6b630ac4b78ba7f3$var$Card;
1452
31
 
1453
32
 
1454
- $parcel$exportWildcard(module.exports, $514a55f6d91f25ef$exports);
1455
- $parcel$exportWildcard(module.exports, $8019a3d2c7d098ea$exports);
1456
- $parcel$exportWildcard(module.exports, $71b727f94b595b1a$exports);
1457
- $parcel$exportWildcard(module.exports, $632abf8fbf0ad57b$exports);
1458
- $parcel$exportWildcard(module.exports, $6b630ac4b78ba7f3$exports);
1459
33
 
1460
34
 
1461
35
  //# sourceMappingURL=main.js.map