bun-plugin-stx 0.2.332 → 0.2.333

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.
@@ -1663,6 +1663,16 @@ else {
1663
1663
  }
1664
1664
  return '';
1665
1665
  });
1666
+ // A <style> inside a script is a string the script owns \u2014 a web
1667
+ // component's shadow-DOM CSS, typically \u2014 not a page style. Lifted into
1668
+ // <head> it restyles the whole document (its bare button rule shrank
1669
+ // every button on the page) and the component loses it. Hold scripts
1670
+ // aside while the fragment's own styles are collected.
1671
+ var heldScripts=[];
1672
+ cleanFrag=cleanFrag.replace(new RegExp('<scr'+'ipt\\\\b[^>]*>[\\\\s\\\\S]*?<\\\\/scr'+'ipt>','gi'),function(m){
1673
+ heldScripts.push(m);
1674
+ return '<!--stx-held-script-'+(heldScripts.length-1)+'-->';
1675
+ });
1666
1676
  cleanFrag=cleanFrag.replace(new RegExp('<sty'+'le\\\\b([^>]*)>([\\\\s\\\\S]*?)<\\\\/sty'+'le>','gi'),function(m,attrs,css){
1667
1677
  if(attrs.indexOf('data-css')!==-1){
1668
1678
  fragCss=css;
@@ -1677,6 +1687,7 @@ else {
1677
1687
  if(hrefMatch&&hrefMatch[2])fragCssHrefs.push(hrefMatch[2]);
1678
1688
  return '';
1679
1689
  });
1690
+ cleanFrag=cleanFrag.replace(new RegExp('<!--stx-held-script-(\\\\d+)-->','g'),function(m,i){return heldScripts[Number(i)]});
1680
1691
  // Remove old page styles (not css \u2014 that gets merged)
1681
1692
  document.querySelectorAll('style[data-stx-page]').forEach(function(s){s.remove()});
1682
1693
  // Merge css CSS from fragment into existing css style
package/dist/serve.js CHANGED
@@ -9791,7 +9791,7 @@ function __stxOverlay(errs){
9791
9791
  rebuildDiscoveredPagePaths(kept);
9792
9792
  await indexPageMiddleware(kept);
9793
9793
  try {
9794
- const { Router } = await import("./chunk-q16hhp48.js");
9794
+ const { Router } = await import("./chunk-pg39gv16.js");
9795
9795
  const pagesDirs = patterns.map((p) => p.replace(/\/$/, "")).filter(Boolean);
9796
9796
  const router = new Router(process19.cwd(), { pagesDirs, stateDir: stateDirName(), exclude: options.exclude });
9797
9797
  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.332",
4
+ "version": "0.2.333",
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.332",
78
- "stx-router": "0.2.332"
77
+ "@stacksjs/stx": "0.2.333",
78
+ "stx-router": "0.2.333"
79
79
  }
80
80
  }