sibujs 4.8.0 → 4.10.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 +44 -6
- package/dist/browser.d.cts +3 -2
- package/dist/browser.d.ts +3 -2
- package/dist/browser.js +4 -4
- package/dist/build.cjs +128 -56
- package/dist/build.js +10 -10
- package/dist/cdn.dev.global.js +14 -14
- package/dist/cdn.full.dev.global.js +13 -13
- package/dist/cdn.full.global.js +12 -12
- package/dist/cdn.global.js +15 -15
- package/dist/{chunk-J3YQ457H.js → chunk-2NWHJ2UJ.js} +99 -61
- package/dist/{chunk-JUTFX2RM.js → chunk-4DCVJ4YA.js} +42 -15
- package/dist/{chunk-QGMSESDD.js → chunk-54F4TPHK.js} +2 -2
- package/dist/{chunk-KJ3UKABJ.js → chunk-5PC7OTQW.js} +1 -1
- package/dist/{chunk-V3LHZSU5.js → chunk-7WIHYHWD.js} +8 -1
- package/dist/{chunk-44MTL7ED.js → chunk-BMCR7TXG.js} +3 -3
- package/dist/{chunk-TQQUN4WR.js → chunk-D6HYFOWR.js} +39 -4
- package/dist/{chunk-VWT3VXPL.js → chunk-EVI4ZQO3.js} +2 -2
- package/dist/{chunk-CZPRSWSS.js → chunk-EVOK663Z.js} +1 -1
- package/dist/{chunk-DSID757X.js → chunk-FYUEL5IW.js} +1 -1
- package/dist/{chunk-UCNP3HVM.js → chunk-GMMDHJJT.js} +30 -12
- package/dist/{chunk-C7AA2CZX.js → chunk-GOL3FU5Q.js} +1 -1
- package/dist/{chunk-EGUQLBHE.js → chunk-GTS35FLA.js} +5 -4
- package/dist/{chunk-GSGNX35Q.js → chunk-IFRIBZ4O.js} +4 -4
- package/dist/{chunk-C5PEWEGH.js → chunk-IL5MMSCL.js} +19 -12
- package/dist/{chunk-ZVLHNEEL.js → chunk-ITEL5KPL.js} +6 -6
- package/dist/{chunk-RGLPEBDE.js → chunk-JCKUWWHU.js} +3 -3
- package/dist/{chunk-Q5J2LVKH.js → chunk-N6U4GOIU.js} +1 -1
- package/dist/{chunk-LI4W3U6C.js → chunk-TOPRMXFY.js} +1 -1
- package/dist/{chunk-4WMSTZ7J.js → chunk-VWPMWV7O.js} +4 -4
- package/dist/{chunk-O6TRVMJI.js → chunk-XUQUQJYE.js} +1 -1
- package/dist/data.cjs +67 -12
- package/dist/data.d.cts +32 -5
- package/dist/data.d.ts +32 -5
- package/dist/data.js +5 -5
- package/dist/devtools.cjs +41 -4
- package/dist/devtools.js +4 -4
- package/dist/ecosystem.cjs +41 -4
- package/dist/ecosystem.js +7 -7
- package/dist/extras.cjs +125 -41
- package/dist/extras.js +20 -20
- package/dist/index.cjs +128 -56
- package/dist/index.d.cts +22 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +10 -10
- package/dist/motion.cjs +36 -4
- package/dist/motion.js +3 -3
- package/dist/patterns.cjs +41 -4
- package/dist/patterns.js +5 -5
- package/dist/performance.cjs +55 -14
- package/dist/performance.js +4 -4
- package/dist/plugins.cjs +176 -60
- package/dist/plugins.d.cts +62 -2
- package/dist/plugins.d.ts +62 -2
- package/dist/plugins.js +143 -61
- package/dist/ssr.cjs +77 -16
- package/dist/ssr.d.cts +4 -0
- package/dist/ssr.d.ts +4 -0
- package/dist/ssr.js +7 -7
- package/dist/testing.cjs +41 -4
- package/dist/testing.js +2 -2
- package/dist/ui.cjs +42 -5
- package/dist/ui.js +7 -7
- package/dist/widgets.cjs +36 -4
- package/dist/widgets.js +6 -6
- package/package.json +1 -1
package/dist/extras.cjs
CHANGED
|
@@ -245,7 +245,7 @@ __export(extras_exports, {
|
|
|
245
245
|
resetSSRState: () => resetSSRState,
|
|
246
246
|
resize: () => resize,
|
|
247
247
|
resource: () => resource,
|
|
248
|
-
runCleanups: () =>
|
|
248
|
+
runCleanups: () => runCleanups2,
|
|
249
249
|
satisfies: () => satisfies,
|
|
250
250
|
scaleDown: () => scaleDown,
|
|
251
251
|
scaleUp: () => scaleUp,
|
|
@@ -730,6 +730,24 @@ function untracked(fn) {
|
|
|
730
730
|
resumeTracking();
|
|
731
731
|
}
|
|
732
732
|
}
|
|
733
|
+
var currentOwnerScope = null;
|
|
734
|
+
function getOwnerScope() {
|
|
735
|
+
return currentOwnerScope;
|
|
736
|
+
}
|
|
737
|
+
function runWithOwnerScope(scope, fn) {
|
|
738
|
+
const prev = currentOwnerScope;
|
|
739
|
+
currentOwnerScope = scope;
|
|
740
|
+
try {
|
|
741
|
+
return fn();
|
|
742
|
+
} finally {
|
|
743
|
+
currentOwnerScope = prev;
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
function bindOwnerScope(fn) {
|
|
747
|
+
const scope = currentOwnerScope;
|
|
748
|
+
if (scope === null) return fn;
|
|
749
|
+
return (...args) => runWithOwnerScope(scope, () => fn(...args));
|
|
750
|
+
}
|
|
733
751
|
var subscriberEpochCounter = 0;
|
|
734
752
|
function retrack(effectFn, subscriber) {
|
|
735
753
|
const prev = currentSubscriber;
|
|
@@ -745,6 +763,10 @@ function retrack(effectFn, subscriber) {
|
|
|
745
763
|
currentSubscriber = subscriber;
|
|
746
764
|
const sub2 = subscriber;
|
|
747
765
|
if (sub2._cap === void 0) sub2._cap = currentDisposerCapture();
|
|
766
|
+
const prevScope = currentOwnerScope;
|
|
767
|
+
if (prevScope !== null && !sub2._epoch && sub2._scope === void 0) sub2._scope = prevScope;
|
|
768
|
+
const scope = sub2._scope === void 0 ? null : sub2._scope;
|
|
769
|
+
if (scope !== prevScope) currentOwnerScope = scope;
|
|
748
770
|
const epoch = ++subscriberEpochCounter;
|
|
749
771
|
sub2._epoch = epoch;
|
|
750
772
|
sub2._structDirty = false;
|
|
@@ -757,6 +779,7 @@ function retrack(effectFn, subscriber) {
|
|
|
757
779
|
effectFn();
|
|
758
780
|
} finally {
|
|
759
781
|
currentSubscriber = prev;
|
|
782
|
+
currentOwnerScope = prevScope;
|
|
760
783
|
if (savedDepth !== 0) {
|
|
761
784
|
suspendDepth = savedDepth;
|
|
762
785
|
suspendSavedSub = savedSuspendSub;
|
|
@@ -791,23 +814,26 @@ function track(effectFn, subscriber) {
|
|
|
791
814
|
trackingSuspended = false;
|
|
792
815
|
}
|
|
793
816
|
currentSubscriber = subscriber;
|
|
817
|
+
const sub2 = subscriber;
|
|
818
|
+
if (sub2._scope === void 0) sub2._scope = currentOwnerScope;
|
|
819
|
+
const prevScope = currentOwnerScope;
|
|
820
|
+
currentOwnerScope = sub2._scope;
|
|
794
821
|
try {
|
|
795
822
|
effectFn();
|
|
796
823
|
} finally {
|
|
797
824
|
currentSubscriber = prev;
|
|
825
|
+
currentOwnerScope = prevScope;
|
|
798
826
|
if (savedDepth !== 0) {
|
|
799
827
|
suspendDepth = savedDepth;
|
|
800
828
|
suspendSavedSub = savedSuspendSub;
|
|
801
829
|
trackingSuspended = true;
|
|
802
830
|
}
|
|
803
|
-
|
|
804
|
-
for (let n = sub3.depsHead ?? null; n !== null; n = n.subNext) {
|
|
831
|
+
for (let n = sub2.depsHead ?? null; n !== null; n = n.subNext) {
|
|
805
832
|
const sig = n.sig;
|
|
806
833
|
sig.__activeNode = n.prevActive;
|
|
807
834
|
n.prevActive = null;
|
|
808
835
|
}
|
|
809
836
|
}
|
|
810
|
-
const sub2 = subscriber;
|
|
811
837
|
return sub2._dispose ?? (sub2._dispose = () => cleanup(subscriber));
|
|
812
838
|
}
|
|
813
839
|
function reactiveBinding(commit, ownerNode) {
|
|
@@ -1077,7 +1103,7 @@ function forEachSubscriber(signal2, visit) {
|
|
|
1077
1103
|
}
|
|
1078
1104
|
|
|
1079
1105
|
// src/reactivity/track.ts
|
|
1080
|
-
var _runtimeVersion = true ? "4.
|
|
1106
|
+
var _runtimeVersion = true ? "4.10.0" : "dev";
|
|
1081
1107
|
var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
|
|
1082
1108
|
function resolveReactiveApi() {
|
|
1083
1109
|
const g2 = globalThis;
|
|
@@ -1109,6 +1135,9 @@ function resolveReactiveApi() {
|
|
|
1109
1135
|
getSubscriberCount,
|
|
1110
1136
|
getSubscriberDeps,
|
|
1111
1137
|
forEachSubscriber,
|
|
1138
|
+
getOwnerScope,
|
|
1139
|
+
runWithOwnerScope,
|
|
1140
|
+
bindOwnerScope,
|
|
1112
1141
|
version: _runtimeVersion
|
|
1113
1142
|
};
|
|
1114
1143
|
g2[REGISTRY_KEY] = local;
|
|
@@ -1132,6 +1161,9 @@ var notifySubscribers2 = API.notifySubscribers;
|
|
|
1132
1161
|
var getSubscriberCount2 = API.getSubscriberCount;
|
|
1133
1162
|
var getSubscriberDeps2 = API.getSubscriberDeps;
|
|
1134
1163
|
var forEachSubscriber2 = API.forEachSubscriber;
|
|
1164
|
+
var getOwnerScope2 = API.getOwnerScope ?? getOwnerScope;
|
|
1165
|
+
var runWithOwnerScope2 = API.runWithOwnerScope ?? runWithOwnerScope;
|
|
1166
|
+
var bindOwnerScope2 = API.bindOwnerScope ?? bindOwnerScope;
|
|
1135
1167
|
|
|
1136
1168
|
// src/core/devtoolsHook.ts
|
|
1137
1169
|
function emitDevtools(hook, event, payload) {
|
|
@@ -1312,6 +1344,11 @@ function flushUserCleanups(ctx) {
|
|
|
1312
1344
|
const list = ctx.userCleanups;
|
|
1313
1345
|
if (list.length === 0) return;
|
|
1314
1346
|
ctx.userCleanups = [];
|
|
1347
|
+
const scope = ctx.subscriber._scope ?? null;
|
|
1348
|
+
if (scope === getOwnerScope2()) runCleanups(list);
|
|
1349
|
+
else runWithOwnerScope2(scope, () => runCleanups(list));
|
|
1350
|
+
}
|
|
1351
|
+
function runCleanups(list) {
|
|
1315
1352
|
for (let i2 = list.length - 1; i2 >= 0; i2--) {
|
|
1316
1353
|
try {
|
|
1317
1354
|
list[i2]();
|
|
@@ -1805,6 +1842,8 @@ function query(key, fetcher, options = {}) {
|
|
|
1805
1842
|
structuralSharing = true
|
|
1806
1843
|
} = options;
|
|
1807
1844
|
const resolveKey = typeof key === "function" ? key : () => key;
|
|
1845
|
+
const enabledGate = typeof enabled === "function" ? derived(() => Boolean(enabled())) : null;
|
|
1846
|
+
const isEnabled = enabledGate ?? (() => Boolean(enabled));
|
|
1808
1847
|
const cache = getActiveQueryCache();
|
|
1809
1848
|
const [data2, setData] = signal(initialData);
|
|
1810
1849
|
const [isFetching, setIsFetching] = signal(false);
|
|
@@ -1823,6 +1862,7 @@ function query(key, fetcher, options = {}) {
|
|
|
1823
1862
|
let currentKey = null;
|
|
1824
1863
|
let attachedEntry = null;
|
|
1825
1864
|
let attachedKey = null;
|
|
1865
|
+
let lastEnabled = null;
|
|
1826
1866
|
let intervalTimer = null;
|
|
1827
1867
|
const loading = derived(() => isFetching() && data2() === void 0);
|
|
1828
1868
|
const isStale = derived(() => {
|
|
@@ -1919,7 +1959,7 @@ function query(key, fetcher, options = {}) {
|
|
|
1919
1959
|
}
|
|
1920
1960
|
}
|
|
1921
1961
|
async function doFetch() {
|
|
1922
|
-
if (disposed || !currentKey || !
|
|
1962
|
+
if (disposed || !currentKey || !untracked2(isEnabled)) return;
|
|
1923
1963
|
const key2 = currentKey;
|
|
1924
1964
|
const entry = getOrCreateEntry(cache, key2);
|
|
1925
1965
|
attachToEntry(entry, key2);
|
|
@@ -2021,10 +2061,20 @@ function query(key, fetcher, options = {}) {
|
|
|
2021
2061
|
}
|
|
2022
2062
|
const effectCleanup = effect(() => {
|
|
2023
2063
|
const key2 = resolveKey();
|
|
2064
|
+
const on = isEnabled();
|
|
2024
2065
|
const keyChanged = currentKey !== key2;
|
|
2066
|
+
const enabledRose = on && lastEnabled === false;
|
|
2025
2067
|
currentKey = key2;
|
|
2068
|
+
lastEnabled = on;
|
|
2069
|
+
if (key2 === "") {
|
|
2070
|
+
detachFromEntry();
|
|
2071
|
+
setIsFetching(false);
|
|
2072
|
+
return;
|
|
2073
|
+
}
|
|
2026
2074
|
const entry = getOrCreateEntry(cache, key2, initialData);
|
|
2075
|
+
const reattached = attachedEntry !== entry;
|
|
2027
2076
|
attachToEntry(entry, key2);
|
|
2077
|
+
if (keyChanged) setIsFetching(entry.promise !== null);
|
|
2028
2078
|
if (entry.data !== void 0) {
|
|
2029
2079
|
const view = viewOf(entry);
|
|
2030
2080
|
batch(() => {
|
|
@@ -2033,19 +2083,20 @@ function query(key, fetcher, options = {}) {
|
|
|
2033
2083
|
setUpdatedAt(entry.dataUpdatedAt);
|
|
2034
2084
|
});
|
|
2035
2085
|
}
|
|
2036
|
-
if (!keyChanged &&
|
|
2086
|
+
if (!keyChanged && !reattached && !enabledRose) return;
|
|
2087
|
+
if (!keyChanged && entry.data !== void 0) {
|
|
2037
2088
|
const isDataStale2 = entry.dataUpdatedAt === 0 || Date.now() - entry.dataUpdatedAt >= staleTime;
|
|
2038
|
-
if (
|
|
2089
|
+
if (on && isDataStale2 && !entry.promise) doFetch();
|
|
2039
2090
|
return;
|
|
2040
2091
|
}
|
|
2041
2092
|
const isDataStale = entry.dataUpdatedAt === 0 || Date.now() - entry.dataUpdatedAt >= staleTime;
|
|
2042
|
-
if (
|
|
2093
|
+
if (on && (entry.data === void 0 || isDataStale)) {
|
|
2043
2094
|
doFetch();
|
|
2044
2095
|
}
|
|
2045
2096
|
});
|
|
2046
2097
|
if (refetchInterval && refetchInterval > 0) {
|
|
2047
2098
|
intervalTimer = setInterval(() => {
|
|
2048
|
-
if (!disposed && currentKey
|
|
2099
|
+
if (!disposed && currentKey) doFetch();
|
|
2049
2100
|
}, refetchInterval);
|
|
2050
2101
|
}
|
|
2051
2102
|
let focusHandler = null;
|
|
@@ -2053,13 +2104,13 @@ function query(key, fetcher, options = {}) {
|
|
|
2053
2104
|
if (typeof globalThis !== "undefined" && typeof globalThis.addEventListener === "function") {
|
|
2054
2105
|
if (refetchOnWindowFocus) {
|
|
2055
2106
|
focusHandler = () => {
|
|
2056
|
-
if (!disposed && currentKey
|
|
2107
|
+
if (!disposed && currentKey) doFetch();
|
|
2057
2108
|
};
|
|
2058
2109
|
globalThis.addEventListener("focus", focusHandler);
|
|
2059
2110
|
}
|
|
2060
2111
|
if (refetchOnReconnect) {
|
|
2061
2112
|
onlineHandler = () => {
|
|
2062
|
-
if (!disposed && currentKey
|
|
2113
|
+
if (!disposed && currentKey) doFetch();
|
|
2063
2114
|
};
|
|
2064
2115
|
globalThis.addEventListener("online", onlineHandler);
|
|
2065
2116
|
}
|
|
@@ -2071,6 +2122,7 @@ function query(key, fetcher, options = {}) {
|
|
|
2071
2122
|
stopSelect?.();
|
|
2072
2123
|
loading.dispose();
|
|
2073
2124
|
isStale.dispose();
|
|
2125
|
+
enabledGate?.dispose();
|
|
2074
2126
|
if (intervalTimer) clearInterval(intervalTimer);
|
|
2075
2127
|
detachFromEntry();
|
|
2076
2128
|
if (focusHandler && typeof globalThis.removeEventListener === "function") {
|
|
@@ -2250,6 +2302,8 @@ function infiniteQuery(key, fetcher, options) {
|
|
|
2250
2302
|
onError
|
|
2251
2303
|
} = options;
|
|
2252
2304
|
const resolveKey = typeof key === "function" ? key : () => key;
|
|
2305
|
+
const enabledGate = typeof enabled === "function" ? derived(() => Boolean(enabled())) : null;
|
|
2306
|
+
const isEnabled = enabledGate ?? (() => enabled);
|
|
2253
2307
|
const [pages, setPages] = signal([]);
|
|
2254
2308
|
const [isFetching, setIsFetching] = signal(false);
|
|
2255
2309
|
const [isFetchingNext, setIsFetchingNext] = signal(false);
|
|
@@ -2328,7 +2382,7 @@ function infiniteQuery(key, fetcher, options) {
|
|
|
2328
2382
|
}
|
|
2329
2383
|
const effectCleanup = effect(() => {
|
|
2330
2384
|
resolveKey();
|
|
2331
|
-
if (
|
|
2385
|
+
if (isEnabled()) {
|
|
2332
2386
|
abortController?.abort();
|
|
2333
2387
|
batch(() => {
|
|
2334
2388
|
setPages([]);
|
|
@@ -2369,6 +2423,7 @@ function infiniteQuery(key, fetcher, options) {
|
|
|
2369
2423
|
loading.dispose();
|
|
2370
2424
|
hasNextPage.dispose();
|
|
2371
2425
|
hasPreviousPage.dispose();
|
|
2426
|
+
enabledGate?.dispose();
|
|
2372
2427
|
}
|
|
2373
2428
|
return {
|
|
2374
2429
|
data: data2,
|
|
@@ -4843,6 +4898,7 @@ function keyboard(options = {}) {
|
|
|
4843
4898
|
};
|
|
4844
4899
|
}
|
|
4845
4900
|
const target = options.target ?? window;
|
|
4901
|
+
const view = options.target?.ownerDocument?.defaultView ?? window;
|
|
4846
4902
|
const filter = options.keys ? new Set(options.keys) : null;
|
|
4847
4903
|
const onDown = (e) => {
|
|
4848
4904
|
if (filter && !filter.has(e.key)) return;
|
|
@@ -4865,14 +4921,14 @@ function keyboard(options = {}) {
|
|
|
4865
4921
|
const onBlur = () => setPressed(/* @__PURE__ */ new Set());
|
|
4866
4922
|
target.addEventListener("keydown", onDown);
|
|
4867
4923
|
target.addEventListener("keyup", onUp);
|
|
4868
|
-
|
|
4924
|
+
view.addEventListener("blur", onBlur);
|
|
4869
4925
|
function isPressed(key) {
|
|
4870
4926
|
return pressed().has(key);
|
|
4871
4927
|
}
|
|
4872
4928
|
function dispose2() {
|
|
4873
4929
|
target.removeEventListener("keydown", onDown);
|
|
4874
4930
|
target.removeEventListener("keyup", onUp);
|
|
4875
|
-
|
|
4931
|
+
view.removeEventListener("blur", onBlur);
|
|
4876
4932
|
}
|
|
4877
4933
|
return { pressed, isPressed, dispose: dispose2 };
|
|
4878
4934
|
}
|
|
@@ -9700,16 +9756,20 @@ function lazyChunk(id, loader, registry, fallback) {
|
|
|
9700
9756
|
registry.load(id, async () => {
|
|
9701
9757
|
const mod = await loader();
|
|
9702
9758
|
return typeof mod === "function" ? mod : mod.default;
|
|
9703
|
-
}).then(
|
|
9704
|
-
|
|
9705
|
-
|
|
9706
|
-
|
|
9707
|
-
|
|
9708
|
-
|
|
9709
|
-
|
|
9710
|
-
|
|
9711
|
-
|
|
9712
|
-
|
|
9759
|
+
}).then(
|
|
9760
|
+
// Instantiated after the chunk resolves, in the owner scope of the
|
|
9761
|
+
// render that asked for it — as `lazy()` does.
|
|
9762
|
+
bindOwnerScope2((component) => {
|
|
9763
|
+
if (disposed) return;
|
|
9764
|
+
const node = component();
|
|
9765
|
+
if (disposed) {
|
|
9766
|
+
dispose(node);
|
|
9767
|
+
return;
|
|
9768
|
+
}
|
|
9769
|
+
clearChildren(container);
|
|
9770
|
+
container.appendChild(node);
|
|
9771
|
+
})
|
|
9772
|
+
).catch((err) => {
|
|
9713
9773
|
if (disposed) return;
|
|
9714
9774
|
clearChildren(container);
|
|
9715
9775
|
const errorEl = document.createElement("div");
|
|
@@ -10042,7 +10102,7 @@ function svgElement(tag, props = {}, ...nodes) {
|
|
|
10042
10102
|
for (const child of nodes) {
|
|
10043
10103
|
if (typeof child === "string") {
|
|
10044
10104
|
el.appendChild(document.createTextNode(child));
|
|
10045
|
-
} else if (child
|
|
10105
|
+
} else if (typeof child?.nodeType === "number") {
|
|
10046
10106
|
el.appendChild(child);
|
|
10047
10107
|
}
|
|
10048
10108
|
}
|
|
@@ -11150,11 +11210,15 @@ function defineRemoteComponent(name, loader) {
|
|
|
11150
11210
|
registerDisposer(container, () => {
|
|
11151
11211
|
disposed = true;
|
|
11152
11212
|
});
|
|
11153
|
-
loader().then(
|
|
11154
|
-
|
|
11155
|
-
|
|
11156
|
-
|
|
11157
|
-
|
|
11213
|
+
loader().then(
|
|
11214
|
+
// Instantiated after the module resolves, in the owner scope of the
|
|
11215
|
+
// render that asked for it — as `lazy()` does.
|
|
11216
|
+
bindOwnerScope2((mod) => {
|
|
11217
|
+
cached = mod.default;
|
|
11218
|
+
if (disposed) return;
|
|
11219
|
+
replaceChildrenSafely(container, cached());
|
|
11220
|
+
})
|
|
11221
|
+
).catch((err) => {
|
|
11158
11222
|
if (disposed) return;
|
|
11159
11223
|
const message = err instanceof Error ? err.message : String(err);
|
|
11160
11224
|
replaceChildrenSafely(
|
|
@@ -11374,7 +11438,7 @@ function createISR(options) {
|
|
|
11374
11438
|
const [data2, setData] = signal(initialData);
|
|
11375
11439
|
const [stale, setStale] = signal(initialData === void 0);
|
|
11376
11440
|
const controller = new AbortController();
|
|
11377
|
-
let inFlight =
|
|
11441
|
+
let inFlight = null;
|
|
11378
11442
|
let disposed = false;
|
|
11379
11443
|
let deadline;
|
|
11380
11444
|
const clearDeadline = () => {
|
|
@@ -11394,10 +11458,7 @@ function createISR(options) {
|
|
|
11394
11458
|
});
|
|
11395
11459
|
}, revalidateAfter);
|
|
11396
11460
|
};
|
|
11397
|
-
const
|
|
11398
|
-
if (disposed || inFlight) return;
|
|
11399
|
-
if (controller.signal.aborted) return;
|
|
11400
|
-
inFlight = true;
|
|
11461
|
+
const run = async () => {
|
|
11401
11462
|
try {
|
|
11402
11463
|
const result = await fetcher({ signal: controller.signal });
|
|
11403
11464
|
if (disposed || controller.signal.aborted) return;
|
|
@@ -11409,10 +11470,33 @@ function createISR(options) {
|
|
|
11409
11470
|
} catch (err) {
|
|
11410
11471
|
if (!disposed && !controller.signal.aborted) armDeadline();
|
|
11411
11472
|
throw err;
|
|
11412
|
-
} finally {
|
|
11413
|
-
inFlight = false;
|
|
11414
11473
|
}
|
|
11415
11474
|
};
|
|
11475
|
+
const revalidate = () => {
|
|
11476
|
+
if (disposed || controller.signal.aborted) return Promise.resolve();
|
|
11477
|
+
if (inFlight) return inFlight;
|
|
11478
|
+
let resolve;
|
|
11479
|
+
let reject;
|
|
11480
|
+
const current = new Promise((res, rej) => {
|
|
11481
|
+
resolve = res;
|
|
11482
|
+
reject = rej;
|
|
11483
|
+
});
|
|
11484
|
+
inFlight = current;
|
|
11485
|
+
const release = () => {
|
|
11486
|
+
if (inFlight === current) inFlight = null;
|
|
11487
|
+
};
|
|
11488
|
+
run().then(
|
|
11489
|
+
() => {
|
|
11490
|
+
release();
|
|
11491
|
+
resolve();
|
|
11492
|
+
},
|
|
11493
|
+
(err) => {
|
|
11494
|
+
release();
|
|
11495
|
+
reject(err);
|
|
11496
|
+
}
|
|
11497
|
+
);
|
|
11498
|
+
return current;
|
|
11499
|
+
};
|
|
11416
11500
|
if (initialData === void 0) {
|
|
11417
11501
|
revalidate().catch((err) => {
|
|
11418
11502
|
if (typeof console !== "undefined") console.warn("[SibuJS ISR] initial fetch failed", err);
|
|
@@ -11947,7 +12031,7 @@ var CDN_ENTRY_POINTS = {
|
|
|
11947
12031
|
};
|
|
11948
12032
|
var packageInfo = {
|
|
11949
12033
|
name: "sibujs",
|
|
11950
|
-
version: true ? "4.
|
|
12034
|
+
version: true ? "4.10.0" : "dev",
|
|
11951
12035
|
entryPoints: MODULE_ENTRY_POINTS,
|
|
11952
12036
|
/**
|
|
11953
12037
|
* Generate the package.json `exports` map. Module entries resolve to the
|
|
@@ -12092,7 +12176,7 @@ var env = {
|
|
|
12092
12176
|
};
|
|
12093
12177
|
|
|
12094
12178
|
// src/plugins/versioning.ts
|
|
12095
|
-
var VERSION = true ? "4.
|
|
12179
|
+
var VERSION = true ? "4.10.0" : "dev";
|
|
12096
12180
|
var NUM = "(?:0|[1-9]\\d*)";
|
|
12097
12181
|
var PRE_ID = `(?:${NUM}|\\d*[a-zA-Z-][0-9a-zA-Z-]*)`;
|
|
12098
12182
|
var BUILD_ID = "[0-9a-zA-Z-]+";
|
|
@@ -12694,7 +12778,7 @@ function trackCleanup(component, cleanup3) {
|
|
|
12694
12778
|
}
|
|
12695
12779
|
trackedCleanups.get(component)?.push(cleanup3);
|
|
12696
12780
|
}
|
|
12697
|
-
function
|
|
12781
|
+
function runCleanups2(component) {
|
|
12698
12782
|
const cleanups = trackedCleanups.get(component);
|
|
12699
12783
|
if (cleanups) {
|
|
12700
12784
|
for (const cleanup3 of cleanups) {
|
package/dist/extras.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
optimisticList,
|
|
6
6
|
persisted,
|
|
7
7
|
timeline
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-JCKUWWHU.js";
|
|
9
9
|
import {
|
|
10
10
|
DOMPool,
|
|
11
11
|
Features,
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
transitionState,
|
|
42
42
|
uniqueId,
|
|
43
43
|
yieldToMain
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-IL5MMSCL.js";
|
|
45
45
|
import {
|
|
46
46
|
MigrationStorageError,
|
|
47
47
|
VERSION,
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
preloadCritical,
|
|
64
64
|
prerenderRoutes,
|
|
65
65
|
satisfies
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-54F4TPHK.js";
|
|
67
67
|
import {
|
|
68
68
|
Head,
|
|
69
69
|
clearWasmCache,
|
|
@@ -89,7 +89,7 @@ import {
|
|
|
89
89
|
wasm,
|
|
90
90
|
worker,
|
|
91
91
|
workerFn
|
|
92
|
-
} from "./chunk-
|
|
92
|
+
} from "./chunk-4DCVJ4YA.js";
|
|
93
93
|
import {
|
|
94
94
|
FocusTrap,
|
|
95
95
|
VirtualList,
|
|
@@ -130,7 +130,7 @@ import {
|
|
|
130
130
|
toast,
|
|
131
131
|
withScopedStyle,
|
|
132
132
|
zipMask
|
|
133
|
-
} from "./chunk-
|
|
133
|
+
} from "./chunk-ITEL5KPL.js";
|
|
134
134
|
import {
|
|
135
135
|
RenderProp,
|
|
136
136
|
assertType,
|
|
@@ -157,7 +157,7 @@ import {
|
|
|
157
157
|
select,
|
|
158
158
|
tabs,
|
|
159
159
|
tooltip
|
|
160
|
-
} from "./chunk-
|
|
160
|
+
} from "./chunk-IFRIBZ4O.js";
|
|
161
161
|
import {
|
|
162
162
|
__resetSpeechCoordinator,
|
|
163
163
|
animationFrame,
|
|
@@ -196,7 +196,7 @@ import {
|
|
|
196
196
|
visibility,
|
|
197
197
|
wakeLock,
|
|
198
198
|
windowSize
|
|
199
|
-
} from "./chunk-
|
|
199
|
+
} from "./chunk-GTS35FLA.js";
|
|
200
200
|
import "./chunk-52XFPGSN.js";
|
|
201
201
|
import {
|
|
202
202
|
__resetQueryCache,
|
|
@@ -222,7 +222,7 @@ import {
|
|
|
222
222
|
throttle,
|
|
223
223
|
withLoader,
|
|
224
224
|
withRetry
|
|
225
|
-
} from "./chunk-
|
|
225
|
+
} from "./chunk-GMMDHJJT.js";
|
|
226
226
|
import {
|
|
227
227
|
SibuError,
|
|
228
228
|
checkLeaks,
|
|
@@ -260,7 +260,7 @@ import {
|
|
|
260
260
|
trackCleanup,
|
|
261
261
|
walkDependencyGraph,
|
|
262
262
|
withErrorTracking
|
|
263
|
-
} from "./chunk-
|
|
263
|
+
} from "./chunk-BMCR7TXG.js";
|
|
264
264
|
import {
|
|
265
265
|
antdAdapter,
|
|
266
266
|
chakraAdapter,
|
|
@@ -270,7 +270,7 @@ import {
|
|
|
270
270
|
mobXAdapter,
|
|
271
271
|
reduxAdapter,
|
|
272
272
|
zustandAdapter
|
|
273
|
-
} from "./chunk-
|
|
273
|
+
} from "./chunk-VWPMWV7O.js";
|
|
274
274
|
import {
|
|
275
275
|
PluginInstallCancelledError,
|
|
276
276
|
createPlugin,
|
|
@@ -284,7 +284,7 @@ import {
|
|
|
284
284
|
triggerPluginMount,
|
|
285
285
|
triggerPluginUnmount
|
|
286
286
|
} from "./chunk-J6FW5TV6.js";
|
|
287
|
-
import "./chunk-
|
|
287
|
+
import "./chunk-N6U4GOIU.js";
|
|
288
288
|
import {
|
|
289
289
|
collectStream,
|
|
290
290
|
deserializeState,
|
|
@@ -305,15 +305,15 @@ import {
|
|
|
305
305
|
suspenseSwapScript,
|
|
306
306
|
trustHTML
|
|
307
307
|
} from "./chunk-FC6KCJSA.js";
|
|
308
|
-
import "./chunk-
|
|
309
|
-
import "./chunk-
|
|
308
|
+
import "./chunk-EVOK663Z.js";
|
|
309
|
+
import "./chunk-GOL3FU5Q.js";
|
|
310
310
|
import "./chunk-62BDYGAG.js";
|
|
311
|
-
import "./chunk-
|
|
312
|
-
import "./chunk-
|
|
311
|
+
import "./chunk-EVI4ZQO3.js";
|
|
312
|
+
import "./chunk-XUQUQJYE.js";
|
|
313
313
|
import "./chunk-3ACAAQIN.js";
|
|
314
|
-
import "./chunk-
|
|
314
|
+
import "./chunk-5PC7OTQW.js";
|
|
315
315
|
import "./chunk-7ZHH77QA.js";
|
|
316
|
-
import "./chunk-
|
|
316
|
+
import "./chunk-7WIHYHWD.js";
|
|
317
317
|
import "./chunk-EXXSN3BW.js";
|
|
318
318
|
import "./chunk-7XHATCIH.js";
|
|
319
319
|
import {
|
|
@@ -338,10 +338,10 @@ import {
|
|
|
338
338
|
stagger,
|
|
339
339
|
transition,
|
|
340
340
|
viewTransition
|
|
341
|
-
} from "./chunk-
|
|
341
|
+
} from "./chunk-TOPRMXFY.js";
|
|
342
342
|
import "./chunk-5HZXGZ6T.js";
|
|
343
|
-
import "./chunk-
|
|
344
|
-
import "./chunk-
|
|
343
|
+
import "./chunk-FYUEL5IW.js";
|
|
344
|
+
import "./chunk-D6HYFOWR.js";
|
|
345
345
|
import "./chunk-NYNYSPK7.js";
|
|
346
346
|
export {
|
|
347
347
|
DOMPool,
|