imxc 0.2.0 → 0.3.1
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/dist/compile.d.ts +10 -0
- package/dist/compile.js +169 -0
- package/dist/components.js +249 -1
- package/dist/diagnostics.d.ts +5 -0
- package/dist/diagnostics.js +23 -0
- package/dist/emitter.d.ts +3 -3
- package/dist/emitter.js +814 -84
- package/dist/index.js +39 -111
- package/dist/init.d.ts +1 -0
- package/dist/init.js +202 -17
- package/dist/ir.d.ts +157 -3
- package/dist/lowering.d.ts +1 -0
- package/dist/lowering.js +400 -63
- package/dist/validator.js +3 -5
- package/dist/watch.d.ts +4 -0
- package/dist/watch.js +66 -0
- package/package.json +2 -2
package/dist/ir.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export type IRType = 'int' | 'float' | 'bool' | 'string' | 'color';
|
|
2
|
+
export interface SourceLoc {
|
|
3
|
+
file: string;
|
|
4
|
+
line: number;
|
|
5
|
+
}
|
|
2
6
|
export interface IRExpr {
|
|
3
7
|
code: string;
|
|
4
8
|
type: IRType;
|
|
@@ -21,27 +25,30 @@ export interface IRPropParam {
|
|
|
21
25
|
name: string;
|
|
22
26
|
type: IRType | 'callback';
|
|
23
27
|
}
|
|
24
|
-
export type IRNode = IRBeginContainer | IREndContainer | IRText | IRButton | IRTextInput | IRCheckbox | IRSeparator | IRBeginPopup | IREndPopup | IROpenPopup | IRConditional | IRListMap | IRCustomComponent | IRMenuItem | IRSliderFloat | IRSliderInt | IRDragFloat | IRDragInt | IRCombo | IRInputInt | IRInputFloat | IRColorEdit | IRListBox | IRProgressBar | IRTooltip;
|
|
28
|
+
export type IRNode = IRBeginContainer | IREndContainer | IRText | IRButton | IRTextInput | IRCheckbox | IRSeparator | IRBeginPopup | IREndPopup | IROpenPopup | IRConditional | IRListMap | IRCustomComponent | IRMenuItem | IRSliderFloat | IRSliderInt | IRDragFloat | IRDragInt | IRCombo | IRInputInt | IRInputFloat | IRColorEdit | IRListBox | IRProgressBar | IRTooltip | IRDockLayout | IRNativeWidget | IRBulletText | IRLabelText | IRSelectable | IRRadio | IRInputTextMultiline | IRColorPicker | IRPlotLines | IRPlotHistogram | IRImage | IRDrawLine | IRDrawRect | IRDrawCircle | IRDrawText;
|
|
25
29
|
export interface IRBeginContainer {
|
|
26
30
|
kind: 'begin_container';
|
|
27
|
-
tag: 'Window' | 'View' | 'Row' | 'Column' | 'DockSpace' | 'MenuBar' | 'Menu' | 'Table' | 'TableRow' | 'TabBar' | 'TabItem' | 'TreeNode' | 'CollapsingHeader';
|
|
31
|
+
tag: 'Window' | 'View' | 'Row' | 'Column' | 'DockSpace' | 'MenuBar' | 'Menu' | 'Table' | 'TableRow' | 'TabBar' | 'TabItem' | 'TreeNode' | 'CollapsingHeader' | 'Theme' | 'DockLayout' | 'DockSplit' | 'DockPanel' | 'Modal' | 'Group' | 'ID' | 'StyleColor' | 'StyleVar' | 'DragDropSource' | 'DragDropTarget' | 'Canvas' | 'Disabled' | 'Child';
|
|
28
32
|
props: Record<string, string>;
|
|
29
33
|
style?: string;
|
|
34
|
+
loc?: SourceLoc;
|
|
30
35
|
}
|
|
31
36
|
export interface IREndContainer {
|
|
32
37
|
kind: 'end_container';
|
|
33
|
-
tag: 'Window' | 'View' | 'Row' | 'Column' | 'DockSpace' | 'MenuBar' | 'Menu' | 'Table' | 'TableRow' | 'TabBar' | 'TabItem' | 'TreeNode' | 'CollapsingHeader';
|
|
38
|
+
tag: 'Window' | 'View' | 'Row' | 'Column' | 'DockSpace' | 'MenuBar' | 'Menu' | 'Table' | 'TableRow' | 'TabBar' | 'TabItem' | 'TreeNode' | 'CollapsingHeader' | 'Theme' | 'DockLayout' | 'DockSplit' | 'DockPanel' | 'Modal' | 'Group' | 'ID' | 'StyleColor' | 'StyleVar' | 'DragDropSource' | 'DragDropTarget' | 'Canvas' | 'Disabled' | 'Child';
|
|
34
39
|
}
|
|
35
40
|
export interface IRText {
|
|
36
41
|
kind: 'text';
|
|
37
42
|
format: string;
|
|
38
43
|
args: string[];
|
|
44
|
+
loc?: SourceLoc;
|
|
39
45
|
}
|
|
40
46
|
export interface IRButton {
|
|
41
47
|
kind: 'button';
|
|
42
48
|
title: string;
|
|
43
49
|
action: string[];
|
|
44
50
|
style?: string;
|
|
51
|
+
loc?: SourceLoc;
|
|
45
52
|
}
|
|
46
53
|
export interface IRTextInput {
|
|
47
54
|
kind: 'text_input';
|
|
@@ -49,6 +56,7 @@ export interface IRTextInput {
|
|
|
49
56
|
bufferIndex: number;
|
|
50
57
|
stateVar: string;
|
|
51
58
|
style?: string;
|
|
59
|
+
loc?: SourceLoc;
|
|
52
60
|
}
|
|
53
61
|
export interface IRCheckbox {
|
|
54
62
|
kind: 'checkbox';
|
|
@@ -57,14 +65,17 @@ export interface IRCheckbox {
|
|
|
57
65
|
valueExpr?: string;
|
|
58
66
|
onChangeExpr?: string;
|
|
59
67
|
style?: string;
|
|
68
|
+
loc?: SourceLoc;
|
|
60
69
|
}
|
|
61
70
|
export interface IRSeparator {
|
|
62
71
|
kind: 'separator';
|
|
72
|
+
loc?: SourceLoc;
|
|
63
73
|
}
|
|
64
74
|
export interface IRBeginPopup {
|
|
65
75
|
kind: 'begin_popup';
|
|
66
76
|
id: string;
|
|
67
77
|
style?: string;
|
|
78
|
+
loc?: SourceLoc;
|
|
68
79
|
}
|
|
69
80
|
export interface IREndPopup {
|
|
70
81
|
kind: 'end_popup';
|
|
@@ -72,12 +83,14 @@ export interface IREndPopup {
|
|
|
72
83
|
export interface IROpenPopup {
|
|
73
84
|
kind: 'open_popup';
|
|
74
85
|
id: string;
|
|
86
|
+
loc?: SourceLoc;
|
|
75
87
|
}
|
|
76
88
|
export interface IRConditional {
|
|
77
89
|
kind: 'conditional';
|
|
78
90
|
condition: string;
|
|
79
91
|
body: IRNode[];
|
|
80
92
|
elseBody?: IRNode[];
|
|
93
|
+
loc?: SourceLoc;
|
|
81
94
|
}
|
|
82
95
|
export interface IRListMap {
|
|
83
96
|
kind: 'list_map';
|
|
@@ -88,6 +101,7 @@ export interface IRListMap {
|
|
|
88
101
|
stateCount: number;
|
|
89
102
|
bufferCount: number;
|
|
90
103
|
body: IRNode[];
|
|
104
|
+
loc?: SourceLoc;
|
|
91
105
|
}
|
|
92
106
|
export interface IRCustomComponent {
|
|
93
107
|
kind: 'custom_component';
|
|
@@ -96,12 +110,14 @@ export interface IRCustomComponent {
|
|
|
96
110
|
key?: string;
|
|
97
111
|
stateCount: number;
|
|
98
112
|
bufferCount: number;
|
|
113
|
+
loc?: SourceLoc;
|
|
99
114
|
}
|
|
100
115
|
export interface IRMenuItem {
|
|
101
116
|
kind: 'menu_item';
|
|
102
117
|
label: string;
|
|
103
118
|
shortcut?: string;
|
|
104
119
|
action: string[];
|
|
120
|
+
loc?: SourceLoc;
|
|
105
121
|
}
|
|
106
122
|
export interface IRSliderFloat {
|
|
107
123
|
kind: 'slider_float';
|
|
@@ -112,6 +128,7 @@ export interface IRSliderFloat {
|
|
|
112
128
|
min: string;
|
|
113
129
|
max: string;
|
|
114
130
|
style?: string;
|
|
131
|
+
loc?: SourceLoc;
|
|
115
132
|
}
|
|
116
133
|
export interface IRSliderInt {
|
|
117
134
|
kind: 'slider_int';
|
|
@@ -122,6 +139,7 @@ export interface IRSliderInt {
|
|
|
122
139
|
min: string;
|
|
123
140
|
max: string;
|
|
124
141
|
style?: string;
|
|
142
|
+
loc?: SourceLoc;
|
|
125
143
|
}
|
|
126
144
|
export interface IRDragFloat {
|
|
127
145
|
kind: 'drag_float';
|
|
@@ -131,6 +149,7 @@ export interface IRDragFloat {
|
|
|
131
149
|
onChangeExpr?: string;
|
|
132
150
|
speed: string;
|
|
133
151
|
style?: string;
|
|
152
|
+
loc?: SourceLoc;
|
|
134
153
|
}
|
|
135
154
|
export interface IRDragInt {
|
|
136
155
|
kind: 'drag_int';
|
|
@@ -140,6 +159,7 @@ export interface IRDragInt {
|
|
|
140
159
|
onChangeExpr?: string;
|
|
141
160
|
speed: string;
|
|
142
161
|
style?: string;
|
|
162
|
+
loc?: SourceLoc;
|
|
143
163
|
}
|
|
144
164
|
export interface IRCombo {
|
|
145
165
|
kind: 'combo';
|
|
@@ -149,6 +169,7 @@ export interface IRCombo {
|
|
|
149
169
|
onChangeExpr?: string;
|
|
150
170
|
items: string;
|
|
151
171
|
style?: string;
|
|
172
|
+
loc?: SourceLoc;
|
|
152
173
|
}
|
|
153
174
|
export interface IRInputInt {
|
|
154
175
|
kind: 'input_int';
|
|
@@ -157,6 +178,7 @@ export interface IRInputInt {
|
|
|
157
178
|
valueExpr?: string;
|
|
158
179
|
onChangeExpr?: string;
|
|
159
180
|
style?: string;
|
|
181
|
+
loc?: SourceLoc;
|
|
160
182
|
}
|
|
161
183
|
export interface IRInputFloat {
|
|
162
184
|
kind: 'input_float';
|
|
@@ -165,12 +187,14 @@ export interface IRInputFloat {
|
|
|
165
187
|
valueExpr?: string;
|
|
166
188
|
onChangeExpr?: string;
|
|
167
189
|
style?: string;
|
|
190
|
+
loc?: SourceLoc;
|
|
168
191
|
}
|
|
169
192
|
export interface IRColorEdit {
|
|
170
193
|
kind: 'color_edit';
|
|
171
194
|
label: string;
|
|
172
195
|
stateVar: string;
|
|
173
196
|
style?: string;
|
|
197
|
+
loc?: SourceLoc;
|
|
174
198
|
}
|
|
175
199
|
export interface IRListBox {
|
|
176
200
|
kind: 'list_box';
|
|
@@ -180,14 +204,144 @@ export interface IRListBox {
|
|
|
180
204
|
onChangeExpr?: string;
|
|
181
205
|
items: string;
|
|
182
206
|
style?: string;
|
|
207
|
+
loc?: SourceLoc;
|
|
183
208
|
}
|
|
184
209
|
export interface IRProgressBar {
|
|
185
210
|
kind: 'progress_bar';
|
|
186
211
|
value: string;
|
|
187
212
|
overlay?: string;
|
|
188
213
|
style?: string;
|
|
214
|
+
loc?: SourceLoc;
|
|
189
215
|
}
|
|
190
216
|
export interface IRTooltip {
|
|
191
217
|
kind: 'tooltip';
|
|
192
218
|
text: string;
|
|
219
|
+
loc?: SourceLoc;
|
|
220
|
+
}
|
|
221
|
+
export interface IRNativeWidget {
|
|
222
|
+
kind: 'native_widget';
|
|
223
|
+
name: string;
|
|
224
|
+
props: Record<string, string>;
|
|
225
|
+
callbackProps: Record<string, string>;
|
|
226
|
+
key?: string;
|
|
227
|
+
loc?: SourceLoc;
|
|
228
|
+
}
|
|
229
|
+
export interface IRBulletText {
|
|
230
|
+
kind: 'bullet_text';
|
|
231
|
+
format: string;
|
|
232
|
+
args: string[];
|
|
233
|
+
loc?: SourceLoc;
|
|
234
|
+
}
|
|
235
|
+
export interface IRLabelText {
|
|
236
|
+
kind: 'label_text';
|
|
237
|
+
label: string;
|
|
238
|
+
value: string;
|
|
239
|
+
loc?: SourceLoc;
|
|
240
|
+
}
|
|
241
|
+
export interface IRSelectable {
|
|
242
|
+
kind: 'selectable';
|
|
243
|
+
label: string;
|
|
244
|
+
selected: string;
|
|
245
|
+
action: string[];
|
|
246
|
+
style?: string;
|
|
247
|
+
loc?: SourceLoc;
|
|
248
|
+
}
|
|
249
|
+
export interface IRRadio {
|
|
250
|
+
kind: 'radio';
|
|
251
|
+
label: string;
|
|
252
|
+
stateVar: string;
|
|
253
|
+
valueExpr?: string;
|
|
254
|
+
onChangeExpr?: string;
|
|
255
|
+
index: string;
|
|
256
|
+
style?: string;
|
|
257
|
+
loc?: SourceLoc;
|
|
258
|
+
}
|
|
259
|
+
export interface IRInputTextMultiline {
|
|
260
|
+
kind: 'input_text_multiline';
|
|
261
|
+
label: string;
|
|
262
|
+
bufferIndex: number;
|
|
263
|
+
stateVar: string;
|
|
264
|
+
style?: string;
|
|
265
|
+
loc?: SourceLoc;
|
|
266
|
+
}
|
|
267
|
+
export interface IRColorPicker {
|
|
268
|
+
kind: 'color_picker';
|
|
269
|
+
label: string;
|
|
270
|
+
stateVar: string;
|
|
271
|
+
style?: string;
|
|
272
|
+
loc?: SourceLoc;
|
|
273
|
+
}
|
|
274
|
+
export interface IRPlotLines {
|
|
275
|
+
kind: 'plot_lines';
|
|
276
|
+
label: string;
|
|
277
|
+
values: string;
|
|
278
|
+
overlay?: string;
|
|
279
|
+
style?: string;
|
|
280
|
+
loc?: SourceLoc;
|
|
281
|
+
}
|
|
282
|
+
export interface IRPlotHistogram {
|
|
283
|
+
kind: 'plot_histogram';
|
|
284
|
+
label: string;
|
|
285
|
+
values: string;
|
|
286
|
+
overlay?: string;
|
|
287
|
+
style?: string;
|
|
288
|
+
loc?: SourceLoc;
|
|
289
|
+
}
|
|
290
|
+
export interface IRImage {
|
|
291
|
+
kind: 'image';
|
|
292
|
+
src: string;
|
|
293
|
+
embed: boolean;
|
|
294
|
+
embedKey?: string;
|
|
295
|
+
width?: string;
|
|
296
|
+
height?: string;
|
|
297
|
+
loc?: SourceLoc;
|
|
298
|
+
}
|
|
299
|
+
export interface IRDrawLine {
|
|
300
|
+
kind: 'draw_line';
|
|
301
|
+
p1: string;
|
|
302
|
+
p2: string;
|
|
303
|
+
color: string;
|
|
304
|
+
thickness: string;
|
|
305
|
+
loc?: SourceLoc;
|
|
306
|
+
}
|
|
307
|
+
export interface IRDrawRect {
|
|
308
|
+
kind: 'draw_rect';
|
|
309
|
+
min: string;
|
|
310
|
+
max: string;
|
|
311
|
+
color: string;
|
|
312
|
+
filled: string;
|
|
313
|
+
thickness: string;
|
|
314
|
+
rounding: string;
|
|
315
|
+
loc?: SourceLoc;
|
|
316
|
+
}
|
|
317
|
+
export interface IRDrawCircle {
|
|
318
|
+
kind: 'draw_circle';
|
|
319
|
+
center: string;
|
|
320
|
+
radius: string;
|
|
321
|
+
color: string;
|
|
322
|
+
filled: string;
|
|
323
|
+
thickness: string;
|
|
324
|
+
loc?: SourceLoc;
|
|
325
|
+
}
|
|
326
|
+
export interface IRDrawText {
|
|
327
|
+
kind: 'draw_text';
|
|
328
|
+
pos: string;
|
|
329
|
+
text: string;
|
|
330
|
+
color: string;
|
|
331
|
+
loc?: SourceLoc;
|
|
332
|
+
}
|
|
333
|
+
export interface IRDockLayout {
|
|
334
|
+
kind: 'dock_layout';
|
|
335
|
+
children: (IRDockSplit | IRDockPanel)[];
|
|
336
|
+
loc?: SourceLoc;
|
|
337
|
+
}
|
|
338
|
+
export interface IRDockSplit {
|
|
339
|
+
kind: 'dock_split';
|
|
340
|
+
direction: string;
|
|
341
|
+
size: string;
|
|
342
|
+
children: (IRDockSplit | IRDockPanel)[];
|
|
343
|
+
}
|
|
344
|
+
export interface IRDockPanel {
|
|
345
|
+
kind: 'dock_panel';
|
|
346
|
+
windows: string[];
|
|
193
347
|
}
|
package/dist/lowering.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ interface LoweringContext {
|
|
|
8
8
|
propsParam: string | null;
|
|
9
9
|
bufferIndex: number;
|
|
10
10
|
sourceFile: ts.SourceFile;
|
|
11
|
+
customComponents: Map<string, string>;
|
|
11
12
|
}
|
|
12
13
|
export declare function lowerComponent(parsed: ParsedFile, validation: ValidationResult): IRComponent;
|
|
13
14
|
/**
|