sibujs 1.2.0 → 1.4.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/README.md +29 -25
- package/dist/browser.cjs +804 -2
- package/dist/browser.d.cts +591 -1
- package/dist/browser.d.ts +591 -1
- package/dist/browser.js +50 -8
- package/dist/build.cjs +655 -237
- package/dist/build.js +15 -93
- package/dist/cdn.global.js +188 -7
- package/dist/chunk-2BYQDGN3.js +742 -0
- package/dist/chunk-32DY64NT.js +282 -0
- package/dist/chunk-3AIRKM3B.js +1263 -0
- package/dist/chunk-3X2YG6YM.js +505 -0
- package/dist/chunk-5X6PP2UK.js +28 -0
- package/dist/chunk-77L6NL3X.js +1097 -0
- package/dist/chunk-BGN5ZMP4.js +26 -0
- package/dist/chunk-BTU3TJDS.js +365 -0
- package/dist/chunk-CHF5OHIA.js +61 -0
- package/dist/chunk-CMBFNA7L.js +27 -0
- package/dist/chunk-CNZ35WI2.js +178 -0
- package/dist/chunk-DAHRH4ON.js +331 -0
- package/dist/chunk-EBGIRKQY.js +616 -0
- package/dist/chunk-EUZND3CB.js +27 -0
- package/dist/chunk-F3FA4F32.js +292 -0
- package/dist/chunk-JAKHTMQU.js +1000 -0
- package/dist/chunk-JCI5M6U6.js +956 -0
- package/dist/chunk-KQPDEVVS.js +398 -0
- package/dist/chunk-M4NLBH4I.js +725 -0
- package/dist/chunk-NEKUBFPT.js +60 -0
- package/dist/chunk-NYVAC6P5.js +37 -0
- package/dist/chunk-PTQJDMRT.js +146 -0
- package/dist/chunk-QWZG56ET.js +2744 -0
- package/dist/chunk-TSOKIX5Z.js +654 -0
- package/dist/chunk-UHNL42EF.js +2730 -0
- package/dist/chunk-VRW3FULF.js +725 -0
- package/dist/chunk-WZSPOOER.js +84 -0
- package/dist/chunk-YT6HQ6AM.js +14 -0
- package/dist/chunk-ZD6OAMTH.js +277 -0
- package/dist/chunk-ZWKZCBO6.js +317 -0
- package/dist/contracts-DDrwxvJ-.d.cts +245 -0
- package/dist/contracts-DDrwxvJ-.d.ts +245 -0
- package/dist/contracts-xo5ckdRP.d.cts +240 -0
- package/dist/contracts-xo5ckdRP.d.ts +240 -0
- package/dist/data.cjs +35 -2
- package/dist/data.d.cts +7 -0
- package/dist/data.d.ts +7 -0
- package/dist/data.js +9 -8
- package/dist/devtools.cjs +122 -0
- package/dist/devtools.d.cts +69 -461
- package/dist/devtools.d.ts +69 -461
- package/dist/devtools.js +127 -6
- package/dist/ecosystem.cjs +23 -6
- package/dist/ecosystem.d.cts +1 -1
- package/dist/ecosystem.d.ts +1 -1
- package/dist/ecosystem.js +10 -9
- package/dist/extras.cjs +1208 -88
- package/dist/extras.d.cts +6 -6
- package/dist/extras.d.ts +6 -6
- package/dist/extras.js +70 -33
- package/dist/index.cjs +663 -158
- package/dist/index.d.cts +398 -40
- package/dist/index.d.ts +398 -40
- package/dist/index.js +39 -21
- package/dist/introspect-BumjnBKr.d.cts +477 -0
- package/dist/introspect-CZrlcaYy.d.ts +477 -0
- package/dist/introspect-Cb0zgpi2.d.cts +477 -0
- package/dist/introspect-Y2xNXGSf.d.ts +477 -0
- package/dist/motion.js +4 -4
- package/dist/patterns.cjs +51 -24
- package/dist/patterns.d.cts +19 -57
- package/dist/patterns.d.ts +19 -57
- package/dist/patterns.js +8 -16
- package/dist/performance.js +4 -4
- package/dist/plugins.cjs +429 -82
- package/dist/plugins.d.cts +27 -4
- package/dist/plugins.d.ts +27 -4
- package/dist/plugins.js +156 -37
- package/dist/ssr-4PBXAOO3.js +40 -0
- package/dist/ssr-Do_SiVoL.d.cts +201 -0
- package/dist/ssr-Do_SiVoL.d.ts +201 -0
- package/dist/ssr.cjs +312 -60
- package/dist/ssr.d.cts +10 -1
- package/dist/ssr.d.ts +10 -1
- package/dist/ssr.js +13 -10
- package/dist/tagFactory-DaJ0YWX6.d.cts +47 -0
- package/dist/tagFactory-DaJ0YWX6.d.ts +47 -0
- package/dist/testing.cjs +233 -2
- package/dist/testing.d.cts +42 -1
- package/dist/testing.d.ts +42 -1
- package/dist/testing.js +129 -2
- package/dist/ui.cjs +374 -8
- package/dist/ui.d.cts +252 -2
- package/dist/ui.d.ts +252 -2
- package/dist/ui.js +329 -11
- package/dist/widgets.js +7 -7
- package/package.json +1 -1
package/dist/devtools.js
CHANGED
|
@@ -33,14 +33,133 @@ import {
|
|
|
33
33
|
trackCleanup,
|
|
34
34
|
walkDependencyGraph,
|
|
35
35
|
withErrorTracking
|
|
36
|
-
} from "./chunk-
|
|
37
|
-
import "./chunk-
|
|
38
|
-
import "./chunk-
|
|
39
|
-
import "./chunk-
|
|
40
|
-
import "./chunk-
|
|
41
|
-
import
|
|
36
|
+
} from "./chunk-77L6NL3X.js";
|
|
37
|
+
import "./chunk-CHF5OHIA.js";
|
|
38
|
+
import "./chunk-EUZND3CB.js";
|
|
39
|
+
import "./chunk-WZSPOOER.js";
|
|
40
|
+
import "./chunk-ZD6OAMTH.js";
|
|
41
|
+
import {
|
|
42
|
+
isDev
|
|
43
|
+
} from "./chunk-5X6PP2UK.js";
|
|
44
|
+
|
|
45
|
+
// src/devtools/signalGraph.ts
|
|
46
|
+
function getHook() {
|
|
47
|
+
if (!isDev()) return null;
|
|
48
|
+
const g = globalThis;
|
|
49
|
+
return g.__SIBU_DEVTOOLS_GLOBAL_HOOK__ ?? null;
|
|
50
|
+
}
|
|
51
|
+
function captureSignalGraph() {
|
|
52
|
+
const hook = getHook();
|
|
53
|
+
if (!hook || typeof hook.getSignalNodes !== "function") {
|
|
54
|
+
return { capturedAt: Date.now(), nodes: [], edgeCount: 0 };
|
|
55
|
+
}
|
|
56
|
+
const nodes = [];
|
|
57
|
+
let edgeCount = 0;
|
|
58
|
+
for (const n of hook.getSignalNodes()) {
|
|
59
|
+
nodes.push({
|
|
60
|
+
id: n.id,
|
|
61
|
+
name: n.name,
|
|
62
|
+
kind: n.kind,
|
|
63
|
+
value: n.value,
|
|
64
|
+
subscribers: [...n.subscribers],
|
|
65
|
+
dependencies: [...n.dependencies],
|
|
66
|
+
evalCount: n.evalCount
|
|
67
|
+
});
|
|
68
|
+
edgeCount += n.dependencies.length;
|
|
69
|
+
}
|
|
70
|
+
return { capturedAt: Date.now(), nodes, edgeCount };
|
|
71
|
+
}
|
|
72
|
+
function diffSignalGraphs(before, after) {
|
|
73
|
+
const beforeById = new Map(before.nodes.map((n) => [n.id, n]));
|
|
74
|
+
const afterById = new Map(after.nodes.map((n) => [n.id, n]));
|
|
75
|
+
const added = [];
|
|
76
|
+
const removed = [];
|
|
77
|
+
const reevaluated = [];
|
|
78
|
+
for (const [id, node] of afterById) {
|
|
79
|
+
if (!beforeById.has(id)) {
|
|
80
|
+
added.push(node);
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
const prev = beforeById.get(id);
|
|
84
|
+
if (prev && prev.evalCount !== node.evalCount) reevaluated.push(node);
|
|
85
|
+
}
|
|
86
|
+
for (const [id, node] of beforeById) {
|
|
87
|
+
if (!afterById.has(id)) removed.push(node);
|
|
88
|
+
}
|
|
89
|
+
return { added, removed, reevaluated };
|
|
90
|
+
}
|
|
91
|
+
function createTraceProfiler() {
|
|
92
|
+
const events = [];
|
|
93
|
+
const hook = getHook();
|
|
94
|
+
if (!hook) {
|
|
95
|
+
return {
|
|
96
|
+
stop: () => events,
|
|
97
|
+
stopTrace: () => JSON.stringify({ traceEvents: events }),
|
|
98
|
+
isRecording: () => false
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
const start = typeof performance !== "undefined" ? performance.now() : Date.now();
|
|
102
|
+
let recording = true;
|
|
103
|
+
const onEffectStart = (payload) => {
|
|
104
|
+
if (!recording) return;
|
|
105
|
+
const now = (typeof performance !== "undefined" ? performance.now() : Date.now()) - start;
|
|
106
|
+
const label = payload.name ?? "effect";
|
|
107
|
+
events.push({
|
|
108
|
+
name: label,
|
|
109
|
+
cat: "effect",
|
|
110
|
+
ph: "B",
|
|
111
|
+
ts: Math.floor(now * 1e3),
|
|
112
|
+
tid: 0,
|
|
113
|
+
pid: 0
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
const onEffectEnd = (payload) => {
|
|
117
|
+
if (!recording) return;
|
|
118
|
+
const now = (typeof performance !== "undefined" ? performance.now() : Date.now()) - start;
|
|
119
|
+
const label = payload.name ?? "effect";
|
|
120
|
+
events.push({
|
|
121
|
+
name: label,
|
|
122
|
+
cat: "effect",
|
|
123
|
+
ph: "E",
|
|
124
|
+
ts: Math.floor(now * 1e3),
|
|
125
|
+
tid: 0,
|
|
126
|
+
pid: 0
|
|
127
|
+
});
|
|
128
|
+
};
|
|
129
|
+
const onSignalSet = (payload) => {
|
|
130
|
+
if (!recording) return;
|
|
131
|
+
const now = (typeof performance !== "undefined" ? performance.now() : Date.now()) - start;
|
|
132
|
+
const label = payload.name ?? "signal";
|
|
133
|
+
events.push({
|
|
134
|
+
name: label,
|
|
135
|
+
cat: "signal",
|
|
136
|
+
ph: "I",
|
|
137
|
+
ts: Math.floor(now * 1e3),
|
|
138
|
+
tid: 0,
|
|
139
|
+
pid: 0,
|
|
140
|
+
args: payload.args
|
|
141
|
+
});
|
|
142
|
+
};
|
|
143
|
+
const offStart = hook.on("effect:start", onEffectStart);
|
|
144
|
+
const offEnd = hook.on("effect:end", onEffectEnd);
|
|
145
|
+
const offSet = hook.on("signal:set", onSignalSet);
|
|
146
|
+
function stop() {
|
|
147
|
+
if (!recording) return events;
|
|
148
|
+
recording = false;
|
|
149
|
+
offStart();
|
|
150
|
+
offEnd();
|
|
151
|
+
offSet();
|
|
152
|
+
return events;
|
|
153
|
+
}
|
|
154
|
+
function stopTrace() {
|
|
155
|
+
stop();
|
|
156
|
+
return JSON.stringify({ traceEvents: events, displayTimeUnit: "ms" });
|
|
157
|
+
}
|
|
158
|
+
return { stop, stopTrace, isRecording: () => recording };
|
|
159
|
+
}
|
|
42
160
|
export {
|
|
43
161
|
SibuError,
|
|
162
|
+
captureSignalGraph,
|
|
44
163
|
checkLeaks,
|
|
45
164
|
clearDebugValues,
|
|
46
165
|
clearHMRState,
|
|
@@ -49,9 +168,11 @@ export {
|
|
|
49
168
|
createErrorReporter,
|
|
50
169
|
createHMRBoundary,
|
|
51
170
|
createProfiler,
|
|
171
|
+
createTraceProfiler,
|
|
52
172
|
debugLog,
|
|
53
173
|
debugValue,
|
|
54
174
|
devState,
|
|
175
|
+
diffSignalGraphs,
|
|
55
176
|
disableDebug,
|
|
56
177
|
enableDebug,
|
|
57
178
|
formatError,
|
package/dist/ecosystem.cjs
CHANGED
|
@@ -539,7 +539,20 @@ function isUrlAttribute(attr) {
|
|
|
539
539
|
|
|
540
540
|
// src/reactivity/bindAttribute.ts
|
|
541
541
|
var _isDev4 = isDev();
|
|
542
|
+
function isEventHandlerAttr(name) {
|
|
543
|
+
if (name.length < 3) return false;
|
|
544
|
+
const lower = name.toLowerCase();
|
|
545
|
+
return lower[0] === "o" && lower[1] === "n" && lower.charCodeAt(2) >= 97 && lower.charCodeAt(2) <= 122;
|
|
546
|
+
}
|
|
542
547
|
function bindAttribute(el, attr, getter) {
|
|
548
|
+
if (isEventHandlerAttr(attr)) {
|
|
549
|
+
if (_isDev4)
|
|
550
|
+
devWarn(
|
|
551
|
+
`bindAttribute: refusing to bind event-handler attribute "${attr}". Use on:{ ${attr.slice(2)}: fn } instead.`
|
|
552
|
+
);
|
|
553
|
+
return () => {
|
|
554
|
+
};
|
|
555
|
+
}
|
|
543
556
|
function commit() {
|
|
544
557
|
let value;
|
|
545
558
|
try {
|
|
@@ -781,16 +794,20 @@ function appendChildren(el, nodes) {
|
|
|
781
794
|
var tagFactory = (tag, ns) => (first, second) => {
|
|
782
795
|
const el = ns ? document.createElementNS(ns, tag) : document.createElement(tag);
|
|
783
796
|
if (first === void 0) return el;
|
|
784
|
-
if (
|
|
797
|
+
if (typeof first === "string") {
|
|
798
|
+
if (second !== void 0) {
|
|
799
|
+
el.setAttribute("class", first);
|
|
800
|
+
appendChildren(el, second);
|
|
801
|
+
return el;
|
|
802
|
+
}
|
|
785
803
|
el.textContent = first;
|
|
786
804
|
return el;
|
|
787
805
|
}
|
|
788
|
-
if (
|
|
789
|
-
el.
|
|
790
|
-
appendChildren(el, second);
|
|
806
|
+
if (typeof first === "number") {
|
|
807
|
+
el.textContent = String(first);
|
|
791
808
|
return el;
|
|
792
809
|
}
|
|
793
|
-
if (Array.isArray(first) || first instanceof Node) {
|
|
810
|
+
if (Array.isArray(first) || first instanceof Node || typeof first === "function") {
|
|
794
811
|
appendChildren(el, first);
|
|
795
812
|
return el;
|
|
796
813
|
}
|
|
@@ -799,7 +816,7 @@ var tagFactory = (tag, ns) => (first, second) => {
|
|
|
799
816
|
if (pClass != null) applyClass(el, pClass);
|
|
800
817
|
const pId = props.id;
|
|
801
818
|
if (pId != null) el.id = pId;
|
|
802
|
-
const pNodes = props.nodes;
|
|
819
|
+
const pNodes = second !== void 0 ? second : props.nodes;
|
|
803
820
|
if (pNodes != null) appendChildren(el, pNodes);
|
|
804
821
|
const pOn = props.on;
|
|
805
822
|
if (pOn) {
|
package/dist/ecosystem.d.cts
CHANGED
package/dist/ecosystem.d.ts
CHANGED
package/dist/ecosystem.js
CHANGED
|
@@ -7,16 +7,17 @@ import {
|
|
|
7
7
|
mobXAdapter,
|
|
8
8
|
reduxAdapter,
|
|
9
9
|
zustandAdapter
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-BTU3TJDS.js";
|
|
11
11
|
import "./chunk-K5ZUMYVS.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-F3FA4F32.js";
|
|
13
|
+
import "./chunk-PTQJDMRT.js";
|
|
14
|
+
import "./chunk-NEKUBFPT.js";
|
|
15
|
+
import "./chunk-CMBFNA7L.js";
|
|
16
|
+
import "./chunk-CHF5OHIA.js";
|
|
17
|
+
import "./chunk-EUZND3CB.js";
|
|
18
|
+
import "./chunk-WZSPOOER.js";
|
|
19
|
+
import "./chunk-ZD6OAMTH.js";
|
|
20
|
+
import "./chunk-5X6PP2UK.js";
|
|
20
21
|
export {
|
|
21
22
|
antdAdapter,
|
|
22
23
|
chakraAdapter,
|