This repository has been archived on 2026-04-03. You can view files and clone it, but cannot push or open issues or pull requests.
nyx/node_modules/vue-router/dist/volar/sfc-route-blocks.cjs
Nico e2667f8e12 Initial nyx project — fork of hermes-frontend
Forked from hermes-frontend, stripped openclaw/bun specifics:
- Auth tokens: openclaw_session -> nyx_session
- Vite proxy: localhost:3003 -> localhost:8000 (assay)
- Prod WS: wss://assay.loop42.de/ws
- Workspace paths: removed openclaw-specific paths
- Added missing deps: @heroicons/vue, overlayscrollbars-vue
- Branding: title -> nyx

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 20:23:27 +02:00

52 lines
1.5 KiB
JavaScript

/*!
* vue-router v5.0.3
* (c) 2026 Eduardo San Martin Morote
* @license MIT
*/
let _vue_language_core = require("@vue/language-core");
let muggle_string = require("muggle-string");
//#region src/volar/entries/sfc-route-blocks.ts
const plugin = () => {
const routeBlockIdPrefix = "route_";
const routeBlockIdRe = new RegExp(`^${routeBlockIdPrefix}(\\d+)$`);
return {
version: 2.1,
getEmbeddedCodes(_fileName, sfc) {
const embeddedCodes = [];
for (let i = 0; i < sfc.customBlocks.length; i++) {
const block = sfc.customBlocks[i];
if (block.type === "route") {
const lang = block.lang === "txt" ? "json" : block.lang;
embeddedCodes.push({
id: `${routeBlockIdPrefix}${i}`,
lang
});
}
}
return embeddedCodes;
},
resolveEmbeddedCode(_fileName, sfc, embeddedCode) {
const match = embeddedCode.id.match(routeBlockIdRe);
if (match) {
const i = parseInt(match[1]);
const block = sfc.customBlocks[i];
if (!block) return;
embeddedCode.content.push([
block.content,
block.name,
0,
_vue_language_core.allCodeFeatures
]);
if (embeddedCode.lang === "json") {
const contentStr = (0, muggle_string.toString)(embeddedCode.content);
if (contentStr.trim().startsWith("{") && !contentStr.includes("$schema")) (0, muggle_string.replace)(embeddedCode.content, "{", "{\n \"$schema\": \"https://router.vuejs.org/schemas/route.schema.json\",");
}
}
}
};
};
var sfc_route_blocks_default = plugin;
//#endregion
module.exports = sfc_route_blocks_default;