@faststore/core 2.2.63 → 2.2.66
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/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +40 -44
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/config.json +3 -3
- package/.next/cache/eslint/.cache_1gneedd +1 -1
- package/.next/cache/next-server.js.nft.json +1 -1
- package/.next/cache/webpack/client-production/0.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack +0 -0
- package/.next/cache/webpack/server-production/0.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.json +1 -1
- package/.next/react-loadable-manifest.json +3 -3
- package/.next/routes-manifest.json +1 -1
- package/.next/server/chunks/289.js +11 -8
- package/.next/server/chunks/445.js +167 -0
- package/.next/server/chunks/585.js +0 -22
- package/.next/server/chunks/74.js +1758 -80
- package/.next/server/chunks/863.js +0 -22
- package/.next/server/chunks/934.js +125 -0
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/pages/404.js.nft.json +1 -1
- package/.next/server/pages/500.js.nft.json +1 -1
- package/.next/server/pages/[...slug].js +5 -5
- package/.next/server/pages/[...slug].js.nft.json +1 -1
- package/.next/server/pages/[slug]/p.js.nft.json +1 -1
- package/.next/server/pages/_app.js.nft.json +1 -1
- package/.next/server/pages/account.js.nft.json +1 -1
- package/.next/server/pages/checkout.js.nft.json +1 -1
- package/.next/server/pages/en-US/404.html +2 -2
- package/.next/server/pages/en-US/500.html +2 -2
- package/.next/server/pages/en-US/account.html +2 -2
- package/.next/server/pages/en-US/checkout.html +2 -2
- package/.next/server/pages/en-US/login.html +2 -2
- package/.next/server/pages/en-US/s.html +2 -2
- package/.next/server/pages/en-US.html +2 -2
- package/.next/server/pages/index.js.nft.json +1 -1
- package/.next/server/pages/login.js.nft.json +1 -1
- package/.next/server/pages/s.js +5 -5
- package/.next/server/pages/s.js.nft.json +1 -1
- package/.next/server/pages-manifest.json +4 -4
- package/.next/static/Z7PsIH45Cy7Rnzoy9ETnz/_buildManifest.js +1 -0
- package/.next/static/chunks/585.ee7478bead8853ae.js +1 -0
- package/.next/static/chunks/800.8f4f91b39aa47346.js +1 -0
- package/.next/static/chunks/846-fbe704a112d163f4.js +1 -0
- package/.next/static/chunks/pages/404-5e6c01505839ca4e.js +1 -0
- package/.next/static/chunks/pages/500-92239cdd00a581dd.js +1 -0
- package/.next/static/chunks/pages/[...slug]-c7b64458aaf57ba4.js +1 -0
- package/.next/static/chunks/pages/[slug]/{p-fd236c3b1d28734d.js → p-1b15ce4b48000425.js} +1 -1
- package/.next/static/chunks/pages/{account-acd169fb6e00021f.js → account-2d15d4e38b855872.js} +1 -1
- package/.next/static/chunks/pages/{checkout-5de711ccb807644b.js → checkout-e34b1a2945839749.js} +1 -1
- package/.next/static/chunks/pages/{index-66a1b740f1101ce4.js → index-9bda5b7b8c3a723e.js} +1 -1
- package/.next/static/chunks/pages/login-1b197c0b0d5ba457.js +1 -0
- package/.next/static/chunks/pages/s-ed126d7e39eec25b.js +1 -0
- package/.next/static/chunks/webpack-340b017ee637c5d4.js +1 -0
- package/.next/static/css/7926db3235e499be.css +1 -0
- package/.next/trace +82 -81
- package/.turbo/turbo-build.log +10 -10
- package/.turbo/turbo-test.log +10 -10
- package/package.json +2 -2
- package/src/components/cms/GlobalSections.tsx +1 -1
- package/src/components/product/ProductGrid/ProductGrid.tsx +8 -8
- package/src/components/region/RegionBar/RegionBar.tsx +17 -21
- package/src/components/search/Filter/Filter.tsx +6 -5
- package/src/components/sections/ProductGallery/DefaultComponents.ts +29 -0
- package/src/components/sections/ProductGallery/OverriddenDefaultProductGallery.ts +12 -0
- package/src/components/sections/ProductGallery/ProductGallery.tsx +4 -2
- package/src/components/sections/RegionBar/DefaultComponents.ts +7 -0
- package/src/components/sections/RegionBar/OverriddenDefaultRegionBar.ts +12 -0
- package/src/components/templates/ProductListingPage/ProductListing.tsx +1 -1
- package/src/components/templates/SearchPage/SearchPage.tsx +1 -1
- package/src/components/ui/ProductGallery/ProductGallery.tsx +12 -10
- package/src/sdk/overrides/sections.tsx +9 -1
- package/src/typings/overrides.ts +2 -0
- package/.next/server/chunks/732.js +0 -1887
- package/.next/static/chunks/238-6cdd6e7841eba836.js +0 -1
- package/.next/static/chunks/585.4d5c26d3a9861c00.js +0 -1
- package/.next/static/chunks/800.ea75aa39e939d9af.js +0 -1
- package/.next/static/chunks/875-299d78c2777aa78f.js +0 -1
- package/.next/static/chunks/pages/404-340e5868f79ee704.js +0 -1
- package/.next/static/chunks/pages/500-ee2a5efc5808cdd4.js +0 -1
- package/.next/static/chunks/pages/[...slug]-8e6c8b59791c31e9.js +0 -1
- package/.next/static/chunks/pages/login-e5ee36783a4877fd.js +0 -1
- package/.next/static/chunks/pages/s-669d2eccade79e75.js +0 -1
- package/.next/static/chunks/webpack-b302478d1b1f81e9.js +0 -1
- package/.next/static/css/ac16c756c850c474.css +0 -1
- package/.next/static/css/d973eeb803fd5b08.css +0 -1
- package/.next/static/yHO1tC6ibIFdp6AHIusRm/_buildManifest.js +0 -1
- package/src/components/sections/ProductGallery/Overrides.tsx +0 -65
- package/src/components/sections/RegionBar/Overrides.tsx +0 -16
- /package/.next/static/{yHO1tC6ibIFdp6AHIusRm → Z7PsIH45Cy7Rnzoy9ETnz}/_ssgManifest.js +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -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
|
|
41
|
+
┌ ● / 6.23 kB 142 kB
|
|
42
42
|
├ └ css/d2e8564f2bf133d9.css 8.38 kB
|
|
43
43
|
├ /_app 0 B 83.7 kB
|
|
44
|
-
├ ● /[...slug]
|
|
44
|
+
├ ● /[...slug] 8.26 kB 144 kB
|
|
45
45
|
├ └ css/eababca67e15ef4b.css 8.8 kB
|
|
46
|
-
├ ● /[slug]/p 5.6 kB
|
|
46
|
+
├ ● /[slug]/p 5.6 kB 141 kB
|
|
47
47
|
├ └ css/e67c73ff7fbc8c54.css 4.42 kB
|
|
48
|
-
├ ○ /404 1.
|
|
49
|
-
├ ● /500 1.
|
|
50
|
-
├ ● /account 676 B
|
|
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
|
|
56
|
-
├ ● /login
|
|
57
|
-
└ ● /s
|
|
55
|
+
├ ● /checkout 661 B 136 kB
|
|
56
|
+
├ ● /login 983 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-
|
|
62
|
+
├ chunks/webpack-340b017ee637c5d4.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)
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
$ jest
|
|
2
|
-
PASS test/server/index.test.ts (
|
|
2
|
+
PASS test/server/index.test.ts (22.015 s)
|
|
3
3
|
FastStore GraphQL Layer
|
|
4
4
|
@faststore/api
|
|
5
|
-
✓ should return a valid GraphQL schema (
|
|
6
|
-
✓ should return a valid GraphQL schema contain all expected types (
|
|
7
|
-
✓ should return a valid GraphQL schema contain all expected queries (
|
|
5
|
+
✓ should return a valid GraphQL schema (9 ms)
|
|
6
|
+
✓ should return a valid GraphQL schema contain all expected types (10 ms)
|
|
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 (
|
|
10
|
+
✓ getTypeDefsFromFolder function should return an Array (9 ms)
|
|
11
11
|
Third Party API Extension
|
|
12
|
-
✓ getTypeDefsFromFolder function should return an Array (
|
|
12
|
+
✓ getTypeDefsFromFolder function should return an Array (13 ms)
|
|
13
13
|
Final Schema after merging
|
|
14
|
-
✓ should return a valid merged GraphQL schema (
|
|
14
|
+
✓ should return a valid merged GraphQL schema (26 ms)
|
|
15
15
|
Envelop
|
|
16
|
-
✓ should exist with its plugins (
|
|
17
|
-
✓ should handle options and execute (
|
|
16
|
+
✓ should exist with its plugins (41 ms)
|
|
17
|
+
✓ should handle options and execute (602 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
|
+
Time: 22.137 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.
|
|
3
|
+
"version": "2.2.66",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": "vtex/faststore",
|
|
6
6
|
"browserslist": "supports es6-module and not dead",
|
|
@@ -123,5 +123,5 @@
|
|
|
123
123
|
"node": "18.19.0",
|
|
124
124
|
"yarn": "1.19.1"
|
|
125
125
|
},
|
|
126
|
-
"gitHead": "
|
|
126
|
+
"gitHead": "81034df9aab52c9772e5c4684fc5c2138890b24b"
|
|
127
127
|
}
|
|
@@ -8,9 +8,9 @@ import Toast from 'src/components/common/Toast'
|
|
|
8
8
|
import RenderSections from './RenderSections'
|
|
9
9
|
|
|
10
10
|
import { OverriddenDefaultAlert as Alert } from 'src/components/sections/Alert/OverriddenDefaultAlert'
|
|
11
|
+
import { OverriddenDefaultRegionBar as RegionBar } from 'src/components/sections/RegionBar/OverriddenDefaultRegionBar'
|
|
11
12
|
import Footer from 'src/components/sections/Footer'
|
|
12
13
|
import Navbar from 'src/components/sections/Navbar'
|
|
13
|
-
import RegionBar from 'src/components/sections/RegionBar'
|
|
14
14
|
|
|
15
15
|
const RegionModal = lazy(() => import('src/components/region/RegionModal'))
|
|
16
16
|
const CartSidebar = lazy(() => import('src/components/cart/CartSidebar'))
|
|
@@ -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={
|
|
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,11 +3,7 @@ import type { RegionBarProps as UIRegionBarProps } from '@faststore/ui'
|
|
|
3
3
|
import { useUI } from '@faststore/ui'
|
|
4
4
|
import { useSession } from 'src/sdk/session'
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
RegionBar as RegionBarWrapper,
|
|
8
|
-
LocationIcon,
|
|
9
|
-
ButtonIcon,
|
|
10
|
-
} from 'src/components/sections/RegionBar/Overrides'
|
|
6
|
+
import { useOverrideComponents } from 'src/sdk/overrides/OverrideContext'
|
|
11
7
|
|
|
12
8
|
export interface RegionBarProps {
|
|
13
9
|
/**
|
|
@@ -35,18 +31,18 @@ export interface RegionBarProps {
|
|
|
35
31
|
}
|
|
36
32
|
|
|
37
33
|
function RegionBar({
|
|
38
|
-
icon: {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
buttonIcon: {
|
|
43
|
-
icon: buttonIcon = ButtonIcon.props.name,
|
|
44
|
-
alt: buttonIconAlt = ButtonIcon.props['aria-label'],
|
|
45
|
-
},
|
|
46
|
-
label = RegionBarWrapper.props.label,
|
|
47
|
-
editLabel = RegionBarWrapper.props.editLabel,
|
|
34
|
+
icon: { icon: locationIcon, alt: locationIconAlt },
|
|
35
|
+
buttonIcon: { icon: buttonIcon, alt: buttonIconAlt },
|
|
36
|
+
label,
|
|
37
|
+
editLabel,
|
|
48
38
|
...otherProps
|
|
49
39
|
}: RegionBarProps) {
|
|
40
|
+
const {
|
|
41
|
+
RegionBar: RegionBarWrapper,
|
|
42
|
+
LocationIcon,
|
|
43
|
+
ButtonIcon,
|
|
44
|
+
} = useOverrideComponents<'RegionBar'>()
|
|
45
|
+
|
|
50
46
|
const { openModal } = useUI()
|
|
51
47
|
const { postalCode } = useSession()
|
|
52
48
|
|
|
@@ -55,20 +51,20 @@ function RegionBar({
|
|
|
55
51
|
icon={
|
|
56
52
|
<LocationIcon.Component
|
|
57
53
|
{...LocationIcon.props}
|
|
58
|
-
name={locationIcon}
|
|
59
|
-
aria-label={locationIconAlt}
|
|
54
|
+
name={locationIcon ?? LocationIcon.props.name}
|
|
55
|
+
aria-label={locationIconAlt ?? LocationIcon.props['aria-label']}
|
|
60
56
|
/>
|
|
61
57
|
}
|
|
62
58
|
buttonIcon={
|
|
63
59
|
<ButtonIcon.Component
|
|
64
60
|
{...ButtonIcon.props}
|
|
65
|
-
name={buttonIcon}
|
|
66
|
-
aria-label={buttonIconAlt}
|
|
61
|
+
name={buttonIcon ?? ButtonIcon.props.name}
|
|
62
|
+
aria-label={buttonIconAlt ?? ButtonIcon.props['aria-label']}
|
|
67
63
|
/>
|
|
68
64
|
}
|
|
69
65
|
{...RegionBarWrapper.props}
|
|
70
|
-
label={label}
|
|
71
|
-
editLabel={editLabel}
|
|
66
|
+
label={label ?? RegionBarWrapper.props.label}
|
|
67
|
+
editLabel={editLabel ?? RegionBarWrapper.props.editLabel}
|
|
72
68
|
// Dynamic props shouldn't be overridable
|
|
73
69
|
// This decision can be reviewed later if needed
|
|
74
70
|
onButtonClick={openModal}
|
|
@@ -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
|
|
|
@@ -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]
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { override } from 'src/customizations/src/components/overrides/RegionBar'
|
|
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 RegionBar section present in the Headless CMS
|
|
9
|
+
*/
|
|
10
|
+
export const OverriddenDefaultRegionBar = getOverriddenSection(
|
|
11
|
+
override as SectionOverrideDefinition<'RegionBar'>
|
|
12
|
+
)
|
|
@@ -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'
|
|
@@ -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,8 @@ 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'
|
|
9
|
+
import RegionBar from '../../components/sections/RegionBar'
|
|
8
10
|
|
|
9
11
|
import type { DefaultSectionComponentsDefinitions } from '../../typings/overridesDefinition'
|
|
10
12
|
import type { SectionsOverrides } from '../../typings/overrides'
|
|
@@ -13,8 +15,10 @@ import { BannerTextDefaultComponents } from '../../components/sections/BannerTex
|
|
|
13
15
|
import { BreadcrumbDefaultComponents } from 'src/components/sections/Breadcrumb/DefaultComponents'
|
|
14
16
|
import { CrossSellingShelfDefaultComponents } from 'src/components/sections/CrossSellingShelf/DefaultComponents'
|
|
15
17
|
import { HeroDefaultComponents } from '../../components/sections/Hero/DefaultComponents'
|
|
16
|
-
import { ProductShelfDefaultComponents } from '../../components/sections/ProductShelf/DefaultComponents'
|
|
17
18
|
import { ProductDetailsDefaultComponents } from '../../components/sections/ProductDetails/DefaultComponents'
|
|
19
|
+
import { ProductGalleryDefaultComponents } from '../../components/sections/ProductGallery/DefaultComponents'
|
|
20
|
+
import { ProductShelfDefaultComponents } from '../../components/sections/ProductShelf/DefaultComponents'
|
|
21
|
+
import { RegionBarDefaultComponents } from '../../components/sections/RegionBar/DefaultComponents'
|
|
18
22
|
|
|
19
23
|
export const Sections = {
|
|
20
24
|
Alert,
|
|
@@ -23,7 +27,9 @@ export const Sections = {
|
|
|
23
27
|
CrossSellingShelf,
|
|
24
28
|
Hero,
|
|
25
29
|
ProductDetails,
|
|
30
|
+
ProductGallery,
|
|
26
31
|
ProductShelf,
|
|
32
|
+
RegionBar,
|
|
27
33
|
}
|
|
28
34
|
|
|
29
35
|
export const DefaultComponents: Partial<
|
|
@@ -38,5 +44,7 @@ export const DefaultComponents: Partial<
|
|
|
38
44
|
CrossSellingShelf: CrossSellingShelfDefaultComponents,
|
|
39
45
|
Hero: HeroDefaultComponents,
|
|
40
46
|
ProductDetails: ProductDetailsDefaultComponents,
|
|
47
|
+
ProductGallery: ProductGalleryDefaultComponents,
|
|
41
48
|
ProductShelf: ProductShelfDefaultComponents,
|
|
49
|
+
RegionBar: RegionBarDefaultComponents,
|
|
42
50
|
}
|