bun-plugin-stx 0.2.346 → 0.2.347

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.
@@ -2782,9 +2782,24 @@ else {
2782
2782
  // point at this path, exactly one is.
2783
2783
  var have=new URLSearchParams(location.search),q=true;
2784
2784
  u.searchParams.forEach(function(v,k){if(have.getAll(k).indexOf(v)===-1)q=false});
2785
+ // EXACT is the stricter half (stacksjs/stx#2017). A link with NO query
2786
+ // satisfied the loop above trivially, so a bare /list reported itself exact
2787
+ // on /list?status=up - taking exact-active-class and aria-current from the
2788
+ // chip the user was actually on, and telling a screen reader the unfiltered
2789
+ // link was the current page.
2790
+ //
2791
+ // Only a link with no query at all is held to the stricter test, which is
2792
+ // what keeps #1777 working: a range picker's /dashboard?site=1&range=7d is
2793
+ // still exact on /dashboard?site=1&range=7d&country=US, because a page
2794
+ // filter the link does not name should not unmark the range it IS on. The
2795
+ // two requests look opposed and are not - one is about a link naming MORE
2796
+ // than the page, the other about a link naming NOTHING.
2797
+ var linkHasQuery=false;
2798
+ u.searchParams.forEach(function(){linkHasQuery=true});
2799
+ var sameQuery=q&&(linkHasQuery||!location.search);
2785
2800
  var matched=matchesAny(also,cur);
2786
2801
  return {
2787
- exact:q&&path===cur,
2802
+ exact:sameQuery&&path===cur,
2788
2803
  active:q&&(path==='/'?cur==='/':(cur===path||cur.indexOf(path+'/')===0))||matched,
2789
2804
  matched:matched
2790
2805
  };
@@ -2836,12 +2851,21 @@ else {
2836
2851
  // Only ever touched on links that already carry the attribute or are the
2837
2852
  // current one, so a page using aria-current for something else \u2014 a step in a
2838
2853
  // wizard, a sort direction \u2014 is not rewritten out from under itself.
2854
+ //
2855
+ // Cleared for 'true' as well as 'page' (#2017). Both say "this is the current
2856
+ // one" with no further meaning, and a consumer working around a missing
2857
+ // aria-current by stamping aria-current="true" server-side kept it forever:
2858
+ // the router neither updated nor removed it, so after one navigation it named
2859
+ // the wrong link and the workaround was worse than the bug. The role-specific
2860
+ // values - step, location, date, time - are still left alone, because those
2861
+ // ARE the page using the attribute for something else.
2839
2862
  function markCurrent(link,isExact){
2863
+ var now=link.getAttribute('aria-current');
2840
2864
  if(isExact){
2841
- if(link.getAttribute('aria-current')!=='page')link.setAttribute('aria-current','page');
2865
+ if(now!=='page')link.setAttribute('aria-current','page');
2842
2866
  return;
2843
2867
  }
2844
- if(link.getAttribute('aria-current')==='page')link.removeAttribute('aria-current');
2868
+ if(now==='page'||now==='true')link.removeAttribute('aria-current');
2845
2869
  }
2846
2870
 
2847
2871
  // \u2500\u2500 Progress bar DOM + style \u2500\u2500
package/dist/serve.js CHANGED
@@ -9792,7 +9792,7 @@ function __stxOverlay(errs){
9792
9792
  rebuildDiscoveredPagePaths(kept);
9793
9793
  await indexPageMiddleware(kept);
9794
9794
  try {
9795
- const { Router } = await import("./chunk-nr0dabfh.js");
9795
+ const { Router } = await import("./chunk-gj752wyj.js");
9796
9796
  const pagesDirs = patterns.map((p) => p.replace(/\/$/, "")).filter(Boolean);
9797
9797
  const router = new Router(process19.cwd(), { pagesDirs, stateDir: stateDirName(), exclude: options.exclude });
9798
9798
  if (!options.quiet)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bun-plugin-stx",
3
3
  "type": "module",
4
- "version": "0.2.346",
4
+ "version": "0.2.347",
5
5
  "description": "A Bun plugin that allows for using Laravel Blade-like syntax.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",
@@ -74,7 +74,7 @@
74
74
  "typecheck": "bun tsc --noEmit"
75
75
  },
76
76
  "dependencies": {
77
- "@stacksjs/stx": "0.2.346",
78
- "stx-router": "0.2.346"
77
+ "@stacksjs/stx": "0.2.347",
78
+ "stx-router": "0.2.347"
79
79
  }
80
80
  }