revojs 0.0.87 → 0.1.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.
@@ -1,110 +0,0 @@
1
- import { type Mergeable } from "../app";
2
- import { type HtmlAttributes } from "../jsx";
3
- import { Scope, type State, type Value } from "../signals";
4
- export type TypeOf<T> = {
5
- (): T;
6
- };
7
- export type Infer<T> = T extends TypeOf<infer U> ? U : unknown;
8
- export type Slot = unknown | Template | Array<Slot> | (() => Slot);
9
- export type Hydration = Comment | Text | Element | Array<Hydration>;
10
- export type EventListener<T extends Event> = ((event: T) => void) | Array<(event: T) => void>;
11
- export type HostContext = {
12
- host?: CustomElement<Events, Attributes>;
13
- internals?: ElementInternals;
14
- };
15
- export type Template = {
16
- tag: string;
17
- attributes: Record<string, unknown>;
18
- children: Array<Slot>;
19
- };
20
- export type ActiveViewTransition = {
21
- name: string;
22
- update: Promise<void>;
23
- };
24
- export type EventInput<T extends Events> = {
25
- [K in keyof T]?: EventListener<Infer<T[K]["type"]> extends Event ? Infer<T[K]["type"]> : CustomEvent<Infer<T[K]["type"]>>>;
26
- };
27
- export type AttributeInput<T extends Attributes> = {
28
- [K in keyof T]?: Value<Infer<T[K]["type"]> | undefined>;
29
- };
30
- export type Input<TEvents extends Events, TAttributes extends Attributes> = EventInput<TEvents> | AttributeInput<TAttributes> | HtmlAttributes;
31
- export type EventOutput<T extends Events> = {
32
- [K in keyof T]?: (event: Infer<T[K]["type"]>) => void;
33
- };
34
- export type AttributeOutput<T extends Attributes> = {
35
- [K in keyof T]: T[K]["default"] extends undefined ? Infer<T[K]["type"]> | undefined : Infer<T[K]["type"]>;
36
- };
37
- export type EventOptions<T = unknown> = {
38
- type: T;
39
- bubbles?: boolean;
40
- cancelable?: boolean;
41
- composed?: boolean;
42
- };
43
- export type AttributeOptions<T = unknown> = {
44
- type: T;
45
- default?: Infer<T>;
46
- };
47
- export type Events = Record<string, EventOptions>;
48
- export type Attributes = Record<string, AttributeOptions>;
49
- export interface ComponentOptions<TEvents extends Events, TAttributes extends Attributes> {
50
- name: string;
51
- events?: TEvents;
52
- attributes?: TAttributes;
53
- shadowRoot?: ShadowRootInit;
54
- setup: (component: Component<TEvents, TAttributes>) => Slot;
55
- }
56
- export interface Component<TEvents extends Events, TAttributes extends Attributes> {
57
- readonly scope: Scope;
58
- readonly events: EventOutput<TEvents>;
59
- readonly attributes: State<AttributeOutput<TAttributes>>;
60
- readonly shadowRoot?: ShadowRootInit;
61
- setup: () => Slot;
62
- }
63
- export interface ComponentConstructor<TEvents extends Events, TAttributes extends Attributes> {
64
- $name: string;
65
- $events: TEvents;
66
- $attributes: TAttributes;
67
- new (input?: Input<TEvents, TAttributes>, parentScope?: Scope): Component<TEvents, TAttributes>;
68
- }
69
- export interface CustomElement<TEvents extends Events, TAttributes extends Attributes> extends HTMLElement {
70
- readonly component: Component<TEvents, TAttributes>;
71
- }
72
- export interface CustomElementConstructor<TEvents extends Events, TAttributes extends Attributes> {
73
- new (): CustomElement<TEvents, TAttributes>;
74
- }
75
- export declare class MountedEvent extends Event {
76
- constructor();
77
- }
78
- export declare function isTemplate<T>(value?: T): value is Template & T;
79
- export declare function isCustomElement<T>(value?: T): value is CustomElement<Events, Attributes> & T;
80
- export declare function isComponent<T>(value?: T): value is ComponentConstructor<Events, Attributes> & T;
81
- export declare function useHost(scope: Scope): HostContext;
82
- export declare function createElement<TEvents extends Events, TAttributes extends Attributes>(input: string | ((attributes: AttributeInput<Attributes>) => Slot) | ComponentConstructor<TEvents, TAttributes>, attributes?: AttributeInput<TAttributes>, ...children: Array<Slot>): Slot;
83
- export declare function toString(slot: Slot): string;
84
- export declare function toArray(hydration: Hydration): Array<Comment | Text | Element>;
85
- export declare function toRange(hydration: Hydration): Range;
86
- export declare function toFragment(hydration: Hydration): DocumentFragment;
87
- export declare function hydrate(scope: Scope, parentNode: Node, slot: Slot, index: number, previous?: Hydration): Hydration;
88
- export declare function renderToString(scope: Scope, slot: Slot, defaults?: Record<string, Mergeable<Template>>): Promise<string>;
89
- export declare function defineComponent<TEvents extends Events, TAttributes extends Attributes>(options: ComponentOptions<TEvents, TAttributes>): ComponentConstructor<TEvents, TAttributes>;
90
- export declare function toCustomElement<TEvents extends Events, TAttributes extends Attributes>(Component: ComponentConstructor<TEvents, TAttributes>): CustomElementConstructor<TEvents, TAttributes>;
91
- export declare function registerComponent<TEvents extends Events, TAttributes extends Attributes>(component: ComponentConstructor<TEvents, TAttributes>): ComponentConstructor<TEvents, TAttributes>;
92
- export declare function useEvent<T extends keyof ElementEventMap>(scope: Scope, target: EventTarget | undefined | null, event: T, input: EventListener<ElementEventMap[T]>, options?: AddEventListenerOptions): void;
93
- export declare function useEvent<T extends keyof WindowEventMap>(scope: Scope, target: Window | undefined | null, event: T, input: EventListener<WindowEventMap[T]>, options?: AddEventListenerOptions): void;
94
- export declare function useEvent<T extends keyof HTMLElementEventMap>(scope: Scope, target: Document | HTMLElement | undefined | null, event: T, input: EventListener<HTMLElementEventMap[T]>, options?: AddEventListenerOptions): void;
95
- export declare function onMounted(scope: Scope, event: EventListener<MountedEvent>): void;
96
- export declare function startViewTransition(name: string, invoke: ViewTransitionUpdateCallback): Promise<void>;
97
- export declare function onViewTransition<T>(name: string, value: T | ((name: string) => T)): () => T | undefined;
98
- export declare function isClient(): boolean;
99
- export declare function isServer(): boolean;
100
- export declare function preventDefault(event: Event): void;
101
- export declare function stopPropagation(event: Event): void;
102
- export declare function stopImmediatePropagation(event: Event): void;
103
- export declare const activeViewTransition: State<ActiveViewTransition | undefined>;
104
- export declare const components: Map<string, ComponentConstructor<Events, Attributes>>;
105
- export declare const HOST_CONTEXT: import("..").Descriptor<HostContext>;
106
- declare global {
107
- interface HTMLElementEventMap {
108
- mounted: MountedEvent;
109
- }
110
- }
@@ -1,36 +0,0 @@
1
- import { Scope } from "../signals";
2
- export type CookiePriority = "Low" | "Medium" | "High";
3
- export type CookieSameSite = "Lax" | "Strict" | "None";
4
- export type CookieOptions = {
5
- domain?: string;
6
- expires?: Date;
7
- httpOnly?: boolean;
8
- maxAge?: number;
9
- path?: string;
10
- priority?: CookiePriority;
11
- sameSite?: CookieSameSite;
12
- secure?: boolean;
13
- };
14
- export type HttpMethod = "GET" | "HEAD" | "PATCH" | "POST" | "PUT" | "DELETE" | "CONNECT" | "OPTIONS" | "TRACE";
15
- export type Encoding = "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex";
16
- export type StatusCode = 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 444 | 450 | 451 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 506 | 507 | 508 | 509 | 510 | 511 | 521 | 522 | 523 | 525 | 530 | 599;
17
- export type MimeType = "text/plain" | "text/css" | "text/html" | "text/csv" | "text/javascript" | "application/json" | "application/xml" | "image/jpeg" | "image/png" | "image/gif" | "image/webp" | "image/svg+xml" | "image/bmp" | "image/x-icon" | "font/ttf" | "font/otf" | "font/woff" | "font/woff2" | "audio/mpeg" | "audio/wav" | "audio/ogg" | "audio/mp4" | "video/mp4" | "video/webm" | "video/ogg" | "video/quicktime" | "video/x-msvideo" | "application/zip" | "application/vnd.rar" | "application/x-tar" | "application/gzip" | "application/x-7z-compressed" | "application/pdf" | "application/msword" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/vnd.ms-powerpoint" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "application/vnd.microsoft.portable-executable" | "application/vnd.android.package-archive";
18
- export type ResponseOptions = {
19
- status?: StatusCode;
20
- message?: string;
21
- headers: Headers;
22
- };
23
- export type Handle = (scope: Scope) => void | Response | Promise<void | Response>;
24
- export type Chain = (scope: Scope, next: Handle) => void | Response | Promise<void | Response>;
25
- export declare function sendText(scope: Scope, text: string): Response;
26
- export declare function sendHtml(scope: Scope, text: string): Response;
27
- export declare function sendJson<T>(scope: Scope, value: T): Response;
28
- export declare function sendRedirect(scope: Scope, path: string): Response;
29
- export declare function sendBadRequest(scope: Scope, text: string): Response;
30
- export declare function sendUnauthorized(scope: Scope): Response;
31
- export declare function useUrl(scope: Scope, base?: string): URL;
32
- export declare function useQuery(scope: Scope): Record<string, string>;
33
- export declare function useCookies(scope: Scope): Record<string, string>;
34
- export declare function useSetCookies(scope: Scope): Record<string, string>;
35
- export declare function setCookie(scope: Scope, name: string, value: string, options?: CookieOptions): void;
36
- export declare function mimeType(file: string): MimeType;
@@ -1,371 +0,0 @@
1
- import { createElement, type EventListener, type Slot } from "../html";
2
- export type Fragment = {
3
- children: Array<Slot>;
4
- };
5
- export type EventAttributes = {
6
- onScroll?: EventListener<Event>;
7
- onScrollCapture?: EventListener<Event>;
8
- onScrollEnd?: EventListener<Event>;
9
- onScrollEndCapture?: EventListener<Event>;
10
- onWheel?: EventListener<WheelEvent>;
11
- onWheelCapture?: EventListener<WheelEvent>;
12
- onAnimationCancel?: EventListener<AnimationEvent>;
13
- onAnimationCancelCapture?: EventListener<AnimationEvent>;
14
- onAnimationEnd?: EventListener<AnimationEvent>;
15
- onAnimationEndCapture?: EventListener<AnimationEvent>;
16
- onAnimationIteration?: EventListener<AnimationEvent>;
17
- onAnimationIterationCapture?: EventListener<AnimationEvent>;
18
- onAnimationStart?: EventListener<AnimationEvent>;
19
- onAnimationStartCapture?: EventListener<AnimationEvent>;
20
- onCopy?: EventListener<ClipboardEvent>;
21
- onCopyCapture?: EventListener<ClipboardEvent>;
22
- onCut?: EventListener<ClipboardEvent>;
23
- onCutCapture?: EventListener<ClipboardEvent>;
24
- onPaste?: EventListener<ClipboardEvent>;
25
- onPasteCapture?: EventListener<ClipboardEvent>;
26
- onCompositionEnd?: EventListener<CompositionEvent>;
27
- onCompositionEndCapture?: EventListener<CompositionEvent>;
28
- onCompositionStart?: EventListener<CompositionEvent>;
29
- onCompositionStartCapture?: EventListener<CompositionEvent>;
30
- onCompositionUpdate?: EventListener<CompositionEvent>;
31
- onCompositionUpdateCapture?: EventListener<CompositionEvent>;
32
- onBlur?: EventListener<FocusEvent>;
33
- onBlurCapture?: EventListener<FocusEvent>;
34
- onFocus?: EventListener<FocusEvent>;
35
- onFocusCapture?: EventListener<FocusEvent>;
36
- onFocusIn?: EventListener<FocusEvent>;
37
- onFocusInCapture?: EventListener<FocusEvent>;
38
- onFocusOut?: EventListener<FocusEvent>;
39
- onFocusOutCapture?: EventListener<FocusEvent>;
40
- onFullscreenChange?: EventListener<Event>;
41
- onFullscreenChangeCapture?: EventListener<Event>;
42
- onFullscreenError?: EventListener<Event>;
43
- onFullscreenErrorCapture?: EventListener<Event>;
44
- onKeyDown?: EventListener<KeyboardEvent>;
45
- onKeyDownCapture?: EventListener<KeyboardEvent>;
46
- onKeyPress?: EventListener<KeyboardEvent>;
47
- onKeyPressCapture?: EventListener<KeyboardEvent>;
48
- onKeyUp?: EventListener<KeyboardEvent>;
49
- onKeyUpCapture?: EventListener<KeyboardEvent>;
50
- onAuxClick?: EventListener<MouseEvent>;
51
- onAuxClickCapture?: EventListener<MouseEvent>;
52
- onClick?: EventListener<MouseEvent>;
53
- onClickCapture?: EventListener<MouseEvent>;
54
- onContextMenu?: EventListener<MouseEvent>;
55
- onContextMenuCapture?: EventListener<MouseEvent>;
56
- onDoubleClick?: EventListener<MouseEvent>;
57
- onDoubleClickCapture?: EventListener<MouseEvent>;
58
- onMouseDown?: EventListener<MouseEvent>;
59
- onMouseDownCapture?: EventListener<MouseEvent>;
60
- onMouseEnter?: EventListener<MouseEvent>;
61
- onMouseEnterCapture?: EventListener<MouseEvent>;
62
- onMouseLeave?: EventListener<MouseEvent>;
63
- onMouseLeaveCapture?: EventListener<MouseEvent>;
64
- onMouseMove?: EventListener<MouseEvent>;
65
- onMouseMoveCapture?: EventListener<MouseEvent>;
66
- onMouseOut?: EventListener<MouseEvent>;
67
- onMouseOutCapture?: EventListener<MouseEvent>;
68
- onMouseOver?: EventListener<MouseEvent>;
69
- onMouseOverCapture?: EventListener<MouseEvent>;
70
- onMouseUp?: EventListener<MouseEvent>;
71
- onMouseUpCapture?: EventListener<MouseEvent>;
72
- onMouseWheel?: EventListener<WheelEvent>;
73
- onMouseWheelCapture?: EventListener<WheelEvent>;
74
- onGotPointerCapture?: EventListener<PointerEvent>;
75
- onGotPointerCaptureCapture?: EventListener<PointerEvent>;
76
- onLostPointerCapture?: EventListener<PointerEvent>;
77
- onLostPointerCaptureCapture?: EventListener<PointerEvent>;
78
- onPointerCancel?: EventListener<PointerEvent>;
79
- onPointerCancelCapture?: EventListener<PointerEvent>;
80
- onPointerDown?: EventListener<PointerEvent>;
81
- onPointerDownCapture?: EventListener<PointerEvent>;
82
- onPointerEnter?: EventListener<PointerEvent>;
83
- onPointerEnterCapture?: EventListener<PointerEvent>;
84
- onPointerLeave?: EventListener<PointerEvent>;
85
- onPointerLeaveCapture?: EventListener<PointerEvent>;
86
- onPointerMove?: EventListener<PointerEvent>;
87
- onPointerMoveCapture?: EventListener<PointerEvent>;
88
- onPointerOut?: EventListener<PointerEvent>;
89
- onPointerOutCapture?: EventListener<PointerEvent>;
90
- onPointerOver?: EventListener<PointerEvent>;
91
- onPointerOverCapture?: EventListener<PointerEvent>;
92
- onPointerUp?: EventListener<PointerEvent>;
93
- onPointerUpCapture?: EventListener<PointerEvent>;
94
- onTouchCancel?: EventListener<TouchEvent>;
95
- onTouchCancelCapture?: EventListener<TouchEvent>;
96
- onTouchEnd?: EventListener<TouchEvent>;
97
- onTouchEndCapture?: EventListener<TouchEvent>;
98
- onTouchMove?: EventListener<TouchEvent>;
99
- onTouchMoveCapture?: EventListener<TouchEvent>;
100
- onTouchStart?: EventListener<TouchEvent>;
101
- onTouchStartCapture?: EventListener<TouchEvent>;
102
- onTransitionCancel?: EventListener<TransitionEvent>;
103
- onTransitionCancelCapture?: EventListener<TransitionEvent>;
104
- onTransitionEnd?: EventListener<TransitionEvent>;
105
- onTransitionEndCapture?: EventListener<TransitionEvent>;
106
- onTransitionRun?: EventListener<TransitionEvent>;
107
- onTransitionRunCapture?: EventListener<TransitionEvent>;
108
- onTransitionStart?: EventListener<TransitionEvent>;
109
- onTransitionStartCapture?: EventListener<TransitionEvent>;
110
- onFormData?: EventListener<FormDataEvent>;
111
- onFormDataCapture?: EventListener<FormDataEvent>;
112
- onReset?: EventListener<Event>;
113
- onResetCapture?: EventListener<Event>;
114
- onSubmit?: EventListener<Event>;
115
- onSubmitCapture?: EventListener<Event>;
116
- onInvalid?: EventListener<Event>;
117
- onInvalidCapture?: EventListener<Event>;
118
- onSelect?: EventListener<Event>;
119
- onSelectCapture?: EventListener<Event>;
120
- onSelectChange?: EventListener<Event>;
121
- onSelectChangeCapture?: EventListener<Event>;
122
- onInput?: EventListener<InputEvent>;
123
- onInputCapture?: EventListener<InputEvent>;
124
- onBeforeInput?: EventListener<InputEvent>;
125
- onBeforeInputCapture?: EventListener<InputEvent>;
126
- onChange?: EventListener<Event>;
127
- onChangeCapture?: EventListener<Event>;
128
- };
129
- export type HtmlTags = Record<string, HtmlAttributes & EventAttributes>;
130
- export type HtmlAttributes = Record<string, unknown>;
131
- export type HtmlAnchorAttributes = HtmlAttributes & EventAttributes;
132
- export type HtmlAbbrAttributes = HtmlAttributes & EventAttributes;
133
- export type HtmlAddressAttributes = HtmlAttributes & EventAttributes;
134
- export type HtmlAreaAttributes = HtmlAttributes & EventAttributes;
135
- export type HtmlArticleAttributes = HtmlAttributes & EventAttributes;
136
- export type HtmlAsideAttributes = HtmlAttributes & EventAttributes;
137
- export type HtmlAudioAttributes = HtmlAttributes & EventAttributes;
138
- export type HtmlBAttributes = HtmlAttributes & EventAttributes;
139
- export type HtmlBaseAttributes = HtmlAttributes & EventAttributes;
140
- export type HtmlBdiAttributes = HtmlAttributes & EventAttributes;
141
- export type HtmlBdoAttributes = HtmlAttributes & EventAttributes;
142
- export type HtmlBigAttributes = HtmlAttributes & EventAttributes;
143
- export type HtmlBlockquoteAttributes = HtmlAttributes & EventAttributes;
144
- export type HtmlBodyAttributes = HtmlAttributes & EventAttributes;
145
- export type HtmlBrAttributes = HtmlAttributes & EventAttributes;
146
- export type HtmlButtonAttributes = HtmlAttributes & EventAttributes;
147
- export type HtmlCanvasAttributes = HtmlAttributes & EventAttributes;
148
- export type HtmlCaptionAttributes = HtmlAttributes & EventAttributes;
149
- export type HtmlCiteAttributes = HtmlAttributes & EventAttributes;
150
- export type HtmlCodeAttributes = HtmlAttributes & EventAttributes;
151
- export type HtmlColAttributes = HtmlAttributes & EventAttributes;
152
- export type HtmlColgroupAttributes = HtmlAttributes & EventAttributes;
153
- export type HtmlDataAttributes = HtmlAttributes & EventAttributes;
154
- export type HtmlDatalistAttributes = HtmlAttributes & EventAttributes;
155
- export type HtmlDdAttributes = HtmlAttributes & EventAttributes;
156
- export type HtmlDelAttributes = HtmlAttributes & EventAttributes;
157
- export type HtmlDetailsAttributes = HtmlAttributes & EventAttributes;
158
- export type HtmlDfnAttributes = HtmlAttributes & EventAttributes;
159
- export type HtmlDialogAttributes = HtmlAttributes & EventAttributes;
160
- export type HtmlDivAttributes = HtmlAttributes & EventAttributes;
161
- export type HtmlDlAttributes = HtmlAttributes & EventAttributes;
162
- export type HtmlDtAttributes = HtmlAttributes & EventAttributes;
163
- export type HtmlEmAttributes = HtmlAttributes & EventAttributes;
164
- export type HtmlEmbedAttributes = HtmlAttributes & EventAttributes;
165
- export type HtmlFieldsetAttributes = HtmlAttributes & EventAttributes;
166
- export type HtmlFigcaptionAttributes = HtmlAttributes & EventAttributes;
167
- export type HtmlFigureAttributes = HtmlAttributes & EventAttributes;
168
- export type HtmlFooterAttributes = HtmlAttributes & EventAttributes;
169
- export type HtmlFormAttributes = HtmlAttributes & EventAttributes;
170
- export type HtmlH1Attributes = HtmlAttributes & EventAttributes;
171
- export type HtmlH2Attributes = HtmlAttributes & EventAttributes;
172
- export type HtmlH3Attributes = HtmlAttributes & EventAttributes;
173
- export type HtmlH4Attributes = HtmlAttributes & EventAttributes;
174
- export type HtmlH5Attributes = HtmlAttributes & EventAttributes;
175
- export type HtmlH6Attributes = HtmlAttributes & EventAttributes;
176
- export type HtmlHeadAttributes = HtmlAttributes & EventAttributes;
177
- export type HtmlHeaderAttributes = HtmlAttributes & EventAttributes;
178
- export type HtmlHgroupAttributes = HtmlAttributes & EventAttributes;
179
- export type HtmlHrAttributes = HtmlAttributes & EventAttributes;
180
- export type HtmlHtmlAttributes = HtmlAttributes & EventAttributes;
181
- export type HtmlIAttributes = HtmlAttributes & EventAttributes;
182
- export type HtmlIframeAttributes = HtmlAttributes & EventAttributes;
183
- export type HtmlImgAttributes = HtmlAttributes & EventAttributes;
184
- export type HtmlInputAttributes = HtmlAttributes & EventAttributes;
185
- export type HtmlInsAttributes = HtmlAttributes & EventAttributes;
186
- export type HtmlKbdAttributes = HtmlAttributes & EventAttributes;
187
- export type HtmlKeygenAttributes = HtmlAttributes & EventAttributes;
188
- export type HtmlLabelAttributes = HtmlAttributes & EventAttributes;
189
- export type HtmlLegendAttributes = HtmlAttributes & EventAttributes;
190
- export type HtmlLiAttributes = HtmlAttributes & EventAttributes;
191
- export type HtmlLinkAttributes = HtmlAttributes & EventAttributes;
192
- export type HtmlMainAttributes = HtmlAttributes & EventAttributes;
193
- export type HtmlMapAttributes = HtmlAttributes & EventAttributes;
194
- export type HtmlMarkAttributes = HtmlAttributes & EventAttributes;
195
- export type HtmlMenuAttributes = HtmlAttributes & EventAttributes;
196
- export type HtmlMenuitemAttributes = HtmlAttributes & EventAttributes;
197
- export type HtmlMetaAttributes = HtmlAttributes & EventAttributes;
198
- export type HtmlMeterAttributes = HtmlAttributes & EventAttributes;
199
- export type HtmlNavAttributes = HtmlAttributes & EventAttributes;
200
- export type HtmlNoindexAttributes = HtmlAttributes & EventAttributes;
201
- export type HtmlNoscriptAttributes = HtmlAttributes & EventAttributes;
202
- export type HtmlObjectAttributes = HtmlAttributes & EventAttributes;
203
- export type HtmlOlAttributes = HtmlAttributes & EventAttributes;
204
- export type HtmlOptgroupAttributes = HtmlAttributes & EventAttributes;
205
- export type HtmlOptionAttributes = HtmlAttributes & EventAttributes;
206
- export type HtmlOutputAttributes = HtmlAttributes & EventAttributes;
207
- export type HtmlPAttributes = HtmlAttributes & EventAttributes;
208
- export type HtmlParamAttributes = HtmlAttributes & EventAttributes;
209
- export type HtmlPictureAttributes = HtmlAttributes & EventAttributes;
210
- export type HtmlPreAttributes = HtmlAttributes & EventAttributes;
211
- export type HtmlProgressAttributes = HtmlAttributes & EventAttributes;
212
- export type HtmlQAttributes = HtmlAttributes & EventAttributes;
213
- export type HtmlRpAttributes = HtmlAttributes & EventAttributes;
214
- export type HtmlRtAttributes = HtmlAttributes & EventAttributes;
215
- export type HtmlRubyAttributes = HtmlAttributes & EventAttributes;
216
- export type HtmlSAttributes = HtmlAttributes & EventAttributes;
217
- export type HtmlSampAttributes = HtmlAttributes & EventAttributes;
218
- export type HtmlScriptAttributes = HtmlAttributes & EventAttributes;
219
- export type HtmlSectionAttributes = HtmlAttributes & EventAttributes;
220
- export type HtmlSelectAttributes = HtmlAttributes & EventAttributes;
221
- export type HtmlSmallAttributes = HtmlAttributes & EventAttributes;
222
- export type HtmlSourceAttributes = HtmlAttributes & EventAttributes;
223
- export type HtmlSpanAttributes = HtmlAttributes & EventAttributes;
224
- export type HtmlStrongAttributes = HtmlAttributes & EventAttributes;
225
- export type HtmlStyleAttributes = HtmlAttributes & EventAttributes;
226
- export type HtmlSubAttributes = HtmlAttributes & EventAttributes;
227
- export type HtmlSummaryAttributes = HtmlAttributes & EventAttributes;
228
- export type HtmlSupAttributes = HtmlAttributes & EventAttributes;
229
- export type HtmlTableAttributes = HtmlAttributes & EventAttributes;
230
- export type HtmlTbodyAttributes = HtmlAttributes & EventAttributes;
231
- export type HtmlTdAttributes = HtmlAttributes & EventAttributes;
232
- export type HtmlTemplateAttributes = HtmlAttributes & EventAttributes;
233
- export type HtmlTextareaAttributes = HtmlAttributes & EventAttributes;
234
- export type HtmlTfootAttributes = HtmlAttributes & EventAttributes;
235
- export type HtmlThAttributes = HtmlAttributes & EventAttributes;
236
- export type HtmlTheadAttributes = HtmlAttributes & EventAttributes;
237
- export type HtmlTimeAttributes = HtmlAttributes & EventAttributes;
238
- export type HtmlTitleAttributes = HtmlAttributes & EventAttributes;
239
- export type HtmlTrAttributes = HtmlAttributes & EventAttributes;
240
- export type HtmlTrackAttributes = HtmlAttributes & EventAttributes;
241
- export type HtmlUAttributes = HtmlAttributes & EventAttributes;
242
- export type HtmlUlAttributes = HtmlAttributes & EventAttributes;
243
- export type HtmlVarAttributes = HtmlAttributes & EventAttributes;
244
- export type HtmlVideoAttributes = HtmlAttributes & EventAttributes;
245
- export type HtmlWbrAttributes = HtmlAttributes & EventAttributes;
246
- export type HtmlSlotAttributes = HtmlAttributes & EventAttributes;
247
- export declare namespace JSX {
248
- type Element = Slot;
249
- interface IntrinsicElements extends HtmlTags {
250
- a: HtmlAnchorAttributes;
251
- abbr: HtmlAbbrAttributes;
252
- address: HtmlAddressAttributes;
253
- area: HtmlAreaAttributes;
254
- article: HtmlArticleAttributes;
255
- aside: HtmlAsideAttributes;
256
- audio: HtmlAudioAttributes;
257
- b: HtmlBAttributes;
258
- base: HtmlBaseAttributes;
259
- bdi: HtmlBdiAttributes;
260
- bdo: HtmlBdoAttributes;
261
- big: HtmlBigAttributes;
262
- blockquote: HtmlBlockquoteAttributes;
263
- body: HtmlBodyAttributes;
264
- br: HtmlBrAttributes;
265
- button: HtmlButtonAttributes;
266
- canvas: HtmlCanvasAttributes;
267
- caption: HtmlCaptionAttributes;
268
- cite: HtmlCiteAttributes;
269
- code: HtmlCodeAttributes;
270
- col: HtmlColAttributes;
271
- colgroup: HtmlColgroupAttributes;
272
- data: HtmlDataAttributes;
273
- datalist: HtmlDatalistAttributes;
274
- dd: HtmlDdAttributes;
275
- del: HtmlDelAttributes;
276
- details: HtmlDetailsAttributes;
277
- dfn: HtmlDfnAttributes;
278
- dialog: HtmlDialogAttributes;
279
- div: HtmlDivAttributes;
280
- dl: HtmlDlAttributes;
281
- dt: HtmlDtAttributes;
282
- em: HtmlEmAttributes;
283
- embed: HtmlEmbedAttributes;
284
- fieldset: HtmlFieldsetAttributes;
285
- figcaption: HtmlFigcaptionAttributes;
286
- figure: HtmlFigureAttributes;
287
- footer: HtmlFooterAttributes;
288
- form: HtmlFormAttributes;
289
- h1: HtmlH1Attributes;
290
- h2: HtmlH2Attributes;
291
- h3: HtmlH3Attributes;
292
- h4: HtmlH4Attributes;
293
- h5: HtmlH5Attributes;
294
- h6: HtmlH6Attributes;
295
- head: HtmlHeadAttributes;
296
- header: HtmlHeaderAttributes;
297
- hgroup: HtmlHgroupAttributes;
298
- hr: HtmlHrAttributes;
299
- html: HtmlHtmlAttributes;
300
- i: HtmlIAttributes;
301
- iframe: HtmlIframeAttributes;
302
- img: HtmlImgAttributes;
303
- input: HtmlInputAttributes;
304
- ins: HtmlInsAttributes;
305
- kbd: HtmlKbdAttributes;
306
- keygen: HtmlKeygenAttributes;
307
- label: HtmlLabelAttributes;
308
- legend: HtmlLegendAttributes;
309
- li: HtmlLiAttributes;
310
- link: HtmlLinkAttributes;
311
- main: HtmlMainAttributes;
312
- map: HtmlMapAttributes;
313
- mark: HtmlMarkAttributes;
314
- menu: HtmlMenuAttributes;
315
- menuitem: HtmlMenuitemAttributes;
316
- meta: HtmlMetaAttributes;
317
- meter: HtmlMeterAttributes;
318
- nav: HtmlNavAttributes;
319
- noindex: HtmlNoindexAttributes;
320
- noscript: HtmlNoscriptAttributes;
321
- object: HtmlObjectAttributes;
322
- ol: HtmlOlAttributes;
323
- optgroup: HtmlOptgroupAttributes;
324
- option: HtmlOptionAttributes;
325
- output: HtmlOutputAttributes;
326
- p: HtmlPAttributes;
327
- param: HtmlParamAttributes;
328
- picture: HtmlPictureAttributes;
329
- pre: HtmlPreAttributes;
330
- progress: HtmlProgressAttributes;
331
- q: HtmlQAttributes;
332
- rp: HtmlRpAttributes;
333
- rt: HtmlRtAttributes;
334
- ruby: HtmlRubyAttributes;
335
- s: HtmlSAttributes;
336
- samp: HtmlSampAttributes;
337
- script: HtmlScriptAttributes;
338
- section: HtmlSectionAttributes;
339
- select: HtmlSelectAttributes;
340
- small: HtmlSmallAttributes;
341
- source: HtmlSourceAttributes;
342
- span: HtmlSpanAttributes;
343
- strong: HtmlStrongAttributes;
344
- style: HtmlStyleAttributes;
345
- sub: HtmlSubAttributes;
346
- summary: HtmlSummaryAttributes;
347
- sup: HtmlSupAttributes;
348
- table: HtmlTableAttributes;
349
- tbody: HtmlTbodyAttributes;
350
- td: HtmlTdAttributes;
351
- template: HtmlTemplateAttributes;
352
- textarea: HtmlTextareaAttributes;
353
- tfoot: HtmlTfootAttributes;
354
- th: HtmlThAttributes;
355
- thead: HtmlTheadAttributes;
356
- time: HtmlTimeAttributes;
357
- title: HtmlTitleAttributes;
358
- tr: HtmlTrAttributes;
359
- track: HtmlTrackAttributes;
360
- u: HtmlUAttributes;
361
- ul: HtmlUlAttributes;
362
- var: HtmlVarAttributes;
363
- video: HtmlVideoAttributes;
364
- wbr: HtmlWbrAttributes;
365
- slot: HtmlSlotAttributes;
366
- }
367
- }
368
- export declare const svgElements: Set<string>;
369
- export declare function namespace(tag: string): "http://www.w3.org/1999/xhtml" | "http://www.w3.org/2000/svg";
370
- export declare const h: typeof createElement;
371
- export declare const fragment: ({ children }: Fragment) => unknown[];
package/dist/jsx/index.js DELETED
@@ -1,160 +0,0 @@
1
- //#region src/signals/index.ts
2
- var Handler = class Handler {
3
- get(target, key) {
4
- const compute = activeCompute;
5
- if (compute) {
6
- const computes = targets.get(target) ?? /* @__PURE__ */ new Map();
7
- const set = computes.get(key) ?? /* @__PURE__ */ new Set();
8
- computes.set(key, set.add(compute));
9
- targets.set(target, computes);
10
- compute.parentScope?.onStop(() => {
11
- set.delete(compute);
12
- if (set.size === 0) {
13
- computes.delete(key);
14
- if (computes.size === 0) targets.delete(target);
15
- }
16
- });
17
- }
18
- const value = Reflect.get(target, key);
19
- if (value) {
20
- if (typeof value === "function" && !value.prototype) return value.bind(target);
21
- if (typeof value === "object") {
22
- const tag = Object.prototype.toString.call(value);
23
- if (tag === "[object Object]" || tag === "[object Array]" || tag === "[object Map]" || tag === "[object Set]" || tag === "[object WeakMap]" || tag === "[object WeakSet]") return new Proxy(value, new Handler());
24
- }
25
- }
26
- return value;
27
- }
28
- set(target, key, value) {
29
- const result = Reflect.set(target, key, value);
30
- for (const compute of targets.get(target)?.get(key) ?? []) compute.run();
31
- return result;
32
- }
33
- };
34
- function createState(value) {
35
- return new Proxy({ value }, new Handler());
36
- }
37
- function defineContext(key) {
38
- return key;
39
- }
40
- let activeCompute;
41
- const targets = /* @__PURE__ */ new WeakMap();
42
-
43
- //#endregion
44
- //#region src/runtime/index.ts
45
- const RUNTIME_CONTEXT = defineContext("RUNTIME_CONTEXT");
46
- const ROUTE_CONTEXT = defineContext("ROUTE_CONTEXT");
47
-
48
- //#endregion
49
- //#region src/html/index.ts
50
- function isComponent(value) {
51
- return !!value && typeof value === "function" && "$name" in value;
52
- }
53
- function createElement(input, attributes, ...children) {
54
- if (isComponent(input)) return {
55
- tag: input.$name,
56
- attributes: attributes ?? {},
57
- children
58
- };
59
- if (typeof input === "string") return {
60
- tag: input,
61
- attributes: attributes ?? {},
62
- children
63
- };
64
- return input?.({
65
- ...attributes,
66
- children
67
- });
68
- }
69
- const activeViewTransition = createState();
70
- const HOST_CONTEXT = defineContext("HOST_CONTEXT");
71
-
72
- //#endregion
73
- //#region src/jsx/index.ts
74
- const svgElements = new Set([
75
- "altGlyph",
76
- "altGlyphDef",
77
- "altGlyphItem",
78
- "animate",
79
- "animateColor",
80
- "animateMotion",
81
- "animateTransform",
82
- "circle",
83
- "clipPath",
84
- "color-profile",
85
- "cursor",
86
- "defs",
87
- "desc",
88
- "ellipse",
89
- "feBlend",
90
- "feColorMatrix",
91
- "feComponentTransfer",
92
- "feComposite",
93
- "feConvolveMatrix",
94
- "feDiffuseLighting",
95
- "feDisplacementMap",
96
- "feDistantLight",
97
- "feDropShadow",
98
- "feFlood",
99
- "feFuncA",
100
- "feFuncB",
101
- "feFuncG",
102
- "feFuncR",
103
- "feGaussianBlur",
104
- "feImage",
105
- "feMerge",
106
- "feMergeNode",
107
- "feMorphology",
108
- "feOffset",
109
- "fePointLight",
110
- "feSpecularLighting",
111
- "feSpotLight",
112
- "feTile",
113
- "feTurbulence",
114
- "filter",
115
- "font",
116
- "font-face",
117
- "font-face-format",
118
- "font-face-name",
119
- "font-face-src",
120
- "font-face-uri",
121
- "foreignObject",
122
- "g",
123
- "glyph",
124
- "glyphRef",
125
- "hkern",
126
- "image",
127
- "line",
128
- "linearGradient",
129
- "marker",
130
- "mask",
131
- "metadata",
132
- "missing-glyph",
133
- "mpath",
134
- "path",
135
- "pattern",
136
- "polygon",
137
- "polyline",
138
- "radialGradient",
139
- "rect",
140
- "set",
141
- "stop",
142
- "svg",
143
- "switch",
144
- "symbol",
145
- "text",
146
- "textPath",
147
- "tref",
148
- "tspan",
149
- "use",
150
- "view",
151
- "vkern"
152
- ]);
153
- function namespace(tag) {
154
- return svgElements.has(tag) ? "http://www.w3.org/2000/svg" : "http://www.w3.org/1999/xhtml";
155
- }
156
- const h = createElement;
157
- const fragment = ({ children }) => children;
158
-
159
- //#endregion
160
- export { fragment, h, namespace, svgElements };