@wireweave/language-data 1.0.2 → 1.1.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.
@@ -0,0 +1,1233 @@
1
+ // src/attributes.ts
2
+ var COMMON_ATTRIBUTES = [
3
+ // Spacing
4
+ "p",
5
+ "px",
6
+ "py",
7
+ "pt",
8
+ "pr",
9
+ "pb",
10
+ "pl",
11
+ "m",
12
+ "mx",
13
+ "my",
14
+ "mt",
15
+ "mr",
16
+ "mb",
17
+ "ml",
18
+ "gap",
19
+ // Size
20
+ "w",
21
+ "h",
22
+ "minW",
23
+ "maxW",
24
+ "minH",
25
+ "maxH",
26
+ // Flex
27
+ "flex",
28
+ "direction",
29
+ "justify",
30
+ "align",
31
+ "wrap",
32
+ // Grid
33
+ "span",
34
+ // Position
35
+ "x",
36
+ "y"
37
+ ];
38
+ var ATTRIBUTES = [
39
+ // ============================================
40
+ // Spacing Attributes
41
+ // ============================================
42
+ { name: "p", type: "number", description: "Padding (all sides)", example: "p=4" },
43
+ { name: "px", type: "number", description: "Horizontal padding", example: "px=4" },
44
+ { name: "py", type: "number", description: "Vertical padding", example: "py=4" },
45
+ { name: "pt", type: "number", description: "Top padding", example: "pt=4" },
46
+ { name: "pr", type: "number", description: "Right padding", example: "pr=4" },
47
+ { name: "pb", type: "number", description: "Bottom padding", example: "pb=4" },
48
+ { name: "pl", type: "number", description: "Left padding", example: "pl=4" },
49
+ { name: "m", type: "number", description: "Margin (all sides)", example: "m=4" },
50
+ { name: "mx", type: "string", description: 'Horizontal margin (number or "auto")', example: "mx=auto" },
51
+ { name: "my", type: "number", description: "Vertical margin", example: "my=4" },
52
+ { name: "mt", type: "number", description: "Top margin", example: "mt=4" },
53
+ { name: "mr", type: "number", description: "Right margin", example: "mr=4" },
54
+ { name: "mb", type: "number", description: "Bottom margin", example: "mb=4" },
55
+ { name: "ml", type: "number", description: "Left margin", example: "ml=4" },
56
+ { name: "gap", type: "number", description: "Gap between children", example: "gap=4" },
57
+ // ============================================
58
+ // Size Attributes
59
+ // ============================================
60
+ { name: "w", type: "string", description: 'Width (number, "full", "auto", "screen", "fit")', example: "w=full" },
61
+ { name: "h", type: "string", description: 'Height (number, "full", "auto", "screen")', example: "h=full" },
62
+ { name: "width", type: "number", description: "Width in pixels (page only)", example: "width=400" },
63
+ { name: "height", type: "number", description: "Height in pixels (page only)", example: "height=300" },
64
+ { name: "minW", type: "number", description: "Minimum width", example: "minW=200" },
65
+ { name: "maxW", type: "number", description: "Maximum width", example: "maxW=600" },
66
+ { name: "minH", type: "number", description: "Minimum height", example: "minH=100" },
67
+ { name: "maxH", type: "number", description: "Maximum height", example: "maxH=400" },
68
+ // ============================================
69
+ // Flex/Grid Layout Attributes
70
+ // ============================================
71
+ { name: "flex", type: "boolean", description: "Enable flexbox", example: "flex" },
72
+ { name: "direction", type: "enum", values: ["row", "column", "row-reverse", "column-reverse"], description: "Flex direction", example: "direction=column" },
73
+ { name: "justify", type: "enum", values: ["start", "center", "end", "between", "around", "evenly"], description: "Main axis alignment", example: "justify=center" },
74
+ { name: "align", type: "enum", values: ["start", "center", "end", "stretch", "baseline"], description: "Cross axis alignment", example: "align=center" },
75
+ { name: "wrap", type: "boolean", description: "Enable flex wrap", example: "wrap" },
76
+ { name: "span", type: "number", description: "Grid column span (1-12)", example: "span=6" },
77
+ { name: "sm", type: "number", description: "Responsive span at 576px+", example: "sm=6" },
78
+ { name: "md", type: "number", description: "Responsive span at 768px+", example: "md=4" },
79
+ { name: "lg", type: "number", description: "Responsive span at 992px+", example: "lg=3" },
80
+ { name: "xl", type: "number", description: "Responsive span at 1200px+", example: "xl=2" },
81
+ { name: "order", type: "number", description: "Flex order", example: "order=1" },
82
+ // ============================================
83
+ // Position Attributes
84
+ // ============================================
85
+ { name: "x", type: "number", description: "Horizontal position", example: "x=100" },
86
+ { name: "y", type: "number", description: "Vertical position", example: "y=50" },
87
+ { name: "position", type: "enum", values: ["left", "right", "top", "bottom", "top-left", "top-center", "top-right", "bottom-left", "bottom-center", "bottom-right"], description: "Position preset", example: "position=left" },
88
+ // ============================================
89
+ // Visual Attributes
90
+ // ============================================
91
+ { name: "border", type: "boolean", description: "Show border", example: "border" },
92
+ { name: "rounded", type: "boolean", description: "Apply border radius", example: "rounded" },
93
+ { name: "shadow", type: "enum", values: ["none", "sm", "md", "lg", "xl"], description: "Box shadow", example: "shadow=md" },
94
+ { name: "bg", type: "enum", values: ["muted", "primary", "secondary"], description: "Background variant", example: "bg=muted" },
95
+ // ============================================
96
+ // Text Attributes
97
+ // ============================================
98
+ { name: "size", type: "enum", values: ["xs", "sm", "base", "md", "lg", "xl", "2xl", "3xl"], description: "Size preset", example: "size=lg" },
99
+ { name: "weight", type: "enum", values: ["normal", "medium", "semibold", "bold"], description: "Font weight", example: "weight=bold" },
100
+ { name: "level", type: "number", description: "Heading level (1-6)", example: "level=2" },
101
+ { name: "muted", type: "boolean", description: "Muted/dimmed style", example: "muted" },
102
+ { name: "bold", type: "boolean", description: "Bold text", example: "bold" },
103
+ // ============================================
104
+ // Button Variant Attributes
105
+ // ============================================
106
+ { name: "primary", type: "boolean", description: "Primary style", example: "primary" },
107
+ { name: "secondary", type: "boolean", description: "Secondary style", example: "secondary" },
108
+ { name: "outline", type: "boolean", description: "Outline style", example: "outline" },
109
+ { name: "ghost", type: "boolean", description: "Ghost/transparent style", example: "ghost" },
110
+ { name: "danger", type: "boolean", description: "Danger/destructive style", example: "danger" },
111
+ // ============================================
112
+ // Status Variant Attributes
113
+ // ============================================
114
+ { name: "variant", type: "enum", values: ["default", "primary", "secondary", "success", "warning", "danger", "info"], description: "Status variant", example: "variant=success" },
115
+ // ============================================
116
+ // Form Attributes
117
+ // ============================================
118
+ { name: "inputType", type: "enum", values: ["text", "email", "password", "number", "tel", "url", "search", "date"], description: "Input field type", example: "inputType=email" },
119
+ { name: "placeholder", type: "string", description: "Placeholder text", example: 'placeholder="Enter text"' },
120
+ { name: "value", type: "string", description: "Default value", example: 'value="default"' },
121
+ { name: "label", type: "string", description: "Field label", example: 'label="Name"' },
122
+ { name: "name", type: "string", description: "Form field name", example: 'name="field"' },
123
+ { name: "required", type: "boolean", description: "Required field", example: "required" },
124
+ { name: "disabled", type: "boolean", description: "Disabled state", example: "disabled" },
125
+ { name: "readonly", type: "boolean", description: "Read-only state", example: "readonly" },
126
+ { name: "checked", type: "boolean", description: "Checked state", example: "checked" },
127
+ { name: "loading", type: "boolean", description: "Loading state", example: "loading" },
128
+ { name: "rows", type: "number", description: "Textarea rows", example: "rows=4" },
129
+ { name: "min", type: "number", description: "Minimum value", example: "min=0" },
130
+ { name: "max", type: "number", description: "Maximum value", example: "max=100" },
131
+ { name: "step", type: "number", description: "Step increment", example: "step=1" },
132
+ // ============================================
133
+ // Content Attributes
134
+ // ============================================
135
+ { name: "title", type: "string", description: "Title text", example: 'title="Title"' },
136
+ { name: "src", type: "string", description: "Source URL", example: 'src="/image.png"' },
137
+ { name: "alt", type: "string", description: "Alt text", example: 'alt="Image"' },
138
+ { name: "href", type: "string", description: "Link URL", example: 'href="/path"' },
139
+ { name: "icon", type: "string", description: "Icon name", example: 'icon="home"' },
140
+ { name: "external", type: "boolean", description: "External link", example: "external" },
141
+ // ============================================
142
+ // State Attributes
143
+ // ============================================
144
+ { name: "active", type: "number", description: "Active index", example: "active=0" },
145
+ { name: "expanded", type: "boolean", description: "Expanded state", example: "expanded" },
146
+ { name: "centered", type: "boolean", description: "Center content", example: "centered" },
147
+ { name: "vertical", type: "boolean", description: "Vertical orientation", example: "vertical" },
148
+ { name: "scroll", type: "boolean", description: "Enable scrolling", example: "scroll" },
149
+ // ============================================
150
+ // Feedback Attributes
151
+ // ============================================
152
+ { name: "dismissible", type: "boolean", description: "Can be dismissed", example: "dismissible" },
153
+ { name: "indeterminate", type: "boolean", description: "Indeterminate state", example: "indeterminate" },
154
+ { name: "pill", type: "boolean", description: "Pill/rounded style", example: "pill" },
155
+ // ============================================
156
+ // Data Attributes
157
+ // ============================================
158
+ { name: "striped", type: "boolean", description: "Striped rows", example: "striped" },
159
+ { name: "bordered", type: "boolean", description: "Full borders", example: "bordered" },
160
+ { name: "hover", type: "boolean", description: "Hover effect", example: "hover" },
161
+ { name: "ordered", type: "boolean", description: "Ordered list", example: "ordered" },
162
+ { name: "none", type: "boolean", description: "No list markers", example: "none" },
163
+ // ============================================
164
+ // Page/Viewport Attributes
165
+ // ============================================
166
+ { name: "viewport", type: "string", description: 'Viewport size (e.g., "1440x900")', example: 'viewport="1440x900"' },
167
+ { name: "device", type: "string", description: "Device preset", example: 'device="iphone14"' }
168
+ ];
169
+ var ATTRIBUTE_MAP = new Map(
170
+ ATTRIBUTES.map((attr) => [attr.name, attr])
171
+ );
172
+ var VALID_ATTRIBUTE_NAMES = new Set(
173
+ ATTRIBUTES.map((attr) => attr.name)
174
+ );
175
+
176
+ // src/components.ts
177
+ var ALL_COMPONENTS = [
178
+ // ============================================
179
+ // Layout Components
180
+ // ============================================
181
+ {
182
+ name: "page",
183
+ nodeType: "Page",
184
+ category: "layout",
185
+ attributes: [...COMMON_ATTRIBUTES, "title", "width", "height", "viewport", "device", "centered"],
186
+ hasChildren: true,
187
+ description: "Root container for a wireframe page",
188
+ example: 'page "Dashboard" centered { ... }',
189
+ validChildren: ["header", "main", "footer", "sidebar", "section", "nav", "row", "col", "card"],
190
+ validParents: []
191
+ },
192
+ {
193
+ name: "header",
194
+ nodeType: "Header",
195
+ category: "layout",
196
+ attributes: [...COMMON_ATTRIBUTES, "border"],
197
+ hasChildren: true,
198
+ description: "Page header section",
199
+ example: "header h=56 border { ... }",
200
+ validParents: ["page"]
201
+ },
202
+ {
203
+ name: "main",
204
+ nodeType: "Main",
205
+ category: "layout",
206
+ attributes: [...COMMON_ATTRIBUTES, "scroll"],
207
+ hasChildren: true,
208
+ description: "Main content section",
209
+ example: "main p=6 scroll { ... }",
210
+ validParents: ["page"]
211
+ },
212
+ {
213
+ name: "footer",
214
+ nodeType: "Footer",
215
+ category: "layout",
216
+ attributes: [...COMMON_ATTRIBUTES, "border"],
217
+ hasChildren: true,
218
+ description: "Page footer section",
219
+ example: "footer h=48 border { ... }",
220
+ validParents: ["page"]
221
+ },
222
+ {
223
+ name: "sidebar",
224
+ nodeType: "Sidebar",
225
+ category: "layout",
226
+ attributes: [...COMMON_ATTRIBUTES, "position", "border", "bg"],
227
+ hasChildren: true,
228
+ description: "Side navigation or content area",
229
+ example: "sidebar w=240 border { ... }",
230
+ validParents: ["page"]
231
+ },
232
+ {
233
+ name: "section",
234
+ nodeType: "Section",
235
+ category: "layout",
236
+ attributes: [...COMMON_ATTRIBUTES, "title", "expanded"],
237
+ hasChildren: true,
238
+ description: "Grouped content section",
239
+ example: 'section "Settings" expanded { ... }'
240
+ },
241
+ // ============================================
242
+ // Grid Components
243
+ // ============================================
244
+ {
245
+ name: "row",
246
+ nodeType: "Row",
247
+ category: "grid",
248
+ attributes: [...COMMON_ATTRIBUTES, "border", "bg"],
249
+ hasChildren: true,
250
+ description: "Horizontal flex container",
251
+ example: "row flex gap=4 justify=between { ... }"
252
+ },
253
+ {
254
+ name: "col",
255
+ nodeType: "Col",
256
+ category: "grid",
257
+ attributes: [...COMMON_ATTRIBUTES, "sm", "md", "lg", "xl", "order", "border", "bg", "scroll"],
258
+ hasChildren: true,
259
+ description: "Vertical flex container or grid column",
260
+ example: "col span=6 md=4 { ... }"
261
+ },
262
+ // ============================================
263
+ // Container Components
264
+ // ============================================
265
+ {
266
+ name: "card",
267
+ nodeType: "Card",
268
+ category: "container",
269
+ attributes: [...COMMON_ATTRIBUTES, "title", "shadow", "border", "rounded"],
270
+ hasChildren: true,
271
+ description: "Card container with optional title",
272
+ example: 'card "Settings" p=4 shadow=md { ... }'
273
+ },
274
+ {
275
+ name: "modal",
276
+ nodeType: "Modal",
277
+ category: "container",
278
+ attributes: [...COMMON_ATTRIBUTES, "title"],
279
+ hasChildren: true,
280
+ description: "Modal dialog overlay",
281
+ example: 'modal "Confirm" w=400 { ... }'
282
+ },
283
+ {
284
+ name: "drawer",
285
+ nodeType: "Drawer",
286
+ category: "container",
287
+ attributes: [...COMMON_ATTRIBUTES, "title", "position"],
288
+ hasChildren: true,
289
+ description: "Slide-in drawer panel",
290
+ example: 'drawer "Menu" position=left { ... }'
291
+ },
292
+ {
293
+ name: "accordion",
294
+ nodeType: "Accordion",
295
+ category: "container",
296
+ attributes: [...COMMON_ATTRIBUTES, "title"],
297
+ hasChildren: true,
298
+ description: "Collapsible sections container",
299
+ example: 'accordion { section "FAQ 1" { ... } }'
300
+ },
301
+ // ============================================
302
+ // Text Components
303
+ // ============================================
304
+ {
305
+ name: "text",
306
+ nodeType: "Text",
307
+ category: "text",
308
+ attributes: [...COMMON_ATTRIBUTES, "size", "weight", "muted", "bold"],
309
+ hasChildren: false,
310
+ description: "Text content",
311
+ example: 'text "Hello World" size=lg weight=bold'
312
+ },
313
+ {
314
+ name: "title",
315
+ nodeType: "Title",
316
+ category: "text",
317
+ attributes: [...COMMON_ATTRIBUTES, "level", "size"],
318
+ hasChildren: false,
319
+ description: "Heading element (h1-h6)",
320
+ example: 'title "Welcome" level=2'
321
+ },
322
+ {
323
+ name: "link",
324
+ nodeType: "Link",
325
+ category: "text",
326
+ attributes: [...COMMON_ATTRIBUTES, "href", "external"],
327
+ hasChildren: false,
328
+ description: "Hyperlink text",
329
+ example: 'link "Learn more" href="/docs" external'
330
+ },
331
+ // ============================================
332
+ // Input Components
333
+ // ============================================
334
+ {
335
+ name: "input",
336
+ nodeType: "Input",
337
+ category: "input",
338
+ attributes: [...COMMON_ATTRIBUTES, "label", "inputType", "placeholder", "value", "disabled", "required", "readonly", "icon", "size", "rounded"],
339
+ hasChildren: false,
340
+ description: "Text input field",
341
+ example: 'input "Email" inputType=email placeholder="user@example.com" required'
342
+ },
343
+ {
344
+ name: "textarea",
345
+ nodeType: "Textarea",
346
+ category: "input",
347
+ attributes: [...COMMON_ATTRIBUTES, "label", "placeholder", "value", "rows", "disabled", "required"],
348
+ hasChildren: false,
349
+ description: "Multi-line text input",
350
+ example: 'textarea "Description" rows=4 placeholder="Enter description..."'
351
+ },
352
+ {
353
+ name: "select",
354
+ nodeType: "Select",
355
+ category: "input",
356
+ attributes: [...COMMON_ATTRIBUTES, "label", "placeholder", "value", "disabled", "required"],
357
+ hasChildren: false,
358
+ description: "Dropdown select",
359
+ example: 'select "Country" ["USA", "Canada", "UK"] placeholder="Select..."'
360
+ },
361
+ {
362
+ name: "checkbox",
363
+ nodeType: "Checkbox",
364
+ category: "input",
365
+ attributes: [...COMMON_ATTRIBUTES, "label", "checked", "disabled"],
366
+ hasChildren: false,
367
+ description: "Checkbox input",
368
+ example: 'checkbox "I agree to terms" checked'
369
+ },
370
+ {
371
+ name: "radio",
372
+ nodeType: "Radio",
373
+ category: "input",
374
+ attributes: [...COMMON_ATTRIBUTES, "label", "name", "checked", "disabled"],
375
+ hasChildren: false,
376
+ description: "Radio button input",
377
+ example: 'radio "Option A" name="choice" checked'
378
+ },
379
+ {
380
+ name: "switch",
381
+ nodeType: "Switch",
382
+ category: "input",
383
+ attributes: [...COMMON_ATTRIBUTES, "label", "checked", "disabled"],
384
+ hasChildren: false,
385
+ description: "Toggle switch",
386
+ example: 'switch "Dark mode" checked'
387
+ },
388
+ {
389
+ name: "slider",
390
+ nodeType: "Slider",
391
+ category: "input",
392
+ attributes: [...COMMON_ATTRIBUTES, "label", "min", "max", "value", "step", "disabled"],
393
+ hasChildren: false,
394
+ description: "Range slider",
395
+ example: 'slider "Volume" min=0 max=100 value=50'
396
+ },
397
+ {
398
+ name: "button",
399
+ nodeType: "Button",
400
+ category: "input",
401
+ attributes: [...COMMON_ATTRIBUTES, "primary", "secondary", "outline", "ghost", "danger", "size", "icon", "disabled", "loading"],
402
+ hasChildren: false,
403
+ description: "Clickable button",
404
+ example: 'button "Submit" primary icon=send'
405
+ },
406
+ // ============================================
407
+ // Display Components
408
+ // ============================================
409
+ {
410
+ name: "image",
411
+ nodeType: "Image",
412
+ category: "display",
413
+ attributes: [...COMMON_ATTRIBUTES, "src", "alt"],
414
+ hasChildren: false,
415
+ description: "Image placeholder",
416
+ example: "image w=200 h=150"
417
+ },
418
+ {
419
+ name: "placeholder",
420
+ nodeType: "Placeholder",
421
+ category: "display",
422
+ attributes: [...COMMON_ATTRIBUTES, "label"],
423
+ hasChildren: true,
424
+ description: "Generic placeholder",
425
+ example: 'placeholder "Banner Image" w=full h=200 { ... }'
426
+ },
427
+ {
428
+ name: "avatar",
429
+ nodeType: "Avatar",
430
+ category: "display",
431
+ attributes: [...COMMON_ATTRIBUTES, "name", "src", "size"],
432
+ hasChildren: false,
433
+ description: "User avatar",
434
+ example: 'avatar "John Doe" size=lg'
435
+ },
436
+ {
437
+ name: "badge",
438
+ nodeType: "Badge",
439
+ category: "display",
440
+ attributes: [...COMMON_ATTRIBUTES, "variant", "pill", "icon", "size"],
441
+ hasChildren: false,
442
+ description: "Status badge",
443
+ example: 'badge "New" variant=success pill'
444
+ },
445
+ {
446
+ name: "icon",
447
+ nodeType: "Icon",
448
+ category: "display",
449
+ attributes: [...COMMON_ATTRIBUTES, "size", "muted"],
450
+ hasChildren: false,
451
+ description: "Lucide icon",
452
+ example: 'icon "settings" size=lg'
453
+ },
454
+ // ============================================
455
+ // Data Components
456
+ // ============================================
457
+ {
458
+ name: "table",
459
+ nodeType: "Table",
460
+ category: "data",
461
+ attributes: [...COMMON_ATTRIBUTES, "striped", "bordered", "hover"],
462
+ hasChildren: false,
463
+ description: "Data table",
464
+ example: 'table striped bordered { columns ["Name", "Email"] row ["John", "john@example.com"] }'
465
+ },
466
+ {
467
+ name: "list",
468
+ nodeType: "List",
469
+ category: "data",
470
+ attributes: [...COMMON_ATTRIBUTES, "ordered", "none"],
471
+ hasChildren: false,
472
+ description: "List of items",
473
+ example: 'list ordered ["First", "Second", "Third"]'
474
+ },
475
+ // ============================================
476
+ // Feedback Components
477
+ // ============================================
478
+ {
479
+ name: "alert",
480
+ nodeType: "Alert",
481
+ category: "feedback",
482
+ attributes: [...COMMON_ATTRIBUTES, "variant", "dismissible", "icon"],
483
+ hasChildren: false,
484
+ description: "Alert message",
485
+ example: 'alert "Changes saved!" variant=success'
486
+ },
487
+ {
488
+ name: "toast",
489
+ nodeType: "Toast",
490
+ category: "feedback",
491
+ attributes: [...COMMON_ATTRIBUTES, "position", "variant"],
492
+ hasChildren: false,
493
+ description: "Toast notification",
494
+ example: 'toast "Item deleted" position=bottom-right variant=danger'
495
+ },
496
+ {
497
+ name: "progress",
498
+ nodeType: "Progress",
499
+ category: "feedback",
500
+ attributes: [...COMMON_ATTRIBUTES, "value", "max", "label", "indeterminate"],
501
+ hasChildren: false,
502
+ description: "Progress bar",
503
+ example: 'progress value=75 label="Uploading..."'
504
+ },
505
+ {
506
+ name: "spinner",
507
+ nodeType: "Spinner",
508
+ category: "feedback",
509
+ attributes: [...COMMON_ATTRIBUTES, "label", "size"],
510
+ hasChildren: false,
511
+ description: "Loading spinner",
512
+ example: "spinner size=lg"
513
+ },
514
+ // ============================================
515
+ // Overlay Components
516
+ // ============================================
517
+ {
518
+ name: "tooltip",
519
+ nodeType: "Tooltip",
520
+ category: "overlay",
521
+ attributes: [...COMMON_ATTRIBUTES, "position"],
522
+ hasChildren: false,
523
+ description: "Tooltip on hover",
524
+ example: 'tooltip "More info" position=top { icon "help-circle" }'
525
+ },
526
+ {
527
+ name: "popover",
528
+ nodeType: "Popover",
529
+ category: "overlay",
530
+ attributes: [...COMMON_ATTRIBUTES, "title"],
531
+ hasChildren: true,
532
+ description: "Popover panel",
533
+ example: 'popover "Details" { ... }'
534
+ },
535
+ {
536
+ name: "dropdown",
537
+ nodeType: "Dropdown",
538
+ category: "overlay",
539
+ attributes: [...COMMON_ATTRIBUTES],
540
+ hasChildren: false,
541
+ description: "Dropdown menu",
542
+ example: 'dropdown { item "Edit" icon=edit item "Delete" icon=trash danger }'
543
+ },
544
+ // ============================================
545
+ // Navigation Components
546
+ // ============================================
547
+ {
548
+ name: "nav",
549
+ nodeType: "Nav",
550
+ category: "navigation",
551
+ attributes: [...COMMON_ATTRIBUTES, "vertical"],
552
+ hasChildren: false,
553
+ description: "Navigation menu",
554
+ example: 'nav [{ label="Home" icon=home active }, { label="Settings" icon=settings }] vertical'
555
+ },
556
+ {
557
+ name: "tabs",
558
+ nodeType: "Tabs",
559
+ category: "navigation",
560
+ attributes: [...COMMON_ATTRIBUTES, "active"],
561
+ hasChildren: true,
562
+ description: "Tab navigation",
563
+ example: 'tabs { tab "General" active { ... } tab "Advanced" { ... } }'
564
+ },
565
+ {
566
+ name: "breadcrumb",
567
+ nodeType: "Breadcrumb",
568
+ category: "navigation",
569
+ attributes: [...COMMON_ATTRIBUTES],
570
+ hasChildren: false,
571
+ description: "Breadcrumb navigation",
572
+ example: 'breadcrumb [{ label="Home" href="/" }, { label="Products" }, { label="Details" }]'
573
+ },
574
+ // ============================================
575
+ // Divider Component
576
+ // ============================================
577
+ {
578
+ name: "divider",
579
+ nodeType: "Divider",
580
+ category: "layout",
581
+ attributes: [...COMMON_ATTRIBUTES, "vertical"],
582
+ hasChildren: false,
583
+ description: "Horizontal separator",
584
+ example: "divider my=4"
585
+ }
586
+ ];
587
+ var COMPONENT_MAP = new Map(
588
+ ALL_COMPONENTS.map((comp) => [comp.name, comp])
589
+ );
590
+ var NODE_TYPE_MAP = new Map(
591
+ ALL_COMPONENTS.map((comp) => [comp.nodeType, comp])
592
+ );
593
+ var VALID_COMPONENT_NAMES = new Set(
594
+ ALL_COMPONENTS.map((comp) => comp.name)
595
+ );
596
+
597
+ // src/utils.ts
598
+ function getComponent(name) {
599
+ return COMPONENT_MAP.get(name.toLowerCase());
600
+ }
601
+ function getAttribute(name) {
602
+ return ATTRIBUTE_MAP.get(name);
603
+ }
604
+ function getValidChildren(componentName) {
605
+ const component = getComponent(componentName);
606
+ if (!component || !component.hasChildren) return [];
607
+ if (component.validChildren === void 0) {
608
+ return ALL_COMPONENTS.filter((c) => c.name !== "page");
609
+ }
610
+ return component.validChildren.map((name) => getComponent(name)).filter((c) => c !== void 0);
611
+ }
612
+ function getComponentAttributes(componentName) {
613
+ const component = getComponent(componentName);
614
+ if (!component) return ATTRIBUTES;
615
+ return ATTRIBUTES.filter((attr) => component.attributes.includes(attr.name));
616
+ }
617
+ function getAttributeTypeLabel(attr) {
618
+ if (attr.type === "boolean") return "boolean";
619
+ if (attr.type === "number") return "number";
620
+ if (attr.type === "string" || attr.type === "string[]") return "string";
621
+ if (attr.type === "enum" && attr.values) {
622
+ const preview = attr.values.slice(0, 3).join(" | ");
623
+ return attr.values.length > 3 ? `${preview}...` : preview;
624
+ }
625
+ return attr.type;
626
+ }
627
+ function getComponentNames() {
628
+ return ALL_COMPONENTS.map((c) => c.name);
629
+ }
630
+ function getAttributeNames() {
631
+ return ATTRIBUTES.map((a) => a.name);
632
+ }
633
+
634
+ // src/keywords.ts
635
+ var CATEGORY_LABELS = {
636
+ layout: "Layout",
637
+ container: "Container",
638
+ grid: "Grid",
639
+ text: "Text",
640
+ input: "Input",
641
+ display: "Display",
642
+ data: "Data",
643
+ feedback: "Feedback",
644
+ overlay: "Overlay",
645
+ navigation: "Navigation"
646
+ };
647
+ var VALUE_KEYWORDS = [
648
+ // Booleans
649
+ "true",
650
+ "false",
651
+ // Button variants
652
+ "primary",
653
+ "secondary",
654
+ "outline",
655
+ "ghost",
656
+ // Status variants
657
+ "success",
658
+ "danger",
659
+ "warning",
660
+ "info",
661
+ "default",
662
+ // Sizes
663
+ "xs",
664
+ "sm",
665
+ "md",
666
+ "lg",
667
+ "xl",
668
+ "base",
669
+ "2xl",
670
+ "3xl",
671
+ // Flex alignment
672
+ "start",
673
+ "center",
674
+ "end",
675
+ "between",
676
+ "around",
677
+ "evenly",
678
+ "stretch",
679
+ "baseline",
680
+ // Positions
681
+ "left",
682
+ "right",
683
+ "top",
684
+ "bottom",
685
+ "top-left",
686
+ "top-center",
687
+ "top-right",
688
+ "bottom-left",
689
+ "bottom-center",
690
+ "bottom-right",
691
+ // Sizing
692
+ "full",
693
+ "auto",
694
+ "screen",
695
+ "fit",
696
+ // Font weights
697
+ "normal",
698
+ "medium",
699
+ "semibold",
700
+ "bold",
701
+ // Input types
702
+ "text",
703
+ "email",
704
+ "password",
705
+ "number",
706
+ "tel",
707
+ "url",
708
+ "search",
709
+ "date",
710
+ // Flex direction
711
+ "row",
712
+ "column",
713
+ "row-reverse",
714
+ "column-reverse",
715
+ // List
716
+ "none",
717
+ "nowrap"
718
+ ];
719
+
720
+ // src/monaco/language.ts
721
+ var LANGUAGE_ID = "wireframe";
722
+ var LANGUAGE_ALIASES = ["wireweave", "wf"];
723
+ var LANGUAGE_EXTENSIONS = [".wf", ".wireframe"];
724
+ function getMonarchTokensProvider() {
725
+ const componentNames = getComponentNames();
726
+ const attributeNames = getAttributeNames();
727
+ const layoutComponents = ["page", "header", "footer", "main", "sidebar", "nav", "row", "col", "card", "modal", "table", "form", "tabs"];
728
+ const otherComponents = componentNames.filter((c) => !layoutComponents.includes(c));
729
+ return {
730
+ defaultToken: "",
731
+ tokenPostfix: ".wireframe",
732
+ // Keywords and identifiers
733
+ keywords: layoutComponents,
734
+ typeKeywords: otherComponents,
735
+ attributes: attributeNames,
736
+ valueKeywords: VALUE_KEYWORDS,
737
+ // Operators
738
+ operators: ["="],
739
+ // Symbols
740
+ symbols: /[=><!~?:&|+\-*\/\^%]+/,
741
+ // Escapes
742
+ escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
743
+ // Tokenizer
744
+ tokenizer: {
745
+ root: [
746
+ // Comments
747
+ [/\/\/.*$/, "comment"],
748
+ [/\/\*/, "comment", "@comment"],
749
+ // Strings
750
+ [/"([^"\\]|\\.)*$/, "string.invalid"],
751
+ [/"/, "string", "@string"],
752
+ // Numbers
753
+ [/\d+(\.\d+)?/, "number"],
754
+ // Identifiers and keywords
755
+ [/[a-zA-Z_]\w*/, {
756
+ cases: {
757
+ "@keywords": "keyword",
758
+ "@typeKeywords": "type",
759
+ "@attributes": "attribute.name",
760
+ "@valueKeywords": "attribute.value",
761
+ "@default": "identifier"
762
+ }
763
+ }],
764
+ // Brackets
765
+ [/[{}()\[\]]/, "@brackets"],
766
+ // Operators
767
+ [/@symbols/, {
768
+ cases: {
769
+ "@operators": "operator",
770
+ "@default": ""
771
+ }
772
+ }],
773
+ // Whitespace
774
+ [/[ \t\r\n]+/, "white"]
775
+ ],
776
+ comment: [
777
+ [/[^\/*]+/, "comment"],
778
+ [/\*\//, "comment", "@pop"],
779
+ [/[\/*]/, "comment"]
780
+ ],
781
+ string: [
782
+ [/[^\\"]+/, "string"],
783
+ [/@escapes/, "string.escape"],
784
+ [/\\./, "string.escape.invalid"],
785
+ [/"/, "string", "@pop"]
786
+ ]
787
+ }
788
+ };
789
+ }
790
+ function getLanguageConfiguration() {
791
+ return {
792
+ comments: {
793
+ lineComment: "//",
794
+ blockComment: ["/*", "*/"]
795
+ },
796
+ brackets: [
797
+ ["{", "}"],
798
+ ["[", "]"],
799
+ ["(", ")"]
800
+ ],
801
+ autoClosingPairs: [
802
+ { open: "{", close: "}" },
803
+ { open: "[", close: "]" },
804
+ { open: "(", close: ")" },
805
+ { open: '"', close: '"', notIn: ["string"] }
806
+ ],
807
+ surroundingPairs: [
808
+ { open: "{", close: "}" },
809
+ { open: "[", close: "]" },
810
+ { open: "(", close: ")" },
811
+ { open: '"', close: '"' }
812
+ ],
813
+ folding: {
814
+ markers: {
815
+ start: /^\s*\{/,
816
+ end: /^\s*\}/
817
+ }
818
+ },
819
+ indentationRules: {
820
+ increaseIndentPattern: /\{\s*$/,
821
+ decreaseIndentPattern: /^\s*\}/
822
+ }
823
+ };
824
+ }
825
+
826
+ // src/monaco/providers.ts
827
+ function getCategoryLabel(category) {
828
+ return CATEGORY_LABELS[category] || category;
829
+ }
830
+ function createHoverProvider(monaco) {
831
+ return {
832
+ provideHover(model, position) {
833
+ const word = model.getWordAtPosition(position);
834
+ if (!word) return null;
835
+ const wordText = word.word;
836
+ const component = getComponent(wordText);
837
+ if (component) {
838
+ return {
839
+ range: new monaco.Range(
840
+ position.lineNumber,
841
+ word.startColumn,
842
+ position.lineNumber,
843
+ word.endColumn
844
+ ),
845
+ contents: [
846
+ { value: `**${component.name}** _(${getCategoryLabel(component.category)})_` },
847
+ { value: component.description },
848
+ { value: `\`\`\`
849
+ Attributes: ${component.attributes.join(", ")}
850
+ \`\`\`` }
851
+ ]
852
+ };
853
+ }
854
+ const attribute = getAttribute(wordText);
855
+ if (attribute) {
856
+ let valueInfo = "";
857
+ if (attribute.type === "number") {
858
+ valueInfo = "Type: number";
859
+ } else if (attribute.type === "string") {
860
+ valueInfo = "Type: string";
861
+ } else if (attribute.type === "boolean") {
862
+ valueInfo = "Type: boolean (can be omitted)";
863
+ } else if (attribute.type === "enum" && attribute.values) {
864
+ valueInfo = `Values: ${attribute.values.join(" | ")}`;
865
+ }
866
+ return {
867
+ range: new monaco.Range(
868
+ position.lineNumber,
869
+ word.startColumn,
870
+ position.lineNumber,
871
+ word.endColumn
872
+ ),
873
+ contents: [
874
+ { value: `**${attribute.name}** _(attribute)_` },
875
+ { value: attribute.description },
876
+ { value: valueInfo ? `\`${valueInfo}\`` : "" },
877
+ { value: attribute.example ? `Example: \`${attribute.example}\`` : "" }
878
+ ].filter((c) => c.value)
879
+ };
880
+ }
881
+ if (VALUE_KEYWORDS.includes(wordText)) {
882
+ const relatedAttrs = ATTRIBUTES.filter(
883
+ (a) => a.type === "enum" && a.values?.includes(wordText)
884
+ );
885
+ if (relatedAttrs.length > 0) {
886
+ return {
887
+ range: new monaco.Range(
888
+ position.lineNumber,
889
+ word.startColumn,
890
+ position.lineNumber,
891
+ word.endColumn
892
+ ),
893
+ contents: [
894
+ { value: `**${wordText}** _(value)_` },
895
+ { value: `Used in: ${relatedAttrs.map((a) => a.name).join(", ")}` }
896
+ ]
897
+ };
898
+ }
899
+ }
900
+ return null;
901
+ }
902
+ };
903
+ }
904
+ function findParentComponent(model, position) {
905
+ let braceCount = 0;
906
+ for (let line = position.lineNumber; line >= 1; line--) {
907
+ const lineContent = model.getLineContent(line);
908
+ const endCol = line === position.lineNumber ? position.column - 1 : lineContent.length;
909
+ for (let col = endCol - 1; col >= 0; col--) {
910
+ if (lineContent[col] === "}") braceCount++;
911
+ if (lineContent[col] === "{") {
912
+ braceCount--;
913
+ if (braceCount < 0) {
914
+ const beforeBrace = lineContent.substring(0, col);
915
+ const match = beforeBrace.match(/(\w+)(?:\s+"[^"]*")?\s*$/);
916
+ return match ? match[1] : null;
917
+ }
918
+ }
919
+ }
920
+ }
921
+ return null;
922
+ }
923
+ function createCompletionProvider(monaco) {
924
+ return {
925
+ triggerCharacters: [" ", "=", '"'],
926
+ provideCompletionItems(model, position) {
927
+ const lineContent = model.getLineContent(position.lineNumber);
928
+ const textUntilPosition = lineContent.substring(0, position.column - 1);
929
+ const word = model.getWordUntilPosition(position);
930
+ const range = {
931
+ startLineNumber: position.lineNumber,
932
+ endLineNumber: position.lineNumber,
933
+ startColumn: word.startColumn,
934
+ endColumn: word.endColumn
935
+ };
936
+ const suggestions = [];
937
+ if (textUntilPosition.match(/\w+\s*=\s*$/)) {
938
+ const attrMatch = textUntilPosition.match(/(\w+)\s*=\s*$/);
939
+ if (attrMatch) {
940
+ const attrName = attrMatch[1];
941
+ const attr = getAttribute(attrName);
942
+ if (attr && attr.type === "enum" && attr.values) {
943
+ attr.values.forEach((value) => {
944
+ suggestions.push({
945
+ label: value,
946
+ kind: monaco.languages.CompletionItemKind.EnumMember,
947
+ insertText: value,
948
+ range,
949
+ detail: `value for ${attrName}`
950
+ });
951
+ });
952
+ } else if (attr?.type === "number") {
953
+ [1, 2, 3, 4, 5, 6, 8, 10, 12, 16].forEach((n) => {
954
+ suggestions.push({
955
+ label: String(n),
956
+ kind: monaco.languages.CompletionItemKind.Value,
957
+ insertText: String(n),
958
+ range,
959
+ detail: "number"
960
+ });
961
+ });
962
+ }
963
+ return { suggestions };
964
+ }
965
+ }
966
+ if (textUntilPosition.match(/^\s*$/) || textUntilPosition.match(/\{\s*$/)) {
967
+ const parentComponent2 = findParentComponent(model, position);
968
+ const validChildren2 = parentComponent2 ? getValidChildren(parentComponent2) : [];
969
+ const validChildNames2 = new Set(validChildren2.map((c) => c.name));
970
+ const isRootLevel2 = !parentComponent2;
971
+ ALL_COMPONENTS.forEach((comp) => {
972
+ const isValidInContext = isRootLevel2 ? comp.name === "page" : validChildNames2.size === 0 || validChildNames2.has(comp.name);
973
+ suggestions.push({
974
+ label: isValidInContext ? `\u2605 ${comp.name}` : comp.name,
975
+ kind: isValidInContext ? monaco.languages.CompletionItemKind.Class : monaco.languages.CompletionItemKind.Reference,
976
+ insertText: comp.hasChildren ? `${comp.name} {
977
+ $0
978
+ }` : comp.name,
979
+ insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet,
980
+ range,
981
+ detail: isValidInContext ? `${getCategoryLabel(comp.category)} (recommended)` : getCategoryLabel(comp.category),
982
+ documentation: comp.description,
983
+ sortText: isValidInContext ? `0_${comp.name}` : `1_${comp.name}`,
984
+ filterText: comp.name
985
+ });
986
+ });
987
+ return { suggestions };
988
+ }
989
+ const componentMatch = textUntilPosition.match(/(\w+)(?:\s+"[^"]*")?\s+(\w*)$/);
990
+ if (componentMatch) {
991
+ const compName = componentMatch[1];
992
+ const component = getComponent(compName);
993
+ if (component) {
994
+ const attrs = getComponentAttributes(compName);
995
+ attrs.forEach((attr) => {
996
+ let insertText = attr.name;
997
+ if (attr.type === "string") {
998
+ insertText = `${attr.name}="$1"`;
999
+ } else if (attr.type === "number") {
1000
+ insertText = `${attr.name}=$1`;
1001
+ } else if (attr.type === "enum") {
1002
+ insertText = `${attr.name}=$1`;
1003
+ }
1004
+ suggestions.push({
1005
+ label: attr.name,
1006
+ kind: monaco.languages.CompletionItemKind.Property,
1007
+ insertText,
1008
+ insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet,
1009
+ range,
1010
+ detail: getAttributeTypeLabel(attr),
1011
+ documentation: attr.description + (attr.example ? `
1012
+
1013
+ Example: ${attr.example}` : "")
1014
+ });
1015
+ });
1016
+ } else {
1017
+ ATTRIBUTES.forEach((attr) => {
1018
+ let insertText = attr.name;
1019
+ if (attr.type === "string") {
1020
+ insertText = `${attr.name}="$1"`;
1021
+ } else if (attr.type === "number") {
1022
+ insertText = `${attr.name}=$1`;
1023
+ } else if (attr.type === "enum") {
1024
+ insertText = `${attr.name}=$1`;
1025
+ }
1026
+ suggestions.push({
1027
+ label: attr.name,
1028
+ kind: monaco.languages.CompletionItemKind.Property,
1029
+ insertText,
1030
+ insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet,
1031
+ range,
1032
+ detail: getAttributeTypeLabel(attr),
1033
+ documentation: attr.description
1034
+ });
1035
+ });
1036
+ }
1037
+ return { suggestions };
1038
+ }
1039
+ const parentComponent = findParentComponent(model, position);
1040
+ const validChildren = parentComponent ? getValidChildren(parentComponent) : [];
1041
+ const validChildNames = new Set(validChildren.map((c) => c.name));
1042
+ const isRootLevel = !parentComponent;
1043
+ ALL_COMPONENTS.forEach((comp) => {
1044
+ const isValidInContext = isRootLevel ? comp.name === "page" : validChildNames.size === 0 || validChildNames.has(comp.name);
1045
+ suggestions.push({
1046
+ label: isValidInContext ? `\u2605 ${comp.name}` : comp.name,
1047
+ kind: isValidInContext ? monaco.languages.CompletionItemKind.Class : monaco.languages.CompletionItemKind.Reference,
1048
+ insertText: comp.hasChildren ? `${comp.name} {
1049
+ $0
1050
+ }` : comp.name,
1051
+ insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet,
1052
+ range,
1053
+ detail: isValidInContext ? `${getCategoryLabel(comp.category)} (recommended)` : getCategoryLabel(comp.category),
1054
+ documentation: comp.description,
1055
+ sortText: isValidInContext ? `0_${comp.name}` : `1_${comp.name}`,
1056
+ filterText: comp.name
1057
+ });
1058
+ });
1059
+ return { suggestions };
1060
+ }
1061
+ };
1062
+ }
1063
+
1064
+ // src/monaco/diagnostics.ts
1065
+ var MarkerSeverity = {
1066
+ Hint: 1,
1067
+ Info: 2,
1068
+ Warning: 4,
1069
+ Error: 8
1070
+ };
1071
+ function validateCode(text) {
1072
+ const markers = [];
1073
+ const lines = text.split("\n");
1074
+ let braceStack = [];
1075
+ let hasPage = false;
1076
+ for (let i = 0; i < lines.length; i++) {
1077
+ const line = lines[i];
1078
+ const lineNumber = i + 1;
1079
+ if (line.trim().startsWith("//")) continue;
1080
+ if (line.match(/^\s*page\b/)) {
1081
+ if (hasPage) {
1082
+ markers.push({
1083
+ severity: MarkerSeverity.Error,
1084
+ message: "Only one page component is allowed.",
1085
+ startLineNumber: lineNumber,
1086
+ startColumn: 1,
1087
+ endLineNumber: lineNumber,
1088
+ endColumn: line.length + 1
1089
+ });
1090
+ }
1091
+ hasPage = true;
1092
+ }
1093
+ const componentMatch = line.match(/^\s*(\w+)(?:\s|{|")/);
1094
+ if (componentMatch) {
1095
+ const compName = componentMatch[1];
1096
+ if (!getComponent(compName) && !["true", "false"].includes(compName)) {
1097
+ const beforeMatch = line.substring(0, componentMatch.index);
1098
+ if (!beforeMatch.match(/=\s*$/)) {
1099
+ markers.push({
1100
+ severity: MarkerSeverity.Warning,
1101
+ message: `Unknown component: "${compName}"`,
1102
+ startLineNumber: lineNumber,
1103
+ startColumn: (componentMatch.index || 0) + 1,
1104
+ endLineNumber: lineNumber,
1105
+ endColumn: (componentMatch.index || 0) + compName.length + 1
1106
+ });
1107
+ }
1108
+ }
1109
+ }
1110
+ const attrMatches = line.matchAll(/\b(\w+)\s*=/g);
1111
+ for (const match of attrMatches) {
1112
+ const attrName = match[1];
1113
+ if (!getAttribute(attrName) && !getComponent(attrName)) {
1114
+ markers.push({
1115
+ severity: MarkerSeverity.Warning,
1116
+ message: `Unknown attribute: "${attrName}"`,
1117
+ startLineNumber: lineNumber,
1118
+ startColumn: match.index + 1,
1119
+ endLineNumber: lineNumber,
1120
+ endColumn: match.index + attrName.length + 1
1121
+ });
1122
+ }
1123
+ }
1124
+ for (let j = 0; j < line.length; j++) {
1125
+ if (line[j] === "{") {
1126
+ const beforeBrace = line.substring(0, j);
1127
+ const compMatch = beforeBrace.match(/(\w+)(?:\s+"[^"]*")?\s*$/);
1128
+ braceStack.push({
1129
+ line: lineNumber,
1130
+ col: j + 1,
1131
+ component: compMatch ? compMatch[1] : void 0
1132
+ });
1133
+ } else if (line[j] === "}") {
1134
+ if (braceStack.length === 0) {
1135
+ markers.push({
1136
+ severity: MarkerSeverity.Error,
1137
+ message: "Unmatched closing brace",
1138
+ startLineNumber: lineNumber,
1139
+ startColumn: j + 1,
1140
+ endLineNumber: lineNumber,
1141
+ endColumn: j + 2
1142
+ });
1143
+ } else {
1144
+ braceStack.pop();
1145
+ }
1146
+ }
1147
+ }
1148
+ const quotes = line.match(/"/g);
1149
+ if (quotes && quotes.length % 2 !== 0) {
1150
+ markers.push({
1151
+ severity: MarkerSeverity.Error,
1152
+ message: "Unclosed string",
1153
+ startLineNumber: lineNumber,
1154
+ startColumn: 1,
1155
+ endLineNumber: lineNumber,
1156
+ endColumn: line.length + 1
1157
+ });
1158
+ }
1159
+ }
1160
+ for (const brace of braceStack) {
1161
+ markers.push({
1162
+ severity: MarkerSeverity.Error,
1163
+ message: `Unclosed brace${brace.component ? ` (${brace.component})` : ""}`,
1164
+ startLineNumber: brace.line,
1165
+ startColumn: brace.col,
1166
+ endLineNumber: brace.line,
1167
+ endColumn: brace.col + 1
1168
+ });
1169
+ }
1170
+ if (!hasPage && text.trim()) {
1171
+ markers.push({
1172
+ severity: MarkerSeverity.Info,
1173
+ message: "Consider starting with a page component.",
1174
+ startLineNumber: 1,
1175
+ startColumn: 1,
1176
+ endLineNumber: 1,
1177
+ endColumn: 1
1178
+ });
1179
+ }
1180
+ return markers;
1181
+ }
1182
+ function createDiagnosticsSetup(monaco) {
1183
+ return function setupDiagnostics(editor) {
1184
+ let timeout = null;
1185
+ const validate = () => {
1186
+ const model = editor.getModel();
1187
+ if (!model) return;
1188
+ const text = model.getValue();
1189
+ const markers = validateCode(text);
1190
+ const monacoMarkers = markers.map((m) => ({
1191
+ ...m,
1192
+ severity: m.severity
1193
+ }));
1194
+ monaco.editor.setModelMarkers(model, "wireframe", monacoMarkers);
1195
+ };
1196
+ validate();
1197
+ const disposable = editor.onDidChangeModelContent(() => {
1198
+ if (timeout) clearTimeout(timeout);
1199
+ timeout = setTimeout(validate, 500);
1200
+ });
1201
+ return () => {
1202
+ disposable.dispose();
1203
+ if (timeout) clearTimeout(timeout);
1204
+ };
1205
+ };
1206
+ }
1207
+
1208
+ // src/monaco/index.ts
1209
+ function registerWireframeLanguage(monaco) {
1210
+ monaco.languages.register({
1211
+ id: LANGUAGE_ID,
1212
+ aliases: ["Wireframe", "wireweave", "wf"],
1213
+ extensions: [".wf", ".wireframe"]
1214
+ });
1215
+ monaco.languages.setMonarchTokensProvider(LANGUAGE_ID, getMonarchTokensProvider());
1216
+ monaco.languages.setLanguageConfiguration(LANGUAGE_ID, getLanguageConfiguration());
1217
+ monaco.languages.registerHoverProvider(LANGUAGE_ID, createHoverProvider(monaco));
1218
+ monaco.languages.registerCompletionItemProvider(LANGUAGE_ID, createCompletionProvider(monaco));
1219
+ }
1220
+ export {
1221
+ LANGUAGE_ALIASES,
1222
+ LANGUAGE_EXTENSIONS,
1223
+ LANGUAGE_ID,
1224
+ MarkerSeverity,
1225
+ createCompletionProvider,
1226
+ createDiagnosticsSetup,
1227
+ createHoverProvider,
1228
+ getLanguageConfiguration,
1229
+ getMonarchTokensProvider,
1230
+ registerWireframeLanguage,
1231
+ validateCode
1232
+ };
1233
+ //# sourceMappingURL=index.js.map