@wire-dsl/language-support 0.2.3 → 0.3.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.
- package/INTEGRATION-GUIDE.md +50 -194
- package/README.md +39 -33
- package/dist/completions.d.ts.map +1 -1
- package/dist/completions.js +8 -1
- package/dist/completions.js.map +1 -1
- package/dist/components.d.ts +0 -6
- package/dist/components.d.ts.map +1 -1
- package/dist/components.js +80 -35
- package/dist/components.js.map +1 -1
- package/dist/context-detection.js +2 -2
- package/dist/context-detection.js.map +1 -1
- package/dist/document-parser.d.ts +12 -0
- package/dist/document-parser.d.ts.map +1 -1
- package/dist/document-parser.js +49 -0
- package/dist/document-parser.js.map +1 -1
- package/dist/documentation.js +1 -1
- package/dist/documentation.js.map +1 -1
- package/dist/icon-names.d.ts +8 -0
- package/dist/icon-names.d.ts.map +1 -0
- package/dist/icon-names.js +295 -0
- package/dist/icon-names.js.map +1 -0
- package/dist/index.d.ts +6 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -6
- package/dist/index.js.map +1 -1
- package/dist-cjs/completions.js +394 -0
- package/dist-cjs/completions.js.map +1 -0
- package/dist-cjs/components.js +495 -0
- package/dist-cjs/components.js.map +1 -0
- package/dist-cjs/context-detection.js +153 -0
- package/dist-cjs/context-detection.js.map +1 -0
- package/dist-cjs/document-parser.js +323 -0
- package/dist-cjs/document-parser.js.map +1 -0
- package/dist-cjs/documentation.js +133 -0
- package/dist-cjs/documentation.js.map +1 -0
- package/dist-cjs/icon-names.js +298 -0
- package/dist-cjs/icon-names.js.map +1 -0
- package/dist-cjs/index.js +114 -0
- package/dist-cjs/index.js.map +1 -0
- package/dist-cjs/package.json +1 -0
- package/package.json +14 -3
|
@@ -0,0 +1,495 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KEYWORDS = exports.PROPERTY_VALUES = exports.LAYOUTS = exports.COMPONENTS = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Wire DSL Component Metadata
|
|
6
|
+
* Used for autocompletion, validation, and code intelligence.
|
|
7
|
+
*
|
|
8
|
+
* Last synced: February 16, 2026
|
|
9
|
+
*/
|
|
10
|
+
const icon_names_js_1 = require("./icon-names.js");
|
|
11
|
+
// Reusable Enum Definitions
|
|
12
|
+
const sizeEnum = { name: 'size', type: 'enum', options: ['sm', 'md', 'lg'] };
|
|
13
|
+
const spacingEnum = {
|
|
14
|
+
name: 'spacing',
|
|
15
|
+
type: 'enum',
|
|
16
|
+
options: ['none', 'xs', 'sm', 'md', 'lg', 'xl'],
|
|
17
|
+
};
|
|
18
|
+
const variantEnum = {
|
|
19
|
+
name: 'variant',
|
|
20
|
+
type: 'enum',
|
|
21
|
+
options: ['primary', 'secondary', 'success', 'warning', 'danger', 'info'],
|
|
22
|
+
};
|
|
23
|
+
const variantWithDefaultEnum = {
|
|
24
|
+
name: 'variant',
|
|
25
|
+
type: 'enum',
|
|
26
|
+
options: ['default', 'primary', 'secondary', 'success', 'warning', 'danger', 'info'],
|
|
27
|
+
};
|
|
28
|
+
const iconNameEnum = {
|
|
29
|
+
name: 'icon',
|
|
30
|
+
type: 'enum',
|
|
31
|
+
options: icon_names_js_1.ICON_NAME_OPTIONS,
|
|
32
|
+
};
|
|
33
|
+
const controlSizeEnum = {
|
|
34
|
+
name: 'size',
|
|
35
|
+
type: 'enum',
|
|
36
|
+
options: ['sm', 'md', 'lg'],
|
|
37
|
+
};
|
|
38
|
+
const alignEnum = {
|
|
39
|
+
name: 'align',
|
|
40
|
+
type: 'enum',
|
|
41
|
+
options: ['left', 'center', 'right'],
|
|
42
|
+
};
|
|
43
|
+
const controlPaddingEnum = {
|
|
44
|
+
name: 'padding',
|
|
45
|
+
type: 'enum',
|
|
46
|
+
options: ['none', 'xs', 'sm', 'md', 'lg', 'xl'],
|
|
47
|
+
};
|
|
48
|
+
const headingLevelEnum = {
|
|
49
|
+
name: 'level',
|
|
50
|
+
type: 'enum',
|
|
51
|
+
options: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'],
|
|
52
|
+
};
|
|
53
|
+
const headingSpacingEnum = {
|
|
54
|
+
name: 'spacing',
|
|
55
|
+
type: 'enum',
|
|
56
|
+
options: spacingEnum.options,
|
|
57
|
+
};
|
|
58
|
+
const imagePlaceholderEnum = {
|
|
59
|
+
name: 'placeholder',
|
|
60
|
+
type: 'enum',
|
|
61
|
+
options: ['landscape', 'portrait', 'square', 'icon', 'avatar'],
|
|
62
|
+
};
|
|
63
|
+
exports.COMPONENTS = {
|
|
64
|
+
Heading: {
|
|
65
|
+
name: 'Heading',
|
|
66
|
+
description: 'Large heading text with level-based typography.',
|
|
67
|
+
category: 'Text',
|
|
68
|
+
properties: {
|
|
69
|
+
text: { name: 'text', type: 'string', required: true },
|
|
70
|
+
level: headingLevelEnum,
|
|
71
|
+
spacing: headingSpacingEnum,
|
|
72
|
+
variant: variantWithDefaultEnum,
|
|
73
|
+
},
|
|
74
|
+
example: 'component Heading text: "Users" level: h2 spacing: sm',
|
|
75
|
+
},
|
|
76
|
+
Text: {
|
|
77
|
+
name: 'Text',
|
|
78
|
+
description: 'Body text content.',
|
|
79
|
+
category: 'Text',
|
|
80
|
+
properties: {
|
|
81
|
+
text: { name: 'text', type: 'string', required: true },
|
|
82
|
+
},
|
|
83
|
+
example: 'component Text text: "Lorem ipsum dolor sit amet"',
|
|
84
|
+
},
|
|
85
|
+
Label: {
|
|
86
|
+
name: 'Label',
|
|
87
|
+
description: 'Small label text.',
|
|
88
|
+
category: 'Text',
|
|
89
|
+
properties: {
|
|
90
|
+
text: { name: 'text', type: 'string', required: true },
|
|
91
|
+
},
|
|
92
|
+
example: 'component Label text: "Field label"',
|
|
93
|
+
},
|
|
94
|
+
Button: {
|
|
95
|
+
name: 'Button',
|
|
96
|
+
description: 'Clickable action button.',
|
|
97
|
+
category: 'Action',
|
|
98
|
+
properties: {
|
|
99
|
+
text: { name: 'text', type: 'string', required: true },
|
|
100
|
+
variant: variantWithDefaultEnum,
|
|
101
|
+
size: controlSizeEnum,
|
|
102
|
+
labelSpace: { name: 'labelSpace', type: 'boolean' },
|
|
103
|
+
padding: controlPaddingEnum,
|
|
104
|
+
block: { name: 'block', type: 'boolean' },
|
|
105
|
+
},
|
|
106
|
+
example: 'component Button text: "Save" variant: primary block: true',
|
|
107
|
+
},
|
|
108
|
+
Link: {
|
|
109
|
+
name: 'Link',
|
|
110
|
+
description: 'Underlined text action without button background.',
|
|
111
|
+
category: 'Action',
|
|
112
|
+
properties: {
|
|
113
|
+
text: { name: 'text', type: 'string', required: true },
|
|
114
|
+
variant: variantEnum,
|
|
115
|
+
size: controlSizeEnum,
|
|
116
|
+
},
|
|
117
|
+
example: 'component Link text: "Learn more" variant: info',
|
|
118
|
+
},
|
|
119
|
+
Input: {
|
|
120
|
+
name: 'Input',
|
|
121
|
+
description: 'Single-line input field.',
|
|
122
|
+
category: 'Input',
|
|
123
|
+
properties: {
|
|
124
|
+
label: { name: 'label', type: 'string' },
|
|
125
|
+
placeholder: { name: 'placeholder', type: 'string' },
|
|
126
|
+
size: controlSizeEnum,
|
|
127
|
+
},
|
|
128
|
+
example: 'component Input label: "Email" placeholder: "you@example.com"',
|
|
129
|
+
},
|
|
130
|
+
Textarea: {
|
|
131
|
+
name: 'Textarea',
|
|
132
|
+
description: 'Multi-line input field.',
|
|
133
|
+
category: 'Input',
|
|
134
|
+
properties: {
|
|
135
|
+
label: { name: 'label', type: 'string' },
|
|
136
|
+
placeholder: { name: 'placeholder', type: 'string' },
|
|
137
|
+
rows: { name: 'rows', type: 'number' },
|
|
138
|
+
},
|
|
139
|
+
example: 'component Textarea label: "Notes" rows: 4',
|
|
140
|
+
},
|
|
141
|
+
Select: {
|
|
142
|
+
name: 'Select',
|
|
143
|
+
description: 'Select-style input control.',
|
|
144
|
+
category: 'Input',
|
|
145
|
+
properties: {
|
|
146
|
+
label: { name: 'label', type: 'string' },
|
|
147
|
+
placeholder: { name: 'placeholder', type: 'string' },
|
|
148
|
+
items: { name: 'items', type: 'string' },
|
|
149
|
+
size: controlSizeEnum,
|
|
150
|
+
},
|
|
151
|
+
example: 'component Select label: "Role" items: "Admin,User,Guest"',
|
|
152
|
+
},
|
|
153
|
+
Checkbox: {
|
|
154
|
+
name: 'Checkbox',
|
|
155
|
+
description: 'Checkbox control.',
|
|
156
|
+
category: 'Input',
|
|
157
|
+
properties: {
|
|
158
|
+
label: { name: 'label', type: 'string', required: true },
|
|
159
|
+
checked: { name: 'checked', type: 'boolean' },
|
|
160
|
+
},
|
|
161
|
+
example: 'component Checkbox label: "I agree" checked: true',
|
|
162
|
+
},
|
|
163
|
+
Radio: {
|
|
164
|
+
name: 'Radio',
|
|
165
|
+
description: 'Radio control.',
|
|
166
|
+
category: 'Input',
|
|
167
|
+
properties: {
|
|
168
|
+
label: { name: 'label', type: 'string', required: true },
|
|
169
|
+
checked: { name: 'checked', type: 'boolean' },
|
|
170
|
+
},
|
|
171
|
+
example: 'component Radio label: "Option A" checked: true',
|
|
172
|
+
},
|
|
173
|
+
Toggle: {
|
|
174
|
+
name: 'Toggle',
|
|
175
|
+
description: 'Toggle switch control.',
|
|
176
|
+
category: 'Input',
|
|
177
|
+
properties: {
|
|
178
|
+
label: { name: 'label', type: 'string', required: true },
|
|
179
|
+
enabled: { name: 'enabled', type: 'boolean' },
|
|
180
|
+
},
|
|
181
|
+
example: 'component Toggle label: "Dark mode" enabled: true',
|
|
182
|
+
},
|
|
183
|
+
Topbar: {
|
|
184
|
+
name: 'Topbar',
|
|
185
|
+
description: 'Top navigation/header bar.',
|
|
186
|
+
category: 'Navigation',
|
|
187
|
+
properties: {
|
|
188
|
+
title: { name: 'title', type: 'string', required: true },
|
|
189
|
+
subtitle: { name: 'subtitle', type: 'string' },
|
|
190
|
+
icon: iconNameEnum,
|
|
191
|
+
avatar: { name: 'avatar', type: 'boolean' },
|
|
192
|
+
actions: { name: 'actions', type: 'string' },
|
|
193
|
+
user: { name: 'user', type: 'string' },
|
|
194
|
+
variant: variantWithDefaultEnum,
|
|
195
|
+
border: { name: 'border', type: 'boolean' },
|
|
196
|
+
background: { name: 'background', type: 'boolean' },
|
|
197
|
+
radius: { name: 'radius', type: 'enum', options: ['none', 'sm', 'md', 'lg', 'xl'] },
|
|
198
|
+
},
|
|
199
|
+
example: 'component Topbar title: "Dashboard" subtitle: "Overview" icon: "menu" user: "john_doe" avatar: true',
|
|
200
|
+
},
|
|
201
|
+
SidebarMenu: {
|
|
202
|
+
name: 'SidebarMenu',
|
|
203
|
+
description: 'Vertical menu list.',
|
|
204
|
+
category: 'Navigation',
|
|
205
|
+
properties: {
|
|
206
|
+
items: { name: 'items', type: 'string', required: true },
|
|
207
|
+
icons: { name: 'icons', type: 'string' },
|
|
208
|
+
active: { name: 'active', type: 'number' },
|
|
209
|
+
},
|
|
210
|
+
example: 'component SidebarMenu items: "Home,Users,Settings" active: 0',
|
|
211
|
+
},
|
|
212
|
+
Sidebar: {
|
|
213
|
+
name: 'Sidebar',
|
|
214
|
+
description: 'Sidebar panel with title and items.',
|
|
215
|
+
category: 'Navigation',
|
|
216
|
+
properties: {
|
|
217
|
+
title: { name: 'title', type: 'string' },
|
|
218
|
+
items: { name: 'items', type: 'string', required: true },
|
|
219
|
+
active: { name: 'active', type: 'string' },
|
|
220
|
+
itemsMock: { name: 'itemsMock', type: 'number' },
|
|
221
|
+
},
|
|
222
|
+
example: 'component Sidebar title: "Menu" items: "Home,Reports,Settings"',
|
|
223
|
+
},
|
|
224
|
+
Breadcrumbs: {
|
|
225
|
+
name: 'Breadcrumbs',
|
|
226
|
+
description: 'Navigation path component.',
|
|
227
|
+
category: 'Navigation',
|
|
228
|
+
properties: {
|
|
229
|
+
items: { name: 'items', type: 'string', required: true },
|
|
230
|
+
separator: { name: 'separator', type: 'string' },
|
|
231
|
+
},
|
|
232
|
+
example: 'component Breadcrumbs items: "Home,Users,Detail" separator: ">"',
|
|
233
|
+
},
|
|
234
|
+
Tabs: {
|
|
235
|
+
name: 'Tabs',
|
|
236
|
+
description: 'Tabbed navigation component.',
|
|
237
|
+
category: 'Navigation',
|
|
238
|
+
properties: {
|
|
239
|
+
items: { name: 'items', type: 'string', required: true },
|
|
240
|
+
active: { name: 'active', type: 'number' },
|
|
241
|
+
},
|
|
242
|
+
example: 'component Tabs items: "Overview,Details,Activity" active: 1',
|
|
243
|
+
},
|
|
244
|
+
Table: {
|
|
245
|
+
name: 'Table',
|
|
246
|
+
description: 'Tabular data placeholder.',
|
|
247
|
+
category: 'Data',
|
|
248
|
+
properties: {
|
|
249
|
+
title: { name: 'title', type: 'string' },
|
|
250
|
+
columns: { name: 'columns', type: 'string', required: true },
|
|
251
|
+
rows: { name: 'rows', type: 'number' },
|
|
252
|
+
rowsMock: { name: 'rowsMock', type: 'number' },
|
|
253
|
+
mock: { name: 'mock', type: 'string' },
|
|
254
|
+
random: { name: 'random', type: 'boolean' },
|
|
255
|
+
pagination: { name: 'pagination', type: 'boolean' },
|
|
256
|
+
pages: { name: 'pages', type: 'number' },
|
|
257
|
+
paginationAlign: alignEnum,
|
|
258
|
+
actions: { name: 'actions', type: 'string' },
|
|
259
|
+
caption: { name: 'caption', type: 'string' },
|
|
260
|
+
captionAlign: alignEnum,
|
|
261
|
+
border: { name: 'border', type: 'boolean' },
|
|
262
|
+
innerBorder: { name: 'innerBorder', type: 'boolean' },
|
|
263
|
+
background: { name: 'background', type: 'boolean' },
|
|
264
|
+
// Backward-compatible alias (common typo) accepted by parser/renderers.
|
|
265
|
+
backround: { name: 'backround', type: 'boolean' },
|
|
266
|
+
},
|
|
267
|
+
example: 'component Table columns: "User,City,Amount" rows: 8 mock: "name,city,amount"',
|
|
268
|
+
},
|
|
269
|
+
List: {
|
|
270
|
+
name: 'List',
|
|
271
|
+
description: 'Vertical list component.',
|
|
272
|
+
category: 'Data',
|
|
273
|
+
properties: {
|
|
274
|
+
title: { name: 'title', type: 'string' },
|
|
275
|
+
items: { name: 'items', type: 'string' },
|
|
276
|
+
itemsMock: { name: 'itemsMock', type: 'number' },
|
|
277
|
+
mock: { name: 'mock', type: 'string' },
|
|
278
|
+
random: { name: 'random', type: 'boolean' },
|
|
279
|
+
},
|
|
280
|
+
example: 'component List title: "Cities" itemsMock: 6 mock: "city"',
|
|
281
|
+
},
|
|
282
|
+
StatCard: {
|
|
283
|
+
name: 'StatCard',
|
|
284
|
+
description: 'Metric card with optional caption and icon.',
|
|
285
|
+
category: 'Data',
|
|
286
|
+
properties: {
|
|
287
|
+
title: { name: 'title', type: 'string', required: true },
|
|
288
|
+
value: { name: 'value', type: 'string', required: true },
|
|
289
|
+
caption: { name: 'caption', type: 'string' },
|
|
290
|
+
icon: iconNameEnum,
|
|
291
|
+
},
|
|
292
|
+
example: 'component StatCard title: "Users" value: "1,234" icon: "users"',
|
|
293
|
+
},
|
|
294
|
+
Card: {
|
|
295
|
+
name: 'Card',
|
|
296
|
+
description: 'Generic content card placeholder.',
|
|
297
|
+
category: 'Layout',
|
|
298
|
+
properties: {
|
|
299
|
+
title: { name: 'title', type: 'string' },
|
|
300
|
+
text: { name: 'text', type: 'string' },
|
|
301
|
+
},
|
|
302
|
+
example: 'component Card title: "Summary" text: "Card content"',
|
|
303
|
+
},
|
|
304
|
+
Chart: {
|
|
305
|
+
name: 'Chart',
|
|
306
|
+
description: 'Chart placeholder with deterministic trend data.',
|
|
307
|
+
category: 'Data',
|
|
308
|
+
properties: {
|
|
309
|
+
type: { name: 'type', type: 'enum', options: ['bar', 'line', 'pie', 'area'], required: true },
|
|
310
|
+
height: { name: 'height', type: 'number' },
|
|
311
|
+
},
|
|
312
|
+
example: 'component Chart type: "line" height: 240',
|
|
313
|
+
},
|
|
314
|
+
ChartPlaceholder: {
|
|
315
|
+
name: 'ChartPlaceholder',
|
|
316
|
+
description: 'Backward-compatible alias of Chart.',
|
|
317
|
+
category: 'Data',
|
|
318
|
+
properties: {
|
|
319
|
+
type: { name: 'type', type: 'enum', options: ['bar', 'line', 'pie', 'area'], required: true },
|
|
320
|
+
height: { name: 'height', type: 'number' },
|
|
321
|
+
},
|
|
322
|
+
example: 'component ChartPlaceholder type: "bar" height: 240',
|
|
323
|
+
},
|
|
324
|
+
Code: {
|
|
325
|
+
name: 'Code',
|
|
326
|
+
description: 'Code snippet display.',
|
|
327
|
+
category: 'Text',
|
|
328
|
+
properties: {
|
|
329
|
+
code: { name: 'code', type: 'string', required: true },
|
|
330
|
+
},
|
|
331
|
+
example: 'component Code code: "const x = 42;"',
|
|
332
|
+
},
|
|
333
|
+
Image: {
|
|
334
|
+
name: 'Image',
|
|
335
|
+
description: 'Image placeholder block.',
|
|
336
|
+
category: 'Media',
|
|
337
|
+
properties: {
|
|
338
|
+
placeholder: imagePlaceholderEnum,
|
|
339
|
+
icon: iconNameEnum,
|
|
340
|
+
height: { name: 'height', type: 'number' },
|
|
341
|
+
},
|
|
342
|
+
example: 'component Image placeholder: "icon" icon: "search" height: 220',
|
|
343
|
+
},
|
|
344
|
+
Icon: {
|
|
345
|
+
name: 'Icon',
|
|
346
|
+
description: 'Standalone icon component.',
|
|
347
|
+
category: 'Media',
|
|
348
|
+
properties: {
|
|
349
|
+
icon: { name: 'icon', type: 'enum', options: icon_names_js_1.ICON_NAME_OPTIONS, required: true },
|
|
350
|
+
size: sizeEnum,
|
|
351
|
+
variant: variantWithDefaultEnum,
|
|
352
|
+
},
|
|
353
|
+
example: 'component Icon icon: "home" size: md',
|
|
354
|
+
},
|
|
355
|
+
IconButton: {
|
|
356
|
+
name: 'IconButton',
|
|
357
|
+
description: 'Button that renders an icon.',
|
|
358
|
+
category: 'Action',
|
|
359
|
+
properties: {
|
|
360
|
+
icon: { name: 'icon', type: 'enum', options: icon_names_js_1.ICON_NAME_OPTIONS, required: true },
|
|
361
|
+
size: controlSizeEnum,
|
|
362
|
+
variant: variantWithDefaultEnum,
|
|
363
|
+
disabled: { name: 'disabled', type: 'boolean' },
|
|
364
|
+
labelSpace: { name: 'labelSpace', type: 'boolean' },
|
|
365
|
+
padding: controlPaddingEnum,
|
|
366
|
+
},
|
|
367
|
+
example: 'component IconButton icon: "search" variant: default size: md',
|
|
368
|
+
},
|
|
369
|
+
Divider: {
|
|
370
|
+
name: 'Divider',
|
|
371
|
+
description: 'Horizontal separator line.',
|
|
372
|
+
category: 'Layout',
|
|
373
|
+
properties: {},
|
|
374
|
+
example: 'component Divider',
|
|
375
|
+
},
|
|
376
|
+
Separate: {
|
|
377
|
+
name: 'Separate',
|
|
378
|
+
description: 'Invisible spacing separator.',
|
|
379
|
+
category: 'Layout',
|
|
380
|
+
properties: {
|
|
381
|
+
size: { name: 'size', type: 'enum', options: ['none', 'xs', 'sm', 'md', 'lg', 'xl'] },
|
|
382
|
+
},
|
|
383
|
+
example: 'component Separate size: md',
|
|
384
|
+
},
|
|
385
|
+
Badge: {
|
|
386
|
+
name: 'Badge',
|
|
387
|
+
description: 'Small status label.',
|
|
388
|
+
category: 'Feedback',
|
|
389
|
+
properties: {
|
|
390
|
+
text: { name: 'text', type: 'string', required: true },
|
|
391
|
+
variant: variantWithDefaultEnum,
|
|
392
|
+
},
|
|
393
|
+
example: 'component Badge text: "Active" variant: success',
|
|
394
|
+
},
|
|
395
|
+
Alert: {
|
|
396
|
+
name: 'Alert',
|
|
397
|
+
description: 'Alert/message box.',
|
|
398
|
+
category: 'Feedback',
|
|
399
|
+
properties: {
|
|
400
|
+
variant: variantEnum,
|
|
401
|
+
title: { name: 'title', type: 'string' },
|
|
402
|
+
text: { name: 'text', type: 'string' },
|
|
403
|
+
},
|
|
404
|
+
example: 'component Alert variant: warning title: "Warning" text: "Review this action"',
|
|
405
|
+
},
|
|
406
|
+
Modal: {
|
|
407
|
+
name: 'Modal',
|
|
408
|
+
description: 'Modal overlay container.',
|
|
409
|
+
category: 'Feedback',
|
|
410
|
+
properties: {
|
|
411
|
+
title: { name: 'title', type: 'string', required: true },
|
|
412
|
+
visible: { name: 'visible', type: 'boolean', defaultValue: true },
|
|
413
|
+
},
|
|
414
|
+
example: 'component Modal title: "Confirm action" visible: false',
|
|
415
|
+
},
|
|
416
|
+
};
|
|
417
|
+
exports.LAYOUTS = {
|
|
418
|
+
stack: {
|
|
419
|
+
name: 'stack',
|
|
420
|
+
description: 'Linear layout container.',
|
|
421
|
+
properties: {
|
|
422
|
+
direction: { name: 'direction', type: 'enum', options: ['horizontal', 'vertical'], required: true },
|
|
423
|
+
align: { name: 'align', type: 'enum', options: ['justify', 'left', 'center', 'right'] },
|
|
424
|
+
gap: { name: 'gap', type: 'enum', options: spacingEnum.options },
|
|
425
|
+
padding: { name: 'padding', type: 'enum', options: spacingEnum.options },
|
|
426
|
+
},
|
|
427
|
+
example: 'layout stack(direction: vertical, gap: md, padding: md) { ... }',
|
|
428
|
+
},
|
|
429
|
+
grid: {
|
|
430
|
+
name: 'grid',
|
|
431
|
+
description: 'Grid layout container.',
|
|
432
|
+
properties: {
|
|
433
|
+
columns: { name: 'columns', type: 'number' },
|
|
434
|
+
gap: { name: 'gap', type: 'enum', options: spacingEnum.options },
|
|
435
|
+
align: { name: 'align', type: 'enum', options: ['justify', 'left', 'center', 'right'] },
|
|
436
|
+
padding: { name: 'padding', type: 'enum', options: spacingEnum.options },
|
|
437
|
+
},
|
|
438
|
+
requiredProperties: ['columns'],
|
|
439
|
+
example: 'layout grid(columns: 12, gap: md) { ... }',
|
|
440
|
+
},
|
|
441
|
+
split: {
|
|
442
|
+
name: 'split',
|
|
443
|
+
description: 'Two-column split layout.',
|
|
444
|
+
properties: {
|
|
445
|
+
left: { name: 'left', type: 'number' },
|
|
446
|
+
right: { name: 'right', type: 'number' },
|
|
447
|
+
background: { name: 'background', type: 'string' },
|
|
448
|
+
border: { name: 'border', type: 'boolean' },
|
|
449
|
+
gap: { name: 'gap', type: 'enum', options: spacingEnum.options },
|
|
450
|
+
padding: { name: 'padding', type: 'enum', options: spacingEnum.options },
|
|
451
|
+
},
|
|
452
|
+
example: 'layout split(left: 260, gap: md, border: true) { ... }',
|
|
453
|
+
},
|
|
454
|
+
panel: {
|
|
455
|
+
name: 'panel',
|
|
456
|
+
description: 'Panel container with border/background support.',
|
|
457
|
+
properties: {
|
|
458
|
+
padding: { name: 'padding', type: 'enum', options: spacingEnum.options },
|
|
459
|
+
gap: { name: 'gap', type: 'enum', options: spacingEnum.options },
|
|
460
|
+
background: { name: 'background', type: 'string' },
|
|
461
|
+
},
|
|
462
|
+
example: 'layout panel(padding: md) { ... }',
|
|
463
|
+
},
|
|
464
|
+
card: {
|
|
465
|
+
name: 'card',
|
|
466
|
+
description: 'Card container with spacing/radius options.',
|
|
467
|
+
properties: {
|
|
468
|
+
padding: { name: 'padding', type: 'enum', options: spacingEnum.options },
|
|
469
|
+
gap: { name: 'gap', type: 'enum', options: spacingEnum.options },
|
|
470
|
+
radius: { name: 'radius', type: 'enum', options: ['none', 'sm', 'md', 'lg'] },
|
|
471
|
+
border: { name: 'border', type: 'boolean' },
|
|
472
|
+
background: { name: 'background', type: 'string' },
|
|
473
|
+
},
|
|
474
|
+
example: 'layout card(padding: md, gap: md, radius: md, border: true) { ... }',
|
|
475
|
+
},
|
|
476
|
+
};
|
|
477
|
+
exports.PROPERTY_VALUES = {
|
|
478
|
+
size: ['none', 'xs', 'sm', 'md', 'lg', 'xl'],
|
|
479
|
+
variant: variantWithDefaultEnum.options,
|
|
480
|
+
align: ['justify', 'left', 'center', 'right'],
|
|
481
|
+
padding: spacingEnum.options,
|
|
482
|
+
gap: spacingEnum.options,
|
|
483
|
+
direction: ['horizontal', 'vertical'],
|
|
484
|
+
level: headingLevelEnum.options,
|
|
485
|
+
spacing: spacingEnum.options,
|
|
486
|
+
};
|
|
487
|
+
exports.KEYWORDS = {
|
|
488
|
+
topLevel: ['project', 'style', 'colors', 'mocks', 'define'],
|
|
489
|
+
screen: ['screen'],
|
|
490
|
+
layout: ['layout'],
|
|
491
|
+
component: ['component'],
|
|
492
|
+
cell: ['cell'],
|
|
493
|
+
special: ['span', 'columns', 'left', 'right', 'gap', 'padding', 'direction', 'background', 'border', 'Component'],
|
|
494
|
+
};
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OAAQ;IAC7B,GAAG,EAAE,WAAW,CAAC,OAAQ;IACzB,SAAS,EAAE,CAAC,YAAY,EAAE,UAAU,CAAC;IACrC,KAAK,EAAE,gBAAgB,CAAC,OAAQ;IAChC,OAAO,EAAE,WAAW,CAAC,OAAQ;CAC9B,CAAC;AAEW,QAAA,QAAQ,GAAG;IACtB,QAAQ,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC;IAC3D,MAAM,EAAE,CAAC,QAAQ,CAAC;IAClB,MAAM,EAAE,CAAC,QAAQ,CAAC;IAClB,SAAS,EAAE,CAAC,WAAW,CAAC;IACxB,IAAI,EAAE,CAAC,MAAM,CAAC;IACd,OAAO,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,WAAW,CAAC;CAClH,CAAC"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Wire DSL Context Detection
|
|
4
|
+
* Agnóstic logic for detecting document scope and completion context
|
|
5
|
+
* Used by Monaco, VS Code, and other editors
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.determineScope = determineScope;
|
|
9
|
+
exports.detectComponentContext = detectComponentContext;
|
|
10
|
+
exports.getCurrentWord = getCurrentWord;
|
|
11
|
+
exports.getComponentPropertiesForCompletion = getComponentPropertiesForCompletion;
|
|
12
|
+
exports.getAlreadyDeclaredProperties = getAlreadyDeclaredProperties;
|
|
13
|
+
const components_js_1 = require("./components.js");
|
|
14
|
+
/**
|
|
15
|
+
* Determine document scope by analyzing text structure
|
|
16
|
+
* Returns: empty-file | inside-project | inside-screen | inside-layout
|
|
17
|
+
*
|
|
18
|
+
* Hierarchy:
|
|
19
|
+
* project { ... } <- empty-file → inside-project
|
|
20
|
+
* screen Name { ... } <- inside-project → inside-screen
|
|
21
|
+
* layout stack(...) { <- inside-screen → inside-layout
|
|
22
|
+
* component Button <- inside-layout
|
|
23
|
+
*/
|
|
24
|
+
function determineScope(textBeforeCursor) {
|
|
25
|
+
const cleanText = textBeforeCursor.replace(/\/\/.*$/gm, '').replace(/\/\*[\s\S]*?\*\//g, '');
|
|
26
|
+
if (cleanText.trim().length === 0) {
|
|
27
|
+
return 'empty-file';
|
|
28
|
+
}
|
|
29
|
+
// Track nesting depth by analyzing braces and keywords
|
|
30
|
+
let projectBraceCount = 0;
|
|
31
|
+
let screenBraceCount = 0;
|
|
32
|
+
let layoutBraceCount = 0;
|
|
33
|
+
let hasProject = false;
|
|
34
|
+
let hasScreen = false;
|
|
35
|
+
let hasLayout = false;
|
|
36
|
+
const lines = cleanText.split('\n');
|
|
37
|
+
for (const line of lines) {
|
|
38
|
+
// Track keywords
|
|
39
|
+
if (line.match(/\bproject\s+"?[^{]*{/)) {
|
|
40
|
+
hasProject = true;
|
|
41
|
+
}
|
|
42
|
+
if (line.match(/\bscreen\s+[A-Za-z_][A-Za-z0-9_]*\s*{/)) {
|
|
43
|
+
hasScreen = true;
|
|
44
|
+
}
|
|
45
|
+
if (line.match(/\blayout\s+[A-Za-z_][A-Za-z0-9_]*\s*\(/)) {
|
|
46
|
+
hasLayout = true;
|
|
47
|
+
}
|
|
48
|
+
// Count opening braces
|
|
49
|
+
if (line.includes('project') && line.includes('{'))
|
|
50
|
+
projectBraceCount++;
|
|
51
|
+
if (line.includes('screen') && line.includes('{'))
|
|
52
|
+
screenBraceCount++;
|
|
53
|
+
if (line.includes('layout') && line.includes('{'))
|
|
54
|
+
layoutBraceCount++;
|
|
55
|
+
// Count closing braces to track nesting level
|
|
56
|
+
projectBraceCount -= (line.match(/}/g) || []).length;
|
|
57
|
+
screenBraceCount -= (line.match(/}/g) || []).length;
|
|
58
|
+
layoutBraceCount -= (line.match(/}/g) || []).length;
|
|
59
|
+
}
|
|
60
|
+
// Determine scope based on nesting hierarchy
|
|
61
|
+
if (!hasProject) {
|
|
62
|
+
return 'empty-file';
|
|
63
|
+
}
|
|
64
|
+
// We're inside a layout (deepest level)
|
|
65
|
+
if (hasLayout && layoutBraceCount > 0) {
|
|
66
|
+
return 'inside-layout';
|
|
67
|
+
}
|
|
68
|
+
// We're inside a screen but not in a layout
|
|
69
|
+
if (hasScreen && screenBraceCount > 0) {
|
|
70
|
+
return 'inside-screen';
|
|
71
|
+
}
|
|
72
|
+
// We're inside project level
|
|
73
|
+
if (hasProject && projectBraceCount > 0) {
|
|
74
|
+
return 'inside-project';
|
|
75
|
+
}
|
|
76
|
+
return 'inside-project';
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Detect if we're inside a component definition (after component keyword)
|
|
80
|
+
* and return the component name if found.
|
|
81
|
+
*
|
|
82
|
+
* Examples:
|
|
83
|
+
* - "component Button" → returns "Button"
|
|
84
|
+
* - "component Button text:" → returns "Button"
|
|
85
|
+
* - "component Button text: "Save"" → returns "Button"
|
|
86
|
+
* - "component B" → returns null (still typing component name)
|
|
87
|
+
*/
|
|
88
|
+
function detectComponentContext(lineText) {
|
|
89
|
+
// Match "component ComponentName" where ComponentName starts with uppercase
|
|
90
|
+
// This ensures we have a complete, recognized component name
|
|
91
|
+
const match = lineText.match(/component\s+([A-Z]\w*)/);
|
|
92
|
+
if (!match) {
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
const componentName = match[1];
|
|
96
|
+
// Check if this is a valid component
|
|
97
|
+
if (!components_js_1.COMPONENTS[componentName]) {
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
// Get text after the component name
|
|
101
|
+
const afterComponent = lineText.substring(match.index + match[0].length);
|
|
102
|
+
// If there's nothing after, or only spaces, we're at the end - show properties
|
|
103
|
+
// Or if we have properties already (word followed by colon), show properties
|
|
104
|
+
if (afterComponent.match(/^\s*$/) || afterComponent.match(/^\s+[\w-]+:/)) {
|
|
105
|
+
return componentName;
|
|
106
|
+
}
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Get the current word being typed at the end of a line
|
|
111
|
+
*/
|
|
112
|
+
function getCurrentWord(lineText) {
|
|
113
|
+
const match = lineText.match(/[\w-]*$/);
|
|
114
|
+
return match ? match[0] : '';
|
|
115
|
+
}
|
|
116
|
+
function getComponentPropertiesForCompletion(componentName, alreadyDeclared = new Set()) {
|
|
117
|
+
const component = components_js_1.COMPONENTS[componentName];
|
|
118
|
+
if (!component)
|
|
119
|
+
return [];
|
|
120
|
+
const items = [];
|
|
121
|
+
const properties = Object.values(component.properties) || [];
|
|
122
|
+
for (const prop of properties) {
|
|
123
|
+
// Skip if this property is already declared
|
|
124
|
+
if (alreadyDeclared.has(prop.name)) {
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
const item = {
|
|
128
|
+
label: prop.name,
|
|
129
|
+
kind: 'Property',
|
|
130
|
+
detail: `Property of ${componentName}`,
|
|
131
|
+
insertText: `${prop.name}: `,
|
|
132
|
+
};
|
|
133
|
+
// Add property values if available
|
|
134
|
+
if (prop.type === 'enum' && prop.options && prop.options.length > 0) {
|
|
135
|
+
item.insertText = `${prop.name}: ${prop.options.length === 1 ? prop.options[0] : ''}`;
|
|
136
|
+
}
|
|
137
|
+
items.push(item);
|
|
138
|
+
}
|
|
139
|
+
return items;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Extract already-declared properties from a component line
|
|
143
|
+
* Patterns: propertyName: or propertyName: value
|
|
144
|
+
*/
|
|
145
|
+
function getAlreadyDeclaredProperties(lineText) {
|
|
146
|
+
const declaredProps = new Set();
|
|
147
|
+
const matches = lineText.matchAll(/(\w+):\s*/g);
|
|
148
|
+
for (const match of Array.from(matches)) {
|
|
149
|
+
declaredProps.add(match[1]);
|
|
150
|
+
}
|
|
151
|
+
return declaredProps;
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=context-detection.js.map
|