@graphcommerce/googletagmanager 9.0.0-canary.59 → 9.0.0-canary.60

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,11 @@
1
1
  # Change Log
2
2
 
3
+ ## 9.0.0-canary.60
4
+
5
+ ### Patch Changes
6
+
7
+ - [#2331](https://github.com/graphcommerce-org/graphcommerce/pull/2331) [`702bfc9`](https://github.com/graphcommerce-org/graphcommerce/commit/702bfc93566c9745546988e57988431d5d4d8cb0) - Moved plugins to new format ([@paales](https://github.com/paales))
8
+
3
9
  ## 9.0.0-canary.59
4
10
 
5
11
  ## 9.0.0-canary.58
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/googletagmanager",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "9.0.0-canary.59",
5
+ "version": "9.0.0-canary.60",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,16 +12,16 @@
12
12
  }
13
13
  },
14
14
  "dependencies": {
15
- "@graphcommerce/google-datalayer": "9.0.0-canary.59"
15
+ "@graphcommerce/google-datalayer": "9.0.0-canary.60"
16
16
  },
17
17
  "devDependencies": {
18
18
  "@types/gapi.client.tagmanager": "^2.0.4"
19
19
  },
20
20
  "peerDependencies": {
21
- "@graphcommerce/eslint-config-pwa": "^9.0.0-canary.59",
22
- "@graphcommerce/next-ui": "^9.0.0-canary.59",
23
- "@graphcommerce/prettier-config-pwa": "^9.0.0-canary.59",
24
- "@graphcommerce/typescript-config-pwa": "^9.0.0-canary.59",
21
+ "@graphcommerce/eslint-config-pwa": "^9.0.0-canary.60",
22
+ "@graphcommerce/next-ui": "^9.0.0-canary.60",
23
+ "@graphcommerce/prettier-config-pwa": "^9.0.0-canary.60",
24
+ "@graphcommerce/typescript-config-pwa": "^9.0.0-canary.60",
25
25
  "@mui/material": "^5.10.16",
26
26
  "next": "*",
27
27
  "react": "^18.2.0",
@@ -1,9 +1,11 @@
1
- import { googleEventNames, sendEvent } from '@graphcommerce/google-datalayer'
2
- import type { IfConfig, MethodPlugin } from '@graphcommerce/next-config'
1
+ import { googleEventNames, type sendEvent as sendEventType } from '@graphcommerce/google-datalayer'
2
+ import type { FunctionPlugin, PluginConfig } from '@graphcommerce/next-config'
3
3
 
4
- export const func = 'sendEvent'
5
- export const exported = '@graphcommerce/google-datalayer/api/sendEvent'
6
- export const ifConfig: IfConfig = 'googleTagmanagerId'
4
+ export const config: PluginConfig = {
5
+ type: 'function',
6
+ module: '@graphcommerce/google-datalayer',
7
+ ifConfig: 'googleTagmanagerId',
8
+ }
7
9
 
8
10
  declare global {
9
11
  interface Window {
@@ -13,7 +15,7 @@ declare global {
13
15
 
14
16
  const ecommerceEvents = new RegExp(`${googleEventNames.join('|')}`, 'i')
15
17
 
16
- const tagmanagerEvent: MethodPlugin<typeof sendEvent> = (prev, eventName, eventData) => {
18
+ export const sendEvent: FunctionPlugin<typeof sendEventType> = (prev, eventName, eventData) => {
17
19
  prev(eventName, eventData)
18
20
 
19
21
  if (ecommerceEvents.test(eventName)) {
@@ -24,5 +26,3 @@ const tagmanagerEvent: MethodPlugin<typeof sendEvent> = (prev, eventName, eventD
24
26
  window.dataLayer?.push({ event: eventName, ...eventData })
25
27
  }
26
28
  }
27
-
28
- export const plugin = tagmanagerEvent