sibujs 1.5.0 → 2.0.0
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 +238 -69
- package/dist/browser.d.cts +5 -0
- package/dist/browser.d.ts +5 -0
- package/dist/browser.js +6 -6
- package/dist/build.cjs +916 -292
- package/dist/build.js +15 -13
- package/dist/cdn.global.js +17 -16
- package/dist/chunk-2RA7SHDA.js +65 -0
- package/dist/chunk-2UPRY23K.js +80 -0
- package/dist/chunk-3JHCYHWN.js +125 -0
- package/dist/{chunk-VAPYJN4X.js → chunk-3LR7GLWQ.js} +93 -23
- package/dist/{chunk-RJ46C3CS.js → chunk-3NSGB5JN.js} +71 -20
- package/dist/{chunk-XUEEGU5O.js → chunk-52YJLLRO.js} +16 -4
- package/dist/{chunk-XHK6BDAJ.js → chunk-54EDRCEF.js} +25 -8
- package/dist/chunk-7JDB7I65.js +1327 -0
- package/dist/{chunk-WZSPOOER.js → chunk-CC65Y57T.js} +8 -5
- package/dist/{chunk-23VV7YD3.js → chunk-DFPFITST.js} +25 -30
- package/dist/{chunk-BGN5ZMP4.js → chunk-GTBNNBJ6.js} +14 -2
- package/dist/chunk-HB24TBAF.js +121 -0
- package/dist/{chunk-CZUGLNJS.js → chunk-ITX6OO3F.js} +3 -3
- package/dist/{chunk-BGTHZHJ5.js → chunk-JA6667UN.js} +188 -44
- package/dist/{chunk-7GRNSCFT.js → chunk-JXMMDLBY.js} +306 -183
- package/dist/{chunk-3X2YG6YM.js → chunk-JYD2PWXH.js} +59 -28
- package/dist/{chunk-SFKNRVCU.js → chunk-KLRMB5ZS.js} +135 -79
- package/dist/{chunk-5X6PP2UK.js → chunk-LMLD24FC.js} +2 -2
- package/dist/{chunk-M4NLBH4I.js → chunk-LYTCUZ7H.js} +3 -2
- package/dist/{chunk-BMPL52BF.js → chunk-MIUAXB7K.js} +118 -66
- package/dist/{chunk-JCDUJN2F.js → chunk-ND2664SF.js} +486 -153
- package/dist/{chunk-VQDZK23A.js → chunk-O2MNQFLP.js} +181 -66
- package/dist/{chunk-NHUC2QWH.js → chunk-R73P76YZ.js} +1 -1
- package/dist/{chunk-2BYQDGN3.js → chunk-SAHNHTFC.js} +234 -63
- package/dist/chunk-UCS6AMJ7.js +79 -0
- package/dist/{chunk-K4G4ZQNR.js → chunk-VLPPXTYG.js} +84 -38
- package/dist/{chunk-OUZZEE4S.js → chunk-WOMYAHHI.js} +17 -11
- package/dist/{customElement-BL3Uo8dL.d.cts → customElement-CPfIrbvg.d.cts} +14 -10
- package/dist/{customElement-BL3Uo8dL.d.ts → customElement-CPfIrbvg.d.ts} +14 -10
- package/dist/data.cjs +410 -99
- package/dist/data.d.cts +20 -2
- package/dist/data.d.ts +20 -2
- package/dist/data.js +11 -9
- package/dist/devtools.cjs +513 -223
- package/dist/devtools.d.cts +1 -1
- package/dist/devtools.d.ts +1 -1
- package/dist/devtools.js +12 -6
- package/dist/ecosystem.cjs +475 -144
- package/dist/ecosystem.d.cts +9 -7
- package/dist/ecosystem.d.ts +9 -7
- package/dist/ecosystem.js +12 -11
- package/dist/extras.cjs +3355 -1541
- package/dist/extras.d.cts +9 -9
- package/dist/extras.d.ts +9 -9
- package/dist/extras.js +58 -45
- package/dist/index.cjs +920 -292
- package/dist/index.d.cts +71 -8
- package/dist/index.d.ts +71 -8
- package/dist/index.js +28 -16
- package/dist/{introspect-BumjnBKr.d.cts → introspect-BWNjNw64.d.cts} +22 -2
- package/dist/{introspect-CZrlcaYy.d.ts → introspect-cY2pg9pW.d.ts} +22 -2
- package/dist/motion.cjs +77 -34
- package/dist/motion.js +4 -4
- package/dist/patterns.cjs +335 -69
- package/dist/patterns.d.cts +11 -12
- package/dist/patterns.d.ts +11 -12
- package/dist/patterns.js +7 -7
- package/dist/performance.cjs +279 -108
- package/dist/performance.d.cts +23 -16
- package/dist/performance.d.ts +23 -16
- package/dist/performance.js +13 -8
- package/dist/plugin-D30wlGW5.d.cts +71 -0
- package/dist/plugin-D30wlGW5.d.ts +71 -0
- package/dist/plugins.cjs +635 -260
- package/dist/plugins.d.cts +10 -3
- package/dist/plugins.d.ts +10 -3
- package/dist/plugins.js +106 -38
- package/dist/{ssr-Do_SiVoL.d.cts → ssr-CrVNy6Pa.d.cts} +9 -15
- package/dist/{ssr-Do_SiVoL.d.ts → ssr-CrVNy6Pa.d.ts} +9 -15
- package/dist/{ssr-4PBXAOO3.js → ssr-FXD2PPMC.js} +4 -3
- package/dist/ssr.cjs +642 -222
- package/dist/ssr.d.cts +26 -6
- package/dist/ssr.d.ts +26 -6
- package/dist/ssr.js +12 -11
- package/dist/{tagFactory-DaJ0YWX6.d.cts → tagFactory-S17H2qxu.d.cts} +9 -1
- package/dist/{tagFactory-DaJ0YWX6.d.ts → tagFactory-S17H2qxu.d.ts} +9 -1
- package/dist/testing.cjs +252 -63
- package/dist/testing.d.cts +17 -4
- package/dist/testing.d.ts +17 -4
- package/dist/testing.js +100 -44
- package/dist/ui.cjs +463 -137
- package/dist/ui.d.cts +1 -1
- package/dist/ui.d.ts +1 -1
- package/dist/ui.js +20 -17
- package/dist/widgets.cjs +977 -94
- package/dist/widgets.d.cts +104 -2
- package/dist/widgets.d.ts +104 -2
- package/dist/widgets.js +9 -7
- package/package.json +8 -2
- package/dist/chunk-32DY64NT.js +0 -282
- package/dist/chunk-3AIRKM3B.js +0 -1263
- package/dist/chunk-3ARAQO7B.js +0 -398
- package/dist/chunk-3CRQALYP.js +0 -877
- package/dist/chunk-4EI4AG32.js +0 -482
- package/dist/chunk-4MYMUBRS.js +0 -21
- package/dist/chunk-5ZYQ6KDD.js +0 -154
- package/dist/chunk-6BMPXPUW.js +0 -26
- package/dist/chunk-6HLLIF3K.js +0 -398
- package/dist/chunk-6LSNVCS2.js +0 -937
- package/dist/chunk-6SA3QQES.js +0 -61
- package/dist/chunk-77L6NL3X.js +0 -1097
- package/dist/chunk-7BF6TK55.js +0 -1097
- package/dist/chunk-7TQKR4PP.js +0 -294
- package/dist/chunk-7V26P53V.js +0 -712
- package/dist/chunk-AZ3ISID5.js +0 -298
- package/dist/chunk-B7SWRFUT.js +0 -332
- package/dist/chunk-BTU3TJDS.js +0 -365
- package/dist/chunk-BW3WT46K.js +0 -937
- package/dist/chunk-C6KFWOFV.js +0 -616
- package/dist/chunk-CHF5OHIA.js +0 -61
- package/dist/chunk-CHJ27IGK.js +0 -26
- package/dist/chunk-CMBFNA7L.js +0 -27
- package/dist/chunk-DAHRH4ON.js +0 -331
- package/dist/chunk-DKOHBI74.js +0 -924
- package/dist/chunk-DTCOOBMX.js +0 -725
- package/dist/chunk-EBGIRKQY.js +0 -616
- package/dist/chunk-EUZND3CB.js +0 -27
- package/dist/chunk-EVCZO745.js +0 -365
- package/dist/chunk-EWFVA3TJ.js +0 -282
- package/dist/chunk-F3FA4F32.js +0 -292
- package/dist/chunk-FGOEVHY3.js +0 -60
- package/dist/chunk-G3BOQPVO.js +0 -365
- package/dist/chunk-GCOK2LC3.js +0 -282
- package/dist/chunk-GJPXRJ45.js +0 -37
- package/dist/chunk-HGMJFBC7.js +0 -654
- package/dist/chunk-JAKHTMQU.js +0 -1000
- package/dist/chunk-JCI5M6U6.js +0 -956
- package/dist/chunk-K5ZUMYVS.js +0 -89
- package/dist/chunk-KQPDEVVS.js +0 -398
- package/dist/chunk-L6JRBDNS.js +0 -60
- package/dist/chunk-LA6KQEDU.js +0 -712
- package/dist/chunk-MB6QFH3I.js +0 -2776
- package/dist/chunk-MDVXJWFN.js +0 -304
- package/dist/chunk-MEZVEBPN.js +0 -2008
- package/dist/chunk-MK4ERFYL.js +0 -2249
- package/dist/chunk-MLKGABMK.js +0 -9
- package/dist/chunk-MQ5GOYPH.js +0 -2249
- package/dist/chunk-MYRV7VDM.js +0 -742
- package/dist/chunk-N6IZB6KJ.js +0 -567
- package/dist/chunk-NEKUBFPT.js +0 -60
- package/dist/chunk-NMRUZALC.js +0 -1097
- package/dist/chunk-NYVAC6P5.js +0 -37
- package/dist/chunk-NZIIMDWI.js +0 -84
- package/dist/chunk-OF7UZIVB.js +0 -725
- package/dist/chunk-P3XWXJZU.js +0 -282
- package/dist/chunk-P6W3STU4.js +0 -2249
- package/dist/chunk-PBHF5WKN.js +0 -616
- package/dist/chunk-PDZQY43A.js +0 -616
- package/dist/chunk-PTQJDMRT.js +0 -146
- package/dist/chunk-PZEGYCF5.js +0 -61
- package/dist/chunk-QBMDLBU2.js +0 -975
- package/dist/chunk-QWZG56ET.js +0 -2744
- package/dist/chunk-RQGQSLQK.js +0 -725
- package/dist/chunk-SDLZDHKP.js +0 -107
- package/dist/chunk-TDGZL5CU.js +0 -365
- package/dist/chunk-TNQWPPE6.js +0 -37
- package/dist/chunk-TSOKIX5Z.js +0 -654
- package/dist/chunk-UHNL42EF.js +0 -2730
- package/dist/chunk-UNXCEF6S.js +0 -21
- package/dist/chunk-V2XTI523.js +0 -347
- package/dist/chunk-VAU366PN.js +0 -2241
- package/dist/chunk-VMVDTCXB.js +0 -712
- package/dist/chunk-VQNQZCWJ.js +0 -61
- package/dist/chunk-VRW3FULF.js +0 -725
- package/dist/chunk-WADYRCO2.js +0 -304
- package/dist/chunk-WILQZRO4.js +0 -282
- package/dist/chunk-WR5D4EGH.js +0 -26
- package/dist/chunk-WUHJISPP.js +0 -298
- package/dist/chunk-XYU6TZOW.js +0 -182
- package/dist/chunk-Y6GP4QGG.js +0 -276
- package/dist/chunk-YECR7UIA.js +0 -347
- package/dist/chunk-YUTWTI4B.js +0 -654
- package/dist/chunk-Z65KYU7I.js +0 -26
- package/dist/chunk-Z6POF5YC.js +0 -975
- package/dist/chunk-ZBJP6WFL.js +0 -482
- package/dist/chunk-ZD6OAMTH.js +0 -277
- package/dist/chunk-ZWKZCBO6.js +0 -317
- package/dist/contracts-DDrwxvJ-.d.cts +0 -245
- package/dist/contracts-DDrwxvJ-.d.ts +0 -245
- package/dist/contracts-DOrhwbke.d.cts +0 -245
- package/dist/contracts-DOrhwbke.d.ts +0 -245
- package/dist/contracts-xo5ckdRP.d.cts +0 -240
- package/dist/contracts-xo5ckdRP.d.ts +0 -240
- package/dist/customElement-BKQfbSZQ.d.cts +0 -262
- package/dist/customElement-BKQfbSZQ.d.ts +0 -262
- package/dist/customElement-D2DJp_xn.d.cts +0 -313
- package/dist/customElement-D2DJp_xn.d.ts +0 -313
- package/dist/customElement-yz8uyk-0.d.cts +0 -308
- package/dist/customElement-yz8uyk-0.d.ts +0 -308
- package/dist/introspect-Cb0zgpi2.d.cts +0 -477
- package/dist/introspect-Y2xNXGSf.d.ts +0 -477
- package/dist/plugin-Bek4RhJY.d.cts +0 -43
- package/dist/plugin-Bek4RhJY.d.ts +0 -43
- package/dist/ssr-3RXHP5ES.js +0 -38
- package/dist/ssr-6GIMY5MX.js +0 -38
- package/dist/ssr-BA6sxxUd.d.cts +0 -135
- package/dist/ssr-BA6sxxUd.d.ts +0 -135
- package/dist/ssr-WKUPVSSK.js +0 -36
- package/dist/tagFactory-Dl8QCLga.d.cts +0 -23
- package/dist/tagFactory-Dl8QCLga.d.ts +0 -23
package/dist/chunk-F3FA4F32.js
DELETED
|
@@ -1,292 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
bindAttribute,
|
|
3
|
-
registerDisposer
|
|
4
|
-
} from "./chunk-PTQJDMRT.js";
|
|
5
|
-
import {
|
|
6
|
-
isUrlAttribute,
|
|
7
|
-
sanitizeCSSValue,
|
|
8
|
-
sanitizeUrl
|
|
9
|
-
} from "./chunk-CMBFNA7L.js";
|
|
10
|
-
import {
|
|
11
|
-
track
|
|
12
|
-
} from "./chunk-ZD6OAMTH.js";
|
|
13
|
-
import {
|
|
14
|
-
devWarn,
|
|
15
|
-
isDev
|
|
16
|
-
} from "./chunk-5X6PP2UK.js";
|
|
17
|
-
|
|
18
|
-
// src/reactivity/bindChildNode.ts
|
|
19
|
-
var _isDev = isDev();
|
|
20
|
-
function bindChildNode(placeholder, getter) {
|
|
21
|
-
let lastNodes = [];
|
|
22
|
-
function commit() {
|
|
23
|
-
let result;
|
|
24
|
-
try {
|
|
25
|
-
result = getter();
|
|
26
|
-
} catch (err) {
|
|
27
|
-
if (_isDev) devWarn(`bindChildNode: getter threw: ${err instanceof Error ? err.message : String(err)}`);
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
if (result == null || typeof result === "boolean") {
|
|
31
|
-
for (let i = 0; i < lastNodes.length; i++) {
|
|
32
|
-
const node = lastNodes[i];
|
|
33
|
-
if (node.parentNode) node.parentNode.removeChild(node);
|
|
34
|
-
}
|
|
35
|
-
lastNodes.length = 0;
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
const parent = placeholder.parentNode;
|
|
39
|
-
if (!parent) {
|
|
40
|
-
lastNodes.length = 0;
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
let newNodes;
|
|
44
|
-
if (Array.isArray(result)) {
|
|
45
|
-
newNodes = [];
|
|
46
|
-
for (let i = 0; i < result.length; i++) {
|
|
47
|
-
const item = result[i];
|
|
48
|
-
if (item == null || typeof item === "boolean") continue;
|
|
49
|
-
newNodes.push(item instanceof Node ? item : document.createTextNode(String(item)));
|
|
50
|
-
}
|
|
51
|
-
} else {
|
|
52
|
-
const node = result instanceof Node ? result : document.createTextNode(String(result));
|
|
53
|
-
newNodes = [node];
|
|
54
|
-
}
|
|
55
|
-
const reused = lastNodes.length > 0 && newNodes.length > 0 ? /* @__PURE__ */ new Set() : void 0;
|
|
56
|
-
if (reused) {
|
|
57
|
-
for (let i = 0; i < newNodes.length; i++) {
|
|
58
|
-
for (let j = 0; j < lastNodes.length; j++) {
|
|
59
|
-
if (newNodes[i] === lastNodes[j]) {
|
|
60
|
-
reused.add(newNodes[i]);
|
|
61
|
-
break;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
for (let i = 0; i < lastNodes.length; i++) {
|
|
67
|
-
const node = lastNodes[i];
|
|
68
|
-
if (reused?.has(node)) continue;
|
|
69
|
-
if (node.parentNode) node.parentNode.removeChild(node);
|
|
70
|
-
}
|
|
71
|
-
const anchor = placeholder.nextSibling;
|
|
72
|
-
for (let i = 0; i < newNodes.length; i++) {
|
|
73
|
-
const node = newNodes[i];
|
|
74
|
-
if (reused?.has(node) && node.parentNode === parent) {
|
|
75
|
-
if (node.nextSibling !== anchor) {
|
|
76
|
-
parent.insertBefore(node, anchor);
|
|
77
|
-
}
|
|
78
|
-
} else {
|
|
79
|
-
parent.insertBefore(node, anchor);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
lastNodes = newNodes;
|
|
83
|
-
}
|
|
84
|
-
return track(commit);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// src/core/rendering/tagFactory.ts
|
|
88
|
-
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
89
|
-
var kebabCache = /* @__PURE__ */ new Map();
|
|
90
|
-
function toKebab(prop) {
|
|
91
|
-
let cached = kebabCache.get(prop);
|
|
92
|
-
if (cached !== void 0) return cached;
|
|
93
|
-
cached = prop.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`);
|
|
94
|
-
kebabCache.set(prop, cached);
|
|
95
|
-
return cached;
|
|
96
|
-
}
|
|
97
|
-
function applyStyle(el, style) {
|
|
98
|
-
if (typeof style === "function") {
|
|
99
|
-
const teardown = track(() => {
|
|
100
|
-
el.setAttribute("style", style());
|
|
101
|
-
});
|
|
102
|
-
registerDisposer(el, teardown);
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
if (typeof style === "string") {
|
|
106
|
-
el.setAttribute("style", style);
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
const htmlEl = el;
|
|
110
|
-
for (const prop in style) {
|
|
111
|
-
const val = style[prop];
|
|
112
|
-
const name = toKebab(prop);
|
|
113
|
-
if (typeof val === "function") {
|
|
114
|
-
const getter = val;
|
|
115
|
-
const teardown = track(() => {
|
|
116
|
-
htmlEl.style.setProperty(name, sanitizeCSSValue(String(getter())));
|
|
117
|
-
});
|
|
118
|
-
registerDisposer(el, teardown);
|
|
119
|
-
} else {
|
|
120
|
-
htmlEl.style.setProperty(name, sanitizeCSSValue(String(val)));
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
function applyClass(el, cls) {
|
|
125
|
-
if (typeof cls === "string") {
|
|
126
|
-
el.setAttribute("class", cls);
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
if (typeof cls === "function") {
|
|
130
|
-
const teardown = track(() => {
|
|
131
|
-
el.setAttribute("class", cls());
|
|
132
|
-
});
|
|
133
|
-
registerDisposer(el, teardown);
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
const obj = cls;
|
|
137
|
-
let hasReactive = false;
|
|
138
|
-
let result = "";
|
|
139
|
-
for (const name in obj) {
|
|
140
|
-
const val = obj[name];
|
|
141
|
-
if (typeof val === "function") {
|
|
142
|
-
hasReactive = true;
|
|
143
|
-
break;
|
|
144
|
-
}
|
|
145
|
-
if (val) result = result ? `${result} ${name}` : name;
|
|
146
|
-
}
|
|
147
|
-
if (hasReactive) {
|
|
148
|
-
const update = () => {
|
|
149
|
-
let r = "";
|
|
150
|
-
for (const name in obj) {
|
|
151
|
-
const val = obj[name];
|
|
152
|
-
const active = typeof val === "function" ? val() : val;
|
|
153
|
-
if (active) r = r ? `${r} ${name}` : name;
|
|
154
|
-
}
|
|
155
|
-
el.setAttribute("class", r);
|
|
156
|
-
};
|
|
157
|
-
const teardown = track(update);
|
|
158
|
-
registerDisposer(el, teardown);
|
|
159
|
-
} else {
|
|
160
|
-
el.setAttribute("class", result);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
function appendChildren(el, nodes) {
|
|
164
|
-
if (typeof nodes === "string") {
|
|
165
|
-
el.textContent = nodes;
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
if (typeof nodes === "number") {
|
|
169
|
-
el.textContent = String(nodes);
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
if (typeof nodes === "boolean" || nodes == null) {
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
|
-
if (typeof nodes === "function") {
|
|
176
|
-
const ph = document.createComment("");
|
|
177
|
-
el.appendChild(ph);
|
|
178
|
-
registerDisposer(el, bindChildNode(ph, nodes));
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
181
|
-
if (nodes instanceof Node) {
|
|
182
|
-
el.appendChild(nodes);
|
|
183
|
-
return;
|
|
184
|
-
}
|
|
185
|
-
if (Array.isArray(nodes)) {
|
|
186
|
-
for (let i = 0; i < nodes.length; i++) {
|
|
187
|
-
const c = nodes[i];
|
|
188
|
-
if (typeof c === "function") {
|
|
189
|
-
const ph = document.createComment("");
|
|
190
|
-
el.appendChild(ph);
|
|
191
|
-
registerDisposer(el, bindChildNode(ph, c));
|
|
192
|
-
} else if (c instanceof Node) {
|
|
193
|
-
el.appendChild(c);
|
|
194
|
-
} else if (Array.isArray(c)) {
|
|
195
|
-
for (let j = 0; j < c.length; j++) {
|
|
196
|
-
const inner = c[j];
|
|
197
|
-
if (typeof inner === "function") {
|
|
198
|
-
const ph = document.createComment("");
|
|
199
|
-
el.appendChild(ph);
|
|
200
|
-
registerDisposer(el, bindChildNode(ph, inner));
|
|
201
|
-
} else if (inner instanceof Node) {
|
|
202
|
-
el.appendChild(inner);
|
|
203
|
-
} else if (inner != null && typeof inner !== "boolean") {
|
|
204
|
-
el.appendChild(document.createTextNode(String(inner)));
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
} else if (c != null && typeof c !== "boolean") {
|
|
208
|
-
el.appendChild(document.createTextNode(String(c)));
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
var tagFactory = (tag, ns) => (first, second) => {
|
|
214
|
-
const el = ns ? document.createElementNS(ns, tag) : document.createElement(tag);
|
|
215
|
-
if (first === void 0) return el;
|
|
216
|
-
if (typeof first === "string") {
|
|
217
|
-
if (second !== void 0) {
|
|
218
|
-
el.setAttribute("class", first);
|
|
219
|
-
appendChildren(el, second);
|
|
220
|
-
return el;
|
|
221
|
-
}
|
|
222
|
-
el.textContent = first;
|
|
223
|
-
return el;
|
|
224
|
-
}
|
|
225
|
-
if (typeof first === "number") {
|
|
226
|
-
el.textContent = String(first);
|
|
227
|
-
return el;
|
|
228
|
-
}
|
|
229
|
-
if (Array.isArray(first) || first instanceof Node || typeof first === "function") {
|
|
230
|
-
appendChildren(el, first);
|
|
231
|
-
return el;
|
|
232
|
-
}
|
|
233
|
-
const props = first;
|
|
234
|
-
const pClass = props.class;
|
|
235
|
-
if (pClass != null) applyClass(el, pClass);
|
|
236
|
-
const pId = props.id;
|
|
237
|
-
if (pId != null) el.id = pId;
|
|
238
|
-
const pNodes = second !== void 0 ? second : props.nodes;
|
|
239
|
-
if (pNodes != null) appendChildren(el, pNodes);
|
|
240
|
-
const pOn = props.on;
|
|
241
|
-
if (pOn) {
|
|
242
|
-
for (const ev in pOn) {
|
|
243
|
-
el.addEventListener(ev, pOn[ev]);
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
const pStyle = props.style;
|
|
247
|
-
if (pStyle != null) applyStyle(el, pStyle);
|
|
248
|
-
const pRef = props.ref;
|
|
249
|
-
if (pRef) pRef.current = el;
|
|
250
|
-
for (const key in props) {
|
|
251
|
-
switch (key) {
|
|
252
|
-
case "class":
|
|
253
|
-
case "id":
|
|
254
|
-
case "nodes":
|
|
255
|
-
case "on":
|
|
256
|
-
case "style":
|
|
257
|
-
case "ref":
|
|
258
|
-
case "onElement":
|
|
259
|
-
continue;
|
|
260
|
-
// already handled above / below
|
|
261
|
-
default: {
|
|
262
|
-
const value = props[key];
|
|
263
|
-
if (value == null) continue;
|
|
264
|
-
if (key[0] === "o" && key[1] === "n") continue;
|
|
265
|
-
if (typeof value === "function") {
|
|
266
|
-
registerDisposer(el, bindAttribute(el, key, value));
|
|
267
|
-
} else if (typeof value === "boolean") {
|
|
268
|
-
if (key in el && (key === "checked" || key === "disabled" || key === "selected")) {
|
|
269
|
-
el[key] = value;
|
|
270
|
-
} else if (value) {
|
|
271
|
-
el.setAttribute(key, "");
|
|
272
|
-
} else {
|
|
273
|
-
el.removeAttribute(key);
|
|
274
|
-
}
|
|
275
|
-
} else {
|
|
276
|
-
const str = String(value);
|
|
277
|
-
el.setAttribute(key, isUrlAttribute(key) ? sanitizeUrl(str) : str);
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
if (props.onElement && typeof props.onElement === "function") {
|
|
283
|
-
props.onElement(el);
|
|
284
|
-
}
|
|
285
|
-
return el;
|
|
286
|
-
};
|
|
287
|
-
|
|
288
|
-
export {
|
|
289
|
-
bindChildNode,
|
|
290
|
-
SVG_NS,
|
|
291
|
-
tagFactory
|
|
292
|
-
};
|
package/dist/chunk-FGOEVHY3.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
recordDependency,
|
|
3
|
-
track,
|
|
4
|
-
trackingSuspended
|
|
5
|
-
} from "./chunk-YECR7UIA.js";
|
|
6
|
-
import {
|
|
7
|
-
devAssert
|
|
8
|
-
} from "./chunk-4MYMUBRS.js";
|
|
9
|
-
|
|
10
|
-
// src/core/signals/derived.ts
|
|
11
|
-
function derived(getter, options) {
|
|
12
|
-
devAssert(typeof getter === "function", "derived: argument must be a getter function.");
|
|
13
|
-
const debugName = options?.name;
|
|
14
|
-
const cs = {};
|
|
15
|
-
cs._d = false;
|
|
16
|
-
cs._g = getter;
|
|
17
|
-
const markDirty = () => {
|
|
18
|
-
if (cs._d) return;
|
|
19
|
-
cs._d = true;
|
|
20
|
-
};
|
|
21
|
-
markDirty._c = 1;
|
|
22
|
-
markDirty._sig = cs;
|
|
23
|
-
track(() => {
|
|
24
|
-
cs._d = false;
|
|
25
|
-
cs._v = getter();
|
|
26
|
-
}, markDirty);
|
|
27
|
-
const hook = globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
|
|
28
|
-
function computedGetter() {
|
|
29
|
-
if (trackingSuspended) {
|
|
30
|
-
if (cs._d) {
|
|
31
|
-
cs._d = false;
|
|
32
|
-
cs._v = getter();
|
|
33
|
-
}
|
|
34
|
-
return cs._v;
|
|
35
|
-
}
|
|
36
|
-
recordDependency(cs);
|
|
37
|
-
if (cs._d) {
|
|
38
|
-
const oldValue = cs._v;
|
|
39
|
-
track(() => {
|
|
40
|
-
cs._d = false;
|
|
41
|
-
cs._v = getter();
|
|
42
|
-
}, markDirty);
|
|
43
|
-
if (hook && oldValue !== cs._v) {
|
|
44
|
-
hook.emit("computed:update", { signal: cs, oldValue, newValue: cs._v });
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return cs._v;
|
|
48
|
-
}
|
|
49
|
-
if (debugName) {
|
|
50
|
-
computedGetter.__name = debugName;
|
|
51
|
-
cs.__name = debugName;
|
|
52
|
-
}
|
|
53
|
-
computedGetter.__signal = cs;
|
|
54
|
-
if (hook) hook.emit("computed:create", { signal: cs, name: debugName, getter: computedGetter });
|
|
55
|
-
return computedGetter;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export {
|
|
59
|
-
derived
|
|
60
|
-
};
|
package/dist/chunk-G3BOQPVO.js
DELETED
|
@@ -1,365 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createPlugin
|
|
3
|
-
} from "./chunk-K5ZUMYVS.js";
|
|
4
|
-
import {
|
|
5
|
-
tagFactory
|
|
6
|
-
} from "./chunk-MDVXJWFN.js";
|
|
7
|
-
import {
|
|
8
|
-
derived
|
|
9
|
-
} from "./chunk-FGOEVHY3.js";
|
|
10
|
-
import {
|
|
11
|
-
effect
|
|
12
|
-
} from "./chunk-PZEGYCF5.js";
|
|
13
|
-
import {
|
|
14
|
-
batch,
|
|
15
|
-
signal
|
|
16
|
-
} from "./chunk-YECR7UIA.js";
|
|
17
|
-
|
|
18
|
-
// src/ecosystem/adapters/mobx.ts
|
|
19
|
-
function mobXAdapter(options) {
|
|
20
|
-
return createPlugin("sibu-mobx", (ctx) => {
|
|
21
|
-
const { autorun } = options;
|
|
22
|
-
const disposers = [];
|
|
23
|
-
function fromMobX(expression) {
|
|
24
|
-
const [getValue, setValue] = signal(expression());
|
|
25
|
-
const disposer = autorun(() => {
|
|
26
|
-
const newValue = expression();
|
|
27
|
-
batch(() => {
|
|
28
|
-
setValue(newValue);
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
disposers.push(disposer);
|
|
32
|
-
return getValue;
|
|
33
|
-
}
|
|
34
|
-
function toMobX(sibuGetter, callback) {
|
|
35
|
-
return effect(() => {
|
|
36
|
-
callback(sibuGetter());
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
function destroy() {
|
|
40
|
-
for (const disposer of disposers) {
|
|
41
|
-
disposer();
|
|
42
|
-
}
|
|
43
|
-
disposers.length = 0;
|
|
44
|
-
}
|
|
45
|
-
const api = { fromMobX, toMobX, destroy };
|
|
46
|
-
ctx.provide("mobx", api);
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// src/ecosystem/adapters/redux.ts
|
|
51
|
-
function reduxAdapter(options) {
|
|
52
|
-
return createPlugin("sibu-redux", (ctx) => {
|
|
53
|
-
const { store } = options;
|
|
54
|
-
const [getState, setState] = signal(store.getState());
|
|
55
|
-
const unsubscribe = store.subscribe(() => {
|
|
56
|
-
batch(() => {
|
|
57
|
-
setState(store.getState());
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
function useSelector(selector) {
|
|
61
|
-
return derived(() => selector(getState()));
|
|
62
|
-
}
|
|
63
|
-
const api = {
|
|
64
|
-
getState,
|
|
65
|
-
useSelector,
|
|
66
|
-
dispatch: store.dispatch.bind(store),
|
|
67
|
-
destroy: unsubscribe
|
|
68
|
-
};
|
|
69
|
-
ctx.provide("redux", api);
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// src/ecosystem/adapters/zustand.ts
|
|
74
|
-
function zustandAdapter(options) {
|
|
75
|
-
return createPlugin("sibu-zustand", (ctx) => {
|
|
76
|
-
const { store } = options;
|
|
77
|
-
const [getState, setSibuState] = signal(store.getState());
|
|
78
|
-
const unsubscribe = store.subscribe((state) => {
|
|
79
|
-
batch(() => {
|
|
80
|
-
setSibuState(state);
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
function useSelector(selector) {
|
|
84
|
-
return derived(() => selector(getState()));
|
|
85
|
-
}
|
|
86
|
-
const api = {
|
|
87
|
-
getState,
|
|
88
|
-
useSelector,
|
|
89
|
-
setState: store.setState.bind(store),
|
|
90
|
-
destroy() {
|
|
91
|
-
unsubscribe();
|
|
92
|
-
store.destroy();
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
ctx.provide("zustand", api);
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// src/ecosystem/ui/componentAdapter.ts
|
|
100
|
-
function createTheme(initial) {
|
|
101
|
-
const [getConfig, setConfig] = signal(initial);
|
|
102
|
-
function resolveClass(component, variant) {
|
|
103
|
-
const config = getConfig();
|
|
104
|
-
const overrideKey = variant ? `${component}-${variant}` : component;
|
|
105
|
-
if (config.classOverrides?.[overrideKey]) {
|
|
106
|
-
return config.classOverrides[overrideKey];
|
|
107
|
-
}
|
|
108
|
-
const base = `${config.prefix}-${component}`;
|
|
109
|
-
return variant ? `${base} ${config.prefix}-${component}--${variant}` : base;
|
|
110
|
-
}
|
|
111
|
-
function setTheme(partial) {
|
|
112
|
-
setConfig((prev) => ({ ...prev, ...partial }));
|
|
113
|
-
}
|
|
114
|
-
return { config: getConfig, setTheme, resolveClass };
|
|
115
|
-
}
|
|
116
|
-
function componentAdapter(config) {
|
|
117
|
-
const theme = createTheme({ prefix: config.prefix });
|
|
118
|
-
const components = {};
|
|
119
|
-
for (const [name, mapping] of Object.entries(config.components)) {
|
|
120
|
-
const factory = tagFactory(mapping.tag || "div");
|
|
121
|
-
components[name] = (props = {}) => {
|
|
122
|
-
const { variant, size, class: userClass, ...rest } = props;
|
|
123
|
-
const classes = [mapping.baseClass];
|
|
124
|
-
if (variant && mapping.variants?.[variant]) {
|
|
125
|
-
classes.push(mapping.variants[variant]);
|
|
126
|
-
}
|
|
127
|
-
if (size && mapping.sizes?.[size]) {
|
|
128
|
-
classes.push(mapping.sizes[size]);
|
|
129
|
-
}
|
|
130
|
-
let finalClass;
|
|
131
|
-
if (typeof userClass === "function") {
|
|
132
|
-
finalClass = () => {
|
|
133
|
-
const extra = userClass();
|
|
134
|
-
return extra ? `${classes.join(" ")} ${extra}` : classes.join(" ");
|
|
135
|
-
};
|
|
136
|
-
} else if (typeof userClass === "string" && userClass) {
|
|
137
|
-
finalClass = `${classes.join(" ")} ${userClass}`;
|
|
138
|
-
} else {
|
|
139
|
-
finalClass = classes.join(" ");
|
|
140
|
-
}
|
|
141
|
-
const mergedProps = {
|
|
142
|
-
...mapping.defaultProps,
|
|
143
|
-
...rest,
|
|
144
|
-
class: finalClass
|
|
145
|
-
};
|
|
146
|
-
return factory(mergedProps);
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
return { name: config.name, components, theme };
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
// src/ecosystem/ui/antd.ts
|
|
153
|
-
var antdConfig = {
|
|
154
|
-
name: "antd",
|
|
155
|
-
prefix: "ant",
|
|
156
|
-
components: {
|
|
157
|
-
Button: {
|
|
158
|
-
tag: "button",
|
|
159
|
-
baseClass: "ant-btn",
|
|
160
|
-
variants: {
|
|
161
|
-
primary: "ant-btn-primary",
|
|
162
|
-
dashed: "ant-btn-dashed",
|
|
163
|
-
text: "ant-btn-text",
|
|
164
|
-
link: "ant-btn-link",
|
|
165
|
-
default: "ant-btn-default",
|
|
166
|
-
danger: "ant-btn-dangerous"
|
|
167
|
-
},
|
|
168
|
-
sizes: {
|
|
169
|
-
sm: "ant-btn-sm",
|
|
170
|
-
lg: "ant-btn-lg"
|
|
171
|
-
},
|
|
172
|
-
defaultProps: { type: "button" }
|
|
173
|
-
},
|
|
174
|
-
Input: {
|
|
175
|
-
tag: "input",
|
|
176
|
-
baseClass: "ant-input",
|
|
177
|
-
sizes: {
|
|
178
|
-
sm: "ant-input-sm",
|
|
179
|
-
lg: "ant-input-lg"
|
|
180
|
-
}
|
|
181
|
-
},
|
|
182
|
-
Card: {
|
|
183
|
-
tag: "div",
|
|
184
|
-
baseClass: "ant-card",
|
|
185
|
-
variants: {
|
|
186
|
-
bordered: "ant-card-bordered"
|
|
187
|
-
}
|
|
188
|
-
},
|
|
189
|
-
Modal: {
|
|
190
|
-
tag: "div",
|
|
191
|
-
baseClass: "ant-modal"
|
|
192
|
-
},
|
|
193
|
-
Tag: {
|
|
194
|
-
tag: "span",
|
|
195
|
-
baseClass: "ant-tag",
|
|
196
|
-
variants: {
|
|
197
|
-
success: "ant-tag-success",
|
|
198
|
-
error: "ant-tag-error",
|
|
199
|
-
warning: "ant-tag-warning",
|
|
200
|
-
processing: "ant-tag-processing"
|
|
201
|
-
}
|
|
202
|
-
},
|
|
203
|
-
Badge: {
|
|
204
|
-
tag: "span",
|
|
205
|
-
baseClass: "ant-badge"
|
|
206
|
-
},
|
|
207
|
-
Avatar: {
|
|
208
|
-
tag: "span",
|
|
209
|
-
baseClass: "ant-avatar",
|
|
210
|
-
sizes: {
|
|
211
|
-
sm: "ant-avatar-sm",
|
|
212
|
-
lg: "ant-avatar-lg"
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
};
|
|
217
|
-
var antdAdapter = componentAdapter(antdConfig);
|
|
218
|
-
|
|
219
|
-
// src/ecosystem/ui/chakra.ts
|
|
220
|
-
var chakraConfig = {
|
|
221
|
-
name: "chakra",
|
|
222
|
-
prefix: "chakra",
|
|
223
|
-
components: {
|
|
224
|
-
Button: {
|
|
225
|
-
tag: "button",
|
|
226
|
-
baseClass: "chakra-button",
|
|
227
|
-
variants: {
|
|
228
|
-
solid: "chakra-button--solid",
|
|
229
|
-
outline: "chakra-button--outline",
|
|
230
|
-
ghost: "chakra-button--ghost",
|
|
231
|
-
link: "chakra-button--link"
|
|
232
|
-
},
|
|
233
|
-
sizes: {
|
|
234
|
-
xs: "chakra-button--xs",
|
|
235
|
-
sm: "chakra-button--sm",
|
|
236
|
-
md: "chakra-button--md",
|
|
237
|
-
lg: "chakra-button--lg"
|
|
238
|
-
},
|
|
239
|
-
defaultProps: { type: "button" }
|
|
240
|
-
},
|
|
241
|
-
Input: {
|
|
242
|
-
tag: "input",
|
|
243
|
-
baseClass: "chakra-input",
|
|
244
|
-
variants: {
|
|
245
|
-
outline: "chakra-input--outline",
|
|
246
|
-
filled: "chakra-input--filled",
|
|
247
|
-
flushed: "chakra-input--flushed",
|
|
248
|
-
unstyled: "chakra-input--unstyled"
|
|
249
|
-
},
|
|
250
|
-
sizes: {
|
|
251
|
-
xs: "chakra-input--xs",
|
|
252
|
-
sm: "chakra-input--sm",
|
|
253
|
-
md: "chakra-input--md",
|
|
254
|
-
lg: "chakra-input--lg"
|
|
255
|
-
}
|
|
256
|
-
},
|
|
257
|
-
Card: {
|
|
258
|
-
tag: "div",
|
|
259
|
-
baseClass: "chakra-card",
|
|
260
|
-
variants: {
|
|
261
|
-
elevated: "chakra-card--elevated",
|
|
262
|
-
outline: "chakra-card--outline",
|
|
263
|
-
filled: "chakra-card--filled",
|
|
264
|
-
unstyled: "chakra-card--unstyled"
|
|
265
|
-
}
|
|
266
|
-
},
|
|
267
|
-
Modal: {
|
|
268
|
-
tag: "div",
|
|
269
|
-
baseClass: "chakra-modal__content"
|
|
270
|
-
},
|
|
271
|
-
Badge: {
|
|
272
|
-
tag: "span",
|
|
273
|
-
baseClass: "chakra-badge",
|
|
274
|
-
variants: {
|
|
275
|
-
solid: "chakra-badge--solid",
|
|
276
|
-
subtle: "chakra-badge--subtle",
|
|
277
|
-
outline: "chakra-badge--outline"
|
|
278
|
-
}
|
|
279
|
-
},
|
|
280
|
-
Stack: {
|
|
281
|
-
tag: "div",
|
|
282
|
-
baseClass: "chakra-stack",
|
|
283
|
-
variants: {
|
|
284
|
-
horizontal: "chakra-stack--horizontal",
|
|
285
|
-
vertical: "chakra-stack--vertical"
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
};
|
|
290
|
-
var chakraAdapter = componentAdapter(chakraConfig);
|
|
291
|
-
|
|
292
|
-
// src/ecosystem/ui/material.ts
|
|
293
|
-
var materialConfig = {
|
|
294
|
-
name: "material",
|
|
295
|
-
prefix: "mdc",
|
|
296
|
-
components: {
|
|
297
|
-
Button: {
|
|
298
|
-
tag: "button",
|
|
299
|
-
baseClass: "mdc-button",
|
|
300
|
-
variants: {
|
|
301
|
-
raised: "mdc-button--raised",
|
|
302
|
-
outlined: "mdc-button--outlined",
|
|
303
|
-
text: "mdc-button--text",
|
|
304
|
-
unelevated: "mdc-button--unelevated"
|
|
305
|
-
},
|
|
306
|
-
sizes: {
|
|
307
|
-
sm: "mdc-button--dense"
|
|
308
|
-
},
|
|
309
|
-
defaultProps: { type: "button" }
|
|
310
|
-
},
|
|
311
|
-
Input: {
|
|
312
|
-
tag: "div",
|
|
313
|
-
baseClass: "mdc-text-field",
|
|
314
|
-
variants: {
|
|
315
|
-
outlined: "mdc-text-field--outlined",
|
|
316
|
-
filled: "mdc-text-field--filled"
|
|
317
|
-
}
|
|
318
|
-
},
|
|
319
|
-
Card: {
|
|
320
|
-
tag: "div",
|
|
321
|
-
baseClass: "mdc-card",
|
|
322
|
-
variants: {
|
|
323
|
-
outlined: "mdc-card--outlined",
|
|
324
|
-
elevated: "mdc-card--elevated"
|
|
325
|
-
}
|
|
326
|
-
},
|
|
327
|
-
Modal: {
|
|
328
|
-
tag: "div",
|
|
329
|
-
baseClass: "mdc-dialog",
|
|
330
|
-
variants: {
|
|
331
|
-
fullscreen: "mdc-dialog--fullscreen"
|
|
332
|
-
}
|
|
333
|
-
},
|
|
334
|
-
Chip: {
|
|
335
|
-
tag: "span",
|
|
336
|
-
baseClass: "mdc-chip",
|
|
337
|
-
variants: {
|
|
338
|
-
outlined: "mdc-chip--outlined"
|
|
339
|
-
}
|
|
340
|
-
},
|
|
341
|
-
List: {
|
|
342
|
-
tag: "ul",
|
|
343
|
-
baseClass: "mdc-list",
|
|
344
|
-
variants: {
|
|
345
|
-
dense: "mdc-list--dense"
|
|
346
|
-
}
|
|
347
|
-
},
|
|
348
|
-
ListItem: {
|
|
349
|
-
tag: "li",
|
|
350
|
-
baseClass: "mdc-list-item"
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
};
|
|
354
|
-
var materialAdapter = componentAdapter(materialConfig);
|
|
355
|
-
|
|
356
|
-
export {
|
|
357
|
-
mobXAdapter,
|
|
358
|
-
reduxAdapter,
|
|
359
|
-
zustandAdapter,
|
|
360
|
-
createTheme,
|
|
361
|
-
componentAdapter,
|
|
362
|
-
antdAdapter,
|
|
363
|
-
chakraAdapter,
|
|
364
|
-
materialAdapter
|
|
365
|
-
};
|