@faststore/core 2.2.61 → 2.2.65

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 (101) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +40 -44
  3. package/.next/cache/.tsbuildinfo +1 -1
  4. package/.next/cache/config.json +3 -3
  5. package/.next/cache/eslint/.cache_1gneedd +1 -1
  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/routes-manifest.json +1 -1
  15. package/.next/server/chunks/289.js +11 -8
  16. package/.next/server/chunks/312.js +3 -5
  17. package/.next/server/chunks/445.js +167 -0
  18. package/.next/server/chunks/520.js +1 -1
  19. package/.next/server/chunks/585.js +3 -25
  20. package/.next/server/chunks/74.js +1700 -86
  21. package/.next/server/chunks/863.js +0 -22
  22. package/.next/server/chunks/934.js +125 -0
  23. package/.next/server/middleware-build-manifest.js +1 -1
  24. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  25. package/.next/server/pages/404.js.nft.json +1 -1
  26. package/.next/server/pages/500.js.nft.json +1 -1
  27. package/.next/server/pages/[...slug].js +7 -7
  28. package/.next/server/pages/[...slug].js.nft.json +1 -1
  29. package/.next/server/pages/[slug]/p.js.nft.json +1 -1
  30. package/.next/server/pages/_app.js.nft.json +1 -1
  31. package/.next/server/pages/_error.js.nft.json +1 -1
  32. package/.next/server/pages/account.js.nft.json +1 -1
  33. package/.next/server/pages/api/graphql.js.nft.json +1 -1
  34. package/.next/server/pages/checkout.js.nft.json +1 -1
  35. package/.next/server/pages/en-US/404.html +2 -2
  36. package/.next/server/pages/en-US/500.html +2 -2
  37. package/.next/server/pages/en-US/account.html +2 -2
  38. package/.next/server/pages/en-US/checkout.html +2 -2
  39. package/.next/server/pages/en-US/login.html +2 -2
  40. package/.next/server/pages/en-US/s.html +2 -2
  41. package/.next/server/pages/en-US.html +2 -2
  42. package/.next/server/pages/index.js +1 -1
  43. package/.next/server/pages/index.js.nft.json +1 -1
  44. package/.next/server/pages/login.js.nft.json +1 -1
  45. package/.next/server/pages/s.js +5 -5
  46. package/.next/server/pages/s.js.nft.json +1 -1
  47. package/.next/static/8bY0SvP6sqeD3bp_3Ie2r/_buildManifest.js +1 -0
  48. package/.next/static/chunks/{251.98f500dd8ba008ae.js → 251.65e0bb7a2f58b3db.js} +1 -1
  49. package/.next/static/chunks/585.ee7478bead8853ae.js +1 -0
  50. package/.next/static/chunks/800.8f4f91b39aa47346.js +1 -0
  51. package/.next/static/chunks/875-e59a8e9803b1d863.js +1 -0
  52. package/.next/static/chunks/pages/404-419470fcedcaba54.js +1 -0
  53. package/.next/static/chunks/pages/500-337a57eb2c9da6ba.js +1 -0
  54. package/.next/static/chunks/pages/[...slug]-4fd81d8f84dd561f.js +1 -0
  55. package/.next/static/chunks/pages/[slug]/{p-fd236c3b1d28734d.js → p-551e8bbc72bab530.js} +1 -1
  56. package/.next/static/chunks/pages/{index-66a1b740f1101ce4.js → index-7d0e3d61afd0a37c.js} +1 -1
  57. package/.next/static/chunks/pages/login-c38b2107d504199c.js +1 -0
  58. package/.next/static/chunks/pages/s-a6e95c34a89ccbfb.js +1 -0
  59. package/.next/static/chunks/webpack-adf61d0bc3a8dbb3.js +1 -0
  60. package/.next/static/css/d2e8564f2bf133d9.css +1 -0
  61. package/.next/static/css/{e84fc497732ea596.css → e772e7786bb4dee9.css} +1 -1
  62. package/.next/static/css/eababca67e15ef4b.css +1 -0
  63. package/.next/static/css/f0e64672053efd0c.css +1 -0
  64. package/.next/trace +81 -81
  65. package/.turbo/turbo-build.log +13 -13
  66. package/.turbo/turbo-test.log +9 -9
  67. package/package.json +4 -4
  68. package/src/components/cart/CartSidebar/section.module.scss +1 -0
  69. package/src/components/product/ProductGrid/ProductGrid.tsx +8 -8
  70. package/src/components/search/Filter/Filter.tsx +6 -5
  71. package/src/components/sections/Navbar/section.module.scss +1 -0
  72. package/src/components/sections/ProductDetails/DefaultComponents.ts +2 -2
  73. package/src/components/sections/ProductGallery/DefaultComponents.ts +29 -0
  74. package/src/components/sections/ProductGallery/OverriddenDefaultProductGallery.ts +12 -0
  75. package/src/components/sections/ProductGallery/ProductGallery.tsx +4 -2
  76. package/src/components/sections/ProductShelf/section.module.scss +1 -0
  77. package/src/components/sections/ProductTiles/section.module.scss +2 -1
  78. package/src/components/templates/ProductListingPage/ProductListing.tsx +1 -1
  79. package/src/components/templates/SearchPage/SearchPage.tsx +1 -1
  80. package/src/components/ui/ProductDetails/ProductDetailsSettings.tsx +8 -48
  81. package/src/components/ui/ProductGallery/ProductGallery.tsx +12 -10
  82. package/src/sdk/overrides/sections.tsx +5 -1
  83. package/src/typings/overrides.ts +5 -4
  84. package/.next/server/chunks/732.js +0 -1887
  85. package/.next/static/YaAOEVbZrM4Y0xL8O4SKx/_buildManifest.js +0 -1
  86. package/.next/static/chunks/238-6cdd6e7841eba836.js +0 -1
  87. package/.next/static/chunks/585.f056dcd6e8625c41.js +0 -1
  88. package/.next/static/chunks/800.ea75aa39e939d9af.js +0 -1
  89. package/.next/static/chunks/875-3b0f69008ecb7897.js +0 -1
  90. package/.next/static/chunks/pages/404-340e5868f79ee704.js +0 -1
  91. package/.next/static/chunks/pages/500-ee2a5efc5808cdd4.js +0 -1
  92. package/.next/static/chunks/pages/[...slug]-8e6c8b59791c31e9.js +0 -1
  93. package/.next/static/chunks/pages/login-e5ee36783a4877fd.js +0 -1
  94. package/.next/static/chunks/pages/s-669d2eccade79e75.js +0 -1
  95. package/.next/static/chunks/webpack-41b4f40c5b7ff474.js +0 -1
  96. package/.next/static/css/014e8b0d9020cd52.css +0 -1
  97. package/.next/static/css/0dc997f9da3027b7.css +0 -1
  98. package/.next/static/css/4a189916c3edc75d.css +0 -1
  99. package/.next/static/css/cf062feb79245123.css +0 -1
  100. package/src/components/sections/ProductGallery/Overrides.tsx +0 -65
  101. /package/.next/static/{YaAOEVbZrM4Y0xL8O4SKx → 8bY0SvP6sqeD3bp_3Ie2r}/_ssgManifest.js +0 -0
@@ -1,6 +1,6 @@
1
1
  $ yarn partytown & yarn generate && next build
2
- $ partytown copylib ./public/~partytown
3
2
  $ faststore generate-graphql -c
3
+ $ partytown copylib ./public/~partytown
4
4
  Partytown lib copied to: /home/runner/work/faststore/faststore/packages/core/public/~partytown
5
5
  success - GraphQL schema, types, and optimizations successfully generated 🎉
6
6
  warn - You have enabled experimental feature (scrollRestoration) in next.config.js.
@@ -38,28 +38,28 @@ info - Generating static pages (7/7)
38
38
  info - Finalizing page optimization...
39
39
 
40
40
  Route (pages) Size First Load JS
41
- ┌ ● / 6.23 kB 135 kB
42
- ├ └ css/cf062feb79245123.css 8.38 kB
41
+ ┌ ● / 6.23 kB 142 kB
42
+ ├ └ css/d2e8564f2bf133d9.css 8.38 kB
43
43
  ├ /_app 0 B 83.7 kB
44
- ├ ● /[...slug] 7.35 kB 145 kB
45
- ├ └ css/0dc997f9da3027b7.css 8.8 kB
46
- ├ ● /[slug]/p 5.6 kB 135 kB
44
+ ├ ● /[...slug] 8.26 kB 144 kB
45
+ ├ └ css/eababca67e15ef4b.css 8.8 kB
46
+ ├ ● /[slug]/p 5.6 kB 141 kB
47
47
  ├ └ css/e67c73ff7fbc8c54.css 4.42 kB
48
- ├ ○ /404 1.19 kB 130 kB
49
- ├ ● /500 1.21 kB 130 kB
50
- ├ ● /account 676 B 130 kB
48
+ ├ ○ /404 1.03 kB 136 kB
49
+ ├ ● /500 1.05 kB 136 kB
50
+ ├ ● /account 676 B 136 kB
51
51
  ├ λ /api/graphql 0 B 83.7 kB
52
52
  ├ λ /api/health/live 0 B 83.7 kB
53
53
  ├ λ /api/health/ready 0 B 83.7 kB
54
54
  ├ λ /api/preview 0 B 83.7 kB
55
- ├ ● /checkout 660 B 130 kB
56
- ├ ● /login 1.14 kB 130 kB
57
- └ ● /s 1.38 kB 139 kB
55
+ ├ ● /checkout 660 B 136 kB
56
+ ├ ● /login 984 B 136 kB
57
+ └ ● /s 2.36 kB 138 kB
58
58
  + First Load JS shared by all 86.8 kB
59
59
  ├ chunks/framework-dfd14d7ce6600b03.js 45.3 kB
60
60
  ├ chunks/main-e4e873ee741162eb.js 24.2 kB
61
61
  ├ chunks/pages/_app-30b9666307e4b3b1.js 12.1 kB
62
- ├ chunks/webpack-41b4f40c5b7ff474.js 2.24 kB
62
+ ├ chunks/webpack-adf61d0bc3a8dbb3.js 2.22 kB
63
63
  └ css/5d1f64b61ea581f4.css 3.05 kB
64
64
 
65
65
  λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
@@ -1,23 +1,23 @@
1
1
  $ jest
2
- PASS test/server/index.test.ts (22.314 s)
2
+ PASS test/server/index.test.ts (21.756 s)
3
3
  FastStore GraphQL Layer
4
4
  @faststore/api
5
- ✓ should return a valid GraphQL schema (8 ms)
6
- ✓ should return a valid GraphQL schema contain all expected types (7 ms)
5
+ ✓ should return a valid GraphQL schema (5 ms)
6
+ ✓ should return a valid GraphQL schema contain all expected types (4 ms)
7
7
  ✓ should return a valid GraphQL schema contain all expected queries (1 ms)
8
8
  ✓ should return a valid GraphQL schema contain all expected mutations (1 ms)
9
9
  VTEX API Extension
10
- ✓ getTypeDefsFromFolder function should return an Array (8 ms)
10
+ ✓ getTypeDefsFromFolder function should return an Array (5 ms)
11
11
  Third Party API Extension
12
- ✓ getTypeDefsFromFolder function should return an Array (6 ms)
12
+ ✓ getTypeDefsFromFolder function should return an Array (8 ms)
13
13
  Final Schema after merging
14
- ✓ should return a valid merged GraphQL schema (32 ms)
14
+ ✓ should return a valid merged GraphQL schema (25 ms)
15
15
  Envelop
16
- ✓ should exist with its plugins (26 ms)
17
- ✓ should handle options and execute (529 ms)
16
+ ✓ should exist with its plugins (24 ms)
17
+ ✓ should handle options and execute (209 ms)
18
18
 
19
19
  Test Suites: 1 passed, 1 total
20
20
  Tests: 9 passed, 9 total
21
21
  Snapshots: 0 total
22
- Time: 22.387 s
22
+ Time: 21.884 s
23
23
  Ran all test suites.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faststore/core",
3
- "version": "2.2.61",
3
+ "version": "2.2.65",
4
4
  "license": "MIT",
5
5
  "repository": "vtex/faststore",
6
6
  "browserslist": "supports es6-module and not dead",
@@ -38,10 +38,10 @@
38
38
  "@envelop/parser-cache": "^2.2.0",
39
39
  "@envelop/validation-cache": "^2.2.0",
40
40
  "@faststore/api": "^2.2.56",
41
- "@faststore/components": "^2.2.56",
41
+ "@faststore/components": "^2.2.63",
42
42
  "@faststore/graphql-utils": "^2.2.56",
43
43
  "@faststore/sdk": "^2.2.61",
44
- "@faststore/ui": "^2.2.56",
44
+ "@faststore/ui": "^2.2.63",
45
45
  "@graphql-codegen/cli": "^3.3.1",
46
46
  "@graphql-codegen/typescript": "^3.0.4",
47
47
  "@graphql-codegen/typescript-operations": "^3.0.4",
@@ -123,5 +123,5 @@
123
123
  "node": "18.19.0",
124
124
  "yarn": "1.19.1"
125
125
  },
126
- "gitHead": "b26e37e4a54d982f2550e804f2643a03b5159e85"
126
+ "gitHead": "16c28fe0a7fccde7ada90e239f6145e1260452d8"
127
127
  }
@@ -13,6 +13,7 @@
13
13
  @import "@faststore/ui/src/components/molecules/Gift/styles.scss";
14
14
  @import "@faststore/ui/src/components/molecules/QuantitySelector/styles.scss";
15
15
  @import "@faststore/ui/src/components/molecules/OrderSummary/styles.scss";
16
+ @import "@faststore/ui/src/components/molecules/ProductPrice/styles.scss";
16
17
  @import "@faststore/ui/src/components/organisms/EmptyState/styles.scss";
17
18
  @import "@faststore/ui/src/components/organisms/SlideOver/styles.scss";
18
19
  @import "@faststore/ui/src/components/organisms/CartSidebar/styles.scss";
@@ -4,11 +4,10 @@ import {
4
4
  } from '@faststore/ui'
5
5
  import type { ClientManyProductsQueryQuery } from '@generated/graphql'
6
6
  import ProductGridSkeleton from 'src/components/skeletons/ProductGridSkeleton'
7
-
8
7
  import { ProductCardProps } from '../ProductCard'
9
8
 
10
- import { __experimentalProductCard as ProductCard } from 'src/components/sections/ProductGallery/Overrides'
11
9
  import { memo } from 'react'
10
+ import { useOverrideComponents } from 'src/sdk/overrides/OverrideContext'
12
11
 
13
12
  interface Props {
14
13
  /**
@@ -30,11 +29,10 @@ function ProductGrid({
30
29
  products,
31
30
  page,
32
31
  pageSize,
33
- productCard: {
34
- showDiscountBadge = ProductCard.props.showDiscountBadge,
35
- bordered = ProductCard.props.bordered,
36
- } = {},
32
+ productCard: { showDiscountBadge, bordered } = {},
37
33
  }: Props) {
34
+ const { __experimentalProductCard: ProductCard } =
35
+ useOverrideComponents<'ProductGallery'>()
38
36
  const aspectRatio = 1
39
37
 
40
38
  return (
@@ -53,8 +51,10 @@ function ProductGrid({
53
51
  sizes: '30vw',
54
52
  }}
55
53
  {...ProductCard.props}
56
- bordered={bordered}
57
- showDiscountBadge={showDiscountBadge}
54
+ bordered={bordered ?? ProductCard.props.bordered}
55
+ showDiscountBadge={
56
+ showDiscountBadge ?? ProductCard.props.showDiscountBadge
57
+ }
58
58
  product={product}
59
59
  index={pageSize * page + idx + 1}
60
60
  />
@@ -3,13 +3,9 @@ import { useUI } from '@faststore/ui'
3
3
  import type { Filter_FacetsFragment } from '@generated/graphql'
4
4
  import { Suspense } from 'react'
5
5
  import { ProductGalleryProps } from 'src/components/ui/ProductGallery/ProductGallery'
6
+ import { useOverrideComponents } from 'src/sdk/overrides/OverrideContext'
6
7
  import { useFilter } from 'src/sdk/search/useFilter'
7
8
 
8
- import {
9
- __experimentalFilterDesktop as FilterDesktop,
10
- __experimentalFilterSlider as FilterSlider,
11
- } from 'src/components/sections/ProductGallery/Overrides'
12
-
13
9
  interface Props {
14
10
  /**
15
11
  * CMS defined data to be used in filter component.
@@ -31,6 +27,11 @@ function Filter({
31
27
  testId = 'fs-filter',
32
28
  filter: filterCmsData,
33
29
  }: Props) {
30
+ const {
31
+ __experimentalFilterDesktop: FilterDesktop,
32
+ __experimentalFilterSlider: FilterSlider,
33
+ } = useOverrideComponents<'ProductGallery'>()
34
+
34
35
  const filter = useFilter(allFacets)
35
36
  const { filter: displayFilter } = useUI()
36
37
 
@@ -14,6 +14,7 @@
14
14
  @import "@faststore/ui/src/components/atoms/Price/styles.scss";
15
15
  @import "@faststore/ui/src/components/molecules/LinkButton/styles.scss";
16
16
  @import "@faststore/ui/src/components/molecules/NavbarLinks/styles.scss";
17
+ @import "@faststore/ui/src/components/molecules/ProductPrice/styles.scss";
17
18
  @import "@faststore/ui/src/components/molecules/SearchAutoComplete/styles.scss";
18
19
  @import "@faststore/ui/src/components/molecules/SearchDropdown/styles.scss";
19
20
  @import "@faststore/ui/src/components/molecules/SearchHistory/styles.scss";
@@ -5,7 +5,7 @@ import {
5
5
  SkuSelector as UISkuSelector,
6
6
  ShippingSimulation as UIShippingSimulation,
7
7
  Icon as UIIcon,
8
- Price as UIPrice,
8
+ ProductPrice as UIProductPrice,
9
9
  QuantitySelector as UIQuantitySelector,
10
10
  ImageGalleryViewer as UIImageGalleryViewer,
11
11
  ImageGallery as UIImageGallery,
@@ -21,7 +21,7 @@ export const ProductDetailsDefaultComponents = {
21
21
  DiscountBadge: UIDiscountBadge,
22
22
  BuyButton: UIBuyButton,
23
23
  Icon: UIIcon,
24
- Price: UIPrice,
24
+ ProductPrice: UIProductPrice,
25
25
  QuantitySelector: UIQuantitySelector,
26
26
  SkuSelector: UISkuSelector,
27
27
  ShippingSimulation: UIShippingSimulation,
@@ -0,0 +1,29 @@
1
+ import { lazy } from 'react'
2
+ import {
3
+ Button as UIButton,
4
+ LinkButton as UILinkButton,
5
+ Skeleton as UISkeleton,
6
+ Icon as UIIcon,
7
+ } from '@faststore/ui'
8
+
9
+ import ProductCard from 'src/components/product/ProductCard'
10
+ import FilterDesktop from 'src/components/search/Filter/FilterDesktop'
11
+ import EmptyGallery from './EmptyGallery'
12
+
13
+ const FilterSlider = lazy(
14
+ () => import('src/components/search/Filter/FilterSlider')
15
+ )
16
+ export const ProductGalleryDefaultComponents = {
17
+ MobileFilterButton: UIButton,
18
+ FilterIcon: UIIcon,
19
+ PrevIcon: UIIcon,
20
+ ResultsCountSkeleton: UISkeleton,
21
+ SortSkeleton: UISkeleton,
22
+ FilterButtonSkeleton: UISkeleton,
23
+ LinkButtonPrev: UILinkButton,
24
+ LinkButtonNext: UILinkButton,
25
+ __experimentalFilterDesktop: FilterDesktop,
26
+ __experimentalFilterSlider: FilterSlider,
27
+ __experimentalProductCard: ProductCard,
28
+ __experimentalEmptyGallery: EmptyGallery,
29
+ } as const
@@ -0,0 +1,12 @@
1
+ import { override } from 'src/customizations/src/components/overrides/ProductGallery'
2
+ import { getOverriddenSection } from 'src/sdk/overrides/getOverriddenSection'
3
+ import type { SectionOverrideDefinition } from 'src/typings/overridesDefinition'
4
+
5
+ /**
6
+ * This component exists to support overrides 1.0
7
+ *
8
+ * This allows users to override the default ProductGallery section present in the Headless CMS
9
+ */
10
+ export const OverriddenDefaultProductGallery = getOverriddenSection(
11
+ override as SectionOverrideDefinition<'ProductGallery'>
12
+ )
@@ -6,8 +6,6 @@ import ProductGallery, {
6
6
  import Section from '../Section'
7
7
  import type { EmptyGalleryProps } from './EmptyGallery'
8
8
 
9
- import { __experimentalEmptyGallery as EmptyGallery } from 'src/components/sections/ProductGallery/Overrides'
10
-
11
9
  import styles from './section.module.scss'
12
10
  import {
13
11
  PLPContext,
@@ -16,6 +14,7 @@ import {
16
14
  isSearchPage,
17
15
  usePage,
18
16
  } from 'src/sdk/overrides/PageProvider'
17
+ import { useOverrideComponents } from 'src/sdk/overrides/OverrideContext'
19
18
 
20
19
  export interface ProductGallerySectionProps {
21
20
  searchTermLabel?: ProductGalleryProps['searchTermLabel']
@@ -33,6 +32,9 @@ function ProductGallerySection({
33
32
  emptyGallery,
34
33
  ...otherProps
35
34
  }: ProductGallerySectionProps) {
35
+ const { __experimentalEmptyGallery: EmptyGallery } =
36
+ useOverrideComponents<'ProductGallery'>()
37
+
36
38
  const context = usePage<SearchPageContext | PLPContext>()
37
39
  const [title, searchTerm] = isSearchPage(context)
38
40
  ? [context?.data?.title, context?.data?.searchTerm]
@@ -28,6 +28,7 @@
28
28
  @import "@faststore/ui/src/components/molecules/Rating/styles";
29
29
  @import "@faststore/ui/src/components/molecules/ProductCard/styles";
30
30
  @import "@faststore/ui/src/components/molecules/ProductCardSkeleton/styles";
31
+ @import "@faststore/ui/src/components/molecules/ProductPrice/styles";
31
32
  @import "@faststore/ui/src/components/organisms/ProductShelf/styles";
32
33
  }
33
34
  }
@@ -9,8 +9,9 @@
9
9
  @import "@faststore/ui/src/components/atoms/SROnly/styles";
10
10
  @import "@faststore/ui/src/components/molecules/DiscountBadge/styles";
11
11
  @import "@faststore/ui/src/components/molecules/Rating/styles";
12
- @import "@faststore/ui/src/components/molecules/ProductTile/styles";
13
12
  @import "@faststore/ui/src/components/molecules/ProductCard/styles";
13
+ @import "@faststore/ui/src/components/molecules/ProductPrice/styles";
14
+ @import "@faststore/ui/src/components/molecules/ProductTile/styles";
14
15
  @import "@faststore/ui/src/components/organisms/Tiles/styles";
15
16
  }
16
17
  }
@@ -1,7 +1,7 @@
1
1
  import type { ServerCollectionPageQueryQuery } from '@generated/graphql'
2
2
  import { OverriddenDefaultBreadcrumb as Breadcrumb } from 'src/components/sections/Breadcrumb/OverriddenDefaultBreadcrumb'
3
3
  import { OverriddenDefaultHero as Hero } from 'src/components/sections/Hero/OverriddenDefaultHero'
4
- import ProductGallery from 'src/components/sections/ProductGallery'
4
+ import { OverriddenDefaultProductGallery as ProductGallery } from 'src/components/sections/ProductGallery/OverriddenDefaultProductGallery'
5
5
  import { OverriddenDefaultProductShelf as ProductShelf } from 'src/components/sections/ProductShelf/OverriddenDefaultProductShelf'
6
6
  import ScrollToTopButton from 'src/components/sections/ScrollToTopButton'
7
7
  import { ITEMS_PER_PAGE } from 'src/constants'
@@ -2,7 +2,7 @@ import { useSearch } from '@faststore/sdk'
2
2
  import type { ComponentType } from 'react'
3
3
 
4
4
  import { OverriddenDefaultBreadcrumb as Breadcrumb } from 'src/components/sections/Breadcrumb/OverriddenDefaultBreadcrumb'
5
- import ProductGallery from 'src/components/sections/ProductGallery'
5
+ import { OverriddenDefaultProductGallery as ProductGallery } from 'src/components/sections/ProductGallery/OverriddenDefaultProductGallery'
6
6
  import { ITEMS_PER_PAGE } from 'src/constants'
7
7
  import CUSTOM_COMPONENTS from 'src/customizations/src/components'
8
8
  import RenderSections from 'src/components/cms/RenderSections'
@@ -36,7 +36,7 @@ function ProductDetailsSettings({
36
36
  const {
37
37
  BuyButton,
38
38
  Icon,
39
- Price,
39
+ ProductPrice,
40
40
  QuantitySelector,
41
41
  __experimentalNotAvailableButton: NotAvailableButton,
42
42
  } = useOverrideComponents<'ProductDetails'>()
@@ -52,7 +52,6 @@ function ProductDetailsSettings({
52
52
  image: productImages,
53
53
  additionalProperty,
54
54
  offers: {
55
- lowPrice,
56
55
  offers: [{ availability, price, listPrice, seller }],
57
56
  },
58
57
  } = product
@@ -78,10 +77,6 @@ function ProductDetailsSettings({
78
77
  () => availability === 'https://schema.org/OutOfStock',
79
78
  [availability]
80
79
  )
81
- const shouldShowDiscountedPrice = useMemo(
82
- () => lowPrice !== listPrice,
83
- [lowPrice, listPrice]
84
- )
85
80
 
86
81
  const AddToCartButton = () => {
87
82
  return outOfStock ? (
@@ -110,48 +105,13 @@ function ProductDetailsSettings({
110
105
  <>
111
106
  {!outOfStock && (
112
107
  <section data-fs-product-details-values>
113
- <div data-fs-product-details-prices>
114
- {shouldShowDiscountedPrice ? (
115
- <>
116
- <Price.Component
117
- formatter={useFormattedPrice}
118
- testId="list-price"
119
- variant="listing"
120
- SRText="Original price:"
121
- {...Price.props}
122
- // Dynamic props shouldn't be overridable
123
- // This decision can be reviewed later if needed
124
- value={listPrice}
125
- data-value={listPrice}
126
- />
127
- <Price.Component
128
- formatter={useFormattedPrice}
129
- testId="price"
130
- variant="spot"
131
- className="text__lead"
132
- SRText="Sale Price:"
133
- {...Price.props}
134
- // Dynamic props shouldn't be overridable
135
- // This decision can be reviewed later if needed
136
- value={lowPrice}
137
- data-value={lowPrice}
138
- />
139
- </>
140
- ) : (
141
- <Price.Component
142
- formatter={useFormattedPrice}
143
- testId="list-price"
144
- variant="spot"
145
- className="text__lead"
146
- SRText="Original price:"
147
- {...Price.props}
148
- // Dynamic props shouldn't be overridable
149
- // This decision can be reviewed later if needed
150
- value={lowPrice}
151
- data-value={lowPrice}
152
- />
153
- )}
154
- </div>
108
+ <ProductPrice.Component
109
+ data-fs-product-details-prices
110
+ value={price}
111
+ listPrice={listPrice}
112
+ formatter={useFormattedPrice}
113
+ {...ProductPrice.props}
114
+ />
155
115
  <QuantitySelector.Component
156
116
  min={1}
157
117
  max={10}
@@ -12,16 +12,6 @@ import ProductGridSkeleton from 'src/components/skeletons/ProductGridSkeleton'
12
12
  import { ProductCardProps } from 'src/components/product/ProductCard'
13
13
  import { FilterSliderProps } from 'src/components/search/Filter/FilterSlider'
14
14
  import { SortProps } from 'src/components/search/Sort/Sort'
15
- import {
16
- FilterButtonSkeleton,
17
- FilterIcon,
18
- LinkButtonNext,
19
- LinkButtonPrev,
20
- MobileFilterButton,
21
- PrevIcon,
22
- ResultsCountSkeleton,
23
- SortSkeleton,
24
- } from 'src/components/sections/ProductGallery/Overrides'
25
15
  import { useDelayedFacets } from 'src/sdk/search/useDelayedFacets'
26
16
  import { useDelayedPagination } from 'src/sdk/search/useDelayedPagination'
27
17
  import {
@@ -30,6 +20,7 @@ import {
30
20
  usePage,
31
21
  } from 'src/sdk/overrides/PageProvider'
32
22
  import { useProductsPrefetch } from 'src/sdk/product/useProductsPrefetch'
23
+ import { useOverrideComponents } from 'src/sdk/overrides/OverrideContext'
33
24
 
34
25
  const ProductGalleryPage = lazy(() => import('./ProductGalleryPage'))
35
26
  const GalleryPageSkeleton = <ProductGridSkeleton loading />
@@ -81,6 +72,17 @@ function ProductGallery({
81
72
  sortBySelector,
82
73
  productCard,
83
74
  }: ProductGalleryProps) {
75
+ const {
76
+ FilterButtonSkeleton,
77
+ FilterIcon,
78
+ LinkButtonNext,
79
+ LinkButtonPrev,
80
+ MobileFilterButton,
81
+ PrevIcon,
82
+ ResultsCountSkeleton,
83
+ SortSkeleton,
84
+ } = useOverrideComponents<'ProductGallery'>()
85
+
84
86
  const { openFilter } = useUI()
85
87
  const { pages, addNextPage, addPrevPage, itemsPerPage } = useSearch()
86
88
  const context = usePage<SearchPageContext | PLPContext>()
@@ -5,6 +5,7 @@ import Hero from '../../components/sections/Hero'
5
5
  import ProductShelf from '../../components/sections/ProductShelf'
6
6
  import CrossSellingShelf from '../../components/sections/CrossSellingShelf'
7
7
  import ProductDetails from '../../components/sections/ProductDetails'
8
+ import ProductGallery from '../../components/sections/ProductGallery'
8
9
 
9
10
  import type { DefaultSectionComponentsDefinitions } from '../../typings/overridesDefinition'
10
11
  import type { SectionsOverrides } from '../../typings/overrides'
@@ -13,8 +14,9 @@ import { BannerTextDefaultComponents } from '../../components/sections/BannerTex
13
14
  import { BreadcrumbDefaultComponents } from 'src/components/sections/Breadcrumb/DefaultComponents'
14
15
  import { CrossSellingShelfDefaultComponents } from 'src/components/sections/CrossSellingShelf/DefaultComponents'
15
16
  import { HeroDefaultComponents } from '../../components/sections/Hero/DefaultComponents'
16
- import { ProductShelfDefaultComponents } from '../../components/sections/ProductShelf/DefaultComponents'
17
17
  import { ProductDetailsDefaultComponents } from '../../components/sections/ProductDetails/DefaultComponents'
18
+ import { ProductGalleryDefaultComponents } from '../../components/sections/ProductGallery/DefaultComponents'
19
+ import { ProductShelfDefaultComponents } from '../../components/sections/ProductShelf/DefaultComponents'
18
20
 
19
21
  export const Sections = {
20
22
  Alert,
@@ -23,6 +25,7 @@ export const Sections = {
23
25
  CrossSellingShelf,
24
26
  Hero,
25
27
  ProductDetails,
28
+ ProductGallery,
26
29
  ProductShelf,
27
30
  }
28
31
 
@@ -38,5 +41,6 @@ export const DefaultComponents: Partial<
38
41
  CrossSellingShelf: CrossSellingShelfDefaultComponents,
39
42
  Hero: HeroDefaultComponents,
40
43
  ProductDetails: ProductDetailsDefaultComponents,
44
+ ProductGallery: ProductGalleryDefaultComponents,
41
45
  ProductShelf: ProductShelfDefaultComponents,
42
46
  }
@@ -26,7 +26,7 @@ import type {
26
26
  NavbarSliderFooterProps,
27
27
  NavbarSliderHeaderProps,
28
28
  NavbarSliderProps,
29
- PriceProps,
29
+ ProductPriceProps,
30
30
  ProductShelfProps,
31
31
  ProductTitleProps,
32
32
  QuantitySelectorProps,
@@ -56,6 +56,7 @@ export type SupportedSectionsOverridesV2 = Pick<
56
56
  | 'Hero'
57
57
  | 'ProductShelf'
58
58
  | 'ProductDetails'
59
+ | 'ProductGallery'
59
60
  >
60
61
 
61
62
  /**
@@ -160,9 +161,9 @@ export type SectionsOverrides = {
160
161
  >
161
162
  BuyButton: ComponentOverrideDefinition<ButtonProps, ButtonProps>
162
163
  Icon: ComponentOverrideDefinition<IconProps, IconProps>
163
- Price: ComponentOverrideDefinition<
164
- PriceProps,
165
- Omit<PriceProps, 'value' | 'data-value'>
164
+ ProductPrice: ComponentOverrideDefinition<
165
+ ProductPriceProps,
166
+ Omit<ProductPriceProps, 'value'>
166
167
  >
167
168
  QuantitySelector: ComponentOverrideDefinition<
168
169
  QuantitySelectorProps,