bun-plugin-stx 0.2.220 → 0.2.221

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.
Files changed (2) hide show
  1. package/dist/serve.js +4 -5
  2. package/package.json +1 -1
package/dist/serve.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
3
  import {
4
- deriveLayoutGroup
4
+ extractLayoutMetadata
5
5
  } from "./chunk-93ete56h.js";
6
6
  import {
7
7
  __require
@@ -10510,10 +10510,9 @@ ${html}`;
10510
10510
  const responseStatus = reqCtx.responseStatus ?? 200;
10511
10511
  const isSpaNav = req.headers.get(SPA_NAV_HEADER) === "true";
10512
10512
  if (isSpaNav) {
10513
- const layoutMatch = content.match(/<!-- stx-layout: ([^ ]+) -->/);
10514
- const pageLayout = layoutMatch ? layoutMatch[1] : "default";
10515
- const groupMetaMatch = content.match(/<meta\b[^>]*name=["']stx-layout-group["'][^>]*content=["']([^"']+)["'][^>]*>/i);
10516
- const pageLayoutGroup = i18nConfig && i18nLocale ? `i18n:${i18nLocale}` : groupMetaMatch?.[1] || deriveLayoutGroup(pageLayout);
10513
+ const layoutMetadata = extractLayoutMetadata(content);
10514
+ const pageLayout = layoutMetadata.layout;
10515
+ const pageLayoutGroup = i18nConfig && i18nLocale ? `i18n:${i18nLocale}` : layoutMetadata.group;
10517
10516
  let fragment = content;
10518
10517
  let containerAttrs = "";
10519
10518
  let mainContentStart = -1;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bun-plugin-stx",
3
3
  "type": "module",
4
- "version": "0.2.220",
4
+ "version": "0.2.221",
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",