@faststore/core 2.1.96 → 2.1.99
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/.turbo/turbo-build.log +2 -2
- package/cms/faststore/sections.json +12 -0
- package/package.json +8 -8
- package/src/components/product/NotAvailableButton/NotAvailableButton.tsx +13 -0
- package/src/components/product/NotAvailableButton/index.ts +1 -0
- package/src/components/sections/ProductDetails/Overrides.tsx +4 -0
- package/src/components/sections/ProductDetails/ProductDetails.tsx +21 -15
- package/src/components/ui/ProductDetails/ProductDetailsSettings.tsx +88 -68
- package/src/typings/overrides.ts +1 -0
- package/.next/BUILD_ID +0 -1
- package/.next/build-manifest.json +0 -129
- package/.next/cache/.tsbuildinfo +0 -1
- package/.next/cache/config.json +0 -7
- package/.next/cache/eslint/.cache_1gneedd +0 -1
- package/.next/cache/next-server.js.nft.json +0 -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/export-marker.json +0 -1
- package/.next/images-manifest.json +0 -1
- package/.next/next-server.js.nft.json +0 -1
- package/.next/package.json +0 -1
- package/.next/prerender-manifest.json +0 -1
- package/.next/react-loadable-manifest.json +0 -44
- package/.next/required-server-files.json +0 -1
- package/.next/routes-manifest.json +0 -1
- package/.next/server/chunks/177.js +0 -120
- package/.next/server/chunks/183.js +0 -95
- package/.next/server/chunks/184.js +0 -61
- package/.next/server/chunks/186.js +0 -113
- package/.next/server/chunks/289.js +0 -239
- package/.next/server/chunks/312.js +0 -697
- package/.next/server/chunks/350.js +0 -143
- package/.next/server/chunks/483.js +0 -650
- package/.next/server/chunks/487.js +0 -9142
- package/.next/server/chunks/53.js +0 -61
- package/.next/server/chunks/530.js +0 -648
- package/.next/server/chunks/574.js +0 -145
- package/.next/server/chunks/576.js +0 -95
- package/.next/server/chunks/650.js +0 -9142
- package/.next/server/chunks/676.js +0 -32
- package/.next/server/chunks/693.js +0 -58
- package/.next/server/chunks/71.js +0 -1252
- package/.next/server/chunks/74.js +0 -4087
- package/.next/server/chunks/753.js +0 -509
- package/.next/server/chunks/779.js +0 -58
- package/.next/server/chunks/825.js +0 -4039
- package/.next/server/chunks/854.js +0 -72
- package/.next/server/chunks/859.js +0 -959
- package/.next/server/chunks/907.js +0 -1933
- package/.next/server/chunks/933.js +0 -521
- package/.next/server/chunks/98.js +0 -163
- package/.next/server/chunks/988.js +0 -211
- package/.next/server/chunks/font-manifest.json +0 -1
- package/.next/server/font-manifest.json +0 -1
- package/.next/server/middleware-build-manifest.js +0 -1
- package/.next/server/middleware-manifest.json +0 -6
- package/.next/server/middleware-react-loadable-manifest.js +0 -1
- package/.next/server/pages/404.js +0 -386
- package/.next/server/pages/404.js.nft.json +0 -1
- package/.next/server/pages/500.js +0 -388
- package/.next/server/pages/500.js.nft.json +0 -1
- package/.next/server/pages/[...slug].js +0 -1006
- package/.next/server/pages/[...slug].js.nft.json +0 -1
- package/.next/server/pages/[slug]/p.js +0 -2289
- package/.next/server/pages/[slug]/p.js.nft.json +0 -1
- package/.next/server/pages/_app.js +0 -280
- package/.next/server/pages/_app.js.nft.json +0 -1
- package/.next/server/pages/_document.js +0 -374
- package/.next/server/pages/_document.js.nft.json +0 -1
- package/.next/server/pages/_error.js +0 -164
- package/.next/server/pages/_error.js.nft.json +0 -1
- package/.next/server/pages/account.js +0 -363
- package/.next/server/pages/account.js.nft.json +0 -1
- package/.next/server/pages/api/graphql.js +0 -365
- package/.next/server/pages/api/graphql.js.nft.json +0 -1
- package/.next/server/pages/api/health/live.js +0 -31
- package/.next/server/pages/api/health/live.js.nft.json +0 -1
- package/.next/server/pages/api/health/ready.js +0 -31
- package/.next/server/pages/api/health/ready.js.nft.json +0 -1
- package/.next/server/pages/api/preview.js +0 -148
- package/.next/server/pages/api/preview.js.nft.json +0 -1
- package/.next/server/pages/checkout.js +0 -363
- package/.next/server/pages/checkout.js.nft.json +0 -1
- package/.next/server/pages/en-US/404.html +0 -81
- package/.next/server/pages/en-US/404.json +0 -1
- package/.next/server/pages/en-US/500.html +0 -81
- package/.next/server/pages/en-US/500.json +0 -1
- package/.next/server/pages/en-US/account.html +0 -81
- package/.next/server/pages/en-US/account.json +0 -1
- package/.next/server/pages/en-US/checkout.html +0 -81
- package/.next/server/pages/en-US/checkout.json +0 -1
- package/.next/server/pages/en-US/login.html +0 -81
- package/.next/server/pages/en-US/login.json +0 -1
- package/.next/server/pages/en-US/s.html +0 -81
- package/.next/server/pages/en-US/s.json +0 -1
- package/.next/server/pages/en-US.html +0 -81
- package/.next/server/pages/en-US.json +0 -1
- package/.next/server/pages/index.js +0 -439
- package/.next/server/pages/index.js.nft.json +0 -1
- package/.next/server/pages/login.js +0 -368
- package/.next/server/pages/login.js.nft.json +0 -1
- package/.next/server/pages/s.js +0 -466
- package/.next/server/pages/s.js.nft.json +0 -1
- package/.next/server/pages-manifest.json +0 -18
- package/.next/server/webpack-api-runtime.js +0 -229
- package/.next/server/webpack-runtime.js +0 -229
- package/.next/static/8EkJazrZDz4rsTIa4IP5R/_buildManifest.js +0 -1
- package/.next/static/8EkJazrZDz4rsTIa4IP5R/_ssgManifest.js +0 -1
- package/.next/static/chunks/148.3bb7e05cc5d1c1c4.js +0 -1
- package/.next/static/chunks/238-2ad31f382e7c6f14.js +0 -1
- package/.next/static/chunks/243-8c394e91ccf75fdb.js +0 -1
- package/.next/static/chunks/530.da3ec94477af00a4.js +0 -1
- package/.next/static/chunks/548-ab84e9e8b49413ab.js +0 -1
- package/.next/static/chunks/574.70612be06fd1365f.js +0 -1
- package/.next/static/chunks/603-be78b9dfb8fa6c49.js +0 -1
- package/.next/static/chunks/651.7142f31ce1e052b3.js +0 -1
- package/.next/static/chunks/709.7bc5a25ce30abda6.js +0 -1
- package/.next/static/chunks/738-67a288ca3569cdbb.js +0 -1
- package/.next/static/chunks/741.52f7fb873418346f.js +0 -1
- package/.next/static/chunks/98.40c7e17d9de4eb8f.js +0 -1
- package/.next/static/chunks/988.d10040040cdfebbb.js +0 -1
- package/.next/static/chunks/framework-dfd14d7ce6600b03.js +0 -1
- package/.next/static/chunks/main-fd466221927468fd.js +0 -1
- package/.next/static/chunks/pages/404-af78f7cd1d3c1f60.js +0 -1
- package/.next/static/chunks/pages/500-f6346ca5f9dc4fef.js +0 -1
- package/.next/static/chunks/pages/[...slug]-ca533c74c22cb787.js +0 -1
- package/.next/static/chunks/pages/[slug]/p-3383e9b97bffafdd.js +0 -1
- package/.next/static/chunks/pages/_app-40cff0982559d0b8.js +0 -1
- package/.next/static/chunks/pages/_error-a7a0c1d9bfbb4f38.js +0 -1
- package/.next/static/chunks/pages/account-05bd79fb78365e88.js +0 -1
- package/.next/static/chunks/pages/checkout-c973786e68f25a39.js +0 -1
- package/.next/static/chunks/pages/index-d521ce4f4e2b89a6.js +0 -1
- package/.next/static/chunks/pages/login-8deb9243376b6aa1.js +0 -1
- package/.next/static/chunks/pages/s-1f885639c2605ace.js +0 -1
- package/.next/static/chunks/polyfills-c67a75d1b6f99dc8.js +0 -1
- package/.next/static/chunks/webpack-fac5a4eeea429971.js +0 -1
- package/.next/static/css/373ae96b742c3694.css +0 -1
- package/.next/static/css/527e334fa69cf40a.css +0 -1
- package/.next/static/css/6e1a7434f061d0ef.css +0 -1
- package/.next/static/css/7ca374e5534a3f68.css +0 -1
- package/.next/static/css/9e76fef1c9ca89af.css +0 -1
- package/.next/static/css/a2eefb25a4608343.css +0 -1
- package/.next/static/css/cb7d1fcea42fab9c.css +0 -1
- package/.next/static/css/df588bb98c0b0ca6.css +0 -1
- package/.next/static/css/e3b039e8f5daf95f.css +0 -1
- package/.next/static/css/f0e2d1b8832e935d.css +0 -1
- package/.next/trace +0 -80
- package/public/~partytown/debug/partytown-atomics.js +0 -556
- package/public/~partytown/debug/partytown-media.js +0 -374
- package/public/~partytown/debug/partytown-sandbox-sw.js +0 -543
- package/public/~partytown/debug/partytown-sw.js +0 -59
- package/public/~partytown/debug/partytown-ww-atomics.js +0 -1789
- package/public/~partytown/debug/partytown-ww-sw.js +0 -1781
- package/public/~partytown/debug/partytown.js +0 -72
- package/public/~partytown/partytown-atomics.js +0 -2
- package/public/~partytown/partytown-media.js +0 -2
- package/public/~partytown/partytown-sw.js +0 -2
- package/public/~partytown/partytown.js +0 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -25,7 +25,7 @@ Route (pages) Size First Load JS
|
|
|
25
25
|
├ /_app 0 B 77.9 kB
|
|
26
26
|
├ ● /[...slug] 4.06 kB 209 kB
|
|
27
27
|
├ └ css/527e334fa69cf40a.css 1.85 kB
|
|
28
|
-
├ ● /[slug]/p 10.
|
|
28
|
+
├ ● /[slug]/p 10.6 kB 205 kB
|
|
29
29
|
├ └ css/7ca374e5534a3f68.css 11.3 kB
|
|
30
30
|
├ ○ /404 1.19 kB 114 kB
|
|
31
31
|
├ ● /500 1.21 kB 114 kB
|
|
@@ -41,7 +41,7 @@ Route (pages) Size First Load JS
|
|
|
41
41
|
├ chunks/framework-dfd14d7ce6600b03.js 45.3 kB
|
|
42
42
|
├ chunks/main-fd466221927468fd.js 23.9 kB
|
|
43
43
|
├ chunks/pages/_app-40cff0982559d0b8.js 6.46 kB
|
|
44
|
-
├ chunks/webpack-
|
|
44
|
+
├ chunks/webpack-aa0b4e883a43f80d.js 2.29 kB
|
|
45
45
|
└ css/9e76fef1c9ca89af.css 3.06 kB
|
|
46
46
|
|
|
47
47
|
λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
|
|
@@ -1374,6 +1374,18 @@
|
|
|
1374
1374
|
}
|
|
1375
1375
|
}
|
|
1376
1376
|
},
|
|
1377
|
+
"notAvailableButton": {
|
|
1378
|
+
"title": "Not Available Button",
|
|
1379
|
+
"description": "Shown when a SKU is not available",
|
|
1380
|
+
"type": "object",
|
|
1381
|
+
"properties": {
|
|
1382
|
+
"title": {
|
|
1383
|
+
"title": "Title",
|
|
1384
|
+
"type": "string",
|
|
1385
|
+
"default": "Not Available"
|
|
1386
|
+
}
|
|
1387
|
+
}
|
|
1388
|
+
},
|
|
1377
1389
|
"shippingSimulator": {
|
|
1378
1390
|
"title": "Shipping Simulation",
|
|
1379
1391
|
"type": "object",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/core",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.99",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"browserslist": "supports es6-module and not dead",
|
|
6
6
|
"scripts": {
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
"@envelop/graphql-jit": "^1.1.1",
|
|
30
30
|
"@envelop/parser-cache": "^2.2.0",
|
|
31
31
|
"@envelop/validation-cache": "^2.2.0",
|
|
32
|
-
"@faststore/api": "^2.1.
|
|
33
|
-
"@faststore/components": "^2.1.
|
|
34
|
-
"@faststore/graphql-utils": "^2.1.
|
|
35
|
-
"@faststore/sdk": "^2.1.
|
|
36
|
-
"@faststore/ui": "^2.1.
|
|
32
|
+
"@faststore/api": "^2.1.99",
|
|
33
|
+
"@faststore/components": "^2.1.99",
|
|
34
|
+
"@faststore/graphql-utils": "^2.1.99",
|
|
35
|
+
"@faststore/sdk": "^2.1.99",
|
|
36
|
+
"@faststore/ui": "^2.1.99",
|
|
37
37
|
"@types/react": "^18.0.14",
|
|
38
38
|
"@vtex/client-cms": "^0.2.12",
|
|
39
39
|
"autoprefixer": "^10.4.0",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@cypress/code-coverage": "^3.12.1",
|
|
64
|
-
"@faststore/eslint-config": "^2.1.
|
|
64
|
+
"@faststore/eslint-config": "^2.1.99",
|
|
65
65
|
"@faststore/lighthouse": "^1.12.32",
|
|
66
66
|
"@graphql-codegen/cli": "^2.6.2",
|
|
67
67
|
"@graphql-codegen/typescript": "^2.5.1",
|
|
@@ -110,5 +110,5 @@
|
|
|
110
110
|
"msw": {
|
|
111
111
|
"workerDirectory": "public"
|
|
112
112
|
},
|
|
113
|
-
"gitHead": "
|
|
113
|
+
"gitHead": "2ecd31444b00639f05e8b99847df231d8f2f7b0e"
|
|
114
114
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react'
|
|
2
|
+
import { Button } from '@faststore/ui'
|
|
3
|
+
|
|
4
|
+
// TODO: Remove this component when <OutOfStock /> is ready to use
|
|
5
|
+
function NotAvailableButton({ children }: PropsWithChildren) {
|
|
6
|
+
return (
|
|
7
|
+
<Button variant="primary" disabled data-fs-buy-button>
|
|
8
|
+
{children}
|
|
9
|
+
</Button>
|
|
10
|
+
)
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default NotAvailableButton
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './NotAvailableButton'
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
import LocalImageGallery from 'src/components/ui/ImageGallery'
|
|
15
15
|
import LocalShippingSimulation from 'src/components/ui/ShippingSimulation/ShippingSimulation'
|
|
16
16
|
import { Image } from 'src/components/ui/Image'
|
|
17
|
+
import LocalNotAvailableButton from 'src/components/product/NotAvailableButton'
|
|
17
18
|
|
|
18
19
|
import { getSectionOverrides } from 'src/utils/overrides'
|
|
19
20
|
import { override } from 'src/customizations/components/overrides/ProductDetails'
|
|
@@ -33,6 +34,7 @@ const {
|
|
|
33
34
|
__experimentalImageGalleryImage,
|
|
34
35
|
__experimentalImageGallery,
|
|
35
36
|
__experimentalShippingSimulation,
|
|
37
|
+
__experimentalNotAvailableButton,
|
|
36
38
|
} = getSectionOverrides(
|
|
37
39
|
{
|
|
38
40
|
ProductTitle: UIProductTitle,
|
|
@@ -48,6 +50,7 @@ const {
|
|
|
48
50
|
__experimentalImageGalleryImage: Image,
|
|
49
51
|
__experimentalImageGallery: LocalImageGallery,
|
|
50
52
|
__experimentalShippingSimulation: LocalShippingSimulation,
|
|
53
|
+
__experimentalNotAvailableButton: LocalNotAvailableButton,
|
|
51
54
|
},
|
|
52
55
|
override as ProductDetailsOverrideDefinition
|
|
53
56
|
)
|
|
@@ -66,4 +69,5 @@ export {
|
|
|
66
69
|
__experimentalImageGalleryImage,
|
|
67
70
|
__experimentalImageGallery,
|
|
68
71
|
__experimentalShippingSimulation,
|
|
72
|
+
__experimentalNotAvailableButton,
|
|
69
73
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react'
|
|
1
|
+
import { useEffect, useState, useMemo } from 'react'
|
|
2
2
|
|
|
3
3
|
import { gql } from '@faststore/graphql-utils'
|
|
4
4
|
import { sendAnalyticsEvent } from '@faststore/sdk'
|
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
DiscountBadge,
|
|
22
22
|
__experimentalImageGallery as ImageGallery,
|
|
23
23
|
__experimentalShippingSimulation as ShippingSimulation,
|
|
24
|
+
__experimentalNotAvailableButton as NotAvailableButton,
|
|
24
25
|
} from 'src/components/sections/ProductDetails/Overrides'
|
|
25
26
|
|
|
26
27
|
interface ProductDetailsContextProps {
|
|
@@ -59,6 +60,9 @@ export interface ProductDetailsProps {
|
|
|
59
60
|
imageGallery: {
|
|
60
61
|
imagePosition: 'top' | 'center' | 'bottom'
|
|
61
62
|
}
|
|
63
|
+
notAvailableButton: {
|
|
64
|
+
title: string
|
|
65
|
+
}
|
|
62
66
|
}
|
|
63
67
|
|
|
64
68
|
function ProductDetails({
|
|
@@ -91,6 +95,9 @@ function ProductDetails({
|
|
|
91
95
|
displayDescription: shouldDisplayProductDescription,
|
|
92
96
|
},
|
|
93
97
|
imageGallery: { imagePosition = ImageGallery.props.imagePosition },
|
|
98
|
+
notAvailableButton: {
|
|
99
|
+
title: notAvailableButtonTitle = NotAvailableButton.props.title,
|
|
100
|
+
},
|
|
94
101
|
}: ProductDetailsProps & ProductDetailsContextProps) {
|
|
95
102
|
const { currency } = useSession()
|
|
96
103
|
const [quantity, setQuantity] = useState(1)
|
|
@@ -155,7 +162,10 @@ function ProductDetails({
|
|
|
155
162
|
gtin,
|
|
156
163
|
])
|
|
157
164
|
|
|
158
|
-
const outOfStock =
|
|
165
|
+
const outOfStock = useMemo(
|
|
166
|
+
() => availability === 'https://schema.org/OutOfStock',
|
|
167
|
+
[availability]
|
|
168
|
+
)
|
|
159
169
|
|
|
160
170
|
return (
|
|
161
171
|
<Section className={`${styles.section} section-product-details`}>
|
|
@@ -194,19 +204,15 @@ function ProductDetails({
|
|
|
194
204
|
data-fs-product-details-settings
|
|
195
205
|
data-fs-product-details-section
|
|
196
206
|
>
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
) : (
|
|
207
|
-
// TODO: Adds <OutOfStock /> when component is ready to use
|
|
208
|
-
<p>Not Available</p>
|
|
209
|
-
)}
|
|
207
|
+
<ProductDetailsSettings
|
|
208
|
+
product={data.product}
|
|
209
|
+
isValidating={isValidating}
|
|
210
|
+
buyButtonTitle={buyButtonTitle}
|
|
211
|
+
quantity={quantity}
|
|
212
|
+
setQuantity={setQuantity}
|
|
213
|
+
buyButtonIcon={buyButtonIcon}
|
|
214
|
+
notAvailableButtonTitle={notAvailableButtonTitle}
|
|
215
|
+
/>
|
|
210
216
|
</section>
|
|
211
217
|
|
|
212
218
|
{!outOfStock && (
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Dispatch, SetStateAction } from 'react'
|
|
2
|
+
import { useMemo } from 'react'
|
|
2
3
|
|
|
3
4
|
import type { ProductDetailsFragment_ProductFragment } from '@generated/graphql'
|
|
4
5
|
|
|
@@ -13,6 +14,7 @@ import {
|
|
|
13
14
|
Icon,
|
|
14
15
|
Price,
|
|
15
16
|
QuantitySelector,
|
|
17
|
+
__experimentalNotAvailableButton as NotAvailableButton,
|
|
16
18
|
} from 'src/components/sections/ProductDetails/Overrides'
|
|
17
19
|
|
|
18
20
|
interface ProductDetailsSettingsProps {
|
|
@@ -25,6 +27,7 @@ interface ProductDetailsSettingsProps {
|
|
|
25
27
|
isValidating: boolean
|
|
26
28
|
quantity: number
|
|
27
29
|
setQuantity: Dispatch<SetStateAction<number>>
|
|
30
|
+
notAvailableButtonTitle: string
|
|
28
31
|
}
|
|
29
32
|
|
|
30
33
|
function ProductDetailsSettings({
|
|
@@ -37,6 +40,7 @@ function ProductDetailsSettings({
|
|
|
37
40
|
icon: buyButtonIconName = Icon.props.name,
|
|
38
41
|
alt: buyButtonIconAlt = Icon.props['aria-label'],
|
|
39
42
|
},
|
|
43
|
+
notAvailableButtonTitle,
|
|
40
44
|
}: ProductDetailsSettingsProps) {
|
|
41
45
|
const {
|
|
42
46
|
id,
|
|
@@ -54,8 +58,6 @@ function ProductDetailsSettings({
|
|
|
54
58
|
},
|
|
55
59
|
} = product
|
|
56
60
|
|
|
57
|
-
const buyDisabled = availability !== 'https://schema.org/InStock'
|
|
58
|
-
|
|
59
61
|
const buyProps = useBuyButton({
|
|
60
62
|
id,
|
|
61
63
|
price,
|
|
@@ -73,62 +75,94 @@ function ProductDetailsSettings({
|
|
|
73
75
|
},
|
|
74
76
|
})
|
|
75
77
|
|
|
76
|
-
const
|
|
78
|
+
const outOfStock = useMemo(
|
|
79
|
+
() => availability === 'https://schema.org/OutOfStock',
|
|
80
|
+
[availability]
|
|
81
|
+
)
|
|
82
|
+
const shouldShowDiscountedPrice = useMemo(
|
|
83
|
+
() => lowPrice !== listPrice,
|
|
84
|
+
[lowPrice, listPrice]
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
const AddToCartButton = () => {
|
|
88
|
+
return outOfStock ? (
|
|
89
|
+
// TODO: Adds <OutOfStock /> when component is ready to use
|
|
90
|
+
<NotAvailableButton.Component>
|
|
91
|
+
{notAvailableButtonTitle}
|
|
92
|
+
</NotAvailableButton.Component>
|
|
93
|
+
) : (
|
|
94
|
+
<BuyButton.Component
|
|
95
|
+
{...BuyButton.props}
|
|
96
|
+
icon={
|
|
97
|
+
<Icon.Component
|
|
98
|
+
{...Icon.props}
|
|
99
|
+
name={buyButtonIconName}
|
|
100
|
+
aria-label={buyButtonIconAlt}
|
|
101
|
+
/>
|
|
102
|
+
}
|
|
103
|
+
{...buyProps}
|
|
104
|
+
>
|
|
105
|
+
{buyButtonTitle || 'Add to Cart'}
|
|
106
|
+
</BuyButton.Component>
|
|
107
|
+
)
|
|
108
|
+
}
|
|
77
109
|
|
|
78
110
|
return (
|
|
79
111
|
<>
|
|
80
|
-
|
|
81
|
-
<
|
|
82
|
-
|
|
83
|
-
|
|
112
|
+
{!outOfStock && (
|
|
113
|
+
<section data-fs-product-details-values>
|
|
114
|
+
<div data-fs-product-details-prices>
|
|
115
|
+
{shouldShowDiscountedPrice ? (
|
|
116
|
+
<>
|
|
117
|
+
<Price.Component
|
|
118
|
+
formatter={useFormattedPrice}
|
|
119
|
+
testId="list-price"
|
|
120
|
+
variant="listing"
|
|
121
|
+
SRText="Original price:"
|
|
122
|
+
{...Price.props}
|
|
123
|
+
// Dynamic props shouldn't be overridable
|
|
124
|
+
// This decision can be reviewed later if needed
|
|
125
|
+
value={listPrice}
|
|
126
|
+
data-value={listPrice}
|
|
127
|
+
/>
|
|
128
|
+
<Price.Component
|
|
129
|
+
formatter={useFormattedPrice}
|
|
130
|
+
testId="price"
|
|
131
|
+
variant="spot"
|
|
132
|
+
className="text__lead"
|
|
133
|
+
SRText="Sale Price:"
|
|
134
|
+
{...Price.props}
|
|
135
|
+
// Dynamic props shouldn't be overridable
|
|
136
|
+
// This decision can be reviewed later if needed
|
|
137
|
+
value={lowPrice}
|
|
138
|
+
data-value={lowPrice}
|
|
139
|
+
/>
|
|
140
|
+
</>
|
|
141
|
+
) : (
|
|
84
142
|
<Price.Component
|
|
85
143
|
formatter={useFormattedPrice}
|
|
86
144
|
testId="list-price"
|
|
87
|
-
variant="listing"
|
|
88
|
-
SRText="Original price:"
|
|
89
|
-
{...Price.props}
|
|
90
|
-
// Dynamic props shouldn't be overridable
|
|
91
|
-
// This decision can be reviewed later if needed
|
|
92
|
-
value={listPrice}
|
|
93
|
-
data-value={listPrice}
|
|
94
|
-
/>
|
|
95
|
-
<Price.Component
|
|
96
|
-
formatter={useFormattedPrice}
|
|
97
|
-
testId="price"
|
|
98
145
|
variant="spot"
|
|
99
146
|
className="text__lead"
|
|
100
|
-
SRText="
|
|
147
|
+
SRText="Original price:"
|
|
101
148
|
{...Price.props}
|
|
102
149
|
// Dynamic props shouldn't be overridable
|
|
103
150
|
// This decision can be reviewed later if needed
|
|
104
151
|
value={lowPrice}
|
|
105
152
|
data-value={lowPrice}
|
|
106
153
|
/>
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
data-value={lowPrice}
|
|
120
|
-
/>
|
|
121
|
-
)}
|
|
122
|
-
</div>
|
|
123
|
-
<QuantitySelector.Component
|
|
124
|
-
min={1}
|
|
125
|
-
max={10}
|
|
126
|
-
{...QuantitySelector.props}
|
|
127
|
-
// Dynamic props shouldn't be overridable
|
|
128
|
-
// This decision can be reviewed later if needed
|
|
129
|
-
onChange={setQuantity}
|
|
130
|
-
/>
|
|
131
|
-
</section>
|
|
154
|
+
)}
|
|
155
|
+
</div>
|
|
156
|
+
<QuantitySelector.Component
|
|
157
|
+
min={1}
|
|
158
|
+
max={10}
|
|
159
|
+
{...QuantitySelector.props}
|
|
160
|
+
// Dynamic props shouldn't be overridable
|
|
161
|
+
// This decision can be reviewed later if needed
|
|
162
|
+
onChange={setQuantity}
|
|
163
|
+
/>
|
|
164
|
+
</section>
|
|
165
|
+
)}
|
|
132
166
|
{skuVariants && (
|
|
133
167
|
<Selectors
|
|
134
168
|
slugsMap={skuVariants.slugsMap}
|
|
@@ -137,30 +171,16 @@ function ProductDetailsSettings({
|
|
|
137
171
|
data-fs-product-details-selectors
|
|
138
172
|
/>
|
|
139
173
|
)}
|
|
140
|
-
{
|
|
141
|
-
/* NOTE:
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
icon={
|
|
151
|
-
<Icon.Component
|
|
152
|
-
{...Icon.props}
|
|
153
|
-
aria-label={buyButtonIconAlt}
|
|
154
|
-
name={buyButtonIconName}
|
|
155
|
-
/>
|
|
156
|
-
}
|
|
157
|
-
disabled={buyDisabled}
|
|
158
|
-
{...buyProps}
|
|
159
|
-
>
|
|
160
|
-
{buyButtonTitle || 'Add to Cart'}
|
|
161
|
-
</BuyButton.Component>
|
|
162
|
-
)
|
|
163
|
-
}
|
|
174
|
+
{isValidating ? (
|
|
175
|
+
/* NOTE:
|
|
176
|
+
A loading skeleton had to be used to avoid a Lighthouse's
|
|
177
|
+
non-composited animation violation due to the button transitioning its
|
|
178
|
+
background color when changing from its initial disabled to active state.
|
|
179
|
+
See full explanation on commit https://git.io/JyXV5. */
|
|
180
|
+
<AddToCartLoadingSkeleton />
|
|
181
|
+
) : (
|
|
182
|
+
<AddToCartButton />
|
|
183
|
+
)}
|
|
164
184
|
</>
|
|
165
185
|
)
|
|
166
186
|
}
|
package/src/typings/overrides.ts
CHANGED
|
@@ -204,6 +204,7 @@ export type ProductDetailsOverrideDefinition = SectionOverrideDefinition<
|
|
|
204
204
|
__experimentalImageGalleryImage: ComponentOverrideDefinition<any, any>
|
|
205
205
|
__experimentalImageGallery: ComponentOverrideDefinition<any, any>
|
|
206
206
|
__experimentalShippingSimulation: ComponentOverrideDefinition<any, any>
|
|
207
|
+
__experimentalNotAvailableButton: ComponentOverrideDefinition<any, any>
|
|
207
208
|
}
|
|
208
209
|
>
|
|
209
210
|
|
package/.next/BUILD_ID
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
8EkJazrZDz4rsTIa4IP5R
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"polyfillFiles": [
|
|
3
|
-
"static/chunks/polyfills-c67a75d1b6f99dc8.js"
|
|
4
|
-
],
|
|
5
|
-
"devFiles": [],
|
|
6
|
-
"ampDevFiles": [],
|
|
7
|
-
"lowPriorityFiles": [
|
|
8
|
-
"static/8EkJazrZDz4rsTIa4IP5R/_buildManifest.js",
|
|
9
|
-
"static/8EkJazrZDz4rsTIa4IP5R/_ssgManifest.js"
|
|
10
|
-
],
|
|
11
|
-
"rootMainFiles": [],
|
|
12
|
-
"pages": {
|
|
13
|
-
"/": [
|
|
14
|
-
"static/chunks/webpack-fac5a4eeea429971.js",
|
|
15
|
-
"static/chunks/framework-dfd14d7ce6600b03.js",
|
|
16
|
-
"static/chunks/main-fd466221927468fd.js",
|
|
17
|
-
"static/chunks/738-67a288ca3569cdbb.js",
|
|
18
|
-
"static/chunks/548-ab84e9e8b49413ab.js",
|
|
19
|
-
"static/css/e3b039e8f5daf95f.css",
|
|
20
|
-
"static/chunks/243-8c394e91ccf75fdb.js",
|
|
21
|
-
"static/css/373ae96b742c3694.css",
|
|
22
|
-
"static/chunks/238-2ad31f382e7c6f14.js",
|
|
23
|
-
"static/css/a2eefb25a4608343.css",
|
|
24
|
-
"static/chunks/pages/index-d521ce4f4e2b89a6.js"
|
|
25
|
-
],
|
|
26
|
-
"/404": [
|
|
27
|
-
"static/chunks/webpack-fac5a4eeea429971.js",
|
|
28
|
-
"static/chunks/framework-dfd14d7ce6600b03.js",
|
|
29
|
-
"static/chunks/main-fd466221927468fd.js",
|
|
30
|
-
"static/chunks/738-67a288ca3569cdbb.js",
|
|
31
|
-
"static/css/e3b039e8f5daf95f.css",
|
|
32
|
-
"static/chunks/243-8c394e91ccf75fdb.js",
|
|
33
|
-
"static/css/df588bb98c0b0ca6.css",
|
|
34
|
-
"static/chunks/pages/404-af78f7cd1d3c1f60.js"
|
|
35
|
-
],
|
|
36
|
-
"/500": [
|
|
37
|
-
"static/chunks/webpack-fac5a4eeea429971.js",
|
|
38
|
-
"static/chunks/framework-dfd14d7ce6600b03.js",
|
|
39
|
-
"static/chunks/main-fd466221927468fd.js",
|
|
40
|
-
"static/chunks/738-67a288ca3569cdbb.js",
|
|
41
|
-
"static/css/e3b039e8f5daf95f.css",
|
|
42
|
-
"static/chunks/243-8c394e91ccf75fdb.js",
|
|
43
|
-
"static/css/df588bb98c0b0ca6.css",
|
|
44
|
-
"static/chunks/pages/500-f6346ca5f9dc4fef.js"
|
|
45
|
-
],
|
|
46
|
-
"/[...slug]": [
|
|
47
|
-
"static/chunks/webpack-fac5a4eeea429971.js",
|
|
48
|
-
"static/chunks/framework-dfd14d7ce6600b03.js",
|
|
49
|
-
"static/chunks/main-fd466221927468fd.js",
|
|
50
|
-
"static/chunks/738-67a288ca3569cdbb.js",
|
|
51
|
-
"static/chunks/548-ab84e9e8b49413ab.js",
|
|
52
|
-
"static/css/e3b039e8f5daf95f.css",
|
|
53
|
-
"static/chunks/243-8c394e91ccf75fdb.js",
|
|
54
|
-
"static/css/373ae96b742c3694.css",
|
|
55
|
-
"static/chunks/238-2ad31f382e7c6f14.js",
|
|
56
|
-
"static/css/f0e2d1b8832e935d.css",
|
|
57
|
-
"static/chunks/603-be78b9dfb8fa6c49.js",
|
|
58
|
-
"static/css/a2eefb25a4608343.css",
|
|
59
|
-
"static/css/527e334fa69cf40a.css",
|
|
60
|
-
"static/chunks/pages/[...slug]-ca533c74c22cb787.js"
|
|
61
|
-
],
|
|
62
|
-
"/[slug]/p": [
|
|
63
|
-
"static/chunks/webpack-fac5a4eeea429971.js",
|
|
64
|
-
"static/chunks/framework-dfd14d7ce6600b03.js",
|
|
65
|
-
"static/chunks/main-fd466221927468fd.js",
|
|
66
|
-
"static/chunks/738-67a288ca3569cdbb.js",
|
|
67
|
-
"static/chunks/548-ab84e9e8b49413ab.js",
|
|
68
|
-
"static/css/e3b039e8f5daf95f.css",
|
|
69
|
-
"static/chunks/243-8c394e91ccf75fdb.js",
|
|
70
|
-
"static/css/373ae96b742c3694.css",
|
|
71
|
-
"static/chunks/238-2ad31f382e7c6f14.js",
|
|
72
|
-
"static/css/7ca374e5534a3f68.css",
|
|
73
|
-
"static/chunks/pages/[slug]/p-3383e9b97bffafdd.js"
|
|
74
|
-
],
|
|
75
|
-
"/_app": [
|
|
76
|
-
"static/chunks/webpack-fac5a4eeea429971.js",
|
|
77
|
-
"static/chunks/framework-dfd14d7ce6600b03.js",
|
|
78
|
-
"static/chunks/main-fd466221927468fd.js",
|
|
79
|
-
"static/css/9e76fef1c9ca89af.css",
|
|
80
|
-
"static/chunks/pages/_app-40cff0982559d0b8.js"
|
|
81
|
-
],
|
|
82
|
-
"/_error": [
|
|
83
|
-
"static/chunks/webpack-fac5a4eeea429971.js",
|
|
84
|
-
"static/chunks/framework-dfd14d7ce6600b03.js",
|
|
85
|
-
"static/chunks/main-fd466221927468fd.js",
|
|
86
|
-
"static/chunks/pages/_error-a7a0c1d9bfbb4f38.js"
|
|
87
|
-
],
|
|
88
|
-
"/account": [
|
|
89
|
-
"static/chunks/webpack-fac5a4eeea429971.js",
|
|
90
|
-
"static/chunks/framework-dfd14d7ce6600b03.js",
|
|
91
|
-
"static/chunks/main-fd466221927468fd.js",
|
|
92
|
-
"static/chunks/738-67a288ca3569cdbb.js",
|
|
93
|
-
"static/css/e3b039e8f5daf95f.css",
|
|
94
|
-
"static/chunks/243-8c394e91ccf75fdb.js",
|
|
95
|
-
"static/chunks/pages/account-05bd79fb78365e88.js"
|
|
96
|
-
],
|
|
97
|
-
"/checkout": [
|
|
98
|
-
"static/chunks/webpack-fac5a4eeea429971.js",
|
|
99
|
-
"static/chunks/framework-dfd14d7ce6600b03.js",
|
|
100
|
-
"static/chunks/main-fd466221927468fd.js",
|
|
101
|
-
"static/chunks/738-67a288ca3569cdbb.js",
|
|
102
|
-
"static/css/e3b039e8f5daf95f.css",
|
|
103
|
-
"static/chunks/243-8c394e91ccf75fdb.js",
|
|
104
|
-
"static/chunks/pages/checkout-c973786e68f25a39.js"
|
|
105
|
-
],
|
|
106
|
-
"/login": [
|
|
107
|
-
"static/chunks/webpack-fac5a4eeea429971.js",
|
|
108
|
-
"static/chunks/framework-dfd14d7ce6600b03.js",
|
|
109
|
-
"static/chunks/main-fd466221927468fd.js",
|
|
110
|
-
"static/chunks/738-67a288ca3569cdbb.js",
|
|
111
|
-
"static/css/e3b039e8f5daf95f.css",
|
|
112
|
-
"static/chunks/243-8c394e91ccf75fdb.js",
|
|
113
|
-
"static/css/df588bb98c0b0ca6.css",
|
|
114
|
-
"static/chunks/pages/login-8deb9243376b6aa1.js"
|
|
115
|
-
],
|
|
116
|
-
"/s": [
|
|
117
|
-
"static/chunks/webpack-fac5a4eeea429971.js",
|
|
118
|
-
"static/chunks/framework-dfd14d7ce6600b03.js",
|
|
119
|
-
"static/chunks/main-fd466221927468fd.js",
|
|
120
|
-
"static/chunks/738-67a288ca3569cdbb.js",
|
|
121
|
-
"static/css/e3b039e8f5daf95f.css",
|
|
122
|
-
"static/chunks/243-8c394e91ccf75fdb.js",
|
|
123
|
-
"static/css/f0e2d1b8832e935d.css",
|
|
124
|
-
"static/chunks/603-be78b9dfb8fa6c49.js",
|
|
125
|
-
"static/chunks/pages/s-1f885639c2605ace.js"
|
|
126
|
-
]
|
|
127
|
-
},
|
|
128
|
-
"ampFirstPages": []
|
|
129
|
-
}
|