sibujs 1.0.0-beta.1

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 (302) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1630 -0
  3. package/dist/browser.cjs +815 -0
  4. package/dist/browser.d.cts +174 -0
  5. package/dist/browser.d.ts +174 -0
  6. package/dist/browser.js +458 -0
  7. package/dist/build.cjs +4970 -0
  8. package/dist/build.d.cts +630 -0
  9. package/dist/build.d.ts +630 -0
  10. package/dist/build.js +2478 -0
  11. package/dist/cdn.global.js +115 -0
  12. package/dist/chunk-27QC4FPL.js +67 -0
  13. package/dist/chunk-2ABBWCGC.js +65 -0
  14. package/dist/chunk-2MUNQYZ7.js +26 -0
  15. package/dist/chunk-2PSPKNUI.js +1711 -0
  16. package/dist/chunk-35CDLDX5.js +1758 -0
  17. package/dist/chunk-36MU4CFV.js +41 -0
  18. package/dist/chunk-3FIQOFI6.js +182 -0
  19. package/dist/chunk-3GHNC2BN.js +28 -0
  20. package/dist/chunk-3HLWWEPU.js +909 -0
  21. package/dist/chunk-3IVI3J54.js +252 -0
  22. package/dist/chunk-3KZ72WNW.js +944 -0
  23. package/dist/chunk-4AU64SQV.js +182 -0
  24. package/dist/chunk-4MOK7HAR.js +84 -0
  25. package/dist/chunk-4QK6FBDH.js +1429 -0
  26. package/dist/chunk-566Z7HXB.js +737 -0
  27. package/dist/chunk-5CRBB7XP.js +358 -0
  28. package/dist/chunk-5G67D3IZ.js +168 -0
  29. package/dist/chunk-5NCPAWBE.js +99 -0
  30. package/dist/chunk-5O2RKXR3.js +1444 -0
  31. package/dist/chunk-6BTBDO6A.js +633 -0
  32. package/dist/chunk-6IWEHW57.js +43 -0
  33. package/dist/chunk-6JGMNCD6.js +282 -0
  34. package/dist/chunk-6QRLJNXR.js +1425 -0
  35. package/dist/chunk-7HM5UE5T.js +270 -0
  36. package/dist/chunk-7JOLTGUH.js +58 -0
  37. package/dist/chunk-7MCWJCQK.js +909 -0
  38. package/dist/chunk-7RIIFP3E.js +1758 -0
  39. package/dist/chunk-7UASYN3G.js +254 -0
  40. package/dist/chunk-7W2WYHDI.js +741 -0
  41. package/dist/chunk-7Y35RDSJ.js +872 -0
  42. package/dist/chunk-A65GFJBL.js +65 -0
  43. package/dist/chunk-AD6ZIEDK.js +67 -0
  44. package/dist/chunk-AK5Y72F3.js +1426 -0
  45. package/dist/chunk-APOMMWH4.js +282 -0
  46. package/dist/chunk-ARZVTWIQ.js +1750 -0
  47. package/dist/chunk-AWWBM2BI.js +664 -0
  48. package/dist/chunk-AX5VEQTY.js +58 -0
  49. package/dist/chunk-AYTXVOW3.js +1708 -0
  50. package/dist/chunk-BG4A246G.js +1746 -0
  51. package/dist/chunk-BNFJJA2L.js +1425 -0
  52. package/dist/chunk-BPKPBVU5.js +59 -0
  53. package/dist/chunk-BPKPPSXC.js +282 -0
  54. package/dist/chunk-BPWKKK7F.js +1711 -0
  55. package/dist/chunk-CCKX6YTC.js +1735 -0
  56. package/dist/chunk-CIF5Z3MP.js +58 -0
  57. package/dist/chunk-CSXYU7IO.js +457 -0
  58. package/dist/chunk-D6JD4FDC.js +26 -0
  59. package/dist/chunk-E7NGA7X2.js +59 -0
  60. package/dist/chunk-EEPPJKAE.js +443 -0
  61. package/dist/chunk-EJMYGAGQ.js +717 -0
  62. package/dist/chunk-EL6Z5MDY.js +55 -0
  63. package/dist/chunk-EP7VRLEB.js +41 -0
  64. package/dist/chunk-ETMEC6FH.js +99 -0
  65. package/dist/chunk-EZ2WHYVL.js +65 -0
  66. package/dist/chunk-EZRVMSZK.js +67 -0
  67. package/dist/chunk-F2TRGINX.js +254 -0
  68. package/dist/chunk-F5JCIH3Q.js +642 -0
  69. package/dist/chunk-FGK3JKMN.js +909 -0
  70. package/dist/chunk-FQWPKSTD.js +1437 -0
  71. package/dist/chunk-FWHVLMCI.js +26 -0
  72. package/dist/chunk-GBEYQRO2.js +303 -0
  73. package/dist/chunk-GBLES3NK.js +248 -0
  74. package/dist/chunk-GQVGUQW6.js +1436 -0
  75. package/dist/chunk-HCV2T76T.js +457 -0
  76. package/dist/chunk-HS7ZKVPR.js +182 -0
  77. package/dist/chunk-HXDVV7HZ.js +909 -0
  78. package/dist/chunk-IB23VMO3.js +1746 -0
  79. package/dist/chunk-IEMZ7RTT.js +99 -0
  80. package/dist/chunk-IPGRSN42.js +1750 -0
  81. package/dist/chunk-IVMOK2QN.js +1750 -0
  82. package/dist/chunk-JCLGQO7T.js +443 -0
  83. package/dist/chunk-JDXL7KDB.js +1436 -0
  84. package/dist/chunk-JIIFW636.js +270 -0
  85. package/dist/chunk-JWGEEH7H.js +944 -0
  86. package/dist/chunk-K2BESAG7.js +1688 -0
  87. package/dist/chunk-K2U5YGF4.js +877 -0
  88. package/dist/chunk-K45FQ4Y4.js +175 -0
  89. package/dist/chunk-K7BPE427.js +1432 -0
  90. package/dist/chunk-KL3266RS.js +26 -0
  91. package/dist/chunk-KNN4P7DZ.js +84 -0
  92. package/dist/chunk-KP2DZH5Q.js +254 -0
  93. package/dist/chunk-KZHAJSQR.js +1636 -0
  94. package/dist/chunk-LBKGHMQV.js +1750 -0
  95. package/dist/chunk-LBTEPL7A.js +1731 -0
  96. package/dist/chunk-LEBBPTDB.js +1444 -0
  97. package/dist/chunk-LLH63WVQ.js +98 -0
  98. package/dist/chunk-LWVR2C4G.js +1711 -0
  99. package/dist/chunk-M3MDTVV2.js +896 -0
  100. package/dist/chunk-M5GNLDEO.js +303 -0
  101. package/dist/chunk-MFHVGKET.js +267 -0
  102. package/dist/chunk-MGWSG3PM.js +358 -0
  103. package/dist/chunk-MJNB47HB.js +19 -0
  104. package/dist/chunk-MLKGABMK.js +9 -0
  105. package/dist/chunk-MQWTY3JY.js +944 -0
  106. package/dist/chunk-MZZOQHNI.js +642 -0
  107. package/dist/chunk-NIHWGZS4.js +1426 -0
  108. package/dist/chunk-NSVVHQK5.js +41 -0
  109. package/dist/chunk-NVI2WE7D.js +443 -0
  110. package/dist/chunk-O7QBO3PH.js +58 -0
  111. package/dist/chunk-OAUPQBO2.js +270 -0
  112. package/dist/chunk-OB2LMD7C.js +297 -0
  113. package/dist/chunk-OHEYBWQU.js +58 -0
  114. package/dist/chunk-OI6OXUHJ.js +443 -0
  115. package/dist/chunk-OX2VMRMV.js +633 -0
  116. package/dist/chunk-P4FYE5TX.js +866 -0
  117. package/dist/chunk-P5KFWM4H.js +98 -0
  118. package/dist/chunk-PUMLE7RJ.js +1711 -0
  119. package/dist/chunk-Q4MFANBF.js +282 -0
  120. package/dist/chunk-QLEKZMMU.js +282 -0
  121. package/dist/chunk-RGGNGVO3.js +98 -0
  122. package/dist/chunk-RKJDRVV6.js +443 -0
  123. package/dist/chunk-S5BHU353.js +43 -0
  124. package/dist/chunk-SHQUSFH7.js +1426 -0
  125. package/dist/chunk-SMB4DBMD.js +182 -0
  126. package/dist/chunk-SNYHQP3D.js +743 -0
  127. package/dist/chunk-T24L3TBF.js +1717 -0
  128. package/dist/chunk-TAQNSOKT.js +692 -0
  129. package/dist/chunk-TDNY4SUA.js +41 -0
  130. package/dist/chunk-TNNF56IQ.js +1750 -0
  131. package/dist/chunk-TR7E6LYX.js +457 -0
  132. package/dist/chunk-URWUFH45.js +98 -0
  133. package/dist/chunk-UUSIH3XH.js +1429 -0
  134. package/dist/chunk-UYFNXLKR.js +1436 -0
  135. package/dist/chunk-V6F7KUWD.js +270 -0
  136. package/dist/chunk-VCZLXRMR.js +254 -0
  137. package/dist/chunk-VDHXSSBT.js +1426 -0
  138. package/dist/chunk-VM4QMKVK.js +254 -0
  139. package/dist/chunk-VWGYKYL2.js +737 -0
  140. package/dist/chunk-VX2OFBJN.js +1426 -0
  141. package/dist/chunk-VXVIE6DG.js +84 -0
  142. package/dist/chunk-W4OH7HG4.js +40 -0
  143. package/dist/chunk-WBVJX4GZ.js +98 -0
  144. package/dist/chunk-WDU2ZV4I.js +1426 -0
  145. package/dist/chunk-X6VUCICU.js +457 -0
  146. package/dist/chunk-XAY7FM7Y.js +618 -0
  147. package/dist/chunk-XJZ5Z2CM.js +642 -0
  148. package/dist/chunk-XKVFQTJJ.js +254 -0
  149. package/dist/chunk-XRLFASCY.js +22 -0
  150. package/dist/chunk-XYU6TZOW.js +182 -0
  151. package/dist/chunk-Y745CBVB.js +944 -0
  152. package/dist/chunk-YLBJSXYY.js +944 -0
  153. package/dist/chunk-YQJIKVPZ.js +1429 -0
  154. package/dist/chunk-YRM2VCZF.js +457 -0
  155. package/dist/chunk-YS33KBVJ.js +944 -0
  156. package/dist/chunk-Z27DZPDG.js +41 -0
  157. package/dist/chunk-ZXQ5NAEN.js +32 -0
  158. package/dist/contracts-B552GopR.d.cts +245 -0
  159. package/dist/contracts-B552GopR.d.ts +245 -0
  160. package/dist/contracts-Bg1ECISC.d.cts +245 -0
  161. package/dist/contracts-Bg1ECISC.d.ts +245 -0
  162. package/dist/contracts-CMriKJ6P.d.cts +245 -0
  163. package/dist/contracts-CMriKJ6P.d.ts +245 -0
  164. package/dist/contracts-DOrhwbke.d.cts +245 -0
  165. package/dist/contracts-DOrhwbke.d.ts +245 -0
  166. package/dist/data.cjs +1373 -0
  167. package/dist/data.d.cts +434 -0
  168. package/dist/data.d.ts +434 -0
  169. package/dist/data.js +945 -0
  170. package/dist/devtools.cjs +1357 -0
  171. package/dist/devtools.d.cts +473 -0
  172. package/dist/devtools.d.ts +473 -0
  173. package/dist/devtools.js +1084 -0
  174. package/dist/ecosystem.cjs +1046 -0
  175. package/dist/ecosystem.d.cts +247 -0
  176. package/dist/ecosystem.d.ts +247 -0
  177. package/dist/ecosystem.js +369 -0
  178. package/dist/extras.cjs +8457 -0
  179. package/dist/extras.d.cts +2356 -0
  180. package/dist/extras.d.ts +2356 -0
  181. package/dist/extras.js +5152 -0
  182. package/dist/index.cjs +2648 -0
  183. package/dist/index.d.cts +869 -0
  184. package/dist/index.d.ts +869 -0
  185. package/dist/index.js +386 -0
  186. package/dist/motion.cjs +604 -0
  187. package/dist/motion.d.cts +146 -0
  188. package/dist/motion.d.ts +146 -0
  189. package/dist/motion.js +346 -0
  190. package/dist/patterns.cjs +815 -0
  191. package/dist/patterns.d.cts +163 -0
  192. package/dist/patterns.d.ts +163 -0
  193. package/dist/patterns.js +296 -0
  194. package/dist/performance.cjs +927 -0
  195. package/dist/performance.d.cts +416 -0
  196. package/dist/performance.d.ts +416 -0
  197. package/dist/performance.js +654 -0
  198. package/dist/plugins.cjs +2487 -0
  199. package/dist/plugins.d.cts +393 -0
  200. package/dist/plugins.d.ts +393 -0
  201. package/dist/plugins.js +1504 -0
  202. package/dist/signal-BnWpq6WB.d.cts +5 -0
  203. package/dist/signal-BnWpq6WB.d.ts +5 -0
  204. package/dist/src/components/ErrorBoundary.d.ts +15 -0
  205. package/dist/src/components/ErrorBoundary.js +119 -0
  206. package/dist/src/core/catch.d.ts +11 -0
  207. package/dist/src/core/catch.js +28 -0
  208. package/dist/src/core/each.d.ts +13 -0
  209. package/dist/src/core/each.js +68 -0
  210. package/dist/src/core/for.d.ts +12 -0
  211. package/dist/src/core/for.js +67 -0
  212. package/dist/src/core/html.d.ts +137 -0
  213. package/dist/src/core/html.js +155 -0
  214. package/dist/src/core/htmlIf.d.ts +11 -0
  215. package/dist/src/core/htmlIf.js +18 -0
  216. package/dist/src/core/lazy.d.ts +7 -0
  217. package/dist/src/core/lazy.js +16 -0
  218. package/dist/src/core/mount.d.ts +7 -0
  219. package/dist/src/core/mount.js +12 -0
  220. package/dist/src/core/slots.d.ts +3 -0
  221. package/dist/src/core/slots.js +3 -0
  222. package/dist/src/core/suspense.d.ts +10 -0
  223. package/dist/src/core/suspense.js +33 -0
  224. package/dist/src/core/tagFactory.d.ts +13 -0
  225. package/dist/src/core/tagFactory.js +86 -0
  226. package/dist/src/core/test.d.ts +11 -0
  227. package/dist/src/core/test.js +28 -0
  228. package/dist/src/core/types.d.ts +2 -0
  229. package/dist/src/core/types.js +1 -0
  230. package/dist/src/core/useComputed.d.ts +6 -0
  231. package/dist/src/core/useComputed.js +30 -0
  232. package/dist/src/core/useEffect.d.ts +6 -0
  233. package/dist/src/core/useEffect.js +23 -0
  234. package/dist/src/core/useState.d.ts +10 -0
  235. package/dist/src/core/useState.js +34 -0
  236. package/dist/src/core/useStore.d.ts +19 -0
  237. package/dist/src/core/useStore.js +53 -0
  238. package/dist/src/core/useWatch.d.ts +8 -0
  239. package/dist/src/core/useWatch.js +23 -0
  240. package/dist/src/plugins/i18n.d.ts +6 -0
  241. package/dist/src/plugins/i18n.js +16 -0
  242. package/dist/src/plugins/router.d.ts +188 -0
  243. package/dist/src/plugins/router.js +1178 -0
  244. package/dist/src/reactivity/bindAttribute.d.ts +5 -0
  245. package/dist/src/reactivity/bindAttribute.js +31 -0
  246. package/dist/src/reactivity/bindChildNode.d.ts +10 -0
  247. package/dist/src/reactivity/bindChildNode.js +46 -0
  248. package/dist/src/reactivity/bindTextNode.d.ts +10 -0
  249. package/dist/src/reactivity/bindTextNode.js +27 -0
  250. package/dist/src/reactivity/signal.d.ts +3 -0
  251. package/dist/src/reactivity/signal.js +1 -0
  252. package/dist/src/reactivity/track.d.ts +18 -0
  253. package/dist/src/reactivity/track.js +73 -0
  254. package/dist/src/reactivity/useComputed.d.ts +6 -0
  255. package/dist/src/reactivity/useComputed.js +30 -0
  256. package/dist/src/reactivity/useEffect.d.ts +6 -0
  257. package/dist/src/reactivity/useEffect.js +23 -0
  258. package/dist/src/reactivity/useState.d.ts +10 -0
  259. package/dist/src/reactivity/useState.js +34 -0
  260. package/dist/src/reactivity/useStore.d.ts +19 -0
  261. package/dist/src/reactivity/useStore.js +53 -0
  262. package/dist/src/reactivity/useWatch.d.ts +8 -0
  263. package/dist/src/reactivity/useWatch.js +23 -0
  264. package/dist/src/utils/sanitize.d.ts +1 -0
  265. package/dist/src/utils/sanitize.js +8 -0
  266. package/dist/ssr-27FOM46T.js +35 -0
  267. package/dist/ssr-GFUTTSJD.js +22 -0
  268. package/dist/ssr-K7DCR6BZ.js +35 -0
  269. package/dist/ssr-O6LFMRFP.js +35 -0
  270. package/dist/ssr-QZEVGMMK.js +35 -0
  271. package/dist/ssr-SGVBCAGC.js +35 -0
  272. package/dist/ssr-UB2IXCYX.js +35 -0
  273. package/dist/ssr-XBZQNV4O.js +22 -0
  274. package/dist/ssr-Y76FSXDU.js +35 -0
  275. package/dist/ssr-YQJ4AYBD.js +35 -0
  276. package/dist/ssr.cjs +1757 -0
  277. package/dist/ssr.d.cts +478 -0
  278. package/dist/ssr.d.ts +478 -0
  279. package/dist/ssr.js +743 -0
  280. package/dist/tagFactory-CZPO4RXF.d.cts +34 -0
  281. package/dist/tagFactory-CZPO4RXF.d.ts +34 -0
  282. package/dist/tagFactory-CgImPVMY.d.cts +22 -0
  283. package/dist/tagFactory-CgImPVMY.d.ts +22 -0
  284. package/dist/tagFactory-Cw1iv5if.d.cts +22 -0
  285. package/dist/tagFactory-Cw1iv5if.d.ts +22 -0
  286. package/dist/tagFactory-DeAXq9ef.d.cts +30 -0
  287. package/dist/tagFactory-DeAXq9ef.d.ts +30 -0
  288. package/dist/tagFactory-SkY0a7L1.d.cts +22 -0
  289. package/dist/tagFactory-SkY0a7L1.d.ts +22 -0
  290. package/dist/testing.cjs +1919 -0
  291. package/dist/testing.d.cts +491 -0
  292. package/dist/testing.d.ts +491 -0
  293. package/dist/testing.js +1862 -0
  294. package/dist/ui.cjs +1497 -0
  295. package/dist/ui.d.cts +264 -0
  296. package/dist/ui.d.ts +264 -0
  297. package/dist/ui.js +900 -0
  298. package/dist/widgets.cjs +919 -0
  299. package/dist/widgets.d.cts +165 -0
  300. package/dist/widgets.d.ts +165 -0
  301. package/dist/widgets.js +545 -0
  302. package/package.json +134 -0
@@ -0,0 +1,5 @@
1
+ interface ReactiveSignal {
2
+ _subscribe?: (subscriber: () => void) => () => void;
3
+ }
4
+
5
+ export type { ReactiveSignal as R };
@@ -0,0 +1,5 @@
1
+ interface ReactiveSignal {
2
+ _subscribe?: (subscriber: () => void) => () => void;
3
+ }
4
+
5
+ export type { ReactiveSignal as R };
@@ -0,0 +1,15 @@
1
+ export interface ErrorBoundaryProps {
2
+ /**
3
+ * Function that renders child content or throws.
4
+ */
5
+ children: () => HTMLElement;
6
+ /**
7
+ * Fallback renderer given an Error and optional retry callback.
8
+ */
9
+ fallback?: (error: Error, retry?: () => void) => HTMLElement;
10
+ }
11
+ /**
12
+ * ErrorBoundary component using SibuJS reactive pattern.
13
+ * Catches errors from children and displays fallback UI with retry functionality.
14
+ */
15
+ export declare function ErrorBoundary({ children, fallback }: ErrorBoundaryProps): HTMLElement;
@@ -0,0 +1,119 @@
1
+ import { useState } from "../core/useState";
2
+ import { div, h3, p, button, style } from "../core/html";
3
+ // CSS styles for ErrorBoundary
4
+ const errorBoundaryStyles = `
5
+ .error-fallback {
6
+ border: 2px solid #dc3545;
7
+ border-radius: 8px;
8
+ padding: 20px;
9
+ margin: 10px 0;
10
+ background-color: #ffebee;
11
+ box-shadow: 0 2px 8px rgba(220, 53, 69, 0.2);
12
+ }
13
+
14
+ .error-fallback .section-title {
15
+ margin: 0 0 15px 0;
16
+ color: #dc3545;
17
+ font-size: 1.2em;
18
+ font-weight: bold;
19
+ }
20
+
21
+ .error-fallback .text-mono {
22
+ font-family: 'Courier New', 'Monaco', 'Menlo', monospace;
23
+ background-color: #f8f9fa;
24
+ padding: 8px 12px;
25
+ border-radius: 4px;
26
+ border: 1px solid #e9ecef;
27
+ margin: 10px 0;
28
+ color: #495057;
29
+ word-break: break-word;
30
+ }
31
+
32
+ .error-fallback .btn {
33
+ display: inline-block;
34
+ padding: 8px 16px;
35
+ border: none;
36
+ border-radius: 4px;
37
+ cursor: pointer;
38
+ font-size: 14px;
39
+ font-weight: 500;
40
+ text-decoration: none;
41
+ transition: all 0.2s ease;
42
+ margin: 4px 0;
43
+ }
44
+
45
+ .error-fallback .btn:hover {
46
+ transform: translateY(-1px);
47
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
48
+ }
49
+
50
+ .error-fallback .btn:active {
51
+ transform: translateY(0);
52
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
53
+ }
54
+
55
+ .error-fallback .btn-danger {
56
+ background-color: #dc3545;
57
+ color: white;
58
+ }
59
+
60
+ .error-fallback .btn-danger:hover {
61
+ background-color: #c82333;
62
+ }
63
+ `;
64
+ // Inject styles only once
65
+ let stylesInjected = false;
66
+ function injectStyles() {
67
+ if (!stylesInjected) {
68
+ const styleElement = style({ children: errorBoundaryStyles });
69
+ document.head.appendChild(styleElement);
70
+ stylesInjected = true;
71
+ }
72
+ }
73
+ /**
74
+ * ErrorBoundary component using SibuJS reactive pattern.
75
+ * Catches errors from children and displays fallback UI with retry functionality.
76
+ */
77
+ export function ErrorBoundary({ children, fallback }) {
78
+ // Inject styles when component is used
79
+ injectStyles();
80
+ const [error, setError] = useState(null);
81
+ const retry = () => setError(null);
82
+ // Default fallback with built-in styling
83
+ const defaultFallback = (error, retry) => div({
84
+ class: "error-fallback",
85
+ children: [
86
+ h3({
87
+ children: "🚨 Something went wrong!",
88
+ class: "section-title"
89
+ }),
90
+ p({
91
+ children: `Error: ${error.message}`,
92
+ class: "text-mono"
93
+ }),
94
+ retry ? button({
95
+ children: "🔄 Try Again",
96
+ class: "btn btn-danger",
97
+ on: { click: retry }
98
+ }) : null
99
+ ].filter(Boolean)
100
+ });
101
+ return div({
102
+ children: () => {
103
+ const currentError = error();
104
+ if (currentError) {
105
+ return fallback ? fallback(currentError, retry) : defaultFallback(currentError, retry);
106
+ }
107
+ try {
108
+ return children();
109
+ }
110
+ catch (e) {
111
+ const errorObj = e instanceof Error ? e : new Error(String(e));
112
+ // Set error state and let next render cycle show the fallback
113
+ setError(errorObj);
114
+ // Return fallback immediately instead of temporary message
115
+ return fallback ? fallback(errorObj, retry) : defaultFallback(errorObj, retry);
116
+ }
117
+ }
118
+ });
119
+ }
@@ -0,0 +1,11 @@
1
+ type ErrorHandler = (error: unknown, context?: any) => void;
2
+ /**
3
+ * Wraps any function in a try/catch block and optionally passes error to a handler.
4
+ * This is used internally by components or boundaries.
5
+ */
6
+ export declare function catchError(fn: () => any, onError?: ErrorHandler): any;
7
+ /**
8
+ * Sets a global error handler used by default if no onError is provided.
9
+ */
10
+ export declare function setGlobalErrorHandler(handler: ErrorHandler): void;
11
+ export {};
@@ -0,0 +1,28 @@
1
+ let globalErrorHandler = null;
2
+ /**
3
+ * Wraps any function in a try/catch block and optionally passes error to a handler.
4
+ * This is used internally by components or boundaries.
5
+ */
6
+ export function catchError(fn, onError) {
7
+ try {
8
+ return fn();
9
+ }
10
+ catch (err) {
11
+ if (onError) {
12
+ onError(err);
13
+ }
14
+ else if (globalErrorHandler) {
15
+ globalErrorHandler(err);
16
+ }
17
+ else {
18
+ console.error("Unhandled error in Sibu.catch:", err);
19
+ }
20
+ return null;
21
+ }
22
+ }
23
+ /**
24
+ * Sets a global error handler used by default if no onError is provided.
25
+ */
26
+ export function setGlobalErrorHandler(handler) {
27
+ globalErrorHandler = handler;
28
+ }
@@ -0,0 +1,13 @@
1
+ import { NodeChild } from "./types";
2
+ /**
3
+ * Renders a list of nodes efficiently with key-based diffing.
4
+ * Only removes nodes whose keys are absent, reuses existing nodes, and orders them.
5
+ *
6
+ * @param getArray A reactive getter returning an array.
7
+ * @param render A function that returns a NodeChild for each item.
8
+ * @param options A key function for unique identity of items.
9
+ * @returns A Comment node serving as the anchor for the list.
10
+ */
11
+ export declare function each<T>(getArray: () => T[], render: (item: T, index: number) => NodeChild, options: {
12
+ key: (item: T) => string | number;
13
+ }): Comment;
@@ -0,0 +1,68 @@
1
+ import { track } from "../reactivity/track";
2
+ /**
3
+ * Resolves a NodeChild to a real Node.
4
+ * - If it's a function, calls recursively.
5
+ * - If it's already a Node, returns it.
6
+ * - Otherwise (string/number), wraps in Text node.
7
+ */
8
+ function resolveNodeChild(child) {
9
+ if (typeof child === "function") {
10
+ return resolveNodeChild(child());
11
+ }
12
+ if (child instanceof Node) {
13
+ return child;
14
+ }
15
+ return document.createTextNode(String(child));
16
+ }
17
+ /**
18
+ * Renders a list of nodes efficiently with key-based diffing.
19
+ * Only removes nodes whose keys are absent, reuses existing nodes, and orders them.
20
+ *
21
+ * @param getArray A reactive getter returning an array.
22
+ * @param render A function that returns a NodeChild for each item.
23
+ * @param options A key function for unique identity of items.
24
+ * @returns A Comment node serving as the anchor for the list.
25
+ */
26
+ export function each(getArray, render, options) {
27
+ const anchor = document.createComment("each:anchor");
28
+ let nodeMap = new Map();
29
+ const update = () => {
30
+ const parent = anchor.parentNode;
31
+ if (!parent)
32
+ return;
33
+ const arr = getArray();
34
+ const newKeys = arr.map(options.key);
35
+ const newNodeMap = new Map();
36
+ // Build or reuse nodes
37
+ newKeys.forEach((key, i) => {
38
+ if (nodeMap.has(key)) {
39
+ newNodeMap.set(key, nodeMap.get(key));
40
+ }
41
+ else {
42
+ const raw = render(arr[i], i);
43
+ const node = resolveNodeChild(raw);
44
+ newNodeMap.set(key, node);
45
+ }
46
+ });
47
+ // Remove old nodes not in new keys
48
+ for (const [key, node] of nodeMap) {
49
+ if (!newNodeMap.has(key) && node.parentNode) {
50
+ parent.removeChild(node);
51
+ }
52
+ }
53
+ // Insert or reorder nodes
54
+ let next = anchor.nextSibling;
55
+ for (const key of newKeys) {
56
+ const node = newNodeMap.get(key);
57
+ if (node !== next) {
58
+ parent.insertBefore(node, next);
59
+ }
60
+ else {
61
+ next = next.nextSibling;
62
+ }
63
+ }
64
+ nodeMap = newNodeMap;
65
+ };
66
+ queueMicrotask(() => track(update, update));
67
+ return anchor;
68
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * For - Smart array rendering with automatic reactivity and fallbacks
3
+ *
4
+ * @param array Reactive array or getter function returning array
5
+ * @param renderFn Function to render each item
6
+ * @param options Configuration options
7
+ * @returns Comment node (anchor) for the list or fallback element
8
+ */
9
+ export declare function For<T>(array: T[] | (() => T[]), renderFn: (item: T, index: number) => HTMLElement, options?: {
10
+ key?: (item: T) => string | number;
11
+ fallback?: HTMLElement | string;
12
+ }): Comment | HTMLElement;
@@ -0,0 +1,67 @@
1
+ import { each } from "./each";
2
+ import { div } from "./html";
3
+ import { track } from "../reactivity/track";
4
+ /**
5
+ * For - Smart array rendering with automatic reactivity and fallbacks
6
+ *
7
+ * @param array Reactive array or getter function returning array
8
+ * @param renderFn Function to render each item
9
+ * @param options Configuration options
10
+ * @returns Comment node (anchor) for the list or fallback element
11
+ */
12
+ export function For(array, renderFn, options) {
13
+ const arrayGetter = typeof array === 'function' ? array : () => array;
14
+ // If fallback is provided, create reactive container
15
+ if (options?.fallback) {
16
+ const container = div({ style: { display: 'contents' } });
17
+ let currentElement = null;
18
+ const update = () => {
19
+ const items = arrayGetter();
20
+ const isEmpty = !items || items.length === 0;
21
+ // Remove current element
22
+ if (currentElement?.parentNode) {
23
+ currentElement.parentNode.removeChild(currentElement);
24
+ }
25
+ if (isEmpty) {
26
+ // Show fallback
27
+ const fallbackEl = typeof options.fallback === 'string'
28
+ ? div({ children: options.fallback })
29
+ : options.fallback;
30
+ container.appendChild(fallbackEl);
31
+ currentElement = fallbackEl;
32
+ }
33
+ else {
34
+ // Show list
35
+ const listAnchor = each(arrayGetter, renderFn, {
36
+ key: options?.key || autoKey
37
+ });
38
+ container.appendChild(listAnchor);
39
+ currentElement = listAnchor;
40
+ }
41
+ };
42
+ // Initial render and reactive updates
43
+ queueMicrotask(() => track(update, update));
44
+ return container;
45
+ }
46
+ // Simple case: just return the each() anchor
47
+ return each(arrayGetter, renderFn, {
48
+ key: options?.key || autoKey
49
+ });
50
+ }
51
+ /**
52
+ * Auto-generate keys for items
53
+ */
54
+ function autoKey(item) {
55
+ // Try common id fields
56
+ if (item && typeof item === 'object') {
57
+ const obj = item;
58
+ if ('id' in obj)
59
+ return obj.id;
60
+ if ('key' in obj)
61
+ return obj.key;
62
+ if ('_id' in obj)
63
+ return obj._id;
64
+ }
65
+ // Fallback to JSON stringify (not ideal for performance but works)
66
+ return JSON.stringify(item);
67
+ }
@@ -0,0 +1,137 @@
1
+ export declare const html: (props?: import("./tagFactory").TagProps) => HTMLElement;
2
+ export declare const head: (props?: import("./tagFactory").TagProps) => HTMLElement;
3
+ export declare const body: (props?: import("./tagFactory").TagProps) => HTMLElement;
4
+ export declare const title: (props?: import("./tagFactory").TagProps) => HTMLElement;
5
+ export declare const div: (props?: import("./tagFactory").TagProps) => HTMLElement;
6
+ export declare const span: (props?: import("./tagFactory").TagProps) => HTMLElement;
7
+ export declare const section: (props?: import("./tagFactory").TagProps) => HTMLElement;
8
+ export declare const article: (props?: import("./tagFactory").TagProps) => HTMLElement;
9
+ export declare const header: (props?: import("./tagFactory").TagProps) => HTMLElement;
10
+ export declare const footer: (props?: import("./tagFactory").TagProps) => HTMLElement;
11
+ export declare const nav: (props?: import("./tagFactory").TagProps) => HTMLElement;
12
+ export declare const main: (props?: import("./tagFactory").TagProps) => HTMLElement;
13
+ export declare const aside: (props?: import("./tagFactory").TagProps) => HTMLElement;
14
+ export declare const address: (props?: import("./tagFactory").TagProps) => HTMLElement;
15
+ export declare const p: (props?: import("./tagFactory").TagProps) => HTMLElement;
16
+ export declare const h1: (props?: import("./tagFactory").TagProps) => HTMLElement;
17
+ export declare const h2: (props?: import("./tagFactory").TagProps) => HTMLElement;
18
+ export declare const h3: (props?: import("./tagFactory").TagProps) => HTMLElement;
19
+ export declare const h4: (props?: import("./tagFactory").TagProps) => HTMLElement;
20
+ export declare const h5: (props?: import("./tagFactory").TagProps) => HTMLElement;
21
+ export declare const h6: (props?: import("./tagFactory").TagProps) => HTMLElement;
22
+ export declare const blockquote: (props?: import("./tagFactory").TagProps) => HTMLElement;
23
+ export declare const dd: (props?: import("./tagFactory").TagProps) => HTMLElement;
24
+ export declare const dl: (props?: import("./tagFactory").TagProps) => HTMLElement;
25
+ export declare const dt: (props?: import("./tagFactory").TagProps) => HTMLElement;
26
+ export declare const figcaption: (props?: import("./tagFactory").TagProps) => HTMLElement;
27
+ export declare const figure: (props?: import("./tagFactory").TagProps) => HTMLElement;
28
+ export declare const hr: (props?: import("./tagFactory").TagProps) => HTMLElement;
29
+ export declare const li: (props?: import("./tagFactory").TagProps) => HTMLElement;
30
+ export declare const ol: (props?: import("./tagFactory").TagProps) => HTMLElement;
31
+ export declare const ul: (props?: import("./tagFactory").TagProps) => HTMLElement;
32
+ export declare const pre: (props?: import("./tagFactory").TagProps) => HTMLElement;
33
+ export declare const a: (props?: import("./tagFactory").TagProps) => HTMLElement;
34
+ export declare const abbr: (props?: import("./tagFactory").TagProps) => HTMLElement;
35
+ export declare const b: (props?: import("./tagFactory").TagProps) => HTMLElement;
36
+ export declare const bdi: (props?: import("./tagFactory").TagProps) => HTMLElement;
37
+ export declare const bdo: (props?: import("./tagFactory").TagProps) => HTMLElement;
38
+ export declare const br: (props?: import("./tagFactory").TagProps) => HTMLElement;
39
+ export declare const cite: (props?: import("./tagFactory").TagProps) => HTMLElement;
40
+ export declare const code: (props?: import("./tagFactory").TagProps) => HTMLElement;
41
+ export declare const data: (props?: import("./tagFactory").TagProps) => HTMLElement;
42
+ export declare const dfn: (props?: import("./tagFactory").TagProps) => HTMLElement;
43
+ export declare const em: (props?: import("./tagFactory").TagProps) => HTMLElement;
44
+ export declare const i: (props?: import("./tagFactory").TagProps) => HTMLElement;
45
+ export declare const kbd: (props?: import("./tagFactory").TagProps) => HTMLElement;
46
+ export declare const mark: (props?: import("./tagFactory").TagProps) => HTMLElement;
47
+ export declare const q: (props?: import("./tagFactory").TagProps) => HTMLElement;
48
+ export declare const rp: (props?: import("./tagFactory").TagProps) => HTMLElement;
49
+ export declare const rt: (props?: import("./tagFactory").TagProps) => HTMLElement;
50
+ export declare const ruby: (props?: import("./tagFactory").TagProps) => HTMLElement;
51
+ export declare const s: (props?: import("./tagFactory").TagProps) => HTMLElement;
52
+ export declare const samp: (props?: import("./tagFactory").TagProps) => HTMLElement;
53
+ export declare const small: (props?: import("./tagFactory").TagProps) => HTMLElement;
54
+ export declare const strong: (props?: import("./tagFactory").TagProps) => HTMLElement;
55
+ export declare const sub: (props?: import("./tagFactory").TagProps) => HTMLElement;
56
+ export declare const sup: (props?: import("./tagFactory").TagProps) => HTMLElement;
57
+ export declare const time: (props?: import("./tagFactory").TagProps) => HTMLElement;
58
+ export declare const u: (props?: import("./tagFactory").TagProps) => HTMLElement;
59
+ export declare const var_: (props?: import("./tagFactory").TagProps) => HTMLElement;
60
+ export declare const area: (props?: import("./tagFactory").TagProps) => HTMLElement;
61
+ export declare const audio: (props?: import("./tagFactory").TagProps) => HTMLElement;
62
+ export declare const img: (props?: import("./tagFactory").TagProps) => HTMLElement;
63
+ export declare const map: (props?: import("./tagFactory").TagProps) => HTMLElement;
64
+ export declare const track: (props?: import("./tagFactory").TagProps) => HTMLElement;
65
+ export declare const video: (props?: import("./tagFactory").TagProps) => HTMLElement;
66
+ export declare const embed: (props?: import("./tagFactory").TagProps) => HTMLElement;
67
+ export declare const iframe: (props?: import("./tagFactory").TagProps) => HTMLElement;
68
+ export declare const object: (props?: import("./tagFactory").TagProps) => HTMLElement;
69
+ export declare const param: (props?: import("./tagFactory").TagProps) => HTMLElement;
70
+ export declare const picture: (props?: import("./tagFactory").TagProps) => HTMLElement;
71
+ export declare const portal: (props?: import("./tagFactory").TagProps) => HTMLElement;
72
+ export declare const source: (props?: import("./tagFactory").TagProps) => HTMLElement;
73
+ export declare const svg: (props?: import("./tagFactory").TagProps) => HTMLElement;
74
+ export declare const math: (props?: import("./tagFactory").TagProps) => HTMLElement;
75
+ export declare const canvas: (props?: import("./tagFactory").TagProps) => HTMLElement;
76
+ export declare const noscript: (props?: import("./tagFactory").TagProps) => HTMLElement;
77
+ export declare const script: (props?: import("./tagFactory").TagProps) => HTMLElement;
78
+ export declare const del: (props?: import("./tagFactory").TagProps) => HTMLElement;
79
+ export declare const ins: (props?: import("./tagFactory").TagProps) => HTMLElement;
80
+ export declare const caption: (props?: import("./tagFactory").TagProps) => HTMLElement;
81
+ export declare const col: (props?: import("./tagFactory").TagProps) => HTMLElement;
82
+ export declare const colgroup: (props?: import("./tagFactory").TagProps) => HTMLElement;
83
+ export declare const table: (props?: import("./tagFactory").TagProps) => HTMLElement;
84
+ export declare const tbody: (props?: import("./tagFactory").TagProps) => HTMLElement;
85
+ export declare const td: (props?: import("./tagFactory").TagProps) => HTMLElement;
86
+ export declare const tfoot: (props?: import("./tagFactory").TagProps) => HTMLElement;
87
+ export declare const th: (props?: import("./tagFactory").TagProps) => HTMLElement;
88
+ export declare const thead: (props?: import("./tagFactory").TagProps) => HTMLElement;
89
+ export declare const tr: (props?: import("./tagFactory").TagProps) => HTMLElement;
90
+ export declare const button: (props?: import("./tagFactory").TagProps) => HTMLElement;
91
+ export declare const datalist: (props?: import("./tagFactory").TagProps) => HTMLElement;
92
+ export declare const fieldset: (props?: import("./tagFactory").TagProps) => HTMLElement;
93
+ export declare const form: (props?: import("./tagFactory").TagProps) => HTMLElement;
94
+ export declare const input: (props?: import("./tagFactory").TagProps) => HTMLElement;
95
+ export declare const label: (props?: import("./tagFactory").TagProps) => HTMLElement;
96
+ export declare const legend: (props?: import("./tagFactory").TagProps) => HTMLElement;
97
+ export declare const meter: (props?: import("./tagFactory").TagProps) => HTMLElement;
98
+ export declare const optgroup: (props?: import("./tagFactory").TagProps) => HTMLElement;
99
+ export declare const option: (props?: import("./tagFactory").TagProps) => HTMLElement;
100
+ export declare const output: (props?: import("./tagFactory").TagProps) => HTMLElement;
101
+ export declare const progress: (props?: import("./tagFactory").TagProps) => HTMLElement;
102
+ export declare const select: (props?: import("./tagFactory").TagProps) => HTMLElement;
103
+ export declare const textarea: (props?: import("./tagFactory").TagProps) => HTMLElement;
104
+ export declare const details: (props?: import("./tagFactory").TagProps) => HTMLElement;
105
+ export declare const dialog: (props?: import("./tagFactory").TagProps) => HTMLElement;
106
+ export declare const menu: (props?: import("./tagFactory").TagProps) => HTMLElement;
107
+ export declare const summary: (props?: import("./tagFactory").TagProps) => HTMLElement;
108
+ export declare const slot: (props?: import("./tagFactory").TagProps) => HTMLElement;
109
+ export declare const template: (props?: import("./tagFactory").TagProps) => HTMLElement;
110
+ export declare const base: (props?: import("./tagFactory").TagProps) => HTMLElement;
111
+ export declare const link: (props?: import("./tagFactory").TagProps) => HTMLElement;
112
+ export declare const meta: (props?: import("./tagFactory").TagProps) => HTMLElement;
113
+ export declare const style: (props?: import("./tagFactory").TagProps) => HTMLElement;
114
+ export declare const circle: (props?: import("./tagFactory").TagProps) => HTMLElement;
115
+ export declare const ellipse: (props?: import("./tagFactory").TagProps) => HTMLElement;
116
+ export declare const g: (props?: import("./tagFactory").TagProps) => HTMLElement;
117
+ export declare const line: (props?: import("./tagFactory").TagProps) => HTMLElement;
118
+ export declare const path: (props?: import("./tagFactory").TagProps) => HTMLElement;
119
+ export declare const polygon: (props?: import("./tagFactory").TagProps) => HTMLElement;
120
+ export declare const polyline: (props?: import("./tagFactory").TagProps) => HTMLElement;
121
+ export declare const rect: (props?: import("./tagFactory").TagProps) => HTMLElement;
122
+ export declare const text: (props?: import("./tagFactory").TagProps) => HTMLElement;
123
+ export declare const tspan: (props?: import("./tagFactory").TagProps) => HTMLElement;
124
+ export declare const defs: (props?: import("./tagFactory").TagProps) => HTMLElement;
125
+ export declare const clipPath: (props?: import("./tagFactory").TagProps) => HTMLElement;
126
+ export declare const mask: (props?: import("./tagFactory").TagProps) => HTMLElement;
127
+ export declare const pattern: (props?: import("./tagFactory").TagProps) => HTMLElement;
128
+ export declare const linearGradient: (props?: import("./tagFactory").TagProps) => HTMLElement;
129
+ export declare const radialGradient: (props?: import("./tagFactory").TagProps) => HTMLElement;
130
+ export declare const stop: (props?: import("./tagFactory").TagProps) => HTMLElement;
131
+ export declare const use: (props?: import("./tagFactory").TagProps) => HTMLElement;
132
+ export declare const symbol: (props?: import("./tagFactory").TagProps) => HTMLElement;
133
+ export declare const marker: (props?: import("./tagFactory").TagProps) => HTMLElement;
134
+ export declare const center: (props?: import("./tagFactory").TagProps) => HTMLElement;
135
+ export declare const font: (props?: import("./tagFactory").TagProps) => HTMLElement;
136
+ export declare const marquee: (props?: import("./tagFactory").TagProps) => HTMLElement;
137
+ export declare const customElement: (tagName: string) => (props?: import("./tagFactory").TagProps) => HTMLElement;
@@ -0,0 +1,155 @@
1
+ import { tagFactory } from "./tagFactory";
2
+ // Document structure
3
+ export const html = tagFactory("html");
4
+ export const head = tagFactory("head");
5
+ export const body = tagFactory("body");
6
+ export const title = tagFactory("title");
7
+ // Content sectioning
8
+ export const div = tagFactory("div");
9
+ export const span = tagFactory("span");
10
+ export const section = tagFactory("section");
11
+ export const article = tagFactory("article");
12
+ export const header = tagFactory("header");
13
+ export const footer = tagFactory("footer");
14
+ export const nav = tagFactory("nav");
15
+ export const main = tagFactory("main");
16
+ export const aside = tagFactory("aside");
17
+ export const address = tagFactory("address");
18
+ // Text content
19
+ export const p = tagFactory("p");
20
+ export const h1 = tagFactory("h1");
21
+ export const h2 = tagFactory("h2");
22
+ export const h3 = tagFactory("h3");
23
+ export const h4 = tagFactory("h4");
24
+ export const h5 = tagFactory("h5");
25
+ export const h6 = tagFactory("h6");
26
+ export const blockquote = tagFactory("blockquote");
27
+ export const dd = tagFactory("dd");
28
+ export const dl = tagFactory("dl");
29
+ export const dt = tagFactory("dt");
30
+ export const figcaption = tagFactory("figcaption");
31
+ export const figure = tagFactory("figure");
32
+ export const hr = tagFactory("hr");
33
+ export const li = tagFactory("li");
34
+ export const ol = tagFactory("ol");
35
+ export const ul = tagFactory("ul");
36
+ export const pre = tagFactory("pre");
37
+ // Inline text semantics
38
+ export const a = tagFactory("a");
39
+ export const abbr = tagFactory("abbr");
40
+ export const b = tagFactory("b");
41
+ export const bdi = tagFactory("bdi");
42
+ export const bdo = tagFactory("bdo");
43
+ export const br = tagFactory("br");
44
+ export const cite = tagFactory("cite");
45
+ export const code = tagFactory("code");
46
+ export const data = tagFactory("data");
47
+ export const dfn = tagFactory("dfn");
48
+ export const em = tagFactory("em");
49
+ export const i = tagFactory("i");
50
+ export const kbd = tagFactory("kbd");
51
+ export const mark = tagFactory("mark");
52
+ export const q = tagFactory("q");
53
+ export const rp = tagFactory("rp");
54
+ export const rt = tagFactory("rt");
55
+ export const ruby = tagFactory("ruby");
56
+ export const s = tagFactory("s");
57
+ export const samp = tagFactory("samp");
58
+ export const small = tagFactory("small");
59
+ export const strong = tagFactory("strong");
60
+ export const sub = tagFactory("sub");
61
+ export const sup = tagFactory("sup");
62
+ export const time = tagFactory("time");
63
+ export const u = tagFactory("u");
64
+ export const var_ = tagFactory("var"); // 'var' is a reserved keyword
65
+ // Image and multimedia
66
+ export const area = tagFactory("area");
67
+ export const audio = tagFactory("audio");
68
+ export const img = tagFactory("img");
69
+ export const map = tagFactory("map");
70
+ export const track = tagFactory("track");
71
+ export const video = tagFactory("video");
72
+ // Embedded content
73
+ export const embed = tagFactory("embed");
74
+ export const iframe = tagFactory("iframe");
75
+ export const object = tagFactory("object");
76
+ export const param = tagFactory("param");
77
+ export const picture = tagFactory("picture");
78
+ export const portal = tagFactory("portal");
79
+ export const source = tagFactory("source");
80
+ // SVG and MathML
81
+ export const svg = tagFactory("svg");
82
+ export const math = tagFactory("math");
83
+ // Scripting
84
+ export const canvas = tagFactory("canvas");
85
+ export const noscript = tagFactory("noscript");
86
+ export const script = tagFactory("script");
87
+ // Demarcating edits
88
+ export const del = tagFactory("del");
89
+ export const ins = tagFactory("ins");
90
+ // Table content
91
+ export const caption = tagFactory("caption");
92
+ export const col = tagFactory("col");
93
+ export const colgroup = tagFactory("colgroup");
94
+ export const table = tagFactory("table");
95
+ export const tbody = tagFactory("tbody");
96
+ export const td = tagFactory("td");
97
+ export const tfoot = tagFactory("tfoot");
98
+ export const th = tagFactory("th");
99
+ export const thead = tagFactory("thead");
100
+ export const tr = tagFactory("tr");
101
+ // Forms
102
+ export const button = tagFactory("button");
103
+ export const datalist = tagFactory("datalist");
104
+ export const fieldset = tagFactory("fieldset");
105
+ export const form = tagFactory("form");
106
+ export const input = tagFactory("input");
107
+ export const label = tagFactory("label");
108
+ export const legend = tagFactory("legend");
109
+ export const meter = tagFactory("meter");
110
+ export const optgroup = tagFactory("optgroup");
111
+ export const option = tagFactory("option");
112
+ export const output = tagFactory("output");
113
+ export const progress = tagFactory("progress");
114
+ export const select = tagFactory("select");
115
+ export const textarea = tagFactory("textarea");
116
+ // Interactive elements
117
+ export const details = tagFactory("details");
118
+ export const dialog = tagFactory("dialog");
119
+ export const menu = tagFactory("menu");
120
+ export const summary = tagFactory("summary");
121
+ // Web Components
122
+ export const slot = tagFactory("slot");
123
+ export const template = tagFactory("template");
124
+ // Document metadata
125
+ export const base = tagFactory("base");
126
+ export const link = tagFactory("link");
127
+ export const meta = tagFactory("meta");
128
+ export const style = tagFactory("style");
129
+ // Common SVG elements
130
+ export const circle = tagFactory("circle");
131
+ export const ellipse = tagFactory("ellipse");
132
+ export const g = tagFactory("g");
133
+ export const line = tagFactory("line");
134
+ export const path = tagFactory("path");
135
+ export const polygon = tagFactory("polygon");
136
+ export const polyline = tagFactory("polyline");
137
+ export const rect = tagFactory("rect");
138
+ export const text = tagFactory("text");
139
+ export const tspan = tagFactory("tspan");
140
+ export const defs = tagFactory("defs");
141
+ export const clipPath = tagFactory("clipPath");
142
+ export const mask = tagFactory("mask");
143
+ export const pattern = tagFactory("pattern");
144
+ export const linearGradient = tagFactory("linearGradient");
145
+ export const radialGradient = tagFactory("radialGradient");
146
+ export const stop = tagFactory("stop");
147
+ export const use = tagFactory("use");
148
+ export const symbol = tagFactory("symbol");
149
+ export const marker = tagFactory("marker");
150
+ // Obsolete/deprecated elements (for legacy support)
151
+ export const center = tagFactory("center");
152
+ export const font = tagFactory("font");
153
+ export const marquee = tagFactory("marquee");
154
+ // Custom elements placeholder
155
+ export const customElement = (tagName) => tagFactory(tagName);
@@ -0,0 +1,11 @@
1
+ import type { NodeChild } from "./types";
2
+ /**
3
+ * Conditionally mounts a node subtree based on a reactive predicate.
4
+ * When the condition is true, the render function is invoked and its result is displayed.
5
+ * When false, the subtree is removed.
6
+ *
7
+ * @param condition - Reactive predicate that returns a boolean.
8
+ * @param render - Function that returns the NodeChild to mount.
9
+ * @returns A Comment node serving as the anchor point.
10
+ */
11
+ export declare function htmlIf(condition: () => boolean, render: () => NodeChild): Comment;