sibujs 1.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +1630 -0
- package/dist/browser.cjs +815 -0
- package/dist/browser.d.cts +174 -0
- package/dist/browser.d.ts +174 -0
- package/dist/browser.js +458 -0
- package/dist/build.cjs +4970 -0
- package/dist/build.d.cts +630 -0
- package/dist/build.d.ts +630 -0
- package/dist/build.js +2478 -0
- package/dist/cdn.global.js +115 -0
- package/dist/chunk-27QC4FPL.js +67 -0
- package/dist/chunk-2ABBWCGC.js +65 -0
- package/dist/chunk-2MUNQYZ7.js +26 -0
- package/dist/chunk-2PSPKNUI.js +1711 -0
- package/dist/chunk-35CDLDX5.js +1758 -0
- package/dist/chunk-36MU4CFV.js +41 -0
- package/dist/chunk-3FIQOFI6.js +182 -0
- package/dist/chunk-3GHNC2BN.js +28 -0
- package/dist/chunk-3HLWWEPU.js +909 -0
- package/dist/chunk-3IVI3J54.js +252 -0
- package/dist/chunk-3KZ72WNW.js +944 -0
- package/dist/chunk-4AU64SQV.js +182 -0
- package/dist/chunk-4MOK7HAR.js +84 -0
- package/dist/chunk-4QK6FBDH.js +1429 -0
- package/dist/chunk-566Z7HXB.js +737 -0
- package/dist/chunk-5CRBB7XP.js +358 -0
- package/dist/chunk-5G67D3IZ.js +168 -0
- package/dist/chunk-5NCPAWBE.js +99 -0
- package/dist/chunk-5O2RKXR3.js +1444 -0
- package/dist/chunk-6BTBDO6A.js +633 -0
- package/dist/chunk-6IWEHW57.js +43 -0
- package/dist/chunk-6JGMNCD6.js +282 -0
- package/dist/chunk-6QRLJNXR.js +1425 -0
- package/dist/chunk-7HM5UE5T.js +270 -0
- package/dist/chunk-7JOLTGUH.js +58 -0
- package/dist/chunk-7MCWJCQK.js +909 -0
- package/dist/chunk-7RIIFP3E.js +1758 -0
- package/dist/chunk-7UASYN3G.js +254 -0
- package/dist/chunk-7W2WYHDI.js +741 -0
- package/dist/chunk-7Y35RDSJ.js +872 -0
- package/dist/chunk-A65GFJBL.js +65 -0
- package/dist/chunk-AD6ZIEDK.js +67 -0
- package/dist/chunk-AK5Y72F3.js +1426 -0
- package/dist/chunk-APOMMWH4.js +282 -0
- package/dist/chunk-ARZVTWIQ.js +1750 -0
- package/dist/chunk-AWWBM2BI.js +664 -0
- package/dist/chunk-AX5VEQTY.js +58 -0
- package/dist/chunk-AYTXVOW3.js +1708 -0
- package/dist/chunk-BG4A246G.js +1746 -0
- package/dist/chunk-BNFJJA2L.js +1425 -0
- package/dist/chunk-BPKPBVU5.js +59 -0
- package/dist/chunk-BPKPPSXC.js +282 -0
- package/dist/chunk-BPWKKK7F.js +1711 -0
- package/dist/chunk-CCKX6YTC.js +1735 -0
- package/dist/chunk-CIF5Z3MP.js +58 -0
- package/dist/chunk-CSXYU7IO.js +457 -0
- package/dist/chunk-D6JD4FDC.js +26 -0
- package/dist/chunk-E7NGA7X2.js +59 -0
- package/dist/chunk-EEPPJKAE.js +443 -0
- package/dist/chunk-EJMYGAGQ.js +717 -0
- package/dist/chunk-EL6Z5MDY.js +55 -0
- package/dist/chunk-EP7VRLEB.js +41 -0
- package/dist/chunk-ETMEC6FH.js +99 -0
- package/dist/chunk-EZ2WHYVL.js +65 -0
- package/dist/chunk-EZRVMSZK.js +67 -0
- package/dist/chunk-F2TRGINX.js +254 -0
- package/dist/chunk-F5JCIH3Q.js +642 -0
- package/dist/chunk-FGK3JKMN.js +909 -0
- package/dist/chunk-FQWPKSTD.js +1437 -0
- package/dist/chunk-FWHVLMCI.js +26 -0
- package/dist/chunk-GBEYQRO2.js +303 -0
- package/dist/chunk-GBLES3NK.js +248 -0
- package/dist/chunk-GQVGUQW6.js +1436 -0
- package/dist/chunk-HCV2T76T.js +457 -0
- package/dist/chunk-HS7ZKVPR.js +182 -0
- package/dist/chunk-HXDVV7HZ.js +909 -0
- package/dist/chunk-IB23VMO3.js +1746 -0
- package/dist/chunk-IEMZ7RTT.js +99 -0
- package/dist/chunk-IPGRSN42.js +1750 -0
- package/dist/chunk-IVMOK2QN.js +1750 -0
- package/dist/chunk-JCLGQO7T.js +443 -0
- package/dist/chunk-JDXL7KDB.js +1436 -0
- package/dist/chunk-JIIFW636.js +270 -0
- package/dist/chunk-JWGEEH7H.js +944 -0
- package/dist/chunk-K2BESAG7.js +1688 -0
- package/dist/chunk-K2U5YGF4.js +877 -0
- package/dist/chunk-K45FQ4Y4.js +175 -0
- package/dist/chunk-K7BPE427.js +1432 -0
- package/dist/chunk-KL3266RS.js +26 -0
- package/dist/chunk-KNN4P7DZ.js +84 -0
- package/dist/chunk-KP2DZH5Q.js +254 -0
- package/dist/chunk-KZHAJSQR.js +1636 -0
- package/dist/chunk-LBKGHMQV.js +1750 -0
- package/dist/chunk-LBTEPL7A.js +1731 -0
- package/dist/chunk-LEBBPTDB.js +1444 -0
- package/dist/chunk-LLH63WVQ.js +98 -0
- package/dist/chunk-LWVR2C4G.js +1711 -0
- package/dist/chunk-M3MDTVV2.js +896 -0
- package/dist/chunk-M5GNLDEO.js +303 -0
- package/dist/chunk-MFHVGKET.js +267 -0
- package/dist/chunk-MGWSG3PM.js +358 -0
- package/dist/chunk-MJNB47HB.js +19 -0
- package/dist/chunk-MLKGABMK.js +9 -0
- package/dist/chunk-MQWTY3JY.js +944 -0
- package/dist/chunk-MZZOQHNI.js +642 -0
- package/dist/chunk-NIHWGZS4.js +1426 -0
- package/dist/chunk-NSVVHQK5.js +41 -0
- package/dist/chunk-NVI2WE7D.js +443 -0
- package/dist/chunk-O7QBO3PH.js +58 -0
- package/dist/chunk-OAUPQBO2.js +270 -0
- package/dist/chunk-OB2LMD7C.js +297 -0
- package/dist/chunk-OHEYBWQU.js +58 -0
- package/dist/chunk-OI6OXUHJ.js +443 -0
- package/dist/chunk-OX2VMRMV.js +633 -0
- package/dist/chunk-P4FYE5TX.js +866 -0
- package/dist/chunk-P5KFWM4H.js +98 -0
- package/dist/chunk-PUMLE7RJ.js +1711 -0
- package/dist/chunk-Q4MFANBF.js +282 -0
- package/dist/chunk-QLEKZMMU.js +282 -0
- package/dist/chunk-RGGNGVO3.js +98 -0
- package/dist/chunk-RKJDRVV6.js +443 -0
- package/dist/chunk-S5BHU353.js +43 -0
- package/dist/chunk-SHQUSFH7.js +1426 -0
- package/dist/chunk-SMB4DBMD.js +182 -0
- package/dist/chunk-SNYHQP3D.js +743 -0
- package/dist/chunk-T24L3TBF.js +1717 -0
- package/dist/chunk-TAQNSOKT.js +692 -0
- package/dist/chunk-TDNY4SUA.js +41 -0
- package/dist/chunk-TNNF56IQ.js +1750 -0
- package/dist/chunk-TR7E6LYX.js +457 -0
- package/dist/chunk-URWUFH45.js +98 -0
- package/dist/chunk-UUSIH3XH.js +1429 -0
- package/dist/chunk-UYFNXLKR.js +1436 -0
- package/dist/chunk-V6F7KUWD.js +270 -0
- package/dist/chunk-VCZLXRMR.js +254 -0
- package/dist/chunk-VDHXSSBT.js +1426 -0
- package/dist/chunk-VM4QMKVK.js +254 -0
- package/dist/chunk-VWGYKYL2.js +737 -0
- package/dist/chunk-VX2OFBJN.js +1426 -0
- package/dist/chunk-VXVIE6DG.js +84 -0
- package/dist/chunk-W4OH7HG4.js +40 -0
- package/dist/chunk-WBVJX4GZ.js +98 -0
- package/dist/chunk-WDU2ZV4I.js +1426 -0
- package/dist/chunk-X6VUCICU.js +457 -0
- package/dist/chunk-XAY7FM7Y.js +618 -0
- package/dist/chunk-XJZ5Z2CM.js +642 -0
- package/dist/chunk-XKVFQTJJ.js +254 -0
- package/dist/chunk-XRLFASCY.js +22 -0
- package/dist/chunk-XYU6TZOW.js +182 -0
- package/dist/chunk-Y745CBVB.js +944 -0
- package/dist/chunk-YLBJSXYY.js +944 -0
- package/dist/chunk-YQJIKVPZ.js +1429 -0
- package/dist/chunk-YRM2VCZF.js +457 -0
- package/dist/chunk-YS33KBVJ.js +944 -0
- package/dist/chunk-Z27DZPDG.js +41 -0
- package/dist/chunk-ZXQ5NAEN.js +32 -0
- package/dist/contracts-B552GopR.d.cts +245 -0
- package/dist/contracts-B552GopR.d.ts +245 -0
- package/dist/contracts-Bg1ECISC.d.cts +245 -0
- package/dist/contracts-Bg1ECISC.d.ts +245 -0
- package/dist/contracts-CMriKJ6P.d.cts +245 -0
- package/dist/contracts-CMriKJ6P.d.ts +245 -0
- package/dist/contracts-DOrhwbke.d.cts +245 -0
- package/dist/contracts-DOrhwbke.d.ts +245 -0
- package/dist/data.cjs +1373 -0
- package/dist/data.d.cts +434 -0
- package/dist/data.d.ts +434 -0
- package/dist/data.js +945 -0
- package/dist/devtools.cjs +1357 -0
- package/dist/devtools.d.cts +473 -0
- package/dist/devtools.d.ts +473 -0
- package/dist/devtools.js +1084 -0
- package/dist/ecosystem.cjs +1046 -0
- package/dist/ecosystem.d.cts +247 -0
- package/dist/ecosystem.d.ts +247 -0
- package/dist/ecosystem.js +369 -0
- package/dist/extras.cjs +8457 -0
- package/dist/extras.d.cts +2356 -0
- package/dist/extras.d.ts +2356 -0
- package/dist/extras.js +5152 -0
- package/dist/index.cjs +2648 -0
- package/dist/index.d.cts +869 -0
- package/dist/index.d.ts +869 -0
- package/dist/index.js +386 -0
- package/dist/motion.cjs +604 -0
- package/dist/motion.d.cts +146 -0
- package/dist/motion.d.ts +146 -0
- package/dist/motion.js +346 -0
- package/dist/patterns.cjs +815 -0
- package/dist/patterns.d.cts +163 -0
- package/dist/patterns.d.ts +163 -0
- package/dist/patterns.js +296 -0
- package/dist/performance.cjs +927 -0
- package/dist/performance.d.cts +416 -0
- package/dist/performance.d.ts +416 -0
- package/dist/performance.js +654 -0
- package/dist/plugins.cjs +2487 -0
- package/dist/plugins.d.cts +393 -0
- package/dist/plugins.d.ts +393 -0
- package/dist/plugins.js +1504 -0
- package/dist/signal-BnWpq6WB.d.cts +5 -0
- package/dist/signal-BnWpq6WB.d.ts +5 -0
- package/dist/src/components/ErrorBoundary.d.ts +15 -0
- package/dist/src/components/ErrorBoundary.js +119 -0
- package/dist/src/core/catch.d.ts +11 -0
- package/dist/src/core/catch.js +28 -0
- package/dist/src/core/each.d.ts +13 -0
- package/dist/src/core/each.js +68 -0
- package/dist/src/core/for.d.ts +12 -0
- package/dist/src/core/for.js +67 -0
- package/dist/src/core/html.d.ts +137 -0
- package/dist/src/core/html.js +155 -0
- package/dist/src/core/htmlIf.d.ts +11 -0
- package/dist/src/core/htmlIf.js +18 -0
- package/dist/src/core/lazy.d.ts +7 -0
- package/dist/src/core/lazy.js +16 -0
- package/dist/src/core/mount.d.ts +7 -0
- package/dist/src/core/mount.js +12 -0
- package/dist/src/core/slots.d.ts +3 -0
- package/dist/src/core/slots.js +3 -0
- package/dist/src/core/suspense.d.ts +10 -0
- package/dist/src/core/suspense.js +33 -0
- package/dist/src/core/tagFactory.d.ts +13 -0
- package/dist/src/core/tagFactory.js +86 -0
- package/dist/src/core/test.d.ts +11 -0
- package/dist/src/core/test.js +28 -0
- package/dist/src/core/types.d.ts +2 -0
- package/dist/src/core/types.js +1 -0
- package/dist/src/core/useComputed.d.ts +6 -0
- package/dist/src/core/useComputed.js +30 -0
- package/dist/src/core/useEffect.d.ts +6 -0
- package/dist/src/core/useEffect.js +23 -0
- package/dist/src/core/useState.d.ts +10 -0
- package/dist/src/core/useState.js +34 -0
- package/dist/src/core/useStore.d.ts +19 -0
- package/dist/src/core/useStore.js +53 -0
- package/dist/src/core/useWatch.d.ts +8 -0
- package/dist/src/core/useWatch.js +23 -0
- package/dist/src/plugins/i18n.d.ts +6 -0
- package/dist/src/plugins/i18n.js +16 -0
- package/dist/src/plugins/router.d.ts +188 -0
- package/dist/src/plugins/router.js +1178 -0
- package/dist/src/reactivity/bindAttribute.d.ts +5 -0
- package/dist/src/reactivity/bindAttribute.js +31 -0
- package/dist/src/reactivity/bindChildNode.d.ts +10 -0
- package/dist/src/reactivity/bindChildNode.js +46 -0
- package/dist/src/reactivity/bindTextNode.d.ts +10 -0
- package/dist/src/reactivity/bindTextNode.js +27 -0
- package/dist/src/reactivity/signal.d.ts +3 -0
- package/dist/src/reactivity/signal.js +1 -0
- package/dist/src/reactivity/track.d.ts +18 -0
- package/dist/src/reactivity/track.js +73 -0
- package/dist/src/reactivity/useComputed.d.ts +6 -0
- package/dist/src/reactivity/useComputed.js +30 -0
- package/dist/src/reactivity/useEffect.d.ts +6 -0
- package/dist/src/reactivity/useEffect.js +23 -0
- package/dist/src/reactivity/useState.d.ts +10 -0
- package/dist/src/reactivity/useState.js +34 -0
- package/dist/src/reactivity/useStore.d.ts +19 -0
- package/dist/src/reactivity/useStore.js +53 -0
- package/dist/src/reactivity/useWatch.d.ts +8 -0
- package/dist/src/reactivity/useWatch.js +23 -0
- package/dist/src/utils/sanitize.d.ts +1 -0
- package/dist/src/utils/sanitize.js +8 -0
- package/dist/ssr-27FOM46T.js +35 -0
- package/dist/ssr-GFUTTSJD.js +22 -0
- package/dist/ssr-K7DCR6BZ.js +35 -0
- package/dist/ssr-O6LFMRFP.js +35 -0
- package/dist/ssr-QZEVGMMK.js +35 -0
- package/dist/ssr-SGVBCAGC.js +35 -0
- package/dist/ssr-UB2IXCYX.js +35 -0
- package/dist/ssr-XBZQNV4O.js +22 -0
- package/dist/ssr-Y76FSXDU.js +35 -0
- package/dist/ssr-YQJ4AYBD.js +35 -0
- package/dist/ssr.cjs +1757 -0
- package/dist/ssr.d.cts +478 -0
- package/dist/ssr.d.ts +478 -0
- package/dist/ssr.js +743 -0
- package/dist/tagFactory-CZPO4RXF.d.cts +34 -0
- package/dist/tagFactory-CZPO4RXF.d.ts +34 -0
- package/dist/tagFactory-CgImPVMY.d.cts +22 -0
- package/dist/tagFactory-CgImPVMY.d.ts +22 -0
- package/dist/tagFactory-Cw1iv5if.d.cts +22 -0
- package/dist/tagFactory-Cw1iv5if.d.ts +22 -0
- package/dist/tagFactory-DeAXq9ef.d.cts +30 -0
- package/dist/tagFactory-DeAXq9ef.d.ts +30 -0
- package/dist/tagFactory-SkY0a7L1.d.cts +22 -0
- package/dist/tagFactory-SkY0a7L1.d.ts +22 -0
- package/dist/testing.cjs +1919 -0
- package/dist/testing.d.cts +491 -0
- package/dist/testing.d.ts +491 -0
- package/dist/testing.js +1862 -0
- package/dist/ui.cjs +1497 -0
- package/dist/ui.d.cts +264 -0
- package/dist/ui.d.ts +264 -0
- package/dist/ui.js +900 -0
- package/dist/widgets.cjs +919 -0
- package/dist/widgets.d.cts +165 -0
- package/dist/widgets.d.ts +165 -0
- package/dist/widgets.js +545 -0
- package/package.json +134 -0
package/dist/widgets.js
ADDED
|
@@ -0,0 +1,545 @@
|
|
|
1
|
+
import {
|
|
2
|
+
derived
|
|
3
|
+
} from "./chunk-2ABBWCGC.js";
|
|
4
|
+
import "./chunk-MJNB47HB.js";
|
|
5
|
+
import {
|
|
6
|
+
batch,
|
|
7
|
+
signal
|
|
8
|
+
} from "./chunk-M5GNLDEO.js";
|
|
9
|
+
import "./chunk-MLKGABMK.js";
|
|
10
|
+
|
|
11
|
+
// src/widgets/Combobox.ts
|
|
12
|
+
function combobox(options) {
|
|
13
|
+
const { items, filterFn, itemToString } = options;
|
|
14
|
+
const defaultFilterFn = (item, q) => {
|
|
15
|
+
const str = itemToString ? itemToString(item) : String(item);
|
|
16
|
+
return str.toLowerCase().includes(q.toLowerCase());
|
|
17
|
+
};
|
|
18
|
+
const filter = filterFn ?? defaultFilterFn;
|
|
19
|
+
const [query, setQuery] = signal("");
|
|
20
|
+
const [selectedItem, setSelectedItem] = signal(null);
|
|
21
|
+
const [highlightedIndex, setHighlightedIndex] = signal(-1);
|
|
22
|
+
const [isOpen, setIsOpen] = signal(false);
|
|
23
|
+
const filteredItems = derived(() => {
|
|
24
|
+
const q = query();
|
|
25
|
+
if (q === "") return items;
|
|
26
|
+
return items.filter((item) => filter(item, q));
|
|
27
|
+
});
|
|
28
|
+
function select2(item) {
|
|
29
|
+
batch(() => {
|
|
30
|
+
setSelectedItem(item);
|
|
31
|
+
const str = itemToString ? itemToString(item) : String(item);
|
|
32
|
+
setQuery(str);
|
|
33
|
+
setIsOpen(false);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function highlightNext() {
|
|
37
|
+
const filtered = filteredItems();
|
|
38
|
+
if (filtered.length === 0) return;
|
|
39
|
+
setHighlightedIndex((prev) => {
|
|
40
|
+
const next = prev + 1;
|
|
41
|
+
return next >= filtered.length ? 0 : next;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function highlightPrev() {
|
|
45
|
+
const filtered = filteredItems();
|
|
46
|
+
if (filtered.length === 0) return;
|
|
47
|
+
setHighlightedIndex((prev) => {
|
|
48
|
+
const next = prev - 1;
|
|
49
|
+
return next < 0 ? filtered.length - 1 : next;
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
function selectHighlighted() {
|
|
53
|
+
const filtered = filteredItems();
|
|
54
|
+
const idx = highlightedIndex();
|
|
55
|
+
if (idx >= 0 && idx < filtered.length) {
|
|
56
|
+
select2(filtered[idx]);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function open() {
|
|
60
|
+
setIsOpen(true);
|
|
61
|
+
}
|
|
62
|
+
function close() {
|
|
63
|
+
setIsOpen(false);
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
query,
|
|
67
|
+
setQuery,
|
|
68
|
+
filteredItems,
|
|
69
|
+
selectedItem,
|
|
70
|
+
select: select2,
|
|
71
|
+
highlightedIndex,
|
|
72
|
+
highlightNext,
|
|
73
|
+
highlightPrev,
|
|
74
|
+
selectHighlighted,
|
|
75
|
+
isOpen,
|
|
76
|
+
open,
|
|
77
|
+
close
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// src/widgets/Tabs.ts
|
|
82
|
+
function tabs(options) {
|
|
83
|
+
const { tabs: tabDefs, defaultTab } = options;
|
|
84
|
+
const initialTab = defaultTab ?? tabDefs.find((t) => !t.disabled)?.id ?? tabDefs[0]?.id ?? "";
|
|
85
|
+
const [activeTab, setActiveTabState] = signal(initialTab);
|
|
86
|
+
function setActiveTab(id) {
|
|
87
|
+
const tab = tabDefs.find((t) => t.id === id);
|
|
88
|
+
if (tab && !tab.disabled) {
|
|
89
|
+
setActiveTabState(id);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
const tabs2 = derived(
|
|
93
|
+
() => tabDefs.map((t) => ({
|
|
94
|
+
...t,
|
|
95
|
+
isActive: t.id === activeTab()
|
|
96
|
+
}))
|
|
97
|
+
);
|
|
98
|
+
function findCurrentIndex() {
|
|
99
|
+
return tabDefs.findIndex((t) => t.id === activeTab());
|
|
100
|
+
}
|
|
101
|
+
function nextTab() {
|
|
102
|
+
const currentIdx = findCurrentIndex();
|
|
103
|
+
const len = tabDefs.length;
|
|
104
|
+
if (len === 0) return;
|
|
105
|
+
for (let i = 1; i <= len; i++) {
|
|
106
|
+
const candidate = tabDefs[(currentIdx + i) % len];
|
|
107
|
+
if (!candidate.disabled) {
|
|
108
|
+
setActiveTabState(candidate.id);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
function prevTab() {
|
|
114
|
+
const currentIdx = findCurrentIndex();
|
|
115
|
+
const len = tabDefs.length;
|
|
116
|
+
if (len === 0) return;
|
|
117
|
+
for (let i = 1; i <= len; i++) {
|
|
118
|
+
const candidate = tabDefs[(currentIdx - i + len) % len];
|
|
119
|
+
if (!candidate.disabled) {
|
|
120
|
+
setActiveTabState(candidate.id);
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return {
|
|
126
|
+
activeTab,
|
|
127
|
+
setActiveTab,
|
|
128
|
+
tabs: tabs2,
|
|
129
|
+
nextTab,
|
|
130
|
+
prevTab
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// src/widgets/Accordion.ts
|
|
135
|
+
function accordion(options) {
|
|
136
|
+
const { items: itemDefs, multiple = false, defaultExpanded = [] } = options;
|
|
137
|
+
const [expandedIds, setExpandedIds] = signal(new Set(defaultExpanded));
|
|
138
|
+
const items = derived(
|
|
139
|
+
() => itemDefs.map((item) => ({
|
|
140
|
+
...item,
|
|
141
|
+
isExpanded: expandedIds().has(item.id)
|
|
142
|
+
}))
|
|
143
|
+
);
|
|
144
|
+
function expand(id) {
|
|
145
|
+
if (!itemDefs.some((item) => item.id === id)) return;
|
|
146
|
+
if (multiple) {
|
|
147
|
+
setExpandedIds((prev) => {
|
|
148
|
+
const next = new Set(prev);
|
|
149
|
+
next.add(id);
|
|
150
|
+
return next;
|
|
151
|
+
});
|
|
152
|
+
} else {
|
|
153
|
+
setExpandedIds(/* @__PURE__ */ new Set([id]));
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
function collapse(id) {
|
|
157
|
+
setExpandedIds((prev) => {
|
|
158
|
+
const next = new Set(prev);
|
|
159
|
+
next.delete(id);
|
|
160
|
+
return next;
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
function toggle(id) {
|
|
164
|
+
if (expandedIds().has(id)) {
|
|
165
|
+
collapse(id);
|
|
166
|
+
} else {
|
|
167
|
+
expand(id);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
function expandAll() {
|
|
171
|
+
if (multiple) {
|
|
172
|
+
setExpandedIds(new Set(itemDefs.map((item) => item.id)));
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
function collapseAll() {
|
|
176
|
+
setExpandedIds(/* @__PURE__ */ new Set());
|
|
177
|
+
}
|
|
178
|
+
return {
|
|
179
|
+
items,
|
|
180
|
+
toggle,
|
|
181
|
+
expand,
|
|
182
|
+
collapse,
|
|
183
|
+
expandAll,
|
|
184
|
+
collapseAll
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// src/widgets/Popover.ts
|
|
189
|
+
function popover() {
|
|
190
|
+
const [isOpen, setIsOpen] = signal(false);
|
|
191
|
+
function open() {
|
|
192
|
+
setIsOpen(true);
|
|
193
|
+
}
|
|
194
|
+
function close() {
|
|
195
|
+
setIsOpen(false);
|
|
196
|
+
}
|
|
197
|
+
function toggle() {
|
|
198
|
+
setIsOpen((prev) => !prev);
|
|
199
|
+
}
|
|
200
|
+
return { isOpen, open, close, toggle };
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// src/widgets/Select.ts
|
|
204
|
+
function select(options) {
|
|
205
|
+
const { items, multiple = false } = options;
|
|
206
|
+
const [selectedItems, setSelectedItems] = signal([]);
|
|
207
|
+
const [isOpen, setIsOpen] = signal(false);
|
|
208
|
+
const [highlightedIndex, setHighlightedIndex] = signal(-1);
|
|
209
|
+
const selectedItem = derived(() => {
|
|
210
|
+
const sel = selectedItems();
|
|
211
|
+
return sel.length > 0 ? sel[sel.length - 1] : null;
|
|
212
|
+
});
|
|
213
|
+
function select2(item) {
|
|
214
|
+
if (multiple) {
|
|
215
|
+
setSelectedItems((prev) => {
|
|
216
|
+
if (prev.includes(item)) return prev;
|
|
217
|
+
return [...prev, item];
|
|
218
|
+
});
|
|
219
|
+
} else {
|
|
220
|
+
batch(() => {
|
|
221
|
+
setSelectedItems([item]);
|
|
222
|
+
setIsOpen(false);
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
function deselect(item) {
|
|
227
|
+
setSelectedItems((prev) => prev.filter((i) => i !== item));
|
|
228
|
+
}
|
|
229
|
+
function toggle(item) {
|
|
230
|
+
if (selectedItems().includes(item)) {
|
|
231
|
+
deselect(item);
|
|
232
|
+
} else {
|
|
233
|
+
select2(item);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
function isSelected(item) {
|
|
237
|
+
return selectedItems().includes(item);
|
|
238
|
+
}
|
|
239
|
+
function open() {
|
|
240
|
+
setIsOpen(true);
|
|
241
|
+
}
|
|
242
|
+
function close() {
|
|
243
|
+
setIsOpen(false);
|
|
244
|
+
}
|
|
245
|
+
function highlightNext() {
|
|
246
|
+
if (items.length === 0) return;
|
|
247
|
+
setHighlightedIndex((prev) => {
|
|
248
|
+
const next = prev + 1;
|
|
249
|
+
return next >= items.length ? 0 : next;
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
function highlightPrev() {
|
|
253
|
+
if (items.length === 0) return;
|
|
254
|
+
setHighlightedIndex((prev) => {
|
|
255
|
+
const next = prev - 1;
|
|
256
|
+
return next < 0 ? items.length - 1 : next;
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
function selectHighlighted() {
|
|
260
|
+
const idx = highlightedIndex();
|
|
261
|
+
if (idx >= 0 && idx < items.length) {
|
|
262
|
+
select2(items[idx]);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
function clear() {
|
|
266
|
+
setSelectedItems([]);
|
|
267
|
+
}
|
|
268
|
+
return {
|
|
269
|
+
selectedItems,
|
|
270
|
+
selectedItem,
|
|
271
|
+
select: select2,
|
|
272
|
+
deselect,
|
|
273
|
+
toggle,
|
|
274
|
+
isSelected,
|
|
275
|
+
isOpen,
|
|
276
|
+
open,
|
|
277
|
+
close,
|
|
278
|
+
highlightedIndex,
|
|
279
|
+
highlightNext,
|
|
280
|
+
highlightPrev,
|
|
281
|
+
selectHighlighted,
|
|
282
|
+
clear
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
// src/widgets/Tooltip.ts
|
|
287
|
+
function tooltip(options) {
|
|
288
|
+
const delay = options?.delay ?? 0;
|
|
289
|
+
const [isVisible, setIsVisible] = signal(false);
|
|
290
|
+
const [content, setContent] = signal("");
|
|
291
|
+
let delayTimer = null;
|
|
292
|
+
function show() {
|
|
293
|
+
if (delay > 0) {
|
|
294
|
+
if (delayTimer !== null) {
|
|
295
|
+
clearTimeout(delayTimer);
|
|
296
|
+
}
|
|
297
|
+
delayTimer = setTimeout(() => {
|
|
298
|
+
setIsVisible(true);
|
|
299
|
+
delayTimer = null;
|
|
300
|
+
}, delay);
|
|
301
|
+
} else {
|
|
302
|
+
setIsVisible(true);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
function hide() {
|
|
306
|
+
if (delayTimer !== null) {
|
|
307
|
+
clearTimeout(delayTimer);
|
|
308
|
+
delayTimer = null;
|
|
309
|
+
}
|
|
310
|
+
setIsVisible(false);
|
|
311
|
+
}
|
|
312
|
+
return { isVisible, show, hide, content, setContent };
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
// src/widgets/FileUpload.ts
|
|
316
|
+
function fileUpload(options) {
|
|
317
|
+
const accept = options?.accept;
|
|
318
|
+
const multiple = options?.multiple ?? false;
|
|
319
|
+
const maxSize = options?.maxSize;
|
|
320
|
+
const onFiles = options?.onFiles;
|
|
321
|
+
const [files, setFiles] = signal([]);
|
|
322
|
+
const [errors, setErrors] = signal([]);
|
|
323
|
+
const [isDragOver, setDragOver] = signal(false);
|
|
324
|
+
function isAccepted(file) {
|
|
325
|
+
if (!accept) return true;
|
|
326
|
+
const acceptedTypes = accept.split(",").map((t) => t.trim().toLowerCase());
|
|
327
|
+
const fileName = file.name.toLowerCase();
|
|
328
|
+
const fileType = file.type.toLowerCase();
|
|
329
|
+
return acceptedTypes.some((pattern) => {
|
|
330
|
+
if (pattern.startsWith(".")) {
|
|
331
|
+
return fileName.endsWith(pattern);
|
|
332
|
+
}
|
|
333
|
+
if (pattern.endsWith("/*")) {
|
|
334
|
+
const prefix = pattern.slice(0, pattern.indexOf("/"));
|
|
335
|
+
return fileType.startsWith(`${prefix}/`);
|
|
336
|
+
}
|
|
337
|
+
return fileType === pattern;
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
function addFiles(fileList) {
|
|
341
|
+
const incoming = Array.from(fileList);
|
|
342
|
+
const validFiles = [];
|
|
343
|
+
const newErrors = [];
|
|
344
|
+
for (const file of incoming) {
|
|
345
|
+
if (!isAccepted(file)) {
|
|
346
|
+
newErrors.push(`File "${file.name}" is not an accepted type`);
|
|
347
|
+
continue;
|
|
348
|
+
}
|
|
349
|
+
if (maxSize !== void 0 && file.size > maxSize) {
|
|
350
|
+
newErrors.push(`File "${file.name}" exceeds maximum size of ${maxSize} bytes`);
|
|
351
|
+
continue;
|
|
352
|
+
}
|
|
353
|
+
validFiles.push(file);
|
|
354
|
+
}
|
|
355
|
+
batch(() => {
|
|
356
|
+
setErrors(newErrors);
|
|
357
|
+
if (validFiles.length > 0) {
|
|
358
|
+
if (multiple) {
|
|
359
|
+
setFiles((prev) => [...prev, ...validFiles]);
|
|
360
|
+
} else {
|
|
361
|
+
setFiles([validFiles[validFiles.length - 1]]);
|
|
362
|
+
}
|
|
363
|
+
if (onFiles) {
|
|
364
|
+
onFiles(validFiles);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
function removeFile(index) {
|
|
370
|
+
setFiles((prev) => {
|
|
371
|
+
if (index < 0 || index >= prev.length) return prev;
|
|
372
|
+
const next = [...prev];
|
|
373
|
+
next.splice(index, 1);
|
|
374
|
+
return next;
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
function clear() {
|
|
378
|
+
batch(() => {
|
|
379
|
+
setFiles([]);
|
|
380
|
+
setErrors([]);
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
return {
|
|
384
|
+
files,
|
|
385
|
+
addFiles,
|
|
386
|
+
removeFile,
|
|
387
|
+
clear,
|
|
388
|
+
errors,
|
|
389
|
+
isDragOver,
|
|
390
|
+
setDragOver
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
// src/widgets/contentEditable.ts
|
|
395
|
+
function contentEditable() {
|
|
396
|
+
const [content, setContent] = signal("");
|
|
397
|
+
const [isFocused, setFocused] = signal(false);
|
|
398
|
+
function execCommand(command, value) {
|
|
399
|
+
if (typeof document !== "undefined" && document.execCommand) {
|
|
400
|
+
document.execCommand(command, false, value ?? "");
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
function bold() {
|
|
404
|
+
execCommand("bold");
|
|
405
|
+
}
|
|
406
|
+
function italic() {
|
|
407
|
+
execCommand("italic");
|
|
408
|
+
}
|
|
409
|
+
function underline() {
|
|
410
|
+
execCommand("underline");
|
|
411
|
+
}
|
|
412
|
+
return {
|
|
413
|
+
content,
|
|
414
|
+
setContent,
|
|
415
|
+
isFocused,
|
|
416
|
+
setFocused,
|
|
417
|
+
execCommand,
|
|
418
|
+
bold,
|
|
419
|
+
italic,
|
|
420
|
+
underline
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
// src/widgets/datePicker.ts
|
|
425
|
+
function datePicker(options) {
|
|
426
|
+
const minDate = options?.minDate;
|
|
427
|
+
const maxDate = options?.maxDate;
|
|
428
|
+
const initialDate = options?.initialDate ?? null;
|
|
429
|
+
const [selectedDate, setSelectedDate] = signal(initialDate);
|
|
430
|
+
const [viewDate, setViewDate] = signal(initialDate ?? /* @__PURE__ */ new Date());
|
|
431
|
+
function isDateDisabled(date) {
|
|
432
|
+
if (minDate && date < stripTime(minDate)) return true;
|
|
433
|
+
if (maxDate && date > stripTime(maxDate)) return true;
|
|
434
|
+
return false;
|
|
435
|
+
}
|
|
436
|
+
function stripTime(d) {
|
|
437
|
+
return new Date(d.getFullYear(), d.getMonth(), d.getDate());
|
|
438
|
+
}
|
|
439
|
+
function sameDay(a, b) {
|
|
440
|
+
return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
|
|
441
|
+
}
|
|
442
|
+
function select2(date) {
|
|
443
|
+
if (!isDateDisabled(date)) {
|
|
444
|
+
setSelectedDate(date);
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
function nextMonth() {
|
|
448
|
+
setViewDate((prev) => {
|
|
449
|
+
const next = new Date(prev);
|
|
450
|
+
next.setMonth(next.getMonth() + 1);
|
|
451
|
+
return next;
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
function prevMonth() {
|
|
455
|
+
setViewDate((prev) => {
|
|
456
|
+
const next = new Date(prev);
|
|
457
|
+
next.setMonth(next.getMonth() - 1);
|
|
458
|
+
return next;
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
function nextYear() {
|
|
462
|
+
setViewDate((prev) => {
|
|
463
|
+
const next = new Date(prev);
|
|
464
|
+
next.setFullYear(next.getFullYear() + 1);
|
|
465
|
+
return next;
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
function prevYear() {
|
|
469
|
+
setViewDate((prev) => {
|
|
470
|
+
const next = new Date(prev);
|
|
471
|
+
next.setFullYear(next.getFullYear() - 1);
|
|
472
|
+
return next;
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
const daysInMonth = derived(() => {
|
|
476
|
+
const vd = viewDate();
|
|
477
|
+
const year = vd.getFullYear();
|
|
478
|
+
const month = vd.getMonth();
|
|
479
|
+
const today = /* @__PURE__ */ new Date();
|
|
480
|
+
const selected = selectedDate();
|
|
481
|
+
const firstDay = new Date(year, month, 1);
|
|
482
|
+
const startDow = firstDay.getDay();
|
|
483
|
+
const lastDay = new Date(year, month + 1, 0);
|
|
484
|
+
const totalDaysInMonth = lastDay.getDate();
|
|
485
|
+
const days = [];
|
|
486
|
+
for (let i = startDow - 1; i >= 0; i--) {
|
|
487
|
+
const date = new Date(year, month, -i);
|
|
488
|
+
days.push({
|
|
489
|
+
date,
|
|
490
|
+
isCurrentMonth: false,
|
|
491
|
+
isToday: sameDay(date, today),
|
|
492
|
+
isSelected: selected !== null && sameDay(date, selected),
|
|
493
|
+
isDisabled: isDateDisabled(date)
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
for (let d = 1; d <= totalDaysInMonth; d++) {
|
|
497
|
+
const date = new Date(year, month, d);
|
|
498
|
+
days.push({
|
|
499
|
+
date,
|
|
500
|
+
isCurrentMonth: true,
|
|
501
|
+
isToday: sameDay(date, today),
|
|
502
|
+
isSelected: selected !== null && sameDay(date, selected),
|
|
503
|
+
isDisabled: isDateDisabled(date)
|
|
504
|
+
});
|
|
505
|
+
}
|
|
506
|
+
const remaining = days.length % 7;
|
|
507
|
+
if (remaining > 0) {
|
|
508
|
+
const trailingCount = 7 - remaining;
|
|
509
|
+
for (let i = 1; i <= trailingCount; i++) {
|
|
510
|
+
const date = new Date(year, month + 1, i);
|
|
511
|
+
days.push({
|
|
512
|
+
date,
|
|
513
|
+
isCurrentMonth: false,
|
|
514
|
+
isToday: sameDay(date, today),
|
|
515
|
+
isSelected: selected !== null && sameDay(date, selected),
|
|
516
|
+
isDisabled: isDateDisabled(date)
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
return days;
|
|
521
|
+
});
|
|
522
|
+
return {
|
|
523
|
+
selectedDate,
|
|
524
|
+
select: select2,
|
|
525
|
+
viewDate,
|
|
526
|
+
setViewDate,
|
|
527
|
+
nextMonth,
|
|
528
|
+
prevMonth,
|
|
529
|
+
nextYear,
|
|
530
|
+
prevYear,
|
|
531
|
+
daysInMonth,
|
|
532
|
+
isDateDisabled
|
|
533
|
+
};
|
|
534
|
+
}
|
|
535
|
+
export {
|
|
536
|
+
accordion,
|
|
537
|
+
combobox,
|
|
538
|
+
contentEditable,
|
|
539
|
+
datePicker,
|
|
540
|
+
fileUpload,
|
|
541
|
+
popover,
|
|
542
|
+
select,
|
|
543
|
+
tabs,
|
|
544
|
+
tooltip
|
|
545
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "sibujs",
|
|
3
|
+
"version": "1.0.0-beta.1",
|
|
4
|
+
"description": "A lightweight, function-based frontend framework that combines the best of React, Svelte, and Vue — with zero VDOM and maximum simplicity. Designed for developers who want fine-grained reactivity and full control without compilation or magic.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"frontend",
|
|
7
|
+
"framework",
|
|
8
|
+
"reactive",
|
|
9
|
+
"dom"
|
|
10
|
+
],
|
|
11
|
+
"homepage": "https://github.com/hexplus/sibujs#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/hexplus/sibujs/issues"
|
|
14
|
+
},
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/hexplus/sibujs.git"
|
|
18
|
+
},
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"author": "hexplus (https://github.com/hexplus)",
|
|
21
|
+
"type": "module",
|
|
22
|
+
"sideEffects": false,
|
|
23
|
+
"main": "dist/index.cjs",
|
|
24
|
+
"module": "dist/index.js",
|
|
25
|
+
"files": [
|
|
26
|
+
"dist",
|
|
27
|
+
"README.md",
|
|
28
|
+
"LICENSE"
|
|
29
|
+
],
|
|
30
|
+
"scripts": {
|
|
31
|
+
"lint": "biome check --max-diagnostics=500 src/ tests/",
|
|
32
|
+
"lint:fix": "biome check --write src/ tests/",
|
|
33
|
+
"format": "biome format --write src/ tests/",
|
|
34
|
+
"test": "vitest",
|
|
35
|
+
"test:ui": "vitest --ui",
|
|
36
|
+
"build": "tsup index.ts data.ts browser.ts patterns.ts motion.ts ui.ts widgets.ts ssr.ts devtools.ts performance.ts ecosystem.ts plugins.ts build.ts testing.ts --dts --format esm,cjs --out-dir dist && tsup cdn.ts --format iife --globalName Sibu --out-dir dist --no-dts --minify",
|
|
37
|
+
"bench": "node bench.mjs",
|
|
38
|
+
"bench:save": "node bench.mjs --save",
|
|
39
|
+
"bench:check": "node bench.mjs --compare",
|
|
40
|
+
"publish:npm": "node publish.mjs",
|
|
41
|
+
"prepublishOnly": "npm run build"
|
|
42
|
+
},
|
|
43
|
+
"types": "dist/index.d.ts",
|
|
44
|
+
"exports": {
|
|
45
|
+
".": {
|
|
46
|
+
"types": "./dist/index.d.ts",
|
|
47
|
+
"import": "./dist/index.js",
|
|
48
|
+
"require": "./dist/index.cjs"
|
|
49
|
+
},
|
|
50
|
+
"./data": {
|
|
51
|
+
"types": "./dist/data.d.ts",
|
|
52
|
+
"import": "./dist/data.js",
|
|
53
|
+
"require": "./dist/data.cjs"
|
|
54
|
+
},
|
|
55
|
+
"./browser": {
|
|
56
|
+
"types": "./dist/browser.d.ts",
|
|
57
|
+
"import": "./dist/browser.js",
|
|
58
|
+
"require": "./dist/browser.cjs"
|
|
59
|
+
},
|
|
60
|
+
"./patterns": {
|
|
61
|
+
"types": "./dist/patterns.d.ts",
|
|
62
|
+
"import": "./dist/patterns.js",
|
|
63
|
+
"require": "./dist/patterns.cjs"
|
|
64
|
+
},
|
|
65
|
+
"./motion": {
|
|
66
|
+
"types": "./dist/motion.d.ts",
|
|
67
|
+
"import": "./dist/motion.js",
|
|
68
|
+
"require": "./dist/motion.cjs"
|
|
69
|
+
},
|
|
70
|
+
"./ui": {
|
|
71
|
+
"types": "./dist/ui.d.ts",
|
|
72
|
+
"import": "./dist/ui.js",
|
|
73
|
+
"require": "./dist/ui.cjs"
|
|
74
|
+
},
|
|
75
|
+
"./widgets": {
|
|
76
|
+
"types": "./dist/widgets.d.ts",
|
|
77
|
+
"import": "./dist/widgets.js",
|
|
78
|
+
"require": "./dist/widgets.cjs"
|
|
79
|
+
},
|
|
80
|
+
"./ssr": {
|
|
81
|
+
"types": "./dist/ssr.d.ts",
|
|
82
|
+
"import": "./dist/ssr.js",
|
|
83
|
+
"require": "./dist/ssr.cjs"
|
|
84
|
+
},
|
|
85
|
+
"./devtools": {
|
|
86
|
+
"types": "./dist/devtools.d.ts",
|
|
87
|
+
"import": "./dist/devtools.js",
|
|
88
|
+
"require": "./dist/devtools.cjs"
|
|
89
|
+
},
|
|
90
|
+
"./performance": {
|
|
91
|
+
"types": "./dist/performance.d.ts",
|
|
92
|
+
"import": "./dist/performance.js",
|
|
93
|
+
"require": "./dist/performance.cjs"
|
|
94
|
+
},
|
|
95
|
+
"./ecosystem": {
|
|
96
|
+
"types": "./dist/ecosystem.d.ts",
|
|
97
|
+
"import": "./dist/ecosystem.js",
|
|
98
|
+
"require": "./dist/ecosystem.cjs"
|
|
99
|
+
},
|
|
100
|
+
"./plugins": {
|
|
101
|
+
"types": "./dist/plugins.d.ts",
|
|
102
|
+
"import": "./dist/plugins.js",
|
|
103
|
+
"require": "./dist/plugins.cjs"
|
|
104
|
+
},
|
|
105
|
+
"./build": {
|
|
106
|
+
"types": "./dist/build.d.ts",
|
|
107
|
+
"import": "./dist/build.js",
|
|
108
|
+
"require": "./dist/build.cjs"
|
|
109
|
+
},
|
|
110
|
+
"./testing": {
|
|
111
|
+
"types": "./dist/testing.d.ts",
|
|
112
|
+
"import": "./dist/testing.js",
|
|
113
|
+
"require": "./dist/testing.cjs"
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"browserslist": [
|
|
117
|
+
"Chrome >= 80",
|
|
118
|
+
"Firefox >= 78",
|
|
119
|
+
"Safari >= 14",
|
|
120
|
+
"Edge >= 80"
|
|
121
|
+
],
|
|
122
|
+
"engines": {
|
|
123
|
+
"node": ">=18.0.0"
|
|
124
|
+
},
|
|
125
|
+
"devDependencies": {
|
|
126
|
+
"@biomejs/biome": "2.4.7",
|
|
127
|
+
"@types/node": "^25.5.0",
|
|
128
|
+
"@vitest/ui": "^3.1.3",
|
|
129
|
+
"jsdom": "^26.1.0",
|
|
130
|
+
"tsup": "^8.5.1",
|
|
131
|
+
"typescript": "^5.8.3",
|
|
132
|
+
"vitest": "^3.1.3"
|
|
133
|
+
}
|
|
134
|
+
}
|