@gem-sdk/components 2.0.0-dev.278 → 2.0.0-dev.288

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 (300) hide show
  1. package/dist/cjs/accordion/components/Accordion.js +60 -179
  2. package/dist/cjs/accordion/components/Accordion.liquid.js +77 -101
  3. package/dist/cjs/accordion/components/AccordionItem.js +126 -280
  4. package/dist/cjs/accordion/components/AccordionItem.liquid.js +77 -215
  5. package/dist/cjs/accordion/components/common/classes.js +55 -0
  6. package/dist/cjs/accordion/components/common/index.js +146 -0
  7. package/dist/cjs/accordion/components/common/styles.js +131 -0
  8. package/dist/cjs/accordion/hooks/useAccordion.js +145 -0
  9. package/dist/cjs/accordion/hooks/useAccordionItem.js +119 -0
  10. package/dist/cjs/article/components/ArticleImage.js +0 -1
  11. package/dist/cjs/article/components/ArticlePagination.js +1 -1
  12. package/dist/cjs/article/components/ArticlePagination.liquid.js +3 -3
  13. package/dist/cjs/article/setting/configs/ArticleImage/settings.js +5 -5
  14. package/dist/cjs/banner/components/HeroBannerItem.js +0 -6
  15. package/dist/cjs/banner/components/HeroBannerItem.liquid.js +3 -0
  16. package/dist/cjs/banner/setting/setting.js +28 -3
  17. package/dist/cjs/banner/setting/uiV2.js +10 -97
  18. package/dist/cjs/builder.js +18 -20
  19. package/dist/cjs/cart/components/CartLineImage.js +0 -2
  20. package/dist/cjs/code/common/classes.js +11 -0
  21. package/dist/cjs/code/common/styles.js +15 -0
  22. package/dist/cjs/code/components/CSSCode.js +9 -99
  23. package/dist/cjs/code/components/CSSCode.liquid.js +11 -11
  24. package/dist/cjs/code/hooks/useCSSCode.js +102 -0
  25. package/dist/cjs/code/setting/CSSCode.js +7 -121
  26. package/dist/cjs/code/setting/config/setting.js +77 -0
  27. package/dist/cjs/code/setting/config/uiV1.js +52 -0
  28. package/dist/cjs/code/setting/config/uiV2.js +58 -0
  29. package/dist/cjs/estimate-delivery/components/EstimateDate.liquid.js +4 -1
  30. package/dist/cjs/form/components/contact/Contact.js +6 -2
  31. package/dist/cjs/form/components/contact/common/composeStyles.js +21 -0
  32. package/dist/cjs/form/components/form-checkbox/FormCheckbox.js +6 -4
  33. package/dist/cjs/form/components/form-checkbox/FormCheckbox.liquid.js +2 -4
  34. package/dist/cjs/form/components/form-checkbox/common/composeClasses.js +2 -2
  35. package/dist/cjs/form/components/form-checkbox/common/composeStyles.js +23 -10
  36. package/dist/cjs/form/components/form-dropdown/common/composeClasses.js +1 -1
  37. package/dist/cjs/form/components/form-email/FormEmail.js +18 -10
  38. package/dist/cjs/form/components/form-email/common/composeClasses.js +2 -1
  39. package/dist/cjs/form/components/newsletter/Newsletter.js +7 -2
  40. package/dist/cjs/form/components/newsletter/Newsletter.liquid.js +1 -1
  41. package/dist/cjs/form/components/newsletter/common/composeStyles.js +4 -2
  42. package/dist/cjs/form/components/textarea/TextArea.js +16 -8
  43. package/dist/cjs/form/components/textarea/common/composeClasses.js +1 -1
  44. package/dist/cjs/form/components/textfield/TextField.js +17 -9
  45. package/dist/cjs/form/components/textfield/common/composeClasses.js +2 -2
  46. package/dist/cjs/form/setting/contact/Contact.js +5 -1
  47. package/dist/cjs/form/setting/form-checkbox/configs/settings.js +153 -6
  48. package/dist/cjs/form/setting/form-checkbox/configs/uiV2.js +137 -0
  49. package/dist/cjs/form/setting/form-dropdown/configs/settings.js +147 -0
  50. package/dist/cjs/form/setting/form-dropdown/configs/uiV2.js +156 -4
  51. package/dist/cjs/form/setting/newsletter/configs/settings.js +132 -3
  52. package/dist/cjs/form/setting/newsletter/configs/uiV2.js +93 -0
  53. package/dist/cjs/form/setting/submit-button/configs/settings.js +37 -0
  54. package/dist/cjs/form/setting/submit-button/configs/uiV2.js +13 -0
  55. package/dist/cjs/grid/row/commons/getInnerRadius.js +11 -10
  56. package/dist/cjs/grid/row/setting/configs/uiV2.js +1 -1
  57. package/dist/cjs/header/components/kind/basic/index.js +1 -0
  58. package/dist/cjs/header/components/kind/modern/index.js +1 -1
  59. package/dist/cjs/helpers.js +53 -0
  60. package/dist/cjs/icon-list/setting/configs/uiV2.js +1 -1
  61. package/dist/cjs/icon-list-v2/setting/configs/settings.js +5 -5
  62. package/dist/cjs/image/components/AdaptiveImage.js +63 -49
  63. package/dist/cjs/image/components/AdaptiveImage.liquid.js +56 -44
  64. package/dist/cjs/image/components/Image.js +65 -154
  65. package/dist/cjs/image/components/Image.liquid.js +68 -103
  66. package/dist/cjs/image/components/Modal3d.liquid.js +54 -21
  67. package/dist/cjs/image/components/NextImage.js +26 -59
  68. package/dist/cjs/image/components/NextImage.liquid.js +27 -115
  69. package/dist/cjs/image/components/Video.liquid.js +38 -13
  70. package/dist/cjs/image/components/common/attributes.js +115 -0
  71. package/dist/cjs/image/components/common/classes.js +57 -0
  72. package/dist/cjs/image/components/common/constants.js +15 -0
  73. package/dist/cjs/image/components/common/data.js +24 -0
  74. package/dist/cjs/image/components/common/helpers.js +75 -0
  75. package/dist/cjs/image/components/common/styles.js +88 -0
  76. package/dist/cjs/image/components/helpers/getNextImageLiquidAttrs.js +80 -0
  77. package/dist/cjs/image/components/helpers/getNextImageReactAttrs.js +40 -0
  78. package/dist/cjs/image/components/hooks/useCheckNoImage.js +25 -0
  79. package/dist/cjs/image/helpers/getSrcSet.js +0 -2
  80. package/dist/cjs/image/next.js +1 -5
  81. package/dist/cjs/image/setting/configs/settings.js +14 -8
  82. package/dist/cjs/image/setting/configs/uiV2.js +61 -15
  83. package/dist/cjs/image/setting/index.js +1 -3
  84. package/dist/cjs/image-comparison/components/CompareImage.js +1 -1
  85. package/dist/cjs/image-comparison/components/CompareImage.liquid.js +1 -1
  86. package/dist/cjs/index.js +91 -91
  87. package/dist/cjs/index.liquid.js +8 -8
  88. package/dist/cjs/post-purchase/callout-banner/components/CalloutText.js +2 -1
  89. package/dist/cjs/post-purchase/callout-banner/components/common/getClasses.js +5 -2
  90. package/dist/cjs/post-purchase/callout-banner/components/common/getStyles.js +2 -4
  91. package/dist/cjs/post-purchase/callout-banner/setting/config/callout-box/setting.js +4 -10
  92. package/dist/cjs/post-purchase/callout-banner/setting/config/callout-text/setting.js +1 -11
  93. package/dist/cjs/post-purchase/countdown-timer/components/PostPurchaseCountdownTimer.js +9 -23
  94. package/dist/cjs/post-purchase/countdown-timer/components/TextCountdown.js +12 -26
  95. package/dist/cjs/post-purchase/countdown-timer/components/common/getClasses.js +24 -0
  96. package/dist/cjs/post-purchase/countdown-timer/components/common/getStyles.js +21 -0
  97. package/dist/cjs/post-purchase/countdown-timer/hooks/useCountdownTimer.js +18 -1
  98. package/dist/cjs/post-purchase/countdown-timer/hooks/useGetTimeExpired.js +18 -0
  99. package/dist/cjs/post-purchase/countdown-timer/settings/CountdownTimer.js +9 -358
  100. package/dist/cjs/post-purchase/countdown-timer/settings/config/preset.js +26 -0
  101. package/dist/cjs/post-purchase/countdown-timer/settings/config/setting.js +243 -0
  102. package/dist/cjs/post-purchase/countdown-timer/settings/config/uiV1.js +125 -0
  103. package/dist/cjs/post-purchase/countdown-timer/settings/config/uiV2.js +185 -0
  104. package/dist/cjs/post-purchase/image/common/getClasses.js +1 -1
  105. package/dist/cjs/post-purchase/image/setting/setting-v2.js +5 -5
  106. package/dist/cjs/post-purchase/product/components/product-image/carousel-post-purchase/CarouselWrapperPostPurchase.js +24 -26
  107. package/dist/cjs/post-purchase/product/settings/product-image/setting-v2.js +5 -5
  108. package/dist/cjs/post-purchase/product/settings/product-price-breakdown/configs/settings.js +2 -2
  109. package/dist/cjs/post-purchase/product/settings/product-quantity/configs/settings.js +1 -1
  110. package/dist/cjs/product/components/FileUpload/components/common/index.js +3 -0
  111. package/dist/cjs/product/components/ProductBundle/common/classes.js +25 -0
  112. package/dist/cjs/product/components/ProductBundle/common/index.js +5 -0
  113. package/dist/cjs/product/components/ProductBundle/common/styles.js +89 -0
  114. package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscount.js +82 -0
  115. package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscount.liquid.js +74 -0
  116. package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.js +69 -0
  117. package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.liquid.js +46 -0
  118. package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscountItem.js +23 -0
  119. package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscountItem.liquid.js +14 -0
  120. package/dist/cjs/product/components/{ProductBundleDiscount.js → ProductBundle/hooks/useProductBundleDataState.js} +20 -215
  121. package/dist/cjs/product/components/ProductBundle/hooks/useProductBundleDiscountState.js +56 -0
  122. package/dist/cjs/product/{setting → components/ProductBundle/setting}/ProductBundleDiscount.js +7 -7
  123. package/dist/cjs/product/{setting → components/ProductBundle/setting}/ProductBundleDiscountItem.js +3 -0
  124. package/dist/cjs/product/components/ProductButton.js +2 -2
  125. package/dist/cjs/product/components/ProductButton.liquid.js +2 -2
  126. package/dist/cjs/product/components/ProductPrice/common/getAttr.js +23 -0
  127. package/dist/cjs/product/components/ProductPrice/common/getClasses.js +19 -0
  128. package/dist/cjs/product/components/ProductPrice/common/getTextData.js +40 -0
  129. package/dist/cjs/product/components/ProductPrice/hooks/useGpPrice.js +126 -0
  130. package/dist/cjs/product/components/ProductPrice/index.js +54 -0
  131. package/dist/cjs/product/components/ProductPrice/index.liquid.js +43 -0
  132. package/dist/cjs/product/components/ProductQuickView/ProductQuickView.js +5 -5
  133. package/dist/cjs/product/next.js +3 -3
  134. package/dist/cjs/product/setting/index.js +2 -2
  135. package/dist/cjs/product/setting/product/configs/presets.js +1 -0
  136. package/dist/cjs/product/setting/product-image-v2/configs/setting-v2/ProductFeatureImage.js +6 -7
  137. package/dist/cjs/product/setting/product-image-v2/configs/setting-v2/ProductGalleryImage.js +11 -12
  138. package/dist/cjs/product/setting/product-image-v2/configs/setting-v2/index.js +6 -5
  139. package/dist/cjs/product/setting/product-list/configs/settingsV2.js +10 -8
  140. package/dist/cjs/setting.js +5 -2
  141. package/dist/esm/accordion/components/Accordion.js +61 -180
  142. package/dist/esm/accordion/components/Accordion.liquid.js +78 -102
  143. package/dist/esm/accordion/components/AccordionItem.js +129 -281
  144. package/dist/esm/accordion/components/AccordionItem.liquid.js +76 -214
  145. package/dist/esm/accordion/components/common/classes.js +44 -0
  146. package/dist/esm/accordion/components/common/index.js +136 -0
  147. package/dist/esm/accordion/components/common/styles.js +122 -0
  148. package/dist/esm/accordion/hooks/useAccordion.js +141 -0
  149. package/dist/esm/accordion/hooks/useAccordionItem.js +115 -0
  150. package/dist/esm/article/components/ArticleImage.js +0 -1
  151. package/dist/esm/article/components/ArticlePagination.js +1 -1
  152. package/dist/esm/article/components/ArticlePagination.liquid.js +3 -3
  153. package/dist/esm/article/setting/configs/ArticleImage/settings.js +5 -5
  154. package/dist/esm/banner/components/HeroBannerItem.js +0 -6
  155. package/dist/esm/banner/components/HeroBannerItem.liquid.js +3 -0
  156. package/dist/esm/banner/setting/setting.js +28 -3
  157. package/dist/esm/banner/setting/uiV2.js +10 -97
  158. package/dist/esm/builder.js +3 -5
  159. package/dist/esm/cart/components/CartLineImage.js +0 -2
  160. package/dist/esm/code/common/classes.js +9 -0
  161. package/dist/esm/code/common/styles.js +13 -0
  162. package/dist/esm/code/components/CSSCode.js +9 -99
  163. package/dist/esm/code/components/CSSCode.liquid.js +12 -12
  164. package/dist/esm/code/hooks/useCSSCode.js +98 -0
  165. package/dist/esm/code/setting/CSSCode.js +7 -121
  166. package/dist/esm/code/setting/config/setting.js +75 -0
  167. package/dist/esm/code/setting/config/uiV1.js +50 -0
  168. package/dist/esm/code/setting/config/uiV2.js +56 -0
  169. package/dist/esm/estimate-delivery/components/EstimateDate.liquid.js +4 -1
  170. package/dist/esm/form/components/contact/Contact.js +7 -3
  171. package/dist/esm/form/components/contact/common/composeStyles.js +19 -0
  172. package/dist/esm/form/components/form-checkbox/FormCheckbox.js +7 -5
  173. package/dist/esm/form/components/form-checkbox/FormCheckbox.liquid.js +3 -5
  174. package/dist/esm/form/components/form-checkbox/common/composeClasses.js +2 -2
  175. package/dist/esm/form/components/form-checkbox/common/composeStyles.js +25 -11
  176. package/dist/esm/form/components/form-dropdown/common/composeClasses.js +1 -1
  177. package/dist/esm/form/components/form-email/FormEmail.js +18 -10
  178. package/dist/esm/form/components/form-email/common/composeClasses.js +2 -1
  179. package/dist/esm/form/components/newsletter/Newsletter.js +8 -3
  180. package/dist/esm/form/components/newsletter/Newsletter.liquid.js +1 -1
  181. package/dist/esm/form/components/newsletter/common/composeStyles.js +4 -2
  182. package/dist/esm/form/components/textarea/TextArea.js +16 -8
  183. package/dist/esm/form/components/textarea/common/composeClasses.js +1 -1
  184. package/dist/esm/form/components/textfield/TextField.js +17 -9
  185. package/dist/esm/form/components/textfield/common/composeClasses.js +2 -2
  186. package/dist/esm/form/setting/contact/Contact.js +5 -1
  187. package/dist/esm/form/setting/form-checkbox/configs/settings.js +153 -6
  188. package/dist/esm/form/setting/form-checkbox/configs/uiV2.js +137 -0
  189. package/dist/esm/form/setting/form-dropdown/configs/settings.js +147 -0
  190. package/dist/esm/form/setting/form-dropdown/configs/uiV2.js +156 -4
  191. package/dist/esm/form/setting/newsletter/configs/settings.js +132 -3
  192. package/dist/esm/form/setting/newsletter/configs/uiV2.js +93 -0
  193. package/dist/esm/form/setting/submit-button/configs/settings.js +37 -0
  194. package/dist/esm/form/setting/submit-button/configs/uiV2.js +13 -0
  195. package/dist/esm/grid/row/commons/getInnerRadius.js +11 -10
  196. package/dist/esm/grid/row/setting/configs/uiV2.js +1 -1
  197. package/dist/esm/header/components/kind/basic/index.js +1 -0
  198. package/dist/esm/header/components/kind/modern/index.js +1 -1
  199. package/dist/esm/helpers.js +52 -1
  200. package/dist/esm/icon-list/setting/configs/uiV2.js +1 -1
  201. package/dist/esm/icon-list-v2/setting/configs/settings.js +5 -5
  202. package/dist/esm/image/components/AdaptiveImage.js +64 -50
  203. package/dist/esm/image/components/AdaptiveImage.liquid.js +57 -45
  204. package/dist/esm/image/components/Image.js +66 -155
  205. package/dist/esm/image/components/Image.liquid.js +69 -104
  206. package/dist/esm/image/components/Modal3d.liquid.js +55 -22
  207. package/dist/esm/image/components/NextImage.js +26 -59
  208. package/dist/esm/image/components/NextImage.liquid.js +28 -116
  209. package/dist/esm/image/components/Video.liquid.js +38 -13
  210. package/dist/esm/image/components/common/attributes.js +108 -0
  211. package/dist/esm/image/components/common/classes.js +51 -0
  212. package/dist/esm/image/components/common/constants.js +11 -0
  213. package/dist/esm/image/components/common/data.js +22 -0
  214. package/dist/esm/image/components/common/helpers.js +69 -0
  215. package/dist/esm/image/components/common/styles.js +80 -0
  216. package/dist/esm/image/components/helpers/getNextImageLiquidAttrs.js +78 -0
  217. package/dist/esm/image/components/helpers/getNextImageReactAttrs.js +38 -0
  218. package/dist/esm/image/components/hooks/useCheckNoImage.js +23 -0
  219. package/dist/esm/image/helpers/getSrcSet.js +1 -2
  220. package/dist/esm/image/next.js +1 -5
  221. package/dist/esm/image/setting/configs/settings.js +14 -8
  222. package/dist/esm/image/setting/configs/uiV2.js +61 -15
  223. package/dist/esm/image/setting/index.js +1 -3
  224. package/dist/esm/image-comparison/components/CompareImage.js +1 -1
  225. package/dist/esm/image-comparison/components/CompareImage.liquid.js +1 -1
  226. package/dist/esm/index.js +4 -5
  227. package/dist/esm/index.liquid.js +3 -3
  228. package/dist/esm/post-purchase/callout-banner/components/CalloutText.js +2 -1
  229. package/dist/esm/post-purchase/callout-banner/components/common/getClasses.js +5 -2
  230. package/dist/esm/post-purchase/callout-banner/components/common/getStyles.js +2 -4
  231. package/dist/esm/post-purchase/callout-banner/setting/config/callout-box/setting.js +4 -10
  232. package/dist/esm/post-purchase/callout-banner/setting/config/callout-text/setting.js +1 -11
  233. package/dist/esm/post-purchase/countdown-timer/components/PostPurchaseCountdownTimer.js +9 -23
  234. package/dist/esm/post-purchase/countdown-timer/components/TextCountdown.js +13 -27
  235. package/dist/esm/post-purchase/countdown-timer/components/common/getClasses.js +21 -0
  236. package/dist/esm/post-purchase/countdown-timer/components/common/getStyles.js +19 -0
  237. package/dist/esm/post-purchase/countdown-timer/hooks/useCountdownTimer.js +19 -3
  238. package/dist/esm/post-purchase/countdown-timer/hooks/useGetTimeExpired.js +16 -0
  239. package/dist/esm/post-purchase/countdown-timer/settings/CountdownTimer.js +9 -358
  240. package/dist/esm/post-purchase/countdown-timer/settings/config/preset.js +24 -0
  241. package/dist/esm/post-purchase/countdown-timer/settings/config/setting.js +241 -0
  242. package/dist/esm/post-purchase/countdown-timer/settings/config/uiV1.js +123 -0
  243. package/dist/esm/post-purchase/countdown-timer/settings/config/uiV2.js +183 -0
  244. package/dist/esm/post-purchase/image/common/getClasses.js +1 -1
  245. package/dist/esm/post-purchase/image/setting/setting-v2.js +5 -5
  246. package/dist/esm/post-purchase/product/components/product-image/carousel-post-purchase/CarouselWrapperPostPurchase.js +25 -27
  247. package/dist/esm/post-purchase/product/settings/product-image/setting-v2.js +5 -5
  248. package/dist/esm/post-purchase/product/settings/product-price-breakdown/configs/settings.js +2 -2
  249. package/dist/esm/post-purchase/product/settings/product-quantity/configs/settings.js +1 -1
  250. package/dist/esm/product/components/FileUpload/components/common/index.js +3 -0
  251. package/dist/esm/product/components/ProductBundle/common/classes.js +19 -0
  252. package/dist/esm/product/components/ProductBundle/common/index.js +3 -0
  253. package/dist/esm/product/components/ProductBundle/common/styles.js +80 -0
  254. package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscount.js +78 -0
  255. package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscount.liquid.js +70 -0
  256. package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.js +65 -0
  257. package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.liquid.js +42 -0
  258. package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscountItem.js +19 -0
  259. package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscountItem.liquid.js +10 -0
  260. package/dist/esm/product/components/{ProductBundleDiscount.js → ProductBundle/hooks/useProductBundleDataState.js} +21 -216
  261. package/dist/esm/product/components/ProductBundle/hooks/useProductBundleDiscountState.js +52 -0
  262. package/dist/esm/product/{setting → components/ProductBundle/setting}/ProductBundleDiscount.js +7 -7
  263. package/dist/esm/product/{setting → components/ProductBundle/setting}/ProductBundleDiscountItem.js +3 -0
  264. package/dist/esm/product/components/ProductButton.js +1 -1
  265. package/dist/esm/product/components/ProductButton.liquid.js +1 -1
  266. package/dist/esm/product/components/ProductPrice/common/getAttr.js +21 -0
  267. package/dist/esm/product/components/ProductPrice/common/getClasses.js +17 -0
  268. package/dist/esm/product/components/ProductPrice/common/getTextData.js +38 -0
  269. package/dist/esm/product/components/ProductPrice/hooks/useGpPrice.js +124 -0
  270. package/dist/esm/product/components/ProductPrice/index.js +50 -0
  271. package/dist/esm/product/components/ProductPrice/index.liquid.js +38 -0
  272. package/dist/esm/product/components/ProductQuickView/ProductQuickView.js +1 -1
  273. package/dist/esm/product/next.js +3 -3
  274. package/dist/esm/product/setting/index.js +2 -2
  275. package/dist/esm/product/setting/product/configs/presets.js +1 -0
  276. package/dist/esm/product/setting/product-image-v2/configs/setting-v2/ProductFeatureImage.js +6 -7
  277. package/dist/esm/product/setting/product-image-v2/configs/setting-v2/ProductGalleryImage.js +11 -12
  278. package/dist/esm/product/setting/product-image-v2/configs/setting-v2/index.js +6 -5
  279. package/dist/esm/product/setting/product-list/configs/settingsV2.js +10 -8
  280. package/dist/esm/setting.js +5 -2
  281. package/dist/types/index.d.ts +174 -257
  282. package/package.json +2 -2
  283. package/dist/cjs/image/components/BackgroundImage.js +0 -102
  284. package/dist/cjs/image/components/Img.js +0 -28
  285. package/dist/cjs/image/components/helpers.js +0 -12
  286. package/dist/cjs/image/setting/BackgroundImage.js +0 -364
  287. package/dist/cjs/product/components/ProductBundleDiscount.liquid.js +0 -81
  288. package/dist/cjs/product/components/ProductBundleDiscountItem.js +0 -42
  289. package/dist/cjs/product/components/ProductBundleDiscountItem.liquid.js +0 -103
  290. package/dist/cjs/product/components/ProductPrice.js +0 -209
  291. package/dist/cjs/product/components/ProductPrice.liquid.js +0 -88
  292. package/dist/esm/image/components/BackgroundImage.js +0 -98
  293. package/dist/esm/image/components/Img.js +0 -24
  294. package/dist/esm/image/components/helpers.js +0 -9
  295. package/dist/esm/image/setting/BackgroundImage.js +0 -360
  296. package/dist/esm/product/components/ProductBundleDiscount.liquid.js +0 -77
  297. package/dist/esm/product/components/ProductBundleDiscountItem.js +0 -36
  298. package/dist/esm/product/components/ProductBundleDiscountItem.liquid.js +0 -99
  299. package/dist/esm/product/components/ProductPrice.js +0 -205
  300. package/dist/esm/product/components/ProductPrice.liquid.js +0 -83
@@ -1,114 +1,79 @@
1
- import { makeStyleResponsive, getWidthByShapeGlobalSize, getHeightByShapeGlobalSize, template, cls, handleConvertClassColor, getBorderStyle, getBorderRadiusStyle, getStyleShadow, getAspectRatioGlobalSize, getCornerCSSFromGlobal } from '@gem-sdk/core';
1
+ import { template } from '@gem-sdk/core';
2
+ import { createStyle, createClass, createAttr, If } from '@gem-sdk/system';
3
+ import { getLinkData } from '../../helpers.js';
2
4
  import AdaptiveImage from './AdaptiveImage.liquid.js';
3
5
  import NextImage from './NextImage.liquid.js';
4
- import { getInsertLinkData } from '../../helpers.js';
6
+ import { getWrapperStyles, getImageStyles, getContainerStyles } from './common/styles.js';
7
+ import { getWrapperClasses, getImageClasses, getContainerClasses } from './common/classes.js';
8
+ import { getContainerAttrs, getAdaptiveImageAttrs, getNextImageAttrs, getLinkWrapperAttrs, getImageLiquidAttrs } from './common/attributes.js';
5
9
 
6
- const Image = ({ styles, className, setting, builderAttrs, builderProps, style, advanced, enableLazyLoadImage = true, pageContext })=>{
7
- const { imageLink, isNotLazyload } = setting ?? {};
8
- const { shape } = styles ?? {};
9
- const { Wrap: WrapLink, urlData } = getInsertLinkData('div', imageLink);
10
- const overwriteDefaultRadius = (cornerRadius)=>{
11
- const radius = {
12
- ...cornerRadius
13
- };
14
- let hasDefault = true;
15
- if (radius) {
16
- Object.keys(radius ?? {}).forEach((key)=>{
17
- if (key === 'bblr' || key === 'bbrr' || key === 'btlr' || key === 'btrr') {
18
- const currPos = radius[key] ?? {};
19
- if (currPos !== '0px') hasDefault = false;
20
- }
21
- });
22
- }
23
- return hasDefault ? getCornerCSSFromGlobal(builderProps?.builderData?.advanced?.rounded) : {};
10
+ const Image = ({ style, styles, setting, advanced, className, pageContext, builderAttrs, builderProps, enableLazyLoadImage = true })=>{
11
+ const { imageLink, isAdaptive, enableImageLink } = setting ?? {};
12
+ const { Wrapper: HTMLTag, urlData } = getLinkData({
13
+ defaultWrap: 'div',
14
+ setting: imageLink,
15
+ enableImageLink,
16
+ isLiquid: true
17
+ });
18
+ const wrapperStyles = createStyle(getWrapperStyles(styles));
19
+ const imageStyles = createStyle(getImageStyles(styles, builderProps));
20
+ const containerStyles = createStyle(getContainerStyles(style, styles));
21
+ const wrapperClasses = createClass(getWrapperClasses());
22
+ const imageClasses = createClass(getImageClasses(className, styles));
23
+ const containerClasses = createClass(getContainerClasses(builderProps?.uid, advanced?.cssClass));
24
+ const containerAttrs = createAttr(getContainerAttrs(builderAttrs, builderProps?.uid));
25
+ const linkWrapperAttrs = getLinkWrapperAttrs({
26
+ urlData,
27
+ imageLink,
28
+ title: setting?.title,
29
+ isLiquid: true
30
+ });
31
+ const adaptiveImageAttrs = getAdaptiveImageAttrs({
32
+ styles,
33
+ setting
34
+ });
35
+ const nextImageAttrs = getNextImageAttrs({
36
+ styles,
37
+ setting
38
+ });
39
+ const imageLiquidAttrs = getImageLiquidAttrs({
40
+ pageContext,
41
+ enableLazyLoadImage
42
+ });
43
+ const Image = ()=>{
44
+ return If(isAdaptive, AdaptiveImage({
45
+ ...imageLiquidAttrs,
46
+ ...adaptiveImageAttrs,
47
+ style: imageStyles,
48
+ className: imageClasses
49
+ }), NextImage({
50
+ ...imageLiquidAttrs,
51
+ ...nextImageAttrs,
52
+ style: imageStyles,
53
+ className: imageClasses
54
+ }));
55
+ };
56
+ const renderImage = ()=>{
57
+ return Image();
24
58
  };
25
- const imageWidth = makeStyleResponsive('w', getWidthByShapeGlobalSize(shape));
26
- const imageHeight = makeStyleResponsive('h', getHeightByShapeGlobalSize(shape));
27
- return template`<div
28
- ${{
29
- ...builderAttrs
59
+ return template`
60
+ <div
61
+ role="presentation"
62
+ ${{
63
+ ...containerAttrs
30
64
  }}
31
- data-id="${builderProps?.uid}"
32
- role="presentation"
33
- class="${cls('gp-group/image', builderProps?.uid, advanced?.cssClass, `force-publish-${new Date().getTime()}`)}"
34
- style="${{
35
- ...style,
36
- ...makeStyleResponsive('ta', styles?.align)
37
- }}"
65
+ style="${containerStyles}"
66
+ class="${containerClasses}"
38
67
  >
39
- <${WrapLink}
40
- class="pointer-events-auto h-full gp-flex"
41
- ${imageLink?.link ? {
42
- ...urlData,
43
- title: setting?.title
44
- } : {}}
45
- ${imageLink?.noFollow ? 'rel="nofollow"' : undefined}
46
- class="gp-h-full gp-w-full"
47
- style="${{
48
- // ...getStyleShadowState(styles?.boxShadowImg, 'box-shadow', styles?.hasBoxShadowImg),
49
- 'border-radius': 'inherit',
50
- overflow: 'hidden',
51
- ...makeStyleResponsive('jc', styles?.align)
52
- }}"
68
+ <${HTMLTag}
69
+ ${linkWrapperAttrs}
70
+ style="${wrapperStyles}"
71
+ class="${wrapperClasses}"
53
72
  >
54
- ${setting?.isAdaptive ? AdaptiveImage({
55
- srcSet: setting.srcSet,
56
- className: cls(className, 'gp-h-full gp-max-w-full gp-flex', handleConvertClassColor(styles?.borderImg)),
57
- pictureClass: 'gp-contents',
58
- alt: setting.alt,
59
- style: {
60
- ...imageWidth,
61
- ...imageHeight,
62
- // ...handleConvertBorderStyle(styles?.borderImg),
63
- // ...handleConvertBorderWidth(styles?.borderImg),
64
- // ...handleConvertBorderColor(styles?.borderImg),
65
- ...overwriteDefaultRadius(builderProps?.builderData?.advanced?.rounded),
66
- ...getBorderStyle(styles?.wrapperBorder),
67
- ...getBorderRadiusStyle(styles?.borderRadius),
68
- ...getStyleShadow({
69
- value: styles?.shadow,
70
- styleAppliedFor: 'box-shadow',
71
- isEnableShadow: styles?.shadow?.type !== 'none'
72
- })
73
- },
74
- aspectRatio: getAspectRatioGlobalSize(styles?.shape),
75
- layout: styles?.objectFit,
76
- priority: setting?.priority,
77
- enableLazyLoadImage,
78
- pageContext
79
- }) : NextImage({
80
- ...setting?.image,
81
- priority: setting?.priority,
82
- quality: setting?.quality,
83
- className: cls(className, '!gp-inline gp-h-full gp-max-w-full gp-flex', handleConvertClassColor(styles?.borderImg)),
84
- style: {
85
- ...imageWidth,
86
- ...imageHeight,
87
- // ...handleConvertBorderStyle(styles?.borderImg),
88
- // ...handleConvertBorderWidth(styles?.borderImg),
89
- // ...handleConvertBorderColor(styles?.borderImg),
90
- ...overwriteDefaultRadius(builderProps?.builderData?.advanced?.rounded),
91
- ...getBorderStyle(styles?.wrapperBorder),
92
- ...getBorderRadiusStyle(styles?.borderRadius),
93
- ...getStyleShadow({
94
- value: styles?.shadow,
95
- styleAppliedFor: 'box-shadow',
96
- isEnableShadow: styles?.shadow?.type !== 'none'
97
- })
98
- },
99
- alt: setting?.alt,
100
- title: setting?.title,
101
- vw: setting?.vw,
102
- setting: {
103
- aspectRatio: getAspectRatioGlobalSize(styles?.shape),
104
- layout: styles?.objectFit
105
- },
106
- isNotLazyload,
107
- enableLazyLoadImage,
108
- pageContext
109
- })}
110
- </${WrapLink}>
111
- </div>`;
73
+ ${renderImage()}
74
+ </${HTMLTag}>
75
+ </div>
76
+ `;
112
77
  };
113
78
 
114
79
  export { Image as default };
@@ -1,31 +1,64 @@
1
- import { getResponsiveValueByScreen, template, makeStyleResponsive } from '@gem-sdk/core';
1
+ import { createAttr, createStyle, createClass } from '@gem-sdk/system';
2
+ import { template, getResponsiveValueByScreen, makeStyleResponsive } from '@gem-sdk/core';
2
3
 
3
- const Model3d = ({ src, alt, loading, poster, dataJsFocusVisible, arStatus, style, cameraControls, dataShopifyFeature = '1.12', reveal, loaded, modelIsVisible, aspectRatio })=>{
4
- const customAspectRatio = {
5
- desktop: getResponsiveValueByScreen(aspectRatio, 'desktop') || '1/1',
6
- tablet: getResponsiveValueByScreen(aspectRatio, 'tablet') || '1/1',
7
- mobile: getResponsiveValueByScreen(aspectRatio, 'mobile') || '1/1'
4
+ const Model3d = ({ src, alt, style, poster, reveal, loaded, loading, arStatus, aspectRatio, modelIsVisible, cameraControls, dataJsFocusVisible, dataShopifyFeature = '1.12' })=>{
5
+ const getModelViewerClasses = ()=>{
6
+ return {
7
+ 'gp-w-full gp-h-full model-viewer gp-z-[90]': true
8
+ };
8
9
  };
10
+ const getModelViewerStyles = ()=>{
11
+ const customAspectRatio = {
12
+ desktop: getResponsiveValueByScreen(aspectRatio, 'desktop') || '1/1',
13
+ tablet: getResponsiveValueByScreen(aspectRatio, 'tablet') || '1/1',
14
+ mobile: getResponsiveValueByScreen(aspectRatio, 'mobile') || '1/1'
15
+ };
16
+ return {
17
+ ...makeStyleResponsive('aspect', customAspectRatio)
18
+ };
19
+ };
20
+ const getModelViewerAttrs = ()=>{
21
+ return {
22
+ src,
23
+ alt,
24
+ 'data-shopify-feature': dataShopifyFeature,
25
+ ...style,
26
+ ...poster ? {
27
+ poster
28
+ } : {},
29
+ ...reveal ? {
30
+ reveal
31
+ } : {},
32
+ ...loaded ? {
33
+ loaded
34
+ } : {},
35
+ ...loading ? {
36
+ loading
37
+ } : {},
38
+ ...modelIsVisible ? {
39
+ modelIsVisible
40
+ } : {},
41
+ ...arStatus ? {
42
+ 'ar-status': arStatus
43
+ } : {},
44
+ ...cameraControls ? {
45
+ 'camera-controls': cameraControls
46
+ } : {},
47
+ ...dataJsFocusVisible ? {
48
+ 'data-js-focus-visible': dataJsFocusVisible
49
+ } : {}
50
+ };
51
+ };
52
+ const modelViewerAttrs = createAttr(getModelViewerAttrs());
53
+ const modelViewerStyles = createStyle(getModelViewerStyles());
54
+ const modelViewerClasses = createClass(getModelViewerClasses());
9
55
  return template`
10
56
  <model-viewer
11
- class="gp-w-full gp-h-full model-viewer gp-z-[90]"
12
57
  ${{
13
- ...style
58
+ ...modelViewerAttrs
14
59
  }}
15
- ${reveal ? `reveal="${reveal}"` : ''}
16
- ${loading ? `loading="${loading}"` : ''}
17
- ${loaded ? `loaded="${loaded}"` : ''}
18
- ${modelIsVisible ? `modelIsVisible="${modelIsVisible}"` : ''}
19
- src="${src}"
20
- alt="${alt}"
21
- camera-controls="${cameraControls}"
22
- poster="${poster}"
23
- data-js-focus-visible="${dataJsFocusVisible}"
24
- data-shopify-feature="${dataShopifyFeature}"
25
- ar-status="${arStatus}"
26
- style="${{
27
- ...makeStyleResponsive('aspect', customAspectRatio)
28
- }}">
60
+ class="${modelViewerClasses}"
61
+ style="${modelViewerStyles}">
29
62
  </model-viewer>
30
63
  `;
31
64
  };
@@ -1,70 +1,37 @@
1
1
  'use client';
2
2
  import { jsx } from 'react/jsx-runtime';
3
3
  import Image from 'next/image';
4
- import { makeStyleResponsive } from '@gem-sdk/core';
5
- import { useMemo } from 'react';
6
- import { DEVICES } from '../helpers/getSrcSet.js';
4
+ import { createStyle, createClass } from '@gem-sdk/system';
5
+ import { getNextImageClasses } from './common/classes.js';
6
+ import { getNextImageStyles } from './common/styles.js';
7
+ import { getNextImageReactAttrs } from './helpers/getNextImageReactAttrs.js';
8
+ import { NEXT_IMAGE_CONFIG } from './common/constants.js';
7
9
 
8
10
  const NextImage = (props)=>{
9
- const { setting, src = 'https://ucarecdn.com/465c7cbb-f087-4d1d-8f08-f6665179f02f/-/format/auto/-/quality/lighter/placeholder-1.png', alt = 'Alt image', width, height, style, priority, imgRef, base64 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=', isNotLazyload, enableLazyLoadImage = true, isDisableAspectStyle } = props;
10
- const { layout, aspectRatio } = setting ?? {};
11
- const newWidth = width ? width : 800;
12
- const newHeight = height ? height : 533;
11
+ const { style, imgRef, setting, priority, className, width = NEXT_IMAGE_CONFIG.DEFAULT_WIDTH_PROPS, height = NEXT_IMAGE_CONFIG.DEFAULT_HEIGHT_PROPS, isNotLazyload, isDisableAspectStyle, enableLazyLoadImage = true } = props;
13
12
  const hasLazyLoad = !isNotLazyload && enableLazyLoadImage && !priority;
14
- const objectFits = useMemo(()=>{
15
- return makeStyleResponsive('objf', layout);
16
- }, [
17
- layout
18
- ]);
19
- const aspectRatioUsed = useMemo(()=>{
20
- if (isDisableAspectStyle) return {};
21
- let result = {};
22
- DEVICES.forEach((device)=>{
23
- const objectFitKey = `--objf${device !== 'desktop' ? `-${device}` : ''}`;
24
- const objectFitByDevice = objectFits?.[objectFitKey] || objectFits?.['--objf'];
25
- if (aspectRatio?.[device] === 'auto' && objectFitByDevice === 'contain') {
26
- result = {
27
- ...result,
28
- [device]: 'auto'
29
- };
30
- return;
31
- }
32
- const value = aspectRatio?.[device] !== 'auto' && !!aspectRatio?.[device] ? aspectRatio?.[device] : `${width}/${height}`;
33
- result = {
34
- ...result,
35
- [device]: value
36
- };
37
- });
38
- return result;
39
- }, [
40
- aspectRatio,
41
- objectFits,
42
- height,
43
- width,
44
- isDisableAspectStyle
45
- ]);
13
+ const nextImageStyles = createStyle({
14
+ ...style,
15
+ ...getNextImageStyles({
16
+ width,
17
+ height,
18
+ setting,
19
+ isDisableAspectStyle,
20
+ isDisableObjectFit: false
21
+ })
22
+ });
23
+ const nextImageClasses = createClass({
24
+ ...getNextImageClasses({
25
+ className,
26
+ hasLazyLoad
27
+ })
28
+ });
29
+ const nextImageAttrs = getNextImageReactAttrs(props);
46
30
  return /*#__PURE__*/ jsx(Image, {
47
- ...props,
48
31
  ref: imgRef,
49
- src,
50
- width: newWidth,
51
- height: newHeight,
52
- alt,
53
- ...hasLazyLoad && base64 && {
54
- placeholder: 'blur',
55
- blurDataURL: base64
56
- },
57
- ...!hasLazyLoad ? {
58
- fetchpriority: 'high',
59
- loading: 'eager'
60
- } : {
61
- loading: 'lazy'
62
- },
63
- style: {
64
- ...makeStyleResponsive('aspect', aspectRatioUsed),
65
- ...objectFits,
66
- ...style
67
- }
32
+ ...nextImageAttrs,
33
+ style: nextImageStyles,
34
+ className: nextImageClasses
68
35
  });
69
36
  };
70
37
 
@@ -1,124 +1,36 @@
1
- import { template, RenderIf, cls, makeStyleResponsive } from '@gem-sdk/core';
2
- import { getNewBackupFileKey, getImageSrc, getSrcSet } from '../helpers/getSrcSet.js';
3
- import { DEVICES } from '../../product/components/ProductVariants/index.js';
1
+ import { template } from '@gem-sdk/core';
2
+ import { createStyle, createClass } from '@gem-sdk/system';
3
+ import { getNextImageClasses } from './common/classes.js';
4
+ import { getNextImageStyles } from './common/styles.js';
5
+ import { getNextImageLiquidAttrs } from './helpers/getNextImageLiquidAttrs.js';
4
6
 
5
7
  const NextImage = (props)=>{
6
- const { setting, src = 'https://ucarecdn.com/465c7cbb-f087-4d1d-8f08-f6665179f02f/-/format/auto/-/quality/lighter/placeholder-1.png', srcIsLiquidCode, alt = 'Alt image', width = 2237, height = 1678, backupFileKey, backupFilePath, storage, style, priority, className, baseSrc, isDisableAspectStyle, isDisableObjectFit, customAttrs, isNotLazyload, enableLazyLoadImage = true, pageContext, srcset, sizes } = props;
7
- const { aspectRatio, layout, qualityPercent, qualityType } = setting ?? {};
8
+ const { style, setting, priority, className, pageContext, width = 2237, height = 1678, isNotLazyload, isDisableObjectFit, isDisableAspectStyle, enableLazyLoadImage = true } = props;
8
9
  const hasLazyLoad = !isNotLazyload && enableLazyLoadImage && !priority;
9
- const newBackupFilekey = backupFileKey ? getNewBackupFileKey(backupFileKey ?? '', src) : '';
10
- const srcImage = srcIsLiquidCode ? baseSrc : getImageSrc({
11
- src,
12
- backupFileKey: newBackupFilekey,
13
- backupFilePath,
14
- storage
10
+ const nextImageStyles = createStyle({
11
+ ...style,
12
+ ...getNextImageStyles({
13
+ width,
14
+ height,
15
+ setting,
16
+ isDisableObjectFit,
17
+ isDisableAspectStyle
18
+ })
15
19
  });
16
- const srcSetImg = srcIsLiquidCode ? src : getSrcSet(newBackupFilekey ?? '', storage ?? 'THEME', src);
17
- const getObjectFit = ()=>{
18
- if (isDisableObjectFit) return {};
19
- return makeStyleResponsive('objf', layout);
20
- };
21
- const aspectRatioGlobalSize = ()=>{
22
- if (isDisableAspectStyle) return {};
23
- let result = {};
24
- const objectFits = getObjectFit();
25
- DEVICES.forEach((device)=>{
26
- const objectFitKey = `--objf${device !== 'desktop' ? `-${device}` : ''}`;
27
- const objectFitByDevice = objectFits?.[objectFitKey] || objectFits?.['--objf'];
28
- if (aspectRatio?.[device] === 'auto' && objectFitByDevice === 'contain') {
29
- result = {
30
- ...result,
31
- [device]: 'auto'
32
- };
33
- return;
34
- }
35
- const value = aspectRatio?.[device] !== 'auto' && !!aspectRatio?.[device] ? aspectRatio?.[device] : `${width}/${height}`;
36
- result = {
37
- ...result,
38
- [device]: value
39
- };
40
- });
41
- return result;
42
- };
43
- const getAttrPropImage = ()=>{
44
- const ignoreAttrInProps = [
45
- 'src',
46
- 'srcset',
47
- 'width',
48
- 'height',
49
- 'alt',
50
- 'base-src'
51
- ];
52
- const propsImage = {
53
- ...props
54
- };
55
- ignoreAttrInProps.forEach((attr)=>{
56
- if (propsImage[attr]) {
57
- delete propsImage[attr];
58
- }
59
- });
60
- return propsImage;
61
- };
62
- const attrProps = getAttrPropImage();
63
- const imagePlaceholder = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=';
20
+ const nextImageClasses = createClass({
21
+ ...getNextImageClasses({
22
+ className,
23
+ hasLazyLoad,
24
+ isOptimizePlan: pageContext?.isOptimizePlan
25
+ })
26
+ });
27
+ const nextImageAttrs = getNextImageLiquidAttrs(props);
64
28
  return template`
65
- ${RenderIf(priority, template`<img
66
- ${{
67
- ...attrProps
68
- }}
69
- ${customAttrs}
70
- draggable="false"
71
- isNotLazyload="true"
72
- class="${cls(className)}"
73
- ${{
74
- src: srcImage,
75
- width,
76
- height,
77
- alt
78
- }}
79
- fetchpriority="high"
80
- quality-type=${JSON.stringify(qualityType) || '{}'}
81
- quality-percent=${JSON.stringify(qualityPercent) || '{}'}
82
- data-sizes="auto"
83
- srcset="${srcset}"
84
- sizes="${sizes || '100vw'}"
85
- style="${{
86
- ...makeStyleResponsive('aspect', aspectRatioGlobalSize()),
87
- ...getObjectFit(),
88
- ...style
89
- }}"
90
- />`, template`<img
91
- ${{
92
- ...attrProps
93
- }}
94
- ${customAttrs}
95
- draggable="false"
96
- class="${cls(className, {
97
- gp_lazyload: hasLazyLoad,
98
- gp_force_load: pageContext?.isOptimizePlan
99
- })}"
100
- ${{
101
- 'data-src': srcImage,
102
- 'data-srcset': srcSetImg,
103
- src: enableLazyLoadImage ? imagePlaceholder : srcImage,
104
- width,
105
- height,
106
- alt,
107
- ...baseSrc ? {
108
- 'base-src': baseSrc
109
- } : {}
110
- }}
111
- quality-type=${JSON.stringify(qualityType) || '{}'}
112
- quality-percent=${JSON.stringify(qualityPercent) || '{}'}
113
- data-sizes="auto"
114
- sizes="100vw"
115
- style="${{
116
- ...makeStyleResponsive('aspect', aspectRatioGlobalSize()),
117
- ...getObjectFit(),
118
- ...style
119
- }}"
120
- />`)}
121
- `;
29
+ <img
30
+ ${nextImageAttrs}
31
+ style="${nextImageStyles}"
32
+ class="${nextImageClasses}"
33
+ />`;
122
34
  };
123
35
 
124
36
  export { NextImage as default };
@@ -1,22 +1,47 @@
1
1
  import { template, makeStyleResponsive } from '@gem-sdk/core';
2
+ import { createAttr, createStyle, createClass } from '@gem-sdk/system';
2
3
 
3
- const Video = ({ src, alt, allowfullscreen, allow = 'accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture', frameborder = '0', autoplay, controls, className = 'feature-video gp-w-full gp-h-full gp-relative', aspectRatio, style })=>{
4
+ const DEFAULT_CLASS = 'feature-video gp-w-full gp-h-full gp-relative';
5
+ const DEFAULT_ALLOW = 'accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture';
6
+ const Video = ({ src, alt, style, autoplay, controls, aspectRatio, allowfullscreen, frameborder = '0', allow = DEFAULT_ALLOW, className = DEFAULT_CLASS })=>{
7
+ const getVideoClasses = ()=>{
8
+ return {
9
+ [className]: true
10
+ };
11
+ };
12
+ const getVideoStyles = ()=>{
13
+ return {
14
+ ...makeStyleResponsive('aspect', aspectRatio)
15
+ };
16
+ };
17
+ const getVideoAttrs = ()=>{
18
+ return {
19
+ src,
20
+ alt,
21
+ allow,
22
+ frameborder,
23
+ ...style,
24
+ ...autoplay ? {
25
+ autoplay
26
+ } : {},
27
+ ...controls ? {
28
+ controls
29
+ } : {},
30
+ ...allowfullscreen ? {
31
+ allowfullscreen
32
+ } : {}
33
+ };
34
+ };
35
+ const videoAttrs = createAttr(getVideoAttrs());
36
+ const videoStyles = createStyle(getVideoStyles());
37
+ const videoClasses = createClass(getVideoClasses());
4
38
  return template`
5
39
  <iframe
6
40
  ${{
7
- ...style
41
+ ...videoAttrs
8
42
  }}
9
- class="${className}"
10
- src="${src}"
11
- controls="${controls}"
12
- allowfullscreen="${allowfullscreen}"
13
- allow="${allow}"
14
- frameborder="${frameborder}"
15
- autoplay="${autoplay}"
16
- alt="${alt}"
17
- style="${{
18
- ...makeStyleResponsive('aspect', aspectRatio)
19
- }}"
43
+ style="${videoStyles}"
44
+ class="${videoClasses}"
20
45
  >
21
46
  </iframe>
22
47
  `;