@gem-sdk/core 3.0.0-pre-production.15 → 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 +2 -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 +2 -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,9 +1 @@
1
- import { pascalToKebab } from '../pascal-to-kebab-case.js';
2
- import { THIRD_PARTY_APP_BLOCK_ID_PREFIX } from './constant.js';
3
-
4
- const composeAppBlockId = (tag, uid)=>{
5
- const key = pascalToKebab(tag);
6
- return `${THIRD_PARTY_APP_BLOCK_ID_PREFIX}_${key}_${uid}`;
7
- };
8
-
9
- export { composeAppBlockId };
1
+ import{pascalToKebab as o}from"../pascal-to-kebab-case.js";import{THIRD_PARTY_APP_BLOCK_ID_PREFIX as p}from"./constant.js";let composeAppBlockId=(t,e)=>{let c=o(t);return`${p}_${c}_${e}`};export{composeAppBlockId};
@@ -1,66 +1 @@
1
- import { RechargeSubscriptionsConfig, BonLoyaltyRewardsReferralsConfig, SubifySubscriptionsConfig, SelleasyConfig, LoopSubscriptionsConfig, SkioSubscriptionsYcS20Config, ShopifyFormsConfig, ReviewxpoProductReviewsAppConfig, PumperBundlesVolumeDiscountConfig, UnlimitedBundlesDiscountsConfig, KiteFreeGiftDiscountConfig, FastBundleBundlesDiscountsConfig, SimpleBundlesKitsConfig, EasyBundleBuilderSkailamaConfig, PreorderNowPreOrderPqConfig, FlyBundlesUpsellsFbtConfig, JunipProductReviewsUgcConfig, PreorderNowWodPresaleConfig, YotpoReviewsV3UgcConfig, WhatmoreShoppableVideosreelConfig, ProductOptionsCustomizerConfig, AppointmentBookingCowlendarConfig, BoldSubscriptionsConfig, SproutPlantTreesGrowSalesConfig, InstasellShoppableInstagramConfig, GrowaveConfig, LoloyalLoyaltyReferralsConfig, PowerfulContactFormBuilderConfig, WishlistKingConfig, GloboProductOptionsVariantConfig, KachingBundlesConfig, TrustooConfig, LooxReviewsConfig, PowrContactFormBuilderConfig, BestBuyFulfillmentConfig, AftershipEmailMarketingsmsConfig, SegunoEmailMarketingConfig, SeoantTrustBadgesIconConfig, TrustreviewsProductReviewsConfig, MyappgurusProductReviewsConfig, HulkProductOptionsConfig, TrustshopProductReviewsConfig, StampedConfig, BoostAISearchDiscoveryConfig, EssentialCountdownTimerBarConfig, EssentialAnnouncementBarConfig, OkendoReviewsLoyaltyConfig, EstimatedDeliveryDatePlusConfig, HextomCountdownTimerBarConfig, TrustBadgesBearConfig, TrustedsiteTrustBadgesConfig, GloColorSwatchvariantImageConfig, BfSizeChartSizeGuideConfig, HextomFreeShippingBarConfig, ShopifySubscriptionsConfig, QikifyUpsellConfig, EcoboostifyShoppableReelUgcConfig, AppstleBundlesDiscountsConfig, ReleasitConfig } from './appConfig.js';
2
-
3
- const mapShopifyAppMeta = {
4
- ...RechargeSubscriptionsConfig,
5
- ...BonLoyaltyRewardsReferralsConfig,
6
- ...SubifySubscriptionsConfig,
7
- ...SelleasyConfig,
8
- ...LoopSubscriptionsConfig,
9
- ...SkioSubscriptionsYcS20Config,
10
- ...ShopifyFormsConfig,
11
- ...ReviewxpoProductReviewsAppConfig,
12
- ...PumperBundlesVolumeDiscountConfig,
13
- ...UnlimitedBundlesDiscountsConfig,
14
- ...KiteFreeGiftDiscountConfig,
15
- ...FastBundleBundlesDiscountsConfig,
16
- ...SimpleBundlesKitsConfig,
17
- ...EasyBundleBuilderSkailamaConfig,
18
- ...PreorderNowPreOrderPqConfig,
19
- ...FlyBundlesUpsellsFbtConfig,
20
- ...JunipProductReviewsUgcConfig,
21
- ...PreorderNowWodPresaleConfig,
22
- ...YotpoReviewsV3UgcConfig,
23
- ...WhatmoreShoppableVideosreelConfig,
24
- ...ProductOptionsCustomizerConfig,
25
- ...AppointmentBookingCowlendarConfig,
26
- ...BoldSubscriptionsConfig,
27
- ...SproutPlantTreesGrowSalesConfig,
28
- ...InstasellShoppableInstagramConfig,
29
- ...GrowaveConfig,
30
- ...LoloyalLoyaltyReferralsConfig,
31
- ...PowerfulContactFormBuilderConfig,
32
- ...WishlistKingConfig,
33
- ...GloboProductOptionsVariantConfig,
34
- ...KachingBundlesConfig,
35
- ...TrustooConfig,
36
- ...LooxReviewsConfig,
37
- ...PowrContactFormBuilderConfig,
38
- ...BestBuyFulfillmentConfig,
39
- ...AftershipEmailMarketingsmsConfig,
40
- ...SegunoEmailMarketingConfig,
41
- ...SeoantTrustBadgesIconConfig,
42
- ...TrustreviewsProductReviewsConfig,
43
- ...MyappgurusProductReviewsConfig,
44
- ...HulkProductOptionsConfig,
45
- ...TrustshopProductReviewsConfig,
46
- ...StampedConfig,
47
- ...BoostAISearchDiscoveryConfig,
48
- ...EssentialCountdownTimerBarConfig,
49
- ...EssentialAnnouncementBarConfig,
50
- ...OkendoReviewsLoyaltyConfig,
51
- ...EstimatedDeliveryDatePlusConfig,
52
- ...HextomCountdownTimerBarConfig,
53
- ...TrustBadgesBearConfig,
54
- ...TrustedsiteTrustBadgesConfig,
55
- ...GloColorSwatchvariantImageConfig,
56
- ...BfSizeChartSizeGuideConfig,
57
- ...HextomFreeShippingBarConfig,
58
- ...ShopifySubscriptionsConfig,
59
- ...QikifyUpsellConfig,
60
- ...EcoboostifyShoppableReelUgcConfig,
61
- ...AppstleBundlesDiscountsConfig,
62
- ...ReleasitConfig
63
- };
64
- const THIRD_PARTY_APP_BLOCK_ID_PREFIX = 'gp_app';
65
-
66
- export { THIRD_PARTY_APP_BLOCK_ID_PREFIX, mapShopifyAppMeta };
1
+ import{RechargeSubscriptionsConfig as p,BonLoyaltyRewardsReferralsConfig as _,SubifySubscriptionsConfig as P,SelleasyConfig as a,LoopSubscriptionsConfig as o,SkioSubscriptionsYcS20Config as A,ShopifyFormsConfig as I,ReviewxpoProductReviewsAppConfig as R,PumperBundlesVolumeDiscountConfig as t,UnlimitedBundlesDiscountsConfig as e,KiteFreeGiftDiscountConfig as f,FastBundleBundlesDiscountsConfig as i,SimpleBundlesKitsConfig as m,EasyBundleBuilderSkailamaConfig as D,PreorderNowPreOrderPqConfig as T,FlyBundlesUpsellsFbtConfig as r,JunipProductReviewsUgcConfig as C,PreorderNowWodPresaleConfig as g,YotpoReviewsV3UgcConfig as h,WhatmoreShoppableVideosreelConfig as y,ProductOptionsCustomizerConfig as B,AppointmentBookingCowlendarConfig as E,BoldSubscriptionsConfig as F,SproutPlantTreesGrowSalesConfig as H,InstasellShoppableInstagramConfig as K,GrowaveConfig as L,LoloyalLoyaltyReferralsConfig as M,PowerfulContactFormBuilderConfig as O,WishlistKingConfig as S,GloboProductOptionsVariantConfig as X,KachingBundlesConfig as Y,BestBuyFulfillmentConfig as j,AftershipEmailMarketingsmsConfig as l,SegunoEmailMarketingConfig as n,TrustooConfig as s,LooxReviewsConfig as x,SeoantTrustBadgesIconConfig as b,TrustreviewsProductReviewsConfig as c,MyappgurusProductReviewsConfig as d,HulkProductOptionsConfig as k,TrustshopProductReviewsConfig as q,StampedConfig as u,BoostAISearchDiscoveryConfig as v,EssentialCountdownTimerBarConfig as w,EssentialAnnouncementBarConfig as z,OkendoReviewsLoyaltyConfig as G,EstimatedDeliveryDatePlusConfig as J,HextomCountdownTimerBarConfig as N,TrustBadgesBearConfig as Q,TrustedsiteTrustBadgesConfig as U,GloColorSwatchvariantImageConfig as V,BfSizeChartSizeGuideConfig as W,HextomFreeShippingBarConfig as Z,ShopifySubscriptionsConfig as $,QikifyUpsellConfig as pp,EcoboostifyShoppableReelUgcConfig as p_,AppstleBundlesDiscountsConfig as pP,ReleasitConfig as pa,AovFreeGiftBuyXGetYBogoConfig as po}from"./appConfig.js";let mapShopifyAppMeta={...p,..._,...P,...a,...o,...A,...I,...R,...t,...e,...f,...i,...m,...D,...T,...r,...C,...g,...h,...y,...B,...E,...F,...H,...K,...L,...M,...O,...S,...X,...Y,...j,...l,...n,...s,...x,...b,...c,...d,...k,...q,...u,...v,...w,...z,...G,...J,...N,...Q,...U,...V,...W,...Z,...$,...pp,...p_,...pP,...pa,...po},THIRD_PARTY_APP_BLOCK_ID_PREFIX="gp_app";export{THIRD_PARTY_APP_BLOCK_ID_PREFIX,mapShopifyAppMeta};
@@ -1,32 +1 @@
1
- import { loopComponent } from '../loop-component.js';
2
- import { getAppBlockConfig } from './getAppBlockConfig.js';
3
-
4
- const generateAppBlockConfigs = (component)=>{
5
- const strComponent = JSON.stringify(component) || '';
6
- if (!strComponent.includes('appBlockId')) return null;
7
- const configs = [];
8
- loopComponent(component, (component)=>{
9
- const settings = component.settings || {};
10
- const appBlockId = settings?.appBlockId || '';
11
- if (!appBlockId) return;
12
- const config = getAppBlockConfig(component.tag, appBlockId, settings);
13
- if (!config) return;
14
- configs.push(config);
15
- });
16
- if (!configs.length) return null;
17
- return {
18
- newBlocks: extractBlocks(configs),
19
- newBlockOrder: extractBlockOrder(configs)
20
- };
21
- };
22
- function extractBlocks(array) {
23
- return array.reduce((acc, item)=>{
24
- acc[item.key] = item.value;
25
- return acc;
26
- }, {});
27
- }
28
- function extractBlockOrder(array) {
29
- return array.map((item)=>item.key);
30
- }
31
-
32
- export { generateAppBlockConfigs };
1
+ import{loopComponent as e}from"../loop-component.js";import{getAppBlockConfig as t}from"./getAppBlockConfig.js";let generateAppBlockConfigs=r=>{let o=JSON.stringify(r)||"";if(!o.includes("appBlockId"))return null;let l=[];return(e(r,e=>{let r=e.settings||{},o=r?.appBlockId||"";if(!o)return;let n=t(e.tag,o,r);n&&l.push(n)}),l.length)?{newBlocks:extractBlocks(l),newBlockOrder:extractBlockOrder(l)}:null};function extractBlocks(e){return e.reduce((e,t)=>(e[t.key]=t.value,e),{})}function extractBlockOrder(e){return e.map(e=>e.key)}export{generateAppBlockConfigs};
@@ -1,53 +1 @@
1
- import { composeSettingsByWidgetType, overrideSettings } from './appSetting.js';
2
- import { getAppBlockType } from './getAppBlockType.js';
3
-
4
- const listAppUpdateNewVersion = [
5
- 'Growave',
6
- 'Trustoo',
7
- 'LooxReviews',
8
- 'Stamped',
9
- 'Releasit'
10
- ];
11
- const listThirdPartyRejectAppBlock = {
12
- YotpoReviews: {
13
- conditionToReject: 'settings?.version === "v1"'
14
- },
15
- Trustoo: {
16
- conditionToReject: 'settings?.version === "v1"'
17
- },
18
- LooxReviews: {
19
- conditionToReject: 'settings?.version === "v1"'
20
- },
21
- Stamped: {
22
- conditionToReject: 'settings?.version === "v1"'
23
- },
24
- Releasit: {
25
- conditionToReject: 'settings?.version === "v1"'
26
- }
27
- };
28
- const getAppBlockConfig = (tag, appBlockId, settings)=>{
29
- if (listThirdPartyRejectAppBlock[tag] && eval(listThirdPartyRejectAppBlock[tag]?.conditionToReject ?? '')) {
30
- return;
31
- }
32
- let widgetType = settings?.widgetType;
33
- if (listAppUpdateNewVersion.includes(tag)) {
34
- widgetType = settings?.widgetTypeV2;
35
- }
36
- const appBlockType = getAppBlockType({
37
- tag,
38
- widgetType
39
- });
40
- const settingByWidget = composeSettingsByWidgetType[tag][widgetType];
41
- const appSettings = overrideSettings(tag, settingByWidget, settings);
42
- return {
43
- key: appBlockId,
44
- value: {
45
- type: appBlockType,
46
- ...settingByWidget && {
47
- settings: appSettings
48
- }
49
- }
50
- };
51
- };
52
-
53
- export { getAppBlockConfig };
1
+ import{composeSettingsByWidgetType,overrideSettings}from"./appSetting.js";import{getAppBlockType}from"./getAppBlockType.js";let listAppUpdateNewVersion=["Growave","Trustoo","LooxReviews","Stamped","Releasit"],listThirdPartyRejectAppBlock={YotpoReviews:{conditionToReject:'settings?.version === "v1"'},Trustoo:{conditionToReject:'settings?.version === "v1"'},LooxReviews:{conditionToReject:'settings?.version === "v1"'},Stamped:{conditionToReject:'settings?.version === "v1"'},Releasit:{conditionToReject:'settings?.version === "v1"'}},getAppBlockConfig=(tag,appBlockId,settings)=>{if(listThirdPartyRejectAppBlock[tag]&&eval(listThirdPartyRejectAppBlock[tag]?.conditionToReject??""))return;let widgetType=settings?.widgetType;listAppUpdateNewVersion.includes(tag)&&(widgetType=settings?.widgetTypeV2);let appBlockType=getAppBlockType({tag,widgetType}),settingByWidget=composeSettingsByWidgetType?.[tag]?.[widgetType],appSettings=overrideSettings(tag,settingByWidget,settings);return{key:appBlockId,value:{type:appBlockType,...settingByWidget&&{settings:appSettings}}}};export{getAppBlockConfig};
@@ -1,10 +1 @@
1
- import { mapShopifyAppMeta } from './constant.js';
2
-
3
- const getAppBlockType = ({ tag, widgetType })=>{
4
- const shopifyAppMeta = mapShopifyAppMeta[tag];
5
- if (!shopifyAppMeta) return '';
6
- const { appName, appId } = shopifyAppMeta;
7
- return `shopify://apps/${appName}/blocks/${widgetType}/${appId}`;
8
- };
9
-
10
- export { getAppBlockType };
1
+ import{mapShopifyAppMeta as p}from"./constant.js";let getAppBlockType=({tag:t,widgetType:e})=>{let o=p[t];if(!o)return"";let{appName:r,appId:l}=o;return`shopify://apps/${r}/blocks/${e}/${l}`};export{getAppBlockType};
@@ -1,28 +1 @@
1
- import { addAppBlockId } from './addAppBlockId.js';
2
- import { generateAppBlockConfigs } from './generateAppBlockConfigs.js';
3
- import { mergeBlocks } from './mergeBlock.js';
4
- import { mergeBlockOrder } from './mergeBlockOrder.js';
5
- import { removeAllGPAppItemsFromBlocks, removeAllGPAppItemsFromBlockOrder } from './removeGPAppItems.js';
6
-
7
- const getAppBlocks = (section)=>{
8
- const { blocks: currentBlock, block_order: currentBlockOrder } = JSON.parse(section?.appBlocks || '{}');
9
- const component = JSON.parse(section?.component || '');
10
- const componentWithAppBlockId = addAppBlockId(component);
11
- const appBlockConfigs = generateAppBlockConfigs(componentWithAppBlockId);
12
- if (!appBlockConfigs) {
13
- if (!currentBlock || !currentBlockOrder) return {};
14
- return {
15
- blocks: removeAllGPAppItemsFromBlocks(currentBlock),
16
- block_order: removeAllGPAppItemsFromBlockOrder(currentBlockOrder)
17
- };
18
- }
19
- const { newBlocks, newBlockOrder } = appBlockConfigs;
20
- const blocks = mergeBlocks(newBlocks, currentBlock);
21
- const block_order = mergeBlockOrder(newBlockOrder, currentBlockOrder);
22
- return {
23
- blocks,
24
- block_order
25
- };
26
- };
27
-
28
- export { getAppBlocks };
1
+ import{addAppBlockId as o}from"./addAppBlockId.js";import{generateAppBlockConfigs as r}from"./generateAppBlockConfigs.js";import{mergeBlocks as e}from"./mergeBlock.js";import{mergeBlockOrder as p}from"./mergeBlockOrder.js";import{removeAllGPAppItemsFromBlocks as t,removeAllGPAppItemsFromBlockOrder as m}from"./removeGPAppItems.js";let getAppBlocks=l=>{let{blocks:s,block_order:c}=JSON.parse(l?.appBlocks||"{}"),k=JSON.parse(l?.component||""),f=o(k),i=r(f);if(!i)return s&&c?{blocks:t(s),block_order:m(c)}:{};let{newBlocks:B,newBlockOrder:d}=i,g=e(B,s),n=p(d,c);return{blocks:g,block_order:n}};export{getAppBlocks};
@@ -1,17 +1 @@
1
- function mergeBlocks(newBlocks, blocks) {
2
- if (!blocks) return newBlocks;
3
- const result = {};
4
- // Add all non-gp_app blocks from the original blocks
5
- for (const [key, value] of Object.entries(blocks)){
6
- if (!key.startsWith('gp_app')) {
7
- result[key] = value;
8
- }
9
- }
10
- // Add all blocks from new-blocks
11
- for (const [key, value] of Object.entries(newBlocks)){
12
- result[key] = value;
13
- }
14
- return result;
15
- }
16
-
17
- export { mergeBlocks };
1
+ function mergeBlocks(e,t){if(!t)return e;let r={};for(let[e,o]of Object.entries(t))e.startsWith("gp_app")||(r[e]=o);for(let[t,o]of Object.entries(e))r[t]=o;return r}export{mergeBlocks};
@@ -1,45 +1 @@
1
- import { THIRD_PARTY_APP_BLOCK_ID_PREFIX } from './constant.js';
2
-
3
- function isGpAppItem(item) {
4
- if (!item) return false;
5
- return item.startsWith(THIRD_PARTY_APP_BLOCK_ID_PREFIX);
6
- }
7
- function filterCurrentOrder(currentOrder, newOrderSet) {
8
- return currentOrder.filter((item)=>!isGpAppItem(item) || newOrderSet.has(item));
9
- }
10
- function processNonGpAppItem(item, resultOrder) {
11
- resultOrder.push(item);
12
- }
13
- function processGpAppItems(newOrder, newOrderIndex, resultOrder) {
14
- while(newOrderIndex < newOrder.length && isGpAppItem(newOrder[newOrderIndex])){
15
- resultOrder.push(newOrder[newOrderIndex]);
16
- newOrderIndex++;
17
- }
18
- return newOrderIndex;
19
- }
20
- function addRemainingGpAppItems(newOrder, startIndex, resultOrder) {
21
- for(let i = startIndex; i < newOrder.length; i++){
22
- const item = newOrder[i];
23
- if (item && isGpAppItem(item)) {
24
- resultOrder.push(item);
25
- }
26
- }
27
- }
28
- function mergeBlockOrder(newOrder, currentOrder) {
29
- if (!currentOrder) return newOrder;
30
- const newOrderSet = new Set(newOrder);
31
- const filteredCurrentOrder = filterCurrentOrder(currentOrder, newOrderSet);
32
- const resultOrder = [];
33
- let newOrderIndex = 0;
34
- filteredCurrentOrder.forEach((item)=>{
35
- if (!isGpAppItem(item)) {
36
- processNonGpAppItem(item, resultOrder);
37
- return;
38
- }
39
- newOrderIndex = processGpAppItems(newOrder, newOrderIndex, resultOrder);
40
- });
41
- addRemainingGpAppItems(newOrder, newOrderIndex, resultOrder);
42
- return resultOrder;
43
- }
44
-
45
- export { mergeBlockOrder };
1
+ import{THIRD_PARTY_APP_BLOCK_ID_PREFIX as e}from"./constant.js";function isGpAppItem(p){return!!p&&p.startsWith(e)}function filterCurrentOrder(e,p){return e.filter(e=>!isGpAppItem(e)||p.has(e))}function processNonGpAppItem(e,p){p.push(e)}function processGpAppItems(e,p,t){for(;p<e.length&&isGpAppItem(e[p]);)t.push(e[p]),p++;return p}function addRemainingGpAppItems(e,p,t){for(let r=p;r<e.length;r++){let p=e[r];p&&isGpAppItem(p)&&t.push(p)}}function mergeBlockOrder(e,p){if(!p)return e;let t=new Set(e),r=filterCurrentOrder(p,t),n=[],s=0;return r.forEach(p=>{if(!isGpAppItem(p)){processNonGpAppItem(p,n);return}s=processGpAppItems(e,s,n)}),addRemainingGpAppItems(e,s,n),n}export{mergeBlockOrder};
@@ -1,15 +1 @@
1
- import { THIRD_PARTY_APP_BLOCK_ID_PREFIX } from './constant.js';
2
-
3
- const removeAllGPAppItemsFromBlocks = (blocks)=>{
4
- for(const key in blocks){
5
- if (key.startsWith(THIRD_PARTY_APP_BLOCK_ID_PREFIX)) {
6
- delete blocks[key];
7
- }
8
- }
9
- return blocks;
10
- };
11
- const removeAllGPAppItemsFromBlockOrder = (blockOrder)=>{
12
- return blockOrder.filter((item)=>!item.includes(THIRD_PARTY_APP_BLOCK_ID_PREFIX));
13
- };
14
-
15
- export { removeAllGPAppItemsFromBlockOrder, removeAllGPAppItemsFromBlocks };
1
+ import{THIRD_PARTY_APP_BLOCK_ID_PREFIX as e}from"./constant.js";let removeAllGPAppItemsFromBlocks=r=>{for(let l in r)l.startsWith(e)&&delete r[l];return r},removeAllGPAppItemsFromBlockOrder=r=>r.filter(r=>!r.includes(e));export{removeAllGPAppItemsFromBlockOrder,removeAllGPAppItemsFromBlocks};
@@ -1,24 +1 @@
1
- const pageview = ()=>{
2
- if (!window.fbq) return;
3
- window.fbq('track', 'PageView');
4
- };
5
- // https://developers.facebook.com/docs/facebook-pixel/advanced/
6
- const event = (name, options = {})=>{
7
- if (!window.fbq) return;
8
- window.fbq('track', name, options);
9
- };
10
- const addToCart = (product)=>{
11
- if (!window.fbq) return;
12
- window.fbq('track', 'AddToCart', {
13
- content_ids: [
14
- product.id
15
- ],
16
- content_name: product.name,
17
- content_category: product.category,
18
- content_type: 'product',
19
- value: product.price,
20
- currency: product.currency
21
- });
22
- };
23
-
24
- export { addToCart, event, pageview };
1
+ let pageview=()=>{window.fbq&&window.fbq("track","PageView")},event=(e,t={})=>{window.fbq&&window.fbq("track",e,t)},addToCart=e=>{window.fbq&&window.fbq("track","AddToCart",{content_ids:[e.id],content_name:e.name,content_category:e.category,content_type:"product",value:e.price,currency:e.currency})};export{addToCart,event,pageview};
@@ -1,87 +1 @@
1
- // https://developers.google.com/analytics/devguides/collection/gtagjs/pages
2
- const pageview = (url, trackingId)=>{
3
- // GA 4
4
- if (window.gtag && trackingId) {
5
- window.gtag('config', trackingId, {
6
- page_path: url
7
- });
8
- }
9
- // GA 3
10
- if (window.ga) {
11
- window.ga('send', 'pageview', url);
12
- }
13
- };
14
- /** Addition to cart events
15
- * https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce#add-remove-cart
16
- */ const addToCart = (product)=>{
17
- // GA 3
18
- if (!window.ga || !product) {
19
- return;
20
- }
21
- window.ga('ec:addProduct', {
22
- ...product,
23
- id: product.sku,
24
- name: product.variant === 'Default Title' ? product.name : `${product.name} - ${product.variant}`,
25
- variant: product.variant === 'Default Title' ? product.name : product.variant
26
- });
27
- window.ga('ec:setAction', 'add');
28
- window.ga('send', 'event', {
29
- eventCategory: 'EnhancedEcommerce',
30
- eventAction: 'Added Product',
31
- nonInteraction: true
32
- });
33
- };
34
- /** Product clicked event
35
- * https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce#product-click
36
- */ const productClick = (product)=>{
37
- if (!window.ga) {
38
- return;
39
- }
40
- ga('ec:addProduct', {
41
- id: product.id,
42
- name: product.name,
43
- category: product.category,
44
- brand: product.brand,
45
- variant: product.variant
46
- });
47
- ga('ec:setAction', 'click');
48
- ga('send', 'event', {
49
- eventAction: 'Click',
50
- eventCategory: 'Product'
51
- });
52
- };
53
- /** Product viewed event
54
- * https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce#measuring-actvities
55
- */ const productDetail = (product)=>{
56
- if (!product || !window.ga) return;
57
- ga('ec:addProduct', {
58
- brand: product.brand,
59
- category: product.category,
60
- id: product.id,
61
- name: product.name,
62
- variant: product.variant
63
- });
64
- ga('ec:setAction', 'detail');
65
- ga('send', 'event', {
66
- eventAction: 'Detail',
67
- eventCategory: 'Ecommerce',
68
- nonInteraction: 1
69
- });
70
- };
71
- /** Removal from cart events
72
- * https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce#add-remove-cart
73
- */ const removeFromCart = (product, price)=>{
74
- if (!product || !window.ga) return;
75
- ga('ec:addProduct', {
76
- id: product.id,
77
- name: product.name,
78
- price
79
- });
80
- ga('ec:setAction', 'remove');
81
- ga('send', 'event', {
82
- eventAction: 'Click',
83
- eventCategory: 'Remove from cart'
84
- });
85
- };
86
-
87
- export { addToCart, pageview, productClick, productDetail, removeFromCart };
1
+ let pageview=(e,a)=>{window.gtag&&a&&window.gtag("config",a,{page_path:e}),window.ga&&window.ga("send","pageview",e)},addToCart=e=>{window.ga&&e&&(window.ga("ec:addProduct",{...e,id:e.sku,name:"Default Title"===e.variant?e.name:`${e.name} - ${e.variant}`,variant:"Default Title"===e.variant?e.name:e.variant}),window.ga("ec:setAction","add"),window.ga("send","event",{eventCategory:"EnhancedEcommerce",eventAction:"Added Product",nonInteraction:!0}))},productClick=e=>{window.ga&&(ga("ec:addProduct",{id:e.id,name:e.name,category:e.category,brand:e.brand,variant:e.variant}),ga("ec:setAction","click"),ga("send","event",{eventAction:"Click",eventCategory:"Product"}))},productDetail=e=>{e&&window.ga&&(ga("ec:addProduct",{brand:e.brand,category:e.category,id:e.id,name:e.name,variant:e.variant}),ga("ec:setAction","detail"),ga("send","event",{eventAction:"Detail",eventCategory:"Ecommerce",nonInteraction:1}))},removeFromCart=(e,a)=>{e&&window.ga&&(ga("ec:addProduct",{id:e.id,name:e.name,price:a}),ga("ec:setAction","remove"),ga("send","event",{eventAction:"Click",eventCategory:"Remove from cart"}))};export{addToCart,pageview,productClick,productDetail,removeFromCart};
@@ -1,15 +1 @@
1
- // @ts-nocheck
2
- const addToCart = (product)=>{
3
- if (!window?.ttq?.track) return;
4
- window.ttq.track('AddToCart', {
5
- content_id: product.id,
6
- content_type: 'product',
7
- content_name: product.name,
8
- quantity: product.quantity,
9
- price: product.price,
10
- value: (product.price ?? 0) * (product.quantity ?? 0),
11
- currency: product.currency
12
- });
13
- };
14
-
15
- export { addToCart };
1
+ let addToCart=t=>{window?.ttq?.track&&window.ttq.track("AddToCart",{content_id:t.id,content_type:"product",content_name:t.name,quantity:t.quantity,price:t.price,value:(t.price??0)*(t.quantity??0),currency:t.currency})};export{addToCart};
@@ -1,149 +1,19 @@
1
- import { getSingleColorVariable } from './colors.js';
2
- import { removeNullUndefined, makeStyle, makeStyleResponsive } from './make-style.js';
3
-
4
- const genTypoClass = (name)=>{
5
- return `gp-g-${name}`;
6
- };
7
- const composeTypographyCss = (typography)=>{
8
- const typographyCustom = typography?.custom;
9
- const { fontFamily, fontSize, fontStyle, fontWeight, lineHeight, letterSpacing } = typographyCustom?.desktop ?? {};
10
- return `
11
- ${fontFamily ? `fontFamily: ${composeFontFamilyTypographyV2({
12
- fontFamily
13
- })};` : ''}
14
- ${fontSize ? `font-size: ${fontSize};` : ''}
15
- ${fontStyle ? `font-style: ${fontStyle};` : ''}
16
- ${fontWeight ? `font-weight: ${fontWeight};` : ''}
17
- ${letterSpacing ? `letter-spacing: ${letterSpacing};` : ''}
18
- ${lineHeight ? `line-height: ${lineHeight};` : ''}
19
- `;
20
- };
21
- const composeTypographyV2Css = (typography, isImportant)=>{
22
- const typographyCustom = typography?.custom;
23
- const { fontFamily, fontSize, fontWeight, lineHeight, letterSpacing } = typographyCustom ?? {};
24
- const typographyAttrs = typography?.attrs;
25
- const { bold, italic, underline, transform } = typographyAttrs ?? {};
26
- const composeImportant = isImportant ? '!important' : '';
27
- return `
28
- ${fontFamily ? `font-family: ${composeFontFamilyTypographyV2({
29
- fontFamily,
30
- type: typography?.type
31
- })} ${composeImportant}` : ''};
32
- ${fontSize?.desktop ? `font-size: ${fontSize?.desktop} ${composeImportant}` : ''};
33
- ${bold ? `font-weight: bold ${composeImportant}` : fontWeight ? `font-weight: ${fontWeight} ${composeImportant}` : ''};
34
- ${letterSpacing ? `letter-spacing: ${letterSpacing} ${composeImportant}` : ''};
35
- ${lineHeight?.desktop ? `line-height: ${lineHeight?.desktop} ${composeImportant}` : ''};
36
- ${italic ? `font-style: italic ${composeImportant}` : ''};
37
- ${underline ? `text-decoration-line: underline ${composeImportant}` : ''};
38
- ${transform ? `text-transform: ${transform} ${composeImportant}` : ''};
39
- `;
40
- };
41
- function getCustomCSSByDevice(typography, device) {
42
- if (!typography || !device) return {};
43
- const suffix = device === 'desktop' || !device ? '' : `-${device}`;
44
- const { fontFamily } = typography?.[device] ?? {};
45
- return {
46
- [`--size${suffix}`]: typography?.[device]?.fontSize,
47
- [`--lh${suffix}`]: typography?.[device]?.lineHeight,
48
- [`--fs${suffix}`]: typography?.[device]?.fontStyle,
49
- [`--ff${suffix}`]: composeFontFamilyTypographyV2({
50
- fontFamily
51
- }),
52
- [`--weight${suffix}`]: typography?.[device]?.fontWeight,
53
- [`--ls${suffix}`]: typography?.[device]?.letterSpacing
54
- };
55
- }
56
- const composeTypography = (typography)=>{
57
- if (!typography) return {};
58
- return removeNullUndefined({
59
- ...getCustomCSSByDevice(typography, 'desktop'),
60
- ...getCustomCSSByDevice(typography, 'tablet'),
61
- ...getCustomCSSByDevice(typography, 'mobile')
62
- });
63
- };
64
- const composeTypographyV2 = (value, attrs)=>{
65
- if (!value) return {};
66
- return removeNullUndefined({
67
- ...makeStyle({
68
- fs: !attrs?.italic ? value?.fontStyle : undefined,
69
- ff: composeFontFamilyTypographyV2(value),
70
- weight: !attrs?.bold ? value?.fontWeight : undefined,
71
- ls: value?.letterSpacing
72
- }),
73
- ...makeStyleResponsive('size', value?.fontSize),
74
- ...makeStyleResponsive('lh', value?.lineHeight)
75
- });
76
- };
77
- const composeFontFamilyTypographyV2 = (value)=>{
78
- const { fontFamily, isCustom, fallbackFontFamily, type } = value || {};
79
- if (!fontFamily) {
80
- return isCustom ? fallbackFontFamily : undefined;
81
- }
82
- if (typeof fontFamily === 'string') {
83
- return getFontUsedByTypographyV2({
84
- fontFamily,
85
- fallbackFontFamily: value?.fallbackFontFamily || composeFallbackTypographyStyle(type ?? 'heading')
86
- });
87
- }
88
- if (typeof fontFamily === 'object' && typeof fontFamily?.value === 'string') {
89
- switch(fontFamily.type){
90
- case 'theme':
91
- return `var(${fontFamily?.value}), var(--g-font-body)`;
92
- default:
93
- return getFontUsedByTypographyV2({
94
- fontFamily: fontFamily.value,
95
- fallbackFontFamily: value?.fallbackFontFamily || composeFallbackTypographyStyle(type ?? 'heading')
96
- });
97
- }
98
- }
99
- return;
100
- };
101
- const getFontUsedByTypographyV2 = ({ fontFamily, fallbackFontFamily })=>{
102
- if (fontFamily) {
103
- return `var(--g-font-${fontFamily?.replace(/ /g, '-')}, '${fontFamily}'), ${fallbackFontFamily}`;
104
- }
105
- return;
106
- };
107
- const composeTypographyAttr = (attrs)=>{
108
- if (!attrs) return {};
109
- return removeNullUndefined({
110
- ...makeStyle({
111
- fs: attrs?.italic ? 'italic' : undefined,
112
- weight: attrs?.bold ? 'bold' : undefined,
113
- c: getSingleColorVariable(attrs?.color),
114
- tt: attrs?.transform,
115
- tdl: attrs?.underline ? 'underline' : undefined
116
- })
117
- });
118
- };
119
- const composeTypographyClassName = (typo, typography)=>{
120
- return typo ? typo?.type && !isCustomTypo(typo.custom) ? genTypoClass(typo.type) : '' : typography?.type && genTypoClass(typography?.type);
121
- };
122
- const composeFallbackTypographyStyle = (tag)=>{
123
- if (tag.toLocaleLowerCase().includes('heading')) {
124
- return 'var(--g-font-heading, heading)';
125
- }
126
- return 'var(--g-font-body, body)';
127
- };
128
- const composeTypographyStyle = (typo, typography, disableAttr)=>{
129
- if (typo) {
130
- const fallbackFontFamily = composeFallbackTypographyStyle(typo.type ?? 'heading');
131
- const customTypo = {
132
- ...typo.custom,
133
- fallbackFontFamily: fallbackFontFamily,
134
- isCustom: isCustomTypo(typo.custom)
135
- };
136
- return {
137
- ...composeTypographyV2(customTypo, typo.attrs),
138
- ...!disableAttr && composeTypographyAttr(typo.attrs)
139
- };
140
- }
141
- return {
142
- ...!typography?.type ? composeTypography(typography?.custom) : {}
143
- };
144
- };
145
- const isCustomTypo = (customTypo)=>{
146
- return customTypo && Object.keys(customTypo).length > 1 || customTypo && Object.keys(customTypo).length === 1 && !customTypo.fontSize;
147
- };
148
-
149
- export { composeFallbackTypographyStyle, composeFontFamilyTypographyV2, composeTypography, composeTypographyAttr, composeTypographyClassName, composeTypographyCss, composeTypographyStyle, composeTypographyV2, composeTypographyV2Css, genTypoClass };
1
+ import{getSingleColorVariable as o}from"./colors.js";import{removeNullUndefined as e,makeStyle as t,makeStyleResponsive as p}from"./make-style.js";let genTypoClass=o=>`gp-g-${o}`,composeTypographyCss=o=>{let e=o?.custom,{fontFamily:t,fontSize:p,fontStyle:a,fontWeight:s,lineHeight:y,letterSpacing:l}=e?.desktop??{};return`
2
+ ${t?`fontFamily: ${composeFontFamilyTypographyV2({fontFamily:t})};`:""}
3
+ ${p?`font-size: ${p};`:""}
4
+ ${a?`font-style: ${a};`:""}
5
+ ${s?`font-weight: ${s};`:""}
6
+ ${l?`letter-spacing: ${l};`:""}
7
+ ${y?`line-height: ${y};`:""}
8
+ `},composeTypographyV2Css=(e,t)=>{let p=e?.custom,{fontFamily:a,fontSize:s,fontWeight:y,lineHeight:l,letterSpacing:r,textShadow:n}=p??{},i=e?.attrs,{bold:g,italic:c,underline:m,transform:h,color:$}=i??{},f=t?"!important":"";return`
9
+ ${a?`font-family: ${composeFontFamilyTypographyV2({fontFamily:a,type:e?.type})} ${f}`:""};
10
+ ${s?.desktop?`font-size: ${s?.desktop} ${f}`:""};
11
+ ${$?`color: ${o($)} ${f}`:""};
12
+ ${g?`font-weight: bold ${f}`:y?`font-weight: ${y} ${f}`:""};
13
+ ${r?`letter-spacing: ${r} ${f}`:""};
14
+ ${l?.desktop?`line-height: ${l?.desktop} ${f}`:""};
15
+ ${c?`font-style: italic ${f}`:""};
16
+ ${m?`text-decoration-line: underline ${f}`:""};
17
+ ${h?`text-transform: ${h} ${f}`:""};
18
+ ${n&&"none"!==n.type?`text-shadow: ${composeTextShadowCss(n)}`:"none"};
19
+ `},composeTextShadowCss=o=>{let e="number"==typeof o?.angle?o?.angle:0,t=e*Math.PI/180,p=parseFloat(o?.distance??"0");if(isNaN(p))return"none";let a=Math.round(Math.cos(t)*p*100)/100,s=Math.round(Math.sin(t)*p*100)/100;return`${a}px ${s}px ${o?.blur??"0"} ${o.color}`},composeTextHoverColorCss=(e,t)=>{if(e){let p=t?"!important":"",a=o(e.hover);return`${a?`color: ${a} ${p}`:""}`}};function getCustomCSSByDevice(o,e){if(!o||!e)return{};let t="desktop"!==e&&e?`-${e}`:"",{fontFamily:p}=o?.[e]??{};return{[`--size${t}`]:o?.[e]?.fontSize,[`--lh${t}`]:o?.[e]?.lineHeight,[`--fs${t}`]:o?.[e]?.fontStyle,[`--ff${t}`]:composeFontFamilyTypographyV2({fontFamily:p}),[`--weight${t}`]:o?.[e]?.fontWeight,[`--ls${t}`]:o?.[e]?.letterSpacing}}let composeTypography=o=>o?e({...getCustomCSSByDevice(o,"desktop"),...getCustomCSSByDevice(o,"tablet"),...getCustomCSSByDevice(o,"mobile")}):{},composeTypographyV2=(o,a)=>o?e({...t({fs:a?.italic?void 0:o?.fontStyle,ff:composeFontFamilyTypographyV2(o),weight:a?.bold?void 0:o?.fontWeight,ls:o?.letterSpacing}),...p("size",o?.fontSize),...p("lh",o?.lineHeight)}):{},composeFontFamilyTypographyV2=o=>{let{fontFamily:e,isCustom:t,fallbackFontFamily:p,type:a}=o||{};return e?"string"==typeof e?getFontUsedByTypographyV2({fontFamily:e,fallbackFontFamily:o?.fallbackFontFamily||composeFallbackTypographyStyle(a??"heading")}):"object"==typeof e&&"string"==typeof e?.value?"theme"===e.type?`var(${e?.value}), var(--g-font-body)`:getFontUsedByTypographyV2({fontFamily:e.value,fallbackFontFamily:o?.fallbackFontFamily||composeFallbackTypographyStyle(a??"heading")}):void 0:t?p:void 0},getFontUsedByTypographyV2=({fontFamily:o,fallbackFontFamily:e})=>{if(o)return`var(--g-font-${o?.replace(/ /g,"-")}, '${o}'), ${e}`},composeTypographyAttr=p=>p?e({...t({fs:p?.italic?"italic":void 0,weight:p?.bold?"bold":void 0,c:o(p?.color),tt:p?.transform,tdl:p?.underline?"underline":void 0})}):{},composeTypographyClassName=(o,e)=>o?o?.type&&!isCustomTypo(o.custom)?genTypoClass(o.type):"":e?.type&&genTypoClass(e?.type),composeFallbackTypographyStyle=o=>o.toLocaleLowerCase().includes("heading")?"var(--g-font-heading, heading)":"var(--g-font-body, body)",composeTypographyStyle=(o,e,t)=>{if(o){let e=composeFallbackTypographyStyle(o.type??"heading"),p={...o.custom,fallbackFontFamily:e,isCustom:isCustomTypo(o.custom)};return{...composeTypographyV2(p,o.attrs),...!t&&composeTypographyAttr(o.attrs)}}return{...e?.type?{}:composeTypography(e?.custom)}},isCustomTypo=o=>o&&Object.keys(o).length>1||o&&1===Object.keys(o).length&&!o.fontSize;export{composeFallbackTypographyStyle,composeFontFamilyTypographyV2,composeTextHoverColorCss,composeTypography,composeTypographyAttr,composeTypographyClassName,composeTypographyCss,composeTypographyStyle,composeTypographyV2,composeTypographyV2Css,genTypoClass};
@@ -1,9 +1 @@
1
- function checkInStock(variant, product) {
2
- if (!variant) return false;
3
- return variant?.inventoryQuantity && variant.inventoryQuantity > 0 && !isDefaultVariant(variant, product) || !variant?.manageInventory || variant.inventoryPolicy === 'CONTINUE';
4
- }
5
- function isDefaultVariant(variant, product) {
6
- return Boolean(variant?.title === 'Default Title' && product?.options?.some((option)=>option.values.length > 1));
7
- }
8
-
9
- export { checkInStock };
1
+ function checkInStock(t,n){return!!t&&(t?.inventoryQuantity&&t.inventoryQuantity>0&&!isDefaultVariant(t,n)||!t?.manageInventory||"CONTINUE"===t.inventoryPolicy)}function isDefaultVariant(t,n){return!!(t?.title==="Default Title"&&n?.options?.some(t=>t.values.length>1))}export{checkInStock};