sibujs 3.3.2 → 3.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/dist/browser.cjs +21 -4
- package/dist/browser.js +4 -4
- package/dist/build.cjs +3343 -3009
- package/dist/build.js +12 -11
- package/dist/cdn.global.js +7 -7
- package/dist/{chunk-AEOLHSSQ.js → chunk-3DVGCW7O.js} +72 -25
- package/dist/{chunk-6TCOWMGY.js → chunk-3Z2NGWQI.js} +1 -1
- package/dist/chunk-7ZHH77QA.js +9 -0
- package/dist/{chunk-2ARSB7NG.js → chunk-APFRCIRI.js} +2906 -2569
- package/dist/{chunk-62V653X2.js → chunk-AXFWGY32.js} +79 -44
- package/dist/{chunk-N5TQVEKE.js → chunk-BUKYCWHX.js} +1 -1
- package/dist/{chunk-655B7MMR.js → chunk-CEBWDD63.js} +15 -8
- package/dist/{chunk-YUBEOWII.js → chunk-ELXMRSVN.js} +16 -5
- package/dist/{chunk-FJIRS3FM.js → chunk-F7HW2NI5.js} +1 -3
- package/dist/{chunk-P7C7SEJV.js → chunk-FKQG7FTY.js} +5 -5
- package/dist/{chunk-RLTFJYDN.js → chunk-H5FI5WDP.js} +1 -1
- package/dist/{chunk-G6N3LMO2.js → chunk-ITWCTZYH.js} +1 -1
- package/dist/{chunk-YUR5SX7F.js → chunk-JCO7AHNU.js} +70 -59
- package/dist/{chunk-ZEUP4TUD.js → chunk-JNGGM2XE.js} +6 -6
- package/dist/{chunk-QCFBIVIQ.js → chunk-K35BAR4P.js} +1 -1
- package/dist/{chunk-JCQG2I2G.js → chunk-KZBEVFXZ.js} +1 -1
- package/dist/{chunk-FJO2ZL4Q.js → chunk-OAVXAFAY.js} +73 -16
- package/dist/{chunk-A7CZH3GN.js → chunk-ODXVQ3CS.js} +41 -20
- package/dist/{chunk-4NJEAPLI.js → chunk-OOUQUCNN.js} +1 -1
- package/dist/{chunk-5VH3GIDX.js → chunk-RT3IYFN2.js} +1 -1
- package/dist/{chunk-Q46YIQYW.js → chunk-S3V6ZXPI.js} +22 -5
- package/dist/{chunk-IQJ36UTJ.js → chunk-WSGLJYFI.js} +31 -24
- package/dist/{chunk-3JHCYHWN.js → chunk-WWV3SJ3L.js} +19 -13
- package/dist/data.cjs +16 -2
- package/dist/data.js +7 -6
- package/dist/devtools.cjs +71 -21
- package/dist/devtools.d.cts +12 -5
- package/dist/devtools.d.ts +12 -5
- package/dist/devtools.js +6 -5
- package/dist/ecosystem.cjs +11 -2
- package/dist/ecosystem.d.cts +1 -1
- package/dist/ecosystem.d.ts +1 -1
- package/dist/ecosystem.js +10 -9
- package/dist/extras.cjs +454 -250
- package/dist/extras.d.cts +2 -2
- package/dist/extras.d.ts +2 -2
- package/dist/extras.js +26 -22
- package/dist/index.cjs +3385 -3045
- package/dist/index.d.cts +1179 -1057
- package/dist/index.d.ts +1179 -1057
- package/dist/index.js +32 -19
- package/dist/motion.cjs +223 -204
- package/dist/motion.d.cts +8 -1
- package/dist/motion.d.ts +8 -1
- package/dist/motion.js +6 -3
- package/dist/patterns.cjs +13 -6
- package/dist/patterns.d.cts +4 -1
- package/dist/patterns.d.ts +4 -1
- package/dist/patterns.js +5 -5
- package/dist/performance.cjs +70 -56
- package/dist/performance.js +6 -5
- package/dist/plugins.cjs +98 -42
- package/dist/plugins.d.cts +2 -1
- package/dist/plugins.d.ts +2 -1
- package/dist/plugins.js +89 -36
- package/dist/ssr.cjs +112 -91
- package/dist/ssr.d.cts +8 -1
- package/dist/ssr.d.ts +8 -1
- package/dist/ssr.js +9 -8
- package/dist/{tagFactory-S17H2qxu.d.ts → tagFactory-Bzupt4Pj.d.cts} +1 -1
- package/dist/{tagFactory-S17H2qxu.d.cts → tagFactory-Bzupt4Pj.d.ts} +1 -1
- package/dist/testing.cjs +18 -4
- package/dist/testing.js +18 -7
- package/dist/ui.cjs +322 -281
- package/dist/ui.d.cts +0 -20
- package/dist/ui.d.ts +0 -20
- package/dist/ui.js +27 -21
- package/dist/widgets.cjs +75 -13
- package/dist/widgets.d.cts +6 -1
- package/dist/widgets.d.ts +6 -1
- package/dist/widgets.js +7 -6
- package/package.json +4 -1
package/dist/motion.d.ts
CHANGED
|
@@ -134,6 +134,13 @@ declare function viewTransition(callback: () => void | Promise<void>): {
|
|
|
134
134
|
isTransitioning: () => boolean;
|
|
135
135
|
};
|
|
136
136
|
|
|
137
|
+
/**
|
|
138
|
+
* One-shot check of the `prefers-reduced-motion: reduce` media query. Returns
|
|
139
|
+
* false under SSR / where `matchMedia` is unavailable. Use this for imperative
|
|
140
|
+
* "should I animate right now?" decisions; use {@link reducedMotion} when you
|
|
141
|
+
* need a value that reacts to the user changing the setting.
|
|
142
|
+
*/
|
|
143
|
+
declare function prefersReducedMotion(): boolean;
|
|
137
144
|
/**
|
|
138
145
|
* reducedMotion returns a reactive boolean tracking whether the user
|
|
139
146
|
* prefers reduced motion via the `prefers-reduced-motion` media query.
|
|
@@ -185,4 +192,4 @@ interface SpringOptions {
|
|
|
185
192
|
*/
|
|
186
193
|
declare function springSignal(initial: number, options?: SpringOptions): [get: () => number, set: (target: number) => void, dispose: () => void];
|
|
187
194
|
|
|
188
|
-
export { type AnimationPreset, type PresetOptions, type SlideDirection, type SpringOptions, TransitionGroup, type TransitionGroupOptions, type TransitionOptions, animate, bounceIn, bounceOut, fadeIn, fadeOut, flipIn, pulse, reducedMotion, scaleDown, scaleUp, sequence, shake, slideIn, slideOut, spring, springSignal, stagger, transition, viewTransition };
|
|
195
|
+
export { type AnimationPreset, type PresetOptions, type SlideDirection, type SpringOptions, TransitionGroup, type TransitionGroupOptions, type TransitionOptions, animate, bounceIn, bounceOut, fadeIn, fadeOut, flipIn, prefersReducedMotion, pulse, reducedMotion, scaleDown, scaleUp, sequence, shake, slideIn, slideOut, spring, springSignal, stagger, transition, viewTransition };
|
package/dist/motion.js
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
fadeIn,
|
|
7
7
|
fadeOut,
|
|
8
8
|
flipIn,
|
|
9
|
+
prefersReducedMotion,
|
|
9
10
|
pulse,
|
|
10
11
|
reducedMotion,
|
|
11
12
|
scaleDown,
|
|
@@ -19,9 +20,10 @@ import {
|
|
|
19
20
|
stagger,
|
|
20
21
|
transition,
|
|
21
22
|
viewTransition
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
23
|
+
} from "./chunk-WSGLJYFI.js";
|
|
24
|
+
import "./chunk-5VGSK6D2.js";
|
|
25
|
+
import "./chunk-KZBEVFXZ.js";
|
|
26
|
+
import "./chunk-OOUQUCNN.js";
|
|
25
27
|
import "./chunk-COY6PUD2.js";
|
|
26
28
|
export {
|
|
27
29
|
TransitionGroup,
|
|
@@ -31,6 +33,7 @@ export {
|
|
|
31
33
|
fadeIn,
|
|
32
34
|
fadeOut,
|
|
33
35
|
flipIn,
|
|
36
|
+
prefersReducedMotion,
|
|
34
37
|
pulse,
|
|
35
38
|
reducedMotion,
|
|
36
39
|
scaleDown,
|
package/dist/patterns.cjs
CHANGED
|
@@ -481,7 +481,7 @@ function forEachSubscriber(signal2, visit) {
|
|
|
481
481
|
|
|
482
482
|
// src/reactivity/track.ts
|
|
483
483
|
var _isDev3 = isDev();
|
|
484
|
-
var _runtimeVersion = true ? "3.
|
|
484
|
+
var _runtimeVersion = true ? "3.4.0" : "dev";
|
|
485
485
|
var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
|
|
486
486
|
function resolveReactiveApi() {
|
|
487
487
|
const g = globalThis;
|
|
@@ -886,7 +886,14 @@ function effect(effectFn, options) {
|
|
|
886
886
|
|
|
887
887
|
// src/patterns/persist.ts
|
|
888
888
|
function persisted(key, initial, options = {}) {
|
|
889
|
-
const storage =
|
|
889
|
+
const storage = (() => {
|
|
890
|
+
try {
|
|
891
|
+
if (options.session) return typeof sessionStorage !== "undefined" ? sessionStorage : null;
|
|
892
|
+
return typeof localStorage !== "undefined" ? localStorage : null;
|
|
893
|
+
} catch {
|
|
894
|
+
return null;
|
|
895
|
+
}
|
|
896
|
+
})();
|
|
890
897
|
const serialize = options.serialize || JSON.stringify;
|
|
891
898
|
const safeReviver = (k, v) => isUnsafeKey(k) ? void 0 : v;
|
|
892
899
|
const deserialize = options.deserialize || ((raw) => JSON.parse(raw, safeReviver));
|
|
@@ -895,7 +902,7 @@ function persisted(key, initial, options = {}) {
|
|
|
895
902
|
const syncTabs = options.session ? false : options.syncTabs ?? true;
|
|
896
903
|
let restored = initial;
|
|
897
904
|
try {
|
|
898
|
-
let raw = storage.getItem(key);
|
|
905
|
+
let raw = storage ? storage.getItem(key) : null;
|
|
899
906
|
if (raw !== null) {
|
|
900
907
|
if (decrypt) raw = decrypt(raw);
|
|
901
908
|
const parsed = deserialize(raw);
|
|
@@ -911,12 +918,12 @@ function persisted(key, initial, options = {}) {
|
|
|
911
918
|
try {
|
|
912
919
|
let serialized = serialize(current);
|
|
913
920
|
if (encrypt) serialized = encrypt(serialized);
|
|
914
|
-
storage
|
|
921
|
+
storage?.setItem(key, serialized);
|
|
915
922
|
} catch {
|
|
916
923
|
}
|
|
917
924
|
});
|
|
918
925
|
let storageListener = null;
|
|
919
|
-
if (syncTabs && typeof window !== "undefined") {
|
|
926
|
+
if (syncTabs && storage && typeof window !== "undefined") {
|
|
920
927
|
storageListener = (e) => {
|
|
921
928
|
if (e.storageArea !== storage || e.key !== key) return;
|
|
922
929
|
if (e.newValue === null) {
|
|
@@ -1298,7 +1305,7 @@ function globalStore(config) {
|
|
|
1298
1305
|
next();
|
|
1299
1306
|
}
|
|
1300
1307
|
function select(selector) {
|
|
1301
|
-
return
|
|
1308
|
+
return () => selector(getState());
|
|
1302
1309
|
}
|
|
1303
1310
|
function subscribe(callback) {
|
|
1304
1311
|
listeners.add(callback);
|
package/dist/patterns.d.cts
CHANGED
|
@@ -36,7 +36,10 @@ declare function machine<S extends string, E extends string, C extends Record<st
|
|
|
36
36
|
* @param key Storage key
|
|
37
37
|
* @param initial Default value when no persisted value exists
|
|
38
38
|
* @param options Storage options
|
|
39
|
-
* @returns
|
|
39
|
+
* @returns The same `[getter, setter]` tuple as `signal()`. For localStorage
|
|
40
|
+
* (cross-tab sync on), the setter additionally carries a non-enumerable
|
|
41
|
+
* `dispose()` method — call `setter.dispose()` on unmount to remove the
|
|
42
|
+
* `storage` event listener; otherwise it lives for the page's lifetime.
|
|
40
43
|
*
|
|
41
44
|
* @example
|
|
42
45
|
* ```ts
|
package/dist/patterns.d.ts
CHANGED
|
@@ -36,7 +36,10 @@ declare function machine<S extends string, E extends string, C extends Record<st
|
|
|
36
36
|
* @param key Storage key
|
|
37
37
|
* @param initial Default value when no persisted value exists
|
|
38
38
|
* @param options Storage options
|
|
39
|
-
* @returns
|
|
39
|
+
* @returns The same `[getter, setter]` tuple as `signal()`. For localStorage
|
|
40
|
+
* (cross-tab sync on), the setter additionally carries a non-enumerable
|
|
41
|
+
* `dispose()` method — call `setter.dispose()` on unmount to remove the
|
|
42
|
+
* `storage` event listener; otherwise it lives for the page's lifetime.
|
|
40
43
|
*
|
|
41
44
|
* @example
|
|
42
45
|
* ```ts
|
package/dist/patterns.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
optimisticList,
|
|
6
6
|
persisted,
|
|
7
7
|
timeline
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-CEBWDD63.js";
|
|
9
9
|
import {
|
|
10
10
|
RenderProp,
|
|
11
11
|
assertType,
|
|
@@ -23,11 +23,11 @@ import {
|
|
|
23
23
|
withWrapper
|
|
24
24
|
} from "./chunk-VJE6DDYM.js";
|
|
25
25
|
import "./chunk-H3SRKIYX.js";
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-ITWCTZYH.js";
|
|
27
|
+
import "./chunk-BUKYCWHX.js";
|
|
28
28
|
import "./chunk-S3NFJO6L.js";
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-KZBEVFXZ.js";
|
|
30
|
+
import "./chunk-OOUQUCNN.js";
|
|
31
31
|
import "./chunk-COY6PUD2.js";
|
|
32
32
|
export {
|
|
33
33
|
RenderProp,
|
package/dist/performance.cjs
CHANGED
|
@@ -58,6 +58,12 @@ __export(performance_exports, {
|
|
|
58
58
|
});
|
|
59
59
|
module.exports = __toCommonJS(performance_exports);
|
|
60
60
|
|
|
61
|
+
// src/utils/globalSingleton.ts
|
|
62
|
+
function globalSingleton(key, create) {
|
|
63
|
+
const g = globalThis;
|
|
64
|
+
return g[key] ?? (g[key] = create());
|
|
65
|
+
}
|
|
66
|
+
|
|
61
67
|
// src/performance/scheduler.ts
|
|
62
68
|
var Priority = {
|
|
63
69
|
IMMEDIATE: 0,
|
|
@@ -66,12 +72,15 @@ var Priority = {
|
|
|
66
72
|
LOW: 3,
|
|
67
73
|
IDLE: 4
|
|
68
74
|
};
|
|
69
|
-
var
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
+
var _sched = globalSingleton(/* @__PURE__ */ Symbol.for("sibujs.scheduler.v1"), () => ({
|
|
76
|
+
taskIdCounter: 0,
|
|
77
|
+
taskQueue: [],
|
|
78
|
+
isProcessing: false,
|
|
79
|
+
scheduledKind: null,
|
|
80
|
+
scheduledHandle: null,
|
|
81
|
+
microtaskScheduled: false
|
|
82
|
+
}));
|
|
83
|
+
var taskQueue = _sched.taskQueue;
|
|
75
84
|
function insertTask(task) {
|
|
76
85
|
let i = taskQueue.length;
|
|
77
86
|
while (i > 0 && taskQueue[i - 1].priority > task.priority) {
|
|
@@ -80,8 +89,8 @@ function insertTask(task) {
|
|
|
80
89
|
taskQueue.splice(i, 0, task);
|
|
81
90
|
}
|
|
82
91
|
function processQueue() {
|
|
83
|
-
if (isProcessing || taskQueue.length === 0) return;
|
|
84
|
-
isProcessing = true;
|
|
92
|
+
if (_sched.isProcessing || taskQueue.length === 0) return;
|
|
93
|
+
_sched.isProcessing = true;
|
|
85
94
|
const startTime = performance.now();
|
|
86
95
|
const timeSlice = 5;
|
|
87
96
|
while (taskQueue.length > 0) {
|
|
@@ -100,64 +109,69 @@ function processQueue() {
|
|
|
100
109
|
console.error("[Scheduler] Task error:", e);
|
|
101
110
|
}
|
|
102
111
|
}
|
|
103
|
-
isProcessing = false;
|
|
112
|
+
_sched.isProcessing = false;
|
|
104
113
|
if (taskQueue.length > 0) {
|
|
105
114
|
scheduleFrame();
|
|
106
115
|
}
|
|
107
116
|
}
|
|
108
117
|
var TIER_SPEED = { microtask: 0, frame: 1, timeout: 2, idle: 3 };
|
|
109
118
|
function cancelScheduled() {
|
|
110
|
-
if (scheduledHandle !== null) {
|
|
111
|
-
if (scheduledKind === "frame") cancelAnimationFrame(scheduledHandle);
|
|
112
|
-
else if (scheduledKind === "idle" && typeof cancelIdleCallback !== "undefined")
|
|
113
|
-
|
|
119
|
+
if (_sched.scheduledHandle !== null) {
|
|
120
|
+
if (_sched.scheduledKind === "frame") cancelAnimationFrame(_sched.scheduledHandle);
|
|
121
|
+
else if (_sched.scheduledKind === "idle" && typeof cancelIdleCallback !== "undefined")
|
|
122
|
+
cancelIdleCallback(_sched.scheduledHandle);
|
|
123
|
+
else if (_sched.scheduledKind === "timeout") clearTimeout(_sched.scheduledHandle);
|
|
114
124
|
}
|
|
115
|
-
scheduledHandle = null;
|
|
116
|
-
scheduledKind = null;
|
|
125
|
+
_sched.scheduledHandle = null;
|
|
126
|
+
_sched.scheduledKind = null;
|
|
117
127
|
}
|
|
118
128
|
function scheduleFrame() {
|
|
119
129
|
const nextTask = taskQueue.find((t) => !t.cancelled);
|
|
120
130
|
if (!nextTask) return;
|
|
121
|
-
const desired = nextTask.priority <= Priority.USER_BLOCKING ? "microtask" : nextTask.priority === Priority.IDLE ? typeof requestIdleCallback !== "undefined" ? "idle" : "timeout" :
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
131
|
+
const desired = nextTask.priority <= Priority.USER_BLOCKING ? "microtask" : nextTask.priority === Priority.IDLE ? typeof requestIdleCallback !== "undefined" ? "idle" : "timeout" : (
|
|
132
|
+
// NORMAL/LOW prefer a frame, but rAF is absent under SSR — fall back
|
|
133
|
+
// to a timeout so startTransition()/deferredValue() don't throw.
|
|
134
|
+
typeof requestAnimationFrame !== "undefined" ? "frame" : "timeout"
|
|
135
|
+
);
|
|
136
|
+
if (_sched.microtaskScheduled) return;
|
|
137
|
+
if (_sched.scheduledKind !== null) {
|
|
138
|
+
if (TIER_SPEED[_sched.scheduledKind] <= TIER_SPEED[desired]) return;
|
|
125
139
|
cancelScheduled();
|
|
126
140
|
}
|
|
127
141
|
if (desired === "microtask") {
|
|
128
|
-
microtaskScheduled = true;
|
|
129
|
-
scheduledKind = "microtask";
|
|
142
|
+
_sched.microtaskScheduled = true;
|
|
143
|
+
_sched.scheduledKind = "microtask";
|
|
130
144
|
queueMicrotask(() => {
|
|
131
|
-
microtaskScheduled = false;
|
|
132
|
-
scheduledKind = null;
|
|
145
|
+
_sched.microtaskScheduled = false;
|
|
146
|
+
_sched.scheduledKind = null;
|
|
133
147
|
processQueue();
|
|
134
148
|
});
|
|
135
149
|
} else if (desired === "idle") {
|
|
136
|
-
scheduledKind = "idle";
|
|
137
|
-
scheduledHandle = requestIdleCallback(() => {
|
|
138
|
-
scheduledKind = null;
|
|
139
|
-
scheduledHandle = null;
|
|
150
|
+
_sched.scheduledKind = "idle";
|
|
151
|
+
_sched.scheduledHandle = requestIdleCallback(() => {
|
|
152
|
+
_sched.scheduledKind = null;
|
|
153
|
+
_sched.scheduledHandle = null;
|
|
140
154
|
processQueue();
|
|
141
155
|
});
|
|
142
156
|
} else if (desired === "timeout") {
|
|
143
|
-
scheduledKind = "timeout";
|
|
144
|
-
scheduledHandle = setTimeout(() => {
|
|
145
|
-
scheduledKind = null;
|
|
146
|
-
scheduledHandle = null;
|
|
157
|
+
_sched.scheduledKind = "timeout";
|
|
158
|
+
_sched.scheduledHandle = setTimeout(() => {
|
|
159
|
+
_sched.scheduledKind = null;
|
|
160
|
+
_sched.scheduledHandle = null;
|
|
147
161
|
processQueue();
|
|
148
162
|
}, 50);
|
|
149
163
|
} else {
|
|
150
|
-
scheduledKind = "frame";
|
|
151
|
-
scheduledHandle = requestAnimationFrame(() => {
|
|
152
|
-
scheduledKind = null;
|
|
153
|
-
scheduledHandle = null;
|
|
164
|
+
_sched.scheduledKind = "frame";
|
|
165
|
+
_sched.scheduledHandle = requestAnimationFrame(() => {
|
|
166
|
+
_sched.scheduledKind = null;
|
|
167
|
+
_sched.scheduledHandle = null;
|
|
154
168
|
processQueue();
|
|
155
169
|
});
|
|
156
170
|
}
|
|
157
171
|
}
|
|
158
172
|
function scheduleUpdate(priority, callback) {
|
|
159
173
|
const task = {
|
|
160
|
-
id: taskIdCounter++,
|
|
174
|
+
id: _sched.taskIdCounter++,
|
|
161
175
|
priority,
|
|
162
176
|
callback,
|
|
163
177
|
cancelled: false
|
|
@@ -178,15 +192,15 @@ function scheduleUpdate(priority, callback) {
|
|
|
178
192
|
};
|
|
179
193
|
}
|
|
180
194
|
function flushScheduler() {
|
|
181
|
-
if (scheduledHandle !== null) {
|
|
182
|
-
if (scheduledKind === "frame") cancelAnimationFrame(scheduledHandle);
|
|
183
|
-
else if (scheduledKind === "idle" && typeof cancelIdleCallback !== "undefined") {
|
|
184
|
-
cancelIdleCallback(scheduledHandle);
|
|
185
|
-
} else if (scheduledKind === "timeout") clearTimeout(scheduledHandle);
|
|
186
|
-
}
|
|
187
|
-
scheduledHandle = null;
|
|
188
|
-
scheduledKind = null;
|
|
189
|
-
microtaskScheduled = false;
|
|
195
|
+
if (_sched.scheduledHandle !== null) {
|
|
196
|
+
if (_sched.scheduledKind === "frame") cancelAnimationFrame(_sched.scheduledHandle);
|
|
197
|
+
else if (_sched.scheduledKind === "idle" && typeof cancelIdleCallback !== "undefined") {
|
|
198
|
+
cancelIdleCallback(_sched.scheduledHandle);
|
|
199
|
+
} else if (_sched.scheduledKind === "timeout") clearTimeout(_sched.scheduledHandle);
|
|
200
|
+
}
|
|
201
|
+
_sched.scheduledHandle = null;
|
|
202
|
+
_sched.scheduledKind = null;
|
|
203
|
+
_sched.microtaskScheduled = false;
|
|
190
204
|
while (taskQueue.length > 0) {
|
|
191
205
|
const task = taskQueue.shift();
|
|
192
206
|
if (!task) break;
|
|
@@ -194,7 +208,7 @@ function flushScheduler() {
|
|
|
194
208
|
task.callback();
|
|
195
209
|
}
|
|
196
210
|
}
|
|
197
|
-
isProcessing = false;
|
|
211
|
+
_sched.isProcessing = false;
|
|
198
212
|
}
|
|
199
213
|
function pendingTasks() {
|
|
200
214
|
return taskQueue.filter((t) => !t.cancelled).length;
|
|
@@ -654,7 +668,7 @@ function forEachSubscriber(signal2, visit) {
|
|
|
654
668
|
|
|
655
669
|
// src/reactivity/track.ts
|
|
656
670
|
var _isDev3 = isDev();
|
|
657
|
-
var _runtimeVersion = true ? "3.
|
|
671
|
+
var _runtimeVersion = true ? "3.4.0" : "dev";
|
|
658
672
|
var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
|
|
659
673
|
function resolveReactiveApi() {
|
|
660
674
|
const g = globalThis;
|
|
@@ -1012,16 +1026,18 @@ function transitionState() {
|
|
|
1012
1026
|
}
|
|
1013
1027
|
return [isPending, transition];
|
|
1014
1028
|
}
|
|
1015
|
-
var
|
|
1016
|
-
|
|
1029
|
+
var _ids = globalSingleton(/* @__PURE__ */ Symbol.for("sibujs.uniqueId.v1"), () => ({
|
|
1030
|
+
counter: 0,
|
|
1031
|
+
prefix: "sibu"
|
|
1032
|
+
}));
|
|
1017
1033
|
function resetIdCounter() {
|
|
1018
|
-
|
|
1034
|
+
_ids.counter = 0;
|
|
1019
1035
|
}
|
|
1020
1036
|
function setIdPrefix(prefix) {
|
|
1021
|
-
|
|
1037
|
+
_ids.prefix = prefix;
|
|
1022
1038
|
}
|
|
1023
1039
|
function uniqueId(suffix) {
|
|
1024
|
-
const id = `${
|
|
1040
|
+
const id = `${_ids.prefix}-${_ids.counter++}`;
|
|
1025
1041
|
return suffix ? `${id}-${suffix}` : id;
|
|
1026
1042
|
}
|
|
1027
1043
|
|
|
@@ -1291,7 +1307,6 @@ function normalizedStore(schema) {
|
|
|
1291
1307
|
}
|
|
1292
1308
|
function normalize(data, schema) {
|
|
1293
1309
|
const entities = {};
|
|
1294
|
-
const idKey = schema.idKey || "id";
|
|
1295
1310
|
function ensureTable(name) {
|
|
1296
1311
|
if (!entities[name]) {
|
|
1297
1312
|
entities[name] = {};
|
|
@@ -1307,7 +1322,7 @@ function normalize(data, schema) {
|
|
|
1307
1322
|
for (const [field, relationType] of Object.entries(entitySchema.relations)) {
|
|
1308
1323
|
const value = entity[field];
|
|
1309
1324
|
if (value == null) continue;
|
|
1310
|
-
const relSchema = { name: relationType
|
|
1325
|
+
const relSchema = { name: relationType };
|
|
1311
1326
|
if (Array.isArray(value)) {
|
|
1312
1327
|
flat[field] = value.map((item) => normalizeEntity(item, relSchema));
|
|
1313
1328
|
} else if (typeof value === "object") {
|
|
@@ -1330,13 +1345,12 @@ function denormalize(id, entities, schema) {
|
|
|
1330
1345
|
if (!table) return void 0;
|
|
1331
1346
|
const entity = table[id];
|
|
1332
1347
|
if (!entity) return void 0;
|
|
1333
|
-
const idKey = schema.idKey || "id";
|
|
1334
1348
|
const result = { ...entity };
|
|
1335
1349
|
if (schema.relations) {
|
|
1336
1350
|
for (const [field, relationType] of Object.entries(schema.relations)) {
|
|
1337
1351
|
const value = entity[field];
|
|
1338
1352
|
if (value == null) continue;
|
|
1339
|
-
const relSchema = { name: relationType
|
|
1353
|
+
const relSchema = { name: relationType };
|
|
1340
1354
|
if (Array.isArray(value)) {
|
|
1341
1355
|
result[field] = value.map((relId) => denormalize(relId, entities, relSchema));
|
|
1342
1356
|
} else if (typeof value === "string") {
|
package/dist/performance.js
CHANGED
|
@@ -33,16 +33,17 @@ import {
|
|
|
33
33
|
transitionState,
|
|
34
34
|
uniqueId,
|
|
35
35
|
yieldToMain
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-JCO7AHNU.js";
|
|
37
37
|
import {
|
|
38
38
|
trustHTML
|
|
39
39
|
} from "./chunk-EX77FXTT.js";
|
|
40
|
-
import "./chunk-
|
|
40
|
+
import "./chunk-7ZHH77QA.js";
|
|
41
41
|
import "./chunk-L3GAGWCC.js";
|
|
42
|
-
import "./chunk-
|
|
42
|
+
import "./chunk-BUKYCWHX.js";
|
|
43
43
|
import "./chunk-S3NFJO6L.js";
|
|
44
|
-
import "./chunk-
|
|
45
|
-
import "./chunk-
|
|
44
|
+
import "./chunk-5VGSK6D2.js";
|
|
45
|
+
import "./chunk-KZBEVFXZ.js";
|
|
46
|
+
import "./chunk-OOUQUCNN.js";
|
|
46
47
|
import "./chunk-COY6PUD2.js";
|
|
47
48
|
export {
|
|
48
49
|
DOMPool,
|