sibujs 1.0.2 → 1.0.3

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