what-core 0.6.2 → 0.6.3
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/README.md +2 -0
- package/compiler.d.ts +30 -0
- package/devtools.d.ts +2 -0
- package/dist/compiler.js +1787 -0
- package/dist/compiler.js.map +7 -0
- package/dist/compiler.min.js +2 -0
- package/dist/compiler.min.js.map +7 -0
- package/dist/devtools.js +10 -0
- package/dist/devtools.js.map +7 -0
- package/dist/devtools.min.js +2 -0
- package/dist/devtools.min.js.map +7 -0
- package/dist/index.js +330 -382
- package/dist/index.js.map +4 -4
- package/dist/index.min.js +62 -62
- package/dist/index.min.js.map +4 -4
- package/dist/render.js +262 -21
- package/dist/render.js.map +4 -4
- package/dist/render.min.js +58 -1
- package/dist/render.min.js.map +4 -4
- package/dist/testing.js +3 -0
- package/dist/testing.js.map +2 -2
- package/dist/testing.min.js +1 -1
- package/dist/testing.min.js.map +2 -2
- package/index.d.ts +176 -1
- package/jsx-runtime.d.ts +622 -0
- package/package.json +20 -2
- package/src/agent-context.js +1 -1
- package/src/compiler.js +18 -0
- package/src/components.js +73 -27
- package/src/devtools.js +4 -0
- package/src/dom.js +7 -0
- package/src/guardrails.js +3 -4
- package/src/hooks.js +0 -11
- package/src/index.js +5 -9
- package/src/render.js +91 -24
- package/dist/a11y.js +0 -440
- package/dist/animation.js +0 -548
- package/dist/components.js +0 -229
- package/dist/data.js +0 -638
- package/dist/dom.js +0 -439
- package/dist/form.js +0 -509
- package/dist/h.js +0 -152
- package/dist/head.js +0 -51
- package/dist/helpers.js +0 -140
- package/dist/hooks.js +0 -210
- package/dist/reactive.js +0 -432
- package/dist/scheduler.js +0 -246
- package/dist/skeleton.js +0 -363
- package/dist/store.js +0 -83
- package/dist/what.js +0 -117
package/jsx-runtime.d.ts
ADDED
|
@@ -0,0 +1,622 @@
|
|
|
1
|
+
// What Framework - JSX Runtime Type Definitions
|
|
2
|
+
// Provides JSX IntrinsicElements and Element types for TypeScript JSX support.
|
|
3
|
+
// Used with: jsxImportSource: "what-core" or "what-framework"
|
|
4
|
+
|
|
5
|
+
import { VNode, VNodeChild, Component } from './index';
|
|
6
|
+
|
|
7
|
+
export { Fragment } from './index';
|
|
8
|
+
|
|
9
|
+
/** Automatic JSX transform entry point */
|
|
10
|
+
export function jsx(type: string | Component<any>, props: Record<string, any> | null, key?: string | number): VNode;
|
|
11
|
+
/** Automatic JSX transform entry point (static children) */
|
|
12
|
+
export function jsxs(type: string | Component<any>, props: Record<string, any> | null, key?: string | number): VNode;
|
|
13
|
+
|
|
14
|
+
// --- JSX Namespace ---
|
|
15
|
+
|
|
16
|
+
type Booleanish = boolean | 'true' | 'false';
|
|
17
|
+
type SignalOrValue<T> = T | (() => T);
|
|
18
|
+
|
|
19
|
+
export namespace JSX {
|
|
20
|
+
type Element = VNode;
|
|
21
|
+
type ElementClass = never;
|
|
22
|
+
|
|
23
|
+
interface ElementChildrenAttribute {
|
|
24
|
+
children: {};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
interface IntrinsicAttributes {
|
|
28
|
+
key?: string | number | null;
|
|
29
|
+
ref?: ((el: HTMLElement) => void) | { current: HTMLElement | null };
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Event handler types
|
|
33
|
+
type EventHandler<E extends Event = Event> = (event: E) => void;
|
|
34
|
+
|
|
35
|
+
// Common HTML attributes shared by all elements
|
|
36
|
+
interface HTMLAttributes<T extends EventTarget = HTMLElement> {
|
|
37
|
+
// Core attributes
|
|
38
|
+
id?: SignalOrValue<string>;
|
|
39
|
+
class?: SignalOrValue<string>;
|
|
40
|
+
className?: SignalOrValue<string>;
|
|
41
|
+
style?: SignalOrValue<string | Record<string, string | number | null | undefined>>;
|
|
42
|
+
title?: SignalOrValue<string>;
|
|
43
|
+
tabIndex?: SignalOrValue<number>;
|
|
44
|
+
role?: string;
|
|
45
|
+
slot?: string;
|
|
46
|
+
hidden?: SignalOrValue<boolean>;
|
|
47
|
+
dir?: 'ltr' | 'rtl' | 'auto';
|
|
48
|
+
lang?: string;
|
|
49
|
+
translate?: 'yes' | 'no';
|
|
50
|
+
draggable?: Booleanish;
|
|
51
|
+
contentEditable?: Booleanish | 'inherit';
|
|
52
|
+
spellcheck?: Booleanish;
|
|
53
|
+
autofocus?: boolean;
|
|
54
|
+
|
|
55
|
+
// ARIA attributes
|
|
56
|
+
'aria-activedescendant'?: string;
|
|
57
|
+
'aria-atomic'?: Booleanish;
|
|
58
|
+
'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both';
|
|
59
|
+
'aria-busy'?: Booleanish;
|
|
60
|
+
'aria-checked'?: Booleanish | 'mixed';
|
|
61
|
+
'aria-colcount'?: number;
|
|
62
|
+
'aria-colindex'?: number;
|
|
63
|
+
'aria-colspan'?: number;
|
|
64
|
+
'aria-controls'?: string;
|
|
65
|
+
'aria-current'?: Booleanish | 'page' | 'step' | 'location' | 'date' | 'time';
|
|
66
|
+
'aria-describedby'?: string;
|
|
67
|
+
'aria-details'?: string;
|
|
68
|
+
'aria-disabled'?: Booleanish;
|
|
69
|
+
'aria-errormessage'?: string;
|
|
70
|
+
'aria-expanded'?: Booleanish;
|
|
71
|
+
'aria-flowto'?: string;
|
|
72
|
+
'aria-haspopup'?: Booleanish | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';
|
|
73
|
+
'aria-hidden'?: Booleanish;
|
|
74
|
+
'aria-invalid'?: Booleanish | 'grammar' | 'spelling';
|
|
75
|
+
'aria-label'?: string;
|
|
76
|
+
'aria-labelledby'?: string;
|
|
77
|
+
'aria-level'?: number;
|
|
78
|
+
'aria-live'?: 'off' | 'assertive' | 'polite';
|
|
79
|
+
'aria-modal'?: Booleanish;
|
|
80
|
+
'aria-multiline'?: Booleanish;
|
|
81
|
+
'aria-multiselectable'?: Booleanish;
|
|
82
|
+
'aria-orientation'?: 'horizontal' | 'vertical';
|
|
83
|
+
'aria-owns'?: string;
|
|
84
|
+
'aria-placeholder'?: string;
|
|
85
|
+
'aria-posinset'?: number;
|
|
86
|
+
'aria-pressed'?: Booleanish | 'mixed';
|
|
87
|
+
'aria-readonly'?: Booleanish;
|
|
88
|
+
'aria-relevant'?: 'additions' | 'all' | 'removals' | 'text' | 'additions text';
|
|
89
|
+
'aria-required'?: Booleanish;
|
|
90
|
+
'aria-roledescription'?: string;
|
|
91
|
+
'aria-rowcount'?: number;
|
|
92
|
+
'aria-rowindex'?: number;
|
|
93
|
+
'aria-rowspan'?: number;
|
|
94
|
+
'aria-selected'?: Booleanish;
|
|
95
|
+
'aria-setsize'?: number;
|
|
96
|
+
'aria-sort'?: 'none' | 'ascending' | 'descending' | 'other';
|
|
97
|
+
'aria-valuemax'?: number;
|
|
98
|
+
'aria-valuemin'?: number;
|
|
99
|
+
'aria-valuenow'?: number;
|
|
100
|
+
'aria-valuetext'?: string;
|
|
101
|
+
|
|
102
|
+
// Data attributes
|
|
103
|
+
[key: `data-${string}`]: any;
|
|
104
|
+
|
|
105
|
+
// Event handlers (What Framework style: lowercase)
|
|
106
|
+
onclick?: EventHandler<MouseEvent>;
|
|
107
|
+
ondblclick?: EventHandler<MouseEvent>;
|
|
108
|
+
onmousedown?: EventHandler<MouseEvent>;
|
|
109
|
+
onmouseup?: EventHandler<MouseEvent>;
|
|
110
|
+
onmousemove?: EventHandler<MouseEvent>;
|
|
111
|
+
onmouseenter?: EventHandler<MouseEvent>;
|
|
112
|
+
onmouseleave?: EventHandler<MouseEvent>;
|
|
113
|
+
onmouseover?: EventHandler<MouseEvent>;
|
|
114
|
+
onmouseout?: EventHandler<MouseEvent>;
|
|
115
|
+
oncontextmenu?: EventHandler<MouseEvent>;
|
|
116
|
+
|
|
117
|
+
onkeydown?: EventHandler<KeyboardEvent>;
|
|
118
|
+
onkeyup?: EventHandler<KeyboardEvent>;
|
|
119
|
+
onkeypress?: EventHandler<KeyboardEvent>;
|
|
120
|
+
|
|
121
|
+
onfocus?: EventHandler<FocusEvent>;
|
|
122
|
+
onblur?: EventHandler<FocusEvent>;
|
|
123
|
+
onfocusin?: EventHandler<FocusEvent>;
|
|
124
|
+
onfocusout?: EventHandler<FocusEvent>;
|
|
125
|
+
|
|
126
|
+
oninput?: EventHandler<InputEvent>;
|
|
127
|
+
onchange?: EventHandler<Event>;
|
|
128
|
+
onsubmit?: EventHandler<SubmitEvent>;
|
|
129
|
+
onreset?: EventHandler<Event>;
|
|
130
|
+
|
|
131
|
+
onscroll?: EventHandler<Event>;
|
|
132
|
+
onwheel?: EventHandler<WheelEvent>;
|
|
133
|
+
|
|
134
|
+
ondrag?: EventHandler<DragEvent>;
|
|
135
|
+
ondragstart?: EventHandler<DragEvent>;
|
|
136
|
+
ondragend?: EventHandler<DragEvent>;
|
|
137
|
+
ondragenter?: EventHandler<DragEvent>;
|
|
138
|
+
ondragleave?: EventHandler<DragEvent>;
|
|
139
|
+
ondragover?: EventHandler<DragEvent>;
|
|
140
|
+
ondrop?: EventHandler<DragEvent>;
|
|
141
|
+
|
|
142
|
+
ontouchstart?: EventHandler<TouchEvent>;
|
|
143
|
+
ontouchmove?: EventHandler<TouchEvent>;
|
|
144
|
+
ontouchend?: EventHandler<TouchEvent>;
|
|
145
|
+
ontouchcancel?: EventHandler<TouchEvent>;
|
|
146
|
+
|
|
147
|
+
onpointerdown?: EventHandler<PointerEvent>;
|
|
148
|
+
onpointermove?: EventHandler<PointerEvent>;
|
|
149
|
+
onpointerup?: EventHandler<PointerEvent>;
|
|
150
|
+
onpointercancel?: EventHandler<PointerEvent>;
|
|
151
|
+
onpointerenter?: EventHandler<PointerEvent>;
|
|
152
|
+
onpointerleave?: EventHandler<PointerEvent>;
|
|
153
|
+
|
|
154
|
+
onanimationstart?: EventHandler<AnimationEvent>;
|
|
155
|
+
onanimationend?: EventHandler<AnimationEvent>;
|
|
156
|
+
onanimationiteration?: EventHandler<AnimationEvent>;
|
|
157
|
+
ontransitionend?: EventHandler<TransitionEvent>;
|
|
158
|
+
|
|
159
|
+
onload?: EventHandler<Event>;
|
|
160
|
+
onerror?: EventHandler<Event>;
|
|
161
|
+
|
|
162
|
+
// React-style camelCase event handlers (also supported)
|
|
163
|
+
onClick?: EventHandler<MouseEvent>;
|
|
164
|
+
onDblClick?: EventHandler<MouseEvent>;
|
|
165
|
+
onMouseDown?: EventHandler<MouseEvent>;
|
|
166
|
+
onMouseUp?: EventHandler<MouseEvent>;
|
|
167
|
+
onMouseMove?: EventHandler<MouseEvent>;
|
|
168
|
+
onMouseEnter?: EventHandler<MouseEvent>;
|
|
169
|
+
onMouseLeave?: EventHandler<MouseEvent>;
|
|
170
|
+
onKeyDown?: EventHandler<KeyboardEvent>;
|
|
171
|
+
onKeyUp?: EventHandler<KeyboardEvent>;
|
|
172
|
+
onFocus?: EventHandler<FocusEvent>;
|
|
173
|
+
onBlur?: EventHandler<FocusEvent>;
|
|
174
|
+
onInput?: EventHandler<InputEvent>;
|
|
175
|
+
onChange?: EventHandler<Event>;
|
|
176
|
+
onSubmit?: EventHandler<SubmitEvent>;
|
|
177
|
+
onScroll?: EventHandler<Event>;
|
|
178
|
+
|
|
179
|
+
// Ref
|
|
180
|
+
ref?: ((el: T) => void) | { current: T | null };
|
|
181
|
+
|
|
182
|
+
// What Framework internals
|
|
183
|
+
dangerouslySetInnerHTML?: { __html: string };
|
|
184
|
+
innerHTML?: { __html: string };
|
|
185
|
+
|
|
186
|
+
// Children
|
|
187
|
+
children?: VNodeChild;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// Specific HTML element attributes
|
|
191
|
+
interface AnchorHTMLAttributes extends HTMLAttributes<HTMLAnchorElement> {
|
|
192
|
+
href?: string;
|
|
193
|
+
target?: '_blank' | '_self' | '_parent' | '_top' | string;
|
|
194
|
+
rel?: string;
|
|
195
|
+
download?: string | boolean;
|
|
196
|
+
type?: string;
|
|
197
|
+
hreflang?: string;
|
|
198
|
+
ping?: string;
|
|
199
|
+
referrerpolicy?: string;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
interface ButtonHTMLAttributes extends HTMLAttributes<HTMLButtonElement> {
|
|
203
|
+
type?: 'button' | 'submit' | 'reset';
|
|
204
|
+
disabled?: boolean;
|
|
205
|
+
form?: string;
|
|
206
|
+
formaction?: string;
|
|
207
|
+
name?: string;
|
|
208
|
+
value?: string | number;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
interface FormHTMLAttributes extends HTMLAttributes<HTMLFormElement> {
|
|
212
|
+
action?: string;
|
|
213
|
+
method?: 'get' | 'post' | 'dialog';
|
|
214
|
+
enctype?: string;
|
|
215
|
+
target?: string;
|
|
216
|
+
novalidate?: boolean;
|
|
217
|
+
autocomplete?: 'on' | 'off';
|
|
218
|
+
name?: string;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
interface ImgHTMLAttributes extends HTMLAttributes<HTMLImageElement> {
|
|
222
|
+
src?: string;
|
|
223
|
+
alt?: string;
|
|
224
|
+
width?: number | string;
|
|
225
|
+
height?: number | string;
|
|
226
|
+
loading?: 'lazy' | 'eager';
|
|
227
|
+
decoding?: 'async' | 'auto' | 'sync';
|
|
228
|
+
srcset?: string;
|
|
229
|
+
sizes?: string;
|
|
230
|
+
crossorigin?: '' | 'anonymous' | 'use-credentials';
|
|
231
|
+
fetchpriority?: 'high' | 'low' | 'auto';
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
interface InputHTMLAttributes extends HTMLAttributes<HTMLInputElement> {
|
|
235
|
+
type?: string;
|
|
236
|
+
value?: SignalOrValue<string | number>;
|
|
237
|
+
checked?: SignalOrValue<boolean>;
|
|
238
|
+
disabled?: boolean;
|
|
239
|
+
placeholder?: string;
|
|
240
|
+
name?: string;
|
|
241
|
+
required?: boolean;
|
|
242
|
+
readonly?: boolean;
|
|
243
|
+
min?: number | string;
|
|
244
|
+
max?: number | string;
|
|
245
|
+
step?: number | string;
|
|
246
|
+
pattern?: string;
|
|
247
|
+
minlength?: number;
|
|
248
|
+
maxlength?: number;
|
|
249
|
+
autocomplete?: string;
|
|
250
|
+
autofocus?: boolean;
|
|
251
|
+
form?: string;
|
|
252
|
+
list?: string;
|
|
253
|
+
multiple?: boolean;
|
|
254
|
+
accept?: string;
|
|
255
|
+
capture?: 'user' | 'environment';
|
|
256
|
+
size?: number;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
interface LabelHTMLAttributes extends HTMLAttributes<HTMLLabelElement> {
|
|
260
|
+
for?: string;
|
|
261
|
+
htmlFor?: string;
|
|
262
|
+
form?: string;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
interface SelectHTMLAttributes extends HTMLAttributes<HTMLSelectElement> {
|
|
266
|
+
value?: SignalOrValue<string | number>;
|
|
267
|
+
disabled?: boolean;
|
|
268
|
+
name?: string;
|
|
269
|
+
required?: boolean;
|
|
270
|
+
multiple?: boolean;
|
|
271
|
+
size?: number;
|
|
272
|
+
form?: string;
|
|
273
|
+
autocomplete?: string;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
interface TextareaHTMLAttributes extends HTMLAttributes<HTMLTextAreaElement> {
|
|
277
|
+
value?: SignalOrValue<string>;
|
|
278
|
+
disabled?: boolean;
|
|
279
|
+
placeholder?: string;
|
|
280
|
+
name?: string;
|
|
281
|
+
required?: boolean;
|
|
282
|
+
readonly?: boolean;
|
|
283
|
+
rows?: number;
|
|
284
|
+
cols?: number;
|
|
285
|
+
minlength?: number;
|
|
286
|
+
maxlength?: number;
|
|
287
|
+
autocomplete?: string;
|
|
288
|
+
form?: string;
|
|
289
|
+
wrap?: 'hard' | 'soft' | 'off';
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
interface OptionHTMLAttributes extends HTMLAttributes<HTMLOptionElement> {
|
|
293
|
+
value?: string | number;
|
|
294
|
+
disabled?: boolean;
|
|
295
|
+
selected?: boolean;
|
|
296
|
+
label?: string;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
interface TableHTMLAttributes extends HTMLAttributes<HTMLTableElement> {
|
|
300
|
+
cellpadding?: number | string;
|
|
301
|
+
cellspacing?: number | string;
|
|
302
|
+
summary?: string;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
interface TdHTMLAttributes extends HTMLAttributes<HTMLTableCellElement> {
|
|
306
|
+
colspan?: number;
|
|
307
|
+
rowspan?: number;
|
|
308
|
+
headers?: string;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
interface ThHTMLAttributes extends HTMLAttributes<HTMLTableCellElement> {
|
|
312
|
+
colspan?: number;
|
|
313
|
+
rowspan?: number;
|
|
314
|
+
scope?: 'col' | 'row' | 'colgroup' | 'rowgroup';
|
|
315
|
+
headers?: string;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
interface VideoHTMLAttributes extends HTMLAttributes<HTMLVideoElement> {
|
|
319
|
+
src?: string;
|
|
320
|
+
poster?: string;
|
|
321
|
+
width?: number | string;
|
|
322
|
+
height?: number | string;
|
|
323
|
+
autoplay?: boolean;
|
|
324
|
+
controls?: boolean;
|
|
325
|
+
loop?: boolean;
|
|
326
|
+
muted?: boolean;
|
|
327
|
+
preload?: 'none' | 'metadata' | 'auto';
|
|
328
|
+
playsinline?: boolean;
|
|
329
|
+
crossorigin?: '' | 'anonymous' | 'use-credentials';
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
interface AudioHTMLAttributes extends HTMLAttributes<HTMLAudioElement> {
|
|
333
|
+
src?: string;
|
|
334
|
+
autoplay?: boolean;
|
|
335
|
+
controls?: boolean;
|
|
336
|
+
loop?: boolean;
|
|
337
|
+
muted?: boolean;
|
|
338
|
+
preload?: 'none' | 'metadata' | 'auto';
|
|
339
|
+
crossorigin?: '' | 'anonymous' | 'use-credentials';
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
interface SourceHTMLAttributes extends HTMLAttributes<HTMLSourceElement> {
|
|
343
|
+
src?: string;
|
|
344
|
+
type?: string;
|
|
345
|
+
srcset?: string;
|
|
346
|
+
sizes?: string;
|
|
347
|
+
media?: string;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
interface CanvasHTMLAttributes extends HTMLAttributes<HTMLCanvasElement> {
|
|
351
|
+
width?: number | string;
|
|
352
|
+
height?: number | string;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
interface IframeHTMLAttributes extends HTMLAttributes<HTMLIFrameElement> {
|
|
356
|
+
src?: string;
|
|
357
|
+
srcdoc?: string;
|
|
358
|
+
name?: string;
|
|
359
|
+
width?: number | string;
|
|
360
|
+
height?: number | string;
|
|
361
|
+
allow?: string;
|
|
362
|
+
allowfullscreen?: boolean;
|
|
363
|
+
loading?: 'lazy' | 'eager';
|
|
364
|
+
sandbox?: string;
|
|
365
|
+
referrerpolicy?: string;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
interface MetaHTMLAttributes extends HTMLAttributes<HTMLMetaElement> {
|
|
369
|
+
charset?: string;
|
|
370
|
+
content?: string;
|
|
371
|
+
'http-equiv'?: string;
|
|
372
|
+
name?: string;
|
|
373
|
+
property?: string;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
interface LinkHTMLAttributes extends HTMLAttributes<HTMLLinkElement> {
|
|
377
|
+
href?: string;
|
|
378
|
+
rel?: string;
|
|
379
|
+
type?: string;
|
|
380
|
+
media?: string;
|
|
381
|
+
sizes?: string;
|
|
382
|
+
as?: string;
|
|
383
|
+
crossorigin?: '' | 'anonymous' | 'use-credentials';
|
|
384
|
+
integrity?: string;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
interface ScriptHTMLAttributes extends HTMLAttributes<HTMLScriptElement> {
|
|
388
|
+
src?: string;
|
|
389
|
+
type?: string;
|
|
390
|
+
async?: boolean;
|
|
391
|
+
defer?: boolean;
|
|
392
|
+
crossorigin?: '' | 'anonymous' | 'use-credentials';
|
|
393
|
+
integrity?: string;
|
|
394
|
+
nomodule?: boolean;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
interface DialogHTMLAttributes extends HTMLAttributes<HTMLDialogElement> {
|
|
398
|
+
open?: boolean;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
interface DetailsHTMLAttributes extends HTMLAttributes<HTMLDetailsElement> {
|
|
402
|
+
open?: boolean;
|
|
403
|
+
ontoggle?: EventHandler<Event>;
|
|
404
|
+
onToggle?: EventHandler<Event>;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
// SVG attributes
|
|
408
|
+
interface SVGAttributes extends HTMLAttributes<SVGElement> {
|
|
409
|
+
viewBox?: string;
|
|
410
|
+
xmlns?: string;
|
|
411
|
+
fill?: string;
|
|
412
|
+
stroke?: string;
|
|
413
|
+
'stroke-width'?: number | string;
|
|
414
|
+
'stroke-linecap'?: 'butt' | 'round' | 'square';
|
|
415
|
+
'stroke-linejoin'?: 'miter' | 'round' | 'bevel';
|
|
416
|
+
'stroke-dasharray'?: string;
|
|
417
|
+
'stroke-dashoffset'?: number | string;
|
|
418
|
+
opacity?: number | string;
|
|
419
|
+
transform?: string;
|
|
420
|
+
d?: string;
|
|
421
|
+
cx?: number | string;
|
|
422
|
+
cy?: number | string;
|
|
423
|
+
r?: number | string;
|
|
424
|
+
rx?: number | string;
|
|
425
|
+
ry?: number | string;
|
|
426
|
+
x?: number | string;
|
|
427
|
+
y?: number | string;
|
|
428
|
+
x1?: number | string;
|
|
429
|
+
y1?: number | string;
|
|
430
|
+
x2?: number | string;
|
|
431
|
+
y2?: number | string;
|
|
432
|
+
width?: number | string;
|
|
433
|
+
height?: number | string;
|
|
434
|
+
points?: string;
|
|
435
|
+
'clip-path'?: string;
|
|
436
|
+
'clip-rule'?: 'nonzero' | 'evenodd';
|
|
437
|
+
'fill-rule'?: 'nonzero' | 'evenodd';
|
|
438
|
+
'fill-opacity'?: number | string;
|
|
439
|
+
'stroke-opacity'?: number | string;
|
|
440
|
+
'text-anchor'?: 'start' | 'middle' | 'end';
|
|
441
|
+
'dominant-baseline'?: string;
|
|
442
|
+
'font-size'?: number | string;
|
|
443
|
+
'font-family'?: string;
|
|
444
|
+
'font-weight'?: number | string;
|
|
445
|
+
href?: string;
|
|
446
|
+
preserveAspectRatio?: string;
|
|
447
|
+
[key: string]: any;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
// Intrinsic elements map
|
|
451
|
+
interface IntrinsicElements {
|
|
452
|
+
// Document structure
|
|
453
|
+
html: HTMLAttributes<HTMLHtmlElement>;
|
|
454
|
+
head: HTMLAttributes<HTMLHeadElement>;
|
|
455
|
+
body: HTMLAttributes<HTMLBodyElement>;
|
|
456
|
+
title: HTMLAttributes<HTMLTitleElement>;
|
|
457
|
+
base: HTMLAttributes<HTMLBaseElement>;
|
|
458
|
+
meta: MetaHTMLAttributes;
|
|
459
|
+
link: LinkHTMLAttributes;
|
|
460
|
+
style: HTMLAttributes<HTMLStyleElement> & { type?: string; media?: string };
|
|
461
|
+
script: ScriptHTMLAttributes;
|
|
462
|
+
noscript: HTMLAttributes;
|
|
463
|
+
|
|
464
|
+
// Sections
|
|
465
|
+
div: HTMLAttributes<HTMLDivElement>;
|
|
466
|
+
span: HTMLAttributes<HTMLSpanElement>;
|
|
467
|
+
section: HTMLAttributes;
|
|
468
|
+
article: HTMLAttributes;
|
|
469
|
+
aside: HTMLAttributes;
|
|
470
|
+
header: HTMLAttributes;
|
|
471
|
+
footer: HTMLAttributes;
|
|
472
|
+
main: HTMLAttributes;
|
|
473
|
+
nav: HTMLAttributes;
|
|
474
|
+
address: HTMLAttributes;
|
|
475
|
+
hgroup: HTMLAttributes;
|
|
476
|
+
search: HTMLAttributes;
|
|
477
|
+
|
|
478
|
+
// Headings
|
|
479
|
+
h1: HTMLAttributes<HTMLHeadingElement>;
|
|
480
|
+
h2: HTMLAttributes<HTMLHeadingElement>;
|
|
481
|
+
h3: HTMLAttributes<HTMLHeadingElement>;
|
|
482
|
+
h4: HTMLAttributes<HTMLHeadingElement>;
|
|
483
|
+
h5: HTMLAttributes<HTMLHeadingElement>;
|
|
484
|
+
h6: HTMLAttributes<HTMLHeadingElement>;
|
|
485
|
+
|
|
486
|
+
// Text content
|
|
487
|
+
p: HTMLAttributes<HTMLParagraphElement>;
|
|
488
|
+
pre: HTMLAttributes<HTMLPreElement>;
|
|
489
|
+
blockquote: HTMLAttributes<HTMLQuoteElement> & { cite?: string };
|
|
490
|
+
hr: HTMLAttributes<HTMLHRElement>;
|
|
491
|
+
br: HTMLAttributes<HTMLBRElement>;
|
|
492
|
+
|
|
493
|
+
// Inline text
|
|
494
|
+
a: AnchorHTMLAttributes;
|
|
495
|
+
strong: HTMLAttributes;
|
|
496
|
+
em: HTMLAttributes;
|
|
497
|
+
b: HTMLAttributes;
|
|
498
|
+
i: HTMLAttributes;
|
|
499
|
+
u: HTMLAttributes;
|
|
500
|
+
s: HTMLAttributes;
|
|
501
|
+
small: HTMLAttributes;
|
|
502
|
+
sub: HTMLAttributes;
|
|
503
|
+
sup: HTMLAttributes;
|
|
504
|
+
mark: HTMLAttributes;
|
|
505
|
+
del: HTMLAttributes;
|
|
506
|
+
ins: HTMLAttributes;
|
|
507
|
+
code: HTMLAttributes;
|
|
508
|
+
kbd: HTMLAttributes;
|
|
509
|
+
var: HTMLAttributes;
|
|
510
|
+
samp: HTMLAttributes;
|
|
511
|
+
q: HTMLAttributes<HTMLQuoteElement> & { cite?: string };
|
|
512
|
+
cite: HTMLAttributes;
|
|
513
|
+
abbr: HTMLAttributes;
|
|
514
|
+
time: HTMLAttributes<HTMLTimeElement> & { datetime?: string };
|
|
515
|
+
dfn: HTMLAttributes;
|
|
516
|
+
ruby: HTMLAttributes;
|
|
517
|
+
rt: HTMLAttributes;
|
|
518
|
+
rp: HTMLAttributes;
|
|
519
|
+
wbr: HTMLAttributes;
|
|
520
|
+
bdi: HTMLAttributes;
|
|
521
|
+
bdo: HTMLAttributes & { dir?: 'ltr' | 'rtl' };
|
|
522
|
+
|
|
523
|
+
// Lists
|
|
524
|
+
ul: HTMLAttributes<HTMLUListElement>;
|
|
525
|
+
ol: HTMLAttributes<HTMLOListElement> & { start?: number; reversed?: boolean; type?: '1' | 'a' | 'A' | 'i' | 'I' };
|
|
526
|
+
li: HTMLAttributes<HTMLLIElement> & { value?: number };
|
|
527
|
+
dl: HTMLAttributes<HTMLDListElement>;
|
|
528
|
+
dt: HTMLAttributes;
|
|
529
|
+
dd: HTMLAttributes;
|
|
530
|
+
menu: HTMLAttributes<HTMLMenuElement>;
|
|
531
|
+
|
|
532
|
+
// Tables
|
|
533
|
+
table: TableHTMLAttributes;
|
|
534
|
+
caption: HTMLAttributes<HTMLTableCaptionElement>;
|
|
535
|
+
thead: HTMLAttributes<HTMLTableSectionElement>;
|
|
536
|
+
tbody: HTMLAttributes<HTMLTableSectionElement>;
|
|
537
|
+
tfoot: HTMLAttributes<HTMLTableSectionElement>;
|
|
538
|
+
tr: HTMLAttributes<HTMLTableRowElement>;
|
|
539
|
+
td: TdHTMLAttributes;
|
|
540
|
+
th: ThHTMLAttributes;
|
|
541
|
+
colgroup: HTMLAttributes<HTMLTableColElement> & { span?: number };
|
|
542
|
+
col: HTMLAttributes<HTMLTableColElement> & { span?: number };
|
|
543
|
+
|
|
544
|
+
// Forms
|
|
545
|
+
form: FormHTMLAttributes;
|
|
546
|
+
input: InputHTMLAttributes;
|
|
547
|
+
button: ButtonHTMLAttributes;
|
|
548
|
+
select: SelectHTMLAttributes;
|
|
549
|
+
textarea: TextareaHTMLAttributes;
|
|
550
|
+
label: LabelHTMLAttributes;
|
|
551
|
+
fieldset: HTMLAttributes<HTMLFieldSetElement> & { disabled?: boolean; form?: string; name?: string };
|
|
552
|
+
legend: HTMLAttributes<HTMLLegendElement>;
|
|
553
|
+
option: OptionHTMLAttributes;
|
|
554
|
+
optgroup: HTMLAttributes<HTMLOptGroupElement> & { disabled?: boolean; label?: string };
|
|
555
|
+
datalist: HTMLAttributes<HTMLDataListElement>;
|
|
556
|
+
output: HTMLAttributes<HTMLOutputElement> & { for?: string; form?: string; name?: string };
|
|
557
|
+
progress: HTMLAttributes<HTMLProgressElement> & { max?: number; value?: number };
|
|
558
|
+
meter: HTMLAttributes<HTMLMeterElement> & { min?: number; max?: number; low?: number; high?: number; optimum?: number; value?: number };
|
|
559
|
+
|
|
560
|
+
// Media
|
|
561
|
+
img: ImgHTMLAttributes;
|
|
562
|
+
video: VideoHTMLAttributes;
|
|
563
|
+
audio: AudioHTMLAttributes;
|
|
564
|
+
source: SourceHTMLAttributes;
|
|
565
|
+
track: HTMLAttributes<HTMLTrackElement> & { default?: boolean; kind?: string; label?: string; src?: string; srclang?: string };
|
|
566
|
+
picture: HTMLAttributes;
|
|
567
|
+
figure: HTMLAttributes;
|
|
568
|
+
figcaption: HTMLAttributes;
|
|
569
|
+
|
|
570
|
+
// Embedded content
|
|
571
|
+
iframe: IframeHTMLAttributes;
|
|
572
|
+
canvas: CanvasHTMLAttributes;
|
|
573
|
+
embed: HTMLAttributes<HTMLEmbedElement> & { src?: string; type?: string; width?: number | string; height?: number | string };
|
|
574
|
+
object: HTMLAttributes<HTMLObjectElement> & { data?: string; type?: string; width?: number | string; height?: number | string; name?: string; form?: string };
|
|
575
|
+
param: HTMLAttributes<HTMLParamElement> & { name?: string; value?: string };
|
|
576
|
+
|
|
577
|
+
// Interactive
|
|
578
|
+
details: DetailsHTMLAttributes;
|
|
579
|
+
summary: HTMLAttributes;
|
|
580
|
+
dialog: DialogHTMLAttributes;
|
|
581
|
+
|
|
582
|
+
// Template & Slots
|
|
583
|
+
template: HTMLAttributes<HTMLTemplateElement>;
|
|
584
|
+
|
|
585
|
+
// SVG elements
|
|
586
|
+
svg: SVGAttributes;
|
|
587
|
+
path: SVGAttributes;
|
|
588
|
+
circle: SVGAttributes;
|
|
589
|
+
rect: SVGAttributes;
|
|
590
|
+
line: SVGAttributes;
|
|
591
|
+
polyline: SVGAttributes;
|
|
592
|
+
polygon: SVGAttributes;
|
|
593
|
+
ellipse: SVGAttributes;
|
|
594
|
+
g: SVGAttributes;
|
|
595
|
+
defs: SVGAttributes;
|
|
596
|
+
use: SVGAttributes;
|
|
597
|
+
symbol: SVGAttributes;
|
|
598
|
+
clipPath: SVGAttributes;
|
|
599
|
+
mask: SVGAttributes;
|
|
600
|
+
pattern: SVGAttributes;
|
|
601
|
+
linearGradient: SVGAttributes;
|
|
602
|
+
radialGradient: SVGAttributes;
|
|
603
|
+
stop: SVGAttributes & { offset?: number | string; 'stop-color'?: string; 'stop-opacity'?: number | string };
|
|
604
|
+
text: SVGAttributes;
|
|
605
|
+
tspan: SVGAttributes;
|
|
606
|
+
foreignObject: SVGAttributes;
|
|
607
|
+
marker: SVGAttributes;
|
|
608
|
+
image: SVGAttributes;
|
|
609
|
+
animate: SVGAttributes;
|
|
610
|
+
animateTransform: SVGAttributes;
|
|
611
|
+
animateMotion: SVGAttributes;
|
|
612
|
+
filter: SVGAttributes;
|
|
613
|
+
feGaussianBlur: SVGAttributes;
|
|
614
|
+
feOffset: SVGAttributes;
|
|
615
|
+
feMerge: SVGAttributes;
|
|
616
|
+
feMergeNode: SVGAttributes;
|
|
617
|
+
feBlend: SVGAttributes;
|
|
618
|
+
feColorMatrix: SVGAttributes;
|
|
619
|
+
feComposite: SVGAttributes;
|
|
620
|
+
feFlood: SVGAttributes;
|
|
621
|
+
}
|
|
622
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "what-core",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"description": "What Framework - The closest framework to vanilla JS",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -13,10 +13,12 @@
|
|
|
13
13
|
"import": "./src/index.js"
|
|
14
14
|
},
|
|
15
15
|
"./jsx-runtime": {
|
|
16
|
+
"types": "./jsx-runtime.d.ts",
|
|
16
17
|
"production": "./dist/jsx-runtime.min.js",
|
|
17
18
|
"import": "./src/jsx-runtime.js"
|
|
18
19
|
},
|
|
19
20
|
"./jsx-dev-runtime": {
|
|
21
|
+
"types": "./jsx-runtime.d.ts",
|
|
20
22
|
"production": "./dist/jsx-dev-runtime.min.js",
|
|
21
23
|
"import": "./src/jsx-dev-runtime.js"
|
|
22
24
|
},
|
|
@@ -29,14 +31,30 @@
|
|
|
29
31
|
"types": "./testing.d.ts",
|
|
30
32
|
"production": "./dist/testing.min.js",
|
|
31
33
|
"import": "./src/testing.js"
|
|
34
|
+
},
|
|
35
|
+
"./hooks": {
|
|
36
|
+
"import": "./src/hooks.js"
|
|
37
|
+
},
|
|
38
|
+
"./compiler": {
|
|
39
|
+
"types": "./compiler.d.ts",
|
|
40
|
+
"production": "./dist/compiler.min.js",
|
|
41
|
+
"import": "./src/compiler.js"
|
|
42
|
+
},
|
|
43
|
+
"./devtools": {
|
|
44
|
+
"types": "./devtools.d.ts",
|
|
45
|
+
"production": "./dist/devtools.min.js",
|
|
46
|
+
"import": "./src/devtools.js"
|
|
32
47
|
}
|
|
33
48
|
},
|
|
34
49
|
"files": [
|
|
35
50
|
"src",
|
|
36
51
|
"dist",
|
|
37
52
|
"index.d.ts",
|
|
53
|
+
"jsx-runtime.d.ts",
|
|
38
54
|
"render.d.ts",
|
|
39
|
-
"testing.d.ts"
|
|
55
|
+
"testing.d.ts",
|
|
56
|
+
"compiler.d.ts",
|
|
57
|
+
"devtools.d.ts"
|
|
40
58
|
],
|
|
41
59
|
"sideEffects": false,
|
|
42
60
|
"keywords": [
|
package/src/agent-context.js
CHANGED
|
@@ -7,7 +7,7 @@ import { getCollectedErrors } from './errors.js';
|
|
|
7
7
|
|
|
8
8
|
// --- Version ---
|
|
9
9
|
// Read from package.json at build time; fallback to runtime constant.
|
|
10
|
-
const VERSION = '0.6.
|
|
10
|
+
const VERSION = '0.6.3';
|
|
11
11
|
|
|
12
12
|
// --- Component Registry ---
|
|
13
13
|
// Tracks mounted components for agent inspection.
|
package/src/compiler.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// What Framework - Compiler Runtime Internals
|
|
2
|
+
// Stable import target for generated compiler output. Not for app code.
|
|
3
|
+
|
|
4
|
+
export {
|
|
5
|
+
_$createComponent,
|
|
6
|
+
_$template,
|
|
7
|
+
_template,
|
|
8
|
+
template,
|
|
9
|
+
insert,
|
|
10
|
+
mapArray,
|
|
11
|
+
spread,
|
|
12
|
+
setProp,
|
|
13
|
+
delegateEvents,
|
|
14
|
+
on,
|
|
15
|
+
classList,
|
|
16
|
+
effect,
|
|
17
|
+
untrack,
|
|
18
|
+
} from './render.js';
|