sibujs 1.0.2 → 1.0.4

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 (443) hide show
  1. package/LICENSE +21 -21
  2. package/dist/browser.cjs +18 -0
  3. package/dist/browser.d.cts +19 -1
  4. package/dist/browser.d.ts +19 -1
  5. package/dist/browser.js +5 -1
  6. package/dist/build.cjs +37 -8
  7. package/dist/build.js +3 -3
  8. package/dist/cdn.global.js +4 -4
  9. package/dist/{chunk-24WSRM54.js → chunk-32ZISOLJ.js} +35 -7
  10. package/dist/{chunk-ONCYDOK6.js → chunk-4EI4AG32.js} +17 -1
  11. package/dist/{chunk-MJ4LVHGX.js → chunk-7V26P53V.js} +1 -1
  12. package/dist/{chunk-7TQKR4PP.js → chunk-AZ3ISID5.js} +4 -0
  13. package/dist/{chunk-3CRQALYP.js → chunk-DKOHBI74.js} +49 -2
  14. package/dist/{chunk-6JGMNCD6.js → chunk-EWFVA3TJ.js} +1 -1
  15. package/dist/{chunk-HS6OOE3Q.js → chunk-G3BOQPVO.js} +1 -1
  16. package/dist/{chunk-QVKGGB2S.js → chunk-MDVXJWFN.js} +7 -3
  17. package/dist/{chunk-DZZMIMGL.js → chunk-OF7UZIVB.js} +1 -1
  18. package/dist/{chunk-N6IZB6KJ.js → chunk-PBHF5WKN.js} +56 -7
  19. package/dist/{chunk-OHQQWZ7P.js → chunk-QBMDLBU2.js} +10 -4
  20. package/dist/{customElement-BKQfbSZQ.d.cts → customElement-yz8uyk-0.d.cts} +52 -6
  21. package/dist/{customElement-BKQfbSZQ.d.ts → customElement-yz8uyk-0.d.ts} +52 -6
  22. package/dist/data.cjs +10 -4
  23. package/dist/data.d.cts +2 -0
  24. package/dist/data.d.ts +2 -0
  25. package/dist/data.js +1 -1
  26. package/dist/ecosystem.cjs +7 -3
  27. package/dist/ecosystem.d.cts +1 -1
  28. package/dist/ecosystem.d.ts +1 -1
  29. package/dist/ecosystem.js +2 -2
  30. package/dist/extras.cjs +146 -16
  31. package/dist/extras.d.cts +5 -4
  32. package/dist/extras.d.ts +5 -4
  33. package/dist/extras.js +19 -11
  34. package/dist/index.cjs +40 -8
  35. package/dist/index.d.cts +48 -4
  36. package/dist/index.d.ts +48 -4
  37. package/dist/index.js +9 -3
  38. package/dist/patterns.d.cts +8 -2
  39. package/dist/patterns.d.ts +8 -2
  40. package/dist/plugins.cjs +149 -4
  41. package/dist/plugins.d.cts +39 -3
  42. package/dist/plugins.d.ts +39 -3
  43. package/dist/plugins.js +121 -5
  44. package/dist/{ssr-WKUPVSSK.js → ssr-6GIMY5MX.js} +5 -3
  45. package/dist/ssr-BA6sxxUd.d.cts +135 -0
  46. package/dist/ssr-BA6sxxUd.d.ts +135 -0
  47. package/dist/ssr.cjs +12 -3
  48. package/dist/ssr.d.cts +3 -113
  49. package/dist/ssr.d.ts +3 -113
  50. package/dist/ssr.js +7 -5
  51. package/dist/{tagFactory-D9e0QGIE.d.cts → tagFactory-Dl8QCLga.d.cts} +2 -2
  52. package/dist/{tagFactory-D9e0QGIE.d.ts → tagFactory-Dl8QCLga.d.ts} +2 -2
  53. package/dist/ui.cjs +50 -2
  54. package/dist/ui.d.cts +1 -1
  55. package/dist/ui.d.ts +1 -1
  56. package/dist/ui.js +3 -1
  57. package/dist/widgets.cjs +56 -7
  58. package/dist/widgets.d.cts +4 -2
  59. package/dist/widgets.d.ts +4 -2
  60. package/dist/widgets.js +1 -1
  61. package/package.json +139 -139
  62. package/dist/chunk-27QC4FPL.js +0 -67
  63. package/dist/chunk-2ABBWCGC.js +0 -65
  64. package/dist/chunk-2GLUWW3D.js +0 -567
  65. package/dist/chunk-2HYHL6VW.js +0 -269
  66. package/dist/chunk-2MUNQYZ7.js +0 -26
  67. package/dist/chunk-2PFRWZIE.js +0 -65
  68. package/dist/chunk-2PSPKNUI.js +0 -1711
  69. package/dist/chunk-2X5NDXNG.js +0 -877
  70. package/dist/chunk-34TOFKL7.js +0 -1803
  71. package/dist/chunk-353KB3DI.js +0 -271
  72. package/dist/chunk-35CDLDX5.js +0 -1758
  73. package/dist/chunk-36MU4CFV.js +0 -41
  74. package/dist/chunk-37NSPDPQ.js +0 -284
  75. package/dist/chunk-3CSF4TOG.js +0 -282
  76. package/dist/chunk-3FIQOFI6.js +0 -182
  77. package/dist/chunk-3GHNC2BN.js +0 -28
  78. package/dist/chunk-3GZTRYSY.js +0 -33
  79. package/dist/chunk-3HLWWEPU.js +0 -909
  80. package/dist/chunk-3IVI3J54.js +0 -252
  81. package/dist/chunk-3KZ72WNW.js +0 -944
  82. package/dist/chunk-4AU64SQV.js +0 -182
  83. package/dist/chunk-4MOK7HAR.js +0 -84
  84. package/dist/chunk-4QK6FBDH.js +0 -1429
  85. package/dist/chunk-526ENZ77.js +0 -58
  86. package/dist/chunk-566Z7HXB.js +0 -737
  87. package/dist/chunk-5CRBB7XP.js +0 -358
  88. package/dist/chunk-5G67D3IZ.js +0 -168
  89. package/dist/chunk-5KBEED6D.js +0 -361
  90. package/dist/chunk-5LJMSKBB.js +0 -26
  91. package/dist/chunk-5M7LJFWV.js +0 -271
  92. package/dist/chunk-5NCPAWBE.js +0 -99
  93. package/dist/chunk-5O2RKXR3.js +0 -1444
  94. package/dist/chunk-5OCBERWW.js +0 -1094
  95. package/dist/chunk-5XUAA53E.js +0 -99
  96. package/dist/chunk-5ZFVYPDG.js +0 -97
  97. package/dist/chunk-6BCDNGIH.js +0 -1839
  98. package/dist/chunk-6BDUQJ7K.js +0 -949
  99. package/dist/chunk-6BTBDO6A.js +0 -633
  100. package/dist/chunk-6DJQF4Z7.js +0 -33
  101. package/dist/chunk-6EYXAMBN.js +0 -1857
  102. package/dist/chunk-6IWEHW57.js +0 -43
  103. package/dist/chunk-6J6S4NI7.js +0 -398
  104. package/dist/chunk-6NBHAKHS.js +0 -1997
  105. package/dist/chunk-6QRLJNXR.js +0 -1425
  106. package/dist/chunk-6SNF5MZK.js +0 -282
  107. package/dist/chunk-7FYJUE77.js +0 -282
  108. package/dist/chunk-7HM5UE5T.js +0 -270
  109. package/dist/chunk-7JOLTGUH.js +0 -58
  110. package/dist/chunk-7LS3ITZB.js +0 -567
  111. package/dist/chunk-7MCWJCQK.js +0 -909
  112. package/dist/chunk-7RIIFP3E.js +0 -1758
  113. package/dist/chunk-7UASYN3G.js +0 -254
  114. package/dist/chunk-7W2WYHDI.js +0 -741
  115. package/dist/chunk-7XFBKLFB.js +0 -90
  116. package/dist/chunk-7Y35RDSJ.js +0 -872
  117. package/dist/chunk-A65GFJBL.js +0 -65
  118. package/dist/chunk-AD6ZIEDK.js +0 -67
  119. package/dist/chunk-AIPXZK5O.js +0 -295
  120. package/dist/chunk-AK5Y72F3.js +0 -1426
  121. package/dist/chunk-ANRSGGFC.js +0 -725
  122. package/dist/chunk-APOMMWH4.js +0 -282
  123. package/dist/chunk-ARZVTWIQ.js +0 -1750
  124. package/dist/chunk-AWWBM2BI.js +0 -664
  125. package/dist/chunk-AX5VEQTY.js +0 -58
  126. package/dist/chunk-AYTXVOW3.js +0 -1708
  127. package/dist/chunk-B4ASD5VC.js +0 -295
  128. package/dist/chunk-BG3HMX4C.js +0 -271
  129. package/dist/chunk-BG4A246G.js +0 -1746
  130. package/dist/chunk-BNFJJA2L.js +0 -1425
  131. package/dist/chunk-BPKPBVU5.js +0 -59
  132. package/dist/chunk-BPKPPSXC.js +0 -282
  133. package/dist/chunk-BPWKKK7F.js +0 -1711
  134. package/dist/chunk-BS5EYKCJ.js +0 -26
  135. package/dist/chunk-BS6ETCJ7.js +0 -949
  136. package/dist/chunk-BTTBAGD3.js +0 -365
  137. package/dist/chunk-BWBWJYBK.js +0 -271
  138. package/dist/chunk-CCKX6YTC.js +0 -1735
  139. package/dist/chunk-CIF5Z3MP.js +0 -58
  140. package/dist/chunk-CQNVF2FD.js +0 -282
  141. package/dist/chunk-CRTHZHU7.js +0 -26
  142. package/dist/chunk-CSXYU7IO.js +0 -457
  143. package/dist/chunk-D6JD4FDC.js +0 -26
  144. package/dist/chunk-DAUTHAYH.js +0 -20
  145. package/dist/chunk-DB243LB7.js +0 -877
  146. package/dist/chunk-DEQLPROY.js +0 -1094
  147. package/dist/chunk-DGUYCZJH.js +0 -654
  148. package/dist/chunk-DI3Z32TV.js +0 -1780
  149. package/dist/chunk-DKGHW6MX.js +0 -90
  150. package/dist/chunk-DKXVN442.js +0 -90
  151. package/dist/chunk-DLWLJZB3.js +0 -712
  152. package/dist/chunk-DNTTC4V5.js +0 -1803
  153. package/dist/chunk-DTCOOBMX.js +0 -725
  154. package/dist/chunk-DWQQ2GZK.js +0 -1787
  155. package/dist/chunk-E5SMAKQQ.js +0 -336
  156. package/dist/chunk-E6BNBVMK.js +0 -457
  157. package/dist/chunk-E7NGA7X2.js +0 -59
  158. package/dist/chunk-EEPPJKAE.js +0 -443
  159. package/dist/chunk-EGZGFIXV.js +0 -90
  160. package/dist/chunk-EJMSUPXQ.js +0 -346
  161. package/dist/chunk-EJMYGAGQ.js +0 -717
  162. package/dist/chunk-EL6Z5MDY.js +0 -55
  163. package/dist/chunk-EP7VRLEB.js +0 -41
  164. package/dist/chunk-EQACK65C.js +0 -63
  165. package/dist/chunk-ESPA7SCH.js +0 -567
  166. package/dist/chunk-ETMEC6FH.js +0 -99
  167. package/dist/chunk-EUFENPGJ.js +0 -290
  168. package/dist/chunk-EZ2WHYVL.js +0 -65
  169. package/dist/chunk-EZRVMSZK.js +0 -67
  170. package/dist/chunk-F25CZRUH.js +0 -282
  171. package/dist/chunk-F2TRGINX.js +0 -254
  172. package/dist/chunk-F4IYF3YU.js +0 -266
  173. package/dist/chunk-F5JCIH3Q.js +0 -642
  174. package/dist/chunk-FBNDOAHU.js +0 -54
  175. package/dist/chunk-FDRU7W6W.js +0 -365
  176. package/dist/chunk-FDW3E54J.js +0 -1767
  177. package/dist/chunk-FEPU4KL6.js +0 -63
  178. package/dist/chunk-FGK3JKMN.js +0 -909
  179. package/dist/chunk-FQWPKSTD.js +0 -1437
  180. package/dist/chunk-FWHVLMCI.js +0 -26
  181. package/dist/chunk-FYIGTFXO.js +0 -712
  182. package/dist/chunk-G4AX3DQ4.js +0 -54
  183. package/dist/chunk-GBEYQRO2.js +0 -303
  184. package/dist/chunk-GBLES3NK.js +0 -248
  185. package/dist/chunk-GQVGUQW6.js +0 -1436
  186. package/dist/chunk-GVDEIJ3G.js +0 -291
  187. package/dist/chunk-GXIM4TC3.js +0 -346
  188. package/dist/chunk-GY5AAP4H.js +0 -316
  189. package/dist/chunk-HCV2T76T.js +0 -457
  190. package/dist/chunk-HCWPQCZP.js +0 -279
  191. package/dist/chunk-HFHOFG6W.js +0 -282
  192. package/dist/chunk-HGKEBAW3.js +0 -63
  193. package/dist/chunk-HJNW3HLI.js +0 -255
  194. package/dist/chunk-HKUNBYN6.js +0 -949
  195. package/dist/chunk-HRIIH4JX.js +0 -712
  196. package/dist/chunk-HS7ZKVPR.js +0 -182
  197. package/dist/chunk-HXDVV7HZ.js +0 -909
  198. package/dist/chunk-HZWNWUPJ.js +0 -466
  199. package/dist/chunk-I6EZTMPB.js +0 -949
  200. package/dist/chunk-IB23VMO3.js +0 -1746
  201. package/dist/chunk-IC4K4EOD.js +0 -26
  202. package/dist/chunk-IEMZ7RTT.js +0 -99
  203. package/dist/chunk-IJU6TOZ6.js +0 -65
  204. package/dist/chunk-IK3NFZOA.js +0 -466
  205. package/dist/chunk-IPGRSN42.js +0 -1750
  206. package/dist/chunk-IVMOK2QN.js +0 -1750
  207. package/dist/chunk-J7PD6L4B.js +0 -1767
  208. package/dist/chunk-JCLGQO7T.js +0 -443
  209. package/dist/chunk-JDXL7KDB.js +0 -1436
  210. package/dist/chunk-JIIFW636.js +0 -270
  211. package/dist/chunk-JLOASJXU.js +0 -654
  212. package/dist/chunk-JRWAHOMS.js +0 -41
  213. package/dist/chunk-JWGEEH7H.js +0 -944
  214. package/dist/chunk-K2BESAG7.js +0 -1688
  215. package/dist/chunk-K2U5YGF4.js +0 -877
  216. package/dist/chunk-K45FQ4Y4.js +0 -175
  217. package/dist/chunk-K7BPE427.js +0 -1432
  218. package/dist/chunk-K7JUDY3C.js +0 -364
  219. package/dist/chunk-KALKXPC3.js +0 -297
  220. package/dist/chunk-KKUV25KB.js +0 -361
  221. package/dist/chunk-KKV3DOAW.js +0 -466
  222. package/dist/chunk-KL3266RS.js +0 -26
  223. package/dist/chunk-KNN4P7DZ.js +0 -84
  224. package/dist/chunk-KP2DZH5Q.js +0 -254
  225. package/dist/chunk-KZHAJSQR.js +0 -1636
  226. package/dist/chunk-L36YN45V.js +0 -949
  227. package/dist/chunk-L5IBT37O.js +0 -263
  228. package/dist/chunk-LAX5H35R.js +0 -90
  229. package/dist/chunk-LBKGHMQV.js +0 -1750
  230. package/dist/chunk-LBTEPL7A.js +0 -1731
  231. package/dist/chunk-LEBBPTDB.js +0 -1444
  232. package/dist/chunk-LHI25KS2.js +0 -654
  233. package/dist/chunk-LHNJSLC6.js +0 -297
  234. package/dist/chunk-LLH63WVQ.js +0 -98
  235. package/dist/chunk-LWNJN3IW.js +0 -295
  236. package/dist/chunk-LWVR2C4G.js +0 -1711
  237. package/dist/chunk-M3MDTVV2.js +0 -896
  238. package/dist/chunk-M3QSBCXC.js +0 -52
  239. package/dist/chunk-M3ZKZQNY.js +0 -282
  240. package/dist/chunk-M5GNLDEO.js +0 -303
  241. package/dist/chunk-MBINISSE.js +0 -35
  242. package/dist/chunk-MFHVGKET.js +0 -267
  243. package/dist/chunk-MGWSG3PM.js +0 -358
  244. package/dist/chunk-MGYRVG2A.js +0 -282
  245. package/dist/chunk-MJNB47HB.js +0 -19
  246. package/dist/chunk-MLN3JZ2E.js +0 -398
  247. package/dist/chunk-MM46JVR2.js +0 -359
  248. package/dist/chunk-MQWTY3JY.js +0 -944
  249. package/dist/chunk-MWE3PK5S.js +0 -551
  250. package/dist/chunk-MXR7LXGC.js +0 -1084
  251. package/dist/chunk-MZZOQHNI.js +0 -642
  252. package/dist/chunk-N6BRVUAP.js +0 -1805
  253. package/dist/chunk-N7UVR6SG.js +0 -877
  254. package/dist/chunk-NIHWGZS4.js +0 -1426
  255. package/dist/chunk-NMTRH4Q3.js +0 -97
  256. package/dist/chunk-NSVVHQK5.js +0 -41
  257. package/dist/chunk-NVI2WE7D.js +0 -443
  258. package/dist/chunk-NZNNXPEE.js +0 -56
  259. package/dist/chunk-O7QBO3PH.js +0 -58
  260. package/dist/chunk-OAUPQBO2.js +0 -270
  261. package/dist/chunk-OB2LMD7C.js +0 -297
  262. package/dist/chunk-OEGAHDEU.js +0 -1094
  263. package/dist/chunk-OHEYBWQU.js +0 -58
  264. package/dist/chunk-OI5B74HF.js +0 -26
  265. package/dist/chunk-OI6OXUHJ.js +0 -443
  266. package/dist/chunk-ONOO74UN.js +0 -361
  267. package/dist/chunk-OWLQ4HZI.js +0 -282
  268. package/dist/chunk-OX2VMRMV.js +0 -633
  269. package/dist/chunk-OXYMB6VB.js +0 -466
  270. package/dist/chunk-OZS4YOOP.js +0 -59
  271. package/dist/chunk-P4FYE5TX.js +0 -866
  272. package/dist/chunk-P5KFWM4H.js +0 -98
  273. package/dist/chunk-PLFQZ7SS.js +0 -90
  274. package/dist/chunk-PMVU6BI4.js +0 -1847
  275. package/dist/chunk-PPNH4Y6U.js +0 -282
  276. package/dist/chunk-PUMLE7RJ.js +0 -1711
  277. package/dist/chunk-Q4MFANBF.js +0 -282
  278. package/dist/chunk-Q54YZ4X3.js +0 -26
  279. package/dist/chunk-Q6XACQW3.js +0 -1847
  280. package/dist/chunk-QI6ZDDUR.js +0 -35
  281. package/dist/chunk-QJ5KLY2S.js +0 -1821
  282. package/dist/chunk-QLEKZMMU.js +0 -282
  283. package/dist/chunk-QLNWSBWK.js +0 -567
  284. package/dist/chunk-QQS7BSPA.js +0 -26
  285. package/dist/chunk-QUGIYF3F.js +0 -712
  286. package/dist/chunk-QYSW3K7A.js +0 -282
  287. package/dist/chunk-QZWTKX5K.js +0 -321
  288. package/dist/chunk-RGGNGVO3.js +0 -98
  289. package/dist/chunk-RKJDRVV6.js +0 -443
  290. package/dist/chunk-RUAJTILD.js +0 -26
  291. package/dist/chunk-S5BHU353.js +0 -43
  292. package/dist/chunk-S6YEHFC7.js +0 -654
  293. package/dist/chunk-SHQUSFH7.js +0 -1426
  294. package/dist/chunk-SMB4DBMD.js +0 -182
  295. package/dist/chunk-SNYHQP3D.js +0 -743
  296. package/dist/chunk-SR2DPCTT.js +0 -1803
  297. package/dist/chunk-SU63HSUU.js +0 -58
  298. package/dist/chunk-SXXKZJI2.js +0 -303
  299. package/dist/chunk-T24L3TBF.js +0 -1717
  300. package/dist/chunk-T2SPHHYU.js +0 -365
  301. package/dist/chunk-TAQNSOKT.js +0 -692
  302. package/dist/chunk-TBA46SVX.js +0 -1805
  303. package/dist/chunk-TCWKKKPP.js +0 -90
  304. package/dist/chunk-TDNY4SUA.js +0 -41
  305. package/dist/chunk-TK4P3V5G.js +0 -56
  306. package/dist/chunk-TNNF56IQ.js +0 -1750
  307. package/dist/chunk-TR7E6LYX.js +0 -457
  308. package/dist/chunk-TVV4JK5G.js +0 -282
  309. package/dist/chunk-UATXXETW.js +0 -278
  310. package/dist/chunk-UHFUQWST.js +0 -65
  311. package/dist/chunk-UKDBQVM3.js +0 -346
  312. package/dist/chunk-URWUFH45.js +0 -98
  313. package/dist/chunk-USPT25TC.js +0 -365
  314. package/dist/chunk-UUSIH3XH.js +0 -1429
  315. package/dist/chunk-UXDIPRCG.js +0 -26
  316. package/dist/chunk-UYFNXLKR.js +0 -1436
  317. package/dist/chunk-UZZFP2EE.js +0 -35
  318. package/dist/chunk-V4G5Y6YM.js +0 -1094
  319. package/dist/chunk-V6F7KUWD.js +0 -270
  320. package/dist/chunk-V6P4LDAV.js +0 -65
  321. package/dist/chunk-VAA4FG3Z.js +0 -365
  322. package/dist/chunk-VCZLXRMR.js +0 -254
  323. package/dist/chunk-VDHXSSBT.js +0 -1426
  324. package/dist/chunk-VI4KRBSU.js +0 -291
  325. package/dist/chunk-VM4QMKVK.js +0 -254
  326. package/dist/chunk-VUXB655T.js +0 -1999
  327. package/dist/chunk-VWGYKYL2.js +0 -737
  328. package/dist/chunk-VX2OFBJN.js +0 -1426
  329. package/dist/chunk-VXVIE6DG.js +0 -84
  330. package/dist/chunk-W3QH7BF5.js +0 -282
  331. package/dist/chunk-W4OH7HG4.js +0 -40
  332. package/dist/chunk-WBVJX4GZ.js +0 -98
  333. package/dist/chunk-WDU2ZV4I.js +0 -1426
  334. package/dist/chunk-WGCQNOEQ.js +0 -712
  335. package/dist/chunk-WZQNHS4J.js +0 -52
  336. package/dist/chunk-X6VUCICU.js +0 -457
  337. package/dist/chunk-XAY7FM7Y.js +0 -618
  338. package/dist/chunk-XFW7B23S.js +0 -282
  339. package/dist/chunk-XJ3MNGY5.js +0 -58
  340. package/dist/chunk-XJZ5Z2CM.js +0 -642
  341. package/dist/chunk-XKVFQTJJ.js +0 -254
  342. package/dist/chunk-XRLFASCY.js +0 -22
  343. package/dist/chunk-XZGY5ZJ4.js +0 -35
  344. package/dist/chunk-Y745CBVB.js +0 -944
  345. package/dist/chunk-YLBJSXYY.js +0 -944
  346. package/dist/chunk-YQJIKVPZ.js +0 -1429
  347. package/dist/chunk-YRM2VCZF.js +0 -457
  348. package/dist/chunk-YS33KBVJ.js +0 -944
  349. package/dist/chunk-Z27DZPDG.js +0 -41
  350. package/dist/chunk-Z6GZHJW5.js +0 -877
  351. package/dist/chunk-ZXQ5NAEN.js +0 -32
  352. package/dist/contracts-B552GopR.d.cts +0 -245
  353. package/dist/contracts-B552GopR.d.ts +0 -245
  354. package/dist/contracts-Bg1ECISC.d.cts +0 -245
  355. package/dist/contracts-Bg1ECISC.d.ts +0 -245
  356. package/dist/contracts-CMriKJ6P.d.cts +0 -245
  357. package/dist/contracts-CMriKJ6P.d.ts +0 -245
  358. package/dist/src/components/ErrorBoundary.d.ts +0 -15
  359. package/dist/src/components/ErrorBoundary.js +0 -119
  360. package/dist/src/core/catch.d.ts +0 -11
  361. package/dist/src/core/catch.js +0 -28
  362. package/dist/src/core/each.d.ts +0 -13
  363. package/dist/src/core/each.js +0 -68
  364. package/dist/src/core/for.d.ts +0 -12
  365. package/dist/src/core/for.js +0 -67
  366. package/dist/src/core/html.d.ts +0 -137
  367. package/dist/src/core/html.js +0 -155
  368. package/dist/src/core/htmlIf.d.ts +0 -11
  369. package/dist/src/core/htmlIf.js +0 -18
  370. package/dist/src/core/lazy.d.ts +0 -7
  371. package/dist/src/core/lazy.js +0 -16
  372. package/dist/src/core/mount.d.ts +0 -7
  373. package/dist/src/core/mount.js +0 -12
  374. package/dist/src/core/slots.d.ts +0 -3
  375. package/dist/src/core/slots.js +0 -3
  376. package/dist/src/core/suspense.d.ts +0 -10
  377. package/dist/src/core/suspense.js +0 -33
  378. package/dist/src/core/tagFactory.d.ts +0 -13
  379. package/dist/src/core/tagFactory.js +0 -86
  380. package/dist/src/core/test.d.ts +0 -11
  381. package/dist/src/core/test.js +0 -28
  382. package/dist/src/core/types.d.ts +0 -2
  383. package/dist/src/core/types.js +0 -1
  384. package/dist/src/core/useComputed.d.ts +0 -6
  385. package/dist/src/core/useComputed.js +0 -30
  386. package/dist/src/core/useEffect.d.ts +0 -6
  387. package/dist/src/core/useEffect.js +0 -23
  388. package/dist/src/core/useState.d.ts +0 -10
  389. package/dist/src/core/useState.js +0 -34
  390. package/dist/src/core/useStore.d.ts +0 -19
  391. package/dist/src/core/useStore.js +0 -53
  392. package/dist/src/core/useWatch.d.ts +0 -8
  393. package/dist/src/core/useWatch.js +0 -23
  394. package/dist/src/plugins/i18n.d.ts +0 -6
  395. package/dist/src/plugins/i18n.js +0 -16
  396. package/dist/src/plugins/router.d.ts +0 -188
  397. package/dist/src/plugins/router.js +0 -1178
  398. package/dist/src/reactivity/bindAttribute.d.ts +0 -5
  399. package/dist/src/reactivity/bindAttribute.js +0 -31
  400. package/dist/src/reactivity/bindChildNode.d.ts +0 -10
  401. package/dist/src/reactivity/bindChildNode.js +0 -46
  402. package/dist/src/reactivity/bindTextNode.d.ts +0 -10
  403. package/dist/src/reactivity/bindTextNode.js +0 -27
  404. package/dist/src/reactivity/signal.d.ts +0 -3
  405. package/dist/src/reactivity/signal.js +0 -1
  406. package/dist/src/reactivity/track.d.ts +0 -18
  407. package/dist/src/reactivity/track.js +0 -73
  408. package/dist/src/reactivity/useComputed.d.ts +0 -6
  409. package/dist/src/reactivity/useComputed.js +0 -30
  410. package/dist/src/reactivity/useEffect.d.ts +0 -6
  411. package/dist/src/reactivity/useEffect.js +0 -23
  412. package/dist/src/reactivity/useState.d.ts +0 -10
  413. package/dist/src/reactivity/useState.js +0 -34
  414. package/dist/src/reactivity/useStore.d.ts +0 -19
  415. package/dist/src/reactivity/useStore.js +0 -53
  416. package/dist/src/reactivity/useWatch.d.ts +0 -8
  417. package/dist/src/reactivity/useWatch.js +0 -23
  418. package/dist/src/utils/sanitize.d.ts +0 -1
  419. package/dist/src/utils/sanitize.js +0 -8
  420. package/dist/ssr-27FOM46T.js +0 -35
  421. package/dist/ssr-GEOEYQV7.js +0 -35
  422. package/dist/ssr-GFUTTSJD.js +0 -22
  423. package/dist/ssr-K7DCR6BZ.js +0 -35
  424. package/dist/ssr-NFAIHWJJ.js +0 -35
  425. package/dist/ssr-O6LFMRFP.js +0 -35
  426. package/dist/ssr-QZEVGMMK.js +0 -35
  427. package/dist/ssr-SGVBCAGC.js +0 -35
  428. package/dist/ssr-UB2IXCYX.js +0 -35
  429. package/dist/ssr-XBZQNV4O.js +0 -22
  430. package/dist/ssr-Y76FSXDU.js +0 -35
  431. package/dist/ssr-YQJ4AYBD.js +0 -35
  432. package/dist/tagFactory-BDN7gDEp.d.cts +0 -21
  433. package/dist/tagFactory-BDN7gDEp.d.ts +0 -21
  434. package/dist/tagFactory-CZPO4RXF.d.cts +0 -34
  435. package/dist/tagFactory-CZPO4RXF.d.ts +0 -34
  436. package/dist/tagFactory-CgImPVMY.d.cts +0 -22
  437. package/dist/tagFactory-CgImPVMY.d.ts +0 -22
  438. package/dist/tagFactory-Cw1iv5if.d.cts +0 -22
  439. package/dist/tagFactory-Cw1iv5if.d.ts +0 -22
  440. package/dist/tagFactory-DeAXq9ef.d.cts +0 -30
  441. package/dist/tagFactory-DeAXq9ef.d.ts +0 -30
  442. package/dist/tagFactory-SkY0a7L1.d.cts +0 -22
  443. package/dist/tagFactory-SkY0a7L1.d.ts +0 -22
@@ -1,1426 +0,0 @@
1
- import {
2
- createContext,
3
- useComputed,
4
- useEffect
5
- } from "./chunk-AD6ZIEDK.js";
6
- import {
7
- SVG_NS,
8
- a,
9
- abbr,
10
- address,
11
- area,
12
- article,
13
- aside,
14
- audio,
15
- b,
16
- base,
17
- batch,
18
- bdi,
19
- bdo,
20
- bindDynamic,
21
- blockquote,
22
- body,
23
- br,
24
- button,
25
- canvas,
26
- caption,
27
- center,
28
- circle,
29
- cite,
30
- clipPath,
31
- code,
32
- col,
33
- colgroup,
34
- customElement,
35
- data,
36
- datalist,
37
- dd,
38
- defs,
39
- del,
40
- details,
41
- dfn,
42
- dialog,
43
- dispose,
44
- div,
45
- dl,
46
- dt,
47
- ellipse,
48
- em,
49
- embed,
50
- enqueueBatchedSignal,
51
- fieldset,
52
- figcaption,
53
- figure,
54
- font,
55
- footer,
56
- form,
57
- g,
58
- h1,
59
- h2,
60
- h3,
61
- h4,
62
- h5,
63
- h6,
64
- head,
65
- header,
66
- hr,
67
- html,
68
- i,
69
- iframe,
70
- img,
71
- input,
72
- ins,
73
- isBatching,
74
- kbd,
75
- label,
76
- legend,
77
- li,
78
- line,
79
- linearGradient,
80
- link,
81
- main,
82
- map,
83
- mark,
84
- marker,
85
- marquee,
86
- mask,
87
- math,
88
- menu,
89
- meta,
90
- meter,
91
- nav,
92
- noscript,
93
- notifySubscribers,
94
- object,
95
- ol,
96
- optgroup,
97
- option,
98
- output,
99
- p,
100
- param,
101
- path,
102
- pattern,
103
- picture,
104
- polygon,
105
- polyline,
106
- portal,
107
- pre,
108
- progress,
109
- q,
110
- radialGradient,
111
- recordDependency,
112
- rect,
113
- registerDisposer,
114
- rp,
115
- rt,
116
- ruby,
117
- s,
118
- samp,
119
- script,
120
- section,
121
- select,
122
- slot,
123
- small,
124
- source,
125
- span,
126
- stop,
127
- strong,
128
- style,
129
- sub,
130
- summary,
131
- sup,
132
- svg,
133
- symbol,
134
- table,
135
- tagFactory,
136
- tbody,
137
- td,
138
- template,
139
- text,
140
- textarea,
141
- tfoot,
142
- th,
143
- thead,
144
- time,
145
- title,
146
- tr,
147
- track,
148
- track2,
149
- tspan,
150
- u,
151
- ul,
152
- use,
153
- useState,
154
- var_,
155
- video
156
- } from "./chunk-7W2WYHDI.js";
157
- import {
158
- __export
159
- } from "./chunk-MLKGABMK.js";
160
-
161
- // index.ts
162
- var index_exports = {};
163
- __export(index_exports, {
164
- DynamicComponent: () => DynamicComponent,
165
- ErrorBoundary: () => ErrorBoundary,
166
- Fragment: () => Fragment,
167
- Loading: () => Loading,
168
- Portal: () => Portal,
169
- SVG_NS: () => SVG_NS,
170
- Suspense: () => Suspense,
171
- a: () => a,
172
- abbr: () => abbr,
173
- address: () => address,
174
- area: () => area,
175
- article: () => article,
176
- aside: () => aside,
177
- audio: () => audio,
178
- b: () => b,
179
- base: () => base,
180
- batch: () => batch,
181
- bdi: () => bdi,
182
- bdo: () => bdo,
183
- bindDynamic: () => bindDynamic,
184
- blockquote: () => blockquote,
185
- body: () => body,
186
- br: () => br,
187
- button: () => button,
188
- canvas: () => canvas,
189
- caption: () => caption,
190
- catchError: () => catchError,
191
- catchErrorAsync: () => catchErrorAsync,
192
- center: () => center,
193
- circle: () => circle,
194
- cite: () => cite,
195
- clipPath: () => clipPath,
196
- code: () => code,
197
- col: () => col,
198
- colgroup: () => colgroup,
199
- createContext: () => createContext,
200
- customElement: () => customElement,
201
- data: () => data,
202
- datalist: () => datalist,
203
- dd: () => dd,
204
- defs: () => defs,
205
- del: () => del,
206
- details: () => details,
207
- dfn: () => dfn,
208
- dialog: () => dialog,
209
- dispose: () => dispose,
210
- div: () => div,
211
- dl: () => dl,
212
- dt: () => dt,
213
- each: () => each,
214
- ellipse: () => ellipse,
215
- em: () => em,
216
- embed: () => embed,
217
- enqueueBatchedSignal: () => enqueueBatchedSignal,
218
- fieldset: () => fieldset,
219
- figcaption: () => figcaption,
220
- figure: () => figure,
221
- font: () => font,
222
- footer: () => footer,
223
- form: () => form,
224
- g: () => g,
225
- getSlot: () => getSlot,
226
- h1: () => h1,
227
- h2: () => h2,
228
- h3: () => h3,
229
- h4: () => h4,
230
- h5: () => h5,
231
- h6: () => h6,
232
- head: () => head,
233
- header: () => header,
234
- hr: () => hr,
235
- html: () => html,
236
- i: () => i,
237
- iframe: () => iframe,
238
- img: () => img,
239
- input: () => input,
240
- ins: () => ins,
241
- isBatching: () => isBatching,
242
- kbd: () => kbd,
243
- label: () => label,
244
- lazy: () => lazy,
245
- legend: () => legend,
246
- li: () => li,
247
- line: () => line,
248
- linearGradient: () => linearGradient,
249
- link: () => link,
250
- main: () => main,
251
- map: () => map,
252
- mark: () => mark,
253
- marker: () => marker,
254
- marquee: () => marquee,
255
- mask: () => mask,
256
- match: () => match,
257
- math: () => math,
258
- menu: () => menu,
259
- meta: () => meta,
260
- meter: () => meter,
261
- mount: () => mount,
262
- nav: () => nav,
263
- noscript: () => noscript,
264
- object: () => object,
265
- ol: () => ol,
266
- onMount: () => onMount,
267
- onUnmount: () => onUnmount,
268
- optgroup: () => optgroup,
269
- option: () => option,
270
- output: () => output,
271
- p: () => p,
272
- param: () => param,
273
- path: () => path,
274
- pattern: () => pattern,
275
- picture: () => picture,
276
- polygon: () => polygon,
277
- polyline: () => polyline,
278
- portal: () => portal,
279
- pre: () => pre,
280
- progress: () => progress,
281
- q: () => q,
282
- radialGradient: () => radialGradient,
283
- rect: () => rect,
284
- registerComponent: () => registerComponent,
285
- registerDisposer: () => registerDisposer,
286
- resolveComponent: () => resolveComponent,
287
- rp: () => rp,
288
- rt: () => rt,
289
- ruby: () => ruby,
290
- s: () => s,
291
- samp: () => samp,
292
- script: () => script,
293
- section: () => section,
294
- select: () => select,
295
- setGlobalErrorHandler: () => setGlobalErrorHandler,
296
- show: () => show,
297
- slot: () => slot,
298
- small: () => small,
299
- source: () => source,
300
- span: () => span,
301
- stop: () => stop,
302
- strong: () => strong,
303
- style: () => style,
304
- sub: () => sub,
305
- summary: () => summary,
306
- sup: () => sup,
307
- svg: () => svg,
308
- symbol: () => symbol,
309
- table: () => table,
310
- tagFactory: () => tagFactory,
311
- tbody: () => tbody,
312
- td: () => td,
313
- template: () => template,
314
- text: () => text,
315
- textarea: () => textarea,
316
- tfoot: () => tfoot,
317
- th: () => th,
318
- thead: () => thead,
319
- time: () => time,
320
- title: () => title,
321
- tr: () => tr,
322
- track: () => track2,
323
- tspan: () => tspan,
324
- u: () => u,
325
- ul: () => ul,
326
- unregisterComponent: () => unregisterComponent,
327
- use: () => use,
328
- useArray: () => useArray,
329
- useCallback: () => useCallback,
330
- useComputed: () => useComputed,
331
- useDeepState: () => useDeepState,
332
- useEffect: () => useEffect,
333
- useMemo: () => useMemo,
334
- useReactiveArray: () => useReactiveArray,
335
- useRef: () => useRef,
336
- useState: () => useState,
337
- useStore: () => useStore,
338
- useWatch: () => useWatch,
339
- var_: () => var_,
340
- video: () => video,
341
- when: () => when
342
- });
343
-
344
- // src/core/rendering/mount.ts
345
- function mount(component, container) {
346
- if (!container) {
347
- throw new Error("Mount target element not found.");
348
- }
349
- const node = typeof component === "function" ? component() : component;
350
- container.appendChild(node);
351
- return {
352
- node,
353
- unmount() {
354
- dispose(node);
355
- if (node.parentNode) {
356
- node.parentNode.removeChild(node);
357
- }
358
- }
359
- };
360
- }
361
-
362
- // src/core/rendering/each.ts
363
- function resolveNodeChild(child) {
364
- if (typeof child === "function") {
365
- return resolveNodeChild(child());
366
- }
367
- if (child instanceof Node) {
368
- return child;
369
- }
370
- return document.createTextNode(String(child));
371
- }
372
- function longestIncreasingSubsequence(arr, len) {
373
- if (len === 0) return [];
374
- const tails = [];
375
- const predecessor = new Array(len);
376
- for (let i2 = 0; i2 < len; i2++) {
377
- const val = arr[i2];
378
- let lo = 0;
379
- let hi = tails.length;
380
- while (lo < hi) {
381
- const mid = lo + hi >> 1;
382
- if (arr[tails[mid]] < val) {
383
- lo = mid + 1;
384
- } else {
385
- hi = mid;
386
- }
387
- }
388
- tails[lo] = i2;
389
- predecessor[i2] = lo > 0 ? tails[lo - 1] : -1;
390
- }
391
- const lisLength = tails.length;
392
- const result = new Array(lisLength);
393
- let k = tails[lisLength - 1];
394
- for (let i2 = lisLength - 1; i2 >= 0; i2--) {
395
- result[i2] = k;
396
- k = predecessor[k];
397
- }
398
- return result;
399
- }
400
- function each(getArray, render, options) {
401
- const anchor = document.createComment("each:anchor");
402
- const end = document.createComment("each:end");
403
- let oldKeys = [];
404
- let nodeMap = /* @__PURE__ */ new Map();
405
- let workMap = /* @__PURE__ */ new Map();
406
- let newNodes = [];
407
- const oldKeyIndex = /* @__PURE__ */ new Map();
408
- let reusedNewBuf = [];
409
- let reusedOldBuf = [];
410
- let initialized = false;
411
- let sentinelInserted = false;
412
- const keyFn = options.key;
413
- const update = () => {
414
- const arr = getArray();
415
- const newLen = arr.length;
416
- const parent = anchor.parentNode;
417
- if (!parent) return;
418
- if (!sentinelInserted) {
419
- parent.insertBefore(end, anchor.nextSibling);
420
- sentinelInserted = true;
421
- }
422
- const newKeys = new Array(newLen);
423
- for (let i2 = 0; i2 < newLen; i2++) {
424
- newKeys[i2] = keyFn(arr[i2]);
425
- }
426
- if (newNodes.length < newLen) {
427
- newNodes = new Array(newLen);
428
- }
429
- workMap.clear();
430
- for (let i2 = 0; i2 < newLen; i2++) {
431
- const key = newKeys[i2];
432
- const existing = nodeMap.get(key);
433
- let node;
434
- if (existing !== void 0) {
435
- node = existing;
436
- } else {
437
- node = resolveNodeChild(render(arr[i2], i2));
438
- }
439
- workMap.set(key, node);
440
- newNodes[i2] = node;
441
- }
442
- for (const [key, node] of nodeMap) {
443
- if (!workMap.has(key) && node.parentNode) {
444
- parent.removeChild(node);
445
- }
446
- }
447
- if (newLen === 0) {
448
- oldKeys = newKeys;
449
- const tmp2 = nodeMap;
450
- nodeMap = workMap;
451
- workMap = tmp2;
452
- return;
453
- }
454
- const oldLen = oldKeys.length;
455
- oldKeyIndex.clear();
456
- for (let i2 = 0; i2 < oldLen; i2++) {
457
- oldKeyIndex.set(oldKeys[i2], i2);
458
- }
459
- if (reusedNewBuf.length < newLen) {
460
- reusedNewBuf = new Array(newLen);
461
- reusedOldBuf = new Array(newLen);
462
- }
463
- let reusedCount = 0;
464
- for (let i2 = 0; i2 < newLen; i2++) {
465
- const oldIdx = oldKeyIndex.get(newKeys[i2]);
466
- if (oldIdx !== void 0) {
467
- reusedNewBuf[reusedCount] = i2;
468
- reusedOldBuf[reusedCount] = oldIdx;
469
- reusedCount++;
470
- }
471
- }
472
- const lisIndices = longestIncreasingSubsequence(reusedOldBuf, reusedCount);
473
- const isStable = new Uint8Array(newLen);
474
- for (let i2 = 0; i2 < lisIndices.length; i2++) {
475
- isStable[reusedNewBuf[lisIndices[i2]]] = 1;
476
- }
477
- let nextRef = end;
478
- for (let i2 = newLen - 1; i2 >= 0; i2--) {
479
- const node = newNodes[i2];
480
- if (isStable[i2]) {
481
- nextRef = node;
482
- } else {
483
- if (node.nextSibling !== nextRef) {
484
- parent.insertBefore(node, nextRef);
485
- }
486
- nextRef = node;
487
- }
488
- }
489
- oldKeys = newKeys;
490
- const tmp = nodeMap;
491
- nodeMap = workMap;
492
- workMap = tmp;
493
- initialized = true;
494
- };
495
- track(update);
496
- if (!initialized) {
497
- queueMicrotask(() => {
498
- if (!initialized && anchor.parentNode) {
499
- update();
500
- }
501
- });
502
- }
503
- return anchor;
504
- }
505
-
506
- // src/core/rendering/fragment.ts
507
- function Fragment(nodes) {
508
- const frag = document.createDocumentFragment();
509
- for (const child of nodes) {
510
- if (child == null) continue;
511
- if (Array.isArray(child)) {
512
- for (const nested of child) {
513
- frag.appendChild(resolveChild(nested));
514
- }
515
- } else {
516
- frag.appendChild(resolveChild(child));
517
- }
518
- }
519
- return frag;
520
- }
521
- function resolveChild(child) {
522
- if (child == null) {
523
- return document.createTextNode("");
524
- }
525
- if (child instanceof Node) {
526
- return child;
527
- }
528
- if (typeof child === "function") {
529
- const result = child();
530
- if (result instanceof Node) return result;
531
- return document.createTextNode(String(result ?? ""));
532
- }
533
- return document.createTextNode(String(child));
534
- }
535
-
536
- // src/core/rendering/portal.ts
537
- function Portal(nodes, target) {
538
- const anchor = document.createComment("portal");
539
- const container = target || document.body;
540
- let portalContent = null;
541
- queueMicrotask(() => {
542
- try {
543
- portalContent = nodes();
544
- container.appendChild(portalContent);
545
- } catch (err) {
546
- console.error("[Portal] Render error:", err);
547
- }
548
- });
549
- const observer = new MutationObserver(() => {
550
- if (!anchor.isConnected && portalContent) {
551
- portalContent.remove();
552
- portalContent = null;
553
- observer.disconnect();
554
- }
555
- });
556
- queueMicrotask(() => {
557
- if (anchor.parentNode) {
558
- observer.observe(anchor.parentNode, { childList: true });
559
- }
560
- });
561
- return anchor;
562
- }
563
-
564
- // src/core/rendering/dynamic.ts
565
- var componentRegistry = /* @__PURE__ */ new Map();
566
- function registerComponent(name, component) {
567
- componentRegistry.set(name, component);
568
- }
569
- function unregisterComponent(name) {
570
- componentRegistry.delete(name);
571
- }
572
- function resolveComponent(name) {
573
- const component = componentRegistry.get(name);
574
- if (component) {
575
- return component();
576
- }
577
- return div({ nodes: `[Component "${name}" not found]` });
578
- }
579
- function DynamicComponent(is) {
580
- const container = div({ class: "sibu-dynamic" });
581
- const [, _setVersion] = useState(0);
582
- const render = () => {
583
- const target = is();
584
- let el;
585
- if (typeof target === "function") {
586
- el = target();
587
- } else {
588
- el = resolveComponent(target);
589
- }
590
- container.replaceChildren(el);
591
- };
592
- queueMicrotask(render);
593
- return container;
594
- }
595
-
596
- // src/core/rendering/slots.ts
597
- function getSlot(slots, name = "default") {
598
- return slots?.[name];
599
- }
600
-
601
- // src/core/rendering/directives.ts
602
- function show(condition, element) {
603
- const update = () => {
604
- element.style.display = condition() ? "" : "none";
605
- };
606
- track(update);
607
- return element;
608
- }
609
- function when(condition, thenBranch, elseBranch) {
610
- const anchor = document.createComment("when");
611
- let currentNode = null;
612
- let initialized = false;
613
- const update = () => {
614
- const show2 = condition();
615
- const parent = anchor.parentNode;
616
- if (!parent) return;
617
- if (currentNode?.parentNode) {
618
- currentNode.parentNode.removeChild(currentNode);
619
- currentNode = null;
620
- }
621
- const result = show2 ? thenBranch() : elseBranch ? elseBranch() : null;
622
- if (result != null) {
623
- const node = result instanceof Node ? result : document.createTextNode(String(result));
624
- parent.insertBefore(node, anchor.nextSibling);
625
- currentNode = node;
626
- }
627
- initialized = true;
628
- };
629
- track(update);
630
- if (!initialized) {
631
- queueMicrotask(() => {
632
- if (!initialized && anchor.parentNode) update();
633
- });
634
- }
635
- return anchor;
636
- }
637
- function match(value, cases, fallback) {
638
- const anchor = document.createComment("match");
639
- let currentNode = null;
640
- let initialized = false;
641
- const update = () => {
642
- const key = String(value());
643
- const parent = anchor.parentNode;
644
- if (!parent) return;
645
- if (currentNode?.parentNode) {
646
- currentNode.parentNode.removeChild(currentNode);
647
- currentNode = null;
648
- }
649
- const renderFn = cases[key] || fallback;
650
- if (renderFn) {
651
- const result = renderFn();
652
- if (result != null) {
653
- const node = result instanceof Node ? result : document.createTextNode(String(result));
654
- parent.insertBefore(node, anchor.nextSibling);
655
- currentNode = node;
656
- }
657
- }
658
- initialized = true;
659
- };
660
- track(update);
661
- if (!initialized) {
662
- queueMicrotask(() => {
663
- if (!initialized && anchor.parentNode) update();
664
- });
665
- }
666
- return anchor;
667
- }
668
-
669
- // src/core/rendering/catch.ts
670
- var globalErrorHandler = null;
671
- function catchError(fn, onError) {
672
- try {
673
- const result = fn();
674
- if (result && typeof result.then === "function") {
675
- result.catch((err) => {
676
- if (onError) {
677
- onError(err, "async");
678
- } else if (globalErrorHandler) {
679
- globalErrorHandler(err, "async");
680
- } else {
681
- console.error("Unhandled async error in Sibu.catchError:", err);
682
- }
683
- });
684
- }
685
- return result;
686
- } catch (err) {
687
- if (onError) {
688
- onError(err, "sync");
689
- } else if (globalErrorHandler) {
690
- globalErrorHandler(err, "sync");
691
- } else {
692
- console.error("Unhandled error in Sibu.catchError:", err);
693
- }
694
- return null;
695
- }
696
- }
697
- async function catchErrorAsync(fn, onError) {
698
- try {
699
- return await fn();
700
- } catch (err) {
701
- if (onError) {
702
- onError(err, "async");
703
- } else if (globalErrorHandler) {
704
- globalErrorHandler(err, "async");
705
- } else {
706
- console.error("Unhandled async error in Sibu.catchErrorAsync:", err);
707
- }
708
- return null;
709
- }
710
- }
711
- function setGlobalErrorHandler(handler) {
712
- globalErrorHandler = handler;
713
- }
714
-
715
- // src/core/hooks/useWatch.ts
716
- function useWatch(getter, callback) {
717
- let oldValue = getter();
718
- const subscriber = () => {
719
- const newValue = getter();
720
- if (newValue !== oldValue) {
721
- callback(newValue, oldValue);
722
- oldValue = newValue;
723
- }
724
- };
725
- const teardown = track(subscriber);
726
- return teardown;
727
- }
728
-
729
- // src/core/hooks/useStore.ts
730
- function useStore(initialState) {
731
- const signals = {};
732
- Object.keys(initialState).forEach((key) => {
733
- const [getter, setter] = useState(initialState[key]);
734
- signals[key] = [getter, setter];
735
- });
736
- const store = new Proxy({}, {
737
- get(_, prop) {
738
- if (prop in signals) {
739
- const getter = signals[prop][0];
740
- return getter();
741
- }
742
- return void 0;
743
- },
744
- set() {
745
- throw new Error("Direct mutation of store is not allowed. Use actions.setState.");
746
- }
747
- });
748
- const getSnapshot = () => {
749
- const snapshot = {};
750
- Object.keys(signals).forEach((key) => {
751
- snapshot[key] = signals[key][0]();
752
- });
753
- return snapshot;
754
- };
755
- const setState = (patch) => {
756
- const current = getSnapshot();
757
- const nextState = typeof patch === "function" ? patch(current) : patch;
758
- Object.entries(nextState).forEach(([key, value]) => {
759
- if (key in signals) {
760
- signals[key][1](value);
761
- }
762
- });
763
- };
764
- const reset = () => {
765
- Object.keys(initialState).forEach((key) => {
766
- const setter = signals[key][1];
767
- setter(initialState[key]);
768
- });
769
- };
770
- const subscribe = (callback) => {
771
- return useEffect(() => {
772
- const snapshot = getSnapshot();
773
- callback(snapshot);
774
- });
775
- };
776
- const subscribeKey = (key, callback) => {
777
- let prev = signals[key][0]();
778
- return useEffect(() => {
779
- const current = signals[key][0]();
780
- if (!Object.is(current, prev)) {
781
- const oldPrev = prev;
782
- prev = current;
783
- callback(current, oldPrev);
784
- }
785
- });
786
- };
787
- return [store, { setState, reset, subscribe, subscribeKey, getSnapshot }];
788
- }
789
-
790
- // src/core/hooks/useRef.ts
791
- function useRef(initial) {
792
- return { current: initial };
793
- }
794
-
795
- // src/core/hooks/useMemo.ts
796
- function useMemo(factory) {
797
- return useComputed(factory);
798
- }
799
-
800
- // src/core/hooks/useCallback.ts
801
- function useCallback(callback) {
802
- return useComputed(callback);
803
- }
804
-
805
- // src/core/hooks/useArray.ts
806
- function useArray(initial = []) {
807
- const [arr, setArr] = useState([...initial]);
808
- const actions = {
809
- push(...items) {
810
- setArr((prev) => [...prev, ...items]);
811
- },
812
- pop() {
813
- let removed;
814
- setArr((prev) => {
815
- const copy = [...prev];
816
- removed = copy.pop();
817
- return copy;
818
- });
819
- return removed;
820
- },
821
- shift() {
822
- let removed;
823
- setArr((prev) => {
824
- const copy = [...prev];
825
- removed = copy.shift();
826
- return copy;
827
- });
828
- return removed;
829
- },
830
- unshift(...items) {
831
- setArr((prev) => [...items, ...prev]);
832
- },
833
- splice(start, deleteCount = 0, ...items) {
834
- let removed = [];
835
- setArr((prev) => {
836
- const copy = [...prev];
837
- removed = copy.splice(start, deleteCount, ...items);
838
- return copy;
839
- });
840
- return removed;
841
- },
842
- remove(index) {
843
- setArr((prev) => prev.filter((_, i2) => i2 !== index));
844
- },
845
- removeWhere(predicate) {
846
- setArr((prev) => {
847
- const idx = prev.findIndex(predicate);
848
- if (idx === -1) return prev;
849
- return prev.filter((_, i2) => i2 !== idx);
850
- });
851
- },
852
- set(items) {
853
- setArr([...items]);
854
- },
855
- update(index, value) {
856
- setArr((prev) => prev.map((item, i2) => i2 === index ? value : item));
857
- },
858
- updateWhere(predicate, updater) {
859
- setArr((prev) => prev.map((item) => predicate(item) ? updater(item) : item));
860
- },
861
- sort(compareFn) {
862
- setArr((prev) => [...prev].sort(compareFn));
863
- },
864
- reverse() {
865
- setArr((prev) => [...prev].reverse());
866
- },
867
- filter(predicate) {
868
- setArr((prev) => prev.filter(predicate));
869
- },
870
- map(transform) {
871
- setArr((prev) => prev.map(transform));
872
- },
873
- clear() {
874
- setArr([]);
875
- }
876
- };
877
- return [arr, actions];
878
- }
879
- function useReactiveArray(initial = []) {
880
- let data2 = [...initial];
881
- let snapshot = null;
882
- const signal = {};
883
- function notify() {
884
- snapshot = null;
885
- if (!enqueueBatchedSignal(signal)) {
886
- notifySubscribers(signal);
887
- }
888
- }
889
- function get() {
890
- recordDependency(signal);
891
- if (snapshot === null) {
892
- snapshot = Object.freeze([...data2]);
893
- }
894
- return snapshot;
895
- }
896
- const actions = {
897
- push(...items) {
898
- if (items.length === 0) return;
899
- data2.push(...items);
900
- notify();
901
- },
902
- pop() {
903
- if (data2.length === 0) return void 0;
904
- const removed = data2.pop();
905
- notify();
906
- return removed;
907
- },
908
- shift() {
909
- if (data2.length === 0) return void 0;
910
- const removed = data2.shift();
911
- notify();
912
- return removed;
913
- },
914
- unshift(...items) {
915
- if (items.length === 0) return;
916
- data2.unshift(...items);
917
- notify();
918
- },
919
- splice(start, deleteCount = 0, ...items) {
920
- const removed = data2.splice(start, deleteCount, ...items);
921
- if (removed.length > 0 || items.length > 0) {
922
- notify();
923
- }
924
- return removed;
925
- },
926
- remove(index) {
927
- if (index < 0 || index >= data2.length) return;
928
- data2.splice(index, 1);
929
- notify();
930
- },
931
- removeWhere(predicate) {
932
- const idx = data2.findIndex(predicate);
933
- if (idx === -1) return;
934
- data2.splice(idx, 1);
935
- notify();
936
- },
937
- set(items) {
938
- data2 = [...items];
939
- notify();
940
- },
941
- update(index, value) {
942
- if (index < 0 || index >= data2.length) return;
943
- if (Object.is(data2[index], value)) return;
944
- data2[index] = value;
945
- notify();
946
- },
947
- updateWhere(predicate, updater) {
948
- let changed = false;
949
- for (let i2 = 0; i2 < data2.length; i2++) {
950
- if (predicate(data2[i2])) {
951
- const updated = updater(data2[i2]);
952
- if (!Object.is(data2[i2], updated)) {
953
- data2[i2] = updated;
954
- changed = true;
955
- }
956
- }
957
- }
958
- if (changed) notify();
959
- },
960
- sort(compareFn) {
961
- if (data2.length <= 1) return;
962
- data2.sort(compareFn);
963
- notify();
964
- },
965
- reverse() {
966
- if (data2.length <= 1) return;
967
- data2.reverse();
968
- notify();
969
- },
970
- filter(predicate) {
971
- const filtered = data2.filter(predicate);
972
- if (filtered.length === data2.length) return;
973
- data2 = filtered;
974
- notify();
975
- },
976
- map(transform) {
977
- let changed = false;
978
- for (let i2 = 0; i2 < data2.length; i2++) {
979
- const transformed = transform(data2[i2], i2);
980
- if (!Object.is(data2[i2], transformed)) {
981
- data2[i2] = transformed;
982
- changed = true;
983
- }
984
- }
985
- if (changed) notify();
986
- },
987
- clear() {
988
- if (data2.length === 0) return;
989
- data2 = [];
990
- notify();
991
- }
992
- };
993
- return [get, actions];
994
- }
995
-
996
- // src/core/hooks/useDeepState.ts
997
- function deepEqual(a2, b2) {
998
- if (Object.is(a2, b2)) return true;
999
- if (a2 == null || b2 == null) return false;
1000
- if (typeof a2 !== typeof b2) return false;
1001
- if (typeof a2 !== "object") return false;
1002
- if (Array.isArray(a2)) {
1003
- if (!Array.isArray(b2)) return false;
1004
- if (a2.length !== b2.length) return false;
1005
- return a2.every((val, i2) => deepEqual(val, b2[i2]));
1006
- }
1007
- const keysA = Object.keys(a2);
1008
- const keysB = Object.keys(b2);
1009
- if (keysA.length !== keysB.length) return false;
1010
- return keysA.every((key) => deepEqual(a2[key], b2[key]));
1011
- }
1012
- function useDeepState(initial) {
1013
- const state = { value: initial };
1014
- function get() {
1015
- recordDependency(state);
1016
- return state.value;
1017
- }
1018
- function set(next) {
1019
- const newValue = typeof next === "function" ? next(state.value) : next;
1020
- if (deepEqual(newValue, state.value)) return;
1021
- state.value = newValue;
1022
- if (!enqueueBatchedSignal(state)) {
1023
- notifySubscribers(state);
1024
- }
1025
- }
1026
- return [get, set];
1027
- }
1028
-
1029
- // src/core/rendering/lifecycle.ts
1030
- function onMount(callback, element) {
1031
- if (element) {
1032
- if (element.isConnected) {
1033
- queueMicrotask(() => {
1034
- callback();
1035
- });
1036
- return;
1037
- }
1038
- const observer = new MutationObserver(() => {
1039
- if (element.isConnected) {
1040
- observer.disconnect();
1041
- callback();
1042
- }
1043
- });
1044
- queueMicrotask(() => {
1045
- if (element.isConnected) {
1046
- callback();
1047
- } else {
1048
- observer.observe(document.body, { childList: true, subtree: true });
1049
- }
1050
- });
1051
- } else {
1052
- queueMicrotask(() => {
1053
- callback();
1054
- });
1055
- }
1056
- }
1057
- function onUnmount(callback, element) {
1058
- const startObserving = () => {
1059
- const observer = new MutationObserver(() => {
1060
- if (!element.isConnected) {
1061
- observer.disconnect();
1062
- callback();
1063
- }
1064
- });
1065
- observer.observe(document.body, { childList: true, subtree: true });
1066
- };
1067
- if (element.isConnected) {
1068
- startObserving();
1069
- } else {
1070
- onMount(() => {
1071
- startObserving();
1072
- return void 0;
1073
- }, element);
1074
- }
1075
- }
1076
-
1077
- // src/core/rendering/lazy.ts
1078
- function lazy(importFn) {
1079
- let cached = null;
1080
- return function LazyComponent() {
1081
- if (cached) {
1082
- return cached();
1083
- }
1084
- const [_status, setStatus] = useState("loading");
1085
- const [_error, setError] = useState(null);
1086
- const container = div({ class: "sibu-lazy" });
1087
- importFn().then((mod) => {
1088
- cached = mod.default;
1089
- const rendered = cached();
1090
- container.replaceChildren(rendered);
1091
- setStatus("loaded");
1092
- }).catch((err) => {
1093
- const errorObj = err instanceof Error ? err : new Error(String(err));
1094
- setError(errorObj);
1095
- setStatus("error");
1096
- container.replaceChildren(
1097
- div({
1098
- class: "sibu-lazy-error",
1099
- nodes: `Failed to load component: ${errorObj.message}`
1100
- })
1101
- );
1102
- });
1103
- container.appendChild(span({ class: "sibu-lazy-loading", nodes: "Loading..." }));
1104
- return container;
1105
- };
1106
- }
1107
- function Suspense({ nodes, fallback }) {
1108
- const container = div({ class: "sibu-suspense" });
1109
- const fallbackEl = fallback();
1110
- container.appendChild(fallbackEl);
1111
- queueMicrotask(() => {
1112
- try {
1113
- const childEl = nodes();
1114
- if (childEl.classList.contains("sibu-lazy")) {
1115
- const observer = new MutationObserver(() => {
1116
- const loading = childEl.querySelector(".sibu-lazy-loading");
1117
- if (!loading) {
1118
- observer.disconnect();
1119
- container.replaceChildren(childEl);
1120
- }
1121
- });
1122
- observer.observe(childEl, { childList: true, subtree: true });
1123
- if (!childEl.querySelector(".sibu-lazy-loading")) {
1124
- container.replaceChildren(childEl);
1125
- }
1126
- } else {
1127
- container.replaceChildren(childEl);
1128
- }
1129
- } catch {
1130
- }
1131
- });
1132
- return container;
1133
- }
1134
-
1135
- // src/components/ErrorBoundary.ts
1136
- var errorBoundaryStyles = `
1137
- .sibu-error-boundary {
1138
- position: relative;
1139
- }
1140
-
1141
- .sibu-error-fallback {
1142
- border: 2px solid #dc3545;
1143
- border-radius: 8px;
1144
- padding: 20px;
1145
- margin: 10px 0;
1146
- background: linear-gradient(135deg, #fff5f5 0%, #ffebee 100%);
1147
- box-shadow: 0 2px 12px rgba(220, 53, 69, 0.15);
1148
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
1149
- }
1150
-
1151
- .sibu-error-fallback .sibu-error-title {
1152
- margin: 0 0 12px 0;
1153
- color: #dc3545;
1154
- font-size: 1.1em;
1155
- font-weight: 600;
1156
- }
1157
-
1158
- .sibu-error-fallback .sibu-error-message {
1159
- font-family: 'SF Mono', 'Fira Code', 'Roboto Mono', monospace;
1160
- background-color: rgba(0, 0, 0, 0.04);
1161
- padding: 10px 14px;
1162
- border-radius: 6px;
1163
- border: 1px solid rgba(0, 0, 0, 0.08);
1164
- margin: 10px 0;
1165
- color: #495057;
1166
- word-break: break-word;
1167
- font-size: 0.9em;
1168
- line-height: 1.5;
1169
- }
1170
-
1171
- .sibu-error-fallback .sibu-error-btn {
1172
- display: inline-flex;
1173
- align-items: center;
1174
- gap: 6px;
1175
- padding: 8px 18px;
1176
- border: none;
1177
- border-radius: 6px;
1178
- cursor: pointer;
1179
- font-size: 14px;
1180
- font-weight: 500;
1181
- transition: all 0.2s ease;
1182
- margin-top: 8px;
1183
- background-color: #dc3545;
1184
- color: white;
1185
- }
1186
-
1187
- .sibu-error-fallback .sibu-error-btn:hover {
1188
- background-color: #c82333;
1189
- transform: translateY(-1px);
1190
- box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
1191
- }
1192
-
1193
- .sibu-error-fallback .sibu-error-btn:active {
1194
- transform: translateY(0);
1195
- }
1196
- `;
1197
- var stylesInjected = false;
1198
- function injectStyles() {
1199
- if (!stylesInjected && typeof document !== "undefined") {
1200
- const styleElement = style({ nodes: errorBoundaryStyles });
1201
- document.head.appendChild(styleElement);
1202
- stylesInjected = true;
1203
- }
1204
- }
1205
- var fallbackCache = /* @__PURE__ */ new WeakMap();
1206
- function getMemoizedFallback(fallbackFn, error, retry) {
1207
- let cache = fallbackCache.get(fallbackFn);
1208
- if (!cache) {
1209
- cache = /* @__PURE__ */ new Map();
1210
- fallbackCache.set(fallbackFn, cache);
1211
- }
1212
- const key = error.message;
1213
- if (!cache.has(key)) {
1214
- cache.set(key, fallbackFn(error, retry));
1215
- }
1216
- return cache.get(key);
1217
- }
1218
- function ErrorBoundary({ nodes, fallback, onError }) {
1219
- injectStyles();
1220
- const [error, setError] = useState(null);
1221
- const retry = () => {
1222
- if (fallback) {
1223
- fallbackCache.delete(fallback);
1224
- }
1225
- setError(null);
1226
- };
1227
- const handleError = (e) => {
1228
- const errorObj = e instanceof Error ? e : new Error(String(e));
1229
- setError(errorObj);
1230
- onError?.(errorObj);
1231
- return errorObj;
1232
- };
1233
- const defaultFallback = (err, retryFn) => div({
1234
- class: "sibu-error-fallback",
1235
- nodes: [
1236
- h3({
1237
- nodes: "Something went wrong",
1238
- class: "sibu-error-title"
1239
- }),
1240
- p({
1241
- nodes: err.message,
1242
- class: "sibu-error-message"
1243
- }),
1244
- button({
1245
- nodes: "Retry",
1246
- class: "sibu-error-btn",
1247
- on: { click: retryFn }
1248
- })
1249
- ]
1250
- });
1251
- const tryRenderFallback = (err) => {
1252
- const fn = fallback || defaultFallback;
1253
- try {
1254
- return getMemoizedFallback(fn, err, retry);
1255
- } catch (fallbackError) {
1256
- const propagateError = fallbackError instanceof Error ? fallbackError : new Error(String(fallbackError));
1257
- if (container.parentNode) {
1258
- container.dispatchEvent(
1259
- new CustomEvent("sibu:error-propagate", {
1260
- bubbles: true,
1261
- detail: { error: propagateError }
1262
- })
1263
- );
1264
- }
1265
- return document.createComment("error-boundary-failed");
1266
- }
1267
- };
1268
- const container = div({
1269
- class: "sibu-error-boundary",
1270
- nodes: () => {
1271
- const currentError = error();
1272
- if (currentError) {
1273
- return tryRenderFallback(currentError);
1274
- }
1275
- try {
1276
- const result = nodes();
1277
- if (result && typeof result.then === "function") {
1278
- const asyncContainer = div({ class: "sibu-error-async" });
1279
- asyncContainer.appendChild(span({ class: "sibu-lazy-loading", nodes: "Loading..." }));
1280
- result.then((el) => {
1281
- asyncContainer.replaceChildren(el);
1282
- }).catch((e) => {
1283
- const err = handleError(e);
1284
- asyncContainer.replaceChildren(tryRenderFallback(err));
1285
- });
1286
- return asyncContainer;
1287
- }
1288
- return result;
1289
- } catch (e) {
1290
- const errorObj = handleError(e);
1291
- return tryRenderFallback(errorObj);
1292
- }
1293
- }
1294
- });
1295
- container.addEventListener("sibu:error-propagate", (e) => {
1296
- if (error()) return;
1297
- e.stopPropagation();
1298
- const customEvent = e;
1299
- const propagatedError = customEvent.detail?.error;
1300
- if (propagatedError) {
1301
- handleError(propagatedError);
1302
- }
1303
- });
1304
- return container;
1305
- }
1306
-
1307
- // src/components/Loading.ts
1308
- var loadingStyles = `
1309
- @keyframes sibu-spin {
1310
- to { transform: rotate(360deg); }
1311
- }
1312
-
1313
- @keyframes sibu-pulse {
1314
- 0%, 100% { opacity: 1; }
1315
- 50% { opacity: 0.4; }
1316
- }
1317
-
1318
- .sibu-loading {
1319
- display: flex;
1320
- align-items: center;
1321
- justify-content: center;
1322
- padding: 20px;
1323
- gap: 10px;
1324
- }
1325
-
1326
- .sibu-loading-spinner {
1327
- width: 24px;
1328
- height: 24px;
1329
- border: 3px solid #e0e0e0;
1330
- border-top-color: #3b82f6;
1331
- border-radius: 50%;
1332
- animation: sibu-spin 0.8s linear infinite;
1333
- }
1334
-
1335
- .sibu-loading-dots {
1336
- display: flex;
1337
- gap: 4px;
1338
- }
1339
-
1340
- .sibu-loading-dot {
1341
- width: 8px;
1342
- height: 8px;
1343
- border-radius: 50%;
1344
- background-color: #3b82f6;
1345
- animation: sibu-pulse 1.2s ease-in-out infinite;
1346
- }
1347
-
1348
- .sibu-loading-dot:nth-child(2) { animation-delay: 0.2s; }
1349
- .sibu-loading-dot:nth-child(3) { animation-delay: 0.4s; }
1350
-
1351
- .sibu-loading-text {
1352
- color: #6b7280;
1353
- font-size: 14px;
1354
- }
1355
-
1356
- .sibu-loading-sm .sibu-loading-spinner { width: 16px; height: 16px; border-width: 2px; }
1357
- .sibu-loading-lg .sibu-loading-spinner { width: 40px; height: 40px; border-width: 4px; }
1358
- `;
1359
- var loadingStylesInjected = false;
1360
- function injectLoadingStyles() {
1361
- if (!loadingStylesInjected && typeof document !== "undefined") {
1362
- document.head.appendChild(style({ nodes: loadingStyles }));
1363
- loadingStylesInjected = true;
1364
- }
1365
- }
1366
- function Loading(props = {}) {
1367
- injectLoadingStyles();
1368
- const { text: text2, variant = "spinner", size = "md" } = props;
1369
- const sizeClass = size !== "md" ? ` sibu-loading-${size}` : "";
1370
- if (variant === "dots") {
1371
- return div({
1372
- class: `sibu-loading${sizeClass}`,
1373
- nodes: [
1374
- div({
1375
- class: "sibu-loading-dots",
1376
- nodes: [
1377
- span({ class: "sibu-loading-dot" }),
1378
- span({ class: "sibu-loading-dot" }),
1379
- span({ class: "sibu-loading-dot" })
1380
- ]
1381
- }),
1382
- text2 ? span({ class: "sibu-loading-text", nodes: text2 }) : null
1383
- ].filter(Boolean)
1384
- });
1385
- }
1386
- return div({
1387
- class: `sibu-loading${sizeClass}`,
1388
- nodes: [
1389
- div({ class: "sibu-loading-spinner" }),
1390
- text2 ? span({ class: "sibu-loading-text", nodes: text2 }) : null
1391
- ].filter(Boolean)
1392
- });
1393
- }
1394
-
1395
- export {
1396
- mount,
1397
- each,
1398
- Fragment,
1399
- Portal,
1400
- registerComponent,
1401
- unregisterComponent,
1402
- resolveComponent,
1403
- DynamicComponent,
1404
- getSlot,
1405
- show,
1406
- when,
1407
- match,
1408
- catchError,
1409
- catchErrorAsync,
1410
- setGlobalErrorHandler,
1411
- useWatch,
1412
- useStore,
1413
- useRef,
1414
- useMemo,
1415
- useCallback,
1416
- useArray,
1417
- useReactiveArray,
1418
- useDeepState,
1419
- onMount,
1420
- onUnmount,
1421
- lazy,
1422
- Suspense,
1423
- ErrorBoundary,
1424
- Loading,
1425
- index_exports
1426
- };