@gem-sdk/components 2.0.0-dev.277 → 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/setting/config/callout-box/setting.js +4 -10
  89. package/dist/cjs/post-purchase/countdown-timer/components/PostPurchaseCountdownTimer.js +9 -23
  90. package/dist/cjs/post-purchase/countdown-timer/components/TextCountdown.js +12 -26
  91. package/dist/cjs/post-purchase/countdown-timer/components/common/getClasses.js +24 -0
  92. package/dist/cjs/post-purchase/countdown-timer/components/common/getStyles.js +21 -0
  93. package/dist/cjs/post-purchase/countdown-timer/hooks/useCountdownTimer.js +18 -1
  94. package/dist/cjs/post-purchase/countdown-timer/hooks/useGetTimeExpired.js +18 -0
  95. package/dist/cjs/post-purchase/countdown-timer/settings/CountdownTimer.js +9 -358
  96. package/dist/cjs/post-purchase/countdown-timer/settings/config/preset.js +26 -0
  97. package/dist/cjs/post-purchase/countdown-timer/settings/config/setting.js +243 -0
  98. package/dist/cjs/post-purchase/countdown-timer/settings/config/uiV1.js +125 -0
  99. package/dist/cjs/post-purchase/countdown-timer/settings/config/uiV2.js +185 -0
  100. package/dist/cjs/post-purchase/image/common/getClasses.js +1 -1
  101. package/dist/cjs/post-purchase/image/setting/setting-v2.js +5 -5
  102. package/dist/cjs/post-purchase/product/components/product-image/carousel-post-purchase/CarouselWrapperPostPurchase.js +24 -26
  103. package/dist/cjs/post-purchase/product/hooks/product-image/useListCarousel.js +1 -1
  104. package/dist/cjs/post-purchase/product/hooks/product-image/useProductImagePostPurchase.js +4 -1
  105. package/dist/cjs/post-purchase/product/settings/product-image/setting-v2.js +20 -7
  106. package/dist/cjs/post-purchase/product/settings/product-image/uiV2.js +3 -1
  107. package/dist/cjs/post-purchase/product/settings/product-price-breakdown/configs/settings.js +2 -2
  108. package/dist/cjs/post-purchase/product/settings/product-quantity/configs/settings.js +1 -1
  109. package/dist/cjs/post-purchase/utils/constants.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/setting/config/callout-box/setting.js +4 -10
  229. package/dist/esm/post-purchase/countdown-timer/components/PostPurchaseCountdownTimer.js +9 -23
  230. package/dist/esm/post-purchase/countdown-timer/components/TextCountdown.js +13 -27
  231. package/dist/esm/post-purchase/countdown-timer/components/common/getClasses.js +21 -0
  232. package/dist/esm/post-purchase/countdown-timer/components/common/getStyles.js +19 -0
  233. package/dist/esm/post-purchase/countdown-timer/hooks/useCountdownTimer.js +19 -3
  234. package/dist/esm/post-purchase/countdown-timer/hooks/useGetTimeExpired.js +16 -0
  235. package/dist/esm/post-purchase/countdown-timer/settings/CountdownTimer.js +9 -358
  236. package/dist/esm/post-purchase/countdown-timer/settings/config/preset.js +24 -0
  237. package/dist/esm/post-purchase/countdown-timer/settings/config/setting.js +241 -0
  238. package/dist/esm/post-purchase/countdown-timer/settings/config/uiV1.js +123 -0
  239. package/dist/esm/post-purchase/countdown-timer/settings/config/uiV2.js +183 -0
  240. package/dist/esm/post-purchase/image/common/getClasses.js +1 -1
  241. package/dist/esm/post-purchase/image/setting/setting-v2.js +5 -5
  242. package/dist/esm/post-purchase/product/components/product-image/carousel-post-purchase/CarouselWrapperPostPurchase.js +25 -27
  243. package/dist/esm/post-purchase/product/hooks/product-image/useListCarousel.js +1 -1
  244. package/dist/esm/post-purchase/product/hooks/product-image/useProductImagePostPurchase.js +4 -1
  245. package/dist/esm/post-purchase/product/settings/product-image/setting-v2.js +20 -7
  246. package/dist/esm/post-purchase/product/settings/product-image/uiV2.js +3 -1
  247. package/dist/esm/post-purchase/product/settings/product-price-breakdown/configs/settings.js +2 -2
  248. package/dist/esm/post-purchase/product/settings/product-quantity/configs/settings.js +1 -1
  249. package/dist/esm/post-purchase/utils/constants.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 +173 -256
  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,205 +0,0 @@
1
- 'use client';
2
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
- import { useEditorMode, useQuantity, useCurrentVariant, useProductBundleDiscount, useProduct, useInteraction, isSafari, useFormatMoney, cls, getGlobalColorClass, getStyleShadow, getGlobalColorStateStyle, makeStyle, getGlobalColorStateClass, filterToolbarPreview } from '@gem-sdk/core';
4
- import { useRef, useState, useMemo, useEffect } from 'react';
5
- import Text from '../../text/components/Text.js';
6
- import { useTransition } from './ProductVariants/common.js';
7
- import NoDataState from '../../common/components/NoDataState.js';
8
- import TooltipHover from '../../common/components/TooltipHover.js';
9
-
10
- const ProductPrice = (props)=>{
11
- const { builderAttrs, style, children, setting, styles, builderProps, classNames } = props;
12
- const elementRef = useRef(null);
13
- const bundleItem = props['bundle-item'];
14
- const mode = useEditorMode();
15
- const { quantity, hasUpdatePrice } = useQuantity();
16
- const currentVariant = useCurrentVariant();
17
- const { useProductCompareAtPrice } = useProductBundleDiscount();
18
- const currentProduct = useProduct();
19
- const price = currentVariant?.price ?? 0;
20
- const salePrice = currentVariant?.salePrice ?? 0;
21
- const [hasThickness, setHasThickness] = useState(true);
22
- const { trigger } = useInteraction();
23
- const quantityProduct = useMemo(()=>{
24
- if (bundleItem?.quantity) {
25
- return bundleItem.quantity;
26
- }
27
- return hasUpdatePrice ? quantity || 1 : 1;
28
- }, [
29
- quantity,
30
- hasUpdatePrice,
31
- bundleItem?.quantity
32
- ]);
33
- const bundleDiscount = useMemo(()=>{
34
- const value = parseInt(bundleItem?.discountValue);
35
- if (bundleItem?.discountType === 'percentage') {
36
- return price * quantityProduct * value / 100;
37
- }
38
- return value;
39
- }, [
40
- bundleItem?.discountType,
41
- bundleItem?.discountValue,
42
- price,
43
- quantityProduct
44
- ]);
45
- const priceCompare = useMemo(()=>{
46
- if (bundleItem?.discountValue) {
47
- if (useProductCompareAtPrice) {
48
- return (salePrice || price) * quantityProduct;
49
- }
50
- return price * quantityProduct;
51
- }
52
- return salePrice * quantityProduct;
53
- }, [
54
- bundleItem?.discountValue,
55
- price,
56
- quantityProduct,
57
- salePrice,
58
- useProductCompareAtPrice
59
- ]);
60
- const displayPrice = useMemo(()=>{
61
- const quantityPrice = price * quantityProduct;
62
- if (styles?.priceType === 'compare') {
63
- return priceCompare;
64
- }
65
- if (bundleDiscount) {
66
- return Math.max(0, quantityPrice - bundleDiscount);
67
- }
68
- return quantityPrice;
69
- }, [
70
- styles?.priceType,
71
- price,
72
- quantityProduct,
73
- bundleDiscount,
74
- priceCompare
75
- ]);
76
- const dispatchInteractionChangePrice = (value, type)=>{
77
- trigger({
78
- event: type === 'price' ? 'gp:rollback:price-change' : 'gp:rollback:compare-price-change',
79
- selector: `[data-id="${builderProps?.uid}"]`,
80
- element: elementRef.current
81
- });
82
- trigger({
83
- event: type === 'price' ? 'gp:price-change' : 'gp:compare-price-change',
84
- data: value,
85
- selector: `[data-id="${builderProps?.uid}"]`,
86
- element: elementRef.current
87
- });
88
- };
89
- useTransition((oldPrice)=>{
90
- if (oldPrice !== price) {
91
- dispatchInteractionChangePrice(price, 'price');
92
- }
93
- }, [
94
- price
95
- ]);
96
- useTransition((oldPriceCompare)=>{
97
- if (oldPriceCompare !== salePrice) {
98
- dispatchInteractionChangePrice(salePrice, 'compare');
99
- }
100
- }, [
101
- salePrice
102
- ]);
103
- const emitNoDataSignal = ()=>{
104
- if (mode !== 'edit') return;
105
- const event = new CustomEvent('editor:product-source-no-data-warning', {
106
- bubbles: true,
107
- detail: {
108
- uid: builderProps?.uid,
109
- value: !displayPrice && styles?.priceType === 'compare',
110
- tag: 'ProductPrice'
111
- }
112
- });
113
- window.dispatchEvent(event);
114
- };
115
- useEffect(()=>{
116
- /* Support line-through on Safari */ if (!isSafari()) return;
117
- setHasThickness(false);
118
- setTimeout(()=>{
119
- setHasThickness(true);
120
- }, 50);
121
- }, [
122
- styles?.thickness
123
- ]);
124
- const moneyFormatted = useFormatMoney(displayPrice ?? 0, setting?.moneyWithCurrentFormat || false);
125
- if (mode !== 'edit' && styles?.priceType === 'compare' && !displayPrice) return /*#__PURE__*/ jsx("div", {
126
- ...builderAttrs,
127
- className: cls(builderProps?.uid),
128
- "data-id": builderProps?.uid,
129
- ref: elementRef,
130
- style: {
131
- visibility: 'hidden',
132
- opacity: 0,
133
- maxWidth: 0,
134
- maxHeight: 0
135
- },
136
- id: `shopify-text-element-${builderProps?.uid}`
137
- });
138
- const colorClass = getGlobalColorClass('decoration', styles?.lineColor);
139
- const currentProductId = currentProduct?.baseID?.replace('gid://shopify/Product/', '');
140
- if (!displayPrice && styles?.priceType === 'compare') {
141
- return /*#__PURE__*/ jsx(NoDataState, {
142
- elementType: "secondary",
143
- description: "No compare price",
144
- rawMode: true
145
- });
146
- }
147
- return /*#__PURE__*/ jsxs("div", {
148
- ...builderAttrs,
149
- className: cls(builderProps?.uid),
150
- "data-id": builderProps?.uid,
151
- ref: elementRef,
152
- style: {
153
- ...style
154
- },
155
- id: `shopify-text-element-${builderProps?.uid}`,
156
- "data-product-id": currentProductId,
157
- "aria-hidden": "true",
158
- onClick: emitNoDataSignal,
159
- children: [
160
- !displayPrice && mode === 'edit' ? /*#__PURE__*/ jsx(TooltipHover, {
161
- enable: true,
162
- text: 'Not be displayed when published',
163
- position: 'bottom',
164
- width: '205px',
165
- children: /*#__PURE__*/ jsx(NoDataState, {
166
- builderAttrs: builderAttrs,
167
- elementType: "secondary",
168
- children: children,
169
- description: "No compare price",
170
- rawMode: true
171
- })
172
- }) : /*#__PURE__*/ jsxs(Fragment, {
173
- children: [
174
- /*#__PURE__*/ jsx(Text, {
175
- styles: styles,
176
- setting: {
177
- text: moneyFormatted,
178
- excludeFlex: true
179
- },
180
- style: {
181
- ...getStyleShadow({
182
- value: setting?.boxShadowPrice,
183
- styleAppliedFor: 'box-shadow',
184
- isEnableShadow: setting?.hasBoxShadowPrice
185
- }),
186
- ...getGlobalColorStateStyle('c', styles?.parentTextColor),
187
- ...setting?.opacityPrice ? makeStyle({
188
- op: `${setting?.opacityPrice}%`
189
- }) : {}
190
- },
191
- className: cls({
192
- 'gp-money': styles?.priceType === 'regular',
193
- 'gp-product-compare-price': styles?.priceType === 'compare',
194
- 'gp-line-through': styles?.priceType === 'compare' && styles?.lineThrough && hasThickness
195
- }, getGlobalColorStateClass('text', styles?.parentTextColor), colorClass, classNames)
196
- }),
197
- children
198
- ]
199
- }),
200
- filterToolbarPreview(children, true)
201
- ]
202
- });
203
- };
204
-
205
- export { ProductPrice as default };
@@ -1,83 +0,0 @@
1
- import { getGlobalColorClass, template, cls, dataStringify, getStyleShadow, getGlobalColorStateStyle, makeStyle, getGlobalColorStateClass, RenderIf, isLocalEnv, baseAssetURL } from '@gem-sdk/core';
2
- import { getSettingPreloadData } from '../../helpers.js';
3
- import Text from '../../text/components/Text.liquid.js';
4
-
5
- const ProductPrice = ({ setting, styles, builderProps, builderAttrs, style, advanced, classNames })=>{
6
- const colorClass = getGlobalColorClass('decoration', styles?.lineColor);
7
- const isComparePrice = styles?.priceType === 'compare' || false;
8
- const priceCompare = ()=>{
9
- return `
10
- {% if variant.compare_at_price %}
11
- {{ variant.compare_at_price | ${setting?.moneyWithCurrentFormat ? `money_with_currency` : `money`}}}
12
- {% else %}
13
-
14
- {% endif %}
15
- `;
16
- };
17
- const defaultPrice = ()=>{
18
- return `
19
- {% if variant.price %}
20
- {{ variant.price | ${setting?.moneyWithCurrentFormat ? `money_with_currency` : `money`}}}
21
- {% endif %}
22
- `;
23
- };
24
- const getDataHidden = ()=>{
25
- if (isComparePrice) {
26
- return `{% if variant.compare_at_price > variant.price and variant.compare_at_price >= 0 %}false{% else %}true{% endif %}`;
27
- }
28
- return false;
29
- };
30
- return template /*liquid*/ `
31
- <gp-product-price
32
- data-id="${builderProps?.uid}"
33
- class="${cls(builderProps?.uid, advanced?.cssClass, classNames)} gp-product-price group-data-[state=loading]:gp-invisible data-[hidden=true]:gp-hidden"
34
- gp-data='${dataStringify({
35
- priceType: styles?.priceType,
36
- uid: builderProps?.uid,
37
- locale: `{{shop.locale}}`,
38
- currency: `{{shop.currency}}`,
39
- moneyFormat: `{{ ${setting?.moneyWithCurrentFormat ? 'shop.money_with_currency_format' : 'shop.money_format'} | replace: '"', '\\"' | escape }}`
40
- })}'
41
- ${{
42
- ...builderAttrs
43
- }}
44
- style="${{
45
- ...style
46
- }}"
47
- data-hidden="${getDataHidden()}"
48
- >
49
- ${Text({
50
- id: `p-price-${builderProps?.uid}`,
51
- styles: {
52
- ...styles
53
- },
54
- style: {
55
- ...getStyleShadow({
56
- value: setting?.boxShadowPrice,
57
- styleAppliedFor: 'box-shadow',
58
- isEnableShadow: setting?.hasBoxShadowPrice
59
- }),
60
- ...getGlobalColorStateStyle('c', styles?.parentTextColor),
61
- ...setting?.opacityPrice ? makeStyle({
62
- op: `${setting?.opacityPrice}%`
63
- }) : {}
64
- },
65
- elementAttrs: {
66
- type: styles?.priceType
67
- },
68
- setting: {
69
- text: `${isComparePrice ? priceCompare() : defaultPrice()}`,
70
- excludeFlex: true
71
- },
72
- className: cls('gp-price', {
73
- 'gp-money': !isComparePrice,
74
- 'gp-product-compare-price': isComparePrice,
75
- 'gp-line-through': isComparePrice && styles?.lineThrough
76
- }, colorClass, getGlobalColorStateClass('text', styles?.parentTextColor))
77
- })}
78
- </gp-product-price>
79
- ${RenderIf(isLocalEnv, `<script ${getSettingPreloadData('class="gps-link" delay', 'src')}="{{ 'gp-product-price.js' | asset_url }}" defer="defer"></script>`, `<script ${getSettingPreloadData('class="gps-link" delay', 'src')}="${baseAssetURL}/assets-v2/gp-product-price.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
80
- `;
81
- };
82
-
83
- export { ProductPrice, ProductPrice as default };