-
-
Notifications
You must be signed in to change notification settings - Fork 80
Expand file tree
/
Copy pathindex.html
More file actions
664 lines (612 loc) · 34.9 KB
/
index.html
File metadata and controls
664 lines (612 loc) · 34.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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
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
436
437
438
439
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
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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Herb Playground</title>
<script src="https://cdn.tailwindcss.com"></script>
<script>
tailwind.config = {
darkMode: 'class'
}
</script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/js/all.min.js"
integrity="sha512-GWzVrcGlo0TxTRvz9ttioyYJ+Wwk9Ck0G81D+eO63BaqHaJ3YZX9wuqjwgfcV/MrB2PhaVX9DkYVhbFpStnqpQ=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
></script>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/prism-themes/1.9.0/prism-one-dark.min.css"
/>
</head>
<body class="bg-white dark:bg-zinc-900 flex flex-col" data-controller="playground iframe">
<script type="module" src="/src/entry-client.ts"></script>
<div class="w-full md:max-h-[100vh] overflow-hidden">
<nav
class="mx-auto flex items-center justify-between p-1 py-2 px-8 border dark:border-gray-700 hidden"
data-iframe-target="hide"
>
<div class="flex font-medium items-center h-8 md:flex-1">
<div class="w-auto text-xl">🌿 Herb</div>
<span class="block md:hidden text-gray-500 dark:text-gray-400 ml-2">Playground</span>
</div>
<div class="hidden md:flex">
<div class="text-center text-lg font-medium text-gray-900 dark:text-gray-100">
Playground
</div>
</div>
<div class="hidden lg:flex lg:flex-1 lg:justify-end">
<div class="flex flex-row-reserve space-x-4 py-0 items-center">
<a
href="/prism/"
class="text-sm text-gray-500 dark:text-gray-400 hover:text-gray-600 dark:hover:text-gray-300"
>Prism Playground →</a
>
<a
href="https://docs.herb-tools.dev"
class="text-sm text-gray-500 dark:text-gray-400 hover:text-gray-600 dark:hover:text-gray-300"
target="_blank"
>Documentation</a
>
<a
href="https://github.com/marcoroth/herb"
target="_blank"
class="opacity-50 hover:opacity-100 dark:opacity-70 dark:hover:opacity-100"
>
<i class="h-6 w-6 fa-brands fa-github text-black dark:text-white"></i>
</a>
</div>
</div>
</nav>
<div class="px-3 lg:px-8 h-screen">
<div class="mx-2 grid grid-cols-1 md:grid-cols-2 gap-4">
<div class="mt-6">
<div class="flex flex-wrap lg:flex-nowrap items-center gap-2 lg:gap-3 mb-2">
<div class="flex items-center text-gray-900 dark:text-gray-100 rounded-md px-0 py-1.5 text-sm font-medium">
HTML+ERB File
</div>
<div class="hidden lg:flex items-center gap-4 font-mono whitespace-break-spaces text-gray-400 dark:text-gray-500 text-[8pt] lg:ml-auto">
<div data-playground-target="position"></div>
<span data-playground-target="diagnosticStatus" data-action="click->playground#showDiagnostics" class="hidden lg:flex items-center gap-4 cursor-pointer hover:text-gray-600 dark:hover:text-gray-300" title="Click to view diagnostics">
<span class="flex items-center gap-1" title="Errors">
<i class="fas fa-circle-xmark text-red-500 text-xs"></i>
<span data-playground-target="errorCount">0</span>
</span>
<span class="flex items-center gap-1" title="Warnings">
<i class="fas fa-triangle-exclamation text-yellow-500 text-xs"></i>
<span data-playground-target="warningCount">0</span>
</span>
<span class="flex items-center gap-1" title="Info">
<i class="fas fa-info-circle text-blue-500 text-xs"></i>
<span data-playground-target="infoCount">0</span>
</span>
</span>
</div>
</div>
<div class="flex flex-wrap items-center gap-2 mb-2">
<div class="relative">
<button
data-action="click->playground#copyEditorContent"
data-playground-target="copyButton"
class="text-gray-900 dark:text-gray-100 bg-gray-100 dark:bg-gray-800 hover:bg-gray-200 dark:hover:bg-gray-700 rounded-md px-3 py-1.5 text-sm font-medium"
>
<i class="fas fa-copy"></i>
<i class="fas fa-circle-check text-green-600 hidden ease-in duration-300"></i>
<span class="ml-1">Copy</span>
</button>
<div
data-playground-target="copyTooltip"
class="hidden absolute top-full left-1/2 transform -translate-x-1/2 mt-2 px-2 py-1 text-xs text-white bg-black rounded-md whitespace-nowrap z-50"
>
Copy editor content to clipboard
<div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-l-4 border-r-4 border-b-4 border-transparent border-b-black"></div>
</div>
</div>
<div class="relative">
<button
data-action="click->playground#share"
data-playground-target="shareButton"
id="copy-share-url"
class="text-gray-900 dark:text-gray-100 bg-gray-100 dark:bg-gray-800 hover:bg-gray-200 dark:hover:bg-gray-700 rounded-md px-3 py-1.5 text-sm font-medium"
>
<i class="fas fa-share"></i>
<i
class="fas fa-circle-check text-green-600 hidden ease-in duration-300"
></i>
<i
class="fas fa-circle-xmark text-red-600 hidden ease-in duration-300"
></i>
<span class="ml-1">Share</span>
</button>
<div
data-playground-target="shareTooltip"
class="hidden absolute top-full left-1/2 transform -translate-x-1/2 mt-2 px-2 py-1 text-xs text-white bg-black rounded-md whitespace-nowrap z-50"
>
Share your code, settings, and selected tab - ideal for bug reports
<div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-l-4 border-r-4 border-b-4 border-transparent border-b-black"></div>
</div>
</div>
<div class="relative">
<button
data-action="click->playground#openGitHubIssue"
data-playground-target="githubButton"
class="text-gray-900 dark:text-gray-100 bg-gray-100 dark:bg-gray-800 hover:bg-gray-200 dark:hover:bg-gray-700 rounded-md px-3 py-1.5 text-sm font-medium"
>
<i class="fab fa-github w-4"></i>
<span class="ml-1">Issue</span>
</button>
<div
data-playground-target="githubTooltip"
class="hidden absolute top-full left-1/2 transform -translate-x-1/2 mt-2 px-2 py-1 text-xs text-white bg-black rounded-md whitespace-nowrap z-50"
>
Open GitHub issue with current playground state
<div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-l-4 border-r-4 border-b-4 border-transparent border-b-black"></div>
</div>
</div>
<div class="relative">
<button
data-action="click->playground#insert click->playground#analyze"
data-playground-target="exampleButton"
id="example"
class="text-gray-900 dark:text-gray-100 bg-gray-100 dark:bg-gray-800 hover:bg-gray-200 dark:hover:bg-gray-700 rounded-md px-3 py-1.5 text-sm font-medium"
>
<i class="fas fa-file w-4"></i>
<i
class="fas fa-circle-check w-4 text-green-600 hidden ease-in duration-300"
></i>
<span class="ml-1">Example</span>
</button>
<div
data-playground-target="exampleTooltip"
class="hidden absolute top-full left-1/2 transform -translate-x-1/2 mt-2 px-2 py-1 text-xs text-white bg-black rounded-md whitespace-nowrap z-50"
>
Load example code into the editor
<div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-l-4 border-r-4 border-b-4 border-transparent border-b-black"></div>
</div>
</div>
<div class="relative">
<button
data-action="click->playground#autofixEditor"
data-playground-target="autofixButton"
id="autofix-editor"
class="text-gray-900 dark:text-gray-100 bg-gray-100 dark:bg-gray-800 hover:bg-gray-200 dark:hover:bg-gray-700 rounded-md px-3 py-1.5 text-sm font-medium"
>
<i class="fas fa-wand-magic-sparkles w-4"></i>
<i
class="fas fa-circle-check w-4 text-green-600 hidden ease-in duration-300"
></i>
<span class="ml-1">Autofix</span>
</button>
<div
data-playground-target="autofixTooltip"
class="hidden absolute top-full left-1/2 transform -translate-x-1/2 mt-2 px-2 py-1 text-xs text-white bg-black rounded-md whitespace-nowrap z-50"
>
Autocorrect autocorrectable Herb Linter offenses
<div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-l-4 border-r-4 border-b-4 border-transparent border-b-black"></div>
</div>
</div>
<div class="relative">
<button
data-action="click->playground#formatEditor"
data-playground-target="formatButton"
id="format-editor"
class="text-gray-900 dark:text-gray-100 bg-gray-100 dark:bg-gray-800 hover:bg-gray-200 dark:hover:bg-gray-700 rounded-md px-3 py-1.5 text-sm font-medium"
>
<i class="fas fa-indent w-4"></i>
<i
class="fas fa-circle-check w-4 text-green-600 hidden ease-in duration-300"
></i>
<span class="ml-1">Format</span>
</button>
<div
data-playground-target="formatTooltip"
class="hidden absolute top-full left-1/2 transform -translate-x-1/2 mt-2 px-2 py-1 text-xs text-white bg-black rounded-md whitespace-nowrap z-50"
>
Format the editor content using the Herb Formatter
<div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-l-4 border-r-4 border-b-4 border-transparent border-b-black"></div>
</div>
</div>
<div class="flex items-center gap-0 ml-auto">
<a
data-playground-target="switchLink"
href="/"
class="rounded-l-md text-white bg-green-600 hover:bg-green-700 px-3 py-1.5 text-sm font-medium"
>HTML+ERB (Herb)</a>
<a
data-playground-target="switchLink"
href="/prism/"
class="rounded-r-md text-gray-900 dark:text-gray-100 bg-gray-100 dark:bg-gray-800 hover:bg-gray-200 dark:hover:bg-gray-700 px-3 py-1.5 text-sm font-medium"
>Ruby (Prism)</a>
</div>
</div>
<div
class="mt-2 outline outline-1 outline-gray-300 dark:outline-gray-600 z-10 rounded-md overflow-hidden bg-gray-50 dark:bg-gray-800 h-[30vh] md:h-[calc(100vh-110px)]"
>
<textarea
data-playground-target="input"
data-action="input->playground#input"
id="input"
class="h-full border-none font-mono w-full text-sm dark:bg-gray-800 dark:text-gray-200"
placeholder="Your HTML+ERB content goes here"
></textarea>
</div>
</div>
<div class="mt-6" data-contoller="output">
<div class="flex flex-wrap lg:flex-nowrap items-center gap-2 lg:gap-3 mb-2">
<div class="flex items-center text-gray-900 dark:text-gray-100 rounded-md px-0 py-1.5 text-sm font-medium">
Herb Result
</div>
<div class="flex items-center gap-3 font-mono whitespace-break-spaces text-gray-400 dark:text-gray-500 text-[8pt]">
<span data-playground-target="time"></span>
</div>
<div class="relative flex items-center">
<button
data-action="click->playground#copyViewerContent"
data-playground-target="copyViewerButton"
class="text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 text-sm"
>
<i class="fas fa-copy"></i>
<i class="fas fa-circle-check text-green-600 hidden ease-in duration-300"></i>
</button>
<div
data-playground-target="copyViewerTooltip"
class="hidden absolute top-full left-1/2 transform -translate-x-1/2 mt-2 px-2 py-1 text-xs text-white bg-black rounded-md whitespace-nowrap z-50"
>
Copy current panel content
<div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-l-4 border-r-4 border-b-4 border-transparent border-b-black"></div>
</div>
</div>
<div class="hidden lg:flex items-center gap-3 font-mono whitespace-break-spaces text-gray-400 dark:text-gray-500 text-[8pt] lg:ml-auto">
<div data-playground-target="version" class="cursor-help flex items-center gap-1" title="">
<i class="fas fa-info-circle text-xs opacity-50 dark:opacity-70"></i>
</div>
<a data-playground-target="commitHash" class="hover:text-gray-600 dark:hover:text-gray-300 underline" href="#" target="_blank"></a>
</div>
</div>
<div class="flex flex-wrap gap-2 mb-2">
<!-- <button
data-action="playground#toggleViewer keydown.esc@window->playground#shrinkViewer"
class="hover:opacity-75 bottom-[40px] right-[60px] text-gray-900 dark:text-gray-100 bg-gray-100 dark:bg-gray-800 hover:bg-gray-200 dark:hover:bg-gray-700 rounded-md px-3 py-1.5 text-sm font-medium data-[active=true]:bg-green-600 data-[active=true]:hover:bg-green-700 data-[active=true]:text-white"
>
<i class="fas fa-expand"></i>
<span class="ml-1">Fullscreen</span>
</button> -->
<button
data-playground-target="viewerButton"
data-viewer="parse"
data-action="click->playground#selectViewer"
class="text-gray-900 dark:text-gray-100 bg-gray-100 dark:bg-gray-800 hover:bg-gray-200 dark:hover:bg-gray-700 rounded-md px-3 py-1.5 text-sm font-medium data-[active=true]:!bg-green-600 data-[active=true]:hover:!bg-green-700 data-[active=true]:!text-white"
data-active="true"
>
<i class="fas fa-folder-tree"></i>
<span class="ml-1"
>Parse</span
>
</button>
<button
data-playground-target="viewerButton"
data-viewer="lex"
data-action="click->playground#selectViewer"
class="text-gray-900 dark:text-gray-100 bg-gray-100 dark:bg-gray-800 hover:bg-gray-200 dark:hover:bg-gray-700 rounded-md px-3 py-1.5 text-sm font-medium data-[active=true]:!bg-green-600 data-[active=true]:hover:!bg-green-700 data-[active=true]:!text-white"
>
<i class="fas fa-bars"></i>
<span class="ml-1"
>Lex</span
>
</button>
<button
data-playground-target="viewerButton"
data-viewer="ruby"
data-action="click->playground#selectViewer"
class="text-gray-900 dark:text-gray-100 bg-gray-100 dark:bg-gray-800 hover:bg-gray-200 dark:hover:bg-gray-700 rounded-md px-3 py-1.5 text-sm font-medium data-[active=true]:!bg-green-600 data-[active=true]:hover:!bg-green-700 data-[active=true]:!text-white"
>
<i class="fas fa-gem"></i>
<span class="ml-1">Ruby</span>
</button>
<button
data-playground-target="viewerButton"
data-viewer="html"
data-action="click->playground#selectViewer"
class="text-gray-900 dark:text-gray-100 bg-gray-100 dark:bg-gray-800 hover:bg-gray-200 dark:hover:bg-gray-700 rounded-md px-3 py-1.5 text-sm font-medium data-[active=true]:!bg-green-600 data-[active=true]:hover:!bg-green-700 data-[active=true]:!text-white"
>
<i class="fab fa-html5"></i>
<span class="ml-1">HTML</span>
</button>
<button
data-playground-target="viewerButton"
data-viewer="format"
data-action="click->playground#selectViewer"
class="text-gray-900 dark:text-gray-100 bg-gray-100 dark:bg-gray-800 hover:bg-gray-200 dark:hover:bg-gray-700 rounded-md px-3 py-1.5 text-sm font-medium data-[active=true]:!bg-green-600 data-[active=true]:hover:!bg-green-700 data-[active=true]:!text-white"
>
<i class="fas fa-indent"></i>
<span class="ml-1">Format</span>
</button>
<button
data-playground-target="viewerButton"
data-viewer="printer"
data-action="click->playground#selectViewer"
class="text-gray-900 dark:text-gray-100 bg-gray-100 dark:bg-gray-800 hover:bg-gray-200 dark:hover:bg-gray-700 rounded-md px-3 py-1.5 text-sm font-medium data-[active=true]:!bg-green-600 data-[active=true]:hover:!bg-green-700 data-[active=true]:!text-white"
>
<i class="fas fa-print"></i>
<span class="ml-1">Printer</span>
</button>
<button
data-playground-target="viewerButton"
data-viewer="diagnostics"
data-action="click->playground#selectViewer"
class="text-gray-900 dark:text-gray-100 bg-gray-100 dark:bg-gray-800 hover:bg-gray-200 dark:hover:bg-gray-700 rounded-md px-3 py-1.5 text-sm font-medium data-[active=true]:!bg-green-600 data-[active=true]:hover:!bg-green-700 data-[active=true]:!text-white"
>
<i class="fas fa-exclamation-triangle"></i>
<span class="ml-1">Diagnostics</span>
</button>
<button
disabled
data-playground-target="viewerButton"
data-viewer="full"
data-action="click->playground#selectViewer"
class="hidden cursor-not-allowed text-gray-900 bg-gray-100 hover:bg-gray-200 rounded-md px-3 py-1.5 text-sm font-medium data-[active=true]:bg-green-600 data-[active=true]:hover:bg-green-700 data-[active=true]:text-white"
data-active="false"
>
<i class="fas fa-code"></i>
<span class="ml-1">Object</span>
</button>
</div>
<div class="mt-2">
<div
data-viewer-target="parse"
data-playground-target="parseViewer"
data-action="click->playground#shrinkViewer"
class="w-full mb-3 rounded overflow-auto bg-[#282c34] h-[50vh] md:h-[calc(100vh-110px)] overflow-scroll"
>
<div
class="sticky top-0 z-10 p-3 border-b border-gray-600 flex flex-wrap gap-3 items-center bg-[#282c34]"
data-playground-target="parserOptions"
>
<span class="text-sm text-gray-300 mr-1">Parser Options:</span>
<label class="flex items-center gap-1.5 text-gray-300 text-sm" title="Include whitespace-only text nodes in the AST">
<input
type="checkbox"
data-option="track_whitespace"
data-action="change->playground#onOptionChange"
class="rounded border-gray-600 text-green-600 focus:ring-green-500 bg-gray-700"
/>
<span class="select-none">Track whitespace</span>
</label>
<label class="flex items-center gap-1.5 text-gray-300 text-sm" title="Enable strict HTML parsing mode with additional validation">
<input
type="checkbox"
data-option="strict"
data-action="change->playground#onOptionChange"
class="rounded border-gray-600 text-green-600 focus:ring-green-500 bg-gray-700"
checked
/>
<span class="select-none">Strict</span>
</label>
<label class="flex items-center gap-1.5 text-gray-300 text-sm" title="Run analysis passes on the parse tree (error detection, tag matching)">
<input
type="checkbox"
data-option="analyze"
data-action="change->playground#onOptionChange"
class="rounded border-gray-600 text-green-600 focus:ring-green-500 bg-gray-700"
checked
/>
<span class="select-none">Analyze</span>
</label>
<label class="flex items-center gap-1.5 text-gray-300 text-sm" title="Transform Action View tag helpers (tag, content_tag, link_to)">
<input
type="checkbox"
data-option="action_view_helpers"
data-action="change->playground#onOptionChange"
class="rounded border-gray-600 text-green-600 focus:ring-green-500 bg-gray-700"
/>
<span class="select-none">Action View helpers</span>
</label>
<label class="flex items-center gap-1.5 text-gray-300 text-sm" title="Serialize the full Prism ProgramNode for the entire extracted Ruby on the DocumentNode">
<input
type="checkbox"
data-option="prism_program"
data-action="change->playground#onOptionChange"
class="rounded border-gray-600 text-green-600 focus:ring-green-500 bg-gray-700"
/>
<span class="select-none">Prism program</span>
</label>
<label class="flex items-center gap-1.5 text-gray-300 text-sm" title="Attach Prism AST subtrees to each ERB node for its Ruby content">
<input
type="checkbox"
data-option="prism_nodes"
data-action="change->playground#onOptionChange change->playground#onPrismNodesChange"
class="rounded border-gray-600 text-green-600 focus:ring-green-500 bg-gray-700"
/>
<span class="select-none">Prism nodes</span>
</label>
<label data-playground-target="prismNodesDeepLabel" class="hidden flex items-center gap-1.5 text-gray-300 text-sm" title="Include nested body content in control-flow Prism nodes (e.g. if/else body statements)">
<input
type="checkbox"
data-option="prism_nodes_deep"
data-action="change->playground#onOptionChange"
class="rounded border-gray-600 text-green-600 focus:ring-green-500 bg-gray-700"
/>
<span class="select-none">Prism nodes (deep)</span>
</label>
</div>
<pre
data-playground-target="parseOutput"
class="w-full p-3 m-0 font-mono bg-[#282c34] text-[#dcdfe4] highlight"
style="white-space: pre; line-height: 1.3"
></pre>
</div>
<pre
style="white-space: pre; line-height: 1.3"
data-viewer-target="ruby"
data-playground-target="rubyViewer"
data-action="click->playground#shrinkViewer"
class="hidden w-full p-3 mb-3 rounded overflow-auto font-mono bg-[#282c34] text-[#dcdfe4] highlight h-[50vh] md:h-[calc(100vh-110px)] overflow-scroll"
></pre>
<pre
style="white-space: pre; line-height: 1.3"
data-viewer-target="html"
data-playground-target="htmlViewer"
data-action="click->playground#shrinkViewer"
class="hidden w-full p-3 mb-3 rounded overflow-auto font-mono bg-[#282c34] text-[#dcdfe4] highlight h-[50vh] md:h-[calc(100vh-110px)] overflow-scroll"
></pre>
<div
data-viewer-target="format"
data-playground-target="formatViewer"
data-action="click->playground#shrinkViewer"
class="hidden w-full mb-3 rounded overflow-auto bg-[#282c34] h-[50vh] md:h-[calc(100vh-110px)] overflow-scroll"
>
<div class="p-3 border-b border-gray-600 flex gap-4 items-center justify-between">
<div class="flex gap-2 items-center">
<span class="text-sm text-gray-300 mr-2">Document Status:</span>
<span data-playground-target="formatVerification" class="px-2 py-1 text-xs rounded font-medium"></span>
</div>
<div class="flex items-center gap-2">
<label class="flex items-center gap-2 text-gray-300 text-sm">
<span class="select-none">Max line length:</span>
<input
type="number"
min="1"
value="80"
data-playground-target="formatterMaxLineLength"
data-action="change->playground#onFormatterOptionChange"
class="w-16 px-2 py-1 text-sm rounded border-gray-600 bg-gray-700 text-gray-200 focus:ring-green-500 focus:border-green-500"
/>
</label>
</div>
</div>
<div class="w-full h-full overflow-auto">
<pre
data-playground-target="formatSuccess"
class="w-full h-full p-3 m-0 rounded overflow-auto font-mono bg-[#282c34] text-[#dcdfe4] language-html highlight"
style="white-space: pre; line-height: 1.3"
></pre>
<div data-playground-target="formatError" class="hidden relative h-full overflow-hidden">
<pre
class="absolute inset-0 blur-md opacity-30 overflow-auto p-3 m-0 font-mono text-[#dcdfe4] language-html"
style="white-space: pre; line-height: 1.3"
></pre>
<div class="absolute inset-0 bg-gray-800/70 backdrop-blur-md flex items-center justify-center z-10 rounded">
<div class="bg-gray-700 border border-gray-500 rounded-lg p-6 text-center">
<i class="fas fa-exclamation-triangle text-yellow-400 text-2xl mb-3"></i>
<h3 class="text-lg font-semibold text-gray-100 mb-2">Formatting Unavailable</h3>
<p class="text-gray-300 text-sm">
Cannot format code due to syntax errors.
</p>
<p class="text-gray-300 text-sm mt-2">
Fix errors in
<button class="text-blue-400 hover:text-blue-300 underline" onclick="this.closest('[data-controller*=playground]').querySelector('[data-playground-target=diagnosticStatus]').click()">
Diagnostics
</button>
tab first.
</p>
</div>
</div>
</div>
</div>
</div>
<div
data-viewer-target="printer"
data-playground-target="printerViewer"
data-action="click->playground#shrinkViewer"
class="hidden w-full mb-3 rounded overflow-auto bg-[#282c34] h-[50vh] md:h-[calc(100vh-110px)] overflow-scroll"
>
<div class="p-3 border-b border-gray-600 flex gap-4 items-center justify-between">
<div class="flex gap-2 items-center">
<span class="text-sm text-gray-300 mr-2">Round-trip Verification:</span>
<span data-playground-target="printerVerification" class="px-2 py-1 text-xs rounded font-medium"></span>
<span data-playground-target="printerLegend" class="hidden text-xs text-gray-400">
<span class="text-yellow-300">█</span> Original <span class="text-green-300">█</span> Printed
</span>
</div>
<div class="flex items-center gap-2">
<label class="flex items-center gap-2 text-gray-300 text-sm">
<input
type="checkbox"
data-playground-target="printerIgnoreErrors"
data-action="change->playground#onPrinterOptionChange"
class="rounded border-gray-300 dark:border-gray-600 text-green-600 focus:ring-green-500 dark:focus:ring-green-400"
/>
<span class="select-none">Ignore errors</span>
</label>
</div>
</div>
<div class="w-full h-full overflow-auto">
<pre data-playground-target="printerOutput" class="w-full p-3 m-0 font-mono bg-[#282c34] text-[#dcdfe4] language-html highlight" style="white-space: pre-wrap; line-height: 1.3; vertical-align: top"></pre>
<div data-playground-target="printerDiff" class="hidden p-3 m-0 font-mono bg-[#282c34] text-[#dcdfe4] flex flex-col justify-start items-start" style="white-space: pre; line-height: 1.3">
<div data-playground-target="printerDiffContent" class="w-full"></div>
</div>
</div>
</div>
<pre
style="white-space: pre; line-height: 1.3"
data-viewer-target="lex"
data-playground-target="lexViewer"
data-action="click->playground#shrinkViewer"
class="hidden w-full p-3 mb-3 rounded overflow-auto font-mono bg-[#282c34] text-[#dcdfe4] highlight h-[50vh] md:h-[calc(100vh-110px)] overflow-scroll"
></pre>
<div
data-viewer-target="diagnostics"
data-playground-target="diagnosticsViewer"
data-action="click->playground#shrinkViewer"
class="hidden w-full mb-3 rounded overflow-auto bg-[#282c34] text-[#dcdfe4] h-[50vh] md:h-[calc(100vh-110px)] overflow-scroll"
>
<div data-playground-target="diagnosticsContent" class="h-full">
<div class="p-3 border-b border-gray-600 flex gap-2 items-center flex-wrap">
<span class="text-sm text-gray-300 mr-2">Filter:</span>
<button
data-action="click->playground#filterDiagnostics"
data-playground-target="diagnosticsFilter"
data-filter="all"
class="px-2 py-1 text-xs rounded bg-green-600 hover:bg-green-700 text-white"
>
All
</button>
<button
data-action="click->playground#filterDiagnostics"
data-playground-target="diagnosticsFilter"
data-filter="parser"
class="px-2 py-1 text-xs rounded bg-gray-600 hover:bg-gray-500 text-white"
>
Parser
</button>
<button
data-action="click->playground#filterDiagnostics"
data-playground-target="diagnosticsFilter"
data-filter="linter"
class="px-2 py-1 text-xs rounded bg-gray-600 hover:bg-gray-500 text-white"
>
Linter
</button>
</div>
<div class="p-3 flex-1 overflow-auto">
<div data-playground-target="noDiagnostics" class="relative h-full min-h-[200px] overflow-hidden">
<div class="absolute inset-0 flex items-center justify-center z-10">
<div class="bg-gray-700 border border-gray-500 rounded-lg p-6 text-center">
<i class="fas fa-circle-check text-green-400 text-2xl mb-3"></i>
<h3 class="text-lg font-semibold text-gray-100 mb-2">No Issues Found</h3>
<p class="text-gray-300 text-sm">
No diagnostics to display
</p>
</div>
</div>
</div>
<div data-playground-target="diagnosticsList" class="hidden">
</div>
</div>
</div>
</div>
<json-viewer
data-playground-target="fullViewer"
data-action="click->playground#shrinkViewer"
class="hidden py-0 px-5 rounded-lg font-mono h-[50vh] md:h-[calc(100vh-110px)] overflow-scroll"
></json-viewer>
</div>
</div>
</div>
</div>
</div>
</body>
</html>