sibujs 4.10.0 → 4.11.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 +1 -1
- package/dist/browser.js +4 -4
- package/dist/build.cjs +1 -1
- package/dist/build.js +10 -10
- package/dist/cdn.dev.global.js +1 -1
- package/dist/cdn.full.dev.global.js +1 -1
- package/dist/cdn.full.global.js +1 -1
- package/dist/cdn.global.js +1 -1
- package/dist/{chunk-EVI4ZQO3.js → chunk-3Z7AEJMQ.js} +2 -2
- package/dist/{chunk-GMMDHJJT.js → chunk-5G53CC6L.js} +4 -4
- package/dist/{chunk-VWPMWV7O.js → chunk-5IODQRR3.js} +4 -4
- package/dist/{chunk-TOPRMXFY.js → chunk-7V7VFT7E.js} +1 -1
- package/dist/{chunk-D6HYFOWR.js → chunk-ADWDDJ5M.js} +1 -1
- package/dist/{chunk-GOL3FU5Q.js → chunk-CHQPJY47.js} +1 -1
- package/dist/{chunk-2NWHJ2UJ.js → chunk-DEUONJYR.js} +9 -9
- package/dist/{chunk-FYUEL5IW.js → chunk-F6B5CKF7.js} +1 -1
- package/dist/{chunk-XUQUQJYE.js → chunk-HMOPAC2Z.js} +1 -1
- package/dist/{chunk-5PC7OTQW.js → chunk-KFJUMC3Q.js} +1 -1
- package/dist/{chunk-IL5MMSCL.js → chunk-KREPZR2U.js} +3 -3
- package/dist/{chunk-N6U4GOIU.js → chunk-LQ2C44YH.js} +1 -1
- package/dist/{chunk-BMCR7TXG.js → chunk-MCPL5WKQ.js} +3 -3
- package/dist/{chunk-ITEL5KPL.js → chunk-NBBFF5VA.js} +5 -5
- package/dist/{chunk-7WIHYHWD.js → chunk-OJV2RW4D.js} +1 -1
- package/dist/{chunk-54F4TPHK.js → chunk-R244COCR.js} +2 -2
- package/dist/{chunk-EVOK663Z.js → chunk-REOAVT2M.js} +1 -1
- package/dist/{chunk-IFRIBZ4O.js → chunk-RRKGQKPU.js} +4 -4
- package/dist/{chunk-GTS35FLA.js → chunk-VZDMHDVA.js} +2 -2
- package/dist/{chunk-JCKUWWHU.js → chunk-WQ7M57JJ.js} +3 -3
- package/dist/{chunk-4DCVJ4YA.js → chunk-YXJHLMRH.js} +4 -4
- package/dist/data.cjs +1 -1
- package/dist/data.js +5 -5
- package/dist/devtools.cjs +1 -1
- package/dist/devtools.js +4 -4
- package/dist/ecosystem.cjs +1 -1
- package/dist/ecosystem.js +7 -7
- package/dist/extras.cjs +3 -3
- package/dist/extras.js +20 -20
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +16 -4
- package/dist/index.d.ts +16 -4
- package/dist/index.js +10 -10
- package/dist/motion.cjs +1 -1
- package/dist/motion.js +3 -3
- package/dist/patterns.cjs +1 -1
- package/dist/patterns.js +5 -5
- package/dist/performance.cjs +1 -1
- package/dist/performance.js +4 -4
- package/dist/plugins.cjs +142 -15
- package/dist/plugins.d.cts +19 -5
- package/dist/plugins.d.ts +19 -5
- package/dist/plugins.js +146 -19
- package/dist/ssr.cjs +1 -1
- package/dist/ssr.js +7 -7
- package/dist/testing.cjs +1 -1
- package/dist/testing.js +2 -2
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +7 -7
- package/dist/widgets.cjs +1 -1
- package/dist/widgets.js +6 -6
- package/package.json +1 -1
package/dist/plugins.js
CHANGED
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
preloadCritical,
|
|
20
20
|
prerenderRoutes,
|
|
21
21
|
satisfies
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-R244COCR.js";
|
|
23
23
|
import {
|
|
24
24
|
PluginInstallCancelledError,
|
|
25
25
|
createPlugin,
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
} from "./chunk-J6FW5TV6.js";
|
|
36
36
|
import {
|
|
37
37
|
span
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-LQ2C44YH.js";
|
|
39
39
|
import {
|
|
40
40
|
escapeScriptJson,
|
|
41
41
|
renderToString,
|
|
@@ -48,17 +48,17 @@ import {
|
|
|
48
48
|
import {
|
|
49
49
|
appendChildren,
|
|
50
50
|
resolveClassValue
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-3Z7AEJMQ.js";
|
|
52
52
|
import {
|
|
53
53
|
setSafeAttribute
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-HMOPAC2Z.js";
|
|
55
55
|
import "./chunk-3ACAAQIN.js";
|
|
56
56
|
import {
|
|
57
57
|
globalSingleton
|
|
58
58
|
} from "./chunk-7ZHH77QA.js";
|
|
59
59
|
import {
|
|
60
60
|
effect
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-OJV2RW4D.js";
|
|
62
62
|
import {
|
|
63
63
|
sanitizeUrl,
|
|
64
64
|
stripControlChars
|
|
@@ -69,14 +69,14 @@ import {
|
|
|
69
69
|
import "./chunk-5HZXGZ6T.js";
|
|
70
70
|
import {
|
|
71
71
|
signal
|
|
72
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-F6B5CKF7.js";
|
|
73
73
|
import {
|
|
74
74
|
bindOwnerScope,
|
|
75
75
|
getOwnerScope,
|
|
76
76
|
runWithOwnerScope,
|
|
77
77
|
track,
|
|
78
78
|
untracked
|
|
79
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-ADWDDJ5M.js";
|
|
80
80
|
import {
|
|
81
81
|
devWarn,
|
|
82
82
|
dispose,
|
|
@@ -186,11 +186,28 @@ function normalizePathname(path) {
|
|
|
186
186
|
function parseQuery(query) {
|
|
187
187
|
return Object.fromEntries(new URLSearchParams(query));
|
|
188
188
|
}
|
|
189
|
+
function parseQueryAll(query) {
|
|
190
|
+
const all = /* @__PURE__ */ new Map();
|
|
191
|
+
for (const [key, value] of new URLSearchParams(query)) {
|
|
192
|
+
const values = all.get(key);
|
|
193
|
+
if (values) values.push(value);
|
|
194
|
+
else all.set(key, [value]);
|
|
195
|
+
}
|
|
196
|
+
return Object.fromEntries(all);
|
|
197
|
+
}
|
|
198
|
+
function serializeQuery(query) {
|
|
199
|
+
const search = new URLSearchParams();
|
|
200
|
+
for (const [key, value] of Object.entries(query)) {
|
|
201
|
+
if (Array.isArray(value)) for (const v of value) search.append(key, String(v));
|
|
202
|
+
else search.append(key, String(value));
|
|
203
|
+
}
|
|
204
|
+
return search.toString();
|
|
205
|
+
}
|
|
189
206
|
function paramsIdentity(params) {
|
|
190
207
|
return JSON.stringify(Object.entries(params).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0));
|
|
191
208
|
}
|
|
192
209
|
function queryIdentity(query) {
|
|
193
|
-
return paramsIdentity(typeof query === "string" ?
|
|
210
|
+
return paramsIdentity(typeof query === "string" ? parseQueryAll(query) : query);
|
|
194
211
|
}
|
|
195
212
|
function isPathnameAncestor(target, current) {
|
|
196
213
|
if (target === current) return true;
|
|
@@ -866,6 +883,7 @@ var _SibuRouter = class _SibuRouter {
|
|
|
866
883
|
path: "/",
|
|
867
884
|
params: {},
|
|
868
885
|
query: {},
|
|
886
|
+
queryAll: {},
|
|
869
887
|
hash: "",
|
|
870
888
|
meta: {},
|
|
871
889
|
matched: []
|
|
@@ -892,6 +910,7 @@ var _SibuRouter = class _SibuRouter {
|
|
|
892
910
|
createRouteContext(fullPath) {
|
|
893
911
|
const { path, query: queryString, hash } = splitRouteUrl(fullPath);
|
|
894
912
|
const query = parseQuery(queryString);
|
|
913
|
+
const queryAll = parseQueryAll(queryString);
|
|
895
914
|
const match = this.matcher.match(path || "/");
|
|
896
915
|
const params = match?.params || {};
|
|
897
916
|
const meta = match?.route.meta || {};
|
|
@@ -900,6 +919,7 @@ var _SibuRouter = class _SibuRouter {
|
|
|
900
919
|
path: path || "/",
|
|
901
920
|
params,
|
|
902
921
|
query,
|
|
922
|
+
queryAll,
|
|
903
923
|
hash,
|
|
904
924
|
meta,
|
|
905
925
|
matched
|
|
@@ -1045,8 +1065,9 @@ var _SibuRouter = class _SibuRouter {
|
|
|
1045
1065
|
path = path.replace(new RegExp(`:${key}(?=[/?#]|$)`, "g"), encodeURIComponent(value));
|
|
1046
1066
|
}
|
|
1047
1067
|
}
|
|
1048
|
-
|
|
1049
|
-
|
|
1068
|
+
const search = to.query ? serializeQuery(to.query) : "";
|
|
1069
|
+
if (search) {
|
|
1070
|
+
path += `?${search}`;
|
|
1050
1071
|
}
|
|
1051
1072
|
if (to.hash) {
|
|
1052
1073
|
path += `#${to.hash}`;
|
|
@@ -1055,10 +1076,11 @@ var _SibuRouter = class _SibuRouter {
|
|
|
1055
1076
|
}
|
|
1056
1077
|
isSameRoute(from, to) {
|
|
1057
1078
|
if (from.matched.length === 0 && to.matched.length > 0) return false;
|
|
1058
|
-
return from.path === to.path && paramsIdentity(from.params) === paramsIdentity(to.params) && queryIdentity(from.
|
|
1079
|
+
return from.path === to.path && paramsIdentity(from.params) === paramsIdentity(to.params) && queryIdentity(from.queryAll) === queryIdentity(to.queryAll) && from.hash === to.hash;
|
|
1059
1080
|
}
|
|
1060
1081
|
updateHistory(to, options) {
|
|
1061
|
-
const
|
|
1082
|
+
const search = serializeQuery(to.queryAll);
|
|
1083
|
+
const fullPath = this.options.base + to.path + (search ? `?${search}` : "") + (to.hash ? `#${to.hash}` : "");
|
|
1062
1084
|
const h = globalThis.history;
|
|
1063
1085
|
if (!h) return;
|
|
1064
1086
|
if (options.replace) {
|
|
@@ -1241,6 +1263,65 @@ function abortReasonOf(signal2) {
|
|
|
1241
1263
|
}
|
|
1242
1264
|
var ROUTER_KEY = /* @__PURE__ */ Symbol.for("sibujs.router.v1");
|
|
1243
1265
|
var _routerRef = globalThis[ROUTER_KEY] ?? (globalThis[ROUTER_KEY] = { current: null });
|
|
1266
|
+
var [routerRevision, setRouterRevision] = signal(0);
|
|
1267
|
+
var awaitingParent = /* @__PURE__ */ new Map();
|
|
1268
|
+
var parentObserver = null;
|
|
1269
|
+
function stopParentObserverIfIdle() {
|
|
1270
|
+
if (parentObserver && awaitingParent.size === 0) {
|
|
1271
|
+
parentObserver.disconnect();
|
|
1272
|
+
parentObserver = null;
|
|
1273
|
+
}
|
|
1274
|
+
}
|
|
1275
|
+
function whenAnchorAttached(anchor, run) {
|
|
1276
|
+
let cancelled = false;
|
|
1277
|
+
queueMicrotask(() => {
|
|
1278
|
+
if (cancelled) return;
|
|
1279
|
+
if (anchor.parentNode) {
|
|
1280
|
+
cancelled = true;
|
|
1281
|
+
run();
|
|
1282
|
+
return;
|
|
1283
|
+
}
|
|
1284
|
+
if (typeof MutationObserver === "undefined" || typeof document === "undefined") return;
|
|
1285
|
+
awaitingParent.set(anchor, () => {
|
|
1286
|
+
cancelled = true;
|
|
1287
|
+
run();
|
|
1288
|
+
});
|
|
1289
|
+
if (!parentObserver) {
|
|
1290
|
+
parentObserver = new MutationObserver(() => {
|
|
1291
|
+
for (const [node, cb] of awaitingParent) {
|
|
1292
|
+
if (!node.parentNode) continue;
|
|
1293
|
+
awaitingParent.delete(node);
|
|
1294
|
+
cb();
|
|
1295
|
+
}
|
|
1296
|
+
stopParentObserverIfIdle();
|
|
1297
|
+
});
|
|
1298
|
+
parentObserver.observe(document, { childList: true, subtree: true });
|
|
1299
|
+
}
|
|
1300
|
+
});
|
|
1301
|
+
return () => {
|
|
1302
|
+
if (cancelled) return;
|
|
1303
|
+
cancelled = true;
|
|
1304
|
+
awaitingParent.delete(anchor);
|
|
1305
|
+
stopParentObserverIfIdle();
|
|
1306
|
+
};
|
|
1307
|
+
}
|
|
1308
|
+
function attachRetry(anchor, rerun) {
|
|
1309
|
+
const run = bindOwnerScope(rerun);
|
|
1310
|
+
let cancelWait = null;
|
|
1311
|
+
return {
|
|
1312
|
+
request: () => {
|
|
1313
|
+
if (cancelWait) return;
|
|
1314
|
+
cancelWait = whenAnchorAttached(anchor, () => {
|
|
1315
|
+
cancelWait = null;
|
|
1316
|
+
run();
|
|
1317
|
+
});
|
|
1318
|
+
},
|
|
1319
|
+
cancel: () => {
|
|
1320
|
+
cancelWait?.();
|
|
1321
|
+
cancelWait = null;
|
|
1322
|
+
}
|
|
1323
|
+
};
|
|
1324
|
+
}
|
|
1244
1325
|
function normalizeRoutes(routes) {
|
|
1245
1326
|
return routes.map((route2) => {
|
|
1246
1327
|
const normalizedChildren = route2.children && route2.children.length > 0 ? normalizeRoutes(route2.children) : route2.children;
|
|
@@ -1272,6 +1353,7 @@ function createRouter(routesOrOptions, options = {}) {
|
|
|
1272
1353
|
}
|
|
1273
1354
|
_routerRef.current = new SibuRouter(routes, options);
|
|
1274
1355
|
ensureRouterPagehide();
|
|
1356
|
+
setRouterRevision((n) => n + 1);
|
|
1275
1357
|
return _routerRef.current;
|
|
1276
1358
|
}
|
|
1277
1359
|
function setRoutes(routes) {
|
|
@@ -1427,6 +1509,9 @@ function Route() {
|
|
|
1427
1509
|
let currentKey = null;
|
|
1428
1510
|
let routeTorn = false;
|
|
1429
1511
|
const commitTarget = (seq) => routeTorn || seq !== navSeq ? null : anchor.parentNode;
|
|
1512
|
+
const retryIfDetached = (seq) => {
|
|
1513
|
+
if (!routeTorn && seq === navSeq && !anchor.parentNode) attachWait.request();
|
|
1514
|
+
};
|
|
1430
1515
|
const release = (node) => {
|
|
1431
1516
|
if (!node) return;
|
|
1432
1517
|
disposeOwned(node);
|
|
@@ -1509,6 +1594,7 @@ function Route() {
|
|
|
1509
1594
|
anchor.parentNode.insertBefore(errorNode, anchor.nextSibling);
|
|
1510
1595
|
};
|
|
1511
1596
|
const update = async () => {
|
|
1597
|
+
routerRevision();
|
|
1512
1598
|
if (routeTorn || !_routerRef.current) return;
|
|
1513
1599
|
const seq = ++navSeq;
|
|
1514
1600
|
const route2 = scopedRoute(_routerRef.current);
|
|
@@ -1542,11 +1628,15 @@ function Route() {
|
|
|
1542
1628
|
showLoading();
|
|
1543
1629
|
}
|
|
1544
1630
|
const plan = await _routerRef.current.loadPlan(routeDef, route2.path);
|
|
1545
|
-
if (!commitTarget(seq))
|
|
1631
|
+
if (!commitTarget(seq)) {
|
|
1632
|
+
retryIfDetached(seq);
|
|
1633
|
+
return;
|
|
1634
|
+
}
|
|
1546
1635
|
const node = await instantiateScoped(_routerRef.current, plan, routeDef, route2.path, route2);
|
|
1547
1636
|
const parent = commitTarget(seq);
|
|
1548
1637
|
if (!parent) {
|
|
1549
1638
|
release(node);
|
|
1639
|
+
retryIfDetached(seq);
|
|
1550
1640
|
return;
|
|
1551
1641
|
}
|
|
1552
1642
|
if (node) {
|
|
@@ -1560,15 +1650,31 @@ function Route() {
|
|
|
1560
1650
|
if (routeTorn || seq !== navSeq) return;
|
|
1561
1651
|
hideLoading();
|
|
1562
1652
|
console.error("[Route] Component error:", error);
|
|
1563
|
-
|
|
1653
|
+
fail(seq, error, routeDef);
|
|
1564
1654
|
}
|
|
1565
1655
|
}
|
|
1566
1656
|
} catch (error) {
|
|
1567
1657
|
if (seq !== navSeq) return;
|
|
1568
1658
|
if (routeTorn) return;
|
|
1569
1659
|
console.error("[Route] Update failed:", error);
|
|
1570
|
-
|
|
1660
|
+
fail(seq, error);
|
|
1661
|
+
}
|
|
1662
|
+
};
|
|
1663
|
+
let unshownFailure = null;
|
|
1664
|
+
const fail = (seq, error, routeDef) => {
|
|
1665
|
+
const err = error instanceof Error ? error : new Error(String(error));
|
|
1666
|
+
if (anchor.parentNode) {
|
|
1667
|
+
showError(err, routeDef);
|
|
1668
|
+
return;
|
|
1571
1669
|
}
|
|
1670
|
+
unshownFailure = { seq, error: err, routeDef };
|
|
1671
|
+
attachWait.request();
|
|
1672
|
+
};
|
|
1673
|
+
const onAttached = () => {
|
|
1674
|
+
const failure = unshownFailure;
|
|
1675
|
+
unshownFailure = null;
|
|
1676
|
+
if (failure && failure.seq === navSeq) showError(failure.error, failure.routeDef);
|
|
1677
|
+
else update();
|
|
1572
1678
|
};
|
|
1573
1679
|
let routeInitialized = false;
|
|
1574
1680
|
const originalUpdate = update;
|
|
@@ -1576,6 +1682,7 @@ function Route() {
|
|
|
1576
1682
|
await originalUpdate();
|
|
1577
1683
|
routeInitialized = true;
|
|
1578
1684
|
};
|
|
1685
|
+
const attachWait = attachRetry(anchor, onAttached);
|
|
1579
1686
|
const routeTeardown = track(wrappedUpdate);
|
|
1580
1687
|
if (!routeInitialized) {
|
|
1581
1688
|
queueMicrotask(
|
|
@@ -1589,6 +1696,8 @@ function Route() {
|
|
|
1589
1696
|
routeTorn = true;
|
|
1590
1697
|
navSeq++;
|
|
1591
1698
|
routeTeardown();
|
|
1699
|
+
attachWait.cancel();
|
|
1700
|
+
unshownFailure = null;
|
|
1592
1701
|
cleanupNodes();
|
|
1593
1702
|
currentTopRoute = null;
|
|
1594
1703
|
currentKey = null;
|
|
@@ -1612,6 +1721,7 @@ function KeepAliveRoute(options) {
|
|
|
1612
1721
|
let updateSeq = 0;
|
|
1613
1722
|
let kaTorn = false;
|
|
1614
1723
|
const update = async () => {
|
|
1724
|
+
routerRevision();
|
|
1615
1725
|
if (kaTorn || !_routerRef.current) return;
|
|
1616
1726
|
const seq = ++updateSeq;
|
|
1617
1727
|
const router2 = _routerRef.current;
|
|
@@ -1629,13 +1739,16 @@ function KeepAliveRoute(options) {
|
|
|
1629
1739
|
return;
|
|
1630
1740
|
}
|
|
1631
1741
|
if (!("component" in routeDef)) return;
|
|
1632
|
-
const cacheKey = JSON.stringify([route2.path, queryIdentity(route2.
|
|
1742
|
+
const cacheKey = JSON.stringify([route2.path, queryIdentity(route2.queryAll), route2.hash]);
|
|
1633
1743
|
const shouldCache = !includeNames || routeDef.name != null && includeNames.includes(routeDef.name);
|
|
1634
1744
|
if (cacheKey === currentKey && currentNode) {
|
|
1635
1745
|
updateInstanceRoute(currentNode, route2);
|
|
1636
1746
|
return;
|
|
1637
1747
|
}
|
|
1638
|
-
if (!anchor.parentNode)
|
|
1748
|
+
if (!anchor.parentNode) {
|
|
1749
|
+
attachWait.request();
|
|
1750
|
+
return;
|
|
1751
|
+
}
|
|
1639
1752
|
let node = null;
|
|
1640
1753
|
let fromCache = false;
|
|
1641
1754
|
if (shouldCache && cache.has(cacheKey)) {
|
|
@@ -1660,6 +1773,7 @@ function KeepAliveRoute(options) {
|
|
|
1660
1773
|
const parent = anchor.parentNode;
|
|
1661
1774
|
if (!parent) {
|
|
1662
1775
|
if (!fromCache) disposeOwned(node);
|
|
1776
|
+
attachWait.request();
|
|
1663
1777
|
return;
|
|
1664
1778
|
}
|
|
1665
1779
|
if (currentNode && currentNode !== node) {
|
|
@@ -1698,6 +1812,7 @@ function KeepAliveRoute(options) {
|
|
|
1698
1812
|
await update();
|
|
1699
1813
|
initialized = true;
|
|
1700
1814
|
};
|
|
1815
|
+
const attachWait = attachRetry(anchor, update);
|
|
1701
1816
|
const kaTeardown = track(wrappedUpdate);
|
|
1702
1817
|
if (!initialized) {
|
|
1703
1818
|
queueMicrotask(
|
|
@@ -1711,6 +1826,7 @@ function KeepAliveRoute(options) {
|
|
|
1711
1826
|
kaTorn = true;
|
|
1712
1827
|
updateSeq++;
|
|
1713
1828
|
kaTeardown();
|
|
1829
|
+
attachWait.cancel();
|
|
1714
1830
|
for (const node of cache.values()) {
|
|
1715
1831
|
disposeOwned(node);
|
|
1716
1832
|
if (node.parentNode) node.parentNode.removeChild(node);
|
|
@@ -1755,7 +1871,7 @@ function RouterLink(props, children) {
|
|
|
1755
1871
|
const route2 = routeGetter();
|
|
1756
1872
|
const currentPath = normalizePathname(route2.path);
|
|
1757
1873
|
const isActive = kind === "internal" && isPathnameAncestor(targetPath, currentPath);
|
|
1758
|
-
const isExactActive = kind === "internal" && currentPath === targetPath && queryIdentity(route2.
|
|
1874
|
+
const isExactActive = kind === "internal" && currentPath === targetPath && queryIdentity(route2.queryAll) === targetQuery && route2.hash === hrefHash;
|
|
1759
1875
|
const classes = [];
|
|
1760
1876
|
if (isActive) {
|
|
1761
1877
|
if (activeClass) classes.push(activeClass);
|
|
@@ -1950,12 +2066,16 @@ function Outlet() {
|
|
|
1950
2066
|
currentKey = null;
|
|
1951
2067
|
};
|
|
1952
2068
|
const commitTarget = (seq) => outletTorn || seq !== navSeq ? null : anchor.parentNode;
|
|
2069
|
+
const retryIfDetached = (seq) => {
|
|
2070
|
+
if (!outletTorn && seq === navSeq && !anchor.parentNode) attachWait.request();
|
|
2071
|
+
};
|
|
1953
2072
|
const release = (node) => {
|
|
1954
2073
|
if (!node) return;
|
|
1955
2074
|
disposeOwned(node);
|
|
1956
2075
|
node.parentNode?.removeChild(node);
|
|
1957
2076
|
};
|
|
1958
2077
|
const update = async () => {
|
|
2078
|
+
routerRevision();
|
|
1959
2079
|
if (outletTorn || !_routerRef.current) return;
|
|
1960
2080
|
const seq = ++navSeq;
|
|
1961
2081
|
const route2 = scopedRoute(_routerRef.current);
|
|
@@ -1976,11 +2096,15 @@ function Outlet() {
|
|
|
1976
2096
|
try {
|
|
1977
2097
|
const cacheKey = `${route2.path}\0${childRoute.path}`;
|
|
1978
2098
|
const plan = await _routerRef.current.loadPlan(childRoute, cacheKey);
|
|
1979
|
-
if (!commitTarget(seq))
|
|
2099
|
+
if (!commitTarget(seq)) {
|
|
2100
|
+
retryIfDetached(seq);
|
|
2101
|
+
return;
|
|
2102
|
+
}
|
|
1980
2103
|
const node = await instantiateScoped(_routerRef.current, plan, childRoute, cacheKey, route2);
|
|
1981
2104
|
const parent = commitTarget(seq);
|
|
1982
2105
|
if (!parent) {
|
|
1983
2106
|
release(node);
|
|
2107
|
+
retryIfDetached(seq);
|
|
1984
2108
|
return;
|
|
1985
2109
|
}
|
|
1986
2110
|
if (!node) return;
|
|
@@ -1994,6 +2118,7 @@ function Outlet() {
|
|
|
1994
2118
|
console.error("[Outlet] Failed to render child route:", error);
|
|
1995
2119
|
}
|
|
1996
2120
|
};
|
|
2121
|
+
const attachWait = attachRetry(anchor, update);
|
|
1997
2122
|
const outletTeardown = track(update);
|
|
1998
2123
|
if (!anchor.parentNode) {
|
|
1999
2124
|
queueMicrotask(
|
|
@@ -2007,6 +2132,7 @@ function Outlet() {
|
|
|
2007
2132
|
outletTorn = true;
|
|
2008
2133
|
navSeq++;
|
|
2009
2134
|
outletTeardown();
|
|
2135
|
+
attachWait.cancel();
|
|
2010
2136
|
if (currentNode) {
|
|
2011
2137
|
disposeOwned(currentNode);
|
|
2012
2138
|
if (currentNode.parentNode) currentNode.parentNode.removeChild(currentNode);
|
|
@@ -2034,6 +2160,7 @@ function routerState() {
|
|
|
2034
2160
|
currentPath: () => scopedRoute(router2).path,
|
|
2035
2161
|
params: () => scopedRoute(router2).params,
|
|
2036
2162
|
query: () => scopedRoute(router2).query,
|
|
2163
|
+
queryAll: () => scopedRoute(router2).queryAll,
|
|
2037
2164
|
hash: () => scopedRoute(router2).hash,
|
|
2038
2165
|
meta: () => scopedRoute(router2).meta,
|
|
2039
2166
|
isNavigating: () => router2.isNavigating,
|
package/dist/ssr.cjs
CHANGED
|
@@ -2023,7 +2023,7 @@ function forEachSubscriber(signal2, visit) {
|
|
|
2023
2023
|
}
|
|
2024
2024
|
|
|
2025
2025
|
// src/reactivity/track.ts
|
|
2026
|
-
var _runtimeVersion = true ? "4.
|
|
2026
|
+
var _runtimeVersion = true ? "4.11.0" : "dev";
|
|
2027
2027
|
var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
|
|
2028
2028
|
function resolveReactiveApi() {
|
|
2029
2029
|
const g2 = globalThis;
|
package/dist/ssr.js
CHANGED
|
@@ -23,9 +23,9 @@ import {
|
|
|
23
23
|
wasm,
|
|
24
24
|
worker,
|
|
25
25
|
workerFn
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-YXJHLMRH.js";
|
|
27
27
|
import "./chunk-52XFPGSN.js";
|
|
28
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-LQ2C44YH.js";
|
|
29
29
|
import {
|
|
30
30
|
collectStream,
|
|
31
31
|
deserializeState,
|
|
@@ -47,15 +47,15 @@ import {
|
|
|
47
47
|
trustHTML
|
|
48
48
|
} from "./chunk-FC6KCJSA.js";
|
|
49
49
|
import "./chunk-62BDYGAG.js";
|
|
50
|
-
import "./chunk-
|
|
51
|
-
import "./chunk-
|
|
50
|
+
import "./chunk-3Z7AEJMQ.js";
|
|
51
|
+
import "./chunk-HMOPAC2Z.js";
|
|
52
52
|
import "./chunk-3ACAAQIN.js";
|
|
53
53
|
import "./chunk-7ZHH77QA.js";
|
|
54
|
-
import "./chunk-
|
|
54
|
+
import "./chunk-OJV2RW4D.js";
|
|
55
55
|
import "./chunk-EXXSN3BW.js";
|
|
56
56
|
import "./chunk-7XHATCIH.js";
|
|
57
|
-
import "./chunk-
|
|
58
|
-
import "./chunk-
|
|
57
|
+
import "./chunk-F6B5CKF7.js";
|
|
58
|
+
import "./chunk-ADWDDJ5M.js";
|
|
59
59
|
import "./chunk-NYNYSPK7.js";
|
|
60
60
|
export {
|
|
61
61
|
Head,
|
package/dist/testing.cjs
CHANGED
|
@@ -780,7 +780,7 @@ function forEachSubscriber(signal, visit) {
|
|
|
780
780
|
}
|
|
781
781
|
|
|
782
782
|
// src/reactivity/track.ts
|
|
783
|
-
var _runtimeVersion = true ? "4.
|
|
783
|
+
var _runtimeVersion = true ? "4.11.0" : "dev";
|
|
784
784
|
var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
|
|
785
785
|
function resolveReactiveApi() {
|
|
786
786
|
const g = globalThis;
|
package/dist/testing.js
CHANGED
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
} from "./chunk-7ZHH77QA.js";
|
|
4
4
|
import {
|
|
5
5
|
effect
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-OJV2RW4D.js";
|
|
7
7
|
import "./chunk-7XHATCIH.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-ADWDDJ5M.js";
|
|
9
9
|
import {
|
|
10
10
|
dispose,
|
|
11
11
|
replaceChildrenSafely,
|
package/dist/ui.cjs
CHANGED
|
@@ -860,7 +860,7 @@ function forEachSubscriber(signal2, visit) {
|
|
|
860
860
|
}
|
|
861
861
|
|
|
862
862
|
// src/reactivity/track.ts
|
|
863
|
-
var _runtimeVersion = true ? "4.
|
|
863
|
+
var _runtimeVersion = true ? "4.11.0" : "dev";
|
|
864
864
|
var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
|
|
865
865
|
function resolveReactiveApi() {
|
|
866
866
|
const g = globalThis;
|
package/dist/ui.js
CHANGED
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
toast,
|
|
39
39
|
withScopedStyle,
|
|
40
40
|
zipMask
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-NBBFF5VA.js";
|
|
42
42
|
import {
|
|
43
43
|
RenderProp,
|
|
44
44
|
assertType,
|
|
@@ -57,24 +57,24 @@ import {
|
|
|
57
57
|
} from "./chunk-TUCPL2HB.js";
|
|
58
58
|
import {
|
|
59
59
|
createId
|
|
60
|
-
} from "./chunk-
|
|
61
|
-
import "./chunk-
|
|
60
|
+
} from "./chunk-CHQPJY47.js";
|
|
61
|
+
import "./chunk-HMOPAC2Z.js";
|
|
62
62
|
import "./chunk-3ACAAQIN.js";
|
|
63
|
-
import "./chunk-
|
|
63
|
+
import "./chunk-KFJUMC3Q.js";
|
|
64
64
|
import {
|
|
65
65
|
globalSingleton
|
|
66
66
|
} from "./chunk-7ZHH77QA.js";
|
|
67
67
|
import {
|
|
68
68
|
effect
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-OJV2RW4D.js";
|
|
70
70
|
import "./chunk-EXXSN3BW.js";
|
|
71
71
|
import "./chunk-7XHATCIH.js";
|
|
72
72
|
import "./chunk-5HZXGZ6T.js";
|
|
73
73
|
import {
|
|
74
74
|
batch,
|
|
75
75
|
signal
|
|
76
|
-
} from "./chunk-
|
|
77
|
-
import "./chunk-
|
|
76
|
+
} from "./chunk-F6B5CKF7.js";
|
|
77
|
+
import "./chunk-ADWDDJ5M.js";
|
|
78
78
|
import {
|
|
79
79
|
registerDisposer,
|
|
80
80
|
unregisterDisposer
|
package/dist/widgets.cjs
CHANGED
|
@@ -735,7 +735,7 @@ function forEachSubscriber(signal2, visit) {
|
|
|
735
735
|
}
|
|
736
736
|
|
|
737
737
|
// src/reactivity/track.ts
|
|
738
|
-
var _runtimeVersion = true ? "4.
|
|
738
|
+
var _runtimeVersion = true ? "4.11.0" : "dev";
|
|
739
739
|
var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
|
|
740
740
|
function resolveReactiveApi() {
|
|
741
741
|
const g = globalThis;
|
package/dist/widgets.js
CHANGED
|
@@ -8,14 +8,14 @@ import {
|
|
|
8
8
|
select,
|
|
9
9
|
tabs,
|
|
10
10
|
tooltip
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-RRKGQKPU.js";
|
|
12
|
+
import "./chunk-REOAVT2M.js";
|
|
13
|
+
import "./chunk-CHQPJY47.js";
|
|
14
|
+
import "./chunk-KFJUMC3Q.js";
|
|
15
15
|
import "./chunk-EXXSN3BW.js";
|
|
16
16
|
import "./chunk-7XHATCIH.js";
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-F6B5CKF7.js";
|
|
18
|
+
import "./chunk-ADWDDJ5M.js";
|
|
19
19
|
import "./chunk-NYNYSPK7.js";
|
|
20
20
|
export {
|
|
21
21
|
accordion,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sibujs",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.11.0",
|
|
4
4
|
"description": "A function-based frontend framework with fine-grained reactivity and no virtual DOM. Tag factories return live DOM nodes you can hold and mutate, signals update only what changed, and nothing needs a compiler — it runs from a script tag or a bundler.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"frontend",
|