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

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 (302) 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/Product.liquid.js +1 -1
  112. package/dist/cjs/product/components/ProductBundle/common/classes.js +25 -0
  113. package/dist/cjs/product/components/ProductBundle/common/index.js +5 -0
  114. package/dist/cjs/product/components/ProductBundle/common/styles.js +89 -0
  115. package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscount.js +82 -0
  116. package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscount.liquid.js +74 -0
  117. package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.js +69 -0
  118. package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.liquid.js +46 -0
  119. package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscountItem.js +23 -0
  120. package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscountItem.liquid.js +14 -0
  121. package/dist/cjs/product/components/{ProductBundleDiscount.js → ProductBundle/hooks/useProductBundleDataState.js} +20 -215
  122. package/dist/cjs/product/components/ProductBundle/hooks/useProductBundleDiscountState.js +56 -0
  123. package/dist/cjs/product/{setting → components/ProductBundle/setting}/ProductBundleDiscount.js +7 -7
  124. package/dist/cjs/product/{setting → components/ProductBundle/setting}/ProductBundleDiscountItem.js +3 -0
  125. package/dist/cjs/product/components/ProductButton.js +2 -2
  126. package/dist/cjs/product/components/ProductButton.liquid.js +2 -2
  127. package/dist/cjs/product/components/ProductPrice/common/getAttr.js +23 -0
  128. package/dist/cjs/product/components/ProductPrice/common/getClasses.js +19 -0
  129. package/dist/cjs/product/components/ProductPrice/common/getTextData.js +40 -0
  130. package/dist/cjs/product/components/ProductPrice/hooks/useGpPrice.js +126 -0
  131. package/dist/cjs/product/components/ProductPrice/index.js +54 -0
  132. package/dist/cjs/product/components/ProductPrice/index.liquid.js +43 -0
  133. package/dist/cjs/product/components/ProductQuickView/ProductQuickView.js +5 -5
  134. package/dist/cjs/product/next.js +3 -3
  135. package/dist/cjs/product/setting/index.js +2 -2
  136. package/dist/cjs/product/setting/product/configs/presets.js +1 -0
  137. package/dist/cjs/product/setting/product-image-v2/configs/setting-v2/ProductFeatureImage.js +6 -7
  138. package/dist/cjs/product/setting/product-image-v2/configs/setting-v2/ProductGalleryImage.js +11 -12
  139. package/dist/cjs/product/setting/product-image-v2/configs/setting-v2/index.js +6 -5
  140. package/dist/cjs/product/setting/product-list/configs/settingsV2.js +10 -8
  141. package/dist/cjs/setting.js +5 -2
  142. package/dist/esm/accordion/components/Accordion.js +61 -180
  143. package/dist/esm/accordion/components/Accordion.liquid.js +78 -102
  144. package/dist/esm/accordion/components/AccordionItem.js +129 -281
  145. package/dist/esm/accordion/components/AccordionItem.liquid.js +76 -214
  146. package/dist/esm/accordion/components/common/classes.js +44 -0
  147. package/dist/esm/accordion/components/common/index.js +136 -0
  148. package/dist/esm/accordion/components/common/styles.js +122 -0
  149. package/dist/esm/accordion/hooks/useAccordion.js +141 -0
  150. package/dist/esm/accordion/hooks/useAccordionItem.js +115 -0
  151. package/dist/esm/article/components/ArticleImage.js +0 -1
  152. package/dist/esm/article/components/ArticlePagination.js +1 -1
  153. package/dist/esm/article/components/ArticlePagination.liquid.js +3 -3
  154. package/dist/esm/article/setting/configs/ArticleImage/settings.js +5 -5
  155. package/dist/esm/banner/components/HeroBannerItem.js +0 -6
  156. package/dist/esm/banner/components/HeroBannerItem.liquid.js +3 -0
  157. package/dist/esm/banner/setting/setting.js +28 -3
  158. package/dist/esm/banner/setting/uiV2.js +10 -97
  159. package/dist/esm/builder.js +3 -5
  160. package/dist/esm/cart/components/CartLineImage.js +0 -2
  161. package/dist/esm/code/common/classes.js +9 -0
  162. package/dist/esm/code/common/styles.js +13 -0
  163. package/dist/esm/code/components/CSSCode.js +9 -99
  164. package/dist/esm/code/components/CSSCode.liquid.js +12 -12
  165. package/dist/esm/code/hooks/useCSSCode.js +98 -0
  166. package/dist/esm/code/setting/CSSCode.js +7 -121
  167. package/dist/esm/code/setting/config/setting.js +75 -0
  168. package/dist/esm/code/setting/config/uiV1.js +50 -0
  169. package/dist/esm/code/setting/config/uiV2.js +56 -0
  170. package/dist/esm/estimate-delivery/components/EstimateDate.liquid.js +4 -1
  171. package/dist/esm/form/components/contact/Contact.js +7 -3
  172. package/dist/esm/form/components/contact/common/composeStyles.js +19 -0
  173. package/dist/esm/form/components/form-checkbox/FormCheckbox.js +7 -5
  174. package/dist/esm/form/components/form-checkbox/FormCheckbox.liquid.js +3 -5
  175. package/dist/esm/form/components/form-checkbox/common/composeClasses.js +2 -2
  176. package/dist/esm/form/components/form-checkbox/common/composeStyles.js +25 -11
  177. package/dist/esm/form/components/form-dropdown/common/composeClasses.js +1 -1
  178. package/dist/esm/form/components/form-email/FormEmail.js +18 -10
  179. package/dist/esm/form/components/form-email/common/composeClasses.js +2 -1
  180. package/dist/esm/form/components/newsletter/Newsletter.js +8 -3
  181. package/dist/esm/form/components/newsletter/Newsletter.liquid.js +1 -1
  182. package/dist/esm/form/components/newsletter/common/composeStyles.js +4 -2
  183. package/dist/esm/form/components/textarea/TextArea.js +16 -8
  184. package/dist/esm/form/components/textarea/common/composeClasses.js +1 -1
  185. package/dist/esm/form/components/textfield/TextField.js +17 -9
  186. package/dist/esm/form/components/textfield/common/composeClasses.js +2 -2
  187. package/dist/esm/form/setting/contact/Contact.js +5 -1
  188. package/dist/esm/form/setting/form-checkbox/configs/settings.js +153 -6
  189. package/dist/esm/form/setting/form-checkbox/configs/uiV2.js +137 -0
  190. package/dist/esm/form/setting/form-dropdown/configs/settings.js +147 -0
  191. package/dist/esm/form/setting/form-dropdown/configs/uiV2.js +156 -4
  192. package/dist/esm/form/setting/newsletter/configs/settings.js +132 -3
  193. package/dist/esm/form/setting/newsletter/configs/uiV2.js +93 -0
  194. package/dist/esm/form/setting/submit-button/configs/settings.js +37 -0
  195. package/dist/esm/form/setting/submit-button/configs/uiV2.js +13 -0
  196. package/dist/esm/grid/row/commons/getInnerRadius.js +11 -10
  197. package/dist/esm/grid/row/setting/configs/uiV2.js +1 -1
  198. package/dist/esm/header/components/kind/basic/index.js +1 -0
  199. package/dist/esm/header/components/kind/modern/index.js +1 -1
  200. package/dist/esm/helpers.js +52 -1
  201. package/dist/esm/icon-list/setting/configs/uiV2.js +1 -1
  202. package/dist/esm/icon-list-v2/setting/configs/settings.js +5 -5
  203. package/dist/esm/image/components/AdaptiveImage.js +64 -50
  204. package/dist/esm/image/components/AdaptiveImage.liquid.js +57 -45
  205. package/dist/esm/image/components/Image.js +66 -155
  206. package/dist/esm/image/components/Image.liquid.js +69 -104
  207. package/dist/esm/image/components/Modal3d.liquid.js +55 -22
  208. package/dist/esm/image/components/NextImage.js +26 -59
  209. package/dist/esm/image/components/NextImage.liquid.js +28 -116
  210. package/dist/esm/image/components/Video.liquid.js +38 -13
  211. package/dist/esm/image/components/common/attributes.js +108 -0
  212. package/dist/esm/image/components/common/classes.js +51 -0
  213. package/dist/esm/image/components/common/constants.js +11 -0
  214. package/dist/esm/image/components/common/data.js +22 -0
  215. package/dist/esm/image/components/common/helpers.js +69 -0
  216. package/dist/esm/image/components/common/styles.js +80 -0
  217. package/dist/esm/image/components/helpers/getNextImageLiquidAttrs.js +78 -0
  218. package/dist/esm/image/components/helpers/getNextImageReactAttrs.js +38 -0
  219. package/dist/esm/image/components/hooks/useCheckNoImage.js +23 -0
  220. package/dist/esm/image/helpers/getSrcSet.js +1 -2
  221. package/dist/esm/image/next.js +1 -5
  222. package/dist/esm/image/setting/configs/settings.js +14 -8
  223. package/dist/esm/image/setting/configs/uiV2.js +61 -15
  224. package/dist/esm/image/setting/index.js +1 -3
  225. package/dist/esm/image-comparison/components/CompareImage.js +1 -1
  226. package/dist/esm/image-comparison/components/CompareImage.liquid.js +1 -1
  227. package/dist/esm/index.js +4 -5
  228. package/dist/esm/index.liquid.js +3 -3
  229. package/dist/esm/post-purchase/callout-banner/components/CalloutText.js +2 -1
  230. package/dist/esm/post-purchase/callout-banner/components/common/getClasses.js +5 -2
  231. package/dist/esm/post-purchase/callout-banner/components/common/getStyles.js +2 -4
  232. package/dist/esm/post-purchase/callout-banner/setting/config/callout-box/setting.js +4 -10
  233. package/dist/esm/post-purchase/callout-banner/setting/config/callout-text/setting.js +1 -11
  234. package/dist/esm/post-purchase/countdown-timer/components/PostPurchaseCountdownTimer.js +9 -23
  235. package/dist/esm/post-purchase/countdown-timer/components/TextCountdown.js +13 -27
  236. package/dist/esm/post-purchase/countdown-timer/components/common/getClasses.js +21 -0
  237. package/dist/esm/post-purchase/countdown-timer/components/common/getStyles.js +19 -0
  238. package/dist/esm/post-purchase/countdown-timer/hooks/useCountdownTimer.js +19 -3
  239. package/dist/esm/post-purchase/countdown-timer/hooks/useGetTimeExpired.js +16 -0
  240. package/dist/esm/post-purchase/countdown-timer/settings/CountdownTimer.js +9 -358
  241. package/dist/esm/post-purchase/countdown-timer/settings/config/preset.js +24 -0
  242. package/dist/esm/post-purchase/countdown-timer/settings/config/setting.js +241 -0
  243. package/dist/esm/post-purchase/countdown-timer/settings/config/uiV1.js +123 -0
  244. package/dist/esm/post-purchase/countdown-timer/settings/config/uiV2.js +183 -0
  245. package/dist/esm/post-purchase/image/common/getClasses.js +1 -1
  246. package/dist/esm/post-purchase/image/setting/setting-v2.js +5 -5
  247. package/dist/esm/post-purchase/product/components/product-image/carousel-post-purchase/CarouselWrapperPostPurchase.js +25 -27
  248. package/dist/esm/post-purchase/product/settings/product-image/setting-v2.js +5 -5
  249. package/dist/esm/post-purchase/product/settings/product-price-breakdown/configs/settings.js +2 -2
  250. package/dist/esm/post-purchase/product/settings/product-quantity/configs/settings.js +1 -1
  251. package/dist/esm/product/components/FileUpload/components/common/index.js +3 -0
  252. package/dist/esm/product/components/Product.liquid.js +1 -1
  253. package/dist/esm/product/components/ProductBundle/common/classes.js +19 -0
  254. package/dist/esm/product/components/ProductBundle/common/index.js +3 -0
  255. package/dist/esm/product/components/ProductBundle/common/styles.js +80 -0
  256. package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscount.js +78 -0
  257. package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscount.liquid.js +70 -0
  258. package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.js +65 -0
  259. package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.liquid.js +42 -0
  260. package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscountItem.js +19 -0
  261. package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscountItem.liquid.js +10 -0
  262. package/dist/esm/product/components/{ProductBundleDiscount.js → ProductBundle/hooks/useProductBundleDataState.js} +21 -216
  263. package/dist/esm/product/components/ProductBundle/hooks/useProductBundleDiscountState.js +52 -0
  264. package/dist/esm/product/{setting → components/ProductBundle/setting}/ProductBundleDiscount.js +7 -7
  265. package/dist/esm/product/{setting → components/ProductBundle/setting}/ProductBundleDiscountItem.js +3 -0
  266. package/dist/esm/product/components/ProductButton.js +1 -1
  267. package/dist/esm/product/components/ProductButton.liquid.js +1 -1
  268. package/dist/esm/product/components/ProductPrice/common/getAttr.js +21 -0
  269. package/dist/esm/product/components/ProductPrice/common/getClasses.js +17 -0
  270. package/dist/esm/product/components/ProductPrice/common/getTextData.js +38 -0
  271. package/dist/esm/product/components/ProductPrice/hooks/useGpPrice.js +124 -0
  272. package/dist/esm/product/components/ProductPrice/index.js +50 -0
  273. package/dist/esm/product/components/ProductPrice/index.liquid.js +38 -0
  274. package/dist/esm/product/components/ProductQuickView/ProductQuickView.js +1 -1
  275. package/dist/esm/product/next.js +3 -3
  276. package/dist/esm/product/setting/index.js +2 -2
  277. package/dist/esm/product/setting/product/configs/presets.js +1 -0
  278. package/dist/esm/product/setting/product-image-v2/configs/setting-v2/ProductFeatureImage.js +6 -7
  279. package/dist/esm/product/setting/product-image-v2/configs/setting-v2/ProductGalleryImage.js +11 -12
  280. package/dist/esm/product/setting/product-image-v2/configs/setting-v2/index.js +6 -5
  281. package/dist/esm/product/setting/product-list/configs/settingsV2.js +10 -8
  282. package/dist/esm/setting.js +5 -2
  283. package/dist/types/index.d.ts +174 -257
  284. package/package.json +2 -2
  285. package/dist/cjs/image/components/BackgroundImage.js +0 -102
  286. package/dist/cjs/image/components/Img.js +0 -28
  287. package/dist/cjs/image/components/helpers.js +0 -12
  288. package/dist/cjs/image/setting/BackgroundImage.js +0 -364
  289. package/dist/cjs/product/components/ProductBundleDiscount.liquid.js +0 -81
  290. package/dist/cjs/product/components/ProductBundleDiscountItem.js +0 -42
  291. package/dist/cjs/product/components/ProductBundleDiscountItem.liquid.js +0 -103
  292. package/dist/cjs/product/components/ProductPrice.js +0 -209
  293. package/dist/cjs/product/components/ProductPrice.liquid.js +0 -88
  294. package/dist/esm/image/components/BackgroundImage.js +0 -98
  295. package/dist/esm/image/components/Img.js +0 -24
  296. package/dist/esm/image/components/helpers.js +0 -9
  297. package/dist/esm/image/setting/BackgroundImage.js +0 -360
  298. package/dist/esm/product/components/ProductBundleDiscount.liquid.js +0 -77
  299. package/dist/esm/product/components/ProductBundleDiscountItem.js +0 -36
  300. package/dist/esm/product/components/ProductBundleDiscountItem.liquid.js +0 -99
  301. package/dist/esm/product/components/ProductPrice.js +0 -205
  302. package/dist/esm/product/components/ProductPrice.liquid.js +0 -83
@@ -6,191 +6,72 @@ Object.defineProperty(exports, '__esModule', { value: true });
6
6
  var jsxRuntime = require('react/jsx-runtime');
7
7
  var React = require('react');
8
8
  var core = require('@gem-sdk/core');
9
+ var system = require('@gem-sdk/system');
10
+ var styles = require('./common/styles.js');
11
+ var useAccordion = require('../hooks/useAccordion.js');
12
+ var classes = require('./common/classes.js');
9
13
 
10
- const Accordion = ({ builderProps, builderAttrs, style, children, setting, styles })=>{
11
- const { align } = styles ?? {};
12
- const currentAccordions = React.useRef([]);
13
- const { childItem, activeKey, expandItem, expandedMode } = setting ?? {};
14
- const [accordions, setAccordions] = React.useState([]);
15
- const contentSizePaddingSize = core.makeGlobalSize(styles?.contentSizePadding);
16
- const mode = core.useEditorMode();
17
- const { onListener, saveToElementInteractionData, ref, findElementIncludingSelf } = core.useInteraction();
18
- const expanded = React.useMemo(()=>{
19
- return expandedMode === 'multiple' ? true : expandedMode !== 'single';
20
- }, [
21
- expandedMode
22
- ]);
23
- React.useEffect(()=>{
24
- if (!expanded && !activeKey) {
25
- currentAccordions.current = [
26
- '0'
27
- ];
28
- setAccordions([
29
- '0'
30
- ]);
31
- }
32
- if (!activeKey) {
33
- currentAccordions.current = [];
34
- setAccordions([]);
35
- }
36
- }, [
37
- expanded,
38
- activeKey
39
- ]);
40
- React.useEffect(()=>{
41
- if (!expandItem) {
42
- currentAccordions.current = [];
43
- setAccordions([]);
44
- }
45
- }, [
46
- expandItem
47
- ]);
48
- React.useEffect(()=>{
49
- if (activeKey && expandItem) {
50
- const composeActiveKeys = activeKey?.toString()?.toLowerCase()?.split(',')?.map((item)=>parseInt(item.trim()) - 1)?.map((item)=>item.toString());
51
- setAccordions(composeActiveKeys);
52
- currentAccordions.current = composeActiveKeys;
53
- }
54
- }, [
55
- activeKey,
56
- expandItem
57
- ]);
58
- React.useEffect(()=>{
59
- if (!expandItem) {
60
- setAccordions([]);
61
- currentAccordions.current = [];
62
- }
63
- if (activeKey?.toString()?.toLowerCase() === 'all' && expandItem) {
64
- const list = Array.from(React.Children?.map(children, (_, index)=>index.toString()));
65
- setAccordions(list);
66
- currentAccordions.current = list;
67
- }
68
- // eslint-disable-next-line react-hooks/exhaustive-deps
69
- }, [
70
- activeKey,
71
- expandItem
72
- ]);
73
- const setActive = (id)=>{
74
- if (accordions.includes(id)) {
75
- setAccordions([]);
76
- currentAccordions.current = [];
77
- } else {
78
- setAccordions([
79
- id
80
- ]);
81
- currentAccordions.current = [
82
- id
83
- ];
84
- }
85
- };
86
- const setToggle = (id)=>{
87
- let newActive = [];
88
- if (accordions.includes(id)) {
89
- newActive = accordions.filter((accordion)=>accordion !== id);
90
- } else {
91
- newActive = [
92
- ...accordions,
93
- id
94
- ];
95
- }
96
- setAccordions(newActive);
97
- currentAccordions.current = newActive;
98
- };
99
- const handleDropdown = (id)=>{
100
- expanded ? setToggle(id.toString()) : setActive(id.toString());
101
- };
102
- const filterStyles = React.useMemo(()=>{
103
- const delList = [
104
- '--mb',
105
- '--mb-mobile',
106
- '--mb-tablet',
107
- '--d',
108
- '--d-mobile',
109
- '--d-tablet'
110
- ];
111
- delList.forEach((element)=>{
112
- delete style?.[element];
113
- });
114
- return style;
115
- }, [
116
- style
117
- ]);
118
- React.useEffect(()=>{
119
- const selector = `[data-id="${builderProps?.uid}"]`;
120
- onListener({
121
- event: 'gp:change-expanded-item-original',
122
- selector
123
- }, (params)=>{
124
- const element = findElementIncludingSelf(ref.current || document, selector);
125
- const { data, isRollback, key } = params || {};
126
- if (data === undefined && isRollback) return;
127
- if (isRollback) {
128
- setAccordions(data);
129
- return;
130
- }
131
- let interactionAccordion = [
132
- ...currentAccordions.current
133
- ];
134
- saveToElementInteractionData(element, key, JSON.stringify({
135
- data: interactionAccordion
136
- }));
137
- const id = data.toString();
138
- if (expanded) {
139
- interactionAccordion = [
140
- ...interactionAccordion.filter((accordion)=>accordion !== id),
141
- id
142
- ];
143
- } else {
144
- interactionAccordion = [
145
- id
146
- ];
147
- }
148
- setAccordions(interactionAccordion);
14
+ const Accordion = ({ builderProps, builderAttrs, style, children, setting, styles: styles$1, advanced })=>{
15
+ const { align } = styles$1 ?? {};
16
+ const { childItem } = setting ?? {};
17
+ const { ref, mode, accordions, handleDropdown, activeKey } = useAccordion.default({
18
+ setting,
19
+ children,
20
+ builderProps
21
+ });
22
+ const createContainerStyles = system.createStyle({
23
+ ...styles.getContainerStyles(style, styles$1)
24
+ });
25
+ const createContainerClasses = system.createClass(classes.getContainerClasses(advanced?.cssClass, mode));
26
+ const createContainerAttr = system.createAttr({
27
+ ...builderAttrs,
28
+ 'data-id': builderProps?.uid ?? ''
29
+ });
30
+ const createChildrenContainerStyles = system.createStyle({
31
+ ...core.makeStyleResponsive('jc', align)
32
+ });
33
+ const createChildrenContainerClasses = system.createClass({
34
+ 'gp-flex': true
35
+ });
36
+ const composeChildren = React.useMemo(()=>{
37
+ return React.Children.map(children, (child, index)=>{
38
+ if (!/*#__PURE__*/ React.isValidElement(child)) return child;
39
+ const childProps = {
40
+ ...child.props,
41
+ index,
42
+ title: childItem?.[index],
43
+ accordions,
44
+ handleDropDown: handleDropdown,
45
+ parentSetting: setting,
46
+ parentStyle: styles$1,
47
+ activeKey,
48
+ childrenIcon: setting?.childConfig?.[index],
49
+ parentUid: builderProps?.uid
50
+ };
51
+ return /*#__PURE__*/ jsxRuntime.jsx("div", {
52
+ className: createChildrenContainerClasses,
53
+ style: createChildrenContainerStyles,
54
+ children: /*#__PURE__*/ React.cloneElement(child, childProps)
55
+ });
149
56
  });
150
- // eslint-disable-next-line react-hooks/exhaustive-deps
151
- }, []);
152
- React.useEffect(()=>{
153
- currentAccordions.current = accordions;
154
57
  }, [
155
- accordions
58
+ accordions,
59
+ activeKey,
60
+ builderProps?.uid,
61
+ childItem,
62
+ children,
63
+ createChildrenContainerClasses,
64
+ createChildrenContainerStyles,
65
+ handleDropdown,
66
+ setting,
67
+ styles$1
156
68
  ]);
157
69
  return /*#__PURE__*/ jsxRuntime.jsx("div", {
158
- ...builderAttrs,
70
+ ...createContainerAttr,
159
71
  ref: ref,
160
- "data-id": builderProps?.uid,
161
- className: core.cls('gp-flex gp-flex-col ', {
162
- 'gp-px-[1px]': mode === 'edit'
163
- }),
164
- style: {
165
- ...filterStyles,
166
- ...contentSizePaddingSize.gap,
167
- ...core.getStyleBackgroundByDevice(style?.backgroundContent),
168
- borderRadius: 'inherit',
169
- overflow: 'hidden'
170
- },
171
- children: React.Children.map(children, (child, index)=>{
172
- if (/*#__PURE__*/ React.isValidElement(child)) {
173
- return /*#__PURE__*/ jsxRuntime.jsx("div", {
174
- className: "gp-flex",
175
- style: {
176
- ...core.makeStyleResponsive('jc', align)
177
- },
178
- children: /*#__PURE__*/ jsxRuntime.jsx(child.type, {
179
- ...child.props,
180
- index: index,
181
- title: childItem?.[index],
182
- accordions: accordions,
183
- handleDropDown: handleDropdown,
184
- parentSetting: setting,
185
- parentStyle: styles,
186
- activeKey: activeKey,
187
- childrenIcon: setting?.childConfig?.[index],
188
- parentUid: builderProps?.uid
189
- })
190
- });
191
- }
192
- return child;
193
- })
72
+ className: createContainerClasses,
73
+ style: createContainerStyles,
74
+ children: composeChildren
194
75
  });
195
76
  };
196
77
 
@@ -4,110 +4,86 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var core = require('@gem-sdk/core');
6
6
  var helpers = require('../../helpers.js');
7
+ var system = require('@gem-sdk/system');
8
+ var index = require('./common/index.js');
9
+ var styles = require('./common/styles.js');
10
+ var classes = require('./common/classes.js');
7
11
 
8
- const Accordion = ({ rawChildren, setting, styles, builderProps, pageContext, advanced })=>{
9
- const { childItem, activeKey, iconSvg, expandItem, iconPosition, iconCollapseSize, iconGlobalSize, iconExpand, iconCollapse, layoutHeader, expandedMode, configIconSize, translate } = setting ?? {};
10
- const { align, bgColor, color, headerBorder, width, fullWidth, textColor, itemHeaderSpacing, contentSizePadding, iconColor, headerContentPadding, widthHeightSize, backgroundContent } = styles ?? {};
11
- const contentSizePaddingSize = core.makeGlobalSize(styles?.contentSizePadding);
12
- let accordions = [];
13
- let activeIndex = [
14
- '0'
15
- ];
16
- if (!expandItem) {
17
- activeIndex = [];
18
- } else if (activeKey) {
19
- const composeActiveKeys = activeKey.toString().toLowerCase().split(',').map((item)=>parseInt(item.trim()) - 1).map((item)=>item.toString());
20
- activeIndex = composeActiveKeys;
21
- }
22
- const expanded = expandedMode === 'multiple' ? true : false;
23
- if (expanded) {
24
- accordions.push(...activeIndex);
25
- } else {
26
- accordions = activeIndex;
27
- }
28
- return core.template`
29
- <gp-accordion
30
- data-id="${builderProps?.uid}"
31
- ${builderProps}
32
- class="gp-flex gp-w-full gp-flex-col ${advanced?.cssClass}"
33
- style="${{
34
- ...contentSizePaddingSize.gap,
35
- ...core.getStyleBackgroundByDevice(backgroundContent),
36
- 'border-radius': 'inherit',
37
- overflow: 'hidden'
38
- }}"
39
- gp-data='${JSON.stringify({
40
- setting: {
41
- iconSvg,
42
- isIconPlus: iconSvg === 'plus',
43
- activeKey,
44
- expanded,
45
- expandItem,
46
- iconPosition,
47
- iconGlobalSize,
48
- iconCollapse,
49
- iconExpand,
50
- iconCollapseSize,
51
- layoutHeader,
52
- expandedMode,
53
- configIconSize,
54
- parentUid: builderProps?.uid,
55
- childListNumber: expandItem ? activeKey?.toString()?.toLowerCase() === 'all' ? rawChildren?.map((item, index)=>index.toString()) : accordions : [],
56
- chidlrenUid: rawChildren?.map((item)=>item.uid)
57
- },
58
- styles: {
59
- bgColor,
60
- color,
61
- headerBorder,
62
- fullWidth,
63
- width,
64
- itemHeaderSpacing,
65
- textColor,
66
- iconColor,
67
- contentSizePadding,
68
- headerContentPadding,
69
- widthHeightSize
70
- },
71
- uid: builderProps?.uid
72
- }).replaceAll("'", '&#039;')}'
73
- >
74
- <div class="gp-hidden gp-rotate-90 -gp-rotate-90 gp-rotate-180"></div>
75
- ${core.WrapRenderChildren({
76
- uid: builderProps?.uid || '',
77
- customProps: rawChildren?.[0].customProps
78
- }, rawChildren?.map((child, index)=>{
79
- if (child) {
80
- const title = helpers.getDynamicSourceLocales({
81
- val: childItem?.[index],
82
- uid: builderProps?.uid,
83
- settingId: `childItem_${index}`,
84
- pageContext,
85
- isCapitalize: setting?.titleTypo?.attrs?.transform === 'capitalize',
86
- translate
87
- });
88
- return core.template`<div
89
- class="gp-flex"
90
- style="${{
91
- ...core.makeStyleResponsive('jc', align)
92
- }}"
93
- >
94
- ${core.RenderChildren({
95
- ...child,
96
- index: index,
97
- title: title,
98
- accordions: accordions,
99
- parentSetting: setting,
100
- parentStyle: styles,
101
- parentUid: builderProps?.uid,
102
- childrenIcon: setting?.childConfig?.[index],
103
- activeKey: activeKey
104
- })}
105
- </div>
12
+ const Accordion = ({ rawChildren, setting, styles: styles$1, builderProps, pageContext, advanced, style, builderAttrs })=>{
13
+ const { align } = styles$1 ?? {};
14
+ const { translate, childItem, activeKey } = setting ?? {};
15
+ const { uidState, settingState, stylesState, accordions } = index.getDataState({
16
+ setting,
17
+ styles: styles$1,
18
+ builderProps
19
+ }, rawChildren);
20
+ const createDataState = system.createStateOrContext({
21
+ uid: uidState,
22
+ setting: settingState,
23
+ styles: stylesState
24
+ });
25
+ const createContainerClasses = system.createClass(classes.getContainerClasses(advanced?.cssClass));
26
+ const createContainerStyles = system.createStyle({
27
+ ...styles.getContainerStyles(style, styles$1)
28
+ });
29
+ const createContainerAttr = system.createAttr({
30
+ ...builderAttrs,
31
+ 'data-id': builderProps?.uid ?? ''
32
+ });
33
+ const createChildrenContainerStyles = system.createStyle({
34
+ ...core.makeStyleResponsive('jc', align)
35
+ });
36
+ const createChildrenContainerClasses = system.createClass({
37
+ 'gp-flex': true
38
+ });
39
+ const createExtendClasses = system.createClass(classes.extendClasses());
40
+ const composeChildren = ()=>{
41
+ return core.WrapRenderChildren({
42
+ uid: builderProps?.uid ?? '',
43
+ customProps: rawChildren?.[0].customProps
44
+ }, rawChildren?.map((child, index)=>{
45
+ if (child) {
46
+ const title = helpers.getDynamicSourceLocales({
47
+ val: childItem?.[index],
48
+ uid: builderProps?.uid,
49
+ settingId: `childItem_${index}`,
50
+ pageContext,
51
+ isCapitalize: setting?.titleTypo?.attrs?.transform === 'capitalize',
52
+ translate
53
+ });
54
+ return core.template`
55
+ <div class="${createChildrenContainerClasses}" style="${createChildrenContainerStyles}">
56
+ ${core.RenderChildren({
57
+ ...child,
58
+ index: index,
59
+ title: title,
60
+ accordions: accordions,
61
+ parentSetting: setting,
62
+ parentStyle: styles$1,
63
+ parentUid: builderProps?.uid,
64
+ childrenIcon: setting?.childConfig?.[index],
65
+ activeKey: activeKey
66
+ })}
67
+ </div>
106
68
  `;
107
- }
108
- }))}
69
+ }
70
+ }));
71
+ };
72
+ const renderScript = ()=>{
73
+ return core.RenderIf(core.isLocalEnv, `
74
+ <script ${helpers.getSettingPreloadData('class="gps-link" delay', 'src')}="{{ 'gp-accordion.js' | asset_url }}"
75
+ defer="defer"></script>`, `
76
+ <script ${helpers.getSettingPreloadData('class="gps-link" delay', 'src')}="${core.baseAssetURL}/assets-v2/gp-accordion.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>
77
+ `);
78
+ };
79
+ return core.template`
80
+ <gp-accordion ${createContainerAttr} class="${createContainerClasses}" style="${createContainerStyles}"
81
+ gp-data='${JSON.stringify(createDataState).replaceAll("'", '&#039;')}'
82
+ >
83
+ <div class=" ${createExtendClasses}"></div>
84
+ ${composeChildren()}
109
85
  </gp-accordion>
110
- ${core.RenderIf(core.isLocalEnv, `<script ${helpers.getSettingPreloadData('class="gps-link" delay', 'src')}="{{ 'gp-accordion.js' | asset_url }}" defer="defer"></script>`, `<script ${helpers.getSettingPreloadData('class="gps-link" delay', 'src')}="${core.baseAssetURL}/assets-v2/gp-accordion.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
86
+ ${renderScript()}
111
87
  `;
112
88
  };
113
89