@faststore/core 2.1.91 → 2.1.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +15 -15
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/config.json +3 -3
- package/.next/cache/eslint/.cache_1gneedd +1 -1
- package/.next/cache/next-server.js.nft.json +1 -1
- package/.next/cache/webpack/client-production/0.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack +0 -0
- package/.next/cache/webpack/server-production/0.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.json +1 -1
- package/.next/routes-manifest.json +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/[slug]/p.js +22 -16
- package/.next/server/pages/en-US/404.html +2 -2
- package/.next/server/pages/en-US/500.html +2 -2
- package/.next/server/pages/en-US/account.html +2 -2
- package/.next/server/pages/en-US/checkout.html +2 -2
- package/.next/server/pages/en-US/login.html +2 -2
- package/.next/server/pages/en-US/s.html +2 -2
- package/.next/server/pages/en-US.html +2 -2
- package/.next/server/pages-manifest.json +2 -2
- package/.next/static/{PBbhTOsdD9dUNSyZhQVMh → CLTJdyHdlxA10PF9e-xnr}/_buildManifest.js +1 -1
- package/.next/static/chunks/pages/[slug]/{p-7bb760bb3fcfc0bb.js → p-9e2aae53cf59dd99.js} +1 -1
- package/.next/static/chunks/{webpack-352e624909554726.js → webpack-8e4905e5f03f2234.js} +1 -1
- package/.next/static/css/{4b7138899cd07c63.css → 3f6300dff11030c5.css} +1 -1
- package/.next/trace +80 -80
- package/.turbo/turbo-build.log +3 -3
- package/cms/faststore/sections.json +12 -0
- package/package.json +4 -4
- package/src/components/sections/ProductDetails/Overrides.tsx +4 -4
- package/src/components/sections/ProductDetails/ProductDetails.tsx +5 -0
- package/src/components/ui/ImageGallery/ImageGallery.tsx +13 -6
- package/src/typings/overrides.ts +5 -2
- /package/.next/static/{PBbhTOsdD9dUNSyZhQVMh → CLTJdyHdlxA10PF9e-xnr}/_ssgManifest.js +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -25,8 +25,8 @@ Route (pages) Size First Load JS
|
|
|
25
25
|
├ /_app 0 B 77.9 kB
|
|
26
26
|
├ ● /[...slug] 4.06 kB 208 kB
|
|
27
27
|
├ └ css/527e334fa69cf40a.css 1.85 kB
|
|
28
|
-
├ ● /[slug]/p 10.
|
|
29
|
-
├ └ css/
|
|
28
|
+
├ ● /[slug]/p 10.5 kB 204 kB
|
|
29
|
+
├ └ css/3f6300dff11030c5.css 11.3 kB
|
|
30
30
|
├ ○ /404 1.19 kB 114 kB
|
|
31
31
|
├ ● /500 1.21 kB 114 kB
|
|
32
32
|
├ ● /account 670 B 113 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-6d0e6ab9a4dd8106.js 6.45 kB
|
|
44
|
-
├ chunks/webpack-
|
|
44
|
+
├ chunks/webpack-8e4905e5f03f2234.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)
|
|
@@ -1430,6 +1430,18 @@
|
|
|
1430
1430
|
"default": "Description"
|
|
1431
1431
|
}
|
|
1432
1432
|
}
|
|
1433
|
+
},
|
|
1434
|
+
"imageGallery": {
|
|
1435
|
+
"title": "Image Gallery",
|
|
1436
|
+
"type": "object",
|
|
1437
|
+
"properties": {
|
|
1438
|
+
"imagePosition": {
|
|
1439
|
+
"type": "string",
|
|
1440
|
+
"title": "Image Position",
|
|
1441
|
+
"enumNames": ["Center", "Top", "Bottom"],
|
|
1442
|
+
"enum": ["center", "top", "bottom"]
|
|
1443
|
+
}
|
|
1444
|
+
}
|
|
1433
1445
|
}
|
|
1434
1446
|
}
|
|
1435
1447
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/core",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.93",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"browserslist": "supports es6-module and not dead",
|
|
6
6
|
"scripts": {
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
"@envelop/parser-cache": "^2.2.0",
|
|
31
31
|
"@envelop/validation-cache": "^2.2.0",
|
|
32
32
|
"@faststore/api": "^2.1.90",
|
|
33
|
-
"@faststore/components": "^2.1.
|
|
33
|
+
"@faststore/components": "^2.1.93",
|
|
34
34
|
"@faststore/graphql-utils": "^2.1.82",
|
|
35
35
|
"@faststore/sdk": "^2.1.82",
|
|
36
|
-
"@faststore/ui": "^2.1.
|
|
36
|
+
"@faststore/ui": "^2.1.93",
|
|
37
37
|
"@types/react": "^18.0.14",
|
|
38
38
|
"@vtex/client-cms": "^0.2.12",
|
|
39
39
|
"autoprefixer": "^10.4.0",
|
|
@@ -110,5 +110,5 @@
|
|
|
110
110
|
"msw": {
|
|
111
111
|
"workerDirectory": "public"
|
|
112
112
|
},
|
|
113
|
-
"gitHead": "
|
|
113
|
+
"gitHead": "6975c41cbaa09ca866e023c0c4ea68c0dc11c6c3"
|
|
114
114
|
}
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
Icon as UIIcon,
|
|
8
8
|
Price as UIPrice,
|
|
9
9
|
QuantitySelector as UIQuantitySelector,
|
|
10
|
-
|
|
10
|
+
ImageGalleryViewer as UIImageGalleryViewer,
|
|
11
11
|
ImageGallery as UIImageGallery,
|
|
12
12
|
} from '@faststore/ui'
|
|
13
13
|
|
|
@@ -29,7 +29,7 @@ const {
|
|
|
29
29
|
SkuSelector,
|
|
30
30
|
ShippingSimulation,
|
|
31
31
|
ImageGallery,
|
|
32
|
-
|
|
32
|
+
ImageGalleryViewer,
|
|
33
33
|
__experimentalImageGalleryImage,
|
|
34
34
|
__experimentalImageGallery,
|
|
35
35
|
__experimentalShippingSimulation,
|
|
@@ -44,7 +44,7 @@ const {
|
|
|
44
44
|
SkuSelector: UISkuSelector,
|
|
45
45
|
ShippingSimulation: UIShippingSimulation,
|
|
46
46
|
ImageGallery: UIImageGallery,
|
|
47
|
-
|
|
47
|
+
ImageGalleryViewer: UIImageGalleryViewer,
|
|
48
48
|
__experimentalImageGalleryImage: Image,
|
|
49
49
|
__experimentalImageGallery: LocalImageGallery,
|
|
50
50
|
__experimentalShippingSimulation: LocalShippingSimulation,
|
|
@@ -62,7 +62,7 @@ export {
|
|
|
62
62
|
SkuSelector,
|
|
63
63
|
ShippingSimulation,
|
|
64
64
|
ImageGallery,
|
|
65
|
-
|
|
65
|
+
ImageGalleryViewer,
|
|
66
66
|
__experimentalImageGalleryImage,
|
|
67
67
|
__experimentalImageGallery,
|
|
68
68
|
__experimentalShippingSimulation,
|
|
@@ -56,6 +56,9 @@ export interface ProductDetailsProps {
|
|
|
56
56
|
displayDescription: boolean
|
|
57
57
|
initiallyExpanded: 'first' | 'all' | 'none'
|
|
58
58
|
}
|
|
59
|
+
imageGallery: {
|
|
60
|
+
imagePosition: 'top' | 'center' | 'bottom'
|
|
61
|
+
}
|
|
59
62
|
}
|
|
60
63
|
|
|
61
64
|
function ProductDetails({
|
|
@@ -87,6 +90,7 @@ function ProductDetails({
|
|
|
87
90
|
initiallyExpanded: productDescriptionInitiallyExpanded,
|
|
88
91
|
displayDescription: shouldDisplayProductDescription,
|
|
89
92
|
},
|
|
93
|
+
imageGallery: { imagePosition = ImageGallery.props.imagePosition },
|
|
90
94
|
}: ProductDetailsProps & ProductDetailsContextProps) {
|
|
91
95
|
const { currency } = useSession()
|
|
92
96
|
const [quantity, setQuantity] = useState(1)
|
|
@@ -182,6 +186,7 @@ function ProductDetails({
|
|
|
182
186
|
<ImageGallery.Component
|
|
183
187
|
data-fs-product-details-gallery
|
|
184
188
|
{...ImageGallery.props}
|
|
189
|
+
imagePosition={imagePosition}
|
|
185
190
|
images={productImages}
|
|
186
191
|
/>
|
|
187
192
|
<section data-fs-product-details-info>
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { ImageElementData } from '@faststore/ui'
|
|
2
1
|
import { useEffect, useState } from 'react'
|
|
3
2
|
|
|
4
3
|
import { useRouter } from 'next/router'
|
|
5
4
|
|
|
6
5
|
import {
|
|
7
6
|
ImageGallery as ImageGalleryWrapper,
|
|
8
|
-
|
|
7
|
+
ImageGalleryViewer,
|
|
9
8
|
__experimentalImageGalleryImage as Image,
|
|
10
9
|
} from 'src/components/sections/ProductDetails/Overrides'
|
|
11
10
|
|
|
11
|
+
import type { ImageGalleryProps as UIImageGalleryProps } from '@faststore/ui'
|
|
12
|
+
|
|
12
13
|
const ImageComponent = ({ url, alternateName }) => {
|
|
13
14
|
return (
|
|
14
15
|
<Image.Component src={url} alt={alternateName} width={68} height={68} />
|
|
@@ -16,10 +17,15 @@ const ImageComponent = ({ url, alternateName }) => {
|
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
export interface ImageGalleryProps {
|
|
19
|
-
images:
|
|
20
|
+
images: UIImageGalleryProps['images']
|
|
21
|
+
imagePosition?: UIImageGalleryProps['imagePosition']
|
|
20
22
|
}
|
|
21
23
|
|
|
22
|
-
const ImageGallery = ({
|
|
24
|
+
const ImageGallery = ({
|
|
25
|
+
images,
|
|
26
|
+
imagePosition,
|
|
27
|
+
...otherProps
|
|
28
|
+
}: ImageGalleryProps) => {
|
|
23
29
|
const [selectedImageIdx, setSelectedImageIdx] = useState(0)
|
|
24
30
|
const currentImage = images[selectedImageIdx] ?? images[0]
|
|
25
31
|
const dynamicRoute = useRouter().asPath
|
|
@@ -33,9 +39,10 @@ const ImageGallery = ({ images, ...otherProps }: ImageGalleryProps) => {
|
|
|
33
39
|
ImageComponent={ImageComponent}
|
|
34
40
|
selectedImageIdx={selectedImageIdx}
|
|
35
41
|
setSelectedImageIdx={setSelectedImageIdx}
|
|
42
|
+
imagePosition={imagePosition ?? ImageGalleryWrapper.props.imagePosition}
|
|
36
43
|
{...otherProps}
|
|
37
44
|
>
|
|
38
|
-
<
|
|
45
|
+
<ImageGalleryViewer.Component {...ImageGalleryViewer.props}>
|
|
39
46
|
<Image.Component
|
|
40
47
|
sizes="(max-width: 360px) 50vw, (max-width: 768px) 90vw, 50vw"
|
|
41
48
|
width={691}
|
|
@@ -45,7 +52,7 @@ const ImageGallery = ({ images, ...otherProps }: ImageGalleryProps) => {
|
|
|
45
52
|
src={currentImage.url}
|
|
46
53
|
alt={currentImage.alternateName}
|
|
47
54
|
/>
|
|
48
|
-
</
|
|
55
|
+
</ImageGalleryViewer.Component>
|
|
49
56
|
</ImageGalleryWrapper.Component>
|
|
50
57
|
)
|
|
51
58
|
}
|
package/src/typings/overrides.ts
CHANGED
|
@@ -13,7 +13,7 @@ import type {
|
|
|
13
13
|
IconButtonProps,
|
|
14
14
|
IconProps,
|
|
15
15
|
ImageGalleryProps,
|
|
16
|
-
|
|
16
|
+
ImageGalleryViewerProps,
|
|
17
17
|
InputFieldProps,
|
|
18
18
|
LinkButtonProps,
|
|
19
19
|
NavbarButtonsProps,
|
|
@@ -197,7 +197,10 @@ export type ProductDetailsOverrideDefinition = SectionOverrideDefinition<
|
|
|
197
197
|
ImageGalleryProps,
|
|
198
198
|
ImageGalleryProps
|
|
199
199
|
>
|
|
200
|
-
|
|
200
|
+
ImageGalleryViewer: ComponentOverrideDefinition<
|
|
201
|
+
ImageGalleryViewerProps,
|
|
202
|
+
ImageGalleryViewerProps
|
|
203
|
+
>
|
|
201
204
|
__experimentalImageGalleryImage: ComponentOverrideDefinition<any, any>
|
|
202
205
|
__experimentalImageGallery: ComponentOverrideDefinition<any, any>
|
|
203
206
|
__experimentalShippingSimulation: ComponentOverrideDefinition<any, any>
|
|
File without changes
|