sibujs 4.6.0 → 4.8.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 (94) hide show
  1. package/README.md +1 -1
  2. package/dist/browser.cjs +62 -8
  3. package/dist/browser.d.cts +23 -0
  4. package/dist/browser.d.ts +23 -0
  5. package/dist/browser.js +6 -5
  6. package/dist/build.cjs +2388 -1004
  7. package/dist/build.d.cts +147 -44
  8. package/dist/build.d.ts +147 -44
  9. package/dist/build.js +1410 -564
  10. package/dist/cdn.dev.global.js +14 -12
  11. package/dist/cdn.full.dev.global.js +15 -13
  12. package/dist/cdn.full.global.js +14 -12
  13. package/dist/cdn.global.js +12 -10
  14. package/dist/chunk-3ACAAQIN.js +224 -0
  15. package/dist/{chunk-7NCARGJW.js → chunk-44MTL7ED.js} +6 -6
  16. package/dist/{chunk-BAAG6ZTI.js → chunk-4WMSTZ7J.js} +8 -5
  17. package/dist/{chunk-H3SRKIYX.js → chunk-62BDYGAG.js} +8 -0
  18. package/dist/{chunk-DKGBBKOF.js → chunk-C5PEWEGH.js} +20 -5
  19. package/dist/{chunk-3ISI6ACU.js → chunk-C7AA2CZX.js} +1 -1
  20. package/dist/{chunk-UZQ6ALFS.js → chunk-CZPRSWSS.js} +1 -1
  21. package/dist/{chunk-D33YTSX5.js → chunk-DSID757X.js} +5 -4
  22. package/dist/{chunk-OXUY2A6L.js → chunk-EGUQLBHE.js} +22 -8
  23. package/dist/{chunk-2INLLLMZ.js → chunk-EXXSN3BW.js} +202 -26
  24. package/dist/{chunk-HURREPU2.js → chunk-FC6KCJSA.js} +87 -150
  25. package/dist/{chunk-HYXDKS4N.js → chunk-GSGNX35Q.js} +5 -5
  26. package/dist/{chunk-7GQCWFOE.js → chunk-J3YQ457H.js} +171 -85
  27. package/dist/{chunk-ORMZXBKQ.js → chunk-JUTFX2RM.js} +18 -10
  28. package/dist/{chunk-QE4TTDU3.js → chunk-KJ3UKABJ.js} +12 -11
  29. package/dist/{chunk-XRRZKZYX.js → chunk-LI4W3U6C.js} +1 -1
  30. package/dist/{chunk-47M47FOM.js → chunk-O6TRVMJI.js} +58 -6
  31. package/dist/{chunk-JSXPZCET.js → chunk-Q5J2LVKH.js} +1 -1
  32. package/dist/{chunk-5MT6SJ3P.js → chunk-QGMSESDD.js} +10 -5
  33. package/dist/{chunk-AIF3Z2T7.js → chunk-RGLPEBDE.js} +13 -10
  34. package/dist/{chunk-5Q4R7HCL.js → chunk-TQQUN4WR.js} +11 -2
  35. package/dist/{chunk-PK6FK2G2.js → chunk-UCNP3HVM.js} +183 -30
  36. package/dist/{chunk-XC4MEKGA.js → chunk-V3LHZSU5.js} +8 -2
  37. package/dist/{chunk-VVWPJ543.js → chunk-VWT3VXPL.js} +55 -20
  38. package/dist/{chunk-SXXVZMKZ.js → chunk-ZVLHNEEL.js} +17 -35
  39. package/dist/{contracts-DRIuclVT.d.cts → contracts-CLqzJnOV.d.ts} +28 -17
  40. package/dist/{contracts-DRIuclVT.d.ts → contracts-CTOJXu-x.d.cts} +28 -17
  41. package/dist/{customElement-MmInOW1U.d.ts → customElement-pYDKUzWl.d.cts} +11 -3
  42. package/dist/{customElement-MmInOW1U.d.cts → customElement-pYDKUzWl.d.ts} +11 -3
  43. package/dist/data.cjs +205 -39
  44. package/dist/data.d.cts +119 -3
  45. package/dist/data.d.ts +119 -3
  46. package/dist/data.js +6 -6
  47. package/dist/devtools.cjs +18 -5
  48. package/dist/devtools.js +5 -5
  49. package/dist/ecosystem.cjs +462 -58
  50. package/dist/ecosystem.d.cts +2 -1
  51. package/dist/ecosystem.d.ts +2 -1
  52. package/dist/ecosystem.js +9 -8
  53. package/dist/extras.cjs +852 -296
  54. package/dist/extras.d.cts +5 -4
  55. package/dist/extras.d.ts +5 -4
  56. package/dist/extras.js +24 -23
  57. package/dist/index.cjs +721 -176
  58. package/dist/index.d.cts +220 -169
  59. package/dist/index.d.ts +220 -169
  60. package/dist/index.js +16 -12
  61. package/dist/motion.cjs +12 -4
  62. package/dist/motion.js +3 -3
  63. package/dist/patterns.cjs +37 -21
  64. package/dist/patterns.d.cts +2 -1
  65. package/dist/patterns.d.ts +2 -1
  66. package/dist/patterns.js +6 -6
  67. package/dist/performance.cjs +48 -6
  68. package/dist/performance.d.cts +12 -2
  69. package/dist/performance.d.ts +12 -2
  70. package/dist/performance.js +8 -6
  71. package/dist/plugins.cjs +672 -261
  72. package/dist/plugins.d.cts +131 -13
  73. package/dist/plugins.d.ts +131 -13
  74. package/dist/plugins.js +83 -47
  75. package/dist/{ssr-XOTUASDO.js → ssr-5OWAH3U2.js} +4 -2
  76. package/dist/{ssr-Bli9XRW5.d.cts → ssr-C8hgIAw7.d.cts} +6 -0
  77. package/dist/{ssr-Bli9XRW5.d.ts → ssr-C8hgIAw7.d.ts} +6 -0
  78. package/dist/ssr.cjs +509 -142
  79. package/dist/ssr.d.cts +55 -5
  80. package/dist/ssr.d.ts +55 -5
  81. package/dist/ssr.js +11 -9
  82. package/dist/{tagFactory-DFstCLQV.d.cts → tagFactory-8qL9LCIx.d.cts} +58 -19
  83. package/dist/{tagFactory-DkaNVUNV.d.ts → tagFactory-BL2fymez.d.ts} +58 -19
  84. package/dist/testing.cjs +17 -4
  85. package/dist/testing.js +4 -4
  86. package/dist/types-CJFViL6Q.d.cts +26 -0
  87. package/dist/types-CJFViL6Q.d.ts +26 -0
  88. package/dist/ui.cjs +635 -254
  89. package/dist/ui.d.cts +3 -2
  90. package/dist/ui.d.ts +3 -2
  91. package/dist/ui.js +9 -8
  92. package/dist/widgets.cjs +22 -14
  93. package/dist/widgets.js +7 -7
  94. package/package.json +8 -5
package/dist/index.d.cts CHANGED
@@ -1,8 +1,10 @@
1
- import { N as NodeChild, a as NodeChildren, T as TagProps, D as DerivedAccessor } from './tagFactory-DFstCLQV.cjs';
2
- export { b as Dispose, S as SVG_NS, d as derived, t as tagFactory } from './tagFactory-DFstCLQV.cjs';
1
+ import { a as NodeChild, C as Component, N as NodeChildren } from './types-CJFViL6Q.cjs';
2
+ export { D as Dispose } from './types-CJFViL6Q.cjs';
3
+ import { T as TagProps, a as TagFunction, D as DerivedAccessor } from './tagFactory-8qL9LCIx.cjs';
4
+ export { S as SVG_NS, b as StyleMap, c as StyleObject, d as TagEventHandlers, e as derived, t as tagFactory } from './tagFactory-8qL9LCIx.cjs';
3
5
  import { A as Accessor } from './signal-EotCj4hS.cjs';
4
6
  export { D as DisposableAccessor, E as ExternalSource, S as SignalOptions, e as external, s as signal } from './signal-EotCj4hS.cjs';
5
- export { T as TrustedHTML, t as trustHTML } from './ssr-Bli9XRW5.cjs';
7
+ export { T as TrustedHTML, t as trustHTML } from './ssr-C8hgIAw7.cjs';
6
8
  import { R as ReactiveSignal } from './signal-BnWpq6WB.cjs';
7
9
 
8
10
  interface ErrorBoundaryOptions {
@@ -603,7 +605,6 @@ declare function replaceChildrenSafely(parent: ParentNode, ...next: Node[]): voi
603
605
  */
604
606
  declare function checkLeaks(warnThreshold?: number): number;
605
607
 
606
- type Component$1 = () => HTMLElement;
607
608
  /**
608
609
  * Register a component by name for dynamic resolution.
609
610
  *
@@ -616,7 +617,7 @@ type Component$1 = () => HTMLElement;
616
617
  * registerComponent("AdminPanel", AdminPanel);
617
618
  * ```
618
619
  */
619
- declare function registerComponent(name: string, component: Component$1): void;
620
+ declare function registerComponent(name: string, component: Component): void;
620
621
  /**
621
622
  * Unregister a previously registered component.
622
623
  */
@@ -625,8 +626,12 @@ declare function unregisterComponent(name: string): void;
625
626
  * Resolve and render a dynamically registered component by name.
626
627
  * Returns a placeholder if the component is not found.
627
628
  *
629
+ * The registry is keyed by name, so it cannot know which root a component
630
+ * renders: `El` states it, like `querySelector<E>()`. It defaults to
631
+ * `HTMLElement`; pass `Element` (or `SVGSVGElement`, …) for an SVG component.
632
+ *
628
633
  * @param name Component name to resolve
629
- * @returns The rendered HTMLElement or a fallback
634
+ * @returns The rendered root element or a fallback
630
635
  *
631
636
  * @example
632
637
  * ```ts
@@ -634,7 +639,7 @@ declare function unregisterComponent(name: string): void;
634
639
  * div([resolveComponent("Widget")]);
635
640
  * ```
636
641
  */
637
- declare function resolveComponent(name: string): HTMLElement;
642
+ declare function resolveComponent<El extends Element = HTMLElement>(name: string): El;
638
643
  /**
639
644
  * Dynamic component that reactively switches between components
640
645
  * based on a reactive getter returning a component name or function.
@@ -650,7 +655,7 @@ declare function resolveComponent(name: string): HTMLElement;
650
655
  * setView("grid"); // Swaps to registered "grid" component
651
656
  * ```
652
657
  */
653
- declare function DynamicComponent(is: () => string | Component$1): HTMLElement;
658
+ declare function DynamicComponent(is: () => string | Component): HTMLDivElement;
654
659
 
655
660
  /**
656
661
  * Renders a list of nodes efficiently with key-based diffing and
@@ -704,12 +709,17 @@ declare function each<T>(getArray: () => T[], render: (item: () => T, index: ()
704
709
  * Fragment groups multiple nodes without adding a wrapper DOM element.
705
710
  * Returns a DocumentFragment that can be appended to any parent.
706
711
  *
712
+ * A function child is reactive, exactly as it is inside a tag factory: it is
713
+ * rendered after a placeholder comment and re-rendered when the signals it reads
714
+ * change. The binding is owned by that placeholder, so disposing the parent the
715
+ * fragment was appended to (or unmounting a mounted fragment) stops it.
716
+ *
707
717
  * @example
708
718
  * ```ts
709
719
  * div([
710
720
  * Fragment([
711
721
  * p("First"),
712
- * p("Second"),
722
+ * () => `Count: ${count()}`,
713
723
  * ])
714
724
  * ]);
715
725
  * ```
@@ -731,11 +741,30 @@ declare function Fragment(nodes: NodeChildren[]): DocumentFragment;
731
741
  * string, and not a virtual node.
732
742
  */
733
743
  declare function html(strings: TemplateStringsArray, ...values: unknown[]): Element;
744
+ /**
745
+ * Render a template the build-time compiler has ALREADY PARSED. Internal: the
746
+ * entry point compiled `html` templates call, not an API for applications.
747
+ *
748
+ * The compiler emits most templates as straight-line DOM code. Some it cannot
749
+ * reproduce exactly — an expression on `value` / `checked`, a top-level
750
+ * `${expr}`, a `<meta>`, a static `srcdoc` — and those used to be left to this
751
+ * module's parser at runtime. Passing the tree the compiler's line-for-line
752
+ * port of that parser produced to the runtime's own executor compiles them too,
753
+ * with output identical to the runtime BY CONSTRUCTION: it is the runtime.
754
+ *
755
+ * TRUST BOUNDARY: `tree` is template SOURCE. Its tag names and static
756
+ * attributes are treated exactly like text typed into an `html` template, so it
757
+ * must only ever be a constant the compiler emitted — never data built at
758
+ * runtime. Interpolated `values` keep the runtime policy.
759
+ *
760
+ * @internal
761
+ */
762
+ declare function __renderParsedTemplate(tree: readonly unknown[], values: unknown[]): Element;
734
763
 
735
764
  type reactive<T> = T | (() => T);
736
- interface AnchorProps extends TagProps {
765
+ interface AnchorProps extends TagProps<HTMLAnchorElement> {
737
766
  href?: reactive<string>;
738
- target?: "_self" | "_blank" | "_parent" | "_top" | (string & {});
767
+ target?: reactive<"_self" | "_blank" | "_parent" | "_top" | (string & {})>;
739
768
  rel?: reactive<string>;
740
769
  download?: reactive<string | boolean>;
741
770
  hreflang?: reactive<string>;
@@ -743,8 +772,8 @@ interface AnchorProps extends TagProps {
743
772
  ping?: reactive<string>;
744
773
  }
745
774
  type InputType = "button" | "checkbox" | "color" | "date" | "datetime-local" | "email" | "file" | "hidden" | "image" | "month" | "number" | "password" | "radio" | "range" | "reset" | "search" | "submit" | "tel" | "text" | "time" | "url" | "week";
746
- interface InputProps extends TagProps {
747
- type?: InputType | (string & {});
775
+ interface InputProps extends TagProps<HTMLInputElement> {
776
+ type?: reactive<InputType | (string & {})>;
748
777
  name?: reactive<string>;
749
778
  value?: reactive<string | number>;
750
779
  placeholder?: reactive<string>;
@@ -767,7 +796,7 @@ interface InputProps extends TagProps {
767
796
  list?: reactive<string>;
768
797
  inputmode?: reactive<"none" | "text" | "decimal" | "numeric" | "tel" | "search" | "email" | "url">;
769
798
  }
770
- interface ImgProps extends TagProps {
799
+ interface ImgProps extends TagProps<HTMLImageElement> {
771
800
  src?: reactive<string>;
772
801
  alt?: reactive<string>;
773
802
  width?: reactive<number | string>;
@@ -779,7 +808,7 @@ interface ImgProps extends TagProps {
779
808
  crossorigin?: reactive<"anonymous" | "use-credentials">;
780
809
  referrerpolicy?: reactive<string>;
781
810
  }
782
- interface ButtonProps extends TagProps {
811
+ interface ButtonProps extends TagProps<HTMLButtonElement> {
783
812
  type?: reactive<"button" | "submit" | "reset">;
784
813
  name?: reactive<string>;
785
814
  value?: reactive<string>;
@@ -792,7 +821,7 @@ interface ButtonProps extends TagProps {
792
821
  formtarget?: reactive<string>;
793
822
  autofocus?: reactive<boolean>;
794
823
  }
795
- interface FormProps extends TagProps {
824
+ interface FormProps extends TagProps<HTMLFormElement> {
796
825
  action?: reactive<string>;
797
826
  method?: reactive<"get" | "post" | "dialog">;
798
827
  enctype?: reactive<"application/x-www-form-urlencoded" | "multipart/form-data" | "text/plain">;
@@ -802,7 +831,7 @@ interface FormProps extends TagProps {
802
831
  autocomplete?: reactive<"on" | "off">;
803
832
  acceptcharset?: reactive<string>;
804
833
  }
805
- interface SelectProps extends TagProps {
834
+ interface SelectProps extends TagProps<HTMLSelectElement> {
806
835
  name?: reactive<string>;
807
836
  value?: reactive<string>;
808
837
  disabled?: reactive<boolean>;
@@ -813,7 +842,7 @@ interface SelectProps extends TagProps {
813
842
  autofocus?: reactive<boolean>;
814
843
  form?: reactive<string>;
815
844
  }
816
- interface TextareaProps extends TagProps {
845
+ interface TextareaProps extends TagProps<HTMLTextAreaElement> {
817
846
  name?: reactive<string>;
818
847
  value?: reactive<string>;
819
848
  placeholder?: reactive<string>;
@@ -830,17 +859,17 @@ interface TextareaProps extends TagProps {
830
859
  form?: reactive<string>;
831
860
  spellcheck?: reactive<boolean>;
832
861
  }
833
- interface LabelProps extends TagProps {
862
+ interface LabelProps extends TagProps<HTMLLabelElement> {
834
863
  for?: reactive<string>;
835
864
  form?: reactive<string>;
836
865
  }
837
- interface OptionProps extends TagProps {
866
+ interface OptionProps extends TagProps<HTMLOptionElement> {
838
867
  value?: reactive<string | number>;
839
868
  selected?: reactive<boolean>;
840
869
  disabled?: reactive<boolean>;
841
870
  label?: reactive<string>;
842
871
  }
843
- interface MediaProps extends TagProps {
872
+ interface MediaProps<El extends HTMLMediaElement = HTMLMediaElement> extends TagProps<El> {
844
873
  src?: reactive<string>;
845
874
  autoplay?: reactive<boolean>;
846
875
  controls?: reactive<boolean>;
@@ -849,152 +878,158 @@ interface MediaProps extends TagProps {
849
878
  preload?: reactive<"none" | "metadata" | "auto">;
850
879
  crossorigin?: reactive<"anonymous" | "use-credentials">;
851
880
  }
852
- interface VideoProps extends MediaProps {
881
+ interface VideoProps extends MediaProps<HTMLVideoElement> {
853
882
  poster?: reactive<string>;
854
883
  width?: reactive<number | string>;
855
884
  height?: reactive<number | string>;
856
885
  playsinline?: reactive<boolean>;
857
886
  }
858
- type AudioProps = MediaProps;
859
-
860
- type TypedTagFunction<Props extends TagProps, El extends Element> = (first?: Props | NodeChildren, second?: NodeChildren) => El;
887
+ type AudioProps = MediaProps<HTMLAudioElement>;
888
+ type TypedTagFunction<Props extends TagProps<El>, El extends Element> = TagFunction<El, Props>;
861
889
 
862
- declare const head: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
863
- declare const body: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
864
- declare const title: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
865
- declare const div: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
866
- declare const span: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
867
- declare const section: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
868
- declare const article: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
869
- declare const header: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
870
- declare const footer: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
871
- declare const nav: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
872
- declare const main: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
873
- declare const aside: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
874
- declare const address: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
875
- declare const p: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
876
- declare const h1: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
877
- declare const h2: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
878
- declare const h3: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
879
- declare const h4: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
880
- declare const h5: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
881
- declare const h6: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
882
- declare const blockquote: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
883
- declare const dd: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
884
- declare const dl: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
885
- declare const dt: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
886
- declare const figcaption: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
887
- declare const figure: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
888
- declare const hr: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
889
- declare const li: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
890
- declare const ol: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
891
- declare const ul: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
892
- declare const pre: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
890
+ declare const head: TagFunction<HTMLHeadElement, TagProps<HTMLHeadElement>>;
891
+ declare const body: TagFunction<HTMLBodyElement, TagProps<HTMLBodyElement>>;
892
+ declare const title: TagFunction<HTMLTitleElement, TagProps<HTMLTitleElement>>;
893
+ declare const div: TagFunction<HTMLDivElement, TagProps<HTMLDivElement>>;
894
+ declare const span: TagFunction<HTMLSpanElement, TagProps<HTMLSpanElement>>;
895
+ declare const section: TagFunction<HTMLElement, TagProps<HTMLElement>>;
896
+ declare const article: TagFunction<HTMLElement, TagProps<HTMLElement>>;
897
+ declare const header: TagFunction<HTMLElement, TagProps<HTMLElement>>;
898
+ declare const footer: TagFunction<HTMLElement, TagProps<HTMLElement>>;
899
+ declare const nav: TagFunction<HTMLElement, TagProps<HTMLElement>>;
900
+ declare const main: TagFunction<HTMLElement, TagProps<HTMLElement>>;
901
+ declare const aside: TagFunction<HTMLElement, TagProps<HTMLElement>>;
902
+ declare const address: TagFunction<HTMLElement, TagProps<HTMLElement>>;
903
+ declare const p: TagFunction<HTMLParagraphElement, TagProps<HTMLParagraphElement>>;
904
+ declare const h1: TagFunction<HTMLHeadingElement, TagProps<HTMLHeadingElement>>;
905
+ declare const h2: TagFunction<HTMLHeadingElement, TagProps<HTMLHeadingElement>>;
906
+ declare const h3: TagFunction<HTMLHeadingElement, TagProps<HTMLHeadingElement>>;
907
+ declare const h4: TagFunction<HTMLHeadingElement, TagProps<HTMLHeadingElement>>;
908
+ declare const h5: TagFunction<HTMLHeadingElement, TagProps<HTMLHeadingElement>>;
909
+ declare const h6: TagFunction<HTMLHeadingElement, TagProps<HTMLHeadingElement>>;
910
+ declare const blockquote: TagFunction<HTMLQuoteElement, TagProps<HTMLQuoteElement>>;
911
+ declare const dd: TagFunction<HTMLElement, TagProps<HTMLElement>>;
912
+ declare const dl: TagFunction<HTMLDListElement, TagProps<HTMLDListElement>>;
913
+ declare const dt: TagFunction<HTMLElement, TagProps<HTMLElement>>;
914
+ declare const figcaption: TagFunction<HTMLElement, TagProps<HTMLElement>>;
915
+ declare const figure: TagFunction<HTMLElement, TagProps<HTMLElement>>;
916
+ declare const hr: TagFunction<HTMLHRElement, TagProps<HTMLHRElement>>;
917
+ declare const li: TagFunction<HTMLLIElement, TagProps<HTMLLIElement>>;
918
+ declare const ol: TagFunction<HTMLOListElement, TagProps<HTMLOListElement>>;
919
+ declare const ul: TagFunction<HTMLUListElement, TagProps<HTMLUListElement>>;
920
+ declare const pre: TagFunction<HTMLPreElement, TagProps<HTMLPreElement>>;
893
921
  declare const a: TypedTagFunction<AnchorProps, HTMLAnchorElement>;
894
- declare const abbr: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
895
- declare const b: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
896
- declare const bdi: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
897
- declare const bdo: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
898
- declare const br: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
899
- declare const cite: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
900
- declare const code: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
901
- declare const data: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
902
- declare const dfn: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
903
- declare const em: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
904
- declare const i: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
905
- declare const kbd: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
906
- declare const mark: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
907
- declare const q: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
908
- declare const rp: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
909
- declare const rt: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
910
- declare const ruby: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
911
- declare const s: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
912
- declare const samp: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
913
- declare const small: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
914
- declare const strong: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
915
- declare const sub: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
916
- declare const sup: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
917
- declare const time: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
918
- declare const u: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
919
- declare const var_: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
920
- declare const area: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
922
+ declare const abbr: TagFunction<HTMLElement, TagProps<HTMLElement>>;
923
+ declare const b: TagFunction<HTMLElement, TagProps<HTMLElement>>;
924
+ declare const bdi: TagFunction<HTMLElement, TagProps<HTMLElement>>;
925
+ declare const bdo: TagFunction<HTMLElement, TagProps<HTMLElement>>;
926
+ declare const br: TagFunction<HTMLBRElement, TagProps<HTMLBRElement>>;
927
+ declare const cite: TagFunction<HTMLElement, TagProps<HTMLElement>>;
928
+ declare const code: TagFunction<HTMLElement, TagProps<HTMLElement>>;
929
+ declare const data: TagFunction<HTMLDataElement, TagProps<HTMLDataElement>>;
930
+ declare const dfn: TagFunction<HTMLElement, TagProps<HTMLElement>>;
931
+ declare const em: TagFunction<HTMLElement, TagProps<HTMLElement>>;
932
+ declare const i: TagFunction<HTMLElement, TagProps<HTMLElement>>;
933
+ declare const kbd: TagFunction<HTMLElement, TagProps<HTMLElement>>;
934
+ declare const mark: TagFunction<HTMLElement, TagProps<HTMLElement>>;
935
+ declare const q: TagFunction<HTMLQuoteElement, TagProps<HTMLQuoteElement>>;
936
+ declare const rp: TagFunction<HTMLElement, TagProps<HTMLElement>>;
937
+ declare const rt: TagFunction<HTMLElement, TagProps<HTMLElement>>;
938
+ declare const ruby: TagFunction<HTMLElement, TagProps<HTMLElement>>;
939
+ declare const s: TagFunction<HTMLElement, TagProps<HTMLElement>>;
940
+ declare const samp: TagFunction<HTMLElement, TagProps<HTMLElement>>;
941
+ declare const small: TagFunction<HTMLElement, TagProps<HTMLElement>>;
942
+ declare const strong: TagFunction<HTMLElement, TagProps<HTMLElement>>;
943
+ declare const sub: TagFunction<HTMLElement, TagProps<HTMLElement>>;
944
+ declare const sup: TagFunction<HTMLElement, TagProps<HTMLElement>>;
945
+ declare const time: TagFunction<HTMLTimeElement, TagProps<HTMLTimeElement>>;
946
+ declare const u: TagFunction<HTMLElement, TagProps<HTMLElement>>;
947
+ declare const var_: TagFunction<HTMLElement, TagProps<HTMLElement>>;
948
+ declare const area: TagFunction<HTMLAreaElement, TagProps<HTMLAreaElement>>;
921
949
  declare const audio: TypedTagFunction<AudioProps, HTMLAudioElement>;
922
950
  declare const img: TypedTagFunction<ImgProps, HTMLImageElement>;
923
- declare const map: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
924
- declare const track$1: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
951
+ declare const map: TagFunction<HTMLMapElement, TagProps<HTMLMapElement>>;
952
+ declare const track$1: TagFunction<HTMLTrackElement, TagProps<HTMLTrackElement>>;
925
953
  declare const video: TypedTagFunction<VideoProps, HTMLVideoElement>;
926
- declare const embed: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
927
- declare const iframe: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
928
- declare const object: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
929
- declare const param: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
930
- declare const picture: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
931
- declare const portal: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
932
- declare const source: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
933
- declare const svg: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
934
- declare const math: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
935
- declare const canvas: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
936
- declare const noscript: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
937
- declare const script: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
938
- declare const del: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
939
- declare const ins: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
940
- declare const caption: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
941
- declare const col: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
942
- declare const colgroup: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
943
- declare const table: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
944
- declare const tbody: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
945
- declare const td: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
946
- declare const tfoot: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
947
- declare const th: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
948
- declare const thead: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
949
- declare const tr: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
954
+ declare const embed: TagFunction<HTMLEmbedElement, TagProps<HTMLEmbedElement>>;
955
+ declare const iframe: TagFunction<HTMLIFrameElement, TagProps<HTMLIFrameElement>>;
956
+ declare const object: TagFunction<HTMLObjectElement, TagProps<HTMLObjectElement>>;
957
+ declare const param: TagFunction<HTMLElement, TagProps<HTMLElement>>;
958
+ declare const picture: TagFunction<HTMLPictureElement, TagProps<HTMLPictureElement>>;
959
+ declare const portal: TagFunction<HTMLElement, TagProps<HTMLElement>>;
960
+ declare const source: TagFunction<HTMLSourceElement, TagProps<HTMLSourceElement>>;
961
+ declare const svg: TagFunction<SVGSVGElement, TagProps<SVGSVGElement>>;
962
+ declare const math: TagFunction<HTMLElement, TagProps<HTMLElement>>;
963
+ declare const canvas: TagFunction<HTMLCanvasElement, TagProps<HTMLCanvasElement>>;
964
+ declare const noscript: TagFunction<HTMLElement, TagProps<HTMLElement>>;
965
+ declare const script: TagFunction<HTMLScriptElement, TagProps<HTMLScriptElement>>;
966
+ declare const del: TagFunction<HTMLModElement, TagProps<HTMLModElement>>;
967
+ declare const ins: TagFunction<HTMLModElement, TagProps<HTMLModElement>>;
968
+ declare const caption: TagFunction<HTMLTableCaptionElement, TagProps<HTMLTableCaptionElement>>;
969
+ declare const col: TagFunction<HTMLTableColElement, TagProps<HTMLTableColElement>>;
970
+ declare const colgroup: TagFunction<HTMLTableColElement, TagProps<HTMLTableColElement>>;
971
+ declare const table: TagFunction<HTMLTableElement, TagProps<HTMLTableElement>>;
972
+ declare const tbody: TagFunction<HTMLTableSectionElement, TagProps<HTMLTableSectionElement>>;
973
+ declare const td: TagFunction<HTMLTableCellElement, TagProps<HTMLTableCellElement>>;
974
+ declare const tfoot: TagFunction<HTMLTableSectionElement, TagProps<HTMLTableSectionElement>>;
975
+ declare const th: TagFunction<HTMLTableCellElement, TagProps<HTMLTableCellElement>>;
976
+ declare const thead: TagFunction<HTMLTableSectionElement, TagProps<HTMLTableSectionElement>>;
977
+ declare const tr: TagFunction<HTMLTableRowElement, TagProps<HTMLTableRowElement>>;
950
978
  declare const button: TypedTagFunction<ButtonProps, HTMLButtonElement>;
951
- declare const datalist: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
952
- declare const fieldset: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
979
+ declare const datalist: TagFunction<HTMLDataListElement, TagProps<HTMLDataListElement>>;
980
+ declare const fieldset: TagFunction<HTMLFieldSetElement, TagProps<HTMLFieldSetElement>>;
953
981
  declare const form: TypedTagFunction<FormProps, HTMLFormElement>;
954
982
  declare const input: TypedTagFunction<InputProps, HTMLInputElement>;
955
983
  declare const label: TypedTagFunction<LabelProps, HTMLLabelElement>;
956
- declare const legend: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
957
- declare const meter: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
958
- declare const optgroup: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
984
+ declare const legend: TagFunction<HTMLLegendElement, TagProps<HTMLLegendElement>>;
985
+ declare const meter: TagFunction<HTMLMeterElement, TagProps<HTMLMeterElement>>;
986
+ declare const optgroup: TagFunction<HTMLOptGroupElement, TagProps<HTMLOptGroupElement>>;
959
987
  declare const option: TypedTagFunction<OptionProps, HTMLOptionElement>;
960
- declare const output: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
961
- declare const progress: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
988
+ declare const output: TagFunction<HTMLOutputElement, TagProps<HTMLOutputElement>>;
989
+ declare const progress: TagFunction<HTMLProgressElement, TagProps<HTMLProgressElement>>;
962
990
  declare const select: TypedTagFunction<SelectProps, HTMLSelectElement>;
963
991
  declare const textarea: TypedTagFunction<TextareaProps, HTMLTextAreaElement>;
964
- declare const details: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
965
- declare const dialog: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
966
- declare const menu: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
967
- declare const summary: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
968
- declare const slot: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
969
- declare const template: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
970
- declare const base: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
971
- declare const link: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
972
- declare const meta: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
973
- declare const style: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
974
- declare const circle: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
975
- declare const ellipse: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
976
- declare const g: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
977
- declare const line: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
978
- declare const path: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
979
- declare const polygon: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
980
- declare const polyline: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
981
- declare const rect: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
982
- declare const text: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
983
- declare const tspan: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
984
- declare const defs: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
985
- declare const clipPath: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
986
- declare const mask: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
987
- declare const pattern: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
988
- declare const linearGradient: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
989
- declare const radialGradient: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
990
- declare const stop: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
991
- declare const use: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
992
- declare const symbol: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
993
- declare const marker: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
994
- declare const center: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
995
- declare const font: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
996
- declare const marquee: (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
997
- declare const customElement: (tagName: string) => (first?: TagProps | NodeChildren, second?: NodeChildren) => Element;
992
+ declare const details: TagFunction<HTMLDetailsElement, TagProps<HTMLDetailsElement>>;
993
+ declare const dialog: TagFunction<HTMLDialogElement, TagProps<HTMLDialogElement>>;
994
+ declare const menu: TagFunction<HTMLMenuElement, TagProps<HTMLMenuElement>>;
995
+ declare const summary: TagFunction<HTMLElement, TagProps<HTMLElement>>;
996
+ declare const slot: TagFunction<HTMLSlotElement, TagProps<HTMLSlotElement>>;
997
+ declare const template: TagFunction<HTMLTemplateElement, TagProps<HTMLTemplateElement>>;
998
+ declare const base: TagFunction<HTMLBaseElement, TagProps<HTMLBaseElement>>;
999
+ declare const link: TagFunction<HTMLLinkElement, TagProps<HTMLLinkElement>>;
1000
+ declare const meta: TagFunction<HTMLMetaElement, TagProps<HTMLMetaElement>>;
1001
+ /**
1002
+ * `<style>`. Its text is STYLESHEET SOURCE, applied unsanitized exactly like a
1003
+ * stylesheet shipped with the application — a trust boundary, since a tag
1004
+ * factory cannot tell a literal from runtime data. For CSS that comes from
1005
+ * runtime data use `scopedStyle()` (sanitized stylesheet text) or `style` props
1006
+ * (sanitized per declaration).
1007
+ */
1008
+ declare const style: TagFunction<HTMLStyleElement, TagProps<HTMLStyleElement>>;
1009
+ declare const circle: TagFunction<SVGCircleElement, TagProps<SVGCircleElement>>;
1010
+ declare const ellipse: TagFunction<SVGEllipseElement, TagProps<SVGEllipseElement>>;
1011
+ declare const g: TagFunction<SVGGElement, TagProps<SVGGElement>>;
1012
+ declare const line: TagFunction<SVGLineElement, TagProps<SVGLineElement>>;
1013
+ declare const path: TagFunction<SVGPathElement, TagProps<SVGPathElement>>;
1014
+ declare const polygon: TagFunction<SVGPolygonElement, TagProps<SVGPolygonElement>>;
1015
+ declare const polyline: TagFunction<SVGPolylineElement, TagProps<SVGPolylineElement>>;
1016
+ declare const rect: TagFunction<SVGRectElement, TagProps<SVGRectElement>>;
1017
+ declare const text: TagFunction<SVGTextElement, TagProps<SVGTextElement>>;
1018
+ declare const tspan: TagFunction<SVGTSpanElement, TagProps<SVGTSpanElement>>;
1019
+ declare const defs: TagFunction<SVGDefsElement, TagProps<SVGDefsElement>>;
1020
+ declare const clipPath: TagFunction<SVGClipPathElement, TagProps<SVGClipPathElement>>;
1021
+ declare const mask: TagFunction<SVGMaskElement, TagProps<SVGMaskElement>>;
1022
+ declare const pattern: TagFunction<SVGPatternElement, TagProps<SVGPatternElement>>;
1023
+ declare const linearGradient: TagFunction<SVGLinearGradientElement, TagProps<SVGLinearGradientElement>>;
1024
+ declare const radialGradient: TagFunction<SVGRadialGradientElement, TagProps<SVGRadialGradientElement>>;
1025
+ declare const stop: TagFunction<SVGStopElement, TagProps<SVGStopElement>>;
1026
+ declare const use: TagFunction<SVGUseElement, TagProps<SVGUseElement>>;
1027
+ declare const symbol: TagFunction<SVGSymbolElement, TagProps<SVGSymbolElement>>;
1028
+ declare const marker: TagFunction<SVGMarkerElement, TagProps<SVGMarkerElement>>;
1029
+ declare const center: TagFunction<HTMLElement, TagProps<HTMLElement>>;
1030
+ declare const font: TagFunction<HTMLElement, TagProps<HTMLElement>>;
1031
+ declare const marquee: TagFunction<HTMLElement, TagProps<HTMLElement>>;
1032
+ declare const customElement: (tagName: string) => TagFunction<HTMLElement, TagProps<HTMLElement>>;
998
1033
 
999
1034
  /**
1000
1035
  * Options for KeepAlive.
@@ -1044,10 +1079,6 @@ declare function KeepAlive(activeKey: () => string, cases: Record<string, () =>
1044
1079
  * @returns The pending error, or `undefined` when there is none.
1045
1080
  */
1046
1081
  declare function takePendingError(node: Element): Error | undefined;
1047
- type Component = () => HTMLElement;
1048
- type LazyImport = () => Promise<{
1049
- default: Component;
1050
- }>;
1051
1082
  /**
1052
1083
  * lazy() enables code-splitting by deferring the import of a component
1053
1084
  * until it is first rendered. Returns a wrapper component that shows a
@@ -1067,10 +1098,16 @@ type LazyImport = () => Promise<{
1067
1098
  * LazyDashboard();
1068
1099
  * ```
1069
1100
  *
1101
+ * The returned component renders either the loading container (a `div`) or,
1102
+ * once loaded, the component's own root — its return type is the union, so an
1103
+ * SVG component stays usable without a cast.
1104
+ *
1070
1105
  * @param importFn Dynamic import function returning `{ default: Component }`
1071
1106
  * @returns A component function that lazy-loads on first call
1072
1107
  */
1073
- declare function lazy(importFn: LazyImport): Component;
1108
+ declare function lazy<R extends Node = HTMLElement>(importFn: () => Promise<{
1109
+ default: Component<void, R>;
1110
+ }>): Component<void, R | HTMLDivElement>;
1074
1111
  /**
1075
1112
  * Suspense provides a fallback UI while lazy or async nodes are loading.
1076
1113
  *
@@ -1084,11 +1121,13 @@ declare function lazy(importFn: LazyImport): Component;
1084
1121
  *
1085
1122
  * @param props.nodes Function that returns the async/lazy component
1086
1123
  * @param props.fallback Function that returns the loading UI
1087
- * @returns An HTMLElement that swaps from fallback to content when ready
1124
+ * @returns A container element that swaps from fallback to content when ready
1088
1125
  */
1089
1126
  interface SuspenseProps {
1090
- nodes: () => HTMLElement;
1091
- fallback: () => HTMLElement;
1127
+ /** The content's root must be an element (HTML or SVG): its loading state is read from it. */
1128
+ nodes: () => Element;
1129
+ /** Any node, including a text node or fragment. */
1130
+ fallback: () => Node;
1092
1131
  }
1093
1132
  /**
1094
1133
  * Render `fallback` until the async `nodes` factory resolves, then swap it for
@@ -1102,7 +1141,7 @@ interface SuspenseProps {
1102
1141
  * the fallback are discarded. That is usually harmless (a spinner rarely holds
1103
1142
  * focus) but matters for a skeleton form; see the note on `when`.
1104
1143
  */
1105
- declare function Suspense({ nodes, fallback }: SuspenseProps): HTMLElement;
1144
+ declare function Suspense({ nodes, fallback }: SuspenseProps): HTMLDivElement;
1106
1145
 
1107
1146
  /**
1108
1147
  * Lifecycle hooks for SibuJS components.
@@ -1135,18 +1174,18 @@ type CleanupFn = () => void;
1135
1174
  * (if you also use onUnmount, prefer that for explicit cleanup).
1136
1175
  *
1137
1176
  * @param callback Function to run after mount. May return a cleanup function.
1138
- * @param element Optional element to observe; if provided, waits until it's connected.
1177
+ * @param element Optional element to observe (HTML or SVG); if provided, waits until it's connected.
1139
1178
  */
1140
- declare function onMount(callback: () => undefined | CleanupFn, element?: HTMLElement): void;
1179
+ declare function onMount(callback: () => undefined | CleanupFn, element?: Element): void;
1141
1180
  /**
1142
1181
  * Runs a callback when the given element is removed from the DOM.
1143
1182
  * Uses a shared MutationObserver to watch for disconnection, plus
1144
1183
  * `registerDisposer` so explicit dispose() paths also trigger the callback.
1145
1184
  *
1146
1185
  * @param callback Function to run on unmount
1147
- * @param element The element to watch for removal
1186
+ * @param element The element to watch for removal (HTML or SVG)
1148
1187
  */
1149
- declare function onUnmount(callback: CleanupFn, element: HTMLElement): void;
1188
+ declare function onUnmount(callback: CleanupFn, element: Element): void;
1150
1189
  /**
1151
1190
  * Register a cleanup callback that runs when the given element is disposed.
1152
1191
  * Integrates with `when()`, `match()`, and `each()` which call `dispose()`
@@ -1169,14 +1208,25 @@ declare function onCleanup(callback: CleanupFn, element: Node): void;
1169
1208
 
1170
1209
  /**
1171
1210
  * Mounts a root component into a DOM element.
1172
- * Supports both function components and pre-created HTMLElements.
1211
+ * Supports both function components and pre-created nodes.
1212
+ *
1213
+ * A component function runs as a render transaction: if it throws — or the
1214
+ * append fails — every binding and listener it registered is released before
1215
+ * the error reaches the caller, so a failed mount leaves nothing subscribed.
1216
+ * A pre-built node belongs to its caller and is never rolled back.
1217
+ *
1218
+ * A `DocumentFragment` root (from `Fragment()`) empties itself into the
1219
+ * container, so the mount tracks the range it filled instead: `unmount()`
1220
+ * disposes and removes everything in that range, including nodes a reactive
1221
+ * child rendered after mounting.
1173
1222
  *
1174
- * @param component Component function, or an already-built Element/Node.
1223
+ * @param component Component function (any root node, HTML or SVG element or
1224
+ * fragment), or an already-built Element/Node.
1175
1225
  * @param container Element to mount into.
1176
1226
  * @returns `{ node, unmount }` — the live root node, and a teardown that
1177
1227
  * disposes the tree and removes it.
1178
1228
  */
1179
- declare function mount(component: (() => Element) | Element | Node, container: Element | null): {
1229
+ declare function mount(component: Component<void, Node> | Node, container: Element | null): {
1180
1230
  node: Node;
1181
1231
  unmount: () => void;
1182
1232
  };
@@ -1189,7 +1239,8 @@ declare function mount(component: (() => Element) | Element | Node, container: E
1189
1239
  * are properly torn down when the anchor is disposed by `when()`, `match()`,
1190
1240
  * `each()`, or manual `dispose(anchor)`.
1191
1241
  *
1192
- * @param nodes Function that returns the content to render
1242
+ * @param nodes Function that returns the content to render — any element,
1243
+ * HTML or SVG (a `Component` fits)
1193
1244
  * @param target Target DOM element (defaults to document.body)
1194
1245
  * @returns A Comment anchor node in the original position
1195
1246
  *
@@ -1203,7 +1254,7 @@ declare function mount(component: (() => Element) | Element | Node, container: E
1203
1254
  * Portal(() => div("Tooltip"), overlay);
1204
1255
  * ```
1205
1256
  */
1206
- declare function Portal(nodes: () => HTMLElement, target?: HTMLElement): Comment;
1257
+ declare function Portal(nodes: () => Element, target?: Element): Comment;
1207
1258
 
1208
1259
  type SlotFn = () => Element | string | number | null | undefined;
1209
1260
  type Slots = Record<string, SlotFn>;
@@ -2196,4 +2247,4 @@ declare const untracked: ReactiveApi["untracked"];
2196
2247
  declare const retrack: ReactiveApi["retrack"];
2197
2248
  declare const setMaxDrainIterations: ReactiveApi["setMaxDrainIterations"];
2198
2249
 
2199
- export { Accessor, type ActionFn, type AnchorProps, type ArrayActions, type AsyncDerivedContext, type AsyncDerivedState, type AudioProps, type ButtonProps, type Context, DerivedAccessor, DynamicComponent, type EachBindings, type EachEventBindings, type EffectBody, type EffectOptions, type EnhanceContext, type EnhanceSetup, ErrorBoundary, type ErrorBoundaryOptions, type ErrorBoundaryProps, ErrorDisplay, type ErrorDisplayProps, type ErrorSeverity, type FormProps, Fragment, type ImgProps, type InputProps, type InputType, type IslandLoader, type IslandRegistration, type IslandStrategy, KeepAlive, type KeepAliveOptions, type LabelProps, type LazyIslandLoader, Loading, type LoadingProps, type LongPressOptions, MAX_DRAIN_TEARDOWNS, type MediaProps, type MountIslandsOptions, NodeChild, NodeChildren, type OnCleanup, type OptionProps, Portal, type Ref, type RuntimeErrorContext, type RuntimeErrorHandler, type RuntimeErrorPhase, type SSRStore, type SelectProps, type SlotFn, type Slots, type StoreActions, Suspense, type SuspenseProps, TagProps, type TextareaProps, type TypedTagFunction, type VideoProps, __resetIdCounter, a, abbr, action, address, area, array, article, aside, asyncDerived, audio, autoResize, b, base, batch, bdi, bdo, bindDynamic, blockquote, body, br, button, canvas, caption, catchError, catchErrorAsync, center, checkLeaks, circle, cite, clickOutside, clipPath, code, col, colgroup, context, copyOnClick, createId, customElement, data, datalist, dd, deepEqual, deepSignal, defer, defs, del, details, dfn, dialog, disableSSR, dispose, div, dl, dt, each, effect, ellipse, em, embed, enableSSR, enhance, enhanceAll, enqueueBatchedSignal, fieldset, figcaption, figure, font, footer, form, g, getAction, getRequestScopedCache, getRuntimeErrorHandler, getSSRStore, getSlot, h1, h2, h3, h4, h5, h6, head, header, hr, html, i, iframe, img, input, ins, isBatching, isSSR, kbd, label, lazy, lazyIsland, legend, li, line, linearGradient, link, longPress, main, map, mark, marker, marquee, mask, match, math, menu, meta, meter, mount, mountIslands, nav, nextTick, noscript, object, ol, on, onCleanup, onMount, onUnmount, optgroup, option, output, p, param, path, pattern, picture, polygon, polyline, portal, pre, progress, q, radialGradient, reactiveArray, rect, ref, registerAction, registerComponent, registerDisposer, registerIsland, replaceChildrenSafely, reportDrainRunaway, reportError, resolveComponent, retrack, rp, rt, ruby, runInSSRContext, s, samp, script, section, select, setGlobalErrorHandler, setMaxDrainIterations, setRuntimeErrorHandler, show, slot, small, source, span, stop, store, strict, strictEffect, strong, style, sub, summary, sup, svg, symbol, table, takePendingError, tbody, td, template, text, textarea, tfoot, th, thead, time, title, tr, track$1 as track, transition, trapFocus, tspan, u, ul, unregisterComponent, unregisterDisposer, unregisterIsland, untracked, use, var_, video, watch, when, withSSR, writable };
2250
+ export { Accessor, type ActionFn, type AnchorProps, type ArrayActions, type AsyncDerivedContext, type AsyncDerivedState, type AudioProps, type ButtonProps, Component, type Context, DerivedAccessor, DynamicComponent, type EachBindings, type EachEventBindings, type EffectBody, type EffectOptions, type EnhanceContext, type EnhanceSetup, ErrorBoundary, type ErrorBoundaryOptions, type ErrorBoundaryProps, ErrorDisplay, type ErrorDisplayProps, type ErrorSeverity, type FormProps, Fragment, type ImgProps, type InputProps, type InputType, type IslandLoader, type IslandRegistration, type IslandStrategy, KeepAlive, type KeepAliveOptions, type LabelProps, type LazyIslandLoader, Loading, type LoadingProps, type LongPressOptions, MAX_DRAIN_TEARDOWNS, type MediaProps, type MountIslandsOptions, NodeChild, NodeChildren, type OnCleanup, type OptionProps, Portal, type Ref, type RuntimeErrorContext, type RuntimeErrorHandler, type RuntimeErrorPhase, type SSRStore, type SelectProps, type SlotFn, type Slots, type StoreActions, Suspense, type SuspenseProps, TagFunction, TagProps, type TextareaProps, type TypedTagFunction, type VideoProps, __renderParsedTemplate, __resetIdCounter, a, abbr, action, address, area, array, article, aside, asyncDerived, audio, autoResize, b, base, batch, bdi, bdo, bindDynamic, blockquote, body, br, button, canvas, caption, catchError, catchErrorAsync, center, checkLeaks, circle, cite, clickOutside, clipPath, code, col, colgroup, context, copyOnClick, createId, customElement, data, datalist, dd, deepEqual, deepSignal, defer, defs, del, details, dfn, dialog, disableSSR, dispose, div, dl, dt, each, effect, ellipse, em, embed, enableSSR, enhance, enhanceAll, enqueueBatchedSignal, fieldset, figcaption, figure, font, footer, form, g, getAction, getRequestScopedCache, getRuntimeErrorHandler, getSSRStore, getSlot, h1, h2, h3, h4, h5, h6, head, header, hr, html, i, iframe, img, input, ins, isBatching, isSSR, kbd, label, lazy, lazyIsland, legend, li, line, linearGradient, link, longPress, main, map, mark, marker, marquee, mask, match, math, menu, meta, meter, mount, mountIslands, nav, nextTick, noscript, object, ol, on, onCleanup, onMount, onUnmount, optgroup, option, output, p, param, path, pattern, picture, polygon, polyline, portal, pre, progress, q, radialGradient, reactiveArray, rect, ref, registerAction, registerComponent, registerDisposer, registerIsland, replaceChildrenSafely, reportDrainRunaway, reportError, resolveComponent, retrack, rp, rt, ruby, runInSSRContext, s, samp, script, section, select, setGlobalErrorHandler, setMaxDrainIterations, setRuntimeErrorHandler, show, slot, small, source, span, stop, store, strict, strictEffect, strong, style, sub, summary, sup, svg, symbol, table, takePendingError, tbody, td, template, text, textarea, tfoot, th, thead, time, title, tr, track$1 as track, transition, trapFocus, tspan, u, ul, unregisterComponent, unregisterDisposer, unregisterIsland, untracked, use, var_, video, watch, when, withSSR, writable };