keits 0.1.0 → 0.1.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.
Files changed (65) hide show
  1. package/dist/dev/forms.js +4 -1
  2. package/dist/dev/index.js +5 -3
  3. package/dist/dev/shared/element-Bgf6SNbW.js +21 -0
  4. package/dist/dev/shared/{hydrate-C8cOsDDH.js → hydrate-g_akkVyT.js} +1 -1
  5. package/dist/dev/shared/{element-DXwmUAnz.js → insert-DadcXJL8.js} +97 -21
  6. package/dist/dev/shared/{mount-CDB2HgN5.js → mount-BtpMEhSZ.js} +1 -1
  7. package/dist/dev/static.js +2 -2
  8. package/dist/dev/svg.js +2 -2
  9. package/dist/dev/testing.js +32 -12
  10. package/dist/prod/forms.js +40 -38
  11. package/dist/prod/index.js +36 -36
  12. package/dist/prod/shared/element-B-0tH1YW.js +15 -0
  13. package/dist/prod/shared/{hydrate-kKnJbkV7.js → hydrate-DhHCtdOz.js} +28 -28
  14. package/dist/prod/shared/insert-CbcOsYmu.js +192 -0
  15. package/dist/prod/shared/{mount-DbeKIoyD.js → mount-BEAO35S_.js} +1 -1
  16. package/dist/prod/static.js +2 -2
  17. package/dist/prod/svg.js +2 -2
  18. package/dist/prod/testing.js +35 -18
  19. package/dist/types/api/client.d.ts +2 -2
  20. package/dist/types/api/index.d.ts +3 -3
  21. package/dist/types/async/index.d.ts +2 -2
  22. package/dist/types/async/lazy.d.ts +1 -1
  23. package/dist/types/async/render-context.d.ts +2 -2
  24. package/dist/types/async/resource.d.ts +1 -1
  25. package/dist/types/async/suspense-context.d.ts +1 -1
  26. package/dist/types/core/computed.d.ts +1 -1
  27. package/dist/types/core/signal.d.ts +2 -2
  28. package/dist/types/dom/element.d.ts +1 -1
  29. package/dist/types/dom/index.d.ts +6 -6
  30. package/dist/types/dom/insert.d.ts +1 -1
  31. package/dist/types/dom/mount.d.ts +1 -1
  32. package/dist/types/dom/props.d.ts +2 -0
  33. package/dist/types/dom/tags.d.ts +112 -112
  34. package/dist/types/flow/catch.d.ts +1 -1
  35. package/dist/types/flow/dynamic.d.ts +1 -1
  36. package/dist/types/flow/for.d.ts +2 -2
  37. package/dist/types/flow/if.d.ts +2 -2
  38. package/dist/types/flow/index.d.ts +8 -8
  39. package/dist/types/flow/portal.d.ts +1 -1
  40. package/dist/types/flow/range.d.ts +1 -1
  41. package/dist/types/flow/suspense.d.ts +1 -1
  42. package/dist/types/flow/switch.d.ts +1 -1
  43. package/dist/types/forms/form.d.ts +3 -3
  44. package/dist/types/forms/index.d.ts +2 -2
  45. package/dist/types/index.d.ts +12 -12
  46. package/dist/types/router/index.d.ts +4 -4
  47. package/dist/types/router/match.d.ts +1 -1
  48. package/dist/types/router/router.d.ts +2 -2
  49. package/dist/types/router/types.d.ts +2 -2
  50. package/dist/types/static/head.d.ts +2 -2
  51. package/dist/types/static/hydrate.d.ts +1 -1
  52. package/dist/types/static/index.d.ts +4 -4
  53. package/dist/types/static/island.d.ts +1 -1
  54. package/dist/types/static/render.d.ts +1 -1
  55. package/dist/types/static/server-dom.d.ts +1 -1
  56. package/dist/types/svg/element.d.ts +1 -1
  57. package/dist/types/svg/index.d.ts +3 -3
  58. package/dist/types/svg/tags.d.ts +63 -63
  59. package/dist/types/svg/types.d.ts +1 -1
  60. package/dist/types/testing/index.d.ts +13 -6
  61. package/dist/types/vite/index.d.ts +1 -1
  62. package/package.json +8 -8
  63. package/dist/dev/shared/namespaces-Cz82B0Pr.js +0 -84
  64. package/dist/prod/shared/element-DCit4-3e.js +0 -129
  65. package/dist/prod/shared/namespaces-BSRrBJIU.js +0 -71
@@ -1,5 +1,5 @@
1
- import type { Child } from "../dom/types";
2
- import type { Accessor } from "../core/types";
1
+ import type { Child } from "../dom/types.js";
2
+ import type { Accessor } from "../core/types.js";
3
3
  export type QuerySpec = "string" | "number" | "boolean" | readonly string[];
4
4
  export type QuerySchema = Readonly<Record<string, QuerySpec>>;
5
5
  export type QueryValues<S> = {
@@ -1,4 +1,4 @@
1
- import type { MaybeAccessor } from "../dom/types";
1
+ import type { MaybeAccessor } from "../dom/types.js";
2
2
  type Text = MaybeAccessor<string | undefined>;
3
3
  export interface HeadTags {
4
4
  title?: Text;
@@ -30,7 +30,7 @@ export interface HeadRegistry {
30
30
  remove(token: object): void;
31
31
  winners(): Map<string, HeadTag>;
32
32
  }
33
- export declare const HeadContext: import("..").Context<HeadRegistry | null>;
33
+ export declare const HeadContext: import("../index.js").Context<HeadRegistry | null>;
34
34
  export declare function head(tags: HeadTags): void;
35
35
  export declare function createHeadRegistry(changed?: (winners: Map<string, HeadTag>) => void): HeadRegistry;
36
36
  export {};
@@ -1,3 +1,3 @@
1
- import type { Child } from "../dom/types";
1
+ import type { Child } from "../dom/types.js";
2
2
  export declare function resetHydrationData(): void;
3
3
  export declare function hydrate(app: () => Child, container: Element, key?: string): () => void;
@@ -1,4 +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";
1
+ export { renderToString, type RenderOptions, type RenderResult } from "./render.js";
2
+ export { head, type HeadTags } from "./head.js";
3
+ export { hydrate } from "./hydrate.js";
4
+ export { hydrateIslands, island, type Island, type IslandEntry, type IslandWhen } from "./island.js";
@@ -1,4 +1,4 @@
1
- import type { Child } from "../dom/types";
1
+ import type { Child } from "../dom/types.js";
2
2
  export type IslandWhen = "load" | "idle" | "visible";
3
3
  export interface Island<P> {
4
4
  (props: P): Child;
@@ -1,4 +1,4 @@
1
- import type { Child } from "../dom/types";
1
+ import type { Child } from "../dom/types.js";
2
2
  export interface RenderOptions {
3
3
  timeout?: number;
4
4
  hydrate?: boolean;
@@ -1,4 +1,4 @@
1
- import type { NodeHooks } from "../dom/hooks";
1
+ import type { NodeHooks } from "../dom/hooks.js";
2
2
  declare abstract class ServerNode {
3
3
  abstract readonly nodeType: number;
4
4
  parentNode: ServerParent | null;
@@ -1,2 +1,2 @@
1
- import type { SvgElementFactory } from "./types";
1
+ import type { SvgElementFactory } from "./types.js";
2
2
  export declare function svg<K extends keyof SVGElementTagNameMap>(tag: K): SvgElementFactory<SVGElementTagNameMap[K]>;
@@ -1,3 +1,3 @@
1
- export * from "./tags";
2
- export { svg } from "./element";
3
- export type { SvgAttributeName, SvgElementFactory, SvgProps } from "./types";
1
+ export * from "./tags.js";
2
+ export { svg } from "./element.js";
3
+ export type { SvgAttributeName, SvgElementFactory, SvgProps } from "./types.js";
@@ -1,63 +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>;
1
+ export declare const $a: import("./types.js").SvgElementFactory<SVGAElement>;
2
+ export declare const $animate: import("./types.js").SvgElementFactory<SVGAnimateElement>;
3
+ export declare const $animateMotion: import("./types.js").SvgElementFactory<SVGAnimateMotionElement>;
4
+ export declare const $animateTransform: import("./types.js").SvgElementFactory<SVGAnimateTransformElement>;
5
+ export declare const $circle: import("./types.js").SvgElementFactory<SVGCircleElement>;
6
+ export declare const $clipPath: import("./types.js").SvgElementFactory<SVGClipPathElement>;
7
+ export declare const $defs: import("./types.js").SvgElementFactory<SVGDefsElement>;
8
+ export declare const $desc: import("./types.js").SvgElementFactory<SVGDescElement>;
9
+ export declare const $ellipse: import("./types.js").SvgElementFactory<SVGEllipseElement>;
10
+ export declare const $feBlend: import("./types.js").SvgElementFactory<SVGFEBlendElement>;
11
+ export declare const $feColorMatrix: import("./types.js").SvgElementFactory<SVGFEColorMatrixElement>;
12
+ export declare const $feComponentTransfer: import("./types.js").SvgElementFactory<SVGFEComponentTransferElement>;
13
+ export declare const $feComposite: import("./types.js").SvgElementFactory<SVGFECompositeElement>;
14
+ export declare const $feConvolveMatrix: import("./types.js").SvgElementFactory<SVGFEConvolveMatrixElement>;
15
+ export declare const $feDiffuseLighting: import("./types.js").SvgElementFactory<SVGFEDiffuseLightingElement>;
16
+ export declare const $feDisplacementMap: import("./types.js").SvgElementFactory<SVGFEDisplacementMapElement>;
17
+ export declare const $feDistantLight: import("./types.js").SvgElementFactory<SVGFEDistantLightElement>;
18
+ export declare const $feDropShadow: import("./types.js").SvgElementFactory<SVGFEDropShadowElement>;
19
+ export declare const $feFlood: import("./types.js").SvgElementFactory<SVGFEFloodElement>;
20
+ export declare const $feFuncA: import("./types.js").SvgElementFactory<SVGFEFuncAElement>;
21
+ export declare const $feFuncB: import("./types.js").SvgElementFactory<SVGFEFuncBElement>;
22
+ export declare const $feFuncG: import("./types.js").SvgElementFactory<SVGFEFuncGElement>;
23
+ export declare const $feFuncR: import("./types.js").SvgElementFactory<SVGFEFuncRElement>;
24
+ export declare const $feGaussianBlur: import("./types.js").SvgElementFactory<SVGFEGaussianBlurElement>;
25
+ export declare const $feImage: import("./types.js").SvgElementFactory<SVGFEImageElement>;
26
+ export declare const $feMerge: import("./types.js").SvgElementFactory<SVGFEMergeElement>;
27
+ export declare const $feMergeNode: import("./types.js").SvgElementFactory<SVGFEMergeNodeElement>;
28
+ export declare const $feMorphology: import("./types.js").SvgElementFactory<SVGFEMorphologyElement>;
29
+ export declare const $feOffset: import("./types.js").SvgElementFactory<SVGFEOffsetElement>;
30
+ export declare const $fePointLight: import("./types.js").SvgElementFactory<SVGFEPointLightElement>;
31
+ export declare const $feSpecularLighting: import("./types.js").SvgElementFactory<SVGFESpecularLightingElement>;
32
+ export declare const $feSpotLight: import("./types.js").SvgElementFactory<SVGFESpotLightElement>;
33
+ export declare const $feTile: import("./types.js").SvgElementFactory<SVGFETileElement>;
34
+ export declare const $feTurbulence: import("./types.js").SvgElementFactory<SVGFETurbulenceElement>;
35
+ export declare const $filter: import("./types.js").SvgElementFactory<SVGFilterElement>;
36
+ export declare const $foreignObject: import("./types.js").SvgElementFactory<SVGForeignObjectElement>;
37
+ export declare const $g: import("./types.js").SvgElementFactory<SVGGElement>;
38
+ export declare const $image: import("./types.js").SvgElementFactory<SVGImageElement>;
39
+ export declare const $line: import("./types.js").SvgElementFactory<SVGLineElement>;
40
+ export declare const $linearGradient: import("./types.js").SvgElementFactory<SVGLinearGradientElement>;
41
+ export declare const $marker: import("./types.js").SvgElementFactory<SVGMarkerElement>;
42
+ export declare const $mask: import("./types.js").SvgElementFactory<SVGMaskElement>;
43
+ export declare const $metadata: import("./types.js").SvgElementFactory<SVGMetadataElement>;
44
+ export declare const $mpath: import("./types.js").SvgElementFactory<SVGMPathElement>;
45
+ export declare const $path: import("./types.js").SvgElementFactory<SVGPathElement>;
46
+ export declare const $pattern: import("./types.js").SvgElementFactory<SVGPatternElement>;
47
+ export declare const $polygon: import("./types.js").SvgElementFactory<SVGPolygonElement>;
48
+ export declare const $polyline: import("./types.js").SvgElementFactory<SVGPolylineElement>;
49
+ export declare const $radialGradient: import("./types.js").SvgElementFactory<SVGRadialGradientElement>;
50
+ export declare const $rect: import("./types.js").SvgElementFactory<SVGRectElement>;
51
+ export declare const $script: import("./types.js").SvgElementFactory<SVGScriptElement>;
52
+ export declare const $set: import("./types.js").SvgElementFactory<SVGSetElement>;
53
+ export declare const $stop: import("./types.js").SvgElementFactory<SVGStopElement>;
54
+ export declare const $style: import("./types.js").SvgElementFactory<SVGStyleElement>;
55
+ export declare const $svg: import("./types.js").SvgElementFactory<SVGSVGElement>;
56
+ export declare const $switch: import("./types.js").SvgElementFactory<SVGSwitchElement>;
57
+ export declare const $symbol: import("./types.js").SvgElementFactory<SVGSymbolElement>;
58
+ export declare const $text: import("./types.js").SvgElementFactory<SVGTextElement>;
59
+ export declare const $textPath: import("./types.js").SvgElementFactory<SVGTextPathElement>;
60
+ export declare const $title: import("./types.js").SvgElementFactory<SVGTitleElement>;
61
+ export declare const $tspan: import("./types.js").SvgElementFactory<SVGTSpanElement>;
62
+ export declare const $use: import("./types.js").SvgElementFactory<SVGUseElement>;
63
+ export declare const $view: import("./types.js").SvgElementFactory<SVGViewElement>;
@@ -1,4 +1,4 @@
1
- import type { AttributeProps, AttributeValue, Child, ClassValue, EventProps, MaybeAccessor, StyleValue } from "../dom/types";
1
+ import type { AttributeProps, AttributeValue, Child, ClassValue, EventProps, MaybeAccessor, StyleValue } from "../dom/types.js";
2
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
3
  export type SvgProps<E extends SVGElement> = AttributeProps & EventProps<E> & {
4
4
  [K in SvgAttributeName]?: MaybeAccessor<AttributeValue>;
@@ -1,10 +1,13 @@
1
- import type { Child } from "../dom/types";
1
+ import type { Child } from "../dom/types.js";
2
2
  /** Queries inside one element. They throw a readable error when nothing (or more than one) matches. */
3
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[];
4
+ /**
5
+ * The one element whose text is `text` (the innermost, if they're nested). With `{ exact: false }`,
6
+ * a string matches any part of the text, ignoring case.
7
+ */
8
+ getByText(text: string | RegExp, options?: TextOptions): HTMLElement;
9
+ queryByText(text: string | RegExp, options?: TextOptions): HTMLElement | null;
10
+ getAllByText(text: string | RegExp, options?: TextOptions): HTMLElement[];
8
11
  /** By ARIA role (explicit, or what the tag means: button, link, textbox, checkbox, heading...), and accessible name. */
9
12
  getByRole(role: string, options?: {
10
13
  name?: string | RegExp;
@@ -16,10 +19,14 @@ export interface Queries {
16
19
  name?: string | RegExp;
17
20
  }): HTMLElement[];
18
21
  /** The form control a <label> (or aria-label) names. */
19
- getByLabelText(text: string | RegExp): HTMLElement;
22
+ getByLabelText(text: string | RegExp, options?: TextOptions): HTMLElement;
20
23
  /** By data-testid, for things a user can't name. */
21
24
  getByTestId(id: string): HTMLElement;
22
25
  }
26
+ export interface TextOptions {
27
+ /** false: a string matches any part of the text, ignoring case. Default true: the whole text. */
28
+ exact?: boolean;
29
+ }
23
30
  export interface Rendered extends Queries {
24
31
  /** The element the app was mounted into. */
25
32
  container: HTMLElement;
@@ -1,5 +1,5 @@
1
1
  import type { Plugin } from "vite";
2
- import type { RenderResult } from "../static/render";
2
+ import type { RenderResult } from "../static/render.js";
3
3
  export interface Page {
4
4
  url: string;
5
5
  version?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keits",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Fine-grained reactive TypeScript framework. Real DOM, no virtual DOM, zero dependencies.",
5
5
  "keywords": [
6
6
  "reactive",
@@ -68,21 +68,21 @@
68
68
  }
69
69
  },
70
70
  "scripts": {
71
- "build": "node ../../scripts/build.mjs && tsc -p tsconfig.build.json",
71
+ "build": "node ../../scripts/build.mjs && tsc -p tsconfig.build.json && node ../../scripts/fix-dts.mjs",
72
72
  "size": "node ../../scripts/size.mjs",
73
73
  "prepublishOnly": "cd ../.. && npm run check"
74
74
  },
75
75
  "size-budget": {
76
76
  "dist/prod/index.js": 7680,
77
77
  "size/basic.js": 1792,
78
- "size/dom-basic.js": 3328,
79
- "size/svg-icon.js": 3328,
80
- "size/data-app.js": 5184,
78
+ "size/dom-basic.js": 3456,
79
+ "size/svg-icon.js": 3456,
80
+ "size/data-app.js": 5312,
81
81
  "size/router-app.js": 6400,
82
- "size/api-app.js": 6912,
83
- "size/forms-app.js": 6656,
82
+ "size/api-app.js": 7040,
83
+ "size/forms-app.js": 6784,
84
84
  "size/head.js": 4096,
85
- "size/islands.js": 4096
85
+ "size/islands.js": 4224
86
86
  },
87
87
  "peerDependencies": {
88
88
  "vite": ">=8"
@@ -1,84 +0,0 @@
1
- import { t as renderEffect } from "./render-effect-Uk9dDmuU.js";
2
- // src/dom/hooks.ts
3
- var defaultHooks = {
4
- element: (tag, namespace) => namespace === null ? document.createElement(tag) : document.createElementNS(namespace, tag),
5
- text: (value) => document.createTextNode(value),
6
- marker: () => document.createComment(""),
7
- fragment: () => document.createDocumentFragment()
8
- };
9
- var claimPauses = 0;
10
- function withoutClaims(fn) {
11
- claimPauses++;
12
- try {
13
- return fn();
14
- } finally {
15
- claimPauses--;
16
- }
17
- }
18
- function claimsPaused() {
19
- return claimPauses > 0;
20
- }
21
- var hooks = defaultHooks;
22
- function setHooks(next) {
23
- const previous = hooks;
24
- hooks = next;
25
- return previous;
26
- }
27
- // src/dom/insert.ts
28
- function insert(parent, child, before = null) {
29
- if (child === null || child === void 0 || typeof child === "boolean") return;
30
- if (typeof child === "function") return insertDynamic(parent, child, before);
31
- if (isChildArray(child)) {
32
- for (const item of child) insert(parent, item, before);
33
- return;
34
- }
35
- if (typeof child === "object") {
36
- if (!child.nodeType) throw new Error("[keits] A child is a plain object, not text or an element. If it came from an API, check its type (see parse), or write String(value).");
37
- parent.insertBefore(child, before);
38
- return;
39
- }
40
- parent.insertBefore(hooks.text(String(child)), before);
41
- }
42
- function isChildArray(value) {
43
- return Array.isArray(value);
44
- }
45
- function isTextValue(value) {
46
- return value === null || typeof value !== "object" && typeof value !== "function";
47
- }
48
- function toText(value) {
49
- return value === null || value === void 0 || typeof value === "boolean" ? "" : String(value);
50
- }
51
- function insertDynamic(parent, fn, before) {
52
- const text = hooks.text("");
53
- parent.insertBefore(text, before);
54
- let start = null;
55
- let end = null;
56
- renderEffect(() => {
57
- const value = fn();
58
- if (start === null || end === null) {
59
- if (isTextValue(value)) {
60
- const next = toText(value);
61
- if (text.data !== next) text.data = next;
62
- return;
63
- }
64
- start = hooks.marker();
65
- end = hooks.marker();
66
- text.before(start);
67
- text.after(end);
68
- text.remove();
69
- }
70
- clearRange(start, end);
71
- insert(end.parentNode, value, end);
72
- });
73
- }
74
- function clearRange(start, end) {
75
- let node = start.nextSibling;
76
- while (node !== null && node !== end) {
77
- const next = node.nextSibling;
78
- node.remove();
79
- node = next;
80
- }
81
- }
82
- // src/dom/namespaces.ts
83
- var SVG_NS = "http://www.w3.org/2000/svg";
84
- export { hooks as a, defaultHooks as i, insert as n, setHooks as o, claimsPaused as r, withoutClaims as s, SVG_NS as t };
@@ -1,129 +0,0 @@
1
- import { a as e, n as t } from "./namespaces-BSRrBJIU.js";
2
- import { d as n, g as r, i, l as a, s as o } from "./graph-CR2WKbwr.js";
3
- import { t as s } from "./unsafe-keys-C5PMlerl.js";
4
- import { t as c } from "./render-effect-UFDi2Pfh.js";
5
- // src/dom/events.ts
6
- function l(e, t, r) {
7
- let i = r, a;
8
- if (Array.isArray(r) && ([i, a] = r), typeof i != "function") throw Error("[keits] bad handler");
9
- n() || u(e, t.slice(2), i, a);
10
- }
11
- function u(e, t, n, s) {
12
- let c = o();
13
- e.addEventListener(t, (e) => {
14
- i(() => {
15
- try {
16
- let t = r(c, () => n(e));
17
- d(t) && t.then(void 0, (e) => i(() => a(e, c)));
18
- } catch (e) {
19
- a(e, c);
20
- }
21
- });
22
- }, s);
23
- }
24
- function d(e) {
25
- return typeof e?.then == "function";
26
- }
27
- // src/dom/props.ts
28
- var f = /* @__PURE__ */ new Set([
29
- "innerhtml",
30
- "outerhtml",
31
- "srcdoc"
32
- ]), p = /* @__PURE__ */ new Set([
33
- "href",
34
- "src",
35
- "action",
36
- "formaction",
37
- "poster",
38
- "cite",
39
- "data",
40
- "xlink:href",
41
- "to",
42
- "from",
43
- "values"
44
- ]), m = "about:invalid#keits-blocked";
45
- function h(e, t) {
46
- for (let n in t) {
47
- let r = t[n];
48
- n !== "ref" && (n === "class" ? b(e, r) : n === "style" ? w(e, r) : n.toLowerCase().startsWith("on") ? l(e, n, r) : typeof r == "function" ? c(() => g(e, n, r())) : g(e, n, r));
49
- }
50
- }
51
- function g(e, t, r) {
52
- let i = t.toLowerCase();
53
- if (f.has(i) || s.has(t) || i.startsWith("on") && typeof r == "string") throw Error("[keits] unsafe prop");
54
- p.has(i) && r != null && r !== !1 && _(String(r)) && (r = m), t in e && e.namespaceURI !== "http://www.w3.org/2000/svg" ? (e[t] = r, n() && v(e, t, r)) : t.startsWith("aria-") && typeof r == "boolean" ? e.setAttribute(t, String(r)) : r == null || r === !1 ? e.removeAttribute(t) : e.setAttribute(t, r === !0 ? "" : String(r));
55
- }
56
- function _(e) {
57
- return e.replace(/[\u0000-\u0020]/g, "").toLowerCase().split(";").some((e) => e.startsWith("javascript:"));
58
- }
59
- function v(e, t, n) {
60
- t === "value" ? e.localName === "textarea" ? e.textContent = n == null ? "" : String(n) : e.localName === "select" ? y(e, n == null ? "" : String(n)) : n == null ? e.removeAttribute("value") : e.setAttribute("value", String(n)) : (t === "checked" || t === "selected") && e.toggleAttribute(t, n === !0);
61
- }
62
- function y(e, t) {
63
- for (let n = e.firstChild; n !== null; n = n.nextSibling) {
64
- if (n.nodeType !== 1) continue;
65
- let e = n;
66
- e.localName === "option" ? e.toggleAttribute("selected", (e.getAttribute("value") ?? e.textContent) === t) : y(e, t);
67
- }
68
- }
69
- function b(e, t) {
70
- if (typeof t == "function") {
71
- c(() => x(e, C(t())));
72
- return;
73
- }
74
- let n = [], r = [];
75
- S(t, n, (e, t) => r.push([e, t])), n.length > 0 && e.classList.add(...n);
76
- for (let [t, n] of r) c(() => e.classList.toggle(t, n()));
77
- }
78
- function x(e, t) {
79
- t === "" ? e.removeAttribute("class") : e.setAttribute("class", t);
80
- }
81
- function S(e, t, n) {
82
- if (e) {
83
- if (typeof e == "string") for (let n of e.split(/\s+/)) n && t.push(n);
84
- else if (Array.isArray(e)) for (let r of e) S(r, t, n);
85
- else for (let [r, i] of Object.entries(e)) typeof i == "function" ? n ? n(r, i) : i() && t.push(r) : i && t.push(r);
86
- }
87
- }
88
- function C(e) {
89
- let t = [];
90
- return S(e, t), t.join(" ");
91
- }
92
- function w(e, t) {
93
- let n = e.style;
94
- if (typeof t == "function") {
95
- let e = [];
96
- c(() => {
97
- let r = t();
98
- if (typeof r == "string" || r == null) {
99
- n.cssText = r ?? "", e = [];
100
- return;
101
- }
102
- let i = Object.keys(r);
103
- for (let t of e) t in r || n.removeProperty(t);
104
- for (let e of i) E(n, e, T(r[e]));
105
- e = i;
106
- });
107
- } else if (typeof t == "string") n.cssText = t;
108
- else if (t != null) for (let [e, r] of Object.entries(t)) typeof r == "function" ? c(() => E(n, e, r())) : E(n, e, r);
109
- }
110
- function T(e) {
111
- return typeof e == "function" ? e() : e;
112
- }
113
- function E(e, t, n) {
114
- n == null || n === "" ? e.removeProperty(t) : e.setProperty(t, String(n));
115
- }
116
- // src/dom/element.ts
117
- function D(e) {
118
- return O(e, null);
119
- }
120
- function O(n, r) {
121
- return (i, a) => {
122
- let o = e.element(n, r);
123
- return k(i) ? (t(o, a), h(o, i), typeof i.ref == "function" && i.ref(o)) : i == null ? t(o, a) : t(o, i), o;
124
- };
125
- }
126
- function k(e) {
127
- return typeof e == "object" && !!e && !Array.isArray(e) && typeof e.nodeType != "number";
128
- }
129
- export { D as n, O as t };
@@ -1,71 +0,0 @@
1
- import { t as e } from "./render-effect-UFDi2Pfh.js";
2
- // src/dom/hooks.ts
3
- var t = {
4
- element: (e, t) => t === null ? document.createElement(e) : document.createElementNS(t, e),
5
- text: (e) => document.createTextNode(e),
6
- marker: () => document.createComment(""),
7
- fragment: () => document.createDocumentFragment()
8
- }, n = 0;
9
- function r(e) {
10
- n++;
11
- try {
12
- return e();
13
- } finally {
14
- n--;
15
- }
16
- }
17
- function i() {
18
- return n > 0;
19
- }
20
- var a = t;
21
- function o(e) {
22
- let t = a;
23
- return a = e, t;
24
- }
25
- // src/dom/insert.ts
26
- function s(e, t, n = null) {
27
- if (t != null && typeof t != "boolean") {
28
- if (typeof t == "function") return d(e, t, n);
29
- if (c(t)) for (let r of t) s(e, r, n);
30
- else if (typeof t == "object") {
31
- if (!t.nodeType) throw Error("[keits] bad child");
32
- e.insertBefore(t, n);
33
- } else e.insertBefore(a.text(String(t)), n);
34
- }
35
- }
36
- function c(e) {
37
- return Array.isArray(e);
38
- }
39
- function l(e) {
40
- return e === null || typeof e != "object" && typeof e != "function";
41
- }
42
- function u(e) {
43
- return e == null || typeof e == "boolean" ? "" : String(e);
44
- }
45
- function d(t, n, r) {
46
- let i = a.text("");
47
- t.insertBefore(i, r);
48
- let o = null, c = null;
49
- e(() => {
50
- let e = n();
51
- if (o === null || c === null) {
52
- if (l(e)) {
53
- let t = u(e);
54
- i.data !== t && (i.data = t);
55
- return;
56
- }
57
- o = a.marker(), c = a.marker(), i.before(o), i.after(c), i.remove();
58
- }
59
- f(o, c), s(c.parentNode, e, c);
60
- });
61
- }
62
- function f(e, t) {
63
- let n = e.nextSibling;
64
- for (; n !== null && n !== t;) {
65
- let e = n.nextSibling;
66
- n.remove(), n = e;
67
- }
68
- }
69
- // src/dom/namespaces.ts
70
- var p = "http://www.w3.org/2000/svg";
71
- export { a, t as i, s as n, o, i as r, r as s, p as t };