@faststore/core 3.0.68 → 3.0.70
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/.babelrc.js +12 -0
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +93 -97
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/config.json +3 -3
- package/.next/cache/eslint/.cache_1gneedd +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/react-loadable-manifest.json +25 -13
- package/.next/required-server-files.json +1 -1
- package/.next/routes-manifest.json +1 -1
- package/.next/server/chunks/110.js +1 -0
- package/.next/server/chunks/12.js +1 -0
- package/.next/server/chunks/153.js +1 -0
- package/.next/server/chunks/187.js +1 -0
- package/.next/server/chunks/202.js +1 -0
- package/.next/server/chunks/24.js +1 -0
- package/.next/server/chunks/247.js +1 -0
- package/.next/server/chunks/344.js +1 -0
- package/.next/server/chunks/350.js +1 -0
- package/.next/server/chunks/484.js +1 -0
- package/.next/server/chunks/485.js +9 -0
- package/.next/server/chunks/493.js +1 -0
- package/.next/server/chunks/498.js +1 -0
- package/.next/server/chunks/540.js +1 -0
- package/.next/server/chunks/624.js +1 -0
- package/.next/server/chunks/640.js +6 -0
- package/.next/server/chunks/646.js +296 -0
- package/.next/server/chunks/679.js +1 -0
- package/.next/server/chunks/693.js +1 -0
- package/.next/server/chunks/716.js +2 -0
- package/.next/server/chunks/779.js +1 -0
- package/.next/server/chunks/82.js +8 -0
- package/.next/server/chunks/857.js +1 -0
- package/.next/server/chunks/859.js +6 -0
- package/.next/server/chunks/917.js +1 -0
- package/.next/server/chunks/918.js +2 -0
- package/.next/server/chunks/936.js +1 -0
- package/.next/server/chunks/945.js +1 -0
- package/.next/server/chunks/96.js +1 -0
- package/.next/server/chunks/997.js +1 -0
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/next-font-manifest.js +1 -1
- package/.next/server/next-font-manifest.json +1 -1
- 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 +1 -24
- package/.next/server/pages/[...slug].js.nft.json +1 -1
- package/.next/server/pages/[slug]/p.js +1 -144
- package/.next/server/pages/[slug]/p.js.nft.json +1 -1
- package/.next/server/pages/_app.js +1 -1
- package/.next/server/pages/_app.js.nft.json +1 -1
- package/.next/server/pages/_document.js +1 -1
- package/.next/server/pages/_document.js.nft.json +1 -1
- package/.next/server/pages/_error.js +1 -1
- package/.next/server/pages/_error.js.nft.json +1 -1
- package/.next/server/pages/account.js +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 +1 -1
- package/.next/server/pages/api/health/live.js.nft.json +1 -1
- package/.next/server/pages/api/health/ready.js +1 -1
- package/.next/server/pages/api/health/ready.js.nft.json +1 -1
- package/.next/server/pages/api/preview.js +1 -1
- package/.next/server/pages/api/preview.js.nft.json +1 -1
- package/.next/server/pages/checkout.js +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 +1 -1
- 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/server/webpack-api-runtime.js +1 -1
- package/.next/server/webpack-runtime.js +1 -1
- package/.next/static/chunks/104-e89fd47aa32b199b.js +1 -0
- package/.next/static/chunks/202.c7d8a71173edecfb.js +1 -0
- package/.next/static/chunks/217.01bc0ad07edd6f1b.js +1 -0
- package/.next/static/chunks/247.6eb0f179401e9e2f.js +1 -0
- package/.next/static/chunks/484.b82b73b1d8c37e02.js +1 -0
- package/.next/static/chunks/540.6c62d2536d42a1e0.js +1 -0
- package/.next/static/chunks/575-853fb8b1ba4ce8c4.js +14 -0
- package/.next/static/chunks/624.455cdc0925956ae5.js +1 -0
- package/.next/static/chunks/629-090bb0bb487cc6cc.js +1 -0
- package/.next/static/chunks/65.da22595d53beae76.js +1 -0
- package/.next/static/chunks/661-0ff17cbc40856afe.js +1 -0
- package/.next/static/chunks/758.9ca1da3ac30b665d.js +1 -0
- package/.next/static/chunks/857.d2299cfe995af21d.js +1 -0
- package/.next/static/chunks/main-6f63f6746cc029db.js +1 -0
- package/.next/static/chunks/pages/404-56dd2d65b7a31cf7.js +1 -0
- package/.next/static/chunks/pages/500-b3732b7fc60d28f7.js +1 -0
- package/.next/static/chunks/pages/[...slug]-484e64ab6c753be5.js +1 -0
- package/.next/static/chunks/pages/[slug]/p-a27af8a8168e7c73.js +1 -0
- package/.next/static/chunks/pages/{_app-67b609ce322eae5f.js → _app-c25fabc2435c8961.js} +2 -2
- package/.next/static/chunks/pages/_error-fbf331a03642b495.js +1 -0
- package/.next/static/chunks/pages/account-dbc5c028225cd1ac.js +1 -0
- package/.next/static/chunks/pages/checkout-29ae2c37eaf172e1.js +1 -0
- package/.next/static/chunks/pages/index-7165efe53537655d.js +1 -0
- package/.next/static/chunks/pages/login-98fbb4cd544d7a1d.js +1 -0
- package/.next/static/chunks/pages/s-d20aa04f06c65540.js +1 -0
- package/.next/static/chunks/webpack-fdd195abd12b3685.js +1 -0
- package/.next/static/css/0d45c82d8887a269.css +1 -0
- package/.next/static/css/131e3773fcbf70e4.css +1 -0
- package/.next/static/css/197e314c5a03eabd.css +1 -0
- package/.next/static/css/211c7542af66d8b4.css +1 -0
- package/.next/static/css/2980acad3f8e1028.css +1 -0
- package/.next/static/css/455d52db23e9236a.css +1 -0
- package/.next/static/css/b9d9ba1b04f3160d.css +1 -0
- package/.next/static/css/cff9aafa16fccc9c.css +1 -0
- package/.next/static/css/e32410b31c666cb2.css +1 -0
- package/.next/static/css/e47f1a002bdcf76f.css +1 -0
- package/.next/static/vO-Qkl6QJO95qdzxqerPJ/_buildManifest.js +1 -0
- package/.next/trace +95 -65
- package/.turbo/turbo-build.log +33 -40
- 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 -0
- package/next-env.d.ts +0 -1
- package/next.config.js +0 -11
- package/package.json +2 -2
- package/src/components/cart/CartItem/CartItem.tsx +8 -8
- package/src/components/sections/ProductDetails/ProductDetails.tsx +4 -4
- package/src/components/sections/ProductTiles/ProductTiles.tsx +1 -1
- 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/ProductShelf/ProductShelf.tsx +1 -1
- package/src/pages/_app.tsx +2 -2
- package/src/pages/_document.tsx +1 -1
- package/src/pages/s.tsx +20 -17
- package/{app → src}/sdk/analytics/index.tsx +0 -2
- package/src/sdk/cart/useBuyButton.ts +3 -3
- package/src/sdk/cart/useRemoveButton.ts +3 -3
- package/{app → src}/sdk/error/ErrorBoundary/ErrorBoundary.tsx +0 -2
- package/src/sdk/product/useProductGalleryQuery.ts +13 -4
- package/src/sdk/product/useProductLink.ts +2 -5
- package/src/sdk/search/Sentinel.tsx +3 -3
- package/src/sdk/search/useSuggestions.ts +1 -1
- package/tsconfig.json +2 -17
- package/.next/app-build-manifest.json +0 -26
- package/.next/app-path-routes-manifest.json +0 -1
- package/.next/cache/fetch-cache/50912854cb7c781522a6ff8792d714e549515fcbbbfd660761961b06afe01c07 +0 -1
- package/.next/server/app/_not-found.html +0 -14
- package/.next/server/app/_not-found.js +0 -1
- package/.next/server/app/_not-found.js.nft.json +0 -1
- package/.next/server/app/_not-found.meta +0 -1
- package/.next/server/app/_not-found.rsc +0 -10
- package/.next/server/app/_not-found_client-reference-manifest.js +0 -1
- package/.next/server/app/fs-next-update/page.js +0 -1
- package/.next/server/app/fs-next-update/page.js.nft.json +0 -1
- package/.next/server/app/fs-next-update/page_client-reference-manifest.js +0 -1
- package/.next/server/app/fs-next-update.html +0 -14
- package/.next/server/app/fs-next-update.meta +0 -1
- package/.next/server/app/fs-next-update.rsc +0 -10
- package/.next/server/app-paths-manifest.json +0 -4
- package/.next/server/chunks/1481.js +0 -413
- package/.next/server/chunks/1889.js +0 -8
- package/.next/server/chunks/2133.js +0 -88
- package/.next/server/chunks/223.js +0 -1
- package/.next/server/chunks/2381.js +0 -1
- package/.next/server/chunks/2534.js +0 -1
- package/.next/server/chunks/2918.js +0 -2
- package/.next/server/chunks/2957.js +0 -1
- package/.next/server/chunks/3383.js +0 -123
- package/.next/server/chunks/3716.js +0 -2
- package/.next/server/chunks/3779.js +0 -1
- package/.next/server/chunks/3969.js +0 -1
- package/.next/server/chunks/3993.js +0 -1
- package/.next/server/chunks/4222.js +0 -1
- package/.next/server/chunks/4520.js +0 -1
- package/.next/server/chunks/4930.js +0 -1
- package/.next/server/chunks/5640.js +0 -6
- package/.next/server/chunks/6058.js +0 -1
- package/.next/server/chunks/6102.js +0 -1
- package/.next/server/chunks/6305.js +0 -15
- package/.next/server/chunks/6374.js +0 -8
- package/.next/server/chunks/6693.js +0 -1
- package/.next/server/chunks/6859.js +0 -6
- package/.next/server/chunks/7035.js +0 -1
- package/.next/server/chunks/7267.js +0 -1
- package/.next/server/chunks/8158.js +0 -1
- package/.next/server/chunks/8245.js +0 -1
- package/.next/server/chunks/8635.js +0 -1
- package/.next/server/chunks/8640.js +0 -1
- package/.next/server/chunks/9679.js +0 -1
- package/.next/server/chunks/9812.js +0 -1
- package/.next/server/pages/404.html +0 -14
- package/.next/server/server-reference-manifest.js +0 -1
- package/.next/server/server-reference-manifest.json +0 -1
- package/.next/static/3UMFfxLNPHRf2Hssm8UPe/_buildManifest.js +0 -1
- package/.next/static/chunks/227.a9d04217946d7d58.js +0 -1
- package/.next/static/chunks/230.e7c7462771519885.js +0 -1
- package/.next/static/chunks/264.ea473d059252d8d7.js +0 -1
- package/.next/static/chunks/393.6dec040044142600.js +0 -1
- package/.next/static/chunks/432-eb17ca619ec04a2a.js +0 -1
- package/.next/static/chunks/470-a762f2bf2d218abf.js +0 -14
- package/.next/static/chunks/472-369461a1f39981d5.js +0 -25
- package/.next/static/chunks/590-da547057f2ae283b.js +0 -1
- package/.next/static/chunks/667.83389641ca332aef.js +0 -1
- package/.next/static/chunks/722-35290092305b1d70.js +0 -1
- package/.next/static/chunks/724.78d40a7affe1d40b.js +0 -1
- package/.next/static/chunks/853.a3933410052d23c8.js +0 -1
- package/.next/static/chunks/app/_not-found-ad3969cc0223f63a.js +0 -1
- package/.next/static/chunks/app/fs-next-update/page-ba9e117d148aa548.js +0 -1
- package/.next/static/chunks/app/layout-e6cecbfdff396848.js +0 -9
- package/.next/static/chunks/fd9d1056-43c43818840d7811.js +0 -9
- package/.next/static/chunks/main-9c9c62c368c0a47e.js +0 -1
- package/.next/static/chunks/main-app-e13fa67c2c3ceca5.js +0 -1
- package/.next/static/chunks/pages/404-be2217109dab18cf.js +0 -1
- package/.next/static/chunks/pages/500-64a07a16830e129c.js +0 -1
- package/.next/static/chunks/pages/[...slug]-56803e57882aacf2.js +0 -1
- package/.next/static/chunks/pages/[slug]/p-151221dbf6aa3115.js +0 -1
- package/.next/static/chunks/pages/_error-65ac7445167ddb62.js +0 -1
- package/.next/static/chunks/pages/account-70e52900601fc5eb.js +0 -1
- package/.next/static/chunks/pages/checkout-fe8c38b138ddecef.js +0 -1
- package/.next/static/chunks/pages/index-86dd2dba6f6f1621.js +0 -1
- package/.next/static/chunks/pages/login-258e5b7ecec36481.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/css/173705e880fb4eaf.css +0 -1
- package/.next/static/css/17e37eb991935d47.css +0 -1
- package/.next/static/css/185f3332f3d0db64.css +0 -1
- package/.next/static/css/25261a033e496803.css +0 -1
- package/.next/static/css/3eed8d7ed5000eb8.css +0 -1
- package/.next/static/css/548bab931c45c770.css +0 -1
- package/.next/static/css/5ed3f7794f0deb5a.css +0 -1
- package/.next/static/css/65f6dd6d16812461.css +0 -1
- package/.next/static/css/d6562b2ce182bbef.css +0 -1
- package/.next/static/css/ec44b650be144ada.css +0 -1
- package/.next/static/css/fa6d43e3c11a59dc.css +0 -1
- package/.next/static/media/05a31a2ca4975f99-s.woff2 +0 -0
- package/.next/static/media/513657b02c5c193f-s.woff2 +0 -0
- package/.next/static/media/51ed15f9841b9f9d-s.woff2 +0 -0
- package/.next/static/media/c9a5bc6a7c948fb0-s.p.woff2 +0 -0
- package/.next/static/media/d6b16ce4a6175f26-s.woff2 +0 -0
- package/.next/static/media/ec159349637c90ad-s.woff2 +0 -0
- package/.next/static/media/fd4db3eb5472fc27-s.woff2 +0 -0
- package/.next/types/app/fs-next-update/page.ts +0 -71
- package/.next/types/package.json +0 -1
- package/app/fs-next-update/page.tsx +0 -3
- package/app/layout.tsx +0 -98
- package/app/sdk/ui/UIProvider.tsx +0 -11
- package/app/styles/fonts/index.tsx +0 -10
- /package/.next/static/chunks/{framework-21e9365486ba23a6.js → framework-8e279965036b6169.js} +0 -0
- /package/.next/static/{3UMFfxLNPHRf2Hssm8UPe → vO-Qkl6QJO95qdzxqerPJ}/_ssgManifest.js +0 -0
- /package/{app → src}/components/ThirdPartyScripts/GoogleTagManager.tsx +0 -0
- /package/{app → src}/components/ThirdPartyScripts/ThirdPartyScripts.tsx +0 -0
- /package/{app → src}/components/ThirdPartyScripts/index.ts +0 -0
- /package/{app → src}/components/ThirdPartyScripts/vtex.tsx +0 -0
- /package/{app → src}/sdk/analytics/hooks/useViewItemListEvent.ts +0 -0
- /package/{app → src}/sdk/analytics/platform/vtex/index.ts +0 -0
- /package/{app → src}/sdk/analytics/platform/vtex/search.ts +0 -0
- /package/{app → src}/sdk/analytics/types.ts +0 -0
- /package/{app → src}/sdk/error/ErrorBoundary/index.ts +0 -0
- /package/{app → src}/utils/getCookie.ts +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -57,60 +57,53 @@ This information is used to shape Next.js' roadmap and prioritize features.
|
|
|
57
57
|
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
|
|
58
58
|
https://nextjs.org/telemetry
|
|
59
59
|
|
|
60
|
+
Browserslist: caniuse-lite is outdated. Please run:
|
|
61
|
+
npx browserslist@latest --update-db
|
|
62
|
+
Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
|
|
63
|
+
Linting and checking validity of types ...
|
|
60
64
|
Browserslist: caniuse-lite is outdated. Please run:
|
|
61
65
|
npx browserslist@latest --update-db
|
|
62
66
|
Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
|
|
63
67
|
Creating an optimized production build ...
|
|
68
|
+
Disabled SWC as replacement for Babel because of custom Babel configuration ".babelrc.js" https://nextjs.org/docs/messages/swc-disabled
|
|
69
|
+
Using external babel configuration from /home/runner/work/faststore/faststore/packages/core/.babelrc.js
|
|
64
70
|
Browserslist: caniuse-lite is outdated. Please run:
|
|
65
71
|
npx update-browserslist-db@latest
|
|
66
72
|
Why you should do it regularly: https://github.com/browserslist/update-db#readme
|
|
67
73
|
✓ Compiled successfully
|
|
68
|
-
Linting and checking validity of types ...
|
|
69
|
-
Browserslist: caniuse-lite is outdated. Please run:
|
|
70
|
-
npx browserslist@latest --update-db
|
|
71
|
-
Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
|
|
72
74
|
Collecting page data ...
|
|
73
|
-
Generating static pages (0/9) ...
|
|
74
|
-
|
|
75
75
|
Generating static pages (2/9)
|
|
76
|
+
Generating static pages (0/7) ...
|
|
77
|
+
|
|
76
78
|
Generating static pages (1/7)
|
|
77
79
|
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.
|
|
78
|
-
|
|
79
80
|
Generating static pages (4/9)
|
|
80
|
-
|
|
81
81
|
Generating static pages (6/9)
|
|
82
|
-
|
|
83
82
|
✓ Generating static pages (9/9)
|
|
83
|
+
|
|
84
84
|
Generating static pages (3/7)
|
|
85
|
+
|
|
85
86
|
Generating static pages (5/7)
|
|
87
|
+
|
|
86
88
|
✓ Generating static pages (7/7)
|
|
87
89
|
Finalizing page optimization ...
|
|
88
90
|
Collecting build traces ...
|
|
89
91
|
|
|
90
|
-
Route (app) Size First Load JS
|
|
91
|
-
┌ ○ /_not-found 876 B 83 kB
|
|
92
|
-
└ ○ /fs-next-update 138 B 82.2 kB
|
|
93
|
-
+ First Load JS shared by all 82.1 kB
|
|
94
|
-
├ chunks/472-369461a1f39981d5.js 28.4 kB
|
|
95
|
-
├ chunks/fd9d1056-43c43818840d7811.js 51.1 kB
|
|
96
|
-
├ chunks/main-app-e13fa67c2c3ceca5.js 230 B
|
|
97
|
-
└ chunks/webpack-240d066e53315260.js 2.43 kB
|
|
98
|
-
|
|
99
92
|
Route (pages) Size First Load JS
|
|
100
|
-
┌ ● / 1.
|
|
101
|
-
├ └ css/
|
|
102
|
-
├ /_app 0 B 93.
|
|
103
|
-
├ ● /[...slug] 2.
|
|
104
|
-
├ └ css/
|
|
105
|
-
├ ● /[slug]/p 10.9 kB
|
|
106
|
-
├ └ css/
|
|
107
|
-
├ ○ /404 1.
|
|
108
|
-
├ ● /500 1.
|
|
109
|
-
├ ● /account
|
|
110
|
-
├ λ /api/graphql 0 B 93.
|
|
111
|
-
├ λ /api/health/live 0 B 93.
|
|
112
|
-
├ λ /api/health/ready 0 B 93.
|
|
113
|
-
├ λ /api/preview 0 B 93.
|
|
114
|
-
├ ● /checkout
|
|
115
|
-
├ ● /login 1.
|
|
116
|
-
└ ● /s
|
|
117
|
-
+ First Load JS shared by all 96.
|
|
118
|
-
├ chunks/framework-
|
|
119
|
-
├ chunks/main-
|
|
120
|
-
├ chunks/pages/_app-
|
|
121
|
-
├ chunks/webpack-
|
|
93
|
+
┌ ● / 1.26 kB 143 kB
|
|
94
|
+
├ └ css/197e314c5a03eabd.css 740 B
|
|
95
|
+
├ /_app 0 B 93.4 kB
|
|
96
|
+
├ ● /[...slug] 2.79 kB 156 kB
|
|
97
|
+
├ └ css/e47f1a002bdcf76f.css 2.38 kB
|
|
98
|
+
├ ● /[slug]/p 10.9 kB 153 kB
|
|
99
|
+
├ └ css/455d52db23e9236a.css 9.47 kB
|
|
100
|
+
├ ○ /404 1.45 kB 127 kB
|
|
101
|
+
├ ● /500 1.45 kB 127 kB
|
|
102
|
+
├ ● /account 676 B 126 kB
|
|
103
|
+
├ λ /api/graphql 0 B 93.4 kB
|
|
104
|
+
├ λ /api/health/live 0 B 93.4 kB
|
|
105
|
+
├ λ /api/health/ready 0 B 93.4 kB
|
|
106
|
+
├ λ /api/preview 0 B 93.4 kB
|
|
107
|
+
├ ● /checkout 662 B 126 kB
|
|
108
|
+
├ ● /login 1.57 kB 127 kB
|
|
109
|
+
└ ● /s 2.25 kB 155 kB
|
|
110
|
+
+ First Load JS shared by all 96.5 kB
|
|
111
|
+
├ chunks/framework-8e279965036b6169.js 45.4 kB
|
|
112
|
+
├ chunks/main-6f63f6746cc029db.js 33.1 kB
|
|
113
|
+
├ chunks/pages/_app-c25fabc2435c8961.js 12.6 kB
|
|
114
|
+
├ chunks/webpack-fdd195abd12b3685.js 2.45 kB
|
|
122
115
|
└ css/5d1f64b61ea581f4.css 3.05 kB
|
|
123
116
|
|
|
124
117
|
λ (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/
|
|
3
|
-
PASS test/
|
|
4
|
-
PASS test/server/index.test.ts (
|
|
2
|
+
PASS test/server/cms/index.test.ts (30.313 s)
|
|
3
|
+
PASS test/utils/multipleTemplates.test.ts (30.717 s)
|
|
4
|
+
PASS test/server/index.test.ts (32.94 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.945 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/next-env.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="next" />
|
|
2
2
|
/// <reference types="next/image-types/global" />
|
|
3
|
-
/// <reference types="next/navigation-types/compat/navigation" />
|
|
4
3
|
|
|
5
4
|
// NOTE: This file should not be edited
|
|
6
5
|
// see https://nextjs.org/docs/basic-features/typescript for more information.
|
package/next.config.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
const path = require('path')
|
|
3
3
|
const storeConfig = require('./faststore.config')
|
|
4
|
-
const webpack = require('webpack')
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* @type {import('next').NextConfig}
|
|
@@ -41,16 +40,6 @@ const nextConfig = {
|
|
|
41
40
|
}
|
|
42
41
|
})
|
|
43
42
|
|
|
44
|
-
// Make css order works as expected in Next 13. See https://github.com/vercel/next.js/issues/51030#issuecomment-2005254907
|
|
45
|
-
config.plugins.push(
|
|
46
|
-
new webpack.BannerPlugin({
|
|
47
|
-
banner: '@layer base, components, theme;',
|
|
48
|
-
test: /\.css$/,
|
|
49
|
-
raw: true,
|
|
50
|
-
entryOnly: false,
|
|
51
|
-
})
|
|
52
|
-
)
|
|
53
|
-
|
|
54
43
|
// Reduce the number of chunks so we ship a smaller first bundle.
|
|
55
44
|
// This should help reducing TBT
|
|
56
45
|
if (!isServer && !dev && config.optimization?.splitChunks) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/core",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.70",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": "vtex/faststore",
|
|
6
6
|
"browserslist": "supports es6-module and not dead",
|
|
@@ -129,5 +129,5 @@
|
|
|
129
129
|
"node": "18.19.0",
|
|
130
130
|
"yarn": "1.19.1"
|
|
131
131
|
},
|
|
132
|
-
"gitHead": "
|
|
132
|
+
"gitHead": "09cdd6fbdeacc796d24738e232d660153dade68d"
|
|
133
133
|
}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
AddToCartEvent,
|
|
3
|
-
CurrencyCode,
|
|
4
|
-
RemoveFromCartEvent,
|
|
5
|
-
} from '@faststore/sdk'
|
|
6
1
|
import { sendAnalyticsEvent } from '@faststore/sdk'
|
|
7
2
|
import {
|
|
8
3
|
CartItem as UICartItem,
|
|
@@ -10,14 +5,19 @@ import {
|
|
|
10
5
|
CartItemSummary as UICartItemSummary,
|
|
11
6
|
} from '@faststore/ui'
|
|
12
7
|
import { useCallback, useMemo } from 'react'
|
|
8
|
+
import type {
|
|
9
|
+
AddToCartEvent,
|
|
10
|
+
CurrencyCode,
|
|
11
|
+
RemoveFromCartEvent,
|
|
12
|
+
} from '@faststore/sdk'
|
|
13
13
|
|
|
14
|
-
import type { AnalyticsItem } from 'app/sdk/analytics/types'
|
|
15
14
|
import { Image } from 'src/components/ui/Image'
|
|
16
|
-
import type { CartItem as ICartItem } from 'src/sdk/cart'
|
|
17
15
|
import { cartStore } from 'src/sdk/cart'
|
|
18
|
-
import { useRemoveButton } from 'src/sdk/cart/useRemoveButton'
|
|
19
16
|
import { useFormattedPrice } from 'src/sdk/product/useFormattedPrice'
|
|
20
17
|
import { useSession } from 'src/sdk/session'
|
|
18
|
+
import { useRemoveButton } from 'src/sdk/cart/useRemoveButton'
|
|
19
|
+
import type { CartItem as ICartItem } from 'src/sdk/cart'
|
|
20
|
+
import type { AnalyticsItem } from 'src/sdk/analytics/types'
|
|
21
21
|
|
|
22
22
|
function useCartItemEvent() {
|
|
23
23
|
const {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useEffect,
|
|
1
|
+
import { useEffect, useState, useMemo } from 'react'
|
|
2
2
|
|
|
3
3
|
import type { CurrencyCode, ViewItemEvent } from '@faststore/sdk'
|
|
4
4
|
import { sendAnalyticsEvent } from '@faststore/sdk'
|
|
5
5
|
|
|
6
6
|
import { gql } from '@generated'
|
|
7
|
-
import type { AnalyticsItem } from '
|
|
7
|
+
import type { AnalyticsItem } from 'src/sdk/analytics/types'
|
|
8
8
|
import { useFormattedPrice } from 'src/sdk/product/useFormattedPrice'
|
|
9
9
|
import { useSession } from 'src/sdk/session'
|
|
10
10
|
|
|
@@ -12,10 +12,10 @@ import Section from '../Section'
|
|
|
12
12
|
|
|
13
13
|
import styles from './section.module.scss'
|
|
14
14
|
|
|
15
|
-
import { useOverrideComponents } from '../../../sdk/overrides/OverrideContext'
|
|
16
15
|
import { usePDP } from '../../../sdk/overrides/PageProvider'
|
|
17
|
-
import {
|
|
16
|
+
import { useOverrideComponents } from '../../../sdk/overrides/OverrideContext'
|
|
18
17
|
import { ProductDetailsDefaultComponents } from './DefaultComponents'
|
|
18
|
+
import { getOverridableSection } from '../../../sdk/overrides/getOverriddenSection'
|
|
19
19
|
|
|
20
20
|
export interface ProductDetailsProps {
|
|
21
21
|
productTitle: {
|
|
@@ -2,10 +2,10 @@ import { useEffect, useRef } from 'react'
|
|
|
2
2
|
import { useInView } from 'react-intersection-observer'
|
|
3
3
|
|
|
4
4
|
import type { ClientManyProductsQueryQueryVariables } from '@generated/graphql'
|
|
5
|
-
import { useViewItemListEvent } from 'app/sdk/analytics/hooks/useViewItemListEvent'
|
|
6
5
|
import ProductCard from 'src/components/product/ProductCard'
|
|
7
6
|
import ProductTilesSkeleton from 'src/components/skeletons/ProductTilesSkeleton'
|
|
8
7
|
import Tiles, { Tile } from 'src/components/ui/Tiles'
|
|
8
|
+
import { useViewItemListEvent } from 'src/sdk/analytics/hooks/useViewItemListEvent'
|
|
9
9
|
import { useProductsQuery } from 'src/sdk/product/useProductsQuery'
|
|
10
10
|
|
|
11
11
|
import Section from '../Section'
|
|
@@ -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
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useEffect, useId, useRef } from 'react'
|
|
2
2
|
|
|
3
|
-
import { useViewItemListEvent } from 'app/sdk/analytics/hooks/useViewItemListEvent'
|
|
4
3
|
import ProductShelfSkeleton from 'src/components/skeletons/ProductShelfSkeleton'
|
|
4
|
+
import { useViewItemListEvent } from 'src/sdk/analytics/hooks/useViewItemListEvent'
|
|
5
5
|
import { useOverrideComponents } from 'src/sdk/overrides/OverrideContext'
|
|
6
6
|
import { useProductsQuery } from 'src/sdk/product/useProductsQuery'
|
|
7
7
|
import { textToKebabCase } from 'src/utils/utilities'
|
package/src/pages/_app.tsx
CHANGED
|
@@ -7,9 +7,9 @@ import type { AppProps } from 'next/app'
|
|
|
7
7
|
import NextNProgress from 'nextjs-progressbar'
|
|
8
8
|
|
|
9
9
|
import { UIProvider } from '@faststore/ui'
|
|
10
|
-
import AnalyticsHandler from 'app/sdk/analytics'
|
|
11
|
-
import ErrorBoundary from 'app/sdk/error/ErrorBoundary'
|
|
12
10
|
import Layout from 'src/Layout'
|
|
11
|
+
import AnalyticsHandler from 'src/sdk/analytics'
|
|
12
|
+
import ErrorBoundary from 'src/sdk/error/ErrorBoundary'
|
|
13
13
|
|
|
14
14
|
import storeConfig from '../../faststore.config'
|
|
15
15
|
|
package/src/pages/_document.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Head, Html, Main, NextScript } from 'next/document'
|
|
2
2
|
|
|
3
|
-
import ThirdPartyScripts from '
|
|
3
|
+
import ThirdPartyScripts from 'src/components/ThirdPartyScripts'
|
|
4
4
|
import { WebFonts } from 'src/customizations/src/GlobalOverrides'
|
|
5
5
|
|
|
6
6
|
function Document() {
|
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
|
)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { AddToCartEvent, CurrencyCode } from '@faststore/sdk'
|
|
2
1
|
import { sendAnalyticsEvent } from '@faststore/sdk'
|
|
3
2
|
import { useCallback } from 'react'
|
|
3
|
+
import type { CurrencyCode, AddToCartEvent } from '@faststore/sdk'
|
|
4
4
|
|
|
5
|
-
import type { AnalyticsItem } from '
|
|
5
|
+
import type { AnalyticsItem } from 'src/sdk/analytics/types'
|
|
6
6
|
import type { CartItem } from 'src/sdk/cart'
|
|
7
7
|
|
|
8
|
-
import { useUI } from '@faststore/ui'
|
|
9
8
|
import { useSession } from '../session'
|
|
9
|
+
import { useUI } from '@faststore/ui'
|
|
10
10
|
import { cartStore } from './index'
|
|
11
11
|
|
|
12
12
|
export const useBuyButton = (item: CartItem | null) => {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { CurrencyCode, RemoveFromCartEvent } from '@faststore/sdk'
|
|
2
1
|
import { sendAnalyticsEvent } from '@faststore/sdk'
|
|
3
2
|
import { useCallback } from 'react'
|
|
3
|
+
import type { CurrencyCode, RemoveFromCartEvent } from '@faststore/sdk'
|
|
4
4
|
|
|
5
|
-
import type { AnalyticsItem } from '
|
|
5
|
+
import type { AnalyticsItem } from 'src/sdk/analytics/types'
|
|
6
6
|
|
|
7
|
-
import type { CartItem } from '.'
|
|
8
7
|
import { useSession } from '../session'
|
|
9
8
|
import { cartStore } from './index'
|
|
9
|
+
import type { CartItem } from '.'
|
|
10
10
|
|
|
11
11
|
export const useRemoveButton = (item: CartItem | null) => {
|
|
12
12
|
const {
|