@zenithbuild/language 1.3.3

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.
@@ -0,0 +1,672 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
3
+ "name": "Zenith",
4
+ "scopeName": "text.html.zenith",
5
+ "fileTypes": [
6
+ "zen",
7
+ "zen.html",
8
+ "zenx"
9
+ ],
10
+ "patterns": [
11
+ {
12
+ "include": "#comment"
13
+ },
14
+ {
15
+ "include": "#script-tag"
16
+ },
17
+ {
18
+ "include": "#style-tag"
19
+ },
20
+ {
21
+ "include": "#router-component-tag"
22
+ },
23
+ {
24
+ "include": "#component-tag"
25
+ },
26
+ {
27
+ "include": "#slot-tag"
28
+ },
29
+ {
30
+ "include": "#html-tag"
31
+ },
32
+ {
33
+ "include": "#expression"
34
+ }
35
+ ],
36
+ "repository": {
37
+ "comment": {
38
+ "begin": "<!--",
39
+ "end": "-->",
40
+ "name": "comment.block.html.zenith",
41
+ "captures": {
42
+ "0": {
43
+ "name": "punctuation.definition.comment.html.zenith"
44
+ }
45
+ }
46
+ },
47
+ "script-tag": {
48
+ "begin": "(<)(script)(?=\\s|>)",
49
+ "beginCaptures": {
50
+ "1": {
51
+ "name": "punctuation.definition.tag.begin.html.zenith"
52
+ },
53
+ "2": {
54
+ "name": "entity.name.tag.script.html.zenith"
55
+ }
56
+ },
57
+ "end": "(</)(script)\\s*(>)",
58
+ "endCaptures": {
59
+ "1": {
60
+ "name": "punctuation.definition.tag.begin.html.zenith"
61
+ },
62
+ "2": {
63
+ "name": "entity.name.tag.script.html.zenith"
64
+ },
65
+ "3": {
66
+ "name": "punctuation.definition.tag.end.html.zenith"
67
+ }
68
+ },
69
+ "name": "meta.tag.script.zenith",
70
+ "patterns": [
71
+ {
72
+ "include": "#script-tag-open"
73
+ },
74
+ {
75
+ "include": "#script-content"
76
+ }
77
+ ]
78
+ },
79
+ "script-tag-open": {
80
+ "begin": "(?<=[tT])(?=\\s|>)",
81
+ "end": "(>)",
82
+ "endCaptures": {
83
+ "1": {
84
+ "name": "punctuation.definition.tag.end.html.zenith"
85
+ }
86
+ },
87
+ "name": "meta.tag.script.start.html.zenith",
88
+ "patterns": [
89
+ {
90
+ "include": "#tag-attributes"
91
+ }
92
+ ]
93
+ },
94
+ "script-content": {
95
+ "begin": "(?<=>)",
96
+ "end": "(?=</script)",
97
+ "name": "source.ts.embedded.zenith",
98
+ "patterns": [
99
+ {
100
+ "include": "#state-declaration"
101
+ },
102
+ {
103
+ "include": "#lifecycle-hooks"
104
+ },
105
+ {
106
+ "include": "#zenith-imports"
107
+ },
108
+ {
109
+ "include": "source.ts"
110
+ }
111
+ ]
112
+ },
113
+ "style-tag": {
114
+ "begin": "(<)(style)(?=\\s|>)",
115
+ "beginCaptures": {
116
+ "1": {
117
+ "name": "punctuation.definition.tag.begin.html.zenith"
118
+ },
119
+ "2": {
120
+ "name": "entity.name.tag.style.html.zenith"
121
+ }
122
+ },
123
+ "end": "(</)(style)\\s*(>)",
124
+ "endCaptures": {
125
+ "1": {
126
+ "name": "punctuation.definition.tag.begin.html.zenith"
127
+ },
128
+ "2": {
129
+ "name": "entity.name.tag.style.html.zenith"
130
+ },
131
+ "3": {
132
+ "name": "punctuation.definition.tag.end.html.zenith"
133
+ }
134
+ },
135
+ "name": "meta.tag.style.zenith",
136
+ "patterns": [
137
+ {
138
+ "include": "#style-tag-open"
139
+ },
140
+ {
141
+ "include": "#style-content"
142
+ }
143
+ ]
144
+ },
145
+ "style-tag-open": {
146
+ "begin": "(?<=[eE])(?=\\s|>)",
147
+ "end": "(>)",
148
+ "endCaptures": {
149
+ "1": {
150
+ "name": "punctuation.definition.tag.end.html.zenith"
151
+ }
152
+ },
153
+ "name": "meta.tag.style.start.html.zenith",
154
+ "patterns": [
155
+ {
156
+ "include": "#tag-attributes"
157
+ }
158
+ ]
159
+ },
160
+ "style-content": {
161
+ "begin": "(?<=>)",
162
+ "end": "(?=</style)",
163
+ "name": "source.css.embedded.zenith",
164
+ "patterns": [
165
+ {
166
+ "include": "source.css"
167
+ }
168
+ ]
169
+ },
170
+ "state-declaration": {
171
+ "match": "(?<=^|\\s)(state)\\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\\s*(=)",
172
+ "captures": {
173
+ "1": {
174
+ "name": "storage.type.state.zenith"
175
+ },
176
+ "2": {
177
+ "name": "variable.other.readwrite.zenith"
178
+ },
179
+ "3": {
180
+ "name": "keyword.operator.assignment.zenith"
181
+ }
182
+ }
183
+ },
184
+ "lifecycle-hooks": {
185
+ "match": "\\b(zenOnMount|zenOnDestroy|zenOnUpdate|zenEffect|onMount|onDestroy|onUpdate|useRoute|useRouter)\\b",
186
+ "name": "support.function.lifecycle.zenith"
187
+ },
188
+ "zenith-imports": {
189
+ "match": "(['\"])(zenith(?:/[a-zA-Z-]+)?|zenith:[a-zA-Z-]+)\\1",
190
+ "captures": {
191
+ "0": {
192
+ "name": "string.quoted.module.zenith"
193
+ },
194
+ "2": {
195
+ "name": "support.module.zenith"
196
+ }
197
+ }
198
+ },
199
+ "router-component-tag": {
200
+ "patterns": [
201
+ {
202
+ "begin": "(<)(ZenLink)(?=\\s|/?>)",
203
+ "beginCaptures": {
204
+ "1": {
205
+ "name": "punctuation.definition.tag.begin.html.zenith"
206
+ },
207
+ "2": {
208
+ "name": "entity.name.tag.component.router.zenith support.class.component.zenith"
209
+ }
210
+ },
211
+ "end": "(/?>)",
212
+ "endCaptures": {
213
+ "1": {
214
+ "name": "punctuation.definition.tag.end.html.zenith"
215
+ }
216
+ },
217
+ "name": "meta.tag.component.router.start.zenith",
218
+ "patterns": [
219
+ {
220
+ "include": "#tag-attributes"
221
+ }
222
+ ]
223
+ },
224
+ {
225
+ "match": "(</)(\\s*)(ZenLink)(\\s*)(>)",
226
+ "captures": {
227
+ "1": {
228
+ "name": "punctuation.definition.tag.begin.html.zenith"
229
+ },
230
+ "3": {
231
+ "name": "entity.name.tag.component.router.zenith support.class.component.zenith"
232
+ },
233
+ "5": {
234
+ "name": "punctuation.definition.tag.end.html.zenith"
235
+ }
236
+ },
237
+ "name": "meta.tag.component.router.end.zenith"
238
+ }
239
+ ]
240
+ },
241
+ "component-tag": {
242
+ "patterns": [
243
+ {
244
+ "begin": "(<)([A-Z][a-zA-Z0-9]*)(?=\\s|/?>)",
245
+ "beginCaptures": {
246
+ "1": {
247
+ "name": "punctuation.definition.tag.begin.html.zenith"
248
+ },
249
+ "2": {
250
+ "name": "entity.name.tag.component.zenith support.class.component.zenith"
251
+ }
252
+ },
253
+ "end": "(/?>)",
254
+ "endCaptures": {
255
+ "1": {
256
+ "name": "punctuation.definition.tag.end.html.zenith"
257
+ }
258
+ },
259
+ "name": "meta.tag.component.start.zenith",
260
+ "patterns": [
261
+ {
262
+ "include": "#tag-attributes"
263
+ }
264
+ ]
265
+ },
266
+ {
267
+ "match": "(</)(\\s*)([A-Z][a-zA-Z0-9]*)(\\s*)(>)",
268
+ "captures": {
269
+ "1": {
270
+ "name": "punctuation.definition.tag.begin.html.zenith"
271
+ },
272
+ "3": {
273
+ "name": "entity.name.tag.component.zenith support.class.component.zenith"
274
+ },
275
+ "5": {
276
+ "name": "punctuation.definition.tag.end.html.zenith"
277
+ }
278
+ },
279
+ "name": "meta.tag.component.end.zenith"
280
+ }
281
+ ]
282
+ },
283
+ "slot-tag": {
284
+ "match": "(<)(slot)(\\s*)(/?>)",
285
+ "captures": {
286
+ "1": {
287
+ "name": "punctuation.definition.tag.begin.html.zenith"
288
+ },
289
+ "2": {
290
+ "name": "entity.name.tag.slot.zenith keyword.control.slot.zenith"
291
+ },
292
+ "4": {
293
+ "name": "punctuation.definition.tag.end.html.zenith"
294
+ }
295
+ },
296
+ "name": "meta.tag.slot.zenith"
297
+ },
298
+ "html-tag": {
299
+ "patterns": [
300
+ {
301
+ "begin": "(<)([a-z][a-zA-Z0-9-]*)(?=\\s|/?>)",
302
+ "beginCaptures": {
303
+ "1": {
304
+ "name": "punctuation.definition.tag.begin.html.zenith"
305
+ },
306
+ "2": {
307
+ "name": "entity.name.tag.html.zenith"
308
+ }
309
+ },
310
+ "end": "(/?>)",
311
+ "endCaptures": {
312
+ "1": {
313
+ "name": "punctuation.definition.tag.end.html.zenith"
314
+ }
315
+ },
316
+ "name": "meta.tag.html.start.zenith",
317
+ "patterns": [
318
+ {
319
+ "include": "#tag-attributes"
320
+ }
321
+ ]
322
+ },
323
+ {
324
+ "match": "(</)(\\s*)([a-z][a-zA-Z0-9-]*)(\\s*)(>)",
325
+ "captures": {
326
+ "1": {
327
+ "name": "punctuation.definition.tag.begin.html.zenith"
328
+ },
329
+ "3": {
330
+ "name": "entity.name.tag.html.zenith"
331
+ },
332
+ "5": {
333
+ "name": "punctuation.definition.tag.end.html.zenith"
334
+ }
335
+ },
336
+ "name": "meta.tag.html.end.zenith"
337
+ }
338
+ ]
339
+ },
340
+ "tag-attributes": {
341
+ "patterns": [
342
+ {
343
+ "include": "#attribute-directive"
344
+ },
345
+ {
346
+ "include": "#attribute-at-event"
347
+ },
348
+ {
349
+ "include": "#attribute-reactive-bind"
350
+ },
351
+ {
352
+ "include": "#attribute-expression"
353
+ },
354
+ {
355
+ "include": "#attribute-event-handler"
356
+ },
357
+ {
358
+ "include": "#attribute-quoted"
359
+ },
360
+ {
361
+ "include": "#attribute-boolean"
362
+ }
363
+ ]
364
+ },
365
+ "attribute-directive": {
366
+ "begin": "(zen:(?:if|for|effect|show))\\s*(=)\\s*",
367
+ "beginCaptures": {
368
+ "1": {
369
+ "name": "keyword.control.directive.zenith"
370
+ },
371
+ "2": {
372
+ "name": "punctuation.separator.key-value.html.zenith"
373
+ }
374
+ },
375
+ "end": "(?<=[\"'])|(?=\\s|/?>)",
376
+ "name": "meta.attribute.directive.zenith",
377
+ "patterns": [
378
+ {
379
+ "begin": "\"",
380
+ "beginCaptures": {
381
+ "0": {
382
+ "name": "punctuation.definition.string.begin.html.zenith"
383
+ }
384
+ },
385
+ "end": "\"",
386
+ "endCaptures": {
387
+ "0": {
388
+ "name": "punctuation.definition.string.end.html.zenith"
389
+ }
390
+ },
391
+ "name": "string.quoted.double.html.zenith",
392
+ "contentName": "source.ts.embedded.zenith",
393
+ "patterns": [
394
+ {
395
+ "include": "source.ts"
396
+ }
397
+ ]
398
+ },
399
+ {
400
+ "begin": "'",
401
+ "beginCaptures": {
402
+ "0": {
403
+ "name": "punctuation.definition.string.begin.html.zenith"
404
+ }
405
+ },
406
+ "end": "'",
407
+ "endCaptures": {
408
+ "0": {
409
+ "name": "punctuation.definition.string.end.html.zenith"
410
+ }
411
+ },
412
+ "name": "string.quoted.single.html.zenith",
413
+ "contentName": "source.ts.embedded.zenith",
414
+ "patterns": [
415
+ {
416
+ "include": "source.ts"
417
+ }
418
+ ]
419
+ }
420
+ ]
421
+ },
422
+ "attribute-at-event": {
423
+ "begin": "(@)([a-zA-Z][a-zA-Z0-9]*)\\s*(=)\\s*(\\{)",
424
+ "beginCaptures": {
425
+ "1": {
426
+ "name": "punctuation.definition.event.zenith"
427
+ },
428
+ "2": {
429
+ "name": "entity.other.attribute-name.event.zenith"
430
+ },
431
+ "3": {
432
+ "name": "punctuation.separator.key-value.html.zenith"
433
+ },
434
+ "4": {
435
+ "name": "punctuation.section.embedded.begin.zenith"
436
+ }
437
+ },
438
+ "end": "(\\})",
439
+ "endCaptures": {
440
+ "1": {
441
+ "name": "punctuation.section.embedded.end.zenith"
442
+ }
443
+ },
444
+ "name": "meta.attribute.event.zenith",
445
+ "contentName": "source.ts.embedded.zenith",
446
+ "patterns": [
447
+ {
448
+ "include": "source.ts"
449
+ }
450
+ ]
451
+ },
452
+ "attribute-reactive-bind": {
453
+ "begin": "(:)([a-zA-Z_][a-zA-Z0-9_-]*)\\s*(=)\\s*",
454
+ "beginCaptures": {
455
+ "1": {
456
+ "name": "punctuation.definition.reactive-bind.zenith"
457
+ },
458
+ "2": {
459
+ "name": "entity.other.attribute-name.reactive.zenith"
460
+ },
461
+ "3": {
462
+ "name": "punctuation.separator.key-value.html.zenith"
463
+ }
464
+ },
465
+ "end": "(?<=[\"'\\}])|(?=\\s|/?>)",
466
+ "name": "meta.attribute.reactive-bind.zenith",
467
+ "patterns": [
468
+ {
469
+ "begin": "\\{",
470
+ "beginCaptures": {
471
+ "0": {
472
+ "name": "punctuation.section.embedded.begin.zenith"
473
+ }
474
+ },
475
+ "end": "\\}",
476
+ "endCaptures": {
477
+ "0": {
478
+ "name": "punctuation.section.embedded.end.zenith"
479
+ }
480
+ },
481
+ "contentName": "source.ts.embedded.zenith",
482
+ "patterns": [
483
+ {
484
+ "include": "source.ts"
485
+ }
486
+ ]
487
+ },
488
+ {
489
+ "begin": "\"",
490
+ "beginCaptures": {
491
+ "0": {
492
+ "name": "punctuation.definition.string.begin.html.zenith"
493
+ }
494
+ },
495
+ "end": "\"",
496
+ "endCaptures": {
497
+ "0": {
498
+ "name": "punctuation.definition.string.end.html.zenith"
499
+ }
500
+ },
501
+ "name": "string.quoted.double.html.zenith",
502
+ "contentName": "source.ts.embedded.zenith",
503
+ "patterns": [
504
+ {
505
+ "include": "source.ts"
506
+ }
507
+ ]
508
+ },
509
+ {
510
+ "begin": "'",
511
+ "beginCaptures": {
512
+ "0": {
513
+ "name": "punctuation.definition.string.begin.html.zenith"
514
+ }
515
+ },
516
+ "end": "'",
517
+ "endCaptures": {
518
+ "0": {
519
+ "name": "punctuation.definition.string.end.html.zenith"
520
+ }
521
+ },
522
+ "name": "string.quoted.single.html.zenith",
523
+ "contentName": "source.ts.embedded.zenith",
524
+ "patterns": [
525
+ {
526
+ "include": "source.ts"
527
+ }
528
+ ]
529
+ }
530
+ ]
531
+ },
532
+ "attribute-expression": {
533
+ "begin": "([a-zA-Z_][a-zA-Z0-9_:-]*)\\s*(=)\\s*(\\{)",
534
+ "beginCaptures": {
535
+ "1": {
536
+ "name": "entity.other.attribute-name.html.zenith"
537
+ },
538
+ "2": {
539
+ "name": "punctuation.separator.key-value.html.zenith"
540
+ },
541
+ "3": {
542
+ "name": "punctuation.section.embedded.begin.zenith"
543
+ }
544
+ },
545
+ "end": "(\\})",
546
+ "endCaptures": {
547
+ "1": {
548
+ "name": "punctuation.section.embedded.end.zenith"
549
+ }
550
+ },
551
+ "name": "meta.attribute.expression.zenith",
552
+ "contentName": "source.ts.embedded.zenith",
553
+ "patterns": [
554
+ {
555
+ "include": "source.ts"
556
+ }
557
+ ]
558
+ },
559
+ "attribute-event-handler": {
560
+ "begin": "(on[A-Z][a-zA-Z]*|onclick|onchange|onsubmit|oninput|onkeydown|onkeyup|onmouseenter|onmouseleave)\\s*(=)\\s*(\\{)",
561
+ "beginCaptures": {
562
+ "1": {
563
+ "name": "entity.other.attribute-name.event.html.zenith"
564
+ },
565
+ "2": {
566
+ "name": "punctuation.separator.key-value.html.zenith"
567
+ },
568
+ "3": {
569
+ "name": "punctuation.section.embedded.begin.zenith"
570
+ }
571
+ },
572
+ "end": "(\\})",
573
+ "endCaptures": {
574
+ "1": {
575
+ "name": "punctuation.section.embedded.end.zenith"
576
+ }
577
+ },
578
+ "name": "meta.attribute.event-handler.zenith",
579
+ "contentName": "source.ts.embedded.zenith",
580
+ "patterns": [
581
+ {
582
+ "include": "source.ts"
583
+ }
584
+ ]
585
+ },
586
+ "attribute-quoted": {
587
+ "begin": "([a-zA-Z_:][a-zA-Z0-9_:-]*)\\s*(=)\\s*",
588
+ "beginCaptures": {
589
+ "1": {
590
+ "name": "entity.other.attribute-name.html.zenith"
591
+ },
592
+ "2": {
593
+ "name": "punctuation.separator.key-value.html.zenith"
594
+ }
595
+ },
596
+ "end": "(?<=[\"'])|(?=\\s|/?>)",
597
+ "name": "meta.attribute.zenith",
598
+ "patterns": [
599
+ {
600
+ "begin": "\"",
601
+ "beginCaptures": {
602
+ "0": {
603
+ "name": "punctuation.definition.string.begin.html.zenith"
604
+ }
605
+ },
606
+ "end": "\"",
607
+ "endCaptures": {
608
+ "0": {
609
+ "name": "punctuation.definition.string.end.html.zenith"
610
+ }
611
+ },
612
+ "name": "string.quoted.double.html.zenith",
613
+ "patterns": [
614
+ {
615
+ "include": "#expression"
616
+ }
617
+ ]
618
+ },
619
+ {
620
+ "begin": "'",
621
+ "beginCaptures": {
622
+ "0": {
623
+ "name": "punctuation.definition.string.begin.html.zenith"
624
+ }
625
+ },
626
+ "end": "'",
627
+ "endCaptures": {
628
+ "0": {
629
+ "name": "punctuation.definition.string.end.html.zenith"
630
+ }
631
+ },
632
+ "name": "string.quoted.single.html.zenith",
633
+ "patterns": [
634
+ {
635
+ "include": "#expression"
636
+ }
637
+ ]
638
+ }
639
+ ]
640
+ },
641
+ "attribute-boolean": {
642
+ "match": "(?<=\\s)([a-zA-Z_][a-zA-Z0-9_-]*)(?=\\s|/?>)",
643
+ "captures": {
644
+ "1": {
645
+ "name": "entity.other.attribute-name.html.zenith"
646
+ }
647
+ },
648
+ "name": "meta.attribute.boolean.zenith"
649
+ },
650
+ "expression": {
651
+ "begin": "(\\{)(?!\\{)",
652
+ "beginCaptures": {
653
+ "1": {
654
+ "name": "punctuation.section.embedded.begin.zenith"
655
+ }
656
+ },
657
+ "end": "(\\})",
658
+ "endCaptures": {
659
+ "1": {
660
+ "name": "punctuation.section.embedded.end.zenith"
661
+ }
662
+ },
663
+ "name": "meta.embedded.expression.zenith",
664
+ "contentName": "source.ts.embedded.zenith",
665
+ "patterns": [
666
+ {
667
+ "include": "source.ts"
668
+ }
669
+ ]
670
+ }
671
+ }
672
+ }