@gem-sdk/core 3.0.0-pre-production.14 → 3.0.0

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 (413) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/components/AddOn.js +2 -18
  3. package/dist/cjs/components/ComponentAnimation.js +2 -17
  4. package/dist/cjs/components/ComponentToolbarPreview.js +2 -752
  5. package/dist/cjs/components/ComponentWrapper.js +2 -61
  6. package/dist/cjs/components/ComponentWrapperPreview.js +2 -213
  7. package/dist/cjs/components/Empty.js +2 -7
  8. package/dist/cjs/components/InteractionSuffix.js +2 -42
  9. package/dist/cjs/components/Render.js +2 -75
  10. package/dist/cjs/components/Render.liquid.js +16 -307
  11. package/dist/cjs/components/RenderBlock.js +2 -54
  12. package/dist/cjs/components/RenderCustomCode.js +4 -59
  13. package/dist/cjs/components/RenderPreview.js +2 -67
  14. package/dist/cjs/components/RenderSection.js +2 -23
  15. package/dist/cjs/components/ai-generator/AIContentGenerator.js +2 -252
  16. package/dist/cjs/components/ai-generator/AIGenContentLoading.js +2 -85
  17. package/dist/cjs/components/ai-generator/components/PickProduct.js +2 -220
  18. package/dist/cjs/components/ai-generator/components/ToneAndVoice.js +2 -77
  19. package/dist/cjs/components/ai-generator/hooks/useCheckingProductInside.js +1 -47
  20. package/dist/cjs/components/ai-generator/hooks/useFlipPopup.js +1 -110
  21. package/dist/cjs/components/ai-generator/hooks/useGettingGenerateRequest.js +1 -37
  22. package/dist/cjs/components/ai-generator/hooks/useListenEventGenerate.js +1 -70
  23. package/dist/cjs/components/ai-generator/icons/AIIcon.js +2 -67
  24. package/dist/cjs/components/ai-generator/icons/CloseIcon.js +2 -19
  25. package/dist/cjs/components/ai-generator/icons/DropdownIcon.js +2 -37
  26. package/dist/cjs/components/ai-generator/icons/SearchIcon.js +2 -21
  27. package/dist/cjs/components/ai-generator/icons/ShowMoreIcon.js +2 -21
  28. package/dist/cjs/components/ai-generator/icons/UpgradeIcon.js +2 -27
  29. package/dist/cjs/components/ai-generator/icons/WarningIcon.js +2 -31
  30. package/dist/cjs/components/constant.js +1 -82
  31. package/dist/cjs/components/resize/Resize.js +2 -16
  32. package/dist/cjs/components/resize/Spacing.js +2 -260
  33. package/dist/cjs/components/src/product/helpers/variant-presets.js +1 -56
  34. package/dist/cjs/components/theme-section/CreateThemeSection.js +2 -123
  35. package/dist/cjs/components/theme-section/ThemeSectionStatus.js +2 -45
  36. package/dist/cjs/components/theme-section/ThemeSectionTooltip.js +2 -126
  37. package/dist/cjs/components/toolbar/Tooltip.js +2 -28
  38. package/dist/cjs/constants/device.js +1 -0
  39. package/dist/cjs/contexts/AddonContext.js +2 -36
  40. package/dist/cjs/contexts/ArticleContext.js +2 -39
  41. package/dist/cjs/contexts/ArticleListContext.js +2 -31
  42. package/dist/cjs/contexts/BuilderComponent.js +2 -34
  43. package/dist/cjs/contexts/BuilderContext.js +2 -39
  44. package/dist/cjs/contexts/BuilderPreviewContext.js +2 -482
  45. package/dist/cjs/contexts/CartLineContext.js +2 -29
  46. package/dist/cjs/contexts/CollectionContext.js +2 -38
  47. package/dist/cjs/contexts/I18nContext.js +2 -0
  48. package/dist/cjs/contexts/ModalContext.js +2 -47
  49. package/dist/cjs/contexts/PageContext.js +2 -111
  50. package/dist/cjs/contexts/ProductContext.js +2 -182
  51. package/dist/cjs/contexts/ProductListContext.js +2 -32
  52. package/dist/cjs/contexts/SectionContext.js +2 -53
  53. package/dist/cjs/contexts/ShopContext.js +2 -107
  54. package/dist/cjs/graphql/fragments/analytic.generated.js +2 -6
  55. package/dist/cjs/graphql/fragments/collection-detail.generated.js +2 -6
  56. package/dist/cjs/graphql/fragments/collection-product.generated.js +2 -6
  57. package/dist/cjs/graphql/fragments/collection.generated.js +2 -6
  58. package/dist/cjs/graphql/fragments/custom-code.generated.js +2 -6
  59. package/dist/cjs/graphql/fragments/custom-font.generated.js +7 -7
  60. package/dist/cjs/graphql/fragments/data-seo.generated.js +2 -6
  61. package/dist/cjs/graphql/fragments/media.generated.js +2 -6
  62. package/dist/cjs/graphql/fragments/preview-theme-page.generated.js +6 -6
  63. package/dist/cjs/graphql/fragments/product-little.generated.js +2 -6
  64. package/dist/cjs/graphql/fragments/product-option-value.generated.js +2 -6
  65. package/dist/cjs/graphql/fragments/product-option.generated.js +2 -6
  66. package/dist/cjs/graphql/fragments/product.generated.js +2 -6
  67. package/dist/cjs/graphql/fragments/published-custom-section.generated.js +2 -6
  68. package/dist/cjs/graphql/fragments/published-page-section.generated.js +2 -6
  69. package/dist/cjs/graphql/fragments/published-theme-page.generated.js +4 -18
  70. package/dist/cjs/graphql/fragments/published-theme-style.generated.js +2 -6
  71. package/dist/cjs/graphql/fragments/selected-option.generated.js +2 -6
  72. package/dist/cjs/graphql/fragments/variant.generated.js +2 -6
  73. package/dist/cjs/graphql/mutations/page-view-up.generated.js +2 -6
  74. package/dist/cjs/graphql/queries/articles.generated.js +2 -6
  75. package/dist/cjs/graphql/queries/blogs.generated.js +3 -6
  76. package/dist/cjs/graphql/queries/collection-detail-filter.generated.js +2 -16
  77. package/dist/cjs/graphql/queries/collection.generated.js +2 -14
  78. package/dist/cjs/graphql/queries/collections.generated.js +2 -9
  79. package/dist/cjs/graphql/queries/preview-page.generated.js +2 -12
  80. package/dist/cjs/graphql/queries/product-little-detail.generated.js +2 -11
  81. package/dist/cjs/graphql/queries/product-medias.generated.js +2 -8
  82. package/dist/cjs/graphql/queries/product-value-label.generated.js +2 -6
  83. package/dist/cjs/graphql/queries/product-variants.generated.js +3 -11
  84. package/dist/cjs/graphql/queries/products.generated.js +3 -17
  85. package/dist/cjs/graphql/queries/{published-shop-metas.js → published-shop-metas.generated.js} +2 -6
  86. package/dist/cjs/graphql/queries/published-theme-pages.generated.js +3 -19
  87. package/dist/cjs/graphql/queries/shop-shopify.generated.js +2 -6
  88. package/dist/cjs/graphql/queries/store-property.generated.js +2 -6
  89. package/dist/cjs/graphql-app-api/queries/LibrarySaleFunnelDiscount.generated.js +2 -6
  90. package/dist/cjs/graphql-app-api/queries/LibraryTemplate.generated.js +2 -6
  91. package/dist/cjs/graphql-app-api/queries/SaleFunnelDiscounts.generated.js +2 -6
  92. package/dist/cjs/graphql-app-api/queries/SaleFunnelOffer.generated.js +2 -6
  93. package/dist/cjs/graphql-app-api/queries/ShopLibraryPage.generated.js +2 -6
  94. package/dist/cjs/graphql-app-api/queries/ThemePage.generated.js +2 -6
  95. package/dist/cjs/helpers/GlobalEvent.js +1 -19
  96. package/dist/cjs/helpers/align.js +1 -37
  97. package/dist/cjs/helpers/animations.js +1 -222
  98. package/dist/cjs/helpers/background.js +1 -236
  99. package/dist/cjs/helpers/backgroundImage.js +1 -0
  100. package/dist/cjs/helpers/borders.js +4 -198
  101. package/dist/cjs/helpers/carousel.js +1 -55
  102. package/dist/cjs/helpers/clone-deep.js +1 -5
  103. package/dist/cjs/helpers/cls.js +1 -16
  104. package/dist/cjs/helpers/colors.js +1 -184
  105. package/dist/cjs/helpers/compose-advance-style.js +1 -323
  106. package/dist/cjs/helpers/composeClasses.js +1 -0
  107. package/dist/cjs/helpers/const.js +1 -0
  108. package/dist/cjs/helpers/constant.js +1 -23
  109. package/dist/cjs/helpers/convert.js +1 -7
  110. package/dist/cjs/helpers/covert-entities-html.js +1 -19
  111. package/dist/cjs/helpers/css-variable.js +1 -7
  112. package/dist/cjs/helpers/email.js +1 -11
  113. package/dist/cjs/helpers/filter-styles.js +1 -0
  114. package/dist/cjs/helpers/filter-toolbar-preview.js +2 -14
  115. package/dist/cjs/helpers/flatten-connection.js +1 -9
  116. package/dist/cjs/helpers/get-resonsive-value.js +1 -36
  117. package/dist/cjs/helpers/get-shortname.js +1 -92
  118. package/dist/cjs/helpers/icon-list.js +1 -61
  119. package/dist/cjs/helpers/interaction/index.js +2 -134
  120. package/dist/cjs/helpers/is-browser.js +1 -9
  121. package/dist/cjs/helpers/is-defined.js +1 -7
  122. package/dist/cjs/helpers/is-empty-children.js +2 -15
  123. package/dist/cjs/helpers/is-safari.js +1 -9
  124. package/dist/cjs/helpers/layout.js +1 -76
  125. package/dist/cjs/helpers/load-script.js +1 -31
  126. package/dist/cjs/helpers/loop-component.js +1 -16
  127. package/dist/cjs/helpers/make-style.js +1 -163
  128. package/dist/cjs/helpers/normalize-builder-data.js +1 -23
  129. package/dist/cjs/helpers/pascal-to-kebab-case.js +1 -7
  130. package/dist/cjs/helpers/prefetch-queries.js +1 -78
  131. package/dist/cjs/helpers/product.js +1 -48
  132. package/dist/cjs/helpers/queries/get-collection.js +1 -226
  133. package/dist/cjs/helpers/queries/get-collections.js +1 -21
  134. package/dist/cjs/helpers/queries/get-product-by-slug.js +1 -125
  135. package/dist/cjs/helpers/queries/get-product.js +1 -154
  136. package/dist/cjs/helpers/queries/get-products.js +1 -214
  137. package/dist/cjs/helpers/query.js +1 -29
  138. package/dist/cjs/helpers/radius.js +6 -140
  139. package/dist/cjs/helpers/render.js +1 -91
  140. package/dist/cjs/helpers/shadow.js +1 -69
  141. package/dist/cjs/helpers/size.js +4 -228
  142. package/dist/cjs/helpers/spacing.js +1 -43
  143. package/dist/cjs/helpers/third-party/addAppBlockId.js +1 -20
  144. package/dist/cjs/helpers/third-party/appConfig.js +1 -416
  145. package/dist/cjs/helpers/third-party/appSetting.js +1 -1324
  146. package/dist/cjs/helpers/third-party/composeAppBlockId.js +1 -11
  147. package/dist/cjs/helpers/third-party/constant.js +1 -69
  148. package/dist/cjs/helpers/third-party/generateAppBlockConfigs.js +1 -34
  149. package/dist/cjs/helpers/third-party/getAppBlockConfig.js +1 -55
  150. package/dist/cjs/helpers/third-party/getAppBlockType.js +1 -12
  151. package/dist/cjs/helpers/third-party/getAppBlocks.js +1 -30
  152. package/dist/cjs/helpers/third-party/mergeBlock.js +1 -19
  153. package/dist/cjs/helpers/third-party/mergeBlockOrder.js +1 -47
  154. package/dist/cjs/helpers/third-party/removeGPAppItems.js +1 -18
  155. package/dist/cjs/helpers/tracking/fpixel.js +1 -28
  156. package/dist/cjs/helpers/tracking/gtag.js +1 -93
  157. package/dist/cjs/helpers/tracking/tiktokpixel.js +1 -17
  158. package/dist/cjs/helpers/typography.js +19 -160
  159. package/dist/cjs/helpers/variant.js +1 -11
  160. package/dist/cjs/hooks/animation/useAnimationActions.js +2 -39
  161. package/dist/cjs/hooks/animation/useAnimationConfig.js +2 -30
  162. package/dist/cjs/hooks/animation/useAnimationPreview.js +2 -31
  163. package/dist/cjs/hooks/animation/useAnimationTarget.js +2 -122
  164. package/dist/cjs/hooks/animation/useApplyAnimation.js +2 -89
  165. package/dist/cjs/hooks/articles/useArticlesQuery.js +2 -33
  166. package/dist/cjs/hooks/cart/use-add-to-cart.js +2 -20
  167. package/dist/cjs/hooks/cart/use-cart-data.js +2 -28
  168. package/dist/cjs/hooks/cart/use-cart-discount-codes-update.js +2 -20
  169. package/dist/cjs/hooks/cart/use-cart-note-update.js +2 -20
  170. package/dist/cjs/hooks/cart/use-create-cart.js +2 -22
  171. package/dist/cjs/hooks/cart/use-remove-cart-item.js +2 -20
  172. package/dist/cjs/hooks/cart/use-update-cart-item.js +2 -20
  173. package/dist/cjs/hooks/shop/use-collection-query.js +2 -22
  174. package/dist/cjs/hooks/shop/use-collections-query.js +2 -17
  175. package/dist/cjs/hooks/shop/use-product-query.js +2 -22
  176. package/dist/cjs/hooks/shop/use-products-query.js +2 -63
  177. package/dist/cjs/hooks/shop/useShopifyLink.js +2 -0
  178. package/dist/cjs/hooks/shop.js +2 -135
  179. package/dist/cjs/hooks/use-current-device.js +2 -30
  180. package/dist/cjs/hooks/use-lazy-video.js +2 -15
  181. package/dist/cjs/hooks/useAnimations.js +2 -29
  182. package/dist/cjs/hooks/useCartId.js +2 -44
  183. package/dist/cjs/hooks/useCartLine.js +2 -11
  184. package/dist/cjs/hooks/useCartUI.js +2 -48
  185. package/dist/cjs/hooks/useCollection.js +2 -9
  186. package/dist/cjs/hooks/useFetchHandle.js +2 -13
  187. package/dist/cjs/hooks/useFormatMoney.js +2 -75
  188. package/dist/cjs/hooks/useI18n.js +2 -0
  189. package/dist/cjs/hooks/useInitialSwatchesOptions.js +2 -127
  190. package/dist/cjs/hooks/useInteraction.js +2 -19
  191. package/dist/cjs/hooks/useIsomorphicLayoutEffect.js +2 -10
  192. package/dist/cjs/hooks/useLoadScript.js +2 -32
  193. package/dist/cjs/hooks/useMoney.js +2 -84
  194. package/dist/cjs/hooks/usePrevious.js +2 -19
  195. package/dist/cjs/hooks/useProduct.js +2 -250
  196. package/dist/cjs/hooks/useProductList.js +2 -21
  197. package/dist/cjs/hooks/useStickyStore.js +1 -0
  198. package/dist/cjs/hooks/useSuspenseFetch.js +2 -27
  199. package/dist/cjs/hooks/useSwatchesOptions.js +2 -41
  200. package/dist/cjs/hooks/useToolbarPostPurchase.js +2 -89
  201. package/dist/cjs/index.js +1 -425
  202. package/dist/cjs/types/animations.js +1 -49
  203. package/dist/cjs/types/appAPI.js +1 -2
  204. package/dist/cjs/types/custom.js +1 -52
  205. package/dist/cjs/types/global-style.js +1 -15
  206. package/dist/cjs/types/shop.js +1 -2
  207. package/dist/esm/components/AddOn.js +2 -14
  208. package/dist/esm/components/ComponentAnimation.js +2 -13
  209. package/dist/esm/components/ComponentToolbarPreview.js +2 -748
  210. package/dist/esm/components/ComponentWrapper.js +2 -57
  211. package/dist/esm/components/ComponentWrapperPreview.js +2 -209
  212. package/dist/esm/components/Empty.js +2 -3
  213. package/dist/esm/components/InteractionSuffix.js +2 -40
  214. package/dist/esm/components/Render.js +2 -71
  215. package/dist/esm/components/Render.liquid.js +16 -301
  216. package/dist/esm/components/RenderBlock.js +2 -50
  217. package/dist/esm/components/RenderCustomCode.js +4 -55
  218. package/dist/esm/components/RenderPreview.js +2 -63
  219. package/dist/esm/components/RenderSection.js +2 -19
  220. package/dist/esm/components/ai-generator/AIContentGenerator.js +2 -250
  221. package/dist/esm/components/ai-generator/AIGenContentLoading.js +2 -83
  222. package/dist/esm/components/ai-generator/components/PickProduct.js +2 -218
  223. package/dist/esm/components/ai-generator/components/ToneAndVoice.js +2 -75
  224. package/dist/esm/components/ai-generator/hooks/useCheckingProductInside.js +1 -45
  225. package/dist/esm/components/ai-generator/hooks/useFlipPopup.js +1 -108
  226. package/dist/esm/components/ai-generator/hooks/useGettingGenerateRequest.js +1 -35
  227. package/dist/esm/components/ai-generator/hooks/useListenEventGenerate.js +1 -68
  228. package/dist/esm/components/ai-generator/icons/AIIcon.js +2 -65
  229. package/dist/esm/components/ai-generator/icons/CloseIcon.js +2 -17
  230. package/dist/esm/components/ai-generator/icons/DropdownIcon.js +2 -34
  231. package/dist/esm/components/ai-generator/icons/SearchIcon.js +2 -19
  232. package/dist/esm/components/ai-generator/icons/ShowMoreIcon.js +2 -19
  233. package/dist/esm/components/ai-generator/icons/UpgradeIcon.js +2 -25
  234. package/dist/esm/components/ai-generator/icons/WarningIcon.js +2 -29
  235. package/dist/esm/components/constant.js +1 -75
  236. package/dist/esm/components/resize/Resize.js +2 -12
  237. package/dist/esm/components/resize/Spacing.js +2 -256
  238. package/dist/esm/components/src/product/helpers/variant-presets.js +1 -54
  239. package/dist/esm/components/theme-section/CreateThemeSection.js +2 -121
  240. package/dist/esm/components/theme-section/ThemeSectionStatus.js +2 -43
  241. package/dist/esm/components/theme-section/ThemeSectionTooltip.js +2 -124
  242. package/dist/esm/components/toolbar/Tooltip.js +2 -24
  243. package/dist/esm/constants/device.js +1 -0
  244. package/dist/esm/contexts/AddonContext.js +2 -32
  245. package/dist/esm/contexts/ArticleContext.js +2 -36
  246. package/dist/esm/contexts/ArticleListContext.js +2 -27
  247. package/dist/esm/contexts/BuilderComponent.js +2 -31
  248. package/dist/esm/contexts/BuilderContext.js +2 -36
  249. package/dist/esm/contexts/BuilderPreviewContext.js +2 -479
  250. package/dist/esm/contexts/CartLineContext.js +2 -26
  251. package/dist/esm/contexts/CollectionContext.js +2 -35
  252. package/dist/esm/contexts/I18nContext.js +2 -0
  253. package/dist/esm/contexts/ModalContext.js +2 -44
  254. package/dist/esm/contexts/PageContext.js +2 -108
  255. package/dist/esm/contexts/ProductContext.js +2 -179
  256. package/dist/esm/contexts/ProductListContext.js +2 -28
  257. package/dist/esm/contexts/SectionContext.js +2 -49
  258. package/dist/esm/contexts/ShopContext.js +2 -104
  259. package/dist/esm/graphql/fragments/analytic.generated.js +2 -4
  260. package/dist/esm/graphql/fragments/collection-detail.generated.js +2 -4
  261. package/dist/esm/graphql/fragments/collection-product.generated.js +2 -4
  262. package/dist/esm/graphql/fragments/collection.generated.js +2 -4
  263. package/dist/esm/graphql/fragments/custom-code.generated.js +2 -4
  264. package/dist/esm/graphql/fragments/custom-font.generated.js +7 -5
  265. package/dist/esm/graphql/fragments/data-seo.generated.js +2 -4
  266. package/dist/esm/graphql/fragments/media.generated.js +2 -4
  267. package/dist/esm/graphql/fragments/preview-theme-page.generated.js +6 -4
  268. package/dist/esm/graphql/fragments/product-little.generated.js +2 -4
  269. package/dist/esm/graphql/fragments/product-option-value.generated.js +2 -4
  270. package/dist/esm/graphql/fragments/product-option.generated.js +2 -4
  271. package/dist/esm/graphql/fragments/product.generated.js +2 -4
  272. package/dist/esm/graphql/fragments/published-custom-section.generated.js +2 -4
  273. package/dist/esm/graphql/fragments/published-page-section.generated.js +2 -4
  274. package/dist/esm/graphql/fragments/published-theme-page.generated.js +4 -16
  275. package/dist/esm/graphql/fragments/published-theme-style.generated.js +2 -4
  276. package/dist/esm/graphql/fragments/selected-option.generated.js +2 -4
  277. package/dist/esm/graphql/fragments/variant.generated.js +2 -4
  278. package/dist/esm/graphql/mutations/page-view-up.generated.js +2 -4
  279. package/dist/esm/graphql/queries/articles.generated.js +2 -4
  280. package/dist/esm/graphql/queries/blogs.generated.js +3 -4
  281. package/dist/esm/graphql/queries/collection-detail-filter.generated.js +10 -22
  282. package/dist/esm/graphql/queries/collection.generated.js +8 -18
  283. package/dist/esm/graphql/queries/collections.generated.js +3 -8
  284. package/dist/esm/graphql/queries/preview-page.generated.js +6 -14
  285. package/dist/esm/graphql/queries/product-little-detail.generated.js +5 -12
  286. package/dist/esm/graphql/queries/product-medias.generated.js +2 -6
  287. package/dist/esm/graphql/queries/product-value-label.generated.js +2 -4
  288. package/dist/esm/graphql/queries/product-variants.generated.js +5 -11
  289. package/dist/esm/graphql/queries/products.generated.js +9 -20
  290. package/dist/esm/graphql/queries/{published-shop-metas.js → published-shop-metas.generated.js} +2 -4
  291. package/dist/esm/graphql/queries/published-theme-pages.generated.js +6 -20
  292. package/dist/esm/graphql/queries/shop-shopify.generated.js +2 -4
  293. package/dist/esm/graphql/queries/store-property.generated.js +2 -4
  294. package/dist/esm/graphql-app-api/queries/LibrarySaleFunnelDiscount.generated.js +2 -4
  295. package/dist/esm/graphql-app-api/queries/LibraryTemplate.generated.js +2 -4
  296. package/dist/esm/graphql-app-api/queries/SaleFunnelDiscounts.generated.js +2 -4
  297. package/dist/esm/graphql-app-api/queries/SaleFunnelOffer.generated.js +2 -4
  298. package/dist/esm/graphql-app-api/queries/ShopLibraryPage.generated.js +2 -4
  299. package/dist/esm/graphql-app-api/queries/ThemePage.generated.js +2 -4
  300. package/dist/esm/helpers/GlobalEvent.js +1 -15
  301. package/dist/esm/helpers/align.js +1 -34
  302. package/dist/esm/helpers/animations.js +1 -220
  303. package/dist/esm/helpers/background.js +1 -227
  304. package/dist/esm/helpers/backgroundImage.js +1 -0
  305. package/dist/esm/helpers/borders.js +4 -189
  306. package/dist/esm/helpers/carousel.js +1 -51
  307. package/dist/esm/helpers/clone-deep.js +1 -3
  308. package/dist/esm/helpers/cls.js +1 -14
  309. package/dist/esm/helpers/colors.js +1 -169
  310. package/dist/esm/helpers/compose-advance-style.js +1 -315
  311. package/dist/esm/helpers/composeClasses.js +1 -0
  312. package/dist/esm/helpers/const.js +1 -0
  313. package/dist/esm/helpers/constant.js +1 -19
  314. package/dist/esm/helpers/convert.js +1 -4
  315. package/dist/esm/helpers/covert-entities-html.js +1 -17
  316. package/dist/esm/helpers/css-variable.js +1 -5
  317. package/dist/esm/helpers/email.js +1 -6
  318. package/dist/esm/helpers/filter-styles.js +1 -0
  319. package/dist/esm/helpers/filter-toolbar-preview.js +2 -9
  320. package/dist/esm/helpers/flatten-connection.js +1 -7
  321. package/dist/esm/helpers/get-resonsive-value.js +1 -31
  322. package/dist/esm/helpers/get-shortname.js +1 -90
  323. package/dist/esm/helpers/icon-list.js +1 -58
  324. package/dist/esm/helpers/interaction/index.js +2 -132
  325. package/dist/esm/helpers/is-browser.js +1 -5
  326. package/dist/esm/helpers/is-defined.js +1 -5
  327. package/dist/esm/helpers/is-empty-children.js +2 -10
  328. package/dist/esm/helpers/is-safari.js +1 -5
  329. package/dist/esm/helpers/layout.js +1 -70
  330. package/dist/esm/helpers/load-script.js +1 -29
  331. package/dist/esm/helpers/loop-component.js +1 -14
  332. package/dist/esm/helpers/make-style.js +1 -149
  333. package/dist/esm/helpers/normalize-builder-data.js +1 -21
  334. package/dist/esm/helpers/pascal-to-kebab-case.js +1 -5
  335. package/dist/esm/helpers/prefetch-queries.js +1 -76
  336. package/dist/esm/helpers/product.js +1 -44
  337. package/dist/esm/helpers/queries/get-collection.js +1 -223
  338. package/dist/esm/helpers/queries/get-collections.js +1 -19
  339. package/dist/esm/helpers/queries/get-product-by-slug.js +1 -123
  340. package/dist/esm/helpers/queries/get-product.js +1 -150
  341. package/dist/esm/helpers/queries/get-products.js +1 -210
  342. package/dist/esm/helpers/query.js +1 -25
  343. package/dist/esm/helpers/radius.js +6 -132
  344. package/dist/esm/helpers/render.js +1 -82
  345. package/dist/esm/helpers/shadow.js +1 -63
  346. package/dist/esm/helpers/size.js +4 -213
  347. package/dist/esm/helpers/spacing.js +1 -40
  348. package/dist/esm/helpers/third-party/addAppBlockId.js +1 -18
  349. package/dist/esm/helpers/third-party/appConfig.js +1 -356
  350. package/dist/esm/helpers/third-party/appSetting.js +1 -1321
  351. package/dist/esm/helpers/third-party/composeAppBlockId.js +1 -9
  352. package/dist/esm/helpers/third-party/constant.js +1 -66
  353. package/dist/esm/helpers/third-party/generateAppBlockConfigs.js +1 -32
  354. package/dist/esm/helpers/third-party/getAppBlockConfig.js +1 -53
  355. package/dist/esm/helpers/third-party/getAppBlockType.js +1 -10
  356. package/dist/esm/helpers/third-party/getAppBlocks.js +1 -28
  357. package/dist/esm/helpers/third-party/mergeBlock.js +1 -17
  358. package/dist/esm/helpers/third-party/mergeBlockOrder.js +1 -45
  359. package/dist/esm/helpers/third-party/removeGPAppItems.js +1 -15
  360. package/dist/esm/helpers/tracking/fpixel.js +1 -24
  361. package/dist/esm/helpers/tracking/gtag.js +1 -87
  362. package/dist/esm/helpers/tracking/tiktokpixel.js +1 -15
  363. package/dist/esm/helpers/typography.js +19 -149
  364. package/dist/esm/helpers/variant.js +1 -9
  365. package/dist/esm/hooks/animation/useAnimationActions.js +2 -37
  366. package/dist/esm/hooks/animation/useAnimationConfig.js +2 -28
  367. package/dist/esm/hooks/animation/useAnimationPreview.js +2 -29
  368. package/dist/esm/hooks/animation/useAnimationTarget.js +2 -120
  369. package/dist/esm/hooks/animation/useApplyAnimation.js +2 -85
  370. package/dist/esm/hooks/articles/useArticlesQuery.js +2 -30
  371. package/dist/esm/hooks/cart/use-add-to-cart.js +2 -18
  372. package/dist/esm/hooks/cart/use-cart-data.js +2 -26
  373. package/dist/esm/hooks/cart/use-cart-discount-codes-update.js +2 -18
  374. package/dist/esm/hooks/cart/use-cart-note-update.js +2 -18
  375. package/dist/esm/hooks/cart/use-create-cart.js +2 -20
  376. package/dist/esm/hooks/cart/use-remove-cart-item.js +2 -18
  377. package/dist/esm/hooks/cart/use-update-cart-item.js +2 -18
  378. package/dist/esm/hooks/shop/use-collection-query.js +2 -20
  379. package/dist/esm/hooks/shop/use-collections-query.js +2 -15
  380. package/dist/esm/hooks/shop/use-product-query.js +2 -20
  381. package/dist/esm/hooks/shop/use-products-query.js +2 -59
  382. package/dist/esm/hooks/shop/useShopifyLink.js +2 -0
  383. package/dist/esm/hooks/shop.js +2 -119
  384. package/dist/esm/hooks/use-current-device.js +2 -28
  385. package/dist/esm/hooks/use-lazy-video.js +2 -13
  386. package/dist/esm/hooks/useAnimations.js +2 -27
  387. package/dist/esm/hooks/useCartId.js +2 -40
  388. package/dist/esm/hooks/useCartLine.js +2 -7
  389. package/dist/esm/hooks/useCartUI.js +2 -44
  390. package/dist/esm/hooks/useCollection.js +2 -7
  391. package/dist/esm/hooks/useFetchHandle.js +2 -11
  392. package/dist/esm/hooks/useFormatMoney.js +2 -71
  393. package/dist/esm/hooks/useI18n.js +2 -0
  394. package/dist/esm/hooks/useInitialSwatchesOptions.js +2 -123
  395. package/dist/esm/hooks/useInteraction.js +2 -17
  396. package/dist/esm/hooks/useIsomorphicLayoutEffect.js +2 -6
  397. package/dist/esm/hooks/useLoadScript.js +2 -28
  398. package/dist/esm/hooks/useMoney.js +2 -80
  399. package/dist/esm/hooks/usePrevious.js +2 -17
  400. package/dist/esm/hooks/useProduct.js +2 -233
  401. package/dist/esm/hooks/useProductList.js +2 -16
  402. package/dist/esm/hooks/useStickyStore.js +1 -0
  403. package/dist/esm/hooks/useSuspenseFetch.js +2 -23
  404. package/dist/esm/hooks/useSwatchesOptions.js +2 -37
  405. package/dist/esm/hooks/useToolbarPostPurchase.js +2 -87
  406. package/dist/esm/index.js +1 -119
  407. package/dist/esm/types/animations.js +1 -49
  408. package/dist/esm/types/custom.js +1 -52
  409. package/dist/esm/types/global-style.js +1 -12
  410. package/dist/types/index.d.ts +12025 -8969
  411. package/package.json +6 -6
  412. package/dist/cjs/web-components/src/helpers/styles/constant.js +0 -9
  413. package/dist/esm/web-components/src/helpers/styles/constant.js +0 -7
@@ -1,315 +1 @@
1
- import { handleConvertBorderStyle, handleConvertBorderWidth, handleConvertBorderColor, getBorderStyle } from './borders.js';
2
- import { isColor } from './colors.js';
3
- import { layoutComponent } from './constant.js';
4
- import { makeStyleKey } from './make-style.js';
5
- import { composeRadius, getCornerCSSFromGlobal } from './radius.js';
6
- import { getResponsiveStyleShadow, getStyleShadowState, getStyleShadow } from './shadow.js';
7
-
8
- const composeSpacing = ({ source, spacing, type, suffix = '' })=>{
9
- const { top, left, bottom, right } = spacing;
10
- if (top) source[`--${type}t${suffix}`] = top;
11
- if (left) source[`--${type}l${suffix}`] = left;
12
- if (bottom) source[`--${type}b${suffix}`] = bottom;
13
- if (right) source[`--${type}r${suffix}`] = right;
14
- };
15
- const composeSpacingV2 = ({ source, spacing, suffix = '', tag = '' })=>{
16
- if (spacing && spacing.margin) {
17
- const { top, left, bottom, right } = spacing.margin;
18
- if (top) source[`--mt${suffix}`] = top;
19
- if (left) source[`--ml${suffix}`] = layoutComponent.includes(tag) && left === '0px' ? 'auto' : left;
20
- if (bottom) source[`--mb${suffix}`] = bottom;
21
- if (right) source[`--mr${suffix}`] = layoutComponent.includes(tag) && right === '0px' ? 'auto' : right;
22
- }
23
- if (spacing && spacing.padding) {
24
- const { top, left, bottom, right } = spacing.padding;
25
- if (top) source[`--pt${suffix}`] = top;
26
- if (left) source[`--pl${suffix}`] = left;
27
- if (bottom) source[`--pb${suffix}`] = bottom;
28
- if (right) source[`--pr${suffix}`] = right;
29
- }
30
- };
31
- const getAttrValue = (attr, value, tag)=>{
32
- if (value === undefined || value === null) return undefined;
33
- switch(attr){
34
- case 'bgc':
35
- case 'c':
36
- return isColor(value.toString()) ? value : `var(--g-c-${value})`;
37
- case 'd':
38
- if (!value) return 'none';
39
- if (value && tag && layoutComponent.includes(tag)) return 'grid';
40
- return 'block';
41
- case 'animation':
42
- return undefined;
43
- case 'hasBoxShadow':
44
- return undefined;
45
- case 'rounded':
46
- return undefined;
47
- case 'boxShadow':
48
- return undefined;
49
- case 'border':
50
- return undefined;
51
- default:
52
- return value;
53
- }
54
- };
55
- const postPurchasePaddingMapping = {
56
- loose: '21px',
57
- extraLoose: '38px',
58
- tight: '9px',
59
- extraTight: '5px',
60
- base: '14px'
61
- };
62
- const composeAdvanceStyleForPostPurchase = (data, tag)=>{
63
- if (!data) return {};
64
- const styles = {};
65
- Object.keys(data).forEach((attr)=>{
66
- const value = data[attr];
67
- if (attr === 'blockPadding') {
68
- const valueMapped = postPurchasePaddingMapping[value];
69
- styles[`--pb`] = getAttrValue(attr, valueMapped, tag);
70
- styles[`--pt`] = getAttrValue(attr, valueMapped, tag);
71
- styles[`--mb`] = '0px';
72
- styles[`--mt`] = '0px';
73
- }
74
- if (attr === 'inlinePadding') {
75
- const valueMapped = postPurchasePaddingMapping[value];
76
- styles[`--pl`] = getAttrValue(attr, valueMapped, tag);
77
- styles[`--pr`] = getAttrValue(attr, valueMapped, tag);
78
- }
79
- });
80
- return styles;
81
- };
82
- function composeAdvanceStyle(data, tag, pageType) {
83
- if (!data) return {};
84
- const styles = {};
85
- const devices = [
86
- 'desktop',
87
- 'tablet',
88
- 'mobile'
89
- ];
90
- const states = [
91
- 'hover',
92
- 'normal'
93
- ];
94
- Object.keys(data).forEach((attr)=>{
95
- const value = data[attr];
96
- if (attr === 'cssClass') return;
97
- if (value === undefined || value === null) return;
98
- const hasBoxShadow = data.hasBoxShadow ? data.hasBoxShadow : {};
99
- if (typeof value === 'object') {
100
- if (Array.isArray(value)) return;
101
- Object.keys(value).forEach((composeAttr)=>{
102
- if (devices.includes(composeAttr)) {
103
- const deviceValue = value[composeAttr];
104
- if (deviceValue !== undefined) {
105
- // Responsive border with state
106
- if (attr === 'border') {
107
- Object.assign(styles, handleConvertBorderStyle(value), handleConvertBorderWidth(value), handleConvertBorderColor(value));
108
- }
109
- if (attr === 'rounded') {
110
- Object.assign(styles, composeRadius(value));
111
- }
112
- if (attr === 'boxShadow') {
113
- Object.assign(styles, getResponsiveStyleShadow(value, 'box-shadow', hasBoxShadow));
114
- }
115
- const styleValue = getAttrValue(attr, deviceValue, tag);
116
- if (composeAttr === 'desktop') {
117
- switch(attr){
118
- case 'padding':
119
- composeSpacing({
120
- source: styles,
121
- spacing: deviceValue,
122
- type: 'p'
123
- });
124
- break;
125
- case 'margin':
126
- composeSpacing({
127
- source: styles,
128
- spacing: deviceValue,
129
- type: 'm'
130
- });
131
- break;
132
- case 'spacing-setting':
133
- composeSpacingV2({
134
- source: styles,
135
- spacing: deviceValue,
136
- tag
137
- });
138
- break;
139
- case 'm':
140
- case 'p':
141
- break;
142
- default:
143
- styleValue && (styles[`--${attr}`] = styleValue);
144
- break;
145
- }
146
- } else {
147
- switch(attr){
148
- case 'padding':
149
- composeSpacing({
150
- source: styles,
151
- spacing: deviceValue,
152
- type: 'p',
153
- suffix: `-${composeAttr}`
154
- });
155
- break;
156
- case 'margin':
157
- composeSpacing({
158
- source: styles,
159
- spacing: deviceValue,
160
- type: 'm',
161
- suffix: `-${composeAttr}`
162
- });
163
- break;
164
- case 'spacing-setting':
165
- composeSpacingV2({
166
- source: styles,
167
- spacing: deviceValue,
168
- suffix: `-${composeAttr}`,
169
- tag
170
- });
171
- break;
172
- case 'm':
173
- case 'p':
174
- break;
175
- default:
176
- styleValue && (styles[`--${attr}-${composeAttr}`] = styleValue);
177
- break;
178
- }
179
- }
180
- }
181
- } else if (states.includes(composeAttr)) {
182
- switch(attr){
183
- case 'hasBoxShadow':
184
- break;
185
- case 'boxShadow':
186
- Object.assign(styles, getStyleShadowState(value, 'box-shadow', hasBoxShadow));
187
- break;
188
- }
189
- } else {
190
- if (attr === 'border') {
191
- const borderStyle = value;
192
- if (borderStyle.border === 'none') {
193
- borderStyle.border = 'solid';
194
- borderStyle.color = '#121212';
195
- borderStyle.isCustom = true;
196
- borderStyle.width = '0px';
197
- borderStyle.position = 'all';
198
- }
199
- Object.assign(styles, getBorderStyle(borderStyle));
200
- }
201
- if (attr === 'rounded') {
202
- Object.assign(styles, getCornerCSSFromGlobal(value));
203
- }
204
- if (attr === 'hasBoxShadow') {
205
- Object.assign(styles, getStyleShadow({
206
- value: data.boxShadow,
207
- styleAppliedFor: 'box-shadow',
208
- isEnableShadow: data.hasBoxShadow
209
- }));
210
- }
211
- if (attr === 'boxShadow') {
212
- Object.assign(styles, getStyleShadow({
213
- value: value,
214
- styleAppliedFor: 'box-shadow',
215
- isEnableShadow: data.hasBoxShadow
216
- }));
217
- }
218
- }
219
- });
220
- } else {
221
- const styleValue = getAttrValue(attr, value, tag);
222
- styleValue && (styles[`--${attr}`] = styleValue);
223
- if (attr === 'hasBoxShadow' && data.boxShadow) {
224
- Object.assign(styles, getStyleShadow({
225
- value: data.boxShadow,
226
- styleAppliedFor: 'box-shadow',
227
- isEnableShadow: data.hasBoxShadow
228
- }));
229
- }
230
- }
231
- if (attr === 'blockPadding' && pageType === 'POST_PURCHASE') {
232
- const valueMapped = postPurchasePaddingMapping[value];
233
- styles[`--pb`] = getAttrValue(attr, valueMapped, tag);
234
- styles[`--pt`] = getAttrValue(attr, valueMapped, tag);
235
- styles[`--mb`] = '0px';
236
- styles[`--mt`] = '0px';
237
- }
238
- if (attr === 'inlinePadding' && pageType === 'POST_PURCHASE') {
239
- const valueMapped = postPurchasePaddingMapping[value];
240
- styles[`--pl`] = getAttrValue(attr, valueMapped, tag);
241
- styles[`--pr`] = getAttrValue(attr, valueMapped, tag);
242
- }
243
- });
244
- const advancedPostPurchaseStyles = pageType === 'POST_PURCHASE' ? composeAdvanceStyleForPostPurchase(data, tag) : {};
245
- return {
246
- ...styles,
247
- ...advancedPostPurchaseStyles
248
- };
249
- }
250
- const splitStyle = (keys, style = {})=>{
251
- const fullKeys = keys.map((key)=>makeStyleKey(key)).flat();
252
- const splitKeys = Object.keys(style).filter((key)=>{
253
- return fullKeys.includes(key);
254
- });
255
- const splitStyle = splitKeys.reduce((curr, key)=>{
256
- return {
257
- ...curr,
258
- [key]: style[key]
259
- };
260
- }, {});
261
- const restStyle = Object.keys(style).filter((key)=>{
262
- return !splitKeys.includes(key);
263
- }).reduce((curr, key)=>{
264
- return {
265
- ...curr,
266
- [key]: style[key]
267
- };
268
- }, {});
269
- return [
270
- splitStyle,
271
- restStyle
272
- ];
273
- };
274
- const filterAttrInStyle = (style, filterKeys)=>{
275
- if (!style || !filterKeys) return {};
276
- const newStyle = {
277
- ...style
278
- };
279
- Object.entries(newStyle).forEach(([key])=>{
280
- if (!filterKeys.includes(key)) {
281
- delete newStyle[key];
282
- }
283
- });
284
- return newStyle;
285
- };
286
- const removeAttrInStyle = (style, filterKeys)=>{
287
- if (!style || !filterKeys) return {};
288
- const newStyle = {
289
- ...style
290
- };
291
- Object.entries(newStyle).forEach(([key])=>{
292
- if (filterKeys.includes(key)) {
293
- delete newStyle[key];
294
- }
295
- });
296
- return newStyle;
297
- };
298
- const getCornerStyle = (advancedSetting)=>{
299
- return composeAdvanceStyle({
300
- rounded: advancedSetting?.rounded
301
- });
302
- };
303
- const removePaddingYInStyle = (style)=>{
304
- const keys = [
305
- '--pt',
306
- '--pt-tablet',
307
- '--pt-mobile',
308
- '--pb',
309
- '--pb-tablet',
310
- '--pb-mobile'
311
- ];
312
- return removeAttrInStyle(style, keys);
313
- };
314
-
315
- export { composeAdvanceStyle, composeAdvanceStyleForPostPurchase, filterAttrInStyle, getCornerStyle, removeAttrInStyle, removePaddingYInStyle, splitStyle };
1
+ import{handleConvertBorderStyle as e,handleConvertBorderWidth as t,handleConvertBorderColor as o,getBorderStyle as a}from"./borders.js";import{isColor as r}from"./colors.js";import{layoutComponent as s}from"./constant.js";import{makeStyleKey as i}from"./make-style.js";import{composeRadius as n,getCornerCSSFromGlobal as c}from"./radius.js";import{getResponsiveStyleShadow as l,getStyleShadowState as d,getStyleShadow as p}from"./shadow.js";import{DEVICES as u}from"../constants/device.js";let composeSpacing=({source:e,spacing:t,type:o,suffix:a=""})=>{let{top:r,left:s,bottom:i,right:n}=t;r&&(e[`--${o}t${a}`]=r),s&&(e[`--${o}l${a}`]=s),i&&(e[`--${o}b${a}`]=i),n&&(e[`--${o}r${a}`]=n)},composeSpacingV2=({source:e,spacing:t,suffix:o="",tag:a=""})=>{if(t&&t.margin){let{top:r,left:i,bottom:n,right:c}=t.margin;r&&(e[`--mt${o}`]=r),i&&(e[`--ml${o}`]=s.includes(a)&&"0px"===i?"auto":i),n&&(e[`--mb${o}`]=n),c&&(e[`--mr${o}`]=s.includes(a)&&"0px"===c?"auto":c)}if(t&&t.padding){let{top:a,left:r,bottom:s,right:i}=t.padding;a&&(e[`--pt${o}`]=a),r&&(e[`--pl${o}`]=r),s&&(e[`--pb${o}`]=s),i&&(e[`--pr${o}`]=i)}},getAttrValue=(e,t,o)=>{if(null!=t)switch(e){case"bgc":case"c":return r(t.toString())?t:`var(--g-c-${t})`;case"d":if(!t)return"none";if(t&&o&&s.includes(o))return"grid";return"block";case"animation":case"hasBoxShadow":case"rounded":case"boxShadow":case"border":return;default:return t}},postPurchasePaddingMapping={loose:"21px",extraLoose:"38px",tight:"9px",extraTight:"5px",base:"14px"},composeAdvanceStyleForPostPurchase=(e,t)=>{if(!e)return{};let o={};return Object.keys(e).forEach(a=>{let r=e[a];if("blockPadding"===a){let e=postPurchasePaddingMapping[r];o["--pb"]=getAttrValue(a,e,t),o["--pt"]=getAttrValue(a,e,t),o["--mb"]="0px",o["--mt"]="0px"}if("inlinePadding"===a){let e=postPurchasePaddingMapping[r];o["--pl"]=getAttrValue(a,e,t),o["--pr"]=getAttrValue(a,e,t)}}),o};function composeAdvanceStyle(r,s,i){if(!r)return{};let b={},g=["hover","normal"];Object.keys(r).forEach(m=>{let h=r[m];if("cssClass"===m||null==h)return;let S=r.hasBoxShadow?r.hasBoxShadow:{};if("object"==typeof h){if(Array.isArray(h))return;Object.keys(h).forEach(i=>{if(u.includes(i)){let a=h[i];if(void 0!==a){"border"===m&&Object.assign(b,e(h),t(h),o(h)),"rounded"===m&&Object.assign(b,n(h)),"boxShadow"===m&&Object.assign(b,l(h,"box-shadow",S));let r=getAttrValue(m,a,s);if("desktop"===i)switch(m){case"padding":composeSpacing({source:b,spacing:a,type:"p"});break;case"margin":composeSpacing({source:b,spacing:a,type:"m"});break;case"spacing-setting":composeSpacingV2({source:b,spacing:a,tag:s});break;case"m":case"p":break;default:r&&(b[`--${m}`]=r)}else switch(m){case"padding":composeSpacing({source:b,spacing:a,type:"p",suffix:`-${i}`});break;case"margin":composeSpacing({source:b,spacing:a,type:"m",suffix:`-${i}`});break;case"spacing-setting":composeSpacingV2({source:b,spacing:a,suffix:`-${i}`,tag:s});break;case"m":case"p":break;default:r&&(b[`--${m}-${i}`]=r)}}}else if(g.includes(i))switch(m){case"hasBoxShadow":break;case"boxShadow":Object.assign(b,d(h,"box-shadow",S))}else"border"===m&&("none"===h.border&&(h.border="solid",h.color="#121212",h.isCustom=!0,h.width="0px",h.position="all"),Object.assign(b,a(h))),"rounded"===m&&Object.assign(b,c(h)),"hasBoxShadow"===m&&Object.assign(b,p({value:r.boxShadow,styleAppliedFor:"box-shadow",isEnableShadow:r.hasBoxShadow})),"boxShadow"===m&&Object.assign(b,p({value:h,styleAppliedFor:"box-shadow",isEnableShadow:r.hasBoxShadow}))})}else{let e=getAttrValue(m,h,s);e&&(b[`--${m}`]=e),"hasBoxShadow"===m&&r.boxShadow&&Object.assign(b,p({value:r.boxShadow,styleAppliedFor:"box-shadow",isEnableShadow:r.hasBoxShadow}))}if("blockPadding"===m&&"POST_PURCHASE"===i){let e=postPurchasePaddingMapping[h];b["--pb"]=getAttrValue(m,e,s),b["--pt"]=getAttrValue(m,e,s),b["--mb"]="0px",b["--mt"]="0px"}if("inlinePadding"===m&&"POST_PURCHASE"===i){let e=postPurchasePaddingMapping[h];b["--pl"]=getAttrValue(m,e,s),b["--pr"]=getAttrValue(m,e,s)}});let m="POST_PURCHASE"===i?composeAdvanceStyleForPostPurchase(r,s):{};return{...b,...m}}let convertBoxShadowV1ToV2=(e,t,o)=>{let a=["Section","Row","Text","Heading","Image","Button","HeroBanner","ImageComparison","Countdown","Video"],r=["ProductTitle","ProductDescription","ProductPrice","ProductVendor","Product","ProductSku","StockCounter","Sticky","ProductBadge","ProductViewMore","ProductButton","DynamicCheckout","ProductList","ProductQuantity","ProductVariants"],s=["Icon","IconListHoz","Line","IconList","IconListV2","Tabs","Accordion","Marquee","Breadcrumb","EstimateDate"],i=["Newsletter","ContactForm","TextField","FormTextarea","FormEmail","FormDropdown","FormCheckbox","SubmitButton","TextInput"],n=["CollectionTitle","CollectionDescription","CollectionBanner","CollectionToolbar","CollectionPaginator"],c=[...a,...r,...s,...i,...n],l=e;return c.includes(o||"")&&(l={desktop:t.desktop??{},tablet:t.tablet??t.desktop??{},mobile:t.mobile??t.tablet??t.desktop??{}}),l},splitStyle=(e,t={})=>{let o=e.map(e=>i(e)).flat(),a=Object.keys(t).filter(e=>o.includes(e)),r=a.reduce((e,o)=>({...e,[o]:t[o]}),{}),s=Object.keys(t).filter(e=>!a.includes(e)).reduce((e,o)=>({...e,[o]:t[o]}),{});return[r,s]},filterAttrInStyle=(e,t)=>{if(!e||!t)return{};let o={...e};return Object.entries(o).forEach(([e])=>{t.includes(e)||delete o[e]}),o},removeAttrInStyle=(e,t)=>{if(!e||!t)return{};let o={...e};return Object.entries(o).forEach(([e])=>{t.includes(e)&&delete o[e]}),o},getCornerStyle=e=>composeAdvanceStyle({rounded:e?.rounded}),removePaddingYInStyle=e=>{let t=["--pt","--pt-tablet","--pt-mobile","--pb","--pb-tablet","--pb-mobile"];return removeAttrInStyle(e,t)};export{composeAdvanceStyle,composeAdvanceStyleForPostPurchase,convertBoxShadowV1ToV2,filterAttrInStyle,getCornerStyle,removeAttrInStyle,removePaddingYInStyle,splitStyle};
@@ -0,0 +1 @@
1
+ function composeClasses(s){return s?s.split(" ").reduce((s,e)=>(s[e]=!0,s),{}):{}}export{composeClasses};
@@ -0,0 +1 @@
1
+ let DIALOG="Dialog";export{DIALOG};
@@ -1,19 +1 @@
1
- const stateMapping = {
2
- normal: '',
3
- hover: '-hvr',
4
- focus: '-focus'
5
- };
6
- const devicesMapping = {
7
- desktop: '',
8
- tablet: '-tablet',
9
- mobile: '-mobile'
10
- };
11
- const layoutComponent = [
12
- 'Row',
13
- 'Section',
14
- 'Product',
15
- 'HeroBanner',
16
- 'CollectionBanner'
17
- ];
18
-
19
- export { devicesMapping, layoutComponent, stateMapping };
1
+ let stateMapping={normal:"",hover:"-hvr",focus:"-focus"},devicesMapping={desktop:"",tablet:"-tablet",mobile:"-mobile"},layoutComponent=["Row","Section","Product","HeroBanner","CollectionBanner"];export{devicesMapping,layoutComponent,stateMapping};
@@ -1,4 +1 @@
1
- const isLocalEnv = process.env.NEXT_CONVERT_ENV === 'local';
2
- const baseAssetURL = process.env.GP_BASE_ASSET_URL || 'https://d3kbi0je7pp4lw.cloudfront.net';
3
-
4
- export { baseAssetURL, isLocalEnv };
1
+ let isLocalEnv="local"===process.env.NEXT_CONVERT_ENV,baseAssetURL=process.env.GP_BASE_ASSET_URL||"https://assets.gemcommerce.xyz";export{baseAssetURL,isLocalEnv};
@@ -1,17 +1 @@
1
- const convertHTML = (str)=>{
2
- const symbols = {
3
- '&': '&',
4
- '&lt;': '<',
5
- '&gt;': '>',
6
- '&nbsp;': ' '
7
- };
8
- let newStr = str;
9
- for(const symbol in symbols){
10
- if (str.indexOf(symbol) >= 0) {
11
- newStr = newStr.replaceAll(symbol, symbols[symbol]);
12
- }
13
- }
14
- return newStr;
15
- };
16
-
17
- export { convertHTML };
1
+ let convertHTML=e=>{let t={"&amp;":"&","&lt;":"<","&gt;":">","&nbsp;":" "},l=e;for(let r in t)e.indexOf(r)>=0&&(l=l.replaceAll(r,t[r]));return l};export{convertHTML};
@@ -1,5 +1 @@
1
- const genVariable = (variableName)=>{
2
- return `var(--g-${variableName})`;
3
- };
4
-
5
- export { genVariable };
1
+ let genVariable=e=>`var(--g-${e})`;export{genVariable};
@@ -1,6 +1 @@
1
- const validateEmail = (email)=>{
2
- const emailRegex = new RegExp(/^(?:[^<>()[\]\\.,;:\s@"]+(?:\.[^<>()[\]\\.,;:\s@"]+)*|".+")@(?:\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]|(?:[a-zA-Z\-\d]+\.)+[a-zA-Z]{2,})$/);
3
- return emailRegex.test(email);
4
- };
5
-
6
- export { validateEmail as default, validateEmail };
1
+ let validateEmail=a=>{let e=new RegExp(/^(?:[^<>()[\]\\.,;:\s@"]+(?:\.[^<>()[\]\\.,;:\s@"]+)*|".+")@(?:\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]|(?:[a-zA-Z\-\d]+\.)+[a-zA-Z]{2,})$/);return e.test(a)};export{validateEmail as default,validateEmail};
@@ -0,0 +1 @@
1
+ function filterTruthyStyles(e){return Object.fromEntries(Object.entries(e||{}).filter(([,e])=>!!e))}let filterHoverVariables=e=>Object.fromEntries(Object.entries(e||{}).filter(([e])=>!e.startsWith("--hvr")));export{filterHoverVariables,filterTruthyStyles};
@@ -1,9 +1,2 @@
1
- import { Children } from 'react';
2
- import ComponentToolbarPreview from '../components/ComponentToolbarPreview.js';
3
-
4
- const filterToolbarPreview = (children, keep = false)=>{
5
- const arrChild = Children.toArray(children);
6
- return arrChild.filter((child)=>!keep ? child?.type != ComponentToolbarPreview : child?.type == ComponentToolbarPreview);
7
- };
8
-
9
- export { filterToolbarPreview as default, filterToolbarPreview };
1
+ 'use client';
2
+ import{Children as e}from"react";import r from"../components/ComponentToolbarPreview.js";let filterToolbarPreview=(o,t=!1)=>{let l=e.toArray(o);return l.filter(e=>t?e?.type==r:e?.type!=r)};export{filterToolbarPreview as default,filterToolbarPreview};
@@ -1,7 +1 @@
1
- /**
2
- * The `flattenConnection` utility transforms a connection object from the Storefront API (for example, [Product-related connections](api/storefront/reference/products/product#connections)) into a flat array of nodes.
3
- */ const flattenConnection = (connection)=>{
4
- return connection?.edges?.map((edge)=>edge.node) ?? [];
5
- };
6
-
7
- export { flattenConnection };
1
+ let flattenConnection=e=>e?.edges?.map(e=>e.node)??[];export{flattenConnection};
@@ -1,31 +1 @@
1
- const getResponsiveValue = (input, k)=>{
2
- if (!k) return {};
3
- return {
4
- desktop: input?.desktop?.[k],
5
- tablet: input?.tablet?.[k],
6
- mobile: input?.mobile?.[k]
7
- };
8
- };
9
- const getResponsiveStateValue = (k, input)=>{
10
- return {
11
- desktop: input?.desktop?.[k],
12
- tablet: input?.tablet?.[k],
13
- mobile: input?.mobile?.[k]
14
- };
15
- };
16
- const getResponsiveValueByScreen = (value, breakpoint, defaultValue)=>{
17
- switch(breakpoint){
18
- case 'tablet':
19
- return value?.tablet ?? value?.desktop ?? defaultValue;
20
- case 'mobile':
21
- return value?.mobile ?? value?.tablet ?? value?.desktop ?? defaultValue;
22
- default:
23
- return value?.desktop ?? defaultValue;
24
- }
25
- };
26
- const isColumnDirectionExist = (layout, breakpoint)=>{
27
- if (breakpoint === 'desktop' || breakpoint === 'tablet') return false;
28
- return layout?.[breakpoint]?.cols?.length !== layout?.desktop?.cols?.length;
29
- };
30
-
31
- export { getResponsiveStateValue, getResponsiveValue, getResponsiveValueByScreen, isColumnDirectionExist };
1
+ let getResponsiveValue=(e,t)=>t?{desktop:e?.desktop?.[t],tablet:e?.tablet?.[t],mobile:e?.mobile?.[t]}:{},getResponsiveStateValue=(e,t)=>({desktop:t?.desktop?.[e],tablet:t?.tablet?.[e],mobile:t?.mobile?.[e]}),getResponsiveValueByScreen=(e,t,s)=>{switch(t){case"tablet":return e?.tablet??e?.desktop??s;case"mobile":return e?.mobile??e?.tablet??e?.desktop??s;default:return e?.desktop??s}},isColumnDirectionExist=(e,t)=>"desktop"!==t&&"tablet"!==t&&e?.[t]?.cols?.length!==e?.desktop?.cols?.length;export{getResponsiveStateValue,getResponsiveValue,getResponsiveValueByScreen,isColumnDirectionExist};
@@ -1,90 +1 @@
1
- const globalSortNameMapping = {
2
- 'typography-heading-1-fontFamily': 'h1-ff',
3
- 'typography-heading-1-fontSize': 'h1-size',
4
- 'typography-heading-1-fontWeight': 'h1-weight',
5
- 'typography-heading-1-lineHeight': 'h1-lh',
6
- 'typography-heading-1-letterSpacing': 'h1-ls',
7
- 'typography-heading-1-fontStyle': 'h1-fs',
8
- 'typography-heading-2-fontFamily': 'h2-ff',
9
- 'typography-heading-2-fontSize': 'h2-size',
10
- 'typography-heading-2-fontWeight': 'h2-weight',
11
- 'typography-heading-2-lineHeight': 'h2-lh',
12
- 'typography-heading-2-letterSpacing': 'h2-ls',
13
- 'typography-heading-2-fontStyle': 'h2-fs',
14
- 'typography-heading-3-fontFamily': 'h3-ff',
15
- 'typography-heading-3-fontSize': 'h3-size',
16
- 'typography-heading-3-fontWeight': 'h3-weight',
17
- 'typography-heading-3-lineHeight': 'h3-lh',
18
- 'typography-heading-3-letterSpacing': 'h3-ls',
19
- 'typography-heading-3-fontStyle': 'h3-fs',
20
- 'typography-subheading-1-fontFamily': 'sh1-ff',
21
- 'typography-subheading-1-fontSize': 'sh1-size',
22
- 'typography-subheading-1-fontWeight': 'sh1-weight',
23
- 'typography-subheading-1-lineHeight': 'sh1-lh',
24
- 'typography-subheading-1-letterSpacing': 'sh1-ls',
25
- 'typography-subheading-1-fontStyle': 'sh1-fs',
26
- 'typography-subheading-2-fontFamily': 'sh2-ff',
27
- 'typography-subheading-2-fontSize': 'sh2-size',
28
- 'typography-subheading-2-fontWeight': 'sh2-weight',
29
- 'typography-subheading-2-lineHeight': 'sh2-lh',
30
- 'typography-subheading-2-letterSpacing': 'sh2-ls',
31
- 'typography-subheading-2-fontStyle': 'sh2-fs',
32
- 'typography-subheading-3-fontFamily': 'sh3-ff',
33
- 'typography-subheading-3-fontSize': 'sh3-size',
34
- 'typography-subheading-3-fontWeight': 'sh3-weight',
35
- 'typography-subheading-3-lineHeight': 'sh3-lh',
36
- 'typography-subheading-3-letterSpacing': 'sh3-ls',
37
- 'typography-subheading-3-fontStyle': 'sh3-fs',
38
- 'typography-paragraph-1-fontFamily': 'p1-ff',
39
- 'typography-paragraph-1-fontSize': 'p1-size',
40
- 'typography-paragraph-1-fontWeight': 'p1-weight',
41
- 'typography-paragraph-1-lineHeight': 'p1-lh',
42
- 'typography-paragraph-1-letterSpacing': 'p1-ls',
43
- 'typography-paragraph-1-fontStyle': 'p1-fs',
44
- 'typography-paragraph-2-fontFamily': 'p2-ff',
45
- 'typography-paragraph-2-fontSize': 'p2-size',
46
- 'typography-paragraph-2-fontWeight': 'p2-weight',
47
- 'typography-paragraph-2-lineHeight': 'p2-lh',
48
- 'typography-paragraph-2-letterSpacing': 'p2-ls',
49
- 'typography-paragraph-2-fontStyle': 'p2-fs',
50
- 'typography-paragraph-3-fontFamily': 'p3-ff',
51
- 'typography-paragraph-3-fontSize': 'p3-size',
52
- 'typography-paragraph-3-fontWeight': 'p3-weight',
53
- 'typography-paragraph-3-lineHeight': 'p3-lh',
54
- 'typography-paragraph-3-letterSpacing': 'p3-ls',
55
- 'typography-paragraph-3-fontStyle': 'p3-fs',
56
- 'color-brand': 'c-brand',
57
- 'color-highlight': 'c-highlight',
58
- 'color-text-1': 'c-text-1',
59
- 'color-text-2': 'c-text-2',
60
- 'color-text-3': 'c-text-3',
61
- 'color-bg-1': 'c-bg-1',
62
- 'color-bg-2': 'c-bg-2',
63
- 'color-bg-3': 'c-bg-3',
64
- 'color-line-1': 'c-line-1',
65
- 'color-line-2': 'c-line-2',
66
- 'color-line-3': 'c-line-3',
67
- 'color-success': 'c-success',
68
- 'color-info': 'c-info',
69
- 'color-warning': 'c-warning',
70
- 'color-error': 'c-error',
71
- 'spacing-xxs': 's-xxs',
72
- 'spacing-xs': 's-xs',
73
- 'spacing-s': 's-s',
74
- 'spacing-m': 's-m',
75
- 'spacing-l': 's-l',
76
- 'spacing-xl': 's-xl',
77
- 'spacing-2xl': 's-2xl',
78
- 'spacing-3xl': 's-3xl',
79
- 'spacing-4xl': 's-4xl',
80
- 'spacing-5xl': 's-5xl',
81
- 'container-width': 'ct-w',
82
- 'container-padding': 'ct-p',
83
- 'text-shadow': 'ts',
84
- 'box-shadow': 'shadow'
85
- };
86
- function getShortName(name) {
87
- return globalSortNameMapping[name] || name;
88
- }
89
-
90
- export { getShortName };
1
+ let globalSortNameMapping={"typography-heading-1-fontFamily":"h1-ff","typography-heading-1-fontSize":"h1-size","typography-heading-1-fontWeight":"h1-weight","typography-heading-1-lineHeight":"h1-lh","typography-heading-1-letterSpacing":"h1-ls","typography-heading-1-fontStyle":"h1-fs","typography-heading-2-fontFamily":"h2-ff","typography-heading-2-fontSize":"h2-size","typography-heading-2-fontWeight":"h2-weight","typography-heading-2-lineHeight":"h2-lh","typography-heading-2-letterSpacing":"h2-ls","typography-heading-2-fontStyle":"h2-fs","typography-heading-3-fontFamily":"h3-ff","typography-heading-3-fontSize":"h3-size","typography-heading-3-fontWeight":"h3-weight","typography-heading-3-lineHeight":"h3-lh","typography-heading-3-letterSpacing":"h3-ls","typography-heading-3-fontStyle":"h3-fs","typography-subheading-1-fontFamily":"sh1-ff","typography-subheading-1-fontSize":"sh1-size","typography-subheading-1-fontWeight":"sh1-weight","typography-subheading-1-lineHeight":"sh1-lh","typography-subheading-1-letterSpacing":"sh1-ls","typography-subheading-1-fontStyle":"sh1-fs","typography-subheading-2-fontFamily":"sh2-ff","typography-subheading-2-fontSize":"sh2-size","typography-subheading-2-fontWeight":"sh2-weight","typography-subheading-2-lineHeight":"sh2-lh","typography-subheading-2-letterSpacing":"sh2-ls","typography-subheading-2-fontStyle":"sh2-fs","typography-subheading-3-fontFamily":"sh3-ff","typography-subheading-3-fontSize":"sh3-size","typography-subheading-3-fontWeight":"sh3-weight","typography-subheading-3-lineHeight":"sh3-lh","typography-subheading-3-letterSpacing":"sh3-ls","typography-subheading-3-fontStyle":"sh3-fs","typography-paragraph-1-fontFamily":"p1-ff","typography-paragraph-1-fontSize":"p1-size","typography-paragraph-1-fontWeight":"p1-weight","typography-paragraph-1-lineHeight":"p1-lh","typography-paragraph-1-letterSpacing":"p1-ls","typography-paragraph-1-fontStyle":"p1-fs","typography-paragraph-2-fontFamily":"p2-ff","typography-paragraph-2-fontSize":"p2-size","typography-paragraph-2-fontWeight":"p2-weight","typography-paragraph-2-lineHeight":"p2-lh","typography-paragraph-2-letterSpacing":"p2-ls","typography-paragraph-2-fontStyle":"p2-fs","typography-paragraph-3-fontFamily":"p3-ff","typography-paragraph-3-fontSize":"p3-size","typography-paragraph-3-fontWeight":"p3-weight","typography-paragraph-3-lineHeight":"p3-lh","typography-paragraph-3-letterSpacing":"p3-ls","typography-paragraph-3-fontStyle":"p3-fs","color-brand":"c-brand","color-highlight":"c-highlight","color-text-1":"c-text-1","color-text-2":"c-text-2","color-text-3":"c-text-3","color-bg-1":"c-bg-1","color-bg-2":"c-bg-2","color-bg-3":"c-bg-3","color-line-1":"c-line-1","color-line-2":"c-line-2","color-line-3":"c-line-3","color-success":"c-success","color-info":"c-info","color-warning":"c-warning","color-error":"c-error","spacing-xxs":"s-xxs","spacing-xs":"s-xs","spacing-s":"s-s","spacing-m":"s-m","spacing-l":"s-l","spacing-xl":"s-xl","spacing-2xl":"s-2xl","spacing-3xl":"s-3xl","spacing-4xl":"s-4xl","spacing-5xl":"s-5xl","container-width":"ct-w","container-padding":"ct-p","text-shadow":"ts","box-shadow":"shadow"};function getShortName(h){return globalSortNameMapping[h]||h}export{getShortName};
@@ -1,58 +1 @@
1
- import { devicesMapping } from '../web-components/src/helpers/styles/constant.js';
2
-
3
- const TEXT_TOTAL_SPACING = 3; //Padding 2, margin 1
4
- const composePostionIconList = (lineHeight, position, iconWidth)=>{
5
- const compose = {};
6
- composePositionLineHeight({
7
- compose,
8
- lineHeight,
9
- device: 'desktop',
10
- position,
11
- iconWidth
12
- });
13
- composePositionLineHeight({
14
- compose,
15
- lineHeight,
16
- device: 'tablet',
17
- position,
18
- iconWidth
19
- });
20
- composePositionLineHeight({
21
- compose,
22
- lineHeight,
23
- device: 'mobile',
24
- position,
25
- iconWidth
26
- });
27
- return compose;
28
- };
29
- const composePositionLineHeight = ({ compose, lineHeight, device, position, iconWidth })=>{
30
- const positionDevice = position?.[device];
31
- const iconWidthDevice = iconWidth?.[device];
32
- if (positionDevice) {
33
- const suffix = devicesMapping[device] ?? '';
34
- if (positionDevice === 'center') {
35
- compose.wrapper = {
36
- ...compose.wrapper,
37
- [`--ai${suffix}`]: 'center'
38
- };
39
- compose.content = {
40
- ...compose.content,
41
- [`--pos${suffix}`]: 'static'
42
- };
43
- } else if (iconWidthDevice) {
44
- const computedTop = parseFloat(lineHeight.replaceAll(/[a-zA-Z]/g, '')) / 2 + TEXT_TOTAL_SPACING - iconWidthDevice / 2;
45
- compose.wrapper = {
46
- ...compose.wrapper,
47
- [`--ai${suffix}`]: 'flex-start'
48
- };
49
- compose.content = {
50
- ...compose.content,
51
- [`--top${suffix}`]: `${Math.max(0, Math.ceil(computedTop))}px`,
52
- [`--pos${suffix}`]: 'relative'
53
- };
54
- }
55
- }
56
- };
57
-
58
- export { composePositionLineHeight, composePostionIconList };
1
+ import{devicesMapping as e}from"./constant.js";let TEXT_TOTAL_SPACING=3,composePostionIconList=(e,t,o)=>{let i={};return composePositionLineHeight({compose:i,lineHeight:e,device:"desktop",position:t,iconWidth:o}),composePositionLineHeight({compose:i,lineHeight:e,device:"tablet",position:t,iconWidth:o}),composePositionLineHeight({compose:i,lineHeight:e,device:"mobile",position:t,iconWidth:o}),i},composePositionLineHeight=({compose:t,lineHeight:o,device:i,position:n,iconWidth:s})=>{let p=n?.[i],c=s?.[i];if(p){let n=e[i]??"";if("center"===p)t.wrapper={...t.wrapper,[`--ai${n}`]:"center"},t.content={...t.content,[`--pos${n}`]:"static"};else if(c){let e=parseFloat(o.replaceAll(/[a-zA-Z]/g,""))/2+3-c/2;t.wrapper={...t.wrapper,[`--ai${n}`]:"flex-start"},t.content={...t.content,[`--top${n}`]:`${Math.max(0,Math.ceil(e))}px`,[`--pos${n}`]:"relative"}}}};export{composePositionLineHeight,composePostionIconList};