sibujs 3.3.2 → 3.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.cjs +21 -4
- package/dist/browser.js +4 -4
- package/dist/build.cjs +10 -3
- package/dist/build.js +11 -11
- package/dist/cdn.global.js +7 -7
- package/dist/{chunk-N5TQVEKE.js → chunk-23VT3KZB.js} +1 -1
- package/dist/{chunk-IQJ36UTJ.js → chunk-25LY5SRH.js} +31 -24
- package/dist/{chunk-6TCOWMGY.js → chunk-5K6RVA2S.js} +1 -1
- package/dist/{chunk-YUBEOWII.js → chunk-5Y34FWED.js} +16 -5
- package/dist/chunk-7ZHH77QA.js +9 -0
- package/dist/{chunk-G6N3LMO2.js → chunk-F3HO2MP7.js} +1 -1
- package/dist/{chunk-FJIRS3FM.js → chunk-F7HW2NI5.js} +1 -3
- package/dist/{chunk-AEOLHSSQ.js → chunk-IEYFHN5V.js} +72 -25
- package/dist/{chunk-FJO2ZL4Q.js → chunk-IQN5W7GE.js} +73 -16
- package/dist/{chunk-JCQG2I2G.js → chunk-IWFE4AHO.js} +1 -1
- package/dist/{chunk-2ARSB7NG.js → chunk-MYXEBADX.js} +27 -20
- package/dist/{chunk-A7CZH3GN.js → chunk-QCQQ2N5H.js} +41 -20
- package/dist/{chunk-Q46YIQYW.js → chunk-QTOOBABV.js} +22 -5
- package/dist/{chunk-ZEUP4TUD.js → chunk-RZKGMHH4.js} +6 -6
- package/dist/{chunk-QCFBIVIQ.js → chunk-SBPUXWCE.js} +1 -1
- package/dist/{chunk-RLTFJYDN.js → chunk-TBDTU7UO.js} +1 -1
- package/dist/{chunk-P7C7SEJV.js → chunk-TVCCXPU2.js} +5 -5
- package/dist/{chunk-4NJEAPLI.js → chunk-UOMYIAG6.js} +1 -1
- package/dist/{chunk-655B7MMR.js → chunk-WFUUT6TG.js} +15 -8
- package/dist/{chunk-YUR5SX7F.js → chunk-WTFMV2RU.js} +70 -59
- package/dist/{chunk-3JHCYHWN.js → chunk-WWV3SJ3L.js} +19 -13
- package/dist/{chunk-62V653X2.js → chunk-Y35NQNLG.js} +79 -44
- package/dist/{chunk-5VH3GIDX.js → chunk-ZXCZWMZT.js} +1 -1
- 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.js +10 -9
- package/dist/extras.cjs +454 -250
- package/dist/extras.d.cts +1 -1
- package/dist/extras.d.ts +1 -1
- package/dist/extras.js +26 -22
- package/dist/index.cjs +10 -3
- package/dist/index.d.cts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +19 -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 +90 -37
- 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/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 +28 -22
- 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 +1 -1
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__resetIdCounter,
|
|
3
|
-
createId
|
|
4
|
-
} from "./chunk-CCSJMTRN.js";
|
|
5
1
|
import {
|
|
6
2
|
a,
|
|
7
3
|
abbr,
|
|
@@ -139,33 +135,32 @@ import {
|
|
|
139
135
|
use,
|
|
140
136
|
var_,
|
|
141
137
|
video
|
|
142
|
-
} from "./chunk-
|
|
138
|
+
} from "./chunk-5K6RVA2S.js";
|
|
143
139
|
import {
|
|
144
140
|
watch
|
|
145
|
-
} from "./chunk-
|
|
141
|
+
} from "./chunk-TBDTU7UO.js";
|
|
142
|
+
import {
|
|
143
|
+
__resetIdCounter,
|
|
144
|
+
createId
|
|
145
|
+
} from "./chunk-CCSJMTRN.js";
|
|
146
146
|
import {
|
|
147
147
|
trustHTML
|
|
148
148
|
} from "./chunk-EX77FXTT.js";
|
|
149
149
|
import {
|
|
150
150
|
context
|
|
151
|
-
} from "./chunk-
|
|
151
|
+
} from "./chunk-ZXCZWMZT.js";
|
|
152
152
|
import {
|
|
153
153
|
SVG_NS,
|
|
154
154
|
bindChildNode,
|
|
155
155
|
tagFactory
|
|
156
|
-
} from "./chunk-
|
|
156
|
+
} from "./chunk-RZKGMHH4.js";
|
|
157
157
|
import {
|
|
158
158
|
bindAttribute,
|
|
159
159
|
bindDynamic
|
|
160
|
-
} from "./chunk-
|
|
160
|
+
} from "./chunk-SBPUXWCE.js";
|
|
161
161
|
import {
|
|
162
162
|
derived
|
|
163
|
-
} from "./chunk-
|
|
164
|
-
import {
|
|
165
|
-
checkLeaks,
|
|
166
|
-
dispose,
|
|
167
|
-
registerDisposer
|
|
168
|
-
} from "./chunk-5VGSK6D2.js";
|
|
163
|
+
} from "./chunk-F3HO2MP7.js";
|
|
169
164
|
import {
|
|
170
165
|
isEventHandlerAttr,
|
|
171
166
|
isUrlAttribute,
|
|
@@ -175,7 +170,7 @@ import {
|
|
|
175
170
|
import {
|
|
176
171
|
effect,
|
|
177
172
|
on
|
|
178
|
-
} from "./chunk-
|
|
173
|
+
} from "./chunk-23VT3KZB.js";
|
|
179
174
|
import {
|
|
180
175
|
disableSSR,
|
|
181
176
|
enableSSR,
|
|
@@ -185,12 +180,17 @@ import {
|
|
|
185
180
|
runInSSRContext,
|
|
186
181
|
withSSR
|
|
187
182
|
} from "./chunk-S3NFJO6L.js";
|
|
183
|
+
import {
|
|
184
|
+
checkLeaks,
|
|
185
|
+
dispose,
|
|
186
|
+
registerDisposer
|
|
187
|
+
} from "./chunk-5VGSK6D2.js";
|
|
188
188
|
import {
|
|
189
189
|
batch,
|
|
190
190
|
enqueueBatchedSignal,
|
|
191
191
|
isBatching,
|
|
192
192
|
signal
|
|
193
|
-
} from "./chunk-
|
|
193
|
+
} from "./chunk-IWFE4AHO.js";
|
|
194
194
|
import {
|
|
195
195
|
notifySubscribers,
|
|
196
196
|
recordDependency,
|
|
@@ -200,7 +200,7 @@ import {
|
|
|
200
200
|
suspendTracking,
|
|
201
201
|
track,
|
|
202
202
|
untracked
|
|
203
|
-
} from "./chunk-
|
|
203
|
+
} from "./chunk-UOMYIAG6.js";
|
|
204
204
|
import {
|
|
205
205
|
__export,
|
|
206
206
|
devAssert,
|
|
@@ -2350,7 +2350,6 @@ function Suspense({ nodes, fallback }) {
|
|
|
2350
2350
|
}
|
|
2351
2351
|
|
|
2352
2352
|
// src/components/ErrorDisplay.ts
|
|
2353
|
-
var _isDev3 = isDev();
|
|
2354
2353
|
var STYLES = `
|
|
2355
2354
|
.sibu-error-display {
|
|
2356
2355
|
border: 1px solid var(--sibu-err-border, #e5484d);
|
|
@@ -2661,7 +2660,7 @@ function ErrorDisplay(props) {
|
|
|
2661
2660
|
injectStyles();
|
|
2662
2661
|
const severity = props.severity ?? "error";
|
|
2663
2662
|
const normalized = normalizeError(props.error);
|
|
2664
|
-
const showDetails = props.alwaysShowDetails ??
|
|
2663
|
+
const showDetails = props.alwaysShowDetails ?? isDev();
|
|
2665
2664
|
const headline = props.title ?? normalized.message;
|
|
2666
2665
|
const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace("T", " ").slice(0, 19);
|
|
2667
2666
|
const [copyLabel, setCopyLabel] = signal("Copy");
|
|
@@ -3148,6 +3147,11 @@ function Loading(props = {}) {
|
|
|
3148
3147
|
if (variant === "dots") {
|
|
3149
3148
|
return div({
|
|
3150
3149
|
class: `sibu-loading${sizeClass}`,
|
|
3150
|
+
role: "status",
|
|
3151
|
+
"aria-live": "polite",
|
|
3152
|
+
// When there's no visible text, give the live region an accessible name
|
|
3153
|
+
// so it isn't announced as an empty status.
|
|
3154
|
+
"aria-label": text2 ? void 0 : "Loading",
|
|
3151
3155
|
nodes: [
|
|
3152
3156
|
div({
|
|
3153
3157
|
class: "sibu-loading-dots",
|
|
@@ -3163,6 +3167,9 @@ function Loading(props = {}) {
|
|
|
3163
3167
|
}
|
|
3164
3168
|
return div({
|
|
3165
3169
|
class: `sibu-loading${sizeClass}`,
|
|
3170
|
+
role: "status",
|
|
3171
|
+
"aria-live": "polite",
|
|
3172
|
+
"aria-label": text2 ? void 0 : "Loading",
|
|
3166
3173
|
nodes: [
|
|
3167
3174
|
div({ class: "sibu-loading-spinner" }),
|
|
3168
3175
|
text2 ? span({ class: "sibu-loading-text", nodes: text2 }) : null
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
globalSingleton
|
|
3
|
+
} from "./chunk-7ZHH77QA.js";
|
|
1
4
|
import {
|
|
2
5
|
div,
|
|
3
6
|
span
|
|
4
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-5K6RVA2S.js";
|
|
5
8
|
import {
|
|
6
9
|
isEventHandlerAttr,
|
|
7
10
|
sanitizeUrl,
|
|
@@ -9,11 +12,14 @@ import {
|
|
|
9
12
|
} from "./chunk-L3GAGWCC.js";
|
|
10
13
|
import {
|
|
11
14
|
effect
|
|
12
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-23VT3KZB.js";
|
|
16
|
+
import {
|
|
17
|
+
registerDisposer
|
|
18
|
+
} from "./chunk-5VGSK6D2.js";
|
|
13
19
|
import {
|
|
14
20
|
batch,
|
|
15
21
|
signal
|
|
16
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-IWFE4AHO.js";
|
|
17
23
|
|
|
18
24
|
// src/platform/head.ts
|
|
19
25
|
var HEAD_URL_ATTRS = /* @__PURE__ */ new Set(["href", "src"]);
|
|
@@ -139,6 +145,7 @@ function Head(props) {
|
|
|
139
145
|
}
|
|
140
146
|
};
|
|
141
147
|
apply();
|
|
148
|
+
registerDisposer(anchor, cleanup);
|
|
142
149
|
return anchor;
|
|
143
150
|
}
|
|
144
151
|
function setStructuredData(data) {
|
|
@@ -375,8 +382,14 @@ function createWorkerPool(workerFn2, poolSize) {
|
|
|
375
382
|
}
|
|
376
383
|
|
|
377
384
|
// src/platform/wasm.ts
|
|
378
|
-
var moduleCache =
|
|
379
|
-
|
|
385
|
+
var moduleCache = globalSingleton(
|
|
386
|
+
/* @__PURE__ */ Symbol.for("sibujs.wasm.moduleCache.v1"),
|
|
387
|
+
() => /* @__PURE__ */ new Map()
|
|
388
|
+
);
|
|
389
|
+
var instanceCache = globalSingleton(
|
|
390
|
+
/* @__PURE__ */ Symbol.for("sibujs.wasm.instanceCache.v1"),
|
|
391
|
+
() => /* @__PURE__ */ new Map()
|
|
392
|
+
);
|
|
380
393
|
function wasm(source, config = {}) {
|
|
381
394
|
const [instance, setInstance] = signal(null);
|
|
382
395
|
const [loading, setLoading] = signal(true);
|
|
@@ -537,7 +550,10 @@ function isWasmCached(key) {
|
|
|
537
550
|
}
|
|
538
551
|
|
|
539
552
|
// src/platform/microfrontend.ts
|
|
540
|
-
var moduleCache2 =
|
|
553
|
+
var moduleCache2 = globalSingleton(
|
|
554
|
+
/* @__PURE__ */ Symbol.for("sibujs.microfrontend.moduleCache.v1"),
|
|
555
|
+
() => /* @__PURE__ */ new Map()
|
|
556
|
+
);
|
|
541
557
|
function createMicroApp(config) {
|
|
542
558
|
const host = config.container ?? document.createElement("div");
|
|
543
559
|
host.setAttribute("data-micro-app", config.name);
|
|
@@ -808,24 +824,30 @@ function createAction(actionFn) {
|
|
|
808
824
|
const [data, setData] = signal(void 0);
|
|
809
825
|
const [error, setError] = signal(void 0);
|
|
810
826
|
const [loading, setLoading] = signal(false);
|
|
827
|
+
let activeRun = 0;
|
|
811
828
|
const submit = async (input) => {
|
|
829
|
+
const runId = ++activeRun;
|
|
812
830
|
batch(() => {
|
|
813
831
|
setLoading(true);
|
|
814
832
|
setError(void 0);
|
|
815
833
|
});
|
|
816
834
|
try {
|
|
817
835
|
const result = await actionFn(input);
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
836
|
+
if (runId === activeRun) {
|
|
837
|
+
batch(() => {
|
|
838
|
+
setData(result);
|
|
839
|
+
setLoading(false);
|
|
840
|
+
});
|
|
841
|
+
}
|
|
822
842
|
return result;
|
|
823
843
|
} catch (err) {
|
|
824
844
|
const actionError = err instanceof Error ? err : new Error(String(err));
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
845
|
+
if (runId === activeRun) {
|
|
846
|
+
batch(() => {
|
|
847
|
+
setError(actionError);
|
|
848
|
+
setLoading(false);
|
|
849
|
+
});
|
|
850
|
+
}
|
|
829
851
|
throw actionError;
|
|
830
852
|
}
|
|
831
853
|
};
|
|
@@ -839,15 +861,14 @@ function scrollRestoration(options) {
|
|
|
839
861
|
let popstateHandler = null;
|
|
840
862
|
let currentKey = null;
|
|
841
863
|
const save = (key) => {
|
|
842
|
-
|
|
843
|
-
x: window.scrollX,
|
|
844
|
-
|
|
845
|
-
});
|
|
864
|
+
if (typeof window !== "undefined") {
|
|
865
|
+
positions.set(key, { x: window.scrollX, y: window.scrollY });
|
|
866
|
+
}
|
|
846
867
|
currentKey = key;
|
|
847
868
|
};
|
|
848
869
|
const restore = (key) => {
|
|
849
870
|
const pos = positions.get(key);
|
|
850
|
-
if (pos) {
|
|
871
|
+
if (pos && typeof window !== "undefined") {
|
|
851
872
|
window.scrollTo(pos.x, pos.y);
|
|
852
873
|
}
|
|
853
874
|
currentKey = key;
|
|
@@ -855,7 +876,7 @@ function scrollRestoration(options) {
|
|
|
855
876
|
const getPosition = (key) => {
|
|
856
877
|
return positions.get(key);
|
|
857
878
|
};
|
|
858
|
-
if (mode === "auto") {
|
|
879
|
+
if (mode === "auto" && typeof window !== "undefined") {
|
|
859
880
|
popstateHandler = () => {
|
|
860
881
|
if (currentKey) {
|
|
861
882
|
save(currentKey);
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
} from "./chunk-H3SRKIYX.js";
|
|
4
4
|
import {
|
|
5
5
|
effect
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-23VT3KZB.js";
|
|
7
7
|
import {
|
|
8
8
|
batch,
|
|
9
9
|
signal
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-IWFE4AHO.js";
|
|
11
11
|
|
|
12
12
|
// src/browser/media.ts
|
|
13
13
|
function media(query) {
|
|
@@ -193,7 +193,7 @@ function battery() {
|
|
|
193
193
|
let disposed = false;
|
|
194
194
|
if (typeof navigator !== "undefined" && "getBattery" in navigator) {
|
|
195
195
|
setSupported(true);
|
|
196
|
-
navigator.getBattery().then((bm) => {
|
|
196
|
+
const batteryPromise = navigator.getBattery().then((bm) => {
|
|
197
197
|
if (disposed) return;
|
|
198
198
|
battery2 = bm;
|
|
199
199
|
batch(() => {
|
|
@@ -211,6 +211,9 @@ function battery() {
|
|
|
211
211
|
bm.addEventListener("chargingtimechange", onChargingTimeChange);
|
|
212
212
|
bm.addEventListener("dischargingtimechange", onDischargingTimeChange);
|
|
213
213
|
});
|
|
214
|
+
batteryPromise.catch(() => {
|
|
215
|
+
if (!disposed) setSupported(false);
|
|
216
|
+
});
|
|
214
217
|
}
|
|
215
218
|
function dispose() {
|
|
216
219
|
disposed = true;
|
|
@@ -762,9 +765,17 @@ function wakeLock() {
|
|
|
762
765
|
}
|
|
763
766
|
const api = navigator.wakeLock;
|
|
764
767
|
let sentinel = null;
|
|
768
|
+
let disposed = false;
|
|
765
769
|
async function request() {
|
|
770
|
+
if (disposed) return;
|
|
766
771
|
try {
|
|
767
|
-
|
|
772
|
+
const s = await api.request("screen");
|
|
773
|
+
if (disposed) {
|
|
774
|
+
s.release().catch(() => {
|
|
775
|
+
});
|
|
776
|
+
return;
|
|
777
|
+
}
|
|
778
|
+
sentinel = s;
|
|
768
779
|
setActive(true);
|
|
769
780
|
sentinel.addEventListener("release", () => {
|
|
770
781
|
setActive(false);
|
|
@@ -791,6 +802,7 @@ function wakeLock() {
|
|
|
791
802
|
};
|
|
792
803
|
document.addEventListener("visibilitychange", onVisibility);
|
|
793
804
|
function dispose() {
|
|
805
|
+
disposed = true;
|
|
794
806
|
document.removeEventListener("visibilitychange", onVisibility);
|
|
795
807
|
release().catch((err) => {
|
|
796
808
|
if (typeof console !== "undefined") {
|
|
@@ -822,6 +834,7 @@ function animationFrame(options = {}) {
|
|
|
822
834
|
let id = null;
|
|
823
835
|
let prev = -1;
|
|
824
836
|
let start = -1;
|
|
837
|
+
let disposed = false;
|
|
825
838
|
const minFrameMs = options.fpsLimit ? 1e3 / options.fpsLimit : 0;
|
|
826
839
|
const step = (now) => {
|
|
827
840
|
if (start < 0) start = now;
|
|
@@ -835,7 +848,7 @@ function animationFrame(options = {}) {
|
|
|
835
848
|
id = requestAnimationFrame(step);
|
|
836
849
|
};
|
|
837
850
|
function resume() {
|
|
838
|
-
if (id !== null) return;
|
|
851
|
+
if (disposed || id !== null) return;
|
|
839
852
|
setRunning(true);
|
|
840
853
|
id = requestAnimationFrame(step);
|
|
841
854
|
}
|
|
@@ -849,6 +862,7 @@ function animationFrame(options = {}) {
|
|
|
849
862
|
start = -1;
|
|
850
863
|
}
|
|
851
864
|
function dispose() {
|
|
865
|
+
disposed = true;
|
|
852
866
|
pause();
|
|
853
867
|
}
|
|
854
868
|
if (options.immediate !== false) resume();
|
|
@@ -907,7 +921,9 @@ function bounds(target) {
|
|
|
907
921
|
}
|
|
908
922
|
};
|
|
909
923
|
}
|
|
924
|
+
let disposed = false;
|
|
910
925
|
function refresh() {
|
|
926
|
+
if (disposed) return;
|
|
911
927
|
setRect(readRect(target));
|
|
912
928
|
}
|
|
913
929
|
refresh();
|
|
@@ -919,6 +935,7 @@ function bounds(target) {
|
|
|
919
935
|
const onScroll = () => refresh();
|
|
920
936
|
window.addEventListener("scroll", onScroll, { passive: true, capture: true });
|
|
921
937
|
function dispose() {
|
|
938
|
+
disposed = true;
|
|
922
939
|
resizeObserver?.disconnect();
|
|
923
940
|
window.removeEventListener("scroll", onScroll, { capture: true });
|
|
924
941
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
bindAttribute
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import {
|
|
5
|
-
dispose,
|
|
6
|
-
registerDisposer
|
|
7
|
-
} from "./chunk-5VGSK6D2.js";
|
|
3
|
+
} from "./chunk-SBPUXWCE.js";
|
|
8
4
|
import {
|
|
9
5
|
isEventHandlerAttr,
|
|
10
6
|
sanitizeAttributeString,
|
|
11
7
|
sanitizeCSSValue
|
|
12
8
|
} from "./chunk-L3GAGWCC.js";
|
|
9
|
+
import {
|
|
10
|
+
dispose,
|
|
11
|
+
registerDisposer
|
|
12
|
+
} from "./chunk-5VGSK6D2.js";
|
|
13
13
|
import {
|
|
14
14
|
reactiveBinding,
|
|
15
15
|
track
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-UOMYIAG6.js";
|
|
17
17
|
import {
|
|
18
18
|
devWarn,
|
|
19
19
|
isDev
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createPlugin
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WWV3SJ3L.js";
|
|
4
4
|
import {
|
|
5
5
|
tagFactory
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-RZKGMHH4.js";
|
|
7
7
|
import {
|
|
8
8
|
derived
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-F3HO2MP7.js";
|
|
10
10
|
import {
|
|
11
11
|
effect
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-23VT3KZB.js";
|
|
13
13
|
import {
|
|
14
14
|
batch,
|
|
15
15
|
signal
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-IWFE4AHO.js";
|
|
17
17
|
|
|
18
18
|
// src/ecosystem/adapters/mobx.ts
|
|
19
19
|
function mobXAdapter(options) {
|
|
@@ -419,7 +419,7 @@ function forEachSubscriber(signal, visit) {
|
|
|
419
419
|
|
|
420
420
|
// src/reactivity/track.ts
|
|
421
421
|
var _isDev2 = isDev();
|
|
422
|
-
var _runtimeVersion = true ? "3.3.
|
|
422
|
+
var _runtimeVersion = true ? "3.3.3" : "dev";
|
|
423
423
|
var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
|
|
424
424
|
function resolveReactiveApi() {
|
|
425
425
|
const g = globalThis;
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
} from "./chunk-H3SRKIYX.js";
|
|
5
5
|
import {
|
|
6
6
|
derived
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-F3HO2MP7.js";
|
|
8
8
|
import {
|
|
9
9
|
effect
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-23VT3KZB.js";
|
|
11
11
|
import {
|
|
12
12
|
batch,
|
|
13
13
|
signal
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-IWFE4AHO.js";
|
|
15
15
|
|
|
16
16
|
// src/patterns/machine.ts
|
|
17
17
|
function machine(config) {
|
|
@@ -73,7 +73,14 @@ function machine(config) {
|
|
|
73
73
|
|
|
74
74
|
// src/patterns/persist.ts
|
|
75
75
|
function persisted(key, initial, options = {}) {
|
|
76
|
-
const storage =
|
|
76
|
+
const storage = (() => {
|
|
77
|
+
try {
|
|
78
|
+
if (options.session) return typeof sessionStorage !== "undefined" ? sessionStorage : null;
|
|
79
|
+
return typeof localStorage !== "undefined" ? localStorage : null;
|
|
80
|
+
} catch {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
})();
|
|
77
84
|
const serialize = options.serialize || JSON.stringify;
|
|
78
85
|
const safeReviver = (k, v) => isUnsafeKey(k) ? void 0 : v;
|
|
79
86
|
const deserialize = options.deserialize || ((raw) => JSON.parse(raw, safeReviver));
|
|
@@ -82,7 +89,7 @@ function persisted(key, initial, options = {}) {
|
|
|
82
89
|
const syncTabs = options.session ? false : options.syncTabs ?? true;
|
|
83
90
|
let restored = initial;
|
|
84
91
|
try {
|
|
85
|
-
let raw = storage.getItem(key);
|
|
92
|
+
let raw = storage ? storage.getItem(key) : null;
|
|
86
93
|
if (raw !== null) {
|
|
87
94
|
if (decrypt) raw = decrypt(raw);
|
|
88
95
|
const parsed = deserialize(raw);
|
|
@@ -98,12 +105,12 @@ function persisted(key, initial, options = {}) {
|
|
|
98
105
|
try {
|
|
99
106
|
let serialized = serialize(current);
|
|
100
107
|
if (encrypt) serialized = encrypt(serialized);
|
|
101
|
-
storage
|
|
108
|
+
storage?.setItem(key, serialized);
|
|
102
109
|
} catch {
|
|
103
110
|
}
|
|
104
111
|
});
|
|
105
112
|
let storageListener = null;
|
|
106
|
-
if (syncTabs && typeof window !== "undefined") {
|
|
113
|
+
if (syncTabs && storage && typeof window !== "undefined") {
|
|
107
114
|
storageListener = (e) => {
|
|
108
115
|
if (e.storageArea !== storage || e.key !== key) return;
|
|
109
116
|
if (e.newValue === null) {
|
|
@@ -406,7 +413,7 @@ function globalStore(config) {
|
|
|
406
413
|
next();
|
|
407
414
|
}
|
|
408
415
|
function select(selector) {
|
|
409
|
-
return
|
|
416
|
+
return () => selector(getState());
|
|
410
417
|
}
|
|
411
418
|
function subscribe(callback) {
|
|
412
419
|
listeners.add(callback);
|