@shopify/hydrogen-react 0.0.0-next-1466ff0 → 0.0.0-next-5637e2e

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 (31) hide show
  1. package/dist/browser-dev/CartProvider.mjs +2 -102
  2. package/dist/browser-dev/CartProvider.mjs.map +1 -1
  3. package/dist/browser-dev/cart-queries.mjs +207 -59
  4. package/dist/browser-dev/cart-queries.mjs.map +1 -1
  5. package/dist/browser-prod/CartProvider.mjs +2 -102
  6. package/dist/browser-prod/CartProvider.mjs.map +1 -1
  7. package/dist/browser-prod/cart-queries.mjs +207 -59
  8. package/dist/browser-prod/cart-queries.mjs.map +1 -1
  9. package/dist/node-dev/CartProvider.js +3 -103
  10. package/dist/node-dev/CartProvider.js.map +1 -1
  11. package/dist/node-dev/CartProvider.mjs +2 -102
  12. package/dist/node-dev/CartProvider.mjs.map +1 -1
  13. package/dist/node-dev/cart-queries.js +206 -58
  14. package/dist/node-dev/cart-queries.js.map +1 -1
  15. package/dist/node-dev/cart-queries.mjs +207 -59
  16. package/dist/node-dev/cart-queries.mjs.map +1 -1
  17. package/dist/node-prod/CartProvider.js +3 -103
  18. package/dist/node-prod/CartProvider.js.map +1 -1
  19. package/dist/node-prod/CartProvider.mjs +2 -102
  20. package/dist/node-prod/CartProvider.mjs.map +1 -1
  21. package/dist/node-prod/cart-queries.js +206 -58
  22. package/dist/node-prod/cart-queries.js.map +1 -1
  23. package/dist/node-prod/cart-queries.mjs +207 -59
  24. package/dist/node-prod/cart-queries.mjs.map +1 -1
  25. package/dist/types/CartProvider.d.ts +0 -1
  26. package/dist/types/cart-queries.d.ts +1 -1
  27. package/dist/umd/hydrogen-react.dev.js +207 -160
  28. package/dist/umd/hydrogen-react.dev.js.map +1 -1
  29. package/dist/umd/hydrogen-react.prod.js +203 -156
  30. package/dist/umd/hydrogen-react.prod.js.map +1 -1
  31. package/package.json +3 -8
@@ -1 +1 @@
1
- {"version":3,"file":"cart-queries.mjs","sources":["../../src/cart-queries.ts"],"sourcesContent":["export const CartLineAdd = (cartFragment: string) => `\nmutation CartLineAdd($cartId: ID!, $lines: [CartLineInput!]!, $numCartLines: Int = 250, $country: CountryCode = ZZ) @inContext(country: $country) {\n cartLinesAdd(cartId: $cartId, lines: $lines) {\n cart {\n ...CartFragment\n }\n }\n}\n\n${cartFragment}\n`;\n\nexport const CartCreate = (cartFragment: string) => `\nmutation CartCreate($input: CartInput!, $numCartLines: Int = 250, $country: CountryCode = ZZ) @inContext(country: $country) {\n cartCreate(input: $input) {\n cart {\n ...CartFragment\n }\n }\n}\n\n${cartFragment}\n`;\n\nexport const CartLineRemove = (cartFragment: string) => `\nmutation CartLineRemove($cartId: ID!, $lines: [ID!]!, $numCartLines: Int = 250, $country: CountryCode = ZZ) @inContext(country: $country) {\n cartLinesRemove(cartId: $cartId, lineIds: $lines) {\n cart {\n ...CartFragment\n }\n }\n}\n\n${cartFragment}\n`;\n\nexport const CartLineUpdate = (cartFragment: string) => `\nmutation CartLineUpdate($cartId: ID!, $lines: [CartLineUpdateInput!]!, $numCartLines: Int = 250, $country: CountryCode = ZZ) @inContext(country: $country) {\n cartLinesUpdate(cartId: $cartId, lines: $lines) {\n cart {\n ...CartFragment\n }\n }\n}\n\n${cartFragment}\n`;\n\nexport const CartNoteUpdate = (cartFragment: string) => `\nmutation CartNoteUpdate($cartId: ID!, $note: String, $numCartLines: Int = 250, $country: CountryCode = ZZ) @inContext(country: $country) {\n cartNoteUpdate(cartId: $cartId, note: $note) {\n cart {\n ...CartFragment\n }\n }\n}\n\n${cartFragment}\n`;\n\nexport const CartBuyerIdentityUpdate = (cartFragment: string) => `\nmutation CartBuyerIdentityUpdate(\n $cartId: ID!\n $buyerIdentity: CartBuyerIdentityInput!\n $numCartLines: Int = 250\n $country: CountryCode = ZZ\n) @inContext(country: $country) {\n cartBuyerIdentityUpdate(cartId: $cartId, buyerIdentity: $buyerIdentity) {\n cart {\n ...CartFragment\n }\n }\n}\n\n${cartFragment}\n`;\n\nexport const CartAttributesUpdate = (cartFragment: string) => `\nmutation CartAttributesUpdate($attributes: [AttributeInput!]!, $cartId: ID!, $numCartLines: Int = 250, $country: CountryCode = ZZ) @inContext(country: $country) {\n cartAttributesUpdate(attributes: $attributes, cartId: $cartId) {\n cart {\n ...CartFragment\n }\n }\n}\n\n${cartFragment}\n`;\n\nexport const CartDiscountCodesUpdate = (cartFragment: string) => `\nmutation CartDiscountCodesUpdate($cartId: ID!, $discountCodes: [String!], $numCartLines: Int = 250, $country: CountryCode = ZZ) @inContext(country: $country) {\n cartDiscountCodesUpdate(cartId: $cartId, discountCodes: $discountCodes) {\n cart {\n ...CartFragment\n }\n }\n}\n\n${cartFragment}\n`;\n\nexport const CartQuery = (cartFragment: string) => `\nquery CartQuery($id: ID!, $numCartLines: Int = 250, $country: CountryCode = ZZ) @inContext(country: $country) {\n cart(id: $id) {\n ...CartFragment\n }\n}\n\n${cartFragment}\n`;\n\nexport const defaultCartFragment = `\nfragment CartFragment on Cart {\n id\n checkoutUrl\n totalQuantity\n buyerIdentity {\n countryCode\n customer {\n id\n email\n firstName\n lastName\n displayName\n }\n email\n phone\n }\n lines(first: $numCartLines) {\n edges {\n node {\n id\n quantity\n attributes {\n key\n value\n }\n cost {\n totalAmount {\n amount\n currencyCode\n }\n compareAtAmountPerQuantity {\n amount\n currencyCode\n }\n }\n merchandise {\n ... on ProductVariant {\n id\n availableForSale\n compareAtPriceV2 {\n ...MoneyFragment\n }\n priceV2 {\n ...MoneyFragment\n }\n requiresShipping\n title\n image {\n ...ImageFragment\n }\n product {\n handle\n title\n id\n }\n selectedOptions {\n name\n value\n }\n }\n }\n }\n }\n }\n cost {\n subtotalAmount {\n ...MoneyFragment\n }\n totalAmount {\n ...MoneyFragment\n }\n totalDutyAmount {\n ...MoneyFragment\n }\n totalTaxAmount {\n ...MoneyFragment\n }\n }\n note\n attributes {\n key\n value\n }\n discountCodes {\n code\n }\n}\n\nfragment MoneyFragment on MoneyV2 {\n currencyCode\n amount\n}\nfragment ImageFragment on Image {\n id\n url\n altText\n width\n height\n}\n`;\n"],"names":[],"mappings":"AAAa,MAAA,cAAc,CAAC,iBAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASnD;AAAA;AAGW,MAAA,aAAa,CAAC,iBAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASlD;AAAA;AAGW,MAAA,iBAAiB,CAAC,iBAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAStD;AAAA;AAGW,MAAA,iBAAiB,CAAC,iBAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAStD;AAAA;AAGW,MAAA,iBAAiB,CAAC,iBAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAStD;AAAA;AAGW,MAAA,0BAA0B,CAAC,iBAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAc/D;AAAA;AAGW,MAAA,uBAAuB,CAAC,iBAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAS5D;AAAA;AAGW,MAAA,0BAA0B,CAAC,iBAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAS/D;AAAA;AAGW,MAAA,YAAY,CAAC,iBAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOjD;AAAA;"}
1
+ {"version":3,"file":"cart-queries.mjs","sources":["../../src/cart-queries.ts"],"sourcesContent":["export const CartLineAdd = (cartFragment: string) => /* GraphQL */ `\n mutation CartLineAdd(\n $cartId: ID!\n $lines: [CartLineInput!]!\n $numCartLines: Int = 250\n $country: CountryCode = ZZ\n ) @inContext(country: $country) {\n cartLinesAdd(cartId: $cartId, lines: $lines) {\n cart {\n ...CartFragment\n }\n }\n }\n\n ${cartFragment}\n`;\n\nexport const CartCreate = (cartFragment: string) => /* GraphQL */ `\n mutation CartCreate(\n $input: CartInput!\n $numCartLines: Int = 250\n $country: CountryCode = ZZ\n ) @inContext(country: $country) {\n cartCreate(input: $input) {\n cart {\n ...CartFragment\n }\n }\n }\n\n ${cartFragment}\n`;\n\nexport const CartLineRemove = (cartFragment: string) => /* GraphQL */ `\n mutation CartLineRemove(\n $cartId: ID!\n $lines: [ID!]!\n $numCartLines: Int = 250\n $country: CountryCode = ZZ\n ) @inContext(country: $country) {\n cartLinesRemove(cartId: $cartId, lineIds: $lines) {\n cart {\n ...CartFragment\n }\n }\n }\n\n ${cartFragment}\n`;\n\nexport const CartLineUpdate = (cartFragment: string) => /* GraphQL */ `\n mutation CartLineUpdate(\n $cartId: ID!\n $lines: [CartLineUpdateInput!]!\n $numCartLines: Int = 250\n $country: CountryCode = ZZ\n ) @inContext(country: $country) {\n cartLinesUpdate(cartId: $cartId, lines: $lines) {\n cart {\n ...CartFragment\n }\n }\n }\n\n ${cartFragment}\n`;\n\nexport const CartNoteUpdate = (cartFragment: string) => /* GraphQL */ `\n mutation CartNoteUpdate(\n $cartId: ID!\n $note: String\n $numCartLines: Int = 250\n $country: CountryCode = ZZ\n ) @inContext(country: $country) {\n cartNoteUpdate(cartId: $cartId, note: $note) {\n cart {\n ...CartFragment\n }\n }\n }\n\n ${cartFragment}\n`;\n\nexport const CartBuyerIdentityUpdate = (cartFragment: string) => /* GraphQL */ `\n mutation CartBuyerIdentityUpdate(\n $cartId: ID!\n $buyerIdentity: CartBuyerIdentityInput!\n $numCartLines: Int = 250\n $country: CountryCode = ZZ\n ) @inContext(country: $country) {\n cartBuyerIdentityUpdate(cartId: $cartId, buyerIdentity: $buyerIdentity) {\n cart {\n ...CartFragment\n }\n }\n }\n\n ${cartFragment}\n`;\n\nexport const CartAttributesUpdate = (cartFragment: string) => /* GraphQL */ `\n mutation CartAttributesUpdate(\n $attributes: [AttributeInput!]!\n $cartId: ID!\n $numCartLines: Int = 250\n $country: CountryCode = ZZ\n ) @inContext(country: $country) {\n cartAttributesUpdate(attributes: $attributes, cartId: $cartId) {\n cart {\n ...CartFragment\n }\n }\n }\n\n ${cartFragment}\n`;\n\nexport const CartDiscountCodesUpdate = (cartFragment: string) => /* GraphQL */ `\n mutation CartDiscountCodesUpdate(\n $cartId: ID!\n $discountCodes: [String!]\n $numCartLines: Int = 250\n $country: CountryCode = ZZ\n ) @inContext(country: $country) {\n cartDiscountCodesUpdate(cartId: $cartId, discountCodes: $discountCodes) {\n cart {\n ...CartFragment\n }\n }\n }\n\n ${cartFragment}\n`;\n\nexport const CartQuery = (cartFragment: string) => /* GraphQL */ `\n query CartQuery(\n $id: ID!\n $numCartLines: Int = 250\n $country: CountryCode = ZZ\n ) @inContext(country: $country) {\n cart(id: $id) {\n ...CartFragment\n }\n }\n\n ${cartFragment}\n`;\n\nexport const defaultCartFragment = /* GraphQL */ `\n fragment CartFragment on Cart {\n id\n checkoutUrl\n totalQuantity\n buyerIdentity {\n countryCode\n customer {\n id\n email\n firstName\n lastName\n displayName\n }\n email\n phone\n }\n lines(first: $numCartLines) {\n edges {\n node {\n id\n quantity\n attributes {\n key\n value\n }\n cost {\n totalAmount {\n amount\n currencyCode\n }\n compareAtAmountPerQuantity {\n amount\n currencyCode\n }\n }\n merchandise {\n ... on ProductVariant {\n id\n availableForSale\n compareAtPrice {\n ...MoneyFragment\n }\n # @deprecated remove in next major\n compareAtPriceV2 {\n ...MoneyFragment\n }\n price {\n ...MoneyFragment\n }\n # @deprecated remove in next major\n priceV2 {\n ...MoneyFragment\n }\n requiresShipping\n title\n image {\n ...ImageFragment\n }\n product {\n handle\n title\n id\n }\n selectedOptions {\n name\n value\n }\n }\n }\n }\n }\n }\n cost {\n subtotalAmount {\n ...MoneyFragment\n }\n totalAmount {\n ...MoneyFragment\n }\n totalDutyAmount {\n ...MoneyFragment\n }\n totalTaxAmount {\n ...MoneyFragment\n }\n }\n note\n attributes {\n key\n value\n }\n discountCodes {\n code\n }\n }\n\n fragment MoneyFragment on MoneyV2 {\n currencyCode\n amount\n }\n fragment ImageFragment on Image {\n id\n url\n altText\n width\n height\n }\n`;\n"],"names":[],"mappings":"AAAa,MAAA,cAAc,CAAC,iBAAuC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAc/D;AAAA;AAGS,MAAA,aAAa,CAAC,iBAAuC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAa9D;AAAA;AAGS,MAAA,iBAAiB,CAAC,iBAAuC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAclE;AAAA;AAGS,MAAA,iBAAiB,CAAC,iBAAuC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAclE;AAAA;AAGS,MAAA,iBAAiB,CAAC,iBAAuC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAclE;AAAA;AAGS,MAAA,0BAA0B,CAAC,iBAAuC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAc3E;AAAA;AAGS,MAAA,uBAAuB,CAAC,iBAAuC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAcxE;AAAA;AAGS,MAAA,0BAA0B,CAAC,iBAAuC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAc3E;AAAA;AAGS,MAAA,YAAY,CAAC,iBAAuC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAW7D;AAAA;AAGG,MAAM,sBAAoC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
@@ -58,4 +58,3 @@ export declare function CartProvider({ children, numCartLines, onCreate, onLineA
58
58
  * https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API/Using_the_Web_Storage_API
59
59
  */
60
60
  export declare function storageAvailable(type: 'localStorage' | 'sessionStorage'): boolean | undefined;
61
- export declare const defaultCartFragment = "\nfragment CartFragment on Cart {\n id\n checkoutUrl\n totalQuantity\n buyerIdentity {\n countryCode\n customer {\n id\n email\n firstName\n lastName\n displayName\n }\n email\n phone\n }\n lines(first: $numCartLines) {\n edges {\n node {\n id\n quantity\n attributes {\n key\n value\n }\n cost {\n totalAmount {\n amount\n currencyCode\n }\n compareAtAmountPerQuantity {\n amount\n currencyCode\n }\n }\n merchandise {\n ... on ProductVariant {\n id\n availableForSale\n compareAtPriceV2 {\n ...MoneyFragment\n }\n priceV2 {\n ...MoneyFragment\n }\n requiresShipping\n title\n image {\n ...ImageFragment\n }\n product {\n handle\n title\n }\n selectedOptions {\n name\n value\n }\n }\n }\n }\n }\n }\n cost {\n subtotalAmount {\n ...MoneyFragment\n }\n totalAmount {\n ...MoneyFragment\n }\n totalDutyAmount {\n ...MoneyFragment\n }\n totalTaxAmount {\n ...MoneyFragment\n }\n }\n note\n attributes {\n key\n value\n }\n discountCodes {\n code\n }\n}\n\nfragment MoneyFragment on MoneyV2 {\n currencyCode\n amount\n}\nfragment ImageFragment on Image {\n id\n url\n altText\n width\n height\n}\n";
@@ -7,4 +7,4 @@ export declare const CartBuyerIdentityUpdate: (cartFragment: string) => string;
7
7
  export declare const CartAttributesUpdate: (cartFragment: string) => string;
8
8
  export declare const CartDiscountCodesUpdate: (cartFragment: string) => string;
9
9
  export declare const CartQuery: (cartFragment: string) => string;
10
- export declare const defaultCartFragment = "\nfragment CartFragment on Cart {\n id\n checkoutUrl\n totalQuantity\n buyerIdentity {\n countryCode\n customer {\n id\n email\n firstName\n lastName\n displayName\n }\n email\n phone\n }\n lines(first: $numCartLines) {\n edges {\n node {\n id\n quantity\n attributes {\n key\n value\n }\n cost {\n totalAmount {\n amount\n currencyCode\n }\n compareAtAmountPerQuantity {\n amount\n currencyCode\n }\n }\n merchandise {\n ... on ProductVariant {\n id\n availableForSale\n compareAtPriceV2 {\n ...MoneyFragment\n }\n priceV2 {\n ...MoneyFragment\n }\n requiresShipping\n title\n image {\n ...ImageFragment\n }\n product {\n handle\n title\n id\n }\n selectedOptions {\n name\n value\n }\n }\n }\n }\n }\n }\n cost {\n subtotalAmount {\n ...MoneyFragment\n }\n totalAmount {\n ...MoneyFragment\n }\n totalDutyAmount {\n ...MoneyFragment\n }\n totalTaxAmount {\n ...MoneyFragment\n }\n }\n note\n attributes {\n key\n value\n }\n discountCodes {\n code\n }\n}\n\nfragment MoneyFragment on MoneyV2 {\n currencyCode\n amount\n}\nfragment ImageFragment on Image {\n id\n url\n altText\n width\n height\n}\n";
10
+ export declare const defaultCartFragment = "\n fragment CartFragment on Cart {\n id\n checkoutUrl\n totalQuantity\n buyerIdentity {\n countryCode\n customer {\n id\n email\n firstName\n lastName\n displayName\n }\n email\n phone\n }\n lines(first: $numCartLines) {\n edges {\n node {\n id\n quantity\n attributes {\n key\n value\n }\n cost {\n totalAmount {\n amount\n currencyCode\n }\n compareAtAmountPerQuantity {\n amount\n currencyCode\n }\n }\n merchandise {\n ... on ProductVariant {\n id\n availableForSale\n compareAtPrice {\n ...MoneyFragment\n }\n # @deprecated remove in next major\n compareAtPriceV2 {\n ...MoneyFragment\n }\n price {\n ...MoneyFragment\n }\n # @deprecated remove in next major\n priceV2 {\n ...MoneyFragment\n }\n requiresShipping\n title\n image {\n ...ImageFragment\n }\n product {\n handle\n title\n id\n }\n selectedOptions {\n name\n value\n }\n }\n }\n }\n }\n }\n cost {\n subtotalAmount {\n ...MoneyFragment\n }\n totalAmount {\n ...MoneyFragment\n }\n totalDutyAmount {\n ...MoneyFragment\n }\n totalTaxAmount {\n ...MoneyFragment\n }\n }\n note\n attributes {\n key\n value\n }\n discountCodes {\n code\n }\n }\n\n fragment MoneyFragment on MoneyV2 {\n currencyCode\n amount\n }\n fragment ImageFragment on Image {\n id\n url\n altText\n width\n height\n }\n";
@@ -664,106 +664,253 @@
664
664
  return [];
665
665
  }
666
666
  const CartLineAdd = (cartFragment) => `
667
- mutation CartLineAdd($cartId: ID!, $lines: [CartLineInput!]!, $numCartLines: Int = 250, $country: CountryCode = ZZ) @inContext(country: $country) {
668
- cartLinesAdd(cartId: $cartId, lines: $lines) {
669
- cart {
670
- ...CartFragment
667
+ mutation CartLineAdd(
668
+ $cartId: ID!
669
+ $lines: [CartLineInput!]!
670
+ $numCartLines: Int = 250
671
+ $country: CountryCode = ZZ
672
+ ) @inContext(country: $country) {
673
+ cartLinesAdd(cartId: $cartId, lines: $lines) {
674
+ cart {
675
+ ...CartFragment
676
+ }
671
677
  }
672
678
  }
673
- }
674
679
 
675
- ${cartFragment}
680
+ ${cartFragment}
676
681
  `;
677
682
  const CartCreate = (cartFragment) => `
678
- mutation CartCreate($input: CartInput!, $numCartLines: Int = 250, $country: CountryCode = ZZ) @inContext(country: $country) {
679
- cartCreate(input: $input) {
680
- cart {
681
- ...CartFragment
683
+ mutation CartCreate(
684
+ $input: CartInput!
685
+ $numCartLines: Int = 250
686
+ $country: CountryCode = ZZ
687
+ ) @inContext(country: $country) {
688
+ cartCreate(input: $input) {
689
+ cart {
690
+ ...CartFragment
691
+ }
682
692
  }
683
693
  }
684
- }
685
694
 
686
- ${cartFragment}
695
+ ${cartFragment}
687
696
  `;
688
697
  const CartLineRemove = (cartFragment) => `
689
- mutation CartLineRemove($cartId: ID!, $lines: [ID!]!, $numCartLines: Int = 250, $country: CountryCode = ZZ) @inContext(country: $country) {
690
- cartLinesRemove(cartId: $cartId, lineIds: $lines) {
691
- cart {
692
- ...CartFragment
698
+ mutation CartLineRemove(
699
+ $cartId: ID!
700
+ $lines: [ID!]!
701
+ $numCartLines: Int = 250
702
+ $country: CountryCode = ZZ
703
+ ) @inContext(country: $country) {
704
+ cartLinesRemove(cartId: $cartId, lineIds: $lines) {
705
+ cart {
706
+ ...CartFragment
707
+ }
693
708
  }
694
709
  }
695
- }
696
710
 
697
- ${cartFragment}
711
+ ${cartFragment}
698
712
  `;
699
713
  const CartLineUpdate = (cartFragment) => `
700
- mutation CartLineUpdate($cartId: ID!, $lines: [CartLineUpdateInput!]!, $numCartLines: Int = 250, $country: CountryCode = ZZ) @inContext(country: $country) {
701
- cartLinesUpdate(cartId: $cartId, lines: $lines) {
702
- cart {
703
- ...CartFragment
714
+ mutation CartLineUpdate(
715
+ $cartId: ID!
716
+ $lines: [CartLineUpdateInput!]!
717
+ $numCartLines: Int = 250
718
+ $country: CountryCode = ZZ
719
+ ) @inContext(country: $country) {
720
+ cartLinesUpdate(cartId: $cartId, lines: $lines) {
721
+ cart {
722
+ ...CartFragment
723
+ }
704
724
  }
705
725
  }
706
- }
707
726
 
708
- ${cartFragment}
727
+ ${cartFragment}
709
728
  `;
710
729
  const CartNoteUpdate = (cartFragment) => `
711
- mutation CartNoteUpdate($cartId: ID!, $note: String, $numCartLines: Int = 250, $country: CountryCode = ZZ) @inContext(country: $country) {
712
- cartNoteUpdate(cartId: $cartId, note: $note) {
713
- cart {
714
- ...CartFragment
730
+ mutation CartNoteUpdate(
731
+ $cartId: ID!
732
+ $note: String
733
+ $numCartLines: Int = 250
734
+ $country: CountryCode = ZZ
735
+ ) @inContext(country: $country) {
736
+ cartNoteUpdate(cartId: $cartId, note: $note) {
737
+ cart {
738
+ ...CartFragment
739
+ }
715
740
  }
716
741
  }
717
- }
718
742
 
719
- ${cartFragment}
743
+ ${cartFragment}
720
744
  `;
721
745
  const CartBuyerIdentityUpdate = (cartFragment) => `
722
- mutation CartBuyerIdentityUpdate(
723
- $cartId: ID!
724
- $buyerIdentity: CartBuyerIdentityInput!
725
- $numCartLines: Int = 250
726
- $country: CountryCode = ZZ
727
- ) @inContext(country: $country) {
728
- cartBuyerIdentityUpdate(cartId: $cartId, buyerIdentity: $buyerIdentity) {
729
- cart {
730
- ...CartFragment
746
+ mutation CartBuyerIdentityUpdate(
747
+ $cartId: ID!
748
+ $buyerIdentity: CartBuyerIdentityInput!
749
+ $numCartLines: Int = 250
750
+ $country: CountryCode = ZZ
751
+ ) @inContext(country: $country) {
752
+ cartBuyerIdentityUpdate(cartId: $cartId, buyerIdentity: $buyerIdentity) {
753
+ cart {
754
+ ...CartFragment
755
+ }
731
756
  }
732
757
  }
733
- }
734
758
 
735
- ${cartFragment}
759
+ ${cartFragment}
736
760
  `;
737
761
  const CartAttributesUpdate = (cartFragment) => `
738
- mutation CartAttributesUpdate($attributes: [AttributeInput!]!, $cartId: ID!, $numCartLines: Int = 250, $country: CountryCode = ZZ) @inContext(country: $country) {
739
- cartAttributesUpdate(attributes: $attributes, cartId: $cartId) {
740
- cart {
741
- ...CartFragment
762
+ mutation CartAttributesUpdate(
763
+ $attributes: [AttributeInput!]!
764
+ $cartId: ID!
765
+ $numCartLines: Int = 250
766
+ $country: CountryCode = ZZ
767
+ ) @inContext(country: $country) {
768
+ cartAttributesUpdate(attributes: $attributes, cartId: $cartId) {
769
+ cart {
770
+ ...CartFragment
771
+ }
742
772
  }
743
773
  }
744
- }
745
774
 
746
- ${cartFragment}
775
+ ${cartFragment}
747
776
  `;
748
777
  const CartDiscountCodesUpdate = (cartFragment) => `
749
- mutation CartDiscountCodesUpdate($cartId: ID!, $discountCodes: [String!], $numCartLines: Int = 250, $country: CountryCode = ZZ) @inContext(country: $country) {
750
- cartDiscountCodesUpdate(cartId: $cartId, discountCodes: $discountCodes) {
751
- cart {
752
- ...CartFragment
778
+ mutation CartDiscountCodesUpdate(
779
+ $cartId: ID!
780
+ $discountCodes: [String!]
781
+ $numCartLines: Int = 250
782
+ $country: CountryCode = ZZ
783
+ ) @inContext(country: $country) {
784
+ cartDiscountCodesUpdate(cartId: $cartId, discountCodes: $discountCodes) {
785
+ cart {
786
+ ...CartFragment
787
+ }
753
788
  }
754
789
  }
755
- }
756
790
 
757
- ${cartFragment}
791
+ ${cartFragment}
758
792
  `;
759
793
  const CartQuery = (cartFragment) => `
760
- query CartQuery($id: ID!, $numCartLines: Int = 250, $country: CountryCode = ZZ) @inContext(country: $country) {
761
- cart(id: $id) {
762
- ...CartFragment
794
+ query CartQuery(
795
+ $id: ID!
796
+ $numCartLines: Int = 250
797
+ $country: CountryCode = ZZ
798
+ ) @inContext(country: $country) {
799
+ cart(id: $id) {
800
+ ...CartFragment
801
+ }
763
802
  }
764
- }
765
803
 
766
- ${cartFragment}
804
+ ${cartFragment}
805
+ `;
806
+ const defaultCartFragment = `
807
+ fragment CartFragment on Cart {
808
+ id
809
+ checkoutUrl
810
+ totalQuantity
811
+ buyerIdentity {
812
+ countryCode
813
+ customer {
814
+ id
815
+ email
816
+ firstName
817
+ lastName
818
+ displayName
819
+ }
820
+ email
821
+ phone
822
+ }
823
+ lines(first: $numCartLines) {
824
+ edges {
825
+ node {
826
+ id
827
+ quantity
828
+ attributes {
829
+ key
830
+ value
831
+ }
832
+ cost {
833
+ totalAmount {
834
+ amount
835
+ currencyCode
836
+ }
837
+ compareAtAmountPerQuantity {
838
+ amount
839
+ currencyCode
840
+ }
841
+ }
842
+ merchandise {
843
+ ... on ProductVariant {
844
+ id
845
+ availableForSale
846
+ compareAtPrice {
847
+ ...MoneyFragment
848
+ }
849
+ # @deprecated remove in next major
850
+ compareAtPriceV2 {
851
+ ...MoneyFragment
852
+ }
853
+ price {
854
+ ...MoneyFragment
855
+ }
856
+ # @deprecated remove in next major
857
+ priceV2 {
858
+ ...MoneyFragment
859
+ }
860
+ requiresShipping
861
+ title
862
+ image {
863
+ ...ImageFragment
864
+ }
865
+ product {
866
+ handle
867
+ title
868
+ id
869
+ }
870
+ selectedOptions {
871
+ name
872
+ value
873
+ }
874
+ }
875
+ }
876
+ }
877
+ }
878
+ }
879
+ cost {
880
+ subtotalAmount {
881
+ ...MoneyFragment
882
+ }
883
+ totalAmount {
884
+ ...MoneyFragment
885
+ }
886
+ totalDutyAmount {
887
+ ...MoneyFragment
888
+ }
889
+ totalTaxAmount {
890
+ ...MoneyFragment
891
+ }
892
+ }
893
+ note
894
+ attributes {
895
+ key
896
+ value
897
+ }
898
+ discountCodes {
899
+ code
900
+ }
901
+ }
902
+
903
+ fragment MoneyFragment on MoneyV2 {
904
+ currencyCode
905
+ amount
906
+ }
907
+ fragment ImageFragment on Image {
908
+ id
909
+ url
910
+ altText
911
+ width
912
+ height
913
+ }
767
914
  `;
768
915
  const SFAPI_VERSION = "2022-10";
769
916
  const warnings = /* @__PURE__ */ new Set();
@@ -1483,7 +1630,7 @@ ${cartFragment}
1483
1630
  data: cart,
1484
1631
  cartFragment,
1485
1632
  countryCode,
1486
- onCartActionEntry(context, event) {
1633
+ onCartActionEntry(_, event) {
1487
1634
  try {
1488
1635
  switch (event.type) {
1489
1636
  case "CART_CREATE":
@@ -1744,7 +1891,7 @@ ${cartFragment}
1744
1891
  __self: this,
1745
1892
  __source: {
1746
1893
  fileName: _jsxFileName$e,
1747
- lineNumber: 423,
1894
+ lineNumber: 424,
1748
1895
  columnNumber: 5
1749
1896
  }
1750
1897
  }, children);
@@ -1809,106 +1956,6 @@ ${cartFragment}
1809
1956
  var _a, _b;
1810
1957
  return event.payload.buyerIdentity.countryCode && ((_b = (_a = context.cart) == null ? void 0 : _a.buyerIdentity) == null ? void 0 : _b.countryCode) !== event.payload.buyerIdentity.countryCode;
1811
1958
  }
1812
- const defaultCartFragment = `
1813
- fragment CartFragment on Cart {
1814
- id
1815
- checkoutUrl
1816
- totalQuantity
1817
- buyerIdentity {
1818
- countryCode
1819
- customer {
1820
- id
1821
- email
1822
- firstName
1823
- lastName
1824
- displayName
1825
- }
1826
- email
1827
- phone
1828
- }
1829
- lines(first: $numCartLines) {
1830
- edges {
1831
- node {
1832
- id
1833
- quantity
1834
- attributes {
1835
- key
1836
- value
1837
- }
1838
- cost {
1839
- totalAmount {
1840
- amount
1841
- currencyCode
1842
- }
1843
- compareAtAmountPerQuantity {
1844
- amount
1845
- currencyCode
1846
- }
1847
- }
1848
- merchandise {
1849
- ... on ProductVariant {
1850
- id
1851
- availableForSale
1852
- compareAtPriceV2 {
1853
- ...MoneyFragment
1854
- }
1855
- priceV2 {
1856
- ...MoneyFragment
1857
- }
1858
- requiresShipping
1859
- title
1860
- image {
1861
- ...ImageFragment
1862
- }
1863
- product {
1864
- handle
1865
- title
1866
- }
1867
- selectedOptions {
1868
- name
1869
- value
1870
- }
1871
- }
1872
- }
1873
- }
1874
- }
1875
- }
1876
- cost {
1877
- subtotalAmount {
1878
- ...MoneyFragment
1879
- }
1880
- totalAmount {
1881
- ...MoneyFragment
1882
- }
1883
- totalDutyAmount {
1884
- ...MoneyFragment
1885
- }
1886
- totalTaxAmount {
1887
- ...MoneyFragment
1888
- }
1889
- }
1890
- note
1891
- attributes {
1892
- key
1893
- value
1894
- }
1895
- discountCodes {
1896
- code
1897
- }
1898
- }
1899
-
1900
- fragment MoneyFragment on MoneyV2 {
1901
- currencyCode
1902
- amount
1903
- }
1904
- fragment ImageFragment on Image {
1905
- id
1906
- url
1907
- altText
1908
- width
1909
- height
1910
- }
1911
- `;
1912
1959
  var _jsxFileName$d = "/home/runner/work/hydrogen-ui/hydrogen-ui/packages/react/src/ProductProvider.tsx";
1913
1960
  const ProductOptionsContext = React.createContext(null);
1914
1961
  function ProductProvider({