@ubnt/store.core 9.9.0-alpha.3 → 9.9.0-alpha.5

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 (429) hide show
  1. package/CHANGELOG.md +350 -2237
  2. package/lib/assets/attention.svg +5 -5
  3. package/lib/assets/attention2.svg +5 -5
  4. package/lib/{components/ModelCompareV3/assets/keylock.svg.js → assets/icons/menu/icon-globe.svg.js} +6 -6
  5. package/lib/assets/icons/menu/icon-globe.svg.js.map +1 -0
  6. package/lib/assets/icons/menu/icon-globe.svg.mjs +3 -0
  7. package/lib/assets/icons/menu/icon-globe.svg.mjs.map +1 -0
  8. package/lib/assets/udmPro.jpg +0 -0
  9. package/lib/assets/udmPro2.jpg +0 -0
  10. package/lib/assets/udmProMax.jpg +0 -0
  11. package/lib/assets/udmProMax2.jpg +0 -0
  12. package/lib/assets/udmProSpecial.jpg +0 -0
  13. package/lib/assets/udmProSpecial2.jpg +0 -0
  14. package/lib/components/Container/Container.styles.js +0 -2
  15. package/lib/components/Container/Container.styles.js.map +1 -1
  16. package/lib/components/Container/Container.styles.mjs +0 -2
  17. package/lib/components/Container/Container.styles.mjs.map +1 -1
  18. package/lib/components/Container/Container.types.d.ts +1 -1
  19. package/lib/components/Explore/Explore.js +1 -1
  20. package/lib/components/Explore/Explore.js.map +1 -1
  21. package/lib/components/Explore/Explore.mjs +1 -1
  22. package/lib/components/Explore/Explore.mjs.map +1 -1
  23. package/lib/components/Footer/Footer.d.ts +1 -1
  24. package/lib/components/Footer/Footer.js +132 -164
  25. package/lib/components/Footer/Footer.js.map +1 -1
  26. package/lib/components/Footer/Footer.mjs +132 -166
  27. package/lib/components/Footer/Footer.mjs.map +1 -1
  28. package/lib/components/Footer/Footer.styles.d.ts +7 -3
  29. package/lib/components/Footer/Footer.styles.js +46 -31
  30. package/lib/components/Footer/Footer.styles.js.map +1 -1
  31. package/lib/components/Footer/Footer.styles.mjs +44 -32
  32. package/lib/components/Footer/Footer.styles.mjs.map +1 -1
  33. package/lib/components/Footer/Footer.types.d.ts +2 -4
  34. package/lib/components/Footer/Footer.types.js.map +1 -1
  35. package/lib/components/Footer/Footer.types.mjs.map +1 -1
  36. package/lib/components/Footer/hooks/useFooterContent.d.ts +10 -22
  37. package/lib/components/Footer/hooks/useFooterContent.js +57 -53
  38. package/lib/components/Footer/hooks/useFooterContent.js.map +1 -1
  39. package/lib/components/Footer/hooks/useFooterContent.mjs +55 -51
  40. package/lib/components/Footer/hooks/useFooterContent.mjs.map +1 -1
  41. package/lib/components/Footer/translations/ar.json.js +8 -7
  42. package/lib/components/Footer/translations/ar.json.js.map +1 -1
  43. package/lib/components/Footer/translations/ar.json.mjs +8 -7
  44. package/lib/components/Footer/translations/ar.json.mjs.map +1 -1
  45. package/lib/components/Footer/translations/de.json.js +10 -9
  46. package/lib/components/Footer/translations/de.json.js.map +1 -1
  47. package/lib/components/Footer/translations/de.json.mjs +10 -9
  48. package/lib/components/Footer/translations/de.json.mjs.map +1 -1
  49. package/lib/components/Footer/translations/el.json.js +8 -7
  50. package/lib/components/Footer/translations/el.json.js.map +1 -1
  51. package/lib/components/Footer/translations/el.json.mjs +8 -7
  52. package/lib/components/Footer/translations/el.json.mjs.map +1 -1
  53. package/lib/components/Footer/translations/en.json.js +11 -11
  54. package/lib/components/Footer/translations/en.json.mjs +11 -11
  55. package/lib/components/Footer/translations/es.json.js +8 -7
  56. package/lib/components/Footer/translations/es.json.js.map +1 -1
  57. package/lib/components/Footer/translations/es.json.mjs +8 -7
  58. package/lib/components/Footer/translations/es.json.mjs.map +1 -1
  59. package/lib/components/Footer/translations/fr.json.js +11 -10
  60. package/lib/components/Footer/translations/fr.json.js.map +1 -1
  61. package/lib/components/Footer/translations/fr.json.mjs +11 -10
  62. package/lib/components/Footer/translations/fr.json.mjs.map +1 -1
  63. package/lib/components/Footer/translations/it.json.js +21 -20
  64. package/lib/components/Footer/translations/it.json.js.map +1 -1
  65. package/lib/components/Footer/translations/it.json.mjs +21 -20
  66. package/lib/components/Footer/translations/it.json.mjs.map +1 -1
  67. package/lib/components/Footer/translations/ja.json.js +8 -7
  68. package/lib/components/Footer/translations/ja.json.js.map +1 -1
  69. package/lib/components/Footer/translations/ja.json.mjs +8 -7
  70. package/lib/components/Footer/translations/ja.json.mjs.map +1 -1
  71. package/lib/components/Footer/translations/pt-BR.json.js +8 -7
  72. package/lib/components/Footer/translations/pt-BR.json.js.map +1 -1
  73. package/lib/components/Footer/translations/pt-BR.json.mjs +8 -7
  74. package/lib/components/Footer/translations/pt-BR.json.mjs.map +1 -1
  75. package/lib/components/Footer/translations/zh-Hans.json.js +8 -7
  76. package/lib/components/Footer/translations/zh-Hans.json.js.map +1 -1
  77. package/lib/components/Footer/translations/zh-Hans.json.mjs +8 -7
  78. package/lib/components/Footer/translations/zh-Hans.json.mjs.map +1 -1
  79. package/lib/components/Footer/translations/zh-Hant-TW.json.js +47 -0
  80. package/lib/components/Footer/translations/zh-Hant-TW.json.js.map +1 -0
  81. package/lib/components/Footer/translations/zh-Hant-TW.json.mjs +42 -0
  82. package/lib/components/Footer/translations/zh-Hant-TW.json.mjs.map +1 -0
  83. package/lib/components/Header/AccountMenu/AccountMenu.js +5 -3
  84. package/lib/components/Header/AccountMenu/AccountMenu.js.map +1 -1
  85. package/lib/components/Header/AccountMenu/AccountMenu.mjs +6 -4
  86. package/lib/components/Header/AccountMenu/AccountMenu.mjs.map +1 -1
  87. package/lib/components/Header/Header.js +1 -8
  88. package/lib/components/Header/Header.js.map +1 -1
  89. package/lib/components/Header/Header.mjs +1 -8
  90. package/lib/components/Header/Header.mjs.map +1 -1
  91. package/lib/components/Header/Header.styles.js +0 -4
  92. package/lib/components/Header/Header.styles.js.map +1 -1
  93. package/lib/components/Header/Header.styles.mjs +0 -4
  94. package/lib/components/Header/Header.styles.mjs.map +1 -1
  95. package/lib/components/Header/Header.types.d.ts +1 -3
  96. package/lib/components/Header/Header.types.js +1 -3
  97. package/lib/components/Header/Header.types.js.map +1 -1
  98. package/lib/components/Header/Header.types.mjs +1 -3
  99. package/lib/components/Header/Header.types.mjs.map +1 -1
  100. package/lib/components/Header/Navigation/MicrositeMenu/MicrositeMenu.js +5 -8
  101. package/lib/components/Header/Navigation/MicrositeMenu/MicrositeMenu.js.map +1 -1
  102. package/lib/components/Header/Navigation/MicrositeMenu/MicrositeMenu.mjs +5 -8
  103. package/lib/components/Header/Navigation/MicrositeMenu/MicrositeMenu.mjs.map +1 -1
  104. package/lib/components/Header/Navigation/MicrositeMenu/MicrositeMenu.styles.js +2 -1
  105. package/lib/components/Header/Navigation/MicrositeMenu/MicrositeMenu.styles.js.map +1 -1
  106. package/lib/components/Header/Navigation/MicrositeMenu/MicrositeMenu.styles.mjs +2 -1
  107. package/lib/components/Header/Navigation/MicrositeMenu/MicrositeMenu.styles.mjs.map +1 -1
  108. package/lib/components/Header/Navigation/MicrositeMenu/mapping.d.ts +1 -7
  109. package/lib/components/Header/Navigation/MicrositeMenu/mapping.js +19 -32
  110. package/lib/components/Header/Navigation/MicrositeMenu/mapping.js.map +1 -1
  111. package/lib/components/Header/Navigation/MicrositeMenu/mapping.mjs +19 -32
  112. package/lib/components/Header/Navigation/MicrositeMenu/mapping.mjs.map +1 -1
  113. package/lib/components/Header/Navigation/MobileMenu/MobileMenu.js +1 -1
  114. package/lib/components/Header/Navigation/MobileMenu/MobileMenu.js.map +1 -1
  115. package/lib/components/Header/Navigation/MobileMenu/MobileMenu.mjs +1 -1
  116. package/lib/components/Header/Navigation/MobileMenu/MobileMenu.mjs.map +1 -1
  117. package/lib/components/Header/Navigation/MobileMenu/MobileMenu.styles.d.ts +0 -1
  118. package/lib/components/Header/Navigation/MobileMenu/MobileMenu.styles.js +0 -4
  119. package/lib/components/Header/Navigation/MobileMenu/MobileMenu.styles.js.map +1 -1
  120. package/lib/components/Header/Navigation/MobileMenu/MobileMenu.styles.mjs +1 -4
  121. package/lib/components/Header/Navigation/MobileMenu/MobileMenu.styles.mjs.map +1 -1
  122. package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.js +55 -65
  123. package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.js.map +1 -1
  124. package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.mjs +55 -65
  125. package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.mjs.map +1 -1
  126. package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.types.d.ts +1 -3
  127. package/lib/components/Header/ProHeader/ProHeader.js +50 -67
  128. package/lib/components/Header/ProHeader/ProHeader.js.map +1 -1
  129. package/lib/components/Header/ProHeader/ProHeader.mjs +50 -67
  130. package/lib/components/Header/ProHeader/ProHeader.mjs.map +1 -1
  131. package/lib/components/Header/translations/de.json.js +2 -2
  132. package/lib/components/Header/translations/de.json.mjs +2 -2
  133. package/lib/components/Header/translations/el.json.js +1 -1
  134. package/lib/components/Header/translations/el.json.mjs +1 -1
  135. package/lib/components/Header/translations/en.json.js +33 -37
  136. package/lib/components/Header/translations/en.json.js.map +1 -1
  137. package/lib/components/Header/translations/en.json.mjs +34 -37
  138. package/lib/components/Header/translations/en.json.mjs.map +1 -1
  139. package/lib/components/Header/translations/fr.json.js +3 -3
  140. package/lib/components/Header/translations/fr.json.mjs +3 -3
  141. package/lib/components/LayoutRenderer/LayoutRenderer.types.d.ts +0 -2
  142. package/lib/components/LayoutRenderer/LayoutRenderer.types.js.map +1 -1
  143. package/lib/components/LayoutRenderer/LayoutRenderer.types.mjs.map +1 -1
  144. package/lib/components/MicrositeHero/MicrositeHero.d.ts +1 -1
  145. package/lib/components/MicrositeHero/MicrositeHero.js +3 -13
  146. package/lib/components/MicrositeHero/MicrositeHero.js.map +1 -1
  147. package/lib/components/MicrositeHero/MicrositeHero.mjs +4 -14
  148. package/lib/components/MicrositeHero/MicrositeHero.mjs.map +1 -1
  149. package/lib/components/MicrositeHero/MicrositeHero.types.d.ts +0 -1
  150. package/lib/components/MicrositeHero/MicrositeHero.types.js.map +1 -1
  151. package/lib/components/MicrositeHero/MicrositeHero.types.mjs.map +1 -1
  152. package/lib/components/MicrositeMediaGrid/MicrositeMediaGrid.js +40 -59
  153. package/lib/components/MicrositeMediaGrid/MicrositeMediaGrid.js.map +1 -1
  154. package/lib/components/MicrositeMediaGrid/MicrositeMediaGrid.mjs +42 -61
  155. package/lib/components/MicrositeMediaGrid/MicrositeMediaGrid.mjs.map +1 -1
  156. package/lib/components/MicrositeMediaGrid/MicrositeMediaGrid.styles.d.ts +0 -15
  157. package/lib/components/MicrositeMediaGrid/MicrositeMediaGrid.styles.js +6 -35
  158. package/lib/components/MicrositeMediaGrid/MicrositeMediaGrid.styles.js.map +1 -1
  159. package/lib/components/MicrositeMediaGrid/MicrositeMediaGrid.styles.mjs +7 -35
  160. package/lib/components/MicrositeMediaGrid/MicrositeMediaGrid.styles.mjs.map +1 -1
  161. package/lib/components/MicrositeMediaGrid/MicrositeMediaGrid.types.d.ts +0 -9
  162. package/lib/components/MicrositeMediaGrid/MicrositeMediaGrid.types.js.map +1 -1
  163. package/lib/components/MicrositeMediaGrid/MicrositeMediaGrid.types.mjs.map +1 -1
  164. package/lib/components/Microsites/MicrositeProductPage.js +1 -2
  165. package/lib/components/Microsites/MicrositeProductPage.js.map +1 -1
  166. package/lib/components/Microsites/MicrositeProductPage.mjs +1 -2
  167. package/lib/components/Microsites/MicrositeProductPage.mjs.map +1 -1
  168. package/lib/components/Microsites/Microsites.types.d.ts +1 -3
  169. package/lib/components/Microsites/Microsites.types.js.map +1 -1
  170. package/lib/components/Microsites/Microsites.types.mjs.map +1 -1
  171. package/lib/components/ModelCompareV3/ModelCompareV3.styles.js +0 -1
  172. package/lib/components/ModelCompareV3/ModelCompareV3.styles.js.map +1 -1
  173. package/lib/components/ModelCompareV3/ModelCompareV3.styles.mjs +0 -1
  174. package/lib/components/ModelCompareV3/ModelCompareV3.styles.mjs.map +1 -1
  175. package/lib/components/ModelCompareV3/ModelCompareV3.types.d.ts +9 -21
  176. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmPro.jpg.js +5 -5
  177. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmPro.jpg.mjs +2 -2
  178. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProMax.jpg.js +5 -5
  179. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProMax.jpg.mjs +2 -2
  180. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProSpecial.jpg.js +5 -5
  181. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProSpecial.jpg.mjs +2 -2
  182. package/lib/components/ModelCompareV3/assets/Consoles/udmPro.jpg.js +1 -1
  183. package/lib/components/ModelCompareV3/assets/Consoles/udmPro.jpg.mjs +2 -2
  184. package/lib/components/ModelCompareV3/assets/Consoles/udmProMax.jpg.js +1 -1
  185. package/lib/components/ModelCompareV3/assets/Consoles/udmProMax.jpg.mjs +2 -2
  186. package/lib/components/ModelCompareV3/assets/Consoles/udmProSpecial.jpg.js +1 -1
  187. package/lib/components/ModelCompareV3/assets/Consoles/udmProSpecial.jpg.mjs +2 -2
  188. package/lib/components/ModelCompareV3/data/CloudGateways.js +16 -16
  189. package/lib/components/ModelCompareV3/data/CloudGateways.js.map +1 -1
  190. package/lib/components/ModelCompareV3/data/CloudGateways.mjs +12 -12
  191. package/lib/components/ModelCompareV3/data/CloudGateways.mjs.map +1 -1
  192. package/lib/components/ModelCompareV3/data/index.d.ts +17 -18
  193. package/lib/components/ModelCompareV3/data/index.js +34 -37
  194. package/lib/components/ModelCompareV3/data/index.js.map +1 -1
  195. package/lib/components/ModelCompareV3/data/index.mjs +34 -37
  196. package/lib/components/ModelCompareV3/data/index.mjs.map +1 -1
  197. package/lib/components/ModelCompareV3/data/products/udmPro.js +1 -1
  198. package/lib/components/ModelCompareV3/data/products/udmPro.mjs +1 -1
  199. package/lib/components/ModelCompareV3/data/products/udmProMax.js +1 -1
  200. package/lib/components/ModelCompareV3/data/products/udmProMax.mjs +1 -1
  201. package/lib/components/ModelCompareV3/data/products/udmProSpecial.js +1 -1
  202. package/lib/components/ModelCompareV3/data/products/udmProSpecial.mjs +1 -1
  203. package/lib/components/ModelCompareV3/data/products/waveApMicro.js +2 -2
  204. package/lib/components/ModelCompareV3/data/products/waveApMicro.js.map +1 -1
  205. package/lib/components/ModelCompareV3/data/products/waveApMicro.mjs +2 -2
  206. package/lib/components/ModelCompareV3/data/products/waveApMicro.mjs.map +1 -1
  207. package/lib/components/ModelCompareV3/data/products/wavePro.js +2 -2
  208. package/lib/components/ModelCompareV3/data/products/wavePro.js.map +1 -1
  209. package/lib/components/ModelCompareV3/data/products/wavePro.mjs +2 -2
  210. package/lib/components/ModelCompareV3/data/products/wavePro.mjs.map +1 -1
  211. package/lib/components/ModelCompareV3/translations/en.json.js +1 -27
  212. package/lib/components/ModelCompareV3/translations/en.json.js.map +1 -1
  213. package/lib/components/ModelCompareV3/translations/en.json.mjs +1 -27
  214. package/lib/components/ModelCompareV3/translations/en.json.mjs.map +1 -1
  215. package/lib/components/ModelCompareV3/translations/useModelCompareTranslation.d.ts +2 -2
  216. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.js +21 -312
  217. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.js.map +1 -1
  218. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.mjs +21 -310
  219. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.mjs.map +1 -1
  220. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.js +22 -38
  221. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.js.map +1 -1
  222. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.mjs +22 -38
  223. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.mjs.map +1 -1
  224. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.d.ts +2 -10
  225. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.js +0 -2
  226. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.js.map +1 -1
  227. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.mjs +0 -2
  228. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.mjs.map +1 -1
  229. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/HddSlots/HddSlots.d.ts +1 -1
  230. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/HddSlots/HddSlots.js +4 -5
  231. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/HddSlots/HddSlots.js.map +1 -1
  232. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/HddSlots/HddSlots.mjs +4 -5
  233. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/HddSlots/HddSlots.mjs.map +1 -1
  234. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.js +1 -1
  235. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.mjs +1 -1
  236. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/attention.svg.js +1 -1
  237. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/attention.svg.mjs +2 -2
  238. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.js +1 -1
  239. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.mjs +1 -1
  240. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/assets/attention.svg.js +1 -1
  241. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/assets/attention.svg.mjs +2 -2
  242. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/useComputeResourceCalculator.js +1 -1
  243. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/useComputeResourceCalculator.js.map +1 -1
  244. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/useComputeResourceCalculator.mjs +1 -1
  245. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/useComputeResourceCalculator.mjs.map +1 -1
  246. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.js +1 -1
  247. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.js.map +1 -1
  248. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.mjs +2 -2
  249. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.mjs.map +1 -1
  250. package/lib/components/ResourceCalculatorV1/translations/en.json.js +1 -4
  251. package/lib/components/ResourceCalculatorV1/translations/en.json.js.map +1 -1
  252. package/lib/components/ResourceCalculatorV1/translations/en.json.mjs +1 -4
  253. package/lib/components/ResourceCalculatorV1/translations/en.json.mjs.map +1 -1
  254. package/lib/components/ResourceCalculatorV1/translations/useResourceCalculatorTranslation.d.ts +2 -2
  255. package/lib/components/ScrollWrapper/ScrollWrapper.js +7 -6
  256. package/lib/components/ScrollWrapper/ScrollWrapper.js.map +1 -1
  257. package/lib/components/ScrollWrapper/ScrollWrapper.mjs +7 -6
  258. package/lib/components/ScrollWrapper/ScrollWrapper.mjs.map +1 -1
  259. package/lib/components/VariantSelector/Variant/Variant.js +29 -33
  260. package/lib/components/VariantSelector/Variant/Variant.js.map +1 -1
  261. package/lib/components/VariantSelector/Variant/Variant.mjs +30 -34
  262. package/lib/components/VariantSelector/Variant/Variant.mjs.map +1 -1
  263. package/lib/components/VariantSelector/Variant/Variant.styles.d.ts +0 -2
  264. package/lib/components/VariantSelector/Variant/Variant.styles.js +1 -20
  265. package/lib/components/VariantSelector/Variant/Variant.styles.js.map +1 -1
  266. package/lib/components/VariantSelector/Variant/Variant.styles.mjs +2 -19
  267. package/lib/components/VariantSelector/Variant/Variant.styles.mjs.map +1 -1
  268. package/lib/components/VariantSelector/VariantSelector.constants.d.ts +0 -1
  269. package/lib/components/VariantSelector/VariantSelector.constants.js +0 -1
  270. package/lib/components/VariantSelector/VariantSelector.constants.js.map +1 -1
  271. package/lib/components/VariantSelector/VariantSelector.constants.mjs +0 -1
  272. package/lib/components/VariantSelector/VariantSelector.constants.mjs.map +1 -1
  273. package/lib/constants/icons/menu/index.d.ts +1 -2
  274. package/lib/constants/icons/menu/index.js +9 -18
  275. package/lib/constants/icons/menu/index.js.map +1 -1
  276. package/lib/constants/icons/menu/index.mjs +2 -4
  277. package/lib/constants/icons/menu/index.mjs.map +1 -1
  278. package/lib/constants/icons/options/colors/black.svg.js +5 -5
  279. package/lib/constants/icons/options/colors/index.js +3 -3
  280. package/lib/constants/icons/options/styles/black.svg.js +5 -5
  281. package/lib/constants/icons/options/styles/index.js +3 -3
  282. package/lib/constants/layout.d.ts +0 -1
  283. package/lib/constants/layout.js +1 -3
  284. package/lib/constants/layout.js.map +1 -1
  285. package/lib/constants/layout.mjs +1 -3
  286. package/lib/constants/layout.mjs.map +1 -1
  287. package/lib/constants/optionIcons.js +6 -6
  288. package/lib/constants/optionIcons.mjs +4 -4
  289. package/lib/constants/proStoreCategories/mapping/index.d.ts +0 -1
  290. package/lib/constants/proStoreCategories/translations/ar.json.js +2 -2
  291. package/lib/constants/proStoreCategories/translations/ar.json.mjs +2 -2
  292. package/lib/constants/proStoreCategories/translations/en.json.js +0 -3
  293. package/lib/constants/proStoreCategories/translations/en.json.js.map +1 -1
  294. package/lib/constants/proStoreCategories/translations/en.json.mjs +1 -3
  295. package/lib/constants/proStoreCategories/translations/en.json.mjs.map +1 -1
  296. package/lib/constants/proStoreCategories/translations/fr.json.js +1 -1
  297. package/lib/constants/proStoreCategories/translations/fr.json.mjs +1 -1
  298. package/lib/constants/proStoreCategories/translations/ja.json.js +2 -2
  299. package/lib/constants/proStoreCategories/translations/ja.json.mjs +2 -2
  300. package/lib/constants/proStoreCategories/translations/zh-Hans.json.js +1 -1
  301. package/lib/constants/proStoreCategories/translations/zh-Hans.json.mjs +1 -1
  302. package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.js +1 -1
  303. package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.mjs +1 -1
  304. package/lib/constants/url.d.ts +1 -1
  305. package/lib/constants/url.js +1 -1
  306. package/lib/constants/url.js.map +1 -1
  307. package/lib/constants/url.mjs +1 -1
  308. package/lib/constants/url.mjs.map +1 -1
  309. package/lib/contexts/MenuContext/mapping.js +41 -45
  310. package/lib/contexts/MenuContext/mapping.js.map +1 -1
  311. package/lib/contexts/MenuContext/mapping.mjs +40 -43
  312. package/lib/contexts/MenuContext/mapping.mjs.map +1 -1
  313. package/lib/utils/address.d.ts +61 -61
  314. package/package.json +52 -52
  315. package/lib/assets/arrow-left-right.svg +0 -3
  316. package/lib/assets/efg.png +0 -0
  317. package/lib/assets/firewall.svg +0 -12
  318. package/lib/assets/globe-shield.svg +0 -3
  319. package/lib/assets/icon-location.svg +0 -5
  320. package/lib/assets/icons/menu/icon-location.svg.js +0 -27
  321. package/lib/assets/icons/menu/icon-location.svg.js.map +0 -1
  322. package/lib/assets/icons/menu/icon-location.svg.mjs +0 -3
  323. package/lib/assets/icons/menu/icon-location.svg.mjs.map +0 -1
  324. package/lib/assets/keylock.svg +0 -3
  325. package/lib/assets/magnifying-glass.svg +0 -10
  326. package/lib/assets/sfpAndCable.svg +0 -9
  327. package/lib/assets/ucg-max.png +0 -0
  328. package/lib/components/MicrositeMediaGrid/components/MobileItem.d.ts +0 -14
  329. package/lib/components/MicrositeMediaGrid/components/MobileItem.js +0 -60
  330. package/lib/components/MicrositeMediaGrid/components/MobileItem.js.map +0 -1
  331. package/lib/components/MicrositeMediaGrid/components/MobileItem.mjs +0 -58
  332. package/lib/components/MicrositeMediaGrid/components/MobileItem.mjs.map +0 -1
  333. package/lib/components/ModelCompareV3/assets/arrow-left-right.svg.js +0 -27
  334. package/lib/components/ModelCompareV3/assets/arrow-left-right.svg.js.map +0 -1
  335. package/lib/components/ModelCompareV3/assets/arrow-left-right.svg.mjs +0 -3
  336. package/lib/components/ModelCompareV3/assets/arrow-left-right.svg.mjs.map +0 -1
  337. package/lib/components/ModelCompareV3/assets/firewall.svg.js +0 -27
  338. package/lib/components/ModelCompareV3/assets/firewall.svg.js.map +0 -1
  339. package/lib/components/ModelCompareV3/assets/firewall.svg.mjs +0 -3
  340. package/lib/components/ModelCompareV3/assets/firewall.svg.mjs.map +0 -1
  341. package/lib/components/ModelCompareV3/assets/globe-shield.svg.js +0 -27
  342. package/lib/components/ModelCompareV3/assets/globe-shield.svg.js.map +0 -1
  343. package/lib/components/ModelCompareV3/assets/globe-shield.svg.mjs +0 -3
  344. package/lib/components/ModelCompareV3/assets/globe-shield.svg.mjs.map +0 -1
  345. package/lib/components/ModelCompareV3/assets/keylock.svg.js.map +0 -1
  346. package/lib/components/ModelCompareV3/assets/keylock.svg.mjs +0 -3
  347. package/lib/components/ModelCompareV3/assets/keylock.svg.mjs.map +0 -1
  348. package/lib/components/ModelCompareV3/assets/magnifying-glass.svg.js +0 -27
  349. package/lib/components/ModelCompareV3/assets/magnifying-glass.svg.js.map +0 -1
  350. package/lib/components/ModelCompareV3/assets/magnifying-glass.svg.mjs +0 -3
  351. package/lib/components/ModelCompareV3/assets/magnifying-glass.svg.mjs.map +0 -1
  352. package/lib/components/ModelCompareV3/data/products/gatewayLiteTechnologyVertical.d.ts +0 -2
  353. package/lib/components/ModelCompareV3/data/products/gatewayLiteTechnologyVertical.js +0 -89
  354. package/lib/components/ModelCompareV3/data/products/gatewayLiteTechnologyVertical.js.map +0 -1
  355. package/lib/components/ModelCompareV3/data/products/gatewayLiteTechnologyVertical.mjs +0 -81
  356. package/lib/components/ModelCompareV3/data/products/gatewayLiteTechnologyVertical.mjs.map +0 -1
  357. package/lib/components/ModelCompareV3/data/products/gatewayProfessionalTechnologyVertical.d.ts +0 -2
  358. package/lib/components/ModelCompareV3/data/products/gatewayProfessionalTechnologyVertical.js +0 -90
  359. package/lib/components/ModelCompareV3/data/products/gatewayProfessionalTechnologyVertical.js.map +0 -1
  360. package/lib/components/ModelCompareV3/data/products/gatewayProfessionalTechnologyVertical.mjs +0 -82
  361. package/lib/components/ModelCompareV3/data/products/gatewayProfessionalTechnologyVertical.mjs.map +0 -1
  362. package/lib/components/ModelCompareV3/data/products/udm.d.ts +0 -2
  363. package/lib/components/ModelCompareV3/data/products/udm.js +0 -89
  364. package/lib/components/ModelCompareV3/data/products/udm.js.map +0 -1
  365. package/lib/components/ModelCompareV3/data/products/udm.mjs +0 -81
  366. package/lib/components/ModelCompareV3/data/products/udm.mjs.map +0 -1
  367. package/lib/components/ModelCompareV3/data/properties/applicationAwareFirewall.d.ts +0 -2
  368. package/lib/components/ModelCompareV3/data/properties/applicationAwareFirewall.js +0 -18
  369. package/lib/components/ModelCompareV3/data/properties/applicationAwareFirewall.js.map +0 -1
  370. package/lib/components/ModelCompareV3/data/properties/applicationAwareFirewall.mjs +0 -10
  371. package/lib/components/ModelCompareV3/data/properties/applicationAwareFirewall.mjs.map +0 -1
  372. package/lib/components/ModelCompareV3/data/properties/intrusionPreventionSystem.d.ts +0 -2
  373. package/lib/components/ModelCompareV3/data/properties/intrusionPreventionSystem.js +0 -18
  374. package/lib/components/ModelCompareV3/data/properties/intrusionPreventionSystem.js.map +0 -1
  375. package/lib/components/ModelCompareV3/data/properties/intrusionPreventionSystem.mjs +0 -10
  376. package/lib/components/ModelCompareV3/data/properties/intrusionPreventionSystem.mjs.map +0 -1
  377. package/lib/components/ModelCompareV3/data/properties/ipsThroughput.d.ts +0 -2
  378. package/lib/components/ModelCompareV3/data/properties/ipsThroughput.js +0 -18
  379. package/lib/components/ModelCompareV3/data/properties/ipsThroughput.js.map +0 -1
  380. package/lib/components/ModelCompareV3/data/properties/ipsThroughput.mjs +0 -10
  381. package/lib/components/ModelCompareV3/data/properties/ipsThroughput.mjs.map +0 -1
  382. package/lib/components/ModelCompareV3/data/properties/ipsVpnThroughput.d.ts +0 -2
  383. package/lib/components/ModelCompareV3/data/properties/ipsVpnThroughput.js +0 -18
  384. package/lib/components/ModelCompareV3/data/properties/ipsVpnThroughput.js.map +0 -1
  385. package/lib/components/ModelCompareV3/data/properties/ipsVpnThroughput.mjs +0 -10
  386. package/lib/components/ModelCompareV3/data/properties/ipsVpnThroughput.mjs.map +0 -1
  387. package/lib/components/ModelCompareV3/data/properties/openVpnThroughput.d.ts +0 -2
  388. package/lib/components/ModelCompareV3/data/properties/openVpnThroughput.js +0 -18
  389. package/lib/components/ModelCompareV3/data/properties/openVpnThroughput.js.map +0 -1
  390. package/lib/components/ModelCompareV3/data/properties/openVpnThroughput.mjs +0 -10
  391. package/lib/components/ModelCompareV3/data/properties/openVpnThroughput.mjs.map +0 -1
  392. package/lib/components/ModelCompareV3/data/properties/routingThroughput.d.ts +0 -2
  393. package/lib/components/ModelCompareV3/data/properties/routingThroughput.js +0 -18
  394. package/lib/components/ModelCompareV3/data/properties/routingThroughput.js.map +0 -1
  395. package/lib/components/ModelCompareV3/data/properties/routingThroughput.mjs +0 -10
  396. package/lib/components/ModelCompareV3/data/properties/routingThroughput.mjs.map +0 -1
  397. package/lib/components/ModelCompareV3/data/properties/sslInspection.d.ts +0 -2
  398. package/lib/components/ModelCompareV3/data/properties/sslInspection.js +0 -18
  399. package/lib/components/ModelCompareV3/data/properties/sslInspection.js.map +0 -1
  400. package/lib/components/ModelCompareV3/data/properties/sslInspection.mjs +0 -10
  401. package/lib/components/ModelCompareV3/data/properties/sslInspection.mjs.map +0 -1
  402. package/lib/components/ModelCompareV3/data/properties/sslInspectionPerformance.d.ts +0 -2
  403. package/lib/components/ModelCompareV3/data/properties/sslInspectionPerformance.js +0 -18
  404. package/lib/components/ModelCompareV3/data/properties/sslInspectionPerformance.js.map +0 -1
  405. package/lib/components/ModelCompareV3/data/properties/sslInspectionPerformance.mjs +0 -10
  406. package/lib/components/ModelCompareV3/data/properties/sslInspectionPerformance.mjs.map +0 -1
  407. package/lib/components/ModelCompareV3/data/properties/wireGuardVpnThroughput.d.ts +0 -2
  408. package/lib/components/ModelCompareV3/data/properties/wireGuardVpnThroughput.js +0 -18
  409. package/lib/components/ModelCompareV3/data/properties/wireGuardVpnThroughput.js.map +0 -1
  410. package/lib/components/ModelCompareV3/data/properties/wireGuardVpnThroughput.mjs +0 -10
  411. package/lib/components/ModelCompareV3/data/properties/wireGuardVpnThroughput.mjs.map +0 -1
  412. package/lib/components/ModelCompareV3/data/technologyVerticals/Cybersecurity/Compare1.d.ts +0 -2
  413. package/lib/components/ModelCompareV3/data/technologyVerticals/Cybersecurity/Compare1.js +0 -26
  414. package/lib/components/ModelCompareV3/data/technologyVerticals/Cybersecurity/Compare1.js.map +0 -1
  415. package/lib/components/ModelCompareV3/data/technologyVerticals/Cybersecurity/Compare1.mjs +0 -24
  416. package/lib/components/ModelCompareV3/data/technologyVerticals/Cybersecurity/Compare1.mjs.map +0 -1
  417. package/lib/components/ModelCompareV3/data/technologyVerticals/Cybersecurity/Compare2.d.ts +0 -1
  418. package/lib/components/ResourceCalculatorV1/assets/consoles/efg.png.js +0 -27
  419. package/lib/components/ResourceCalculatorV1/assets/consoles/efg.png.js.map +0 -1
  420. package/lib/components/ResourceCalculatorV1/assets/consoles/efg.png.mjs +0 -3
  421. package/lib/components/ResourceCalculatorV1/assets/consoles/efg.png.mjs.map +0 -1
  422. package/lib/components/ResourceCalculatorV1/assets/consoles/ucg-max.png.js +0 -27
  423. package/lib/components/ResourceCalculatorV1/assets/consoles/ucg-max.png.js.map +0 -1
  424. package/lib/components/ResourceCalculatorV1/assets/consoles/ucg-max.png.mjs +0 -3
  425. package/lib/components/ResourceCalculatorV1/assets/consoles/ucg-max.png.mjs.map +0 -1
  426. package/lib/constants/icons/menu/sfpAndCable.svg.js +0 -27
  427. package/lib/constants/icons/menu/sfpAndCable.svg.js.map +0 -1
  428. package/lib/constants/icons/menu/sfpAndCable.svg.mjs +0 -3
  429. package/lib/constants/icons/menu/sfpAndCable.svg.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"LayoutRenderer.types.mjs","sources":["../../../src/components/LayoutRenderer/LayoutRenderer.types.tsx"],"sourcesContent":["import type { Currency, Nullish } from \"../../types\";\nimport type { Money } from \"../../utils/money\";\nimport type { BuiltFeaturesSectionProps } from \"../BuiltFeaturesSection/BuiltFeaturesSection.types\";\nimport type { SectionTab } from \"../CloserLookSection\";\nimport type { CloserLookSectionProps } from \"../CloserLookSection/CloserLookSection.types\";\nimport type { RecommendedAddonsProps } from \"../CloserLookSection/RecommendedAddons/RecommendedAddons.types\";\nimport type { CompareSectionProps } from \"../CompareSection/CompareSection.types\";\nimport type {\n CustomImageAsset,\n CustomMediaAsset,\n RenderImageProps,\n} from \"../CustomImage/CustomImage.types\";\nimport type { HeroVideoProps } from \"../HeroVideo/HeroVideo.types\";\nimport type { MicrositePageBlocks } from \"../Microsites/Microsites.types\";\nimport type { ProductCardPopupProps } from \"../ProductCardPopup/ProductCardPopup.types\";\nimport type { ProductKeyFeaturesProps } from \"../ProductKeyFeatures/ProductKeyFeatures.types\";\nimport type { ProductSectionNavigationProps } from \"../ProductSectionNavigation/ProductSectionNavigation.types\";\nimport type { ProductUpsellProps } from \"../ProductUpsell/ProductUpsell.types\";\nimport type { ProductWizardProps } from \"../ProductWizard/ProductWizard.types\";\nimport type { RelatedProductsVariantSelectorProps } from \"../RelatedProductsVariantSelector/RelatedProductsVariantSelector.types\";\nimport type { UICareProps } from \"../UICare/UICare.types\";\nimport type { VariantSelectorProps } from \"../VariantSelector/VariantSelector.types\";\n\nexport interface InlineAccessories {\n onOptionSelect: (productId: string, variantId?: string) => void;\n /** Popup */\n activePopupProduct?: Omit<\n ProductCardPopupProps,\n \"translations\" | \"renderImage\" | \"isOpen\"\n >;\n items: {\n productId: string;\n variantId: string;\n image?: CustomMediaAsset;\n title: string;\n description?: string;\n displayPrice: Money;\n isUICare: boolean;\n hasOptions: boolean;\n isSelected?: boolean;\n isDisabled?: boolean;\n handleSelect: (quantity: number) => void;\n }[];\n}\n\nexport type VariantBundleOffer = {\n /**\n * Will set the offer item as selected by default\n */\n preSelect?: boolean;\n /**\n * If set as true, will render \"log in\" case\n */\n requiresLogin?: boolean;\n name: string;\n onLogin: () => void;\n /**\n * Overall customer limit qty\n */\n maxQtyPerCustomer: Nullish<number>;\n /**\n * Actual qty of remaining limit\n */\n remainingRedeemQty: Nullish<number>;\n // ???\n // remainingQuantity: number;\n item: {\n variantId: string;\n shortTitle: string;\n image: CustomImageAsset | undefined;\n onLearnMore?: () => void;\n price: Money;\n };\n};\n\nexport interface VariantCompatibleProduct {\n title: string;\n sku: string;\n url: string;\n image: Nullish<CustomImageAsset>;\n}\n\n/**\n * General product page variant type\n */\nexport interface LayoutVariant {\n id: string;\n /**\n * Since the ID can be SKU, add a definite variant ID\n */\n variantId: string;\n baseSku: string;\n sku: string;\n\n skuExtraLabel?: string;\n\n title: string;\n description?: string;\n callout?: string;\n\n /**\n * Current variant price, before taxes (not prepared for SG store)\n */\n displayPrice: Money;\n\n /**\n * Product \"from\" price, before taxes (not prepared for SG store)\n */\n fromPrice?: Money;\n /**\n * [NEP-2470] Pre-discount price used to add a \"Safe 99.99$\"\n * Price before taxes (not prepared for SG store)\n * @see https://ubiquiti.atlassian.net/browse/NEP-2470\n */\n originalPrice?: Money;\n\n images?: CustomMediaAsset[];\n techSpecsImages?: CustomMediaAsset[];\n keyFeatures?: ProductKeyFeaturesProps[\"keyFeatures\"];\n\n currentVariantGalleryIds?: string[];\n\n datasheet?: {\n sku: string;\n html: string;\n };\n\n /**\n * Additional variant IDs/SKUs which are used to determine if\n * the current variant is selected.\n */\n otherIds?: string[];\n /**\n * Currently it is used for adding data-test-id=\"product-card-${slug}\" attribute\n * to product selector. Optional since it is not required in Shopify.\n */\n slug?: string;\n\n /**\n * Flags\n */\n isInStock?: boolean;\n isSoldOut?: boolean;\n isEarlyAccess?: boolean;\n isComingSoon?: boolean;\n isLegacy?: boolean;\n isSubscription?: boolean;\n isRegionNotAvailable?: boolean;\n isSpecialOffer?: boolean;\n\n /**\n * @FIXME Move away from these tag flags and just feed tag list\n * and denote the magic tags in store.core. Currently it is done on SF side.\n */\n // Tags\n isTopPerformer?: boolean;\n isBestPricePerformance?: boolean;\n isMostVersatile?: boolean;\n isTopPerformanceHighDensity?: boolean;\n isHighestClientCapacity?: boolean;\n /**\n * (Optional) Indication when product is coming soon when will launch.\n * FIXME: Currently as string currently as `store.storefront` currently manages the parsing of it. Once migrated over\n * to store.storefront we can potentially just pass in a date and generate the copyright here.\n */\n comingSoonDate?: string;\n\n /**\n * Upsell variant\n */\n upsellVariant?: Pick<\n LayoutVariant,\n | \"id\"\n | \"variantId\"\n | \"baseSku\"\n | \"images\"\n | \"title\"\n | \"description\"\n | \"displayPrice\"\n | \"datasheet\"\n | \"isSoldOut\"\n | \"isTopPerformer\"\n | \"isBestPricePerformance\"\n | \"isMostVersatile\"\n | \"isTopPerformanceHighDensity\"\n | \"isHighestClientCapacity\"\n | \"hddTerabytes\"\n | \"campaignDiscount\"\n >;\n /**\n * ! Used only for the upsell variant\n */\n hddTerabytes?: number;\n\n inlineAccessories?: InlineAccessories;\n\n /**\n * Bundled item offer\n */\n bundleOffer?: VariantBundleOffer;\n\n /**\n * Category (Optical and Installation collections)\n */\n category?: SubCategory;\n\n campaignDiscount?: {\n minProductQty: number;\n maxProductQty?: number | null;\n percentageAmount?: number;\n fixedAmountCurrency?: Currency;\n fixedAmountPrice?: number;\n upsellProductTitle?: string;\n productTitle?: string;\n overrideShortTitle?: string;\n showNearPrice?: boolean;\n };\n\n productBundleNotes?: string[];\n compatibleProducts?: VariantCompatibleProduct[];\n\n shortTitle?: string;\n}\n\nexport interface SubCategory {\n title: string;\n id: string;\n shortDescription?: string;\n items?: SubCategory[];\n isDisabled?: boolean;\n}\n\ninterface Category {\n sectionTitle: string;\n id: string;\n items: SubCategory[];\n}\n\n// TODO use productWizard quantity controls(or rework) and adding to cart (current approach ignores limits)\nexport type OnVariantAddToCartFn = (\n items: Array<{\n variantId: string;\n quantity: number;\n }>,\n) => Promise<void>;\n\nexport const PRODUCT_PAGE = \"product-page\";\n\nexport interface LayoutRendererProps {\n collection?: {\n title?: string;\n descriptionHtml?: string;\n videoUrl?: string;\n images?: CustomMediaAsset[];\n slug?: string;\n };\n currentProduct: {\n id: string;\n title: string;\n shortDescription: string;\n descriptionHtml?: string;\n images?: CustomMediaAsset[];\n showGallery?: boolean;\n datasheet?: {\n sku: string;\n html: string;\n };\n hasUICare?: boolean;\n relatedProductsVariantSelectorProps?: Omit<\n RelatedProductsVariantSelectorProps,\n \"renderImage\" | \"translations\"\n >;\n\n topologyImages?: CustomMediaAsset[];\n deploymentImages?: CustomMediaAsset[];\n techSpecsImages?: CustomMediaAsset[];\n inTheBoxImages?: CustomMediaAsset[];\n installationImages?: CustomMediaAsset[];\n performanceImages?: CustomMediaAsset[];\n installationGuide?: {\n name: string;\n url: string;\n };\n glanceAssets?: MicrositePageBlocks[];\n } | null;\n\n productSectionNavigationProps?: ProductSectionNavigationProps;\n\n // onBreadcrumbClick: BreadcrumbsProps[\"onBreadcrumbClick\"];\n variantSelectorProps: Omit<\n VariantSelectorProps,\n | \"activeCategories\"\n | \"categoryChangeHandler\"\n | \"categories\"\n | \"renderImage\"\n | \"translations\"\n | \"collectionSlug\"\n | \"language\"\n >;\n renderImage: (props: RenderImageProps) => React.ReactNode;\n wizardProps: ProductWizardProps;\n uiCareProps?: Omit<UICareProps, \"renderImage\">;\n upsellProps?: Omit<ProductUpsellProps, \"renderImage\">;\n categories?: Category[];\n activeCategories?: string[];\n categoryChangeHandler: (id: string) => void;\n language: string;\n showCookiesConsentOptions: () => void;\n videoNoCookiesConsent: boolean;\n translations: {\n productSpecification?: string;\n\n /** Variant Selector translations */\n variantSelector?: VariantSelectorProps[\"translations\"];\n\n /** Related Products Variant selector translations */\n relatedProductsVariantSelector: RelatedProductsVariantSelectorProps[\"translations\"];\n\n /** For DeploymentGallery component - `title` prop */\n deploymentGalleryTitle: string;\n\n /** For RelatedProducts component - `title` prop */\n // relatedProducts: RelatedProductsProps[\"translations\"];\n\n compareSection: CompareSectionProps[\"translations\"];\n\n topLevelBreadcrumb: string;\n\n closerLookSection?: CloserLookSectionProps[\"translations\"];\n\n builtFeaturesSection: BuiltFeaturesSectionProps[\"translations\"];\n\n specifications: string;\n faqTitle: string;\n completeYourBuild: string;\n technicalSpecifications: string;\n };\n heroVideoProps?: HeroVideoProps;\n\n capacityCalculator: React.ReactNode;\n\n isProStore?: boolean;\n\n recommendedAddonsProps?: RecommendedAddonsProps;\n faq?: CloserLookSectionProps[\"faq\"];\n\n onToggleTechSpec?: (isActive: boolean) => void;\n onTabClick?: (tabId: SectionTab) => void;\n onTabSectionGalleryModalToggle?: (tabId: SectionTab, src: string) => void;\n\n bannerHtml?: CloserLookSectionProps[\"bannerHtml\"];\n}\n"],"names":["PRODUCT_PAGE"],"mappings":";;AAsPO,MAAMA,YAAe,GAAA,cAAA;"}
1
+ {"version":3,"file":"LayoutRenderer.types.mjs","sources":["../../../src/components/LayoutRenderer/LayoutRenderer.types.tsx"],"sourcesContent":["import type { Currency, Nullish } from \"../../types\";\nimport type { Money } from \"../../utils/money\";\nimport type { BuiltFeaturesSectionProps } from \"../BuiltFeaturesSection/BuiltFeaturesSection.types\";\nimport type { SectionTab } from \"../CloserLookSection\";\nimport type { CloserLookSectionProps } from \"../CloserLookSection/CloserLookSection.types\";\nimport type { RecommendedAddonsProps } from \"../CloserLookSection/RecommendedAddons/RecommendedAddons.types\";\nimport type { CompareSectionProps } from \"../CompareSection/CompareSection.types\";\nimport type {\n CustomImageAsset,\n CustomMediaAsset,\n RenderImageProps,\n} from \"../CustomImage/CustomImage.types\";\nimport type { HeroVideoProps } from \"../HeroVideo/HeroVideo.types\";\nimport type { MicrositePageBlocks } from \"../Microsites/Microsites.types\";\nimport type { ProductCardPopupProps } from \"../ProductCardPopup/ProductCardPopup.types\";\nimport type { ProductKeyFeaturesProps } from \"../ProductKeyFeatures/ProductKeyFeatures.types\";\nimport type { ProductSectionNavigationProps } from \"../ProductSectionNavigation/ProductSectionNavigation.types\";\nimport type { ProductUpsellProps } from \"../ProductUpsell/ProductUpsell.types\";\nimport type { ProductWizardProps } from \"../ProductWizard/ProductWizard.types\";\nimport type { RelatedProductsVariantSelectorProps } from \"../RelatedProductsVariantSelector/RelatedProductsVariantSelector.types\";\nimport type { UICareProps } from \"../UICare/UICare.types\";\nimport type { VariantSelectorProps } from \"../VariantSelector/VariantSelector.types\";\n\nexport interface InlineAccessories {\n onOptionSelect: (productId: string, variantId?: string) => void;\n /** Popup */\n activePopupProduct?: Omit<\n ProductCardPopupProps,\n \"translations\" | \"renderImage\" | \"isOpen\"\n >;\n items: {\n productId: string;\n variantId: string;\n image?: CustomMediaAsset;\n title: string;\n description?: string;\n displayPrice: Money;\n isUICare: boolean;\n hasOptions: boolean;\n isSelected?: boolean;\n isDisabled?: boolean;\n handleSelect: (quantity: number) => void;\n }[];\n}\n\nexport type VariantBundleOffer = {\n /**\n * Will set the offer item as selected by default\n */\n preSelect?: boolean;\n /**\n * If set as true, will render \"log in\" case\n */\n requiresLogin?: boolean;\n name: string;\n onLogin: () => void;\n /**\n * Overall customer limit qty\n */\n maxQtyPerCustomer: Nullish<number>;\n /**\n * Actual qty of remaining limit\n */\n remainingRedeemQty: Nullish<number>;\n // ???\n // remainingQuantity: number;\n item: {\n variantId: string;\n shortTitle: string;\n image: CustomImageAsset | undefined;\n onLearnMore?: () => void;\n price: Money;\n };\n};\n\nexport interface VariantCompatibleProduct {\n title: string;\n sku: string;\n url: string;\n image: Nullish<CustomImageAsset>;\n}\n\n/**\n * General product page variant type\n */\nexport interface LayoutVariant {\n id: string;\n /**\n * Since the ID can be SKU, add a definite variant ID\n */\n variantId: string;\n baseSku: string;\n sku: string;\n\n skuExtraLabel?: string;\n\n title: string;\n description?: string;\n callout?: string;\n\n /**\n * Current variant price, before taxes (not prepared for SG store)\n */\n displayPrice: Money;\n\n /**\n * Product \"from\" price, before taxes (not prepared for SG store)\n */\n fromPrice?: Money;\n /**\n * [NEP-2470] Pre-discount price used to add a \"Safe 99.99$\"\n * Price before taxes (not prepared for SG store)\n * @see https://ubiquiti.atlassian.net/browse/NEP-2470\n */\n originalPrice?: Money;\n\n images?: CustomMediaAsset[];\n techSpecsImages?: CustomMediaAsset[];\n keyFeatures?: ProductKeyFeaturesProps[\"keyFeatures\"];\n\n currentVariantGalleryIds?: string[];\n\n datasheet?: {\n sku: string;\n html: string;\n };\n\n /**\n * Additional variant IDs/SKUs which are used to determine if\n * the current variant is selected.\n */\n otherIds?: string[];\n /**\n * Currently it is used for adding data-test-id=\"product-card-${slug}\" attribute\n * to product selector. Optional since it is not required in Shopify.\n */\n slug?: string;\n\n /**\n * Flags\n */\n isInStock?: boolean;\n isSoldOut?: boolean;\n isEarlyAccess?: boolean;\n isComingSoon?: boolean;\n isLegacy?: boolean;\n isSubscription?: boolean;\n isRegionNotAvailable?: boolean;\n\n /**\n * @FIXME Move away from these tag flags and just feed tag list\n * and denote the magic tags in store.core. Currently it is done on SF side.\n */\n // Tags\n isTopPerformer?: boolean;\n isBestPricePerformance?: boolean;\n isMostVersatile?: boolean;\n isTopPerformanceHighDensity?: boolean;\n isHighestClientCapacity?: boolean;\n /**\n * (Optional) Indication when product is coming soon when will launch.\n * FIXME: Currently as string currently as `store.storefront` currently manages the parsing of it. Once migrated over\n * to store.storefront we can potentially just pass in a date and generate the copyright here.\n */\n comingSoonDate?: string;\n\n /**\n * Upsell variant\n */\n upsellVariant?: Pick<\n LayoutVariant,\n | \"id\"\n | \"variantId\"\n | \"baseSku\"\n | \"images\"\n | \"title\"\n | \"description\"\n | \"displayPrice\"\n | \"datasheet\"\n | \"isSoldOut\"\n | \"isTopPerformer\"\n | \"isBestPricePerformance\"\n | \"isMostVersatile\"\n | \"isTopPerformanceHighDensity\"\n | \"isHighestClientCapacity\"\n | \"hddTerabytes\"\n | \"campaignDiscount\"\n >;\n /**\n * ! Used only for the upsell variant\n */\n hddTerabytes?: number;\n\n inlineAccessories?: InlineAccessories;\n\n /**\n * Bundled item offer\n */\n bundleOffer?: VariantBundleOffer;\n\n /**\n * Category (Optical and Installation collections)\n */\n category?: SubCategory;\n\n campaignDiscount?: {\n minProductQty: number;\n maxProductQty?: number | null;\n percentageAmount?: number;\n fixedAmountCurrency?: Currency;\n fixedAmountPrice?: number;\n upsellProductTitle?: string;\n productTitle?: string;\n overrideShortTitle?: string;\n };\n\n productBundleNotes?: string[];\n compatibleProducts?: VariantCompatibleProduct[];\n\n shortTitle?: string;\n}\n\nexport interface SubCategory {\n title: string;\n id: string;\n shortDescription?: string;\n items?: SubCategory[];\n isDisabled?: boolean;\n}\n\ninterface Category {\n sectionTitle: string;\n id: string;\n items: SubCategory[];\n}\n\n// TODO use productWizard quantity controls(or rework) and adding to cart (current approach ignores limits)\nexport type OnVariantAddToCartFn = (\n items: Array<{\n variantId: string;\n quantity: number;\n }>,\n) => Promise<void>;\n\nexport const PRODUCT_PAGE = \"product-page\";\n\nexport interface LayoutRendererProps {\n collection?: {\n title?: string;\n descriptionHtml?: string;\n videoUrl?: string;\n images?: CustomMediaAsset[];\n slug?: string;\n };\n currentProduct: {\n id: string;\n title: string;\n shortDescription: string;\n descriptionHtml?: string;\n images?: CustomMediaAsset[];\n showGallery?: boolean;\n datasheet?: {\n sku: string;\n html: string;\n };\n hasUICare?: boolean;\n relatedProductsVariantSelectorProps?: Omit<\n RelatedProductsVariantSelectorProps,\n \"renderImage\" | \"translations\"\n >;\n\n topologyImages?: CustomMediaAsset[];\n deploymentImages?: CustomMediaAsset[];\n techSpecsImages?: CustomMediaAsset[];\n inTheBoxImages?: CustomMediaAsset[];\n installationImages?: CustomMediaAsset[];\n performanceImages?: CustomMediaAsset[];\n installationGuide?: {\n name: string;\n url: string;\n };\n glanceAssets?: MicrositePageBlocks[];\n } | null;\n\n productSectionNavigationProps?: ProductSectionNavigationProps;\n\n // onBreadcrumbClick: BreadcrumbsProps[\"onBreadcrumbClick\"];\n variantSelectorProps: Omit<\n VariantSelectorProps,\n | \"activeCategories\"\n | \"categoryChangeHandler\"\n | \"categories\"\n | \"renderImage\"\n | \"translations\"\n | \"collectionSlug\"\n | \"language\"\n >;\n renderImage: (props: RenderImageProps) => React.ReactNode;\n wizardProps: ProductWizardProps;\n uiCareProps?: Omit<UICareProps, \"renderImage\">;\n upsellProps?: Omit<ProductUpsellProps, \"renderImage\">;\n categories?: Category[];\n activeCategories?: string[];\n categoryChangeHandler: (id: string) => void;\n language: string;\n showCookiesConsentOptions: () => void;\n videoNoCookiesConsent: boolean;\n translations: {\n productSpecification?: string;\n\n /** Variant Selector translations */\n variantSelector?: VariantSelectorProps[\"translations\"];\n\n /** Related Products Variant selector translations */\n relatedProductsVariantSelector: RelatedProductsVariantSelectorProps[\"translations\"];\n\n /** For DeploymentGallery component - `title` prop */\n deploymentGalleryTitle: string;\n\n /** For RelatedProducts component - `title` prop */\n // relatedProducts: RelatedProductsProps[\"translations\"];\n\n compareSection: CompareSectionProps[\"translations\"];\n\n topLevelBreadcrumb: string;\n\n closerLookSection?: CloserLookSectionProps[\"translations\"];\n\n builtFeaturesSection: BuiltFeaturesSectionProps[\"translations\"];\n\n specifications: string;\n faqTitle: string;\n completeYourBuild: string;\n technicalSpecifications: string;\n };\n heroVideoProps?: HeroVideoProps;\n\n capacityCalculator: React.ReactNode;\n\n isProStore?: boolean;\n\n recommendedAddonsProps?: RecommendedAddonsProps;\n faq?: CloserLookSectionProps[\"faq\"];\n\n onToggleTechSpec?: (isActive: boolean) => void;\n onTabClick?: (tabId: SectionTab) => void;\n onTabSectionGalleryModalToggle?: (tabId: SectionTab, src: string) => void;\n\n bannerHtml?: CloserLookSectionProps[\"bannerHtml\"];\n}\n"],"names":["PRODUCT_PAGE"],"mappings":";;AAoPO,MAAMA,YAAe,GAAA,cAAA;"}
@@ -1,2 +1,2 @@
1
1
  import { type MicrositeHeroProps } from "./MicrositeHero.types";
2
- export declare const MicrositeHero: ({ title, subtitle, description, titleMarginTop, buyButton, customButton, video, loop, className, variant, enableBottomGradient, contentMaxWidth, icons, transitions: customTransitions, id, }: MicrositeHeroProps) => JSX.Element;
2
+ export declare const MicrositeHero: ({ title, subtitle, description, titleMarginTop, buyButton, customButton, video, loop, className, variant, enableBottomGradient, contentMaxWidth, icons, transitions: customTransitions, }: MicrositeHeroProps) => JSX.Element;
@@ -28,8 +28,7 @@ const MicrositeHero = ({
28
28
  enableBottomGradient,
29
29
  contentMaxWidth,
30
30
  icons,
31
- transitions: customTransitions,
32
- id
31
+ transitions: customTransitions
33
32
  }) => {
34
33
  const videoRef = react.useRef(null);
35
34
  const videoInnerWrapRef = react.useRef(null);
@@ -44,9 +43,6 @@ const MicrositeHero = ({
44
43
  const {
45
44
  width
46
45
  } = reactUse.useWindowSize();
47
- const [videoOuterWrapRef, {
48
- width: videoOuterWrapWidth
49
- }] = reactUse.useMeasure();
50
46
  const [isVideoPlaying, setVideoPlaying] = react.useState(false);
51
47
  const [loopActive, setLoopActive] = react.useState(false);
52
48
  const animateText = react.useCallback(() => {
@@ -146,7 +142,7 @@ const MicrositeHero = ({
146
142
  } catch {}
147
143
  }, []);
148
144
  const aspectRatio = react.useMemo(() => {
149
- return round__default["default"](video.width / video.height, 2);
145
+ return round__default["default"](video.width / video.height, 1);
150
146
  }, [video.height, video.width]);
151
147
  const iconBreakPoint = react.useMemo(() => {
152
148
  if (!icons?.length) {
@@ -157,14 +153,9 @@ const MicrositeHero = ({
157
153
  }, 0);
158
154
  }, [icons]);
159
155
  const isIconBreakPoint = reactUse.useMedia(`(max-width: ${iconBreakPoint - 1}px)`, false);
160
- const showHorizontalGradient = react.useMemo(() => {
161
- const videoWidth = videoRef.current?.clientWidth ?? video.width;
162
- return width > Math.min(videoWidth, videoOuterWrapWidth);
163
- }, [video.width, videoOuterWrapWidth, width]);
164
156
  return /* @__PURE__ */jsxRuntime.jsxs(MicrositeHero_styles.Wrap, {
165
157
  className,
166
158
  $hasIcons: !!icons?.length,
167
- id,
168
159
  children: [video.slides?.length ? /* @__PURE__ */jsxRuntime.jsx(jsxRuntime.Fragment, {
169
160
  children: video.slides.map((slide, i) => /* @__PURE__ */jsxRuntime.jsx(MicrositeHero_styles.Slide, {
170
161
  active: i === currentSlide,
@@ -207,14 +198,13 @@ const MicrositeHero = ({
207
198
  }), customButton]
208
199
  })]
209
200
  }), /* @__PURE__ */jsxRuntime.jsx(MicrositeHero_styles.VideoOuterWrap, {
210
- ref: videoOuterWrapRef,
211
201
  children: /* @__PURE__ */jsxRuntime.jsxs(MicrositeHero_styles.VideoWrap, {
212
202
  aspectRatio,
213
203
  $variant: variant,
214
204
  children: [/* @__PURE__ */jsxRuntime.jsx(MicrositeHero_styles.TopGradient, {}), (enableBottomGradient || icons?.length && isIconBreakPoint) && /* @__PURE__ */jsxRuntime.jsx(MicrositeHero_styles.BottomGradient, {}), /* @__PURE__ */jsxRuntime.jsxs(MicrositeHero_styles.VideoInnerWrap, {
215
205
  $variant: variant,
216
206
  ref: videoInnerWrapRef,
217
- children: [showHorizontalGradient && /* @__PURE__ */jsxRuntime.jsxs(MicrositeHero_styles.HorizontalShadows, {
207
+ children: [videoInnerWrapRef.current?.clientWidth && width >= videoInnerWrapRef.current?.clientWidth && /* @__PURE__ */jsxRuntime.jsxs(MicrositeHero_styles.HorizontalShadows, {
218
208
  children: [/* @__PURE__ */jsxRuntime.jsx(MicrositeHero_styles.HorizontalShadowLeft, {}), /* @__PURE__ */jsxRuntime.jsx(MicrositeHero_styles.HorizontalShadowRight, {})]
219
209
  }), !isVideoPlaying && /* @__PURE__ */jsxRuntime.jsx(MicrositeHero_styles.PosterImage, {
220
210
  src: video?.poster,
@@ -1 +1 @@
1
- {"version":3,"file":"MicrositeHero.js","sources":["../../../src/components/MicrositeHero/MicrositeHero.tsx"],"sourcesContent":["import round from \"lodash/round\";\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { useMeasure, useMedia, useWindowSize } from \"react-use\";\n\nimport { BREAKPOINTS } from \"../../constants/layout\";\nimport * as S from \"./MicrositeHero.styles\";\nimport { ICON_DEFAULT_BOX_WIDTH, ICON_GAP } from \"./MicrositeHero.styles\";\nimport { HeroVariant, type MicrositeHeroProps } from \"./MicrositeHero.types\";\n\nexport const MicrositeHero = ({\n title,\n subtitle,\n description,\n titleMarginTop,\n buyButton,\n customButton,\n video,\n loop,\n className,\n variant = HeroVariant.homepage,\n enableBottomGradient,\n contentMaxWidth,\n icons,\n transitions: customTransitions,\n id,\n}: MicrositeHeroProps) => {\n const videoRef = useRef<HTMLVideoElement>(null);\n const videoInnerWrapRef = useRef<HTMLDivElement>(null);\n const loopVideoRef = useRef<HTMLVideoElement>(null);\n const headingWrapRef = useRef<HTMLDivElement>(null);\n const headingInnerWrapRef = useRef<HTMLDivElement>(null);\n const buyButtonRef = useRef<HTMLDivElement>(null);\n const frameRef = useRef<number>(0);\n\n const [currentSlide, setCurrentSlide] = useState(0);\n\n const isMobile = useMedia(BREAKPOINTS.MOBILE_AND_DOWN, false);\n const isDesktop = useMedia(BREAKPOINTS.TABLET_UP, false);\n const { width } = useWindowSize();\n const [videoOuterWrapRef, { width: videoOuterWrapWidth }] =\n useMeasure<HTMLDivElement>();\n\n const [isVideoPlaying, setVideoPlaying] = useState(false);\n const [loopActive, setLoopActive] = useState(false);\n\n const animateText = useCallback(() => {\n const videoElement = videoRef.current;\n const headingWrapElement = headingWrapRef.current;\n const headingInnerWrapElement = headingInnerWrapRef.current;\n const buyButtonElement = buyButtonRef.current;\n\n if (!videoElement) {\n return;\n }\n\n const currentTime = videoElement.currentTime;\n\n if (\n !videoElement?.paused &&\n headingWrapElement &&\n headingInnerWrapElement\n ) {\n const transitions = customTransitions ?? S.TRANSITIONS;\n\n /**\n * Transitions needs to be in descending order based on timestamps of the video\n */\n transitions.every((t) => {\n const transition = isMobile\n ? t.mobile\n : isDesktop\n ? t.desktop\n : t.tablet;\n\n if (currentTime > t.timestamp) {\n const scale = transition.transformScale ?? 1;\n\n headingInnerWrapElement.style.transform = `scale3d(${scale}, ${scale}, ${scale})`;\n headingWrapElement.style.transitionDuration = `${\n transition.transitionDuration ?? 0\n }ms`;\n headingWrapElement.style.top = transition.top;\n\n return false;\n }\n\n return true;\n });\n\n /**\n * When all transitions completed, fade in the BuyButton\n * after the last transition is completed\n */\n const allTransitionsCompleted = transitions.every(\n (t) => currentTime > t.timestamp,\n );\n\n if (allTransitionsCompleted) {\n const lastTransition = transitions?.[transitions.length - 1];\n\n const responsiveTransition = lastTransition\n ? isMobile\n ? lastTransition.mobile\n : isDesktop\n ? lastTransition.desktop\n : lastTransition.tablet\n : null;\n\n const transitionDuration =\n responsiveTransition?.transitionDuration ?? 0;\n\n const revertScale = 1 / (responsiveTransition?.transformScale ?? 1);\n\n setTimeout(() => {\n buyButtonElement?.style.setProperty(\"opacity\", \"1\");\n buyButtonElement?.style.setProperty(\n \"transform\",\n `scale(${revertScale})`,\n );\n }, transitionDuration);\n\n cancelAnimationFrame(frameRef.current);\n return;\n }\n }\n\n // Reverse slide order for easier comparison\n const slides = [...(video?.slides ?? [])]?.sort(\n (a, b) => b.timestamp - a.timestamp,\n );\n\n if (slides?.length) {\n slides?.every((slide) => {\n if (currentTime > slide.timestamp) {\n const slideIndex = video.slides?.findIndex((s) => s.id === slide.id);\n\n if (slideIndex !== undefined && currentSlide !== slideIndex) {\n setCurrentSlide(slideIndex);\n }\n return false;\n }\n\n return true;\n });\n }\n\n frameRef.current = requestAnimationFrame(animateText);\n }, [currentSlide, customTransitions, isDesktop, isMobile, video.slides]);\n\n useEffect(() => {\n if (variant === HeroVariant.productPage) {\n // We are not animating on product pages\n return;\n }\n\n frameRef.current = requestAnimationFrame(animateText);\n\n return () => {\n cancelAnimationFrame(frameRef.current);\n };\n }, [animateText, variant]);\n\n const handleLoopVideoPlay = useCallback(() => {\n const loopVideo = loopVideoRef.current;\n\n if (!loopVideo) {\n return;\n }\n\n loopVideo.play();\n }, []);\n\n useEffect(() => {\n const video = videoRef.current;\n\n const handleVideoEnded = () => {\n setLoopActive(true);\n\n handleLoopVideoPlay();\n };\n\n video?.addEventListener(\"ended\", handleVideoEnded);\n\n return () => {\n video?.removeEventListener(\"ended\", handleVideoEnded);\n };\n }, [handleLoopVideoPlay]);\n\n /**\n * Hack for forcing the iOS video to preload\n */\n useEffect(() => {\n const loopVideo = loopVideoRef.current;\n\n if (!loopVideo) {\n return;\n }\n\n try {\n loopVideo?.play().finally(() => {\n setTimeout(() => {\n try {\n loopVideo?.pause();\n\n setTimeout(() => {\n loopVideo.currentTime = 0;\n }, 500);\n } catch {\n // Fail silently\n }\n }, 1000);\n });\n } catch {\n // Fail silently\n }\n }, []);\n\n const aspectRatio = useMemo(() => {\n return round(video.width / video.height, 2);\n }, [video.height, video.width]);\n\n const iconBreakPoint = useMemo(() => {\n if (!icons?.length) {\n return 0;\n }\n return icons?.reduce((acc, icon) => {\n return acc + (icon.boxWidth || ICON_DEFAULT_BOX_WIDTH) + ICON_GAP;\n }, 0);\n }, [icons]);\n\n const isIconBreakPoint = useMedia(\n `(max-width: ${iconBreakPoint - 1}px)`,\n false,\n );\n\n // #############################################################################\n // Gradient\n // #############################################################################\n const showHorizontalGradient = useMemo(() => {\n /**\n * If video is not loaded, the clientWidth will be 0.\n * Therefore, we need to fallback to the video width provided\n * in the props (they actually should match, but we take the safe route by\n * relying on the client width first)\n */\n const videoWidth = videoRef.current?.clientWidth ?? video.width;\n\n /**\n * Show the gradient only if the window width is greater than or equal to the\n * video width\n */\n return width > Math.min(videoWidth, videoOuterWrapWidth);\n }, [video.width, videoOuterWrapWidth, width]);\n\n // #############################################################################\n // Render\n // #############################################################################\n return (\n <S.Wrap className={className} $hasIcons={!!icons?.length} id={id}>\n {video.slides?.length ? (\n <>\n {video.slides.map((slide, i) => (\n <S.Slide key={slide.id} active={i === currentSlide}>\n {slide.text}\n </S.Slide>\n ))}\n </>\n ) : variant === HeroVariant.homepage ? (\n // HOME PAGE VARIANT\n <S.HeadingWrap ref={headingWrapRef} $contentMaxWidth={contentMaxWidth}>\n <S.HeadingInnerWrap ref={headingInnerWrapRef}>\n {title && <S.Title>{title}</S.Title>}\n {subtitle && <S.Subtitle>{subtitle}</S.Subtitle>}\n {buyButton && (\n <S.HomepageButtonWrap ref={buyButtonRef}>\n <S.HomepageBuyButton {...buyButton} />\n </S.HomepageButtonWrap>\n )}\n </S.HeadingInnerWrap>\n </S.HeadingWrap>\n ) : (\n // PRODUCT PAGE VARIANT\n <S.ProductPageHeadingWrap\n $contentMaxWidth={contentMaxWidth}\n $marginTop={titleMarginTop}\n >\n {subtitle && (\n <S.ProductPageSubtitle>{subtitle}</S.ProductPageSubtitle>\n )}\n {title && <S.ProductPageTitle>{title}</S.ProductPageTitle>}\n {description && (\n <S.ProductPageDescription>{description}</S.ProductPageDescription>\n )}\n <S.ProductPageButtonWrap>\n {buyButton && <S.ProductPageBuyButton {...buyButton} />}\n {customButton}\n </S.ProductPageButtonWrap>\n </S.ProductPageHeadingWrap>\n )}\n\n <S.VideoOuterWrap ref={videoOuterWrapRef}>\n <S.VideoWrap aspectRatio={aspectRatio} $variant={variant}>\n <S.TopGradient />\n {(enableBottomGradient || (icons?.length && isIconBreakPoint)) && (\n <S.BottomGradient />\n )}\n <S.VideoInnerWrap $variant={variant} ref={videoInnerWrapRef}>\n {showHorizontalGradient && (\n <S.HorizontalShadows>\n <S.HorizontalShadowLeft />\n <S.HorizontalShadowRight />\n </S.HorizontalShadows>\n )}\n {/**\n * Put poster here to avoid showing play button on iOS when in low power mode\n */}\n {!isVideoPlaying && <S.PosterImage src={video?.poster} alt=\"\" />}\n <S.Video\n ref={videoRef}\n $variant={variant}\n autoPlay\n muted\n /**\n * If loop video available, hide the main video\n */\n loop={!loop}\n src={video?.src}\n playsInline\n controlsList=\"nodownload\"\n style={{\n position: \"absolute\",\n display: loopActive ? \"none\" : \"block\",\n zIndex: 10,\n background: \"none\",\n }}\n onLoadedData={() => {\n // NOTE: Hack for iOS/Safari\n if (videoRef.current) {\n try {\n videoRef.current.pause();\n videoRef.current.play();\n } catch {\n // Fail silently\n }\n }\n }}\n onPlay={() => {\n if (videoRef.current)\n videoRef.current.style.background = \"transparent\";\n\n setVideoPlaying(true);\n }}\n />\n\n {loop && (\n <S.Video\n ref={loopVideoRef}\n $variant={variant}\n preload=\"auto\"\n muted\n loop\n controlsList=\"nodownload\"\n poster={loop.poster}\n src={loop.src}\n playsInline\n />\n )}\n </S.VideoInnerWrap>\n </S.VideoWrap>\n </S.VideoOuterWrap>\n {!!icons?.length && (\n <S.IconsWrap $iconBreakPoint={iconBreakPoint}>\n {icons.map((icon, index) => (\n <S.IconItem\n key={`hero-section-icon-${icon.id}-${index}`}\n $width={icon.boxWidth}\n className={icon.className}\n $maxWidth={icons.reduce(\n (acc, icon) =>\n Math.max(acc, icon.boxWidth || ICON_DEFAULT_BOX_WIDTH),\n 0,\n )}\n $iconBreakPoint={iconBreakPoint}\n >\n <S.IconItemIcon\n src={icon.src}\n width={icon.width}\n height={icon.height}\n />\n\n <S.IconItemLabel $maxWidth={icon.labelWidth}>\n {icon.label}\n </S.IconItemLabel>\n </S.IconItem>\n ))}\n </S.IconsWrap>\n )}\n </S.Wrap>\n );\n};\n"],"names":["MicrositeHero","title","subtitle","description","titleMarginTop","buyButton","customButton","video","loop","className","variant","HeroVariant","homepage","enableBottomGradient","contentMaxWidth","icons","transitions","customTransitions","id","videoRef","useRef","videoInnerWrapRef","loopVideoRef","headingWrapRef","headingInnerWrapRef","buyButtonRef","frameRef","currentSlide","setCurrentSlide","useState","isMobile","useMedia","BREAKPOINTS","MOBILE_AND_DOWN","isDesktop","TABLET_UP","width","useWindowSize","videoOuterWrapRef","videoOuterWrapWidth","useMeasure","isVideoPlaying","setVideoPlaying","loopActive","setLoopActive","animateText","useCallback","videoElement","current","headingWrapElement","headingInnerWrapElement","buyButtonElement","currentTime","paused","S.TRANSITIONS","every","t","transition","mobile","desktop","tablet","timestamp","scale","transformScale","style","transform","transitionDuration","top","allTransitionsCompleted","lastTransition","length","responsiveTransition","revertScale","setTimeout","setProperty","cancelAnimationFrame","slides","sort","a","b","slide","slideIndex","findIndex","s","requestAnimationFrame","useEffect","productPage","handleLoopVideoPlay","loopVideo","play","handleVideoEnded","addEventListener","removeEventListener","finally","pause","aspectRatio","useMemo","round","height","iconBreakPoint","reduce","acc","icon","boxWidth","ICON_DEFAULT_BOX_WIDTH","ICON_GAP","isIconBreakPoint","showHorizontalGradient","videoWidth","clientWidth","Math","min","jsxs","S.Wrap","$hasIcons","children","jsx","Fragment","map","i","S.Slide","active","text","S.HeadingWrap","ref","$contentMaxWidth","S.HeadingInnerWrap","HeadingInnerWrap","S.Title","S.Subtitle","S.HomepageButtonWrap","S.HomepageBuyButton","S.ProductPageHeadingWrap","ProductPageHeadingWrap","$marginTop","S.ProductPageSubtitle","S.ProductPageTitle","S.ProductPageDescription","S.ProductPageButtonWrap","S.ProductPageBuyButton","S.VideoOuterWrap","VideoOuterWrap","S.VideoWrap","$variant","S.TopGradient","S.BottomGradient","S.VideoInnerWrap","VideoInnerWrap","S.HorizontalShadows","S.HorizontalShadowLeft","S.HorizontalShadowRight","HorizontalShadowRight","S.PosterImage","src","poster","alt","S.Video","Video","autoPlay","muted","playsInline","controlsList","position","display","zIndex","background","onLoadedData","onPlay","preload","S.IconsWrap","$iconBreakPoint","index","S.IconItem","IconItem","$width","$maxWidth","max","S.IconItemIcon","IconItemIcon","S.IconItemLabel","labelWidth","label"],"mappings":";;;;;;;;;;;;;;;;AASO,MAAMA,gBAAgBA,CAAC;EAC5BC,KAAA;EACAC,QAAA;EACAC,WAAA;EACAC,cAAA;EACAC,SAAA;EACAC,Y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A/E,IAAA,CAAKpF,EAAE,IAAIyJ,KAAK,EAoB7C,CAAA;KACH,CAAA;EAEJ,CAAA,CAAA;AAEJ,CAAA;"}
1
+ {"version":3,"file":"MicrositeHero.js","sources":["../../../src/components/MicrositeHero/MicrositeHero.tsx"],"sourcesContent":["import round from \"lodash/round\";\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { useMedia, useWindowSize } from \"react-use\";\n\nimport { BREAKPOINTS } from \"../../constants/layout\";\nimport * as S from \"./MicrositeHero.styles\";\nimport { ICON_DEFAULT_BOX_WIDTH, ICON_GAP } from \"./MicrositeHero.styles\";\nimport { HeroVariant, type MicrositeHeroProps } from \"./MicrositeHero.types\";\n\nexport const MicrositeHero = ({\n title,\n subtitle,\n description,\n titleMarginTop,\n buyButton,\n customButton,\n video,\n loop,\n className,\n variant = HeroVariant.homepage,\n enableBottomGradient,\n contentMaxWidth,\n icons,\n transitions: customTransitions,\n}: MicrositeHeroProps) => {\n const videoRef = useRef<HTMLVideoElement>(null);\n const videoInnerWrapRef = useRef<HTMLDivElement>(null);\n const loopVideoRef = useRef<HTMLVideoElement>(null);\n const headingWrapRef = useRef<HTMLDivElement>(null);\n const headingInnerWrapRef = useRef<HTMLDivElement>(null);\n const buyButtonRef = useRef<HTMLDivElement>(null);\n const frameRef = useRef<number>(0);\n\n const [currentSlide, setCurrentSlide] = useState(0);\n\n const isMobile = useMedia(BREAKPOINTS.MOBILE_AND_DOWN, false);\n const isDesktop = useMedia(BREAKPOINTS.TABLET_UP, false);\n const { width } = useWindowSize();\n\n const [isVideoPlaying, setVideoPlaying] = useState(false);\n const [loopActive, setLoopActive] = useState(false);\n\n const animateText = useCallback(() => {\n const videoElement = videoRef.current;\n const headingWrapElement = headingWrapRef.current;\n const headingInnerWrapElement = headingInnerWrapRef.current;\n const buyButtonElement = buyButtonRef.current;\n\n if (!videoElement) {\n return;\n }\n\n const currentTime = videoElement.currentTime;\n\n if (\n !videoElement?.paused &&\n headingWrapElement &&\n headingInnerWrapElement\n ) {\n const transitions = customTransitions ?? S.TRANSITIONS;\n\n /**\n * Transitions needs to be in descending order based on timestamps of the video\n */\n transitions.every((t) => {\n const transition = isMobile\n ? t.mobile\n : isDesktop\n ? t.desktop\n : t.tablet;\n\n if (currentTime > t.timestamp) {\n const scale = transition.transformScale ?? 1;\n\n headingInnerWrapElement.style.transform = `scale3d(${scale}, ${scale}, ${scale})`;\n headingWrapElement.style.transitionDuration = `${\n transition.transitionDuration ?? 0\n }ms`;\n headingWrapElement.style.top = transition.top;\n\n return false;\n }\n\n return true;\n });\n\n /**\n * When all transitions completed, fade in the BuyButton\n * after the last transition is completed\n */\n const allTransitionsCompleted = transitions.every(\n (t) => currentTime > t.timestamp,\n );\n\n if (allTransitionsCompleted) {\n const lastTransition = transitions?.[transitions.length - 1];\n\n const responsiveTransition = lastTransition\n ? isMobile\n ? lastTransition.mobile\n : isDesktop\n ? lastTransition.desktop\n : lastTransition.tablet\n : null;\n\n const transitionDuration =\n responsiveTransition?.transitionDuration ?? 0;\n\n const revertScale = 1 / (responsiveTransition?.transformScale ?? 1);\n\n setTimeout(() => {\n buyButtonElement?.style.setProperty(\"opacity\", \"1\");\n buyButtonElement?.style.setProperty(\n \"transform\",\n `scale(${revertScale})`,\n );\n }, transitionDuration);\n\n cancelAnimationFrame(frameRef.current);\n return;\n }\n }\n\n // Reverse slide order for easier comparison\n const slides = [...(video?.slides ?? [])]?.sort(\n (a, b) => b.timestamp - a.timestamp,\n );\n\n if (slides?.length) {\n slides?.every((slide) => {\n if (currentTime > slide.timestamp) {\n const slideIndex = video.slides?.findIndex((s) => s.id === slide.id);\n\n if (slideIndex !== undefined && currentSlide !== slideIndex) {\n setCurrentSlide(slideIndex);\n }\n return false;\n }\n\n return true;\n });\n }\n\n frameRef.current = requestAnimationFrame(animateText);\n }, [currentSlide, customTransitions, isDesktop, isMobile, video.slides]);\n\n useEffect(() => {\n if (variant === HeroVariant.productPage) {\n // We are not animating on product pages\n return;\n }\n\n frameRef.current = requestAnimationFrame(animateText);\n\n return () => {\n cancelAnimationFrame(frameRef.current);\n };\n }, [animateText, variant]);\n\n const handleLoopVideoPlay = useCallback(() => {\n const loopVideo = loopVideoRef.current;\n\n if (!loopVideo) {\n return;\n }\n\n loopVideo.play();\n }, []);\n\n useEffect(() => {\n const video = videoRef.current;\n\n const handleVideoEnded = () => {\n setLoopActive(true);\n\n handleLoopVideoPlay();\n };\n\n video?.addEventListener(\"ended\", handleVideoEnded);\n\n return () => {\n video?.removeEventListener(\"ended\", handleVideoEnded);\n };\n }, [handleLoopVideoPlay]);\n\n /**\n * Hack for forcing the iOS video to preload\n */\n useEffect(() => {\n const loopVideo = loopVideoRef.current;\n\n if (!loopVideo) {\n return;\n }\n\n try {\n loopVideo?.play().finally(() => {\n setTimeout(() => {\n try {\n loopVideo?.pause();\n\n setTimeout(() => {\n loopVideo.currentTime = 0;\n }, 500);\n } catch {\n // Fail silently\n }\n }, 1000);\n });\n } catch {\n // Fail silently\n }\n }, []);\n\n const aspectRatio = useMemo(() => {\n return round(video.width / video.height, 1);\n }, [video.height, video.width]);\n\n const iconBreakPoint = useMemo(() => {\n if (!icons?.length) {\n return 0;\n }\n return icons?.reduce((acc, icon) => {\n return acc + (icon.boxWidth || ICON_DEFAULT_BOX_WIDTH) + ICON_GAP;\n }, 0);\n }, [icons]);\n\n const isIconBreakPoint = useMedia(\n `(max-width: ${iconBreakPoint - 1}px)`,\n false,\n );\n\n // #############################################################################\n // Render\n // #############################################################################\n return (\n <S.Wrap className={className} $hasIcons={!!icons?.length}>\n {video.slides?.length ? (\n <>\n {video.slides.map((slide, i) => (\n <S.Slide key={slide.id} active={i === currentSlide}>\n {slide.text}\n </S.Slide>\n ))}\n </>\n ) : variant === HeroVariant.homepage ? (\n // HOME PAGE VARIANT\n <S.HeadingWrap ref={headingWrapRef} $contentMaxWidth={contentMaxWidth}>\n <S.HeadingInnerWrap ref={headingInnerWrapRef}>\n {title && <S.Title>{title}</S.Title>}\n {subtitle && <S.Subtitle>{subtitle}</S.Subtitle>}\n {buyButton && (\n <S.HomepageButtonWrap ref={buyButtonRef}>\n <S.HomepageBuyButton {...buyButton} />\n </S.HomepageButtonWrap>\n )}\n </S.HeadingInnerWrap>\n </S.HeadingWrap>\n ) : (\n // PRODUCT PAGE VARIANT\n <S.ProductPageHeadingWrap\n $contentMaxWidth={contentMaxWidth}\n $marginTop={titleMarginTop}\n >\n {subtitle && (\n <S.ProductPageSubtitle>{subtitle}</S.ProductPageSubtitle>\n )}\n {title && <S.ProductPageTitle>{title}</S.ProductPageTitle>}\n {description && (\n <S.ProductPageDescription>{description}</S.ProductPageDescription>\n )}\n <S.ProductPageButtonWrap>\n {buyButton && <S.ProductPageBuyButton {...buyButton} />}\n {customButton}\n </S.ProductPageButtonWrap>\n </S.ProductPageHeadingWrap>\n )}\n\n <S.VideoOuterWrap>\n <S.VideoWrap aspectRatio={aspectRatio} $variant={variant}>\n <S.TopGradient />\n {(enableBottomGradient || (icons?.length && isIconBreakPoint)) && (\n <S.BottomGradient />\n )}\n <S.VideoInnerWrap $variant={variant} ref={videoInnerWrapRef}>\n {videoInnerWrapRef.current?.clientWidth &&\n width >= videoInnerWrapRef.current?.clientWidth && (\n <S.HorizontalShadows>\n <S.HorizontalShadowLeft />\n <S.HorizontalShadowRight />\n </S.HorizontalShadows>\n )}\n {/**\n * Put poster here to avoid showing play button on iOS when in low power mode\n */}\n {!isVideoPlaying && <S.PosterImage src={video?.poster} alt=\"\" />}\n <S.Video\n ref={videoRef}\n $variant={variant}\n autoPlay\n muted\n /**\n * If loop video available, hide the main video\n */\n loop={!loop}\n src={video?.src}\n playsInline\n controlsList=\"nodownload\"\n style={{\n position: \"absolute\",\n display: loopActive ? \"none\" : \"block\",\n zIndex: 10,\n background: \"none\",\n }}\n onLoadedData={() => {\n // NOTE: Hack for iOS/Safari\n if (videoRef.current) {\n try {\n videoRef.current.pause();\n videoRef.current.play();\n } catch {\n // Fail silently\n }\n }\n }}\n onPlay={() => {\n if (videoRef.current)\n videoRef.current.style.background = \"transparent\";\n\n setVideoPlaying(true);\n }}\n />\n\n {loop && (\n <S.Video\n ref={loopVideoRef}\n $variant={variant}\n preload=\"auto\"\n muted\n loop\n controlsList=\"nodownload\"\n poster={loop.poster}\n src={loop.src}\n playsInline\n />\n )}\n </S.VideoInnerWrap>\n </S.VideoWrap>\n </S.VideoOuterWrap>\n {!!icons?.length && (\n <S.IconsWrap $iconBreakPoint={iconBreakPoint}>\n {icons.map((icon, index) => (\n <S.IconItem\n key={`hero-section-icon-${icon.id}-${index}`}\n $width={icon.boxWidth}\n className={icon.className}\n $maxWidth={icons.reduce(\n (acc, icon) =>\n Math.max(acc, icon.boxWidth || ICON_DEFAULT_BOX_WIDTH),\n 0,\n )}\n $iconBreakPoint={iconBreakPoint}\n >\n <S.IconItemIcon\n src={icon.src}\n width={icon.width}\n height={icon.height}\n />\n\n <S.IconItemLabel $maxWidth={icon.labelWidth}>\n {icon.label}\n </S.IconItemLabel>\n </S.IconItem>\n ))}\n </S.IconsWrap>\n )}\n </S.Wrap>\n );\n};\n"],"names":["MicrositeHero","title","subtitle","description","titleMarginTop","buyButton","customButton","video","loop","className","variant","HeroVariant","homepage","enableBottomGradient","contentMaxWidth","icons","transitions","customTransitions","videoRef","useRef","videoInnerWrapRef","loopVideoRef","headingWrapRef","headingInnerWrapRef","buyButtonRef","frameRef","currentSlide","setCurrentSlide","useState","isMobile","useMedia","BREAKPOINTS","MOBILE_AND_DOWN","isDesktop","TABLET_UP","width","useWindowSize","isVideoPlaying","setVideoPlaying","loopActive","setLoopActive","animateText","useCallback","videoElement","current","headingWrapElement","headingInnerWrapElement","buyButtonElement","currentTime","paused","S.TRANSITIONS","every","t","transition","mobile","desktop","tablet","timestamp","scale","transformScale","style","transform","transitionDuration","top","allTransitionsCompleted","lastTransition","length","responsiveTransition","revertScale","setTimeout","setProperty","cancelAnimationFrame","slides","sort","a","b","slide","slideIndex","findIndex","s","id","requestAnimationFrame","useEffect","productPage","handleLoopVideoPlay","loopVideo","play","handleVideoEnded","addEventListener","removeEventListener","finally","pause","aspectRatio","useMemo","round","height","iconBreakPoint","reduce","acc","icon","boxWidth","ICON_DEFAULT_BOX_WIDTH","ICON_GAP","isIconBreakPoint","jsxs","S.Wrap","Wrap","$hasIcons","children","jsx","Fragment","map","i","S.Slide","active","text","S.HeadingWrap","ref","$contentMaxWidth","S.HeadingInnerWrap","HeadingInnerWrap","S.Title","S.Subtitle","S.HomepageButtonWrap","S.HomepageBuyButton","S.ProductPageHeadingWrap","ProductPageHeadingWrap","$marginTop","S.ProductPageSubtitle","S.ProductPageTitle","S.ProductPageDescription","S.ProductPageButtonWrap","S.ProductPageBuyButton","S.VideoOuterWrap","S.VideoWrap","$variant","S.TopGradient","S.BottomGradient","S.VideoInnerWrap","VideoInnerWrap","clientWidth","S.HorizontalShadows","S.HorizontalShadowLeft","S.HorizontalShadowRight","HorizontalShadowRight","S.PosterImage","src","poster","alt","S.Video","Video","autoPlay","muted","playsInline","controlsList","position","display","zIndex","background","onLoadedData","onPlay","preload","S.IconsWrap","$iconBreakPoint","index","S.IconItem","IconItem","$width","$maxWidth","Math","max","S.IconItemIcon","IconItemIcon","S.IconItemLabel","labelWidth","label"],"mappings":";;;;;;;;;;;;;;;;AASO,MAAMA,gBAAgBA,CAAC;EAC5BC,KAAA;EACAC,QAAA;EACAC,WAAA;EACAC,cAAA;EACAC,SAAA;EACAC,YAAA;EACAC,KAAA;EACAC,IAAA;EACAC,SAAA;EACAC,UAAUC,mBAAY,CAAAA,WAAA,CAAAC,QAAA;EACtBC,oBAAA;EACAC,eAAA;EACAC,KAAA;EACAC,WAAa,EAAAC;AACf,CAA0B,KAAA;EAClB,MAAAC,QAAA,GAAWC,aAAyB,IAAI,CAAA;EACxC,MAAAC,iBAAA,GAAoBD,aAAuB,IAAI,CAAA;EAC/C,MAAAE,YAAA,GAAeF,aAAyB,IAAI,CAAA;EAC5C,MAAAG,cAAA,GAAiBH,aAAuB,IAAI,CA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KAAAsE,IAAA,CAAKC,IAAIxE,GAAKC,EAAAA,KAAAA,CAAKC,YAAYC,2CAAsB,CAAA,EACvD,CACF,CAAA;QACA8D,eAAiB,EAAAnE,cAAA;QAEjBY,QAAA,EAAA,CAAA,eAAAC,UAAA,CAAAA,GAAA,CAAC8D,oBAAE,CAAAC,YAAA,EAAF;UACC1B,KAAK/C,IAAK,CAAA+C,GAAA;UACV/G,OAAOgE,IAAK,CAAAhE,KAAA;UACZ4D,QAAQI,IAAK,CAAAJ;QAAA,CACf,CAAA,EAAA,eAEAc,cAAA,CAACgE,oBAAAA,CAAAA,aAAA,EAAA;UAAgBL,WAAWrE,IAAK,CAAA2E,UAAA;UAC9BlE,eAAKmE;SACR,CAAA;MAAA,CAAA,EAlB0B,qBAAA5E,IAAA,CAAKnB,EAAE,IAAIoF,KAAK,EAoB7C,CAAA;KACH,CAAA;EAEJ,CAAA,CAAA;AAEJ,CAAA;"}
@@ -1,7 +1,7 @@
1
1
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
2
  import round from 'lodash/round';
3
3
  import { useRef, useState, useCallback, useEffect, useMemo } from 'react';
4
- import { useMedia, useWindowSize, useMeasure } from 'react-use';
4
+ import { useMedia, useWindowSize } from 'react-use';
5
5
  import { BREAKPOINTS } from '../../constants/layout.mjs';
6
6
  import { TRANSITIONS, ICON_DEFAULT_BOX_WIDTH, ICON_GAP, Wrap, Slide, HeadingWrap, HeadingInnerWrap, Title, Subtitle, HomepageButtonWrap, HomepageBuyButton, ProductPageHeadingWrap, ProductPageSubtitle, ProductPageTitle, ProductPageDescription, ProductPageButtonWrap, ProductPageBuyButton, VideoOuterWrap, VideoWrap, TopGradient, BottomGradient, VideoInnerWrap, HorizontalShadows, HorizontalShadowLeft, HorizontalShadowRight, PosterImage, Video, IconsWrap, IconItem, IconItemIcon, IconItemLabel } from './MicrositeHero.styles.mjs';
7
7
  import { HeroVariant } from './MicrositeHero.types.mjs';
@@ -20,8 +20,7 @@ const MicrositeHero = ({
20
20
  enableBottomGradient,
21
21
  contentMaxWidth,
22
22
  icons,
23
- transitions: customTransitions,
24
- id
23
+ transitions: customTransitions
25
24
  }) => {
26
25
  const videoRef = useRef(null);
27
26
  const videoInnerWrapRef = useRef(null);
@@ -36,9 +35,6 @@ const MicrositeHero = ({
36
35
  const {
37
36
  width
38
37
  } = useWindowSize();
39
- const [videoOuterWrapRef, {
40
- width: videoOuterWrapWidth
41
- }] = useMeasure();
42
38
  const [isVideoPlaying, setVideoPlaying] = useState(false);
43
39
  const [loopActive, setLoopActive] = useState(false);
44
40
  const animateText = useCallback(() => {
@@ -138,7 +134,7 @@ const MicrositeHero = ({
138
134
  } catch {}
139
135
  }, []);
140
136
  const aspectRatio = useMemo(() => {
141
- return round(video.width / video.height, 2);
137
+ return round(video.width / video.height, 1);
142
138
  }, [video.height, video.width]);
143
139
  const iconBreakPoint = useMemo(() => {
144
140
  if (!icons?.length) {
@@ -149,14 +145,9 @@ const MicrositeHero = ({
149
145
  }, 0);
150
146
  }, [icons]);
151
147
  const isIconBreakPoint = useMedia(`(max-width: ${iconBreakPoint - 1}px)`, false);
152
- const showHorizontalGradient = useMemo(() => {
153
- const videoWidth = videoRef.current?.clientWidth ?? video.width;
154
- return width > Math.min(videoWidth, videoOuterWrapWidth);
155
- }, [video.width, videoOuterWrapWidth, width]);
156
148
  return /* @__PURE__ */jsxs(Wrap, {
157
149
  className,
158
150
  $hasIcons: !!icons?.length,
159
- id,
160
151
  children: [video.slides?.length ? /* @__PURE__ */jsx(Fragment, {
161
152
  children: video.slides.map((slide, i) => /* @__PURE__ */jsx(Slide, {
162
153
  active: i === currentSlide,
@@ -199,14 +190,13 @@ const MicrositeHero = ({
199
190
  }), customButton]
200
191
  })]
201
192
  }), /* @__PURE__ */jsx(VideoOuterWrap, {
202
- ref: videoOuterWrapRef,
203
193
  children: /* @__PURE__ */jsxs(VideoWrap, {
204
194
  aspectRatio,
205
195
  $variant: variant,
206
196
  children: [/* @__PURE__ */jsx(TopGradient, {}), (enableBottomGradient || icons?.length && isIconBreakPoint) && /* @__PURE__ */jsx(BottomGradient, {}), /* @__PURE__ */jsxs(VideoInnerWrap, {
207
197
  $variant: variant,
208
198
  ref: videoInnerWrapRef,
209
- children: [showHorizontalGradient && /* @__PURE__ */jsxs(HorizontalShadows, {
199
+ children: [videoInnerWrapRef.current?.clientWidth && width >= videoInnerWrapRef.current?.clientWidth && /* @__PURE__ */jsxs(HorizontalShadows, {
210
200
  children: [/* @__PURE__ */jsx(HorizontalShadowLeft, {}), /* @__PURE__ */jsx(HorizontalShadowRight, {})]
211
201
  }), !isVideoPlaying && /* @__PURE__ */jsx(PosterImage, {
212
202
  src: video?.poster,
@@ -1 +1 @@
1
- {"version":3,"file":"MicrositeHero.mjs","sources":["../../../src/components/MicrositeHero/MicrositeHero.tsx"],"sourcesContent":["import round from \"lodash/round\";\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { useMeasure, useMedia, useWindowSize } from \"react-use\";\n\nimport { BREAKPOINTS } from \"../../constants/layout\";\nimport * as S from \"./MicrositeHero.styles\";\nimport { ICON_DEFAULT_BOX_WIDTH, ICON_GAP } from \"./MicrositeHero.styles\";\nimport { HeroVariant, type MicrositeHeroProps } from \"./MicrositeHero.types\";\n\nexport const MicrositeHero = ({\n title,\n subtitle,\n description,\n titleMarginTop,\n buyButton,\n customButton,\n video,\n loop,\n className,\n variant = HeroVariant.homepage,\n enableBottomGradient,\n contentMaxWidth,\n icons,\n transitions: customTransitions,\n id,\n}: MicrositeHeroProps) => {\n const videoRef = useRef<HTMLVideoElement>(null);\n const videoInnerWrapRef = useRef<HTMLDivElement>(null);\n const loopVideoRef = useRef<HTMLVideoElement>(null);\n const headingWrapRef = useRef<HTMLDivElement>(null);\n const headingInnerWrapRef = useRef<HTMLDivElement>(null);\n const buyButtonRef = useRef<HTMLDivElement>(null);\n const frameRef = useRef<number>(0);\n\n const [currentSlide, setCurrentSlide] = useState(0);\n\n const isMobile = useMedia(BREAKPOINTS.MOBILE_AND_DOWN, false);\n const isDesktop = useMedia(BREAKPOINTS.TABLET_UP, false);\n const { width } = useWindowSize();\n const [videoOuterWrapRef, { width: videoOuterWrapWidth }] =\n useMeasure<HTMLDivElement>();\n\n const [isVideoPlaying, setVideoPlaying] = useState(false);\n const [loopActive, setLoopActive] = useState(false);\n\n const animateText = useCallback(() => {\n const videoElement = videoRef.current;\n const headingWrapElement = headingWrapRef.current;\n const headingInnerWrapElement = headingInnerWrapRef.current;\n const buyButtonElement = buyButtonRef.current;\n\n if (!videoElement) {\n return;\n }\n\n const currentTime = videoElement.currentTime;\n\n if (\n !videoElement?.paused &&\n headingWrapElement &&\n headingInnerWrapElement\n ) {\n const transitions = customTransitions ?? S.TRANSITIONS;\n\n /**\n * Transitions needs to be in descending order based on timestamps of the video\n */\n transitions.every((t) => {\n const transition = isMobile\n ? t.mobile\n : isDesktop\n ? t.desktop\n : t.tablet;\n\n if (currentTime > t.timestamp) {\n const scale = transition.transformScale ?? 1;\n\n headingInnerWrapElement.style.transform = `scale3d(${scale}, ${scale}, ${scale})`;\n headingWrapElement.style.transitionDuration = `${\n transition.transitionDuration ?? 0\n }ms`;\n headingWrapElement.style.top = transition.top;\n\n return false;\n }\n\n return true;\n });\n\n /**\n * When all transitions completed, fade in the BuyButton\n * after the last transition is completed\n */\n const allTransitionsCompleted = transitions.every(\n (t) => currentTime > t.timestamp,\n );\n\n if (allTransitionsCompleted) {\n const lastTransition = transitions?.[transitions.length - 1];\n\n const responsiveTransition = lastTransition\n ? isMobile\n ? lastTransition.mobile\n : isDesktop\n ? lastTransition.desktop\n : lastTransition.tablet\n : null;\n\n const transitionDuration =\n responsiveTransition?.transitionDuration ?? 0;\n\n const revertScale = 1 / (responsiveTransition?.transformScale ?? 1);\n\n setTimeout(() => {\n buyButtonElement?.style.setProperty(\"opacity\", \"1\");\n buyButtonElement?.style.setProperty(\n \"transform\",\n `scale(${revertScale})`,\n );\n }, transitionDuration);\n\n cancelAnimationFrame(frameRef.current);\n return;\n }\n }\n\n // Reverse slide order for easier comparison\n const slides = [...(video?.slides ?? [])]?.sort(\n (a, b) => b.timestamp - a.timestamp,\n );\n\n if (slides?.length) {\n slides?.every((slide) => {\n if (currentTime > slide.timestamp) {\n const slideIndex = video.slides?.findIndex((s) => s.id === slide.id);\n\n if (slideIndex !== undefined && currentSlide !== slideIndex) {\n setCurrentSlide(slideIndex);\n }\n return false;\n }\n\n return true;\n });\n }\n\n frameRef.current = requestAnimationFrame(animateText);\n }, [currentSlide, customTransitions, isDesktop, isMobile, video.slides]);\n\n useEffect(() => {\n if (variant === HeroVariant.productPage) {\n // We are not animating on product pages\n return;\n }\n\n frameRef.current = requestAnimationFrame(animateText);\n\n return () => {\n cancelAnimationFrame(frameRef.current);\n };\n }, [animateText, variant]);\n\n const handleLoopVideoPlay = useCallback(() => {\n const loopVideo = loopVideoRef.current;\n\n if (!loopVideo) {\n return;\n }\n\n loopVideo.play();\n }, []);\n\n useEffect(() => {\n const video = videoRef.current;\n\n const handleVideoEnded = () => {\n setLoopActive(true);\n\n handleLoopVideoPlay();\n };\n\n video?.addEventListener(\"ended\", handleVideoEnded);\n\n return () => {\n video?.removeEventListener(\"ended\", handleVideoEnded);\n };\n }, [handleLoopVideoPlay]);\n\n /**\n * Hack for forcing the iOS video to preload\n */\n useEffect(() => {\n const loopVideo = loopVideoRef.current;\n\n if (!loopVideo) {\n return;\n }\n\n try {\n loopVideo?.play().finally(() => {\n setTimeout(() => {\n try {\n loopVideo?.pause();\n\n setTimeout(() => {\n loopVideo.currentTime = 0;\n }, 500);\n } catch {\n // Fail silently\n }\n }, 1000);\n });\n } catch {\n // Fail silently\n }\n }, []);\n\n const aspectRatio = useMemo(() => {\n return round(video.width / video.height, 2);\n }, [video.height, video.width]);\n\n const iconBreakPoint = useMemo(() => {\n if (!icons?.length) {\n return 0;\n }\n return icons?.reduce((acc, icon) => {\n return acc + (icon.boxWidth || ICON_DEFAULT_BOX_WIDTH) + ICON_GAP;\n }, 0);\n }, [icons]);\n\n const isIconBreakPoint = useMedia(\n `(max-width: ${iconBreakPoint - 1}px)`,\n false,\n );\n\n // #############################################################################\n // Gradient\n // #############################################################################\n const showHorizontalGradient = useMemo(() => {\n /**\n * If video is not loaded, the clientWidth will be 0.\n * Therefore, we need to fallback to the video width provided\n * in the props (they actually should match, but we take the safe route by\n * relying on the client width first)\n */\n const videoWidth = videoRef.current?.clientWidth ?? video.width;\n\n /**\n * Show the gradient only if the window width is greater than or equal to the\n * video width\n */\n return width > Math.min(videoWidth, videoOuterWrapWidth);\n }, [video.width, videoOuterWrapWidth, width]);\n\n // #############################################################################\n // Render\n // #############################################################################\n return (\n <S.Wrap className={className} $hasIcons={!!icons?.length} id={id}>\n {video.slides?.length ? (\n <>\n {video.slides.map((slide, i) => (\n <S.Slide key={slide.id} active={i === currentSlide}>\n {slide.text}\n </S.Slide>\n ))}\n </>\n ) : variant === HeroVariant.homepage ? (\n // HOME PAGE VARIANT\n <S.HeadingWrap ref={headingWrapRef} $contentMaxWidth={contentMaxWidth}>\n <S.HeadingInnerWrap ref={headingInnerWrapRef}>\n {title && <S.Title>{title}</S.Title>}\n {subtitle && <S.Subtitle>{subtitle}</S.Subtitle>}\n {buyButton && (\n <S.HomepageButtonWrap ref={buyButtonRef}>\n <S.HomepageBuyButton {...buyButton} />\n </S.HomepageButtonWrap>\n )}\n </S.HeadingInnerWrap>\n </S.HeadingWrap>\n ) : (\n // PRODUCT PAGE VARIANT\n <S.ProductPageHeadingWrap\n $contentMaxWidth={contentMaxWidth}\n $marginTop={titleMarginTop}\n >\n {subtitle && (\n <S.ProductPageSubtitle>{subtitle}</S.ProductPageSubtitle>\n )}\n {title && <S.ProductPageTitle>{title}</S.ProductPageTitle>}\n {description && (\n <S.ProductPageDescription>{description}</S.ProductPageDescription>\n )}\n <S.ProductPageButtonWrap>\n {buyButton && <S.ProductPageBuyButton {...buyButton} />}\n {customButton}\n </S.ProductPageButtonWrap>\n </S.ProductPageHeadingWrap>\n )}\n\n <S.VideoOuterWrap ref={videoOuterWrapRef}>\n <S.VideoWrap aspectRatio={aspectRatio} $variant={variant}>\n <S.TopGradient />\n {(enableBottomGradient || (icons?.length && isIconBreakPoint)) && (\n <S.BottomGradient />\n )}\n <S.VideoInnerWrap $variant={variant} ref={videoInnerWrapRef}>\n {showHorizontalGradient && (\n <S.HorizontalShadows>\n <S.HorizontalShadowLeft />\n <S.HorizontalShadowRight />\n </S.HorizontalShadows>\n )}\n {/**\n * Put poster here to avoid showing play button on iOS when in low power mode\n */}\n {!isVideoPlaying && <S.PosterImage src={video?.poster} alt=\"\" />}\n <S.Video\n ref={videoRef}\n $variant={variant}\n autoPlay\n muted\n /**\n * If loop video available, hide the main video\n */\n loop={!loop}\n src={video?.src}\n playsInline\n controlsList=\"nodownload\"\n style={{\n position: \"absolute\",\n display: loopActive ? \"none\" : \"block\",\n zIndex: 10,\n background: \"none\",\n }}\n onLoadedData={() => {\n // NOTE: Hack for iOS/Safari\n if (videoRef.current) {\n try {\n videoRef.current.pause();\n videoRef.current.play();\n } catch {\n // Fail silently\n }\n }\n }}\n onPlay={() => {\n if (videoRef.current)\n videoRef.current.style.background = \"transparent\";\n\n setVideoPlaying(true);\n }}\n />\n\n {loop && (\n <S.Video\n ref={loopVideoRef}\n $variant={variant}\n preload=\"auto\"\n muted\n loop\n controlsList=\"nodownload\"\n poster={loop.poster}\n src={loop.src}\n playsInline\n />\n )}\n </S.VideoInnerWrap>\n </S.VideoWrap>\n </S.VideoOuterWrap>\n {!!icons?.length && (\n <S.IconsWrap $iconBreakPoint={iconBreakPoint}>\n {icons.map((icon, index) => (\n <S.IconItem\n key={`hero-section-icon-${icon.id}-${index}`}\n $width={icon.boxWidth}\n className={icon.className}\n $maxWidth={icons.reduce(\n (acc, icon) =>\n Math.max(acc, icon.boxWidth || ICON_DEFAULT_BOX_WIDTH),\n 0,\n )}\n $iconBreakPoint={iconBreakPoint}\n >\n <S.IconItemIcon\n src={icon.src}\n width={icon.width}\n height={icon.height}\n />\n\n <S.IconItemLabel $maxWidth={icon.labelWidth}>\n {icon.label}\n </S.IconItemLabel>\n </S.IconItem>\n ))}\n </S.IconsWrap>\n )}\n </S.Wrap>\n );\n};\n"],"names":["MicrositeHero","title","subtitle","description","titleMarginTop","buyButton","customButton","video","loop","className","variant","HeroVariant","homepage","enableBottomGradient","contentMaxWidth","icons","transitions","customTransitions","id","videoRef","useRef","videoInnerWrapRef","loopVideoRef","headingWrapRef","headingInnerWrapRef","buyButtonRef","frameRef","currentSlide","setCurrentSlide","useState","isMobile","useMedia","BREAKPOINTS","MOBILE_AND_DOWN","isDesktop","TABLET_UP","width","useWindowSize","videoOuterWrapRef","videoOuterWrapWidth","useMeasure","isVideoPlaying","setVideoPlaying","loopActive","setLoopActive","animateText","useCallback","videoElement","current","headingWrapElement","headingInnerWrapElement","buyButtonElement","currentTime","paused","S.TRANSITIONS","every","t","transition","mobile","desktop","tablet","timestamp","scale","transformScale","style","transform","transitionDuration","top","allTransitionsCompleted","lastTransition","length","responsiveTransition","revertScale","setTimeout","setProperty","cancelAnimationFrame","slides","sort","a","b","slide","slideIndex","findIndex","s","requestAnimationFrame","useEffect","productPage","handleLoopVideoPlay","loopVideo","play","handleVideoEnded","addEventListener","removeEventListener","finally","pause","aspectRatio","useMemo","round","height","iconBreakPoint","reduce","acc","icon","boxWidth","ICON_DEFAULT_BOX_WIDTH","ICON_GAP","isIconBreakPoint","showHorizontalGradient","videoWidth","clientWidth","Math","min","jsxs","S.Wrap","$hasIcons","children","jsx","Fragment","map","i","S.Slide","active","text","S.HeadingWrap","ref","$contentMaxWidth","S.HeadingInnerWrap","S.Title","S.Subtitle","S.HomepageButtonWrap","S.HomepageBuyButton","S.ProductPageHeadingWrap","$marginTop","S.ProductPageSubtitle","S.ProductPageTitle","S.ProductPageDescription","S.ProductPageButtonWrap","S.ProductPageBuyButton","S.VideoOuterWrap","S.VideoWrap","$variant","S.TopGradient","S.BottomGradient","S.VideoInnerWrap","S.HorizontalShadows","S.HorizontalShadowLeft","S.HorizontalShadowRight","S.PosterImage","src","poster","alt","S.Video","autoPlay","muted","playsInline","controlsList","position","display","zIndex","background","onLoadedData","onPlay","preload","S.IconsWrap","$iconBreakPoint","index","S.IconItem","$width","$maxWidth","max","S.IconItemIcon","S.IconItemLabel","labelWidth","label"],"mappings":";;;;;;;;AASO,MAAMA,gBAAgBA,CAAC;EAC5BC,KAAA;EACAC,QAAA;EACAC,WAAA;EACAC,cAAA;EACAC,SAAA;EACAC,YAAA;EACAC,KAAA;EACAC,IAAA;EACAC,SAAA;EACAC,UAAUC,WAAY,CAAAC,QAAA;EACtBC,oBAAA;EACAC,eAAA;EACAC,KAAA;EACAC,WAAa,EAAAC,iBAAA;EACbC;AACF,CAA0B,KAAA;EAClB,MAAAC,QAAA,GAAWC,OAAyB,IAAI,CAAA;EACxC,MAAAC,iBAAA,GAAoBD,OAAuB,IAAI,CAAA;EAC/C,MAAAE,YAAA,GAAeF,OAAyB,IAAI,CAAA;EAC5C,MAAAG,cAAA,GAAiBH,OAAuB,IAAI,CAAA;EAC5C,MAAAI,mBAAA,GAAsBJ,OAAuB,IAAI,CAAA;EACjD,MAAAK,YAAA,GAAeL,OAAuB,IAAI,CAAA;EAC1C,MAAAM,QAAA,GAAWN,OAAe,CAAC,CAAA;EAEjC,MAAM,CAACO,YAAA,EAAcC,eAAe,CAAA,GAAIC,SAAS,CAAC,CAAA;EAElD,MAAMC,QAAW,GAAAC,QAAA,CAASC,WAAY,CAAAC,eAAA,EAAiB,KAAK,CAAA;EAC5D,MAAMC,SAAY,GAAAH,QAAA,CAASC,WAAY,CAAAG,SAAA,EAAW,KAAK,CAAA;EACjD,MAAA;IAAEC;GAAM,GAAIC,aAAc,EAAA;EAChC,MAAM,CAACC,iBAAmB,EAAA;IAAEF,OAAOG;EAAqB,CAAA,IACtDC,UAA2B,EAAA;EAE7B,MAAM,CAACC,cAAA,EAAgBC,eAAe,CAAA,GAAIb,SAAS,KAAK,CAAA;EACxD,MAAM,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6F,IAAK,CAAA7F,SAAA;QAChB+J,WAAWzJ,KAAM,CAAAqF,MAAA,CACf,CAACC,KAAKC,KACJ,KAAAQ,IAAA,CAAK2D,IAAIpE,GAAKC,EAAAA,KAAAA,CAAKC,YAAYC,sBAAsB,CAAA,EACvD,CACF,CAAA;QACA4D,eAAiB,EAAAjE,cAAA;QAEjBgB,QAAA,EAAA,CAAA,eAAAC,GAAA,CAACsD,YAAE,EAAF;UACCtB,KAAK9C,IAAK,CAAA8C,GAAA;UACVhH,OAAOkE,IAAK,CAAAlE,KAAA;UACZ8D,QAAQI,IAAK,CAAAJ;QAAA,CACf,CAAA,EAAA,eAEAkB,GAAA,CAACuD,aAAA,EAAA;UAAgBH,WAAWlE,IAAK,CAAAsE,UAAA;UAC9BzD,eAAK0D;SACR,CAAA;MAAA,CAAA,EAlB0B,qBAAAvE,IAAA,CAAKpF,EAAE,IAAImJ,KAAK,EAoB7C,CAAA;KACH,CAAA;EAEJ,CAAA,CAAA;AAEJ,CAAA;"}
1
+ {"version":3,"file":"MicrositeHero.mjs","sources":["../../../src/components/MicrositeHero/MicrositeHero.tsx"],"sourcesContent":["import round from \"lodash/round\";\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { useMedia, useWindowSize } from \"react-use\";\n\nimport { BREAKPOINTS } from \"../../constants/layout\";\nimport * as S from \"./MicrositeHero.styles\";\nimport { ICON_DEFAULT_BOX_WIDTH, ICON_GAP } from \"./MicrositeHero.styles\";\nimport { HeroVariant, type MicrositeHeroProps } from \"./MicrositeHero.types\";\n\nexport const MicrositeHero = ({\n title,\n subtitle,\n description,\n titleMarginTop,\n buyButton,\n customButton,\n video,\n loop,\n className,\n variant = HeroVariant.homepage,\n enableBottomGradient,\n contentMaxWidth,\n icons,\n transitions: customTransitions,\n}: MicrositeHeroProps) => {\n const videoRef = useRef<HTMLVideoElement>(null);\n const videoInnerWrapRef = useRef<HTMLDivElement>(null);\n const loopVideoRef = useRef<HTMLVideoElement>(null);\n const headingWrapRef = useRef<HTMLDivElement>(null);\n const headingInnerWrapRef = useRef<HTMLDivElement>(null);\n const buyButtonRef = useRef<HTMLDivElement>(null);\n const frameRef = useRef<number>(0);\n\n const [currentSlide, setCurrentSlide] = useState(0);\n\n const isMobile = useMedia(BREAKPOINTS.MOBILE_AND_DOWN, false);\n const isDesktop = useMedia(BREAKPOINTS.TABLET_UP, false);\n const { width } = useWindowSize();\n\n const [isVideoPlaying, setVideoPlaying] = useState(false);\n const [loopActive, setLoopActive] = useState(false);\n\n const animateText = useCallback(() => {\n const videoElement = videoRef.current;\n const headingWrapElement = headingWrapRef.current;\n const headingInnerWrapElement = headingInnerWrapRef.current;\n const buyButtonElement = buyButtonRef.current;\n\n if (!videoElement) {\n return;\n }\n\n const currentTime = videoElement.currentTime;\n\n if (\n !videoElement?.paused &&\n headingWrapElement &&\n headingInnerWrapElement\n ) {\n const transitions = customTransitions ?? S.TRANSITIONS;\n\n /**\n * Transitions needs to be in descending order based on timestamps of the video\n */\n transitions.every((t) => {\n const transition = isMobile\n ? t.mobile\n : isDesktop\n ? t.desktop\n : t.tablet;\n\n if (currentTime > t.timestamp) {\n const scale = transition.transformScale ?? 1;\n\n headingInnerWrapElement.style.transform = `scale3d(${scale}, ${scale}, ${scale})`;\n headingWrapElement.style.transitionDuration = `${\n transition.transitionDuration ?? 0\n }ms`;\n headingWrapElement.style.top = transition.top;\n\n return false;\n }\n\n return true;\n });\n\n /**\n * When all transitions completed, fade in the BuyButton\n * after the last transition is completed\n */\n const allTransitionsCompleted = transitions.every(\n (t) => currentTime > t.timestamp,\n );\n\n if (allTransitionsCompleted) {\n const lastTransition = transitions?.[transitions.length - 1];\n\n const responsiveTransition = lastTransition\n ? isMobile\n ? lastTransition.mobile\n : isDesktop\n ? lastTransition.desktop\n : lastTransition.tablet\n : null;\n\n const transitionDuration =\n responsiveTransition?.transitionDuration ?? 0;\n\n const revertScale = 1 / (responsiveTransition?.transformScale ?? 1);\n\n setTimeout(() => {\n buyButtonElement?.style.setProperty(\"opacity\", \"1\");\n buyButtonElement?.style.setProperty(\n \"transform\",\n `scale(${revertScale})`,\n );\n }, transitionDuration);\n\n cancelAnimationFrame(frameRef.current);\n return;\n }\n }\n\n // Reverse slide order for easier comparison\n const slides = [...(video?.slides ?? [])]?.sort(\n (a, b) => b.timestamp - a.timestamp,\n );\n\n if (slides?.length) {\n slides?.every((slide) => {\n if (currentTime > slide.timestamp) {\n const slideIndex = video.slides?.findIndex((s) => s.id === slide.id);\n\n if (slideIndex !== undefined && currentSlide !== slideIndex) {\n setCurrentSlide(slideIndex);\n }\n return false;\n }\n\n return true;\n });\n }\n\n frameRef.current = requestAnimationFrame(animateText);\n }, [currentSlide, customTransitions, isDesktop, isMobile, video.slides]);\n\n useEffect(() => {\n if (variant === HeroVariant.productPage) {\n // We are not animating on product pages\n return;\n }\n\n frameRef.current = requestAnimationFrame(animateText);\n\n return () => {\n cancelAnimationFrame(frameRef.current);\n };\n }, [animateText, variant]);\n\n const handleLoopVideoPlay = useCallback(() => {\n const loopVideo = loopVideoRef.current;\n\n if (!loopVideo) {\n return;\n }\n\n loopVideo.play();\n }, []);\n\n useEffect(() => {\n const video = videoRef.current;\n\n const handleVideoEnded = () => {\n setLoopActive(true);\n\n handleLoopVideoPlay();\n };\n\n video?.addEventListener(\"ended\", handleVideoEnded);\n\n return () => {\n video?.removeEventListener(\"ended\", handleVideoEnded);\n };\n }, [handleLoopVideoPlay]);\n\n /**\n * Hack for forcing the iOS video to preload\n */\n useEffect(() => {\n const loopVideo = loopVideoRef.current;\n\n if (!loopVideo) {\n return;\n }\n\n try {\n loopVideo?.play().finally(() => {\n setTimeout(() => {\n try {\n loopVideo?.pause();\n\n setTimeout(() => {\n loopVideo.currentTime = 0;\n }, 500);\n } catch {\n // Fail silently\n }\n }, 1000);\n });\n } catch {\n // Fail silently\n }\n }, []);\n\n const aspectRatio = useMemo(() => {\n return round(video.width / video.height, 1);\n }, [video.height, video.width]);\n\n const iconBreakPoint = useMemo(() => {\n if (!icons?.length) {\n return 0;\n }\n return icons?.reduce((acc, icon) => {\n return acc + (icon.boxWidth || ICON_DEFAULT_BOX_WIDTH) + ICON_GAP;\n }, 0);\n }, [icons]);\n\n const isIconBreakPoint = useMedia(\n `(max-width: ${iconBreakPoint - 1}px)`,\n false,\n );\n\n // #############################################################################\n // Render\n // #############################################################################\n return (\n <S.Wrap className={className} $hasIcons={!!icons?.length}>\n {video.slides?.length ? (\n <>\n {video.slides.map((slide, i) => (\n <S.Slide key={slide.id} active={i === currentSlide}>\n {slide.text}\n </S.Slide>\n ))}\n </>\n ) : variant === HeroVariant.homepage ? (\n // HOME PAGE VARIANT\n <S.HeadingWrap ref={headingWrapRef} $contentMaxWidth={contentMaxWidth}>\n <S.HeadingInnerWrap ref={headingInnerWrapRef}>\n {title && <S.Title>{title}</S.Title>}\n {subtitle && <S.Subtitle>{subtitle}</S.Subtitle>}\n {buyButton && (\n <S.HomepageButtonWrap ref={buyButtonRef}>\n <S.HomepageBuyButton {...buyButton} />\n </S.HomepageButtonWrap>\n )}\n </S.HeadingInnerWrap>\n </S.HeadingWrap>\n ) : (\n // PRODUCT PAGE VARIANT\n <S.ProductPageHeadingWrap\n $contentMaxWidth={contentMaxWidth}\n $marginTop={titleMarginTop}\n >\n {subtitle && (\n <S.ProductPageSubtitle>{subtitle}</S.ProductPageSubtitle>\n )}\n {title && <S.ProductPageTitle>{title}</S.ProductPageTitle>}\n {description && (\n <S.ProductPageDescription>{description}</S.ProductPageDescription>\n )}\n <S.ProductPageButtonWrap>\n {buyButton && <S.ProductPageBuyButton {...buyButton} />}\n {customButton}\n </S.ProductPageButtonWrap>\n </S.ProductPageHeadingWrap>\n )}\n\n <S.VideoOuterWrap>\n <S.VideoWrap aspectRatio={aspectRatio} $variant={variant}>\n <S.TopGradient />\n {(enableBottomGradient || (icons?.length && isIconBreakPoint)) && (\n <S.BottomGradient />\n )}\n <S.VideoInnerWrap $variant={variant} ref={videoInnerWrapRef}>\n {videoInnerWrapRef.current?.clientWidth &&\n width >= videoInnerWrapRef.current?.clientWidth && (\n <S.HorizontalShadows>\n <S.HorizontalShadowLeft />\n <S.HorizontalShadowRight />\n </S.HorizontalShadows>\n )}\n {/**\n * Put poster here to avoid showing play button on iOS when in low power mode\n */}\n {!isVideoPlaying && <S.PosterImage src={video?.poster} alt=\"\" />}\n <S.Video\n ref={videoRef}\n $variant={variant}\n autoPlay\n muted\n /**\n * If loop video available, hide the main video\n */\n loop={!loop}\n src={video?.src}\n playsInline\n controlsList=\"nodownload\"\n style={{\n position: \"absolute\",\n display: loopActive ? \"none\" : \"block\",\n zIndex: 10,\n background: \"none\",\n }}\n onLoadedData={() => {\n // NOTE: Hack for iOS/Safari\n if (videoRef.current) {\n try {\n videoRef.current.pause();\n videoRef.current.play();\n } catch {\n // Fail silently\n }\n }\n }}\n onPlay={() => {\n if (videoRef.current)\n videoRef.current.style.background = \"transparent\";\n\n setVideoPlaying(true);\n }}\n />\n\n {loop && (\n <S.Video\n ref={loopVideoRef}\n $variant={variant}\n preload=\"auto\"\n muted\n loop\n controlsList=\"nodownload\"\n poster={loop.poster}\n src={loop.src}\n playsInline\n />\n )}\n </S.VideoInnerWrap>\n </S.VideoWrap>\n </S.VideoOuterWrap>\n {!!icons?.length && (\n <S.IconsWrap $iconBreakPoint={iconBreakPoint}>\n {icons.map((icon, index) => (\n <S.IconItem\n key={`hero-section-icon-${icon.id}-${index}`}\n $width={icon.boxWidth}\n className={icon.className}\n $maxWidth={icons.reduce(\n (acc, icon) =>\n Math.max(acc, icon.boxWidth || ICON_DEFAULT_BOX_WIDTH),\n 0,\n )}\n $iconBreakPoint={iconBreakPoint}\n >\n <S.IconItemIcon\n src={icon.src}\n width={icon.width}\n height={icon.height}\n />\n\n <S.IconItemLabel $maxWidth={icon.labelWidth}>\n {icon.label}\n </S.IconItemLabel>\n </S.IconItem>\n ))}\n </S.IconsWrap>\n )}\n </S.Wrap>\n );\n};\n"],"names":["MicrositeHero","title","subtitle","description","titleMarginTop","buyButton","customButton","video","loop","className","variant","HeroVariant","homepage","enableBottomGradient","contentMaxWidth","icons","transitions","customTransitions","videoRef","useRef","videoInnerWrapRef","loopVideoRef","headingWrapRef","headingInnerWrapRef","buyButtonRef","frameRef","currentSlide","setCurrentSlide","useState","isMobile","useMedia","BREAKPOINTS","MOBILE_AND_DOWN","isDesktop","TABLET_UP","width","useWindowSize","isVideoPlaying","setVideoPlaying","loopActive","setLoopActive","animateText","useCallback","videoElement","current","headingWrapElement","headingInnerWrapElement","buyButtonElement","currentTime","paused","S.TRANSITIONS","every","t","transition","mobile","desktop","tablet","timestamp","scale","transformScale","style","transform","transitionDuration","top","allTransitionsCompleted","lastTransition","length","responsiveTransition","revertScale","setTimeout","setProperty","cancelAnimationFrame","slides","sort","a","b","slide","slideIndex","findIndex","s","id","requestAnimationFrame","useEffect","productPage","handleLoopVideoPlay","loopVideo","play","handleVideoEnded","addEventListener","removeEventListener","finally","pause","aspectRatio","useMemo","round","height","iconBreakPoint","reduce","acc","icon","boxWidth","ICON_DEFAULT_BOX_WIDTH","ICON_GAP","isIconBreakPoint","jsxs","S.Wrap","$hasIcons","children","jsx","Fragment","map","i","S.Slide","active","text","S.HeadingWrap","ref","$contentMaxWidth","S.HeadingInnerWrap","S.Title","S.Subtitle","S.HomepageButtonWrap","S.HomepageBuyButton","S.ProductPageHeadingWrap","$marginTop","S.ProductPageSubtitle","S.ProductPageTitle","S.ProductPageDescription","S.ProductPageButtonWrap","S.ProductPageBuyButton","S.VideoOuterWrap","S.VideoWrap","$variant","S.TopGradient","S.BottomGradient","S.VideoInnerWrap","clientWidth","S.HorizontalShadows","S.HorizontalShadowLeft","S.HorizontalShadowRight","S.PosterImage","src","poster","alt","S.Video","autoPlay","muted","playsInline","controlsList","position","display","zIndex","background","onLoadedData","onPlay","preload","S.IconsWrap","$iconBreakPoint","index","S.IconItem","$width","$maxWidth","Math","max","S.IconItemIcon","S.IconItemLabel","labelWidth","label"],"mappings":";;;;;;;;AASO,MAAM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AAA;EAEJ,CAAA,CAAA;AAEJ,CAAA;"}
@@ -45,7 +45,6 @@ export interface MicrositeHeroProps {
45
45
  buyButton?: MicrositeBuyButtonProps;
46
46
  customButton?: ReactNode;
47
47
  variant?: HeroVariant;
48
- id?: string;
49
48
  /**
50
49
  * The maximum width (px) of the content (title and subtitle) tow wrap text like in the design
51
50
  * If not defined, the content will be full width
@@ -1 +1 @@
1
- {"version":3,"file":"MicrositeHero.types.js","sources":["../../../src/components/MicrositeHero/MicrositeHero.types.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\n\nimport type { MicrositeBuyButtonProps } from \"../MicrositeBuyButton\";\n\ntype Slide = {\n id: string;\n /**\n * Text to show on the current slide\n */\n text: ReactNode;\n /**\n * Timestamp at which the slide should be shown\n */\n timestamp: number;\n};\n\nexport enum HeroVariant {\n /**\n * The hero is shown on the homepage\n * NOTE: The design might often change for this variant\n */\n homepage = \"homepage\",\n /**\n * The hero is shown on the product pages\n */\n productPage = \"productPage\",\n}\n\ntype TransitionProperties = {\n transformScale: number;\n /** In milliseconds */\n transitionDuration: number;\n top: string;\n};\n\nexport type Transition = {\n timestamp: number;\n desktop: TransitionProperties;\n tablet: TransitionProperties;\n mobile: TransitionProperties;\n};\n\nexport interface MicrositeHeroProps {\n title?: ReactNode;\n subtitle?: string;\n description?: string;\n titleMarginTop?: number;\n /**\n * Shows Buy now button (only on product page variant)\n */\n buyButton?: MicrositeBuyButtonProps;\n customButton?: ReactNode;\n\n variant?: HeroVariant;\n id?: string;\n\n /**\n * The maximum width (px) of the content (title and subtitle) tow wrap text like in the design\n * If not defined, the content will be full width\n * @default undefined\n * @example 1200\n */\n contentMaxWidth?: number;\n video: {\n poster?: string;\n src: string;\n width: number;\n height: number;\n /**\n * Slides to show on the video\n * If slides defined, the video will be paused at the first slide\n */\n slides?: [Slide, ...Slide[]];\n };\n\n loop?: {\n poster?: string;\n src: string;\n width: number;\n height: number;\n };\n\n /**\n * Transitions to apply to the title and subtitle\n * Transitions needs to be in descending order based on timestamps of the video\n */\n transitions?: Transition[];\n\n /**\n * Whether to show the bottom gradient\n */\n enableBottomGradient?: boolean;\n\n icons?: {\n id: string;\n src: string;\n height: number;\n width: number;\n label: string;\n labelWidth?: number;\n boxWidth?: number;\n className?: string;\n }[];\n\n className?: string;\n}\n"],"names":["HeroVariant"],"mappings":";;;AAgBY,IAAAA,WAAA,GAAA,gBAAAA,YAAL,IAAA;EAKLA,aAAA,UAAW,CAAA,GAAA,UAAA;EAIXA,aAAA,aAAc,CAAA,GAAA,aAAA;EATJA,OAAAA,YAAAA;AAAA,CAAA,EAAAA,WAAA,IAAA,CAAA,CAAA,CAAA;"}
1
+ {"version":3,"file":"MicrositeHero.types.js","sources":["../../../src/components/MicrositeHero/MicrositeHero.types.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\n\nimport type { MicrositeBuyButtonProps } from \"../MicrositeBuyButton\";\n\ntype Slide = {\n id: string;\n /**\n * Text to show on the current slide\n */\n text: ReactNode;\n /**\n * Timestamp at which the slide should be shown\n */\n timestamp: number;\n};\n\nexport enum HeroVariant {\n /**\n * The hero is shown on the homepage\n * NOTE: The design might often change for this variant\n */\n homepage = \"homepage\",\n /**\n * The hero is shown on the product pages\n */\n productPage = \"productPage\",\n}\n\ntype TransitionProperties = {\n transformScale: number;\n /** In milliseconds */\n transitionDuration: number;\n top: string;\n};\n\nexport type Transition = {\n timestamp: number;\n desktop: TransitionProperties;\n tablet: TransitionProperties;\n mobile: TransitionProperties;\n};\n\nexport interface MicrositeHeroProps {\n title?: ReactNode;\n subtitle?: string;\n description?: string;\n titleMarginTop?: number;\n /**\n * Shows Buy now button (only on product page variant)\n */\n buyButton?: MicrositeBuyButtonProps;\n customButton?: ReactNode;\n\n variant?: HeroVariant;\n\n /**\n * The maximum width (px) of the content (title and subtitle) tow wrap text like in the design\n * If not defined, the content will be full width\n * @default undefined\n * @example 1200\n */\n contentMaxWidth?: number;\n video: {\n poster?: string;\n src: string;\n width: number;\n height: number;\n /**\n * Slides to show on the video\n * If slides defined, the video will be paused at the first slide\n */\n slides?: [Slide, ...Slide[]];\n };\n\n loop?: {\n poster?: string;\n src: string;\n width: number;\n height: number;\n };\n\n /**\n * Transitions to apply to the title and subtitle\n * Transitions needs to be in descending order based on timestamps of the video\n */\n transitions?: Transition[];\n\n /**\n * Whether to show the bottom gradient\n */\n enableBottomGradient?: boolean;\n\n icons?: {\n id: string;\n src: string;\n height: number;\n width: number;\n label: string;\n labelWidth?: number;\n boxWidth?: number;\n className?: string;\n }[];\n\n className?: string;\n}\n"],"names":["HeroVariant"],"mappings":";;;AAgBY,IAAAA,WAAA,GAAA,gBAAAA,YAAL,IAAA;EAKLA,aAAA,UAAW,CAAA,GAAA,UAAA;EAIXA,aAAA,aAAc,CAAA,GAAA,aAAA;EATJA,OAAAA,YAAAA;AAAA,CAAA,EAAAA,WAAA,IAAA,CAAA,CAAA,CAAA;"}
@@ -1 +1 @@
1
- {"version":3,"file":"MicrositeHero.types.mjs","sources":["../../../src/components/MicrositeHero/MicrositeHero.types.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\n\nimport type { MicrositeBuyButtonProps } from \"../MicrositeBuyButton\";\n\ntype Slide = {\n id: string;\n /**\n * Text to show on the current slide\n */\n text: ReactNode;\n /**\n * Timestamp at which the slide should be shown\n */\n timestamp: number;\n};\n\nexport enum HeroVariant {\n /**\n * The hero is shown on the homepage\n * NOTE: The design might often change for this variant\n */\n homepage = \"homepage\",\n /**\n * The hero is shown on the product pages\n */\n productPage = \"productPage\",\n}\n\ntype TransitionProperties = {\n transformScale: number;\n /** In milliseconds */\n transitionDuration: number;\n top: string;\n};\n\nexport type Transition = {\n timestamp: number;\n desktop: TransitionProperties;\n tablet: TransitionProperties;\n mobile: TransitionProperties;\n};\n\nexport interface MicrositeHeroProps {\n title?: ReactNode;\n subtitle?: string;\n description?: string;\n titleMarginTop?: number;\n /**\n * Shows Buy now button (only on product page variant)\n */\n buyButton?: MicrositeBuyButtonProps;\n customButton?: ReactNode;\n\n variant?: HeroVariant;\n id?: string;\n\n /**\n * The maximum width (px) of the content (title and subtitle) tow wrap text like in the design\n * If not defined, the content will be full width\n * @default undefined\n * @example 1200\n */\n contentMaxWidth?: number;\n video: {\n poster?: string;\n src: string;\n width: number;\n height: number;\n /**\n * Slides to show on the video\n * If slides defined, the video will be paused at the first slide\n */\n slides?: [Slide, ...Slide[]];\n };\n\n loop?: {\n poster?: string;\n src: string;\n width: number;\n height: number;\n };\n\n /**\n * Transitions to apply to the title and subtitle\n * Transitions needs to be in descending order based on timestamps of the video\n */\n transitions?: Transition[];\n\n /**\n * Whether to show the bottom gradient\n */\n enableBottomGradient?: boolean;\n\n icons?: {\n id: string;\n src: string;\n height: number;\n width: number;\n label: string;\n labelWidth?: number;\n boxWidth?: number;\n className?: string;\n }[];\n\n className?: string;\n}\n"],"names":["HeroVariant"],"mappings":";;AAgBY,IAAAA,WAAA,GAAA,gBAAAA,YAAL,IAAA;EAKLA,aAAA,UAAW,CAAA,GAAA,UAAA;EAIXA,aAAA,aAAc,CAAA,GAAA,aAAA;EATJA,OAAAA,YAAAA;AAAA,CAAA,EAAAA,WAAA,IAAA,CAAA,CAAA,CAAA;"}
1
+ {"version":3,"file":"MicrositeHero.types.mjs","sources":["../../../src/components/MicrositeHero/MicrositeHero.types.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\n\nimport type { MicrositeBuyButtonProps } from \"../MicrositeBuyButton\";\n\ntype Slide = {\n id: string;\n /**\n * Text to show on the current slide\n */\n text: ReactNode;\n /**\n * Timestamp at which the slide should be shown\n */\n timestamp: number;\n};\n\nexport enum HeroVariant {\n /**\n * The hero is shown on the homepage\n * NOTE: The design might often change for this variant\n */\n homepage = \"homepage\",\n /**\n * The hero is shown on the product pages\n */\n productPage = \"productPage\",\n}\n\ntype TransitionProperties = {\n transformScale: number;\n /** In milliseconds */\n transitionDuration: number;\n top: string;\n};\n\nexport type Transition = {\n timestamp: number;\n desktop: TransitionProperties;\n tablet: TransitionProperties;\n mobile: TransitionProperties;\n};\n\nexport interface MicrositeHeroProps {\n title?: ReactNode;\n subtitle?: string;\n description?: string;\n titleMarginTop?: number;\n /**\n * Shows Buy now button (only on product page variant)\n */\n buyButton?: MicrositeBuyButtonProps;\n customButton?: ReactNode;\n\n variant?: HeroVariant;\n\n /**\n * The maximum width (px) of the content (title and subtitle) tow wrap text like in the design\n * If not defined, the content will be full width\n * @default undefined\n * @example 1200\n */\n contentMaxWidth?: number;\n video: {\n poster?: string;\n src: string;\n width: number;\n height: number;\n /**\n * Slides to show on the video\n * If slides defined, the video will be paused at the first slide\n */\n slides?: [Slide, ...Slide[]];\n };\n\n loop?: {\n poster?: string;\n src: string;\n width: number;\n height: number;\n };\n\n /**\n * Transitions to apply to the title and subtitle\n * Transitions needs to be in descending order based on timestamps of the video\n */\n transitions?: Transition[];\n\n /**\n * Whether to show the bottom gradient\n */\n enableBottomGradient?: boolean;\n\n icons?: {\n id: string;\n src: string;\n height: number;\n width: number;\n label: string;\n labelWidth?: number;\n boxWidth?: number;\n className?: string;\n }[];\n\n className?: string;\n}\n"],"names":["HeroVariant"],"mappings":";;AAgBY,IAAAA,WAAA,GAAA,gBAAAA,YAAL,IAAA;EAKLA,aAAA,UAAW,CAAA,GAAA,UAAA;EAIXA,aAAA,aAAc,CAAA,GAAA,aAAA;EATJA,OAAAA,YAAAA;AAAA,CAAA,EAAAA,WAAA,IAAA,CAAA,CAAA,CAAA;"}
@@ -5,7 +5,6 @@ var react = require('react');
5
5
  require('../../contexts/MenuContext/index.js');
6
6
  var MicrositePageContext = require('../Microsites/MicrositePageContext.js');
7
7
  var Microsites_types = require('../Microsites/Microsites.types.js');
8
- var MobileItem = require('./components/MobileItem.js');
9
8
  var MicrositeMediaGrid_styles = require('./MicrositeMediaGrid.styles.js');
10
9
  var MicrositeMediaGrid_types = require('./MicrositeMediaGrid.types.js');
11
10
  var context = require('../../contexts/MenuContext/context.js');
@@ -55,15 +54,24 @@ const GridItem = ({
55
54
  window.cancelAnimationFrame(animationFrame.current);
56
55
  };
57
56
  }, [playing, resetCurrentTime]);
58
- const Gradient = () => {
59
- return /* @__PURE__ */jsxRuntime.jsx(MicrositeMediaGrid_styles.Gradient, {
57
+ return /* @__PURE__ */jsxRuntime.jsxs(MicrositeMediaGrid_styles.Item, {
58
+ onMouseEnter,
59
+ onMouseLeave,
60
+ $motif: item.motif,
61
+ $gridRowStart: item.gridRowStart,
62
+ $gridRowEnd: item.gridRowEnd,
63
+ $aspectRatio: item.media.width / item.media.height,
64
+ $tabletAspectRatio: item.tabletAspectRatio,
65
+ $mobileAspectRatio: item.mobileAspectRatio,
66
+ $shadow: item.shadow,
67
+ $border: item.border,
68
+ className: item.className,
69
+ $contentPlacement: item.contentPlacement,
70
+ children: [item.gradient && item.contentPlacement !== "before" && /* @__PURE__ */jsxRuntime.jsx(MicrositeMediaGrid_styles.Gradient, {
60
71
  $motif: item.gradient,
61
72
  $props: item.gradientProps,
62
73
  className: item.gradientProps?.className
63
- });
64
- };
65
- const Content = () => {
66
- return /* @__PURE__ */jsxRuntime.jsxs(MicrositeMediaGrid_styles.Content, {
74
+ }), /* @__PURE__ */jsxRuntime.jsxs(MicrositeMediaGrid_styles.Content, {
67
75
  $placement: item.contentPlacement,
68
76
  $centered: item.centered,
69
77
  $stretch: !!item.customContent,
@@ -74,60 +82,33 @@ const GridItem = ({
74
82
  }), item.subTitle && /* @__PURE__ */jsxRuntime.jsx(MicrositeMediaGrid_styles.SubTitle, {
75
83
  children: item.subTitle
76
84
  }), item.customContent]
77
- });
78
- };
79
- return /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, {
80
- children: [/* @__PURE__ */jsxRuntime.jsxs(MicrositeMediaGrid_styles.Item, {
81
- onMouseEnter,
82
- onMouseLeave,
83
- $motif: item.motif,
84
- $gridRowStart: item.gridRowStart,
85
- $gridRowEnd: item.gridRowEnd,
86
- $aspectRatio: item.media.width / item.media.height,
87
- $tabletAspectRatio: item.tabletAspectRatio,
88
- $mobileAspectRatio: item.mobileAspectRatio,
89
- $mobileMediaExists: Boolean(item.mobileMedia),
90
- $shadow: item.shadow,
91
- $border: item.border,
92
- className: item.className,
93
- $mobileAssetExists: Boolean(item.mobileMedia?.src),
94
- $contentPlacement: item.contentPlacement,
95
- children: [item.gradient && item.contentPlacement !== "before" && /* @__PURE__ */jsxRuntime.jsx(Gradient, {}), /* @__PURE__ */jsxRuntime.jsx(Content, {}), item.media.type === "image" && /* @__PURE__ */jsxRuntime.jsx(MicrositeMediaGrid_styles.Image, {
96
- sizes: "100%",
97
- responsive: true,
98
- objectFit: "cover",
99
- canFullscreen: item.media.canFullscreen,
100
- onFullscreenChange: isFullscreen => {
101
- if (isFullscreen) {
102
- context?.setActiveFullscreenType(Microsites_types.MicrositeBlockType.MediaGrid);
103
- }
104
- },
105
- asset: {
106
- src: item.media.src,
107
- width: item.media.width,
108
- height: item.media.height
85
+ }), item.media.type === "image" && /* @__PURE__ */jsxRuntime.jsx(MicrositeMediaGrid_styles.Image, {
86
+ sizes: "100%",
87
+ responsive: true,
88
+ objectFit: "cover",
89
+ canFullscreen: item.media.canFullscreen,
90
+ onFullscreenChange: isFullscreen => {
91
+ if (isFullscreen) {
92
+ context?.setActiveFullscreenType(Microsites_types.MicrositeBlockType.MediaGrid);
109
93
  }
110
- }), item.media.type === "video" && /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, {
111
- children: [/* @__PURE__ */jsxRuntime.jsx(MicrositeMediaGrid_styles.MediaVideo, {
112
- ref: videoRef,
113
- src: item.media.src,
114
- autoPlay: !item.media.playOnHover,
115
- loop: item.media.loop,
116
- playsInline: true,
117
- muted: true
118
- }), item.media.poster && /* @__PURE__ */jsxRuntime.jsx(MicrositeMediaGrid_styles.PosterImage, {
119
- src: item.media.poster,
120
- alt: ""
121
- })]
94
+ },
95
+ asset: {
96
+ src: item.media.src,
97
+ width: item.media.width,
98
+ height: item.media.height
99
+ }
100
+ }), item.media.type === "video" && /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, {
101
+ children: [/* @__PURE__ */jsxRuntime.jsx(MicrositeMediaGrid_styles.MediaVideo, {
102
+ ref: videoRef,
103
+ src: item.media.src,
104
+ autoPlay: !item.media.playOnHover,
105
+ loop: item.media.loop,
106
+ playsInline: true,
107
+ muted: true
108
+ }), item.media.poster && /* @__PURE__ */jsxRuntime.jsx(MicrositeMediaGrid_styles.PosterImage, {
109
+ src: item.media.poster,
110
+ alt: ""
122
111
  })]
123
- }), item.mobileMedia && /* @__PURE__ */jsxRuntime.jsx(MobileItem.MobileItem, {
124
- item,
125
- onMouseEnter,
126
- onMouseLeave,
127
- Gradient,
128
- Content,
129
- context,
130
- videoRef
131
112
  })]
132
113
  });
133
114
  };