@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.
Files changed (36) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +15 -15
  3. package/.next/cache/.tsbuildinfo +1 -1
  4. package/.next/cache/config.json +3 -3
  5. package/.next/cache/eslint/.cache_1gneedd +1 -1
  6. package/.next/cache/next-server.js.nft.json +1 -1
  7. package/.next/cache/webpack/client-production/0.pack +0 -0
  8. package/.next/cache/webpack/client-production/index.pack +0 -0
  9. package/.next/cache/webpack/server-production/0.pack +0 -0
  10. package/.next/cache/webpack/server-production/index.pack +0 -0
  11. package/.next/next-server.js.nft.json +1 -1
  12. package/.next/prerender-manifest.json +1 -1
  13. package/.next/routes-manifest.json +1 -1
  14. package/.next/server/middleware-build-manifest.js +1 -1
  15. package/.next/server/pages/[slug]/p.js +22 -16
  16. package/.next/server/pages/en-US/404.html +2 -2
  17. package/.next/server/pages/en-US/500.html +2 -2
  18. package/.next/server/pages/en-US/account.html +2 -2
  19. package/.next/server/pages/en-US/checkout.html +2 -2
  20. package/.next/server/pages/en-US/login.html +2 -2
  21. package/.next/server/pages/en-US/s.html +2 -2
  22. package/.next/server/pages/en-US.html +2 -2
  23. package/.next/server/pages-manifest.json +2 -2
  24. package/.next/static/{PBbhTOsdD9dUNSyZhQVMh → CLTJdyHdlxA10PF9e-xnr}/_buildManifest.js +1 -1
  25. package/.next/static/chunks/pages/[slug]/{p-7bb760bb3fcfc0bb.js → p-9e2aae53cf59dd99.js} +1 -1
  26. package/.next/static/chunks/{webpack-352e624909554726.js → webpack-8e4905e5f03f2234.js} +1 -1
  27. package/.next/static/css/{4b7138899cd07c63.css → 3f6300dff11030c5.css} +1 -1
  28. package/.next/trace +80 -80
  29. package/.turbo/turbo-build.log +3 -3
  30. package/cms/faststore/sections.json +12 -0
  31. package/package.json +4 -4
  32. package/src/components/sections/ProductDetails/Overrides.tsx +4 -4
  33. package/src/components/sections/ProductDetails/ProductDetails.tsx +5 -0
  34. package/src/components/ui/ImageGallery/ImageGallery.tsx +13 -6
  35. package/src/typings/overrides.ts +5 -2
  36. /package/.next/static/{PBbhTOsdD9dUNSyZhQVMh → CLTJdyHdlxA10PF9e-xnr}/_ssgManifest.js +0 -0
@@ -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.4 kB 204 kB
29
- ├ └ css/4b7138899cd07c63.css 11.3 kB
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-352e624909554726.js 2.29 kB
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.91",
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.82",
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.82",
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": "1cd662c7de939daf29ff6a820d73ea4d61dfd3d9"
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
- ImageZoom as UIImageZoom,
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
- ImageZoom,
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
- ImageZoom: UIImageZoom,
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
- ImageZoom,
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
- ImageZoom,
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: ImageElementData[]
20
+ images: UIImageGalleryProps['images']
21
+ imagePosition?: UIImageGalleryProps['imagePosition']
20
22
  }
21
23
 
22
- const ImageGallery = ({ images, ...otherProps }: ImageGalleryProps) => {
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
- <ImageZoom.Component {...ImageZoom.props}>
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
- </ImageZoom.Component>
55
+ </ImageGalleryViewer.Component>
49
56
  </ImageGalleryWrapper.Component>
50
57
  )
51
58
  }
@@ -13,7 +13,7 @@ import type {
13
13
  IconButtonProps,
14
14
  IconProps,
15
15
  ImageGalleryProps,
16
- ImageZoomProps,
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
- ImageZoom: ComponentOverrideDefinition<ImageZoomProps, ImageZoomProps>
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>