@shopify/hydrogen 0.1.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.
- package/README.md +29 -0
- package/client.d.ts +1 -0
- package/client.js +1 -0
- package/dist/esnext/client.d.ts +7 -0
- package/dist/esnext/client.js +7 -0
- package/dist/esnext/components/AddToCartButton/AddToCartButton.client.d.ts +15 -0
- package/dist/esnext/components/AddToCartButton/AddToCartButton.client.js +44 -0
- package/dist/esnext/components/AddToCartButton/index.d.ts +1 -0
- package/dist/esnext/components/AddToCartButton/index.js +1 -0
- package/dist/esnext/components/BuyNowButton/BuyNowButton.d.ts +12 -0
- package/dist/esnext/components/BuyNowButton/BuyNowButton.js +29 -0
- package/dist/esnext/components/BuyNowButton/index.d.ts +1 -0
- package/dist/esnext/components/BuyNowButton/index.js +1 -0
- package/dist/esnext/components/CartCheckoutButton/CartCheckoutButton.client.d.ts +7 -0
- package/dist/esnext/components/CartCheckoutButton/CartCheckoutButton.client.js +14 -0
- package/dist/esnext/components/CartCheckoutButton/index.d.ts +1 -0
- package/dist/esnext/components/CartCheckoutButton/index.js +1 -0
- package/dist/esnext/components/CartContainer/CartContainer.client.d.ts +9 -0
- package/dist/esnext/components/CartContainer/CartContainer.client.js +24 -0
- package/dist/esnext/components/CartContainer/index.d.ts +1 -0
- package/dist/esnext/components/CartContainer/index.js +1 -0
- package/dist/esnext/components/CartLineAttributes/CartLineAttributes.client.d.ts +10 -0
- package/dist/esnext/components/CartLineAttributes/CartLineAttributes.client.js +9 -0
- package/dist/esnext/components/CartLineAttributes/index.d.ts +1 -0
- package/dist/esnext/components/CartLineAttributes/index.js +1 -0
- package/dist/esnext/components/CartLineImage/CartLineImage.client.d.ts +6 -0
- package/dist/esnext/components/CartLineImage/CartLineImage.client.js +8 -0
- package/dist/esnext/components/CartLineImage/index.d.ts +1 -0
- package/dist/esnext/components/CartLineImage/index.js +1 -0
- package/dist/esnext/components/CartLinePrice/CartLinePrice.client.d.ts +6 -0
- package/dist/esnext/components/CartLinePrice/CartLinePrice.client.js +17 -0
- package/dist/esnext/components/CartLinePrice/index.d.ts +1 -0
- package/dist/esnext/components/CartLinePrice/index.js +1 -0
- package/dist/esnext/components/CartLineProductTitle/CartLineProductTitle.client.d.ts +3 -0
- package/dist/esnext/components/CartLineProductTitle/CartLineProductTitle.client.js +8 -0
- package/dist/esnext/components/CartLineProductTitle/index.d.ts +1 -0
- package/dist/esnext/components/CartLineProductTitle/index.js +1 -0
- package/dist/esnext/components/CartLineProvider/CartLineProvider.client.d.ts +6 -0
- package/dist/esnext/components/CartLineProvider/CartLineProvider.client.js +5 -0
- package/dist/esnext/components/CartLineProvider/context.d.ts +26 -0
- package/dist/esnext/components/CartLineProvider/context.js +2 -0
- package/dist/esnext/components/CartLineProvider/hooks.d.ts +26 -0
- package/dist/esnext/components/CartLineProvider/hooks.js +9 -0
- package/dist/esnext/components/CartLineProvider/index.d.ts +2 -0
- package/dist/esnext/components/CartLineProvider/index.js +2 -0
- package/dist/esnext/components/CartLineQuantity/CartLineQuantity.client.d.ts +3 -0
- package/dist/esnext/components/CartLineQuantity/CartLineQuantity.client.js +8 -0
- package/dist/esnext/components/CartLineQuantity/index.d.ts +1 -0
- package/dist/esnext/components/CartLineQuantity/index.js +1 -0
- package/dist/esnext/components/CartLineQuantityAdjustButton/CartLineQuantityAdjustButton.d.ts +8 -0
- package/dist/esnext/components/CartLineQuantityAdjustButton/CartLineQuantityAdjustButton.js +17 -0
- package/dist/esnext/components/CartLineQuantityAdjustButton/index.d.ts +1 -0
- package/dist/esnext/components/CartLineQuantityAdjustButton/index.js +1 -0
- package/dist/esnext/components/CartLineSelectedOptions/CartLineSelectedOptions.client.d.ts +10 -0
- package/dist/esnext/components/CartLineSelectedOptions/CartLineSelectedOptions.client.js +9 -0
- package/dist/esnext/components/CartLineSelectedOptions/index.d.ts +1 -0
- package/dist/esnext/components/CartLineSelectedOptions/index.js +1 -0
- package/dist/esnext/components/CartLines/CartLines.d.ts +7 -0
- package/dist/esnext/components/CartLines/CartLines.js +15 -0
- package/dist/esnext/components/CartLines/index.d.ts +1 -0
- package/dist/esnext/components/CartLines/index.js +1 -0
- package/dist/esnext/components/CartProvider/CartProvider.client.d.ts +7 -0
- package/dist/esnext/components/CartProvider/CartProvider.client.js +422 -0
- package/dist/esnext/components/CartProvider/CartServerProvider.server.d.ts +11 -0
- package/dist/esnext/components/CartProvider/CartServerProvider.server.js +20 -0
- package/dist/esnext/components/CartProvider/constants.d.ts +2 -0
- package/dist/esnext/components/CartProvider/constants.js +2 -0
- package/dist/esnext/components/CartProvider/context.d.ts +2 -0
- package/dist/esnext/components/CartProvider/context.js +2 -0
- package/dist/esnext/components/CartProvider/graphql/CartAttributesUpdateMutation.d.ts +18 -0
- package/dist/esnext/components/CartProvider/graphql/CartAttributesUpdateMutation.js +1 -0
- package/dist/esnext/components/CartProvider/graphql/CartBuyerIdentityUpdateMutation.d.ts +18 -0
- package/dist/esnext/components/CartProvider/graphql/CartBuyerIdentityUpdateMutation.js +1 -0
- package/dist/esnext/components/CartProvider/graphql/CartCreateMutation.d.ts +17 -0
- package/dist/esnext/components/CartProvider/graphql/CartCreateMutation.js +1 -0
- package/dist/esnext/components/CartProvider/graphql/CartDiscountCodesUpdateMutation.d.ts +18 -0
- package/dist/esnext/components/CartProvider/graphql/CartDiscountCodesUpdateMutation.js +1 -0
- package/dist/esnext/components/CartProvider/graphql/CartFragment.d.ts +68 -0
- package/dist/esnext/components/CartProvider/graphql/CartFragment.js +1 -0
- package/dist/esnext/components/CartProvider/graphql/CartLineAddMutation.d.ts +18 -0
- package/dist/esnext/components/CartProvider/graphql/CartLineAddMutation.js +1 -0
- package/dist/esnext/components/CartProvider/graphql/CartLineRemoveMutation.d.ts +18 -0
- package/dist/esnext/components/CartProvider/graphql/CartLineRemoveMutation.js +1 -0
- package/dist/esnext/components/CartProvider/graphql/CartLineUpdateMutation.d.ts +18 -0
- package/dist/esnext/components/CartProvider/graphql/CartLineUpdateMutation.js +1 -0
- package/dist/esnext/components/CartProvider/graphql/CartNoteUpdateMutation.d.ts +18 -0
- package/dist/esnext/components/CartProvider/graphql/CartNoteUpdateMutation.js +1 -0
- package/dist/esnext/components/CartProvider/graphql/CartQuery.d.ts +13 -0
- package/dist/esnext/components/CartProvider/graphql/CartQuery.js +1 -0
- package/dist/esnext/components/CartProvider/hooks.d.ts +18 -0
- package/dist/esnext/components/CartProvider/hooks.js +79 -0
- package/dist/esnext/components/CartProvider/index.d.ts +4 -0
- package/dist/esnext/components/CartProvider/index.js +4 -0
- package/dist/esnext/components/CartProvider/types.d.ts +105 -0
- package/dist/esnext/components/CartProvider/types.js +1 -0
- package/dist/esnext/components/CartShopPayButton/CartShopPayButton.client.d.ts +2 -0
- package/dist/esnext/components/CartShopPayButton/CartShopPayButton.client.js +10 -0
- package/dist/esnext/components/CartShopPayButton/index.d.ts +1 -0
- package/dist/esnext/components/CartShopPayButton/index.js +1 -0
- package/dist/esnext/components/CartToggle/CartToggle.client.d.ts +8 -0
- package/dist/esnext/components/CartToggle/CartToggle.client.js +11 -0
- package/dist/esnext/components/CartToggle/index.d.ts +1 -0
- package/dist/esnext/components/CartToggle/index.js +1 -0
- package/dist/esnext/components/CartTotal/CartTotal.client.d.ts +3 -0
- package/dist/esnext/components/CartTotal/CartTotal.client.js +8 -0
- package/dist/esnext/components/CartTotal/index.d.ts +1 -0
- package/dist/esnext/components/CartTotal/index.js +1 -0
- package/dist/esnext/components/CartUIProvider/CartUIProvider.client.d.ts +5 -0
- package/dist/esnext/components/CartUIProvider/CartUIProvider.client.js +26 -0
- package/dist/esnext/components/CartUIProvider/context.d.ts +9 -0
- package/dist/esnext/components/CartUIProvider/context.js +2 -0
- package/dist/esnext/components/CartUIProvider/hooks.d.ts +1 -0
- package/dist/esnext/components/CartUIProvider/hooks.js +9 -0
- package/dist/esnext/components/CartUIProvider/index.d.ts +2 -0
- package/dist/esnext/components/CartUIProvider/index.js +2 -0
- package/dist/esnext/components/ExternalVideo/ExternalVideo.d.ts +14 -0
- package/dist/esnext/components/ExternalVideo/ExternalVideo.js +9 -0
- package/dist/esnext/components/ExternalVideo/ExternalVideoFragment.d.ts +4 -0
- package/dist/esnext/components/ExternalVideo/ExternalVideoFragment.js +1 -0
- package/dist/esnext/components/ExternalVideo/index.d.ts +1 -0
- package/dist/esnext/components/ExternalVideo/index.js +1 -0
- package/dist/esnext/components/Image/Image.d.ts +14 -0
- package/dist/esnext/components/Image/Image.js +10 -0
- package/dist/esnext/components/Image/ImageFragment.d.ts +4 -0
- package/dist/esnext/components/Image/ImageFragment.js +1 -0
- package/dist/esnext/components/Image/index.d.ts +1 -0
- package/dist/esnext/components/Image/index.js +1 -0
- package/dist/esnext/components/LocalizationProvider/LocalizationClientProvider.client.d.ts +6 -0
- package/dist/esnext/components/LocalizationProvider/LocalizationClientProvider.client.js +14 -0
- package/dist/esnext/components/LocalizationProvider/LocalizationContext.client.d.ts +8 -0
- package/dist/esnext/components/LocalizationProvider/LocalizationContext.client.js +2 -0
- package/dist/esnext/components/LocalizationProvider/LocalizationProvider.server.d.ts +4 -0
- package/dist/esnext/components/LocalizationProvider/LocalizationProvider.server.js +8 -0
- package/dist/esnext/components/LocalizationProvider/LocalizationQuery.d.ts +18 -0
- package/dist/esnext/components/LocalizationProvider/LocalizationQuery.js +1 -0
- package/dist/esnext/components/LocalizationProvider/hooks.d.ts +8 -0
- package/dist/esnext/components/LocalizationProvider/hooks.js +17 -0
- package/dist/esnext/components/LocalizationProvider/index.d.ts +2 -0
- package/dist/esnext/components/LocalizationProvider/index.js +2 -0
- package/dist/esnext/components/MediaFile/MediaFile.d.ts +19 -0
- package/dist/esnext/components/MediaFile/MediaFile.js +22 -0
- package/dist/esnext/components/MediaFile/MediaFileFragment.d.ts +22 -0
- package/dist/esnext/components/MediaFile/MediaFileFragment.js +1 -0
- package/dist/esnext/components/MediaFile/index.d.ts +1 -0
- package/dist/esnext/components/MediaFile/index.js +1 -0
- package/dist/esnext/components/Metafield/Metafield.client.d.ts +8 -0
- package/dist/esnext/components/Metafield/Metafield.client.js +50 -0
- package/dist/esnext/components/Metafield/MetafieldFragment.d.ts +4 -0
- package/dist/esnext/components/Metafield/MetafieldFragment.js +1 -0
- package/dist/esnext/components/Metafield/components/StarRating/StarRating.d.ts +12 -0
- package/dist/esnext/components/Metafield/components/StarRating/StarRating.js +48 -0
- package/dist/esnext/components/Metafield/components/StarRating/index.d.ts +1 -0
- package/dist/esnext/components/Metafield/components/StarRating/index.js +1 -0
- package/dist/esnext/components/Metafield/components/index.d.ts +1 -0
- package/dist/esnext/components/Metafield/components/index.js +1 -0
- package/dist/esnext/components/Metafield/index.d.ts +3 -0
- package/dist/esnext/components/Metafield/index.js +1 -0
- package/dist/esnext/components/Metafield/types.d.ts +4 -0
- package/dist/esnext/components/Metafield/types.js +1 -0
- package/dist/esnext/components/Model3D/Model3D.client.d.ts +25 -0
- package/dist/esnext/components/Model3D/Model3D.client.js +30 -0
- package/dist/esnext/components/Model3D/Model3DFragment.d.ts +11 -0
- package/dist/esnext/components/Model3D/Model3DFragment.js +1 -0
- package/dist/esnext/components/Model3D/index.d.ts +1 -0
- package/dist/esnext/components/Model3D/index.js +1 -0
- package/dist/esnext/components/Money/Money.client.d.ts +7 -0
- package/dist/esnext/components/Money/Money.client.js +10 -0
- package/dist/esnext/components/Money/index.d.ts +1 -0
- package/dist/esnext/components/Money/index.js +1 -0
- package/dist/esnext/components/ProductDescription/ProductDescription.client.d.ts +3 -0
- package/dist/esnext/components/ProductDescription/ProductDescription.client.js +10 -0
- package/dist/esnext/components/ProductDescription/index.d.ts +1 -0
- package/dist/esnext/components/ProductDescription/index.js +1 -0
- package/dist/esnext/components/ProductMetafield/ProductMetafield.client.d.ts +7 -0
- package/dist/esnext/components/ProductMetafield/ProductMetafield.client.js +16 -0
- package/dist/esnext/components/ProductMetafield/index.d.ts +1 -0
- package/dist/esnext/components/ProductMetafield/index.js +1 -0
- package/dist/esnext/components/ProductPrice/ProductPrice.client.d.ts +7 -0
- package/dist/esnext/components/ProductPrice/ProductPrice.client.js +32 -0
- package/dist/esnext/components/ProductPrice/index.d.ts +1 -0
- package/dist/esnext/components/ProductPrice/index.js +1 -0
- package/dist/esnext/components/ProductProvider/ProductProvider.client.d.ts +7 -0
- package/dist/esnext/components/ProductProvider/ProductProvider.client.js +35 -0
- package/dist/esnext/components/ProductProvider/ProductProviderFragment.d.ts +96 -0
- package/dist/esnext/components/ProductProvider/ProductProviderFragment.js +1 -0
- package/dist/esnext/components/ProductProvider/context.d.ts +13 -0
- package/dist/esnext/components/ProductProvider/context.js +2 -0
- package/dist/esnext/components/ProductProvider/hooks.d.ts +1 -0
- package/dist/esnext/components/ProductProvider/hooks.js +6 -0
- package/dist/esnext/components/ProductProvider/index.d.ts +2 -0
- package/dist/esnext/components/ProductProvider/index.js +2 -0
- package/dist/esnext/components/ProductProvider/types.d.ts +5 -0
- package/dist/esnext/components/ProductProvider/types.js +1 -0
- package/dist/esnext/components/ProductTitle/ProductTitle.client.d.ts +3 -0
- package/dist/esnext/components/ProductTitle/ProductTitle.client.js +11 -0
- package/dist/esnext/components/ProductTitle/index.d.ts +1 -0
- package/dist/esnext/components/ProductTitle/index.js +1 -0
- package/dist/esnext/components/RawHtml/RawHtml.d.ts +7 -0
- package/dist/esnext/components/RawHtml/RawHtml.js +13 -0
- package/dist/esnext/components/RawHtml/index.d.ts +1 -0
- package/dist/esnext/components/RawHtml/index.js +1 -0
- package/dist/esnext/components/SelectedVariantAddToCartButton/SelectedVariantAddToCartButton.client.d.ts +6 -0
- package/dist/esnext/components/SelectedVariantAddToCartButton/SelectedVariantAddToCartButton.client.js +12 -0
- package/dist/esnext/components/SelectedVariantAddToCartButton/index.d.ts +1 -0
- package/dist/esnext/components/SelectedVariantAddToCartButton/index.js +1 -0
- package/dist/esnext/components/SelectedVariantBuyNowButton/SelectedVariantBuyNowButton.d.ts +4 -0
- package/dist/esnext/components/SelectedVariantBuyNowButton/SelectedVariantBuyNowButton.js +12 -0
- package/dist/esnext/components/SelectedVariantBuyNowButton/index.d.ts +1 -0
- package/dist/esnext/components/SelectedVariantBuyNowButton/index.js +1 -0
- package/dist/esnext/components/SelectedVariantImage/SelectedVariantImage.client.d.ts +6 -0
- package/dist/esnext/components/SelectedVariantImage/SelectedVariantImage.client.js +12 -0
- package/dist/esnext/components/SelectedVariantImage/index.d.ts +1 -0
- package/dist/esnext/components/SelectedVariantImage/index.js +1 -0
- package/dist/esnext/components/SelectedVariantMetafield/SelectedVariantMetafield.client.d.ts +7 -0
- package/dist/esnext/components/SelectedVariantMetafield/SelectedVariantMetafield.client.js +15 -0
- package/dist/esnext/components/SelectedVariantMetafield/index.d.ts +1 -0
- package/dist/esnext/components/SelectedVariantMetafield/index.js +1 -0
- package/dist/esnext/components/SelectedVariantPrice/SelectedVariantPrice.client.d.ts +6 -0
- package/dist/esnext/components/SelectedVariantPrice/SelectedVariantPrice.client.js +18 -0
- package/dist/esnext/components/SelectedVariantPrice/index.d.ts +1 -0
- package/dist/esnext/components/SelectedVariantPrice/index.js +1 -0
- package/dist/esnext/components/SelectedVariantShopPayButton/SelectedVariantShopPayButton.client.d.ts +2 -0
- package/dist/esnext/components/SelectedVariantShopPayButton/SelectedVariantShopPayButton.client.js +12 -0
- package/dist/esnext/components/SelectedVariantShopPayButton/index.d.ts +1 -0
- package/dist/esnext/components/SelectedVariantShopPayButton/index.js +1 -0
- package/dist/esnext/components/SelectedVariantUnitPrice/SelectedVariantUnitPrice.client.d.ts +3 -0
- package/dist/esnext/components/SelectedVariantUnitPrice/SelectedVariantUnitPrice.client.js +12 -0
- package/dist/esnext/components/SelectedVariantUnitPrice/index.d.ts +1 -0
- package/dist/esnext/components/SelectedVariantUnitPrice/index.js +1 -0
- package/dist/esnext/components/ShopPayButton/ShopPayButton.client.d.ts +15 -0
- package/dist/esnext/components/ShopPayButton/ShopPayButton.client.js +32 -0
- package/dist/esnext/components/ShopPayButton/index.d.ts +1 -0
- package/dist/esnext/components/ShopPayButton/index.js +1 -0
- package/dist/esnext/components/UnitPrice/UnitPrice.client.d.ts +8 -0
- package/dist/esnext/components/UnitPrice/UnitPrice.client.js +16 -0
- package/dist/esnext/components/UnitPrice/index.d.ts +1 -0
- package/dist/esnext/components/UnitPrice/index.js +1 -0
- package/dist/esnext/components/Video/Video.d.ts +13 -0
- package/dist/esnext/components/Video/Video.js +8 -0
- package/dist/esnext/components/Video/VideoFragment.d.ts +11 -0
- package/dist/esnext/components/Video/VideoFragment.js +1 -0
- package/dist/esnext/components/Video/index.d.ts +1 -0
- package/dist/esnext/components/Video/index.js +1 -0
- package/dist/esnext/components/index.d.ts +41 -0
- package/dist/esnext/components/index.js +87 -0
- package/dist/esnext/components/types.d.ts +73 -0
- package/dist/esnext/components/types.js +10 -0
- package/dist/esnext/entry-client.d.ts +3 -0
- package/dist/esnext/entry-client.js +36 -0
- package/dist/esnext/entry-server.d.ts +3 -0
- package/dist/esnext/entry-server.js +286 -0
- package/dist/esnext/foundation/ClientMarker/ClientMarker.d.ts +10 -0
- package/dist/esnext/foundation/ClientMarker/ClientMarker.js +25 -0
- package/dist/esnext/foundation/ClientMarker/index.d.ts +1 -0
- package/dist/esnext/foundation/ClientMarker/index.js +1 -0
- package/dist/esnext/foundation/Hydration/Cache.client.d.ts +9 -0
- package/dist/esnext/foundation/Hydration/Cache.client.js +131 -0
- package/dist/esnext/foundation/Hydration/ClientComponents.server.d.ts +13 -0
- package/dist/esnext/foundation/Hydration/ClientComponents.server.js +18 -0
- package/dist/esnext/foundation/Hydration/Html.d.ts +5 -0
- package/dist/esnext/foundation/Hydration/Html.js +9 -0
- package/dist/esnext/foundation/Hydration/HydrationContext.server.d.ts +1 -0
- package/dist/esnext/foundation/Hydration/HydrationContext.server.js +2 -0
- package/dist/esnext/foundation/Hydration/ServerComponentRequest.server.d.ts +13 -0
- package/dist/esnext/foundation/Hydration/ServerComponentRequest.server.js +39 -0
- package/dist/esnext/foundation/Hydration/ServerComponentResponse.server.d.ts +18 -0
- package/dist/esnext/foundation/Hydration/ServerComponentResponse.server.js +35 -0
- package/dist/esnext/foundation/Hydration/react-utils.d.ts +5 -0
- package/dist/esnext/foundation/Hydration/react-utils.js +55 -0
- package/dist/esnext/foundation/Hydration/wire.server.d.ts +4 -0
- package/dist/esnext/foundation/Hydration/wire.server.js +75 -0
- package/dist/esnext/foundation/Hydration/writer.server.d.ts +14 -0
- package/dist/esnext/foundation/Hydration/writer.server.js +29 -0
- package/dist/esnext/foundation/Router/DefaultRoutes.d.ts +20 -0
- package/dist/esnext/foundation/Router/DefaultRoutes.js +54 -0
- package/dist/esnext/foundation/Router/ServerStateRouter.client.d.ts +6 -0
- package/dist/esnext/foundation/Router/ServerStateRouter.client.js +27 -0
- package/dist/esnext/foundation/Router/index.d.ts +1 -0
- package/dist/esnext/foundation/Router/index.js +1 -0
- package/dist/esnext/foundation/ServerStateProvider/ServerStateProvider.client.d.ts +11 -0
- package/dist/esnext/foundation/ServerStateProvider/ServerStateProvider.client.js +48 -0
- package/dist/esnext/foundation/ServerStateProvider/index.d.ts +1 -0
- package/dist/esnext/foundation/ServerStateProvider/index.js +1 -0
- package/dist/esnext/foundation/ShopifyProvider/ShopifyContext.d.ts +1 -0
- package/dist/esnext/foundation/ShopifyProvider/ShopifyContext.js +2 -0
- package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.d.ts +3 -0
- package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.js +11 -0
- package/dist/esnext/foundation/ShopifyProvider/ShopifyServerProvider.server.d.ts +8 -0
- package/dist/esnext/foundation/ShopifyProvider/ShopifyServerProvider.server.js +7 -0
- package/dist/esnext/foundation/ShopifyProvider/hooks.d.ts +2 -0
- package/dist/esnext/foundation/ShopifyProvider/hooks.js +9 -0
- package/dist/esnext/foundation/ShopifyProvider/index.d.ts +2 -0
- package/dist/esnext/foundation/ShopifyProvider/index.js +2 -0
- package/dist/esnext/foundation/ShopifyProvider/types.d.ts +12 -0
- package/dist/esnext/foundation/ShopifyProvider/types.js +1 -0
- package/dist/esnext/foundation/index.d.ts +4 -0
- package/dist/esnext/foundation/index.js +4 -0
- package/dist/esnext/framework/graphiql.d.ts +1 -0
- package/dist/esnext/framework/graphiql.js +39 -0
- package/dist/esnext/framework/middleware.d.ts +17 -0
- package/dist/esnext/framework/middleware.js +116 -0
- package/dist/esnext/framework/plugin.d.ts +3 -0
- package/dist/esnext/framework/plugin.js +14 -0
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-config.d.ts +3 -0
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-config.js +43 -0
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-middleware.d.ts +4 -0
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-middleware.js +28 -0
- package/dist/esnext/framework/plugins/vite-plugin-react-server-components-shim.d.ts +3 -0
- package/dist/esnext/framework/plugins/vite-plugin-react-server-components-shim.js +123 -0
- package/dist/esnext/framework/server-components.d.ts +12 -0
- package/dist/esnext/framework/server-components.js +72 -0
- package/dist/esnext/graphql/graphql-constants.d.ts +1295 -0
- package/dist/esnext/graphql/graphql-constants.js +2482 -0
- package/dist/esnext/graphql/types/types.d.ts +5583 -0
- package/dist/esnext/graphql/types/types.js +1414 -0
- package/dist/esnext/handle-event.d.ts +20 -0
- package/dist/esnext/handle-event.js +140 -0
- package/dist/esnext/handle-worker-event.d.ts +11 -0
- package/dist/esnext/handle-worker-event.js +14 -0
- package/dist/esnext/hooks/index.d.ts +5 -0
- package/dist/esnext/hooks/index.js +5 -0
- package/dist/esnext/hooks/useMeasurement/hooks.d.ts +9 -0
- package/dist/esnext/hooks/useMeasurement/hooks.js +13 -0
- package/dist/esnext/hooks/useMeasurement/index.d.ts +1 -0
- package/dist/esnext/hooks/useMeasurement/index.js +1 -0
- package/dist/esnext/hooks/useMoney/hooks.d.ts +11 -0
- package/dist/esnext/hooks/useMoney/hooks.js +33 -0
- package/dist/esnext/hooks/useMoney/index.d.ts +1 -0
- package/dist/esnext/hooks/useMoney/index.js +1 -0
- package/dist/esnext/hooks/useParsedMetafields/hooks.d.ts +3 -0
- package/dist/esnext/hooks/useParsedMetafields/hooks.js +15 -0
- package/dist/esnext/hooks/useParsedMetafields/index.d.ts +1 -0
- package/dist/esnext/hooks/useParsedMetafields/index.js +1 -0
- package/dist/esnext/hooks/useProductOptions/helpers.d.ts +4 -0
- package/dist/esnext/hooks/useProductOptions/helpers.js +33 -0
- package/dist/esnext/hooks/useProductOptions/index.d.ts +2 -0
- package/dist/esnext/hooks/useProductOptions/index.js +2 -0
- package/dist/esnext/hooks/useProductOptions/types.d.ts +50 -0
- package/dist/esnext/hooks/useProductOptions/types.js +1 -0
- package/dist/esnext/hooks/useProductOptions/useProductOptions.d.ts +23 -0
- package/dist/esnext/hooks/useProductOptions/useProductOptions.js +84 -0
- package/dist/esnext/hooks/useQuery/QueryProvider.d.ts +6 -0
- package/dist/esnext/hooks/useQuery/QueryProvider.js +13 -0
- package/dist/esnext/hooks/useQuery/hooks.d.ts +12 -0
- package/dist/esnext/hooks/useQuery/hooks.js +28 -0
- package/dist/esnext/hooks/useQuery/index.d.ts +2 -0
- package/dist/esnext/hooks/useQuery/index.js +2 -0
- package/dist/esnext/hooks/useShopQuery/hooks.d.ts +9 -0
- package/dist/esnext/hooks/useShopQuery/hooks.js +34 -0
- package/dist/esnext/hooks/useShopQuery/index.d.ts +1 -0
- package/dist/esnext/hooks/useShopQuery/index.js +1 -0
- package/dist/esnext/index.d.ts +9 -0
- package/dist/esnext/index.js +11 -0
- package/dist/esnext/types.d.ts +62 -0
- package/dist/esnext/types.js +1 -0
- package/dist/esnext/utilities/connections.d.ts +2 -0
- package/dist/esnext/utilities/connections.js +4 -0
- package/dist/esnext/utilities/environment.d.ts +2 -0
- package/dist/esnext/utilities/environment.js +2 -0
- package/dist/esnext/utilities/image_size.d.ts +17 -0
- package/dist/esnext/utilities/image_size.js +45 -0
- package/dist/esnext/utilities/index.d.ts +8 -0
- package/dist/esnext/utilities/index.js +8 -0
- package/dist/esnext/utilities/meaurement.d.ts +3 -0
- package/dist/esnext/utilities/meaurement.js +98 -0
- package/dist/esnext/utilities/metafields.d.ts +2 -0
- package/dist/esnext/utilities/metafields.js +32 -0
- package/dist/esnext/utilities/script_loader.d.ts +3 -0
- package/dist/esnext/utilities/script_loader.js +23 -0
- package/dist/esnext/utilities/suspense.d.ts +7 -0
- package/dist/esnext/utilities/suspense.js +32 -0
- package/dist/esnext/utilities/video_parameters.d.ts +47 -0
- package/dist/esnext/utilities/video_parameters.js +22 -0
- package/dist/esnext/version.d.ts +1 -0
- package/dist/esnext/version.js +1 -0
- package/dist/node/foundation/ClientMarker/ClientMarker.d.ts +10 -0
- package/dist/node/foundation/ClientMarker/ClientMarker.js +48 -0
- package/dist/node/foundation/ClientMarker/index.d.ts +1 -0
- package/dist/node/foundation/ClientMarker/index.js +13 -0
- package/dist/node/foundation/Hydration/HydrationContext.server.d.ts +1 -0
- package/dist/node/foundation/Hydration/HydrationContext.server.js +5 -0
- package/dist/node/foundation/Hydration/ServerComponentRequest.server.d.ts +13 -0
- package/dist/node/foundation/Hydration/ServerComponentRequest.server.js +43 -0
- package/dist/node/foundation/Hydration/ServerComponentResponse.server.d.ts +18 -0
- package/dist/node/foundation/Hydration/ServerComponentResponse.server.js +39 -0
- package/dist/node/foundation/Hydration/react-utils.d.ts +5 -0
- package/dist/node/foundation/Hydration/react-utils.js +63 -0
- package/dist/node/foundation/Router/DefaultRoutes.d.ts +20 -0
- package/dist/node/foundation/Router/DefaultRoutes.js +78 -0
- package/dist/node/foundation/Router/index.d.ts +1 -0
- package/dist/node/foundation/Router/index.js +5 -0
- package/dist/node/foundation/ShopifyProvider/ShopifyContext.d.ts +1 -0
- package/dist/node/foundation/ShopifyProvider/ShopifyContext.js +5 -0
- package/dist/node/foundation/ShopifyProvider/ShopifyProvider.d.ts +3 -0
- package/dist/node/foundation/ShopifyProvider/ShopifyProvider.js +34 -0
- package/dist/node/foundation/ShopifyProvider/ShopifyServerProvider.server.d.ts +8 -0
- package/dist/node/foundation/ShopifyProvider/ShopifyServerProvider.server.js +14 -0
- package/dist/node/foundation/ShopifyProvider/hooks.d.ts +2 -0
- package/dist/node/foundation/ShopifyProvider/hooks.js +13 -0
- package/dist/node/foundation/ShopifyProvider/index.d.ts +2 -0
- package/dist/node/foundation/ShopifyProvider/index.js +8 -0
- package/dist/node/foundation/ShopifyProvider/types.d.ts +12 -0
- package/dist/node/foundation/ShopifyProvider/types.js +2 -0
- package/dist/node/foundation/index.d.ts +4 -0
- package/dist/node/foundation/index.js +13 -0
- package/dist/node/framework/graphiql.d.ts +1 -0
- package/dist/node/framework/graphiql.js +43 -0
- package/dist/node/framework/middleware.d.ts +17 -0
- package/dist/node/framework/middleware.js +141 -0
- package/dist/node/framework/plugin.d.ts +3 -0
- package/dist/node/framework/plugin.js +19 -0
- package/dist/node/framework/plugins/vite-plugin-hydrogen-config.d.ts +3 -0
- package/dist/node/framework/plugins/vite-plugin-hydrogen-config.js +45 -0
- package/dist/node/framework/plugins/vite-plugin-hydrogen-middleware.d.ts +4 -0
- package/dist/node/framework/plugins/vite-plugin-hydrogen-middleware.js +33 -0
- package/dist/node/framework/plugins/vite-plugin-react-server-components-shim.d.ts +3 -0
- package/dist/node/framework/plugins/vite-plugin-react-server-components-shim.js +128 -0
- package/dist/node/framework/server-components.d.ts +12 -0
- package/dist/node/framework/server-components.js +77 -0
- package/dist/node/graphql/types/types.d.ts +5583 -0
- package/dist/node/graphql/types/types.js +1417 -0
- package/dist/node/handle-event.d.ts +20 -0
- package/dist/node/handle-event.js +143 -0
- package/dist/node/hooks/useQuery/QueryProvider.d.ts +6 -0
- package/dist/node/hooks/useQuery/QueryProvider.js +20 -0
- package/dist/node/hooks/useQuery/hooks.d.ts +12 -0
- package/dist/node/hooks/useQuery/hooks.js +32 -0
- package/dist/node/hooks/useQuery/index.d.ts +2 -0
- package/dist/node/hooks/useQuery/index.js +14 -0
- package/dist/node/types.d.ts +62 -0
- package/dist/node/types.js +2 -0
- package/dist/worker/foundation/Hydration/ServerComponentRequest.server.d.ts +13 -0
- package/dist/worker/foundation/Hydration/ServerComponentRequest.server.js +39 -0
- package/dist/worker/foundation/Hydration/ServerComponentResponse.server.d.ts +18 -0
- package/dist/worker/foundation/Hydration/ServerComponentResponse.server.js +35 -0
- package/dist/worker/graphql/types/types.d.ts +5583 -0
- package/dist/worker/graphql/types/types.js +1414 -0
- package/dist/worker/handle-event.d.ts +20 -0
- package/dist/worker/handle-event.js +140 -0
- package/dist/worker/handle-worker-event.d.ts +11 -0
- package/dist/worker/handle-worker-event.js +14 -0
- package/dist/worker/types.d.ts +62 -0
- package/dist/worker/types.js +1 -0
- package/entry-client.d.ts +1 -0
- package/entry-client.js +1 -0
- package/entry-server.d.ts +1 -0
- package/entry-server.js +1 -0
- package/marker.js +1 -0
- package/middleware.d.ts +1 -0
- package/middleware.js +1 -0
- package/package.json +98 -0
- package/plugin.d.ts +1 -0
- package/plugin.js +1 -0
- package/worker.js +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as Types from '../../../graphql/types/types';
|
|
2
|
+
import { CartFragmentFragment } from './CartFragment';
|
|
3
|
+
export declare type CartLineUpdateMutationVariables = Types.Exact<{
|
|
4
|
+
cartId: Types.Scalars['ID'];
|
|
5
|
+
lines: Array<Types.CartLineUpdateInput> | Types.CartLineUpdateInput;
|
|
6
|
+
numCartLines?: Types.Maybe<Types.Scalars['Int']>;
|
|
7
|
+
}>;
|
|
8
|
+
export declare type CartLineUpdateMutation = {
|
|
9
|
+
__typename?: 'Mutation';
|
|
10
|
+
} & {
|
|
11
|
+
cartLinesUpdate?: Types.Maybe<{
|
|
12
|
+
__typename?: 'CartLinesUpdatePayload';
|
|
13
|
+
} & {
|
|
14
|
+
cart?: Types.Maybe<{
|
|
15
|
+
__typename?: 'Cart';
|
|
16
|
+
} & CartFragmentFragment>;
|
|
17
|
+
}>;
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as Types from '../../../graphql/types/types';
|
|
2
|
+
import { CartFragmentFragment } from './CartFragment';
|
|
3
|
+
export declare type CartNoteUpdateMutationVariables = Types.Exact<{
|
|
4
|
+
cartId: Types.Scalars['ID'];
|
|
5
|
+
note?: Types.Maybe<Types.Scalars['String']>;
|
|
6
|
+
numCartLines?: Types.Maybe<Types.Scalars['Int']>;
|
|
7
|
+
}>;
|
|
8
|
+
export declare type CartNoteUpdateMutation = {
|
|
9
|
+
__typename?: 'Mutation';
|
|
10
|
+
} & {
|
|
11
|
+
cartNoteUpdate?: Types.Maybe<{
|
|
12
|
+
__typename?: 'CartNoteUpdatePayload';
|
|
13
|
+
} & {
|
|
14
|
+
cart?: Types.Maybe<{
|
|
15
|
+
__typename?: 'Cart';
|
|
16
|
+
} & CartFragmentFragment>;
|
|
17
|
+
}>;
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as Types from '../../../graphql/types/types';
|
|
2
|
+
import { CartFragmentFragment } from './CartFragment';
|
|
3
|
+
export declare type CartQueryQueryVariables = Types.Exact<{
|
|
4
|
+
id: Types.Scalars['ID'];
|
|
5
|
+
numCartLines?: Types.Maybe<Types.Scalars['Int']>;
|
|
6
|
+
}>;
|
|
7
|
+
export declare type CartQueryQuery = {
|
|
8
|
+
__typename?: 'QueryRoot';
|
|
9
|
+
} & {
|
|
10
|
+
cart?: Types.Maybe<{
|
|
11
|
+
__typename?: 'Cart';
|
|
12
|
+
} & CartFragmentFragment>;
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare function useCartFetch(): <T, K>({ query, variables, }: {
|
|
2
|
+
query: string;
|
|
3
|
+
variables: T;
|
|
4
|
+
}) => Promise<{
|
|
5
|
+
data: K | undefined;
|
|
6
|
+
error: any;
|
|
7
|
+
}>;
|
|
8
|
+
export declare function useCart(): import("./types").CartWithActions;
|
|
9
|
+
export declare function useCartCheckoutUrl(): string | undefined;
|
|
10
|
+
export declare function useCartLinesTotalQuantity(): number;
|
|
11
|
+
export declare function useCartCreateCallback(): (cart: import("../../graphql/types/types").CartInput) => void;
|
|
12
|
+
export declare function useCartLinesAddCallback(): (lines: import("../../graphql/types/types").CartLineInput[]) => void;
|
|
13
|
+
export declare function useCartLinesRemoveCallback(): (lines: string[]) => void;
|
|
14
|
+
export declare function useCartLinesUpdateCallback(): (lines: import("../../graphql/types/types").CartLineUpdateInput[]) => void;
|
|
15
|
+
export declare function useCartNoteUpdateCallback(): (note: import("../../graphql/types/types").Maybe<string> | undefined) => void;
|
|
16
|
+
export declare function useCartBuyerIdentityUpdateCallback(): (buyerIdenity: import("../../graphql/types/types").CartBuyerIdentityInput) => void;
|
|
17
|
+
export declare function useCartAttributesUpdateCallback(): (attributes: import("../../graphql/types/types").AttributeInput[]) => void;
|
|
18
|
+
export declare function useCartDiscountCodesUpdateCallback(): (discountCodes: string[]) => void;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useShop } from '../../foundation';
|
|
3
|
+
import { CartContext } from './context';
|
|
4
|
+
export function useCartFetch() {
|
|
5
|
+
const { storeDomain, graphqlApiVersion, storefrontToken } = useShop();
|
|
6
|
+
return React.useCallback(({ query, variables, }) => {
|
|
7
|
+
return fetch(`https://${storeDomain}/api/${graphqlApiVersion}/graphql.json`, {
|
|
8
|
+
method: 'POST',
|
|
9
|
+
headers: {
|
|
10
|
+
'Content-Type': 'application/json',
|
|
11
|
+
'X-Shopify-Storefront-Access-Token': storefrontToken,
|
|
12
|
+
},
|
|
13
|
+
body: JSON.stringify({
|
|
14
|
+
query: query.toString(),
|
|
15
|
+
variables,
|
|
16
|
+
}),
|
|
17
|
+
})
|
|
18
|
+
.then((res) => res.json())
|
|
19
|
+
.catch((error) => {
|
|
20
|
+
return {
|
|
21
|
+
data: undefined,
|
|
22
|
+
error,
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
}, [storeDomain, graphqlApiVersion, storefrontToken]);
|
|
26
|
+
}
|
|
27
|
+
export function useCart() {
|
|
28
|
+
const context = React.useContext(CartContext);
|
|
29
|
+
if (!context) {
|
|
30
|
+
throw new Error('Expected a Cart Context, but no Cart Context was found');
|
|
31
|
+
}
|
|
32
|
+
return context;
|
|
33
|
+
}
|
|
34
|
+
export function useCartCheckoutUrl() {
|
|
35
|
+
const { checkoutUrl } = useCart();
|
|
36
|
+
return checkoutUrl;
|
|
37
|
+
}
|
|
38
|
+
export function useCartLinesTotalQuantity() {
|
|
39
|
+
var _a;
|
|
40
|
+
const { lines } = useCart();
|
|
41
|
+
const itemCount = (_a = React.useMemo(() => {
|
|
42
|
+
return lines.reduce((accumulator, line) => {
|
|
43
|
+
return accumulator + line.quantity;
|
|
44
|
+
}, 0);
|
|
45
|
+
}, [lines])) !== null && _a !== void 0 ? _a : 0;
|
|
46
|
+
return itemCount;
|
|
47
|
+
}
|
|
48
|
+
export function useCartCreateCallback() {
|
|
49
|
+
const { cartCreate } = useCart();
|
|
50
|
+
return cartCreate;
|
|
51
|
+
}
|
|
52
|
+
export function useCartLinesAddCallback() {
|
|
53
|
+
const { linesAdd } = useCart();
|
|
54
|
+
return linesAdd;
|
|
55
|
+
}
|
|
56
|
+
export function useCartLinesRemoveCallback() {
|
|
57
|
+
const { linesRemove } = useCart();
|
|
58
|
+
return linesRemove;
|
|
59
|
+
}
|
|
60
|
+
export function useCartLinesUpdateCallback() {
|
|
61
|
+
const { linesUpdate } = useCart();
|
|
62
|
+
return linesUpdate;
|
|
63
|
+
}
|
|
64
|
+
export function useCartNoteUpdateCallback() {
|
|
65
|
+
const { noteUpdate } = useCart();
|
|
66
|
+
return noteUpdate;
|
|
67
|
+
}
|
|
68
|
+
export function useCartBuyerIdentityUpdateCallback() {
|
|
69
|
+
const { buyerIdentityUpdate } = useCart();
|
|
70
|
+
return buyerIdentityUpdate;
|
|
71
|
+
}
|
|
72
|
+
export function useCartAttributesUpdateCallback() {
|
|
73
|
+
const { cartAttributesUpdate } = useCart();
|
|
74
|
+
return cartAttributesUpdate;
|
|
75
|
+
}
|
|
76
|
+
export function useCartDiscountCodesUpdateCallback() {
|
|
77
|
+
const { discountCodesUpdate } = useCart();
|
|
78
|
+
return discountCodesUpdate;
|
|
79
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { CartInput, CartLineInput, CartLineUpdateInput, MutationCartNoteUpdateArgs, CartBuyerIdentityInput, MutationCartAttributesUpdateArgs, AttributeInput } from '../../graphql/types/types';
|
|
2
|
+
import { CartDiscountCodesUpdateMutationVariables } from './graphql/CartDiscountCodesUpdateMutation';
|
|
3
|
+
import { CartFragmentFragment } from './graphql/CartFragment';
|
|
4
|
+
import { CartNoteUpdateMutationVariables } from './graphql/CartNoteUpdateMutation';
|
|
5
|
+
export declare type Status = 'uninitialized' | 'creating' | 'updating' | 'idle';
|
|
6
|
+
export interface Cart {
|
|
7
|
+
id?: string;
|
|
8
|
+
lines: CartFragmentFragment['lines']['edges'][1]['node'][];
|
|
9
|
+
checkoutUrl?: string;
|
|
10
|
+
note?: string;
|
|
11
|
+
buyerIdentity?: CartFragmentFragment['buyerIdentity'];
|
|
12
|
+
attributes: CartFragmentFragment['attributes'];
|
|
13
|
+
discountCodes?: CartFragmentFragment['discountCodes'];
|
|
14
|
+
estimatedCost?: CartFragmentFragment['estimatedCost'];
|
|
15
|
+
}
|
|
16
|
+
export interface CartWithActions extends Cart {
|
|
17
|
+
status: Status;
|
|
18
|
+
error?: string;
|
|
19
|
+
cartCreate: (cart: CartInput) => void;
|
|
20
|
+
linesAdd: (lines: CartLineInput[]) => void;
|
|
21
|
+
linesRemove: (lines: string[]) => void;
|
|
22
|
+
linesUpdate: (lines: CartLineUpdateInput[]) => void;
|
|
23
|
+
noteUpdate: (note: MutationCartNoteUpdateArgs['note']) => void;
|
|
24
|
+
buyerIdentityUpdate: (buyerIdenity: CartBuyerIdentityInput) => void;
|
|
25
|
+
cartAttributesUpdate: (attributes: MutationCartAttributesUpdateArgs['attributes']) => void;
|
|
26
|
+
discountCodesUpdate: (discountCodes: string[]) => void;
|
|
27
|
+
}
|
|
28
|
+
export declare type State = {
|
|
29
|
+
status: 'uninitialized';
|
|
30
|
+
error?: string;
|
|
31
|
+
} | {
|
|
32
|
+
status: 'creating';
|
|
33
|
+
} | {
|
|
34
|
+
status: 'updating';
|
|
35
|
+
cart: Cart;
|
|
36
|
+
lastValidCart: Cart;
|
|
37
|
+
} | {
|
|
38
|
+
status: 'idle';
|
|
39
|
+
cart: Cart;
|
|
40
|
+
error?: string;
|
|
41
|
+
};
|
|
42
|
+
export declare type CartEvent = {
|
|
43
|
+
type: 'cartCreate';
|
|
44
|
+
cart: CartInput;
|
|
45
|
+
} | {
|
|
46
|
+
type: 'addLineItem';
|
|
47
|
+
lines: CartLineInput[];
|
|
48
|
+
} | {
|
|
49
|
+
type: 'removeLineItem';
|
|
50
|
+
lines: string[];
|
|
51
|
+
} | {
|
|
52
|
+
type: 'updateLineItem';
|
|
53
|
+
lines: CartLineUpdateInput[];
|
|
54
|
+
} | {
|
|
55
|
+
type: 'noteUpdate';
|
|
56
|
+
note: CartNoteUpdateMutationVariables['note'];
|
|
57
|
+
} | {
|
|
58
|
+
type: 'buyerIdentityUpdate';
|
|
59
|
+
buyerIdentity: CartBuyerIdentityInput;
|
|
60
|
+
} | {
|
|
61
|
+
type: 'cartAttributesUpdate';
|
|
62
|
+
attributes: AttributeInput[];
|
|
63
|
+
} | {
|
|
64
|
+
type: 'discountCodesUpdate';
|
|
65
|
+
discountCodes: CartDiscountCodesUpdateMutationVariables['discountCodes'];
|
|
66
|
+
} | {
|
|
67
|
+
type: 'resolve';
|
|
68
|
+
cart: Cart;
|
|
69
|
+
} | {
|
|
70
|
+
type: 'reject';
|
|
71
|
+
error: string;
|
|
72
|
+
};
|
|
73
|
+
export declare type CartEffect = {
|
|
74
|
+
type: 'cartCreate';
|
|
75
|
+
cart: CartInput;
|
|
76
|
+
} | {
|
|
77
|
+
type: 'addLineItem';
|
|
78
|
+
cartId: string;
|
|
79
|
+
lines: CartLineInput[];
|
|
80
|
+
} | {
|
|
81
|
+
type: 'removeLineItem';
|
|
82
|
+
cartId: string;
|
|
83
|
+
lines: string[];
|
|
84
|
+
} | {
|
|
85
|
+
type: 'updateLineItem';
|
|
86
|
+
cartId: string;
|
|
87
|
+
lines: CartLineUpdateInput[];
|
|
88
|
+
} | {
|
|
89
|
+
type: 'noteUpdate';
|
|
90
|
+
cartId: string;
|
|
91
|
+
note: CartNoteUpdateMutationVariables['note'];
|
|
92
|
+
} | {
|
|
93
|
+
type: 'buyerIdentityUpdate';
|
|
94
|
+
cartId: string;
|
|
95
|
+
buyerIdentity: CartBuyerIdentityInput;
|
|
96
|
+
} | {
|
|
97
|
+
type: 'cartAttributesUpdate';
|
|
98
|
+
cartId: string;
|
|
99
|
+
attributes: AttributeInput[];
|
|
100
|
+
} | {
|
|
101
|
+
type: 'discountCodesUpdate';
|
|
102
|
+
cartId: string;
|
|
103
|
+
discountCodes: CartDiscountCodesUpdateMutationVariables['discountCodes'];
|
|
104
|
+
};
|
|
105
|
+
export declare type StateWithEffect = [State, CartEffect] | [State];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { useCart } from '../CartProvider';
|
|
3
|
+
import { ShopPayButton } from '../ShopPayButton';
|
|
4
|
+
export function CartShopPayButton({ className, }) {
|
|
5
|
+
const { lines } = useCart();
|
|
6
|
+
const ids = useMemo(() => {
|
|
7
|
+
return lines.map((line) => line.merchandise.id);
|
|
8
|
+
}, [lines]);
|
|
9
|
+
return React.createElement(ShopPayButton, { className: className, variantIds: ids });
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CartShopPayButton } from './CartShopPayButton.client';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CartShopPayButton } from './CartShopPayButton.client';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { Props } from '../types';
|
|
3
|
+
export interface CartToggleProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
declare type PropsWeControl = 'aria-expanded' | 'aria-controls' | 'onClick';
|
|
7
|
+
export declare function CartToggle<TTag extends React.ElementType = 'button'>(props: Props<TTag, PropsWeControl> & CartToggleProps): JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useCartUI } from '../CartUIProvider/hooks';
|
|
3
|
+
export function CartToggle(props) {
|
|
4
|
+
const { children, ...passthroughProps } = props;
|
|
5
|
+
const cartUI = useCartUI();
|
|
6
|
+
if (cartUI == null) {
|
|
7
|
+
throw new Error('CartToggle must be a descendent of a CartUIProvider');
|
|
8
|
+
}
|
|
9
|
+
const { isCartOpen, toggleCart, containerID } = cartUI;
|
|
10
|
+
return (React.createElement("button", { ...passthroughProps, "aria-expanded": isCartOpen, "aria-controls": containerID, onClick: toggleCart }, children));
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CartToggle } from './CartToggle.client';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CartToggle } from './CartToggle.client';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useCart } from '../CartProvider';
|
|
3
|
+
import { Money } from '../Money';
|
|
4
|
+
export function CartTotal(props) {
|
|
5
|
+
const { estimatedCost } = useCart();
|
|
6
|
+
const { children, ...passthroughProps } = props;
|
|
7
|
+
return (estimatedCost === null || estimatedCost === void 0 ? void 0 : estimatedCost.totalAmount) ? (React.createElement(Money, { ...passthroughProps, money: estimatedCost.totalAmount }, children)) : null;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CartTotal } from './CartTotal.client';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CartTotal } from './CartTotal.client';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React, { useState, useMemo, useCallback } from 'react';
|
|
2
|
+
import { CartContext } from './context';
|
|
3
|
+
export function CartUIProvider({ children }) {
|
|
4
|
+
const [open, setOpen] = useState(false);
|
|
5
|
+
const [containerID, setContainerID] = useState();
|
|
6
|
+
const openCart = useCallback(() => {
|
|
7
|
+
setOpen(true);
|
|
8
|
+
}, [setOpen]);
|
|
9
|
+
const closeCart = useCallback(() => {
|
|
10
|
+
setOpen(false);
|
|
11
|
+
}, [setOpen]);
|
|
12
|
+
const toggleCart = useCallback(() => {
|
|
13
|
+
setOpen(!open);
|
|
14
|
+
}, [setOpen, open]);
|
|
15
|
+
const contextValue = useMemo(() => {
|
|
16
|
+
return {
|
|
17
|
+
isCartOpen: open,
|
|
18
|
+
openCart,
|
|
19
|
+
closeCart,
|
|
20
|
+
toggleCart,
|
|
21
|
+
containerID,
|
|
22
|
+
setContainerID,
|
|
23
|
+
};
|
|
24
|
+
}, [open, openCart, closeCart, toggleCart, containerID]);
|
|
25
|
+
return (React.createElement(CartContext.Provider, { value: contextValue }, children));
|
|
26
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const CartContext: import("react").Context<CartContextType | null>;
|
|
2
|
+
export interface CartContextType {
|
|
3
|
+
isCartOpen: boolean;
|
|
4
|
+
openCart: () => void;
|
|
5
|
+
closeCart: () => void;
|
|
6
|
+
toggleCart: () => void;
|
|
7
|
+
containerID?: string;
|
|
8
|
+
setContainerID: (id: string) => void;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useCartUI(): import("./context").CartContextType;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { useContext } from 'react';
|
|
2
|
+
import { CartContext } from './context';
|
|
3
|
+
export function useCartUI() {
|
|
4
|
+
const context = useContext(CartContext);
|
|
5
|
+
if (!context) {
|
|
6
|
+
throw new Error('Expected a CartUI Context, but none was found');
|
|
7
|
+
}
|
|
8
|
+
return context;
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { YouTube, Vimeo } from '../../utilities';
|
|
3
|
+
import { Props } from '../types';
|
|
4
|
+
import { ExternalVideo as ExternalVideoType } from '../../graphql/types/types';
|
|
5
|
+
export interface ExternalVideoProps {
|
|
6
|
+
video: Pick<ExternalVideoType, 'host' | 'embeddedUrl' | 'id'>;
|
|
7
|
+
options?: YouTube | Vimeo;
|
|
8
|
+
}
|
|
9
|
+
declare type PropsWeControl = 'src';
|
|
10
|
+
export declare function ExternalVideo<TTag extends React.ElementType = 'iframe'>(props: Props<TTag, PropsWeControl> & ExternalVideoProps): JSX.Element;
|
|
11
|
+
export declare namespace ExternalVideo {
|
|
12
|
+
var Fragment: string;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useEmbeddedVideoUrl } from '../../utilities';
|
|
3
|
+
import { ExternalVideoFragment } from '../../graphql/graphql-constants';
|
|
4
|
+
export function ExternalVideo(props) {
|
|
5
|
+
const { video, options, id = video.id, frameBorder = '0', allow = 'accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture', allowFullScreen = true, ...passthroughProps } = props;
|
|
6
|
+
const url = useEmbeddedVideoUrl(video.embeddedUrl, options);
|
|
7
|
+
return (React.createElement("iframe", { ...passthroughProps, id: id, frameBorder: frameBorder, allow: allow, allowFullScreen: allowFullScreen, src: url }));
|
|
8
|
+
}
|
|
9
|
+
ExternalVideo.Fragment = ExternalVideoFragment;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ExternalVideo, ExternalVideoProps } from './ExternalVideo';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ExternalVideo } from './ExternalVideo';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ImageSizeOptions } from '../../utilities';
|
|
3
|
+
import { Props } from '../types';
|
|
4
|
+
import { Image as ImageType } from '../../graphql/types/types';
|
|
5
|
+
export interface ImageProps {
|
|
6
|
+
image: Pick<ImageType, 'altText' | 'originalSrc' | 'id'>;
|
|
7
|
+
options?: ImageSizeOptions;
|
|
8
|
+
}
|
|
9
|
+
declare type PropsWeControl = 'src' | 'alt';
|
|
10
|
+
export declare function Image<TTag extends React.ElementType = 'img'>(props: Props<TTag, PropsWeControl> & ImageProps): JSX.Element;
|
|
11
|
+
export declare namespace Image {
|
|
12
|
+
var Fragment: string;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useImageUrl } from '../../utilities';
|
|
3
|
+
import { ImageFragment } from '../../graphql/graphql-constants';
|
|
4
|
+
export function Image(props) {
|
|
5
|
+
var _a;
|
|
6
|
+
const { options, image, id = image.id, ...passthroughProps } = props;
|
|
7
|
+
const url = useImageUrl(image.originalSrc, options);
|
|
8
|
+
return (React.createElement("img", { id: id !== null && id !== void 0 ? id : '', ...passthroughProps, src: url, alt: (_a = image.altText) !== null && _a !== void 0 ? _a : '' }));
|
|
9
|
+
}
|
|
10
|
+
Image.Fragment = ImageFragment;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Image, ImageProps } from './Image';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Image } from './Image';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React, { useMemo, useState } from 'react';
|
|
2
|
+
import { LocalizationContext } from './LocalizationContext.client';
|
|
3
|
+
export default function LocalizationClientProvider({ localization, children, }) {
|
|
4
|
+
const [country, setCountry] = useState(localization.country);
|
|
5
|
+
const [availableCountries] = useState(localization.availableCountries);
|
|
6
|
+
const contextValue = useMemo(() => {
|
|
7
|
+
return {
|
|
8
|
+
country,
|
|
9
|
+
setCountry,
|
|
10
|
+
availableCountries,
|
|
11
|
+
};
|
|
12
|
+
}, [country, availableCountries, setCountry]);
|
|
13
|
+
return (React.createElement(LocalizationContext.Provider, { value: contextValue }, children));
|
|
14
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { LocalizationQuery } from './LocalizationQuery';
|
|
2
|
+
export declare type Localization = LocalizationQuery['localization'];
|
|
3
|
+
export interface LocalizationContextValue {
|
|
4
|
+
country?: Localization['country'];
|
|
5
|
+
availableCountries: Localization['availableCountries'];
|
|
6
|
+
setCountry: React.Dispatch<React.SetStateAction<Localization['country']>>;
|
|
7
|
+
}
|
|
8
|
+
export declare const LocalizationContext: import("react").Context<LocalizationContextValue | null>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import LocalizationClientProvider from './LocalizationClientProvider.client';
|
|
3
|
+
import { useShopQuery } from '../../hooks/useShopQuery';
|
|
4
|
+
import { Localization } from '../../graphql/graphql-constants';
|
|
5
|
+
export function LocalizationProvider({ children }) {
|
|
6
|
+
const { data: { localization }, } = useShopQuery({ query: Localization });
|
|
7
|
+
return (React.createElement(LocalizationClientProvider, { localization: localization }, children));
|
|
8
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as Types from '../../graphql/types/types';
|
|
2
|
+
export declare type LocalizationQueryVariables = Types.Exact<{
|
|
3
|
+
[key: string]: never;
|
|
4
|
+
}>;
|
|
5
|
+
export declare type LocalizationQuery = {
|
|
6
|
+
__typename?: 'QueryRoot';
|
|
7
|
+
} & {
|
|
8
|
+
localization: {
|
|
9
|
+
__typename?: 'Localization';
|
|
10
|
+
} & {
|
|
11
|
+
country: {
|
|
12
|
+
__typename?: 'Country';
|
|
13
|
+
} & Pick<Types.Country, 'isoCode' | 'name'>;
|
|
14
|
+
availableCountries: Array<{
|
|
15
|
+
__typename?: 'Country';
|
|
16
|
+
} & Pick<Types.Country, 'isoCode' | 'name'>>;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function useCountry(): (({
|
|
2
|
+
__typename?: "Country" | undefined;
|
|
3
|
+
} & Pick<import("../../graphql/types/types").Country, "name" | "isoCode">) | import("react").Dispatch<import("react").SetStateAction<{
|
|
4
|
+
__typename?: "Country" | undefined;
|
|
5
|
+
} & Pick<import("../../graphql/types/types").Country, "name" | "isoCode">>> | undefined)[];
|
|
6
|
+
export declare function useAvailableCountries(): ({
|
|
7
|
+
__typename?: "Country" | undefined;
|
|
8
|
+
} & Pick<import("../../graphql/types/types").Country, "name" | "isoCode">)[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useContext } from 'react';
|
|
2
|
+
import { LocalizationContext } from './LocalizationContext.client';
|
|
3
|
+
function useLocalization() {
|
|
4
|
+
const context = useContext(LocalizationContext);
|
|
5
|
+
if (context == null) {
|
|
6
|
+
throw new Error('No Localization Context available');
|
|
7
|
+
}
|
|
8
|
+
return context;
|
|
9
|
+
}
|
|
10
|
+
export function useCountry() {
|
|
11
|
+
const context = useLocalization();
|
|
12
|
+
return [context.country, context.setCountry];
|
|
13
|
+
}
|
|
14
|
+
export function useAvailableCountries() {
|
|
15
|
+
const context = useLocalization();
|
|
16
|
+
return context.availableCountries;
|
|
17
|
+
}
|