@graphcommerce/google-datalayer 8.1.0-canary.8 → 9.0.0-canary.54
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 +97 -0
- package/Config.graphqls +3 -0
- package/package.json +9 -9
- package/plugins/GoogleDatalayerRemoveItemFromCart.tsx +19 -22
- package/plugins/GoogleDatalayerRemoveItemFromCartFab.tsx +0 -29
- /package/plugins/{GoogleDatalayerUpdateItemQuantity.tsx → GoogleDatalayerUseRemoveItemFromCart.tsx} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,102 @@
|
|
|
1
1
|
# @graphcommerce/google-datalayer
|
|
2
2
|
|
|
3
|
+
## 9.0.0-canary.54
|
|
4
|
+
|
|
5
|
+
## 8.1.0-canary.53
|
|
6
|
+
|
|
7
|
+
## 8.1.0-canary.52
|
|
8
|
+
|
|
9
|
+
## 8.1.0-canary.51
|
|
10
|
+
|
|
11
|
+
## 8.1.0-canary.50
|
|
12
|
+
|
|
13
|
+
## 8.1.0-canary.49
|
|
14
|
+
|
|
15
|
+
## 8.1.0-canary.48
|
|
16
|
+
|
|
17
|
+
## 8.1.0-canary.47
|
|
18
|
+
|
|
19
|
+
## 8.1.0-canary.46
|
|
20
|
+
|
|
21
|
+
## 8.1.0-canary.45
|
|
22
|
+
|
|
23
|
+
## 8.1.0-canary.44
|
|
24
|
+
|
|
25
|
+
## 8.1.0-canary.43
|
|
26
|
+
|
|
27
|
+
## 8.1.0-canary.42
|
|
28
|
+
|
|
29
|
+
## 8.1.0-canary.41
|
|
30
|
+
|
|
31
|
+
## 8.1.0-canary.40
|
|
32
|
+
|
|
33
|
+
## 8.1.0-canary.39
|
|
34
|
+
|
|
35
|
+
## 8.1.0-canary.38
|
|
36
|
+
|
|
37
|
+
## 8.1.0-canary.37
|
|
38
|
+
|
|
39
|
+
## 8.1.0-canary.36
|
|
40
|
+
|
|
41
|
+
## 8.1.0-canary.35
|
|
42
|
+
|
|
43
|
+
## 8.1.0-canary.34
|
|
44
|
+
|
|
45
|
+
## 8.1.0-canary.33
|
|
46
|
+
|
|
47
|
+
## 8.1.0-canary.32
|
|
48
|
+
|
|
49
|
+
## 8.1.0-canary.31
|
|
50
|
+
|
|
51
|
+
## 8.1.0-canary.30
|
|
52
|
+
|
|
53
|
+
## 8.1.0-canary.29
|
|
54
|
+
|
|
55
|
+
## 8.1.0-canary.28
|
|
56
|
+
|
|
57
|
+
## 8.1.0-canary.27
|
|
58
|
+
|
|
59
|
+
## 8.1.0-canary.26
|
|
60
|
+
|
|
61
|
+
## 8.1.0-canary.25
|
|
62
|
+
|
|
63
|
+
## 8.1.0-canary.24
|
|
64
|
+
|
|
65
|
+
## 8.1.0-canary.23
|
|
66
|
+
|
|
67
|
+
## 8.1.0-canary.22
|
|
68
|
+
|
|
69
|
+
## 8.1.0-canary.21
|
|
70
|
+
|
|
71
|
+
## 8.1.0-canary.20
|
|
72
|
+
|
|
73
|
+
### Patch Changes
|
|
74
|
+
|
|
75
|
+
- [#2246](https://github.com/graphcommerce-org/graphcommerce/pull/2246) [`fc5c04d`](https://github.com/graphcommerce-org/graphcommerce/commit/fc5c04d4a2c0301be7d3cc983d9b31f6fcaf6fe6) - Create useRemoveItemFromCart hook to allow for reuse while keeping compatibility with plugins.
|
|
76
|
+
([@Jessevdpoel](https://github.com/Jessevdpoel))
|
|
77
|
+
|
|
78
|
+
## 8.1.0-canary.19
|
|
79
|
+
|
|
80
|
+
## 8.1.0-canary.18
|
|
81
|
+
|
|
82
|
+
## 8.1.0-canary.17
|
|
83
|
+
|
|
84
|
+
## 8.1.0-canary.16
|
|
85
|
+
|
|
86
|
+
## 8.1.0-canary.15
|
|
87
|
+
|
|
88
|
+
## 8.1.0-canary.14
|
|
89
|
+
|
|
90
|
+
## 8.1.0-canary.13
|
|
91
|
+
|
|
92
|
+
## 8.1.0-canary.12
|
|
93
|
+
|
|
94
|
+
## 8.1.0-canary.11
|
|
95
|
+
|
|
96
|
+
## 8.1.0-canary.10
|
|
97
|
+
|
|
98
|
+
## 8.1.0-canary.9
|
|
99
|
+
|
|
3
100
|
## 8.1.0-canary.8
|
|
4
101
|
|
|
5
102
|
## 8.1.0-canary.7
|
package/Config.graphqls
CHANGED
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/google-datalayer",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "
|
|
5
|
+
"version": "9.0.0-canary.54",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@graphcommerce/eslint-config-pwa": "^
|
|
16
|
-
"@graphcommerce/magento-cart": "^
|
|
17
|
-
"@graphcommerce/magento-cart-payment-method": "^
|
|
18
|
-
"@graphcommerce/magento-cart-shipping-method": "^
|
|
19
|
-
"@graphcommerce/magento-product": "^
|
|
20
|
-
"@graphcommerce/next-ui": "^
|
|
21
|
-
"@graphcommerce/prettier-config-pwa": "^
|
|
22
|
-
"@graphcommerce/typescript-config-pwa": "^
|
|
15
|
+
"@graphcommerce/eslint-config-pwa": "^9.0.0-canary.54",
|
|
16
|
+
"@graphcommerce/magento-cart": "^9.0.0-canary.54",
|
|
17
|
+
"@graphcommerce/magento-cart-payment-method": "^9.0.0-canary.54",
|
|
18
|
+
"@graphcommerce/magento-cart-shipping-method": "^9.0.0-canary.54",
|
|
19
|
+
"@graphcommerce/magento-product": "^9.0.0-canary.54",
|
|
20
|
+
"@graphcommerce/next-ui": "^9.0.0-canary.54",
|
|
21
|
+
"@graphcommerce/prettier-config-pwa": "^9.0.0-canary.54",
|
|
22
|
+
"@graphcommerce/typescript-config-pwa": "^9.0.0-canary.54",
|
|
23
23
|
"@mui/material": "^5.14.20",
|
|
24
24
|
"next": "^14",
|
|
25
25
|
"react": "^18.2.0",
|
|
@@ -1,29 +1,26 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { useRemoveItemFromCart as useRemoveItemFromCartBase } from '@graphcommerce/magento-cart-items'
|
|
2
|
+
import type { FunctionPlugin, PluginConfig } from '@graphcommerce/next-config'
|
|
3
3
|
import { sendEvent } from '../api/sendEvent'
|
|
4
4
|
import { cartItemToRemoveFromCart } from '../mapping/cartItemToRemoveFromCart/cartToRemoveFromCart'
|
|
5
5
|
|
|
6
6
|
export const config: PluginConfig = {
|
|
7
|
-
type: '
|
|
7
|
+
type: 'function',
|
|
8
8
|
module: '@graphcommerce/magento-cart-items',
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
/>
|
|
28
|
-
)
|
|
29
|
-
}
|
|
11
|
+
export const useRemoveItemFromCart: FunctionPlugin<typeof useRemoveItemFromCartBase> = (
|
|
12
|
+
usePrev,
|
|
13
|
+
props,
|
|
14
|
+
) =>
|
|
15
|
+
usePrev({
|
|
16
|
+
...props,
|
|
17
|
+
onComplete: (result, variables) => {
|
|
18
|
+
if (!result.errors) {
|
|
19
|
+
sendEvent(
|
|
20
|
+
'remove_from_cart',
|
|
21
|
+
cartItemToRemoveFromCart({ ...props, __typename: 'SimpleCartItem' }),
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
return props.onComplete?.(result, variables)
|
|
25
|
+
},
|
|
26
|
+
})
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { RemoveItemFromCartFabProps } from '@graphcommerce/magento-cart-items'
|
|
2
|
-
import type { PluginConfig, PluginProps } from '@graphcommerce/next-config'
|
|
3
|
-
import { sendEvent } from '../api/sendEvent'
|
|
4
|
-
import { cartItemToRemoveFromCart } from '../mapping/cartItemToRemoveFromCart/cartToRemoveFromCart'
|
|
5
|
-
|
|
6
|
-
export const config: PluginConfig = {
|
|
7
|
-
type: 'component',
|
|
8
|
-
module: '@graphcommerce/magento-cart-items',
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function RemoveItemFromCartFab(props: PluginProps<RemoveItemFromCartFabProps>) {
|
|
12
|
-
const { Prev, fabProps } = props
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<Prev
|
|
16
|
-
{...props}
|
|
17
|
-
fabProps={{
|
|
18
|
-
...fabProps,
|
|
19
|
-
onClick: (e) => {
|
|
20
|
-
sendEvent(
|
|
21
|
-
'remove_from_cart',
|
|
22
|
-
cartItemToRemoveFromCart({ __typename: 'SimpleCartItem', ...props }),
|
|
23
|
-
)
|
|
24
|
-
fabProps?.onClick?.(e)
|
|
25
|
-
},
|
|
26
|
-
}}
|
|
27
|
-
/>
|
|
28
|
-
)
|
|
29
|
-
}
|
/package/plugins/{GoogleDatalayerUpdateItemQuantity.tsx → GoogleDatalayerUseRemoveItemFromCart.tsx}
RENAMED
|
File without changes
|