@graphcommerce/googleanalytics 6.2.0-canary.87 → 6.2.0-canary.89

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,5 +1,17 @@
1
1
  # Change Log
2
2
 
3
+ ## 6.2.0-canary.89
4
+
5
+ ### Patch Changes
6
+
7
+ - [#2031](https://github.com/graphcommerce-org/graphcommerce/pull/2031) [`4d8fc9e99`](https://github.com/graphcommerce-org/graphcommerce/commit/4d8fc9e998fc9361282833316ec9564da0644ed6) - Eslint fixes and suppress accepted warnings ([@paales](https://github.com/paales))
8
+
9
+ ## 6.2.0-canary.88
10
+
11
+ ### Patch Changes
12
+
13
+ - [`372c8974b`](https://github.com/graphcommerce-org/graphcommerce/commit/372c8974b8724a603d5d9e80f708a2d695055559) - Fix regression with the new cart renderer ([@paales](https://github.com/paales))
14
+
3
15
  ## 6.2.0-canary.87
4
16
 
5
17
  ## 6.2.0-canary.86
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/googleanalytics",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "6.2.0-canary.87",
5
+ "version": "6.2.0-canary.89",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,18 +12,18 @@
12
12
  }
13
13
  },
14
14
  "dependencies": {
15
- "@graphcommerce/graphql-mesh": "6.2.0-canary.87",
16
- "@graphcommerce/magento-cart": "6.2.0-canary.87",
17
- "@graphcommerce/magento-cart-payment-method": "6.2.0-canary.87",
18
- "@graphcommerce/magento-cart-shipping-method": "6.2.0-canary.87",
19
- "@graphcommerce/magento-product": "6.2.0-canary.87",
20
- "@graphcommerce/next-config": "6.2.0-canary.87",
21
- "@graphcommerce/next-ui": "6.2.0-canary.87"
15
+ "@graphcommerce/graphql-mesh": "6.2.0-canary.89",
16
+ "@graphcommerce/magento-cart": "6.2.0-canary.89",
17
+ "@graphcommerce/magento-cart-payment-method": "6.2.0-canary.89",
18
+ "@graphcommerce/magento-cart-shipping-method": "6.2.0-canary.89",
19
+ "@graphcommerce/magento-product": "6.2.0-canary.89",
20
+ "@graphcommerce/next-config": "6.2.0-canary.89",
21
+ "@graphcommerce/next-ui": "6.2.0-canary.89"
22
22
  },
23
23
  "devDependencies": {
24
- "@graphcommerce/eslint-config-pwa": "6.2.0-canary.87",
25
- "@graphcommerce/prettier-config-pwa": "6.2.0-canary.87",
26
- "@graphcommerce/typescript-config-pwa": "6.2.0-canary.87",
24
+ "@graphcommerce/eslint-config-pwa": "6.2.0-canary.89",
25
+ "@graphcommerce/prettier-config-pwa": "6.2.0-canary.89",
26
+ "@graphcommerce/typescript-config-pwa": "6.2.0-canary.89",
27
27
  "@types/gtag.js": "^0.0.12"
28
28
  },
29
29
  "peerDependencies": {
@@ -1,32 +1,26 @@
1
- import { RemoveItemFromCartProps } from '@graphcommerce/magento-cart-items'
2
- import { IfConfig, PluginProps } from '@graphcommerce/next-config'
1
+ import type { RemoveItemFromCart } from '@graphcommerce/magento-cart-items'
2
+ import { IfConfig, ReactPlugin } from '@graphcommerce/next-config'
3
3
  import { gtagRemoveFromCart } from '../events/gtagRemoveFromCart/gtagRemoveFromCart'
4
4
 
5
5
  export const component = 'RemoveItemFromCartFab'
6
6
  export const exported = '@graphcommerce/magento-cart-items/RemoveItemFromCart/RemoveItemFromCartFab'
7
7
  export const ifConfig: IfConfig = 'googleAnalyticsId'
8
8
 
9
- export function GaRemoveItemFromCart(props: PluginProps<RemoveItemFromCartProps>) {
10
- const { Prev, uid, quantity, prices, product, onClick } = props
9
+ export const GaRemoveItemFromCart: ReactPlugin<typeof RemoveItemFromCart> = (props) => {
10
+ const { Prev, uid, quantity, prices, product, buttonProps } = props
11
11
 
12
12
  return (
13
13
  <Prev
14
14
  {...props}
15
15
  product={product}
16
- onClick={(e) => {
17
- gtagRemoveFromCart({
18
- __typename: 'Cart',
19
- items: [
20
- {
21
- uid,
22
- __typename: 'SimpleCartItem',
23
- product,
24
- quantity,
25
- prices,
26
- },
27
- ],
28
- })
29
- onClick?.(e)
16
+ buttonProps={{
17
+ onClick: (e) => {
18
+ gtagRemoveFromCart({
19
+ __typename: 'Cart',
20
+ items: [{ uid, __typename: 'SimpleCartItem', product, quantity, prices }],
21
+ })
22
+ buttonProps?.onClick?.(e)
23
+ },
30
24
  }}
31
25
  />
32
26
  )
@@ -0,0 +1,29 @@
1
+ import type { RemoveItemFromCartFab } from '@graphcommerce/magento-cart-items'
2
+ import { IfConfig, ReactPlugin } from '@graphcommerce/next-config'
3
+ import { gtagRemoveFromCart } from '../events/gtagRemoveFromCart/gtagRemoveFromCart'
4
+
5
+ export const component = 'RemoveItemFromCartFab'
6
+ export const exported = '@graphcommerce/magento-cart-items/RemoveItemFromCart/RemoveItemFromCartFab'
7
+ export const ifConfig: IfConfig = 'googleAnalyticsId'
8
+
9
+ export const GaRemoveItemFromCartFab: ReactPlugin<typeof RemoveItemFromCartFab> = (props) => {
10
+ const { Prev, uid, quantity, prices, product, fabProps } = props
11
+
12
+ return (
13
+ <Prev
14
+ {...props}
15
+ product={product}
16
+ fabProps={{
17
+ onClick: (e) => {
18
+ gtagRemoveFromCart({
19
+ __typename: 'Cart',
20
+ items: [{ uid, __typename: 'SimpleCartItem', product, quantity, prices }],
21
+ })
22
+ fabProps?.onClick?.(e)
23
+ },
24
+ }}
25
+ />
26
+ )
27
+ }
28
+
29
+ export const Plugin = GaRemoveItemFromCartFab