bun-plugin-stx 0.2.393 → 0.2.394

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.
@@ -2836,6 +2836,22 @@ else {
2836
2836
  navigate(location.pathname+location.search+location.hash,false);
2837
2837
  });
2838
2838
 
2839
+ // \u2500\u2500 Offline stand-in \u2500\u2500
2840
+ // Without a network the offline worker answers a screen it has not kept
2841
+ // whole with the app's first screen, marked. A screen reached inside the
2842
+ // app was kept as a fragment, so ask for that and show it in place. Only
2843
+ // when it is there: a failed navigate reloads, and the reload would be
2844
+ // answered with the stand-in again.
2845
+ var standIn=document.querySelector('meta[name="stx-offline-fallback"]');
2846
+ if(standIn&&shouldUseFragmentResponse()){
2847
+ standIn.remove();
2848
+ var wanted=location.pathname+location.search;
2849
+ fetch(wanted,{headers:{'X-STX-Router':'true','Accept':'text/html'}}).then(function(r){
2850
+ if(r.ok&&r.headers.get('X-STX-Fragment')==='true'&&location.pathname+location.search===wanted)
2851
+ navigate(wanted+location.hash,false,true);
2852
+ }).catch(function(){});
2853
+ }
2854
+
2839
2855
  // \u2500\u2500 Prefetch \u2500\u2500
2840
2856
  // A link's page, fetched before it is followed into the cache navigate
2841
2857
  // reads, so following it is a swap rather than a round trip.
package/dist/serve.js CHANGED
@@ -9800,7 +9800,7 @@ function __stxOverlay(errs){
9800
9800
  rebuildDiscoveredPagePaths(kept);
9801
9801
  await indexPageMiddleware(kept);
9802
9802
  try {
9803
- const { Router } = await import("./chunk-2fh2t5gw.js");
9803
+ const { Router } = await import("./chunk-1ssqyfe3.js");
9804
9804
  const pagesDirs = patterns.map((p) => p.replace(/\/$/, "")).filter(Boolean);
9805
9805
  const router = new Router(process19.cwd(), { pagesDirs, stateDir: stateDirName(), exclude: options.exclude });
9806
9806
  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.393",
4
+ "version": "0.2.394",
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.393",
78
- "stx-router": "0.2.393"
77
+ "@stacksjs/stx": "0.2.394",
78
+ "stx-router": "0.2.394"
79
79
  }
80
80
  }