bun-plugin-stx 0.2.221 → 0.2.222
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.
|
@@ -2180,9 +2180,28 @@ else {
|
|
|
2180
2180
|
var isActive=href!=='/'?cur.startsWith(href):cur==='/';
|
|
2181
2181
|
if(isExact)eac.split(' ').forEach(function(cls){if(cls)link.classList.add(cls)});
|
|
2182
2182
|
if(isActive)ac.split(' ').forEach(function(cls){if(cls)link.classList.add(cls)});
|
|
2183
|
+
markCurrent(link,isExact);
|
|
2183
2184
|
});
|
|
2184
2185
|
}
|
|
2185
2186
|
|
|
2187
|
+
// aria-current="page" names the page the user is ON, so it has to move when
|
|
2188
|
+
// the page does. The server stamps it on the link for the page it rendered;
|
|
2189
|
+
// after that, only a full load would ever correct it, and a fragment swap is
|
|
2190
|
+
// not a full load. Left alone, a screen reader announces the entry the user
|
|
2191
|
+
// arrived through as current for the rest of the session, however far they
|
|
2192
|
+
// navigate \u2014 silently wrong, and only to the people relying on it.
|
|
2193
|
+
//
|
|
2194
|
+
// Only ever touched on links that already carry the attribute or are the
|
|
2195
|
+
// current one, so a page using aria-current for something else \u2014 a step in a
|
|
2196
|
+
// wizard, a sort direction \u2014 is not rewritten out from under itself.
|
|
2197
|
+
function markCurrent(link,isExact){
|
|
2198
|
+
if(isExact){
|
|
2199
|
+
if(link.getAttribute('aria-current')!=='page')link.setAttribute('aria-current','page');
|
|
2200
|
+
return;
|
|
2201
|
+
}
|
|
2202
|
+
if(link.getAttribute('aria-current')==='page')link.removeAttribute('aria-current');
|
|
2203
|
+
}
|
|
2204
|
+
|
|
2186
2205
|
// \u2500\u2500 Progress bar DOM + style \u2500\u2500
|
|
2187
2206
|
// Injects a fixed-position element at the top of the viewport plus the
|
|
2188
2207
|
// minimal CSS for its transform/opacity transitions. Kept idempotent so
|
package/dist/serve.js
CHANGED
|
@@ -9587,7 +9587,7 @@ function __stxOverlay(errs){
|
|
|
9587
9587
|
pageMiddlewarePatterns.length = 0;
|
|
9588
9588
|
await Promise.all(files.map((f) => detectPageMiddleware(f)));
|
|
9589
9589
|
try {
|
|
9590
|
-
const { Router } = await import("./chunk-
|
|
9590
|
+
const { Router } = await import("./chunk-qqcjq6v2.js");
|
|
9591
9591
|
const pagesDirs = patterns.map((p) => p.replace(/\/$/, "")).filter(Boolean);
|
|
9592
9592
|
const router = new Router(process19.cwd(), { pagesDirs, stateDir: stateDirName() });
|
|
9593
9593
|
if (!options.quiet)
|
package/package.json
CHANGED