@shopify/hydrogen-react 2026.1.2 → 2026.4.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 (147) hide show
  1. package/customer-account.schema.json +1 -1
  2. package/dist/browser-dev/CartLineProvider.mjs.map +1 -1
  3. package/dist/browser-dev/CartProvider.mjs.map +1 -1
  4. package/dist/browser-dev/Image.mjs.map +1 -1
  5. package/dist/browser-dev/ModelViewer.mjs.map +1 -1
  6. package/dist/browser-dev/Money.mjs.map +1 -1
  7. package/dist/browser-dev/Video.mjs.map +1 -1
  8. package/dist/browser-dev/analytics-schema-custom-storefront-customer-tracking.mjs +1 -1
  9. package/dist/browser-dev/codegen.helpers.mjs.map +1 -1
  10. package/dist/browser-dev/node_modules/.pnpm/@xstate_fsm@2.0.0/node_modules/@xstate/fsm/es/index.mjs +151 -0
  11. package/dist/browser-dev/node_modules/.pnpm/@xstate_fsm@2.0.0/node_modules/@xstate/fsm/es/index.mjs.map +1 -0
  12. package/dist/browser-dev/optionValueDecoder.mjs.map +1 -1
  13. package/dist/browser-dev/{package.json.mjs → packages/hydrogen-react/package.json.mjs} +1 -1
  14. package/dist/browser-dev/storefront-api-constants.mjs +1 -1
  15. package/dist/browser-dev/storefront-api-constants.mjs.map +1 -1
  16. package/dist/browser-dev/useCartAPIStateMachine.mjs +8 -8
  17. package/dist/browser-dev/useCartAPIStateMachine.mjs.map +1 -1
  18. package/dist/browser-dev/useCartActions.mjs.map +1 -1
  19. package/dist/browser-dev/useMachine.mjs +4 -4
  20. package/dist/browser-dev/useMachine.mjs.map +1 -1
  21. package/dist/browser-dev/useMoney.mjs.map +1 -1
  22. package/dist/browser-prod/CartLineProvider.mjs.map +1 -1
  23. package/dist/browser-prod/CartProvider.mjs.map +1 -1
  24. package/dist/browser-prod/Image.mjs.map +1 -1
  25. package/dist/browser-prod/ModelViewer.mjs.map +1 -1
  26. package/dist/browser-prod/Money.mjs.map +1 -1
  27. package/dist/browser-prod/Video.mjs.map +1 -1
  28. package/dist/browser-prod/analytics-schema-custom-storefront-customer-tracking.mjs +1 -1
  29. package/dist/browser-prod/codegen.helpers.mjs.map +1 -1
  30. package/dist/browser-prod/node_modules/.pnpm/@xstate_fsm@2.0.0/node_modules/@xstate/fsm/es/index.mjs +151 -0
  31. package/dist/browser-prod/node_modules/.pnpm/@xstate_fsm@2.0.0/node_modules/@xstate/fsm/es/index.mjs.map +1 -0
  32. package/dist/browser-prod/optionValueDecoder.mjs.map +1 -1
  33. package/dist/{node-dev → browser-prod/packages/hydrogen-react}/package.json.mjs +1 -1
  34. package/dist/browser-prod/storefront-api-constants.mjs +1 -1
  35. package/dist/browser-prod/storefront-api-constants.mjs.map +1 -1
  36. package/dist/browser-prod/useCartAPIStateMachine.mjs +8 -8
  37. package/dist/browser-prod/useCartAPIStateMachine.mjs.map +1 -1
  38. package/dist/browser-prod/useCartActions.mjs.map +1 -1
  39. package/dist/browser-prod/useMachine.mjs +4 -4
  40. package/dist/browser-prod/useMachine.mjs.map +1 -1
  41. package/dist/browser-prod/useMoney.mjs.map +1 -1
  42. package/dist/node-dev/CartLineProvider.js.map +1 -1
  43. package/dist/node-dev/CartLineProvider.mjs.map +1 -1
  44. package/dist/node-dev/CartProvider.js.map +1 -1
  45. package/dist/node-dev/CartProvider.mjs.map +1 -1
  46. package/dist/node-dev/Image.js.map +1 -1
  47. package/dist/node-dev/Image.mjs.map +1 -1
  48. package/dist/node-dev/ModelViewer.js.map +1 -1
  49. package/dist/node-dev/ModelViewer.mjs.map +1 -1
  50. package/dist/node-dev/Money.js.map +1 -1
  51. package/dist/node-dev/Money.mjs.map +1 -1
  52. package/dist/node-dev/Video.js.map +1 -1
  53. package/dist/node-dev/Video.mjs.map +1 -1
  54. package/dist/node-dev/analytics-schema-custom-storefront-customer-tracking.js +1 -1
  55. package/dist/node-dev/analytics-schema-custom-storefront-customer-tracking.mjs +1 -1
  56. package/dist/node-dev/codegen.helpers.js.map +1 -1
  57. package/dist/node-dev/codegen.helpers.mjs.map +1 -1
  58. package/dist/node-dev/node_modules/.pnpm/@xstate_fsm@2.0.0/node_modules/@xstate/fsm/es/index.js +150 -0
  59. package/dist/node-dev/node_modules/.pnpm/@xstate_fsm@2.0.0/node_modules/@xstate/fsm/es/index.js.map +1 -0
  60. package/dist/node-dev/node_modules/.pnpm/@xstate_fsm@2.0.0/node_modules/@xstate/fsm/es/index.mjs +151 -0
  61. package/dist/node-dev/node_modules/.pnpm/@xstate_fsm@2.0.0/node_modules/@xstate/fsm/es/index.mjs.map +1 -0
  62. package/dist/node-dev/optionValueDecoder.js.map +1 -1
  63. package/dist/node-dev/optionValueDecoder.mjs.map +1 -1
  64. package/dist/node-dev/{package.json.js → packages/hydrogen-react/package.json.js} +1 -1
  65. package/dist/{browser-prod → node-dev/packages/hydrogen-react}/package.json.mjs +1 -1
  66. package/dist/node-dev/storefront-api-constants.js +1 -1
  67. package/dist/node-dev/storefront-api-constants.js.map +1 -1
  68. package/dist/node-dev/storefront-api-constants.mjs +1 -1
  69. package/dist/node-dev/storefront-api-constants.mjs.map +1 -1
  70. package/dist/node-dev/useCartAPIStateMachine.js +8 -8
  71. package/dist/node-dev/useCartAPIStateMachine.js.map +1 -1
  72. package/dist/node-dev/useCartAPIStateMachine.mjs +8 -8
  73. package/dist/node-dev/useCartAPIStateMachine.mjs.map +1 -1
  74. package/dist/node-dev/useCartActions.js.map +1 -1
  75. package/dist/node-dev/useCartActions.mjs.map +1 -1
  76. package/dist/node-dev/useMachine.js +4 -4
  77. package/dist/node-dev/useMachine.js.map +1 -1
  78. package/dist/node-dev/useMachine.mjs +4 -4
  79. package/dist/node-dev/useMachine.mjs.map +1 -1
  80. package/dist/node-dev/useMoney.js.map +1 -1
  81. package/dist/node-dev/useMoney.mjs.map +1 -1
  82. package/dist/node-prod/CartLineProvider.js.map +1 -1
  83. package/dist/node-prod/CartLineProvider.mjs.map +1 -1
  84. package/dist/node-prod/CartProvider.js.map +1 -1
  85. package/dist/node-prod/CartProvider.mjs.map +1 -1
  86. package/dist/node-prod/Image.js.map +1 -1
  87. package/dist/node-prod/Image.mjs.map +1 -1
  88. package/dist/node-prod/ModelViewer.js.map +1 -1
  89. package/dist/node-prod/ModelViewer.mjs.map +1 -1
  90. package/dist/node-prod/Money.js.map +1 -1
  91. package/dist/node-prod/Money.mjs.map +1 -1
  92. package/dist/node-prod/Video.js.map +1 -1
  93. package/dist/node-prod/Video.mjs.map +1 -1
  94. package/dist/node-prod/analytics-schema-custom-storefront-customer-tracking.js +1 -1
  95. package/dist/node-prod/analytics-schema-custom-storefront-customer-tracking.mjs +1 -1
  96. package/dist/node-prod/codegen.helpers.js.map +1 -1
  97. package/dist/node-prod/codegen.helpers.mjs.map +1 -1
  98. package/dist/node-prod/node_modules/.pnpm/@xstate_fsm@2.0.0/node_modules/@xstate/fsm/es/index.js +150 -0
  99. package/dist/node-prod/node_modules/.pnpm/@xstate_fsm@2.0.0/node_modules/@xstate/fsm/es/index.js.map +1 -0
  100. package/dist/node-prod/node_modules/.pnpm/@xstate_fsm@2.0.0/node_modules/@xstate/fsm/es/index.mjs +151 -0
  101. package/dist/node-prod/node_modules/.pnpm/@xstate_fsm@2.0.0/node_modules/@xstate/fsm/es/index.mjs.map +1 -0
  102. package/dist/node-prod/optionValueDecoder.js.map +1 -1
  103. package/dist/node-prod/optionValueDecoder.mjs.map +1 -1
  104. package/dist/node-prod/{package.json.js → packages/hydrogen-react/package.json.js} +1 -1
  105. package/dist/node-prod/{package.json.mjs → packages/hydrogen-react/package.json.mjs} +1 -1
  106. package/dist/node-prod/storefront-api-constants.js +1 -1
  107. package/dist/node-prod/storefront-api-constants.js.map +1 -1
  108. package/dist/node-prod/storefront-api-constants.mjs +1 -1
  109. package/dist/node-prod/storefront-api-constants.mjs.map +1 -1
  110. package/dist/node-prod/useCartAPIStateMachine.js +8 -8
  111. package/dist/node-prod/useCartAPIStateMachine.js.map +1 -1
  112. package/dist/node-prod/useCartAPIStateMachine.mjs +8 -8
  113. package/dist/node-prod/useCartAPIStateMachine.mjs.map +1 -1
  114. package/dist/node-prod/useCartActions.js.map +1 -1
  115. package/dist/node-prod/useCartActions.mjs.map +1 -1
  116. package/dist/node-prod/useMachine.js +4 -4
  117. package/dist/node-prod/useMachine.js.map +1 -1
  118. package/dist/node-prod/useMachine.mjs +4 -4
  119. package/dist/node-prod/useMachine.mjs.map +1 -1
  120. package/dist/node-prod/useMoney.js.map +1 -1
  121. package/dist/node-prod/useMoney.mjs.map +1 -1
  122. package/dist/types/CartLineProvider.d.ts +1 -1
  123. package/dist/types/CartProvider.d.ts +2 -2
  124. package/dist/types/Image.d.ts +1 -1
  125. package/dist/types/ModelViewer.d.ts +1 -1
  126. package/dist/types/Money.d.ts +4 -4
  127. package/dist/types/Video.d.ts +1 -1
  128. package/dist/types/codegen.helpers.d.ts +2 -2
  129. package/dist/types/customer-account-api-types.d.ts +23 -1
  130. package/dist/types/optionValueDecoder.d.ts +2 -2
  131. package/dist/types/storefront-api-constants.d.ts +1 -1
  132. package/dist/types/storefront-api-types.d.ts +1467 -443
  133. package/dist/types/useCartAPIStateMachine.d.ts +2 -2
  134. package/dist/types/useCartActions.d.ts +2 -2
  135. package/dist/types/useMoney.d.ts +2 -2
  136. package/dist/umd/hydrogen-react.dev.js +2 -2
  137. package/dist/umd/hydrogen-react.dev.js.map +1 -1
  138. package/dist/umd/hydrogen-react.prod.js +2 -2
  139. package/dist/umd/hydrogen-react.prod.js.map +1 -1
  140. package/package.json +3 -3
  141. package/storefront.schema.json +1 -1
  142. /package/dist/browser-dev/{package.json.mjs.map → packages/hydrogen-react/package.json.mjs.map} +0 -0
  143. /package/dist/browser-prod/{package.json.mjs.map → packages/hydrogen-react/package.json.mjs.map} +0 -0
  144. /package/dist/node-dev/{package.json.js.map → packages/hydrogen-react/package.json.js.map} +0 -0
  145. /package/dist/node-dev/{package.json.mjs.map → packages/hydrogen-react/package.json.mjs.map} +0 -0
  146. /package/dist/node-prod/{package.json.js.map → packages/hydrogen-react/package.json.js.map} +0 -0
  147. /package/dist/node-prod/{package.json.mjs.map → packages/hydrogen-react/package.json.mjs.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * THIS FILE IS AUTO-GENERATED, DO NOT EDIT
3
- * Based on Customer Account API 2026-01
3
+ * Based on Customer Account API 2026-04
4
4
  * If changes need to happen to the types defined in this file, then generally the Storefront API needs to update. After it's updated, you can run `npm run graphql-types`.
5
5
  * Except custom Scalars, which are defined in the `codegen.ts` file
6
6
  */
@@ -2906,6 +2906,8 @@ export type DraftOrder = Node & {
2906
2906
  currencyCode: CurrencyCode;
2907
2907
  /** The customer who placed the order. */
2908
2908
  customer?: Maybe<Customer>;
2909
+ /** List of discounts applied to the draft order. */
2910
+ discountApplications: DiscountApplicationConnection;
2909
2911
  /** The discount information for the draft order. */
2910
2912
  discountInformation: DraftOrderDiscountInformation;
2911
2913
  /** The email address of the customer, which is used to send notifications to. */
@@ -2965,11 +2967,21 @@ export type DraftOrder = Node & {
2965
2967
  updatedAt: Scalars['DateTime']['output'];
2966
2968
  };
2967
2969
 
2970
+ /** A draft order for the customer. Any fields related to money are in the presentment currency. Apps using the Customer Account API must meet the protected customer data [requirements](https://shopify.dev/docs/apps/launch/protected-customer-data). */
2971
+ export type DraftOrderDiscountApplicationsArgs = {
2972
+ after?: InputMaybe<Scalars['String']['input']>;
2973
+ before?: InputMaybe<Scalars['String']['input']>;
2974
+ first?: InputMaybe<Scalars['Int']['input']>;
2975
+ last?: InputMaybe<Scalars['Int']['input']>;
2976
+ reverse?: InputMaybe<Scalars['Boolean']['input']>;
2977
+ };
2978
+
2968
2979
  /** A draft order for the customer. Any fields related to money are in the presentment currency. Apps using the Customer Account API must meet the protected customer data [requirements](https://shopify.dev/docs/apps/launch/protected-customer-data). */
2969
2980
  export type DraftOrderLineItemsArgs = {
2970
2981
  after?: InputMaybe<Scalars['String']['input']>;
2971
2982
  before?: InputMaybe<Scalars['String']['input']>;
2972
2983
  first?: InputMaybe<Scalars['Int']['input']>;
2984
+ flattenComponents?: InputMaybe<Scalars['Boolean']['input']>;
2973
2985
  last?: InputMaybe<Scalars['Int']['input']>;
2974
2986
  reverse?: InputMaybe<Scalars['Boolean']['input']>;
2975
2987
  };
@@ -3037,6 +3049,10 @@ export type DraftOrderConnection = {
3037
3049
  /** The discount information associated with a draft order. */
3038
3050
  export type DraftOrderDiscountInformation = {
3039
3051
  __typename?: 'DraftOrderDiscountInformation';
3052
+ /** The discount information for the draft order, including line_level discount applications. */
3053
+ allAppliedDiscounts: Array<OrderAllDiscounts>;
3054
+ /** The order level discount information for the draft order. */
3055
+ allOrderLevelAppliedDiscounts: Array<OrderAllDiscounts>;
3040
3056
  /** The order-level discount applied to the draft order. */
3041
3057
  appliedDiscount?: Maybe<DraftOrderAppliedDiscount>;
3042
3058
  /** The total discounts applied to the draft order. */
@@ -3055,6 +3071,12 @@ export type DraftOrderEdge = {
3055
3071
  /** A line item included in a draft order. */
3056
3072
  export type DraftOrderLineItem = Node & {
3057
3073
  __typename?: 'DraftOrderLineItem';
3074
+ /** The discounted total divided by the quantity, resulting in an average per-unit price reduction. */
3075
+ approximateDiscountedUnitPrice: MoneyV2;
3076
+ /** The list of components for this draft order line item. */
3077
+ components: Array<DraftOrderLineItem>;
3078
+ /** List of discounts allocated to the draft order line item. */
3079
+ discountAllocations: Array<DiscountAllocation>;
3058
3080
  /** The discount information for the draft order line item. */
3059
3081
  discountInformation: DraftOrderLineItemDiscountInformation;
3060
3082
  /** The total price of the line item after discounts have been applied. */
@@ -14,7 +14,7 @@ export type IsOptionValueCombinationInEncodedVariant = (targetOptionValueCombina
14
14
  * Determine whether an option value combination is present in an encoded option value string. Function is memoized by encodedVariantField.
15
15
  *
16
16
  * @param targetOptionValueCombination - Indices of option values to look up in the encoded option value string. A partial set of indices may be passed to determine whether a node or any children is present. For example, if a product has 3 options, passing [0] will return true if any option value combination for the first option's option value is present in the encoded string.
17
- * @param encodedVariantField - Encoded option value string from the Storefront API, e.g. [product.encodedVariantExistence](/docs/api/storefront/2026-01/objects/Product#field-encodedvariantexistence) or [product.encodedVariantAvailability](/docs/api/storefront/2026-01/objects/Product#field-encodedvariantavailability)
17
+ * @param encodedVariantField - Encoded option value string from the Storefront API, e.g. [product.encodedVariantExistence](/docs/api/storefront/2026-04/objects/Product#field-encodedvariantexistence) or [product.encodedVariantAvailability](/docs/api/storefront/2026-04/objects/Product#field-encodedvariantavailability)
18
18
  * @returns - True if a full or partial targetOptionValueIndices is present in the encoded option value string, false otherwise.
19
19
  */
20
20
  export declare const isOptionValueCombinationInEncodedVariant: IsOptionValueCombinationInEncodedVariant;
@@ -22,7 +22,7 @@ type EncodedVariantField = Product['encodedVariantAvailability'] | Product['enco
22
22
  type DecodedOptionValues = number[][];
23
23
  /**
24
24
  * For an encoded option value string, decode into option value combinations. Entries represent a valid combination formatted as an array of option value positions.
25
- * @param encodedVariantField - Encoded option value string from the Storefront API, e.g. [product.encodedVariantExistence](/docs/api/storefront/2026-01/objects/Product#field-encodedvariantexistence) or [product.encodedVariantAvailability](/docs/api/storefront/2026-01/objects/Product#field-encodedvariantavailability)
25
+ * @param encodedVariantField - Encoded option value string from the Storefront API, e.g. [product.encodedVariantExistence](/docs/api/storefront/2026-04/objects/Product#field-encodedvariantexistence) or [product.encodedVariantAvailability](/docs/api/storefront/2026-04/objects/Product#field-encodedvariantavailability)
26
26
  * @returns Decoded option value combinations
27
27
  */
28
28
  export declare function decodeEncodedVariant(encodedVariantField: EncodedVariantField): DecodedOptionValues;
@@ -1 +1 @@
1
- export declare const SFAPI_VERSION = "2026-01";
1
+ export declare const SFAPI_VERSION = "2026-04";