@graphcommerce/googleanalytics 6.2.0-canary.71 → 6.2.0-canary.73

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,9 @@
1
1
  # Change Log
2
2
 
3
+ ## 6.2.0-canary.73
4
+
5
+ ## 6.2.0-canary.72
6
+
3
7
  ## 6.2.0-canary.71
4
8
 
5
9
  ## 6.2.0-canary.70
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.71",
5
+ "version": "6.2.0-canary.73",
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.71",
16
- "@graphcommerce/magento-cart": "6.2.0-canary.71",
17
- "@graphcommerce/magento-cart-payment-method": "6.2.0-canary.71",
18
- "@graphcommerce/magento-cart-shipping-method": "6.2.0-canary.71",
19
- "@graphcommerce/magento-product": "6.2.0-canary.71",
20
- "@graphcommerce/next-config": "6.2.0-canary.71",
21
- "@graphcommerce/next-ui": "6.2.0-canary.71"
15
+ "@graphcommerce/graphql-mesh": "6.2.0-canary.73",
16
+ "@graphcommerce/magento-cart": "6.2.0-canary.73",
17
+ "@graphcommerce/magento-cart-payment-method": "6.2.0-canary.73",
18
+ "@graphcommerce/magento-cart-shipping-method": "6.2.0-canary.73",
19
+ "@graphcommerce/magento-product": "6.2.0-canary.73",
20
+ "@graphcommerce/next-config": "6.2.0-canary.73",
21
+ "@graphcommerce/next-ui": "6.2.0-canary.73"
22
22
  },
23
23
  "devDependencies": {
24
- "@graphcommerce/eslint-config-pwa": "6.2.0-canary.71",
25
- "@graphcommerce/prettier-config-pwa": "6.2.0-canary.71",
26
- "@graphcommerce/typescript-config-pwa": "6.2.0-canary.71",
24
+ "@graphcommerce/eslint-config-pwa": "6.2.0-canary.73",
25
+ "@graphcommerce/prettier-config-pwa": "6.2.0-canary.73",
26
+ "@graphcommerce/typescript-config-pwa": "6.2.0-canary.73",
27
27
  "@types/gtag.js": "^0.0.12"
28
28
  },
29
29
  "peerDependencies": {
@@ -1,4 +1,4 @@
1
- import { ProductPageMetaFragment } from '@graphcommerce/magento-product/components/ProductPageMeta/ProductPageMeta.gql'
1
+ import type { ProductPageMeta } from '@graphcommerce/magento-product'
2
2
  import { IfConfig, PluginProps } from '@graphcommerce/next-config'
3
3
  import { useMemoObject } from '@graphcommerce/next-ui'
4
4
  import { useEffect } from 'react'
@@ -9,13 +9,14 @@ export const exported = '@graphcommerce/magento-product'
9
9
  export const ifConfig: IfConfig = 'googleAnalyticsId'
10
10
 
11
11
  /** When a product is added to the Cart, send a Google Analytics event */
12
- function GaViewItem(props: PluginProps<ProductPageMetaFragment>) {
13
- const { Prev, price_range } = props
12
+ function GaViewItem(props: PluginProps<React.ComponentProps<typeof ProductPageMeta>>) {
13
+ const { Prev, product } = props
14
+ const { price_range } = product
14
15
 
15
16
  const viewItem = useMemoObject({
16
17
  currency: price_range.minimum_price.final_price.currency,
17
18
  value: price_range.minimum_price.final_price.value,
18
- items: [productToGtagItem(props)],
19
+ items: [productToGtagItem(product)],
19
20
  })
20
21
  // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
21
22
  useEffect(() => globalThis.gtag?.('event', 'view_item', viewItem), [viewItem])