@wire-dsl/language-support 0.0.2
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 +218 -0
- package/LICENSE +36 -0
- package/README.md +55 -0
- package/dist/completions.d.ts +86 -0
- package/dist/completions.d.ts.map +1 -0
- package/dist/completions.js +416 -0
- package/dist/completions.js.map +1 -0
- package/dist/components.d.ts +39 -0
- package/dist/components.d.ts.map +1 -0
- package/dist/components.js +271 -0
- package/dist/components.js.map +1 -0
- package/dist/context-detection.d.ts +56 -0
- package/dist/context-detection.d.ts.map +1 -0
- package/dist/context-detection.js +147 -0
- package/dist/context-detection.js.map +1 -0
- package/dist/document-parser.d.ts +63 -0
- package/dist/document-parser.d.ts.map +1 -0
- package/dist/document-parser.js +264 -0
- package/dist/document-parser.js.map +1 -0
- package/dist/documentation.d.ts +30 -0
- package/dist/documentation.d.ts.map +1 -0
- package/dist/documentation.js +121 -0
- package/dist/documentation.js.map +1 -0
- package/dist/generate-grammar.d.ts +28 -0
- package/dist/generate-grammar.d.ts.map +1 -0
- package/dist/generate-grammar.js +136 -0
- package/dist/generate-grammar.js.map +1 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +75 -0
- package/dist/index.js.map +1 -0
- package/package.json +90 -0
|
@@ -0,0 +1,416 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Autocomplete and IntelliSense Provider
|
|
3
|
+
* Shared completion logic for Monaco, VS Code, and other editors
|
|
4
|
+
*/
|
|
5
|
+
import { COMPONENTS } from './components';
|
|
6
|
+
// Completion suggestions by context
|
|
7
|
+
export const KEYWORD_COMPLETIONS = [
|
|
8
|
+
{
|
|
9
|
+
label: 'project',
|
|
10
|
+
kind: 'Keyword',
|
|
11
|
+
detail: 'Define a Wire project',
|
|
12
|
+
documentation: 'project "My App" { ... }',
|
|
13
|
+
insertText: 'project "',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
label: 'screen',
|
|
17
|
+
kind: 'Keyword',
|
|
18
|
+
detail: 'Define a screen/page',
|
|
19
|
+
documentation: 'screen MyScreen { ... }',
|
|
20
|
+
insertText: 'screen ',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
label: 'component',
|
|
24
|
+
kind: 'Keyword',
|
|
25
|
+
detail: 'Use a component',
|
|
26
|
+
documentation: 'component Button label: "Click"',
|
|
27
|
+
insertText: 'component ',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
label: 'layout',
|
|
31
|
+
kind: 'Keyword',
|
|
32
|
+
detail: 'Define a layout container',
|
|
33
|
+
documentation: 'layout stack(direction: vertical) { ... }',
|
|
34
|
+
insertText: 'layout ',
|
|
35
|
+
},
|
|
36
|
+
];
|
|
37
|
+
export const CONTAINER_COMPLETIONS = [
|
|
38
|
+
{
|
|
39
|
+
label: 'stack',
|
|
40
|
+
kind: 'Component',
|
|
41
|
+
detail: 'Vertical/horizontal layout',
|
|
42
|
+
documentation: 'layout stack(direction: vertical, gap: md) { ... }',
|
|
43
|
+
insertText: 'stack(',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
label: 'grid',
|
|
47
|
+
kind: 'Component',
|
|
48
|
+
detail: 'Grid layout container',
|
|
49
|
+
documentation: 'layout grid(columns: 2, gap: md) { ... }',
|
|
50
|
+
insertText: 'grid(',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
label: 'panel',
|
|
54
|
+
kind: 'Component',
|
|
55
|
+
detail: 'Panel with border',
|
|
56
|
+
documentation: 'layout panel(padding: md) { ... }',
|
|
57
|
+
insertText: 'panel(',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
label: 'card',
|
|
61
|
+
kind: 'Component',
|
|
62
|
+
detail: 'Card with shadow',
|
|
63
|
+
documentation: 'layout card(padding: md) { ... }',
|
|
64
|
+
insertText: 'card(',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
label: 'split',
|
|
68
|
+
kind: 'Component',
|
|
69
|
+
detail: 'Split pane layout',
|
|
70
|
+
documentation: 'layout split() { ... }',
|
|
71
|
+
insertText: 'split(',
|
|
72
|
+
},
|
|
73
|
+
];
|
|
74
|
+
export const COMPONENT_COMPLETIONS = [
|
|
75
|
+
{
|
|
76
|
+
label: 'button',
|
|
77
|
+
kind: 'Component',
|
|
78
|
+
detail: 'Interactive button',
|
|
79
|
+
documentation: 'button { label: "Click me" }',
|
|
80
|
+
insertText: 'button {\n\tid: "${1:btn}"\n\tlabel: "${2:Click}"\n\t$0\n}',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
label: 'text',
|
|
84
|
+
kind: 'Component',
|
|
85
|
+
detail: 'Text content',
|
|
86
|
+
documentation: 'text { label: "Content" }',
|
|
87
|
+
insertText: 'text {\n\tlabel: "${1:Content}"\n\t$0\n}',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
label: 'input',
|
|
91
|
+
kind: 'Component',
|
|
92
|
+
detail: 'Text input field',
|
|
93
|
+
documentation: 'input { placeholder: "Enter..." }',
|
|
94
|
+
insertText: 'input {\n\tid: "${1:input}"\n\tplaceholder: "${2:Enter...}"\n\t$0\n}',
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
label: 'label',
|
|
98
|
+
kind: 'Component',
|
|
99
|
+
detail: 'Form label',
|
|
100
|
+
documentation: 'label { label: "Name" }',
|
|
101
|
+
insertText: 'label {\n\tlabel: "${1:Name}"\n\t$0\n}',
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
label: 'select',
|
|
105
|
+
kind: 'Component',
|
|
106
|
+
detail: 'Dropdown select',
|
|
107
|
+
documentation: 'select { ... }',
|
|
108
|
+
insertText: 'select {\n\tid: "${1:select}"\n\t$0\n}',
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
label: 'checkbox',
|
|
112
|
+
kind: 'Component',
|
|
113
|
+
detail: 'Checkbox input',
|
|
114
|
+
documentation: 'checkbox { label: "Agree" }',
|
|
115
|
+
insertText: 'checkbox {\n\tid: "${1:check}"\n\tlabel: "${2:Agree}"\n\t$0\n}',
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
label: 'textarea',
|
|
119
|
+
kind: 'Component',
|
|
120
|
+
detail: 'Multi-line text area',
|
|
121
|
+
documentation: 'textarea { ... }',
|
|
122
|
+
insertText: 'textarea {\n\tid: "${1:textarea}"\n\tplaceholder: "${2:Enter text...}"\n\t$0\n}',
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
label: 'table',
|
|
126
|
+
kind: 'Component',
|
|
127
|
+
detail: 'Data table',
|
|
128
|
+
documentation: 'table { ... }',
|
|
129
|
+
insertText: 'table {\n\tid: "${1:table}"\n\t$0\n}',
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
label: 'form',
|
|
133
|
+
kind: 'Component',
|
|
134
|
+
detail: 'Form container',
|
|
135
|
+
documentation: 'form { ... }',
|
|
136
|
+
insertText: 'form {\n\tid: "${1:form}"\n\t$0\n}',
|
|
137
|
+
},
|
|
138
|
+
];
|
|
139
|
+
export const PROPERTY_COMPLETIONS = [
|
|
140
|
+
{
|
|
141
|
+
label: 'id',
|
|
142
|
+
kind: 'Property',
|
|
143
|
+
detail: 'Element identifier',
|
|
144
|
+
documentation: 'id: "my-element"',
|
|
145
|
+
insertText: 'id: "${1:element}"',
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
label: 'label',
|
|
149
|
+
kind: 'Property',
|
|
150
|
+
detail: 'Display label/text',
|
|
151
|
+
documentation: 'label: "Click me"',
|
|
152
|
+
insertText: 'label: "${1:text}"',
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
label: 'width',
|
|
156
|
+
kind: 'Property',
|
|
157
|
+
detail: 'Element width',
|
|
158
|
+
documentation: 'width: 200px',
|
|
159
|
+
insertText: 'width: ${1:100}${2:px|%|rem}',
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
label: 'height',
|
|
163
|
+
kind: 'Property',
|
|
164
|
+
detail: 'Element height',
|
|
165
|
+
documentation: 'height: 100px',
|
|
166
|
+
insertText: 'height: ${1:100}${2:px|%|rem}',
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
label: 'gap',
|
|
170
|
+
kind: 'Property',
|
|
171
|
+
detail: 'Space between children',
|
|
172
|
+
documentation: 'gap: md',
|
|
173
|
+
insertText: 'gap: ${1:md|sm|lg}',
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
label: 'padding',
|
|
177
|
+
kind: 'Property',
|
|
178
|
+
detail: 'Internal spacing',
|
|
179
|
+
documentation: 'padding: 16px',
|
|
180
|
+
insertText: 'padding: ${1:16}px',
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
label: 'color',
|
|
184
|
+
kind: 'Property',
|
|
185
|
+
detail: 'Text color',
|
|
186
|
+
documentation: 'color: #000000',
|
|
187
|
+
insertText: 'color: ${1:#000000}',
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
label: 'background',
|
|
191
|
+
kind: 'Property',
|
|
192
|
+
detail: 'Background color',
|
|
193
|
+
documentation: 'background: #ffffff',
|
|
194
|
+
insertText: 'background: ${1:#ffffff}',
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
label: 'border',
|
|
198
|
+
kind: 'Property',
|
|
199
|
+
detail: 'Border style',
|
|
200
|
+
documentation: 'border: 1px solid #ccc',
|
|
201
|
+
insertText: 'border: ${1:1px} solid ${2:#ccc}',
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
label: 'variant',
|
|
205
|
+
kind: 'Property',
|
|
206
|
+
detail: 'Style variant',
|
|
207
|
+
documentation: 'variant: primary|secondary',
|
|
208
|
+
insertText: 'variant: ${1:primary|secondary}',
|
|
209
|
+
},
|
|
210
|
+
];
|
|
211
|
+
/**
|
|
212
|
+
* Detect if cursor is after 'component' keyword
|
|
213
|
+
* Returns component name if found, null otherwise
|
|
214
|
+
*/
|
|
215
|
+
export function detectComponentKeyword(lineText) {
|
|
216
|
+
// Match "component ComponentName" where ComponentName starts with uppercase
|
|
217
|
+
const match = lineText.match(/\bcomponent\s+([A-Z]\w*)/);
|
|
218
|
+
return match ? match[1] : null;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Detect if cursor is after ':' in a property context
|
|
222
|
+
* Returns { propertyName, componentName } if in property value context
|
|
223
|
+
*/
|
|
224
|
+
export function detectPropertyValueContext(lineText) {
|
|
225
|
+
// Match "component ComponentName ... property: "
|
|
226
|
+
const componentMatch = lineText.match(/\bcomponent\s+([A-Z]\w*)/);
|
|
227
|
+
if (!componentMatch)
|
|
228
|
+
return null;
|
|
229
|
+
const componentName = componentMatch[1];
|
|
230
|
+
const afterComponent = lineText.substring(componentMatch.index + componentMatch[0].length);
|
|
231
|
+
// Match "property: " at the end
|
|
232
|
+
const propMatch = afterComponent.match(/(\w+)\s*:\s*$/);
|
|
233
|
+
if (!propMatch)
|
|
234
|
+
return null;
|
|
235
|
+
return {
|
|
236
|
+
propertyName: propMatch[1],
|
|
237
|
+
componentName,
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Determine if we're in a property context (after ':')
|
|
242
|
+
*/
|
|
243
|
+
export function isPropertyContext(lineText, position) {
|
|
244
|
+
const beforeCursor = lineText.substring(0, position);
|
|
245
|
+
return /:\s*$/.test(beforeCursor);
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Get all available component names (built-in ones that start with uppercase)
|
|
249
|
+
*/
|
|
250
|
+
export function getAvailableComponents() {
|
|
251
|
+
return Object.entries(COMPONENTS)
|
|
252
|
+
.filter(([name]) => /^[A-Z]/.test(name)) // Only uppercase names
|
|
253
|
+
.map(([name, meta]) => ({
|
|
254
|
+
label: name,
|
|
255
|
+
kind: 'Component',
|
|
256
|
+
detail: meta.description,
|
|
257
|
+
documentation: meta.description,
|
|
258
|
+
insertText: `${name} `,
|
|
259
|
+
}));
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Get properties for a specific component
|
|
263
|
+
*/
|
|
264
|
+
export function getComponentProperties(componentName) {
|
|
265
|
+
const component = COMPONENTS[componentName];
|
|
266
|
+
if (!component || !component.properties) {
|
|
267
|
+
return [];
|
|
268
|
+
}
|
|
269
|
+
return Object.entries(component.properties)
|
|
270
|
+
.map(([propName, propType]) => ({
|
|
271
|
+
label: propName,
|
|
272
|
+
kind: 'Property',
|
|
273
|
+
detail: propType,
|
|
274
|
+
documentation: `Property: ${propName} (${propType})`,
|
|
275
|
+
insertText: `${propName}: `,
|
|
276
|
+
}));
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Get available properties for a component
|
|
280
|
+
* Filters out properties already declared in current line
|
|
281
|
+
*/
|
|
282
|
+
export function getComponentPropertiesForCompletion(componentName, alreadyDeclaredProps = []) {
|
|
283
|
+
const componentMeta = COMPONENTS[componentName];
|
|
284
|
+
if (!componentMeta) {
|
|
285
|
+
return PROPERTY_COMPLETIONS;
|
|
286
|
+
}
|
|
287
|
+
const availableProps = Object.entries(componentMeta.properties || {})
|
|
288
|
+
.filter(([propName]) => !alreadyDeclaredProps.includes(propName))
|
|
289
|
+
.map(([propName, propType]) => ({
|
|
290
|
+
label: propName,
|
|
291
|
+
kind: 'Property',
|
|
292
|
+
documentation: `Type: ${propType}`,
|
|
293
|
+
insertText: `${propName}: `,
|
|
294
|
+
detail: `${componentName} property`,
|
|
295
|
+
}));
|
|
296
|
+
return [...availableProps, ...PROPERTY_COMPLETIONS];
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Get property value suggestions for a given component property
|
|
300
|
+
*/
|
|
301
|
+
export function getPropertyValueSuggestions(componentName, propertyName) {
|
|
302
|
+
const componentMeta = COMPONENTS[componentName];
|
|
303
|
+
if (!componentMeta || !componentMeta.propertyValues) {
|
|
304
|
+
return [];
|
|
305
|
+
}
|
|
306
|
+
const values = componentMeta.propertyValues[propertyName];
|
|
307
|
+
if (!values) {
|
|
308
|
+
return [];
|
|
309
|
+
}
|
|
310
|
+
return (Array.isArray(values) ? values : [values]).map((value) => ({
|
|
311
|
+
label: value.toString(),
|
|
312
|
+
kind: 'Value',
|
|
313
|
+
documentation: `Value for ${propertyName}`,
|
|
314
|
+
}));
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Get completions based on hierarchical scope
|
|
318
|
+
*
|
|
319
|
+
* Hierarchy:
|
|
320
|
+
* - empty-file: suggest 'project' to start
|
|
321
|
+
* - inside-project: suggest project-level keywords (screen, theme, colors, mocks, define)
|
|
322
|
+
* - inside-screen: suggest 'layout' keyword and containers (stack, grid, split, panel, card)
|
|
323
|
+
* - inside-layout: suggest components and nested layouts
|
|
324
|
+
*/
|
|
325
|
+
export function getScopeBasedCompletions(scope) {
|
|
326
|
+
switch (scope) {
|
|
327
|
+
case 'empty-file':
|
|
328
|
+
// Only suggest project keyword to start
|
|
329
|
+
return KEYWORD_COMPLETIONS.filter(item => item.label === 'project');
|
|
330
|
+
case 'inside-project': {
|
|
331
|
+
// Suggest project-level keywords from KEYWORDS.topLevel
|
|
332
|
+
// topLevel: ['project', 'theme', 'colors', 'mocks', 'define']
|
|
333
|
+
const topLevelCompletions = [
|
|
334
|
+
{
|
|
335
|
+
label: 'screen',
|
|
336
|
+
kind: 'Keyword',
|
|
337
|
+
detail: 'Define a screen/page',
|
|
338
|
+
documentation: 'screen MyScreen { ... }',
|
|
339
|
+
insertText: 'screen ${1:MyScreen} {\n\t$0\n}',
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
label: 'theme',
|
|
343
|
+
kind: 'Keyword',
|
|
344
|
+
detail: 'Define theme properties',
|
|
345
|
+
documentation: 'theme { density: "comfortable" ... }',
|
|
346
|
+
insertText: 'theme {\n\t$0\n}',
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
label: 'colors',
|
|
350
|
+
kind: 'Keyword',
|
|
351
|
+
detail: 'Define color palette',
|
|
352
|
+
documentation: 'colors { primary: "#007AFF" ... }',
|
|
353
|
+
insertText: 'colors {\n\t$0\n}',
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
label: 'mocks',
|
|
357
|
+
kind: 'Keyword',
|
|
358
|
+
detail: 'Define mock data',
|
|
359
|
+
documentation: 'mocks { users: [...] ... }',
|
|
360
|
+
insertText: 'mocks {\n\t$0\n}',
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
label: 'define',
|
|
364
|
+
kind: 'Keyword',
|
|
365
|
+
detail: 'Define custom component',
|
|
366
|
+
documentation: 'define Component "Name" { ... }',
|
|
367
|
+
insertText: 'define Component "${1:CustomName}" {\n\t$0\n}',
|
|
368
|
+
},
|
|
369
|
+
];
|
|
370
|
+
return topLevelCompletions;
|
|
371
|
+
}
|
|
372
|
+
case 'inside-screen':
|
|
373
|
+
// Suggest 'layout' keyword followed by container types
|
|
374
|
+
const layoutCompletions = [
|
|
375
|
+
{
|
|
376
|
+
label: 'layout',
|
|
377
|
+
kind: 'Keyword',
|
|
378
|
+
detail: 'Define a layout container',
|
|
379
|
+
documentation: 'layout stack(direction: vertical) { ... }',
|
|
380
|
+
insertText: 'layout ${1:stack}(${2:direction: vertical}) {\n\t$0\n}',
|
|
381
|
+
},
|
|
382
|
+
...CONTAINER_COMPLETIONS,
|
|
383
|
+
];
|
|
384
|
+
return layoutCompletions;
|
|
385
|
+
case 'inside-layout':
|
|
386
|
+
// Suggest components, nested layouts, and cells
|
|
387
|
+
return [
|
|
388
|
+
...CONTAINER_COMPLETIONS, // Allow nested layouts
|
|
389
|
+
{
|
|
390
|
+
label: 'cell',
|
|
391
|
+
kind: 'Keyword',
|
|
392
|
+
detail: 'Grid cell within layout',
|
|
393
|
+
documentation: 'cell span: 2 { ... }',
|
|
394
|
+
insertText: 'cell span: ${1:1} {\n\t$0\n}',
|
|
395
|
+
},
|
|
396
|
+
...COMPONENT_COMPLETIONS,
|
|
397
|
+
];
|
|
398
|
+
default:
|
|
399
|
+
return [];
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
export default {
|
|
403
|
+
KEYWORD_COMPLETIONS,
|
|
404
|
+
CONTAINER_COMPLETIONS,
|
|
405
|
+
COMPONENT_COMPLETIONS,
|
|
406
|
+
PROPERTY_COMPLETIONS,
|
|
407
|
+
isPropertyContext,
|
|
408
|
+
getComponentPropertiesForCompletion,
|
|
409
|
+
getPropertyValueSuggestions,
|
|
410
|
+
getScopeBasedCompletions,
|
|
411
|
+
detectComponentKeyword,
|
|
412
|
+
detectPropertyValueContext,
|
|
413
|
+
getAvailableComponents,
|
|
414
|
+
getComponentProperties,
|
|
415
|
+
};
|
|
416
|
+
//# sourceMappingURL=completions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completions.js","sourceRoot":"","sources":["../src/completions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAA4B,MAAM,cAAc,CAAC;AAsBpE,oCAAoC;AACpC,MAAM,CAAC,MAAM,mBAAmB,GAAqB;IACnD;QACE,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,uBAAuB;QAC/B,aAAa,EAAE,0BAA0B;QACzC,UAAU,EAAE,WAAW;KACxB;IACD;QACE,KAAK,EAAE,QAAQ;QACf,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,sBAAsB;QAC9B,aAAa,EAAE,yBAAyB;QACxC,UAAU,EAAE,SAAS;KACtB;IACD;QACE,KAAK,EAAE,WAAW;QAClB,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,iBAAiB;QACzB,aAAa,EAAE,iCAAiC;QAChD,UAAU,EAAE,YAAY;KACzB;IACD;QACE,KAAK,EAAE,QAAQ;QACf,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,2BAA2B;QACnC,aAAa,EAAE,2CAA2C;QAC1D,UAAU,EAAE,SAAS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B,qBAAqB;IACrB,qBAAqB;IACrB,oBAAoB;IACpB,iBAAiB;IACjB,mCAAmC;IACnC,2BAA2B;IAC3B,wBAAwB;IACxB,sBAAsB;IACtB,0BAA0B;IAC1B,sBAAsB;IACtB,sBAAsB;CACvB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire DSL Component Metadata
|
|
3
|
+
* Used for autocompletion and hover documentation
|
|
4
|
+
*
|
|
5
|
+
* SYNC SOURCES:
|
|
6
|
+
* 1. Built-in components: Check packages/core/src/renderer/index.ts renderComponent() method
|
|
7
|
+
* for latest component implementations. Update this file when new components are added.
|
|
8
|
+
* 2. User-defined components: Syntax is `define Component "Name" { ... }`
|
|
9
|
+
* These are parsed and resolved before IR generation.
|
|
10
|
+
*
|
|
11
|
+
* Total components: 32 built-in + unlimited user-defined
|
|
12
|
+
* Last synced: February 2, 2026
|
|
13
|
+
*/
|
|
14
|
+
export interface ComponentMetadata {
|
|
15
|
+
name: string;
|
|
16
|
+
description: string;
|
|
17
|
+
properties: string[];
|
|
18
|
+
propertyValues?: Record<string, string[]>;
|
|
19
|
+
example: string;
|
|
20
|
+
}
|
|
21
|
+
export interface LayoutMetadata {
|
|
22
|
+
name: string;
|
|
23
|
+
description: string;
|
|
24
|
+
properties: string[];
|
|
25
|
+
example: string;
|
|
26
|
+
requiredProperties?: string[];
|
|
27
|
+
}
|
|
28
|
+
export declare const COMPONENTS: Record<string, ComponentMetadata>;
|
|
29
|
+
export declare const LAYOUTS: Record<string, LayoutMetadata>;
|
|
30
|
+
export declare const PROPERTY_VALUES: Record<string, string[]>;
|
|
31
|
+
export declare const KEYWORDS: {
|
|
32
|
+
topLevel: string[];
|
|
33
|
+
screen: string[];
|
|
34
|
+
layout: string[];
|
|
35
|
+
component: string[];
|
|
36
|
+
cell: string[];
|
|
37
|
+
special: string[];
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=components.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../src/components.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAC1C,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CA8MxD,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAoClD,CAAC;AAGF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CASpD,CAAC;AAGF,eAAO,MAAM,QAAQ;;;;;;;CAOpB,CAAC"}
|