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-HKUNBYN6.js
DELETED
|
@@ -1,949 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
context
|
|
3
|
-
} from "./chunk-UXDIPRCG.js";
|
|
4
|
-
import {
|
|
5
|
-
derived
|
|
6
|
-
} from "./chunk-526ENZ77.js";
|
|
7
|
-
import {
|
|
8
|
-
effect
|
|
9
|
-
} from "./chunk-JRWAHOMS.js";
|
|
10
|
-
import {
|
|
11
|
-
batch,
|
|
12
|
-
signal
|
|
13
|
-
} from "./chunk-5KBEED6D.js";
|
|
14
|
-
|
|
15
|
-
// src/data/retry.ts
|
|
16
|
-
function calculateDelay(attempt, strategy, baseDelay, maxDelay, jitter) {
|
|
17
|
-
let delay;
|
|
18
|
-
switch (strategy) {
|
|
19
|
-
case "exponential":
|
|
20
|
-
delay = baseDelay * 2 ** attempt;
|
|
21
|
-
break;
|
|
22
|
-
case "linear":
|
|
23
|
-
delay = baseDelay * (attempt + 1);
|
|
24
|
-
break;
|
|
25
|
-
case "fixed":
|
|
26
|
-
delay = baseDelay;
|
|
27
|
-
break;
|
|
28
|
-
}
|
|
29
|
-
delay = Math.min(delay, maxDelay);
|
|
30
|
-
if (jitter > 0) {
|
|
31
|
-
const jitterRange = delay * jitter;
|
|
32
|
-
delay += (Math.random() * 2 - 1) * jitterRange;
|
|
33
|
-
}
|
|
34
|
-
return Math.max(0, delay);
|
|
35
|
-
}
|
|
36
|
-
async function withRetry(fn, options, onRetry, signal2) {
|
|
37
|
-
const maxRetries = options?.maxRetries ?? 3;
|
|
38
|
-
const strategy = options?.strategy ?? "exponential";
|
|
39
|
-
const baseDelay = options?.baseDelay ?? 1e3;
|
|
40
|
-
const maxDelay = options?.maxDelay ?? 3e4;
|
|
41
|
-
const jitter = options?.jitter ?? 0.1;
|
|
42
|
-
const shouldRetry = options?.shouldRetry ?? (() => true);
|
|
43
|
-
let lastError;
|
|
44
|
-
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
45
|
-
if (signal2?.aborted) throw new DOMException("Aborted", "AbortError");
|
|
46
|
-
try {
|
|
47
|
-
return await fn();
|
|
48
|
-
} catch (error) {
|
|
49
|
-
lastError = error;
|
|
50
|
-
if (attempt >= maxRetries || !shouldRetry(error, attempt)) throw error;
|
|
51
|
-
const delay = calculateDelay(attempt, strategy, baseDelay, maxDelay, jitter);
|
|
52
|
-
onRetry?.(error, attempt, delay);
|
|
53
|
-
await new Promise((resolve, reject) => {
|
|
54
|
-
const timer = setTimeout(resolve, delay);
|
|
55
|
-
if (signal2) {
|
|
56
|
-
const onAbort = () => {
|
|
57
|
-
clearTimeout(timer);
|
|
58
|
-
reject(new DOMException("Aborted", "AbortError"));
|
|
59
|
-
};
|
|
60
|
-
signal2.addEventListener("abort", onAbort, { once: true });
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
throw lastError;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// src/data/query.ts
|
|
69
|
-
var queryCache = /* @__PURE__ */ new Map();
|
|
70
|
-
function getOrCreateEntry(key, initialData) {
|
|
71
|
-
let entry = queryCache.get(key);
|
|
72
|
-
if (!entry) {
|
|
73
|
-
entry = {
|
|
74
|
-
data: initialData,
|
|
75
|
-
error: void 0,
|
|
76
|
-
dataUpdatedAt: initialData !== void 0 ? Date.now() : 0,
|
|
77
|
-
subscribers: 0,
|
|
78
|
-
gcTimer: null,
|
|
79
|
-
promise: null,
|
|
80
|
-
listeners: /* @__PURE__ */ new Set(),
|
|
81
|
-
refetchers: /* @__PURE__ */ new Set()
|
|
82
|
-
};
|
|
83
|
-
queryCache.set(key, entry);
|
|
84
|
-
}
|
|
85
|
-
return entry;
|
|
86
|
-
}
|
|
87
|
-
function query(key, fetcher, options = {}) {
|
|
88
|
-
const {
|
|
89
|
-
staleTime = 0,
|
|
90
|
-
cacheTime = 3e5,
|
|
91
|
-
enabled = true,
|
|
92
|
-
retry: retryOptions,
|
|
93
|
-
initialData,
|
|
94
|
-
refetchInterval,
|
|
95
|
-
refetchOnWindowFocus = false,
|
|
96
|
-
refetchOnReconnect = false,
|
|
97
|
-
onSuccess,
|
|
98
|
-
onError,
|
|
99
|
-
onSettled
|
|
100
|
-
} = options;
|
|
101
|
-
const resolveKey = typeof key === "function" ? key : () => key;
|
|
102
|
-
const [data, setData] = signal(initialData);
|
|
103
|
-
const [isFetching, setIsFetching] = signal(false);
|
|
104
|
-
const [error, setError] = signal(void 0);
|
|
105
|
-
let abortController = null;
|
|
106
|
-
let disposed = false;
|
|
107
|
-
let currentKey = null;
|
|
108
|
-
let intervalTimer = null;
|
|
109
|
-
const loading = derived(() => isFetching() && data() === void 0);
|
|
110
|
-
const isStale = derived(() => {
|
|
111
|
-
data();
|
|
112
|
-
if (!currentKey) return true;
|
|
113
|
-
const entry = queryCache.get(currentKey);
|
|
114
|
-
if (!entry || entry.dataUpdatedAt === 0) return true;
|
|
115
|
-
return Date.now() - entry.dataUpdatedAt >= staleTime;
|
|
116
|
-
});
|
|
117
|
-
async function doFetch() {
|
|
118
|
-
if (disposed || !currentKey || !enabled) return;
|
|
119
|
-
const key2 = currentKey;
|
|
120
|
-
const entry = queryCache.get(key2);
|
|
121
|
-
if (!entry) return;
|
|
122
|
-
if (entry.promise) {
|
|
123
|
-
setIsFetching(true);
|
|
124
|
-
try {
|
|
125
|
-
await entry.promise;
|
|
126
|
-
} catch {
|
|
127
|
-
}
|
|
128
|
-
onCacheUpdate();
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
abortController?.abort();
|
|
132
|
-
abortController = new AbortController();
|
|
133
|
-
const signal2 = abortController.signal;
|
|
134
|
-
setIsFetching(true);
|
|
135
|
-
const promise = withRetry(() => fetcher({ signal: signal2, key: key2 }), retryOptions, void 0, signal2);
|
|
136
|
-
entry.promise = promise;
|
|
137
|
-
try {
|
|
138
|
-
const result = await promise;
|
|
139
|
-
entry.promise = null;
|
|
140
|
-
if (disposed || currentKey !== key2) return;
|
|
141
|
-
entry.data = result;
|
|
142
|
-
entry.dataUpdatedAt = Date.now();
|
|
143
|
-
entry.error = void 0;
|
|
144
|
-
batch(() => {
|
|
145
|
-
setData(result);
|
|
146
|
-
setIsFetching(false);
|
|
147
|
-
setError(void 0);
|
|
148
|
-
});
|
|
149
|
-
for (const listener of entry.listeners) listener();
|
|
150
|
-
onSuccess?.(result);
|
|
151
|
-
} catch (err) {
|
|
152
|
-
entry.promise = null;
|
|
153
|
-
if (disposed || currentKey !== key2) return;
|
|
154
|
-
if (err instanceof DOMException && err.name === "AbortError") return;
|
|
155
|
-
const errorObj = err instanceof Error ? err : new Error(String(err));
|
|
156
|
-
entry.error = errorObj;
|
|
157
|
-
batch(() => {
|
|
158
|
-
setError(errorObj);
|
|
159
|
-
setIsFetching(false);
|
|
160
|
-
});
|
|
161
|
-
for (const listener of entry.listeners) listener();
|
|
162
|
-
onError?.(errorObj);
|
|
163
|
-
} finally {
|
|
164
|
-
if (!disposed && currentKey === key2) onSettled?.();
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
function onCacheUpdate() {
|
|
168
|
-
if (disposed || !currentKey) return;
|
|
169
|
-
const entry = queryCache.get(currentKey);
|
|
170
|
-
if (!entry) return;
|
|
171
|
-
batch(() => {
|
|
172
|
-
if (entry.data !== void 0) setData(entry.data);
|
|
173
|
-
setError(entry.error);
|
|
174
|
-
if (!entry.promise) setIsFetching(false);
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
const effectCleanup = effect(() => {
|
|
178
|
-
const key2 = resolveKey();
|
|
179
|
-
if (currentKey !== null && currentKey !== key2) {
|
|
180
|
-
const oldEntry = queryCache.get(currentKey);
|
|
181
|
-
if (oldEntry) {
|
|
182
|
-
oldEntry.listeners.delete(onCacheUpdate);
|
|
183
|
-
oldEntry.refetchers.delete(doFetch);
|
|
184
|
-
oldEntry.subscribers--;
|
|
185
|
-
if (oldEntry.subscribers <= 0 && cacheTime >= 0) {
|
|
186
|
-
const oldKey = currentKey;
|
|
187
|
-
oldEntry.gcTimer = setTimeout(() => queryCache.delete(oldKey), cacheTime);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
currentKey = key2;
|
|
192
|
-
const entry = getOrCreateEntry(key2, initialData);
|
|
193
|
-
entry.subscribers++;
|
|
194
|
-
if (entry.gcTimer !== null) {
|
|
195
|
-
clearTimeout(entry.gcTimer);
|
|
196
|
-
entry.gcTimer = null;
|
|
197
|
-
}
|
|
198
|
-
entry.listeners.add(onCacheUpdate);
|
|
199
|
-
entry.refetchers.add(doFetch);
|
|
200
|
-
if (entry.data !== void 0) {
|
|
201
|
-
batch(() => {
|
|
202
|
-
setData(entry.data);
|
|
203
|
-
setError(entry.error);
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
const isDataStale = entry.dataUpdatedAt === 0 || Date.now() - entry.dataUpdatedAt >= staleTime;
|
|
207
|
-
if (enabled && (entry.data === void 0 || isDataStale)) {
|
|
208
|
-
doFetch();
|
|
209
|
-
}
|
|
210
|
-
});
|
|
211
|
-
if (refetchInterval && refetchInterval > 0) {
|
|
212
|
-
intervalTimer = setInterval(() => {
|
|
213
|
-
if (!disposed && currentKey && enabled) doFetch();
|
|
214
|
-
}, refetchInterval);
|
|
215
|
-
}
|
|
216
|
-
let focusHandler = null;
|
|
217
|
-
let onlineHandler = null;
|
|
218
|
-
if (typeof globalThis !== "undefined" && typeof globalThis.addEventListener === "function") {
|
|
219
|
-
if (refetchOnWindowFocus) {
|
|
220
|
-
focusHandler = () => {
|
|
221
|
-
if (!disposed && currentKey && enabled) doFetch();
|
|
222
|
-
};
|
|
223
|
-
globalThis.addEventListener("focus", focusHandler);
|
|
224
|
-
}
|
|
225
|
-
if (refetchOnReconnect) {
|
|
226
|
-
onlineHandler = () => {
|
|
227
|
-
if (!disposed && currentKey && enabled) doFetch();
|
|
228
|
-
};
|
|
229
|
-
globalThis.addEventListener("online", onlineHandler);
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
function dispose() {
|
|
233
|
-
disposed = true;
|
|
234
|
-
abortController?.abort();
|
|
235
|
-
effectCleanup();
|
|
236
|
-
if (intervalTimer) clearInterval(intervalTimer);
|
|
237
|
-
if (currentKey) {
|
|
238
|
-
const entry = queryCache.get(currentKey);
|
|
239
|
-
if (entry) {
|
|
240
|
-
entry.listeners.delete(onCacheUpdate);
|
|
241
|
-
entry.refetchers.delete(doFetch);
|
|
242
|
-
entry.subscribers--;
|
|
243
|
-
if (entry.subscribers <= 0 && cacheTime >= 0) {
|
|
244
|
-
const key2 = currentKey;
|
|
245
|
-
entry.gcTimer = setTimeout(() => queryCache.delete(key2), cacheTime);
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
if (focusHandler) globalThis.removeEventListener("focus", focusHandler);
|
|
250
|
-
if (onlineHandler) globalThis.removeEventListener("online", onlineHandler);
|
|
251
|
-
}
|
|
252
|
-
return {
|
|
253
|
-
data,
|
|
254
|
-
loading,
|
|
255
|
-
fetching: isFetching,
|
|
256
|
-
error,
|
|
257
|
-
isStale,
|
|
258
|
-
refetch: doFetch,
|
|
259
|
-
dispose
|
|
260
|
-
};
|
|
261
|
-
}
|
|
262
|
-
function invalidateQueries(keyOrPredicate) {
|
|
263
|
-
const predicate = typeof keyOrPredicate === "function" ? keyOrPredicate : (k) => k === keyOrPredicate;
|
|
264
|
-
for (const [key, entry] of queryCache.entries()) {
|
|
265
|
-
if (predicate(key)) {
|
|
266
|
-
entry.dataUpdatedAt = 0;
|
|
267
|
-
for (const refetcher of entry.refetchers) refetcher();
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
function getQueryData(key) {
|
|
272
|
-
return queryCache.get(key)?.data;
|
|
273
|
-
}
|
|
274
|
-
function setQueryData(key, data) {
|
|
275
|
-
const entry = queryCache.get(key);
|
|
276
|
-
if (!entry) return;
|
|
277
|
-
const newData = typeof data === "function" ? data(entry.data) : data;
|
|
278
|
-
entry.data = newData;
|
|
279
|
-
entry.dataUpdatedAt = Date.now();
|
|
280
|
-
for (const listener of entry.listeners) listener();
|
|
281
|
-
}
|
|
282
|
-
function clearQueryCache() {
|
|
283
|
-
for (const entry of queryCache.values()) {
|
|
284
|
-
if (entry.gcTimer) clearTimeout(entry.gcTimer);
|
|
285
|
-
}
|
|
286
|
-
queryCache.clear();
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
// src/data/mutation.ts
|
|
290
|
-
function mutation(mutationFn, options = {}) {
|
|
291
|
-
const [data, setData] = signal(void 0);
|
|
292
|
-
const [loading, setLoading] = signal(false);
|
|
293
|
-
const [error, setError] = signal(void 0);
|
|
294
|
-
const [status, setStatus] = signal("idle");
|
|
295
|
-
const isSuccess = derived(() => status() === "success");
|
|
296
|
-
const isIdle = derived(() => status() === "idle");
|
|
297
|
-
async function execute(variables) {
|
|
298
|
-
let context2;
|
|
299
|
-
batch(() => {
|
|
300
|
-
setLoading(true);
|
|
301
|
-
setError(void 0);
|
|
302
|
-
setStatus("loading");
|
|
303
|
-
});
|
|
304
|
-
try {
|
|
305
|
-
if (options.onMutate) {
|
|
306
|
-
context2 = await options.onMutate(variables);
|
|
307
|
-
}
|
|
308
|
-
const result = await withRetry(() => mutationFn(variables), options.retry);
|
|
309
|
-
batch(() => {
|
|
310
|
-
setData(result);
|
|
311
|
-
setLoading(false);
|
|
312
|
-
setStatus("success");
|
|
313
|
-
});
|
|
314
|
-
options.onSuccess?.(result, variables, context2);
|
|
315
|
-
options.onSettled?.(result, void 0, variables, context2);
|
|
316
|
-
return result;
|
|
317
|
-
} catch (err) {
|
|
318
|
-
const errorObj = err instanceof Error ? err : new Error(String(err));
|
|
319
|
-
batch(() => {
|
|
320
|
-
setError(errorObj);
|
|
321
|
-
setLoading(false);
|
|
322
|
-
setStatus("error");
|
|
323
|
-
});
|
|
324
|
-
options.onError?.(errorObj, variables, context2);
|
|
325
|
-
options.onSettled?.(void 0, errorObj, variables, context2);
|
|
326
|
-
throw errorObj;
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
function reset() {
|
|
330
|
-
batch(() => {
|
|
331
|
-
setData(void 0);
|
|
332
|
-
setError(void 0);
|
|
333
|
-
setLoading(false);
|
|
334
|
-
setStatus("idle");
|
|
335
|
-
});
|
|
336
|
-
}
|
|
337
|
-
return {
|
|
338
|
-
data,
|
|
339
|
-
loading,
|
|
340
|
-
error,
|
|
341
|
-
isSuccess,
|
|
342
|
-
isIdle,
|
|
343
|
-
mutate: (variables) => {
|
|
344
|
-
execute(variables).catch(() => {
|
|
345
|
-
});
|
|
346
|
-
},
|
|
347
|
-
mutateAsync: execute,
|
|
348
|
-
reset
|
|
349
|
-
};
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
// src/data/infiniteQuery.ts
|
|
353
|
-
function infiniteQuery(key, fetcher, options) {
|
|
354
|
-
const {
|
|
355
|
-
getNextPageParam,
|
|
356
|
-
getPreviousPageParam,
|
|
357
|
-
initialPageParam = 0,
|
|
358
|
-
enabled = true,
|
|
359
|
-
retry: retryOptions,
|
|
360
|
-
onSuccess,
|
|
361
|
-
onError
|
|
362
|
-
} = options;
|
|
363
|
-
const resolveKey = typeof key === "function" ? key : () => key;
|
|
364
|
-
const [pages, setPages] = signal([]);
|
|
365
|
-
const [isFetching, setIsFetching] = signal(false);
|
|
366
|
-
const [isFetchingNext, setIsFetchingNext] = signal(false);
|
|
367
|
-
const [isFetchingPrev, setIsFetchingPrev] = signal(false);
|
|
368
|
-
const [error, setError] = signal(void 0);
|
|
369
|
-
const [nextPageParam, setNextPageParam] = signal(initialPageParam);
|
|
370
|
-
const [prevPageParam, setPrevPageParam] = signal(void 0);
|
|
371
|
-
const data = derived(() => {
|
|
372
|
-
const p = pages();
|
|
373
|
-
return p.length > 0 ? p : void 0;
|
|
374
|
-
});
|
|
375
|
-
const loading = derived(() => isFetching() && pages().length === 0);
|
|
376
|
-
const hasNextPage = derived(() => nextPageParam() !== void 0);
|
|
377
|
-
const hasPreviousPage = derived(() => prevPageParam() !== void 0);
|
|
378
|
-
let abortController = null;
|
|
379
|
-
let disposed = false;
|
|
380
|
-
async function fetchPage(pageParam, direction) {
|
|
381
|
-
if (disposed) return;
|
|
382
|
-
abortController?.abort();
|
|
383
|
-
abortController = new AbortController();
|
|
384
|
-
const signal2 = abortController.signal;
|
|
385
|
-
batch(() => {
|
|
386
|
-
setIsFetching(true);
|
|
387
|
-
if (direction === "next") setIsFetchingNext(true);
|
|
388
|
-
if (direction === "prev") setIsFetchingPrev(true);
|
|
389
|
-
setError(void 0);
|
|
390
|
-
});
|
|
391
|
-
try {
|
|
392
|
-
const page = await withRetry(() => fetcher({ signal: signal2, pageParam }), retryOptions, void 0, signal2);
|
|
393
|
-
if (disposed) return;
|
|
394
|
-
const currentPages = pages();
|
|
395
|
-
let newPages;
|
|
396
|
-
if (direction === "prev") {
|
|
397
|
-
newPages = [page, ...currentPages];
|
|
398
|
-
} else {
|
|
399
|
-
newPages = [...currentPages, page];
|
|
400
|
-
}
|
|
401
|
-
const nextParam = getNextPageParam(page, newPages);
|
|
402
|
-
const prevParam = getPreviousPageParam?.(newPages[0], newPages);
|
|
403
|
-
batch(() => {
|
|
404
|
-
setPages(newPages);
|
|
405
|
-
setNextPageParam(nextParam);
|
|
406
|
-
setPrevPageParam(prevParam);
|
|
407
|
-
setIsFetching(false);
|
|
408
|
-
setIsFetchingNext(false);
|
|
409
|
-
setIsFetchingPrev(false);
|
|
410
|
-
});
|
|
411
|
-
onSuccess?.(newPages);
|
|
412
|
-
} catch (err) {
|
|
413
|
-
if (disposed) return;
|
|
414
|
-
if (err instanceof DOMException && err.name === "AbortError") return;
|
|
415
|
-
const errorObj = err instanceof Error ? err : new Error(String(err));
|
|
416
|
-
batch(() => {
|
|
417
|
-
setError(errorObj);
|
|
418
|
-
setIsFetching(false);
|
|
419
|
-
setIsFetchingNext(false);
|
|
420
|
-
setIsFetchingPrev(false);
|
|
421
|
-
});
|
|
422
|
-
onError?.(errorObj);
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
const effectCleanup = effect(() => {
|
|
426
|
-
resolveKey();
|
|
427
|
-
if (enabled) {
|
|
428
|
-
setPages([]);
|
|
429
|
-
setNextPageParam(initialPageParam);
|
|
430
|
-
setPrevPageParam(void 0);
|
|
431
|
-
fetchPage(initialPageParam, "initial");
|
|
432
|
-
}
|
|
433
|
-
});
|
|
434
|
-
function fetchNextPage() {
|
|
435
|
-
const param = nextPageParam();
|
|
436
|
-
if (param === void 0) return Promise.resolve();
|
|
437
|
-
return fetchPage(param, "next");
|
|
438
|
-
}
|
|
439
|
-
function fetchPreviousPage() {
|
|
440
|
-
const param = prevPageParam();
|
|
441
|
-
if (param === void 0) return Promise.resolve();
|
|
442
|
-
return fetchPage(param, "prev");
|
|
443
|
-
}
|
|
444
|
-
async function refetch() {
|
|
445
|
-
batch(() => {
|
|
446
|
-
setPages([]);
|
|
447
|
-
setNextPageParam(initialPageParam);
|
|
448
|
-
setPrevPageParam(void 0);
|
|
449
|
-
});
|
|
450
|
-
await fetchPage(initialPageParam, "initial");
|
|
451
|
-
}
|
|
452
|
-
function dispose() {
|
|
453
|
-
disposed = true;
|
|
454
|
-
abortController?.abort();
|
|
455
|
-
effectCleanup();
|
|
456
|
-
}
|
|
457
|
-
return {
|
|
458
|
-
data,
|
|
459
|
-
pages,
|
|
460
|
-
loading,
|
|
461
|
-
fetching: isFetching,
|
|
462
|
-
fetchingNextPage: isFetchingNext,
|
|
463
|
-
fetchingPreviousPage: isFetchingPrev,
|
|
464
|
-
error,
|
|
465
|
-
hasNextPage,
|
|
466
|
-
hasPreviousPage,
|
|
467
|
-
fetchNextPage,
|
|
468
|
-
fetchPreviousPage,
|
|
469
|
-
refetch,
|
|
470
|
-
dispose
|
|
471
|
-
};
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
// src/data/previous.ts
|
|
475
|
-
function previous(getter) {
|
|
476
|
-
const [previous2, setPrevious] = signal(void 0);
|
|
477
|
-
let current = getter();
|
|
478
|
-
effect(() => {
|
|
479
|
-
const next = getter();
|
|
480
|
-
if (!Object.is(next, current)) {
|
|
481
|
-
setPrevious(current);
|
|
482
|
-
current = next;
|
|
483
|
-
}
|
|
484
|
-
});
|
|
485
|
-
return previous2;
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
// src/data/debounce.ts
|
|
489
|
-
function debounce(getter, delay) {
|
|
490
|
-
const [debounced, setDebounced] = signal(getter());
|
|
491
|
-
let timer = null;
|
|
492
|
-
effect(() => {
|
|
493
|
-
const value = getter();
|
|
494
|
-
if (timer !== null) clearTimeout(timer);
|
|
495
|
-
timer = setTimeout(() => {
|
|
496
|
-
setDebounced(value);
|
|
497
|
-
timer = null;
|
|
498
|
-
}, delay);
|
|
499
|
-
});
|
|
500
|
-
return debounced;
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
// src/data/throttle.ts
|
|
504
|
-
function throttle(getter, interval) {
|
|
505
|
-
const [throttled, setThrottled] = signal(getter());
|
|
506
|
-
let cooldown = false;
|
|
507
|
-
let pending = null;
|
|
508
|
-
let lastEmitted = getter();
|
|
509
|
-
effect(() => {
|
|
510
|
-
const value = getter();
|
|
511
|
-
if (!cooldown) {
|
|
512
|
-
if (!Object.is(value, lastEmitted)) {
|
|
513
|
-
setThrottled(value);
|
|
514
|
-
lastEmitted = value;
|
|
515
|
-
cooldown = true;
|
|
516
|
-
pending = null;
|
|
517
|
-
setTimeout(() => {
|
|
518
|
-
cooldown = false;
|
|
519
|
-
if (pending !== null) {
|
|
520
|
-
const trailingValue = pending.value;
|
|
521
|
-
pending = null;
|
|
522
|
-
setThrottled(trailingValue);
|
|
523
|
-
lastEmitted = trailingValue;
|
|
524
|
-
}
|
|
525
|
-
}, interval);
|
|
526
|
-
}
|
|
527
|
-
} else {
|
|
528
|
-
pending = { value };
|
|
529
|
-
}
|
|
530
|
-
});
|
|
531
|
-
return throttled;
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
// src/data/resource.ts
|
|
535
|
-
function resource(sourceOrFetcher, fetcherOrOptions, maybeOptions) {
|
|
536
|
-
let source = null;
|
|
537
|
-
let fetcher;
|
|
538
|
-
let options;
|
|
539
|
-
if (typeof fetcherOrOptions === "function") {
|
|
540
|
-
source = sourceOrFetcher;
|
|
541
|
-
fetcher = fetcherOrOptions;
|
|
542
|
-
options = maybeOptions ?? {};
|
|
543
|
-
} else {
|
|
544
|
-
const rawFetcher = sourceOrFetcher;
|
|
545
|
-
fetcher = (_source, info) => rawFetcher(info);
|
|
546
|
-
options = fetcherOrOptions ?? {};
|
|
547
|
-
}
|
|
548
|
-
const [data, setData] = signal(options.initialValue);
|
|
549
|
-
const [loading, setLoading] = signal(false);
|
|
550
|
-
const [error, setError] = signal(void 0);
|
|
551
|
-
let currentData = options.initialValue;
|
|
552
|
-
let abortController = null;
|
|
553
|
-
let disposed = false;
|
|
554
|
-
let effectCleanup = null;
|
|
555
|
-
let fetchVersion = 0;
|
|
556
|
-
async function doFetch(sourceValue) {
|
|
557
|
-
if (disposed) return;
|
|
558
|
-
abortController?.abort();
|
|
559
|
-
abortController = new AbortController();
|
|
560
|
-
const version = ++fetchVersion;
|
|
561
|
-
const signal2 = abortController.signal;
|
|
562
|
-
const prev = currentData;
|
|
563
|
-
batch(() => {
|
|
564
|
-
setLoading(true);
|
|
565
|
-
setError(void 0);
|
|
566
|
-
});
|
|
567
|
-
options.onStart?.();
|
|
568
|
-
try {
|
|
569
|
-
const result = await withRetry(() => fetcher(sourceValue, { signal: signal2, prev }), options.retry, void 0, signal2);
|
|
570
|
-
if (version !== fetchVersion || disposed) return;
|
|
571
|
-
currentData = result;
|
|
572
|
-
batch(() => {
|
|
573
|
-
setData(result);
|
|
574
|
-
setLoading(false);
|
|
575
|
-
});
|
|
576
|
-
options.onSuccess?.(result);
|
|
577
|
-
} catch (err) {
|
|
578
|
-
if (version !== fetchVersion || disposed) return;
|
|
579
|
-
if (err instanceof DOMException && err.name === "AbortError") return;
|
|
580
|
-
const errorObj = err instanceof Error ? err : new Error(String(err));
|
|
581
|
-
batch(() => {
|
|
582
|
-
setError(errorObj);
|
|
583
|
-
setLoading(false);
|
|
584
|
-
});
|
|
585
|
-
options.onError?.(errorObj);
|
|
586
|
-
} finally {
|
|
587
|
-
if (version === fetchVersion) {
|
|
588
|
-
options.onSettled?.();
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
if (source) {
|
|
593
|
-
effectCleanup = effect(() => {
|
|
594
|
-
const sourceValue = source();
|
|
595
|
-
doFetch(sourceValue);
|
|
596
|
-
});
|
|
597
|
-
} else if (options.immediate !== false) {
|
|
598
|
-
doFetch(void 0);
|
|
599
|
-
}
|
|
600
|
-
return {
|
|
601
|
-
data,
|
|
602
|
-
loading,
|
|
603
|
-
error,
|
|
604
|
-
refetch: () => doFetch(source ? source() : void 0),
|
|
605
|
-
mutate: (value) => {
|
|
606
|
-
const newValue = typeof value === "function" ? value(currentData) : value;
|
|
607
|
-
currentData = newValue;
|
|
608
|
-
setData(newValue);
|
|
609
|
-
},
|
|
610
|
-
abort: () => abortController?.abort(),
|
|
611
|
-
dispose: () => {
|
|
612
|
-
disposed = true;
|
|
613
|
-
abortController?.abort();
|
|
614
|
-
effectCleanup?.();
|
|
615
|
-
}
|
|
616
|
-
};
|
|
617
|
-
}
|
|
618
|
-
|
|
619
|
-
// src/data/offlineStore.ts
|
|
620
|
-
function openDB(name, version, keyPath) {
|
|
621
|
-
return new Promise((resolve, reject) => {
|
|
622
|
-
const request = indexedDB.open(name, version);
|
|
623
|
-
request.onerror = () => reject(request.error);
|
|
624
|
-
request.onsuccess = () => resolve(request.result);
|
|
625
|
-
request.onupgradeneeded = () => {
|
|
626
|
-
const db = request.result;
|
|
627
|
-
if (!db.objectStoreNames.contains("items")) {
|
|
628
|
-
db.createObjectStore("items", { keyPath });
|
|
629
|
-
}
|
|
630
|
-
if (!db.objectStoreNames.contains("_changes")) {
|
|
631
|
-
const changeStore = db.createObjectStore("_changes", { autoIncrement: true });
|
|
632
|
-
changeStore.createIndex("timestamp", "timestamp");
|
|
633
|
-
}
|
|
634
|
-
if (!db.objectStoreNames.contains("_meta")) {
|
|
635
|
-
db.createObjectStore("_meta");
|
|
636
|
-
}
|
|
637
|
-
};
|
|
638
|
-
});
|
|
639
|
-
}
|
|
640
|
-
function idbGetAll(db, store) {
|
|
641
|
-
return new Promise((resolve, reject) => {
|
|
642
|
-
const tx = db.transaction(store, "readonly");
|
|
643
|
-
const req = tx.objectStore(store).getAll();
|
|
644
|
-
req.onsuccess = () => resolve(req.result);
|
|
645
|
-
req.onerror = () => reject(req.error);
|
|
646
|
-
});
|
|
647
|
-
}
|
|
648
|
-
function idbGet(db, store, key) {
|
|
649
|
-
return new Promise((resolve, reject) => {
|
|
650
|
-
const tx = db.transaction(store, "readonly");
|
|
651
|
-
const req = tx.objectStore(store).get(key);
|
|
652
|
-
req.onsuccess = () => resolve(req.result);
|
|
653
|
-
req.onerror = () => reject(req.error);
|
|
654
|
-
});
|
|
655
|
-
}
|
|
656
|
-
function idbPut(db, store, item) {
|
|
657
|
-
return new Promise((resolve, reject) => {
|
|
658
|
-
const tx = db.transaction(store, "readwrite");
|
|
659
|
-
tx.objectStore(store).put(item);
|
|
660
|
-
tx.oncomplete = () => resolve();
|
|
661
|
-
tx.onerror = () => reject(tx.error);
|
|
662
|
-
});
|
|
663
|
-
}
|
|
664
|
-
function idbDelete(db, store, key) {
|
|
665
|
-
return new Promise((resolve, reject) => {
|
|
666
|
-
const tx = db.transaction(store, "readwrite");
|
|
667
|
-
tx.objectStore(store).delete(key);
|
|
668
|
-
tx.oncomplete = () => resolve();
|
|
669
|
-
tx.onerror = () => reject(tx.error);
|
|
670
|
-
});
|
|
671
|
-
}
|
|
672
|
-
function idbClear(db, store) {
|
|
673
|
-
return new Promise((resolve, reject) => {
|
|
674
|
-
const tx = db.transaction(store, "readwrite");
|
|
675
|
-
tx.objectStore(store).clear();
|
|
676
|
-
tx.oncomplete = () => resolve();
|
|
677
|
-
tx.onerror = () => reject(tx.error);
|
|
678
|
-
});
|
|
679
|
-
}
|
|
680
|
-
async function offlineStore(options) {
|
|
681
|
-
const { name, version = 1, keyPath = "id", autoSync = true } = options;
|
|
682
|
-
const db = await openDB(name, version, keyPath);
|
|
683
|
-
const initialData = await idbGetAll(db, "items");
|
|
684
|
-
const initialChanges = await idbGetAll(db, "_changes");
|
|
685
|
-
const savedLastSync = await idbGet(db, "_meta", "lastSynced");
|
|
686
|
-
const [data, setData] = signal(initialData);
|
|
687
|
-
const [isSyncing, setIsSyncing] = signal(false);
|
|
688
|
-
const [lastSynced, setLastSynced] = signal(savedLastSync ?? null);
|
|
689
|
-
const [pendingCount, setPendingCount] = signal(initialChanges.length);
|
|
690
|
-
let adapter = options.adapter;
|
|
691
|
-
async function refreshData() {
|
|
692
|
-
const items = await idbGetAll(db, "items");
|
|
693
|
-
setData(items);
|
|
694
|
-
const changes = await idbGetAll(db, "_changes");
|
|
695
|
-
setPendingCount(changes.length);
|
|
696
|
-
}
|
|
697
|
-
async function put(item) {
|
|
698
|
-
await idbPut(db, "items", item);
|
|
699
|
-
await idbPut(db, "_changes", { type: "put", item, timestamp: Date.now() });
|
|
700
|
-
await refreshData();
|
|
701
|
-
}
|
|
702
|
-
async function remove(key) {
|
|
703
|
-
const existing = await idbGet(db, "items", key);
|
|
704
|
-
if (existing) {
|
|
705
|
-
await idbDelete(db, "items", key);
|
|
706
|
-
await idbPut(db, "_changes", { type: "delete", item: existing, timestamp: Date.now() });
|
|
707
|
-
await refreshData();
|
|
708
|
-
}
|
|
709
|
-
}
|
|
710
|
-
async function get(key) {
|
|
711
|
-
return idbGet(db, "items", key);
|
|
712
|
-
}
|
|
713
|
-
function query2(filter) {
|
|
714
|
-
return data().filter(filter);
|
|
715
|
-
}
|
|
716
|
-
async function sync() {
|
|
717
|
-
if (!adapter || isSyncing()) return;
|
|
718
|
-
setIsSyncing(true);
|
|
719
|
-
try {
|
|
720
|
-
const changes = await idbGetAll(db, "_changes");
|
|
721
|
-
if (changes.length > 0) {
|
|
722
|
-
const result = await adapter.push(changes);
|
|
723
|
-
if (result.ok) {
|
|
724
|
-
await idbClear(db, "_changes");
|
|
725
|
-
}
|
|
726
|
-
}
|
|
727
|
-
const remoteItems = await adapter.pull(lastSynced());
|
|
728
|
-
for (const item of remoteItems) {
|
|
729
|
-
await idbPut(db, "items", item);
|
|
730
|
-
}
|
|
731
|
-
const now = Date.now();
|
|
732
|
-
await idbPut(db, "_meta", now);
|
|
733
|
-
setLastSynced(now);
|
|
734
|
-
await refreshData();
|
|
735
|
-
} catch {
|
|
736
|
-
} finally {
|
|
737
|
-
setIsSyncing(false);
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
function attach(newAdapter) {
|
|
741
|
-
adapter = newAdapter;
|
|
742
|
-
}
|
|
743
|
-
function close() {
|
|
744
|
-
db.close();
|
|
745
|
-
}
|
|
746
|
-
if (autoSync && typeof window !== "undefined") {
|
|
747
|
-
window.addEventListener("online", () => {
|
|
748
|
-
sync();
|
|
749
|
-
});
|
|
750
|
-
}
|
|
751
|
-
return {
|
|
752
|
-
data,
|
|
753
|
-
get,
|
|
754
|
-
put,
|
|
755
|
-
remove,
|
|
756
|
-
query: query2,
|
|
757
|
-
isSyncing,
|
|
758
|
-
lastSynced,
|
|
759
|
-
sync,
|
|
760
|
-
attach,
|
|
761
|
-
pendingCount,
|
|
762
|
-
close
|
|
763
|
-
};
|
|
764
|
-
}
|
|
765
|
-
function syncAdapter(config) {
|
|
766
|
-
return config;
|
|
767
|
-
}
|
|
768
|
-
|
|
769
|
-
// src/data/routeLoader.ts
|
|
770
|
-
var LoaderContext = context(null);
|
|
771
|
-
function executeLoader(loader, context2, options) {
|
|
772
|
-
const res = resource(({ signal: signal2 }) => loader(context2, { signal: signal2 }), options);
|
|
773
|
-
LoaderContext.provide(res);
|
|
774
|
-
return res;
|
|
775
|
-
}
|
|
776
|
-
function loaderData() {
|
|
777
|
-
const resource2 = LoaderContext.get();
|
|
778
|
-
if (!resource2) {
|
|
779
|
-
throw new Error("loaderData must be used inside a route with a loader");
|
|
780
|
-
}
|
|
781
|
-
return {
|
|
782
|
-
data: resource2.data,
|
|
783
|
-
loading: resource2.loading,
|
|
784
|
-
error: resource2.error
|
|
785
|
-
};
|
|
786
|
-
}
|
|
787
|
-
async function preloadRoute(route, context2) {
|
|
788
|
-
if (!route.loader) return void 0;
|
|
789
|
-
const controller = new AbortController();
|
|
790
|
-
return route.loader(context2, { signal: controller.signal });
|
|
791
|
-
}
|
|
792
|
-
|
|
793
|
-
// src/ui/socket.ts
|
|
794
|
-
function socket(url, options) {
|
|
795
|
-
const autoReconnect = options?.autoReconnect ?? false;
|
|
796
|
-
const reconnectDelay = options?.reconnectDelay ?? 1e3;
|
|
797
|
-
const maxReconnects = options?.maxReconnects ?? Infinity;
|
|
798
|
-
const heartbeat = options?.heartbeat;
|
|
799
|
-
const protocols = options?.protocols;
|
|
800
|
-
const [data, setData] = signal(null);
|
|
801
|
-
const [status, setStatus] = signal("closed");
|
|
802
|
-
let ws = null;
|
|
803
|
-
let reconnectCount = 0;
|
|
804
|
-
let reconnectTimer = null;
|
|
805
|
-
let heartbeatTimer = null;
|
|
806
|
-
let disposed = false;
|
|
807
|
-
function getUrl() {
|
|
808
|
-
return typeof url === "function" ? url() : url;
|
|
809
|
-
}
|
|
810
|
-
function connect() {
|
|
811
|
-
if (disposed) return;
|
|
812
|
-
setStatus("connecting");
|
|
813
|
-
ws = new WebSocket(getUrl(), protocols);
|
|
814
|
-
ws.onopen = () => {
|
|
815
|
-
setStatus("open");
|
|
816
|
-
reconnectCount = 0;
|
|
817
|
-
startHeartbeat();
|
|
818
|
-
};
|
|
819
|
-
ws.onmessage = (event) => {
|
|
820
|
-
setData(event.data);
|
|
821
|
-
};
|
|
822
|
-
ws.onclose = () => {
|
|
823
|
-
setStatus("closed");
|
|
824
|
-
stopHeartbeat();
|
|
825
|
-
if (autoReconnect && !disposed && reconnectCount < maxReconnects) {
|
|
826
|
-
reconnectCount++;
|
|
827
|
-
reconnectTimer = setTimeout(() => {
|
|
828
|
-
connect();
|
|
829
|
-
}, reconnectDelay);
|
|
830
|
-
}
|
|
831
|
-
};
|
|
832
|
-
ws.onerror = () => {
|
|
833
|
-
};
|
|
834
|
-
}
|
|
835
|
-
function startHeartbeat() {
|
|
836
|
-
if (!heartbeat) return;
|
|
837
|
-
stopHeartbeat();
|
|
838
|
-
heartbeatTimer = setInterval(() => {
|
|
839
|
-
if (ws && ws.readyState === WebSocket.OPEN) {
|
|
840
|
-
ws.send(heartbeat.message);
|
|
841
|
-
}
|
|
842
|
-
}, heartbeat.interval);
|
|
843
|
-
}
|
|
844
|
-
function stopHeartbeat() {
|
|
845
|
-
if (heartbeatTimer !== null) {
|
|
846
|
-
clearInterval(heartbeatTimer);
|
|
847
|
-
heartbeatTimer = null;
|
|
848
|
-
}
|
|
849
|
-
}
|
|
850
|
-
function send(msg) {
|
|
851
|
-
if (ws && ws.readyState === WebSocket.OPEN) {
|
|
852
|
-
ws.send(msg);
|
|
853
|
-
}
|
|
854
|
-
}
|
|
855
|
-
function close() {
|
|
856
|
-
if (reconnectTimer !== null) {
|
|
857
|
-
clearTimeout(reconnectTimer);
|
|
858
|
-
reconnectTimer = null;
|
|
859
|
-
}
|
|
860
|
-
stopHeartbeat();
|
|
861
|
-
if (ws) {
|
|
862
|
-
setStatus("closing");
|
|
863
|
-
ws.close();
|
|
864
|
-
}
|
|
865
|
-
}
|
|
866
|
-
function dispose() {
|
|
867
|
-
disposed = true;
|
|
868
|
-
close();
|
|
869
|
-
}
|
|
870
|
-
connect();
|
|
871
|
-
return { data, status, send, close, dispose };
|
|
872
|
-
}
|
|
873
|
-
|
|
874
|
-
// src/ui/stream.ts
|
|
875
|
-
function stream(url, options) {
|
|
876
|
-
const autoReconnect = options?.autoReconnect ?? false;
|
|
877
|
-
const [data, setData] = signal(null);
|
|
878
|
-
const [event, setEvent] = signal(null);
|
|
879
|
-
const [status, setStatus] = signal("connecting");
|
|
880
|
-
let source = null;
|
|
881
|
-
let disposed = false;
|
|
882
|
-
let reconnectTimer = null;
|
|
883
|
-
function connect() {
|
|
884
|
-
if (disposed) return;
|
|
885
|
-
setStatus("connecting");
|
|
886
|
-
source = new EventSource(url, {
|
|
887
|
-
withCredentials: options?.withCredentials ?? false
|
|
888
|
-
});
|
|
889
|
-
source.onopen = () => {
|
|
890
|
-
setStatus("open");
|
|
891
|
-
};
|
|
892
|
-
source.onmessage = (evt) => {
|
|
893
|
-
setData(evt.data);
|
|
894
|
-
setEvent(evt.type);
|
|
895
|
-
};
|
|
896
|
-
source.onerror = () => {
|
|
897
|
-
if (source && source.readyState === EventSource.CLOSED) {
|
|
898
|
-
setStatus("closed");
|
|
899
|
-
source = null;
|
|
900
|
-
if (autoReconnect && !disposed) {
|
|
901
|
-
reconnectTimer = setTimeout(() => {
|
|
902
|
-
reconnectTimer = null;
|
|
903
|
-
connect();
|
|
904
|
-
}, 1e3);
|
|
905
|
-
}
|
|
906
|
-
}
|
|
907
|
-
};
|
|
908
|
-
}
|
|
909
|
-
function close() {
|
|
910
|
-
if (reconnectTimer !== null) {
|
|
911
|
-
clearTimeout(reconnectTimer);
|
|
912
|
-
reconnectTimer = null;
|
|
913
|
-
}
|
|
914
|
-
if (source) {
|
|
915
|
-
source.close();
|
|
916
|
-
setStatus("closed");
|
|
917
|
-
source = null;
|
|
918
|
-
}
|
|
919
|
-
}
|
|
920
|
-
function dispose() {
|
|
921
|
-
disposed = true;
|
|
922
|
-
close();
|
|
923
|
-
}
|
|
924
|
-
connect();
|
|
925
|
-
return { data, event, status, close, dispose };
|
|
926
|
-
}
|
|
927
|
-
|
|
928
|
-
export {
|
|
929
|
-
calculateDelay,
|
|
930
|
-
withRetry,
|
|
931
|
-
query,
|
|
932
|
-
invalidateQueries,
|
|
933
|
-
getQueryData,
|
|
934
|
-
setQueryData,
|
|
935
|
-
clearQueryCache,
|
|
936
|
-
mutation,
|
|
937
|
-
infiniteQuery,
|
|
938
|
-
previous,
|
|
939
|
-
debounce,
|
|
940
|
-
throttle,
|
|
941
|
-
resource,
|
|
942
|
-
offlineStore,
|
|
943
|
-
syncAdapter,
|
|
944
|
-
executeLoader,
|
|
945
|
-
loaderData,
|
|
946
|
-
preloadRoute,
|
|
947
|
-
socket,
|
|
948
|
-
stream
|
|
949
|
-
};
|