@graphcommerce/magento-recently-viewed-products 8.1.0-canary.8 → 9.0.0-canary.100

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,193 @@
1
1
  # @graphcommerce/magento-recently-viewed-products
2
2
 
3
+ ## 9.0.0-canary.100
4
+
5
+ ## 9.0.0-canary.99
6
+
7
+ ## 9.0.0-canary.98
8
+
9
+ ## 9.0.0-canary.97
10
+
11
+ ## 9.0.0-canary.96
12
+
13
+ ## 9.0.0-canary.95
14
+
15
+ ## 9.0.0-canary.94
16
+
17
+ ## 9.0.0-canary.93
18
+
19
+ ## 9.0.0-canary.92
20
+
21
+ ## 9.0.0-canary.91
22
+
23
+ ## 9.0.0-canary.90
24
+
25
+ ## 9.0.0-canary.89
26
+
27
+ ## 9.0.0-canary.88
28
+
29
+ ## 9.0.0-canary.87
30
+
31
+ ## 9.0.0-canary.86
32
+
33
+ ### Patch Changes
34
+
35
+ - [#2379](https://github.com/graphcommerce-org/graphcommerce/pull/2379) [`5832c9d`](https://github.com/graphcommerce-org/graphcommerce/commit/5832c9d891e288f47e3b181f4a2f5529847dee2b) - Solved issue where Recently Viewed Products would execute a query even if there were no products to display. ([@paales](https://github.com/paales))
36
+
37
+ ## 9.0.0-canary.85
38
+
39
+ ## 9.0.0-canary.84
40
+
41
+ ## 9.0.0-canary.83
42
+
43
+ ## 9.0.0-canary.82
44
+
45
+ ## 9.0.0-canary.81
46
+
47
+ ## 9.0.0-canary.80
48
+
49
+ ## 9.0.0-canary.79
50
+
51
+ ## 9.0.0-canary.78
52
+
53
+ ## 9.0.0-canary.77
54
+
55
+ ## 9.0.0-canary.76
56
+
57
+ ## 9.0.0-canary.75
58
+
59
+ ## 9.0.0-canary.74
60
+
61
+ ## 9.0.0-canary.73
62
+
63
+ ## 9.0.0-canary.72
64
+
65
+ ## 9.0.0-canary.71
66
+
67
+ ## 9.0.0-canary.70
68
+
69
+ ## 9.0.0-canary.69
70
+
71
+ ## 9.0.0-canary.68
72
+
73
+ ## 9.0.0-canary.67
74
+
75
+ ## 9.0.0-canary.66
76
+
77
+ ## 9.0.0-canary.65
78
+
79
+ ## 9.0.0-canary.64
80
+
81
+ ## 9.0.0-canary.63
82
+
83
+ ## 9.0.0-canary.62
84
+
85
+ ## 9.0.0-canary.61
86
+
87
+ ## 9.0.0-canary.60
88
+
89
+ ## 9.0.0-canary.59
90
+
91
+ ## 9.0.0-canary.58
92
+
93
+ ## 9.0.0-canary.57
94
+
95
+ ## 9.0.0-canary.56
96
+
97
+ ## 9.0.0-canary.55
98
+
99
+ ## 9.0.0-canary.54
100
+
101
+ ## 8.1.0-canary.53
102
+
103
+ ## 8.1.0-canary.52
104
+
105
+ ## 8.1.0-canary.51
106
+
107
+ ## 8.1.0-canary.50
108
+
109
+ ## 8.1.0-canary.49
110
+
111
+ ## 8.1.0-canary.48
112
+
113
+ ## 8.1.0-canary.47
114
+
115
+ ## 8.1.0-canary.46
116
+
117
+ ## 8.1.0-canary.45
118
+
119
+ ## 8.1.0-canary.44
120
+
121
+ ## 8.1.0-canary.43
122
+
123
+ ## 8.1.0-canary.42
124
+
125
+ ## 8.1.0-canary.41
126
+
127
+ ## 8.1.0-canary.40
128
+
129
+ ## 8.1.0-canary.39
130
+
131
+ ## 8.1.0-canary.38
132
+
133
+ ## 8.1.0-canary.37
134
+
135
+ ## 8.1.0-canary.36
136
+
137
+ ## 8.1.0-canary.35
138
+
139
+ ## 8.1.0-canary.34
140
+
141
+ ## 8.1.0-canary.33
142
+
143
+ ## 8.1.0-canary.32
144
+
145
+ ## 8.1.0-canary.31
146
+
147
+ ## 8.1.0-canary.30
148
+
149
+ ## 8.1.0-canary.29
150
+
151
+ ## 8.1.0-canary.28
152
+
153
+ ## 8.1.0-canary.27
154
+
155
+ ## 8.1.0-canary.26
156
+
157
+ ## 8.1.0-canary.25
158
+
159
+ ## 8.1.0-canary.24
160
+
161
+ ## 8.1.0-canary.23
162
+
163
+ ## 8.1.0-canary.22
164
+
165
+ ## 8.1.0-canary.21
166
+
167
+ ## 8.1.0-canary.20
168
+
169
+ ## 8.1.0-canary.19
170
+
171
+ ## 8.1.0-canary.18
172
+
173
+ ## 8.1.0-canary.17
174
+
175
+ ## 8.1.0-canary.16
176
+
177
+ ## 8.1.0-canary.15
178
+
179
+ ## 8.1.0-canary.14
180
+
181
+ ## 8.1.0-canary.13
182
+
183
+ ## 8.1.0-canary.12
184
+
185
+ ## 8.1.0-canary.11
186
+
187
+ ## 8.1.0-canary.10
188
+
189
+ ## 8.1.0-canary.9
190
+
3
191
  ## 8.1.0-canary.8
4
192
 
5
193
  ## 8.1.0-canary.7
@@ -90,8 +278,7 @@
90
278
 
91
279
  ### Minor Changes
92
280
 
93
- - [#2077](https://github.com/graphcommerce-org/graphcommerce/pull/2077) [`e661106`](https://github.com/graphcommerce-org/graphcommerce/commit/e661106d45e51c617533f19b397a812e22b6fc82) - Created a new `<RecentlyViewedProducts/>` component and render it on product pages.
94
- ([@bramvanderholst](https://github.com/bramvanderholst))
281
+ - [#2077](https://github.com/graphcommerce-org/graphcommerce/pull/2077) [`e661106`](https://github.com/graphcommerce-org/graphcommerce/commit/e661106d45e51c617533f19b397a812e22b6fc82) - Created a new `<RecentlyViewedProducts/>` component and render it on product pages. ([@bramvanderholst](https://github.com/bramvanderholst))
95
282
 
96
283
  ## 8.0.0-canary.100
97
284
 
@@ -115,8 +302,7 @@
115
302
 
116
303
  ### Patch Changes
117
304
 
118
- - [#2172](https://github.com/graphcommerce-org/graphcommerce/pull/2172) [`871e07a`](https://github.com/graphcommerce-org/graphcommerce/commit/871e07ac8bbb7e6c392a740a8244f69992b42b76) - Recently viewed products would show skeleton items even after loading succeeded
119
- ([@paales](https://github.com/paales))
305
+ - [#2172](https://github.com/graphcommerce-org/graphcommerce/pull/2172) [`871e07a`](https://github.com/graphcommerce-org/graphcommerce/commit/871e07ac8bbb7e6c392a740a8244f69992b42b76) - Recently viewed products would show skeleton items even after loading succeeded ([@paales](https://github.com/paales))
120
306
 
121
307
  ## 8.0.0-canary.90
122
308
 
@@ -168,11 +354,9 @@
168
354
 
169
355
  ### Patch Changes
170
356
 
171
- - [#2108](https://github.com/graphcommerce-org/graphcommerce/pull/2108) [`c4a64d8`](https://github.com/graphcommerce-org/graphcommerce/commit/c4a64d8c5e38232d31f84b68acdf0032af5eeffd) - When multiple variations of a single configurable product were viewed the RecentlyViewedProducts component it would keep showing a loading state.
172
- ([@StefanAngenent](https://github.com/StefanAngenent))
357
+ - [#2108](https://github.com/graphcommerce-org/graphcommerce/pull/2108) [`c4a64d8`](https://github.com/graphcommerce-org/graphcommerce/commit/c4a64d8c5e38232d31f84b68acdf0032af5eeffd) - When multiple variations of a single configurable product were viewed the RecentlyViewedProducts component it would keep showing a loading state. ([@StefanAngenent](https://github.com/StefanAngenent))
173
358
 
174
- - [#2108](https://github.com/graphcommerce-org/graphcommerce/pull/2108) [`6f214fb`](https://github.com/graphcommerce-org/graphcommerce/commit/6f214fbfd8ef24cc6dcba72f403bdcb1d8a5ed8a) - Remove marginBottom from ProductScroller by default and let implementor set the margin
175
- ([@StefanAngenent](https://github.com/StefanAngenent))
359
+ - [#2108](https://github.com/graphcommerce-org/graphcommerce/pull/2108) [`6f214fb`](https://github.com/graphcommerce-org/graphcommerce/commit/6f214fbfd8ef24cc6dcba72f403bdcb1d8a5ed8a) - Remove marginBottom from ProductScroller by default and let implementor set the margin ([@StefanAngenent](https://github.com/StefanAngenent))
176
360
 
177
361
  ## 7.1.0-canary.66
178
362
 
@@ -16,7 +16,10 @@ export function RecentlyViewedProducts(props: RecentlyViewedProductsProps) {
16
16
  const ref = useRef<HTMLDivElement>(null)
17
17
  const isInView = useInView(ref, { margin: '300px', once: true })
18
18
  const { skus } = useRecentlyViewedSkus({ exclude })
19
- const productList = useRecentlyViewedProducts({ exclude, skip: !isInView && loading === 'lazy' })
19
+ const productList = useRecentlyViewedProducts({
20
+ exclude,
21
+ skip: skus.length === 0 || (!isInView && loading === 'lazy'),
22
+ })
20
23
 
21
24
  if (
22
25
  !import.meta.graphCommerce.recentlyViewedProducts?.enabled ||
@@ -9,13 +9,7 @@ export function useRecentlyViewedProducts(props: UseRecentlyViewedProductsProps)
9
9
  let { skus, loading } = useRecentlyViewedSkus()
10
10
 
11
11
  const productList = useQuery(ProductListDocument, {
12
- variables: {
13
- filters: {
14
- sku: {
15
- in: skus.map((p) => p.sku).sort(),
16
- },
17
- },
18
- },
12
+ variables: { onlyItems: true, filters: { sku: { in: skus.map((p) => p.sku).sort() } } },
19
13
  skip: loading || !skus.length || skip,
20
14
  })
21
15
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/magento-recently-viewed-products",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "8.1.0-canary.8",
5
+ "version": "9.0.0-canary.100",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,16 +12,16 @@
12
12
  }
13
13
  },
14
14
  "peerDependencies": {
15
- "@graphcommerce/eslint-config-pwa": "^8.1.0-canary.8",
16
- "@graphcommerce/graphql": "^8.1.0-canary.8",
17
- "@graphcommerce/graphql-mesh": "^8.1.0-canary.8",
18
- "@graphcommerce/magento-cart": "^8.1.0-canary.8",
19
- "@graphcommerce/magento-product": "^8.1.0-canary.8",
20
- "@graphcommerce/magento-product-configurable": "^8.1.0-canary.8",
21
- "@graphcommerce/next-config": "^8.1.0-canary.8",
22
- "@graphcommerce/next-ui": "^8.1.0-canary.8",
23
- "@graphcommerce/prettier-config-pwa": "^8.1.0-canary.8",
24
- "@graphcommerce/typescript-config-pwa": "^8.1.0-canary.8",
15
+ "@graphcommerce/eslint-config-pwa": "^9.0.0-canary.100",
16
+ "@graphcommerce/graphql": "^9.0.0-canary.100",
17
+ "@graphcommerce/graphql-mesh": "^9.0.0-canary.100",
18
+ "@graphcommerce/magento-cart": "^9.0.0-canary.100",
19
+ "@graphcommerce/magento-product": "^9.0.0-canary.100",
20
+ "@graphcommerce/magento-product-configurable": "^9.0.0-canary.100",
21
+ "@graphcommerce/next-config": "^9.0.0-canary.100",
22
+ "@graphcommerce/next-ui": "^9.0.0-canary.100",
23
+ "@graphcommerce/prettier-config-pwa": "^9.0.0-canary.100",
24
+ "@graphcommerce/typescript-config-pwa": "^9.0.0-canary.100",
25
25
  "@mui/material": "^5.10.16",
26
26
  "framer-motion": "^10.0.0",
27
27
  "next": "*",
@@ -5,15 +5,17 @@ import {
5
5
  ProductPageMetaProps,
6
6
  } from '@graphcommerce/magento-product'
7
7
  import { useConfigurableSelectedVariant } from '@graphcommerce/magento-product-configurable/hooks'
8
- import type { IfConfig, PluginProps } from '@graphcommerce/next-config'
8
+ import type { PluginConfig, PluginProps } from '@graphcommerce/next-config'
9
9
  import { useEventCallback } from '@mui/material'
10
10
  import { useRouter } from 'next/router'
11
11
  import { useEffect } from 'react'
12
12
  import { RecentlyViewedProductsDocument } from '../graphql/RecentlyViewedProducts.gql'
13
13
 
14
- export const component = 'ProductPageMeta'
15
- export const exported = '@graphcommerce/magento-product'
16
- export const ifConfig: IfConfig = 'recentlyViewedProducts.enabled'
14
+ export const config: PluginConfig = {
15
+ type: 'component',
16
+ module: '@graphcommerce/magento-product',
17
+ ifConfig: 'recentlyViewedProducts.enabled',
18
+ }
17
19
 
18
20
  function ViewHandling(props: { product: ProductPageMetaFragment }) {
19
21
  const { product } = props
@@ -69,9 +71,7 @@ function ViewHandling(props: { product: ProductPageMetaFragment }) {
69
71
  return null
70
72
  }
71
73
 
72
- const RegisterProductAsRecentlyViewed = (
73
- props: PluginProps<ProductPageMetaProps> & AddToCartItemSelector,
74
- ) => {
74
+ export function ProductPageMeta(props: PluginProps<ProductPageMetaProps> & AddToCartItemSelector) {
75
75
  const { Prev, product } = props
76
76
 
77
77
  return (
@@ -81,5 +81,3 @@ const RegisterProductAsRecentlyViewed = (
81
81
  </>
82
82
  )
83
83
  }
84
-
85
- export const Plugin = RegisterProductAsRecentlyViewed