@jbpark/live-editor 4.1.0 → 4.2.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.
Files changed (63) hide show
  1. package/README.ko.md +1 -1
  2. package/README.md +1 -1
  3. package/dist/ast-CMD20ykx.js +1613 -0
  4. package/dist/ast-CMD20ykx.js.map +1 -0
  5. package/dist/{boundary-C90q3YsT.js → boundary-D2IFja-3.js} +2 -2
  6. package/dist/boundary-D2IFja-3.js.map +1 -0
  7. package/dist/cache-B0-XcIxJ.js +51 -0
  8. package/dist/cache-B0-XcIxJ.js.map +1 -0
  9. package/dist/{utils-BQ7WL7Jh.js → cn-CAnad2vL.js} +3 -128
  10. package/dist/cn-CAnad2vL.js.map +1 -0
  11. package/dist/compile-0Dvp8zp5.js +135 -0
  12. package/dist/compile-0Dvp8zp5.js.map +1 -0
  13. package/dist/constants-CKvdqZtO.js +1457 -0
  14. package/dist/constants-CKvdqZtO.js.map +1 -0
  15. package/dist/{context-Y-M9fViD.js → context-93X3gyfJ.js} +3 -3
  16. package/dist/context-93X3gyfJ.js.map +1 -0
  17. package/dist/{core-Co8Nlq16.js → core-B3ruccKb.js} +3 -2
  18. package/dist/core-B3ruccKb.js.map +1 -0
  19. package/dist/detect-typescript-5MV4mCM7.js +10 -0
  20. package/dist/detect-typescript-5MV4mCM7.js.map +1 -0
  21. package/dist/dnd/index.d.ts +2 -2
  22. package/dist/dnd/index.js +2 -2
  23. package/dist/{dnd-D_rG92-R.js → dnd-DBaH2L8N.js} +548 -137
  24. package/dist/dnd-DBaH2L8N.js.map +1 -0
  25. package/dist/{extract-abHYmNsu.js → document-C3eCRQlj.js} +6791 -8938
  26. package/dist/document-C3eCRQlj.js.map +1 -0
  27. package/dist/{document-J9Lo9p81.d.ts → document-Ct4jW78J.d.ts} +42 -22
  28. package/dist/editor/index.js +2 -2
  29. package/dist/{editor-aNRx7hRY.js → editor-DvMruljw.js} +2 -2
  30. package/dist/{editor-aNRx7hRY.js.map → editor-DvMruljw.js.map} +1 -1
  31. package/dist/editor-caches-ClMvdcQF.js +23 -0
  32. package/dist/editor-caches-ClMvdcQF.js.map +1 -0
  33. package/dist/error/index.js +2 -2
  34. package/dist/{error-o0SBwtTv.js → error-KW8XCcjH.js} +2 -2
  35. package/dist/{error-o0SBwtTv.js.map → error-KW8XCcjH.js.map} +1 -1
  36. package/dist/{index-Doh4VTXr.d.ts → index-DVgwXnPa.d.ts} +109 -34
  37. package/dist/{index-B_p74BRM.d.ts → index-w3kLcCXl.d.ts} +29 -5
  38. package/dist/index.d.ts +4 -4
  39. package/dist/index.js +5 -5
  40. package/dist/index.js.map +1 -1
  41. package/dist/preview/index.js +2 -2
  42. package/dist/{preview-CS6Rsppd.js → preview-B9Jhv1Up.js} +4 -4
  43. package/dist/preview-B9Jhv1Up.js.map +1 -0
  44. package/dist/provider/index.js +1 -1
  45. package/dist/sections-A4TAXUP8.js +24 -0
  46. package/dist/sections-A4TAXUP8.js.map +1 -0
  47. package/dist/{use-dynamic-tailwind-SOgrb2qc.js → use-dynamic-tailwind-BDfytfYC.js} +33 -9
  48. package/dist/use-dynamic-tailwind-BDfytfYC.js.map +1 -0
  49. package/dist/utils/ast/index.d.ts +3 -3
  50. package/dist/utils/ast/index.js +3 -3
  51. package/dist/utils/index.d.ts +20 -9
  52. package/dist/utils/index.js +7 -3
  53. package/package.json +1 -1
  54. package/dist/ast-CZwpVrJv.js +0 -851
  55. package/dist/ast-CZwpVrJv.js.map +0 -1
  56. package/dist/boundary-C90q3YsT.js.map +0 -1
  57. package/dist/context-Y-M9fViD.js.map +0 -1
  58. package/dist/core-Co8Nlq16.js.map +0 -1
  59. package/dist/dnd-D_rG92-R.js.map +0 -1
  60. package/dist/extract-abHYmNsu.js.map +0 -1
  61. package/dist/preview-CS6Rsppd.js.map +0 -1
  62. package/dist/use-dynamic-tailwind-SOgrb2qc.js.map +0 -1
  63. package/dist/utils-BQ7WL7Jh.js.map +0 -1
@@ -0,0 +1,1457 @@
1
+ //#region src/constants/index.ts
2
+ const CONFIG = {
3
+ CACHE_LIMIT: 50,
4
+ DOCUMENT_CACHE_LIMIT: 4,
5
+ SCRIPT_CACHE_LIMIT: 10
6
+ };
7
+ const DATA_ATTR = {
8
+ ID: "data-id",
9
+ BINDING: "data-binding",
10
+ ITEM: "data-item"
11
+ };
12
+ const RESERVED_BINDING_PROPERTIES = [
13
+ DATA_ATTR.ID,
14
+ "data-name",
15
+ DATA_ATTR.BINDING
16
+ ];
17
+ const REGEX = {
18
+ NUMBER: /^\d+(\.\d+)?$/,
19
+ BOOLEAN_OR_NULL: /^(true|false|null|undefined)$/,
20
+ MODULE_IMPORT_EXPORT_LINE: /^\s*(?:import|export)\b[^\n]*\bfrom\s+['"][^'"]*['"];?\s*$/gm
21
+ };
22
+ const TS_PATTERNS = [
23
+ /interface\s+\w+/,
24
+ /type\s+\w+\s*=/,
25
+ /:\s*\w+(\[\])?(\s*\||\s*&|\s*=|\s*;|\s*,|\s*\))/,
26
+ /as\s+\w+/,
27
+ /<[A-Z]\w*>/,
28
+ /enum\s+\w+/,
29
+ /public\s+|private\s+|protected\s+/,
30
+ /readonly\s+/,
31
+ /\?\s*:/
32
+ ];
33
+ const BINDING_PROP = {
34
+ CHILDREN: "children",
35
+ INNER_TEXT: "innerText",
36
+ INNER_HTML: "innerHTML",
37
+ ITEMS: "items"
38
+ };
39
+ const DEFAULT_CONTAINER_ID = "app-container";
40
+ const documentTemplate = (containerId) => `
41
+ import * as ui from 'ui-kit';
42
+ import { cn } from 'ui-kit/utils';
43
+
44
+ const App = () => {
45
+ return (
46
+ <main id="${containerId}"></main>
47
+ )
48
+ }
49
+
50
+ export default App;
51
+ `;
52
+ const DEFAULT_TEMPLATE = documentTemplate(DEFAULT_CONTAINER_ID);
53
+ const DRAGGABLE_ITEMS = [
54
+ {
55
+ id: "hero",
56
+ name: "Hero",
57
+ code: `
58
+ <section
59
+ data-name="Hero"
60
+ className={cn(
61
+ 'text-center text-white',
62
+ //
63
+ )}
64
+ >
65
+ <ui.Space
66
+ data-id=""
67
+ data-binding={[
68
+ {
69
+ label: 'Background Style',
70
+ property: 'style',
71
+ type: 'object',
72
+ // Types the keys inside the object value; a leaf takes the same
73
+ // fields as a top-level binding.
74
+ render: {
75
+ backgroundColor: { type: 'color', label: 'Background Color' },
76
+ },
77
+ // Not a library field, so it arrives as meta.group.
78
+ group: 'layout',
79
+ },
80
+ {
81
+ label: 'Content Spacing',
82
+ property: 'size',
83
+ type: 'number',
84
+ // Constraints the library validates with or without a widget.
85
+ min: 0,
86
+ max: 40,
87
+ // Presentation only: the built-in panel ignores it and shows a
88
+ // number input; a custom panel can switch on widget.type.
89
+ widget: { type: 'slider', step: 4, unit: 'px' },
90
+ group: 'layout',
91
+ },
92
+ ]}
93
+ style={{
94
+ backgroundColor: '#6366f1',
95
+ }}
96
+ orientation="vertical"
97
+ size={16}
98
+ align="center"
99
+ className={cn(
100
+ 'px-5 py-15',
101
+ //
102
+ )}
103
+ >
104
+ <h1
105
+ data-id=""
106
+ data-binding={[
107
+ {
108
+ label: 'Title',
109
+ property: 'innerText',
110
+ type: 'string',
111
+ required: true,
112
+ },
113
+ ]}
114
+ className={cn(
115
+ 'text-5xl font-bold',
116
+ //
117
+ )}
118
+ >
119
+ Welcome to Live Editor
120
+ </h1>
121
+ <p
122
+ data-id=""
123
+ data-binding={[
124
+ {
125
+ label: 'Description',
126
+ type: 'richtext',
127
+ },
128
+ ]}
129
+ className={cn(
130
+ 'text-xl',
131
+ //
132
+ )}
133
+ >
134
+ Build <strong>dynamic components</strong> with drag & drop
135
+ </p>
136
+ <ui.Button
137
+ data-id=""
138
+ data-binding={[
139
+ {
140
+ label: 'Button Text',
141
+ property: 'innerText',
142
+ },
143
+ {
144
+ label: 'Button Icon',
145
+ property: 'icon',
146
+ type: 'jsx',
147
+ },
148
+ {
149
+ label: 'Button Size',
150
+ property: 'size',
151
+ options: [
152
+ { label: 'Small', value: 'small' },
153
+ { label: 'Middle', value: 'middle' },
154
+ { label: 'Large', value: 'large' },
155
+ ],
156
+ },
157
+ {
158
+ label: 'Button Variant',
159
+ property: 'variant',
160
+ options: [
161
+ { label: 'Solid', value: 'solid' },
162
+ { label: 'Outlined', value: 'outlined' },
163
+ { label: 'Filled', value: 'filled' },
164
+ ],
165
+ },
166
+ ]}
167
+ icon={<span>🚀</span>}
168
+ size="large"
169
+ variant="solid"
170
+ className={cn(
171
+ 'bg-white text-indigo-500',
172
+ 'hover:bg-gray-50',
173
+ //
174
+ )}
175
+ >
176
+ Get Started
177
+ </ui.Button>
178
+ </ui.Space>
179
+ </section>
180
+ `
181
+ },
182
+ {
183
+ id: "features",
184
+ name: "Features",
185
+ code: `
186
+ <section
187
+ data-name="Features"
188
+ className={cn(
189
+ 'px-5 py-10',
190
+ //
191
+ )}
192
+ >
193
+ <ui.Space
194
+ data-id=""
195
+ data-binding={[
196
+ {
197
+ label: 'Feature Cards',
198
+ property: 'children',
199
+ },
200
+ ]}
201
+ className={cn(
202
+ 'mx-auto max-w-7xl',
203
+ //
204
+ )}
205
+ size="large"
206
+ wrap
207
+ >
208
+ <ui.Card
209
+ className={cn(
210
+ 'min-w-70 flex-1 text-center',
211
+ //
212
+ )}
213
+ >
214
+ <ui.Space orientation="vertical" size="middle" align="center">
215
+ <div
216
+ data-id=""
217
+ data-binding={[
218
+ {
219
+ label: 'Icon',
220
+ property: 'innerText',
221
+ },
222
+ ]}
223
+ className={cn(
224
+ 'text-5xl',
225
+ //
226
+ )}
227
+ >
228
+ 🚀
229
+ </div>
230
+ <h3
231
+ data-id=""
232
+ data-binding={[
233
+ {
234
+ label: 'Title',
235
+ property: 'innerText',
236
+ },
237
+ ]}
238
+ className={cn(
239
+ 'text-2xl text-gray-800',
240
+ //
241
+ )}
242
+ >
243
+ Feature 1
244
+ </h3>
245
+ <p
246
+ data-id=""
247
+ data-binding={[
248
+ {
249
+ label: 'Description',
250
+ property: 'innerText',
251
+ },
252
+ ]}
253
+ className={cn(
254
+ 'text-gray-600',
255
+ //
256
+ )}
257
+ >
258
+ Amazing feature description
259
+ </p>
260
+ </ui.Space>
261
+ </ui.Card>
262
+ <ui.Card
263
+ className={cn(
264
+ 'min-w-70 flex-1 text-center',
265
+ //
266
+ )}
267
+ >
268
+ <ui.Space orientation="vertical" size="middle" align="center">
269
+ <div
270
+ data-id=""
271
+ data-binding={[
272
+ {
273
+ label: 'Icon',
274
+ property: 'innerText',
275
+ },
276
+ ]}
277
+ className={cn(
278
+ 'text-5xl',
279
+ //
280
+ )}
281
+ >
282
+ ⚡
283
+ </div>
284
+ <h3
285
+ data-id=""
286
+ data-binding={[
287
+ {
288
+ label: 'Title',
289
+ property: 'innerText',
290
+ },
291
+ ]}
292
+ className={cn(
293
+ 'text-2xl text-gray-800',
294
+ //
295
+ )}
296
+ >
297
+ Feature 2
298
+ </h3>
299
+ <p
300
+ data-id=""
301
+ data-binding={[
302
+ {
303
+ label: 'Description',
304
+ property: 'innerText',
305
+ },
306
+ ]}
307
+ className={cn(
308
+ 'text-gray-600',
309
+ //
310
+ )}
311
+ >
312
+ Another great feature
313
+ </p>
314
+ </ui.Space>
315
+ </ui.Card>
316
+ <ui.Card
317
+ className={cn(
318
+ 'min-w-70 flex-1 text-center',
319
+ //
320
+ )}
321
+ >
322
+ <ui.Space orientation="vertical" size="middle" align="center">
323
+ <div
324
+ data-id=""
325
+ data-binding={[
326
+ {
327
+ label: 'Icon',
328
+ property: 'innerText',
329
+ },
330
+ ]}
331
+ className={cn(
332
+ 'text-5xl',
333
+ //
334
+ )}
335
+ >
336
+ ✨
337
+ </div>
338
+ <h3
339
+ data-id=""
340
+ data-binding={[
341
+ {
342
+ label: 'Title',
343
+ property: 'innerText',
344
+ },
345
+ ]}
346
+ className={cn(
347
+ 'text-2xl text-gray-800',
348
+ //
349
+ )}
350
+ >
351
+ Feature 3
352
+ </h3>
353
+ <p
354
+ data-id=""
355
+ data-binding={[
356
+ {
357
+ label: 'Description',
358
+ property: 'innerText',
359
+ },
360
+ ]}
361
+ className={cn(
362
+ 'text-gray-600',
363
+ //
364
+ )}
365
+ >
366
+ One more awesome thing
367
+ </p>
368
+ </ui.Space>
369
+ </ui.Card>
370
+ </ui.Space>
371
+ </section>
372
+ `
373
+ },
374
+ {
375
+ id: "about",
376
+ name: "About",
377
+ code: `
378
+ <section
379
+ data-name="About"
380
+ className={cn(
381
+ 'mx-auto max-w-3xl px-5 py-10',
382
+ //
383
+ )}
384
+ >
385
+ <ui.Typography.Title
386
+ data-id=""
387
+ data-binding={[{ label: 'Title', property: 'innerText' }]}
388
+ level={2}
389
+ className={cn(
390
+ 'mb-5 text-4xl text-gray-800',
391
+ //
392
+ )}
393
+ >
394
+ About Live Editor
395
+ </ui.Typography.Title>
396
+ <ui.Typography.Paragraph
397
+ data-id=""
398
+ data-binding={[
399
+ {
400
+ label: 'Description 1',
401
+ type: 'richtext',
402
+ },
403
+ ]}
404
+ className={cn(
405
+ 'mb-4 text-lg leading-relaxed text-gray-600',
406
+ //
407
+ )}
408
+ >
409
+ Live Editor is a powerful visual development tool that enables you to
410
+ create stunning web interfaces through an intuitive drag-and-drop
411
+ experience. Built with modern web technologies, it streamlines your
412
+ workflow and accelerates development cycles.
413
+ </ui.Typography.Paragraph>
414
+ <ui.Typography.Paragraph
415
+ data-id=""
416
+ data-binding={[
417
+ {
418
+ label: 'Description 2',
419
+ type: 'richtext',
420
+ },
421
+ ]}
422
+ className={cn(
423
+ 'text-lg leading-relaxed text-gray-600',
424
+ //
425
+ )}
426
+ >
427
+ Whether you&apos;re a seasoned developer or just starting out, Live
428
+ Editor provides the flexibility and control you need to bring your
429
+ creative vision to life. Focus on what matters most - building great
430
+ products.
431
+ </ui.Typography.Paragraph>
432
+ </section>
433
+ `
434
+ },
435
+ {
436
+ id: "cta",
437
+ name: "CTA",
438
+ code: `
439
+ <section
440
+ data-name="CTA"
441
+ className={cn(
442
+ 'bg-gray-50 px-5 py-12 text-center',
443
+ //
444
+ )}
445
+ >
446
+ <div
447
+ className={cn(
448
+ 'mx-auto max-w-xl',
449
+ //
450
+ )}
451
+ >
452
+ <ui.Typography.Title
453
+ data-id=""
454
+ data-binding={[{ label: 'Title', property: 'innerText' }]}
455
+ level={2}
456
+ className={cn(
457
+ 'mb-4 text-3xl text-gray-800',
458
+ //
459
+ )}
460
+ >
461
+ Ready to get started?
462
+ </ui.Typography.Title>
463
+ <ui.Typography.Paragraph
464
+ data-id=""
465
+ data-binding={[
466
+ {
467
+ label: 'Description',
468
+ property: 'innerText',
469
+ },
470
+ ]}
471
+ className={cn(
472
+ 'mb-6 text-lg text-gray-600',
473
+ //
474
+ )}
475
+ >
476
+ Start exploring what Live Editor can do for your projects
477
+ </ui.Typography.Paragraph>
478
+ <ui.Space
479
+ data-id=""
480
+ data-binding={[{ label: 'Buttons', property: 'children' }]}
481
+ className={cn(
482
+ 'flex flex-wrap justify-center gap-4',
483
+ //
484
+ )}
485
+ >
486
+ <ui.Button
487
+ data-id=""
488
+ data-binding={[
489
+ {
490
+ label: 'Button 1 Text',
491
+ property: 'innerText',
492
+ },
493
+ ]}
494
+ size="large"
495
+ className={cn(
496
+ 'bg-indigo-500 px-8 text-base text-white',
497
+ 'hover:bg-indigo-600',
498
+ //
499
+ )}
500
+ >
501
+ View Documentation
502
+ </ui.Button>
503
+ <ui.Button
504
+ data-id=""
505
+ data-binding={[
506
+ {
507
+ label: 'Button 2 Text',
508
+ property: 'innerText',
509
+ },
510
+ ]}
511
+ variant="outlined"
512
+ size="large"
513
+ className={cn(
514
+ 'border-2 border-indigo-500 px-8 text-base text-indigo-500',
515
+ 'hover:bg-indigo-50',
516
+ //
517
+ )}
518
+ >
519
+ View Examples
520
+ </ui.Button>
521
+ </ui.Space>
522
+ </div>
523
+ </section>
524
+ `
525
+ },
526
+ {
527
+ id: "getting-started",
528
+ name: "Getting Started",
529
+ code: `
530
+ <section
531
+ data-name="Getting Started"
532
+ className={cn(
533
+ 'px-5 py-16',
534
+ //
535
+ )}
536
+ >
537
+ <div
538
+ className={cn(
539
+ 'mx-auto max-w-5xl',
540
+ //
541
+ )}
542
+ >
543
+ <ui.Typography.Title
544
+ data-id=""
545
+ data-binding={[{ label: 'Title', property: 'innerText' }]}
546
+ level={2}
547
+ className={cn(
548
+ 'mb-12 text-center text-4xl font-bold text-gray-800',
549
+ //
550
+ )}
551
+ >
552
+ How to Get Started
553
+ </ui.Typography.Title>
554
+ <div
555
+ className={cn(
556
+ 'grid gap-8 md:grid-cols-3',
557
+ //
558
+ )}
559
+ >
560
+ <ui.Card
561
+ data-id=""
562
+ data-binding={[
563
+ {
564
+ label: 'Card 1 Content',
565
+ property: 'children',
566
+ },
567
+ ]}
568
+ className={cn(
569
+ 'rounded-lg border-2 border-gray-200 bg-white p-8',
570
+ //
571
+ )}
572
+ >
573
+ <ui.Typography.Title
574
+ data-id=""
575
+ data-binding={[
576
+ {
577
+ label: 'Card 1 Title',
578
+ property: 'innerText',
579
+ },
580
+ ]}
581
+ level={3}
582
+ className={cn(
583
+ 'mb-2 text-2xl font-bold text-gray-800',
584
+ //
585
+ )}
586
+ >
587
+ Explore
588
+ </ui.Typography.Title>
589
+ <ui.Typography.Paragraph
590
+ data-id=""
591
+ data-binding={[
592
+ {
593
+ label: 'Card 1 Icon',
594
+ property: 'innerText',
595
+ },
596
+ ]}
597
+ className={cn(
598
+ 'mb-6 text-4xl font-bold text-indigo-600',
599
+ //
600
+ )}
601
+ >
602
+ 📚
603
+ </ui.Typography.Paragraph>
604
+ <ul
605
+ className={cn(
606
+ 'mb-8 space-y-3 text-gray-600',
607
+ //
608
+ )}
609
+ >
610
+ <li>✓ Read documentation</li>
611
+ <li>✓ Browse examples</li>
612
+ <li>✓ Try the demo</li>
613
+ </ul>
614
+ <ui.Button
615
+ data-id=""
616
+ data-binding={[
617
+ {
618
+ label: 'Card 1 Button',
619
+ property: 'innerText',
620
+ },
621
+ ]}
622
+ variant="outlined"
623
+ size="large"
624
+ block
625
+ className={cn(
626
+ 'border-2 border-indigo-500 text-indigo-500',
627
+ 'hover:bg-indigo-50',
628
+ //
629
+ )}
630
+ >
631
+ View Docs
632
+ </ui.Button>
633
+ </ui.Card>
634
+ <ui.Card
635
+ data-id=""
636
+ data-binding={[
637
+ {
638
+ label: 'Card 2 Content',
639
+ property: 'children',
640
+ },
641
+ ]}
642
+ className={cn(
643
+ 'relative rounded-lg border-2 border-indigo-500 bg-white p-8',
644
+ //
645
+ )}
646
+ >
647
+ <div
648
+ className={cn(
649
+ 'absolute -top-4 left-1/2 -translate-x-1/2',
650
+ 'rounded-full bg-indigo-500 px-4 py-1 text-sm text-white',
651
+ //
652
+ )}
653
+ >
654
+ Recommended
655
+ </div>
656
+ <ui.Typography.Title
657
+ data-id=""
658
+ data-binding={[
659
+ {
660
+ label: 'Card 2 Title',
661
+ property: 'innerText',
662
+ },
663
+ ]}
664
+ level={3}
665
+ className={cn(
666
+ 'mb-2 text-2xl font-bold text-gray-800',
667
+ //
668
+ )}
669
+ >
670
+ Practice
671
+ </ui.Typography.Title>
672
+ <ui.Typography.Paragraph
673
+ data-id=""
674
+ data-binding={[
675
+ {
676
+ label: 'Card 2 Icon',
677
+ property: 'innerText',
678
+ },
679
+ ]}
680
+ className={cn(
681
+ 'mb-6 text-4xl font-bold text-indigo-600',
682
+ //
683
+ )}
684
+ >
685
+ 💻
686
+ </ui.Typography.Paragraph>
687
+ <ul
688
+ className={cn(
689
+ 'mb-8 space-y-3 text-gray-600',
690
+ //
691
+ )}
692
+ >
693
+ <li>✓ Interactive playground</li>
694
+ <li>✓ Experiment freely</li>
695
+ <li>✓ Build your own</li>
696
+ </ul>
697
+ <ui.Button
698
+ data-id=""
699
+ data-binding={[
700
+ {
701
+ label: 'Card 2 Button',
702
+ property: 'innerText',
703
+ },
704
+ ]}
705
+ size="large"
706
+ block
707
+ className={cn(
708
+ 'bg-indigo-500 text-white',
709
+ 'hover:bg-indigo-600',
710
+ //
711
+ )}
712
+ >
713
+ Start Building
714
+ </ui.Button>
715
+ </ui.Card>
716
+ <ui.Card
717
+ data-id=""
718
+ data-binding={[
719
+ {
720
+ label: 'Card 3 Content',
721
+ property: 'children',
722
+ },
723
+ ]}
724
+ className={cn(
725
+ 'rounded-lg border-2 border-gray-200 bg-white p-8',
726
+ //
727
+ )}
728
+ >
729
+ <ui.Typography.Title
730
+ data-id=""
731
+ data-binding={[
732
+ {
733
+ label: 'Card 3 Title',
734
+ property: 'innerText',
735
+ },
736
+ ]}
737
+ level={3}
738
+ className={cn(
739
+ 'mb-2 text-2xl font-bold text-gray-800',
740
+ //
741
+ )}
742
+ >
743
+ Contribute
744
+ </ui.Typography.Title>
745
+ <ui.Typography.Paragraph
746
+ data-id=""
747
+ data-binding={[
748
+ {
749
+ label: 'Card 3 Icon',
750
+ property: 'innerText',
751
+ },
752
+ ]}
753
+ className={cn(
754
+ 'mb-6 text-4xl font-bold text-indigo-600',
755
+ //
756
+ )}
757
+ >
758
+ 🤝
759
+ </ui.Typography.Paragraph>
760
+ <ul
761
+ className={cn(
762
+ 'mb-8 space-y-3 text-gray-600',
763
+ //
764
+ )}
765
+ >
766
+ <li>✓ Report issues</li>
767
+ <li>✓ Suggest features</li>
768
+ <li>✓ Submit pull requests</li>
769
+ </ul>
770
+ <ui.Button
771
+ data-id=""
772
+ data-binding={[
773
+ {
774
+ label: 'Card 3 Button',
775
+ property: 'innerText',
776
+ },
777
+ ]}
778
+ variant="outlined"
779
+ size="large"
780
+ block
781
+ className={cn(
782
+ 'border-2 border-indigo-500 text-indigo-500',
783
+ 'hover:bg-indigo-50',
784
+ //
785
+ )}
786
+ >
787
+ View on GitHub
788
+ </ui.Button>
789
+ </ui.Card>
790
+ </div>
791
+ </div>
792
+ </section>
793
+ `
794
+ },
795
+ {
796
+ id: "key-features",
797
+ name: "Key Features",
798
+ code: `
799
+ <section
800
+ data-name="Key Features"
801
+ className={cn(
802
+ 'bg-indigo-50 px-5 py-16',
803
+ //
804
+ )}
805
+ >
806
+ <div
807
+ className={cn(
808
+ 'mx-auto max-w-6xl',
809
+ //
810
+ )}
811
+ >
812
+ <h2
813
+ data-id=""
814
+ data-binding={[{ label: 'Title', property: 'innerText' }]}
815
+ className={cn(
816
+ 'mb-12 text-center text-4xl font-bold text-gray-800',
817
+ //
818
+ )}
819
+ >
820
+ Key Features
821
+ </h2>
822
+ <div
823
+ className={cn(
824
+ 'grid gap-8 md:grid-cols-2',
825
+ //
826
+ )}
827
+ >
828
+ <div
829
+ className={cn(
830
+ 'rounded-lg bg-white p-8 shadow-md',
831
+ //
832
+ )}
833
+ >
834
+ <div
835
+ className={cn(
836
+ 'mb-4 text-4xl',
837
+ //
838
+ )}
839
+ >
840
+ 🎨
841
+ </div>
842
+ <h3
843
+ className={cn(
844
+ 'mb-4 text-2xl font-bold text-gray-800',
845
+ //
846
+ )}
847
+ >
848
+ Visual Editing
849
+ </h3>
850
+ <p
851
+ className={cn(
852
+ 'text-gray-600',
853
+ //
854
+ )}
855
+ >
856
+ See your changes in real-time as you build. Live Editor provides
857
+ instant visual feedback, making it easier to understand how code
858
+ affects your interface.
859
+ </p>
860
+ </div>
861
+ <div
862
+ className={cn(
863
+ 'rounded-lg bg-white p-8 shadow-md',
864
+ //
865
+ )}
866
+ >
867
+ <div
868
+ className={cn(
869
+ 'mb-4 text-4xl',
870
+ //
871
+ )}
872
+ >
873
+ 🧩
874
+ </div>
875
+ <h3
876
+ className={cn(
877
+ 'mb-4 text-2xl font-bold text-gray-800',
878
+ //
879
+ )}
880
+ >
881
+ Component-Based
882
+ </h3>
883
+ <p
884
+ className={cn(
885
+ 'text-gray-600',
886
+ //
887
+ )}
888
+ >
889
+ Build with reusable components that you can drag, drop, and
890
+ customize. Learn modern development patterns while creating your
891
+ interface.
892
+ </p>
893
+ </div>
894
+ </div>
895
+ </div>
896
+ </section>
897
+ `
898
+ },
899
+ {
900
+ id: "stats",
901
+ name: "Stats",
902
+ code: `
903
+ <section
904
+ data-name="Stats"
905
+ className={cn(
906
+ 'bg-indigo-600 text-white',
907
+ //
908
+ )}
909
+ >
910
+ <ui.Marquees
911
+ data-id=""
912
+ data-binding={[
913
+ { label: 'Stats Items', property: 'items' },
914
+ {
915
+ label: 'Scroll Speed',
916
+ property: 'speed',
917
+ type: 'number',
918
+ min: 20,
919
+ max: 300,
920
+ // The bare-string form; it arrives as { type: 'slider' }.
921
+ widget: 'slider',
922
+ },
923
+ { label: 'Pause On Hover', property: 'pauseOnHover', type: 'boolean' },
924
+ ]}
925
+ speed={100}
926
+ pauseOnHover={true}
927
+ autoFill={true}
928
+ className="px-5 py-16"
929
+ items={[
930
+ {
931
+ key: 'stats-row',
932
+ children: (
933
+ <div
934
+ data-id=""
935
+ data-binding={[
936
+ {
937
+ label: 'Stats Cards',
938
+ property: 'children',
939
+ },
940
+ ]}
941
+ className={cn('flex gap-20')}
942
+ >
943
+ <div
944
+ className={cn(
945
+ 'min-w-60 text-center',
946
+ //
947
+ )}
948
+ >
949
+ <p
950
+ data-id=""
951
+ data-binding={[
952
+ {
953
+ label: 'Title',
954
+ property: 'innerText',
955
+ },
956
+ ]}
957
+ className={cn(
958
+ 'mb-2 text-5xl font-bold',
959
+ //
960
+ )}
961
+ >
962
+ Open
963
+ </p>
964
+ <p
965
+ data-id=""
966
+ data-binding={[
967
+ {
968
+ label: 'Description',
969
+ property: 'innerText',
970
+ },
971
+ ]}
972
+ className={cn(
973
+ 'text-indigo-200',
974
+ //
975
+ )}
976
+ >
977
+ Source Project
978
+ </p>
979
+ </div>
980
+ <div
981
+ className={cn(
982
+ 'min-w-60 text-center',
983
+ //
984
+ )}
985
+ >
986
+ <p
987
+ data-id=""
988
+ data-binding={[
989
+ {
990
+ label: 'Title',
991
+ property: 'innerText',
992
+ },
993
+ ]}
994
+ className={cn(
995
+ 'mb-2 text-5xl font-bold',
996
+ //
997
+ )}
998
+ >
999
+ Free
1000
+ </p>
1001
+ <p
1002
+ data-id=""
1003
+ data-binding={[
1004
+ {
1005
+ label: 'Description',
1006
+ property: 'innerText',
1007
+ },
1008
+ ]}
1009
+ className={cn(
1010
+ 'text-indigo-200',
1011
+ //
1012
+ )}
1013
+ >
1014
+ For Everyone
1015
+ </p>
1016
+ </div>
1017
+ <div
1018
+ className={cn(
1019
+ 'min-w-60 text-center',
1020
+ //
1021
+ )}
1022
+ >
1023
+ <p
1024
+ data-id=""
1025
+ data-binding={[
1026
+ {
1027
+ label: 'Title',
1028
+ property: 'innerText',
1029
+ },
1030
+ ]}
1031
+ className={cn(
1032
+ 'mb-2 text-5xl font-bold',
1033
+ //
1034
+ )}
1035
+ >
1036
+ Active
1037
+ </p>
1038
+ <p
1039
+ data-id=""
1040
+ data-binding={[
1041
+ {
1042
+ label: 'Description',
1043
+ property: 'innerText',
1044
+ },
1045
+ ]}
1046
+ className={cn(
1047
+ 'text-indigo-200',
1048
+ //
1049
+ )}
1050
+ >
1051
+ Community
1052
+ </p>
1053
+ </div>
1054
+ <div
1055
+ className={cn(
1056
+ 'min-w-60 text-center',
1057
+ //
1058
+ )}
1059
+ >
1060
+ <p
1061
+ data-id=""
1062
+ data-binding={[
1063
+ {
1064
+ label: 'Title',
1065
+ property: 'innerText',
1066
+ },
1067
+ ]}
1068
+ className={cn(
1069
+ 'mb-2 text-5xl font-bold',
1070
+ //
1071
+ )}
1072
+ >
1073
+ Learn
1074
+ </p>
1075
+ <p
1076
+ data-id=""
1077
+ data-binding={[
1078
+ {
1079
+ label: 'Description',
1080
+ property: 'innerText',
1081
+ },
1082
+ ]}
1083
+ className={cn(
1084
+ 'text-indigo-200',
1085
+ //
1086
+ )}
1087
+ >
1088
+ By Doing
1089
+ </p>
1090
+ </div>
1091
+ </div>
1092
+ ),
1093
+ },
1094
+ ]}
1095
+ />
1096
+ </section>
1097
+ `
1098
+ },
1099
+ {
1100
+ id: "roadmap",
1101
+ name: "Roadmap",
1102
+ code: `
1103
+ <section
1104
+ data-name="Roadmap"
1105
+ className={cn(
1106
+ 'px-5 py-16',
1107
+ //
1108
+ )}
1109
+ >
1110
+ <div
1111
+ className={cn(
1112
+ 'mx-auto max-w-3xl',
1113
+ //
1114
+ )}
1115
+ >
1116
+ <h2
1117
+ data-id=""
1118
+ data-binding={[
1119
+ { label: 'Title', property: 'innerText', required: true },
1120
+ ]}
1121
+ className={cn(
1122
+ 'mb-8 text-center text-4xl font-bold text-gray-800',
1123
+ //
1124
+ )}
1125
+ >
1126
+ Roadmap
1127
+ </h2>
1128
+ <ui.List
1129
+ data-id=""
1130
+ data-binding={[
1131
+ {
1132
+ label: 'Milestones',
1133
+ property: 'data',
1134
+ type: 'array',
1135
+ // One leaf per item key. Each leaf takes the same fields as a
1136
+ // top-level binding, and label falls back to the key.
1137
+ render: {
1138
+ title: {
1139
+ type: 'string',
1140
+ label: 'Title',
1141
+ required: true,
1142
+ },
1143
+ date: { type: 'date', label: 'Release Date', required: true },
1144
+ status: {
1145
+ type: 'string',
1146
+ label: 'Status',
1147
+ options: [
1148
+ { label: 'Planned', value: 'planned' },
1149
+ { label: 'In Progress', value: 'in-progress' },
1150
+ { label: 'Shipped', value: 'shipped' },
1151
+ ],
1152
+ },
1153
+ progress: {
1154
+ type: 'number',
1155
+ label: 'Progress',
1156
+ min: 0,
1157
+ max: 100,
1158
+ widget: { type: 'slider', step: 10, unit: '%' },
1159
+ },
1160
+ color: { type: 'color', label: 'Accent Color' },
1161
+ highlight: { type: 'boolean', label: 'Highlight' },
1162
+ // An object-valued key: its own render map types the keys
1163
+ // inside it, one level further down.
1164
+ link: {
1165
+ type: 'object',
1166
+ label: 'Link',
1167
+ render: {
1168
+ text: { type: 'string', label: 'Link Text' },
1169
+ href: {
1170
+ type: 'url',
1171
+ label: 'Link URL',
1172
+ pattern: '^https://',
1173
+ // Not a library field, so it arrives as meta.hint.
1174
+ hint: 'Must use https',
1175
+ },
1176
+ },
1177
+ },
1178
+ },
1179
+ },
1180
+ ]}
1181
+ data={[
1182
+ {
1183
+ title: 'Visual editing',
1184
+ date: '2026-03-02',
1185
+ status: 'shipped',
1186
+ progress: 100,
1187
+ color: '#22c55e',
1188
+ highlight: false,
1189
+ link: { text: 'Release notes', href: 'https://github.com' },
1190
+ },
1191
+ {
1192
+ title: 'Custom panels',
1193
+ date: '2026-09-26',
1194
+ status: 'in-progress',
1195
+ progress: 60,
1196
+ color: '#6366f1',
1197
+ highlight: true,
1198
+ link: { text: 'Guide', href: 'https://github.com' },
1199
+ },
1200
+ {
1201
+ title: 'Collaboration',
1202
+ date: '2027-01-15',
1203
+ status: 'planned',
1204
+ progress: 0,
1205
+ color: '#f59e0b',
1206
+ highlight: false,
1207
+ link: { text: 'Discussion', href: 'https://github.com' },
1208
+ },
1209
+ ]}
1210
+ itemKey={item => item.title}
1211
+ renderItem={item => (
1212
+ <div
1213
+ className={cn(
1214
+ 'flex items-center gap-4 border-b border-gray-100 py-4',
1215
+ item.highlight && 'rounded-lg bg-indigo-50 px-4',
1216
+ )}
1217
+ >
1218
+ <span
1219
+ className="size-3 shrink-0 rounded-full"
1220
+ style={{ backgroundColor: item.color }}
1221
+ />
1222
+ <div className="min-w-0 flex-1">
1223
+ <p className="font-semibold text-gray-800">{item.title}</p>
1224
+ <p className="text-sm text-gray-500">
1225
+ {item.date} · {item.status}
1226
+ </p>
1227
+ <ui.Progress value={item.progress} className="mt-2" />
1228
+ </div>
1229
+ <a
1230
+ href={item.link.href}
1231
+ className="text-sm text-indigo-500 hover:underline"
1232
+ >
1233
+ {item.link.text}
1234
+ </a>
1235
+ </div>
1236
+ )}
1237
+ />
1238
+ <p
1239
+ className={cn(
1240
+ 'mt-6 text-center text-sm text-gray-500',
1241
+ //
1242
+ )}
1243
+ >
1244
+ Last updated{' '}
1245
+ <time
1246
+ data-id=""
1247
+ data-binding={[
1248
+ {
1249
+ label: 'Updated On',
1250
+ property: 'dateTime',
1251
+ type: 'date',
1252
+ required: true,
1253
+ },
1254
+ { label: 'Updated Text', property: 'innerText' },
1255
+ ]}
1256
+ dateTime="2026-09-26"
1257
+ >
1258
+ September 26, 2026
1259
+ </time>
1260
+ {' · '}
1261
+ <a
1262
+ data-id=""
1263
+ data-binding={[
1264
+ { label: 'Link Text', property: 'innerText' },
1265
+ {
1266
+ label: 'Link URL',
1267
+ property: 'href',
1268
+ type: 'url',
1269
+ required: true,
1270
+ pattern: '^https://',
1271
+ },
1272
+ ]}
1273
+ href="https://github.com/pjb0811/live-editor/releases"
1274
+ className="text-indigo-500 hover:underline"
1275
+ >
1276
+ All releases
1277
+ </a>
1278
+ </p>
1279
+ </div>
1280
+ </section>
1281
+ `
1282
+ },
1283
+ {
1284
+ id: "faq",
1285
+ name: "FAQ",
1286
+ code: `
1287
+ <section
1288
+ data-name="FAQ"
1289
+ className={cn(
1290
+ 'px-5 py-16',
1291
+ //
1292
+ )}
1293
+ >
1294
+ <div
1295
+ className={cn(
1296
+ 'mx-auto max-w-3xl',
1297
+ //
1298
+ )}
1299
+ >
1300
+ <ui.Typography.Title
1301
+ data-id=""
1302
+ data-binding={[{ label: 'Title', property: 'innerText' }]}
1303
+ level={2}
1304
+ className={cn(
1305
+ 'mb-12 text-center text-4xl font-bold text-gray-800',
1306
+ //
1307
+ )}
1308
+ >
1309
+ Frequently Asked Questions
1310
+ </ui.Typography.Title>
1311
+ <ui.Collapse
1312
+ data-id=""
1313
+ data-binding={[{ label: 'FAQ Items', property: 'items' }]}
1314
+ items={[
1315
+ {
1316
+ key: '1',
1317
+ label: (
1318
+ <ui.Typography.Text
1319
+ data-id=""
1320
+ data-binding={[
1321
+ {
1322
+ label: 'Question 1',
1323
+ property: 'innerText',
1324
+ },
1325
+ ]}
1326
+ className={cn('text-lg font-semibold text-gray-800')}
1327
+ >
1328
+ What is Live Editor?
1329
+ </ui.Typography.Text>
1330
+ ),
1331
+ children: (
1332
+ <ui.Typography.Paragraph
1333
+ data-id=""
1334
+ data-binding={[
1335
+ {
1336
+ label: 'Answer 1',
1337
+ type: 'richtext',
1338
+ },
1339
+ ]}
1340
+ className={cn('text-gray-600')}
1341
+ >
1342
+ Live Editor is an open-source tool for building web
1343
+ interfaces visually. It helps you learn web development by
1344
+ providing instant feedback as you build components.
1345
+ </ui.Typography.Paragraph>
1346
+ ),
1347
+ },
1348
+ {
1349
+ key: '2',
1350
+ label: (
1351
+ <ui.Typography.Text
1352
+ data-id=""
1353
+ data-binding={[
1354
+ {
1355
+ label: 'Question 2',
1356
+ property: 'innerText',
1357
+ },
1358
+ ]}
1359
+ className={cn('text-lg font-semibold text-gray-800')}
1360
+ >
1361
+ Do I need coding experience?
1362
+ </ui.Typography.Text>
1363
+ ),
1364
+ children: (
1365
+ <ui.Typography.Paragraph
1366
+ data-id=""
1367
+ data-binding={[
1368
+ {
1369
+ label: 'Answer 2',
1370
+ type: 'richtext',
1371
+ },
1372
+ ]}
1373
+ className={cn('text-gray-600')}
1374
+ >
1375
+ No! Live Editor is designed for all skill levels. Beginners
1376
+ can learn through visual editing, while experienced
1377
+ developers can work directly with code.
1378
+ </ui.Typography.Paragraph>
1379
+ ),
1380
+ },
1381
+ {
1382
+ key: '3',
1383
+ label: (
1384
+ <ui.Typography.Text
1385
+ data-id=""
1386
+ data-binding={[
1387
+ {
1388
+ label: 'Question 3',
1389
+ property: 'innerText',
1390
+ },
1391
+ ]}
1392
+ className={cn('text-lg font-semibold text-gray-800')}
1393
+ >
1394
+ Is it really free?
1395
+ </ui.Typography.Text>
1396
+ ),
1397
+ children: (
1398
+ <ui.Typography.Paragraph
1399
+ data-id=""
1400
+ data-binding={[
1401
+ {
1402
+ label: 'Answer 3',
1403
+ type: 'richtext',
1404
+ },
1405
+ ]}
1406
+ className={cn('text-gray-600')}
1407
+ >
1408
+ Yes, completely free! Live Editor is an open-source project
1409
+ with no hidden costs or premium tiers. All features are
1410
+ available to everyone.
1411
+ </ui.Typography.Paragraph>
1412
+ ),
1413
+ },
1414
+ {
1415
+ key: '4',
1416
+ label: (
1417
+ <ui.Typography.Text
1418
+ data-id=""
1419
+ data-binding={[
1420
+ {
1421
+ label: 'Question 4',
1422
+ property: 'innerText',
1423
+ },
1424
+ ]}
1425
+ className={cn('text-lg font-semibold text-gray-800')}
1426
+ >
1427
+ How can I contribute?
1428
+ </ui.Typography.Text>
1429
+ ),
1430
+ children: (
1431
+ <ui.Typography.Paragraph
1432
+ data-id=""
1433
+ data-binding={[
1434
+ {
1435
+ label: 'Answer 4',
1436
+ type: 'richtext',
1437
+ },
1438
+ ]}
1439
+ className={cn('text-gray-600')}
1440
+ >
1441
+ You can contribute by reporting bugs, suggesting features,
1442
+ sharing your projects, or contributing code. Check our
1443
+ GitHub repository for more details.
1444
+ </ui.Typography.Paragraph>
1445
+ ),
1446
+ },
1447
+ ]}
1448
+ />
1449
+ </div>
1450
+ </section>
1451
+ `
1452
+ }
1453
+ ];
1454
+ //#endregion
1455
+ export { DEFAULT_TEMPLATE as a, RESERVED_BINDING_PROPERTIES as c, DEFAULT_CONTAINER_ID as i, TS_PATTERNS as l, CONFIG as n, DRAGGABLE_ITEMS as o, DATA_ATTR as r, REGEX as s, BINDING_PROP as t, documentTemplate as u };
1456
+
1457
+ //# sourceMappingURL=constants-CKvdqZtO.js.map