@graphcommerce/magento-cart-shipping-method 9.0.4-canary.9 → 9.0.4

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/CHANGELOG.md CHANGED
@@ -1,31 +1,27 @@
1
1
  # Change Log
2
2
 
3
- ## 9.0.4-canary.9
3
+ ## 9.0.4
4
4
 
5
- ## 9.0.4-canary.8
5
+ ## 9.0.3
6
6
 
7
- ## 9.0.4-canary.7
7
+ ## 9.0.3-canary.0
8
8
 
9
- ## 9.0.4-canary.6
10
-
11
- ## 9.0.4-canary.5
12
-
13
- ## 9.0.4-canary.4
14
-
15
- ## 9.0.4-canary.3
16
-
17
- ## 9.0.4-canary.2
9
+ ## 9.0.2
18
10
 
19
- ## 9.0.4-canary.1
11
+ ### Patch Changes
20
12
 
21
- ## 9.0.4-canary.0
13
+ - [`6b28b60`](https://github.com/graphcommerce-org/graphcommerce/commit/6b28b60db3f4d58b346275dfb8bcbb85744861b9) - Make sure we are correctly selecting the shipping method form when a user selects a previously selected method again. ([@paales](https://github.com/paales))
22
14
 
23
- ## 9.0.2
15
+ ## 9.0.2-canary.0
24
16
 
25
17
  ### Patch Changes
26
18
 
27
19
  - [`6b28b60`](https://github.com/graphcommerce-org/graphcommerce/commit/6b28b60db3f4d58b346275dfb8bcbb85744861b9) - Make sure we are correctly selecting the shipping method form when a user selects a previously selected method again. ([@paales](https://github.com/paales))
28
20
 
21
+ ## 9.0.1
22
+
23
+ ## 9.0.1-canary.1
24
+
29
25
  ## 9.0.0
30
26
 
31
27
  ### Major Changes
@@ -25,12 +25,13 @@ import type {
25
25
  } from './ShippingMethodForm.gql'
26
26
  import { ShippingMethodFormDocument } from './ShippingMethodForm.gql'
27
27
 
28
- type ShippingMethodFormValues = ShippingMethodFormMutationVariables & { carrierMethod?: string }
29
-
30
28
  export type ShippingMethodFormProps = Pick<UseFormComposeOptions, 'step'> & {
31
29
  sx?: SxProps<Theme>
32
30
  children?: React.ReactNode
33
- } & UseFormGraphQlOptions<ShippingMethodFormMutation, ShippingMethodFormValues>
31
+ } & UseFormGraphQlOptions<
32
+ ShippingMethodFormMutation,
33
+ ShippingMethodFormMutationVariables & { carrierMethod?: string }
34
+ >
34
35
 
35
36
  function notEmpty<TValue>(value: TValue | null | undefined): value is TValue {
36
37
  return value !== null && value !== undefined
@@ -67,17 +68,17 @@ export function ShippingMethodForm(props: ShippingMethodFormProps) {
67
68
  ? `${selectedMethod.carrier_code}-${selectedMethod.method_code}`
68
69
  : undefined
69
70
 
70
- const form = useFormGqlMutationCart<ShippingMethodFormMutation, ShippingMethodFormValues>(
71
- ShippingMethodFormDocument,
72
- {
73
- defaultValues: { carrierMethod },
74
- onBeforeSubmit: (variables) => {
75
- const [carrier, method] = (variables.carrierMethod ?? '').split('-')
76
- return onBeforeSubmit({ ...variables, carrier, method })
77
- },
78
- ...options,
71
+ const form = useFormGqlMutationCart<
72
+ ShippingMethodFormMutation,
73
+ ShippingMethodFormMutationVariables & { carrierMethod?: string }
74
+ >(ShippingMethodFormDocument, {
75
+ defaultValues: { carrierMethod },
76
+ onBeforeSubmit: (variables) => {
77
+ const [carrier, method] = (variables.carrierMethod ?? '').split('-')
78
+ return onBeforeSubmit({ ...variables, carrier, method })
79
79
  },
80
- )
80
+ ...options,
81
+ })
81
82
 
82
83
  const { handleSubmit, control, error, setValue } = form
83
84
  const submit = handleSubmit(() => {})
@@ -113,7 +114,7 @@ export function ShippingMethodForm(props: ShippingMethodFormProps) {
113
114
  }, [shippingAddress, firstCarrierMethod, carrierMethod, setValue])
114
115
 
115
116
  return (
116
- <FormProvider<ShippingMethodFormValues> {...form}>
117
+ <FormProvider {...form}>
117
118
  <FormAutoSubmit
118
119
  control={control}
119
120
  submit={submit}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/magento-cart-shipping-method",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "9.0.4-canary.9",
5
+ "version": "9.0.4",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,18 +12,18 @@
12
12
  }
13
13
  },
14
14
  "peerDependencies": {
15
- "@graphcommerce/ecommerce-ui": "^9.0.4-canary.9",
16
- "@graphcommerce/eslint-config-pwa": "^9.0.4-canary.9",
17
- "@graphcommerce/framer-scroller": "^9.0.4-canary.9",
18
- "@graphcommerce/graphql": "^9.0.4-canary.9",
19
- "@graphcommerce/image": "^9.0.4-canary.9",
20
- "@graphcommerce/magento-cart": "^9.0.4-canary.9",
21
- "@graphcommerce/magento-cart-shipping-address": "^9.0.4-canary.9",
22
- "@graphcommerce/magento-store": "^9.0.4-canary.9",
23
- "@graphcommerce/next-ui": "^9.0.4-canary.9",
24
- "@graphcommerce/prettier-config-pwa": "^9.0.4-canary.9",
25
- "@graphcommerce/react-hook-form": "^9.0.4-canary.9",
26
- "@graphcommerce/typescript-config-pwa": "^9.0.4-canary.9",
15
+ "@graphcommerce/ecommerce-ui": "^9.0.4",
16
+ "@graphcommerce/eslint-config-pwa": "^9.0.4",
17
+ "@graphcommerce/framer-scroller": "^9.0.4",
18
+ "@graphcommerce/graphql": "^9.0.4",
19
+ "@graphcommerce/image": "^9.0.4",
20
+ "@graphcommerce/magento-cart": "^9.0.4",
21
+ "@graphcommerce/magento-cart-shipping-address": "^9.0.4",
22
+ "@graphcommerce/magento-store": "^9.0.4",
23
+ "@graphcommerce/next-ui": "^9.0.4",
24
+ "@graphcommerce/prettier-config-pwa": "^9.0.4",
25
+ "@graphcommerce/react-hook-form": "^9.0.4",
26
+ "@graphcommerce/typescript-config-pwa": "^9.0.4",
27
27
  "@lingui/core": "^4.2.1",
28
28
  "@lingui/macro": "^4.2.1",
29
29
  "@lingui/react": "^4.2.1",