keits 0.0.4 → 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.
Files changed (70) hide show
  1. package/README.md +93 -79
  2. package/dist/dev/api.js +8 -3
  3. package/dist/dev/forms.js +6 -4
  4. package/dist/dev/index.js +26 -35
  5. package/dist/dev/router.js +24 -7
  6. package/dist/dev/shared/{computed-3UO-KiH1.js → computed-DrF8O8b4.js} +1 -1
  7. package/dist/dev/shared/{element-CQPqagu1.js → element-DXwmUAnz.js} +30 -76
  8. package/dist/dev/shared/{graph-D6-x_CWC.js → graph-SIvYLXSv.js} +62 -3
  9. package/dist/dev/shared/hydrate-C8cOsDDH.js +588 -0
  10. package/dist/dev/shared/mount-CDB2HgN5.js +23 -0
  11. package/dist/dev/shared/namespaces-Cz82B0Pr.js +84 -0
  12. package/dist/dev/shared/{owner-Dmge21OW.js → owner-BuwIoI4j.js} +12 -2
  13. package/dist/dev/shared/render-context-k2uu_dM_.js +34 -0
  14. package/dist/dev/shared/render-effect-Uk9dDmuU.js +32 -0
  15. package/dist/dev/shared/{resource-CbXVATvq.js → resource-DlgzdtcG.js} +24 -33
  16. package/dist/dev/shared/{signal-BOXkY-Iv.js → signal-B3xOKbVm.js} +1 -1
  17. package/dist/dev/shared/{store-BzUN1qE5.js → store-0vEg2bQV.js} +7 -3
  18. package/dist/dev/shared/unsafe-keys-CB1P22No.js +8 -0
  19. package/dist/dev/static.js +76 -0
  20. package/dist/dev/svg.js +2 -1
  21. package/dist/dev/testing.js +216 -0
  22. package/dist/dev/vite.js +141 -0
  23. package/dist/prod/api.js +76 -71
  24. package/dist/prod/forms.js +63 -60
  25. package/dist/prod/index.js +56 -64
  26. package/dist/prod/router.js +86 -73
  27. package/dist/prod/shared/{computed-CAPpOLCY.js → computed-BjqJ6Pps.js} +1 -1
  28. package/dist/prod/shared/element-DCit4-3e.js +129 -0
  29. package/dist/prod/shared/{graph-C_aA46c6.js → graph-CR2WKbwr.js} +107 -63
  30. package/dist/prod/shared/hydrate-kKnJbkV7.js +480 -0
  31. package/dist/prod/shared/mount-DbeKIoyD.js +18 -0
  32. package/dist/prod/shared/namespaces-BSRrBJIU.js +71 -0
  33. package/dist/prod/shared/owner-DBi3odT4.js +67 -0
  34. package/dist/prod/shared/render-context-DF8lr1uu.js +30 -0
  35. package/dist/prod/shared/render-effect-UFDi2Pfh.js +25 -0
  36. package/dist/prod/shared/resource-Ch5tVseZ.js +91 -0
  37. package/dist/prod/shared/signal-BDMlfa0Z.js +16 -0
  38. package/dist/prod/shared/store-CvW0DbmK.js +110 -0
  39. package/dist/prod/shared/unsafe-keys-C5PMlerl.js +7 -0
  40. package/dist/prod/static.js +48 -0
  41. package/dist/prod/svg.js +3 -2
  42. package/dist/prod/testing.js +144 -0
  43. package/dist/prod/vite.js +106 -0
  44. package/dist/types/async/render-context.d.ts +10 -0
  45. package/dist/types/core/effect.d.ts +1 -0
  46. package/dist/types/core/graph.d.ts +11 -0
  47. package/dist/types/core/owner.d.ts +1 -0
  48. package/dist/types/core/unsafe-keys.d.ts +2 -0
  49. package/dist/types/dom/hooks.d.ts +4 -0
  50. package/dist/types/dom/types.d.ts +5 -0
  51. package/dist/types/router/index.d.ts +1 -0
  52. package/dist/types/router/match.d.ts +1 -0
  53. package/dist/types/router/types.d.ts +1 -0
  54. package/dist/types/static/head.d.ts +36 -0
  55. package/dist/types/static/hydrate.d.ts +3 -0
  56. package/dist/types/static/index.d.ts +4 -0
  57. package/dist/types/static/island.d.ts +14 -0
  58. package/dist/types/static/json.d.ts +1 -0
  59. package/dist/types/static/render.d.ts +11 -0
  60. package/dist/types/static/server-dom.d.ts +100 -0
  61. package/dist/types/testing/index.d.ts +62 -0
  62. package/dist/types/vite/index.d.ts +24 -0
  63. package/package.json +34 -7
  64. package/dist/dev/shared/render-effect-kOGnLNbL.js +0 -26
  65. package/dist/prod/shared/element-DGyQ01Vs.js +0 -164
  66. package/dist/prod/shared/owner-6BFHIPR9.js +0 -59
  67. package/dist/prod/shared/render-effect-DjaUT3Cn.js +0 -23
  68. package/dist/prod/shared/resource-CNC2DBO3.js +0 -109
  69. package/dist/prod/shared/signal-DGrl3r9T.js +0 -16
  70. package/dist/prod/shared/store-Dcscpk_h.js +0 -109
@@ -0,0 +1,36 @@
1
+ import type { MaybeAccessor } from "../dom/types";
2
+ type Text = MaybeAccessor<string | undefined>;
3
+ export interface HeadTags {
4
+ title?: Text;
5
+ description?: Text;
6
+ canonical?: Text;
7
+ robots?: Text;
8
+ og?: Readonly<Record<string, Text>>;
9
+ twitter?: Readonly<Record<string, Text>>;
10
+ meta?: readonly {
11
+ name?: string;
12
+ property?: string;
13
+ content: Text;
14
+ }[];
15
+ link?: readonly (Readonly<Record<string, string>> & {
16
+ rel: string;
17
+ href: string;
18
+ })[];
19
+ jsonLd?: MaybeAccessor<object | readonly object[] | undefined>;
20
+ }
21
+ export interface HeadTag {
22
+ key: string;
23
+ tag: "title" | "meta" | "link" | "script";
24
+ attrs: Record<string, string>;
25
+ text?: string;
26
+ selector: string;
27
+ }
28
+ export interface HeadRegistry {
29
+ set(token: object, tags: HeadTag[]): void;
30
+ remove(token: object): void;
31
+ winners(): Map<string, HeadTag>;
32
+ }
33
+ export declare const HeadContext: import("..").Context<HeadRegistry | null>;
34
+ export declare function head(tags: HeadTags): void;
35
+ export declare function createHeadRegistry(changed?: (winners: Map<string, HeadTag>) => void): HeadRegistry;
36
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { Child } from "../dom/types";
2
+ export declare function resetHydrationData(): void;
3
+ export declare function hydrate(app: () => Child, container: Element, key?: string): () => void;
@@ -0,0 +1,4 @@
1
+ export { renderToString, type RenderOptions, type RenderResult } from "./render";
2
+ export { head, type HeadTags } from "./head";
3
+ export { hydrate } from "./hydrate";
4
+ export { hydrateIslands, island, type Island, type IslandEntry, type IslandWhen } from "./island";
@@ -0,0 +1,14 @@
1
+ import type { Child } from "../dom/types";
2
+ export type IslandWhen = "load" | "idle" | "visible";
3
+ export interface Island<P> {
4
+ (props: P): Child;
5
+ readonly island: string;
6
+ readonly component: (props: P) => Child;
7
+ }
8
+ export type IslandEntry = Island<never> | (() => PromiseLike<Island<never> | {
9
+ default: Island<never>;
10
+ }>);
11
+ export declare function island<P = void>(name: string, component: (props: P) => Child, options?: {
12
+ when?: IslandWhen;
13
+ }): Island<P>;
14
+ export declare function hydrateIslands(islands: Readonly<Record<string, IslandEntry>>, root?: ParentNode): void;
@@ -0,0 +1 @@
1
+ export declare function scriptJson(value: unknown): string;
@@ -0,0 +1,11 @@
1
+ import type { Child } from "../dom/types";
2
+ export interface RenderOptions {
3
+ timeout?: number;
4
+ hydrate?: boolean;
5
+ }
6
+ export interface RenderResult {
7
+ html: string;
8
+ head: string;
9
+ data: string;
10
+ }
11
+ export declare function renderToString(app: () => Child, options?: RenderOptions): Promise<RenderResult>;
@@ -0,0 +1,100 @@
1
+ import type { NodeHooks } from "../dom/hooks";
2
+ declare abstract class ServerNode {
3
+ abstract readonly nodeType: number;
4
+ parentNode: ServerParent | null;
5
+ previousSibling: ServerNode | null;
6
+ nextSibling: ServerNode | null;
7
+ remove(): void;
8
+ before(...nodes: (ServerNode | string)[]): void;
9
+ after(...nodes: (ServerNode | string)[]): void;
10
+ abstract get textContent(): string;
11
+ abstract print(out: string[], rawText: boolean): void;
12
+ }
13
+ declare abstract class ServerParent extends ServerNode {
14
+ firstChild: ServerNode | null;
15
+ lastChild: ServerNode | null;
16
+ insertBefore<N extends ServerNode>(node: N, before: ServerNode | null): N;
17
+ appendChild<N extends ServerNode>(node: N): N;
18
+ append(...nodes: (ServerNode | string)[]): void;
19
+ removeChild<N extends ServerNode>(node: N): N;
20
+ get textContent(): string;
21
+ set textContent(value: string);
22
+ printChildren(out: string[], rawText: boolean): void;
23
+ }
24
+ export declare class ServerFragment extends ServerParent {
25
+ readonly nodeType = 11;
26
+ print(out: string[], rawText: boolean): void;
27
+ }
28
+ export declare class ServerText extends ServerNode {
29
+ readonly nodeType = 3;
30
+ data: string;
31
+ constructor(data: string);
32
+ get textContent(): string;
33
+ print(out: string[], rawText: boolean): void;
34
+ }
35
+ export declare class ServerComment extends ServerNode {
36
+ readonly nodeType = 8;
37
+ data: string;
38
+ constructor(data: string);
39
+ get textContent(): string;
40
+ print(): void;
41
+ }
42
+ export declare class ServerRawHTML extends ServerNode {
43
+ readonly nodeType = 3;
44
+ readonly html: string;
45
+ constructor(html: string);
46
+ get textContent(): string;
47
+ print(out: string[]): void;
48
+ }
49
+ export declare const SAFE_NAME: RegExp;
50
+ export declare class ServerElement extends ServerParent {
51
+ #private;
52
+ readonly nodeType = 1;
53
+ readonly localName: string;
54
+ readonly namespaceURI: string | null;
55
+ readonly classList: ServerClassList;
56
+ readonly style: ServerStyle;
57
+ constructor(tag: string, namespace: string | null);
58
+ getAttribute(name: string): string | null;
59
+ hasAttribute(name: string): boolean;
60
+ setAttribute(name: string, value: string): void;
61
+ removeAttribute(name: string): void;
62
+ toggleAttribute(name: string, force?: boolean): boolean;
63
+ get value(): unknown;
64
+ set value(value: unknown);
65
+ get checked(): boolean;
66
+ set checked(value: boolean);
67
+ get selected(): boolean;
68
+ set selected(value: boolean);
69
+ get textContent(): string;
70
+ set textContent(value: string);
71
+ set className(value: string);
72
+ set htmlFor(value: string);
73
+ set draggable(value: boolean);
74
+ set spellcheck(value: boolean);
75
+ print(out: string[]): void;
76
+ }
77
+ export declare class ServerClassList {
78
+ #private;
79
+ constructor(element: ServerElement);
80
+ contains(name: string): boolean;
81
+ add(...names: string[]): void;
82
+ remove(...names: string[]): void;
83
+ toggle(name: string, force?: boolean): boolean;
84
+ }
85
+ export declare class ServerStyle {
86
+ #private;
87
+ constructor(element: ServerElement);
88
+ getPropertyValue(name: string): string;
89
+ setProperty(name: string, value: string): void;
90
+ removeProperty(name: string): string;
91
+ get cssText(): string;
92
+ set cssText(text: string);
93
+ get display(): string;
94
+ set display(value: string);
95
+ }
96
+ export declare function escapeText(text: string): string;
97
+ export declare function escapeAttribute(text: string): string;
98
+ export declare const serverHooks: NodeHooks;
99
+ export declare function printNode(node: Node): string;
100
+ export {};
@@ -0,0 +1,62 @@
1
+ import type { Child } from "../dom/types";
2
+ /** Queries inside one element. They throw a readable error when nothing (or more than one) matches. */
3
+ export interface Queries {
4
+ /** The one element whose text is `text` (the innermost, if they're nested). */
5
+ getByText(text: string | RegExp): HTMLElement;
6
+ queryByText(text: string | RegExp): HTMLElement | null;
7
+ getAllByText(text: string | RegExp): HTMLElement[];
8
+ /** By ARIA role (explicit, or what the tag means: button, link, textbox, checkbox, heading...), and accessible name. */
9
+ getByRole(role: string, options?: {
10
+ name?: string | RegExp;
11
+ }): HTMLElement;
12
+ queryByRole(role: string, options?: {
13
+ name?: string | RegExp;
14
+ }): HTMLElement | null;
15
+ getAllByRole(role: string, options?: {
16
+ name?: string | RegExp;
17
+ }): HTMLElement[];
18
+ /** The form control a <label> (or aria-label) names. */
19
+ getByLabelText(text: string | RegExp): HTMLElement;
20
+ /** By data-testid, for things a user can't name. */
21
+ getByTestId(id: string): HTMLElement;
22
+ }
23
+ export interface Rendered extends Queries {
24
+ /** The element the app was mounted into. */
25
+ container: HTMLElement;
26
+ /** Disposes the app and removes it (cleanup() does this for every render). */
27
+ unmount(): void;
28
+ }
29
+ /** Mounts `app` into a fresh element in the document. */
30
+ export declare function render(app: () => Child): Rendered;
31
+ /**
32
+ * Renders `app` like the server does (waiting for its data), and puts the HTML in the page the way
33
+ * a browser receives it. Then `hydrate()` makes it live, as the browser would.
34
+ */
35
+ export declare function renderOnServer(app: () => Child): Promise<{
36
+ container: HTMLElement;
37
+ html: string;
38
+ head: string;
39
+ hydrate(): Rendered;
40
+ }>;
41
+ /** Disposes everything render() and renderOnServer() made. Call it after each test: `afterEach(cleanup)`. */
42
+ export declare function cleanup(): void;
43
+ /** Waits until pending promises and timers of 0 ms have run (loaded data shows, effects settle). */
44
+ export declare function flush(): Promise<void>;
45
+ /** Acts like a user would: the events a browser fires, in its order. */
46
+ export declare const user: {
47
+ click(element: Element): void;
48
+ /** Types `text` one character at a time (an `input` event each), after the current value. */
49
+ type(element: Element, text: string): void;
50
+ /** Empties a text field. */
51
+ clear(element: Element): void;
52
+ /** Picks an option of a <select> by its value. */
53
+ select(element: Element, value: string): void;
54
+ /** Ticks or unticks a checkbox, or picks a radio. */
55
+ check(element: Element): void;
56
+ /** Leaves a field (what makes keits/forms show its error). */
57
+ blur(element: Element): void;
58
+ /** Submits a form (or the form an element is in), like pressing Enter in it. */
59
+ submit(element: Element): void;
60
+ };
61
+ /** The queries, scoped to `root`. */
62
+ export declare function within(root: Element): Queries;
@@ -0,0 +1,24 @@
1
+ import type { Plugin } from "vite";
2
+ import type { RenderResult } from "../static/render";
3
+ export interface Page {
4
+ url: string;
5
+ version?: string;
6
+ sitemap?: boolean;
7
+ }
8
+ export interface ServerEntry {
9
+ pages(): Iterable<string | Page> | Promise<Iterable<string | Page>>;
10
+ render(url: string): RenderResult | Promise<RenderResult>;
11
+ }
12
+ export interface KeitsOptions {
13
+ entry: string;
14
+ site?: string;
15
+ cacheDir?: string;
16
+ }
17
+ export interface BuildReport {
18
+ changed: string[];
19
+ removed: string[];
20
+ rendered: number;
21
+ reused: number;
22
+ }
23
+ export declare function keits(options: KeitsOptions): Plugin;
24
+ export declare function fileFor(url: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keits",
3
- "version": "0.0.4",
3
+ "version": "0.1.0",
4
4
  "description": "Fine-grained reactive TypeScript framework. Real DOM, no virtual DOM, zero dependencies.",
5
5
  "keywords": [
6
6
  "reactive",
@@ -48,6 +48,23 @@
48
48
  "types": "./dist/types/forms/index.d.ts",
49
49
  "development": "./dist/dev/forms.js",
50
50
  "default": "./dist/prod/forms.js"
51
+ },
52
+ "./static": {
53
+ "@keits/source": "./src/static/index.ts",
54
+ "types": "./dist/types/static/index.d.ts",
55
+ "development": "./dist/dev/static.js",
56
+ "default": "./dist/prod/static.js"
57
+ },
58
+ "./testing": {
59
+ "@keits/source": "./src/testing/index.ts",
60
+ "types": "./dist/types/testing/index.d.ts",
61
+ "development": "./dist/dev/testing.js",
62
+ "default": "./dist/prod/testing.js"
63
+ },
64
+ "./vite": {
65
+ "@keits/source": "./src/vite/index.ts",
66
+ "types": "./dist/types/vite/index.d.ts",
67
+ "default": "./dist/prod/vite.js"
51
68
  }
52
69
  },
53
70
  "scripts": {
@@ -56,13 +73,23 @@
56
73
  "prepublishOnly": "cd ../.. && npm run check"
57
74
  },
58
75
  "size-budget": {
59
- "dist/prod/index.js": 7168,
76
+ "dist/prod/index.js": 7680,
60
77
  "size/basic.js": 1792,
61
- "size/dom-basic.js": 3072,
78
+ "size/dom-basic.js": 3328,
62
79
  "size/svg-icon.js": 3328,
63
- "size/data-app.js": 5120,
64
- "size/router-app.js": 6144,
65
- "size/api-app.js": 6656,
66
- "size/forms-app.js": 6656
80
+ "size/data-app.js": 5184,
81
+ "size/router-app.js": 6400,
82
+ "size/api-app.js": 6912,
83
+ "size/forms-app.js": 6656,
84
+ "size/head.js": 4096,
85
+ "size/islands.js": 4096
86
+ },
87
+ "peerDependencies": {
88
+ "vite": ">=8"
89
+ },
90
+ "peerDependenciesMeta": {
91
+ "vite": {
92
+ "optional": true
93
+ }
67
94
  }
68
95
  }
@@ -1,26 +0,0 @@
1
- import { f as runEffect, i as batch, l as isStaticRender, r as adopt } from "./graph-D6-x_CWC.js";
2
- // src/core/effect.ts
3
- function effect(fn, options) {
4
- if (isStaticRender()) return;
5
- const node = {
6
- kind: 1,
7
- fn,
8
- state: 0,
9
- sources: [],
10
- flushId: 0,
11
- flushRuns: 0,
12
- owner: null,
13
- children: null,
14
- cleanups: null,
15
- disposed: false
16
- };
17
- if (options?.name !== void 0) node.name = options.name;
18
- adopt(node);
19
- batch(() => runEffect(node));
20
- }
21
- // src/dom/render-effect.ts
22
- function renderEffect(fn) {
23
- if (isStaticRender()) fn();
24
- else effect(fn);
25
- }
26
- export { effect as n, renderEffect as t };
@@ -1,164 +0,0 @@
1
- import { t as e } from "./render-effect-DjaUT3Cn.js";
2
- import { c as t, i as n, l as r, p as i, s as a } from "./graph-C_aA46c6.js";
3
- var o = {
4
- element: (e, t) => t === null ? document.createElement(e) : document.createElementNS(t, e),
5
- text: (e) => document.createTextNode(e),
6
- marker: () => document.createComment("")
7
- };
8
- // src/dom/insert.ts
9
- function s(e, t, n = null) {
10
- if (t != null && typeof t != "boolean") {
11
- if (typeof t == "function") return d(e, t, n);
12
- if (c(t)) for (let r of t) s(e, r, n);
13
- else typeof t == "object" ? e.insertBefore(t, n) : e.insertBefore(o.text(String(t)), n);
14
- }
15
- }
16
- function c(e) {
17
- return Array.isArray(e);
18
- }
19
- function l(e) {
20
- return e === null || typeof e != "object" && typeof e != "function";
21
- }
22
- function u(e) {
23
- return e == null || typeof e == "boolean" ? "" : String(e);
24
- }
25
- function d(t, n, r) {
26
- let i = o.text("");
27
- t.insertBefore(i, r);
28
- let a = null, c = null;
29
- e(() => {
30
- let e = n();
31
- if (a === null || c === null) {
32
- if (l(e)) {
33
- let t = u(e);
34
- i.data !== t && (i.data = t);
35
- return;
36
- }
37
- a = o.marker(), c = o.marker(), i.before(a), i.after(c), i.remove();
38
- }
39
- f(a, c), s(c.parentNode, e, c);
40
- });
41
- }
42
- function f(e, t) {
43
- let n = e.nextSibling;
44
- for (; n !== null && n !== t;) {
45
- let e = n.nextSibling;
46
- n.remove(), n = e;
47
- }
48
- }
49
- // src/dom/events.ts
50
- function p(e, t, n) {
51
- let i = n, a;
52
- if (Array.isArray(n) && ([i, a] = n), typeof i != "function") throw Error("[keits] bad handler");
53
- r() || m(e, t.slice(2), i, a);
54
- }
55
- function m(e, r, o, s) {
56
- let c = a();
57
- e.addEventListener(r, (e) => {
58
- n(() => {
59
- try {
60
- let r = i(c, () => o(e));
61
- h(r) && r.then(void 0, (e) => n(() => t(e, c)));
62
- } catch (e) {
63
- t(e, c);
64
- }
65
- });
66
- }, s);
67
- }
68
- function h(e) {
69
- return typeof e?.then == "function";
70
- }
71
- // src/dom/namespaces.ts
72
- var g = "http://www.w3.org/2000/svg", _ = /* @__PURE__ */ new Set([
73
- "innerHTML",
74
- "outerHTML",
75
- "srcdoc"
76
- ]), v = /* @__PURE__ */ new Set([
77
- "href",
78
- "src",
79
- "action",
80
- "formAction",
81
- "formaction",
82
- "poster",
83
- "cite",
84
- "data",
85
- "xlink:href"
86
- ]), y = "about:invalid#keits-blocked";
87
- function b(t, n) {
88
- for (let r in n) {
89
- let i = n[r];
90
- r !== "ref" && (r === "class" ? w(t, i) : r === "style" ? O(t, i) : r.startsWith("on") ? p(t, r, i) : typeof i == "function" ? e(() => x(t, r, i())) : x(t, r, i));
91
- }
92
- }
93
- function x(e, t, n) {
94
- if (_.has(t)) throw Error("[keits] unsafe prop");
95
- v.has(t) && typeof n == "string" && S(n) && (n = y), t in e && e.namespaceURI !== "http://www.w3.org/2000/svg" ? (e[t] = n, r() && C(e, t, n)) : n == null || n === !1 ? e.removeAttribute(t) : e.setAttribute(t, n === !0 ? "" : String(n));
96
- }
97
- function S(e) {
98
- return e.replace(/[\u0000-\u0020]/g, "").toLowerCase().startsWith("javascript");
99
- }
100
- function C(e, t, n) {
101
- t === "value" ? e.localName === "textarea" ? e.textContent = n == null ? "" : String(n) : n == null ? e.removeAttribute("value") : e.setAttribute("value", String(n)) : (t === "checked" || t === "selected") && e.toggleAttribute(t, n === !0);
102
- }
103
- function w(t, n) {
104
- if (typeof n == "function") {
105
- e(() => T(t, D(n())));
106
- return;
107
- }
108
- let r = [];
109
- E(n, r, (n, r) => {
110
- e(() => t.classList.toggle(n, r()));
111
- }), r.length > 0 && t.classList.add(...r);
112
- }
113
- function T(e, t) {
114
- t === "" ? e.removeAttribute("class") : e.setAttribute("class", t);
115
- }
116
- function E(e, t, n) {
117
- if (e) {
118
- if (typeof e == "string") for (let n of e.split(/\s+/)) n && t.push(n);
119
- else if (Array.isArray(e)) for (let r of e) E(r, t, n);
120
- else for (let [r, i] of Object.entries(e)) typeof i == "function" ? n ? n(r, i) : i() && t.push(r) : i && t.push(r);
121
- }
122
- }
123
- function D(e) {
124
- let t = [];
125
- return E(e, t), t.join(" ");
126
- }
127
- function O(t, n) {
128
- let r = t.style;
129
- if (typeof n == "function") {
130
- let t = [];
131
- e(() => {
132
- let e = n();
133
- if (typeof e == "string" || e == null) {
134
- r.cssText = e ?? "", t = [];
135
- return;
136
- }
137
- let i = Object.keys(e);
138
- for (let n of t) n in e || r.removeProperty(n);
139
- for (let t of i) A(r, t, k(e[t]));
140
- t = i;
141
- });
142
- } else if (typeof n == "string") r.cssText = n;
143
- else if (n != null) for (let [t, i] of Object.entries(n)) typeof i == "function" ? e(() => A(r, t, i())) : A(r, t, i);
144
- }
145
- function k(e) {
146
- return typeof e == "function" ? e() : e;
147
- }
148
- function A(e, t, n) {
149
- n == null || n === "" ? e.removeProperty(t) : e.setProperty(t, String(n));
150
- }
151
- // src/dom/element.ts
152
- function j(e) {
153
- return M(e, null);
154
- }
155
- function M(e, t) {
156
- return (n, r) => {
157
- let i = o.element(e, t);
158
- return N(n) ? (s(i, r), b(i, n), typeof n.ref == "function" && n.ref(i)) : n == null ? s(i, r) : s(i, n), i;
159
- };
160
- }
161
- function N(e) {
162
- return typeof e == "object" && !!e && !Array.isArray(e) && typeof e.nodeType != "number";
163
- }
164
- export { o as a, s as i, j as n, g as r, M as t };
@@ -1,59 +0,0 @@
1
- import { _ as e, c as t, i as n, n as r, o as i, p as a, r as o, s, t as c } from "./graph-C_aA46c6.js";
2
- // src/core/owner.ts
3
- function l() {
4
- return s();
5
- }
6
- function u(e, t) {
7
- return a(e, t);
8
- }
9
- function d(e) {
10
- let t = {
11
- kind: 3,
12
- owner: s(),
13
- children: null,
14
- cleanups: null,
15
- disposed: !1,
16
- handler: null
17
- }, r = () => n(() => i(t));
18
- return n(() => {
19
- try {
20
- return a(t, () => e(r));
21
- } catch (e) {
22
- throw i(t), e;
23
- }
24
- });
25
- }
26
- function f(e) {
27
- c(e);
28
- }
29
- function p(e) {
30
- r(e);
31
- }
32
- function m(e, r) {
33
- let i = {
34
- kind: 3,
35
- owner: null,
36
- children: null,
37
- cleanups: null,
38
- disposed: !1,
39
- handler: r
40
- };
41
- return o(i), n(() => {
42
- try {
43
- return a(i, e);
44
- } catch (e) {
45
- t(e, i);
46
- return;
47
- }
48
- });
49
- }
50
- function h(t) {
51
- return e(() => d((e) => {
52
- try {
53
- return t();
54
- } finally {
55
- e();
56
- }
57
- }));
58
- }
59
- export { p as a, f as i, d as n, h as o, l as r, u as s, m as t };
@@ -1,23 +0,0 @@
1
- import { f as e, i as t, l as n, r } from "./graph-C_aA46c6.js";
2
- // src/core/effect.ts
3
- function i(i, a) {
4
- if (n()) return;
5
- let o = {
6
- kind: 1,
7
- fn: i,
8
- state: 0,
9
- sources: [],
10
- flushId: 0,
11
- flushRuns: 0,
12
- owner: null,
13
- children: null,
14
- cleanups: null,
15
- disposed: !1
16
- };
17
- r(o), t(() => e(o));
18
- }
19
- // src/dom/render-effect.ts
20
- function a(e) {
21
- n() ? e() : i(e);
22
- }
23
- export { i as n, a as t };