@faststore/core 3.77.3 → 3.78.0
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 +49 -49
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/config.json +3 -3
- 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/prerender-manifest.js +1 -1
- package/.next/prerender-manifest.json +1 -1
- package/.next/react-loadable-manifest.json +71 -57
- package/.next/routes-manifest.json +1 -1
- package/.next/server/chunks/1270.js +1 -0
- package/.next/server/chunks/1911.js +1 -0
- package/.next/server/chunks/2430.js +1 -0
- package/.next/server/chunks/3006.js +1 -1
- package/.next/server/chunks/3836.js +1 -1
- package/.next/server/chunks/3945.js +1 -0
- package/.next/server/chunks/5402.js +1 -0
- package/.next/server/chunks/6698.js +1 -0
- package/.next/server/chunks/6789.js +1 -1
- package/.next/server/chunks/{7178.js → 8071.js} +1 -1
- package/.next/server/chunks/83.js +1 -1
- package/.next/server/chunks/831.js +1 -1
- package/.next/server/chunks/8474.js +9 -0
- package/.next/server/chunks/8563.js +1 -0
- package/.next/server/chunks/9088.js +1 -1
- package/.next/server/chunks/9117.js +1 -0
- package/.next/server/chunks/948.js +1 -1
- package/.next/server/chunks/9563.js +2 -2
- package/.next/server/chunks/9630.js +101 -4
- package/.next/server/chunks/9853.js +1 -1
- package/.next/server/chunks/UIBannerText.js +1 -1
- package/.next/server/chunks/UISKUMatrixSidebar.js +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/pages/404.js.nft.json +1 -1
- package/.next/server/pages/500.js.nft.json +1 -1
- package/.next/server/pages/[...slug].js +1 -1
- package/.next/server/pages/[...slug].js.nft.json +1 -1
- package/.next/server/pages/[slug]/p.js +1 -1
- package/.next/server/pages/[slug]/p.js.nft.json +1 -1
- package/.next/server/pages/_app.js.nft.json +1 -1
- package/.next/server/pages/_document.js.nft.json +1 -1
- package/.next/server/pages/_error.js.nft.json +1 -1
- package/.next/server/pages/account/403.js.nft.json +1 -1
- package/.next/server/pages/account/404.js.nft.json +1 -1
- package/.next/server/pages/account/[...unknown].js.nft.json +1 -1
- package/.next/server/pages/account/orders/[id].js.nft.json +1 -1
- package/.next/server/pages/account/orders.js +1 -1
- package/.next/server/pages/account/orders.js.nft.json +1 -1
- package/.next/server/pages/account/profile.js.nft.json +1 -1
- package/.next/server/pages/account/security.js.nft.json +1 -1
- package/.next/server/pages/account/user-details.js.nft.json +1 -1
- package/.next/server/pages/account.js.nft.json +1 -1
- package/.next/server/pages/api/graphql.js +2 -2
- package/.next/server/pages/api/graphql.js.nft.json +1 -1
- package/.next/server/pages/api/health/live.js.nft.json +1 -1
- package/.next/server/pages/api/health/ready.js.nft.json +1 -1
- package/.next/server/pages/api/preview.js.nft.json +1 -1
- package/.next/server/pages/checkout.js.nft.json +1 -1
- package/.next/server/pages/en-US/404.html +1 -1
- package/.next/server/pages/en-US/500.html +1 -1
- package/.next/server/pages/en-US/checkout.html +1 -1
- package/.next/server/pages/en-US/login.html +1 -1
- package/.next/server/pages/en-US/s.html +1 -1
- package/.next/server/pages/en-US.html +1 -1
- package/.next/server/pages/index.js.nft.json +1 -1
- package/.next/server/pages/login.js.nft.json +1 -1
- package/.next/server/pages/s.js +1 -1
- package/.next/server/pages/s.js.nft.json +1 -1
- package/.next/server/pages-manifest.json +1 -1
- package/.next/static/{xFgIjKNUaH5r_Yo0uIAnc → 6VSKTBCq7vRe86nXQK6nv}/_buildManifest.js +1 -1
- package/.next/static/chunks/3155.c3fa96f983101956.js +1 -0
- package/.next/static/chunks/3166-a1d98d71987c90d6.js +1 -0
- package/.next/static/chunks/3399.60aae5ddb9123ef5.js +1 -0
- package/.next/static/chunks/3836.a2f49cd66f78bcb2.js +1 -0
- package/.next/static/chunks/4836.ef87204971e182f4.js +1 -0
- package/.next/static/chunks/6789.634a5fcc1ed30b8d.js +1 -0
- package/.next/static/chunks/7026.e990acc86d95259d.js +1 -0
- package/.next/static/chunks/7191-2b424236f6799274.js +1 -0
- package/.next/static/chunks/7351.8ef7b6b1d6e1505a.js +1 -0
- package/.next/static/chunks/83.affac11ef34a0c11.js +1 -0
- package/.next/static/chunks/8325.b3ddbb43feda1a85.js +1 -0
- package/.next/static/chunks/8587.1d6d458c9b697351.js +1 -0
- package/.next/static/chunks/9173-acced9d62b9088c8.js +1 -0
- package/.next/static/chunks/9666-9be3f1e484eeb148.js +1 -0
- package/.next/static/chunks/{7351.e90a4cc21797c136.js → 9714.68af2d4bf27f560b.js} +1 -1
- package/.next/static/chunks/9781.dd4028663db7414b.js +1 -0
- package/.next/static/chunks/BannerNewsletter.d91d065d644d15f3.js +1 -0
- package/.next/static/chunks/BannerText.3bc2f0af3687e984.js +1 -0
- package/.next/static/chunks/CartSidebar.f2f885b6d9a227e2.js +1 -0
- package/.next/static/chunks/ProductShelf.dcdeffe85dca1ace.js +1 -0
- package/.next/static/chunks/ProductTiles.12e553830401871d.js +1 -0
- package/.next/static/chunks/RegionModal.0aff964cb36eb49a.js +1 -0
- package/.next/static/chunks/RegionSlider.cbf2ac28eeac8dbe.js +1 -0
- package/.next/static/chunks/Toast.c06d4e2e2e7913c5.js +1 -0
- package/.next/static/chunks/UIBannerText.08c65db460bd1695.js +1 -0
- package/.next/static/chunks/UIToast.55af19d2eba3d8a1.js +1 -0
- package/.next/static/chunks/pages/{[...slug]-b3a9bdfcf0127006.js → [...slug]-1e68a914dfca7da9.js} +1 -1
- package/.next/static/chunks/pages/[slug]/p-2c73921b1ab00c27.js +1 -0
- package/.next/static/chunks/pages/_app-57478e0d1d2ddf62.js +1 -0
- package/.next/static/chunks/pages/{s-989fccebe1b60a4e.js → s-e7745eef6c834c3e.js} +1 -1
- package/.next/static/chunks/webpack-d29ca7e9684f9a33.js +1 -0
- package/.next/static/css/{70353bf19c496790.css → 297be4be3be36ff0.css} +1 -1
- package/.next/static/css/{0a57ee6c7a57788c.css → 4b8252ed2f23ac67.css} +1 -1
- package/.next/static/css/{6831395ff5fd317a.css → 6d92375b6ee8276a.css} +1 -1
- package/.next/static/css/8f6350925b347380.css +1 -0
- package/.next/trace +136 -135
- package/.turbo/turbo-build.log +19 -19
- package/.turbo/turbo-test.log +5 -5
- package/@generated/gql.ts +20 -4
- package/@generated/graphql.ts +310 -6
- package/@generated/persisted-documents.json +6 -5
- package/@generated/schema.graphql +39 -1
- package/CHANGELOG.md +6 -0
- package/cms/faststore/sections.json +99 -0
- package/package.json +4 -4
- package/src/components/product/ProductCard/ProductCard.tsx +74 -35
- package/src/components/product/ProductGrid/ProductGrid.tsx +16 -0
- package/src/components/sections/ProductDetails/ProductDetails.tsx +4 -0
- package/src/components/sections/ProductGallery/DefaultComponents.ts +15 -0
- package/src/components/sections/ProductGallery/ProductGallery.tsx +1 -0
- package/src/components/sections/ProductGallery/section.module.scss +16 -3
- package/src/components/ui/ProductComparison/ProductComparisonSidebar.tsx +256 -0
- package/src/components/ui/ProductComparison/index.ts +1 -0
- package/src/components/ui/ProductGallery/ProductGallery.tsx +251 -173
- package/src/components/ui/ProductGallery/ProductGalleryPage.tsx +6 -0
- package/src/sdk/product/useProductsSelected.tsx +45 -0
- package/src/typings/overrides.ts +30 -1
- package/test/server/index.test.ts +1 -0
- package/.next/server/chunks/1333.js +0 -1
- package/.next/server/chunks/2295.js +0 -1
- package/.next/server/chunks/2778.js +0 -9
- package/.next/server/chunks/3918.js +0 -1
- package/.next/server/chunks/3963.js +0 -1
- package/.next/server/chunks/5607.js +0 -1
- package/.next/server/chunks/6335.js +0 -1
- package/.next/server/chunks/76.js +0 -1
- package/.next/server/chunks/7794.js +0 -1
- package/.next/server/chunks/839.js +0 -1
- package/.next/static/chunks/3155.243c7558a71f0695.js +0 -1
- package/.next/static/chunks/3166-e2e2d3255aa5f208.js +0 -1
- package/.next/static/chunks/3399.93804fb74f79436c.js +0 -1
- package/.next/static/chunks/3836.c0487aea7bd0c6f0.js +0 -1
- package/.next/static/chunks/5781.28d03feacead66ad.js +0 -1
- package/.next/static/chunks/6355.454b14737c2bf69c.js +0 -1
- package/.next/static/chunks/6857.b2c06171638955ea.js +0 -1
- package/.next/static/chunks/7191-7badbb9888b79ce9.js +0 -1
- package/.next/static/chunks/7481.3c4ad3642e346232.js +0 -1
- package/.next/static/chunks/7498-0dc4f9a9ed199d3a.js +0 -1
- package/.next/static/chunks/83.ee1fdbe283ac65b6.js +0 -1
- package/.next/static/chunks/9173-3a00edf7b695a319.js +0 -1
- package/.next/static/chunks/BannerNewsletter.fe0181162c046991.js +0 -1
- package/.next/static/chunks/BannerText.681f118e9f149f6c.js +0 -1
- package/.next/static/chunks/CartSidebar.55cc31a37ffa6ee6.js +0 -1
- package/.next/static/chunks/ProductShelf.b75a7ab8e313ea07.js +0 -1
- package/.next/static/chunks/ProductTiles.35cd23ada22f5a96.js +0 -1
- package/.next/static/chunks/RegionModal.04b02aafc0836d49.js +0 -1
- package/.next/static/chunks/RegionSlider.d063ccee38bdfdb7.js +0 -1
- package/.next/static/chunks/Toast.75a18f47eb23b703.js +0 -1
- package/.next/static/chunks/UIBannerText.f4167ceafb96cf67.js +0 -1
- package/.next/static/chunks/UIToast.a49584c87d3adc17.js +0 -1
- package/.next/static/chunks/pages/[slug]/p-73a253032aaf8ce2.js +0 -1
- package/.next/static/chunks/pages/_app-df4ba03d82beaf86.js +0 -1
- package/.next/static/chunks/webpack-c996443db6f4fa91.js +0 -1
- package/.next/static/css/4bd5e2314f697713.css +0 -1
- /package/.next/static/{xFgIjKNUaH5r_Yo0uIAnc → 6VSKTBCq7vRe86nXQK6nv}/_ssgManifest.js +0 -0
|
@@ -2005,6 +2005,105 @@
|
|
|
2005
2005
|
}
|
|
2006
2006
|
}
|
|
2007
2007
|
}
|
|
2008
|
+
},
|
|
2009
|
+
"productComparison": {
|
|
2010
|
+
"title": "Product Comparison",
|
|
2011
|
+
"type": "object",
|
|
2012
|
+
"properties": {
|
|
2013
|
+
"enabled": {
|
|
2014
|
+
"title": "Enable Product Comparison",
|
|
2015
|
+
"type": "boolean",
|
|
2016
|
+
"default": false
|
|
2017
|
+
},
|
|
2018
|
+
"labels": {
|
|
2019
|
+
"title": "Labels",
|
|
2020
|
+
"type": "object",
|
|
2021
|
+
"properties": {
|
|
2022
|
+
"compareButton": {
|
|
2023
|
+
"title": "Compare Button",
|
|
2024
|
+
"type": "string",
|
|
2025
|
+
"default": "Compare"
|
|
2026
|
+
},
|
|
2027
|
+
"clearSelectionButton": {
|
|
2028
|
+
"title": "Clear Selection Button",
|
|
2029
|
+
"type": "string",
|
|
2030
|
+
"default": "Clear Selection"
|
|
2031
|
+
},
|
|
2032
|
+
"selectionWarning": {
|
|
2033
|
+
"title": "Selection Warning",
|
|
2034
|
+
"type": "string",
|
|
2035
|
+
"default": "Select at least 2"
|
|
2036
|
+
},
|
|
2037
|
+
"sidebarComponent": {
|
|
2038
|
+
"title": "Sidebar component",
|
|
2039
|
+
"type": "object",
|
|
2040
|
+
"properties": {
|
|
2041
|
+
"title": {
|
|
2042
|
+
"title": "Title",
|
|
2043
|
+
"type": "string",
|
|
2044
|
+
"default": "Compare Products"
|
|
2045
|
+
},
|
|
2046
|
+
"filterLabel": {
|
|
2047
|
+
"title": "Filter text",
|
|
2048
|
+
"type": "string",
|
|
2049
|
+
"default": "Filters"
|
|
2050
|
+
},
|
|
2051
|
+
"productNameFilterLabel": {
|
|
2052
|
+
"title": "Filter by product name text",
|
|
2053
|
+
"type": "string",
|
|
2054
|
+
"default": "Product name"
|
|
2055
|
+
},
|
|
2056
|
+
"sortLabel": {
|
|
2057
|
+
"title": "Sort filter text",
|
|
2058
|
+
"type": "string",
|
|
2059
|
+
"default": "Sort by"
|
|
2060
|
+
},
|
|
2061
|
+
"toggleFieldLabel": {
|
|
2062
|
+
"title": "Toggle filter text",
|
|
2063
|
+
"type": "string",
|
|
2064
|
+
"default": "Show only differences"
|
|
2065
|
+
},
|
|
2066
|
+
"preferencesLabel": {
|
|
2067
|
+
"title": "Preferences text",
|
|
2068
|
+
"type": "string",
|
|
2069
|
+
"default": "Preferences"
|
|
2070
|
+
},
|
|
2071
|
+
"cartButtonLabel": {
|
|
2072
|
+
"title": "Add to cart button",
|
|
2073
|
+
"type": "string",
|
|
2074
|
+
"default": "Add to cart"
|
|
2075
|
+
},
|
|
2076
|
+
"priceLabel": {
|
|
2077
|
+
"title": "Price text",
|
|
2078
|
+
"type": "string",
|
|
2079
|
+
"default": "Price"
|
|
2080
|
+
},
|
|
2081
|
+
"priceWithTaxLabel": {
|
|
2082
|
+
"title": "Price with taxes text",
|
|
2083
|
+
"type": "string",
|
|
2084
|
+
"default": "Price with taxes"
|
|
2085
|
+
}
|
|
2086
|
+
}
|
|
2087
|
+
},
|
|
2088
|
+
"technicalInformation": {
|
|
2089
|
+
"title": "Technical Information",
|
|
2090
|
+
"type": "object",
|
|
2091
|
+
"properties": {
|
|
2092
|
+
"title": {
|
|
2093
|
+
"title": "Title",
|
|
2094
|
+
"type": "string",
|
|
2095
|
+
"default": "Technical Information"
|
|
2096
|
+
},
|
|
2097
|
+
"description": {
|
|
2098
|
+
"title": "Description",
|
|
2099
|
+
"type": "string",
|
|
2100
|
+
"default": "Technical facts and information about the product."
|
|
2101
|
+
}
|
|
2102
|
+
}
|
|
2103
|
+
}
|
|
2104
|
+
}
|
|
2105
|
+
}
|
|
2106
|
+
}
|
|
2008
2107
|
}
|
|
2009
2108
|
}
|
|
2010
2109
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.78.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": "vtex/faststore",
|
|
6
6
|
"browserslist": "supports es6-module and not dead",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"@envelop/graphql-jit": "^8.0.3",
|
|
45
45
|
"@envelop/parser-cache": "^6.0.2",
|
|
46
46
|
"@envelop/validation-cache": "^6.0.2",
|
|
47
|
-
"@faststore/api": "^3.
|
|
47
|
+
"@faststore/api": "^3.78.0",
|
|
48
48
|
"@faststore/graphql-utils": "^3.56.1",
|
|
49
49
|
"@faststore/lighthouse": "^3.56.1",
|
|
50
50
|
"@faststore/sdk": "^3.77.2",
|
|
51
|
-
"@faststore/ui": "^3.
|
|
51
|
+
"@faststore/ui": "^3.78.0",
|
|
52
52
|
"@graphql-codegen/cli": "5.0.2",
|
|
53
53
|
"@graphql-codegen/client-preset": "4.2.6",
|
|
54
54
|
"@graphql-codegen/typescript": "4.0.7",
|
|
@@ -108,5 +108,5 @@
|
|
|
108
108
|
"ts-jest": "29.1.1",
|
|
109
109
|
"typescript": "5.3.2"
|
|
110
110
|
},
|
|
111
|
-
"gitHead": "
|
|
111
|
+
"gitHead": "e4853a8c962f5ba4527694ea4b60984fa21e1208"
|
|
112
112
|
}
|
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
ProductCard as UIProductCard,
|
|
3
3
|
ProductCardContent as UIProductCardContent,
|
|
4
4
|
ProductCardImage as UIProductCardImage,
|
|
5
|
+
ProductComparisonTrigger as UIProductComparisonTrigger,
|
|
5
6
|
} from '@faststore/ui'
|
|
6
7
|
import { memo, useMemo } from 'react'
|
|
7
8
|
|
|
@@ -61,6 +62,14 @@ export interface ProductCardProps {
|
|
|
61
62
|
* Specifies the sponsored label, if advertisement is applicable.
|
|
62
63
|
*/
|
|
63
64
|
sponsoredLabel?: string
|
|
65
|
+
/**
|
|
66
|
+
* Enable the compare checkbox on display.
|
|
67
|
+
*/
|
|
68
|
+
enableCompareCheckbox?: boolean
|
|
69
|
+
/**
|
|
70
|
+
* Label for the compare checkbox.
|
|
71
|
+
*/
|
|
72
|
+
compareLabel?: string
|
|
64
73
|
}
|
|
65
74
|
|
|
66
75
|
function ProductCard({
|
|
@@ -76,6 +85,8 @@ function ProductCard({
|
|
|
76
85
|
showDiscountBadge = true,
|
|
77
86
|
taxesConfiguration,
|
|
78
87
|
sponsoredLabel,
|
|
88
|
+
enableCompareCheckbox = false,
|
|
89
|
+
compareLabel,
|
|
79
90
|
...otherProps
|
|
80
91
|
}: ProductCardProps) {
|
|
81
92
|
const {
|
|
@@ -121,42 +132,52 @@ function ProductCard({
|
|
|
121
132
|
: {}
|
|
122
133
|
|
|
123
134
|
return (
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
{...otherProps}
|
|
131
|
-
>
|
|
132
|
-
<UIProductCardImage aspectRatio={aspectRatio}>
|
|
133
|
-
<Image
|
|
134
|
-
src={img.url}
|
|
135
|
-
alt={img.alternateName}
|
|
136
|
-
sizes={`${imgProps?.sizes ?? '(max-width: 768px) 40vw, 30vw'}`}
|
|
137
|
-
width={imgProps?.width ?? 360}
|
|
138
|
-
height={Math.round((Number(imgProps?.height) || 360) / aspectRatio)}
|
|
139
|
-
loading={imgProps?.loading}
|
|
135
|
+
<>
|
|
136
|
+
{enableCompareCheckbox && (
|
|
137
|
+
<UIProductComparisonTrigger
|
|
138
|
+
label={compareLabel}
|
|
139
|
+
product={product}
|
|
140
|
+
id={product.id}
|
|
140
141
|
/>
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
price={{
|
|
145
|
-
value: spotPrice,
|
|
146
|
-
listPrice: listPrice,
|
|
147
|
-
formatter: useFormattedPrice,
|
|
148
|
-
}}
|
|
149
|
-
ratingValue={ratingValue}
|
|
142
|
+
)}
|
|
143
|
+
|
|
144
|
+
<UIProductCard
|
|
150
145
|
outOfStock={outOfStock}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
146
|
+
bordered={bordered}
|
|
147
|
+
variant={variant}
|
|
148
|
+
data-fs-product-card-sku={sku}
|
|
149
|
+
{...advertisementDataAttributes}
|
|
150
|
+
{...otherProps}
|
|
151
|
+
>
|
|
152
|
+
<UIProductCardImage aspectRatio={aspectRatio}>
|
|
153
|
+
<Image
|
|
154
|
+
src={img.url}
|
|
155
|
+
alt={img.alternateName}
|
|
156
|
+
sizes={`${imgProps?.sizes ?? '(max-width: 768px) 40vw, 30vw'}`}
|
|
157
|
+
width={imgProps?.width ?? 360}
|
|
158
|
+
height={Math.round((Number(imgProps?.height) || 360) / aspectRatio)}
|
|
159
|
+
loading={imgProps?.loading}
|
|
160
|
+
/>
|
|
161
|
+
</UIProductCardImage>
|
|
162
|
+
<UIProductCardContent
|
|
163
|
+
title={name}
|
|
164
|
+
price={{
|
|
165
|
+
value: spotPrice,
|
|
166
|
+
listPrice: listPrice,
|
|
167
|
+
formatter: useFormattedPrice,
|
|
168
|
+
}}
|
|
169
|
+
ratingValue={ratingValue}
|
|
170
|
+
outOfStock={outOfStock}
|
|
171
|
+
onButtonClick={onButtonClick}
|
|
172
|
+
linkProps={linkProps}
|
|
173
|
+
showDiscountBadge={hasDiscount && showDiscountBadge}
|
|
174
|
+
includeTaxes={taxesConfiguration?.usePriceWithTaxes}
|
|
175
|
+
includeTaxesLabel={taxesConfiguration?.taxesLabel}
|
|
176
|
+
sponsored={!!advertisement}
|
|
177
|
+
sponsoredLabel={sponsoredLabel}
|
|
178
|
+
/>
|
|
179
|
+
</UIProductCard>
|
|
180
|
+
</>
|
|
160
181
|
)
|
|
161
182
|
}
|
|
162
183
|
|
|
@@ -200,7 +221,7 @@ export const fragment = gql(`
|
|
|
200
221
|
price
|
|
201
222
|
listPrice
|
|
202
223
|
listPriceWithTaxes
|
|
203
|
-
|
|
224
|
+
priceWithTaxes
|
|
204
225
|
quantity
|
|
205
226
|
seller {
|
|
206
227
|
identifier
|
|
@@ -215,6 +236,24 @@ export const fragment = gql(`
|
|
|
215
236
|
valueReference
|
|
216
237
|
}
|
|
217
238
|
|
|
239
|
+
hasSpecifications
|
|
240
|
+
|
|
241
|
+
unitMultiplier
|
|
242
|
+
|
|
243
|
+
isVariantOf {
|
|
244
|
+
productGroupID
|
|
245
|
+
name
|
|
246
|
+
skuVariants {
|
|
247
|
+
activeVariations
|
|
248
|
+
slugsMap
|
|
249
|
+
availableVariations
|
|
250
|
+
allVariantProducts {
|
|
251
|
+
name
|
|
252
|
+
productID
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
218
257
|
advertisement {
|
|
219
258
|
adId
|
|
220
259
|
adResponseId
|
|
@@ -36,6 +36,14 @@ interface Props {
|
|
|
36
36
|
* Determine if the current page is the first page.
|
|
37
37
|
*/
|
|
38
38
|
firstPage?: number
|
|
39
|
+
/**
|
|
40
|
+
* Determine whether to show the comparison checkbox.
|
|
41
|
+
*/
|
|
42
|
+
shouldShowComparison?: boolean
|
|
43
|
+
/**
|
|
44
|
+
* Label for comparison text.
|
|
45
|
+
*/
|
|
46
|
+
compareLabel?: string
|
|
39
47
|
/**
|
|
40
48
|
* Title for the `ProductGrid` component that will be send to GA events.
|
|
41
49
|
*/
|
|
@@ -53,6 +61,8 @@ function ProductGrid({
|
|
|
53
61
|
sponsoredLabel,
|
|
54
62
|
} = {},
|
|
55
63
|
firstPage,
|
|
64
|
+
shouldShowComparison,
|
|
65
|
+
compareLabel,
|
|
56
66
|
title,
|
|
57
67
|
}: Props) {
|
|
58
68
|
const { isMobile } = useScreenResize()
|
|
@@ -80,6 +90,8 @@ function ProductGrid({
|
|
|
80
90
|
pageSize={pageSize}
|
|
81
91
|
>
|
|
82
92
|
<ProductCard.Component
|
|
93
|
+
enableCompareCheckbox={shouldShowComparison}
|
|
94
|
+
compareLabel={compareLabel}
|
|
83
95
|
aspectRatio={aspectRatio}
|
|
84
96
|
imgProps={{
|
|
85
97
|
width: 150,
|
|
@@ -110,6 +122,8 @@ function ProductGrid({
|
|
|
110
122
|
pageSize={pageSize}
|
|
111
123
|
>
|
|
112
124
|
<ProductCard.Component
|
|
125
|
+
enableCompareCheckbox={shouldShowComparison}
|
|
126
|
+
compareLabel={compareLabel}
|
|
113
127
|
aspectRatio={aspectRatio}
|
|
114
128
|
imgProps={{
|
|
115
129
|
width: 150,
|
|
@@ -143,6 +157,8 @@ function ProductGrid({
|
|
|
143
157
|
pageSize={pageSize}
|
|
144
158
|
>
|
|
145
159
|
<ProductCard.Component
|
|
160
|
+
enableCompareCheckbox={shouldShowComparison}
|
|
161
|
+
compareLabel={compareLabel}
|
|
146
162
|
aspectRatio={aspectRatio}
|
|
147
163
|
imgProps={{
|
|
148
164
|
width: 150,
|
|
@@ -3,6 +3,10 @@ import {
|
|
|
3
3
|
Icon as UIIcon,
|
|
4
4
|
LinkButton as UILinkButton,
|
|
5
5
|
Skeleton as UISkeleton,
|
|
6
|
+
ToggleField as UIToggleField,
|
|
7
|
+
ProductComparison as UIProductComparison,
|
|
8
|
+
ProductComparisonSidebar as UIProductComparisonSidebar,
|
|
9
|
+
ProductComparisonToolbar as UIProductComparisonToolbar,
|
|
6
10
|
} from '@faststore/ui'
|
|
7
11
|
|
|
8
12
|
import dynamic from 'next/dynamic'
|
|
@@ -29,6 +33,12 @@ const FilterSlider = dynamic(
|
|
|
29
33
|
import('src/components/search/Filter/FilterSlider')
|
|
30
34
|
)
|
|
31
35
|
|
|
36
|
+
const ProductComparisonSidebar = dynamic(
|
|
37
|
+
() =>
|
|
38
|
+
/* webpackChunkName: "ProductComparisonSidebar" */
|
|
39
|
+
import('src/components/ui/ProductComparison')
|
|
40
|
+
)
|
|
41
|
+
|
|
32
42
|
export const ProductGalleryDefaultComponents = {
|
|
33
43
|
MobileFilterButton: UIButton,
|
|
34
44
|
FilterIcon: UIIcon,
|
|
@@ -36,10 +46,15 @@ export const ProductGalleryDefaultComponents = {
|
|
|
36
46
|
ResultsCountSkeleton: UISkeleton,
|
|
37
47
|
SortSkeleton: UISkeleton,
|
|
38
48
|
FilterButtonSkeleton: UISkeleton,
|
|
49
|
+
ToggleField: UIToggleField,
|
|
50
|
+
ProductComparison: UIProductComparison,
|
|
51
|
+
ProductComparisonSidebar: UIProductComparisonSidebar,
|
|
52
|
+
ProductComparisonToolbar: UIProductComparisonToolbar,
|
|
39
53
|
LinkButtonPrev: UILinkButton,
|
|
40
54
|
LinkButtonNext: UILinkButton,
|
|
41
55
|
__experimentalFilterDesktop: FilterDesktop,
|
|
42
56
|
__experimentalFilterSlider: FilterSlider,
|
|
43
57
|
__experimentalProductCard: ProductCard,
|
|
44
58
|
__experimentalEmptyGallery: EmptyGallery,
|
|
59
|
+
__experimentalProductComparisonSidebar: ProductComparisonSidebar,
|
|
45
60
|
} as const
|
|
@@ -26,6 +26,7 @@ export interface ProductGallerySectionProps {
|
|
|
26
26
|
sortBySelector?: ProductGalleryProps['sortBySelector']
|
|
27
27
|
productCard?: ProductGalleryProps['productCard']
|
|
28
28
|
emptyGallery?: EmptyGalleryProps
|
|
29
|
+
productComparison?: ProductGalleryProps['productComparison']
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
function ProductGallerySection({
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
.section {
|
|
3
3
|
@include media("<notebook") {
|
|
4
4
|
margin-top: 0;
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
&:last-child {
|
|
7
|
+
margin-bottom: 0;
|
|
8
|
+
}
|
|
6
9
|
|
|
7
10
|
@include section-divisor(bottom, 0);
|
|
8
11
|
}
|
|
@@ -22,7 +25,10 @@
|
|
|
22
25
|
h1 {
|
|
23
26
|
font-size: var(--fs-text-size-4);
|
|
24
27
|
|
|
25
|
-
@include media(">=tablet") {
|
|
28
|
+
@include media(">=tablet") {
|
|
29
|
+
padding-top: var(--fs-spacing-4);
|
|
30
|
+
font-size: var(--fs-text-size-5);
|
|
31
|
+
}
|
|
26
32
|
|
|
27
33
|
span {
|
|
28
34
|
font-weight: var(--fs-text-weight-bold);
|
|
@@ -43,19 +49,26 @@
|
|
|
43
49
|
@import "@faststore/ui/src/components/atoms/Skeleton/styles";
|
|
44
50
|
@import "@faststore/ui/src/components/atoms/Slider/styles.scss";
|
|
45
51
|
@import "@faststore/ui/src/components/molecules/Accordion/styles.scss";
|
|
52
|
+
@import "@faststore/ui/src/components/molecules/CheckboxField/styles.scss";
|
|
46
53
|
@import "@faststore/ui/src/components/molecules/DiscountBadge/styles.scss";
|
|
54
|
+
@import "@faststore/ui/src/components/molecules/Dropdown/styles.scss";
|
|
47
55
|
@import "@faststore/ui/src/components/molecules/InputField/styles.scss";
|
|
48
56
|
@import "@faststore/ui/src/components/molecules/LinkButton/styles.scss";
|
|
57
|
+
@import "@faststore/ui/src/components/molecules/Modal/styles.scss";
|
|
49
58
|
@import "@faststore/ui/src/components/molecules/ProductCard/styles.scss";
|
|
50
59
|
@import "@faststore/ui/src/components/molecules/ProductCardSkeleton/styles";
|
|
51
60
|
@import "@faststore/ui/src/components/molecules/ProductPrice/styles.scss";
|
|
52
61
|
@import "@faststore/ui/src/components/molecules/RadioField/styles.scss";
|
|
53
62
|
@import "@faststore/ui/src/components/molecules/SelectField/styles.scss";
|
|
63
|
+
@import "@faststore/ui/src/components/molecules/Toggle/styles.scss";
|
|
64
|
+
@import "@faststore/ui/src/components/molecules/ToggleField/styles.scss";
|
|
54
65
|
@import "@faststore/ui/src/components/organisms/EmptyState/styles.scss";
|
|
55
66
|
@import "@faststore/ui/src/components/organisms/Filter/styles.scss";
|
|
56
67
|
@import "@faststore/ui/src/components/organisms/FilterSkeleton/styles.scss";
|
|
57
68
|
@import "@faststore/ui/src/components/organisms/PriceRange/styles.scss";
|
|
58
|
-
@import "@faststore/ui/src/components/organisms/
|
|
69
|
+
@import "@faststore/ui/src/components/organisms/ProductComparison/styles";
|
|
59
70
|
@import "@faststore/ui/src/components/organisms/ProductGallery/styles.scss";
|
|
71
|
+
@import "@faststore/ui/src/components/organisms/ProductGrid/styles.scss";
|
|
72
|
+
@import "@faststore/ui/src/components/organisms/SlideOver/styles";
|
|
60
73
|
}
|
|
61
74
|
}
|