@faststore/core 2.1.0 → 2.1.3

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.
Files changed (99) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +43 -43
  3. package/.next/cache/.tsbuildinfo +1 -1
  4. package/.next/cache/config.json +7 -0
  5. package/.next/cache/eslint/.cache_1gneedd +1 -0
  6. package/.next/cache/next-server.js.nft.json +1 -1
  7. package/.next/cache/webpack/client-production/0.pack +0 -0
  8. package/.next/cache/webpack/client-production/index.pack +0 -0
  9. package/.next/cache/webpack/server-production/0.pack +0 -0
  10. package/.next/cache/webpack/server-production/index.pack +0 -0
  11. package/.next/next-server.js.nft.json +1 -1
  12. package/.next/prerender-manifest.json +1 -1
  13. package/.next/react-loadable-manifest.json +5 -5
  14. package/.next/required-server-files.json +1 -1
  15. package/.next/routes-manifest.json +1 -1
  16. package/.next/server/chunks/184.js +61 -0
  17. package/.next/server/chunks/205.js +1 -1
  18. package/.next/server/chunks/{280.js → 269.js} +233 -41
  19. package/.next/server/chunks/289.js +22 -9
  20. package/.next/server/chunks/350.js +1 -1
  21. package/.next/server/chunks/378.js +6 -6
  22. package/.next/server/chunks/74.js +54 -3
  23. package/.next/server/chunks/907.js +334 -180
  24. package/.next/server/middleware-build-manifest.js +1 -1
  25. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  26. package/.next/server/pages/404.js +0 -7
  27. package/.next/server/pages/404.js.nft.json +1 -1
  28. package/.next/server/pages/500.js +0 -7
  29. package/.next/server/pages/500.js.nft.json +1 -1
  30. package/.next/server/pages/[...slug].js +1 -9
  31. package/.next/server/pages/[...slug].js.nft.json +1 -1
  32. package/.next/server/pages/[slug]/p.js +948 -907
  33. package/.next/server/pages/[slug]/p.js.nft.json +1 -1
  34. package/.next/server/pages/_app.js.nft.json +1 -1
  35. package/.next/server/pages/_document.js.nft.json +1 -1
  36. package/.next/server/pages/_error.js.nft.json +1 -1
  37. package/.next/server/pages/account.js +0 -7
  38. package/.next/server/pages/account.js.nft.json +1 -1
  39. package/.next/server/pages/api/graphql.js +1 -1
  40. package/.next/server/pages/checkout.js +0 -7
  41. package/.next/server/pages/checkout.js.nft.json +1 -1
  42. package/.next/server/pages/en-US/404.html +2 -2
  43. package/.next/server/pages/en-US/500.html +2 -2
  44. package/.next/server/pages/en-US/account.html +2 -2
  45. package/.next/server/pages/en-US/checkout.html +2 -2
  46. package/.next/server/pages/en-US/login.html +2 -2
  47. package/.next/server/pages/en-US/s.html +2 -2
  48. package/.next/server/pages/en-US.html +2 -2
  49. package/.next/server/pages/index.js +1 -9
  50. package/.next/server/pages/index.js.nft.json +1 -1
  51. package/.next/server/pages/login.js +0 -7
  52. package/.next/server/pages/login.js.nft.json +1 -1
  53. package/.next/server/pages/s.js +1 -8
  54. package/.next/server/pages/s.js.nft.json +1 -1
  55. package/.next/server/pages-manifest.json +4 -4
  56. package/.next/static/chunks/64.7ea3677ac3a10e00.js +1 -0
  57. package/.next/static/chunks/{682-dc059ce3e47eb9e1.js → 682-5cfea9ed52851ed1.js} +1 -1
  58. package/.next/static/chunks/738-a5ff304828f20cbf.js +1 -0
  59. package/.next/static/chunks/791-727eda8f766aa791.js +1 -0
  60. package/.next/static/chunks/pages/{404-e7a1846b72ad3430.js → 404-c3b320b915df45bb.js} +1 -1
  61. package/.next/static/chunks/pages/{500-0f4d738fa1caac78.js → 500-d37a3a2e931f6995.js} +1 -1
  62. package/.next/static/chunks/pages/[...slug]-d4e0a671c6248369.js +1 -0
  63. package/.next/static/chunks/pages/[slug]/p-2ad8b84fd5d98814.js +1 -0
  64. package/.next/static/chunks/pages/{account-bbe1795b8566f75a.js → account-86a1b6e7db03bab6.js} +1 -1
  65. package/.next/static/chunks/pages/{checkout-4321004c6cdaf5c7.js → checkout-c77dbc66c0b35ec3.js} +1 -1
  66. package/.next/static/chunks/pages/{index-949a5393471484d5.js → index-2912eeade1da43bf.js} +1 -1
  67. package/.next/static/chunks/pages/{login-b09e2dd0941c8882.js → login-bbf85bc59afce37c.js} +1 -1
  68. package/.next/static/chunks/pages/{s-e603b0c6e5eef0a7.js → s-dd486933e8ba7fbf.js} +1 -1
  69. package/.next/static/chunks/webpack-c5cf5350bcb7f6f4.js +1 -0
  70. package/.next/static/css/{8988ac07eb0af0ca.css → 0f8ce5203de8ae6f.css} +1 -1
  71. package/.next/static/hHM-WaPbC6D9MU3Qh2tZ1/_buildManifest.js +1 -0
  72. package/.next/trace +72 -72
  73. package/.turbo/turbo-build.log +14 -8
  74. package/.turbo/turbo-lint.log +2 -0
  75. package/package.json +8 -8
  76. package/src/components/product/ProductGrid/ProductGrid.tsx +22 -6
  77. package/src/components/search/Filter/Filter.tsx +12 -3
  78. package/src/components/sections/ProductDetails/Overrides.tsx +38 -2
  79. package/src/components/sections/ProductDetails/ProductDetails.tsx +45 -16
  80. package/src/components/sections/ProductDetails/section.module.scss +1 -0
  81. package/src/components/sections/ProductGallery/Overrides.tsx +52 -0
  82. package/src/components/ui/ImageGallery/ImageGallery.tsx +25 -14
  83. package/src/components/ui/ProductDetails/ProductDetailsSettings.tsx +32 -18
  84. package/src/components/ui/ProductGallery/ProductGallery.tsx +77 -37
  85. package/src/components/ui/ProductShelf/ProductShelf.tsx +1 -1
  86. package/src/components/ui/ShippingSimulation/ShippingSimulation.tsx +1 -2
  87. package/src/customizations/components/overrides/ProductDetails.tsx +15 -1
  88. package/src/customizations/components/overrides/ProductGallery.tsx +24 -0
  89. package/src/typings/overrides.d.ts +23 -0
  90. package/.next/cache/eslint/.cache_abdhua +0 -1
  91. package/.next/server/chunks/368.js +0 -253
  92. package/.next/static/chunks/21-5b0c50a44b0ed6ce.js +0 -1
  93. package/.next/static/chunks/460-08f41a79ff49f7be.js +0 -1
  94. package/.next/static/chunks/64.ebbe1d2b40f980c7.js +0 -1
  95. package/.next/static/chunks/pages/[...slug]-119a323292c7e3af.js +0 -1
  96. package/.next/static/chunks/pages/[slug]/p-3c424924080d88cb.js +0 -1
  97. package/.next/static/chunks/webpack-9ba6546d294eb768.js +0 -1
  98. package/.next/static/eLm2Cd_zypP0KQaj5UlQ2/_buildManifest.js +0 -1
  99. /package/.next/static/{eLm2Cd_zypP0KQaj5UlQ2 → hHM-WaPbC6D9MU3Qh2tZ1}/_ssgManifest.js +0 -0
@@ -1,14 +1,9 @@
1
1
  import { useSearch } from '@faststore/sdk'
2
- import {
3
- Button as UIButton,
4
- LinkButton as UILinkButton,
5
- Skeleton as UISkeleton,
6
- } from '@faststore/ui'
7
2
  import { NextSeo } from 'next-seo'
8
3
  import type { MouseEvent } from 'react'
9
4
  import { Suspense, lazy } from 'react'
10
5
 
11
- import { Icon, useUI } from '@faststore/ui'
6
+ import { useUI } from '@faststore/ui'
12
7
  import Filter from 'src/components/search/Filter'
13
8
  import Sort from 'src/components/search/Sort'
14
9
  import FilterSkeleton from 'src/components/skeletons/FilterSkeleton'
@@ -21,10 +16,25 @@ import { SortProps } from 'src/components/search/Sort/Sort'
21
16
  import { useDelayedFacets } from './useDelayedFacets'
22
17
  import { useDelayedPagination } from './useDelayedPagination'
23
18
  import { useProductsPrefetch } from './usePageProducts'
19
+ import {
20
+ Components,
21
+ Props,
22
+ } from 'src/components/sections/ProductGallery/Overrides'
24
23
 
25
24
  const GalleryPage = lazy(() => import('./ProductGalleryPage'))
26
25
  const GalleryPageSkeleton = <ProductGridSkeleton loading />
27
26
 
27
+ const {
28
+ Button,
29
+ FilterIcon,
30
+ PrevIcon,
31
+ ResultsCountSkeleton,
32
+ SortSkeleton,
33
+ FilterButtonSkeleton,
34
+ LinkButtonPrev,
35
+ LinkButtonNext,
36
+ } = Components
37
+
28
38
  export interface ProductGalleryProps {
29
39
  title?: string
30
40
  searchTerm?: string
@@ -98,49 +108,68 @@ function ProductGallery({
98
108
  </FilterSkeleton>
99
109
  </div>
100
110
  <div data-fs-product-listing-results-count data-count={totalCount}>
101
- <UISkeleton
111
+ <ResultsCountSkeleton
102
112
  data-fs-product-listing-results-count-skeleton
103
- loading={!productGalleryData}
104
113
  size={{ width: '100%', height: '1.5rem' }}
114
+ {...Props['ResultsCountSkeleton']}
115
+ // Dynamic props shouldn't be overridable
116
+ // This decision can be reviewed later if needed
117
+ loading={!productGalleryData}
105
118
  >
106
119
  <h2 data-testid="total-product-count">
107
120
  {totalCount} {totalCountLabel}
108
121
  </h2>
109
- </UISkeleton>
122
+ </ResultsCountSkeleton>
110
123
  </div>
111
124
  <div data-fs-product-listing-sort>
112
- <UISkeleton
125
+ <SortSkeleton
113
126
  data-fs-product-listing-sort-skeleton
114
- loading={facets?.length === 0}
115
127
  size={{ width: 'auto', height: '1.5rem' }}
128
+ {...Props['SortSkeleton']}
129
+ // Dynamic props shouldn't be overridable
130
+ // This decision can be reviewed later if needed
131
+ loading={facets?.length === 0}
116
132
  >
117
133
  <Sort
118
134
  label={sortBySelector?.label}
119
135
  options={sortBySelector?.options}
120
136
  />
121
- </UISkeleton>
122
- <UISkeleton
137
+ </SortSkeleton>
138
+ <FilterButtonSkeleton
123
139
  data-fs-product-listing-filter-button-skeleton
124
- loading={facets?.length === 0}
125
140
  size={{ width: '6rem', height: '1.5rem' }}
141
+ {...Props['FilterButtonSkeleton']}
142
+ // Dynamic props shouldn't be overridable
143
+ // This decision can be reviewed later if needed
144
+ loading={facets?.length === 0}
126
145
  >
127
- <UIButton
146
+ <Button
128
147
  variant="tertiary"
129
148
  data-testid="open-filter-button"
130
149
  icon={
131
- <Icon
132
- name={filter?.mobileOnly?.filterButton?.icon?.icon}
133
- aria-label={filter?.mobileOnly?.filterButton?.icon?.alt}
150
+ <FilterIcon
134
151
  width={16}
135
152
  height={16}
153
+ {...Props['FilterIcon']}
154
+ name={
155
+ filter?.mobileOnly?.filterButton?.icon?.icon ??
156
+ Props['FilterIcon'].name
157
+ }
158
+ aria-label={
159
+ filter?.mobileOnly?.filterButton?.icon?.alt ??
160
+ Props['FilterIcon']['aria-label']
161
+ }
136
162
  />
137
163
  }
138
164
  iconPosition="left"
165
+ {...Props['Button']}
166
+ // Dynamic props shouldn't be overridable
167
+ // This decision can be reviewed later if needed
139
168
  onClick={openFilter}
140
169
  >
141
170
  {filter?.mobileOnly?.filterButton?.label}
142
- </UIButton>
143
- </UISkeleton>
171
+ </Button>
172
+ </FilterButtonSkeleton>
144
173
  </div>
145
174
  <div data-fs-product-listing-results>
146
175
  {/* Add link to previous page. This helps on SEO */}
@@ -149,30 +178,38 @@ function ProductGallery({
149
178
  <NextSeo
150
179
  additionalLinkTags={[{ rel: 'prev', href: prev.link }]}
151
180
  />
152
- <UILinkButton
153
- onClick={(e: MouseEvent<HTMLElement>) => {
154
- e.currentTarget.blur()
155
- e.preventDefault()
156
- addPrevPage()
157
- }}
158
- href={prev.link}
181
+ <LinkButtonPrev
159
182
  rel="prev"
160
183
  variant="secondary"
161
184
  iconPosition="left"
162
185
  icon={
163
- <Icon
164
- name={previousPageButton?.icon?.icon}
165
- aria-label={
166
- previousPageButton?.icon?.alt ?? previousPageButton?.label
167
- }
186
+ <PrevIcon
168
187
  width={16}
169
188
  height={16}
170
189
  weight="bold"
190
+ {...Props['PrevIcon']}
191
+ name={
192
+ previousPageButton?.icon?.icon ?? Props['PrevIcon'].name
193
+ }
194
+ aria-label={
195
+ previousPageButton?.icon?.alt ??
196
+ previousPageButton?.label ??
197
+ Props['PrevIcon']['aria-label']
198
+ }
171
199
  />
172
200
  }
201
+ {...Props['LinkButtonPrev']}
202
+ // Dynamic props shouldn't be overridable
203
+ // This decision can be reviewed later if needed
204
+ onClick={(e: MouseEvent<HTMLElement>) => {
205
+ e.currentTarget.blur()
206
+ e.preventDefault()
207
+ addPrevPage()
208
+ }}
209
+ href={prev.link}
173
210
  >
174
211
  {previousPageButton?.label}
175
- </UILinkButton>
212
+ </LinkButtonPrev>
176
213
  </div>
177
214
  )}
178
215
  {/* Render ALL products */}
@@ -196,19 +233,22 @@ function ProductGallery({
196
233
  <NextSeo
197
234
  additionalLinkTags={[{ rel: 'next', href: next.link }]}
198
235
  />
199
- <UILinkButton
236
+ <LinkButtonNext
200
237
  testId="show-more"
238
+ rel="next"
239
+ variant="secondary"
240
+ {...Props['LinkButtonNext']}
241
+ // Dynamic props shouldn't be overridable
242
+ // This decision can be reviewed later if needed
201
243
  onClick={(e: MouseEvent<HTMLElement>) => {
202
244
  e.currentTarget.blur()
203
245
  e.preventDefault()
204
246
  addNextPage()
205
247
  }}
206
248
  href={next.link}
207
- rel="next"
208
- variant="secondary"
209
249
  >
210
250
  {loadMorePageButton?.label}
211
- </UILinkButton>
251
+ </LinkButtonNext>
212
252
  </div>
213
253
  )}
214
254
  </div>
@@ -98,7 +98,7 @@ function ProductShelf({
98
98
  {...Props['__experimentalProductCard']}
99
99
  bordered={bordered}
100
100
  showDiscountBadge={showDiscountBadge}
101
- // Dynamic props, shouldn't be overridable
101
+ // Dynamic props shouldn't be overridable
102
102
  // This decision can be reviewed later if needed
103
103
  key={`${product.node.id}`}
104
104
  product={product.node}
@@ -8,8 +8,6 @@ import { useShippingSimulation } from './useShippingSimulation'
8
8
 
9
9
  import { Components } from 'src/components/sections/ProductDetails/Overrides'
10
10
 
11
- const { ShippingSimulation: ShippingSimulationWrapper } = Components
12
-
13
11
  type ShippingSimulationOptionalProps =
14
12
  | 'title'
15
13
  | 'formatter'
@@ -58,6 +56,7 @@ export default function ShippingSimulation({
58
56
  ...otherProps
59
57
  }: ShippingSimulationProps) {
60
58
  const { country, postalCode: sessionPostalCode } = useSession()
59
+ const { ShippingSimulation: ShippingSimulationWrapper } = Components
61
60
 
62
61
  const {
63
62
  input,
@@ -6,7 +6,21 @@ const SECTION = 'ProductDetails' as const
6
6
 
7
7
  const overrides: SectionOverride[typeof SECTION] = {
8
8
  name: SECTION,
9
- components: {},
9
+ components: {
10
+ ProductTitle: { props: {} },
11
+ DiscountBadge: { props: {} },
12
+ BuyButton: { props: {} },
13
+ Icon: { props: {} },
14
+ Price: { props: {} },
15
+ QuantitySelector: { props: {} },
16
+ SkuSelector: { props: {} },
17
+ ShippingSimulation: { props: {} },
18
+ ImageGallery: { props: {} },
19
+ ImageZoom: { props: {} },
20
+ __experimentalImageGalleryImage: { props: {} },
21
+ __experimentalImageGallery: { props: {} },
22
+ __experimentalShippingSimulation: { props: {} },
23
+ },
10
24
  }
11
25
 
12
26
  export default overrides
@@ -0,0 +1,24 @@
1
+ // This is an example of how it can be used on the starter.
2
+
3
+ import { SectionOverride } from 'src/typings/overrides'
4
+
5
+ const SECTION = 'ProductGallery' as const
6
+
7
+ const overrides: SectionOverride[typeof SECTION] = {
8
+ name: SECTION,
9
+ components: {
10
+ Button: { props: {} },
11
+ FilterIcon: { props: {} },
12
+ PrevIcon: { props: {} },
13
+ ResultsCountSkeleton: { props: {} },
14
+ SortSkeleton: { props: {} },
15
+ FilterButtonSkeleton: { props: {} },
16
+ LinkButtonPrev: { props: {} },
17
+ LinkButtonNext: { props: {} },
18
+ __experimentalFilterDesktop: { props: {} },
19
+ __experimentalFilterSlider: { props: {} },
20
+ __experimentalProductCard: { props: {} },
21
+ },
22
+ }
23
+
24
+ export default overrides
@@ -10,8 +10,16 @@ export const SECTIONS = {
10
10
  'ProductTitle',
11
11
  'DiscountBadge',
12
12
  'BuyButton',
13
+ 'Icon',
14
+ 'Price',
15
+ 'QuantitySelector',
13
16
  'SkuSelector',
14
17
  'ShippingSimulation',
18
+ 'ImageGallery',
19
+ 'ImageZoom',
20
+ '__experimentalImageGalleryImage',
21
+ '__experimentalImageGallery',
22
+ '__experimentalShippingSimulation',
15
23
  ],
16
24
  },
17
25
  ProductShelf: {
@@ -39,6 +47,21 @@ export const SECTIONS = {
39
47
  Breadcrumb: {
40
48
  components: ['Breadcrumb', 'Icon'],
41
49
  },
50
+ ProductGallery: {
51
+ components: [
52
+ 'Button',
53
+ 'FilterIcon',
54
+ 'PrevIcon',
55
+ 'ResultsCountSkeleton',
56
+ 'SortSkeleton',
57
+ 'FilterButtonSkeleton',
58
+ 'LinkButtonPrev',
59
+ 'LinkButtonNext',
60
+ '__experimentalFilterDesktop',
61
+ '__experimentalFilterSlider',
62
+ '__experimentalProductCard',
63
+ ],
64
+ },
42
65
  } as const
43
66
 
44
67
  // export type ComponentOrProps =