@faststore/core 2.1.98 → 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.
Files changed (164) hide show
  1. package/.turbo/turbo-build.log +10 -4
  2. package/.turbo/turbo-lint.log +2 -0
  3. package/cms/faststore/sections.json +12 -0
  4. package/package.json +8 -8
  5. package/src/components/product/NotAvailableButton/NotAvailableButton.tsx +13 -0
  6. package/src/components/product/NotAvailableButton/index.ts +1 -0
  7. package/src/components/sections/ProductDetails/Overrides.tsx +4 -0
  8. package/src/components/sections/ProductDetails/ProductDetails.tsx +21 -15
  9. package/src/components/ui/ProductDetails/ProductDetailsSettings.tsx +88 -68
  10. package/src/pages/api/graphql.ts +0 -4
  11. package/src/server/index.ts +2 -5
  12. package/src/typings/overrides.ts +1 -0
  13. package/.next/BUILD_ID +0 -1
  14. package/.next/build-manifest.json +0 -129
  15. package/.next/cache/.tsbuildinfo +0 -1
  16. package/.next/cache/eslint/.cache_abdhua +0 -1
  17. package/.next/cache/next-server.js.nft.json +0 -1
  18. package/.next/cache/webpack/client-production/0.pack +0 -0
  19. package/.next/cache/webpack/client-production/index.pack +0 -0
  20. package/.next/cache/webpack/client-production/index.pack.old +0 -0
  21. package/.next/cache/webpack/server-production/0.pack +0 -0
  22. package/.next/cache/webpack/server-production/index.pack +0 -0
  23. package/.next/cache/webpack/server-production/index.pack.old +0 -0
  24. package/.next/export-marker.json +0 -1
  25. package/.next/images-manifest.json +0 -1
  26. package/.next/next-server.js.nft.json +0 -1
  27. package/.next/package.json +0 -1
  28. package/.next/prerender-manifest.json +0 -1
  29. package/.next/react-loadable-manifest.json +0 -44
  30. package/.next/required-server-files.json +0 -1
  31. package/.next/routes-manifest.json +0 -1
  32. package/.next/server/chunks/177.js +0 -120
  33. package/.next/server/chunks/183.js +0 -95
  34. package/.next/server/chunks/184.js +0 -61
  35. package/.next/server/chunks/186.js +0 -113
  36. package/.next/server/chunks/289.js +0 -239
  37. package/.next/server/chunks/312.js +0 -697
  38. package/.next/server/chunks/350.js +0 -144
  39. package/.next/server/chunks/483.js +0 -650
  40. package/.next/server/chunks/487.js +0 -9142
  41. package/.next/server/chunks/53.js +0 -61
  42. package/.next/server/chunks/530.js +0 -648
  43. package/.next/server/chunks/574.js +0 -145
  44. package/.next/server/chunks/576.js +0 -95
  45. package/.next/server/chunks/650.js +0 -9142
  46. package/.next/server/chunks/676.js +0 -32
  47. package/.next/server/chunks/693.js +0 -58
  48. package/.next/server/chunks/71.js +0 -1252
  49. package/.next/server/chunks/74.js +0 -4087
  50. package/.next/server/chunks/753.js +0 -509
  51. package/.next/server/chunks/779.js +0 -58
  52. package/.next/server/chunks/825.js +0 -4039
  53. package/.next/server/chunks/854.js +0 -72
  54. package/.next/server/chunks/859.js +0 -959
  55. package/.next/server/chunks/907.js +0 -1933
  56. package/.next/server/chunks/933.js +0 -521
  57. package/.next/server/chunks/98.js +0 -163
  58. package/.next/server/chunks/988.js +0 -211
  59. package/.next/server/chunks/font-manifest.json +0 -1
  60. package/.next/server/font-manifest.json +0 -1
  61. package/.next/server/middleware-build-manifest.js +0 -1
  62. package/.next/server/middleware-manifest.json +0 -6
  63. package/.next/server/middleware-react-loadable-manifest.js +0 -1
  64. package/.next/server/pages/404.js +0 -386
  65. package/.next/server/pages/404.js.nft.json +0 -1
  66. package/.next/server/pages/500.js +0 -388
  67. package/.next/server/pages/500.js.nft.json +0 -1
  68. package/.next/server/pages/[...slug].js +0 -1006
  69. package/.next/server/pages/[...slug].js.nft.json +0 -1
  70. package/.next/server/pages/[slug]/p.js +0 -2289
  71. package/.next/server/pages/[slug]/p.js.nft.json +0 -1
  72. package/.next/server/pages/_app.js +0 -280
  73. package/.next/server/pages/_app.js.nft.json +0 -1
  74. package/.next/server/pages/_document.js +0 -374
  75. package/.next/server/pages/_document.js.nft.json +0 -1
  76. package/.next/server/pages/_error.js +0 -164
  77. package/.next/server/pages/_error.js.nft.json +0 -1
  78. package/.next/server/pages/account.js +0 -363
  79. package/.next/server/pages/account.js.nft.json +0 -1
  80. package/.next/server/pages/api/graphql.js +0 -371
  81. package/.next/server/pages/api/graphql.js.nft.json +0 -1
  82. package/.next/server/pages/api/health/live.js +0 -31
  83. package/.next/server/pages/api/health/live.js.nft.json +0 -1
  84. package/.next/server/pages/api/health/ready.js +0 -31
  85. package/.next/server/pages/api/health/ready.js.nft.json +0 -1
  86. package/.next/server/pages/api/preview.js +0 -148
  87. package/.next/server/pages/api/preview.js.nft.json +0 -1
  88. package/.next/server/pages/checkout.js +0 -363
  89. package/.next/server/pages/checkout.js.nft.json +0 -1
  90. package/.next/server/pages/en-US/404.html +0 -81
  91. package/.next/server/pages/en-US/404.json +0 -1
  92. package/.next/server/pages/en-US/500.html +0 -81
  93. package/.next/server/pages/en-US/500.json +0 -1
  94. package/.next/server/pages/en-US/account.html +0 -81
  95. package/.next/server/pages/en-US/account.json +0 -1
  96. package/.next/server/pages/en-US/checkout.html +0 -81
  97. package/.next/server/pages/en-US/checkout.json +0 -1
  98. package/.next/server/pages/en-US/login.html +0 -81
  99. package/.next/server/pages/en-US/login.json +0 -1
  100. package/.next/server/pages/en-US/s.html +0 -81
  101. package/.next/server/pages/en-US/s.json +0 -1
  102. package/.next/server/pages/en-US.html +0 -81
  103. package/.next/server/pages/en-US.json +0 -1
  104. package/.next/server/pages/index.js +0 -439
  105. package/.next/server/pages/index.js.nft.json +0 -1
  106. package/.next/server/pages/login.js +0 -368
  107. package/.next/server/pages/login.js.nft.json +0 -1
  108. package/.next/server/pages/s.js +0 -466
  109. package/.next/server/pages/s.js.nft.json +0 -1
  110. package/.next/server/pages-manifest.json +0 -18
  111. package/.next/server/webpack-api-runtime.js +0 -229
  112. package/.next/server/webpack-runtime.js +0 -229
  113. package/.next/static/6S44gOq9FRmyEQybDi2Yj/_buildManifest.js +0 -1
  114. package/.next/static/6S44gOq9FRmyEQybDi2Yj/_ssgManifest.js +0 -1
  115. package/.next/static/chunks/148.582eaa81293ee470.js +0 -1
  116. package/.next/static/chunks/238-c6f8d07b669a1ec2.js +0 -1
  117. package/.next/static/chunks/243-fcf2a6c4691476a2.js +0 -1
  118. package/.next/static/chunks/530.2650771daa532c02.js +0 -1
  119. package/.next/static/chunks/548-19272804c3f0ff0d.js +0 -1
  120. package/.next/static/chunks/574.70612be06fd1365f.js +0 -1
  121. package/.next/static/chunks/603-7b26158c40b8a3e5.js +0 -1
  122. package/.next/static/chunks/651.7142f31ce1e052b3.js +0 -1
  123. package/.next/static/chunks/709.7bc5a25ce30abda6.js +0 -1
  124. package/.next/static/chunks/738-a5ff304828f20cbf.js +0 -1
  125. package/.next/static/chunks/741.52f7fb873418346f.js +0 -1
  126. package/.next/static/chunks/98.40c7e17d9de4eb8f.js +0 -1
  127. package/.next/static/chunks/988.afda042dd9ba11d1.js +0 -1
  128. package/.next/static/chunks/framework-dfd14d7ce6600b03.js +0 -1
  129. package/.next/static/chunks/main-fd466221927468fd.js +0 -1
  130. package/.next/static/chunks/pages/404-af78f7cd1d3c1f60.js +0 -1
  131. package/.next/static/chunks/pages/500-f6346ca5f9dc4fef.js +0 -1
  132. package/.next/static/chunks/pages/[...slug]-ca533c74c22cb787.js +0 -1
  133. package/.next/static/chunks/pages/[slug]/p-78699b0be521b30b.js +0 -1
  134. package/.next/static/chunks/pages/_app-40cff0982559d0b8.js +0 -1
  135. package/.next/static/chunks/pages/_error-a7a0c1d9bfbb4f38.js +0 -1
  136. package/.next/static/chunks/pages/account-05bd79fb78365e88.js +0 -1
  137. package/.next/static/chunks/pages/checkout-c973786e68f25a39.js +0 -1
  138. package/.next/static/chunks/pages/index-d521ce4f4e2b89a6.js +0 -1
  139. package/.next/static/chunks/pages/login-8deb9243376b6aa1.js +0 -1
  140. package/.next/static/chunks/pages/s-0935734d9ac3acb8.js +0 -1
  141. package/.next/static/chunks/polyfills-c67a75d1b6f99dc8.js +0 -1
  142. package/.next/static/chunks/webpack-34aa83cb25f3f792.js +0 -1
  143. package/.next/static/css/527e334fa69cf40a.css +0 -1
  144. package/.next/static/css/6e1a7434f061d0ef.css +0 -1
  145. package/.next/static/css/7ca374e5534a3f68.css +0 -1
  146. package/.next/static/css/9e76fef1c9ca89af.css +0 -1
  147. package/.next/static/css/a2eefb25a4608343.css +0 -1
  148. package/.next/static/css/cb7d1fcea42fab9c.css +0 -1
  149. package/.next/static/css/d5a515091be5db82.css +0 -1
  150. package/.next/static/css/df588bb98c0b0ca6.css +0 -1
  151. package/.next/static/css/e3b039e8f5daf95f.css +0 -1
  152. package/.next/static/css/f0e2d1b8832e935d.css +0 -1
  153. package/.next/trace +0 -80
  154. package/public/~partytown/debug/partytown-atomics.js +0 -556
  155. package/public/~partytown/debug/partytown-media.js +0 -374
  156. package/public/~partytown/debug/partytown-sandbox-sw.js +0 -543
  157. package/public/~partytown/debug/partytown-sw.js +0 -59
  158. package/public/~partytown/debug/partytown-ww-atomics.js +0 -1789
  159. package/public/~partytown/debug/partytown-ww-sw.js +0 -1781
  160. package/public/~partytown/debug/partytown.js +0 -72
  161. package/public/~partytown/partytown-atomics.js +0 -2
  162. package/public/~partytown/partytown-media.js +0 -2
  163. package/public/~partytown/partytown-sw.js +0 -2
  164. package/public/~partytown/partytown.js +0 -2
@@ -1,10 +1,16 @@
1
1
  $ yarn partytown && next build
2
2
  $ partytown copylib ./public/~partytown
3
- Partytown lib copied to: /Users/emersonlaurentino/develop/vtex/faststore/packages/core/public/~partytown
3
+ Partytown lib copied to: /home/runner/work/faststore/faststore/packages/core/public/~partytown
4
+ warn - No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
5
+ Attention: Next.js now collects completely anonymous telemetry regarding usage.
6
+ This information is used to shape Next.js' roadmap and prioritize features.
7
+ You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
8
+ https://nextjs.org/telemetry
9
+
4
10
  info - Linting and checking validity of types...
5
11
  info - Creating an optimized production build...
6
12
  info - Disabled SWC as replacement for Babel because of custom Babel configuration ".babelrc" https://nextjs.org/docs/messages/swc-disabled
7
- info - Using external babel configuration from /Users/emersonlaurentino/develop/vtex/faststore/packages/core/.babelrc
13
+ info - Using external babel configuration from /home/runner/work/faststore/faststore/packages/core/.babelrc
8
14
  info - Compiled successfully
9
15
  info - Collecting page data...
10
16
  info - Generating static pages (0/7)
@@ -19,7 +25,7 @@ Route (pages) Size First Load JS
19
25
  ├ /_app 0 B 77.9 kB
20
26
  ├ ● /[...slug] 4.06 kB 209 kB
21
27
  ├ └ css/527e334fa69cf40a.css 1.85 kB
22
- ├ ● /[slug]/p 10.5 kB 205 kB
28
+ ├ ● /[slug]/p 10.6 kB 205 kB
23
29
  ├ └ css/7ca374e5534a3f68.css 11.3 kB
24
30
  ├ ○ /404 1.19 kB 114 kB
25
31
  ├ ● /500 1.21 kB 114 kB
@@ -35,7 +41,7 @@ Route (pages) Size First Load JS
35
41
  ├ chunks/framework-dfd14d7ce6600b03.js 45.3 kB
36
42
  ├ chunks/main-fd466221927468fd.js 23.9 kB
37
43
  ├ chunks/pages/_app-40cff0982559d0b8.js 6.46 kB
38
- ├ chunks/webpack-34aa83cb25f3f792.js 2.29 kB
44
+ ├ chunks/webpack-aa0b4e883a43f80d.js 2.29 kB
39
45
  └ css/9e76fef1c9ca89af.css 3.06 kB
40
46
 
41
47
  λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
@@ -0,0 +1,2 @@
1
+ $ next lint
2
+ ✔ No ESLint warnings or errors
@@ -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.98",
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.98",
33
- "@faststore/components": "^2.1.94",
34
- "@faststore/graphql-utils": "^2.1.82",
35
- "@faststore/sdk": "^2.1.82",
36
- "@faststore/ui": "^2.1.94",
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.82",
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": "5b295774a676946af022c70fb0d04914d3bd3a44"
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 = availability == 'https://schema.org/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
- {!outOfStock ? (
198
- <ProductDetailsSettings
199
- product={data.product}
200
- isValidating={isValidating}
201
- buyButtonTitle={buyButtonTitle}
202
- quantity={quantity}
203
- setQuantity={setQuantity}
204
- buyButtonIcon={buyButtonIcon}
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 shouldShowDiscountedPrice = lowPrice !== listPrice
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
- <section data-fs-product-details-values>
81
- <div data-fs-product-details-prices>
82
- {shouldShowDiscountedPrice ? (
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="Sale Price:"
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
- <Price.Component
110
- formatter={useFormattedPrice}
111
- testId="list-price"
112
- variant="spot"
113
- className="text__lead"
114
- SRText="Original price:"
115
- {...Price.props}
116
- // Dynamic props shouldn't be overridable
117
- // This decision can be reviewed later if needed
118
- value={lowPrice}
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: A loading skeleton had to be used to avoid a Lighthouse's
142
- non-composited animation violation due to the button transitioning its
143
- background color when changing from its initial disabled to active state.
144
- See full explanation on commit https://git.io/JyXV5. */
145
- isValidating ? (
146
- <AddToCartLoadingSkeleton />
147
- ) : (
148
- <BuyButton.Component
149
- {...BuyButton.props}
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
  }
@@ -59,10 +59,6 @@ const handler: NextApiHandler = async (request, response) => {
59
59
  ? stringifyCacheControl(extensions.cacheControl)
60
60
  : 'no-cache, no-store'
61
61
 
62
- if (extensions.cookies && !hasErrors) {
63
- response.setHeader('set-cookie', extensions.cookies)
64
- }
65
-
66
62
  response.setHeader('cache-control', cacheControl)
67
63
  response.setHeader('content-type', 'application/json')
68
64
  response.send(JSON.stringify({ data, errors }))
@@ -71,7 +71,7 @@ export const execute = async <V extends Maybe<{ [key: string]: unknown }>, D>(
71
71
  ): Promise<{
72
72
  data: D
73
73
  errors: unknown[]
74
- extensions: { cacheControl?: CacheControl; cookies: string | null }
74
+ extensions: { cacheControl?: CacheControl }
75
75
  }> => {
76
76
  const { operationName, variables, query: maybeQuery } = options
77
77
  const query = maybeQuery ?? persistedQueries.get(operationName)
@@ -101,9 +101,6 @@ export const execute = async <V extends Maybe<{ [key: string]: unknown }>, D>(
101
101
  return {
102
102
  data,
103
103
  errors,
104
- extensions: {
105
- cookies: contextValue.storage.cookies,
106
- cacheControl: contextValue.cacheControl,
107
- },
104
+ extensions: { cacheControl: contextValue.cacheControl },
108
105
  }
109
106
  }
@@ -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
- 6S44gOq9FRmyEQybDi2Yj
@@ -1,129 +0,0 @@
1
- {
2
- "polyfillFiles": [
3
- "static/chunks/polyfills-c67a75d1b6f99dc8.js"
4
- ],
5
- "devFiles": [],
6
- "ampDevFiles": [],
7
- "lowPriorityFiles": [
8
- "static/6S44gOq9FRmyEQybDi2Yj/_buildManifest.js",
9
- "static/6S44gOq9FRmyEQybDi2Yj/_ssgManifest.js"
10
- ],
11
- "rootMainFiles": [],
12
- "pages": {
13
- "/": [
14
- "static/chunks/webpack-34aa83cb25f3f792.js",
15
- "static/chunks/framework-dfd14d7ce6600b03.js",
16
- "static/chunks/main-fd466221927468fd.js",
17
- "static/chunks/738-a5ff304828f20cbf.js",
18
- "static/chunks/548-19272804c3f0ff0d.js",
19
- "static/css/e3b039e8f5daf95f.css",
20
- "static/chunks/243-fcf2a6c4691476a2.js",
21
- "static/css/d5a515091be5db82.css",
22
- "static/chunks/238-c6f8d07b669a1ec2.js",
23
- "static/css/a2eefb25a4608343.css",
24
- "static/chunks/pages/index-d521ce4f4e2b89a6.js"
25
- ],
26
- "/404": [
27
- "static/chunks/webpack-34aa83cb25f3f792.js",
28
- "static/chunks/framework-dfd14d7ce6600b03.js",
29
- "static/chunks/main-fd466221927468fd.js",
30
- "static/chunks/738-a5ff304828f20cbf.js",
31
- "static/css/e3b039e8f5daf95f.css",
32
- "static/chunks/243-fcf2a6c4691476a2.js",
33
- "static/css/df588bb98c0b0ca6.css",
34
- "static/chunks/pages/404-af78f7cd1d3c1f60.js"
35
- ],
36
- "/500": [
37
- "static/chunks/webpack-34aa83cb25f3f792.js",
38
- "static/chunks/framework-dfd14d7ce6600b03.js",
39
- "static/chunks/main-fd466221927468fd.js",
40
- "static/chunks/738-a5ff304828f20cbf.js",
41
- "static/css/e3b039e8f5daf95f.css",
42
- "static/chunks/243-fcf2a6c4691476a2.js",
43
- "static/css/df588bb98c0b0ca6.css",
44
- "static/chunks/pages/500-f6346ca5f9dc4fef.js"
45
- ],
46
- "/[...slug]": [
47
- "static/chunks/webpack-34aa83cb25f3f792.js",
48
- "static/chunks/framework-dfd14d7ce6600b03.js",
49
- "static/chunks/main-fd466221927468fd.js",
50
- "static/chunks/738-a5ff304828f20cbf.js",
51
- "static/chunks/548-19272804c3f0ff0d.js",
52
- "static/css/e3b039e8f5daf95f.css",
53
- "static/chunks/243-fcf2a6c4691476a2.js",
54
- "static/css/d5a515091be5db82.css",
55
- "static/chunks/238-c6f8d07b669a1ec2.js",
56
- "static/css/f0e2d1b8832e935d.css",
57
- "static/chunks/603-7b26158c40b8a3e5.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-34aa83cb25f3f792.js",
64
- "static/chunks/framework-dfd14d7ce6600b03.js",
65
- "static/chunks/main-fd466221927468fd.js",
66
- "static/chunks/738-a5ff304828f20cbf.js",
67
- "static/chunks/548-19272804c3f0ff0d.js",
68
- "static/css/e3b039e8f5daf95f.css",
69
- "static/chunks/243-fcf2a6c4691476a2.js",
70
- "static/css/d5a515091be5db82.css",
71
- "static/chunks/238-c6f8d07b669a1ec2.js",
72
- "static/css/7ca374e5534a3f68.css",
73
- "static/chunks/pages/[slug]/p-78699b0be521b30b.js"
74
- ],
75
- "/_app": [
76
- "static/chunks/webpack-34aa83cb25f3f792.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-34aa83cb25f3f792.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-34aa83cb25f3f792.js",
90
- "static/chunks/framework-dfd14d7ce6600b03.js",
91
- "static/chunks/main-fd466221927468fd.js",
92
- "static/chunks/738-a5ff304828f20cbf.js",
93
- "static/css/e3b039e8f5daf95f.css",
94
- "static/chunks/243-fcf2a6c4691476a2.js",
95
- "static/chunks/pages/account-05bd79fb78365e88.js"
96
- ],
97
- "/checkout": [
98
- "static/chunks/webpack-34aa83cb25f3f792.js",
99
- "static/chunks/framework-dfd14d7ce6600b03.js",
100
- "static/chunks/main-fd466221927468fd.js",
101
- "static/chunks/738-a5ff304828f20cbf.js",
102
- "static/css/e3b039e8f5daf95f.css",
103
- "static/chunks/243-fcf2a6c4691476a2.js",
104
- "static/chunks/pages/checkout-c973786e68f25a39.js"
105
- ],
106
- "/login": [
107
- "static/chunks/webpack-34aa83cb25f3f792.js",
108
- "static/chunks/framework-dfd14d7ce6600b03.js",
109
- "static/chunks/main-fd466221927468fd.js",
110
- "static/chunks/738-a5ff304828f20cbf.js",
111
- "static/css/e3b039e8f5daf95f.css",
112
- "static/chunks/243-fcf2a6c4691476a2.js",
113
- "static/css/df588bb98c0b0ca6.css",
114
- "static/chunks/pages/login-8deb9243376b6aa1.js"
115
- ],
116
- "/s": [
117
- "static/chunks/webpack-34aa83cb25f3f792.js",
118
- "static/chunks/framework-dfd14d7ce6600b03.js",
119
- "static/chunks/main-fd466221927468fd.js",
120
- "static/chunks/738-a5ff304828f20cbf.js",
121
- "static/css/e3b039e8f5daf95f.css",
122
- "static/chunks/243-fcf2a6c4691476a2.js",
123
- "static/css/f0e2d1b8832e935d.css",
124
- "static/chunks/603-7b26158c40b8a3e5.js",
125
- "static/chunks/pages/s-0935734d9ac3acb8.js"
126
- ]
127
- },
128
- "ampFirstPages": []
129
- }