@faststore/core 3.83.0 → 3.84.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 +32 -32
- 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 +36 -36
- package/.next/routes-manifest.json +1 -1
- package/.next/server/chunks/1911.js +1 -1
- package/.next/server/chunks/2792.js +1 -1
- package/.next/server/chunks/6789.js +1 -1
- package/.next/server/chunks/8474.js +2 -2
- package/.next/server/chunks/948.js +1 -1
- package/.next/server/chunks/9563.js +2 -2
- package/.next/server/chunks/9630.js +10 -7
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/pages/[...slug].js +1 -1
- package/.next/server/pages/[slug]/p.js +1 -1
- package/.next/server/pages/api/graphql.js +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/s.js +1 -1
- package/.next/server/pages-manifest.json +1 -1
- package/.next/static/{irlP2Y8IJEbMTGvY6bTt_ → DhcFFBEwJrYjN9OdXaeMO}/_buildManifest.js +1 -1
- package/.next/static/chunks/3166-b1ac316afe18625b.js +1 -0
- package/.next/static/chunks/3836.c7f8d69a151682bc.js +1 -0
- package/.next/static/chunks/{6393.f13568b0fd5f52f6.js → 6393.4ad395e06f7dbbc6.js} +1 -1
- package/.next/static/chunks/6789.c37c2ec891333684.js +1 -0
- package/.next/static/chunks/7191-d39597fc204602cb.js +1 -0
- package/.next/static/chunks/9781.60f28efd7e165f54.js +1 -0
- package/.next/static/chunks/ProductShelf.ee5cec2ae121df87.js +1 -0
- package/.next/static/chunks/ProductTiles.2bd64de5bcd5f6d8.js +1 -0
- package/.next/static/chunks/pages/[slug]/{p-0287b5a8ac0b92e5.js → p-60dd0938ba92424b.js} +1 -1
- package/.next/static/chunks/pages/_app-423f11b0d7fff185.js +1 -0
- package/.next/static/chunks/pages/s-c624c961a98a1be0.js +1 -0
- package/.next/static/chunks/{webpack-e7151d8bd72a8f2f.js → webpack-92cd0db592faf63b.js} +1 -1
- package/.next/static/css/{4656927d3ebbf5b8.css → 04fb2d4b8924b0c6.css} +1 -1
- package/.next/static/css/24a5e8f6808266fe.css +1 -0
- package/.next/static/css/{62a5153ac7061286.css → 3d7be7043aee15df.css} +1 -1
- package/.next/static/css/{a3ca6a9b63f657be.css → 6cd282d958f613bc.css} +1 -1
- package/.next/static/css/{8f6350925b347380.css → fe0bcc13a2b68605.css} +1 -1
- package/.next/trace +136 -136
- package/.turbo/turbo-build.log +19 -19
- package/.turbo/turbo-test.log +5 -5
- package/@generated/gql.ts +2 -2
- package/@generated/graphql.ts +22 -3
- package/@generated/persisted-documents.json +3 -3
- package/@generated/schema.graphql +8 -0
- package/CHANGELOG.md +12 -0
- package/cms/faststore/content-types.json +32 -0
- package/package.json +5 -5
- package/src/components/product/ProductCard/ProductCard.tsx +14 -0
- package/src/components/sections/ProductTiles/ProductTiles.tsx +15 -1
- package/src/components/templates/SearchPage/SearchPage.tsx +1 -3
- package/src/components/templates/SearchPage/SearchWrapper.tsx +1 -1
- package/src/components/ui/ProductShelf/ProductShelf.tsx +4 -7
- package/src/pages/s.tsx +5 -8
- package/src/sdk/deliveryPromise/useDeliveryPromise.ts +87 -1
- package/src/sdk/product/useLocalizedVariables.ts +2 -6
- package/src/sdk/product/usePageProductsQuery.ts +64 -80
- package/src/utils/globalSettings.ts +7 -0
- package/src/utils/utilities.ts +18 -0
- package/.next/static/chunks/3166-785c61fd0e214905.js +0 -1
- package/.next/static/chunks/3836.63a23109a71dbbdb.js +0 -1
- package/.next/static/chunks/6789.38bef760c1190c23.js +0 -1
- package/.next/static/chunks/7191-102277856f196551.js +0 -1
- package/.next/static/chunks/9781.dd4028663db7414b.js +0 -1
- package/.next/static/chunks/ProductShelf.9f3194be577c7cce.js +0 -1
- package/.next/static/chunks/ProductTiles.e0528e72234381e6.js +0 -1
- package/.next/static/chunks/pages/_app-f8a8608651b3f06b.js +0 -1
- package/.next/static/chunks/pages/s-e7745eef6c834c3e.js +0 -1
- package/.next/static/css/4b8252ed2f23ac67.css +0 -1
- /package/.next/static/{irlP2Y8IJEbMTGvY6bTt_ → DhcFFBEwJrYjN9OdXaeMO}/_ssgManifest.js +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
|
|
2
|
-
> @faststore/core@3.
|
|
2
|
+
> @faststore/core@3.83.1 prebuild /home/runner/work/faststore/faststore/packages/core
|
|
3
3
|
> na run partytown && na run generate
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @faststore/core@3.
|
|
6
|
+
> @faststore/core@3.83.1 partytown /home/runner/work/faststore/faststore/packages/core
|
|
7
7
|
> partytown copylib ./public/~partytown
|
|
8
8
|
|
|
9
9
|
Partytown lib copied to: /home/runner/work/faststore/faststore/packages/core/public/~partytown
|
|
10
10
|
|
|
11
|
-
> @faststore/core@3.
|
|
11
|
+
> @faststore/core@3.83.1 generate /home/runner/work/faststore/faststore/packages/core
|
|
12
12
|
> na run generate:schema && na run generate:codegen && na run format:generated
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
> @faststore/core@3.
|
|
15
|
+
> @faststore/core@3.83.1 generate:schema /home/runner/work/faststore/faststore/packages/core
|
|
16
16
|
> tsx src/server/generator/generateGraphQLSchemaFile.ts
|
|
17
17
|
|
|
18
18
|
Schema GraphQL file generated successfully
|
|
19
19
|
|
|
20
|
-
> @faststore/core@3.
|
|
20
|
+
> @faststore/core@3.83.1 generate:codegen /home/runner/work/faststore/faststore/packages/core
|
|
21
21
|
> graphql-codegen
|
|
22
22
|
|
|
23
23
|
[STARTED] Parse Configuration
|
|
@@ -37,11 +37,11 @@ Running lifecycle hook "afterStart" scripts...
|
|
|
37
37
|
[CLI] Loading Documents
|
|
38
38
|
[CLI] Generating output
|
|
39
39
|
|
|
40
|
-
> @faststore/core@3.
|
|
40
|
+
> @faststore/core@3.83.1 format:generated /home/runner/work/faststore/faststore/packages/core
|
|
41
41
|
> prettier --write "@generated/**/*.{ts,js,tsx,jsx,json}" --loglevel error
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
> @faststore/core@3.
|
|
44
|
+
> @faststore/core@3.83.1 build /home/runner/work/faststore/faststore/packages/core
|
|
45
45
|
> next build
|
|
46
46
|
|
|
47
47
|
⚠ No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
|
|
@@ -65,8 +65,8 @@ Browserslist: browsers data (caniuse-lite) is 8 months old. Please run:
|
|
|
65
65
|
Collecting page data ...
|
|
66
66
|
Generating static pages (0/6) ...
|
|
67
67
|
|
|
68
68
|
Generating static pages (1/6)
|
|
69
|
-
Warning: Dynamic Content not found for the page: home. Refer to the Dynamic Content documentation at https://developers.vtex.com/docs/guides/faststore/dynamic-content-overview for mapping the page and the corresponding data-fetching function.
|
|
70
69
|
|
|
71
70
|
Generating static pages (2/6)
|
|
71
|
+
Warning: Dynamic Content not found for the page: home. Refer to the Dynamic Content documentation at https://developers.vtex.com/docs/guides/faststore/dynamic-content-overview for mapping the page and the corresponding data-fetching function.
|
|
72
72
|
|
|
73
73
|
Generating static pages (4/6)
|
|
74
74
|
|
|
75
75
|
✓ Generating static pages (6/6)
|
|
76
76
|
Finalizing page optimization ...
|
|
@@ -77,21 +77,21 @@ Route (pages) Size First Load JS
|
|
|
77
77
|
├ └ css/b1806cbafd0c1f81.css 3.06 kB
|
|
78
78
|
├ /_app 0 B 107 kB
|
|
79
79
|
├ ● /[...slug] 2.45 kB 155 kB
|
|
80
|
-
├ ● /[slug]/p 33.
|
|
81
|
-
├ ├ css/
|
|
82
|
-
├ ├ css/
|
|
80
|
+
├ ● /[slug]/p 33.5 kB 171 kB
|
|
81
|
+
├ ├ css/6cd282d958f613bc.css 5.9 kB
|
|
82
|
+
├ ├ css/3d7be7043aee15df.css 6.26 kB
|
|
83
83
|
├ └ css/6d92375b6ee8276a.css 16.1 kB
|
|
84
84
|
├ ○ /404 1.55 kB 139 kB
|
|
85
85
|
├ ● /500 1.55 kB 139 kB
|
|
86
86
|
├ λ /account 240 B 107 kB
|
|
87
87
|
├ ● /account/[...unknown] 281 B 107 kB
|
|
88
|
-
├ λ /account/403 2.44 kB
|
|
88
|
+
├ λ /account/403 2.44 kB 140 kB
|
|
89
89
|
├ └ css/b7bba8fce075688b.css 4.2 kB
|
|
90
|
-
├ λ /account/404 2.13 kB
|
|
90
|
+
├ λ /account/404 2.13 kB 140 kB
|
|
91
91
|
├ └ css/5347dbc8b71de47d.css 4.25 kB
|
|
92
|
-
├ λ /account/orders 10.5 kB
|
|
92
|
+
├ λ /account/orders 10.5 kB 148 kB
|
|
93
93
|
├ └ css/b7fc24e8f1eb011f.css 12.8 kB
|
|
94
|
-
├ λ /account/orders/[id] 12.2 kB
|
|
94
|
+
├ λ /account/orders/[id] 12.2 kB 150 kB
|
|
95
95
|
├ └ css/297be4be3be36ff0.css 12.6 kB
|
|
96
96
|
├ λ /account/profile 1.79 kB 139 kB
|
|
97
97
|
├ └ css/831a1f72fe4b2d80.css 3.97 kB
|
|
@@ -105,13 +105,13 @@ Route (pages) Size First Load JS
|
|
|
105
105
|
├ λ /api/preview 0 B 107 kB
|
|
106
106
|
├ ● /checkout 737 B 138 kB
|
|
107
107
|
├ ● /login 1.68 kB 139 kB
|
|
108
|
-
└ ● /s 3.
|
|
108
|
+
└ ● /s 3.24 kB 156 kB
|
|
109
109
|
+ First Load JS shared by all 110 kB
|
|
110
110
|
├ chunks/framework-807b0f81cbc129f0.js 45.4 kB
|
|
111
111
|
├ chunks/main-f658704b53a96ab1.js 33.1 kB
|
|
112
|
-
├ chunks/pages/_app-
|
|
113
|
-
├ chunks/webpack-
|
|
114
|
-
└ css/
|
|
112
|
+
├ chunks/pages/_app-423f11b0d7fff185.js 24.7 kB
|
|
113
|
+
├ chunks/webpack-92cd0db592faf63b.js 3.85 kB
|
|
114
|
+
└ css/24a5e8f6808266fe.css 3.53 kB
|
|
115
115
|
|
|
116
116
|
λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
|
|
117
117
|
○ (Static) automatically rendered as static HTML (uses no initial props)
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
> @faststore/core@3.
|
|
2
|
+
> @faststore/core@3.83.1 test /home/runner/work/faststore/faststore/packages/core
|
|
3
3
|
> jest
|
|
4
4
|
|
|
5
|
-
PASS test/
|
|
6
|
-
PASS test/
|
|
5
|
+
PASS test/utils/multipleTemplates.test.ts (27.708 s)
|
|
6
|
+
PASS test/server/cms/global.test.ts (28.492 s)
|
|
7
7
|
PASS test/server/cms/index.test.ts
|
|
8
|
-
PASS test/server/index.test.ts (
|
|
8
|
+
PASS test/server/index.test.ts (31.229 s)
|
|
9
9
|
|
|
10
10
|
Test Suites: 4 passed, 4 total
|
|
11
11
|
Tests: 22 passed, 22 total
|
|
12
12
|
Snapshots: 0 total
|
|
13
|
-
Time: 32.
|
|
13
|
+
Time: 32.612 s
|
|
14
14
|
Ran all test suites.
|
package/@generated/gql.ts
CHANGED
|
@@ -12,7 +12,7 @@ import * as types from './graphql'
|
|
|
12
12
|
* Therefore it is highly recommended to use the babel or swc plugin for production.
|
|
13
13
|
*/
|
|
14
14
|
const documents = {
|
|
15
|
-
'\n fragment ProductSummary_product on StoreProduct {\n id: productID\n slug\n sku\n brand {\n brandName: name\n }\n name\n gtin\n\t\tunitMultiplier\n\n isVariantOf {\n productGroupID\n name\n\t\t\tskuVariants {\n\t\t\t\tallVariantsByName\n\t\t\t\tactiveVariations\n\t\t\t\tslugsMap\n\t\t\t\tavailableVariations\n\t\t\t}\n }\n\n image {\n url\n alternateName\n }\n\n brand {\n name\n }\n\n offers {\n lowPrice\n lowPriceWithTaxes\n offers {\n availability\n price\n listPrice\n listPriceWithTaxes\n priceWithTaxes\n quantity\n seller {\n identifier\n }\n }\n }\n\n additionalProperty {\n propertyID\n name\n value\n valueReference\n }\n\n hasSpecifications\n\n unitMultiplier\n\n isVariantOf {\n productGroupID\n name\n skuVariants {\n activeVariations\n slugsMap\n availableVariations\n allVariantProducts {\n name\n productID\n }\n }\n }\n\n advertisement {\n adId\n adResponseId\n }\n }\n':
|
|
15
|
+
'\n fragment ProductSummary_product on StoreProduct {\n id: productID\n slug\n sku\n brand {\n brandName: name\n }\n name\n gtin\n\t\tunitMultiplier\n\n isVariantOf {\n productGroupID\n name\n\t\t\tskuVariants {\n\t\t\t\tallVariantsByName\n\t\t\t\tactiveVariations\n\t\t\t\tslugsMap\n\t\t\t\tavailableVariations\n\t\t\t}\n }\n\n image {\n url\n alternateName\n }\n\n brand {\n name\n }\n\n offers {\n lowPrice\n lowPriceWithTaxes\n offers {\n availability\n price\n listPrice\n listPriceWithTaxes\n priceWithTaxes\n quantity\n seller {\n identifier\n }\n }\n }\n\n additionalProperty {\n propertyID\n name\n value\n valueReference\n }\n\n hasSpecifications\n\n unitMultiplier\n\n isVariantOf {\n productGroupID\n name\n skuVariants {\n activeVariations\n slugsMap\n availableVariations\n allVariantProducts {\n name\n productID\n }\n }\n }\n\n advertisement {\n adId\n adResponseId\n }\n\n deliveryPromiseBadges {\n typeName\n }\n }\n':
|
|
16
16
|
types.ProductSummary_ProductFragmentDoc,
|
|
17
17
|
'\n fragment Filter_facets on StoreFacet {\n ... on StoreFacetRange {\n key\n label\n\n min {\n selected\n absolute\n }\n\n max {\n selected\n absolute\n }\n\n __typename\n }\n ... on StoreFacetBoolean {\n key\n label\n values {\n label\n value\n selected\n quantity\n }\n\n __typename\n }\n }\n':
|
|
18
18
|
types.Filter_FacetsFragmentDoc,
|
|
@@ -98,7 +98,7 @@ const documents = {
|
|
|
98
98
|
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
99
99
|
*/
|
|
100
100
|
export function gql(
|
|
101
|
-
source: '\n fragment ProductSummary_product on StoreProduct {\n id: productID\n slug\n sku\n brand {\n brandName: name\n }\n name\n gtin\n\t\tunitMultiplier\n\n isVariantOf {\n productGroupID\n name\n\t\t\tskuVariants {\n\t\t\t\tallVariantsByName\n\t\t\t\tactiveVariations\n\t\t\t\tslugsMap\n\t\t\t\tavailableVariations\n\t\t\t}\n }\n\n image {\n url\n alternateName\n }\n\n brand {\n name\n }\n\n offers {\n lowPrice\n lowPriceWithTaxes\n offers {\n availability\n price\n listPrice\n listPriceWithTaxes\n priceWithTaxes\n quantity\n seller {\n identifier\n }\n }\n }\n\n additionalProperty {\n propertyID\n name\n value\n valueReference\n }\n\n hasSpecifications\n\n unitMultiplier\n\n isVariantOf {\n productGroupID\n name\n skuVariants {\n activeVariations\n slugsMap\n availableVariations\n allVariantProducts {\n name\n productID\n }\n }\n }\n\n advertisement {\n adId\n adResponseId\n }\n }\n'
|
|
101
|
+
source: '\n fragment ProductSummary_product on StoreProduct {\n id: productID\n slug\n sku\n brand {\n brandName: name\n }\n name\n gtin\n\t\tunitMultiplier\n\n isVariantOf {\n productGroupID\n name\n\t\t\tskuVariants {\n\t\t\t\tallVariantsByName\n\t\t\t\tactiveVariations\n\t\t\t\tslugsMap\n\t\t\t\tavailableVariations\n\t\t\t}\n }\n\n image {\n url\n alternateName\n }\n\n brand {\n name\n }\n\n offers {\n lowPrice\n lowPriceWithTaxes\n offers {\n availability\n price\n listPrice\n listPriceWithTaxes\n priceWithTaxes\n quantity\n seller {\n identifier\n }\n }\n }\n\n additionalProperty {\n propertyID\n name\n value\n valueReference\n }\n\n hasSpecifications\n\n unitMultiplier\n\n isVariantOf {\n productGroupID\n name\n skuVariants {\n activeVariations\n slugsMap\n availableVariations\n allVariantProducts {\n name\n productID\n }\n }\n }\n\n advertisement {\n adId\n adResponseId\n }\n\n deliveryPromiseBadges {\n typeName\n }\n }\n'
|
|
102
102
|
): typeof import('./graphql').ProductSummary_ProductFragmentDoc
|
|
103
103
|
/**
|
|
104
104
|
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
package/@generated/graphql.ts
CHANGED
|
@@ -349,6 +349,12 @@ export type DeliveryIds = {
|
|
|
349
349
|
warehouseId: Maybe<Scalars['String']['output']>
|
|
350
350
|
}
|
|
351
351
|
|
|
352
|
+
/** Delivery Promise badge. */
|
|
353
|
+
export type DeliveryPromiseBadge = {
|
|
354
|
+
/** Badge type. */
|
|
355
|
+
typeName: Maybe<Scalars['String']['output']>
|
|
356
|
+
}
|
|
357
|
+
|
|
352
358
|
/** Input to get commercial authorizations by order ID. */
|
|
353
359
|
export type ICommercialAuthorizationByOrderId = {
|
|
354
360
|
/** Order ID to get commercial authorizations for. */
|
|
@@ -1417,6 +1423,8 @@ export type StoreProduct = {
|
|
|
1417
1423
|
brand: StoreBrand
|
|
1418
1424
|
/** List of items consisting of chain linked web pages, ending with the current page. */
|
|
1419
1425
|
breadcrumbList: StoreBreadcrumbList
|
|
1426
|
+
/** Delivery Promise product's badge. */
|
|
1427
|
+
deliveryPromiseBadges: Maybe<Array<Maybe<DeliveryPromiseBadge>>>
|
|
1420
1428
|
/** Product description. */
|
|
1421
1429
|
description: Scalars['String']['output']
|
|
1422
1430
|
/** Global Trade Item Number. */
|
|
@@ -2441,6 +2449,7 @@ export type ProductSummary_ProductFragment = {
|
|
|
2441
2449
|
valueReference: any
|
|
2442
2450
|
}>
|
|
2443
2451
|
advertisement: { adId: string; adResponseId: string } | null
|
|
2452
|
+
deliveryPromiseBadges: Array<{ typeName: string | null } | null> | null
|
|
2444
2453
|
}
|
|
2445
2454
|
|
|
2446
2455
|
type Filter_Facets_StoreFacetBoolean_Fragment = {
|
|
@@ -3297,6 +3306,9 @@ export type ClientManyProductsQueryQuery = {
|
|
|
3297
3306
|
valueReference: any
|
|
3298
3307
|
}>
|
|
3299
3308
|
advertisement: { adId: string; adResponseId: string } | null
|
|
3309
|
+
deliveryPromiseBadges: Array<{
|
|
3310
|
+
typeName: string | null
|
|
3311
|
+
} | null> | null
|
|
3300
3312
|
}
|
|
3301
3313
|
}>
|
|
3302
3314
|
}
|
|
@@ -3529,6 +3541,7 @@ export type ClientSearchSuggestionsQueryQuery = {
|
|
|
3529
3541
|
valueReference: any
|
|
3530
3542
|
}>
|
|
3531
3543
|
advertisement: { adId: string; adResponseId: string } | null
|
|
3544
|
+
deliveryPromiseBadges: Array<{ typeName: string | null } | null> | null
|
|
3532
3545
|
}>
|
|
3533
3546
|
}
|
|
3534
3547
|
products: { pageInfo: { totalCount: number } }
|
|
@@ -3687,6 +3700,9 @@ export type ServerManyProductsQueryQuery = {
|
|
|
3687
3700
|
valueReference: any
|
|
3688
3701
|
}>
|
|
3689
3702
|
advertisement: { adId: string; adResponseId: string } | null
|
|
3703
|
+
deliveryPromiseBadges: Array<{
|
|
3704
|
+
typeName: string | null
|
|
3705
|
+
} | null> | null
|
|
3690
3706
|
}
|
|
3691
3707
|
}>
|
|
3692
3708
|
}
|
|
@@ -3781,6 +3797,9 @@ export const ProductSummary_ProductFragmentDoc = new TypedDocumentString(
|
|
|
3781
3797
|
adId
|
|
3782
3798
|
adResponseId
|
|
3783
3799
|
}
|
|
3800
|
+
deliveryPromiseBadges {
|
|
3801
|
+
typeName
|
|
3802
|
+
}
|
|
3784
3803
|
}
|
|
3785
3804
|
`,
|
|
3786
3805
|
{ fragmentName: 'ProductSummary_product' }
|
|
@@ -4413,7 +4432,7 @@ export const ClientAllVariantProductsQueryDocument = {
|
|
|
4413
4432
|
export const ClientManyProductsQueryDocument = {
|
|
4414
4433
|
__meta__: {
|
|
4415
4434
|
operationName: 'ClientManyProductsQuery',
|
|
4416
|
-
operationHash: '
|
|
4435
|
+
operationHash: 'e49027bc29aa10cbf7bbb0ed62239af8de1653f0',
|
|
4417
4436
|
},
|
|
4418
4437
|
} as unknown as TypedDocumentString<
|
|
4419
4438
|
ClientManyProductsQueryQuery,
|
|
@@ -4458,7 +4477,7 @@ export const ClientProfileQueryDocument = {
|
|
|
4458
4477
|
export const ClientSearchSuggestionsQueryDocument = {
|
|
4459
4478
|
__meta__: {
|
|
4460
4479
|
operationName: 'ClientSearchSuggestionsQuery',
|
|
4461
|
-
operationHash: '
|
|
4480
|
+
operationHash: 'bbaa2ed75c4fb04842189e8d53a1d65481154e2b',
|
|
4462
4481
|
},
|
|
4463
4482
|
} as unknown as TypedDocumentString<
|
|
4464
4483
|
ClientSearchSuggestionsQueryQuery,
|
|
@@ -4494,7 +4513,7 @@ export const ClientShippingSimulationQueryDocument = {
|
|
|
4494
4513
|
export const ServerManyProductsQueryDocument = {
|
|
4495
4514
|
__meta__: {
|
|
4496
4515
|
operationName: 'ServerManyProductsQuery',
|
|
4497
|
-
operationHash: '
|
|
4516
|
+
operationHash: '4b769cda49004c85d0d427c601eba36c37a52224',
|
|
4498
4517
|
},
|
|
4499
4518
|
} as unknown as TypedDocumentString<
|
|
4500
4519
|
ServerManyProductsQueryQuery,
|
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
"feb7005103a859e2bc8cf2360d568806fd88deba": "mutation SubscribeToNewsletter($data: IPersonNewsletter!) { subscribeToNewsletter(data: $data) { id } }",
|
|
16
16
|
"dc912e7272e3d9f5ced206837df87f544d39d0a5": "query ClientProductCountQuery($term: String) { productCount(term: $term) { total } }",
|
|
17
17
|
"4039e05f01a2fe449e20e8b82170d0ba94b1fbe9": "fragment ProductSKUMatrixSidebarFragment_product on StoreProduct { isVariantOf { name productGroupID skuVariants { activeVariations allVariantProducts { additionalProperty { name propertyID value valueReference } image { alternateName url } name offers { highPrice lowPrice lowPriceWithTaxes offerCount offers { availability itemCondition listPrice listPriceWithTaxes price priceCurrency priceValidUntil priceWithTaxes quantity sellingPrice } priceCurrency } sku } availableVariations slugsMap } } id: productID } query ClientAllVariantProductsQuery($locator: [IStoreSelectedFacet!]!) { product(locator: $locator) { ...ProductSKUMatrixSidebarFragment_product } }",
|
|
18
|
-
"
|
|
18
|
+
"e49027bc29aa10cbf7bbb0ed62239af8de1653f0": "fragment ClientManyProducts on Query { search( first: $first after: $after sort: $sort term: $term selectedFacets: $selectedFacets sponsoredCount: $sponsoredCount ) { products { pageInfo { totalCount } } } } fragment ProductSummary_product on StoreProduct { additionalProperty { name propertyID value valueReference } advertisement { adId adResponseId } brand { brandName: name } brand { name } deliveryPromiseBadges { typeName } gtin hasSpecifications image { alternateName url } isVariantOf { name productGroupID skuVariants { activeVariations allVariantsByName availableVariations slugsMap } } isVariantOf { name productGroupID skuVariants { activeVariations allVariantProducts { name productID } availableVariations slugsMap } } name offers { lowPrice lowPriceWithTaxes offers { availability listPrice listPriceWithTaxes price priceWithTaxes quantity seller { identifier } } } id: productID sku slug unitMultiplier unitMultiplier } query ClientManyProductsQuery($after: String, $first: Int!, $selectedFacets: [IStoreSelectedFacet!]!, $sort: StoreSort!, $sponsoredCount: Int, $term: String!) { search( first: $first after: $after sort: $sort term: $term selectedFacets: $selectedFacets sponsoredCount: $sponsoredCount ) { products { edges { node { ...ProductSummary_product } } pageInfo { totalCount } } } ...ClientManyProducts }",
|
|
19
19
|
"bfc40da32b60f9404a4adb96b0856e3fbb04b076": "fragment ClientProductGallery on Query { search( first: $first after: $after sort: $sort term: $term selectedFacets: $selectedFacets ) { products { pageInfo { totalCount } } } } fragment Filter_facets on StoreFacet { ... on StoreFacetBoolean { __typename key label values { label quantity selected value } } ... on StoreFacetRange { __typename key label max { absolute selected } min { absolute selected } } } fragment SearchEvent_metadata on SearchMetadata { fuzzy isTermMisspelled logicalOperator } query ClientProductGalleryQuery($after: String!, $first: Int!, $selectedFacets: [IStoreSelectedFacet!]!, $sort: StoreSort!, $term: String!) { redirect(term: $term, selectedFacets: $selectedFacets) { url } search( first: $first after: $after sort: $sort term: $term selectedFacets: $selectedFacets ) { facets { ...Filter_facets } metadata { ...SearchEvent_metadata } products { pageInfo { totalCount } } } ...ClientProductGallery }",
|
|
20
20
|
"47aa22eb750cb2c529e5eeafb921bfeadb67db71": "fragment CartProductItem on StoreProduct { additionalProperty { name propertyID value valueReference } brand { name } gtin image { alternateName url } isVariantOf { name productGroupID skuVariants { activeVariations availableVariations slugsMap } } name sku unitMultiplier } fragment ClientProduct on Query { product(locator: $locator) { id: productID } } fragment ProductDetailsFragment_product on StoreProduct { additionalProperty { name propertyID value valueReference } brand { name } description gtin image { alternateName url } isVariantOf { name productGroupID skuVariants { activeVariations allVariantProducts { name productID } availableVariations slugsMap } } name offers { lowPrice lowPriceWithTaxes offers { availability listPrice listPriceWithTaxes price priceWithTaxes seller { identifier } } } id: productID sku unitMultiplier ...CartProductItem } query ClientProductQuery($locator: [IStoreSelectedFacet!]!) { product(locator: $locator) { ...ProductDetailsFragment_product } ...ClientProduct }",
|
|
21
21
|
"b668777678c137b8c7004297df4d8b8f2b29ee06": "fragment ProductComparisonFragment_product on StoreProduct { additionalProperty { name propertyID value valueReference } advertisement { adId adResponseId } brand { name } description gtin hasSpecifications image { alternateName url } isVariantOf { name productGroupID skuVariants { activeVariations allVariantProducts { name productID } availableVariations slugsMap } } name offers { lowPrice lowPriceWithTaxes offers { availability listPrice listPriceWithTaxes price priceWithTaxes quantity seller { identifier } } } id: productID sku skuSpecifications { field { id name originalName } values { fieldId id name originalName } } slug specificationGroups { name originalName specifications { name originalName values } } unitMultiplier } query ClientManyProductsSelectedQuery($productIds: [String!]!) { products(productIds: $productIds) { ...ProductComparisonFragment_product } }",
|
|
22
22
|
"34ea14c0d4a57ddf9bc11e4be0cd2b5a6506d3d4": "query ClientProfileQuery($id: String!) { profile(id: $id) { addresses { city country geoCoordinate postalCode } } }",
|
|
23
|
-
"
|
|
23
|
+
"bbaa2ed75c4fb04842189e8d53a1d65481154e2b": "fragment ClientSearchSuggestions on Query { search(first: 5, term: $term, selectedFacets: $selectedFacets) { suggestions { terms { value } } } } fragment ProductSummary_product on StoreProduct { additionalProperty { name propertyID value valueReference } advertisement { adId adResponseId } brand { brandName: name } brand { name } deliveryPromiseBadges { typeName } gtin hasSpecifications image { alternateName url } isVariantOf { name productGroupID skuVariants { activeVariations allVariantsByName availableVariations slugsMap } } isVariantOf { name productGroupID skuVariants { activeVariations allVariantProducts { name productID } availableVariations slugsMap } } name offers { lowPrice lowPriceWithTaxes offers { availability listPrice listPriceWithTaxes price priceWithTaxes quantity seller { identifier } } } id: productID sku slug unitMultiplier unitMultiplier } fragment SearchEvent_metadata on SearchMetadata { fuzzy isTermMisspelled logicalOperator } query ClientSearchSuggestionsQuery($selectedFacets: [IStoreSelectedFacet!], $term: String!) { search(first: 5, term: $term, selectedFacets: $selectedFacets) { metadata { ...SearchEvent_metadata } products { pageInfo { totalCount } } suggestions { products { ...ProductSummary_product } terms { value } } } ...ClientSearchSuggestions }",
|
|
24
24
|
"e2385b0f11726d0068f96548f57a8dd441c064e3": "fragment ClientTopSearchSuggestions on Query { search(first: 5, term: $term, selectedFacets: $selectedFacets) { suggestions { terms { value } } } } query ClientTopSearchSuggestionsQuery($selectedFacets: [IStoreSelectedFacet!], $term: String!) { search(first: 5, term: $term, selectedFacets: $selectedFacets) { suggestions { terms { value } } } ...ClientTopSearchSuggestions }",
|
|
25
25
|
"5da2700f5a69ee8835b1cb6c69e14f4b6e12c4df": "mutation ValidateSession($search: String!, $session: IStoreSession!) { validateSession(session: $session, search: $search) { addressType b2b { customerId firstName isRepresentative lastName savedPostalCode unitId unitName userEmail userName } channel city country currency { code symbol } deliveryMode { deliveryChannel deliveryMethod deliveryWindow { endDate startDate } } geoCoordinates { latitude longitude } locale marketingData { utmCampaign utmMedium utmSource utmiCampaign utmiPage utmiPart } person { email familyName givenName id } postalCode refreshAfter } }",
|
|
26
26
|
"c35bad22f67f3eb34fea52bb49efa6b1da6b728d": "fragment ClientShippingSimulation on Query { shipping(items: $items, postalCode: $postalCode, country: $country) { address { city } } } query ClientShippingSimulationQuery($country: String!, $items: [IShippingItem!]!, $postalCode: String!) { shipping(items: $items, postalCode: $postalCode, country: $country) { address { city neighborhood state } logisticsInfo { slas { availableDeliveryWindows { endDateUtc listPrice price startDateUtc } carrier deliveryChannel localizedEstimates price shippingEstimate } } } ...ClientShippingSimulation }",
|
|
27
|
-
"
|
|
27
|
+
"4b769cda49004c85d0d427c601eba36c37a52224": "fragment ClientManyProducts on Query { search( first: $first after: $after sort: $sort term: $term selectedFacets: $selectedFacets sponsoredCount: $sponsoredCount ) { products { pageInfo { totalCount } } } } fragment ProductSummary_product on StoreProduct { additionalProperty { name propertyID value valueReference } advertisement { adId adResponseId } brand { brandName: name } brand { name } deliveryPromiseBadges { typeName } gtin hasSpecifications image { alternateName url } isVariantOf { name productGroupID skuVariants { activeVariations allVariantsByName availableVariations slugsMap } } isVariantOf { name productGroupID skuVariants { activeVariations allVariantProducts { name productID } availableVariations slugsMap } } name offers { lowPrice lowPriceWithTaxes offers { availability listPrice listPriceWithTaxes price priceWithTaxes quantity seller { identifier } } } id: productID sku slug unitMultiplier unitMultiplier } fragment SearchEvent_metadata on SearchMetadata { fuzzy isTermMisspelled logicalOperator } query ServerManyProductsQuery($after: String, $first: Int!, $selectedFacets: [IStoreSelectedFacet!]!, $sort: StoreSort!, $sponsoredCount: Int, $term: String!) { search( first: $first after: $after sort: $sort term: $term selectedFacets: $selectedFacets sponsoredCount: $sponsoredCount ) { metadata { ...SearchEvent_metadata } products { edges { node { ...ProductSummary_product } } pageInfo { totalCount } } } ...ClientManyProducts }"
|
|
28
28
|
}
|
|
@@ -165,6 +165,12 @@ type StoreCollection {
|
|
|
165
165
|
type: StoreCollectionType!
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
+
"""Delivery Promise badge."""
|
|
169
|
+
type DeliveryPromiseBadge {
|
|
170
|
+
"""Badge type."""
|
|
171
|
+
typeName: String
|
|
172
|
+
}
|
|
173
|
+
|
|
168
174
|
union StoreFacet = StoreFacetRange | StoreFacetBoolean
|
|
169
175
|
|
|
170
176
|
"""Search facet range information."""
|
|
@@ -698,6 +704,8 @@ type StoreProduct {
|
|
|
698
704
|
skuSpecifications: [SkuSpecification!]!
|
|
699
705
|
"""Indicate the specifications of a group of SKUs."""
|
|
700
706
|
specificationGroups: [SpecificationGroup!]!
|
|
707
|
+
"""Delivery Promise product's badge."""
|
|
708
|
+
deliveryPromiseBadges: [DeliveryPromiseBadge]
|
|
701
709
|
}
|
|
702
710
|
|
|
703
711
|
type SkuSpecification {
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.84.0](https://github.com/vtex/faststore/compare/v3.83.1...v3.84.0) (2025-09-09)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- Adds delivery promise badges to product card ([#2994](https://github.com/vtex/faststore/issues/2994)) ([87279c8](https://github.com/vtex/faststore/commit/87279c82a0ba83c9dffc5872b94cead98189dd23))
|
|
11
|
+
|
|
12
|
+
## [3.83.1](https://github.com/vtex/faststore/compare/v3.83.0...v3.83.1) (2025-09-09)
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
- search update ([#3015](https://github.com/vtex/faststore/issues/3015)) ([74d3261](https://github.com/vtex/faststore/commit/74d3261267e111801b6e9fd46086c8d289a83d1e))
|
|
17
|
+
|
|
6
18
|
# [3.83.0](https://github.com/vtex/faststore/compare/v3.82.4...v3.83.0) (2025-09-09)
|
|
7
19
|
|
|
8
20
|
### Features
|
|
@@ -255,6 +255,38 @@
|
|
|
255
255
|
"default": "All delivery options"
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
|
+
},
|
|
259
|
+
"deliveryPromiseBadges": {
|
|
260
|
+
"title": "Delivery Promise badges",
|
|
261
|
+
"type": "object",
|
|
262
|
+
"description": "The badges will be displayed in product cards indicating the delivery methods availability for the product.",
|
|
263
|
+
"properties": {
|
|
264
|
+
"enabled": {
|
|
265
|
+
"title": "Should display Delivery Promise badges?",
|
|
266
|
+
"type": "boolean",
|
|
267
|
+
"default": true
|
|
268
|
+
},
|
|
269
|
+
"delivery": {
|
|
270
|
+
"title": "Shipping available label",
|
|
271
|
+
"type": "string",
|
|
272
|
+
"default": "Available for shipping"
|
|
273
|
+
},
|
|
274
|
+
"deliveryUnavailable": {
|
|
275
|
+
"title": "Shipping unavailable label",
|
|
276
|
+
"type": "string",
|
|
277
|
+
"default": "Unavailable for shipping"
|
|
278
|
+
},
|
|
279
|
+
"pickupInPoint": {
|
|
280
|
+
"title": "Pickup available label",
|
|
281
|
+
"type": "string",
|
|
282
|
+
"default": "Available for pickup"
|
|
283
|
+
},
|
|
284
|
+
"pickupInPointUnavailable": {
|
|
285
|
+
"title": "Pickup unavailable label",
|
|
286
|
+
"type": "string",
|
|
287
|
+
"default": "Unavailable for pickup"
|
|
288
|
+
}
|
|
289
|
+
}
|
|
258
290
|
}
|
|
259
291
|
}
|
|
260
292
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.84.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.84.0",
|
|
48
48
|
"@faststore/graphql-utils": "^3.81.0",
|
|
49
49
|
"@faststore/lighthouse": "^3.81.0",
|
|
50
|
-
"@faststore/sdk": "^3.
|
|
51
|
-
"@faststore/ui": "^3.
|
|
50
|
+
"@faststore/sdk": "^3.83.1",
|
|
51
|
+
"@faststore/ui": "^3.84.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": "6fa29e5b0a01dab3971a688484c8ec73e1a40aad"
|
|
112
112
|
}
|
|
@@ -11,8 +11,10 @@ import type { ProductSummary_ProductFragment } from '@generated/graphql'
|
|
|
11
11
|
import type { ImageProps } from 'next/image'
|
|
12
12
|
import NextLink from 'next/link'
|
|
13
13
|
import { Image } from 'src/components/ui/Image'
|
|
14
|
+
import { useDeliveryPromise } from 'src/sdk/deliveryPromise'
|
|
14
15
|
import { useFormattedPrice } from 'src/sdk/product/useFormattedPrice'
|
|
15
16
|
import { useProductLink } from 'src/sdk/product/useProductLink'
|
|
17
|
+
import { getGlobalSettings } from 'src/utils/globalSettings'
|
|
16
18
|
|
|
17
19
|
type Variant = 'wide' | 'default'
|
|
18
20
|
|
|
@@ -99,8 +101,15 @@ function ProductCard({
|
|
|
99
101
|
lowPriceWithTaxes,
|
|
100
102
|
offers: [{ listPrice: listPriceBase, availability, listPriceWithTaxes }],
|
|
101
103
|
},
|
|
104
|
+
deliveryPromiseBadges,
|
|
102
105
|
} = product
|
|
103
106
|
|
|
107
|
+
const { deliveryPromise: deliveryPromiseSettings } = getGlobalSettings() ?? {}
|
|
108
|
+
const { badges, shouldDisplayDeliveryPromiseBadges } = useDeliveryPromise({
|
|
109
|
+
deliveryPromiseBadges,
|
|
110
|
+
deliveryPromiseSettings,
|
|
111
|
+
})
|
|
112
|
+
|
|
104
113
|
const linkProps = {
|
|
105
114
|
...useProductLink({ product, selectedOffer: 0, index }),
|
|
106
115
|
as: NextLink,
|
|
@@ -175,6 +184,7 @@ function ProductCard({
|
|
|
175
184
|
includeTaxesLabel={taxesConfiguration?.taxesLabel}
|
|
176
185
|
sponsored={!!advertisement}
|
|
177
186
|
sponsoredLabel={sponsoredLabel}
|
|
187
|
+
deliveryPromiseBadges={shouldDisplayDeliveryPromiseBadges && badges}
|
|
178
188
|
/>
|
|
179
189
|
</UIProductCard>
|
|
180
190
|
</>
|
|
@@ -258,6 +268,10 @@ export const fragment = gql(`
|
|
|
258
268
|
adId
|
|
259
269
|
adResponseId
|
|
260
270
|
}
|
|
271
|
+
|
|
272
|
+
deliveryPromiseBadges {
|
|
273
|
+
typeName
|
|
274
|
+
}
|
|
261
275
|
}
|
|
262
276
|
`)
|
|
263
277
|
|
|
@@ -10,6 +10,9 @@ import { useProductsQuery } from 'src/sdk/product/useProductsQuery'
|
|
|
10
10
|
|
|
11
11
|
import Section from '../Section'
|
|
12
12
|
|
|
13
|
+
import deepmerge from 'deepmerge'
|
|
14
|
+
import { useDeliveryPromiseFacets } from 'src/sdk/deliveryPromise/useDeliveryPromiseFacets'
|
|
15
|
+
import { overwriteMerge, toArray } from 'src/utils/utilities'
|
|
13
16
|
import styles from './section.module.scss'
|
|
14
17
|
|
|
15
18
|
interface ProductTilesProps
|
|
@@ -65,7 +68,18 @@ const ProductTiles = ({
|
|
|
65
68
|
}: ProductTilesProps) => {
|
|
66
69
|
const viewedOnce = useRef(false)
|
|
67
70
|
const { ref, inView } = useInView()
|
|
68
|
-
const
|
|
71
|
+
const { deliveryFacets } = useDeliveryPromiseFacets()
|
|
72
|
+
|
|
73
|
+
const data = useProductsQuery({
|
|
74
|
+
...variables,
|
|
75
|
+
selectedFacets: deepmerge(
|
|
76
|
+
toArray(variables.selectedFacets),
|
|
77
|
+
deliveryFacets,
|
|
78
|
+
{
|
|
79
|
+
arrayMerge: overwriteMerge,
|
|
80
|
+
}
|
|
81
|
+
),
|
|
82
|
+
})
|
|
69
83
|
const products = data?.search?.products
|
|
70
84
|
const productEdges = products?.edges ?? []
|
|
71
85
|
|
|
@@ -24,9 +24,7 @@ function SearchPage({
|
|
|
24
24
|
globalSections,
|
|
25
25
|
globalSettings,
|
|
26
26
|
}: SearchPageProps) {
|
|
27
|
-
const { pages, useGalleryPage } = useCreateUseGalleryPage(
|
|
28
|
-
searchTerm: serverData?.searchTerm,
|
|
29
|
-
})
|
|
27
|
+
const { pages, useGalleryPage } = useCreateUseGalleryPage()
|
|
30
28
|
|
|
31
29
|
const context = {
|
|
32
30
|
data: {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import dynamic from 'next/dynamic'
|
|
2
2
|
import { useEffect, useId, useRef } from 'react'
|
|
3
3
|
|
|
4
|
+
import deepmerge from 'deepmerge'
|
|
4
5
|
import { useViewItemListEvent } from 'src/sdk/analytics/hooks/useViewItemListEvent'
|
|
6
|
+
import { useDeliveryPromiseFacets } from 'src/sdk/deliveryPromise/useDeliveryPromiseFacets'
|
|
5
7
|
import { useOverrideComponents } from 'src/sdk/overrides/OverrideContext'
|
|
6
8
|
import { useProductsQuery } from 'src/sdk/product/useProductsQuery'
|
|
7
|
-
import { textToKebabCase } from 'src/utils/utilities'
|
|
8
|
-
import { useDeliveryPromiseFacets } from 'src/sdk/deliveryPromise/useDeliveryPromiseFacets'
|
|
9
|
-
import deepmerge from 'deepmerge'
|
|
9
|
+
import { overwriteMerge, textToKebabCase } from 'src/utils/utilities'
|
|
10
10
|
|
|
11
11
|
const ProductShelfSkeleton = dynamic(
|
|
12
12
|
() =>
|
|
@@ -66,11 +66,11 @@ function ProductShelf({
|
|
|
66
66
|
const { deliveryFacets } = useDeliveryPromiseFacets()
|
|
67
67
|
|
|
68
68
|
const data = useProductsQuery({
|
|
69
|
+
...otherProps,
|
|
69
70
|
first: numberOfItems,
|
|
70
71
|
selectedFacets: deepmerge(otherProps.selectedFacets, deliveryFacets, {
|
|
71
72
|
arrayMerge: overwriteMerge,
|
|
72
73
|
}),
|
|
73
|
-
...otherProps,
|
|
74
74
|
})
|
|
75
75
|
|
|
76
76
|
const products = data?.search?.products
|
|
@@ -139,6 +139,3 @@ function ProductShelf({
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
export default ProductShelf
|
|
142
|
-
|
|
143
|
-
// Array merging strategy from deepmerge that makes client arrays overwrite server array
|
|
144
|
-
const overwriteMerge = (_: any[], clientArray: any[]) => clientArray
|
package/src/pages/s.tsx
CHANGED
|
@@ -98,9 +98,8 @@ function generateSEOData(storeConfig: StoreConfig, searchTerm?: string) {
|
|
|
98
98
|
function Page({
|
|
99
99
|
page: searchContentType,
|
|
100
100
|
globalSections: globalSectionsProp,
|
|
101
|
-
searchTerm
|
|
101
|
+
searchTerm,
|
|
102
102
|
}: SearchPageProps) {
|
|
103
|
-
const router = useRouter()
|
|
104
103
|
const { sections: globalSections, settings: globalSettings } =
|
|
105
104
|
globalSectionsProp ?? {}
|
|
106
105
|
const { settings } = searchContentType
|
|
@@ -110,11 +109,6 @@ function Page({
|
|
|
110
109
|
})
|
|
111
110
|
|
|
112
111
|
const itemsPerPage = settings?.productGallery?.itemsPerPage ?? ITEMS_PER_PAGE
|
|
113
|
-
const searchTerm =
|
|
114
|
-
serverSearchTerm ??
|
|
115
|
-
(router.query?.q as string) ??
|
|
116
|
-
searchParams.term ??
|
|
117
|
-
undefined
|
|
118
112
|
|
|
119
113
|
if (!searchParams) {
|
|
120
114
|
return null
|
|
@@ -150,7 +144,10 @@ function Page({
|
|
|
150
144
|
<SearchWrapper
|
|
151
145
|
itemsPerPage={itemsPerPage}
|
|
152
146
|
searchContentType={searchContentType}
|
|
153
|
-
serverData={{
|
|
147
|
+
serverData={{
|
|
148
|
+
title: seoData.title,
|
|
149
|
+
searchTerm: searchTerm ?? searchParams.term ?? undefined,
|
|
150
|
+
}}
|
|
154
151
|
globalSections={globalSections}
|
|
155
152
|
globalSettings={globalSettings}
|
|
156
153
|
/>
|