@faststore/core 2.0.152-alpha.0 → 2.0.154-alpha.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/.turbo/turbo-build.log +6 -8
- package/CHANGELOG.md +12 -0
- package/cms/faststore/content-types.json +96 -2
- package/cms/faststore/sections.json +179 -8
- package/package.json +4 -4
- package/src/components/cms/GlobalSections.tsx +3 -25
- package/src/components/cms/RenderSections.tsx +37 -2
- package/src/components/navigation/Navbar/Navbar.tsx +14 -8
- package/src/components/product/ProductGrid/ProductGrid.tsx +8 -3
- package/src/components/search/Filter/Filter.tsx +22 -3
- package/src/components/search/Filter/FilterSlider.tsx +14 -4
- package/src/components/search/SearchDropdown/SearchDropdown.tsx +17 -7
- package/src/components/search/SearchInput/SearchInput.tsx +10 -5
- package/src/components/search/SearchTop/SearchTop.tsx +17 -3
- package/src/components/search/Sort/Sort.tsx +21 -3
- package/src/components/sections/CrossSellingShelf/CrossSellingShelf.tsx +17 -3
- package/src/components/sections/Navbar/Navbar.tsx +5 -0
- package/src/components/sections/ProductGallery/ProductGallery.tsx +44 -154
- package/src/components/sections/ProductShelf/ProductShelf.tsx +7 -76
- package/src/components/sections/Section/section.scss +0 -7
- package/src/components/ui/ProductGallery/ProductGallery.tsx +220 -0
- package/src/components/{sections → ui}/ProductGallery/ProductGalleryPage.tsx +9 -2
- package/src/components/ui/ProductGallery/index.ts +1 -0
- package/src/components/{sections → ui}/ProductShelf/Overrides.tsx +2 -2
- package/src/components/ui/ProductShelf/ProductShelf.tsx +106 -0
- package/src/components/ui/ProductShelf/index.ts +2 -0
- package/src/pages/[...slug].tsx +35 -24
- package/src/pages/s.tsx +38 -13
- package/src/sdk/search/formatSearchPath.ts +8 -1
- package/src/server/cms.ts +11 -2
- package/.next/BUILD_ID +0 -1
- package/.next/build-manifest.json +0 -132
- package/.next/cache/.tsbuildinfo +0 -1
- package/.next/cache/config.json +0 -7
- package/.next/cache/eslint/.cache_1gneedd +0 -1
- package/.next/cache/next-server.js.nft.json +0 -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/export-marker.json +0 -1
- package/.next/images-manifest.json +0 -1
- package/.next/next-server.js.nft.json +0 -1
- package/.next/package.json +0 -1
- package/.next/prerender-manifest.json +0 -1
- package/.next/react-loadable-manifest.json +0 -48
- package/.next/required-server-files.json +0 -1
- package/.next/routes-manifest.json +0 -1
- package/.next/server/chunks/104.js +0 -703
- package/.next/server/chunks/123.js +0 -58
- package/.next/server/chunks/143.js +0 -106
- package/.next/server/chunks/183.js +0 -80
- package/.next/server/chunks/247.js +0 -61
- package/.next/server/chunks/280.js +0 -324
- package/.next/server/chunks/287.js +0 -58
- package/.next/server/chunks/312.js +0 -670
- package/.next/server/chunks/336.js +0 -821
- package/.next/server/chunks/350.js +0 -142
- package/.next/server/chunks/368.js +0 -253
- package/.next/server/chunks/401.js +0 -7241
- package/.next/server/chunks/431.js +0 -7241
- package/.next/server/chunks/502.js +0 -600
- package/.next/server/chunks/557.js +0 -132
- package/.next/server/chunks/576.js +0 -80
- package/.next/server/chunks/597.js +0 -169
- package/.next/server/chunks/608.js +0 -644
- package/.next/server/chunks/644.js +0 -235
- package/.next/server/chunks/664.js +0 -3401
- package/.next/server/chunks/676.js +0 -32
- package/.next/server/chunks/701.js +0 -87
- package/.next/server/chunks/74.js +0 -2674
- package/.next/server/chunks/746.js +0 -225
- package/.next/server/chunks/82.js +0 -371
- package/.next/server/chunks/854.js +0 -72
- package/.next/server/chunks/859.js +0 -959
- package/.next/server/chunks/874.js +0 -487
- package/.next/server/chunks/886.js +0 -120
- package/.next/server/chunks/907.js +0 -1723
- package/.next/server/chunks/98.js +0 -124
- package/.next/server/chunks/font-manifest.json +0 -1
- package/.next/server/font-manifest.json +0 -1
- package/.next/server/middleware-build-manifest.js +0 -1
- package/.next/server/middleware-manifest.json +0 -6
- package/.next/server/middleware-react-loadable-manifest.js +0 -1
- package/.next/server/pages/404.js +0 -393
- package/.next/server/pages/404.js.nft.json +0 -1
- package/.next/server/pages/500.js +0 -395
- package/.next/server/pages/500.js.nft.json +0 -1
- package/.next/server/pages/[...slug].js +0 -718
- package/.next/server/pages/[...slug].js.nft.json +0 -1
- package/.next/server/pages/[slug]/p.js +0 -2458
- package/.next/server/pages/[slug]/p.js.nft.json +0 -1
- package/.next/server/pages/_app.js +0 -368
- package/.next/server/pages/_app.js.nft.json +0 -1
- package/.next/server/pages/_document.js +0 -304
- package/.next/server/pages/_document.js.nft.json +0 -1
- package/.next/server/pages/_error.js +0 -164
- package/.next/server/pages/_error.js.nft.json +0 -1
- package/.next/server/pages/account.js +0 -370
- package/.next/server/pages/account.js.nft.json +0 -1
- package/.next/server/pages/api/graphql.js +0 -315
- package/.next/server/pages/api/graphql.js.nft.json +0 -1
- package/.next/server/pages/api/preview.js +0 -118
- package/.next/server/pages/api/preview.js.nft.json +0 -1
- package/.next/server/pages/checkout.js +0 -370
- package/.next/server/pages/checkout.js.nft.json +0 -1
- package/.next/server/pages/en-US/404.html +0 -81
- package/.next/server/pages/en-US/404.json +0 -1
- package/.next/server/pages/en-US/500.html +0 -81
- package/.next/server/pages/en-US/500.json +0 -1
- package/.next/server/pages/en-US/account.html +0 -81
- package/.next/server/pages/en-US/account.json +0 -1
- package/.next/server/pages/en-US/checkout.html +0 -81
- package/.next/server/pages/en-US/checkout.json +0 -1
- package/.next/server/pages/en-US/login.html +0 -81
- package/.next/server/pages/en-US/login.json +0 -1
- package/.next/server/pages/en-US/s.html +0 -81
- package/.next/server/pages/en-US/s.json +0 -1
- package/.next/server/pages/en-US.html +0 -81
- package/.next/server/pages/en-US.json +0 -1
- package/.next/server/pages/index.js +0 -966
- package/.next/server/pages/index.js.nft.json +0 -1
- package/.next/server/pages/login.js +0 -375
- package/.next/server/pages/login.js.nft.json +0 -1
- package/.next/server/pages/s.js +0 -457
- package/.next/server/pages/s.js.nft.json +0 -1
- package/.next/server/pages-manifest.json +0 -16
- package/.next/server/webpack-api-runtime.js +0 -229
- package/.next/server/webpack-runtime.js +0 -229
- package/.next/static/chunks/143.dd8a556e6957baa1.js +0 -1
- package/.next/static/chunks/170.c17ce564bb568265.js +0 -1
- package/.next/static/chunks/226.b57e10ad9932f88c.js +0 -1
- package/.next/static/chunks/327-43715af4f3fffaf6.js +0 -1
- package/.next/static/chunks/336.0846f48eccce57e4.js +0 -1
- package/.next/static/chunks/366-c0bfd9890048babf.js +0 -1
- package/.next/static/chunks/377-61e89c711b136605.js +0 -1
- package/.next/static/chunks/391-47b923ef44945418.js +0 -1
- package/.next/static/chunks/495.8ffebac98e9475dc.js +0 -1
- package/.next/static/chunks/502.ae82de1669112b15.js +0 -1
- package/.next/static/chunks/545-1d3d08edfd2ee4c6.js +0 -1
- package/.next/static/chunks/597.c5cf3fbeae5ceb63.js +0 -1
- package/.next/static/chunks/651.7142f31ce1e052b3.js +0 -1
- package/.next/static/chunks/741.52f7fb873418346f.js +0 -1
- package/.next/static/chunks/98.97381d2021f86cd9.js +0 -1
- package/.next/static/chunks/framework-dfd14d7ce6600b03.js +0 -1
- package/.next/static/chunks/main-fd466221927468fd.js +0 -1
- package/.next/static/chunks/pages/404-459452495a0df278.js +0 -1
- package/.next/static/chunks/pages/500-008e30c48eceebed.js +0 -1
- package/.next/static/chunks/pages/[...slug]-a351612e92518155.js +0 -1
- package/.next/static/chunks/pages/[slug]/p-fa35dd93d53f75f6.js +0 -1
- package/.next/static/chunks/pages/_app-3e4e7e579cb0681a.js +0 -1
- package/.next/static/chunks/pages/_error-a7a0c1d9bfbb4f38.js +0 -1
- package/.next/static/chunks/pages/account-46263f0c100c3eae.js +0 -1
- package/.next/static/chunks/pages/checkout-20bb3710b24df3b6.js +0 -1
- package/.next/static/chunks/pages/index-49b7ee570f7cc4b7.js +0 -1
- package/.next/static/chunks/pages/login-f9d316d261fcc062.js +0 -1
- package/.next/static/chunks/pages/s-890c0c4b88484224.js +0 -1
- package/.next/static/chunks/polyfills-c67a75d1b6f99dc8.js +0 -1
- package/.next/static/chunks/webpack-976c8f7df8e3dea3.js +0 -1
- package/.next/static/css/1323734429a8aa40.css +0 -1
- package/.next/static/css/13a4da555ff5e3be.css +0 -1
- package/.next/static/css/2e00f7ba49c754b3.css +0 -1
- package/.next/static/css/7d822a137c54a781.css +0 -1
- package/.next/static/css/a0feab89b7648c5c.css +0 -1
- package/.next/static/css/a13a9f9cd349d906.css +0 -1
- package/.next/static/css/a45618030b16a245.css +0 -1
- package/.next/static/css/bde408cc006e64f8.css +0 -1
- package/.next/static/css/d462d9478ce00021.css +0 -1
- package/.next/static/css/e02cdad8fc000339.css +0 -1
- package/.next/static/d4K49oW-EfaWNefvNv5AZ/_buildManifest.js +0 -1
- package/.next/static/d4K49oW-EfaWNefvNv5AZ/_ssgManifest.js +0 -1
- package/.next/trace +0 -69
- package/public/~partytown/debug/partytown-atomics.js +0 -556
- package/public/~partytown/debug/partytown-media.js +0 -374
- package/public/~partytown/debug/partytown-sandbox-sw.js +0 -543
- package/public/~partytown/debug/partytown-sw.js +0 -59
- package/public/~partytown/debug/partytown-ww-atomics.js +0 -1789
- package/public/~partytown/debug/partytown-ww-sw.js +0 -1781
- package/public/~partytown/debug/partytown.js +0 -72
- package/public/~partytown/partytown-atomics.js +0 -2
- package/public/~partytown/partytown-media.js +0 -2
- package/public/~partytown/partytown-sw.js +0 -2
- package/public/~partytown/partytown.js +0 -2
- /package/src/components/{sections → ui}/ProductGallery/useDelayedFacets.ts +0 -0
- /package/src/components/{sections → ui}/ProductGallery/useDelayedPagination.ts +0 -0
- /package/src/components/{sections → ui}/ProductGallery/usePageProducts.ts +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -16,18 +16,16 @@ info - Collecting page data...
|
|
|
16
16
|
info - Generating static pages (0/7)
|
|
17
17
|
info - Generating static pages (1/7)
|
|
18
18
|
info - Generating static pages (3/7)
|
|
19
|
-
warn - CallToAction not found. Add a new component for this section or remove it from the CMS
|
|
20
|
-
warn - IncentivesHeader not found. Add a new component for this section or remove it from the CMS
|
|
21
19
|
info - Generating static pages (5/7)
|
|
22
20
|
info - Generating static pages (7/7)
|
|
23
21
|
info - Finalizing page optimization...
|
|
24
22
|
|
|
25
23
|
Route (pages) Size First Load JS
|
|
26
|
-
┌ ● /
|
|
24
|
+
┌ ● / 3.09 kB 126 kB
|
|
27
25
|
├ └ css/13a4da555ff5e3be.css 7.19 kB
|
|
28
26
|
├ /_app 0 B 77.9 kB
|
|
29
|
-
├ ● /[...slug]
|
|
30
|
-
├ └ css/
|
|
27
|
+
├ ● /[...slug] 10.1 kB 133 kB
|
|
28
|
+
├ └ css/6e41f1b6078c14c1.css 7.9 kB
|
|
31
29
|
├ ● /[slug]/p 11.7 kB 135 kB
|
|
32
30
|
├ └ css/d462d9478ce00021.css 10.9 kB
|
|
33
31
|
├ ○ /404 1.09 kB 113 kB
|
|
@@ -37,13 +35,13 @@ Route (pages) Size First Load JS
|
|
|
37
35
|
├ λ /api/preview 0 B 77.9 kB
|
|
38
36
|
├ ● /checkout 659 B 113 kB
|
|
39
37
|
├ ● /login 1.01 kB 113 kB
|
|
40
|
-
└ ● /s
|
|
38
|
+
└ ● /s 1.11 kB 124 kB
|
|
41
39
|
+ First Load JS shared by all 80.7 kB
|
|
42
40
|
├ chunks/framework-dfd14d7ce6600b03.js 45.3 kB
|
|
43
41
|
├ chunks/main-fd466221927468fd.js 23.9 kB
|
|
44
42
|
├ chunks/pages/_app-3e4e7e579cb0681a.js 6.43 kB
|
|
45
|
-
├ chunks/webpack-
|
|
46
|
-
└ css/
|
|
43
|
+
├ chunks/webpack-90918babbeee4949.js 2.26 kB
|
|
44
|
+
└ css/47d82dcec9a7dbc2.css 2.78 kB
|
|
47
45
|
|
|
48
46
|
λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
|
|
49
47
|
○ (Static) automatically rendered as static HTML (uses no initial props)
|
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
|
+
## [2.0.154-alpha.0](https://github.com/vtex/faststore/compare/v2.0.153-alpha.0...v2.0.154-alpha.0) (2023-05-23)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- Adjust `ProductShelf` for CMS ([#1766](https://github.com/vtex/faststore/issues/1766)) ([1798536](https://github.com/vtex/faststore/commit/1798536f60a508997616350f0b4ac6c11878dc04))
|
|
11
|
+
|
|
12
|
+
## [2.0.153-alpha.0](https://github.com/vtex/faststore/compare/v2.0.152-alpha.0...v2.0.153-alpha.0) (2023-05-23)
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
- Adds `ProductGallery` Sections + `Filter` component from CMS ([#1770](https://github.com/vtex/faststore/issues/1770)) ([3b80811](https://github.com/vtex/faststore/commit/3b808119904d68e6c848eaa4c30be050650ad2bb))
|
|
17
|
+
|
|
6
18
|
## [2.0.152-alpha.0](https://github.com/vtex/faststore/compare/v2.0.151-alpha.0...v2.0.152-alpha.0) (2023-05-23)
|
|
7
19
|
|
|
8
20
|
### Features
|
|
@@ -58,11 +58,105 @@
|
|
|
58
58
|
{
|
|
59
59
|
"id": "plp",
|
|
60
60
|
"name": "Product List Page",
|
|
61
|
-
"configurationSchemaSets": [
|
|
61
|
+
"configurationSchemaSets": [
|
|
62
|
+
{
|
|
63
|
+
"name": "Settings",
|
|
64
|
+
"configurations": [
|
|
65
|
+
{
|
|
66
|
+
"name": "productGallery",
|
|
67
|
+
"schema": {
|
|
68
|
+
"title": "Product Gallery",
|
|
69
|
+
"description": "ProductGallery options",
|
|
70
|
+
"type": "object",
|
|
71
|
+
"required": ["itemsPerPage", "sortBySelection"],
|
|
72
|
+
"properties": {
|
|
73
|
+
"itemsPerPage": {
|
|
74
|
+
"title": "Number of ProductCards per page",
|
|
75
|
+
"type": "integer",
|
|
76
|
+
"default": 12
|
|
77
|
+
},
|
|
78
|
+
"sortBySelection": {
|
|
79
|
+
"title": "Default sort by value",
|
|
80
|
+
"type": "string",
|
|
81
|
+
"default": "score_desc",
|
|
82
|
+
"enumNames": [
|
|
83
|
+
"Price, descending",
|
|
84
|
+
"Price, ascending",
|
|
85
|
+
"Top sales",
|
|
86
|
+
"Name, A-Z",
|
|
87
|
+
"Name, Z-A",
|
|
88
|
+
"Release date",
|
|
89
|
+
"Discount",
|
|
90
|
+
"Relevance"
|
|
91
|
+
],
|
|
92
|
+
"enum": [
|
|
93
|
+
"price_desc",
|
|
94
|
+
"price_asc",
|
|
95
|
+
"orders_desc",
|
|
96
|
+
"name_asc",
|
|
97
|
+
"name_desc",
|
|
98
|
+
"release_desc",
|
|
99
|
+
"discount_desc",
|
|
100
|
+
"score_desc"
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
]
|
|
62
109
|
},
|
|
63
110
|
{
|
|
64
111
|
"id": "search",
|
|
65
112
|
"name": "Search Page",
|
|
66
|
-
"configurationSchemaSets": [
|
|
113
|
+
"configurationSchemaSets": [
|
|
114
|
+
{
|
|
115
|
+
"name": "Settings",
|
|
116
|
+
"configurations": [
|
|
117
|
+
{
|
|
118
|
+
"name": "productGallery",
|
|
119
|
+
"schema": {
|
|
120
|
+
"title": "Product Gallery",
|
|
121
|
+
"description": "ProductGallery options",
|
|
122
|
+
"type": "object",
|
|
123
|
+
"required": ["itemsPerPage", "sortBySelection"],
|
|
124
|
+
"properties": {
|
|
125
|
+
"itemsPerPage": {
|
|
126
|
+
"title": "Number of ProductCards per page",
|
|
127
|
+
"type": "integer",
|
|
128
|
+
"default": 12
|
|
129
|
+
},
|
|
130
|
+
"sortBySelection": {
|
|
131
|
+
"title": "Default sort by value",
|
|
132
|
+
"type": "string",
|
|
133
|
+
"default": "score_desc",
|
|
134
|
+
"enumNames": [
|
|
135
|
+
"Price, descending",
|
|
136
|
+
"Price, ascending",
|
|
137
|
+
"Top sales",
|
|
138
|
+
"Name, A-Z",
|
|
139
|
+
"Name, Z-A",
|
|
140
|
+
"Release date",
|
|
141
|
+
"Discount",
|
|
142
|
+
"Relevance"
|
|
143
|
+
],
|
|
144
|
+
"enum": [
|
|
145
|
+
"price_desc",
|
|
146
|
+
"price_asc",
|
|
147
|
+
"orders_desc",
|
|
148
|
+
"name_asc",
|
|
149
|
+
"name_desc",
|
|
150
|
+
"release_desc",
|
|
151
|
+
"discount_desc",
|
|
152
|
+
"score_desc"
|
|
153
|
+
]
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
]
|
|
67
161
|
}
|
|
68
162
|
]
|
|
@@ -169,6 +169,39 @@
|
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
},
|
|
172
|
+
"searchInput": {
|
|
173
|
+
"title": "Search Input",
|
|
174
|
+
"description": "Search Input configurations",
|
|
175
|
+
"type": "object",
|
|
176
|
+
"required": ["sort"],
|
|
177
|
+
"properties": {
|
|
178
|
+
"sort": {
|
|
179
|
+
"title": "Results default sort value",
|
|
180
|
+
"type": "string",
|
|
181
|
+
"default": "score_desc",
|
|
182
|
+
"enumNames": [
|
|
183
|
+
"Price, descending",
|
|
184
|
+
"Price, ascending",
|
|
185
|
+
"Top sales",
|
|
186
|
+
"Name, A-Z",
|
|
187
|
+
"Name, Z-A",
|
|
188
|
+
"Release date",
|
|
189
|
+
"Discount",
|
|
190
|
+
"Relevance"
|
|
191
|
+
],
|
|
192
|
+
"enum": [
|
|
193
|
+
"price_desc",
|
|
194
|
+
"price_asc",
|
|
195
|
+
"orders_desc",
|
|
196
|
+
"name_asc",
|
|
197
|
+
"name_desc",
|
|
198
|
+
"release_desc",
|
|
199
|
+
"discount_desc",
|
|
200
|
+
"score_desc"
|
|
201
|
+
]
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
},
|
|
172
205
|
"signInButton": {
|
|
173
206
|
"title": "Sign In Button",
|
|
174
207
|
"type": "object",
|
|
@@ -801,8 +834,8 @@
|
|
|
801
834
|
],
|
|
802
835
|
"enumNames": [
|
|
803
836
|
"Discount: higher to lower",
|
|
804
|
-
"Name: Z-A",
|
|
805
837
|
"Name: A-Z",
|
|
838
|
+
"Name: Z-A",
|
|
806
839
|
"Orders: higher to lower",
|
|
807
840
|
"Price: lower to higher",
|
|
808
841
|
"Price: higher to lower",
|
|
@@ -846,15 +879,10 @@
|
|
|
846
879
|
"type": "boolean",
|
|
847
880
|
"default": true
|
|
848
881
|
},
|
|
849
|
-
"
|
|
850
|
-
"title": "
|
|
882
|
+
"bordered": {
|
|
883
|
+
"title": "Cards should be bordered?",
|
|
851
884
|
"type": "boolean",
|
|
852
885
|
"default": true
|
|
853
|
-
},
|
|
854
|
-
"buyButtonTitle": {
|
|
855
|
-
"title": "Buy Button Text",
|
|
856
|
-
"type": "string",
|
|
857
|
-
"default": "Buy"
|
|
858
886
|
}
|
|
859
887
|
}
|
|
860
888
|
}
|
|
@@ -1251,5 +1279,148 @@
|
|
|
1251
1279
|
}
|
|
1252
1280
|
}
|
|
1253
1281
|
}
|
|
1282
|
+
},
|
|
1283
|
+
{
|
|
1284
|
+
"name": "ProductGallery",
|
|
1285
|
+
"schema": {
|
|
1286
|
+
"title": "Product Gallery",
|
|
1287
|
+
"type": "object",
|
|
1288
|
+
"description": "Product Gallery configuration",
|
|
1289
|
+
"required": ["filter"],
|
|
1290
|
+
"properties": {
|
|
1291
|
+
"searchTermLabel": {
|
|
1292
|
+
"title": "Search page term label",
|
|
1293
|
+
"type": "string",
|
|
1294
|
+
"default": "Showing results for:"
|
|
1295
|
+
},
|
|
1296
|
+
"totalCountLabel": {
|
|
1297
|
+
"title": "Total count label",
|
|
1298
|
+
"type": "string",
|
|
1299
|
+
"default": "Results"
|
|
1300
|
+
},
|
|
1301
|
+
"previousPageButton": {
|
|
1302
|
+
"title": "Previous page button",
|
|
1303
|
+
"type": "object",
|
|
1304
|
+
"required": ["icon", "label"],
|
|
1305
|
+
"properties": {
|
|
1306
|
+
"icon": {
|
|
1307
|
+
"title": "Icon",
|
|
1308
|
+
"type": "object",
|
|
1309
|
+
"properties": {
|
|
1310
|
+
"icon": {
|
|
1311
|
+
"title": "Icon",
|
|
1312
|
+
"type": "string",
|
|
1313
|
+
"enumNames": ["ArrowLeft"],
|
|
1314
|
+
"enum": ["ArrowLeft"],
|
|
1315
|
+
"default": "ArrowLeft"
|
|
1316
|
+
},
|
|
1317
|
+
"alt": {
|
|
1318
|
+
"title": "Alternative label",
|
|
1319
|
+
"type": "string",
|
|
1320
|
+
"default": "Arrow Left icon"
|
|
1321
|
+
}
|
|
1322
|
+
}
|
|
1323
|
+
},
|
|
1324
|
+
"label": {
|
|
1325
|
+
"title": "Previous page button",
|
|
1326
|
+
"type": "string",
|
|
1327
|
+
"default": "Previous Page"
|
|
1328
|
+
}
|
|
1329
|
+
}
|
|
1330
|
+
},
|
|
1331
|
+
"loadMorePageButton": {
|
|
1332
|
+
"title": "Load more products Button",
|
|
1333
|
+
"type": "object",
|
|
1334
|
+
"required": ["label"],
|
|
1335
|
+
"properties": {
|
|
1336
|
+
"label": {
|
|
1337
|
+
"title": "Load more products label",
|
|
1338
|
+
"type": "string",
|
|
1339
|
+
"default": "Load more products"
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
},
|
|
1343
|
+
"filter": {
|
|
1344
|
+
"title": "Filter",
|
|
1345
|
+
"type": "object",
|
|
1346
|
+
"required": ["title", "mobileOnly"],
|
|
1347
|
+
"properties": {
|
|
1348
|
+
"title": {
|
|
1349
|
+
"title": "Filter title",
|
|
1350
|
+
"type": "string",
|
|
1351
|
+
"default": "Filters"
|
|
1352
|
+
},
|
|
1353
|
+
"mobileOnly": {
|
|
1354
|
+
"title": "Mobile Only",
|
|
1355
|
+
"type": "object",
|
|
1356
|
+
"required": [
|
|
1357
|
+
"filterButton",
|
|
1358
|
+
"clearButtonLabel",
|
|
1359
|
+
"applyButtonLabel"
|
|
1360
|
+
],
|
|
1361
|
+
"properties": {
|
|
1362
|
+
"filterButton": {
|
|
1363
|
+
"title": "Show filter button",
|
|
1364
|
+
"type": "object",
|
|
1365
|
+
"required": ["label", "icon"],
|
|
1366
|
+
"properties": {
|
|
1367
|
+
"label": {
|
|
1368
|
+
"title": "Label",
|
|
1369
|
+
"type": "string",
|
|
1370
|
+
"default": "Filters"
|
|
1371
|
+
},
|
|
1372
|
+
"icon": {
|
|
1373
|
+
"title": "Icon",
|
|
1374
|
+
"type": "object",
|
|
1375
|
+
"required": ["icon", "alt"],
|
|
1376
|
+
"properties": {
|
|
1377
|
+
"icon": {
|
|
1378
|
+
"title": "Icon",
|
|
1379
|
+
"type": "string",
|
|
1380
|
+
"enumNames": ["FadersHorizontal"],
|
|
1381
|
+
"enum": ["FadersHorizontal"],
|
|
1382
|
+
"default": "FadersHorizontal"
|
|
1383
|
+
},
|
|
1384
|
+
"alt": {
|
|
1385
|
+
"title": "Alternative label",
|
|
1386
|
+
"type": "string",
|
|
1387
|
+
"default": "Open Filters"
|
|
1388
|
+
}
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1392
|
+
},
|
|
1393
|
+
"clearButtonLabel": {
|
|
1394
|
+
"title": "Clear button label",
|
|
1395
|
+
"type": "string",
|
|
1396
|
+
"default": "Clear All"
|
|
1397
|
+
},
|
|
1398
|
+
"applyButtonLabel": {
|
|
1399
|
+
"title": "Apply button label",
|
|
1400
|
+
"type": "string",
|
|
1401
|
+
"default": "Apply"
|
|
1402
|
+
}
|
|
1403
|
+
}
|
|
1404
|
+
}
|
|
1405
|
+
}
|
|
1406
|
+
},
|
|
1407
|
+
"productCard": {
|
|
1408
|
+
"title": "Product Card Configuration",
|
|
1409
|
+
"type": "object",
|
|
1410
|
+
"properties": {
|
|
1411
|
+
"showDiscountBadge": {
|
|
1412
|
+
"title": "Show discount badge?",
|
|
1413
|
+
"type": "boolean",
|
|
1414
|
+
"default": true
|
|
1415
|
+
},
|
|
1416
|
+
"bordered": {
|
|
1417
|
+
"title": "Cards should be bordered?",
|
|
1418
|
+
"type": "boolean",
|
|
1419
|
+
"default": true
|
|
1420
|
+
}
|
|
1421
|
+
}
|
|
1422
|
+
}
|
|
1423
|
+
}
|
|
1424
|
+
}
|
|
1254
1425
|
}
|
|
1255
1426
|
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.154-alpha.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"browserslist": "supports es6-module and not dead",
|
|
6
6
|
"scripts": {
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
"@envelop/graphql-jit": "^1.1.1",
|
|
30
30
|
"@envelop/parser-cache": "^2.2.0",
|
|
31
31
|
"@envelop/validation-cache": "^2.2.0",
|
|
32
|
-
"@faststore/api": "^2.0.
|
|
32
|
+
"@faststore/api": "^2.0.154-alpha.0",
|
|
33
33
|
"@faststore/components": "^2.0.152-alpha.0",
|
|
34
34
|
"@faststore/graphql-utils": "^2.0.3-alpha.0",
|
|
35
35
|
"@faststore/sdk": "^2.0.118-alpha.0",
|
|
36
|
-
"@faststore/ui": "^2.0.
|
|
36
|
+
"@faststore/ui": "^2.0.154-alpha.0",
|
|
37
37
|
"@types/react": "^18.0.14",
|
|
38
38
|
"@vtex/client-cms": "^0.2.12",
|
|
39
39
|
"autoprefixer": "^10.4.0",
|
|
@@ -108,5 +108,5 @@
|
|
|
108
108
|
"msw": {
|
|
109
109
|
"workerDirectory": "public"
|
|
110
110
|
},
|
|
111
|
-
"gitHead": "
|
|
111
|
+
"gitHead": "f2f4fe80c11a4523ef1dd6827e6c1cf998908c24"
|
|
112
112
|
}
|
|
@@ -27,41 +27,19 @@ const COMPONENTS: Record<string, ComponentType<any>> = {
|
|
|
27
27
|
...CUSTOM_COMPONENTS,
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
const useDividedSections = (sections: Section[]) => {
|
|
31
|
-
return useMemo(() => {
|
|
32
|
-
const indexChildren = sections.findIndex(({ name }) => name === 'Children')
|
|
33
|
-
const hasChildren = indexChildren > -1
|
|
34
|
-
|
|
35
|
-
return {
|
|
36
|
-
hasChildren,
|
|
37
|
-
firstSections: hasChildren ? sections.slice(0, indexChildren) : sections,
|
|
38
|
-
...(hasChildren && { lastSections: sections.slice(indexChildren + 1) }),
|
|
39
|
-
}
|
|
40
|
-
}, [sections])
|
|
41
|
-
}
|
|
42
|
-
|
|
43
30
|
function GlobalSections({
|
|
44
31
|
children,
|
|
45
|
-
|
|
32
|
+
...otherProps
|
|
46
33
|
}: PropsWithChildren<GlobalSectionsData>) {
|
|
47
|
-
const { hasChildren, firstSections, lastSections } =
|
|
48
|
-
useDividedSections(sections)
|
|
49
|
-
|
|
50
34
|
return (
|
|
51
|
-
|
|
52
|
-
<RenderSections sections={firstSections} components={COMPONENTS} />
|
|
53
|
-
|
|
35
|
+
<RenderSections components={COMPONENTS} {...otherProps}>
|
|
54
36
|
<Toast />
|
|
55
37
|
|
|
56
38
|
<main>
|
|
57
39
|
<RegionBar className="display-mobile" />
|
|
58
40
|
{children}
|
|
59
41
|
</main>
|
|
60
|
-
|
|
61
|
-
{hasChildren && (
|
|
62
|
-
<RenderSections sections={lastSections} components={COMPONENTS} />
|
|
63
|
-
)}
|
|
64
|
-
</>
|
|
42
|
+
</RenderSections>
|
|
65
43
|
)
|
|
66
44
|
}
|
|
67
45
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import chalk from 'chalk'
|
|
2
|
-
import { ComponentType } from 'react'
|
|
2
|
+
import { ComponentType, PropsWithChildren, useMemo } from 'react'
|
|
3
3
|
|
|
4
4
|
import SectionBoundary from './SectionBoundary'
|
|
5
|
+
import { Section } from '@vtex/client-cms'
|
|
5
6
|
|
|
6
7
|
interface Props {
|
|
7
8
|
components: Record<string, ComponentType<any>>
|
|
@@ -9,7 +10,20 @@ interface Props {
|
|
|
9
10
|
context?: unknown
|
|
10
11
|
}
|
|
11
12
|
|
|
12
|
-
const
|
|
13
|
+
const useDividedSections = (sections: Section[]) => {
|
|
14
|
+
return useMemo(() => {
|
|
15
|
+
const indexChildren = sections.findIndex(({ name }) => name === 'Children')
|
|
16
|
+
const hasChildren = indexChildren > -1
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
hasChildren,
|
|
20
|
+
firstSections: hasChildren ? sections.slice(0, indexChildren) : sections,
|
|
21
|
+
...(hasChildren && { lastSections: sections.slice(indexChildren + 1) }),
|
|
22
|
+
}
|
|
23
|
+
}, [sections])
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const RenderSectionsBase = ({ sections = [], context, components }: Props) => {
|
|
13
27
|
return (
|
|
14
28
|
<>
|
|
15
29
|
{sections.map(({ name, data }, index) => {
|
|
@@ -36,4 +50,25 @@ const RenderSections = ({ sections = [], context, components }: Props) => {
|
|
|
36
50
|
)
|
|
37
51
|
}
|
|
38
52
|
|
|
53
|
+
function RenderSections({
|
|
54
|
+
children,
|
|
55
|
+
sections,
|
|
56
|
+
...otherProps
|
|
57
|
+
}: PropsWithChildren<Props>) {
|
|
58
|
+
const { hasChildren, firstSections, lastSections } =
|
|
59
|
+
useDividedSections(sections)
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<>
|
|
63
|
+
<RenderSectionsBase sections={firstSections} {...otherProps} />
|
|
64
|
+
|
|
65
|
+
{children}
|
|
66
|
+
|
|
67
|
+
{hasChildren && (
|
|
68
|
+
<RenderSectionsBase sections={lastSections} {...otherProps} />
|
|
69
|
+
)}
|
|
70
|
+
</>
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
|
|
39
74
|
export default RenderSections
|
|
@@ -1,35 +1,39 @@
|
|
|
1
1
|
import { Suspense, useRef, useState } from 'react'
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
|
-
useUI,
|
|
5
|
-
useScrollDirection,
|
|
6
4
|
Icon as UIIcon,
|
|
7
|
-
Navbar as UINavbar,
|
|
8
|
-
NavbarRow as UINavbarRow,
|
|
9
5
|
IconButton as UIIconButton,
|
|
6
|
+
Navbar as UINavbar,
|
|
10
7
|
NavbarButtons as UINavbarButtons,
|
|
11
8
|
NavbarHeader as UINavbarHeader,
|
|
9
|
+
NavbarRow as UINavbarRow,
|
|
10
|
+
useScrollDirection,
|
|
11
|
+
useUI,
|
|
12
12
|
} from '@faststore/ui'
|
|
13
13
|
|
|
14
14
|
import { mark } from 'src/sdk/tests/mark'
|
|
15
15
|
|
|
16
16
|
import CartToggle from 'src/components/cart/CartToggle'
|
|
17
|
-
import SearchInput from 'src/components/search/SearchInput'
|
|
18
17
|
import type { SearchInputRef } from 'src/components/search/SearchInput'
|
|
18
|
+
import SearchInput from 'src/components/search/SearchInput'
|
|
19
19
|
|
|
20
|
+
import { ButtonSignIn, ButtonSignInFallback } from 'src/components/ui/Button'
|
|
20
21
|
import Link from 'src/components/ui/Link'
|
|
21
22
|
import Logo from 'src/components/ui/Logo'
|
|
22
|
-
import { ButtonSignIn, ButtonSignInFallback } from 'src/components/ui/Button'
|
|
23
23
|
|
|
24
|
+
import type { NavbarProps as SectionNavbarProps } from '../../sections/Navbar'
|
|
24
25
|
import NavbarLinks from '../NavbarLinks'
|
|
25
26
|
import NavbarSlider from '../NavbarSlider'
|
|
26
|
-
import type { NavbarProps as SectionNavbarProps } from '../../sections/Navbar'
|
|
27
27
|
|
|
28
28
|
export interface NavbarProps {
|
|
29
29
|
/**
|
|
30
30
|
* Logo props.
|
|
31
31
|
*/
|
|
32
32
|
logo: SectionNavbarProps['logo']
|
|
33
|
+
/**
|
|
34
|
+
* Search Input props.
|
|
35
|
+
*/
|
|
36
|
+
searchInput: SectionNavbarProps['searchInput']
|
|
33
37
|
/**
|
|
34
38
|
* Cart props.
|
|
35
39
|
*/
|
|
@@ -65,6 +69,7 @@ export interface NavbarProps {
|
|
|
65
69
|
function Navbar({
|
|
66
70
|
cart,
|
|
67
71
|
logo,
|
|
72
|
+
searchInput,
|
|
68
73
|
home,
|
|
69
74
|
links,
|
|
70
75
|
signIn,
|
|
@@ -109,7 +114,7 @@ function Navbar({
|
|
|
109
114
|
</>
|
|
110
115
|
)}
|
|
111
116
|
|
|
112
|
-
<SearchInput />
|
|
117
|
+
<SearchInput sort={searchInput?.sort} />
|
|
113
118
|
|
|
114
119
|
<UINavbarButtons searchExpanded={searchExpanded}>
|
|
115
120
|
{searchExpanded && (
|
|
@@ -130,6 +135,7 @@ function Navbar({
|
|
|
130
135
|
testId="store-input-mobile"
|
|
131
136
|
buttonTestId="store-input-mobile-button"
|
|
132
137
|
onSearchClick={handlerExpandSearch}
|
|
138
|
+
sort={searchInput?.sort}
|
|
133
139
|
/>
|
|
134
140
|
|
|
135
141
|
<Suspense fallback={<ButtonSignInFallback />}>
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import type { ProductSummary_ProductFragment } from '@generated/graphql'
|
|
6
6
|
import ProductGridSkeleton from 'src/components/skeletons/ProductGridSkeleton'
|
|
7
7
|
|
|
8
|
-
import ProductCard from '../ProductCard'
|
|
8
|
+
import ProductCard, { ProductCardProps } from '../ProductCard'
|
|
9
9
|
|
|
10
10
|
interface Props {
|
|
11
11
|
/**
|
|
@@ -17,9 +17,13 @@ interface Props {
|
|
|
17
17
|
* Quantity of products listed.
|
|
18
18
|
*/
|
|
19
19
|
pageSize: number
|
|
20
|
+
/**
|
|
21
|
+
* CMS defined data to be used in ProductCard component.
|
|
22
|
+
*/
|
|
23
|
+
productCard?: Pick<ProductCardProps, 'showDiscountBadge' | 'bordered'>
|
|
20
24
|
}
|
|
21
25
|
|
|
22
|
-
function ProductGrid({ products, page, pageSize }: Props) {
|
|
26
|
+
function ProductGrid({ products, page, pageSize, productCard }: Props) {
|
|
23
27
|
const aspectRatio = 1
|
|
24
28
|
|
|
25
29
|
return (
|
|
@@ -33,7 +37,8 @@ function ProductGrid({ products, page, pageSize }: Props) {
|
|
|
33
37
|
<ProductCard
|
|
34
38
|
product={product}
|
|
35
39
|
index={pageSize * page + idx + 1}
|
|
36
|
-
bordered
|
|
40
|
+
bordered={productCard?.bordered}
|
|
41
|
+
showDiscountBadge={productCard?.showDiscountBadge}
|
|
37
42
|
aspectRatio={aspectRatio}
|
|
38
43
|
imgProps={{
|
|
39
44
|
width: 150,
|
|
@@ -2,12 +2,17 @@ import { gql } from '@faststore/graphql-utils'
|
|
|
2
2
|
import { useUI } from '@faststore/ui'
|
|
3
3
|
import type { Filter_FacetsFragment } from '@generated/graphql'
|
|
4
4
|
import { lazy, Suspense } from 'react'
|
|
5
|
+
import { ProductGalleryProps } from 'src/components/ui/ProductGallery/ProductGallery'
|
|
5
6
|
import FilterDesktop from './FilterDesktop'
|
|
6
7
|
import { useFilter } from './useFilter'
|
|
7
8
|
|
|
8
9
|
const FilterSlider = lazy(() => import('./FilterSlider'))
|
|
9
10
|
|
|
10
11
|
interface Props {
|
|
12
|
+
/**
|
|
13
|
+
* CMS defined data to be used in filter component.
|
|
14
|
+
*/
|
|
15
|
+
filter: ProductGalleryProps['filter']
|
|
11
16
|
/**
|
|
12
17
|
* The array that represents the details of every facet.
|
|
13
18
|
*/
|
|
@@ -19,19 +24,33 @@ interface Props {
|
|
|
19
24
|
testId?: string
|
|
20
25
|
}
|
|
21
26
|
|
|
22
|
-
function Filter({
|
|
27
|
+
function Filter({
|
|
28
|
+
facets: allFacets,
|
|
29
|
+
testId = 'fs-filter',
|
|
30
|
+
filter: filterCmsData,
|
|
31
|
+
}: Props) {
|
|
23
32
|
const filter = useFilter(allFacets)
|
|
24
33
|
const { filter: displayFilter } = useUI()
|
|
25
34
|
|
|
26
35
|
return (
|
|
27
36
|
<>
|
|
28
37
|
<div className="hidden-mobile">
|
|
29
|
-
<FilterDesktop
|
|
38
|
+
<FilterDesktop
|
|
39
|
+
{...filter}
|
|
40
|
+
testId={testId}
|
|
41
|
+
title={filterCmsData?.title}
|
|
42
|
+
/>
|
|
30
43
|
</div>
|
|
31
44
|
|
|
32
45
|
{displayFilter && (
|
|
33
46
|
<Suspense fallback={null}>
|
|
34
|
-
<FilterSlider
|
|
47
|
+
<FilterSlider
|
|
48
|
+
{...filter}
|
|
49
|
+
testId={testId}
|
|
50
|
+
title={filterCmsData?.title}
|
|
51
|
+
clearButtonLabel={filterCmsData?.mobileOnly?.clearButtonLabel}
|
|
52
|
+
applyButtonLabel={filterCmsData?.mobileOnly?.applyButtonLabel}
|
|
53
|
+
/>
|
|
35
54
|
</Suspense>
|
|
36
55
|
)}
|
|
37
56
|
</>
|