roqa 0.0.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/CHANGELOG.md +21 -0
- package/LICENSE +21 -0
- package/README.md +33 -0
- package/package.json +77 -0
- package/src/compiler/codegen.js +1217 -0
- package/src/compiler/index.js +47 -0
- package/src/compiler/parser.js +197 -0
- package/src/compiler/transforms/bind-detector.js +264 -0
- package/src/compiler/transforms/events.js +246 -0
- package/src/compiler/transforms/for-transform.js +164 -0
- package/src/compiler/transforms/inline-get.js +1049 -0
- package/src/compiler/transforms/jsx-to-template.js +871 -0
- package/src/compiler/transforms/show-transform.js +78 -0
- package/src/compiler/transforms/validate.js +80 -0
- package/src/compiler/utils.js +69 -0
- package/src/jsx-runtime.d.ts +640 -0
- package/src/jsx-runtime.js +73 -0
- package/src/runtime/cell.js +37 -0
- package/src/runtime/component.js +241 -0
- package/src/runtime/events.js +156 -0
- package/src/runtime/for-block.js +374 -0
- package/src/runtime/index.js +17 -0
- package/src/runtime/show-block.js +115 -0
- package/src/runtime/template.js +32 -0
- package/types/compiler.d.ts +9 -0
- package/types/index.d.ts +433 -0
|
@@ -0,0 +1,640 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Roqa JSX Runtime Type Definitions
|
|
3
|
+
*
|
|
4
|
+
* Provides TypeScript support for Roqa's JSX syntax.
|
|
5
|
+
* Configure in tsconfig.json:
|
|
6
|
+
* {
|
|
7
|
+
* "compilerOptions": {
|
|
8
|
+
* "jsx": "react-jsx",
|
|
9
|
+
* "jsxImportSource": "roqa"
|
|
10
|
+
* }
|
|
11
|
+
* }
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import type { Cell } from "roqa";
|
|
15
|
+
|
|
16
|
+
// ============================================
|
|
17
|
+
// Component Types
|
|
18
|
+
// ============================================
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Roqa component function type.
|
|
22
|
+
* Components are imperative - they don't return JSX elements.
|
|
23
|
+
* Instead, they set up reactive bindings when connected to the DOM.
|
|
24
|
+
*/
|
|
25
|
+
export type ComponentType<P = {}> = (props: P) => void;
|
|
26
|
+
|
|
27
|
+
// ============================================
|
|
28
|
+
// JSX Runtime Functions
|
|
29
|
+
// ============================================
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Create a JSX element (automatic runtime)
|
|
33
|
+
* Note: This throws at runtime - JSX must be compiled
|
|
34
|
+
*/
|
|
35
|
+
export function jsx(
|
|
36
|
+
type: string | ComponentType<any>,
|
|
37
|
+
props?: Record<string, any>,
|
|
38
|
+
key?: string | number | null,
|
|
39
|
+
): void;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Create a JSX element with static children
|
|
43
|
+
* Note: This throws at runtime - JSX must be compiled
|
|
44
|
+
*/
|
|
45
|
+
export function jsxs(
|
|
46
|
+
type: string | ComponentType<any>,
|
|
47
|
+
props?: Record<string, any>,
|
|
48
|
+
key?: string | number | null,
|
|
49
|
+
): void;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* JSX Fragment - groups elements without a wrapper
|
|
53
|
+
*/
|
|
54
|
+
export function Fragment(props: { children?: any }): void;
|
|
55
|
+
|
|
56
|
+
// ============================================
|
|
57
|
+
// Special Components
|
|
58
|
+
// ============================================
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Props for the For component
|
|
62
|
+
*/
|
|
63
|
+
export interface ForProps<T> {
|
|
64
|
+
/** Reactive cell containing the array to iterate */
|
|
65
|
+
each: Cell<T[]>;
|
|
66
|
+
/** Render callback for each item */
|
|
67
|
+
children: (item: T, index: number) => void;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* For component - renders a list reactively
|
|
72
|
+
* Compiled into forBlock() calls
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```tsx
|
|
76
|
+
* const items = cell([{ name: "A" }, { name: "B" }]);
|
|
77
|
+
*
|
|
78
|
+
* <For each={items}>
|
|
79
|
+
* {(item, index) => <li>{item.name}</li>}
|
|
80
|
+
* </For>
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
export declare function For<T>(props: ForProps<T>): JSX.Element;
|
|
84
|
+
|
|
85
|
+
// ============================================
|
|
86
|
+
// Event Handler Types
|
|
87
|
+
// ============================================
|
|
88
|
+
|
|
89
|
+
export type EventHandler<E extends Event = Event> =
|
|
90
|
+
| ((event: E) => void)
|
|
91
|
+
| { handler: (event: E, ...args: any[]) => void; args: any[] };
|
|
92
|
+
|
|
93
|
+
// ============================================
|
|
94
|
+
// HTML Attribute Types
|
|
95
|
+
// ============================================
|
|
96
|
+
|
|
97
|
+
type Booleanish = boolean | "true" | "false";
|
|
98
|
+
|
|
99
|
+
interface DOMAttributes {
|
|
100
|
+
children?: any;
|
|
101
|
+
|
|
102
|
+
// Clipboard Events
|
|
103
|
+
oncopy?: EventHandler<ClipboardEvent>;
|
|
104
|
+
oncut?: EventHandler<ClipboardEvent>;
|
|
105
|
+
onpaste?: EventHandler<ClipboardEvent>;
|
|
106
|
+
|
|
107
|
+
// Composition Events
|
|
108
|
+
oncompositionend?: EventHandler<CompositionEvent>;
|
|
109
|
+
oncompositionstart?: EventHandler<CompositionEvent>;
|
|
110
|
+
oncompositionupdate?: EventHandler<CompositionEvent>;
|
|
111
|
+
|
|
112
|
+
// Focus Events
|
|
113
|
+
onfocus?: EventHandler<FocusEvent>;
|
|
114
|
+
onblur?: EventHandler<FocusEvent>;
|
|
115
|
+
|
|
116
|
+
// Form Events
|
|
117
|
+
onchange?: EventHandler<Event>;
|
|
118
|
+
oninput?: EventHandler<Event>;
|
|
119
|
+
onreset?: EventHandler<Event>;
|
|
120
|
+
onsubmit?: EventHandler<Event>;
|
|
121
|
+
oninvalid?: EventHandler<Event>;
|
|
122
|
+
|
|
123
|
+
// Image Events
|
|
124
|
+
onload?: EventHandler<Event>;
|
|
125
|
+
onerror?: EventHandler<Event>;
|
|
126
|
+
|
|
127
|
+
// Keyboard Events
|
|
128
|
+
onkeydown?: EventHandler<KeyboardEvent>;
|
|
129
|
+
onkeypress?: EventHandler<KeyboardEvent>;
|
|
130
|
+
onkeyup?: EventHandler<KeyboardEvent>;
|
|
131
|
+
|
|
132
|
+
// Mouse Events
|
|
133
|
+
onclick?: EventHandler<MouseEvent>;
|
|
134
|
+
oncontextmenu?: EventHandler<MouseEvent>;
|
|
135
|
+
ondblclick?: EventHandler<MouseEvent>;
|
|
136
|
+
ondrag?: EventHandler<DragEvent>;
|
|
137
|
+
ondragend?: EventHandler<DragEvent>;
|
|
138
|
+
ondragenter?: EventHandler<DragEvent>;
|
|
139
|
+
ondragleave?: EventHandler<DragEvent>;
|
|
140
|
+
ondragover?: EventHandler<DragEvent>;
|
|
141
|
+
ondragstart?: EventHandler<DragEvent>;
|
|
142
|
+
ondrop?: EventHandler<DragEvent>;
|
|
143
|
+
onmousedown?: EventHandler<MouseEvent>;
|
|
144
|
+
onmouseenter?: EventHandler<MouseEvent>;
|
|
145
|
+
onmouseleave?: EventHandler<MouseEvent>;
|
|
146
|
+
onmousemove?: EventHandler<MouseEvent>;
|
|
147
|
+
onmouseout?: EventHandler<MouseEvent>;
|
|
148
|
+
onmouseover?: EventHandler<MouseEvent>;
|
|
149
|
+
onmouseup?: EventHandler<MouseEvent>;
|
|
150
|
+
|
|
151
|
+
// Pointer Events
|
|
152
|
+
onpointerdown?: EventHandler<PointerEvent>;
|
|
153
|
+
onpointermove?: EventHandler<PointerEvent>;
|
|
154
|
+
onpointerup?: EventHandler<PointerEvent>;
|
|
155
|
+
onpointercancel?: EventHandler<PointerEvent>;
|
|
156
|
+
onpointerenter?: EventHandler<PointerEvent>;
|
|
157
|
+
onpointerleave?: EventHandler<PointerEvent>;
|
|
158
|
+
onpointerover?: EventHandler<PointerEvent>;
|
|
159
|
+
onpointerout?: EventHandler<PointerEvent>;
|
|
160
|
+
|
|
161
|
+
// Touch Events
|
|
162
|
+
ontouchcancel?: EventHandler<TouchEvent>;
|
|
163
|
+
ontouchend?: EventHandler<TouchEvent>;
|
|
164
|
+
ontouchmove?: EventHandler<TouchEvent>;
|
|
165
|
+
ontouchstart?: EventHandler<TouchEvent>;
|
|
166
|
+
|
|
167
|
+
// UI Events
|
|
168
|
+
onscroll?: EventHandler<UIEvent>;
|
|
169
|
+
|
|
170
|
+
// Wheel Events
|
|
171
|
+
onwheel?: EventHandler<WheelEvent>;
|
|
172
|
+
|
|
173
|
+
// Animation Events
|
|
174
|
+
onanimationstart?: EventHandler<AnimationEvent>;
|
|
175
|
+
onanimationend?: EventHandler<AnimationEvent>;
|
|
176
|
+
onanimationiteration?: EventHandler<AnimationEvent>;
|
|
177
|
+
|
|
178
|
+
// Transition Events
|
|
179
|
+
ontransitionend?: EventHandler<TransitionEvent>;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
interface HTMLAttributes extends DOMAttributes {
|
|
183
|
+
// Standard HTML Attributes
|
|
184
|
+
accesskey?: string;
|
|
185
|
+
autofocus?: boolean;
|
|
186
|
+
class?: string;
|
|
187
|
+
contenteditable?: Booleanish | "inherit";
|
|
188
|
+
dir?: string;
|
|
189
|
+
draggable?: Booleanish;
|
|
190
|
+
hidden?: boolean;
|
|
191
|
+
id?: string;
|
|
192
|
+
lang?: string;
|
|
193
|
+
slot?: string;
|
|
194
|
+
spellcheck?: Booleanish;
|
|
195
|
+
style?: string | Record<string, string | number>;
|
|
196
|
+
tabindex?: number;
|
|
197
|
+
title?: string;
|
|
198
|
+
translate?: "yes" | "no";
|
|
199
|
+
|
|
200
|
+
// WAI-ARIA
|
|
201
|
+
role?: string;
|
|
202
|
+
|
|
203
|
+
// RDFa Attributes
|
|
204
|
+
about?: string;
|
|
205
|
+
datatype?: string;
|
|
206
|
+
inlist?: any;
|
|
207
|
+
prefix?: string;
|
|
208
|
+
property?: string;
|
|
209
|
+
resource?: string;
|
|
210
|
+
typeof?: string;
|
|
211
|
+
vocab?: string;
|
|
212
|
+
|
|
213
|
+
// Non-standard Attributes
|
|
214
|
+
autocapitalize?: string;
|
|
215
|
+
autocorrect?: string;
|
|
216
|
+
autosave?: string;
|
|
217
|
+
color?: string;
|
|
218
|
+
itemprop?: string;
|
|
219
|
+
itemscope?: boolean;
|
|
220
|
+
itemtype?: string;
|
|
221
|
+
itemid?: string;
|
|
222
|
+
itemref?: string;
|
|
223
|
+
results?: number;
|
|
224
|
+
security?: string;
|
|
225
|
+
unselectable?: "on" | "off";
|
|
226
|
+
|
|
227
|
+
// Living Standard
|
|
228
|
+
inputmode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search";
|
|
229
|
+
is?: string;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
interface AnchorHTMLAttributes extends HTMLAttributes {
|
|
233
|
+
download?: any;
|
|
234
|
+
href?: string;
|
|
235
|
+
hreflang?: string;
|
|
236
|
+
media?: string;
|
|
237
|
+
ping?: string;
|
|
238
|
+
rel?: string;
|
|
239
|
+
target?: string;
|
|
240
|
+
type?: string;
|
|
241
|
+
referrerpolicy?: string;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
interface ButtonHTMLAttributes extends HTMLAttributes {
|
|
245
|
+
autofocus?: boolean;
|
|
246
|
+
disabled?: boolean;
|
|
247
|
+
form?: string;
|
|
248
|
+
formaction?: string;
|
|
249
|
+
formenctype?: string;
|
|
250
|
+
formmethod?: string;
|
|
251
|
+
formnovalidate?: boolean;
|
|
252
|
+
formtarget?: string;
|
|
253
|
+
name?: string;
|
|
254
|
+
type?: "submit" | "reset" | "button";
|
|
255
|
+
value?: string | string[] | number;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
interface FormHTMLAttributes extends HTMLAttributes {
|
|
259
|
+
acceptcharset?: string;
|
|
260
|
+
action?: string;
|
|
261
|
+
autocomplete?: string;
|
|
262
|
+
enctype?: string;
|
|
263
|
+
method?: string;
|
|
264
|
+
name?: string;
|
|
265
|
+
novalidate?: boolean;
|
|
266
|
+
target?: string;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
interface ImgHTMLAttributes extends HTMLAttributes {
|
|
270
|
+
alt?: string;
|
|
271
|
+
crossorigin?: "anonymous" | "use-credentials" | "";
|
|
272
|
+
decoding?: "async" | "auto" | "sync";
|
|
273
|
+
height?: number | string;
|
|
274
|
+
loading?: "eager" | "lazy";
|
|
275
|
+
referrerpolicy?: string;
|
|
276
|
+
sizes?: string;
|
|
277
|
+
src?: string;
|
|
278
|
+
srcset?: string;
|
|
279
|
+
usemap?: string;
|
|
280
|
+
width?: number | string;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
interface InputHTMLAttributes extends HTMLAttributes {
|
|
284
|
+
accept?: string;
|
|
285
|
+
alt?: string;
|
|
286
|
+
autocomplete?: string;
|
|
287
|
+
autofocus?: boolean;
|
|
288
|
+
capture?: boolean | "user" | "environment";
|
|
289
|
+
checked?: boolean;
|
|
290
|
+
crossorigin?: string;
|
|
291
|
+
disabled?: boolean;
|
|
292
|
+
form?: string;
|
|
293
|
+
formaction?: string;
|
|
294
|
+
formenctype?: string;
|
|
295
|
+
formmethod?: string;
|
|
296
|
+
formnovalidate?: boolean;
|
|
297
|
+
formtarget?: string;
|
|
298
|
+
height?: number | string;
|
|
299
|
+
list?: string;
|
|
300
|
+
max?: number | string;
|
|
301
|
+
maxlength?: number;
|
|
302
|
+
min?: number | string;
|
|
303
|
+
minlength?: number;
|
|
304
|
+
multiple?: boolean;
|
|
305
|
+
name?: string;
|
|
306
|
+
pattern?: string;
|
|
307
|
+
placeholder?: string;
|
|
308
|
+
readonly?: boolean;
|
|
309
|
+
required?: boolean;
|
|
310
|
+
size?: number;
|
|
311
|
+
src?: string;
|
|
312
|
+
step?: number | string;
|
|
313
|
+
type?: string;
|
|
314
|
+
value?: string | string[] | number;
|
|
315
|
+
width?: number | string;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
interface LabelHTMLAttributes extends HTMLAttributes {
|
|
319
|
+
form?: string;
|
|
320
|
+
for?: string;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
interface SelectHTMLAttributes extends HTMLAttributes {
|
|
324
|
+
autocomplete?: string;
|
|
325
|
+
autofocus?: boolean;
|
|
326
|
+
disabled?: boolean;
|
|
327
|
+
form?: string;
|
|
328
|
+
multiple?: boolean;
|
|
329
|
+
name?: string;
|
|
330
|
+
required?: boolean;
|
|
331
|
+
size?: number;
|
|
332
|
+
value?: string | string[] | number;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
interface OptionHTMLAttributes extends HTMLAttributes {
|
|
336
|
+
disabled?: boolean;
|
|
337
|
+
label?: string;
|
|
338
|
+
selected?: boolean;
|
|
339
|
+
value?: string | string[] | number;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
interface OptgroupHTMLAttributes extends HTMLAttributes {
|
|
343
|
+
disabled?: boolean;
|
|
344
|
+
label?: string;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
interface TextareaHTMLAttributes extends HTMLAttributes {
|
|
348
|
+
autocomplete?: string;
|
|
349
|
+
autofocus?: boolean;
|
|
350
|
+
cols?: number;
|
|
351
|
+
dirname?: string;
|
|
352
|
+
disabled?: boolean;
|
|
353
|
+
form?: string;
|
|
354
|
+
maxlength?: number;
|
|
355
|
+
minlength?: number;
|
|
356
|
+
name?: string;
|
|
357
|
+
placeholder?: string;
|
|
358
|
+
readonly?: boolean;
|
|
359
|
+
required?: boolean;
|
|
360
|
+
rows?: number;
|
|
361
|
+
value?: string | string[] | number;
|
|
362
|
+
wrap?: string;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
interface TableHTMLAttributes extends HTMLAttributes {
|
|
366
|
+
cellpadding?: number | string;
|
|
367
|
+
cellspacing?: number | string;
|
|
368
|
+
summary?: string;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
interface TdHTMLAttributes extends HTMLAttributes {
|
|
372
|
+
align?: "left" | "center" | "right" | "justify" | "char";
|
|
373
|
+
colspan?: number;
|
|
374
|
+
headers?: string;
|
|
375
|
+
rowspan?: number;
|
|
376
|
+
scope?: string;
|
|
377
|
+
valign?: "top" | "middle" | "bottom" | "baseline";
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
interface ThHTMLAttributes extends HTMLAttributes {
|
|
381
|
+
align?: "left" | "center" | "right" | "justify" | "char";
|
|
382
|
+
colspan?: number;
|
|
383
|
+
headers?: string;
|
|
384
|
+
rowspan?: number;
|
|
385
|
+
scope?: string;
|
|
386
|
+
valign?: "top" | "middle" | "bottom" | "baseline";
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
interface SVGAttributes extends DOMAttributes {
|
|
390
|
+
// SVG Specific attributes
|
|
391
|
+
class?: string;
|
|
392
|
+
color?: string;
|
|
393
|
+
height?: number | string;
|
|
394
|
+
id?: string;
|
|
395
|
+
lang?: string;
|
|
396
|
+
max?: number | string;
|
|
397
|
+
media?: string;
|
|
398
|
+
method?: string;
|
|
399
|
+
min?: number | string;
|
|
400
|
+
name?: string;
|
|
401
|
+
style?: string | Record<string, string | number>;
|
|
402
|
+
target?: string;
|
|
403
|
+
type?: string;
|
|
404
|
+
width?: number | string;
|
|
405
|
+
|
|
406
|
+
// SVG Presentation Attributes
|
|
407
|
+
"clip-path"?: string;
|
|
408
|
+
cx?: number | string;
|
|
409
|
+
cy?: number | string;
|
|
410
|
+
d?: string;
|
|
411
|
+
fill?: string;
|
|
412
|
+
"fill-opacity"?: number | string;
|
|
413
|
+
"fill-rule"?: "nonzero" | "evenodd" | "inherit";
|
|
414
|
+
filter?: string;
|
|
415
|
+
"font-family"?: string;
|
|
416
|
+
"font-size"?: number | string;
|
|
417
|
+
fx?: number | string;
|
|
418
|
+
fy?: number | string;
|
|
419
|
+
gradientTransform?: string;
|
|
420
|
+
gradientUnits?: string;
|
|
421
|
+
href?: string;
|
|
422
|
+
markerEnd?: string;
|
|
423
|
+
markerMid?: string;
|
|
424
|
+
markerStart?: string;
|
|
425
|
+
offset?: number | string;
|
|
426
|
+
opacity?: number | string;
|
|
427
|
+
patternContentUnits?: string;
|
|
428
|
+
patternUnits?: string;
|
|
429
|
+
points?: string;
|
|
430
|
+
preserveAspectRatio?: string;
|
|
431
|
+
r?: number | string;
|
|
432
|
+
rx?: number | string;
|
|
433
|
+
ry?: number | string;
|
|
434
|
+
spreadMethod?: string;
|
|
435
|
+
"stop-color"?: string;
|
|
436
|
+
"stop-opacity"?: number | string;
|
|
437
|
+
stroke?: string;
|
|
438
|
+
"stroke-dasharray"?: string | number;
|
|
439
|
+
"stroke-dashoffset"?: string | number;
|
|
440
|
+
"stroke-linecap"?: "butt" | "round" | "square" | "inherit";
|
|
441
|
+
"stroke-linejoin"?: "miter" | "round" | "bevel" | "inherit";
|
|
442
|
+
"stroke-miterlimit"?: number | string;
|
|
443
|
+
"stroke-opacity"?: number | string;
|
|
444
|
+
"stroke-width"?: number | string;
|
|
445
|
+
textAnchor?: string;
|
|
446
|
+
transform?: string;
|
|
447
|
+
viewBox?: string;
|
|
448
|
+
x?: number | string;
|
|
449
|
+
x1?: number | string;
|
|
450
|
+
x2?: number | string;
|
|
451
|
+
xmlns?: string;
|
|
452
|
+
y?: number | string;
|
|
453
|
+
y1?: number | string;
|
|
454
|
+
y2?: number | string;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
// ============================================
|
|
458
|
+
// Global JSX Namespace
|
|
459
|
+
// ============================================
|
|
460
|
+
|
|
461
|
+
declare global {
|
|
462
|
+
namespace JSX {
|
|
463
|
+
// JSX expressions return void in Roqa (imperative, no virtual DOM)
|
|
464
|
+
type Element = void;
|
|
465
|
+
|
|
466
|
+
interface ElementChildrenAttribute {
|
|
467
|
+
children: {};
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
interface IntrinsicElements {
|
|
471
|
+
// Main root
|
|
472
|
+
html: HTMLAttributes;
|
|
473
|
+
|
|
474
|
+
// Document metadata
|
|
475
|
+
head: HTMLAttributes;
|
|
476
|
+
title: HTMLAttributes;
|
|
477
|
+
base: HTMLAttributes;
|
|
478
|
+
link: HTMLAttributes;
|
|
479
|
+
meta: HTMLAttributes;
|
|
480
|
+
style: HTMLAttributes;
|
|
481
|
+
|
|
482
|
+
// Sectioning root
|
|
483
|
+
body: HTMLAttributes;
|
|
484
|
+
|
|
485
|
+
// Content sectioning
|
|
486
|
+
address: HTMLAttributes;
|
|
487
|
+
article: HTMLAttributes;
|
|
488
|
+
aside: HTMLAttributes;
|
|
489
|
+
footer: HTMLAttributes;
|
|
490
|
+
header: HTMLAttributes;
|
|
491
|
+
h1: HTMLAttributes;
|
|
492
|
+
h2: HTMLAttributes;
|
|
493
|
+
h3: HTMLAttributes;
|
|
494
|
+
h4: HTMLAttributes;
|
|
495
|
+
h5: HTMLAttributes;
|
|
496
|
+
h6: HTMLAttributes;
|
|
497
|
+
main: HTMLAttributes;
|
|
498
|
+
nav: HTMLAttributes;
|
|
499
|
+
section: HTMLAttributes;
|
|
500
|
+
|
|
501
|
+
// Text content
|
|
502
|
+
blockquote: HTMLAttributes;
|
|
503
|
+
dd: HTMLAttributes;
|
|
504
|
+
div: HTMLAttributes;
|
|
505
|
+
dl: HTMLAttributes;
|
|
506
|
+
dt: HTMLAttributes;
|
|
507
|
+
figcaption: HTMLAttributes;
|
|
508
|
+
figure: HTMLAttributes;
|
|
509
|
+
hr: HTMLAttributes;
|
|
510
|
+
li: HTMLAttributes;
|
|
511
|
+
ol: HTMLAttributes;
|
|
512
|
+
p: HTMLAttributes;
|
|
513
|
+
pre: HTMLAttributes;
|
|
514
|
+
ul: HTMLAttributes;
|
|
515
|
+
|
|
516
|
+
// Inline text semantics
|
|
517
|
+
a: AnchorHTMLAttributes;
|
|
518
|
+
abbr: HTMLAttributes;
|
|
519
|
+
b: HTMLAttributes;
|
|
520
|
+
bdi: HTMLAttributes;
|
|
521
|
+
bdo: HTMLAttributes;
|
|
522
|
+
br: HTMLAttributes;
|
|
523
|
+
cite: HTMLAttributes;
|
|
524
|
+
code: HTMLAttributes;
|
|
525
|
+
data: HTMLAttributes;
|
|
526
|
+
dfn: HTMLAttributes;
|
|
527
|
+
em: HTMLAttributes;
|
|
528
|
+
i: HTMLAttributes;
|
|
529
|
+
kbd: HTMLAttributes;
|
|
530
|
+
mark: HTMLAttributes;
|
|
531
|
+
q: HTMLAttributes;
|
|
532
|
+
rp: HTMLAttributes;
|
|
533
|
+
rt: HTMLAttributes;
|
|
534
|
+
ruby: HTMLAttributes;
|
|
535
|
+
s: HTMLAttributes;
|
|
536
|
+
samp: HTMLAttributes;
|
|
537
|
+
small: HTMLAttributes;
|
|
538
|
+
span: HTMLAttributes;
|
|
539
|
+
strong: HTMLAttributes;
|
|
540
|
+
sub: HTMLAttributes;
|
|
541
|
+
sup: HTMLAttributes;
|
|
542
|
+
time: HTMLAttributes;
|
|
543
|
+
u: HTMLAttributes;
|
|
544
|
+
var: HTMLAttributes;
|
|
545
|
+
wbr: HTMLAttributes;
|
|
546
|
+
|
|
547
|
+
// Image and multimedia
|
|
548
|
+
area: HTMLAttributes;
|
|
549
|
+
audio: HTMLAttributes;
|
|
550
|
+
img: ImgHTMLAttributes;
|
|
551
|
+
map: HTMLAttributes;
|
|
552
|
+
track: HTMLAttributes;
|
|
553
|
+
video: HTMLAttributes;
|
|
554
|
+
|
|
555
|
+
// Embedded content
|
|
556
|
+
embed: HTMLAttributes;
|
|
557
|
+
iframe: HTMLAttributes;
|
|
558
|
+
object: HTMLAttributes;
|
|
559
|
+
param: HTMLAttributes;
|
|
560
|
+
picture: HTMLAttributes;
|
|
561
|
+
portal: HTMLAttributes;
|
|
562
|
+
source: HTMLAttributes;
|
|
563
|
+
|
|
564
|
+
// SVG and MathML
|
|
565
|
+
svg: SVGAttributes;
|
|
566
|
+
math: HTMLAttributes;
|
|
567
|
+
|
|
568
|
+
// Scripting
|
|
569
|
+
canvas: HTMLAttributes;
|
|
570
|
+
noscript: HTMLAttributes;
|
|
571
|
+
script: HTMLAttributes;
|
|
572
|
+
|
|
573
|
+
// Demarcating edits
|
|
574
|
+
del: HTMLAttributes;
|
|
575
|
+
ins: HTMLAttributes;
|
|
576
|
+
|
|
577
|
+
// Table content
|
|
578
|
+
caption: HTMLAttributes;
|
|
579
|
+
col: HTMLAttributes;
|
|
580
|
+
colgroup: HTMLAttributes;
|
|
581
|
+
table: TableHTMLAttributes;
|
|
582
|
+
tbody: HTMLAttributes;
|
|
583
|
+
td: TdHTMLAttributes;
|
|
584
|
+
tfoot: HTMLAttributes;
|
|
585
|
+
th: ThHTMLAttributes;
|
|
586
|
+
thead: HTMLAttributes;
|
|
587
|
+
tr: HTMLAttributes;
|
|
588
|
+
|
|
589
|
+
// Forms
|
|
590
|
+
button: ButtonHTMLAttributes;
|
|
591
|
+
datalist: HTMLAttributes;
|
|
592
|
+
fieldset: HTMLAttributes;
|
|
593
|
+
form: FormHTMLAttributes;
|
|
594
|
+
input: InputHTMLAttributes;
|
|
595
|
+
label: LabelHTMLAttributes;
|
|
596
|
+
legend: HTMLAttributes;
|
|
597
|
+
meter: HTMLAttributes;
|
|
598
|
+
optgroup: OptgroupHTMLAttributes;
|
|
599
|
+
option: OptionHTMLAttributes;
|
|
600
|
+
output: HTMLAttributes;
|
|
601
|
+
progress: HTMLAttributes;
|
|
602
|
+
select: SelectHTMLAttributes;
|
|
603
|
+
textarea: TextareaHTMLAttributes;
|
|
604
|
+
|
|
605
|
+
// Interactive elements
|
|
606
|
+
details: HTMLAttributes;
|
|
607
|
+
dialog: HTMLAttributes;
|
|
608
|
+
menu: HTMLAttributes;
|
|
609
|
+
summary: HTMLAttributes;
|
|
610
|
+
|
|
611
|
+
// Web Components
|
|
612
|
+
slot: HTMLAttributes;
|
|
613
|
+
template: HTMLAttributes;
|
|
614
|
+
|
|
615
|
+
// SVG elements
|
|
616
|
+
circle: SVGAttributes;
|
|
617
|
+
clipPath: SVGAttributes;
|
|
618
|
+
defs: SVGAttributes;
|
|
619
|
+
ellipse: SVGAttributes;
|
|
620
|
+
g: SVGAttributes;
|
|
621
|
+
image: SVGAttributes;
|
|
622
|
+
line: SVGAttributes;
|
|
623
|
+
linearGradient: SVGAttributes;
|
|
624
|
+
mask: SVGAttributes;
|
|
625
|
+
path: SVGAttributes;
|
|
626
|
+
pattern: SVGAttributes;
|
|
627
|
+
polygon: SVGAttributes;
|
|
628
|
+
polyline: SVGAttributes;
|
|
629
|
+
radialGradient: SVGAttributes;
|
|
630
|
+
rect: SVGAttributes;
|
|
631
|
+
stop: SVGAttributes;
|
|
632
|
+
text: SVGAttributes;
|
|
633
|
+
tspan: SVGAttributes;
|
|
634
|
+
use: SVGAttributes;
|
|
635
|
+
|
|
636
|
+
// Allow any element (for custom elements)
|
|
637
|
+
[elemName: string]: any;
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Roqa JSX Runtime
|
|
3
|
+
*
|
|
4
|
+
* This module provides JSX runtime functions for TypeScript/tooling compatibility.
|
|
5
|
+
*
|
|
6
|
+
* IMPORTANT: Roqa compiles JSX at build time into optimized template cloning and
|
|
7
|
+
* DOM manipulation code. This runtime is NOT used in production - JSX is transformed
|
|
8
|
+
* by the Roqa compiler before it ever reaches the browser.
|
|
9
|
+
*
|
|
10
|
+
* This file exists for:
|
|
11
|
+
* 1. TypeScript type checking with jsxImportSource
|
|
12
|
+
* 2. IDE intellisense and autocompletion
|
|
13
|
+
* 3. Development-time error messages if uncompiled JSX somehow runs
|
|
14
|
+
*
|
|
15
|
+
* @see packages/roqa/src/compiler for the actual JSX transformation
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a JSX element
|
|
20
|
+
* @param {string | Function} type - Element type (tag name or component function)
|
|
21
|
+
* @param {object} props - Element properties including children
|
|
22
|
+
* @param {string} [key] - Element key (unused in Roqa)
|
|
23
|
+
* @returns {void}
|
|
24
|
+
*/
|
|
25
|
+
export function jsx(type, _props, _key) {
|
|
26
|
+
throw new Error(
|
|
27
|
+
`[Roqa] Uncompiled JSX detected: <${
|
|
28
|
+
typeof type === "function" ? type.name || "Component" : type
|
|
29
|
+
}>. ` +
|
|
30
|
+
`Roqa requires JSX to be compiled at build time. ` +
|
|
31
|
+
`Make sure you're using the Roqa Vite plugin or compiler.`,
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Create a JSX element with static children
|
|
37
|
+
* @param {string | Function} type - Element type (tag name or component function)
|
|
38
|
+
* @param {object} props - Element properties including children
|
|
39
|
+
* @param {string} [key] - Element key (unused in Roqa)
|
|
40
|
+
* @returns {void}
|
|
41
|
+
*/
|
|
42
|
+
export function jsxs(type, props, key) {
|
|
43
|
+
return jsx(type, props, key);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* JSX Fragment - groups multiple elements without a wrapper
|
|
48
|
+
* @param {{ children?: any }} props - Fragment props
|
|
49
|
+
* @returns {void}
|
|
50
|
+
*/
|
|
51
|
+
export function Fragment(_props) {
|
|
52
|
+
throw new Error(
|
|
53
|
+
`[Roqa] Uncompiled JSX Fragment detected. ` +
|
|
54
|
+
`Roqa requires JSX to be compiled at build time. ` +
|
|
55
|
+
`Make sure you're using the Roqa Vite plugin or compiler.`,
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* For component - renders a list of items reactively
|
|
61
|
+
* Used as: <For each={items}>{(item) => <div>{item}</div>}</For>
|
|
62
|
+
*
|
|
63
|
+
* This is compiled into forBlock() calls by the Roqa compiler.
|
|
64
|
+
* @param {{ each: any, children: Function }} props
|
|
65
|
+
* @returns {void}
|
|
66
|
+
*/
|
|
67
|
+
export function For(_props) {
|
|
68
|
+
throw new Error(
|
|
69
|
+
`[Roqa] Uncompiled <For> component detected. ` +
|
|
70
|
+
`Roqa requires JSX to be compiled at build time. ` +
|
|
71
|
+
`Make sure you're using the Roqa Vite plugin or compiler.`,
|
|
72
|
+
);
|
|
73
|
+
}
|