@faststore/core 2.1.33 → 2.1.35
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 -0
- package/.next/build-manifest.json +129 -0
- package/.next/cache/.tsbuildinfo +1 -0
- package/.next/cache/config.json +7 -0
- package/.next/cache/eslint/.cache_1gneedd +1 -0
- package/.next/cache/next-server.js.nft.json +1 -0
- 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/export-marker.json +1 -0
- package/.next/images-manifest.json +1 -0
- package/.next/next-server.js.nft.json +1 -0
- package/.next/package.json +1 -0
- package/.next/prerender-manifest.json +1 -0
- package/.next/react-loadable-manifest.json +44 -0
- package/.next/required-server-files.json +1 -0
- package/.next/routes-manifest.json +1 -0
- package/.next/server/chunks/123.js +58 -0
- package/.next/server/chunks/143.js +106 -0
- package/.next/server/chunks/183.js +90 -0
- package/.next/server/chunks/184.js +61 -0
- package/.next/server/chunks/186.js +113 -0
- package/.next/server/chunks/247.js +61 -0
- package/.next/server/chunks/253.js +509 -0
- package/.next/server/chunks/269.js +517 -0
- package/.next/server/chunks/287.js +58 -0
- package/.next/server/chunks/289.js +239 -0
- package/.next/server/chunks/312.js +697 -0
- package/.next/server/chunks/350.js +143 -0
- package/.next/server/chunks/487.js +9142 -0
- package/.next/server/chunks/502.js +626 -0
- package/.next/server/chunks/576.js +90 -0
- package/.next/server/chunks/597.js +211 -0
- package/.next/server/chunks/650.js +9142 -0
- package/.next/server/chunks/676.js +32 -0
- package/.next/server/chunks/721.js +650 -0
- package/.next/server/chunks/74.js +4039 -0
- package/.next/server/chunks/81.js +1254 -0
- package/.next/server/chunks/825.js +4039 -0
- package/.next/server/chunks/854.js +72 -0
- package/.next/server/chunks/859.js +959 -0
- package/.next/server/chunks/886.js +120 -0
- package/.next/server/chunks/907.js +1910 -0
- package/.next/server/chunks/98.js +124 -0
- package/.next/server/chunks/font-manifest.json +1 -0
- package/.next/server/font-manifest.json +1 -0
- package/.next/server/middleware-build-manifest.js +1 -0
- package/.next/server/middleware-manifest.json +6 -0
- package/.next/server/middleware-react-loadable-manifest.js +1 -0
- package/.next/server/pages/404.js +386 -0
- package/.next/server/pages/404.js.nft.json +1 -0
- package/.next/server/pages/500.js +388 -0
- package/.next/server/pages/500.js.nft.json +1 -0
- package/.next/server/pages/[...slug].js +1005 -0
- package/.next/server/pages/[...slug].js.nft.json +1 -0
- package/.next/server/pages/[slug]/p.js +2337 -0
- package/.next/server/pages/[slug]/p.js.nft.json +1 -0
- package/.next/server/pages/_app.js +281 -0
- package/.next/server/pages/_app.js.nft.json +1 -0
- package/.next/server/pages/_document.js +352 -0
- package/.next/server/pages/_document.js.nft.json +1 -0
- package/.next/server/pages/_error.js +164 -0
- package/.next/server/pages/_error.js.nft.json +1 -0
- package/.next/server/pages/account.js +363 -0
- package/.next/server/pages/account.js.nft.json +1 -0
- package/.next/server/pages/api/graphql.js +365 -0
- package/.next/server/pages/api/graphql.js.nft.json +1 -0
- package/.next/server/pages/api/preview.js +148 -0
- package/.next/server/pages/api/preview.js.nft.json +1 -0
- package/.next/server/pages/checkout.js +363 -0
- package/.next/server/pages/checkout.js.nft.json +1 -0
- package/.next/server/pages/en-US/404.html +81 -0
- package/.next/server/pages/en-US/404.json +1 -0
- package/.next/server/pages/en-US/500.html +81 -0
- package/.next/server/pages/en-US/500.json +1 -0
- package/.next/server/pages/en-US/account.html +81 -0
- package/.next/server/pages/en-US/account.json +1 -0
- package/.next/server/pages/en-US/checkout.html +81 -0
- package/.next/server/pages/en-US/checkout.json +1 -0
- package/.next/server/pages/en-US/login.html +81 -0
- package/.next/server/pages/en-US/login.json +1 -0
- package/.next/server/pages/en-US/s.html +81 -0
- package/.next/server/pages/en-US/s.json +1 -0
- package/.next/server/pages/en-US.html +81 -0
- package/.next/server/pages/en-US.json +1 -0
- package/.next/server/pages/index.js +439 -0
- package/.next/server/pages/index.js.nft.json +1 -0
- package/.next/server/pages/login.js +368 -0
- package/.next/server/pages/login.js.nft.json +1 -0
- package/.next/server/pages/s.js +466 -0
- package/.next/server/pages/s.js.nft.json +1 -0
- package/.next/server/pages-manifest.json +16 -0
- package/.next/server/webpack-api-runtime.js +229 -0
- package/.next/server/webpack-runtime.js +229 -0
- package/.next/static/chunks/143.dd8a556e6957baa1.js +1 -0
- package/.next/static/chunks/209-d1d2eeaeefbc68f7.js +1 -0
- package/.next/static/chunks/495.0ecd099878b2a36d.js +1 -0
- package/.next/static/chunks/502.b14533723651e5a1.js +1 -0
- package/.next/static/chunks/548-6b23e7ad82cd22b9.js +1 -0
- package/.next/static/chunks/597.f8d0595b113c70af.js +1 -0
- package/.next/static/chunks/64.2f385ef39cd5877d.js +1 -0
- package/.next/static/chunks/651.7142f31ce1e052b3.js +1 -0
- package/.next/static/chunks/706-1020d118bb59b204.js +1 -0
- package/.next/static/chunks/738-a5ff304828f20cbf.js +1 -0
- package/.next/static/chunks/741.52f7fb873418346f.js +1 -0
- package/.next/static/chunks/791-681afeb766a9098f.js +1 -0
- package/.next/static/chunks/98.97381d2021f86cd9.js +1 -0
- package/.next/static/chunks/framework-dfd14d7ce6600b03.js +1 -0
- package/.next/static/chunks/main-fd466221927468fd.js +1 -0
- package/.next/static/chunks/pages/404-14d27e3706f3d2c3.js +1 -0
- package/.next/static/chunks/pages/500-250ccf5c9626e451.js +1 -0
- package/.next/static/chunks/pages/[...slug]-bcfaf0c5d60b57a0.js +1 -0
- package/.next/static/chunks/pages/[slug]/p-c1f2b05344981f12.js +1 -0
- package/.next/static/chunks/pages/_app-babcc4d7b80d8f4a.js +1 -0
- package/.next/static/chunks/pages/_error-a7a0c1d9bfbb4f38.js +1 -0
- package/.next/static/chunks/pages/account-d248acc931146694.js +1 -0
- package/.next/static/chunks/pages/checkout-97f6d6f36f041a6f.js +1 -0
- package/.next/static/chunks/pages/index-bdbfb082027ed2b7.js +1 -0
- package/.next/static/chunks/pages/login-b1bdf30c951bb60d.js +1 -0
- package/.next/static/chunks/pages/s-aabfa5c08338974a.js +1 -0
- package/.next/static/chunks/polyfills-c67a75d1b6f99dc8.js +1 -0
- package/.next/static/chunks/webpack-73cade94715ad9e1.js +1 -0
- package/.next/static/css/208b7dd52a0981bd.css +1 -0
- package/.next/static/css/41ef280537acec50.css +1 -0
- package/.next/static/css/4ad5a6bd11a9f8d8.css +1 -0
- package/.next/static/css/5330ae3076254840.css +1 -0
- package/.next/static/css/5972921daee792bb.css +1 -0
- package/.next/static/css/6e1a7434f061d0ef.css +1 -0
- package/.next/static/css/82a475e147f4b2ee.css +1 -0
- package/.next/static/css/af5ef0767b748cb3.css +1 -0
- package/.next/static/css/cb7d1fcea42fab9c.css +1 -0
- package/.next/static/css/d67fbe2a613293c1.css +1 -0
- package/.next/static/uXS-aZT8ClbPcIudKFF0d/_buildManifest.js +1 -0
- package/.next/static/uXS-aZT8ClbPcIudKFF0d/_ssgManifest.js +1 -0
- package/.next/trace +80 -0
- package/.turbo/turbo-build.log +7 -7
- package/package.json +2 -2
- package/public/~partytown/debug/partytown-atomics.js +556 -0
- package/public/~partytown/debug/partytown-media.js +374 -0
- package/public/~partytown/debug/partytown-sandbox-sw.js +543 -0
- package/public/~partytown/debug/partytown-sw.js +59 -0
- package/public/~partytown/debug/partytown-ww-atomics.js +1789 -0
- package/public/~partytown/debug/partytown-ww-sw.js +1781 -0
- package/public/~partytown/debug/partytown.js +72 -0
- package/public/~partytown/partytown-atomics.js +2 -0
- package/public/~partytown/partytown-media.js +2 -0
- package/public/~partytown/partytown-sw.js +2 -0
- package/public/~partytown/partytown.js +2 -0
- package/src/components/common/Alert/Alert.tsx +5 -8
- package/src/components/navigation/Navbar/Navbar.tsx +22 -22
- package/src/components/navigation/NavbarLinks/NavbarLinks.tsx +8 -7
- package/src/components/navigation/NavbarSlider/NavbarSlider.tsx +15 -14
- package/src/components/product/ProductGrid/ProductGrid.tsx +5 -10
- package/src/components/region/RegionBar/RegionBar.tsx +27 -13
- package/src/components/search/Filter/Filter.tsx +6 -11
- package/src/components/sections/Alert/Alert.tsx +17 -13
- package/src/components/sections/Alert/Overrides.tsx +13 -25
- package/src/components/sections/BannerText/BannerText.tsx +24 -20
- package/src/components/sections/BannerText/Overrides.tsx +11 -23
- package/src/components/sections/Breadcrumb/Overrides.tsx +13 -25
- package/src/components/sections/EmptyState/EmptyState.tsx +6 -8
- package/src/components/sections/EmptyState/Overrides.tsx +12 -24
- package/src/components/sections/Hero/Hero.tsx +15 -12
- package/src/components/sections/Hero/Overrides.tsx +12 -24
- package/src/components/sections/Navbar/Overrides.tsx +43 -31
- package/src/components/sections/Newsletter/Overrides.tsx +28 -26
- package/src/components/sections/ProductDetails/Overrides.tsx +51 -38
- package/src/components/sections/ProductDetails/ProductDetails.tsx +22 -30
- package/src/components/sections/ProductGallery/Overrides.tsx +44 -35
- package/src/components/sections/ProductShelf/Overrides.tsx +14 -28
- package/src/components/sections/RegionBar/Overrides.tsx +12 -24
- package/src/components/ui/Breadcrumb/Breadcrumb.tsx +9 -7
- package/src/components/ui/ImageGallery/ImageGallery.tsx +13 -19
- package/src/components/ui/Newsletter/Newsletter.tsx +23 -24
- package/src/components/ui/ProductDetails/ProductDetailsSettings.tsx +21 -17
- package/src/components/ui/ProductGallery/ProductGallery.tsx +31 -38
- package/src/components/ui/ProductShelf/ProductShelf.tsx +11 -16
- package/src/components/ui/ShippingSimulation/ShippingSimulation.tsx +2 -3
- package/src/components/ui/SkuSelector/Selectors.tsx +8 -7
- package/src/customizations/components/overrides/Alert.tsx +3 -7
- package/src/customizations/components/overrides/BannerText.tsx +3 -7
- package/src/customizations/components/overrides/Breadcrumb.tsx +3 -7
- package/src/customizations/components/overrides/EmptyState.tsx +3 -6
- package/src/customizations/components/overrides/Hero.tsx +3 -8
- package/src/customizations/components/overrides/Navbar.tsx +3 -16
- package/src/customizations/components/overrides/Newsletter.tsx +3 -11
- package/src/customizations/components/overrides/ProductDetails.tsx +3 -18
- package/src/customizations/components/overrides/ProductGallery.tsx +3 -16
- package/src/customizations/components/overrides/ProductShelf.tsx +3 -8
- package/src/customizations/components/overrides/RegionBar.tsx +3 -8
- package/src/typings/overrideDefinitionUtils.ts +40 -0
- package/src/typings/overrides.ts +267 -0
- package/src/utils/overrides.ts +53 -0
- package/src/typings/overrides.d.ts +0 -97
|
@@ -10,47 +10,60 @@ import {
|
|
|
10
10
|
ImageZoom as UIImageZoom,
|
|
11
11
|
ImageGallery as UIImageGallery,
|
|
12
12
|
} from '@faststore/ui'
|
|
13
|
-
import ImageGallery from 'src/components/ui/ImageGallery'
|
|
14
|
-
import ShippingSimulation from 'src/components/ui/ShippingSimulation/ShippingSimulation'
|
|
15
|
-
import { Image } from 'src/components/ui/Image'
|
|
16
|
-
|
|
17
|
-
import ProductDetailsCustomizations from 'src/customizations/components/overrides/ProductDetails'
|
|
18
|
-
|
|
19
|
-
const productDetailsComponentsCustomization = {}
|
|
20
13
|
|
|
21
|
-
|
|
14
|
+
import LocalImageGallery from 'src/components/ui/ImageGallery'
|
|
15
|
+
import LocalShippingSimulation from 'src/components/ui/ShippingSimulation/ShippingSimulation'
|
|
16
|
+
import { Image } from 'src/components/ui/Image'
|
|
22
17
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
productDetailsComponentsCustomization[key] = value.Component
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
)
|
|
18
|
+
import { getSectionOverrides } from 'src/utils/overrides'
|
|
19
|
+
import { override } from 'src/customizations/components/overrides/ProductDetails'
|
|
20
|
+
import type { ProductDetailsOverrideDefinition } from 'src/typings/overrides'
|
|
30
21
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
22
|
+
const {
|
|
23
|
+
ProductTitle,
|
|
24
|
+
DiscountBadge,
|
|
25
|
+
BuyButton,
|
|
26
|
+
Icon,
|
|
27
|
+
Price,
|
|
28
|
+
QuantitySelector,
|
|
29
|
+
SkuSelector,
|
|
30
|
+
ShippingSimulation,
|
|
31
|
+
ImageGallery,
|
|
32
|
+
ImageZoom,
|
|
33
|
+
__experimentalImageGalleryImage,
|
|
34
|
+
__experimentalImageGallery,
|
|
35
|
+
__experimentalShippingSimulation,
|
|
36
|
+
} = getSectionOverrides(
|
|
37
|
+
{
|
|
38
|
+
ProductTitle: UIProductTitle,
|
|
39
|
+
DiscountBadge: UIDiscountBadge,
|
|
40
|
+
BuyButton: UIBuyButton,
|
|
41
|
+
Icon: UIIcon,
|
|
42
|
+
Price: UIPrice,
|
|
43
|
+
QuantitySelector: UIQuantitySelector,
|
|
44
|
+
SkuSelector: UISkuSelector,
|
|
45
|
+
ShippingSimulation: UIShippingSimulation,
|
|
46
|
+
ImageGallery: UIImageGallery,
|
|
47
|
+
ImageZoom: UIImageZoom,
|
|
48
|
+
__experimentalImageGalleryImage: Image,
|
|
49
|
+
__experimentalImageGallery: LocalImageGallery,
|
|
50
|
+
__experimentalShippingSimulation: LocalShippingSimulation,
|
|
51
|
+
},
|
|
52
|
+
override as ProductDetailsOverrideDefinition
|
|
37
53
|
)
|
|
38
54
|
|
|
39
|
-
|
|
40
|
-
ProductTitle
|
|
41
|
-
DiscountBadge
|
|
42
|
-
BuyButton
|
|
43
|
-
Icon
|
|
44
|
-
Price
|
|
45
|
-
QuantitySelector
|
|
46
|
-
SkuSelector
|
|
47
|
-
ShippingSimulation
|
|
48
|
-
ImageGallery
|
|
49
|
-
ImageZoom
|
|
50
|
-
__experimentalImageGalleryImage
|
|
51
|
-
__experimentalImageGallery
|
|
52
|
-
__experimentalShippingSimulation
|
|
53
|
-
...productDetailsComponentsCustomization,
|
|
55
|
+
export {
|
|
56
|
+
ProductTitle,
|
|
57
|
+
DiscountBadge,
|
|
58
|
+
BuyButton,
|
|
59
|
+
Icon,
|
|
60
|
+
Price,
|
|
61
|
+
QuantitySelector,
|
|
62
|
+
SkuSelector,
|
|
63
|
+
ShippingSimulation,
|
|
64
|
+
ImageGallery,
|
|
65
|
+
ImageZoom,
|
|
66
|
+
__experimentalImageGalleryImage,
|
|
67
|
+
__experimentalImageGallery,
|
|
68
|
+
__experimentalShippingSimulation,
|
|
54
69
|
}
|
|
55
|
-
|
|
56
|
-
export { Components, productDetailsPropsCustomization as Props }
|
|
@@ -18,16 +18,11 @@ import { ProductDetailsSettings } from 'src/components/ui/ProductDetails'
|
|
|
18
18
|
import styles from './section.module.scss'
|
|
19
19
|
|
|
20
20
|
import {
|
|
21
|
-
Components,
|
|
22
|
-
Props,
|
|
23
|
-
} from 'src/components/sections/ProductDetails/Overrides'
|
|
24
|
-
|
|
25
|
-
const {
|
|
26
21
|
ProductTitle,
|
|
27
22
|
DiscountBadge,
|
|
28
|
-
__experimentalImageGallery
|
|
29
|
-
__experimentalShippingSimulation
|
|
30
|
-
}
|
|
23
|
+
__experimentalImageGallery as ImageGallery,
|
|
24
|
+
__experimentalShippingSimulation as ShippingSimulation,
|
|
25
|
+
} from 'src/components/sections/ProductDetails/Overrides'
|
|
31
26
|
|
|
32
27
|
interface ProductDetailsContextProps {
|
|
33
28
|
context: ProductDetailsFragment_ProductFragment
|
|
@@ -70,25 +65,22 @@ function ProductDetails({
|
|
|
70
65
|
refNumber: showRefNumber,
|
|
71
66
|
discountBadge: {
|
|
72
67
|
showDiscountBadge,
|
|
73
|
-
size: discountBadgeSize =
|
|
68
|
+
size: discountBadgeSize = DiscountBadge.props.size,
|
|
74
69
|
},
|
|
75
70
|
},
|
|
76
71
|
buyButton: { icon: buyButtonIcon, title: buyButtonTitle },
|
|
77
72
|
shippingSimulator: {
|
|
78
|
-
title: shippingSimulatorTitle =
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
'__experimentalShippingSimulation'
|
|
85
|
-
].optionsLabel,
|
|
73
|
+
title: shippingSimulatorTitle = ShippingSimulation.props.title,
|
|
74
|
+
inputLabel: shippingSimulatorInputLabel = ShippingSimulation.props
|
|
75
|
+
.inputLabel,
|
|
76
|
+
shippingOptionsTableTitle:
|
|
77
|
+
shippingSimulatorOptionsTableTitle = ShippingSimulation.props
|
|
78
|
+
.optionsLabel,
|
|
86
79
|
link: {
|
|
87
|
-
to: shippingSimulatorLinkUrl =
|
|
80
|
+
to: shippingSimulatorLinkUrl = ShippingSimulation.props
|
|
88
81
|
.idkPostalCodeLinkProps?.href,
|
|
89
|
-
text: shippingSimulatorLinkText =
|
|
90
|
-
|
|
91
|
-
].idkPostalCodeLinkProps?.children,
|
|
82
|
+
text: shippingSimulatorLinkText = ShippingSimulation.props
|
|
83
|
+
.idkPostalCodeLinkProps?.children,
|
|
92
84
|
},
|
|
93
85
|
},
|
|
94
86
|
productDescription: {
|
|
@@ -165,16 +157,16 @@ function ProductDetails({
|
|
|
165
157
|
<section data-fs-product-details>
|
|
166
158
|
<section data-fs-product-details-body data-fs-content="product-details">
|
|
167
159
|
<header data-fs-product-details-title data-fs-product-details-section>
|
|
168
|
-
<ProductTitle
|
|
160
|
+
<ProductTitle.Component
|
|
169
161
|
// TODO: We should review this prop. There's now way to override the title and use the dynamic name value.
|
|
170
162
|
// Maybe passing a ProductTitleHeader component as a prop would be better, as it would be overridable.
|
|
171
163
|
// Maybe now it's worth to make title always a h1 and receive only the name, as it would be easier for users to override.
|
|
172
164
|
title={<h1>{name}</h1>}
|
|
173
|
-
{...
|
|
165
|
+
{...ProductTitle.props}
|
|
174
166
|
label={
|
|
175
167
|
showDiscountBadge && (
|
|
176
|
-
<DiscountBadge
|
|
177
|
-
{...
|
|
168
|
+
<DiscountBadge.Component
|
|
169
|
+
{...DiscountBadge.props}
|
|
178
170
|
size={discountBadgeSize}
|
|
179
171
|
// Dynamic props shouldn't be overridable
|
|
180
172
|
// This decision can be reviewed later if needed
|
|
@@ -186,9 +178,9 @@ function ProductDetails({
|
|
|
186
178
|
refNumber={showRefNumber && productId}
|
|
187
179
|
/>
|
|
188
180
|
</header>
|
|
189
|
-
<ImageGallery
|
|
181
|
+
<ImageGallery.Component
|
|
190
182
|
data-fs-product-details-gallery
|
|
191
|
-
{...
|
|
183
|
+
{...ImageGallery.props}
|
|
192
184
|
images={productImages}
|
|
193
185
|
/>
|
|
194
186
|
<section data-fs-product-details-info>
|
|
@@ -211,13 +203,13 @@ function ProductDetails({
|
|
|
211
203
|
</section>
|
|
212
204
|
|
|
213
205
|
{availability && (
|
|
214
|
-
<ShippingSimulation
|
|
206
|
+
<ShippingSimulation.Component
|
|
215
207
|
data-fs-product-details-section
|
|
216
208
|
data-fs-product-details-shipping
|
|
217
209
|
formatter={useFormattedPrice}
|
|
218
|
-
{...
|
|
210
|
+
{...ShippingSimulation.props}
|
|
219
211
|
idkPostalCodeLinkProps={{
|
|
220
|
-
...
|
|
212
|
+
...ShippingSimulation.props.idkPostalCodeLinkProps,
|
|
221
213
|
href: shippingSimulatorLinkUrl,
|
|
222
214
|
children: shippingSimulatorLinkText,
|
|
223
215
|
}}
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
Skeleton as UISkeleton,
|
|
6
6
|
Icon as UIIcon,
|
|
7
7
|
} from '@faststore/ui'
|
|
8
|
+
|
|
8
9
|
import ProductCard from 'src/components/product/ProductCard'
|
|
9
10
|
import FilterDesktop from 'src/components/search/Filter/FilterDesktop'
|
|
10
11
|
|
|
@@ -12,41 +13,49 @@ const FilterSlider = lazy(
|
|
|
12
13
|
() => import('src/components/search/Filter/FilterSlider')
|
|
13
14
|
)
|
|
14
15
|
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
16
|
+
import { getSectionOverrides } from 'src/utils/overrides'
|
|
17
|
+
import { override } from 'src/customizations/components/overrides/ProductGallery'
|
|
18
|
+
import type { ProductGalleryOverrideDefinition } from 'src/typings/overrides'
|
|
19
|
+
|
|
20
|
+
const {
|
|
21
|
+
MobileFilterButton,
|
|
22
|
+
FilterIcon,
|
|
23
|
+
PrevIcon,
|
|
24
|
+
ResultsCountSkeleton,
|
|
25
|
+
SortSkeleton,
|
|
26
|
+
FilterButtonSkeleton,
|
|
27
|
+
LinkButtonPrev,
|
|
28
|
+
LinkButtonNext,
|
|
29
|
+
__experimentalFilterDesktop,
|
|
30
|
+
__experimentalFilterSlider,
|
|
31
|
+
__experimentalProductCard,
|
|
32
|
+
} = getSectionOverrides(
|
|
33
|
+
{
|
|
34
|
+
MobileFilterButton: UIButton,
|
|
35
|
+
FilterIcon: UIIcon,
|
|
36
|
+
PrevIcon: UIIcon,
|
|
37
|
+
ResultsCountSkeleton: UISkeleton,
|
|
38
|
+
SortSkeleton: UISkeleton,
|
|
39
|
+
FilterButtonSkeleton: UISkeleton,
|
|
40
|
+
LinkButtonPrev: UILinkButton,
|
|
41
|
+
LinkButtonNext: UILinkButton,
|
|
42
|
+
__experimentalFilterDesktop: FilterDesktop,
|
|
43
|
+
__experimentalFilterSlider: FilterSlider,
|
|
44
|
+
__experimentalProductCard: ProductCard,
|
|
45
|
+
},
|
|
46
|
+
override as ProductGalleryOverrideDefinition
|
|
27
47
|
)
|
|
28
48
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
ResultsCountSkeleton: UISkeleton,
|
|
42
|
-
SortSkeleton: UISkeleton,
|
|
43
|
-
FilterButtonSkeleton: UISkeleton,
|
|
44
|
-
LinkButtonPrev: UILinkButton,
|
|
45
|
-
LinkButtonNext: UILinkButton,
|
|
46
|
-
__experimentalFilterDesktop: FilterDesktop,
|
|
47
|
-
__experimentalFilterSlider: FilterSlider,
|
|
48
|
-
__experimentalProductCard: ProductCard,
|
|
49
|
-
...productGalleryComponentsCustomization,
|
|
49
|
+
export {
|
|
50
|
+
MobileFilterButton,
|
|
51
|
+
FilterIcon,
|
|
52
|
+
PrevIcon,
|
|
53
|
+
ResultsCountSkeleton,
|
|
54
|
+
SortSkeleton,
|
|
55
|
+
FilterButtonSkeleton,
|
|
56
|
+
LinkButtonPrev,
|
|
57
|
+
LinkButtonNext,
|
|
58
|
+
__experimentalFilterDesktop,
|
|
59
|
+
__experimentalFilterSlider,
|
|
60
|
+
__experimentalProductCard,
|
|
50
61
|
}
|
|
51
|
-
|
|
52
|
-
export { Components, productGalleryPropsCustomization as Props }
|
|
@@ -1,34 +1,20 @@
|
|
|
1
1
|
import { ProductShelf as UIProductShelf } from '@faststore/ui'
|
|
2
|
+
|
|
2
3
|
import ProductCard from 'src/components/product/ProductCard'
|
|
3
4
|
import Carousel from 'src/components/ui/Carousel'
|
|
4
5
|
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const productShelfPropsCustomization = {} as any
|
|
10
|
-
|
|
11
|
-
Object.entries(ProductShelfCustomizations.components).forEach(
|
|
12
|
-
([key, value]) => {
|
|
13
|
-
if (value.Component) {
|
|
14
|
-
productShelfComponentsCustomization[key] = value.Component
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
Object.entries(ProductShelfCustomizations.components).forEach(
|
|
20
|
-
([key, value]) => {
|
|
21
|
-
if (value.props) {
|
|
22
|
-
productShelfPropsCustomization[key] = value.props
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
)
|
|
6
|
+
import { getSectionOverrides } from 'src/utils/overrides'
|
|
7
|
+
import { override } from 'src/customizations/components/overrides/ProductShelf'
|
|
8
|
+
import type { ProductShelfOverrideDefinition } from 'src/typings/overrides'
|
|
26
9
|
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
10
|
+
const { ProductShelf, __experimentalCarousel, __experimentalProductCard } =
|
|
11
|
+
getSectionOverrides(
|
|
12
|
+
{
|
|
13
|
+
ProductShelf: UIProductShelf,
|
|
14
|
+
__experimentalCarousel: Carousel,
|
|
15
|
+
__experimentalProductCard: ProductCard,
|
|
16
|
+
},
|
|
17
|
+
override as ProductShelfOverrideDefinition
|
|
18
|
+
)
|
|
33
19
|
|
|
34
|
-
export {
|
|
20
|
+
export { ProductShelf, __experimentalCarousel, __experimentalProductCard }
|
|
@@ -1,28 +1,16 @@
|
|
|
1
1
|
import { RegionBar as UIRegionBar, Icon as UIIcon } from '@faststore/ui'
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import { getSectionOverrides } from 'src/utils/overrides'
|
|
4
|
+
import { override } from 'src/customizations/components/overrides/RegionBar'
|
|
5
|
+
import type { RegionBarOverrideDefinition } from 'src/typings/overrides'
|
|
4
6
|
|
|
5
|
-
const
|
|
7
|
+
const { RegionBar, LocationIcon, ButtonIcon } = getSectionOverrides(
|
|
8
|
+
{
|
|
9
|
+
RegionBar: UIRegionBar,
|
|
10
|
+
LocationIcon: UIIcon,
|
|
11
|
+
ButtonIcon: UIIcon,
|
|
12
|
+
},
|
|
13
|
+
override as RegionBarOverrideDefinition
|
|
14
|
+
)
|
|
6
15
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Object.entries(RegionBarCustomizations.components).forEach(([key, value]) => {
|
|
10
|
-
if (value.Component) {
|
|
11
|
-
regionBarComponentsCustomization[key] = value.Component
|
|
12
|
-
}
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
Object.entries(RegionBarCustomizations.components).forEach(([key, value]) => {
|
|
16
|
-
if (value.props) {
|
|
17
|
-
regionBarPropsCustomization[key] = value.props
|
|
18
|
-
}
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
const Components = {
|
|
22
|
-
RegionBar: UIRegionBar,
|
|
23
|
-
LocationIcon: UIIcon,
|
|
24
|
-
ButtonIcon: UIIcon,
|
|
25
|
-
...regionBarComponentsCustomization,
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export { Components, regionBarPropsCustomization as Props }
|
|
16
|
+
export { RegionBar, LocationIcon, ButtonIcon }
|
|
@@ -3,8 +3,10 @@ import { memo } from 'react'
|
|
|
3
3
|
|
|
4
4
|
import Link from 'src/components/ui/Link'
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
|
|
6
|
+
import {
|
|
7
|
+
Breadcrumb as BreadcrumbWrapper,
|
|
8
|
+
Icon,
|
|
9
|
+
} from 'src/components/sections/Breadcrumb/Overrides'
|
|
8
10
|
|
|
9
11
|
export interface BreadcrumbProps extends UIBreadcrumbProps {
|
|
10
12
|
icon: string
|
|
@@ -12,11 +14,11 @@ export interface BreadcrumbProps extends UIBreadcrumbProps {
|
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
const Breadcrumb = ({
|
|
15
|
-
icon =
|
|
17
|
+
icon = Icon.props.name ?? 'Home',
|
|
16
18
|
alt = 'Go to homepage',
|
|
17
19
|
...otherProps
|
|
18
20
|
}: BreadcrumbProps) => (
|
|
19
|
-
<BreadcrumbWrapper
|
|
21
|
+
<BreadcrumbWrapper.Component
|
|
20
22
|
homeLink={
|
|
21
23
|
<Link
|
|
22
24
|
data-fs-breadcrumb-link
|
|
@@ -25,11 +27,11 @@ const Breadcrumb = ({
|
|
|
25
27
|
href="/"
|
|
26
28
|
prefetch={false}
|
|
27
29
|
>
|
|
28
|
-
<Icon
|
|
30
|
+
<Icon.Component
|
|
29
31
|
width={18}
|
|
30
32
|
height={18}
|
|
31
33
|
weight="bold"
|
|
32
|
-
{...
|
|
34
|
+
{...Icon.props}
|
|
33
35
|
name={icon}
|
|
34
36
|
/>
|
|
35
37
|
</Link>
|
|
@@ -39,7 +41,7 @@ const Breadcrumb = ({
|
|
|
39
41
|
{name}
|
|
40
42
|
</Link>
|
|
41
43
|
)}
|
|
42
|
-
{...
|
|
44
|
+
{...BreadcrumbWrapper.props}
|
|
43
45
|
{...otherProps}
|
|
44
46
|
/>
|
|
45
47
|
)
|
|
@@ -4,14 +4,15 @@ import { useEffect, useState } from 'react'
|
|
|
4
4
|
import { useRouter } from 'next/router'
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
ImageGallery as ImageGalleryWrapper,
|
|
8
|
+
ImageZoom,
|
|
9
|
+
__experimentalImageGalleryImage as Image,
|
|
9
10
|
} from 'src/components/sections/ProductDetails/Overrides'
|
|
10
11
|
|
|
11
12
|
const ImageComponent = ({ url, alternateName }) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
return (
|
|
14
|
+
<Image.Component src={url} alt={alternateName} width={68} height={68} />
|
|
15
|
+
)
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
export interface ImageGalleryProps {
|
|
@@ -25,34 +26,27 @@ const ImageGallery = ({ images, ...otherProps }: ImageGalleryProps) => {
|
|
|
25
26
|
|
|
26
27
|
useEffect(() => setSelectedImageIdx(0), [dynamicRoute])
|
|
27
28
|
|
|
28
|
-
// Deconstructing the object to avoid circular dependency errors
|
|
29
|
-
const {
|
|
30
|
-
ImageGallery: ImageGalleryWrapper,
|
|
31
|
-
ImageZoom,
|
|
32
|
-
__experimentalImageGalleryImage: Image,
|
|
33
|
-
} = Components
|
|
34
|
-
|
|
35
29
|
return (
|
|
36
|
-
<ImageGalleryWrapper
|
|
37
|
-
{...
|
|
30
|
+
<ImageGalleryWrapper.Component
|
|
31
|
+
{...ImageGalleryWrapper.props}
|
|
38
32
|
images={images}
|
|
39
33
|
ImageComponent={ImageComponent}
|
|
40
34
|
selectedImageIdx={selectedImageIdx}
|
|
41
35
|
setSelectedImageIdx={setSelectedImageIdx}
|
|
42
36
|
{...otherProps}
|
|
43
37
|
>
|
|
44
|
-
<ImageZoom {...
|
|
45
|
-
<Image
|
|
38
|
+
<ImageZoom.Component {...ImageZoom.props}>
|
|
39
|
+
<Image.Component
|
|
46
40
|
sizes="(max-width: 360px) 50vw, (max-width: 768px) 90vw, 50vw"
|
|
47
41
|
width={691}
|
|
48
42
|
height={691 * (3 / 4)}
|
|
49
43
|
loading="eager"
|
|
50
|
-
{...
|
|
44
|
+
{...Image.props}
|
|
51
45
|
src={currentImage.url}
|
|
52
46
|
alt={currentImage.alternateName}
|
|
53
47
|
/>
|
|
54
|
-
</ImageZoom>
|
|
55
|
-
</ImageGalleryWrapper>
|
|
48
|
+
</ImageZoom.Component>
|
|
49
|
+
</ImageGalleryWrapper.Component>
|
|
56
50
|
)
|
|
57
51
|
}
|
|
58
52
|
|
|
@@ -3,18 +3,17 @@ import { forwardRef, useRef } from 'react'
|
|
|
3
3
|
import { convertFromRaw } from 'draft-js'
|
|
4
4
|
import { stateToHTML } from 'draft-js-export-html'
|
|
5
5
|
import { useUI } from '@faststore/ui'
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
import { Components, Props } from 'src/components/sections/Newsletter/Overrides'
|
|
6
|
+
import type { InputFieldProps } from '@faststore/ui'
|
|
9
7
|
|
|
10
|
-
|
|
8
|
+
import { useNewsletter } from 'src/sdk/newsletter/useNewsletter'
|
|
9
|
+
import {
|
|
11
10
|
ToastIconSuccess,
|
|
12
11
|
ToastIconError,
|
|
13
12
|
HeaderIcon,
|
|
14
|
-
InputFieldEmail,
|
|
15
13
|
InputFieldName,
|
|
14
|
+
InputFieldEmail,
|
|
16
15
|
Button,
|
|
17
|
-
}
|
|
16
|
+
} from 'src/components/sections/Newsletter/Overrides'
|
|
18
17
|
|
|
19
18
|
const cmsToHtml = (content) => {
|
|
20
19
|
if (!content) {
|
|
@@ -146,11 +145,11 @@ const Newsletter = forwardRef<HTMLFormElement, NewsletterProps>(
|
|
|
146
145
|
...toastSubscribe,
|
|
147
146
|
status: 'INFO',
|
|
148
147
|
icon: (
|
|
149
|
-
<ToastIconSuccess
|
|
148
|
+
<ToastIconSuccess.Component
|
|
150
149
|
width={30}
|
|
151
150
|
height={30}
|
|
152
|
-
{...
|
|
153
|
-
name={toastSubscribe.icon ??
|
|
151
|
+
{...ToastIconSuccess.props}
|
|
152
|
+
name={toastSubscribe.icon ?? ToastIconSuccess.props.name}
|
|
154
153
|
/>
|
|
155
154
|
),
|
|
156
155
|
})
|
|
@@ -159,11 +158,11 @@ const Newsletter = forwardRef<HTMLFormElement, NewsletterProps>(
|
|
|
159
158
|
...toastSubscribeError,
|
|
160
159
|
status: 'ERROR',
|
|
161
160
|
icon: (
|
|
162
|
-
<ToastIconError
|
|
161
|
+
<ToastIconError.Component
|
|
163
162
|
width={30}
|
|
164
163
|
height={30}
|
|
165
|
-
{...
|
|
166
|
-
name={toastSubscribe.icon ??
|
|
164
|
+
{...ToastIconError.props}
|
|
165
|
+
name={toastSubscribe.icon ?? ToastIconError.props.name}
|
|
167
166
|
/>
|
|
168
167
|
),
|
|
169
168
|
})
|
|
@@ -184,11 +183,11 @@ const Newsletter = forwardRef<HTMLFormElement, NewsletterProps>(
|
|
|
184
183
|
>
|
|
185
184
|
<header data-fs-newsletter-header>
|
|
186
185
|
<h3>
|
|
187
|
-
<HeaderIcon
|
|
186
|
+
<HeaderIcon.Component
|
|
188
187
|
width={32}
|
|
189
188
|
height={32}
|
|
190
|
-
{...
|
|
191
|
-
name={icon?.icon ??
|
|
189
|
+
{...HeaderIcon.props}
|
|
190
|
+
name={icon?.icon ?? HeaderIcon.props.name}
|
|
192
191
|
/>
|
|
193
192
|
{title}
|
|
194
193
|
</h3>
|
|
@@ -198,22 +197,22 @@ const Newsletter = forwardRef<HTMLFormElement, NewsletterProps>(
|
|
|
198
197
|
<div data-fs-newsletter-controls>
|
|
199
198
|
<>
|
|
200
199
|
{displayNameInput ? (
|
|
201
|
-
<InputFieldName
|
|
200
|
+
<InputFieldName.Component
|
|
202
201
|
id="newsletter-name"
|
|
203
202
|
required
|
|
204
|
-
{...
|
|
205
|
-
label={nameInputLabel ??
|
|
203
|
+
{...(InputFieldName.props as InputFieldProps)}
|
|
204
|
+
label={nameInputLabel ?? InputFieldName.props.label}
|
|
206
205
|
// Dynamic props shouldn't be overridable
|
|
207
206
|
// This decision can be reviewed later if needed
|
|
208
207
|
inputRef={nameInputRef}
|
|
209
208
|
/>
|
|
210
209
|
) : null}
|
|
211
|
-
<InputFieldEmail
|
|
210
|
+
<InputFieldEmail.Component
|
|
212
211
|
id="newsletter-email"
|
|
213
212
|
type="email"
|
|
214
213
|
required
|
|
215
|
-
{...
|
|
216
|
-
label={emailInputLabel ??
|
|
214
|
+
{...(InputFieldEmail.props as InputFieldProps)}
|
|
215
|
+
label={emailInputLabel ?? InputFieldEmail.props.label}
|
|
217
216
|
// Dynamic props shouldn't be overridable
|
|
218
217
|
// This decision can be reviewed later if needed
|
|
219
218
|
inputRef={emailInputRef}
|
|
@@ -224,14 +223,14 @@ const Newsletter = forwardRef<HTMLFormElement, NewsletterProps>(
|
|
|
224
223
|
__html: cmsToHtml(privacyPolicy),
|
|
225
224
|
}}
|
|
226
225
|
></span>
|
|
227
|
-
<Button
|
|
226
|
+
<Button.Component
|
|
228
227
|
variant="secondary"
|
|
229
228
|
inverse
|
|
230
229
|
type="submit"
|
|
231
|
-
{...
|
|
230
|
+
{...Button.props}
|
|
232
231
|
>
|
|
233
232
|
{loading ? subscribeButtonLoadingLabel : subscribeButtonLabel}
|
|
234
|
-
</Button>
|
|
233
|
+
</Button.Component>
|
|
235
234
|
</>
|
|
236
235
|
</div>
|
|
237
236
|
</form>
|