keits 0.0.0-stage → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +126 -2
- package/dist/dev/index.js +435 -0
- package/dist/dev/shared/element-By0uLZli.js +544 -0
- package/dist/dev/svg.js +70 -0
- package/dist/prod/index.js +258 -0
- package/dist/prod/shared/element-C8c5hIhH.js +394 -0
- package/dist/prod/svg.js +8 -0
- package/dist/types/core/computed.d.ts +6 -0
- package/dist/types/core/context.d.ts +11 -0
- package/dist/types/core/effect.d.ts +4 -0
- package/dist/types/core/env.d.ts +1 -0
- package/dist/types/core/graph.d.ts +73 -0
- package/dist/types/core/owner.d.ts +12 -0
- package/dist/types/core/signal.d.ts +15 -0
- package/dist/types/core/store.d.ts +13 -0
- package/dist/types/core/types.d.ts +1 -0
- package/dist/types/dom/element.d.ts +3 -0
- package/dist/types/dom/events.d.ts +1 -0
- package/dist/types/dom/hooks.d.ts +8 -0
- package/dist/types/dom/index.d.ts +6 -0
- package/dist/types/dom/insert.d.ts +2 -0
- package/dist/types/dom/mount.d.ts +2 -0
- package/dist/types/dom/namespaces.d.ts +1 -0
- package/dist/types/dom/props.d.ts +3 -0
- package/dist/types/dom/render-effect.d.ts +1 -0
- package/dist/types/dom/tags.d.ts +112 -0
- package/dist/types/dom/types.d.ts +43 -0
- package/dist/types/dom/unsafe.d.ts +1 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/svg/element.d.ts +2 -0
- package/dist/types/svg/index.d.ts +3 -0
- package/dist/types/svg/tags.d.ts +63 -0
- package/dist/types/svg/types.d.ts +13 -0
- package/package.json +34 -3
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export declare const SIGNAL = 0;
|
|
2
|
+
export declare const EFFECT = 1;
|
|
3
|
+
export declare const COMPUTED = 2;
|
|
4
|
+
export declare const ROOT = 3;
|
|
5
|
+
export declare const CLEAN = 0;
|
|
6
|
+
export declare const CHECK = 1;
|
|
7
|
+
export declare const DIRTY = 2;
|
|
8
|
+
export type State = typeof CLEAN | typeof CHECK | typeof DIRTY;
|
|
9
|
+
interface SourceFields {
|
|
10
|
+
observers: Computation[];
|
|
11
|
+
seenBy: number;
|
|
12
|
+
name?: string;
|
|
13
|
+
}
|
|
14
|
+
interface OwnerFields {
|
|
15
|
+
owner: Owner | null;
|
|
16
|
+
children: Owner[] | null;
|
|
17
|
+
cleanups: (() => void)[] | null;
|
|
18
|
+
disposed: boolean;
|
|
19
|
+
}
|
|
20
|
+
interface ComputationFields extends OwnerFields {
|
|
21
|
+
state: State;
|
|
22
|
+
sources: Source[];
|
|
23
|
+
flushId: number;
|
|
24
|
+
flushRuns: number;
|
|
25
|
+
name?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface SignalSource extends SourceFields {
|
|
28
|
+
kind: typeof SIGNAL;
|
|
29
|
+
}
|
|
30
|
+
export interface EffectNode extends ComputationFields {
|
|
31
|
+
kind: typeof EFFECT;
|
|
32
|
+
fn: () => void;
|
|
33
|
+
}
|
|
34
|
+
export interface ComputedNode extends SourceFields, ComputationFields {
|
|
35
|
+
kind: typeof COMPUTED;
|
|
36
|
+
fn: (prev: unknown) => unknown;
|
|
37
|
+
value: unknown;
|
|
38
|
+
equals: false | ((prev: unknown, next: unknown) => boolean);
|
|
39
|
+
hasValue: boolean;
|
|
40
|
+
hasError: boolean;
|
|
41
|
+
error: unknown;
|
|
42
|
+
computing: boolean;
|
|
43
|
+
}
|
|
44
|
+
export interface RootNode extends OwnerFields {
|
|
45
|
+
kind: typeof ROOT;
|
|
46
|
+
handler: ((error: unknown) => void) | null;
|
|
47
|
+
context?: {
|
|
48
|
+
key: object;
|
|
49
|
+
value: unknown;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
export type Source = SignalSource | ComputedNode;
|
|
53
|
+
export type Computation = EffectNode | ComputedNode;
|
|
54
|
+
export type Owner = RootNode | Computation;
|
|
55
|
+
export declare function track(source: Source): void;
|
|
56
|
+
export declare function isTracking(): boolean;
|
|
57
|
+
export declare function notify(source: Source): void;
|
|
58
|
+
export declare function updateIfNeeded(node: Computation): void;
|
|
59
|
+
export declare function recompute(node: ComputedNode): void;
|
|
60
|
+
export declare function runEffect(node: EffectNode): void;
|
|
61
|
+
export declare function run<T>(node: Computation, fn: () => T): T;
|
|
62
|
+
export declare function batch<T>(fn: () => T): T;
|
|
63
|
+
export declare function untrack<T>(fn: () => T): T;
|
|
64
|
+
export declare function adopt(node: Owner): void;
|
|
65
|
+
export declare function getOwner(): Owner | null;
|
|
66
|
+
export declare function runWithOwner<T>(owner: Owner | null, fn: () => T): T;
|
|
67
|
+
export declare function addCleanup(fn: () => void): boolean;
|
|
68
|
+
export declare function addMount(fn: () => void): void;
|
|
69
|
+
export declare function dispose(node: Owner): void;
|
|
70
|
+
export declare function handleError(error: unknown, owner: Owner | null): void;
|
|
71
|
+
export declare function isStaticRender(): boolean;
|
|
72
|
+
export declare function withStaticRender<T>(fn: () => T): T;
|
|
73
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare const OWNER: unique symbol;
|
|
2
|
+
export interface Owner {
|
|
3
|
+
readonly [OWNER]: true;
|
|
4
|
+
}
|
|
5
|
+
export declare function getOwner(): Owner | null;
|
|
6
|
+
export declare function runWithOwner<T>(owner: Owner | null, fn: () => T): T;
|
|
7
|
+
export declare function createRoot<T>(fn: (dispose: () => void) => T): T;
|
|
8
|
+
export declare function onCleanup(fn: () => void): void;
|
|
9
|
+
export declare function onMount(fn: () => void): void;
|
|
10
|
+
export declare function catchError<T>(fn: () => T, handler: (error: unknown) => void): T | undefined;
|
|
11
|
+
export declare function renderStatic<T>(fn: () => T): T;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type SignalSource } from "./graph";
|
|
2
|
+
import type { Accessor } from "./types";
|
|
3
|
+
export interface Signal<T> extends Accessor<T> {
|
|
4
|
+
set(next: Exclude<T, Function> | ((prev: T) => T)): void;
|
|
5
|
+
}
|
|
6
|
+
export interface SignalOptions<T> {
|
|
7
|
+
equals?: false | ((prev: T, next: T) => boolean);
|
|
8
|
+
name?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface SignalNode<T> extends SignalSource {
|
|
11
|
+
value: T;
|
|
12
|
+
equals: false | ((prev: T, next: T) => boolean);
|
|
13
|
+
}
|
|
14
|
+
export declare function signal<T>(): Signal<T | undefined>;
|
|
15
|
+
export declare function signal<T>(value: T, options?: SignalOptions<T>): Signal<T>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type Store<T> = T extends (...args: never[]) => unknown ? T : T extends object ? {
|
|
2
|
+
readonly [K in keyof T]: Store<T[K]>;
|
|
3
|
+
} : T;
|
|
4
|
+
export type SetStore<T> = (fn: (draft: T) => void) => void;
|
|
5
|
+
export interface StoreOptions {
|
|
6
|
+
name?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function store<T extends object>(initial: T, options?: StoreOptions): [Store<T>, SetStore<T>];
|
|
9
|
+
export declare function unwrap<T>(value: T): T;
|
|
10
|
+
export interface ReconcileOptions {
|
|
11
|
+
key?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function reconcile<T extends object>(target: T, source: T, options?: ReconcileOptions): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type Accessor<T> = () => T;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { Child, ElementFactory } from "./types";
|
|
2
|
+
export declare function html<K extends keyof HTMLElementTagNameMap>(tag: K): ElementFactory<HTMLElementTagNameMap[K]>;
|
|
3
|
+
export declare function createFactory(tag: string, namespace: string | null): (first?: unknown, children?: Child) => Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function applyEvent(element: Element, key: string, value: unknown): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface NodeHooks {
|
|
2
|
+
element(tag: string, namespace: string | null): Element;
|
|
3
|
+
text(value: string): Text;
|
|
4
|
+
marker(): Comment;
|
|
5
|
+
}
|
|
6
|
+
export declare const defaultHooks: NodeHooks;
|
|
7
|
+
export declare let hooks: NodeHooks;
|
|
8
|
+
export declare function setHooks(next: NodeHooks): NodeHooks;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from "./tags";
|
|
2
|
+
export { html } from "./element";
|
|
3
|
+
export { insert } from "./insert";
|
|
4
|
+
export { mount } from "./mount";
|
|
5
|
+
export { unsafeHTML } from "./unsafe";
|
|
6
|
+
export type { Child, ClassValue, ElementFactory, EventHandler, MaybeAccessor, Props, StyleValue } from "./types";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SVG_NS = "http://www.w3.org/2000/svg";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function renderEffect(fn: () => void): void;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
export declare const $a: import("./types").ElementFactory<HTMLAnchorElement>;
|
|
2
|
+
export declare const $abbr: import("./types").ElementFactory<HTMLElement>;
|
|
3
|
+
export declare const $address: import("./types").ElementFactory<HTMLElement>;
|
|
4
|
+
export declare const $area: import("./types").ElementFactory<HTMLAreaElement>;
|
|
5
|
+
export declare const $article: import("./types").ElementFactory<HTMLElement>;
|
|
6
|
+
export declare const $aside: import("./types").ElementFactory<HTMLElement>;
|
|
7
|
+
export declare const $audio: import("./types").ElementFactory<HTMLAudioElement>;
|
|
8
|
+
export declare const $b: import("./types").ElementFactory<HTMLElement>;
|
|
9
|
+
export declare const $base: import("./types").ElementFactory<HTMLBaseElement>;
|
|
10
|
+
export declare const $bdi: import("./types").ElementFactory<HTMLElement>;
|
|
11
|
+
export declare const $bdo: import("./types").ElementFactory<HTMLElement>;
|
|
12
|
+
export declare const $blockquote: import("./types").ElementFactory<HTMLQuoteElement>;
|
|
13
|
+
export declare const $body: import("./types").ElementFactory<HTMLBodyElement>;
|
|
14
|
+
export declare const $br: import("./types").ElementFactory<HTMLBRElement>;
|
|
15
|
+
export declare const $button: import("./types").ElementFactory<HTMLButtonElement>;
|
|
16
|
+
export declare const $canvas: import("./types").ElementFactory<HTMLCanvasElement>;
|
|
17
|
+
export declare const $caption: import("./types").ElementFactory<HTMLTableCaptionElement>;
|
|
18
|
+
export declare const $cite: import("./types").ElementFactory<HTMLElement>;
|
|
19
|
+
export declare const $code: import("./types").ElementFactory<HTMLElement>;
|
|
20
|
+
export declare const $col: import("./types").ElementFactory<HTMLTableColElement>;
|
|
21
|
+
export declare const $colgroup: import("./types").ElementFactory<HTMLTableColElement>;
|
|
22
|
+
export declare const $data: import("./types").ElementFactory<HTMLDataElement>;
|
|
23
|
+
export declare const $datalist: import("./types").ElementFactory<HTMLDataListElement>;
|
|
24
|
+
export declare const $dd: import("./types").ElementFactory<HTMLElement>;
|
|
25
|
+
export declare const $del: import("./types").ElementFactory<HTMLModElement>;
|
|
26
|
+
export declare const $details: import("./types").ElementFactory<HTMLDetailsElement>;
|
|
27
|
+
export declare const $dfn: import("./types").ElementFactory<HTMLElement>;
|
|
28
|
+
export declare const $dialog: import("./types").ElementFactory<HTMLDialogElement>;
|
|
29
|
+
export declare const $div: import("./types").ElementFactory<HTMLDivElement>;
|
|
30
|
+
export declare const $dl: import("./types").ElementFactory<HTMLDListElement>;
|
|
31
|
+
export declare const $dt: import("./types").ElementFactory<HTMLElement>;
|
|
32
|
+
export declare const $em: import("./types").ElementFactory<HTMLElement>;
|
|
33
|
+
export declare const $embed: import("./types").ElementFactory<HTMLEmbedElement>;
|
|
34
|
+
export declare const $fieldset: import("./types").ElementFactory<HTMLFieldSetElement>;
|
|
35
|
+
export declare const $figcaption: import("./types").ElementFactory<HTMLElement>;
|
|
36
|
+
export declare const $figure: import("./types").ElementFactory<HTMLElement>;
|
|
37
|
+
export declare const $footer: import("./types").ElementFactory<HTMLElement>;
|
|
38
|
+
export declare const $form: import("./types").ElementFactory<HTMLFormElement>;
|
|
39
|
+
export declare const $h1: import("./types").ElementFactory<HTMLHeadingElement>;
|
|
40
|
+
export declare const $h2: import("./types").ElementFactory<HTMLHeadingElement>;
|
|
41
|
+
export declare const $h3: import("./types").ElementFactory<HTMLHeadingElement>;
|
|
42
|
+
export declare const $h4: import("./types").ElementFactory<HTMLHeadingElement>;
|
|
43
|
+
export declare const $h5: import("./types").ElementFactory<HTMLHeadingElement>;
|
|
44
|
+
export declare const $h6: import("./types").ElementFactory<HTMLHeadingElement>;
|
|
45
|
+
export declare const $head: import("./types").ElementFactory<HTMLHeadElement>;
|
|
46
|
+
export declare const $header: import("./types").ElementFactory<HTMLElement>;
|
|
47
|
+
export declare const $hgroup: import("./types").ElementFactory<HTMLElement>;
|
|
48
|
+
export declare const $hr: import("./types").ElementFactory<HTMLHRElement>;
|
|
49
|
+
export declare const $html: import("./types").ElementFactory<HTMLHtmlElement>;
|
|
50
|
+
export declare const $i: import("./types").ElementFactory<HTMLElement>;
|
|
51
|
+
export declare const $iframe: import("./types").ElementFactory<HTMLIFrameElement>;
|
|
52
|
+
export declare const $img: import("./types").ElementFactory<HTMLImageElement>;
|
|
53
|
+
export declare const $input: import("./types").ElementFactory<HTMLInputElement>;
|
|
54
|
+
export declare const $ins: import("./types").ElementFactory<HTMLModElement>;
|
|
55
|
+
export declare const $kbd: import("./types").ElementFactory<HTMLElement>;
|
|
56
|
+
export declare const $label: import("./types").ElementFactory<HTMLLabelElement>;
|
|
57
|
+
export declare const $legend: import("./types").ElementFactory<HTMLLegendElement>;
|
|
58
|
+
export declare const $li: import("./types").ElementFactory<HTMLLIElement>;
|
|
59
|
+
export declare const $link: import("./types").ElementFactory<HTMLLinkElement>;
|
|
60
|
+
export declare const $main: import("./types").ElementFactory<HTMLElement>;
|
|
61
|
+
export declare const $map: import("./types").ElementFactory<HTMLMapElement>;
|
|
62
|
+
export declare const $mark: import("./types").ElementFactory<HTMLElement>;
|
|
63
|
+
export declare const $menu: import("./types").ElementFactory<HTMLMenuElement>;
|
|
64
|
+
export declare const $meta: import("./types").ElementFactory<HTMLMetaElement>;
|
|
65
|
+
export declare const $meter: import("./types").ElementFactory<HTMLMeterElement>;
|
|
66
|
+
export declare const $nav: import("./types").ElementFactory<HTMLElement>;
|
|
67
|
+
export declare const $noscript: import("./types").ElementFactory<HTMLElement>;
|
|
68
|
+
export declare const $object: import("./types").ElementFactory<HTMLObjectElement>;
|
|
69
|
+
export declare const $ol: import("./types").ElementFactory<HTMLOListElement>;
|
|
70
|
+
export declare const $optgroup: import("./types").ElementFactory<HTMLOptGroupElement>;
|
|
71
|
+
export declare const $option: import("./types").ElementFactory<HTMLOptionElement>;
|
|
72
|
+
export declare const $output: import("./types").ElementFactory<HTMLOutputElement>;
|
|
73
|
+
export declare const $p: import("./types").ElementFactory<HTMLParagraphElement>;
|
|
74
|
+
export declare const $picture: import("./types").ElementFactory<HTMLPictureElement>;
|
|
75
|
+
export declare const $pre: import("./types").ElementFactory<HTMLPreElement>;
|
|
76
|
+
export declare const $progress: import("./types").ElementFactory<HTMLProgressElement>;
|
|
77
|
+
export declare const $q: import("./types").ElementFactory<HTMLQuoteElement>;
|
|
78
|
+
export declare const $rp: import("./types").ElementFactory<HTMLElement>;
|
|
79
|
+
export declare const $rt: import("./types").ElementFactory<HTMLElement>;
|
|
80
|
+
export declare const $ruby: import("./types").ElementFactory<HTMLElement>;
|
|
81
|
+
export declare const $s: import("./types").ElementFactory<HTMLElement>;
|
|
82
|
+
export declare const $samp: import("./types").ElementFactory<HTMLElement>;
|
|
83
|
+
export declare const $script: import("./types").ElementFactory<HTMLScriptElement>;
|
|
84
|
+
export declare const $search: import("./types").ElementFactory<HTMLElement>;
|
|
85
|
+
export declare const $section: import("./types").ElementFactory<HTMLElement>;
|
|
86
|
+
export declare const $select: import("./types").ElementFactory<HTMLSelectElement>;
|
|
87
|
+
export declare const $slot: import("./types").ElementFactory<HTMLSlotElement>;
|
|
88
|
+
export declare const $small: import("./types").ElementFactory<HTMLElement>;
|
|
89
|
+
export declare const $source: import("./types").ElementFactory<HTMLSourceElement>;
|
|
90
|
+
export declare const $span: import("./types").ElementFactory<HTMLSpanElement>;
|
|
91
|
+
export declare const $strong: import("./types").ElementFactory<HTMLElement>;
|
|
92
|
+
export declare const $style: import("./types").ElementFactory<HTMLStyleElement>;
|
|
93
|
+
export declare const $sub: import("./types").ElementFactory<HTMLElement>;
|
|
94
|
+
export declare const $summary: import("./types").ElementFactory<HTMLElement>;
|
|
95
|
+
export declare const $sup: import("./types").ElementFactory<HTMLElement>;
|
|
96
|
+
export declare const $table: import("./types").ElementFactory<HTMLTableElement>;
|
|
97
|
+
export declare const $tbody: import("./types").ElementFactory<HTMLTableSectionElement>;
|
|
98
|
+
export declare const $td: import("./types").ElementFactory<HTMLTableCellElement>;
|
|
99
|
+
export declare const $template: import("./types").ElementFactory<HTMLTemplateElement>;
|
|
100
|
+
export declare const $textarea: import("./types").ElementFactory<HTMLTextAreaElement>;
|
|
101
|
+
export declare const $tfoot: import("./types").ElementFactory<HTMLTableSectionElement>;
|
|
102
|
+
export declare const $th: import("./types").ElementFactory<HTMLTableCellElement>;
|
|
103
|
+
export declare const $thead: import("./types").ElementFactory<HTMLTableSectionElement>;
|
|
104
|
+
export declare const $time: import("./types").ElementFactory<HTMLTimeElement>;
|
|
105
|
+
export declare const $title: import("./types").ElementFactory<HTMLTitleElement>;
|
|
106
|
+
export declare const $tr: import("./types").ElementFactory<HTMLTableRowElement>;
|
|
107
|
+
export declare const $track: import("./types").ElementFactory<HTMLTrackElement>;
|
|
108
|
+
export declare const $u: import("./types").ElementFactory<HTMLElement>;
|
|
109
|
+
export declare const $ul: import("./types").ElementFactory<HTMLUListElement>;
|
|
110
|
+
export declare const $var: import("./types").ElementFactory<HTMLElement>;
|
|
111
|
+
export declare const $video: import("./types").ElementFactory<HTMLVideoElement>;
|
|
112
|
+
export declare const $wbr: import("./types").ElementFactory<HTMLElement>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export type Child = Node | string | number | bigint | boolean | null | undefined | readonly Child[] | (() => Child);
|
|
2
|
+
type IfEquals<X, Y, Then, Else> = (<T>() => T extends X ? 1 : 2) extends <T>() => (T extends Y ? 1 : 2) ? Then : Else;
|
|
3
|
+
type WritableKeys<T> = {
|
|
4
|
+
[K in keyof T]-?: IfEquals<{
|
|
5
|
+
[Q in K]: T[K];
|
|
6
|
+
}, {
|
|
7
|
+
-readonly [Q in K]: T[K];
|
|
8
|
+
}, K, never>;
|
|
9
|
+
}[keyof T];
|
|
10
|
+
type Primitive = string | number | bigint | boolean | null | undefined;
|
|
11
|
+
type UnsafeKeys = "innerHTML" | "outerHTML" | "srcdoc";
|
|
12
|
+
export type MaybeAccessor<T> = T | (() => T);
|
|
13
|
+
type ElementProps<E> = {
|
|
14
|
+
[K in WritableKeys<E> as K extends UnsafeKeys ? never : E[K] extends Primitive ? K : never]?: MaybeAccessor<E[K]>;
|
|
15
|
+
};
|
|
16
|
+
export type AttributeValue = string | number | boolean | null | undefined;
|
|
17
|
+
export type AttributeProps = {
|
|
18
|
+
[key: `data-${string}`]: MaybeAccessor<AttributeValue>;
|
|
19
|
+
[key: `aria-${string}`]: MaybeAccessor<AttributeValue>;
|
|
20
|
+
};
|
|
21
|
+
export type ClassValue = string | null | undefined | false | {
|
|
22
|
+
readonly [name: string]: MaybeAccessor<boolean>;
|
|
23
|
+
} | readonly ClassValue[];
|
|
24
|
+
export type StyleValue = string | null | undefined | {
|
|
25
|
+
readonly [property: string]: MaybeAccessor<string | number | null | undefined>;
|
|
26
|
+
};
|
|
27
|
+
type EventMapOf<E> = E extends HTMLVideoElement ? HTMLVideoElementEventMap : E extends HTMLMediaElement ? HTMLMediaElementEventMap : E extends HTMLBodyElement ? HTMLBodyElementEventMap : E extends HTMLElement ? HTMLElementEventMap : E extends SVGElement ? SVGElementEventMap : ElementEventMap;
|
|
28
|
+
export type EventHandler<E extends Element, Ev extends Event> = (event: Ev & {
|
|
29
|
+
readonly currentTarget: E;
|
|
30
|
+
}) => unknown;
|
|
31
|
+
export type EventProps<E extends Element> = {
|
|
32
|
+
[K in keyof EventMapOf<E> & string as `on${K}`]?: EventHandler<E, EventMapOf<E>[K] & Event> | readonly [EventHandler<E, EventMapOf<E>[K] & Event>, AddEventListenerOptions];
|
|
33
|
+
};
|
|
34
|
+
export type Props<E extends Element> = ElementProps<E> & AttributeProps & EventProps<E> & {
|
|
35
|
+
class?: ClassValue | (() => ClassValue);
|
|
36
|
+
style?: StyleValue | (() => StyleValue);
|
|
37
|
+
ref?: (element: E) => void;
|
|
38
|
+
};
|
|
39
|
+
export interface ElementFactory<E extends Element> {
|
|
40
|
+
(props?: Props<E> | null, children?: Child): E;
|
|
41
|
+
(children: Child): E;
|
|
42
|
+
}
|
|
43
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function unsafeHTML(markup: string): DocumentFragment;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type { Accessor } from "./core/types";
|
|
2
|
+
export { signal, type Signal, type SignalOptions } from "./core/signal";
|
|
3
|
+
export { effect, type EffectOptions } from "./core/effect";
|
|
4
|
+
export { computed, type ComputedOptions } from "./core/computed";
|
|
5
|
+
export { batch, isStaticRender, untrack } from "./core/graph";
|
|
6
|
+
export { isServer } from "./core/env";
|
|
7
|
+
export { catchError, createRoot, getOwner, onCleanup, onMount, renderStatic, runWithOwner, type Owner } from "./core/owner";
|
|
8
|
+
export { createContext, provide, useContext, type Context, type ContextOptions } from "./core/context";
|
|
9
|
+
export { reconcile, store, unwrap, type ReconcileOptions, type SetStore, type Store, type StoreOptions } from "./core/store";
|
|
10
|
+
export * from "./dom/index";
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export declare const $a: import("./types").SvgElementFactory<SVGAElement>;
|
|
2
|
+
export declare const $animate: import("./types").SvgElementFactory<SVGAnimateElement>;
|
|
3
|
+
export declare const $animateMotion: import("./types").SvgElementFactory<SVGAnimateMotionElement>;
|
|
4
|
+
export declare const $animateTransform: import("./types").SvgElementFactory<SVGAnimateTransformElement>;
|
|
5
|
+
export declare const $circle: import("./types").SvgElementFactory<SVGCircleElement>;
|
|
6
|
+
export declare const $clipPath: import("./types").SvgElementFactory<SVGClipPathElement>;
|
|
7
|
+
export declare const $defs: import("./types").SvgElementFactory<SVGDefsElement>;
|
|
8
|
+
export declare const $desc: import("./types").SvgElementFactory<SVGDescElement>;
|
|
9
|
+
export declare const $ellipse: import("./types").SvgElementFactory<SVGEllipseElement>;
|
|
10
|
+
export declare const $feBlend: import("./types").SvgElementFactory<SVGFEBlendElement>;
|
|
11
|
+
export declare const $feColorMatrix: import("./types").SvgElementFactory<SVGFEColorMatrixElement>;
|
|
12
|
+
export declare const $feComponentTransfer: import("./types").SvgElementFactory<SVGFEComponentTransferElement>;
|
|
13
|
+
export declare const $feComposite: import("./types").SvgElementFactory<SVGFECompositeElement>;
|
|
14
|
+
export declare const $feConvolveMatrix: import("./types").SvgElementFactory<SVGFEConvolveMatrixElement>;
|
|
15
|
+
export declare const $feDiffuseLighting: import("./types").SvgElementFactory<SVGFEDiffuseLightingElement>;
|
|
16
|
+
export declare const $feDisplacementMap: import("./types").SvgElementFactory<SVGFEDisplacementMapElement>;
|
|
17
|
+
export declare const $feDistantLight: import("./types").SvgElementFactory<SVGFEDistantLightElement>;
|
|
18
|
+
export declare const $feDropShadow: import("./types").SvgElementFactory<SVGFEDropShadowElement>;
|
|
19
|
+
export declare const $feFlood: import("./types").SvgElementFactory<SVGFEFloodElement>;
|
|
20
|
+
export declare const $feFuncA: import("./types").SvgElementFactory<SVGFEFuncAElement>;
|
|
21
|
+
export declare const $feFuncB: import("./types").SvgElementFactory<SVGFEFuncBElement>;
|
|
22
|
+
export declare const $feFuncG: import("./types").SvgElementFactory<SVGFEFuncGElement>;
|
|
23
|
+
export declare const $feFuncR: import("./types").SvgElementFactory<SVGFEFuncRElement>;
|
|
24
|
+
export declare const $feGaussianBlur: import("./types").SvgElementFactory<SVGFEGaussianBlurElement>;
|
|
25
|
+
export declare const $feImage: import("./types").SvgElementFactory<SVGFEImageElement>;
|
|
26
|
+
export declare const $feMerge: import("./types").SvgElementFactory<SVGFEMergeElement>;
|
|
27
|
+
export declare const $feMergeNode: import("./types").SvgElementFactory<SVGFEMergeNodeElement>;
|
|
28
|
+
export declare const $feMorphology: import("./types").SvgElementFactory<SVGFEMorphologyElement>;
|
|
29
|
+
export declare const $feOffset: import("./types").SvgElementFactory<SVGFEOffsetElement>;
|
|
30
|
+
export declare const $fePointLight: import("./types").SvgElementFactory<SVGFEPointLightElement>;
|
|
31
|
+
export declare const $feSpecularLighting: import("./types").SvgElementFactory<SVGFESpecularLightingElement>;
|
|
32
|
+
export declare const $feSpotLight: import("./types").SvgElementFactory<SVGFESpotLightElement>;
|
|
33
|
+
export declare const $feTile: import("./types").SvgElementFactory<SVGFETileElement>;
|
|
34
|
+
export declare const $feTurbulence: import("./types").SvgElementFactory<SVGFETurbulenceElement>;
|
|
35
|
+
export declare const $filter: import("./types").SvgElementFactory<SVGFilterElement>;
|
|
36
|
+
export declare const $foreignObject: import("./types").SvgElementFactory<SVGForeignObjectElement>;
|
|
37
|
+
export declare const $g: import("./types").SvgElementFactory<SVGGElement>;
|
|
38
|
+
export declare const $image: import("./types").SvgElementFactory<SVGImageElement>;
|
|
39
|
+
export declare const $line: import("./types").SvgElementFactory<SVGLineElement>;
|
|
40
|
+
export declare const $linearGradient: import("./types").SvgElementFactory<SVGLinearGradientElement>;
|
|
41
|
+
export declare const $marker: import("./types").SvgElementFactory<SVGMarkerElement>;
|
|
42
|
+
export declare const $mask: import("./types").SvgElementFactory<SVGMaskElement>;
|
|
43
|
+
export declare const $metadata: import("./types").SvgElementFactory<SVGMetadataElement>;
|
|
44
|
+
export declare const $mpath: import("./types").SvgElementFactory<SVGMPathElement>;
|
|
45
|
+
export declare const $path: import("./types").SvgElementFactory<SVGPathElement>;
|
|
46
|
+
export declare const $pattern: import("./types").SvgElementFactory<SVGPatternElement>;
|
|
47
|
+
export declare const $polygon: import("./types").SvgElementFactory<SVGPolygonElement>;
|
|
48
|
+
export declare const $polyline: import("./types").SvgElementFactory<SVGPolylineElement>;
|
|
49
|
+
export declare const $radialGradient: import("./types").SvgElementFactory<SVGRadialGradientElement>;
|
|
50
|
+
export declare const $rect: import("./types").SvgElementFactory<SVGRectElement>;
|
|
51
|
+
export declare const $script: import("./types").SvgElementFactory<SVGScriptElement>;
|
|
52
|
+
export declare const $set: import("./types").SvgElementFactory<SVGSetElement>;
|
|
53
|
+
export declare const $stop: import("./types").SvgElementFactory<SVGStopElement>;
|
|
54
|
+
export declare const $style: import("./types").SvgElementFactory<SVGStyleElement>;
|
|
55
|
+
export declare const $svg: import("./types").SvgElementFactory<SVGSVGElement>;
|
|
56
|
+
export declare const $switch: import("./types").SvgElementFactory<SVGSwitchElement>;
|
|
57
|
+
export declare const $symbol: import("./types").SvgElementFactory<SVGSymbolElement>;
|
|
58
|
+
export declare const $text: import("./types").SvgElementFactory<SVGTextElement>;
|
|
59
|
+
export declare const $textPath: import("./types").SvgElementFactory<SVGTextPathElement>;
|
|
60
|
+
export declare const $title: import("./types").SvgElementFactory<SVGTitleElement>;
|
|
61
|
+
export declare const $tspan: import("./types").SvgElementFactory<SVGTSpanElement>;
|
|
62
|
+
export declare const $use: import("./types").SvgElementFactory<SVGUseElement>;
|
|
63
|
+
export declare const $view: import("./types").SvgElementFactory<SVGViewElement>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AttributeProps, AttributeValue, Child, ClassValue, EventProps, MaybeAccessor, StyleValue } from "../dom/types";
|
|
2
|
+
export type SvgAttributeName = "id" | "href" | "lang" | "tabindex" | "role" | "focusable" | "viewBox" | "preserveAspectRatio" | "xmlns" | "width" | "height" | "x" | "y" | "x1" | "y1" | "x2" | "y2" | "cx" | "cy" | "r" | "rx" | "ry" | "fx" | "fy" | "dx" | "dy" | "d" | "points" | "pathLength" | "transform" | "rotate" | "fill" | "fill-opacity" | "fill-rule" | "stroke" | "stroke-width" | "stroke-linecap" | "stroke-linejoin" | "stroke-dasharray" | "stroke-dashoffset" | "stroke-opacity" | "stroke-miterlimit" | "opacity" | "color" | "display" | "visibility" | "overflow" | "pointer-events" | "cursor" | "clip-path" | "clip-rule" | "clipPathUnits" | "mask" | "maskUnits" | "maskContentUnits" | "filter" | "filterUnits" | "primitiveUnits" | "vector-effect" | "shape-rendering" | "paint-order" | "marker-start" | "marker-mid" | "marker-end" | "markerWidth" | "markerHeight" | "markerUnits" | "orient" | "refX" | "refY" | "offset" | "stop-color" | "stop-opacity" | "gradientUnits" | "gradientTransform" | "spreadMethod" | "patternUnits" | "patternContentUnits" | "patternTransform" | "text-anchor" | "dominant-baseline" | "font-family" | "font-size" | "font-weight" | "textLength" | "lengthAdjust" | "in" | "in2" | "result" | "stdDeviation" | "mode" | "type" | "values" | "operator" | "attributeName" | "from" | "to" | "dur" | "begin" | "repeatCount" | "keyTimes" | "calcMode";
|
|
3
|
+
export type SvgProps<E extends SVGElement> = AttributeProps & EventProps<E> & {
|
|
4
|
+
[K in SvgAttributeName]?: MaybeAccessor<AttributeValue>;
|
|
5
|
+
} & {
|
|
6
|
+
class?: ClassValue | (() => ClassValue);
|
|
7
|
+
style?: StyleValue | (() => StyleValue);
|
|
8
|
+
ref?: (element: E) => void;
|
|
9
|
+
};
|
|
10
|
+
export interface SvgElementFactory<E extends SVGElement> {
|
|
11
|
+
(props?: SvgProps<E> | null, children?: Child): E;
|
|
12
|
+
(children: Child): E;
|
|
13
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "keits",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "Fine-grained reactive TypeScript framework. Real DOM, no virtual DOM, zero dependencies.",
|
|
5
|
+
"keywords": ["reactive", "signals", "framework", "typescript", "fine-grained", "no-vdom"],
|
|
6
|
+
"author": "Michael Ranni",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"sideEffects": false,
|
|
10
|
+
"files": ["dist"],
|
|
11
|
+
"types": "./dist/types/index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"@keits/source": "./src/index.ts",
|
|
15
|
+
"types": "./dist/types/index.d.ts",
|
|
16
|
+
"development": "./dist/dev/index.js",
|
|
17
|
+
"default": "./dist/prod/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./svg": {
|
|
20
|
+
"@keits/source": "./src/svg/index.ts",
|
|
21
|
+
"types": "./dist/types/svg/index.d.ts",
|
|
22
|
+
"development": "./dist/dev/svg.js",
|
|
23
|
+
"default": "./dist/prod/svg.js"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "node ../../scripts/build.mjs && tsc -p tsconfig.build.json",
|
|
28
|
+
"size": "node ../../scripts/size.mjs",
|
|
29
|
+
"prepublishOnly": "cd ../.. && npm run check"
|
|
30
|
+
},
|
|
31
|
+
"size-budget": {
|
|
32
|
+
"dist/prod/index.js": 5376,
|
|
33
|
+
"size/basic.js": 1792,
|
|
34
|
+
"size/dom-basic.js": 3072,
|
|
35
|
+
"size/svg-icon.js": 3328
|
|
36
|
+
}
|
|
6
37
|
}
|