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