@shopify/hydrogen 0.22.0 → 0.24.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 (491) hide show
  1. package/CHANGELOG.md +240 -0
  2. package/dist/esnext/components/AddToCartButton/AddToCartButton.client.js +5 -5
  3. package/dist/esnext/components/CartLinePrice/CartLinePrice.client.js +5 -8
  4. package/dist/esnext/components/CartLineProvider/context.d.ts +12 -2
  5. package/dist/esnext/components/CartLines/{CartLines.d.ts → CartLines.client.d.ts} +0 -0
  6. package/dist/esnext/components/CartLines/{CartLines.js → CartLines.client.js} +0 -0
  7. package/dist/esnext/components/CartLines/index.d.ts +1 -1
  8. package/dist/esnext/components/CartLines/index.js +1 -1
  9. package/dist/esnext/components/CartProvider/CartProvider.client.js +2 -5
  10. package/dist/esnext/components/CartProvider/cart-queries.d.ts +1 -1
  11. package/dist/esnext/components/CartProvider/cart-queries.js +11 -0
  12. package/dist/esnext/components/CartProvider/graphql/CartAttributesUpdateMutation.d.ts +11 -1
  13. package/dist/esnext/components/CartProvider/graphql/CartBuyerIdentityUpdateMutation.d.ts +11 -1
  14. package/dist/esnext/components/CartProvider/graphql/CartCreateMutation.d.ts +11 -1
  15. package/dist/esnext/components/CartProvider/graphql/CartDiscountCodesUpdateMutation.d.ts +11 -1
  16. package/dist/esnext/components/CartProvider/graphql/CartFragment.d.ts +11 -1
  17. package/dist/esnext/components/CartProvider/graphql/CartLineAddMutation.d.ts +11 -1
  18. package/dist/esnext/components/CartProvider/graphql/CartLineRemoveMutation.d.ts +11 -1
  19. package/dist/esnext/components/CartProvider/graphql/CartLineUpdateMutation.d.ts +11 -1
  20. package/dist/esnext/components/CartProvider/graphql/CartNoteUpdateMutation.d.ts +11 -1
  21. package/dist/esnext/components/CartProvider/graphql/CartQuery.d.ts +11 -1
  22. package/dist/esnext/components/CartProvider/hooks.client.js +3 -5
  23. package/dist/esnext/components/CartProvider/types.d.ts +2 -0
  24. package/dist/esnext/components/DevTools.client.js +1 -1
  25. package/dist/esnext/components/Image/Image.d.ts +8 -0
  26. package/dist/esnext/components/Image/Image.js +58 -10
  27. package/dist/esnext/components/Link/Link.client.d.ts +2 -0
  28. package/dist/esnext/components/Link/Link.client.js +7 -4
  29. package/dist/esnext/components/LocalizationProvider/LocalizationProvider.server.js +1 -1
  30. package/dist/esnext/components/ProductOptionsProvider/ProductOptionsProvider.client.d.ts +21 -0
  31. package/dist/esnext/components/ProductOptionsProvider/ProductOptionsProvider.client.js +141 -0
  32. package/dist/esnext/components/ProductOptionsProvider/context.d.ts +2 -0
  33. package/dist/esnext/components/{ProductProvider → ProductOptionsProvider}/context.js +0 -1
  34. package/dist/esnext/components/ProductOptionsProvider/index.d.ts +2 -0
  35. package/dist/esnext/components/ProductOptionsProvider/index.js +2 -0
  36. package/dist/esnext/components/ProductPrice/ProductPrice.client.d.ts +5 -2
  37. package/dist/esnext/components/ProductPrice/ProductPrice.client.js +10 -12
  38. package/dist/esnext/components/index.d.ts +1 -1
  39. package/dist/esnext/components/index.js +1 -1
  40. package/dist/esnext/entry-client.js +106 -6
  41. package/dist/esnext/entry-server.d.ts +2 -15
  42. package/dist/esnext/entry-server.js +246 -322
  43. package/dist/esnext/foundation/Analytics/Analytics.client.js +15 -13
  44. package/dist/esnext/foundation/Analytics/Analytics.server.js +27 -20
  45. package/dist/esnext/foundation/Analytics/ClientAnalytics.d.ts +4 -2
  46. package/dist/esnext/foundation/Analytics/ClientAnalytics.js +16 -14
  47. package/dist/esnext/foundation/Analytics/ServerAnalyticsRoute.server.js +7 -5
  48. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/ServerAnalyticsConnector.server.d.ts +1 -0
  49. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/{PerformanceMetrics.server.js → ServerAnalyticsConnector.server.js} +7 -6
  50. package/dist/esnext/foundation/Analytics/connectors/Shopify/ServerAnalyticsConnector.server.d.ts +1 -0
  51. package/dist/esnext/foundation/Analytics/connectors/Shopify/ServerAnalyticsConnector.server.js +19 -0
  52. package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.client.d.ts +3 -0
  53. package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.client.js +190 -0
  54. package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.server.d.ts +3 -0
  55. package/dist/esnext/foundation/Analytics/connectors/Shopify/ShopifyAnalytics.server.js +24 -0
  56. package/dist/esnext/foundation/Analytics/connectors/Shopify/const.d.ts +28 -0
  57. package/dist/esnext/foundation/Analytics/connectors/Shopify/const.js +51 -0
  58. package/dist/esnext/foundation/Analytics/connectors/Shopify/utils.d.ts +3 -0
  59. package/dist/esnext/foundation/Analytics/connectors/Shopify/utils.js +56 -0
  60. package/dist/esnext/foundation/Analytics/hook.js +4 -2
  61. package/dist/esnext/foundation/Analytics/utils.d.ts +2 -0
  62. package/dist/esnext/foundation/Analytics/utils.js +21 -0
  63. package/dist/{node/framework → esnext/foundation/Cache}/cache-sub-request.d.ts +1 -1
  64. package/dist/esnext/{framework → foundation/Cache}/cache-sub-request.js +3 -3
  65. package/dist/esnext/{framework → foundation/Cache}/cache.d.ts +1 -1
  66. package/dist/esnext/{framework → foundation/Cache}/cache.js +3 -3
  67. package/dist/{node/framework/CachingStrategy → esnext/foundation/Cache/strategies}/index.d.ts +2 -1
  68. package/dist/esnext/{framework/CachingStrategy → foundation/Cache/strategies}/index.js +1 -1
  69. package/dist/esnext/foundation/Cookie/Cookie.d.ts +3 -3
  70. package/dist/{node/framework/Hydration → esnext/foundation/Html}/Html.d.ts +3 -1
  71. package/dist/esnext/{framework/Hydration → foundation/Html}/Html.js +15 -2
  72. package/dist/{node/framework/Hydration/ServerComponentRequest.server.d.ts → esnext/foundation/HydrogenRequest/HydrogenRequest.server.d.ts} +8 -3
  73. package/dist/esnext/{framework/Hydration/ServerComponentRequest.server.js → foundation/HydrogenRequest/HydrogenRequest.server.js} +3 -2
  74. package/dist/{node/framework/Hydration/ServerComponentResponse.server.d.ts → esnext/foundation/HydrogenResponse/HydrogenResponse.server.d.ts} +7 -10
  75. package/dist/esnext/{framework/Hydration/ServerComponentResponse.server.js → foundation/HydrogenResponse/HydrogenResponse.server.js} +19 -15
  76. package/dist/esnext/foundation/Router/BrowserRouter.client.js +16 -9
  77. package/dist/esnext/foundation/ServerPropsProvider/ServerPropsProvider.d.ts +2 -1
  78. package/dist/esnext/foundation/ServerPropsProvider/ServerPropsProvider.js +1 -1
  79. package/dist/esnext/foundation/ServerRequestProvider/ServerRequestProvider.d.ts +5 -6
  80. package/dist/esnext/foundation/ServerRequestProvider/ServerRequestProvider.js +18 -21
  81. package/dist/esnext/foundation/ServerStateProvider/ServerStateProvider.d.ts +1 -1
  82. package/dist/esnext/foundation/ServerStateProvider/ServerStateProvider.js +1 -1
  83. package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.server.js +1 -0
  84. package/dist/esnext/foundation/index.d.ts +1 -1
  85. package/dist/esnext/foundation/index.js +1 -1
  86. package/dist/esnext/foundation/runtime.d.ts +2 -0
  87. package/dist/esnext/foundation/runtime.js +6 -0
  88. package/dist/esnext/foundation/session/session.d.ts +3 -3
  89. package/dist/esnext/foundation/ssr-interop.d.ts +2 -2
  90. package/dist/esnext/foundation/useNavigate/useNavigate.d.ts +2 -0
  91. package/dist/esnext/foundation/useNavigate/useNavigate.js +11 -4
  92. package/dist/esnext/foundation/useQuery/hooks.d.ts +1 -0
  93. package/dist/esnext/foundation/useQuery/hooks.js +24 -7
  94. package/dist/esnext/foundation/useRequestContext/index.d.ts +15 -0
  95. package/dist/esnext/foundation/useRequestContext/index.js +23 -0
  96. package/dist/esnext/framework/Hydration/rsc.js +2 -0
  97. package/dist/esnext/framework/plugin.js +2 -0
  98. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-config.js +5 -2
  99. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-middleware.js +1 -1
  100. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-rsc.js +4 -12
  101. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-suppress-warnings.d.ts +3 -0
  102. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-suppress-warnings.js +19 -0
  103. package/dist/esnext/hooks/useCartLine/useCartLine.d.ts +12 -2
  104. package/dist/esnext/hooks/useParsedMetafields/useParsedMetafields.d.ts +2 -2
  105. package/dist/esnext/hooks/useProductOptions/types.d.ts +17 -15
  106. package/dist/esnext/hooks/useProductOptions/useProductOptions.client.d.ts +1 -15
  107. package/dist/esnext/hooks/useProductOptions/useProductOptions.client.js +8 -107
  108. package/dist/esnext/hooks/useShopQuery/hooks.js +12 -6
  109. package/dist/esnext/index.d.ts +9 -3
  110. package/dist/esnext/index.js +7 -3
  111. package/dist/esnext/storefront-api-types.d.ts +10 -339
  112. package/dist/esnext/streaming.server.d.ts +0 -1
  113. package/dist/esnext/streaming.server.js +0 -4
  114. package/dist/esnext/types.d.ts +32 -23
  115. package/dist/esnext/utilities/apiRoutes.d.ts +2 -2
  116. package/dist/esnext/utilities/graphql-tracker.js +1 -1
  117. package/dist/esnext/utilities/index.d.ts +1 -1
  118. package/dist/esnext/utilities/index.js +1 -1
  119. package/dist/esnext/utilities/isBrowser/index.d.ts +1 -0
  120. package/dist/esnext/utilities/isBrowser/index.js +1 -0
  121. package/dist/esnext/utilities/isBrowser/isBrowser.d.ts +4 -0
  122. package/dist/esnext/utilities/isBrowser/isBrowser.js +6 -0
  123. package/dist/esnext/utilities/isServer/isServer.js +2 -2
  124. package/dist/esnext/utilities/log/index.d.ts +1 -1
  125. package/dist/esnext/utilities/log/index.js +1 -1
  126. package/dist/esnext/utilities/log/log-cache-header.d.ts +4 -4
  127. package/dist/esnext/utilities/log/log-query-timeline.d.ts +3 -3
  128. package/dist/esnext/utilities/log/log.d.ts +17 -11
  129. package/dist/esnext/utilities/log/log.js +29 -20
  130. package/dist/esnext/version.d.ts +1 -1
  131. package/dist/esnext/version.js +1 -1
  132. package/dist/node/client.d.ts +16 -0
  133. package/dist/node/client.js +43 -0
  134. package/dist/node/components/AddToCartButton/AddToCartButton.client.d.ts +23 -0
  135. package/dist/node/components/AddToCartButton/AddToCartButton.client.js +74 -0
  136. package/dist/node/components/AddToCartButton/index.d.ts +1 -0
  137. package/dist/node/components/AddToCartButton/index.js +5 -0
  138. package/dist/node/components/BuyNowButton/BuyNowButton.client.d.ts +18 -0
  139. package/dist/node/components/BuyNowButton/BuyNowButton.client.js +53 -0
  140. package/dist/node/components/BuyNowButton/index.d.ts +1 -0
  141. package/dist/node/components/BuyNowButton/index.js +5 -0
  142. package/dist/node/components/CartCheckoutButton/CartCheckoutButton.client.d.ts +11 -0
  143. package/dist/node/components/CartCheckoutButton/CartCheckoutButton.client.js +44 -0
  144. package/dist/node/components/CartCheckoutButton/index.d.ts +1 -0
  145. package/dist/node/components/CartCheckoutButton/index.js +5 -0
  146. package/dist/node/components/CartEstimatedCost/CartEstimatedCost.client.d.ts +14 -0
  147. package/dist/node/components/CartEstimatedCost/CartEstimatedCost.client.js +36 -0
  148. package/dist/node/components/CartEstimatedCost/index.d.ts +1 -0
  149. package/dist/node/components/CartEstimatedCost/index.js +5 -0
  150. package/dist/node/components/CartLineImage/CartLineImage.client.d.ts +9 -0
  151. package/dist/node/components/CartLineImage/CartLineImage.client.js +18 -0
  152. package/dist/node/components/CartLineImage/index.d.ts +1 -0
  153. package/dist/node/components/CartLineImage/index.js +5 -0
  154. package/dist/node/components/CartLinePrice/CartLinePrice.client.d.ts +12 -0
  155. package/dist/node/components/CartLinePrice/CartLinePrice.client.js +25 -0
  156. package/dist/node/components/CartLinePrice/index.d.ts +1 -0
  157. package/dist/node/components/CartLinePrice/index.js +5 -0
  158. package/dist/node/components/CartLineProductTitle/CartLineProductTitle.client.d.ts +8 -0
  159. package/dist/node/components/CartLineProductTitle/CartLineProductTitle.client.js +19 -0
  160. package/dist/node/components/CartLineProductTitle/index.d.ts +1 -0
  161. package/dist/node/components/CartLineProductTitle/index.js +5 -0
  162. package/dist/node/components/CartLineProvider/CartLineProvider.client.d.ts +11 -0
  163. package/dist/node/components/CartLineProvider/CartLineProvider.client.js +15 -0
  164. package/dist/node/components/CartLineProvider/context.d.ts +36 -0
  165. package/dist/node/components/CartLineProvider/context.js +5 -0
  166. package/dist/node/components/CartLineProvider/index.d.ts +2 -0
  167. package/dist/node/components/CartLineProvider/index.js +7 -0
  168. package/dist/node/components/CartLineQuantity/CartLineQuantity.client.d.ts +8 -0
  169. package/dist/node/components/CartLineQuantity/CartLineQuantity.client.js +19 -0
  170. package/dist/node/components/CartLineQuantity/index.d.ts +1 -0
  171. package/dist/node/components/CartLineQuantity/index.js +5 -0
  172. package/dist/node/components/CartLineQuantityAdjustButton/CartLineQuantityAdjustButton.d.ts +14 -0
  173. package/dist/node/components/CartLineQuantityAdjustButton/CartLineQuantityAdjustButton.js +31 -0
  174. package/dist/node/components/CartLineQuantityAdjustButton/index.d.ts +1 -0
  175. package/dist/node/components/CartLineQuantityAdjustButton/index.js +5 -0
  176. package/dist/node/components/CartLines/CartLines.client.d.ts +15 -0
  177. package/dist/node/components/CartLines/CartLines.client.js +44 -0
  178. package/dist/node/components/CartLines/index.d.ts +1 -0
  179. package/dist/node/components/CartLines/index.js +5 -0
  180. package/dist/node/components/CartProvider/CartProvider.client.d.ts +41 -0
  181. package/dist/node/components/CartProvider/CartProvider.client.js +547 -0
  182. package/dist/node/components/CartProvider/cart-queries.d.ts +10 -0
  183. package/dist/node/components/CartProvider/cart-queries.js +214 -0
  184. package/dist/node/components/CartProvider/constants.d.ts +2 -0
  185. package/dist/node/components/CartProvider/constants.js +5 -0
  186. package/dist/node/components/CartProvider/context.d.ts +2 -0
  187. package/dist/node/components/CartProvider/context.js +5 -0
  188. package/dist/node/components/CartProvider/graphql/CartAttributesUpdateMutation.d.ts +96 -0
  189. package/dist/node/components/CartProvider/graphql/CartAttributesUpdateMutation.js +2 -0
  190. package/dist/node/components/CartProvider/graphql/CartBuyerIdentityUpdateMutation.d.ts +96 -0
  191. package/dist/node/components/CartProvider/graphql/CartBuyerIdentityUpdateMutation.js +2 -0
  192. package/dist/node/components/CartProvider/graphql/CartCreateMutation.d.ts +95 -0
  193. package/dist/node/components/CartProvider/graphql/CartCreateMutation.js +2 -0
  194. package/dist/node/components/CartProvider/graphql/CartDiscountCodesUpdateMutation.d.ts +96 -0
  195. package/dist/node/components/CartProvider/graphql/CartDiscountCodesUpdateMutation.js +2 -0
  196. package/dist/node/components/CartProvider/graphql/CartFragment.d.ts +82 -0
  197. package/dist/node/components/CartProvider/graphql/CartFragment.js +2 -0
  198. package/dist/node/components/CartProvider/graphql/CartLineAddMutation.d.ts +96 -0
  199. package/dist/node/components/CartProvider/graphql/CartLineAddMutation.js +2 -0
  200. package/dist/node/components/CartProvider/graphql/CartLineRemoveMutation.d.ts +96 -0
  201. package/dist/node/components/CartProvider/graphql/CartLineRemoveMutation.js +2 -0
  202. package/dist/node/components/CartProvider/graphql/CartLineUpdateMutation.d.ts +96 -0
  203. package/dist/node/components/CartProvider/graphql/CartLineUpdateMutation.js +2 -0
  204. package/dist/node/components/CartProvider/graphql/CartNoteUpdateMutation.d.ts +96 -0
  205. package/dist/node/components/CartProvider/graphql/CartNoteUpdateMutation.js +2 -0
  206. package/dist/node/components/CartProvider/graphql/CartQuery.d.ts +91 -0
  207. package/dist/node/components/CartProvider/graphql/CartQuery.js +2 -0
  208. package/dist/node/components/CartProvider/hooks.client.d.ts +15 -0
  209. package/dist/node/components/CartProvider/hooks.client.js +88 -0
  210. package/dist/node/components/CartProvider/index.d.ts +4 -0
  211. package/dist/node/components/CartProvider/index.js +10 -0
  212. package/dist/node/components/CartProvider/types.d.ts +104 -0
  213. package/dist/node/components/CartProvider/types.js +2 -0
  214. package/dist/node/components/CartShopPayButton/CartShopPayButton.client.d.ts +9 -0
  215. package/dist/node/components/CartShopPayButton/CartShopPayButton.client.js +46 -0
  216. package/dist/node/components/CartShopPayButton/index.d.ts +1 -0
  217. package/dist/node/components/CartShopPayButton/index.js +5 -0
  218. package/dist/node/components/ExternalVideo/ExternalVideo.d.ts +21 -0
  219. package/dist/node/components/ExternalVideo/ExternalVideo.js +21 -0
  220. package/dist/node/components/ExternalVideo/index.d.ts +1 -0
  221. package/dist/node/components/ExternalVideo/index.js +5 -0
  222. package/dist/node/components/Image/Image.d.ts +8 -0
  223. package/dist/node/components/Image/Image.js +57 -9
  224. package/dist/node/components/Link/Link.client.d.ts +25 -0
  225. package/dist/node/components/Link/Link.client.js +165 -0
  226. package/dist/node/components/Link/index.d.ts +1 -0
  227. package/dist/node/components/Link/index.js +5 -0
  228. package/dist/node/components/LocalizationProvider/LocalizationClientProvider.client.d.ts +6 -0
  229. package/dist/node/components/LocalizationProvider/LocalizationClientProvider.client.js +11 -0
  230. package/dist/node/components/LocalizationProvider/LocalizationContext.client.d.ts +6 -0
  231. package/dist/node/components/LocalizationProvider/LocalizationContext.client.js +5 -0
  232. package/dist/node/components/LocalizationProvider/LocalizationProvider.server.d.ts +33 -0
  233. package/dist/node/components/LocalizationProvider/LocalizationProvider.server.js +51 -0
  234. package/dist/node/components/MediaFile/MediaFile.d.ts +19 -0
  235. package/dist/node/components/MediaFile/MediaFile.js +39 -0
  236. package/dist/node/components/MediaFile/index.d.ts +1 -0
  237. package/dist/node/components/MediaFile/index.js +5 -0
  238. package/dist/node/components/Metafield/Metafield.client.d.ts +21 -0
  239. package/dist/node/components/Metafield/Metafield.client.js +75 -0
  240. package/dist/node/components/Metafield/index.d.ts +2 -0
  241. package/dist/node/components/Metafield/index.js +5 -0
  242. package/dist/node/components/Metafield/types.d.ts +4 -0
  243. package/dist/node/components/Metafield/types.js +2 -0
  244. package/dist/node/components/ModelViewer/ModelViewer.client.d.ts +128 -0
  245. package/dist/node/components/ModelViewer/ModelViewer.client.js +132 -0
  246. package/dist/node/components/ModelViewer/index.d.ts +1 -0
  247. package/dist/node/components/ModelViewer/index.js +5 -0
  248. package/dist/node/components/Money/Money.client.d.ts +25 -0
  249. package/dist/node/components/Money/Money.client.js +46 -0
  250. package/dist/node/components/Money/index.d.ts +1 -0
  251. package/dist/node/components/Money/index.js +5 -0
  252. package/dist/node/components/ProductOptionsProvider/ProductOptionsProvider.client.d.ts +21 -0
  253. package/dist/node/components/ProductOptionsProvider/ProductOptionsProvider.client.js +168 -0
  254. package/dist/node/components/ProductOptionsProvider/context.d.ts +2 -0
  255. package/dist/node/components/ProductOptionsProvider/context.js +5 -0
  256. package/dist/node/components/ProductOptionsProvider/index.d.ts +2 -0
  257. package/dist/node/components/ProductOptionsProvider/index.js +7 -0
  258. package/dist/node/components/ProductPrice/ProductPrice.client.d.ts +18 -0
  259. package/dist/node/components/ProductPrice/ProductPrice.client.js +61 -0
  260. package/dist/node/components/ProductPrice/index.d.ts +1 -0
  261. package/dist/node/components/ProductPrice/index.js +5 -0
  262. package/dist/node/components/Seo/CollectionSeo.client.d.ts +3 -0
  263. package/dist/node/components/Seo/CollectionSeo.client.js +22 -0
  264. package/dist/node/components/Seo/DefaultPageSeo.client.d.ts +3 -0
  265. package/dist/node/components/Seo/DefaultPageSeo.client.js +25 -0
  266. package/dist/node/components/Seo/DescriptionSeo.client.d.ts +4 -0
  267. package/dist/node/components/Seo/DescriptionSeo.client.js +17 -0
  268. package/dist/node/components/Seo/HomePageSeo.client.d.ts +2 -0
  269. package/dist/node/components/Seo/HomePageSeo.client.js +32 -0
  270. package/dist/node/components/Seo/ImageSeo.client.d.ts +3 -0
  271. package/dist/node/components/Seo/ImageSeo.client.js +17 -0
  272. package/dist/node/components/Seo/NoIndexSeo.client.d.ts +3 -0
  273. package/dist/node/components/Seo/NoIndexSeo.client.js +17 -0
  274. package/dist/node/components/Seo/PageSeo.client.d.ts +3 -0
  275. package/dist/node/components/Seo/PageSeo.client.js +20 -0
  276. package/dist/node/components/Seo/ProductSeo.client.d.ts +5 -0
  277. package/dist/node/components/Seo/ProductSeo.client.js +70 -0
  278. package/dist/node/components/Seo/Seo.client.d.ts +30 -0
  279. package/dist/node/components/Seo/Seo.client.js +38 -0
  280. package/dist/node/components/Seo/TitleSeo.client.d.ts +3 -0
  281. package/dist/node/components/Seo/TitleSeo.client.js +17 -0
  282. package/dist/node/components/Seo/TwitterSeo.client.d.ts +2 -0
  283. package/dist/node/components/Seo/TwitterSeo.client.js +16 -0
  284. package/dist/node/components/Seo/index.d.ts +1 -0
  285. package/dist/node/components/Seo/index.js +5 -0
  286. package/dist/node/components/Seo/seo-types.d.ts +17 -0
  287. package/dist/node/components/Seo/seo-types.js +2 -0
  288. package/dist/node/components/ShopPayButton/ShopPayButton.client.d.ts +38 -0
  289. package/dist/node/components/ShopPayButton/ShopPayButton.client.js +60 -0
  290. package/dist/node/components/ShopPayButton/index.d.ts +1 -0
  291. package/dist/node/components/ShopPayButton/index.js +5 -0
  292. package/dist/node/components/Video/Video.d.ts +14 -0
  293. package/dist/node/components/Video/Video.js +31 -0
  294. package/dist/node/components/Video/index.d.ts +1 -0
  295. package/dist/node/components/Video/index.js +5 -0
  296. package/dist/node/components/index.d.ts +28 -0
  297. package/dist/node/components/index.js +59 -0
  298. package/dist/node/components/types.d.ts +71 -0
  299. package/dist/node/components/types.js +11 -0
  300. package/dist/node/entry-server.d.ts +2 -15
  301. package/dist/node/entry-server.js +245 -321
  302. package/dist/node/foundation/Analytics/Analytics.client.js +15 -13
  303. package/dist/node/foundation/Analytics/Analytics.server.js +27 -20
  304. package/dist/node/foundation/Analytics/ClientAnalytics.d.ts +4 -2
  305. package/dist/node/foundation/Analytics/ClientAnalytics.js +15 -13
  306. package/dist/node/foundation/Analytics/ServerAnalyticsRoute.server.js +7 -5
  307. package/dist/node/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetrics.client.d.ts +7 -0
  308. package/dist/node/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetrics.client.js +68 -0
  309. package/dist/node/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetricsDebug.client.d.ts +1 -0
  310. package/dist/node/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetricsDebug.client.js +27 -0
  311. package/dist/node/foundation/Analytics/hook.js +4 -2
  312. package/dist/node/foundation/Analytics/index.d.ts +1 -0
  313. package/dist/node/foundation/Analytics/index.js +5 -0
  314. package/dist/node/foundation/Analytics/utils.d.ts +2 -0
  315. package/dist/node/foundation/Analytics/utils.js +24 -1
  316. package/dist/{esnext/framework → node/foundation/Cache}/cache-sub-request.d.ts +1 -1
  317. package/dist/node/{framework → foundation/Cache}/cache-sub-request.js +4 -4
  318. package/dist/node/{framework → foundation/Cache}/cache.d.ts +1 -1
  319. package/dist/node/{framework → foundation/Cache}/cache.js +5 -5
  320. package/dist/{esnext/framework/CachingStrategy → node/foundation/Cache/strategies}/index.d.ts +2 -1
  321. package/dist/node/{framework/CachingStrategy → foundation/Cache/strategies}/index.js +3 -3
  322. package/dist/node/foundation/Head/Head.client.d.ts +5 -0
  323. package/dist/node/foundation/Head/Head.client.js +17 -0
  324. package/dist/node/foundation/Head/index.d.ts +1 -0
  325. package/dist/node/foundation/Head/index.js +5 -0
  326. package/dist/{esnext/framework/Hydration → node/foundation/Html}/Html.d.ts +3 -1
  327. package/dist/node/{framework/Hydration → foundation/Html}/Html.js +15 -2
  328. package/dist/{esnext/framework/Hydration/ServerComponentRequest.server.d.ts → node/foundation/HydrogenRequest/HydrogenRequest.server.d.ts} +8 -3
  329. package/dist/node/{framework/Hydration/ServerComponentRequest.server.js → foundation/HydrogenRequest/HydrogenRequest.server.js} +5 -4
  330. package/dist/{esnext/framework/Hydration/ServerComponentResponse.server.d.ts → node/foundation/HydrogenResponse/HydrogenResponse.server.d.ts} +7 -10
  331. package/dist/node/{framework/Hydration/ServerComponentResponse.server.js → foundation/HydrogenResponse/HydrogenResponse.server.js} +23 -19
  332. package/dist/node/foundation/Router/BrowserRouter.client.js +16 -9
  333. package/dist/node/foundation/ServerPropsProvider/ServerPropsProvider.d.ts +2 -1
  334. package/dist/node/foundation/ServerPropsProvider/ServerPropsProvider.js +1 -1
  335. package/dist/node/foundation/ServerRequestProvider/ServerRequestProvider.d.ts +5 -6
  336. package/dist/node/foundation/ServerRequestProvider/ServerRequestProvider.js +18 -21
  337. package/dist/node/foundation/ShopifyProvider/ShopifyProvider.client.d.ts +7 -0
  338. package/dist/node/foundation/ShopifyProvider/ShopifyProvider.client.js +35 -0
  339. package/dist/node/foundation/ShopifyProvider/index.d.ts +1 -0
  340. package/dist/node/foundation/ShopifyProvider/index.js +5 -0
  341. package/dist/node/foundation/fetchSync/client/fetchSync.d.ts +10 -0
  342. package/dist/node/foundation/fetchSync/client/fetchSync.js +33 -0
  343. package/dist/node/foundation/fetchSync/server/fetchSync.d.ts +8 -0
  344. package/dist/node/foundation/fetchSync/server/fetchSync.js +33 -0
  345. package/dist/node/foundation/fetchSync/types.d.ts +5 -0
  346. package/dist/node/foundation/fetchSync/types.js +2 -0
  347. package/dist/node/foundation/index.d.ts +3 -0
  348. package/dist/node/foundation/index.js +10 -0
  349. package/dist/node/foundation/runtime.d.ts +2 -0
  350. package/dist/node/foundation/runtime.js +11 -0
  351. package/dist/node/foundation/session/session.d.ts +3 -3
  352. package/dist/node/foundation/ssr-interop.d.ts +2 -2
  353. package/dist/node/foundation/useNavigate/useNavigate.d.ts +2 -0
  354. package/dist/node/foundation/useNavigate/useNavigate.js +11 -4
  355. package/dist/node/foundation/useQuery/hooks.d.ts +37 -0
  356. package/dist/node/foundation/useQuery/hooks.js +119 -0
  357. package/dist/node/foundation/useRouteParams/RouteParamsProvider.client.d.ts +10 -0
  358. package/dist/node/foundation/useRouteParams/RouteParamsProvider.client.js +34 -0
  359. package/dist/node/foundation/useRouteParams/useRouteParams.d.ts +4 -0
  360. package/dist/node/foundation/useRouteParams/useRouteParams.js +13 -0
  361. package/dist/node/foundation/useServerProps/index.d.ts +1 -0
  362. package/dist/node/foundation/useServerProps/index.js +5 -0
  363. package/dist/node/foundation/useSession/useSession.d.ts +2 -0
  364. package/dist/node/foundation/useSession/useSession.js +12 -0
  365. package/dist/node/foundation/useShop/index.d.ts +1 -0
  366. package/dist/node/foundation/useShop/index.js +5 -0
  367. package/dist/node/foundation/useShop/use-shop.d.ts +6 -0
  368. package/dist/node/foundation/useShop/use-shop.js +18 -0
  369. package/dist/node/foundation/useUrl/index.d.ts +1 -0
  370. package/dist/node/foundation/useUrl/index.js +5 -0
  371. package/dist/node/foundation/useUrl/useUrl.d.ts +4 -0
  372. package/dist/node/foundation/useUrl/useUrl.js +32 -0
  373. package/dist/node/framework/Hydration/rsc.js +2 -0
  374. package/dist/node/framework/plugin.js +2 -0
  375. package/dist/node/framework/plugins/vite-plugin-hydrogen-config.js +5 -2
  376. package/dist/node/framework/plugins/vite-plugin-hydrogen-middleware.js +1 -1
  377. package/dist/node/framework/plugins/vite-plugin-hydrogen-rsc.js +4 -12
  378. package/dist/node/framework/plugins/vite-plugin-hydrogen-suppress-warnings.d.ts +3 -0
  379. package/dist/node/framework/plugins/vite-plugin-hydrogen-suppress-warnings.js +21 -0
  380. package/dist/node/hooks/index.d.ts +6 -0
  381. package/dist/node/hooks/index.js +28 -0
  382. package/dist/node/hooks/useCart/index.d.ts +1 -0
  383. package/dist/node/hooks/useCart/index.js +5 -0
  384. package/dist/node/hooks/useCart/useCart.d.ts +4 -0
  385. package/dist/node/hooks/useCart/useCart.js +19 -0
  386. package/dist/node/hooks/useCartLine/index.d.ts +1 -0
  387. package/dist/node/hooks/useCartLine/index.js +5 -0
  388. package/dist/node/hooks/useCartLine/useCartLine.d.ts +39 -0
  389. package/dist/node/hooks/useCartLine/useCartLine.js +16 -0
  390. package/dist/node/hooks/useCountry/index.d.ts +1 -0
  391. package/dist/node/hooks/useCountry/index.js +5 -0
  392. package/dist/node/hooks/useCountry/useCountry.d.ts +7 -0
  393. package/dist/node/hooks/useCountry/useCountry.js +21 -0
  394. package/dist/node/hooks/useLoadScript/index.d.ts +1 -0
  395. package/dist/node/hooks/useLoadScript/index.js +5 -0
  396. package/dist/node/hooks/useLoadScript/useLoadScript.client.d.ts +8 -0
  397. package/dist/node/hooks/useLoadScript/useLoadScript.client.js +27 -0
  398. package/dist/node/hooks/useMeasurement/hooks.d.ts +9 -0
  399. package/dist/node/hooks/useMeasurement/hooks.js +17 -0
  400. package/dist/node/hooks/useMeasurement/index.d.ts +1 -0
  401. package/dist/node/hooks/useMeasurement/index.js +5 -0
  402. package/dist/node/hooks/useMoney/hooks.d.ts +54 -0
  403. package/dist/node/hooks/useMoney/hooks.js +70 -0
  404. package/dist/node/hooks/useMoney/index.d.ts +1 -0
  405. package/dist/node/hooks/useMoney/index.js +5 -0
  406. package/dist/node/hooks/useParsedMetafields/index.d.ts +1 -0
  407. package/dist/node/hooks/useParsedMetafields/index.js +5 -0
  408. package/dist/node/hooks/useParsedMetafields/useParsedMetafields.d.ts +21 -0
  409. package/dist/node/hooks/useParsedMetafields/useParsedMetafields.js +25 -0
  410. package/dist/node/hooks/useProductOptions/helpers.d.ts +6 -0
  411. package/dist/node/hooks/useProductOptions/helpers.js +46 -0
  412. package/dist/node/hooks/useProductOptions/index.d.ts +2 -0
  413. package/dist/node/hooks/useProductOptions/index.js +20 -0
  414. package/dist/node/hooks/useProductOptions/types.d.ts +44 -0
  415. package/dist/node/hooks/useProductOptions/types.js +2 -0
  416. package/dist/node/hooks/useProductOptions/useProductOptions.client.d.ts +1 -0
  417. package/dist/node/hooks/useProductOptions/useProductOptions.client.js +13 -0
  418. package/dist/node/hooks/useShopQuery/hooks.d.ts +28 -0
  419. package/dist/node/hooks/useShopQuery/hooks.js +171 -0
  420. package/dist/node/hooks/useShopQuery/index.d.ts +1 -0
  421. package/dist/node/hooks/useShopQuery/index.js +5 -0
  422. package/dist/node/storefront-api-types.d.ts +10 -339
  423. package/dist/node/streaming.server.d.ts +0 -1
  424. package/dist/node/streaming.server.js +1 -6
  425. package/dist/node/types.d.ts +32 -23
  426. package/dist/node/utilities/apiRoutes.d.ts +2 -2
  427. package/dist/node/utilities/devtools.d.ts +11 -0
  428. package/dist/node/utilities/devtools.js +15 -0
  429. package/dist/node/utilities/graphql-tag.d.ts +1 -0
  430. package/dist/node/utilities/graphql-tag.js +10 -0
  431. package/dist/node/utilities/graphql-tracker.d.ts +17 -0
  432. package/dist/node/utilities/graphql-tracker.js +130 -0
  433. package/dist/node/utilities/index.d.ts +1 -1
  434. package/dist/node/utilities/index.js +3 -3
  435. package/dist/node/utilities/isBrowser/index.d.ts +1 -0
  436. package/dist/node/utilities/isBrowser/index.js +5 -0
  437. package/dist/node/utilities/isBrowser/isBrowser.d.ts +4 -0
  438. package/dist/node/utilities/isBrowser/isBrowser.js +10 -0
  439. package/dist/node/utilities/isServer/isServer.js +2 -2
  440. package/dist/node/utilities/log/index.d.ts +1 -1
  441. package/dist/node/utilities/log/index.js +1 -3
  442. package/dist/node/utilities/log/log-cache-header.d.ts +4 -4
  443. package/dist/node/utilities/log/log-query-timeline.d.ts +3 -3
  444. package/dist/node/utilities/log/log.d.ts +17 -11
  445. package/dist/node/utilities/log/log.js +30 -23
  446. package/dist/node/version.d.ts +1 -1
  447. package/dist/node/version.js +1 -1
  448. package/package.json +4 -2
  449. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-plugin.js +234 -53
  450. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.browser.development.server.js +77 -59
  451. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.browser.production.min.server.js +30 -30
  452. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.node.development.server.js +199 -70
  453. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.node.production.min.server.js +38 -35
  454. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite.development.js +9 -8
  455. package/vendor/react-server-dom-vite/cjs/react-server-dom-vite.production.min.js +3 -3
  456. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-client-proxy.js +3 -7
  457. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-plugin.js +235 -54
  458. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-writer.browser.server.js +77 -59
  459. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-writer.node.server.js +199 -70
  460. package/vendor/react-server-dom-vite/esm/react-server-dom-vite.js +9 -8
  461. package/vendor/react-server-dom-vite/package.json +1 -1
  462. package/dist/esnext/components/ProductProvider/ProductOptionsProvider.client.d.ts +0 -8
  463. package/dist/esnext/components/ProductProvider/ProductOptionsProvider.client.js +0 -12
  464. package/dist/esnext/components/ProductProvider/ProductProvider.client.d.ts +0 -24
  465. package/dist/esnext/components/ProductProvider/ProductProvider.client.js +0 -34
  466. package/dist/esnext/components/ProductProvider/context.d.ts +0 -29
  467. package/dist/esnext/components/ProductProvider/index.d.ts +0 -2
  468. package/dist/esnext/components/ProductProvider/index.js +0 -2
  469. package/dist/esnext/foundation/Analytics/connectors/PerformanceMetrics/PerformanceMetrics.server.d.ts +0 -1
  470. package/dist/esnext/framework/config.d.ts +0 -6
  471. package/dist/esnext/framework/config.js +0 -6
  472. package/dist/esnext/framework/runtime.d.ts +0 -13
  473. package/dist/esnext/framework/runtime.js +0 -27
  474. package/dist/esnext/hooks/useProduct/index.d.ts +0 -1
  475. package/dist/esnext/hooks/useProduct/index.js +0 -1
  476. package/dist/esnext/hooks/useProduct/useProduct.d.ts +0 -52
  477. package/dist/esnext/hooks/useProduct/useProduct.js +0 -43
  478. package/dist/esnext/utilities/isClient/index.d.ts +0 -1
  479. package/dist/esnext/utilities/isClient/index.js +0 -1
  480. package/dist/esnext/utilities/isClient/isClient.d.ts +0 -4
  481. package/dist/esnext/utilities/isClient/isClient.js +0 -6
  482. package/dist/node/framework/config.d.ts +0 -6
  483. package/dist/node/framework/config.js +0 -11
  484. package/dist/node/framework/runtime.d.ts +0 -13
  485. package/dist/node/framework/runtime.js +0 -35
  486. package/dist/node/utilities/defer.d.ts +0 -6
  487. package/dist/node/utilities/defer.js +0 -18
  488. package/dist/node/utilities/isClient/index.d.ts +0 -1
  489. package/dist/node/utilities/isClient/index.js +0 -5
  490. package/dist/node/utilities/isClient/isClient.d.ts +0 -4
  491. package/dist/node/utilities/isClient/isClient.js +0 -10
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.CartCheckoutButton = void 0;
27
+ const react_1 = __importStar(require("react"));
28
+ const CartProvider_1 = require("../CartProvider");
29
+ /**
30
+ * The `CartCheckoutButton` component renders a button that redirects to the checkout URL for the cart.
31
+ * It must be a descendent of a `CartProvider` component.
32
+ */
33
+ function CartCheckoutButton(props) {
34
+ const [requestedCheckout, setRequestedCheckout] = (0, react_1.useState)(false);
35
+ const { status, checkoutUrl } = (0, CartProvider_1.useCart)();
36
+ const { children, ...passthroughProps } = props;
37
+ (0, react_1.useEffect)(() => {
38
+ if (requestedCheckout && checkoutUrl && status === 'idle') {
39
+ window.location.href = checkoutUrl;
40
+ }
41
+ }, [requestedCheckout, status, checkoutUrl]);
42
+ return (react_1.default.createElement("button", { ...passthroughProps, disabled: requestedCheckout || passthroughProps.disabled, onClick: () => setRequestedCheckout(true) }, children));
43
+ }
44
+ exports.CartCheckoutButton = CartCheckoutButton;
@@ -0,0 +1 @@
1
+ export { CartCheckoutButton } from './CartCheckoutButton.client';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CartCheckoutButton = void 0;
4
+ var CartCheckoutButton_client_1 = require("./CartCheckoutButton.client");
5
+ Object.defineProperty(exports, "CartCheckoutButton", { enumerable: true, get: function () { return CartCheckoutButton_client_1.CartCheckoutButton; } });
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { Money } from '../Money';
3
+ export interface CartEstimatedCostProps {
4
+ /** A string type that defines the type of cost needed. Valid values: `total`, `subtotal`, `tax`, or `duty`. */
5
+ amountType?: 'total' | 'subtotal' | 'tax' | 'duty';
6
+ /** A function that takes an object return by the `useMoney` hook and returns a `ReactNode`. */
7
+ children?: React.ReactNode;
8
+ }
9
+ /**
10
+ * The `CartEstimatedCost` component renders a `Money` component with the
11
+ * cost associated with the `amountType` prop. If no `amountType` prop is specified, then it defaults to `totalAmount`.
12
+ * If `children` is a function, then it will pass down the render props provided by the parent component.
13
+ */
14
+ export declare function CartEstimatedCost(props: Omit<React.ComponentProps<typeof Money>, 'data'> & CartEstimatedCostProps): JSX.Element | null;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CartEstimatedCost = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const CartProvider_1 = require("../CartProvider");
9
+ const Money_1 = require("../Money");
10
+ /**
11
+ * The `CartEstimatedCost` component renders a `Money` component with the
12
+ * cost associated with the `amountType` prop. If no `amountType` prop is specified, then it defaults to `totalAmount`.
13
+ * If `children` is a function, then it will pass down the render props provided by the parent component.
14
+ */
15
+ function CartEstimatedCost(props) {
16
+ const { estimatedCost } = (0, CartProvider_1.useCart)();
17
+ const { amountType = 'total', children, ...passthroughProps } = props;
18
+ let amount;
19
+ if (amountType == 'total') {
20
+ amount = estimatedCost === null || estimatedCost === void 0 ? void 0 : estimatedCost.totalAmount;
21
+ }
22
+ else if (amountType == 'subtotal') {
23
+ amount = estimatedCost === null || estimatedCost === void 0 ? void 0 : estimatedCost.subtotalAmount;
24
+ }
25
+ else if (amountType == 'tax') {
26
+ amount = estimatedCost === null || estimatedCost === void 0 ? void 0 : estimatedCost.totalTaxAmount;
27
+ }
28
+ else if (amountType == 'duty') {
29
+ amount = estimatedCost === null || estimatedCost === void 0 ? void 0 : estimatedCost.totalDutyAmount;
30
+ }
31
+ if (amount == null) {
32
+ return null;
33
+ }
34
+ return (react_1.default.createElement(Money_1.Money, { ...passthroughProps, data: amount }, children));
35
+ }
36
+ exports.CartEstimatedCost = CartEstimatedCost;
@@ -0,0 +1 @@
1
+ export { CartEstimatedCost } from './CartEstimatedCost.client';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CartEstimatedCost = void 0;
4
+ var CartEstimatedCost_client_1 = require("./CartEstimatedCost.client");
5
+ Object.defineProperty(exports, "CartEstimatedCost", { enumerable: true, get: function () { return CartEstimatedCost_client_1.CartEstimatedCost; } });
@@ -0,0 +1,9 @@
1
+ import { type ShopifyImageProps } from '../Image';
2
+ import type { Simplify } from 'type-fest';
3
+ declare type PropsWeControl = 'data';
4
+ /**
5
+ * The `CartLineImage` component renders an `Image` component for the cart line merchandise's image.
6
+ * It must be a descendent of a `CartLineProvider` component.
7
+ */
8
+ export declare function CartLineImage(props: Simplify<Omit<ShopifyImageProps, PropsWeControl>>): JSX.Element | null;
9
+ export {};
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CartLineImage = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const CartLineProvider_1 = require("../CartLineProvider");
9
+ const Image_1 = require("../Image");
10
+ /**
11
+ * The `CartLineImage` component renders an `Image` component for the cart line merchandise's image.
12
+ * It must be a descendent of a `CartLineProvider` component.
13
+ */
14
+ function CartLineImage(props) {
15
+ const cartLine = (0, CartLineProvider_1.useCartLine)();
16
+ return cartLine.merchandise.image ? (react_1.default.createElement(Image_1.Image, { ...props, data: cartLine.merchandise.image })) : null;
17
+ }
18
+ exports.CartLineImage = CartLineImage;
@@ -0,0 +1 @@
1
+ export { CartLineImage } from './CartLineImage.client';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CartLineImage = void 0;
4
+ var CartLineImage_client_1 = require("./CartLineImage.client");
5
+ Object.defineProperty(exports, "CartLineImage", { enumerable: true, get: function () { return CartLineImage_client_1.CartLineImage; } });
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { Money } from '../Money';
3
+ interface CartLinePriceProps {
4
+ /** The type of price. Valid values:`regular` (default) or `compareAt`. */
5
+ priceType?: 'regular' | 'compareAt';
6
+ }
7
+ /**
8
+ * The `CartLinePrice` component renders a `Money` component for the cart line merchandise's price or
9
+ * compare at price. It must be a descendent of a `CartLineProvider` component.
10
+ */
11
+ export declare function CartLinePrice(props: Omit<React.ComponentProps<typeof Money>, 'data'> & CartLinePriceProps): JSX.Element | null;
12
+ export {};
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CartLinePrice = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const CartLineProvider_1 = require("../CartLineProvider");
9
+ const Money_1 = require("../Money");
10
+ /**
11
+ * The `CartLinePrice` component renders a `Money` component for the cart line merchandise's price or
12
+ * compare at price. It must be a descendent of a `CartLineProvider` component.
13
+ */
14
+ function CartLinePrice(props) {
15
+ const cartLine = (0, CartLineProvider_1.useCartLine)();
16
+ const { priceType = 'regular', ...passthroughProps } = props;
17
+ const moneyV2 = priceType === 'regular'
18
+ ? cartLine.estimatedCost.totalAmount
19
+ : cartLine.estimatedCost.compareAtAmount;
20
+ if (moneyV2 == null) {
21
+ return null;
22
+ }
23
+ return react_1.default.createElement(Money_1.Money, { ...passthroughProps, data: moneyV2 });
24
+ }
25
+ exports.CartLinePrice = CartLinePrice;
@@ -0,0 +1 @@
1
+ export { CartLinePrice } from './CartLinePrice.client';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CartLinePrice = void 0;
4
+ var CartLinePrice_client_1 = require("./CartLinePrice.client");
5
+ Object.defineProperty(exports, "CartLinePrice", { enumerable: true, get: function () { return CartLinePrice_client_1.CartLinePrice; } });
@@ -0,0 +1,8 @@
1
+ /**
2
+ * The `CartLineProductTitle` component renders a `span` element (or the type of HTML element specified by
3
+ * the `as` prop) with the cart line merchandise's title. It must be a descendent of a `CartLineProvider` component.
4
+ */
5
+ export declare function CartLineProductTitle<TTag extends keyof JSX.IntrinsicElements = 'span'>(props: JSX.IntrinsicElements[TTag] & {
6
+ /** An HTML tag to be rendered as the base element wrapper. The default is `span`. */
7
+ as?: TTag;
8
+ }): JSX.Element;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CartLineProductTitle = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const CartLineProvider_1 = require("../CartLineProvider");
9
+ /**
10
+ * The `CartLineProductTitle` component renders a `span` element (or the type of HTML element specified by
11
+ * the `as` prop) with the cart line merchandise's title. It must be a descendent of a `CartLineProvider` component.
12
+ */
13
+ function CartLineProductTitle(props) {
14
+ const cartLine = (0, CartLineProvider_1.useCartLine)();
15
+ const { as, ...passthroughProps } = props;
16
+ const Wrapper = as ? as : 'span';
17
+ return (react_1.default.createElement(Wrapper, { ...passthroughProps }, cartLine.merchandise.product.title));
18
+ }
19
+ exports.CartLineProductTitle = CartLineProductTitle;
@@ -0,0 +1 @@
1
+ export { CartLineProductTitle } from './CartLineProductTitle.client';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CartLineProductTitle = void 0;
4
+ var CartLineProductTitle_client_1 = require("./CartLineProductTitle.client");
5
+ Object.defineProperty(exports, "CartLineProductTitle", { enumerable: true, get: function () { return CartLineProductTitle_client_1.CartLineProductTitle; } });
@@ -0,0 +1,11 @@
1
+ import { ReactNode } from 'react';
2
+ import { Cart } from '../CartProvider';
3
+ /**
4
+ * The `CartLineProvider` component creates a context for using a cart line.
5
+ */
6
+ export declare function CartLineProvider({ children, line, }: {
7
+ /** Any `ReactNode` elements. */
8
+ children: ReactNode;
9
+ /** A cart line object. */
10
+ line: Cart['lines'][1];
11
+ }): JSX.Element;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CartLineProvider = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const context_1 = require("./context");
9
+ /**
10
+ * The `CartLineProvider` component creates a context for using a cart line.
11
+ */
12
+ function CartLineProvider({ children, line, }) {
13
+ return (react_1.default.createElement(context_1.CartLineContext.Provider, { value: line }, children));
14
+ }
15
+ exports.CartLineProvider = CartLineProvider;
@@ -0,0 +1,36 @@
1
+ export declare const CartLineContext: import("react").Context<({
2
+ __typename?: "CartLine" | undefined;
3
+ } & Pick<import("../../storefront-api-types").CartLine, "id" | "quantity"> & {
4
+ attributes: ({
5
+ __typename?: "Attribute" | undefined;
6
+ } & Pick<import("../../storefront-api-types").Attribute, "key" | "value">)[];
7
+ estimatedCost: {
8
+ __typename?: "CartLineEstimatedCost" | undefined;
9
+ } & {
10
+ totalAmount: {
11
+ __typename?: "MoneyV2" | undefined;
12
+ } & Pick<import("../../storefront-api-types").MoneyV2, "amount" | "currencyCode">;
13
+ compareAtAmount?: import("../../storefront-api-types").Maybe<{
14
+ __typename?: "MoneyV2" | undefined;
15
+ } & Pick<import("../../storefront-api-types").MoneyV2, "amount" | "currencyCode">> | undefined;
16
+ };
17
+ merchandise: {
18
+ __typename?: "ProductVariant" | undefined;
19
+ } & Pick<import("../../storefront-api-types").ProductVariant, "id" | "title" | "availableForSale" | "requiresShipping"> & {
20
+ compareAtPriceV2?: import("../../storefront-api-types").Maybe<{
21
+ __typename?: "MoneyV2" | undefined;
22
+ } & Pick<import("../../storefront-api-types").MoneyV2, "amount" | "currencyCode">> | undefined;
23
+ priceV2: {
24
+ __typename?: "MoneyV2" | undefined;
25
+ } & Pick<import("../../storefront-api-types").MoneyV2, "amount" | "currencyCode">;
26
+ image?: import("../../storefront-api-types").Maybe<{
27
+ __typename?: "Image" | undefined;
28
+ } & Pick<import("../../storefront-api-types").Image, "id" | "height" | "width" | "url" | "altText">> | undefined;
29
+ product: {
30
+ __typename?: "Product" | undefined;
31
+ } & Pick<import("../../storefront-api-types").Product, "title" | "handle">;
32
+ selectedOptions: ({
33
+ __typename?: "SelectedOption" | undefined;
34
+ } & Pick<import("../../storefront-api-types").SelectedOption, "name" | "value">)[];
35
+ };
36
+ }) | null>;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CartLineContext = void 0;
4
+ const react_1 = require("react");
5
+ exports.CartLineContext = (0, react_1.createContext)(null);
@@ -0,0 +1,2 @@
1
+ export { CartLineProvider } from './CartLineProvider.client';
2
+ export { useCartLine } from '../../hooks/useCartLine';
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useCartLine = exports.CartLineProvider = void 0;
4
+ var CartLineProvider_client_1 = require("./CartLineProvider.client");
5
+ Object.defineProperty(exports, "CartLineProvider", { enumerable: true, get: function () { return CartLineProvider_client_1.CartLineProvider; } });
6
+ var useCartLine_1 = require("../../hooks/useCartLine");
7
+ Object.defineProperty(exports, "useCartLine", { enumerable: true, get: function () { return useCartLine_1.useCartLine; } });
@@ -0,0 +1,8 @@
1
+ /**
2
+ * The `CartLineQuantity` component renders a `span` element (or the type of HTML element
3
+ * specified by the `as` prop) with the cart line's quantity. It must be a descendent of a `CartLineProvider` component.
4
+ */
5
+ export declare function CartLineQuantity<TTag extends keyof JSX.IntrinsicElements = 'span'>(props: JSX.IntrinsicElements[TTag] & {
6
+ /** An HTML tag to be rendered as the base element wrapper. The default is `div`. */
7
+ as?: TTag;
8
+ }): JSX.Element;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CartLineQuantity = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const CartLineProvider_1 = require("../CartLineProvider");
9
+ /**
10
+ * The `CartLineQuantity` component renders a `span` element (or the type of HTML element
11
+ * specified by the `as` prop) with the cart line's quantity. It must be a descendent of a `CartLineProvider` component.
12
+ */
13
+ function CartLineQuantity(props) {
14
+ const cartLine = (0, CartLineProvider_1.useCartLine)();
15
+ const { as, ...passthroughProps } = props;
16
+ const Wrapper = as ? as : 'span';
17
+ return react_1.default.createElement(Wrapper, { ...passthroughProps }, cartLine.quantity);
18
+ }
19
+ exports.CartLineQuantity = CartLineQuantity;
@@ -0,0 +1 @@
1
+ export { CartLineQuantity } from './CartLineQuantity.client';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CartLineQuantity = void 0;
4
+ var CartLineQuantity_client_1 = require("./CartLineQuantity.client");
5
+ Object.defineProperty(exports, "CartLineQuantity", { enumerable: true, get: function () { return CartLineQuantity_client_1.CartLineQuantity; } });
@@ -0,0 +1,14 @@
1
+ import { ReactNode, ElementType } from 'react';
2
+ import { Props } from '../types';
3
+ declare type PropsWeControl = 'onClick' | 'adjust';
4
+ /**
5
+ * The `CartLineQuantityAdjustButton` component renders a button that adjusts the cart line's quantity when pressed.
6
+ * It must be a descendent of a `CartLineProvider` component.
7
+ */
8
+ export declare function CartLineQuantityAdjustButton<TTag extends ElementType = 'button'>(props: Props<TTag, PropsWeControl> & {
9
+ /** Any `ReactNode` elements. */
10
+ children: ReactNode;
11
+ /** The adjustment for a cart line's quantity. Valid values: `increase` (default), `decrease`, or `remove`. */
12
+ adjust?: 'increase' | 'decrease' | 'remove';
13
+ }): JSX.Element;
14
+ export {};
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CartLineQuantityAdjustButton = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const CartProvider_1 = require("../CartProvider");
9
+ const CartLineProvider_1 = require("../CartLineProvider");
10
+ /**
11
+ * The `CartLineQuantityAdjustButton` component renders a button that adjusts the cart line's quantity when pressed.
12
+ * It must be a descendent of a `CartLineProvider` component.
13
+ */
14
+ function CartLineQuantityAdjustButton(props) {
15
+ const { status, linesRemove, linesUpdate } = (0, CartProvider_1.useCart)();
16
+ const cartLine = (0, CartLineProvider_1.useCartLine)();
17
+ const { children, adjust, ...passthroughProps } = props;
18
+ return (react_1.default.createElement("button", { disabled: status !== 'idle', onClick: () => {
19
+ if (adjust === 'remove') {
20
+ linesRemove([cartLine.id]);
21
+ return;
22
+ }
23
+ const quantity = adjust === 'decrease' ? cartLine.quantity - 1 : cartLine.quantity + 1;
24
+ if (quantity <= 0) {
25
+ linesRemove([cartLine.id]);
26
+ return;
27
+ }
28
+ linesUpdate([{ id: cartLine.id, quantity }]);
29
+ }, ...passthroughProps }, children));
30
+ }
31
+ exports.CartLineQuantityAdjustButton = CartLineQuantityAdjustButton;
@@ -0,0 +1 @@
1
+ export { CartLineQuantityAdjustButton } from './CartLineQuantityAdjustButton';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CartLineQuantityAdjustButton = void 0;
4
+ var CartLineQuantityAdjustButton_1 = require("./CartLineQuantityAdjustButton");
5
+ Object.defineProperty(exports, "CartLineQuantityAdjustButton", { enumerable: true, get: function () { return CartLineQuantityAdjustButton_1.CartLineQuantityAdjustButton; } });
@@ -0,0 +1,15 @@
1
+ import { ReactNode, ElementType } from 'react';
2
+ import { Props } from '../types';
3
+ export interface CartLinesProps {
4
+ /** A `ReactNode` element. Valid values: `ul` or `undefined`. If `ul`, then each child will
5
+ * be wrapped with a `li` element.
6
+ */
7
+ as?: 'ul';
8
+ /** A `ReactNode` element */
9
+ children: ReactNode;
10
+ }
11
+ /**
12
+ * The `CartLines` component iterates over each cart line and renders its `children` within
13
+ * a `CartLineProvider` for each cart line.
14
+ */
15
+ export declare function CartLines<TTag extends ElementType>(props: Props<TTag> & CartLinesProps): JSX.Element;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.CartLines = void 0;
27
+ const react_1 = __importStar(require("react"));
28
+ const CartProvider_1 = require("../CartProvider");
29
+ const CartLineProvider_1 = require("../CartLineProvider");
30
+ /**
31
+ * The `CartLines` component iterates over each cart line and renders its `children` within
32
+ * a `CartLineProvider` for each cart line.
33
+ */
34
+ function CartLines(props) {
35
+ const { lines } = (0, CartProvider_1.useCart)();
36
+ const { as, children, ...passthroughProps } = props;
37
+ const Wrapper = as !== null && as !== void 0 ? as : react_1.Fragment;
38
+ const ChildWrapper = Wrapper === 'ul' ? 'li' : react_1.Fragment;
39
+ return (react_1.default.createElement(Wrapper, { ...passthroughProps }, lines.map((line) => {
40
+ return (react_1.default.createElement(ChildWrapper, { key: line.id },
41
+ react_1.default.createElement(CartLineProvider_1.CartLineProvider, { line: line }, children)));
42
+ })));
43
+ }
44
+ exports.CartLines = CartLines;
@@ -0,0 +1 @@
1
+ export { CartLines } from './CartLines.client';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CartLines = void 0;
4
+ var CartLines_client_1 = require("./CartLines.client");
5
+ Object.defineProperty(exports, "CartLines", { enumerable: true, get: function () { return CartLines_client_1.CartLines; } });
@@ -0,0 +1,41 @@
1
+ import React from 'react';
2
+ import { CartBuyerIdentityInput, CountryCode } from '../../storefront-api-types';
3
+ import { CartFragmentFragment } from './graphql/CartFragment';
4
+ /**
5
+ * The `CartProvider` component creates a context for using a cart. It creates a cart object and callbacks
6
+ * that can be accessed by any descendent component using the `useCart` hook and related hooks. It also carries out
7
+ * any callback props when a relevant action is performed. For example, if a `onLineAdd` callback is provided,
8
+ * then the callback will be called when a new line item is successfully added to the cart.
9
+ *
10
+ * The `CartProvider` component must be a descendent of the `ShopifyProvider` component.
11
+ * You must use this component if you want to use the `useCart` hook or related hooks, or if you would like to use the `AddToCartButton` component.
12
+ */
13
+ export declare function CartProvider({ children, numCartLines, onCreate, onLineAdd, onLineRemove, onLineUpdate, onNoteUpdate, onBuyerIdentityUpdate, onAttributesUpdate, onDiscountCodesUpdate, data: cart, cartFragment, customerAccessToken, countryCode, }: {
14
+ /** Any `ReactNode` elements. */
15
+ children: React.ReactNode;
16
+ numCartLines?: number;
17
+ /** A callback that is invoked when the process to create a cart begins, but before the cart is created in the Storefront API. */
18
+ onCreate?: () => void;
19
+ /** A callback that is invoked when the process to add a line item to the cart begins, but before the line item is added to the Storefront API. */
20
+ onLineAdd?: () => void;
21
+ /** A callback that is invoked when the process to remove a line item to the cart begins, but before the line item is removed from the Storefront API. */
22
+ onLineRemove?: () => void;
23
+ /** A callback that is invoked when the process to update a line item in the cart begins, but before the line item is updated in the Storefront API. */
24
+ onLineUpdate?: () => void;
25
+ /** A callback that is invoked when the process to add or update a note in the cart begins, but before the note is added or updated in the Storefront API. */
26
+ onNoteUpdate?: () => void;
27
+ /** A callback that is invoked when the process to update the buyer identity begins, but before the buyer identity is updated in the Storefront API. */
28
+ onBuyerIdentityUpdate?: () => void;
29
+ /** A callback that is invoked when the process to update the cart attributes begins, but before the attributes are updated in the Storefront API. */
30
+ onAttributesUpdate?: () => void;
31
+ /** A callback that is invoked when the process to update the cart discount codes begins, but before the discount codes are updated in the Storefront API. */
32
+ onDiscountCodesUpdate?: () => void;
33
+ /** An object with fields that correspond to the Storefront API's [Cart object](https://shopify.dev/api/storefront/latest/objects/cart). */
34
+ data?: CartFragmentFragment;
35
+ /** A fragment used to query the Storefront API's [Cart object](https://shopify.dev/api/storefront/latest/objects/cart) for all queries and mutations. A default value is used if no argument is provided. */
36
+ cartFragment?: string;
37
+ /** A customer access token that's accessible on the server if there's a customer login. */
38
+ customerAccessToken?: CartBuyerIdentityInput['customerAccessToken'];
39
+ /** The ISO country code for i18n. */
40
+ countryCode?: CountryCode;
41
+ }): JSX.Element;