@faststore/core 3.0.67 → 3.0.69
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/app-build-manifest.json +3 -3
- package/.next/build-manifest.json +31 -30
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/config.json +3 -3
- package/.next/cache/eslint/.cache_1gneedd +1 -1
- package/.next/cache/fetch-cache/50912854cb7c781522a6ff8792d714e549515fcbbbfd660761961b06afe01c07 +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-minimal-server.js.nft.json +1 -1
- package/.next/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.js +1 -1
- package/.next/prerender-manifest.json +1 -1
- package/.next/routes-manifest.json +1 -1
- package/.next/server/app/_not-found.html +2 -2
- package/.next/server/app/_not-found.js.nft.json +1 -1
- package/.next/server/app/_not-found.rsc +1 -1
- package/.next/server/app/fs-next-update/page.js.nft.json +1 -1
- package/.next/server/app/fs-next-update.html +2 -2
- package/.next/server/app/fs-next-update.rsc +1 -1
- package/.next/server/chunks/1481.js +1 -1
- package/.next/server/chunks/2381.js +1 -1
- package/.next/server/chunks/3383.js +7 -4
- package/.next/server/chunks/4501.js +1 -0
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/404.html +2 -2
- package/.next/server/pages/404.js +1 -1
- package/.next/server/pages/404.js.nft.json +1 -1
- package/.next/server/pages/500.js +1 -1
- package/.next/server/pages/500.js.nft.json +1 -1
- package/.next/server/pages/[...slug].js +2 -2
- package/.next/server/pages/[...slug].js.nft.json +1 -1
- package/.next/server/pages/[slug]/p.js +4 -4
- 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.js.nft.json +1 -1
- package/.next/server/pages/api/graphql.js +1 -1
- 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 +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/index.js.nft.json +1 -1
- package/.next/server/pages/login.js +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/9mzgUpnc-9K9OkwBUwU_J/_buildManifest.js +1 -0
- package/.next/static/chunks/432-f9746c0a02be7690.js +1 -0
- package/.next/static/chunks/{722-35290092305b1d70.js → 722-35a54a587fc5345e.js} +1 -1
- package/.next/static/chunks/pages/404-73a524c217e7d675.js +1 -0
- package/.next/static/chunks/pages/500-818614ef804ffdb4.js +1 -0
- package/.next/static/chunks/pages/[slug]/p-151221dbf6aa3115.js +1 -0
- package/.next/static/chunks/pages/login-f44af0d9785a931a.js +1 -0
- package/.next/static/chunks/pages/s-ecb0e723ef7b76cc.js +1 -0
- package/.next/static/chunks/webpack-9d8f8adc92bc26a1.js +1 -0
- package/.next/trace +65 -65
- package/.turbo/turbo-build.log +7 -7
- package/.turbo/turbo-test.log +4 -4
- package/@generated/gql.ts +2 -2
- package/@generated/graphql.ts +2 -1
- package/@generated/persisted-documents.json +1 -1
- package/README.md +1 -1
- package/package.json +9 -9
- package/src/components/sections/ProductDetails/DefaultComponents.ts +2 -0
- package/src/components/sections/ProductDetails/ProductDetails.tsx +9 -6
- package/src/components/templates/SearchPage/SearchPage.tsx +4 -22
- package/src/components/templates/SearchPage/SearchWrapper.tsx +68 -0
- package/src/components/templates/SearchPage/index.ts +3 -0
- package/src/components/ui/ProductDetails/ProductDetailsSettings.tsx +0 -1
- package/src/experimental/index.ts +1 -0
- package/src/pages/s.tsx +20 -17
- package/src/sdk/product/useProductGalleryQuery.ts +8 -0
- package/src/typings/overrides.ts +1 -0
- package/.next/server/chunks/8635.js +0 -1
- package/.next/static/aEQ7uTPqGbyNQl7_gQ1Ce/_buildManifest.js +0 -1
- package/.next/static/chunks/432-eb17ca619ec04a2a.js +0 -1
- package/.next/static/chunks/pages/404-6d926d3bdc58852b.js +0 -1
- package/.next/static/chunks/pages/500-cbffc24e6eaddf18.js +0 -1
- package/.next/static/chunks/pages/[slug]/p-080b6cd39125b474.js +0 -1
- package/.next/static/chunks/pages/login-78b2d6166a2ebbaa.js +0 -1
- package/.next/static/chunks/pages/s-53cc10ba9aa8331e.js +0 -1
- package/.next/static/chunks/webpack-240d066e53315260.js +0 -1
- /package/.next/static/{aEQ7uTPqGbyNQl7_gQ1Ce → 9mzgUpnc-9K9OkwBUwU_J}/_ssgManifest.js +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -86,31 +86,31 @@ Route (app) Size First Load JS
|
|
|
86
86
|
├ chunks/472-369461a1f39981d5.js 28.4 kB
|
|
87
87
|
├ chunks/fd9d1056-43c43818840d7811.js 51.1 kB
|
|
88
88
|
├ chunks/main-app-e13fa67c2c3ceca5.js 230 B
|
|
89
|
-
└ chunks/webpack-
|
|
89
|
+
└ chunks/webpack-9d8f8adc92bc26a1.js 2.43 kB
|
|
90
90
|
|
|
91
91
|
Route (pages) Size First Load JS
|
|
92
92
|
┌ ● / 1.04 kB 148 kB
|
|
93
93
|
├ └ css/fa6d43e3c11a59dc.css 755 B
|
|
94
94
|
├ /_app 0 B 93.8 kB
|
|
95
|
-
├ ● /[...slug] 2.65 kB
|
|
95
|
+
├ ● /[...slug] 2.65 kB 161 kB
|
|
96
96
|
├ └ css/3eed8d7ed5000eb8.css 2.4 kB
|
|
97
97
|
├ ● /[slug]/p 10.9 kB 158 kB
|
|
98
98
|
├ └ css/65f6dd6d16812461.css 9.49 kB
|
|
99
|
-
├ ○ /404 1.
|
|
100
|
-
├ ● /500 1.
|
|
99
|
+
├ ○ /404 1.19 kB 131 kB
|
|
100
|
+
├ ● /500 1.19 kB 131 kB
|
|
101
101
|
├ ● /account 447 B 130 kB
|
|
102
102
|
├ λ /api/graphql 0 B 93.8 kB
|
|
103
103
|
├ λ /api/health/live 0 B 93.8 kB
|
|
104
104
|
├ λ /api/health/ready 0 B 93.8 kB
|
|
105
105
|
├ λ /api/preview 0 B 93.8 kB
|
|
106
106
|
├ ● /checkout 432 B 130 kB
|
|
107
|
-
├ ● /login 1.
|
|
108
|
-
└ ● /s 1.
|
|
107
|
+
├ ● /login 1.31 kB 131 kB
|
|
108
|
+
└ ● /s 1.94 kB 160 kB
|
|
109
109
|
+ First Load JS shared by all 96.9 kB
|
|
110
110
|
├ chunks/framework-21e9365486ba23a6.js 45.4 kB
|
|
111
111
|
├ chunks/main-9c9c62c368c0a47e.js 34.8 kB
|
|
112
112
|
├ chunks/pages/_app-67b609ce322eae5f.js 11.2 kB
|
|
113
|
-
├ chunks/webpack-
|
|
113
|
+
├ chunks/webpack-9d8f8adc92bc26a1.js 2.43 kB
|
|
114
114
|
└ css/5d1f64b61ea581f4.css 3.05 kB
|
|
115
115
|
|
|
116
116
|
λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
$ jest
|
|
2
|
-
PASS test/utils/multipleTemplates.test.ts (30.
|
|
3
|
-
PASS test/server/cms/index.test.ts (
|
|
4
|
-
PASS test/server/index.test.ts (
|
|
2
|
+
PASS test/utils/multipleTemplates.test.ts (30.945 s)
|
|
3
|
+
PASS test/server/cms/index.test.ts (30.912 s)
|
|
4
|
+
PASS test/server/index.test.ts (32.544 s)
|
|
5
5
|
|
|
6
6
|
Test Suites: 3 passed, 3 total
|
|
7
7
|
Tests: 19 passed, 19 total
|
|
8
8
|
Snapshots: 0 total
|
|
9
|
-
Time:
|
|
9
|
+
Time: 33.442 s
|
|
10
10
|
Ran all test suites.
|
package/@generated/gql.ts
CHANGED
|
@@ -44,7 +44,7 @@ const documents = {
|
|
|
44
44
|
types.SubscribeToNewsletterDocument,
|
|
45
45
|
'\n query ClientManyProductsQuery(\n $first: Int!\n $after: String\n $sort: StoreSort!\n $term: String!\n $selectedFacets: [IStoreSelectedFacet!]!\n ) {\n ...ClientManyProducts\n search(\n first: $first\n after: $after\n sort: $sort\n term: $term\n selectedFacets: $selectedFacets\n ) {\n products {\n pageInfo {\n totalCount\n }\n edges {\n node {\n ...ProductSummary_product\n }\n }\n }\n }\n }\n':
|
|
46
46
|
types.ClientManyProductsQueryDocument,
|
|
47
|
-
'\n query ClientProductGalleryQuery(\n $first: Int!\n $after: String!\n $sort: StoreSort!\n $term: String!\n $selectedFacets: [IStoreSelectedFacet!]!\n ) {\n ...ClientProductGallery\n search(\n first: $first\n after: $after\n sort: $sort\n term: $term\n selectedFacets: $selectedFacets\n ) {\n products {\n pageInfo {\n totalCount\n }\n }\n facets {\n ...Filter_facets\n }\n metadata {\n ...SearchEvent_metadata\n }\n }\n }\n':
|
|
47
|
+
'\n query ClientProductGalleryQuery(\n $first: Int!\n $after: String!\n $sort: StoreSort!\n $term: String!\n $selectedFacets: [IStoreSelectedFacet!]!\n ) {\n ...ClientProductGallery\n redirect(term: $term, selectedFacets: $selectedFacets) {\n url\n }\n search(\n first: $first\n after: $after\n sort: $sort\n term: $term\n selectedFacets: $selectedFacets\n ) {\n products {\n pageInfo {\n totalCount\n }\n }\n facets {\n ...Filter_facets\n }\n metadata {\n ...SearchEvent_metadata\n }\n }\n }\n':
|
|
48
48
|
types.ClientProductGalleryQueryDocument,
|
|
49
49
|
'\n fragment SearchEvent_metadata on SearchMetadata {\n isTermMisspelled\n logicalOperator\n fuzzy\n }\n':
|
|
50
50
|
types.SearchEvent_MetadataFragmentDoc,
|
|
@@ -160,7 +160,7 @@ export function gql(
|
|
|
160
160
|
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
161
161
|
*/
|
|
162
162
|
export function gql(
|
|
163
|
-
source: '\n query ClientProductGalleryQuery(\n $first: Int!\n $after: String!\n $sort: StoreSort!\n $term: String!\n $selectedFacets: [IStoreSelectedFacet!]!\n ) {\n ...ClientProductGallery\n search(\n first: $first\n after: $after\n sort: $sort\n term: $term\n selectedFacets: $selectedFacets\n ) {\n products {\n pageInfo {\n totalCount\n }\n }\n facets {\n ...Filter_facets\n }\n metadata {\n ...SearchEvent_metadata\n }\n }\n }\n'
|
|
163
|
+
source: '\n query ClientProductGalleryQuery(\n $first: Int!\n $after: String!\n $sort: StoreSort!\n $term: String!\n $selectedFacets: [IStoreSelectedFacet!]!\n ) {\n ...ClientProductGallery\n redirect(term: $term, selectedFacets: $selectedFacets) {\n url\n }\n search(\n first: $first\n after: $after\n sort: $sort\n term: $term\n selectedFacets: $selectedFacets\n ) {\n products {\n pageInfo {\n totalCount\n }\n }\n facets {\n ...Filter_facets\n }\n metadata {\n ...SearchEvent_metadata\n }\n }\n }\n'
|
|
164
164
|
): typeof import('./graphql').ClientProductGalleryQueryDocument
|
|
165
165
|
/**
|
|
166
166
|
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
package/@generated/graphql.ts
CHANGED
|
@@ -1430,6 +1430,7 @@ export type ClientProductGalleryQueryQueryVariables = Exact<{
|
|
|
1430
1430
|
}>
|
|
1431
1431
|
|
|
1432
1432
|
export type ClientProductGalleryQueryQuery = {
|
|
1433
|
+
redirect: { url: string | null } | null
|
|
1433
1434
|
search: {
|
|
1434
1435
|
products: { pageInfo: { totalCount: number } }
|
|
1435
1436
|
facets: Array<
|
|
@@ -2039,7 +2040,7 @@ export const ClientManyProductsQueryDocument = {
|
|
|
2039
2040
|
export const ClientProductGalleryQueryDocument = {
|
|
2040
2041
|
__meta__: {
|
|
2041
2042
|
operationName: 'ClientProductGalleryQuery',
|
|
2042
|
-
operationHash: '
|
|
2043
|
+
operationHash: 'bfc40da32b60f9404a4adb96b0856e3fbb04b076',
|
|
2043
2044
|
},
|
|
2044
2045
|
} as unknown as TypedDocumentString<
|
|
2045
2046
|
ClientProductGalleryQueryQuery,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"534fae829675533052d75fd4aa509b9cf85b4d40": "fragment CartItem on StoreOffer { itemOffered { ...CartProductItem } listPrice price quantity seller { identifier } } fragment CartMessage on StoreCartMessage { status text } 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 } mutation ValidateCartMutation($cart: IStoreCart!, $session: IStoreSession!) { validateCart(cart: $cart, session: $session) { messages { ...CartMessage } order { acceptedOffer { ...CartItem } orderNumber } } }",
|
|
5
5
|
"feb7005103a859e2bc8cf2360d568806fd88deba": "mutation SubscribeToNewsletter($data: IPersonNewsletter!) { subscribeToNewsletter(data: $data) { id } }",
|
|
6
6
|
"c0d7d2ae1d5aaae5d50eea683b389377c36fb57d": "fragment ClientManyProducts on Query { search( first: $first after: $after sort: $sort term: $term selectedFacets: $selectedFacets ) { products { pageInfo { totalCount } } } } fragment ProductSummary_product on StoreProduct { additionalProperty { name propertyID value valueReference } brand { brandName: name } brand { name } gtin image { alternateName url } isVariantOf { name productGroupID } name offers { lowPrice offers { availability listPrice price quantity seller { identifier } } } id: productID sku slug } query ClientManyProductsQuery($after: String, $first: Int!, $selectedFacets: [IStoreSelectedFacet!]!, $sort: StoreSort!, $term: String!) { search( first: $first after: $after sort: $sort term: $term selectedFacets: $selectedFacets ) { products { edges { node { ...ProductSummary_product } } pageInfo { totalCount } } } ...ClientManyProducts }",
|
|
7
|
-
"
|
|
7
|
+
"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 }",
|
|
8
8
|
"cedeb0c3e7ec1678400fe2ae930f5a79382fba1e": "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 availableVariations slugsMap } } name offers { lowPrice offers { availability listPrice price seller { identifier } } } id: productID sku unitMultiplier ...CartProductItem } query ClientProductQuery($locator: [IStoreSelectedFacet!]!) { product(locator: $locator) { ...ProductDetailsFragment_product } ...ClientProduct }",
|
|
9
9
|
"a8a27661f6a032e086c047339e0d0f180f0e0161": "fragment ClientSearchSuggestions on Query { search(first: 5, term: $term, selectedFacets: $selectedFacets) { suggestions { terms { value } } } } fragment ProductSummary_product on StoreProduct { additionalProperty { name propertyID value valueReference } brand { brandName: name } brand { name } gtin image { alternateName url } isVariantOf { name productGroupID } name offers { lowPrice offers { availability listPrice price quantity seller { identifier } } } id: productID sku slug } 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 }",
|
|
10
10
|
"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 }",
|
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/core",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.69",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": "vtex/faststore",
|
|
6
6
|
"browserslist": "supports es6-module and not dead",
|
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
"@envelop/graphql-jit": "^1.1.1",
|
|
41
41
|
"@envelop/parser-cache": "^2.2.0",
|
|
42
42
|
"@envelop/validation-cache": "^2.2.0",
|
|
43
|
-
"@faststore/api": "^3.0.
|
|
44
|
-
"@faststore/components": "^3.0.
|
|
45
|
-
"@faststore/graphql-utils": "^3.0.
|
|
46
|
-
"@faststore/sdk": "^3.0.
|
|
47
|
-
"@faststore/ui": "^3.0.
|
|
43
|
+
"@faststore/api": "^3.0.68",
|
|
44
|
+
"@faststore/components": "^3.0.68",
|
|
45
|
+
"@faststore/graphql-utils": "^3.0.68",
|
|
46
|
+
"@faststore/sdk": "^3.0.68",
|
|
47
|
+
"@faststore/ui": "^3.0.68",
|
|
48
48
|
"@graphql-codegen/cli": "^5.0.2",
|
|
49
49
|
"@graphql-codegen/client-preset": "^4.2.6",
|
|
50
50
|
"@graphql-codegen/typescript": "^4.0.7",
|
|
@@ -86,8 +86,8 @@
|
|
|
86
86
|
"devDependencies": {
|
|
87
87
|
"@cypress/code-coverage": "^3.12.1",
|
|
88
88
|
"@envelop/testing": "^6.0.0",
|
|
89
|
-
"@faststore/cli": "^3.0.
|
|
90
|
-
"@faststore/eslint-config": "^3.0.
|
|
89
|
+
"@faststore/cli": "^3.0.68",
|
|
90
|
+
"@faststore/eslint-config": "^3.0.68",
|
|
91
91
|
"@faststore/lighthouse": "^1.12.32",
|
|
92
92
|
"@lhci/cli": "^0.9.0",
|
|
93
93
|
"@testing-library/cypress": "^10.0.1",
|
|
@@ -129,5 +129,5 @@
|
|
|
129
129
|
"node": "18.19.0",
|
|
130
130
|
"yarn": "1.19.1"
|
|
131
131
|
},
|
|
132
|
-
"gitHead": "
|
|
132
|
+
"gitHead": "f4395a8f30148c6e354f356968f4c8947da05387"
|
|
133
133
|
}
|
|
@@ -16,6 +16,7 @@ import LocalShippingSimulation from 'src/components/ui/ShippingSimulation/Shippi
|
|
|
16
16
|
import { Image } from 'src/components/ui/Image'
|
|
17
17
|
import LocalNotAvailableButton from 'src/components/product/NotAvailableButton'
|
|
18
18
|
import LocalProductDescription from 'src/components/ui/ProductDescription'
|
|
19
|
+
import { ProductDetailsSettings as LocalProductDetailsSettings } from 'src/components/ui/ProductDetails'
|
|
19
20
|
|
|
20
21
|
export const ProductDetailsDefaultComponents = {
|
|
21
22
|
ProductTitle: UIProductTitle,
|
|
@@ -33,4 +34,5 @@ export const ProductDetailsDefaultComponents = {
|
|
|
33
34
|
__experimentalShippingSimulation: LocalShippingSimulation,
|
|
34
35
|
__experimentalNotAvailableButton: LocalNotAvailableButton,
|
|
35
36
|
__experimentalProductDescription: LocalProductDescription,
|
|
37
|
+
__experimentalProductDetailsSettings: LocalProductDetailsSettings,
|
|
36
38
|
}
|
|
@@ -8,7 +8,6 @@ import type { AnalyticsItem } from 'app/sdk/analytics/types'
|
|
|
8
8
|
import { useFormattedPrice } from 'src/sdk/product/useFormattedPrice'
|
|
9
9
|
import { useSession } from 'src/sdk/session'
|
|
10
10
|
|
|
11
|
-
import { ProductDetailsSettings } from '../../../components/ui/ProductDetails'
|
|
12
11
|
import Section from '../Section'
|
|
13
12
|
|
|
14
13
|
import styles from './section.module.scss'
|
|
@@ -82,6 +81,7 @@ function ProductDetails({
|
|
|
82
81
|
__experimentalShippingSimulation: ShippingSimulation,
|
|
83
82
|
__experimentalNotAvailableButton: NotAvailableButton,
|
|
84
83
|
__experimentalProductDescription: ProductDescription,
|
|
84
|
+
__experimentalProductDetailsSettings: ProductDetailsSettings,
|
|
85
85
|
} = useOverrideComponents<'ProductDetails'>()
|
|
86
86
|
const { currency } = useSession()
|
|
87
87
|
const context = usePDP()
|
|
@@ -182,17 +182,20 @@ function ProductDetails({
|
|
|
182
182
|
data-fs-product-details-settings
|
|
183
183
|
data-fs-product-details-section
|
|
184
184
|
>
|
|
185
|
-
<ProductDetailsSettings
|
|
186
|
-
product={product}
|
|
187
|
-
isValidating={isValidating}
|
|
185
|
+
<ProductDetailsSettings.Component
|
|
188
186
|
buyButtonTitle={buyButtonTitle}
|
|
189
|
-
quantity={quantity}
|
|
190
|
-
setQuantity={setQuantity}
|
|
191
187
|
buyButtonIcon={buyButtonIcon}
|
|
192
188
|
notAvailableButtonTitle={
|
|
193
189
|
notAvailableButtonTitle ?? NotAvailableButton.props.title
|
|
194
190
|
}
|
|
195
191
|
useUnitMultiplier={quantitySelector?.useUnitMultiplier ?? false}
|
|
192
|
+
{...ProductDetailsSettings.props}
|
|
193
|
+
// Dynamic props shouldn't be overridable
|
|
194
|
+
// This decision can be reviewed later if needed
|
|
195
|
+
quantity={quantity}
|
|
196
|
+
setQuantity={setQuantity}
|
|
197
|
+
product={product}
|
|
198
|
+
isValidating={isValidating}
|
|
196
199
|
/>
|
|
197
200
|
</section>
|
|
198
201
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { useSearch } from '@faststore/sdk'
|
|
2
1
|
import type { ComponentType } from 'react'
|
|
3
2
|
|
|
4
3
|
import RenderSections from 'src/components/cms/RenderSections'
|
|
@@ -10,7 +9,6 @@ import { OverriddenDefaultNewsletter as Newsletter } from 'src/components/sectio
|
|
|
10
9
|
import { OverriddenDefaultProductGallery as ProductGallery } from 'src/components/sections/ProductGallery/OverriddenDefaultProductGallery'
|
|
11
10
|
import { OverriddenDefaultProductShelf as ProductShelf } from 'src/components/sections/ProductShelf/OverriddenDefaultProductShelf'
|
|
12
11
|
import ProductTiles from 'src/components/sections/ProductTiles'
|
|
13
|
-
import { ITEMS_PER_PAGE } from 'src/constants'
|
|
14
12
|
import CUSTOM_COMPONENTS from 'src/customizations/src/components'
|
|
15
13
|
import { SearchPageContextType } from 'src/pages/s'
|
|
16
14
|
import PageProvider, { SearchPageContext } from 'src/sdk/overrides/PageProvider'
|
|
@@ -18,8 +16,8 @@ import {
|
|
|
18
16
|
useCreateUseGalleryPage,
|
|
19
17
|
UseGalleryPageContext,
|
|
20
18
|
} from 'src/sdk/product/usePageProductsQuery'
|
|
21
|
-
import { useProductGalleryQuery } from 'src/sdk/product/useProductGalleryQuery'
|
|
22
19
|
import { SearchContentType } from 'src/server/cms'
|
|
20
|
+
import type { ClientProductGalleryQueryQuery as ClientProductGalleryQuery } from '@generated/graphql'
|
|
23
21
|
|
|
24
22
|
/**
|
|
25
23
|
* Sections: Components imported from each store's custom components and '../components/sections' only.
|
|
@@ -38,32 +36,16 @@ const COMPONENTS: Record<string, ComponentType<any>> = {
|
|
|
38
36
|
}
|
|
39
37
|
|
|
40
38
|
export type SearchPageProps = {
|
|
41
|
-
data: SearchPageContextType
|
|
39
|
+
data: SearchPageContextType & ClientProductGalleryQuery
|
|
42
40
|
page: SearchContentType
|
|
43
41
|
}
|
|
44
42
|
|
|
45
|
-
function SearchPage({
|
|
46
|
-
page: { sections, settings },
|
|
47
|
-
data: server,
|
|
48
|
-
}: SearchPageProps) {
|
|
49
|
-
const {
|
|
50
|
-
state: { sort, term, selectedFacets },
|
|
51
|
-
} = useSearch()
|
|
52
|
-
const itemsPerPage = settings?.productGallery?.itemsPerPage ?? ITEMS_PER_PAGE
|
|
53
|
-
|
|
54
|
-
const { data: pageProductGalleryData } = useProductGalleryQuery({
|
|
55
|
-
term,
|
|
56
|
-
sort,
|
|
57
|
-
selectedFacets,
|
|
58
|
-
itemsPerPage,
|
|
59
|
-
})
|
|
60
|
-
|
|
43
|
+
function SearchPage({ page: { sections }, data: serverData }: SearchPageProps) {
|
|
61
44
|
const { pages, useGalleryPage } = useCreateUseGalleryPage()
|
|
62
45
|
|
|
63
46
|
const context = {
|
|
64
47
|
data: {
|
|
65
|
-
...
|
|
66
|
-
...pageProductGalleryData,
|
|
48
|
+
...serverData,
|
|
67
49
|
pages,
|
|
68
50
|
},
|
|
69
51
|
} as SearchPageContext
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { useRouter } from 'next/router'
|
|
2
|
+
import { useSearch } from '@faststore/sdk'
|
|
3
|
+
|
|
4
|
+
import type { SearchContentType } from 'src/server/cms'
|
|
5
|
+
import type { SearchPageContextType } from 'src/pages/s'
|
|
6
|
+
import { useProductGalleryQuery } from 'src/sdk/product/useProductGalleryQuery'
|
|
7
|
+
import Section from 'src/components/sections/Section'
|
|
8
|
+
import EmptyState from 'src/components/sections/EmptyState'
|
|
9
|
+
import ProductGalleryStyles from 'src/components/sections/ProductGallery/section.module.scss'
|
|
10
|
+
|
|
11
|
+
import SearchPage from './SearchPage'
|
|
12
|
+
|
|
13
|
+
function EmptySearch() {
|
|
14
|
+
return (
|
|
15
|
+
<Section
|
|
16
|
+
className={`${ProductGalleryStyles.section} section-product-gallery`}
|
|
17
|
+
>
|
|
18
|
+
<section data-testid="product-gallery" data-fs-product-listing>
|
|
19
|
+
<EmptyState title="" showLoader />
|
|
20
|
+
</section>
|
|
21
|
+
</Section>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type SearchWrapperProps = {
|
|
26
|
+
itemsPerPage: number
|
|
27
|
+
searchContentType: SearchContentType
|
|
28
|
+
serverData: SearchPageContextType
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default function SearchWrapper({
|
|
32
|
+
itemsPerPage,
|
|
33
|
+
searchContentType,
|
|
34
|
+
serverData,
|
|
35
|
+
}: SearchWrapperProps) {
|
|
36
|
+
const router = useRouter()
|
|
37
|
+
const {
|
|
38
|
+
state: { term, sort, selectedFacets },
|
|
39
|
+
} = useSearch()
|
|
40
|
+
const { data: pageProductGalleryData, isValidating } = useProductGalleryQuery(
|
|
41
|
+
{
|
|
42
|
+
term,
|
|
43
|
+
sort,
|
|
44
|
+
itemsPerPage,
|
|
45
|
+
selectedFacets,
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
if (isValidating || !pageProductGalleryData) {
|
|
50
|
+
return <EmptySearch />
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Redirect when there are registered Intelligent Search redirects on VTEX Admin
|
|
54
|
+
if (pageProductGalleryData?.redirect?.url) {
|
|
55
|
+
router.replace(pageProductGalleryData?.redirect?.url, null, {
|
|
56
|
+
shallow: true,
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
return <EmptySearch />
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<SearchPage
|
|
64
|
+
page={searchContentType}
|
|
65
|
+
data={{ ...serverData, ...pageProductGalleryData }}
|
|
66
|
+
/>
|
|
67
|
+
)
|
|
68
|
+
}
|
|
@@ -5,7 +5,6 @@ import type { ProductDetailsFragment_ProductFragment } from '@generated/graphql'
|
|
|
5
5
|
|
|
6
6
|
import { useBuyButton } from 'src/sdk/cart/useBuyButton'
|
|
7
7
|
import { useFormattedPrice } from 'src/sdk/product/useFormattedPrice'
|
|
8
|
-
import config from '../../../../faststore.config'
|
|
9
8
|
|
|
10
9
|
import Selectors from 'src/components/ui/SkuSelector'
|
|
11
10
|
import AddToCartLoadingSkeleton from './AddToCartLoadingSkeleton'
|
|
@@ -37,3 +37,4 @@ export { useShippingSimulation as useShippingSimulation_unstable } from '../../s
|
|
|
37
37
|
// Components
|
|
38
38
|
export { Image as Image_unstable } from '../../src/components/ui/Image'
|
|
39
39
|
export { ProfileChallenge as ProfileChallenge_unstable } from '../../src/components/auth/ProfileChallenge'
|
|
40
|
+
export { default as Selectors_unstable } from '../../src/components/ui/SkuSelector'
|
package/src/pages/s.tsx
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import { useMemo } from 'react'
|
|
2
|
+
import { NextSeo } from 'next-seo'
|
|
3
|
+
import { useRouter } from 'next/router'
|
|
4
|
+
import type { GetStaticProps } from 'next'
|
|
5
|
+
|
|
1
6
|
import type { SearchState } from '@faststore/sdk'
|
|
2
7
|
import {
|
|
3
8
|
formatSearchState,
|
|
@@ -5,9 +10,6 @@ import {
|
|
|
5
10
|
SearchProvider,
|
|
6
11
|
} from '@faststore/sdk'
|
|
7
12
|
import { SROnly as UISROnly } from '@faststore/ui'
|
|
8
|
-
import { NextSeo } from 'next-seo'
|
|
9
|
-
import { useRouter } from 'next/router'
|
|
10
|
-
import { useMemo } from 'react'
|
|
11
13
|
|
|
12
14
|
import { ITEMS_PER_PAGE } from 'src/constants'
|
|
13
15
|
import { useApplySearchState } from 'src/sdk/search/state'
|
|
@@ -15,12 +17,11 @@ import { mark } from 'src/sdk/tests/mark'
|
|
|
15
17
|
|
|
16
18
|
import { Locator } from '@vtex/client-cms'
|
|
17
19
|
import storeConfig from 'faststore.config'
|
|
18
|
-
import { GetStaticProps } from 'next'
|
|
19
20
|
import GlobalSections, {
|
|
20
21
|
getGlobalSectionsData,
|
|
21
22
|
GlobalSectionsData,
|
|
22
23
|
} from 'src/components/cms/GlobalSections'
|
|
23
|
-
import
|
|
24
|
+
import { SearchWrapper } from 'src/components/templates/SearchPage'
|
|
24
25
|
import { getPage, SearchContentType } from 'src/server/cms'
|
|
25
26
|
|
|
26
27
|
type Props = {
|
|
@@ -33,11 +34,11 @@ export interface SearchPageContextType {
|
|
|
33
34
|
searchTerm?: string
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
|
|
37
|
+
const useSearchParams = ({
|
|
38
|
+
sort: defaultSort,
|
|
39
|
+
}: {
|
|
37
40
|
sort: SearchState['sort']
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const useSearchParams = ({ sort: defaultSort }: UseSearchParams) => {
|
|
41
|
+
}) => {
|
|
41
42
|
const { asPath } = useRouter()
|
|
42
43
|
|
|
43
44
|
return useMemo(() => {
|
|
@@ -56,24 +57,19 @@ const useSearchParams = ({ sort: defaultSort }: UseSearchParams) => {
|
|
|
56
57
|
|
|
57
58
|
function Page({ page: searchContentType, globalSections }: Props) {
|
|
58
59
|
const { settings } = searchContentType
|
|
60
|
+
const applySearchState = useApplySearchState()
|
|
59
61
|
const searchParams = useSearchParams({
|
|
60
62
|
sort: settings?.productGallery?.sortBySelection as SearchState['sort'],
|
|
61
63
|
})
|
|
62
|
-
|
|
64
|
+
|
|
63
65
|
const title = 'Search Results'
|
|
64
66
|
const { description, titleTemplate } = storeConfig.seo
|
|
65
|
-
|
|
66
67
|
const itemsPerPage = settings?.productGallery?.itemsPerPage ?? ITEMS_PER_PAGE
|
|
67
68
|
|
|
68
69
|
if (!searchParams) {
|
|
69
70
|
return null
|
|
70
71
|
}
|
|
71
72
|
|
|
72
|
-
const server = {
|
|
73
|
-
title,
|
|
74
|
-
searchTerm: searchParams.term ?? undefined,
|
|
75
|
-
} as SearchPageContextType
|
|
76
|
-
|
|
77
73
|
return (
|
|
78
74
|
<GlobalSections {...globalSections}>
|
|
79
75
|
<SearchProvider
|
|
@@ -107,7 +103,14 @@ function Page({ page: searchContentType, globalSections }: Props) {
|
|
|
107
103
|
If needed, wrap your component in a <Section /> component
|
|
108
104
|
(not the HTML tag) before rendering it here.
|
|
109
105
|
*/}
|
|
110
|
-
<
|
|
106
|
+
<SearchWrapper
|
|
107
|
+
itemsPerPage={itemsPerPage}
|
|
108
|
+
searchContentType={searchContentType}
|
|
109
|
+
serverData={{
|
|
110
|
+
title,
|
|
111
|
+
searchTerm: searchParams.term ?? undefined,
|
|
112
|
+
}}
|
|
113
|
+
/>
|
|
111
114
|
</SearchProvider>
|
|
112
115
|
</GlobalSections>
|
|
113
116
|
)
|
|
@@ -27,6 +27,9 @@ export const query = gql(`
|
|
|
27
27
|
$selectedFacets: [IStoreSelectedFacet!]!
|
|
28
28
|
) {
|
|
29
29
|
...ClientProductGallery
|
|
30
|
+
redirect(term: $term, selectedFacets: $selectedFacets) {
|
|
31
|
+
url
|
|
32
|
+
}
|
|
30
33
|
search(
|
|
31
34
|
first: $first
|
|
32
35
|
after: $after
|
|
@@ -85,6 +88,11 @@ export const useProductGalleryQuery = ({
|
|
|
85
88
|
return useQuery<Query, Variables>(query, localizedVariables, {
|
|
86
89
|
onSuccess: (data) => {
|
|
87
90
|
if (data) {
|
|
91
|
+
// Cancel query onSuccess event when redirecting
|
|
92
|
+
if (data?.redirect?.url) {
|
|
93
|
+
return
|
|
94
|
+
}
|
|
95
|
+
|
|
88
96
|
const fuzzyFacetValue = findFacetValue(selectedFacets, 'fuzzy')
|
|
89
97
|
const operatorFacetValue = findFacetValue(selectedFacets, 'operator')
|
|
90
98
|
|
package/src/typings/overrides.ts
CHANGED
|
@@ -273,6 +273,7 @@ export type SectionsOverrides = {
|
|
|
273
273
|
__experimentalShippingSimulation: ComponentOverrideDefinition<any, any>
|
|
274
274
|
__experimentalNotAvailableButton: ComponentOverrideDefinition<any, any>
|
|
275
275
|
__experimentalProductDescription: ComponentOverrideDefinition<any, any>
|
|
276
|
+
__experimentalProductDetailsSettings: ComponentOverrideDefinition<any, any>
|
|
276
277
|
}
|
|
277
278
|
}
|
|
278
279
|
ProductGallery: {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
exports.id=8635,exports.ids=[8635],exports.modules={6133:(t,e,r)=>{"use strict";r.d(e,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var s=r(16689),a=r.n(s);let __WEBPACK_DEFAULT_EXPORT__=function({testId:t="fs-empty-state",title:e,titleIcon:r,variant:s="default",bkgColor:o="default",children:n,...i}){return a().createElement("section",{"data-fs-empty-state":!0,"data-fs-empty-state-variant":s,"data-fs-empty-state-bkg-color":o,"data-fs-content":"empty-state","data-testid":t,...i},e&&a().createElement("header",{"data-fs-empty-state-title":!0},r&&a().createElement(a().Fragment,null,r),a().createElement("p",null,e)),n)}},28474:t=>{t.exports={section:"section_section__KG_b8",load:"section_load__DKeod"}},28635:(t,e,r)=>{"use strict";r.d(e,{C:()=>E});var s=r(16152),a=r(20997),o=r(11163),n=r(2614),i=r(83982),l=r(26315),c=r(14129),d=r(28474),p=r.n(d),m=r(6133);let _={EmptyState:m.Z},useErrorState=()=>{let t=(0,o.useRouter)(),{query:{errorId:e,fromUrl:r},pathname:s,asPath:a}=t;return{errorId:e,fromUrl:r??a??s}},u=(0,s.B)("EmptyState",function({title:t,titleIcon:e,children:r,subtitle:s,errorState:o,showLoader:d=!1}){let{EmptyState:m}=(0,l.r3)(),{errorId:_,fromUrl:u}=useErrorState(),E=e?.icon?a.jsx(n.Z,{name:e?.icon,"aria-label":e?.alt,width:56,height:56,weight:"thin"}):m.props.titleIcon;return a.jsx(c.Z,{className:`${p().section} section-empty-state`,children:(0,a.jsxs)(m.Component,{bkgColor:"light",...m.props,title:t??m.props.title,titleIcon:E,children:[!!s&&a.jsx("h2",{children:s}),!!o?.errorId?.show&&a.jsx("p",{children:`${o?.errorId?.description} ${_}`}),!!o?.fromUrl?.show&&a.jsx("p",{children:`${o?.fromUrl?.description} ${u}`}),d&&a.jsx(i.Z,{}),r]})})},_),E=(0,s.v)({section:"EmptyState",Section:u})}};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
self.__BUILD_MANIFEST=function(s,c,a,t,e,b,d,f){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/":[s,c,a,t,e,"static/css/fa6d43e3c11a59dc.css","static/chunks/pages/index-86dd2dba6f6f1621.js"],"/404":[s,c,a,b,"static/chunks/pages/404-6d926d3bdc58852b.js"],"/500":[s,c,a,b,"static/chunks/pages/500-cbffc24e6eaddf18.js"],"/_error":["static/chunks/pages/_error-65ac7445167ddb62.js"],"/account":[s,c,a,"static/chunks/pages/account-70e52900601fc5eb.js"],"/checkout":[s,c,a,"static/chunks/pages/checkout-fe8c38b138ddecef.js"],"/login":[s,c,a,b,"static/chunks/pages/login-78b2d6166a2ebbaa.js"],"/s":[s,c,a,t,e,d,f,"static/chunks/pages/s-53cc10ba9aa8331e.js"],"/[slug]/p":[s,c,a,t,e,"static/css/65f6dd6d16812461.css","static/chunks/pages/[slug]/p-080b6cd39125b474.js"],"/[...slug]":[s,c,a,t,e,d,f,"static/css/3eed8d7ed5000eb8.css","static/chunks/pages/[...slug]-56803e57882aacf2.js"],sortedPages:["/","/404","/500","/_app","/_error","/account","/checkout","/login","/s","/[slug]/p","/[...slug]"]}}("static/chunks/470-a762f2bf2d218abf.js","static/css/25261a033e496803.css","static/chunks/432-eb17ca619ec04a2a.js","static/css/548bab931c45c770.css","static/chunks/590-da547057f2ae283b.js","static/css/ec44b650be144ada.css","static/css/185f3332f3d0db64.css","static/chunks/722-35290092305b1d70.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
|