create-visualbuild-app 0.1.0 → 1.0.1
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/README.md +919 -58
- package/docs/user-guide.md +759 -0
- package/package.json +92 -85
- package/scripts/create-builder-app.mjs +513 -501
- package/scripts/vb-dev.mjs +41 -32
- package/scripts/vb-generate.mjs +332 -224
- package/templates/default/app/.vercelignore +6 -0
- package/templates/default/app/README.md +56 -21
- package/templates/default/app/visualbuild/components.json +3 -0
- package/templates/default/app/visualbuild/config.d.ts +48 -0
- package/templates/default/app/visualbuild.config.ts +38 -0
- package/templates/default/builder/README.md +37 -21
- package/visual-app-builder/server/parseReactPage.ts +776 -571
- package/visual-app-builder/shared/createReactComponentSource.d.mts +2 -0
- package/visual-app-builder/shared/createReactComponentSource.mjs +45 -0
- package/visual-app-builder/shared/generateReactSource.d.mts +57 -37
- package/visual-app-builder/shared/generateReactSource.mjs +608 -443
- package/visual-app-builder/shared/npmBuildCommand.d.mts +17 -0
- package/visual-app-builder/shared/npmBuildCommand.mjs +26 -0
- package/visual-app-builder/shared/syncCustomComponentSource.d.mts +13 -0
- package/visual-app-builder/shared/syncCustomComponentSource.mjs +345 -0
- package/visual-app-builder/shared/vercelDeployment.d.mts +31 -0
- package/visual-app-builder/shared/vercelDeployment.mjs +266 -0
- package/visual-app-builder/shared/visualbuildConfig.d.mts +144 -0
- package/visual-app-builder/shared/visualbuildConfig.mjs +578 -0
- package/visual-app-builder/src/App.tsx +1090 -874
- package/visual-app-builder/src/components/Canvas.tsx +1116 -1059
- package/visual-app-builder/src/components/CodePanel.tsx +1147 -812
- package/visual-app-builder/src/components/ComponentSidebar.tsx +365 -302
- package/visual-app-builder/src/components/DeploymentModal.tsx +295 -0
- package/visual-app-builder/src/components/PageSwitcher.tsx +133 -133
- package/visual-app-builder/src/components/ProjectExplorer.tsx +1054 -1054
- package/visual-app-builder/src/components/PropertiesPanel.tsx +792 -692
- package/visual-app-builder/src/components/Topbar.tsx +257 -128
- package/visual-app-builder/src/data/componentRegistry.tsx +613 -292
- package/visual-app-builder/src/data/tailwindClassCatalog.ts +95 -0
- package/visual-app-builder/src/index.css +383 -111
- package/visual-app-builder/src/stores/useAppStore.ts +2385 -1265
- package/visual-app-builder/src/theme.ts +71 -0
- package/visual-app-builder/src/types/index.ts +350 -261
- package/visual-app-builder/src/utils/codegen.ts +90 -66
- package/visual-app-builder/src/utils/deployment.ts +54 -0
- package/visual-app-builder/src/utils/projectPersistence.ts +218 -177
- package/visual-app-builder/vite.config.ts +1946 -1479
|
@@ -1,692 +1,792 @@
|
|
|
1
|
-
import { useMemo, useRef, useState } from 'react'
|
|
2
|
-
import { primitiveRegistry } from '../data/primitiveRegistry'
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
...(appShell.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
</FieldShell>
|
|
436
|
-
)
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
function
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
.
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
const
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
'
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
'
|
|
569
|
-
'
|
|
570
|
-
'
|
|
571
|
-
'
|
|
572
|
-
'
|
|
573
|
-
'
|
|
574
|
-
'
|
|
575
|
-
'
|
|
576
|
-
'
|
|
577
|
-
'
|
|
578
|
-
'
|
|
579
|
-
'
|
|
580
|
-
'
|
|
581
|
-
'
|
|
582
|
-
'
|
|
583
|
-
'
|
|
584
|
-
'
|
|
585
|
-
'
|
|
586
|
-
'
|
|
587
|
-
'
|
|
588
|
-
'
|
|
589
|
-
'
|
|
590
|
-
'
|
|
591
|
-
'
|
|
592
|
-
'
|
|
593
|
-
'
|
|
594
|
-
'
|
|
595
|
-
'
|
|
596
|
-
'
|
|
597
|
-
'
|
|
598
|
-
'
|
|
599
|
-
'
|
|
600
|
-
'
|
|
601
|
-
'
|
|
602
|
-
'
|
|
603
|
-
'
|
|
604
|
-
'
|
|
605
|
-
'
|
|
606
|
-
'
|
|
607
|
-
'
|
|
608
|
-
'
|
|
609
|
-
'
|
|
610
|
-
'
|
|
611
|
-
'
|
|
612
|
-
'
|
|
613
|
-
'
|
|
614
|
-
'
|
|
615
|
-
'
|
|
616
|
-
'
|
|
617
|
-
'
|
|
618
|
-
'
|
|
619
|
-
'
|
|
620
|
-
'
|
|
621
|
-
'
|
|
622
|
-
'
|
|
623
|
-
'
|
|
624
|
-
'
|
|
625
|
-
'
|
|
626
|
-
'
|
|
627
|
-
'
|
|
628
|
-
'
|
|
629
|
-
'
|
|
630
|
-
'
|
|
631
|
-
'
|
|
632
|
-
'
|
|
633
|
-
'
|
|
634
|
-
'
|
|
635
|
-
'
|
|
636
|
-
'
|
|
637
|
-
'
|
|
638
|
-
'
|
|
639
|
-
'
|
|
640
|
-
'
|
|
641
|
-
'
|
|
642
|
-
'
|
|
643
|
-
'
|
|
644
|
-
'
|
|
645
|
-
'
|
|
646
|
-
'
|
|
647
|
-
'
|
|
648
|
-
'
|
|
649
|
-
'
|
|
650
|
-
'
|
|
651
|
-
'
|
|
652
|
-
'
|
|
653
|
-
'
|
|
654
|
-
'
|
|
655
|
-
'
|
|
656
|
-
'
|
|
657
|
-
'
|
|
658
|
-
'
|
|
659
|
-
'
|
|
660
|
-
'
|
|
661
|
-
'
|
|
662
|
-
'
|
|
663
|
-
'
|
|
664
|
-
'
|
|
665
|
-
'
|
|
666
|
-
'
|
|
667
|
-
'
|
|
668
|
-
'
|
|
669
|
-
'
|
|
670
|
-
'
|
|
671
|
-
'
|
|
672
|
-
'
|
|
673
|
-
'
|
|
674
|
-
'
|
|
675
|
-
'
|
|
676
|
-
'
|
|
677
|
-
'
|
|
678
|
-
'
|
|
679
|
-
'
|
|
680
|
-
'
|
|
681
|
-
'
|
|
682
|
-
'
|
|
683
|
-
'
|
|
684
|
-
'
|
|
685
|
-
'
|
|
686
|
-
'
|
|
687
|
-
'
|
|
688
|
-
'
|
|
689
|
-
'
|
|
690
|
-
'
|
|
691
|
-
'
|
|
692
|
-
|
|
1
|
+
import { useMemo, useRef, useState } from 'react'
|
|
2
|
+
import { primitiveRegistry } from '../data/primitiveRegistry'
|
|
3
|
+
import { getTailwindColorClassSuggestions } from '../data/tailwindClassCatalog'
|
|
4
|
+
import { useAppStore } from '../stores/useAppStore'
|
|
5
|
+
import type { PrimitiveType, PropSchema, VisualNode } from '../types'
|
|
6
|
+
|
|
7
|
+
export default function PropertiesPanel({
|
|
8
|
+
embedded = false,
|
|
9
|
+
}: {
|
|
10
|
+
embedded?: boolean
|
|
11
|
+
}) {
|
|
12
|
+
const {
|
|
13
|
+
pages,
|
|
14
|
+
appShell,
|
|
15
|
+
activePageId,
|
|
16
|
+
selectedComponentId,
|
|
17
|
+
updateNodeProps,
|
|
18
|
+
updatePageRoot,
|
|
19
|
+
customComponents,
|
|
20
|
+
} = useAppStore()
|
|
21
|
+
|
|
22
|
+
const activePage = pages.find((page) => page.id === activePageId)
|
|
23
|
+
const isPageRootSelected =
|
|
24
|
+
activePage?.root.id !== undefined && activePage.root.id === selectedComponentId
|
|
25
|
+
const selectedNode = isPageRootSelected
|
|
26
|
+
? activePage.root
|
|
27
|
+
: findNode(
|
|
28
|
+
[
|
|
29
|
+
...(appShell.header ? [appShell.header] : []),
|
|
30
|
+
...(activePage?.components ?? []),
|
|
31
|
+
...(appShell.footer ? [appShell.footer] : []),
|
|
32
|
+
],
|
|
33
|
+
selectedComponentId
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
if (!selectedNode) {
|
|
37
|
+
return (
|
|
38
|
+
<aside
|
|
39
|
+
className={`${embedded ? 'h-full w-full' : 'w-60 border-l'} flex shrink-0 flex-col border-white/[0.06] bg-panel`}
|
|
40
|
+
>
|
|
41
|
+
<div className="px-3 py-2.5 border-b border-white/[0.06]">
|
|
42
|
+
<p className="text-[10px] font-semibold uppercase tracking-widest text-gray-500">
|
|
43
|
+
Properties
|
|
44
|
+
</p>
|
|
45
|
+
</div>
|
|
46
|
+
<div className="flex-1 flex flex-col items-center justify-center text-center px-4">
|
|
47
|
+
<p className="text-xs text-gray-600">
|
|
48
|
+
Select any element on the canvas to edit text, attributes, and Tailwind classes
|
|
49
|
+
</p>
|
|
50
|
+
</div>
|
|
51
|
+
</aside>
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const definition =
|
|
56
|
+
primitiveRegistry[selectedNode.type as PrimitiveType] ??
|
|
57
|
+
customComponents.find((component) => component.name === selectedNode.type)
|
|
58
|
+
|
|
59
|
+
if (!definition) {
|
|
60
|
+
return (
|
|
61
|
+
<aside className={`${embedded ? 'h-full w-full' : 'w-60 border-l'} flex shrink-0 flex-col border-white/[0.06] bg-panel p-4`}>
|
|
62
|
+
<p className="text-xs text-amber-400">
|
|
63
|
+
{selectedNode.type} is no longer registered in visualbuild.config.ts.
|
|
64
|
+
</p>
|
|
65
|
+
</aside>
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const handleChange = (key: string, value: unknown) => {
|
|
70
|
+
if (isPageRootSelected && activePage) {
|
|
71
|
+
updatePageRoot(activePage.id, { props: { [key]: value } })
|
|
72
|
+
return
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
updateNodeProps(selectedNode.id, { [key]: value })
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const handleRootTagChange = (type: PrimitiveType) => {
|
|
79
|
+
if (!activePage) {
|
|
80
|
+
return
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
updatePageRoot(activePage.id, { type })
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return (
|
|
87
|
+
<aside
|
|
88
|
+
className={`${embedded ? 'h-full w-full' : 'w-60 border-l'} flex shrink-0 flex-col overflow-hidden border-white/[0.06] bg-panel`}
|
|
89
|
+
>
|
|
90
|
+
<div className="px-3 py-2.5 border-b border-white/[0.06] flex items-center justify-between">
|
|
91
|
+
<p className="text-[10px] font-semibold uppercase tracking-widest text-gray-500">
|
|
92
|
+
Properties
|
|
93
|
+
</p>
|
|
94
|
+
<span className="text-[10px] font-medium px-1.5 py-0.5 bg-accent/20 text-accent rounded">
|
|
95
|
+
{isPageRootSelected ? 'Page root' : selectedNode.label ?? definition.label}
|
|
96
|
+
</span>
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
<div className="flex-1 overflow-y-auto p-3 space-y-3">
|
|
100
|
+
{isPageRootSelected ? (
|
|
101
|
+
<RootTagField
|
|
102
|
+
value={selectedNode.type as PrimitiveType}
|
|
103
|
+
onChange={handleRootTagChange}
|
|
104
|
+
/>
|
|
105
|
+
) : (
|
|
106
|
+
<ReadOnlyField label="Tag" value={selectedNode.type} />
|
|
107
|
+
)}
|
|
108
|
+
{Object.entries(definition.propSchema).map(([key, schema]) => (
|
|
109
|
+
<PropField
|
|
110
|
+
key={`${selectedNode.id}:${key}`}
|
|
111
|
+
schema={schema}
|
|
112
|
+
value={selectedNode.props[key] ?? schema.default}
|
|
113
|
+
onChange={(value) => handleChange(key, value)}
|
|
114
|
+
/>
|
|
115
|
+
))}
|
|
116
|
+
</div>
|
|
117
|
+
</aside>
|
|
118
|
+
)
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function RootTagField({
|
|
122
|
+
value,
|
|
123
|
+
onChange,
|
|
124
|
+
}: {
|
|
125
|
+
value: PrimitiveType
|
|
126
|
+
onChange: (type: PrimitiveType) => void
|
|
127
|
+
}) {
|
|
128
|
+
return (
|
|
129
|
+
<FieldShell label="Page root tag">
|
|
130
|
+
<select
|
|
131
|
+
value={value}
|
|
132
|
+
onChange={(event) => onChange(event.target.value as PrimitiveType)}
|
|
133
|
+
className="w-full px-2.5 py-1.5 text-xs bg-white/[0.05] border border-white/[0.08] rounded text-gray-200 focus:outline-none focus:border-accent/50 transition-colors"
|
|
134
|
+
>
|
|
135
|
+
{pageRootTags.map((tag) => (
|
|
136
|
+
<option key={tag} value={tag}>
|
|
137
|
+
{tag}
|
|
138
|
+
</option>
|
|
139
|
+
))}
|
|
140
|
+
</select>
|
|
141
|
+
</FieldShell>
|
|
142
|
+
)
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const pageRootTags: PrimitiveType[] = [
|
|
146
|
+
'div',
|
|
147
|
+
'main',
|
|
148
|
+
'section',
|
|
149
|
+
'article',
|
|
150
|
+
'header',
|
|
151
|
+
'footer',
|
|
152
|
+
'nav',
|
|
153
|
+
'aside',
|
|
154
|
+
'form',
|
|
155
|
+
]
|
|
156
|
+
|
|
157
|
+
function findNode(nodes: VisualNode[], nodeId: string | null): VisualNode | null {
|
|
158
|
+
if (!nodeId) {
|
|
159
|
+
return null
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
for (const node of nodes) {
|
|
163
|
+
if (node.id === nodeId) {
|
|
164
|
+
return node
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
const child = findNode(node.children, nodeId)
|
|
168
|
+
|
|
169
|
+
if (child) {
|
|
170
|
+
return child
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
const componentTree = node.props.componentTree
|
|
174
|
+
if (
|
|
175
|
+
typeof componentTree === 'object' &&
|
|
176
|
+
componentTree !== null &&
|
|
177
|
+
Array.isArray((componentTree as { children?: unknown }).children)
|
|
178
|
+
) {
|
|
179
|
+
const definitionChild = findNode(
|
|
180
|
+
(componentTree as { children: VisualNode[] }).children,
|
|
181
|
+
nodeId
|
|
182
|
+
)
|
|
183
|
+
if (definitionChild) return definitionChild
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
return null
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
function ReadOnlyField({ label, value }: { label: string; value: string }) {
|
|
191
|
+
return (
|
|
192
|
+
<div className="space-y-1">
|
|
193
|
+
<label className="text-[10px] font-medium text-gray-500 uppercase tracking-wide">
|
|
194
|
+
{label}
|
|
195
|
+
</label>
|
|
196
|
+
<div className="w-full px-2.5 py-1.5 text-xs bg-white/[0.03] border border-white/[0.06] rounded text-gray-500">
|
|
197
|
+
{value}
|
|
198
|
+
</div>
|
|
199
|
+
</div>
|
|
200
|
+
)
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
function PropField({
|
|
204
|
+
schema,
|
|
205
|
+
value,
|
|
206
|
+
onChange,
|
|
207
|
+
}: {
|
|
208
|
+
schema: PropSchema
|
|
209
|
+
value: unknown
|
|
210
|
+
onChange: (value: unknown) => void
|
|
211
|
+
}) {
|
|
212
|
+
if (schema.type === 'boolean') {
|
|
213
|
+
const checked = Boolean(value)
|
|
214
|
+
|
|
215
|
+
return (
|
|
216
|
+
<div className="flex items-center justify-between">
|
|
217
|
+
<label className="text-xs text-gray-400">{schema.label}</label>
|
|
218
|
+
<button
|
|
219
|
+
type="button"
|
|
220
|
+
onClick={() => onChange(!checked)}
|
|
221
|
+
className={`w-8 h-4 rounded-full transition-colors ${
|
|
222
|
+
checked ? 'bg-accent' : 'bg-white/10'
|
|
223
|
+
}`}
|
|
224
|
+
>
|
|
225
|
+
<span
|
|
226
|
+
className={`block w-3 h-3 rounded-full bg-white shadow transition-transform mx-0.5 ${
|
|
227
|
+
checked ? 'translate-x-4' : 'translate-x-0'
|
|
228
|
+
}`}
|
|
229
|
+
/>
|
|
230
|
+
</button>
|
|
231
|
+
</div>
|
|
232
|
+
)
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
if (schema.type === 'array') {
|
|
236
|
+
return <ArrayField schema={schema} value={value} onChange={onChange} />
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
if (schema.type === 'attributes') {
|
|
240
|
+
return <AttributesField schema={schema} value={value} onChange={onChange} />
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
if (schema.type === 'select') {
|
|
244
|
+
return (
|
|
245
|
+
<FieldShell label={schema.label}>
|
|
246
|
+
<select
|
|
247
|
+
value={String(value ?? schema.default)}
|
|
248
|
+
onChange={(event) => onChange(event.target.value)}
|
|
249
|
+
className="w-full px-2.5 py-1.5 text-xs bg-white/[0.05] border border-white/[0.08] rounded text-gray-200 focus:outline-none focus:border-accent/50 transition-colors"
|
|
250
|
+
>
|
|
251
|
+
{(schema.options ?? []).map((option) => (
|
|
252
|
+
<option key={option} value={option}>
|
|
253
|
+
{option}
|
|
254
|
+
</option>
|
|
255
|
+
))}
|
|
256
|
+
</select>
|
|
257
|
+
</FieldShell>
|
|
258
|
+
)
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
if (schema.label === 'Tailwind classes') {
|
|
262
|
+
return (
|
|
263
|
+
<TailwindClassField
|
|
264
|
+
value={String(value ?? schema.default)}
|
|
265
|
+
onChange={onChange}
|
|
266
|
+
/>
|
|
267
|
+
)
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
if (schema.type === 'text') {
|
|
271
|
+
return (
|
|
272
|
+
<FieldShell label={schema.label}>
|
|
273
|
+
<textarea
|
|
274
|
+
value={String(value ?? schema.default)}
|
|
275
|
+
onChange={(event) => onChange(event.target.value)}
|
|
276
|
+
rows={3}
|
|
277
|
+
className="w-full px-2.5 py-1.5 text-xs bg-white/[0.05] border border-white/[0.08] rounded text-gray-200 focus:outline-none focus:border-accent/50 transition-colors resize-none"
|
|
278
|
+
/>
|
|
279
|
+
</FieldShell>
|
|
280
|
+
)
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
return (
|
|
284
|
+
<FieldShell label={schema.label}>
|
|
285
|
+
<input
|
|
286
|
+
type={schema.type === 'number' ? 'number' : 'text'}
|
|
287
|
+
value={String(value ?? schema.default)}
|
|
288
|
+
onChange={(event) =>
|
|
289
|
+
onChange(
|
|
290
|
+
schema.type === 'number'
|
|
291
|
+
? Number(event.target.value)
|
|
292
|
+
: event.target.value
|
|
293
|
+
)
|
|
294
|
+
}
|
|
295
|
+
className="w-full px-2.5 py-1.5 text-xs bg-white/[0.05] border border-white/[0.08] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-accent/50 transition-colors"
|
|
296
|
+
/>
|
|
297
|
+
</FieldShell>
|
|
298
|
+
)
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
function TailwindClassField({
|
|
302
|
+
value,
|
|
303
|
+
onChange,
|
|
304
|
+
}: {
|
|
305
|
+
value: string
|
|
306
|
+
onChange: (value: unknown) => void
|
|
307
|
+
}) {
|
|
308
|
+
const textareaRef = useRef<HTMLTextAreaElement | null>(null)
|
|
309
|
+
const [caretIndex, setCaretIndex] = useState(value.length)
|
|
310
|
+
const [isFocused, setIsFocused] = useState(false)
|
|
311
|
+
const [activeIndex, setActiveIndex] = useState(0)
|
|
312
|
+
const token = getCurrentClassToken(value, caretIndex)
|
|
313
|
+
const suggestions = useMemo(() => {
|
|
314
|
+
if (!isFocused || token.value.length === 0) {
|
|
315
|
+
return []
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
const variantSeparator = token.value.lastIndexOf(':')
|
|
319
|
+
const variantPrefix =
|
|
320
|
+
variantSeparator >= 0 ? token.value.slice(0, variantSeparator + 1) : ''
|
|
321
|
+
const utilityToken =
|
|
322
|
+
variantSeparator >= 0
|
|
323
|
+
? token.value.slice(variantSeparator + 1)
|
|
324
|
+
: token.value
|
|
325
|
+
const generalSuggestions = tailwindClassSuggestions
|
|
326
|
+
.filter((className) => className.startsWith(utilityToken))
|
|
327
|
+
.map((className) => `${variantPrefix}${className}`)
|
|
328
|
+
|
|
329
|
+
return Array.from(
|
|
330
|
+
new Set([
|
|
331
|
+
...getTailwindColorClassSuggestions(token.value),
|
|
332
|
+
...generalSuggestions,
|
|
333
|
+
]),
|
|
334
|
+
).slice(0, 64)
|
|
335
|
+
}, [isFocused, token.value])
|
|
336
|
+
|
|
337
|
+
const updateCaret = () => {
|
|
338
|
+
setCaretIndex(textareaRef.current?.selectionStart ?? value.length)
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
const applySuggestion = (className: string) => {
|
|
342
|
+
const before = value.slice(0, token.start)
|
|
343
|
+
const after = value.slice(token.end)
|
|
344
|
+
const needsLeadingSpace = before.length > 0 && !/\s$/.test(before)
|
|
345
|
+
const needsTrailingSpace = after.length === 0 || !/^\s/.test(after)
|
|
346
|
+
const nextValue = `${before}${needsLeadingSpace ? ' ' : ''}${className}${
|
|
347
|
+
needsTrailingSpace ? ' ' : ''
|
|
348
|
+
}${after}`
|
|
349
|
+
const nextCaret =
|
|
350
|
+
before.length + (needsLeadingSpace ? 1 : 0) + className.length + 1
|
|
351
|
+
|
|
352
|
+
onChange(nextValue)
|
|
353
|
+
setCaretIndex(nextCaret)
|
|
354
|
+
setActiveIndex(0)
|
|
355
|
+
window.setTimeout(() => {
|
|
356
|
+
textareaRef.current?.focus()
|
|
357
|
+
textareaRef.current?.setSelectionRange(nextCaret, nextCaret)
|
|
358
|
+
}, 0)
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
return (
|
|
362
|
+
<FieldShell label="Tailwind classes">
|
|
363
|
+
<div className="relative">
|
|
364
|
+
<textarea
|
|
365
|
+
ref={textareaRef}
|
|
366
|
+
value={value}
|
|
367
|
+
onFocus={() => setIsFocused(true)}
|
|
368
|
+
onBlur={() => {
|
|
369
|
+
window.setTimeout(() => setIsFocused(false), 120)
|
|
370
|
+
}}
|
|
371
|
+
onChange={(event) => {
|
|
372
|
+
onChange(event.target.value)
|
|
373
|
+
setCaretIndex(event.target.selectionStart)
|
|
374
|
+
setActiveIndex(0)
|
|
375
|
+
}}
|
|
376
|
+
onSelect={updateCaret}
|
|
377
|
+
onKeyUp={updateCaret}
|
|
378
|
+
onKeyDown={(event) => {
|
|
379
|
+
if (suggestions.length === 0) {
|
|
380
|
+
return
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
if (event.key === 'ArrowDown') {
|
|
384
|
+
event.preventDefault()
|
|
385
|
+
setActiveIndex((index) => (index + 1) % suggestions.length)
|
|
386
|
+
return
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
if (event.key === 'ArrowUp') {
|
|
390
|
+
event.preventDefault()
|
|
391
|
+
setActiveIndex(
|
|
392
|
+
(index) => (index - 1 + suggestions.length) % suggestions.length
|
|
393
|
+
)
|
|
394
|
+
return
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
if (event.key === 'Enter' || event.key === 'Tab') {
|
|
398
|
+
event.preventDefault()
|
|
399
|
+
applySuggestion(suggestions[activeIndex])
|
|
400
|
+
return
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
if (event.key === 'Escape') {
|
|
404
|
+
setIsFocused(false)
|
|
405
|
+
}
|
|
406
|
+
}}
|
|
407
|
+
rows={4}
|
|
408
|
+
className="w-full px-2.5 py-1.5 text-xs bg-white/[0.05] border border-white/[0.08] rounded text-gray-200 focus:outline-none focus:border-accent/50 transition-colors resize-none"
|
|
409
|
+
/>
|
|
410
|
+
{suggestions.length > 0 && (
|
|
411
|
+
<div className="absolute left-0 right-0 top-full z-30 mt-1 max-h-44 overflow-y-auto rounded border border-white/[0.12] bg-[#11151c] py-1 shadow-xl">
|
|
412
|
+
{suggestions.map((className, index) => (
|
|
413
|
+
<button
|
|
414
|
+
key={className}
|
|
415
|
+
type="button"
|
|
416
|
+
onMouseDown={(event) => {
|
|
417
|
+
event.preventDefault()
|
|
418
|
+
applySuggestion(className)
|
|
419
|
+
}}
|
|
420
|
+
className={`block w-full cursor-pointer px-2.5 py-1.5 text-left font-mono text-[11px] transition-colors ${
|
|
421
|
+
index === activeIndex
|
|
422
|
+
? 'bg-accent text-white'
|
|
423
|
+
: 'text-gray-300 hover:bg-white/[0.08] hover:text-white'
|
|
424
|
+
}`}
|
|
425
|
+
>
|
|
426
|
+
{className}
|
|
427
|
+
</button>
|
|
428
|
+
))}
|
|
429
|
+
</div>
|
|
430
|
+
)}
|
|
431
|
+
</div>
|
|
432
|
+
<p className="text-[10px] text-gray-600">
|
|
433
|
+
Type a class prefix, then press Tab or Enter to accept.
|
|
434
|
+
</p>
|
|
435
|
+
</FieldShell>
|
|
436
|
+
)
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
function getCurrentClassToken(value: string, caretIndex: number) {
|
|
440
|
+
const safeCaret = Math.max(0, Math.min(caretIndex, value.length))
|
|
441
|
+
const before = value.slice(0, safeCaret)
|
|
442
|
+
const tokenStart = Math.max(
|
|
443
|
+
before.lastIndexOf(' '),
|
|
444
|
+
before.lastIndexOf('\n'),
|
|
445
|
+
before.lastIndexOf('\t')
|
|
446
|
+
) + 1
|
|
447
|
+
const after = value.slice(safeCaret)
|
|
448
|
+
const nextBreak = after.search(/\s/)
|
|
449
|
+
const tokenEnd = nextBreak === -1 ? value.length : safeCaret + nextBreak
|
|
450
|
+
|
|
451
|
+
return {
|
|
452
|
+
start: tokenStart,
|
|
453
|
+
end: tokenEnd,
|
|
454
|
+
value: value.slice(tokenStart, tokenEnd),
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
function ArrayField({
|
|
459
|
+
schema,
|
|
460
|
+
value,
|
|
461
|
+
onChange,
|
|
462
|
+
}: {
|
|
463
|
+
schema: PropSchema
|
|
464
|
+
value: unknown
|
|
465
|
+
onChange: (value: unknown) => void
|
|
466
|
+
}) {
|
|
467
|
+
const [draft, setDraft] = useState(formatArrayValue(value))
|
|
468
|
+
|
|
469
|
+
const handleChange = (rawValue: string) => {
|
|
470
|
+
setDraft(rawValue)
|
|
471
|
+
onChange(parseArrayValue(rawValue))
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
return (
|
|
475
|
+
<FieldShell label={schema.label}>
|
|
476
|
+
<textarea
|
|
477
|
+
value={draft}
|
|
478
|
+
onChange={(event) => handleChange(event.target.value)}
|
|
479
|
+
rows={2}
|
|
480
|
+
className="w-full px-2.5 py-1.5 text-xs bg-white/[0.05] border border-white/[0.08] rounded text-gray-200 focus:outline-none focus:border-accent/50 transition-colors resize-none"
|
|
481
|
+
/>
|
|
482
|
+
<p className="text-[10px] text-gray-600">Comma or line separated</p>
|
|
483
|
+
</FieldShell>
|
|
484
|
+
)
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
function AttributesField({
|
|
488
|
+
schema,
|
|
489
|
+
value,
|
|
490
|
+
onChange,
|
|
491
|
+
}: {
|
|
492
|
+
schema: PropSchema
|
|
493
|
+
value: unknown
|
|
494
|
+
onChange: (value: unknown) => void
|
|
495
|
+
}) {
|
|
496
|
+
const [draft, setDraft] = useState(() =>
|
|
497
|
+
JSON.stringify(
|
|
498
|
+
value && typeof value === 'object' && !Array.isArray(value) ? value : {},
|
|
499
|
+
null,
|
|
500
|
+
2
|
|
501
|
+
)
|
|
502
|
+
)
|
|
503
|
+
const [error, setError] = useState<string | null>(null)
|
|
504
|
+
|
|
505
|
+
return (
|
|
506
|
+
<FieldShell label={schema.label}>
|
|
507
|
+
<textarea
|
|
508
|
+
value={draft}
|
|
509
|
+
onChange={(event) => {
|
|
510
|
+
const nextDraft = event.target.value
|
|
511
|
+
setDraft(nextDraft)
|
|
512
|
+
|
|
513
|
+
try {
|
|
514
|
+
const parsed = JSON.parse(nextDraft) as unknown
|
|
515
|
+
if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
|
|
516
|
+
throw new Error('Use a JSON object')
|
|
517
|
+
}
|
|
518
|
+
setError(null)
|
|
519
|
+
onChange(parsed)
|
|
520
|
+
} catch (parseError) {
|
|
521
|
+
setError(
|
|
522
|
+
parseError instanceof Error
|
|
523
|
+
? parseError.message
|
|
524
|
+
: 'Enter valid JSON'
|
|
525
|
+
)
|
|
526
|
+
}
|
|
527
|
+
}}
|
|
528
|
+
rows={5}
|
|
529
|
+
spellCheck={false}
|
|
530
|
+
className="w-full resize-none rounded border border-white/[0.08] bg-white/[0.05] px-2.5 py-1.5 font-mono text-xs text-gray-200 outline-none transition-colors focus:border-accent/50"
|
|
531
|
+
/>
|
|
532
|
+
<p className={`text-[10px] ${error ? 'text-red-300' : 'text-gray-600'}`}>
|
|
533
|
+
{error ?? 'JSON attributes, for example {"aria-label": "Card"}'}
|
|
534
|
+
</p>
|
|
535
|
+
</FieldShell>
|
|
536
|
+
)
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
function formatArrayValue(value: unknown) {
|
|
540
|
+
return Array.isArray(value) ? value.join(', ') : ''
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
function parseArrayValue(value: string) {
|
|
544
|
+
return value
|
|
545
|
+
.split(/[,\n]/)
|
|
546
|
+
.map((item) => item.trim())
|
|
547
|
+
.filter(Boolean)
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
function FieldShell({
|
|
551
|
+
label,
|
|
552
|
+
children,
|
|
553
|
+
}: {
|
|
554
|
+
label: string
|
|
555
|
+
children: React.ReactNode
|
|
556
|
+
}) {
|
|
557
|
+
return (
|
|
558
|
+
<div className="space-y-1">
|
|
559
|
+
<label className="text-[10px] font-medium text-gray-500 uppercase tracking-wide">
|
|
560
|
+
{label}
|
|
561
|
+
</label>
|
|
562
|
+
{children}
|
|
563
|
+
</div>
|
|
564
|
+
)
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
const tailwindClassSuggestions = [
|
|
568
|
+
'block',
|
|
569
|
+
'inline',
|
|
570
|
+
'inline-block',
|
|
571
|
+
'flex',
|
|
572
|
+
'inline-flex',
|
|
573
|
+
'grid',
|
|
574
|
+
'hidden',
|
|
575
|
+
'contents',
|
|
576
|
+
'flex-row',
|
|
577
|
+
'flex-col',
|
|
578
|
+
'flex-wrap',
|
|
579
|
+
'items-start',
|
|
580
|
+
'items-center',
|
|
581
|
+
'items-end',
|
|
582
|
+
'items-stretch',
|
|
583
|
+
'justify-start',
|
|
584
|
+
'justify-center',
|
|
585
|
+
'justify-end',
|
|
586
|
+
'justify-between',
|
|
587
|
+
'justify-around',
|
|
588
|
+
'content-center',
|
|
589
|
+
'self-start',
|
|
590
|
+
'self-center',
|
|
591
|
+
'self-end',
|
|
592
|
+
'gap-1',
|
|
593
|
+
'gap-2',
|
|
594
|
+
'gap-3',
|
|
595
|
+
'gap-4',
|
|
596
|
+
'gap-6',
|
|
597
|
+
'gap-8',
|
|
598
|
+
'grid-cols-1',
|
|
599
|
+
'grid-cols-2',
|
|
600
|
+
'grid-cols-3',
|
|
601
|
+
'grid-cols-4',
|
|
602
|
+
'grid-cols-6',
|
|
603
|
+
'col-span-1',
|
|
604
|
+
'col-span-2',
|
|
605
|
+
'col-span-full',
|
|
606
|
+
'w-full',
|
|
607
|
+
'w-screen',
|
|
608
|
+
'w-auto',
|
|
609
|
+
'w-fit',
|
|
610
|
+
'w-1/2',
|
|
611
|
+
'w-1/3',
|
|
612
|
+
'w-2/3',
|
|
613
|
+
'w-1/4',
|
|
614
|
+
'w-3/4',
|
|
615
|
+
'min-w-0',
|
|
616
|
+
'max-w-sm',
|
|
617
|
+
'max-w-md',
|
|
618
|
+
'max-w-lg',
|
|
619
|
+
'max-w-xl',
|
|
620
|
+
'max-w-2xl',
|
|
621
|
+
'max-w-4xl',
|
|
622
|
+
'max-w-6xl',
|
|
623
|
+
'max-w-full',
|
|
624
|
+
'h-full',
|
|
625
|
+
'h-screen',
|
|
626
|
+
'h-auto',
|
|
627
|
+
'min-h-12',
|
|
628
|
+
'min-h-24',
|
|
629
|
+
'min-h-48',
|
|
630
|
+
'min-h-screen',
|
|
631
|
+
'p-0',
|
|
632
|
+
'p-1',
|
|
633
|
+
'p-2',
|
|
634
|
+
'p-3',
|
|
635
|
+
'p-4',
|
|
636
|
+
'p-6',
|
|
637
|
+
'p-8',
|
|
638
|
+
'px-2',
|
|
639
|
+
'px-3',
|
|
640
|
+
'px-4',
|
|
641
|
+
'px-6',
|
|
642
|
+
'px-8',
|
|
643
|
+
'py-1',
|
|
644
|
+
'py-2',
|
|
645
|
+
'py-3',
|
|
646
|
+
'py-4',
|
|
647
|
+
'py-6',
|
|
648
|
+
'py-8',
|
|
649
|
+
'm-0',
|
|
650
|
+
'mx-auto',
|
|
651
|
+
'mt-1',
|
|
652
|
+
'mt-2',
|
|
653
|
+
'mt-4',
|
|
654
|
+
'mb-1',
|
|
655
|
+
'mb-2',
|
|
656
|
+
'mb-4',
|
|
657
|
+
'space-y-1',
|
|
658
|
+
'space-y-2',
|
|
659
|
+
'space-y-3',
|
|
660
|
+
'space-y-4',
|
|
661
|
+
'text-left',
|
|
662
|
+
'text-center',
|
|
663
|
+
'text-right',
|
|
664
|
+
'text-xs',
|
|
665
|
+
'text-sm',
|
|
666
|
+
'text-base',
|
|
667
|
+
'text-lg',
|
|
668
|
+
'text-xl',
|
|
669
|
+
'text-2xl',
|
|
670
|
+
'text-3xl',
|
|
671
|
+
'text-4xl',
|
|
672
|
+
'text-5xl',
|
|
673
|
+
'font-thin',
|
|
674
|
+
'font-light',
|
|
675
|
+
'font-normal',
|
|
676
|
+
'font-medium',
|
|
677
|
+
'font-semibold',
|
|
678
|
+
'font-bold',
|
|
679
|
+
'font-extrabold',
|
|
680
|
+
'italic',
|
|
681
|
+
'not-italic',
|
|
682
|
+
'underline',
|
|
683
|
+
'line-through',
|
|
684
|
+
'leading-none',
|
|
685
|
+
'leading-tight',
|
|
686
|
+
'leading-normal',
|
|
687
|
+
'leading-relaxed',
|
|
688
|
+
'tracking-tight',
|
|
689
|
+
'tracking-normal',
|
|
690
|
+
'tracking-wide',
|
|
691
|
+
'text-white',
|
|
692
|
+
'text-black',
|
|
693
|
+
'text-gray-50',
|
|
694
|
+
'text-gray-100',
|
|
695
|
+
'text-gray-200',
|
|
696
|
+
'text-gray-300',
|
|
697
|
+
'text-gray-400',
|
|
698
|
+
'text-gray-500',
|
|
699
|
+
'text-gray-600',
|
|
700
|
+
'text-gray-700',
|
|
701
|
+
'text-gray-800',
|
|
702
|
+
'text-gray-900',
|
|
703
|
+
'text-red-500',
|
|
704
|
+
'text-orange-500',
|
|
705
|
+
'text-amber-500',
|
|
706
|
+
'text-yellow-500',
|
|
707
|
+
'text-green-500',
|
|
708
|
+
'text-emerald-500',
|
|
709
|
+
'text-teal-500',
|
|
710
|
+
'text-cyan-500',
|
|
711
|
+
'text-sky-500',
|
|
712
|
+
'text-blue-500',
|
|
713
|
+
'text-blue-600',
|
|
714
|
+
'text-indigo-500',
|
|
715
|
+
'text-violet-500',
|
|
716
|
+
'text-purple-500',
|
|
717
|
+
'text-pink-500',
|
|
718
|
+
'bg-white',
|
|
719
|
+
'bg-black',
|
|
720
|
+
'bg-transparent',
|
|
721
|
+
'bg-gray-50',
|
|
722
|
+
'bg-gray-100',
|
|
723
|
+
'bg-gray-200',
|
|
724
|
+
'bg-gray-300',
|
|
725
|
+
'bg-gray-800',
|
|
726
|
+
'bg-gray-900',
|
|
727
|
+
'bg-red-500',
|
|
728
|
+
'bg-orange-500',
|
|
729
|
+
'bg-yellow-500',
|
|
730
|
+
'bg-green-500',
|
|
731
|
+
'bg-blue-500',
|
|
732
|
+
'bg-blue-600',
|
|
733
|
+
'bg-indigo-600',
|
|
734
|
+
'bg-purple-600',
|
|
735
|
+
'border',
|
|
736
|
+
'border-0',
|
|
737
|
+
'border-2',
|
|
738
|
+
'border-t',
|
|
739
|
+
'border-b',
|
|
740
|
+
'border-l',
|
|
741
|
+
'border-r',
|
|
742
|
+
'border-transparent',
|
|
743
|
+
'border-white',
|
|
744
|
+
'border-black',
|
|
745
|
+
'border-gray-200',
|
|
746
|
+
'border-gray-300',
|
|
747
|
+
'border-gray-700',
|
|
748
|
+
'border-blue-500',
|
|
749
|
+
'rounded',
|
|
750
|
+
'rounded-sm',
|
|
751
|
+
'rounded-md',
|
|
752
|
+
'rounded-lg',
|
|
753
|
+
'rounded-xl',
|
|
754
|
+
'rounded-2xl',
|
|
755
|
+
'rounded-full',
|
|
756
|
+
'shadow',
|
|
757
|
+
'shadow-sm',
|
|
758
|
+
'shadow-md',
|
|
759
|
+
'shadow-lg',
|
|
760
|
+
'shadow-xl',
|
|
761
|
+
'overflow-hidden',
|
|
762
|
+
'overflow-auto',
|
|
763
|
+
'overflow-x-auto',
|
|
764
|
+
'relative',
|
|
765
|
+
'absolute',
|
|
766
|
+
'fixed',
|
|
767
|
+
'sticky',
|
|
768
|
+
'top-0',
|
|
769
|
+
'right-0',
|
|
770
|
+
'bottom-0',
|
|
771
|
+
'left-0',
|
|
772
|
+
'z-10',
|
|
773
|
+
'z-20',
|
|
774
|
+
'z-50',
|
|
775
|
+
'opacity-0',
|
|
776
|
+
'opacity-50',
|
|
777
|
+
'opacity-75',
|
|
778
|
+
'opacity-100',
|
|
779
|
+
'cursor-pointer',
|
|
780
|
+
'select-none',
|
|
781
|
+
'transition',
|
|
782
|
+
'transition-colors',
|
|
783
|
+
'duration-150',
|
|
784
|
+
'duration-200',
|
|
785
|
+
'hover:bg-gray-100',
|
|
786
|
+
'hover:bg-gray-900',
|
|
787
|
+
'hover:text-white',
|
|
788
|
+
'hover:text-black',
|
|
789
|
+
'focus:outline-none',
|
|
790
|
+
'focus:ring-2',
|
|
791
|
+
'focus:ring-blue-500',
|
|
792
|
+
]
|