@nuvler/cli 0.5.6 → 0.5.7
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/dist/nuvler.js +49 -9
- package/dist/nuvler.js.map +1 -1
- package/dist/preview/launcher.js +4 -3
- package/dist/preview/launcher.js.map +1 -1
- package/dist/templates/nuvler-default/nuvler.theme.json +150 -7
- package/dist/templates/nuvler-default/package.json +1 -1
- package/dist/templates/nuvler-default/src/assets/not-found-cloud.png +0 -0
- package/dist/templates/nuvler-default/src/assets/not-found-cloud.svg +131 -0
- package/dist/templates/nuvler-default/src/assets/not-found-illustration.png +0 -0
- package/dist/templates/nuvler-default/src/banner-carousel.tsx +11 -0
- package/dist/templates/nuvler-default/src/carousel-frame.tsx +8 -4
- package/dist/templates/nuvler-default/src/definition.ts +2 -1
- package/dist/templates/nuvler-default/src/footer.tsx +4 -2
- package/dist/templates/nuvler-default/src/header-interactions.tsx +30 -17
- package/dist/templates/nuvler-default/src/header.tsx +25 -10
- package/dist/templates/nuvler-default/src/home.tsx +37 -25
- package/dist/templates/nuvler-default/src/index.ts +2 -0
- package/dist/templates/nuvler-default/src/not-found.tsx +29 -0
- package/dist/templates/nuvler-default/src/product-carousel.tsx +1 -1
- package/dist/templates/nuvler-default/src/product-detail-interactive.tsx +7 -1
- package/dist/templates/nuvler-default/src/product-detail.tsx +27 -5
- package/dist/templates/nuvler-default/src/products.tsx +13 -2
- package/dist/templates/nuvler-default/src/server-shell.tsx +5 -5
- package/dist/templates/nuvler-default/src/styles.d.ts +15 -0
- package/dist/templates/nuvler-default/src/theme-component.tsx +27 -8
- package/dist/templates/nuvler-default/src/theme-config.ts +12 -12
- package/dist/templates/nuvler-default/src/theme.css +1724 -169
- package/package.json +1 -1
- package/preview-host/src/main.tsx +16 -1
- package/preview-host/src/preview-path.d.mts +4 -1
- package/preview-host/src/preview-path.mjs +32 -1
- package/preview-host/vendor/theme-runtime/default-theme.tsx +41 -2
- package/preview-host/vendor/theme-runtime/index.ts +1 -1
package/dist/preview/launcher.js
CHANGED
|
@@ -9,13 +9,14 @@ async function resolvePreviewHost() {
|
|
|
9
9
|
const candidates = configured
|
|
10
10
|
? [path.resolve(configured)]
|
|
11
11
|
: [
|
|
12
|
+
// No monorepo, o preview precisa usar o host-fonte para refletir as
|
|
13
|
+
// alterações locais; a cópia empacotada fica como fallback do pacote.
|
|
14
|
+
path.resolve(currentDirectory, "../../../apps/preview-host"),
|
|
15
|
+
path.resolve(currentDirectory, "../../../../apps/preview-host"),
|
|
12
16
|
// Bundle publicado: dist/nuvler.js -> preview-host/.
|
|
13
17
|
path.resolve(currentDirectory, "../preview-host"),
|
|
14
18
|
// Módulo compilado: dist/preview/launcher.js -> preview-host/.
|
|
15
19
|
path.resolve(currentDirectory, "../../preview-host"),
|
|
16
|
-
// Fallbacks de desenvolvimento dentro do monorepo.
|
|
17
|
-
path.resolve(currentDirectory, "../../../apps/preview-host"),
|
|
18
|
-
path.resolve(currentDirectory, "../../../../apps/preview-host"),
|
|
19
20
|
];
|
|
20
21
|
for (const directory of candidates) {
|
|
21
22
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launcher.js","sourceRoot":"","sources":["../../src/preview/launcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAIzC,KAAK,UAAU,kBAAkB;IAC/B,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE,IAAI,EAAE,CAAC;IAC/D,MAAM,gBAAgB,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CA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EAAE,EAAE,eAAe,CAAC,CAAC,CAAC;IACtE,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;IAC/D,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;IAE1D,IAAI,CAAC;QACH,MAAM,SAAS,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE;YAC7D,QAAQ,EAAE,MAAM;YAChB,IAAI,EAAE,KAAK;SACZ,CAAC,CAAC;QACH,MAAM,eAAe,CACnB,WAAW,EACX,cAAc,EACd,OAAO,EACP,OAAO,CAAC,MAAM,EACd,OAAO,CAAC,KAAK,EACb,OAAO,CAAC,IAAI,CACb,CAAC;IACJ,CAAC;YAAS,CAAC;QACT,MAAM,EAAE,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACxD,CAAC;AACH,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"id": "nuvler-default",
|
|
4
4
|
"name": "Nuvler Default",
|
|
5
|
-
"version": "1.0.
|
|
5
|
+
"version": "1.0.9",
|
|
6
6
|
"runtimeVersion": "1",
|
|
7
7
|
"sdkVersion": "^1.3.3",
|
|
8
8
|
"entry": "src/theme.tsx",
|
|
@@ -15,15 +15,15 @@
|
|
|
15
15
|
"colors": {
|
|
16
16
|
"primary": "#176b3a",
|
|
17
17
|
"secondary": "#d99b31",
|
|
18
|
-
"background": "#
|
|
19
|
-
"text": "#
|
|
18
|
+
"background": "#fbfcfa",
|
|
19
|
+
"text": "#172019",
|
|
20
20
|
"primaryText": "#ffffff",
|
|
21
21
|
"secondaryText": "#18221b",
|
|
22
22
|
"accent": "#b45309",
|
|
23
23
|
"surface": "#ffffff",
|
|
24
|
-
"surfaceAlt": "#
|
|
24
|
+
"surfaceAlt": "#f4f7f3",
|
|
25
25
|
"textMuted": "#657068",
|
|
26
|
-
"border": "#
|
|
26
|
+
"border": "#dce3dc",
|
|
27
27
|
"headerBackground": "#ffffff",
|
|
28
28
|
"headerText": "#18221b",
|
|
29
29
|
"footerBackground": "#14251a",
|
|
@@ -31,7 +31,150 @@
|
|
|
31
31
|
},
|
|
32
32
|
"layout": {
|
|
33
33
|
"containerWidth": 1280,
|
|
34
|
-
"borderRadius":
|
|
35
|
-
}
|
|
34
|
+
"borderRadius": 16
|
|
35
|
+
},
|
|
36
|
+
"homeComponents": [
|
|
37
|
+
{
|
|
38
|
+
"key": "benefits",
|
|
39
|
+
"name": "Diferenciais da loja",
|
|
40
|
+
"description": "Exibe benefícios configurados pela loja em cards reutilizáveis.",
|
|
41
|
+
"category": "Destaques",
|
|
42
|
+
"schemaVersion": 1,
|
|
43
|
+
"fields": [
|
|
44
|
+
{
|
|
45
|
+
"key": "eyebrow",
|
|
46
|
+
"label": "Sobretítulo",
|
|
47
|
+
"control": "text",
|
|
48
|
+
"maxLength": 80
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"key": "title",
|
|
52
|
+
"label": "Título",
|
|
53
|
+
"control": "text",
|
|
54
|
+
"maxLength": 120
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"key": "items",
|
|
58
|
+
"label": "Diferenciais",
|
|
59
|
+
"control": "repeater",
|
|
60
|
+
"maxItems": 6,
|
|
61
|
+
"itemFields": [
|
|
62
|
+
{
|
|
63
|
+
"key": "title",
|
|
64
|
+
"label": "Título",
|
|
65
|
+
"control": "text",
|
|
66
|
+
"required": true,
|
|
67
|
+
"maxLength": 100
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"key": "description",
|
|
71
|
+
"label": "Descrição",
|
|
72
|
+
"control": "textarea",
|
|
73
|
+
"maxLength": 240
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"key": "url",
|
|
77
|
+
"label": "Link opcional",
|
|
78
|
+
"control": "url"
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"key": "brands",
|
|
86
|
+
"name": "Marcas",
|
|
87
|
+
"description": "Exibe marcas e parceiros configurados pela loja.",
|
|
88
|
+
"category": "Destaques",
|
|
89
|
+
"schemaVersion": 1,
|
|
90
|
+
"fields": [
|
|
91
|
+
{
|
|
92
|
+
"key": "eyebrow",
|
|
93
|
+
"label": "Sobretítulo",
|
|
94
|
+
"control": "text",
|
|
95
|
+
"maxLength": 80
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"key": "title",
|
|
99
|
+
"label": "Título",
|
|
100
|
+
"control": "text",
|
|
101
|
+
"maxLength": 120
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"key": "items",
|
|
105
|
+
"label": "Marcas",
|
|
106
|
+
"control": "repeater",
|
|
107
|
+
"maxItems": 20,
|
|
108
|
+
"itemFields": [
|
|
109
|
+
{
|
|
110
|
+
"key": "title",
|
|
111
|
+
"label": "Nome",
|
|
112
|
+
"control": "text",
|
|
113
|
+
"required": true,
|
|
114
|
+
"maxLength": 100
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"key": "image",
|
|
118
|
+
"label": "Logo",
|
|
119
|
+
"control": "image"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"key": "url",
|
|
123
|
+
"label": "Link opcional",
|
|
124
|
+
"control": "url"
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"key": "newsletter-form",
|
|
132
|
+
"name": "Cadastro de novidades",
|
|
133
|
+
"description": "Capta contatos para comunicações da loja.",
|
|
134
|
+
"category": "Formulários",
|
|
135
|
+
"schemaVersion": 1,
|
|
136
|
+
"fields": [
|
|
137
|
+
{
|
|
138
|
+
"key": "eyebrow",
|
|
139
|
+
"label": "Sobretítulo",
|
|
140
|
+
"control": "text",
|
|
141
|
+
"maxLength": 80
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"key": "title",
|
|
145
|
+
"label": "Título",
|
|
146
|
+
"control": "text",
|
|
147
|
+
"maxLength": 120
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"key": "description",
|
|
151
|
+
"label": "Descrição",
|
|
152
|
+
"control": "textarea",
|
|
153
|
+
"maxLength": 400
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"key": "submitLabel",
|
|
157
|
+
"label": "Texto do botão",
|
|
158
|
+
"control": "text",
|
|
159
|
+
"maxLength": 60
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"key": "successMessage",
|
|
163
|
+
"label": "Mensagem de sucesso",
|
|
164
|
+
"control": "text",
|
|
165
|
+
"maxLength": 240
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"key": "fields",
|
|
169
|
+
"label": "Campos do formulário",
|
|
170
|
+
"control": "contact-fields"
|
|
171
|
+
}
|
|
172
|
+
],
|
|
173
|
+
"action": {
|
|
174
|
+
"type": "contact.submit",
|
|
175
|
+
"formKey": "newsletter-form"
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
]
|
|
36
179
|
}
|
|
37
180
|
}
|
|
Binary file
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 420" role="img" aria-label="Nuvem triste">
|
|
2
|
+
<!--
|
|
3
|
+
SVG monocromático: toda a ilustração usa currentColor.
|
|
4
|
+
Para trocar a cor, use o SVG inline e defina CSS `color`.
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
<!-- Corpo + rosto vazado -->
|
|
8
|
+
<path
|
|
9
|
+
fill="currentColor"
|
|
10
|
+
fill-rule="evenodd"
|
|
11
|
+
clip-rule="evenodd"
|
|
12
|
+
d="
|
|
13
|
+
M124 319
|
|
14
|
+
C75 319 36 282 36 236
|
|
15
|
+
C36 195 67 161 108 155
|
|
16
|
+
C112 100 158 58 215 58
|
|
17
|
+
C242 58 267 67 287 83
|
|
18
|
+
C316 45 362 22 413 22
|
|
19
|
+
C488 22 550 77 559 148
|
|
20
|
+
C605 154 640 192 640 238
|
|
21
|
+
C640 283 603 319 556 319
|
|
22
|
+
H124 Z
|
|
23
|
+
|
|
24
|
+
M250 183
|
|
25
|
+
C239 183 232 194 232 210
|
|
26
|
+
C232 226 239 237 250 237
|
|
27
|
+
C261 237 268 226 268 210
|
|
28
|
+
C268 194 261 183 250 183 Z
|
|
29
|
+
|
|
30
|
+
M391 183
|
|
31
|
+
C380 183 373 194 373 210
|
|
32
|
+
C373 226 380 237 391 237
|
|
33
|
+
C402 237 409 226 409 210
|
|
34
|
+
C409 194 402 183 391 183 Z
|
|
35
|
+
|
|
36
|
+
M210 164
|
|
37
|
+
C224 160 238 152 250 140
|
|
38
|
+
C254 136 260 137 263 141
|
|
39
|
+
C267 145 266 151 262 155
|
|
40
|
+
C248 169 231 178 215 181
|
|
41
|
+
C210 182 206 179 205 174
|
|
42
|
+
C204 169 206 166 210 164 Z
|
|
43
|
+
|
|
44
|
+
M432 164
|
|
45
|
+
C418 160 404 152 392 140
|
|
46
|
+
C388 136 382 137 379 141
|
|
47
|
+
C375 145 376 151 380 155
|
|
48
|
+
C394 169 411 178 427 181
|
|
49
|
+
C432 182 436 179 437 174
|
|
50
|
+
C438 169 436 166 432 164 Z
|
|
51
|
+
|
|
52
|
+
M282 260
|
|
53
|
+
C292 241 307 232 321 232
|
|
54
|
+
C336 232 351 241 360 260
|
|
55
|
+
C362 265 360 270 355 272
|
|
56
|
+
C350 274 346 271 344 267
|
|
57
|
+
C338 254 330 247 321 247
|
|
58
|
+
C312 247 304 254 297 267
|
|
59
|
+
C295 271 290 274 285 272
|
|
60
|
+
C280 270 279 265 282 260 Z
|
|
61
|
+
"
|
|
62
|
+
/>
|
|
63
|
+
|
|
64
|
+
<!-- Mão esquerda com dois recortes -->
|
|
65
|
+
<path
|
|
66
|
+
fill="currentColor"
|
|
67
|
+
fill-rule="evenodd"
|
|
68
|
+
clip-rule="evenodd"
|
|
69
|
+
d="
|
|
70
|
+
M165 286
|
|
71
|
+
C165 254 190 229 222 229
|
|
72
|
+
C254 229 280 254 280 286
|
|
73
|
+
C280 316 259 339 231 344
|
|
74
|
+
C219 346 209 341 202 332
|
|
75
|
+
C195 342 184 347 172 344
|
|
76
|
+
C145 338 128 312 135 286
|
|
77
|
+
C139 270 149 258 165 250
|
|
78
|
+
V286 Z
|
|
79
|
+
|
|
80
|
+
M167 300
|
|
81
|
+
C171 297 176 298 179 302
|
|
82
|
+
C187 311 192 320 195 331
|
|
83
|
+
C196 336 193 340 188 341
|
|
84
|
+
C183 342 179 339 178 334
|
|
85
|
+
C176 326 171 317 164 310
|
|
86
|
+
C161 306 162 302 167 300 Z
|
|
87
|
+
|
|
88
|
+
M192 294
|
|
89
|
+
C196 291 201 292 204 296
|
|
90
|
+
C212 305 217 314 220 325
|
|
91
|
+
C221 330 218 334 213 335
|
|
92
|
+
C208 336 204 333 203 328
|
|
93
|
+
C201 320 196 311 189 304
|
|
94
|
+
C186 300 187 296 192 294 Z
|
|
95
|
+
"
|
|
96
|
+
/>
|
|
97
|
+
|
|
98
|
+
<!-- Mão direita com dois recortes -->
|
|
99
|
+
<path
|
|
100
|
+
fill="currentColor"
|
|
101
|
+
fill-rule="evenodd"
|
|
102
|
+
clip-rule="evenodd"
|
|
103
|
+
d="
|
|
104
|
+
M360 286
|
|
105
|
+
C360 254 386 229 418 229
|
|
106
|
+
C450 229 476 254 476 286
|
|
107
|
+
C476 316 455 339 427 344
|
|
108
|
+
C415 346 405 341 398 332
|
|
109
|
+
C391 342 380 347 368 344
|
|
110
|
+
C341 338 324 312 331 286
|
|
111
|
+
C335 270 345 258 360 250
|
|
112
|
+
V286 Z
|
|
113
|
+
|
|
114
|
+
M362 300
|
|
115
|
+
C366 297 371 298 374 302
|
|
116
|
+
C382 311 387 320 390 331
|
|
117
|
+
C391 336 388 340 383 341
|
|
118
|
+
C378 342 374 339 373 334
|
|
119
|
+
C371 326 366 317 359 310
|
|
120
|
+
C356 306 357 302 362 300 Z
|
|
121
|
+
|
|
122
|
+
M387 294
|
|
123
|
+
C391 291 396 292 399 296
|
|
124
|
+
C407 305 412 314 415 325
|
|
125
|
+
C416 330 413 334 408 335
|
|
126
|
+
C403 336 399 333 398 328
|
|
127
|
+
C396 320 391 311 384 304
|
|
128
|
+
C381 300 382 296 387 294 Z
|
|
129
|
+
"
|
|
130
|
+
/>
|
|
131
|
+
</svg>
|
|
@@ -5,6 +5,12 @@ import { ThemeImageView, type ThemeImageComponent } from "./shared.js";
|
|
|
5
5
|
|
|
6
6
|
export type ThemeBanner = ThemeHomeBanner & { imageUrl: string };
|
|
7
7
|
|
|
8
|
+
function imageAspectRatio(image: ThemeHomeBanner["image"] | null | undefined) {
|
|
9
|
+
const width = Number(image?.width);
|
|
10
|
+
const height = Number(image?.height);
|
|
11
|
+
return width > 0 && height > 0 ? width / height : null;
|
|
12
|
+
}
|
|
13
|
+
|
|
8
14
|
export function BannerCarousel({ banners, autoplay, desktopHeight = 590, mobileHeight = 420, imageFit = "COVER", priority = false, ImageComponent = ThemeImageView }: {
|
|
9
15
|
banners: ThemeBanner[];
|
|
10
16
|
autoplay: boolean;
|
|
@@ -15,9 +21,14 @@ export function BannerCarousel({ banners, autoplay, desktopHeight = 590, mobileH
|
|
|
15
21
|
ImageComponent?: ThemeImageComponent;
|
|
16
22
|
}) {
|
|
17
23
|
if (!banners.length) return null;
|
|
24
|
+
const firstBanner = banners.find((banner) => banner.image?.url || banner.imageUrl);
|
|
25
|
+
const desktopAspectRatio = imageAspectRatio(firstBanner?.image);
|
|
26
|
+
const mobileAspectRatio = imageAspectRatio(firstBanner?.mobileImage);
|
|
18
27
|
const style = {
|
|
19
28
|
"--banner-desktop-height": `${desktopHeight}px`,
|
|
20
29
|
"--banner-mobile-height": `${mobileHeight}px`,
|
|
30
|
+
...(desktopAspectRatio ? { "--banner-desktop-aspect-ratio": String(desktopAspectRatio) } : {}),
|
|
31
|
+
...(mobileAspectRatio ? { "--banner-mobile-aspect-ratio": String(mobileAspectRatio) } : {}),
|
|
21
32
|
} as CSSProperties;
|
|
22
33
|
return (
|
|
23
34
|
<div className="banner-carousel-settings" data-image-fit={imageFit.toLowerCase()} style={style}>
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
import { useEffect, useRef, useState, type ReactNode } from "react";
|
|
4
4
|
|
|
5
|
+
function ArrowIcon({ direction }: { direction: "previous" | "next" }) {
|
|
6
|
+
return <svg viewBox="0 0 24 24" aria-hidden="true"><path d={direction === "previous" ? "m14.5 5-7 7 7 7" : "m9.5 5 7 7-7 7"} /></svg>;
|
|
7
|
+
}
|
|
8
|
+
|
|
5
9
|
export function BannerCarouselFrame({
|
|
6
10
|
children,
|
|
7
11
|
count,
|
|
@@ -31,8 +35,8 @@ export function BannerCarouselFrame({
|
|
|
31
35
|
{children}
|
|
32
36
|
</div>
|
|
33
37
|
{count > 1 && <>
|
|
34
|
-
<button className="carousel-arrow carousel-arrow-prev" type="button" aria-label="Banner anterior" onClick={() => setActive((active - 1 + count) % count)}
|
|
35
|
-
<button className="carousel-arrow carousel-arrow-next" type="button" aria-label="Próximo banner" onClick={() => setActive((active + 1) % count)}
|
|
38
|
+
<button className="carousel-arrow carousel-arrow-prev" type="button" aria-label="Banner anterior" onClick={() => setActive((active - 1 + count) % count)}><ArrowIcon direction="previous" /></button>
|
|
39
|
+
<button className="carousel-arrow carousel-arrow-next" type="button" aria-label="Próximo banner" onClick={() => setActive((active + 1) % count)}><ArrowIcon direction="next" /></button>
|
|
36
40
|
<div className="carousel-dots">
|
|
37
41
|
{Array.from({ length: count }, (_, index) => <button key={index} type="button" className={index === active ? "active" : ""} aria-label={`Ir para banner ${index + 1}`} onClick={() => setActive(index)} />)}
|
|
38
42
|
</div>
|
|
@@ -51,8 +55,8 @@ export function ProductCarouselFrame({ children }: { children: ReactNode }) {
|
|
|
51
55
|
return (
|
|
52
56
|
<div className="product-carousel">
|
|
53
57
|
<div className="product-carousel-track" ref={track}>{children}</div>
|
|
54
|
-
<button type="button" className="carousel-arrow carousel-arrow-prev" onClick={() => move(-1)} aria-label="Produtos anteriores"
|
|
55
|
-
<button type="button" className="carousel-arrow carousel-arrow-next" onClick={() => move(1)} aria-label="Próximos produtos"
|
|
58
|
+
<button type="button" className="carousel-arrow carousel-arrow-prev" onClick={() => move(-1)} aria-label="Produtos anteriores"><ArrowIcon direction="previous" /></button>
|
|
59
|
+
<button type="button" className="carousel-arrow carousel-arrow-next" onClick={() => move(1)} aria-label="Próximos produtos"><ArrowIcon direction="next" /></button>
|
|
56
60
|
</div>
|
|
57
61
|
);
|
|
58
62
|
}
|
|
@@ -2,6 +2,7 @@ import { defineTheme } from "@nuvler/theme-sdk";
|
|
|
2
2
|
import { Footer } from "./footer.js";
|
|
3
3
|
import { Header } from "./header.js";
|
|
4
4
|
import { Home } from "./home.js";
|
|
5
|
+
import { NotFound } from "./not-found.js";
|
|
5
6
|
import { ProductDetail } from "./product-detail.js";
|
|
6
7
|
import { ProductGrid } from "./products.js";
|
|
7
8
|
import {
|
|
@@ -16,5 +17,5 @@ export const nuvlerDefaultTheme = defineTheme({
|
|
|
16
17
|
manifest,
|
|
17
18
|
tokens: nuvlerDefaultTokens,
|
|
18
19
|
template: nuvlerDefaultTemplate,
|
|
19
|
-
components: { Header, Footer, Home, ProductGrid, ProductDetail },
|
|
20
|
+
components: { Header, Footer, Home, ProductGrid, ProductDetail, NotFound },
|
|
20
21
|
});
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type { FooterProps } from "@nuvler/theme-sdk";
|
|
2
2
|
import type { ReactNode } from "react";
|
|
3
|
+
import { ThemeImageView, type ThemeImageComponent } from "./shared.js";
|
|
3
4
|
|
|
4
5
|
export interface NuvlerDefaultFooterProps extends FooterProps {
|
|
5
6
|
platformBrand?: ReactNode;
|
|
7
|
+
ImageComponent?: ThemeImageComponent;
|
|
6
8
|
}
|
|
7
9
|
|
|
8
|
-
export function Footer({ site, pages, template, platformBrand }: NuvlerDefaultFooterProps) {
|
|
10
|
+
export function Footer({ site, pages, template, platformBrand, ImageComponent = ThemeImageView }: NuvlerDefaultFooterProps) {
|
|
9
11
|
const settings = site.settings;
|
|
10
12
|
const name = settings?.siteName || site.tenant.name;
|
|
11
|
-
return <footer className="store-footer"><div className="store-container footer-grid"><div><
|
|
13
|
+
return <footer className="store-footer"><div className="store-container footer-grid"><div className="footer-intro"><a className="footer-brand" href="/" aria-label={`${name} — início`}>{settings?.logo?.url ? <ImageComponent image={settings.logo} fallbackAlt={name} className="footer-logo" sizes="200px" fallbackWidth={240} fallbackHeight={96} /> : name}</a><p>{settings?.description || template.footerTagline}</p>{settings?.contact.whatsapp && <a className="footer-contact-cta" href={`https://wa.me/${settings.contact.whatsapp.replace(/\D/g, "")}`} target="_blank" rel="noreferrer">Fale pelo WhatsApp <span aria-hidden="true">→</span></a>}</div><div><strong>{template.footerNavigationLabel}</strong>{site.modules.includes("PRODUCTS") && <a href="/produtos">Todos os produtos</a>}{site.modules.includes("BLOG") && <a href="/blog">Blog</a>}{site.modules.includes("SERVICES") && <a href="/servicos">Serviços</a>}{site.modules.includes("CASES") && <a href="/cases">Cases</a>}<a href="/">Início</a></div>{pages.length > 0 && <div><strong>Institucional</strong>{pages.slice(0, 6).map((page) => <a key={page.slug} href={`/${page.slug}`}>{page.title}</a>)}</div>}<div><strong>Atendimento</strong>{settings?.contact.email && <a href={`mailto:${settings.contact.email}`}>{settings.contact.email}</a>}{settings?.contact.phone && <a href={`tel:${settings.contact.phone}`}>{settings.contact.phone}</a>}{settings?.contact.address && <span>{settings.contact.address}</span>}</div>{settings?.social && Object.values(settings.social).some(Boolean) && <div className="footer-social"><strong>{template.socialLabel}</strong>{settings.social.instagram && <a href={settings.social.instagram} target="_blank" rel="noreferrer">Instagram</a>}{settings.social.facebook && <a href={settings.social.facebook} target="_blank" rel="noreferrer">Facebook</a>}{settings.social.youtube && <a href={settings.social.youtube} target="_blank" rel="noreferrer">YouTube</a>}{settings.social.tiktok && <a href={settings.social.tiktok} target="_blank" rel="noreferrer">TikTok</a>}</div>}</div><div className="store-container footer-bottom"><span>© {new Date().getFullYear()} {name}</span><span>{template.footerNote}</span>{platformBrand && <span data-nuvler-platform-brand-slot>{platformBrand}</span>}</div></footer>;
|
|
12
14
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { useCallback, useEffect, useLayoutEffect, useRef, useState, type KeyboardEvent } from "react";
|
|
4
|
-
import { productUrl, type ThemeCategory, type ThemeNavigationItem, type
|
|
4
|
+
import { productUrl, type ThemeCategory, type ThemeNavigationItem, type ThemeProduct, type ThemeSite } from "@nuvler/theme-sdk";
|
|
5
5
|
import { categoryUrl, displayPrice, ThemeImageView } from "./shared.js";
|
|
6
6
|
|
|
7
7
|
function CategoryTree({ categories, path = [], depth = 0 }: {
|
|
@@ -149,11 +149,9 @@ export function CategoryNavigation({ categories: initialCategories }: { categori
|
|
|
149
149
|
</nav>;
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
export function ConfiguredNavigation({ menu, categories: initialCategories }: { menu: ThemeNavigationItem[]; categories: ThemeCategory[] }) {
|
|
152
|
+
export function ConfiguredNavigation({ menu, categories: initialCategories, inline = false }: { menu: ThemeNavigationItem[]; categories: ThemeCategory[]; inline?: boolean }) {
|
|
153
153
|
const { categories, status, load } = useLazyCategories(initialCategories);
|
|
154
|
-
|
|
155
|
-
<a href="/">Início</a>
|
|
156
|
-
{menu.map((item) => {
|
|
154
|
+
const navigation = <nav className={`main-nav${inline ? " main-nav-inline" : " store-container"}`} aria-label="Navegação principal">{menu.map((item) => {
|
|
157
155
|
const categorySlug = categorySlugFromMenuItem(item);
|
|
158
156
|
if (!categorySlug) return <a href={item.href} key={item.key} target={item.openInNewTab ? "_blank" : undefined} rel={item.openInNewTab ? "noopener noreferrer" : undefined}>{item.label}</a>;
|
|
159
157
|
const match = findCategory(categories, categorySlug);
|
|
@@ -161,13 +159,12 @@ export function ConfiguredNavigation({ menu, categories: initialCategories }: {
|
|
|
161
159
|
return <div className="main-nav-group" key={item.key} onPointerEnter={() => { void load(); }} onFocusCapture={() => { void load(); }}>
|
|
162
160
|
<a href={item.href}>{item.label}{hasSubcategories && <svg className="category-item-chevron" viewBox="0 0 20 20" aria-hidden="true"><path d="m6 8 4 4 4-4" /></svg>}</a>
|
|
163
161
|
{hasSubcategories && <div className="category-nav-submenu configured-category-submenu">
|
|
164
|
-
<div className="configured-category-heading"><div><span>Explore a categoria</span><strong>{match?.category.name ?? item.label}</strong></div><a href={item.href}>Ver todos</a></div>
|
|
165
162
|
{status !== "loaded" && !match?.category.children.length && <p className="category-nav-status" role="status">{status === "error" ? "Não foi possível carregar as subcategorias." : "Carregando subcategorias…"}</p>}
|
|
166
163
|
{match?.category.children.length ? <div className="configured-category-grid"><CategoryTree categories={match.category.children} path={match.path} /></div> : null}
|
|
167
164
|
</div>}
|
|
168
165
|
</div>;
|
|
169
|
-
})}
|
|
170
|
-
</
|
|
166
|
+
})}</nav>;
|
|
167
|
+
return inline ? navigation : <div className="primary-nav-shell">{navigation}</div>;
|
|
171
168
|
}
|
|
172
169
|
|
|
173
170
|
export function SmartProductSearch({ endpoint = "/api/product-suggestions", queryParam = "q", searchProducts }: { endpoint?: string; queryParam?: string; searchProducts?: (query: string) => Promise<ThemeProduct[]> }) {
|
|
@@ -175,8 +172,14 @@ export function SmartProductSearch({ endpoint = "/api/product-suggestions", quer
|
|
|
175
172
|
const [results, setResults] = useState<ThemeProduct[]>([]);
|
|
176
173
|
const [loading, setLoading] = useState(false);
|
|
177
174
|
const [open, setOpen] = useState(false);
|
|
175
|
+
const [expanded, setExpanded] = useState(false);
|
|
178
176
|
const [activeIndex, setActiveIndex] = useState(-1);
|
|
179
177
|
const root = useRef<HTMLDivElement>(null);
|
|
178
|
+
const input = useRef<HTMLInputElement>(null);
|
|
179
|
+
|
|
180
|
+
useEffect(() => {
|
|
181
|
+
if (expanded) window.requestAnimationFrame(() => input.current?.focus());
|
|
182
|
+
}, [expanded]);
|
|
180
183
|
|
|
181
184
|
useEffect(() => {
|
|
182
185
|
const query = value.trim();
|
|
@@ -213,15 +216,23 @@ export function SmartProductSearch({ endpoint = "/api/product-suggestions", quer
|
|
|
213
216
|
}, [endpoint, queryParam, searchProducts, value]);
|
|
214
217
|
|
|
215
218
|
useEffect(() => {
|
|
216
|
-
const close = (event: PointerEvent) => {
|
|
219
|
+
const close = (event: PointerEvent) => {
|
|
220
|
+
if (root.current?.contains(event.target as Node)) return;
|
|
221
|
+
setOpen(false);
|
|
222
|
+
setExpanded(false);
|
|
223
|
+
};
|
|
217
224
|
document.addEventListener("pointerdown", close);
|
|
218
225
|
return () => document.removeEventListener("pointerdown", close);
|
|
219
226
|
}, []);
|
|
220
227
|
|
|
221
228
|
function handleKeyDown(event: KeyboardEvent<HTMLInputElement>) {
|
|
222
229
|
if (event.key === "Escape") {
|
|
223
|
-
|
|
224
|
-
|
|
230
|
+
if (open) {
|
|
231
|
+
setOpen(false);
|
|
232
|
+
setActiveIndex(-1);
|
|
233
|
+
} else {
|
|
234
|
+
setExpanded(false);
|
|
235
|
+
}
|
|
225
236
|
return;
|
|
226
237
|
}
|
|
227
238
|
if (!open || loading || !results.length) return;
|
|
@@ -242,11 +253,13 @@ export function SmartProductSearch({ endpoint = "/api/product-suggestions", quer
|
|
|
242
253
|
const query = value.trim();
|
|
243
254
|
const resultLabel = `${results.length} ${results.length === 1 ? "resultado" : "resultados"}`;
|
|
244
255
|
|
|
245
|
-
return <div className=
|
|
256
|
+
return <div className={`header-search-shell${expanded ? " is-expanded" : ""}`} ref={root}>
|
|
257
|
+
<button className="header-search-toggle" type="button" aria-label="Abrir busca" aria-expanded={expanded} onClick={() => setExpanded(true)}><svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="11" cy="11" r="7" /><path d="m16.5 16.5 4 4" /></svg></button>
|
|
246
258
|
<form className="header-search" action="/produtos">
|
|
247
259
|
<label className="sr-only" htmlFor="theme-store-search">Pesquisar produtos</label>
|
|
248
|
-
<input id="theme-store-search" name="busca" type="search" placeholder="Busque por produto, marca ou referência" autoComplete="off" value={value} onChange={(event) => setValue(event.target.value)} onFocus={() => query.length >= 2 && setOpen(true)} onKeyDown={handleKeyDown} aria-expanded={open} aria-controls="theme-search-suggestions" aria-activedescendant={activeIndex >= 0 ? `theme-search-result-${activeIndex}` : undefined} aria-autocomplete="list" role="combobox" />
|
|
249
|
-
<button type="submit" aria-label="Pesquisar produtos"><svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="11" cy="11" r="7" /><path d="m16.5 16.5 4 4" /></svg></button>
|
|
260
|
+
<input ref={input} id="theme-store-search" name="busca" type="search" placeholder="Busque por produto, marca ou referência" autoComplete="off" tabIndex={expanded ? 0 : -1} value={value} onChange={(event) => setValue(event.target.value)} onFocus={() => query.length >= 2 && setOpen(true)} onKeyDown={handleKeyDown} aria-expanded={open} aria-controls="theme-search-suggestions" aria-activedescendant={activeIndex >= 0 ? `theme-search-result-${activeIndex}` : undefined} aria-autocomplete="list" role="combobox" />
|
|
261
|
+
<button type="submit" tabIndex={expanded ? 0 : -1} aria-label="Pesquisar produtos"><svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="11" cy="11" r="7" /><path d="m16.5 16.5 4 4" /></svg></button>
|
|
262
|
+
<button className="header-search-close" type="button" tabIndex={expanded ? 0 : -1} aria-label="Fechar busca" onClick={() => { setOpen(false); setExpanded(false); }}>×</button>
|
|
250
263
|
</form>
|
|
251
264
|
{open && query.length >= 2 && <div className="search-suggestions" id="theme-search-suggestions" role="listbox" aria-label="Sugestões de produtos">
|
|
252
265
|
<div className="search-suggestions-heading"><strong>Sugestões para “{query}”</strong>{!loading && <span>{resultLabel}</span>}</div>
|
|
@@ -270,7 +283,7 @@ function MobileCategories({ categories, path = [] }: { categories: ThemeCategory
|
|
|
270
283
|
});
|
|
271
284
|
}
|
|
272
285
|
|
|
273
|
-
export function MobileStoreMenu({ site, categories: initialCategories,
|
|
286
|
+
export function MobileStoreMenu({ site, categories: initialCategories, menu = [], headerButton }: { site: ThemeSite; categories: ThemeCategory[]; menu?: ThemeNavigationItem[]; headerButton?: import("@nuvler/theme-sdk").ThemeNavigationHeaderButton | null }) {
|
|
274
287
|
const [open, setOpen] = useState(false);
|
|
275
288
|
const { categories, status, load } = useLazyCategories(initialCategories);
|
|
276
289
|
useEffect(() => {
|
|
@@ -282,11 +295,11 @@ export function MobileStoreMenu({ site, categories: initialCategories, pages, me
|
|
|
282
295
|
const settings = site.settings;
|
|
283
296
|
const configuredMenu = [...menu].sort((left, right) => left.order - right.order);
|
|
284
297
|
const configuredHasCategories = configuredMenu.some((item) => item.type === "CATEGORY");
|
|
285
|
-
return <><button type="button" className="mobile-menu-trigger" onClick={() => { setOpen(true); if (
|
|
298
|
+
return <><button type="button" className="mobile-menu-trigger" onClick={() => { setOpen(true); if (configuredHasCategories) void load(); }} aria-label="Abrir menu"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 7h16M4 12h16M4 17h16" /></svg></button>{open && <div className="mobile-menu-backdrop" role="presentation" onPointerDown={(event) => event.target === event.currentTarget && setOpen(false)}><aside className="mobile-menu-drawer" aria-label="Menu da loja"><div className="mobile-menu-heading"><div><small>Navegação</small><strong>{settings?.siteName || site.tenant.name}</strong></div><button type="button" onClick={() => setOpen(false)} aria-label="Fechar menu">×</button></div><nav className="mobile-menu-links">{configuredMenu.map((item) => {
|
|
286
299
|
const categorySlug = categorySlugFromMenuItem(item);
|
|
287
300
|
if (!categorySlug) return <a href={item.href} key={item.key} target={item.openInNewTab ? "_blank" : undefined} rel={item.openInNewTab ? "noopener noreferrer" : undefined}>{item.label}</a>;
|
|
288
301
|
const match = findCategory(categories, categorySlug);
|
|
289
302
|
const hasSubcategories = status !== "loaded" || Boolean(match?.category.children.length);
|
|
290
303
|
return hasSubcategories ? <details key={item.key} className="mobile-menu-category"><summary><span>{item.label}</span><span aria-hidden="true">+</span></summary><div><a href={item.href}>Ver tudo em {item.label}</a>{status !== "loaded" && !match?.category.children.length && <p className="mobile-menu-category-status" role="status">{status === "error" ? "Não foi possível carregar as subcategorias." : "Carregando subcategorias…"}</p>}{match?.category.children.length ? <MobileCategories categories={match.category.children} path={match.path} /> : null}</div></details> : <a href={item.href} key={item.key}>{item.label}</a>;
|
|
291
|
-
})
|
|
304
|
+
})}{headerButton?.enabled && <a className="mobile-menu-highlight" href={headerButton.href} target={headerButton.openInNewTab ? "_blank" : undefined} rel={headerButton.openInNewTab ? "noopener noreferrer" : undefined} style={{ backgroundColor: headerButton.backgroundColor, color: headerButton.textColor }}>{headerButton.label}</a>}</nav></aside></div>}</>;
|
|
292
305
|
}
|