veslx 0.1.64 → 0.1.66

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 (50) hide show
  1. package/README.md +0 -16
  2. package/bin/lib/serve.ts +46 -0
  3. package/dist/bin/lib/serve.js +36 -0
  4. package/dist/bin/veslx.js +0 -0
  5. package/dist/client/components/gallery/index.js +7 -23
  6. package/dist/client/components/gallery/index.js.map +1 -1
  7. package/dist/client/components/mdx-components.js +0 -14
  8. package/dist/client/components/mdx-components.js.map +1 -1
  9. package/dist/client/components/post-list-item.js +6 -5
  10. package/dist/client/components/post-list-item.js.map +1 -1
  11. package/dist/client/components/post-list.js +6 -1
  12. package/dist/client/components/post-list.js.map +1 -1
  13. package/dist/client/lib/content-classification.js +11 -2
  14. package/dist/client/lib/content-classification.js.map +1 -1
  15. package/dist/client/plugin/src/client.js +7 -40
  16. package/dist/client/plugin/src/client.js.map +1 -1
  17. package/dist/plugin/src/client.js +7 -0
  18. package/dist/plugin/src/plugin.js +5 -2
  19. package/package.json +1 -1
  20. package/plugin/src/client.tsx +10 -0
  21. package/plugin/src/plugin.ts +5 -2
  22. package/src/components/gallery/index.tsx +8 -23
  23. package/src/components/index.ts +0 -3
  24. package/src/components/mdx-components.tsx +0 -21
  25. package/src/components/post-list-item.tsx +10 -6
  26. package/src/components/post-list.tsx +8 -2
  27. package/src/lib/content-classification.ts +12 -2
  28. package/dist/client/components/parameter-badge.js +0 -48
  29. package/dist/client/components/parameter-badge.js.map +0 -1
  30. package/dist/client/components/parameter-table.js +0 -216
  31. package/dist/client/components/parameter-table.js.map +0 -1
  32. package/dist/client/components/slides/figure-slide.js +0 -14
  33. package/dist/client/components/slides/figure-slide.js.map +0 -1
  34. package/dist/client/components/slides/hero-slide.js +0 -21
  35. package/dist/client/components/slides/hero-slide.js.map +0 -1
  36. package/dist/client/components/slides/slide-outline.js +0 -28
  37. package/dist/client/components/slides/slide-outline.js.map +0 -1
  38. package/dist/client/components/slides/text-slide.js +0 -18
  39. package/dist/client/components/slides/text-slide.js.map +0 -1
  40. package/dist/client/components/veslx-cat.js +0 -40
  41. package/dist/client/components/veslx-cat.js.map +0 -1
  42. package/dist/client/lib/parameter-utils.js +0 -108
  43. package/dist/client/lib/parameter-utils.js.map +0 -1
  44. package/src/components/parameter-badge.tsx +0 -78
  45. package/src/components/parameter-table.tsx +0 -369
  46. package/src/components/slides/figure-slide.tsx +0 -16
  47. package/src/components/slides/hero-slide.tsx +0 -34
  48. package/src/components/slides/slide-outline.tsx +0 -38
  49. package/src/components/slides/text-slide.tsx +0 -35
  50. package/src/components/veslx-cat.tsx +0 -73
@@ -1,216 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { useDirectory, useFileContent } from "../plugin/src/client.js";
3
- import { useMemo, useRef, useEffect } from "react";
4
- import { useParams } from "react-router-dom";
5
- import { cn } from "../lib/utils.js";
6
- import { minimatch } from "minimatch";
7
- import { parseConfigFile, extractPath, formatValue, getValueType } from "../lib/parameter-utils.js";
8
- function usePreventSwipeNavigation(ref) {
9
- useEffect(() => {
10
- const el = ref.current;
11
- if (!el) return;
12
- const handleWheel = (e) => {
13
- if (Math.abs(e.deltaX) <= Math.abs(e.deltaY)) return;
14
- const { scrollLeft, scrollWidth, clientWidth } = el;
15
- const atLeftEdge = scrollLeft <= 0;
16
- const atRightEdge = scrollLeft + clientWidth >= scrollWidth - 1;
17
- if (atLeftEdge && e.deltaX < 0 || atRightEdge && e.deltaX > 0) {
18
- e.preventDefault();
19
- }
20
- };
21
- el.addEventListener("wheel", handleWheel, { passive: false });
22
- return () => el.removeEventListener("wheel", handleWheel);
23
- }, [ref]);
24
- }
25
- function isGlobPattern(path) {
26
- return path.includes("*") || path.includes("?") || path.includes("[");
27
- }
28
- function collectAllConfigFiles(entry) {
29
- if (entry.type === "file") {
30
- if (entry.name.match(/\.(yaml|yml|json)$/i)) {
31
- return [entry];
32
- }
33
- return [];
34
- }
35
- const files = [];
36
- for (const child of entry.children || []) {
37
- files.push(...collectAllConfigFiles(child));
38
- }
39
- return files;
40
- }
41
- function sortPathsNumerically(paths) {
42
- paths.sort((a, b) => {
43
- const nums = (s) => (s.match(/\d+/g) || []).map(Number);
44
- const na = nums(a);
45
- const nb = nums(b);
46
- const len = Math.max(na.length, nb.length);
47
- for (let i = 0; i < len; i++) {
48
- const diff = (na[i] ?? 0) - (nb[i] ?? 0);
49
- if (diff !== 0) return diff;
50
- }
51
- return a.localeCompare(b);
52
- });
53
- }
54
- function SingleParameterTable({
55
- path,
56
- pairs,
57
- label,
58
- withMargin = true,
59
- scrollable = true,
60
- compact = false
61
- }) {
62
- const { content, loading, error } = useFileContent(path);
63
- if (!pairs || pairs.length === 0) {
64
- return /* @__PURE__ */ jsx("div", { className: cn("p-3 rounded border border-border/50 bg-card/30", withMargin && "my-6"), children: /* @__PURE__ */ jsx("p", { className: "text-[11px] font-mono text-muted-foreground", children: "pairs is required" }) });
65
- }
66
- const { parsed, parseError } = useMemo(() => {
67
- if (!content) return { parsed: null, parseError: "no content" };
68
- const data = parseConfigFile(content, path);
69
- if (!data) {
70
- if (!path.match(/\.(yaml|yml|json)$/i)) {
71
- return { parsed: null, parseError: `unsupported file type` };
72
- }
73
- if (content.trim().startsWith("<!") || content.trim().startsWith("<html")) {
74
- return { parsed: null, parseError: `file not found` };
75
- }
76
- return { parsed: null, parseError: `invalid ${path.split(".").pop()} syntax` };
77
- }
78
- return { parsed: data, parseError: null };
79
- }, [content, path]);
80
- if (loading) {
81
- return /* @__PURE__ */ jsx("div", { className: "my-6 p-4 rounded border border-border/50 bg-card/30", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-muted-foreground/60", children: [
82
- /* @__PURE__ */ jsx("div", { className: "w-3 h-3 border border-current border-t-transparent rounded-full animate-spin" }),
83
- /* @__PURE__ */ jsx("span", { className: "text-[11px] font-mono", children: "loading parameters..." })
84
- ] }) });
85
- }
86
- if (error) {
87
- return /* @__PURE__ */ jsx("div", { className: "my-6 p-3 rounded border border-destructive/30 bg-destructive/5", children: /* @__PURE__ */ jsx("p", { className: "text-[11px] font-mono text-destructive", children: error }) });
88
- }
89
- if (!parsed) {
90
- return /* @__PURE__ */ jsx("div", { className: cn("p-3 rounded border border-border/50 bg-card/30", withMargin && "my-6"), children: /* @__PURE__ */ jsxs("p", { className: "text-[11px] font-mono text-muted-foreground", children: [
91
- label && /* @__PURE__ */ jsxs("span", { className: "text-foreground/60", children: [
92
- label,
93
- ": "
94
- ] }),
95
- parseError || "unable to parse"
96
- ] }) });
97
- }
98
- const renderPairsTable = () => {
99
- return /* @__PURE__ */ jsx("div", { className: cn(
100
- "border border-border rounded-md",
101
- scrollable ? "overflow-x-auto" : "overflow-x-hidden"
102
- ), children: /* @__PURE__ */ jsxs("table", { className: cn(
103
- "w-full border-collapse",
104
- compact ? "text-[11px]" : "text-sm"
105
- ), children: [
106
- /* @__PURE__ */ jsx("thead", { className: "bg-muted/50", children: /* @__PURE__ */ jsxs("tr", { className: "border-b border-border last:border-b-0", children: [
107
- /* @__PURE__ */ jsx("th", { className: cn(
108
- "text-left text-xs font-medium text-muted-foreground uppercase tracking-wider",
109
- compact ? "px-3 py-2" : "px-4 py-3"
110
- ), children: "Parameter" }),
111
- /* @__PURE__ */ jsx("th", { className: cn(
112
- "text-left text-xs font-medium text-muted-foreground uppercase tracking-wider",
113
- compact ? "px-3 py-2" : "px-4 py-3"
114
- ), children: "Value" })
115
- ] }) }),
116
- /* @__PURE__ */ jsx("tbody", { children: pairs.map(({ key, label: rowLabel }) => {
117
- const value = extractPath(parsed, key);
118
- const type = value === void 0 ? "missing" : getValueType(value);
119
- const displayValue = value === void 0 ? "—" : type === "string" ? `"${formatValue(value)}"` : formatValue(value);
120
- return /* @__PURE__ */ jsxs("tr", { className: "border-b border-border last:border-b-0", children: [
121
- /* @__PURE__ */ jsx("td", { className: cn(
122
- "align-top",
123
- compact ? "px-3 py-2" : "px-4 py-3"
124
- ), children: rowLabel || key }),
125
- /* @__PURE__ */ jsx(
126
- "td",
127
- {
128
- className: cn(
129
- "align-top",
130
- compact ? "px-3 py-2" : "px-4 py-3",
131
- type === "missing" && "text-muted-foreground"
132
- ),
133
- children: displayValue
134
- }
135
- )
136
- ] }, key);
137
- }) })
138
- ] }) });
139
- };
140
- return /* @__PURE__ */ jsxs("div", { className: cn("not-prose", withMargin && "my-6"), children: [
141
- label && /* @__PURE__ */ jsx("div", { className: "text-[11px] font-mono text-muted-foreground mb-1.5 truncate", title: label, children: label }),
142
- renderPairsTable()
143
- ] });
144
- }
145
- function ParameterTable({ path, pairs, compact = false }) {
146
- const { "*": routePath = "" } = useParams();
147
- if (!pairs || pairs.length === 0) {
148
- return /* @__PURE__ */ jsx("div", { className: "my-6 p-3 rounded border border-border/50 bg-card/30", children: /* @__PURE__ */ jsx("p", { className: "text-[11px] font-mono text-muted-foreground", children: "pairs is required" }) });
149
- }
150
- const currentDir = routePath.replace(/\/?[^/]+\.mdx$/i, "").replace(/\/$/, "") || ".";
151
- let resolvedPath = path;
152
- if (path == null ? void 0 : path.startsWith("./")) {
153
- const relativePart = path.slice(2);
154
- resolvedPath = currentDir === "." ? relativePart : `${currentDir}/${relativePart}`;
155
- } else if (path && !path.startsWith("/") && !path.includes("/") && !isGlobPattern(path)) {
156
- resolvedPath = currentDir === "." ? path : `${currentDir}/${path}`;
157
- }
158
- const hasGlob = isGlobPattern(resolvedPath);
159
- const baseDir = useMemo(() => {
160
- if (!hasGlob) return null;
161
- const beforeGlob = resolvedPath.split(/[*?\[]/, 1)[0];
162
- const lastSlash = beforeGlob.lastIndexOf("/");
163
- if (lastSlash === -1) return ".";
164
- return beforeGlob.slice(0, lastSlash) || ".";
165
- }, [hasGlob, resolvedPath]);
166
- const { directory } = useDirectory(baseDir || ".");
167
- const matchingPaths = useMemo(() => {
168
- if (!hasGlob || !directory) return [];
169
- const allFiles = collectAllConfigFiles(directory);
170
- const paths = allFiles.map((f) => f.path).filter((p) => minimatch(p, resolvedPath, { matchBase: true }));
171
- sortPathsNumerically(paths);
172
- return paths;
173
- }, [hasGlob, directory, resolvedPath, path, baseDir]);
174
- if (!hasGlob) {
175
- return /* @__PURE__ */ jsx(SingleParameterTable, { path: resolvedPath, pairs, compact });
176
- }
177
- if (!directory) {
178
- return /* @__PURE__ */ jsx("div", { className: "my-6 p-4 rounded border border-border/50 bg-card/30", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-muted-foreground/60", children: [
179
- /* @__PURE__ */ jsx("div", { className: "w-3 h-3 border border-current border-t-transparent rounded-full animate-spin" }),
180
- /* @__PURE__ */ jsx("span", { className: "text-[11px] font-mono", children: "loading parameters..." })
181
- ] }) });
182
- }
183
- if (matchingPaths.length === 0) {
184
- return /* @__PURE__ */ jsx("div", { className: "my-6 p-3 rounded border border-border/50 bg-card/30", children: /* @__PURE__ */ jsxs("p", { className: "text-[11px] font-mono text-muted-foreground", children: [
185
- "no files matching: ",
186
- resolvedPath,
187
- /* @__PURE__ */ jsx("br", {}),
188
- /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground/50", children: [
189
- "(base dir: ",
190
- baseDir,
191
- ", original: ",
192
- path,
193
- ")"
194
- ] })
195
- ] }) });
196
- }
197
- const scrollRef = useRef(null);
198
- usePreventSwipeNavigation(scrollRef);
199
- const count = matchingPaths.length;
200
- const breakoutClass = count >= 4 ? "relative left-1/2 w-[96vw] -translate-x-1/2" : count >= 2 ? "relative left-1/2 w-[75vw] -translate-x-1/2" : "";
201
- return /* @__PURE__ */ jsx("div", { className: `my-6 ${breakoutClass} overflow-x-hidden`, children: /* @__PURE__ */ jsx("div", { ref: scrollRef, className: "flex gap-4 overflow-x-auto overscroll-x-contain pb-2", children: matchingPaths.map((filePath) => /* @__PURE__ */ jsx("div", { className: "flex-none w-[280px]", children: /* @__PURE__ */ jsx(
202
- SingleParameterTable,
203
- {
204
- path: filePath,
205
- pairs,
206
- label: filePath.split("/").pop() || filePath,
207
- withMargin: false,
208
- scrollable: false,
209
- compact
210
- }
211
- ) }, filePath)) }) });
212
- }
213
- export {
214
- ParameterTable
215
- };
216
- //# sourceMappingURL=parameter-table.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parameter-table.js","sources":["../../../src/components/parameter-table.tsx"],"sourcesContent":["import { useFileContent, useDirectory } from \"../../plugin/src/client\";\nimport { useMemo, useRef, useEffect } from \"react\";\nimport { useParams } from \"react-router-dom\";\nimport { cn } from \"@/lib/utils\";\nimport { minimatch } from \"minimatch\";\nimport {\n type ParameterValue,\n extractPath,\n getValueType,\n formatValue,\n parseConfigFile,\n} from \"@/lib/parameter-utils\";\nimport { FileEntry, DirectoryEntry } from \"../../plugin/src/lib\";\n\n/**\n * Hook to prevent horizontal scroll from triggering browser back/forward gestures.\n */\nfunction usePreventSwipeNavigation(ref: React.RefObject<HTMLElement | null>) {\n useEffect(() => {\n const el = ref.current;\n if (!el) return;\n\n const handleWheel = (e: WheelEvent) => {\n if (Math.abs(e.deltaX) <= Math.abs(e.deltaY)) return;\n\n const { scrollLeft, scrollWidth, clientWidth } = el;\n const atLeftEdge = scrollLeft <= 0;\n const atRightEdge = scrollLeft + clientWidth >= scrollWidth - 1;\n\n if ((atLeftEdge && e.deltaX < 0) || (atRightEdge && e.deltaX > 0)) {\n e.preventDefault();\n }\n };\n\n el.addEventListener('wheel', handleWheel, { passive: false });\n return () => el.removeEventListener('wheel', handleWheel);\n }, [ref]);\n}\n\n// Check if a path contains glob patterns\nfunction isGlobPattern(path: string): boolean {\n return path.includes('*') || path.includes('?') || path.includes('[');\n}\n\n// Recursively collect all config files from a directory tree\nfunction collectAllConfigFiles(entry: DirectoryEntry | FileEntry): FileEntry[] {\n if (entry.type === \"file\") {\n if (entry.name.match(/\\.(yaml|yml|json)$/i)) {\n return [entry];\n }\n return [];\n }\n const files: FileEntry[] = [];\n for (const child of entry.children || []) {\n files.push(...collectAllConfigFiles(child));\n }\n return files;\n}\n\n// Sort paths numerically\nfunction sortPathsNumerically(paths: string[]): void {\n paths.sort((a, b) => {\n const nums = (s: string) => (s.match(/\\d+/g) || []).map(Number);\n const na = nums(a);\n const nb = nums(b);\n const len = Math.max(na.length, nb.length);\n for (let i = 0; i < len; i++) {\n const diff = (na[i] ?? 0) - (nb[i] ?? 0);\n if (diff !== 0) return diff;\n }\n return a.localeCompare(b);\n });\n}\n\ninterface SingleParameterTableProps {\n /** Path to the YAML or JSON file */\n path: string;\n /**\n * Required array of key/label pairs to render as a markdown-style table.\n * Each key is a jq-like path (e.g., \".base.dt\").\n */\n pairs: Array<{ key: string; label?: string }>;\n /** Optional label to show above the table */\n label?: string;\n /** Whether to include vertical margin (default true) */\n withMargin?: boolean;\n /**\n * Whether this table should manage its own horizontal scrolling.\n * Set false when the parent already provides a single shared scrollbar.\n */\n scrollable?: boolean;\n /** Compact mode for dense rendering */\n compact?: boolean;\n}\n\ninterface ParameterTableProps {\n /** Path to the YAML or JSON file, supports glob patterns like \"*.yaml\" */\n path: string;\n /**\n * Required array of key/label pairs to render Complete table.\n */\n pairs: Array<{ key: string; label?: string }>;\n /** Compact mode for dense rendering */\n compact?: boolean;\n}\n\nfunction SingleParameterTable({\n path,\n pairs,\n label,\n withMargin = true,\n scrollable = true,\n compact = false,\n}: SingleParameterTableProps) {\n const { content, loading, error } = useFileContent(path);\n\n if (!pairs || pairs.length === 0) {\n return (\n <div className={cn(\"p-3 rounded border border-border/50 bg-card/30\", withMargin && \"my-6\")}>\n <p className=\"text-[11px] font-mono text-muted-foreground\">\n pairs is required\n </p>\n </div>\n );\n }\n\n const { parsed, parseError } = useMemo(() => {\n if (!content) return { parsed: null, parseError: 'no content' };\n\n const data = parseConfigFile(content, path);\n if (!data) {\n // Check why parsing failed\n if (!path.match(/\\.(yaml|yml|json)$/i)) {\n return { parsed: null, parseError: `unsupported file type` };\n }\n // Check if content looks like HTML (404 page)\n if (content.trim().startsWith('<!') || content.trim().startsWith('<html')) {\n return { parsed: null, parseError: `file not found` };\n }\n return { parsed: null, parseError: `invalid ${path.split('.').pop()} syntax` };\n }\n\n return { parsed: data, parseError: null };\n }, [content, path]);\n\n if (loading) {\n return (\n <div className=\"my-6 p-4 rounded border border-border/50 bg-card/30\">\n <div className=\"flex items-center gap-2 text-muted-foreground/60\">\n <div className=\"w-3 h-3 border border-current border-t-transparent rounded-full animate-spin\" />\n <span className=\"text-[11px] font-mono\">loading parameters...</span>\n </div>\n </div>\n );\n }\n\n if (error) {\n return (\n <div className=\"my-6 p-3 rounded border border-destructive/30 bg-destructive/5\">\n <p className=\"text-[11px] font-mono text-destructive\">{error}</p>\n </div>\n );\n }\n\n if (!parsed) {\n return (\n <div className={cn(\"p-3 rounded border border-border/50 bg-card/30\", withMargin && \"my-6\")}>\n <p className=\"text-[11px] font-mono text-muted-foreground\">\n {label && <span className=\"text-foreground/60\">{label}: </span>}\n {parseError || 'unable to parse'}\n </p>\n </div>\n );\n }\n\n const renderPairsTable = () => {\n return (\n <div className={cn(\n \"border border-border rounded-md\",\n scrollable ? \"overflow-x-auto\" : \"overflow-x-hidden\"\n )}>\n <table className={cn(\n \"w-full border-collapse\",\n compact ? \"text-[11px]\" : \"text-sm\"\n )}>\n <thead className=\"bg-muted/50\">\n <tr className=\"border-b border-border last:border-b-0\">\n <th className={cn(\n \"text-left text-xs font-medium text-muted-foreground uppercase tracking-wider\",\n compact ? \"px-3 py-2\" : \"px-4 py-3\"\n )}>\n Parameter\n </th>\n <th className={cn(\n \"text-left text-xs font-medium text-muted-foreground uppercase tracking-wider\",\n compact ? \"px-3 py-2\" : \"px-4 py-3\"\n )}>\n Value\n </th>\n </tr>\n </thead>\n <tbody>\n {pairs.map(({ key, label: rowLabel }) => {\n const value = extractPath(parsed, key);\n const type = value === undefined ? \"missing\" : getValueType(value);\n const displayValue = value === undefined\n ? \"—\"\n : type === \"string\"\n ? `\"${formatValue(value)}\"`\n : formatValue(value);\n\n return (\n <tr key={key} className=\"border-b border-border last:border-b-0\">\n <td className={cn(\n \"align-top\",\n compact ? \"px-3 py-2\" : \"px-4 py-3\"\n )}>{rowLabel || key}</td>\n <td\n className={cn(\n \"align-top\",\n compact ? \"px-3 py-2\" : \"px-4 py-3\",\n type === \"missing\" && \"text-muted-foreground\"\n )}\n >\n {displayValue}\n </td>\n </tr>\n );\n })}\n </tbody>\n </table>\n </div>\n );\n };\n\n return (\n <div className={cn(\"not-prose\", withMargin && \"my-6\")}>\n {label && (\n <div className=\"text-[11px] font-mono text-muted-foreground mb-1.5 truncate\" title={label}>\n {label}\n </div>\n )}\n {renderPairsTable()}\n </div>\n );\n}\n\n/**\n * ParameterTable component that displays YAML/JSON config files.\n * Supports glob patterns in the path prop to show multiple files.\n */\nexport function ParameterTable({ path, pairs, compact = false }: ParameterTableProps) {\n const { \"*\": routePath = \"\" } = useParams();\n\n if (!pairs || pairs.length === 0) {\n return (\n <div className=\"my-6 p-3 rounded border border-border/50 bg-card/30\">\n <p className=\"text-[11px] font-mono text-muted-foreground\">pairs is required</p>\n </div>\n );\n }\n\n // Get current directory from route\n const currentDir = routePath\n .replace(/\\/?[^/]+\\.mdx$/i, \"\")\n .replace(/\\/$/, \"\")\n || \".\";\n\n // Resolve relative paths\n let resolvedPath = path;\n if (path?.startsWith(\"./\")) {\n const relativePart = path.slice(2);\n resolvedPath = currentDir === \".\" ? relativePart : `${currentDir}/${relativePart}`;\n } else if (path && !path.startsWith(\"/\") && !path.includes(\"/\") && !isGlobPattern(path)) {\n resolvedPath = currentDir === \".\" ? path : `${currentDir}/${path}`;\n }\n\n // Check if this is a glob pattern\n const hasGlob = isGlobPattern(resolvedPath);\n\n // For glob patterns, get the base directory (directory containing the glob pattern)\n const baseDir = useMemo(() => {\n if (!hasGlob) return null;\n // Get everything before the first glob character\n const beforeGlob = resolvedPath.split(/[*?\\[]/, 1)[0];\n // Extract directory portion (everything up to the last slash)\n const lastSlash = beforeGlob.lastIndexOf('/');\n if (lastSlash === -1) return \".\";\n return beforeGlob.slice(0, lastSlash) || \".\";\n }, [hasGlob, resolvedPath]);\n\n const { directory } = useDirectory(baseDir || \".\");\n\n // Find matching files for glob patterns\n const matchingPaths = useMemo(() => {\n if (!hasGlob || !directory) return [];\n\n const allFiles = collectAllConfigFiles(directory);\n const paths = allFiles\n .map(f => f.path)\n .filter(p => minimatch(p, resolvedPath, { matchBase: true }));\n\n sortPathsNumerically(paths);\n\n return paths;\n }, [hasGlob, directory, resolvedPath, path, baseDir]);\n\n // If not a glob pattern, just render the single table\n if (!hasGlob) {\n return <SingleParameterTable path={resolvedPath} pairs={pairs} compact={compact} />;\n }\n\n // Loading state for glob patterns\n if (!directory) {\n return (\n <div className=\"my-6 p-4 rounded border border-border/50 bg-card/30\">\n <div className=\"flex items-center gap-2 text-muted-foreground/60\">\n <div className=\"w-3 h-3 border border-current border-t-transparent rounded-full animate-spin\" />\n <span className=\"text-[11px] font-mono\">loading parameters...</span>\n </div>\n </div>\n );\n }\n\n // No matches\n if (matchingPaths.length === 0) {\n return (\n <div className=\"my-6 p-3 rounded border border-border/50 bg-card/30\">\n <p className=\"text-[11px] font-mono text-muted-foreground\">\n no files matching: {resolvedPath}\n <br />\n <span className=\"text-muted-foreground/50\">(base dir: {baseDir}, original: {path})</span>\n </p>\n </div>\n );\n }\n\n const scrollRef = useRef<HTMLDivElement>(null);\n usePreventSwipeNavigation(scrollRef);\n\n // Breakout width based on count\n const count = matchingPaths.length;\n // Use translate centering (instead of negative margins) to avoid creating a tiny\n // page-level horizontal scrollbar while still \"breaking out\" of prose width.\n const breakoutClass = count >= 4\n ? 'relative left-1/2 w-[96vw] -translate-x-1/2'\n : count >= 2\n ? 'relative left-1/2 w-[75vw] -translate-x-1/2'\n : '';\n\n return (\n <div className={`my-6 ${breakoutClass} overflow-x-hidden`}>\n <div ref={scrollRef} className=\"flex gap-4 overflow-x-auto overscroll-x-contain pb-2\">\n {matchingPaths.map((filePath) => (\n <div key={filePath} className=\"flex-none w-[280px]\">\n <SingleParameterTable\n path={filePath}\n pairs={pairs}\n label={filePath.split('/').pop() || filePath}\n withMargin={false}\n scrollable={false}\n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IAAA,EAAA,CAC/D,EAAA,CACF;AAAA,EAEJ;AAGA,MAAI,cAAc,WAAW,GAAG;AAC9B,+BACG,OAAA,EAAI,WAAU,uDACb,UAAA,qBAAC,KAAA,EAAE,WAAU,+CAA8C,UAAA;AAAA,MAAA;AAAA,MACrC;AAAA,0BACnB,MAAA,EAAG;AAAA,MACJ,qBAAC,QAAA,EAAK,WAAU,4BAA2B,UAAA;AAAA,QAAA;AAAA,QAAY;AAAA,QAAQ;AAAA,QAAa;AAAA,QAAK;AAAA,MAAA,EAAA,CAAC;AAAA,IAAA,EAAA,CACpF,EAAA,CACF;AAAA,EAEJ;AAEA,QAAM,YAAY,OAAuB,IAAI;AAC7C,4BAA0B,SAAS;AAGnC,QAAM,QAAQ,cAAc;AAG5B,QAAM,gBAAgB,SAAS,IAC3B,gDACA,SAAS,IACP,gDACA;AAEN,6BACG,OAAA,EAAI,WAAW,QAAQ,aAAa,sBACnC,8BAAC,OAAA,EAAI,KAAK,WAAW,WAAU,wDAC5B,wBAAc,IAAI,CAAC,aAClB,oBAAC,OAAA,EAAmB,WAAU,uBAC5B,UAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAM;AAAA,MACN;AAAA,MACA,OAAO,SAAS,MAAM,GAAG,EAAE,SAAS;AAAA,MACpC,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ;AAAA,IAAA;AAAA,EAAA,EACF,GARQ,QASV,CACD,EAAA,CACH,GACF;AAEJ;"}
@@ -1,14 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- function FigureSlide({
3
- title,
4
- src
5
- }) {
6
- return /* @__PURE__ */ jsxs("div", { className: "figure-slide", children: [
7
- /* @__PURE__ */ jsx("h2", { children: title }),
8
- /* @__PURE__ */ jsx("img", { src, alt: title })
9
- ] });
10
- }
11
- export {
12
- FigureSlide
13
- };
14
- //# sourceMappingURL=figure-slide.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"figure-slide.js","sources":["../../../../src/components/slides/figure-slide.tsx"],"sourcesContent":["\n\nexport function FigureSlide({\n title,\n src,\n}: {\n title: string;\n src: string;\n}) {\n return (\n <div className=\"figure-slide\">\n <h2>{title}</h2>\n <img src={src} alt={title} />\n </div>\n );\n}"],"names":[],"mappings":";AAEO,SAAS,YAAY;AAAA,EAC1B;AAAA,EACA;AACF,GAGG;AACD,SACE,qBAAC,OAAA,EAAI,WAAU,gBACb,UAAA;AAAA,IAAA,oBAAC,QAAI,UAAA,MAAA,CAAM;AAAA,IACX,oBAAC,OAAA,EAAI,KAAU,KAAK,MAAA,CAAO;AAAA,EAAA,GAC7B;AAEJ;"}
@@ -1,21 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- function HeroSlide({
3
- title,
4
- subtitle,
5
- author,
6
- date
7
- }) {
8
- return /* @__PURE__ */ jsxs("div", { children: [
9
- /* @__PURE__ */ jsx("h1", { className: "text-[clamp(2.5rem,6vw,5rem)] font-semibold leading-[1.1] tracking-[-0.02em] text-foreground text-balance", children: title }),
10
- subtitle && /* @__PURE__ */ jsx("p", { className: "text-[clamp(1rem,2vw,1.5rem)] text-muted-foreground max-w-[50ch] leading-relaxed", children: subtitle }),
11
- (author || date) && /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-x-4 gap-y-1 text-sm text-muted-foreground mt-4", children: [
12
- author && /* @__PURE__ */ jsx("span", { children: author }),
13
- author && date && /* @__PURE__ */ jsx("span", { className: "text-border", children: "·" }),
14
- date && /* @__PURE__ */ jsx("span", { children: date })
15
- ] })
16
- ] });
17
- }
18
- export {
19
- HeroSlide
20
- };
21
- //# sourceMappingURL=hero-slide.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hero-slide.js","sources":["../../../../src/components/slides/hero-slide.tsx"],"sourcesContent":["\nexport function HeroSlide({\n title,\n subtitle,\n author,\n date,\n}: {\n title: string;\n subtitle?: string;\n author?: string;\n date?: string;\n}) {\n return (\n <div>\n <h1 className=\"text-[clamp(2.5rem,6vw,5rem)] font-semibold leading-[1.1] tracking-[-0.02em] text-foreground text-balance\">\n {title}\n </h1>\n\n {subtitle && (\n <p className=\"text-[clamp(1rem,2vw,1.5rem)] text-muted-foreground max-w-[50ch] leading-relaxed\">\n {subtitle}\n </p>\n )}\n\n {(author || date) && (\n <div className=\"flex flex-wrap gap-x-4 gap-y-1 text-sm text-muted-foreground mt-4\">\n {author && <span>{author}</span>}\n {author && date && <span className=\"text-border\">·</span>}\n {date && <span>{date}</span>}\n </div>\n )}\n </div>\n );\n}\n"],"names":[],"mappings":";AACO,SAAS,UAAU;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAKG;AACD,8BACG,OAAA,EACC,UAAA;AAAA,IAAA,oBAAC,MAAA,EAAG,WAAU,6GACX,UAAA,OACH;AAAA,IAEC,YACC,oBAAC,KAAA,EAAE,WAAU,oFACV,UAAA,UACH;AAAA,KAGA,UAAU,SACV,qBAAC,OAAA,EAAI,WAAU,qEACZ,UAAA;AAAA,MAAA,UAAU,oBAAC,UAAM,UAAA,OAAA,CAAO;AAAA,MACxB,UAAU,QAAQ,oBAAC,QAAA,EAAK,WAAU,eAAc,UAAA,KAAC;AAAA,MACjD,QAAQ,oBAAC,QAAA,EAAM,UAAA,KAAA,CAAK;AAAA,IAAA,EAAA,CACvB;AAAA,EAAA,GAEJ;AAEJ;"}
@@ -1,28 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- function SlideOutline({
3
- children,
4
- className,
5
- size = "md"
6
- }) {
7
- const wClasses = {
8
- sm: "max-w-lg",
9
- md: "max-w-2xl",
10
- lg: "max-w-5xl",
11
- xl: "max-w-7xl",
12
- full: "max-w-full"
13
- };
14
- const wClassName = `${wClasses[size]} ${className ?? ""}`;
15
- const hClasses = {
16
- sm: "min-h-[300px]",
17
- md: "min-h-[400px]",
18
- lg: "min-h-[500px]",
19
- xl: "min-h-[600px]",
20
- full: "min-h-[600px]"
21
- };
22
- const hClassName = `${hClasses[size]} ${className ?? ""}`;
23
- return /* @__PURE__ */ jsx("div", { className: `border rounded relative left-1/2 -translate-x-1/2 w-screen ${wClassName} ${hClassName} ${className}`, children });
24
- }
25
- export {
26
- SlideOutline
27
- };
28
- //# sourceMappingURL=slide-outline.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"slide-outline.js","sources":["../../../../src/components/slides/slide-outline.tsx"],"sourcesContent":["\n\nexport function SlideOutline({\n children,\n className,\n size=\"md\"\n}: {\n children?: React.ReactNode;\n className?: string;\n size?: \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\" | \"3xl\" | \"full\";\n}) {\n\n const wClasses: Record<string, string> = {\n sm: \"max-w-lg\",\n md: \"max-w-2xl\",\n lg: \"max-w-5xl\",\n xl: \"max-w-7xl\",\n full: \"max-w-full\",\n };\n\n const wClassName = `${wClasses[size]} ${className ?? \"\"}`;\n\n const hClasses: Record<string, string> = {\n sm: \"min-h-[300px]\",\n md: \"min-h-[400px]\",\n lg: \"min-h-[500px]\",\n xl: \"min-h-[600px]\",\n full: \"min-h-[600px]\",\n };\n\n const hClassName = `${hClasses[size]} ${className ?? \"\"}`;\n\n return (\n <div className={`border rounded relative left-1/2 -translate-x-1/2 w-screen ${wClassName} ${hClassName} ${className}`}>\n {children}\n </div>\n );\n}"],"names":[],"mappings":";AAEO,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AAAA,EACA,OAAK;AACP,GAIG;AAED,QAAM,WAAmC;AAAA,IACvC,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,MAAM;AAAA,EAAA;AAGR,QAAM,aAAa,GAAG,SAAS,IAAI,CAAC,IAAI,aAAa,EAAE;AAEvD,QAAM,WAAmC;AAAA,IACvC,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,MAAM;AAAA,EAAA;AAGR,QAAM,aAAa,GAAG,SAAS,IAAI,CAAC,IAAI,aAAa,EAAE;AAEvD,SACE,oBAAC,OAAA,EAAI,WAAW,8DAA8D,UAAU,IAAI,UAAU,IAAI,SAAS,IAChH,SAAA,CACH;AAEJ;"}
@@ -1,18 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- function TextSlide({
3
- title,
4
- subtitle,
5
- children
6
- }) {
7
- return /* @__PURE__ */ jsxs("div", { children: [
8
- (title || subtitle) && /* @__PURE__ */ jsxs("header", { className: "flex flex-col gap-2", children: [
9
- title && /* @__PURE__ */ jsx("h2", { className: "text-[clamp(1.75rem,4vw,3rem)] font-semibold leading-tight tracking-[-0.02em] text-foreground", children: title }),
10
- subtitle && /* @__PURE__ */ jsx("p", { className: "text-[clamp(0.95rem,1.5vw,1.25rem)] text-muted-foreground", children: subtitle })
11
- ] }),
12
- children && /* @__PURE__ */ jsx("div", { className: "text-[clamp(1rem,1.8vw,1.35rem)] leading-[1.6] text-foreground/90 space-y-4 [&>ul]:space-y-2 [&>ul]:list-disc [&>ul]:pl-6 [&>ol]:space-y-2 [&>ol]:list-decimal [&>ol]:pl-6", children })
13
- ] });
14
- }
15
- export {
16
- TextSlide
17
- };
18
- //# sourceMappingURL=text-slide.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"text-slide.js","sources":["../../../../src/components/slides/text-slide.tsx"],"sourcesContent":["\nexport function TextSlide({\n title,\n subtitle,\n children,\n}: {\n title?: string;\n subtitle?: string;\n children?: React.ReactNode;\n}) {\n return (\n <div>\n {(title || subtitle) && (\n <header className=\"flex flex-col gap-2\">\n {title && (\n <h2 className=\"text-[clamp(1.75rem,4vw,3rem)] font-semibold leading-tight tracking-[-0.02em] text-foreground\">\n {title}\n </h2>\n )}\n {subtitle && (\n <p className=\"text-[clamp(0.95rem,1.5vw,1.25rem)] text-muted-foreground\">\n {subtitle}\n </p>\n )}\n </header>\n )}\n\n {children && (\n <div className=\"text-[clamp(1rem,1.8vw,1.35rem)] leading-[1.6] text-foreground/90 space-y-4 [&>ul]:space-y-2 [&>ul]:list-disc [&>ul]:pl-6 [&>ol]:space-y-2 [&>ol]:list-decimal [&>ol]:pl-6\">\n {children}\n </div>\n )}\n </div>\n );\n}\n"],"names":[],"mappings":";AACO,SAAS,UAAU;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AACF,GAIG;AACD,8BACG,OAAA,EACG,UAAA;AAAA,KAAA,SAAS,aACT,qBAAC,UAAA,EAAO,WAAU,uBACf,UAAA;AAAA,MAAA,SACC,oBAAC,MAAA,EAAG,WAAU,iGACX,UAAA,OACH;AAAA,MAED,YACC,oBAAC,KAAA,EAAE,WAAU,6DACV,UAAA,SAAA,CACH;AAAA,IAAA,GAEJ;AAAA,IAGD,YACC,oBAAC,OAAA,EAAI,WAAU,8KACZ,SAAA,CACH;AAAA,EAAA,GAEJ;AAEJ;"}
@@ -1,40 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { useFileContent } from "../plugin/src/client.js";
3
- import { cn } from "../lib/utils.js";
4
- import { FigureHeader } from "./gallery/components/figure-header.js";
5
- import { FigureCaption } from "./gallery/components/figure-caption.js";
6
- function VeslxCat({
7
- path,
8
- title,
9
- subtitle,
10
- caption,
11
- captionLabel,
12
- className
13
- }) {
14
- const { content, loading, error } = useFileContent(path);
15
- const header = title || subtitle ? /* @__PURE__ */ jsx("div", { className: "mb-3", children: /* @__PURE__ */ jsx(FigureHeader, { title, subtitle }) }) : null;
16
- const footer = caption || captionLabel ? /* @__PURE__ */ jsx(FigureCaption, { caption, label: captionLabel }) : null;
17
- if (loading) {
18
- return /* @__PURE__ */ jsxs("div", { className: cn("not-prose my-6", className), children: [
19
- header,
20
- /* @__PURE__ */ jsx("pre", { className: "w-full overflow-x-auto p-4 text-xs bg-muted border border-border rounded-md font-mono", children: "loading…" }),
21
- footer
22
- ] });
23
- }
24
- if (error) {
25
- return /* @__PURE__ */ jsxs("div", { className: cn("not-prose my-6", className), children: [
26
- header,
27
- /* @__PURE__ */ jsx("pre", { className: "w-full overflow-x-auto p-4 text-xs bg-destructive/5 border border-destructive/30 rounded-md font-mono text-destructive", children: error }),
28
- footer
29
- ] });
30
- }
31
- return /* @__PURE__ */ jsxs("div", { className: cn("not-prose my-6", className), children: [
32
- header,
33
- /* @__PURE__ */ jsx("pre", { className: "w-full overflow-x-auto p-4 text-xs bg-muted border border-border rounded-md font-mono", children: content ?? "" }),
34
- footer
35
- ] });
36
- }
37
- export {
38
- VeslxCat
39
- };
40
- //# sourceMappingURL=veslx-cat.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"veslx-cat.js","sources":["../../../src/components/veslx-cat.tsx"],"sourcesContent":["import { useFileContent } from \"../../plugin/src/client\";\nimport { cn } from \"@/lib/utils\";\nimport { FigureHeader } from \"@/components/gallery/components/figure-header\";\nimport { FigureCaption } from \"@/components/gallery/components/figure-caption\";\n\ninterface VeslxCatProps {\n /** Path to the file */\n path: string;\n /** Optional title */\n title?: string;\n /** Optional subtitle */\n subtitle?: string;\n /** Optional caption */\n caption?: string;\n /** Optional caption label */\n captionLabel?: string;\n /** Optional class override */\n className?: string;\n}\n\nexport function VeslxCat({\n path,\n title,\n subtitle,\n caption,\n captionLabel,\n className,\n}: VeslxCatProps) {\n const { content, loading, error } = useFileContent(path);\n\n const header = (title || subtitle) ? (\n <div className=\"mb-3\">\n <FigureHeader title={title} subtitle={subtitle} />\n </div>\n ) : null;\n const footer = (caption || captionLabel) ? (\n <FigureCaption caption={caption} label={captionLabel} />\n ) : null;\n\n if (loading) {\n return (\n <div className={cn(\"not-prose my-6\", className)}>\n {header}\n <pre className=\"w-full overflow-x-auto p-4 text-xs bg-muted border border-border rounded-md font-mono\">\n loading…\n </pre>\n {footer}\n </div>\n );\n }\n\n if (error) {\n return (\n <div className={cn(\"not-prose my-6\", className)}>\n {header}\n <pre className=\"w-full overflow-x-auto p-4 text-xs bg-destructive/5 border border-destructive/30 rounded-md font-mono text-destructive\">\n {error}\n </pre>\n {footer}\n </div>\n );\n }\n\n return (\n <div className={cn(\"not-prose my-6\", className)}>\n {header}\n <pre className=\"w-full overflow-x-auto p-4 text-xs bg-muted border border-border rounded-md font-mono\">\n {content ?? \"\"}\n </pre>\n {footer}\n </div>\n );\n}\n"],"names":[],"mappings":";;;;;AAoBO,SAAS,SAAS;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAkB;AAChB,QAAM,EAAE,SAAS,SAAS,MAAA,IAAU,eAAe,IAAI;AAEvD,QAAM,SAAU,SAAS,WACvB,oBAAC,OAAA,EAAI,WAAU,QACb,UAAA,oBAAC,cAAA,EAAa,OAAc,SAAA,CAAoB,EAAA,CAClD,IACE;AACJ,QAAM,SAAU,WAAW,eACzB,oBAAC,iBAAc,SAAkB,OAAO,cAAc,IACpD;AAEJ,MAAI,SAAS;AACX,gCACG,OAAA,EAAI,WAAW,GAAG,kBAAkB,SAAS,GAC3C,UAAA;AAAA,MAAA;AAAA,MACD,oBAAC,OAAA,EAAI,WAAU,yFAAwF,UAAA,YAEvG;AAAA,MACC;AAAA,IAAA,GACH;AAAA,EAEJ;AAEA,MAAI,OAAO;AACT,gCACG,OAAA,EAAI,WAAW,GAAG,kBAAkB,SAAS,GAC3C,UAAA;AAAA,MAAA;AAAA,MACD,oBAAC,OAAA,EAAI,WAAU,0HACZ,UAAA,OACH;AAAA,MACC;AAAA,IAAA,GACH;AAAA,EAEJ;AAEA,8BACG,OAAA,EAAI,WAAW,GAAG,kBAAkB,SAAS,GAC3C,UAAA;AAAA,IAAA;AAAA,IACD,oBAAC,OAAA,EAAI,WAAU,yFACZ,qBAAW,IACd;AAAA,IACC;AAAA,EAAA,GACH;AAEJ;"}
@@ -1,108 +0,0 @@
1
- import { load } from "js-yaml";
2
- function extractPath(data, path) {
3
- if (!path || path === ".") return data;
4
- const cleanPath = path.startsWith(".") ? path.slice(1) : path;
5
- if (!cleanPath) return data;
6
- const segments = [];
7
- let current = "";
8
- let i = 0;
9
- while (i < cleanPath.length) {
10
- const char = cleanPath[i];
11
- if (char === ".") {
12
- if (current) {
13
- segments.push({ type: "key", value: current });
14
- current = "";
15
- }
16
- i++;
17
- } else if (char === "[") {
18
- if (current) {
19
- segments.push({ type: "key", value: current });
20
- current = "";
21
- }
22
- const closeIdx = cleanPath.indexOf("]", i);
23
- if (closeIdx === -1) return void 0;
24
- const inner = cleanPath.slice(i + 1, closeIdx);
25
- if (inner === "") {
26
- segments.push({ type: "all", value: 0 });
27
- } else {
28
- const idx = parseInt(inner, 10);
29
- if (isNaN(idx)) return void 0;
30
- segments.push({ type: "index", value: idx });
31
- }
32
- i = closeIdx + 1;
33
- } else {
34
- current += char;
35
- i++;
36
- }
37
- }
38
- if (current) {
39
- segments.push({ type: "key", value: current });
40
- }
41
- let result = data;
42
- for (const seg of segments) {
43
- if (result === null || result === void 0) return void 0;
44
- if (seg.type === "key") {
45
- if (typeof result !== "object" || Array.isArray(result)) return void 0;
46
- result = result[seg.value];
47
- } else if (seg.type === "index") {
48
- if (!Array.isArray(result)) return void 0;
49
- result = result[seg.value];
50
- } else if (seg.type === "all") {
51
- if (!Array.isArray(result)) return void 0;
52
- }
53
- }
54
- return result;
55
- }
56
- function getValueType(value) {
57
- if (value === null) return "null";
58
- if (Array.isArray(value)) return "array";
59
- if (typeof value === "object") return "object";
60
- if (typeof value === "boolean") return "boolean";
61
- if (typeof value === "number") return "number";
62
- return "string";
63
- }
64
- function formatNumber(value) {
65
- if (Math.abs(value) < 1e-4 && value !== 0) return value.toExponential(1);
66
- if (Math.abs(value) >= 1e4) return value.toExponential(1);
67
- if (Number.isInteger(value)) return value.toString();
68
- return value.toFixed(3);
69
- }
70
- function formatValue(value) {
71
- if (value === null) return "null";
72
- if (typeof value === "boolean") return value ? "true" : "false";
73
- if (typeof value === "number") return formatNumber(value);
74
- if (Array.isArray(value)) return `[${value.length}]`;
75
- if (typeof value === "object") return "{...}";
76
- return String(value);
77
- }
78
- function parseConfigFile(content, path) {
79
- if (path.endsWith(".yaml") || path.endsWith(".yml")) {
80
- try {
81
- return load(content);
82
- } catch {
83
- return null;
84
- }
85
- }
86
- if (path.endsWith(".json")) {
87
- try {
88
- return JSON.parse(content);
89
- } catch {
90
- return null;
91
- }
92
- }
93
- return null;
94
- }
95
- function deriveLabelFromPath(keyPath) {
96
- const cleanPath = keyPath.startsWith(".") ? keyPath.slice(1) : keyPath;
97
- const parts = cleanPath.split(".");
98
- return parts[parts.length - 1].replace(/\[\d+\]/g, "");
99
- }
100
- export {
101
- deriveLabelFromPath,
102
- extractPath,
103
- formatNumber,
104
- formatValue,
105
- getValueType,
106
- parseConfigFile
107
- };
108
- //# sourceMappingURL=parameter-utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parameter-utils.js","sources":["../../../src/lib/parameter-utils.ts"],"sourcesContent":["import { load } from \"js-yaml\";\n\nexport type ParameterValue = string | number | boolean | null | ParameterValue[] | { [key: string]: ParameterValue };\n\n/**\n * Extract a value from nested data using a jq-like path.\n * Supports:\n * - .foo.bar → nested keys\n * - .foo[0] → array index\n * - .foo[] → all array elements (returns array)\n */\nexport function extractPath(data: ParameterValue, path: string): ParameterValue | undefined {\n if (!path || path === \".\") return data;\n\n const cleanPath = path.startsWith(\".\") ? path.slice(1) : path;\n if (!cleanPath) return data;\n\n const segments: Array<{ type: \"key\" | \"index\" | \"all\"; value: string | number }> = [];\n let current = \"\";\n let i = 0;\n\n while (i < cleanPath.length) {\n const char = cleanPath[i];\n\n if (char === \".\") {\n if (current) {\n segments.push({ type: \"key\", value: current });\n current = \"\";\n }\n i++;\n } else if (char === \"[\") {\n if (current) {\n segments.push({ type: \"key\", value: current });\n current = \"\";\n }\n const closeIdx = cleanPath.indexOf(\"]\", i);\n if (closeIdx === -1) return undefined;\n const inner = cleanPath.slice(i + 1, closeIdx);\n if (inner === \"\") {\n segments.push({ type: \"all\", value: 0 });\n } else {\n const idx = parseInt(inner, 10);\n if (isNaN(idx)) return undefined;\n segments.push({ type: \"index\", value: idx });\n }\n i = closeIdx + 1;\n } else {\n current += char;\n i++;\n }\n }\n if (current) {\n segments.push({ type: \"key\", value: current });\n }\n\n let result: ParameterValue | undefined = data;\n\n for (const seg of segments) {\n if (result === null || result === undefined) return undefined;\n\n if (seg.type === \"key\") {\n if (typeof result !== \"object\" || Array.isArray(result)) return undefined;\n result = (result as Record<string, ParameterValue>)[seg.value as string];\n } else if (seg.type === \"index\") {\n if (!Array.isArray(result)) return undefined;\n result = result[seg.value as number];\n } else if (seg.type === \"all\") {\n if (!Array.isArray(result)) return undefined;\n // Return the array itself for further processing\n }\n }\n\n return result;\n}\n\nexport function getValueType(value: ParameterValue): \"string\" | \"number\" | \"boolean\" | \"null\" | \"array\" | \"object\" {\n if (value === null) return \"null\";\n if (Array.isArray(value)) return \"array\";\n if (typeof value === \"object\") return \"object\";\n if (typeof value === \"boolean\") return \"boolean\";\n if (typeof value === \"number\") return \"number\";\n return \"string\";\n}\n\nexport function formatNumber(value: number): string {\n if (Math.abs(value) < 0.0001 && value !== 0) return value.toExponential(1);\n if (Math.abs(value) >= 10000) return value.toExponential(1);\n if (Number.isInteger(value)) return value.toString();\n return value.toFixed(3);\n}\n\nexport function formatValue(value: ParameterValue): string {\n if (value === null) return \"null\";\n if (typeof value === \"boolean\") return value ? \"true\" : \"false\";\n if (typeof value === \"number\") return formatNumber(value);\n if (Array.isArray(value)) return `[${value.length}]`;\n if (typeof value === \"object\") return \"{...}\";\n return String(value);\n}\n\n/**\n * Parse YAML or JSON content based on file extension.\n */\nexport function parseConfigFile(content: string, path: string): Record<string, ParameterValue> | null {\n if (path.endsWith(\".yaml\") || path.endsWith(\".yml\")) {\n try {\n return load(content) as Record<string, ParameterValue>;\n } catch {\n return null;\n }\n }\n\n if (path.endsWith(\".json\")) {\n try {\n return JSON.parse(content) as Record<string, ParameterValue>;\n } catch {\n return null;\n }\n }\n\n return null;\n}\n\n/**\n * Derive a label from a jq-like keyPath.\n * E.g., \".base.N_E\" → \"N_E\"\n */\nexport function deriveLabelFromPath(keyPath: string): string {\n const cleanPath = keyPath.startsWith(\".\") ? keyPath.slice(1) : keyPath;\n const parts = cleanPath.split(\".\");\n return parts[parts.length - 1].replace(/\\[\\d+\\]/g, \"\");\n}\n"],"names":[],"mappings":";AAWO,SAAS,YAAY,MAAsB,MAA0C;AAC1F,MAAI,CAAC,QAAQ,SAAS,IAAK,QAAO;AAElC,QAAM,YAAY,KAAK,WAAW,GAAG,IAAI,KAAK,MAAM,CAAC,IAAI;AACzD,MAAI,CAAC,UAAW,QAAO;AAEvB,QAAM,WAA6E,CAAA;AACnF,MAAI,UAAU;AACd,MAAI,IAAI;AAER,SAAO,IAAI,UAAU,QAAQ;AAC3B,UAAM,OAAO,UAAU,CAAC;AAExB,QAAI,SAAS,KAAK;AAChB,UAAI,SAAS;AACX,iBAAS,KAAK,EAAE,MAAM,OAAO,OAAO,SAAS;AAC7C,kBAAU;AAAA,MACZ;AACA;AAAA,IACF,WAAW,SAAS,KAAK;AACvB,UAAI,SAAS;AACX,iBAAS,KAAK,EAAE,MAAM,OAAO,OAAO,SAAS;AAC7C,kBAAU;AAAA,MACZ;AACA,YAAM,WAAW,UAAU,QAAQ,KAAK,CAAC;AACzC,UAAI,aAAa,GAAI,QAAO;AAC5B,YAAM,QAAQ,UAAU,MAAM,IAAI,GAAG,QAAQ;AAC7C,UAAI,UAAU,IAAI;AAChB,iBAAS,KAAK,EAAE,MAAM,OAAO,OAAO,GAAG;AAAA,MACzC,OAAO;AACL,cAAM,MAAM,SAAS,OAAO,EAAE;AAC9B,YAAI,MAAM,GAAG,EAAG,QAAO;AACvB,iBAAS,KAAK,EAAE,MAAM,SAAS,OAAO,KAAK;AAAA,MAC7C;AACA,UAAI,WAAW;AAAA,IACjB,OAAO;AACL,iBAAW;AACX;AAAA,IACF;AAAA,EACF;AACA,MAAI,SAAS;AACX,aAAS,KAAK,EAAE,MAAM,OAAO,OAAO,SAAS;AAAA,EAC/C;AAEA,MAAI,SAAqC;AAEzC,aAAW,OAAO,UAAU;AAC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AAS,OAAO,KAAK,KAAK,SAAS,MAAM,GAAG;AACnD,QAAI;AACF,aAAO,KAAK,OAAO;AAAA,IACrB,QAAQ;AACN,aAAO;AAAA,IACT;AAAA,EACF;AAEA,MAAI,KAAK,SAAS,OAAO,GAAG;AAC1B,QAAI;AACF,aAAO,KAAK,MAAM,OAAO;AAAA,IAC3B,QAAQ;AACN,aAAO;AAAA,IACT;AAAA,EACF;AAEA,SAAO;AACT;AAMO,SAAS,oBAAoB,SAAyB;AAC3D,QAAM,YAAY,QAAQ,WAAW,GAAG,IAAI,QAAQ,MAAM,CAAC,IAAI;AAC/D,QAAM,QAAQ,UAAU,MAAM,GAAG;AACjC,SAAO,MAAM,MAAM,SAAS,CAAC,EAAE,QAAQ,YAAY,EAAE;AACvD;"}
@@ -1,78 +0,0 @@
1
- import { useFileContent } from "../../plugin/src/client";
2
- import { useMemo } from "react";
3
- import { cn } from "@/lib/utils";
4
- import {
5
- type ParameterValue,
6
- extractPath,
7
- getValueType,
8
- formatValue,
9
- parseConfigFile,
10
- deriveLabelFromPath,
11
- } from "@/lib/parameter-utils";
12
-
13
- interface ParameterBadgeProps {
14
- /** Path to the YAML or JSON file */
15
- path: string;
16
- /** jq-like path to the value (e.g., ".base.N_E") */
17
- keyPath: string;
18
- /** Optional label override (defaults to last segment of keyPath) */
19
- label?: string;
20
- /** Optional unit suffix (e.g., "ms", "Hz") */
21
- unit?: string;
22
- }
23
-
24
- export function ParameterBadge({ path, keyPath, label, unit }: ParameterBadgeProps) {
25
- const { content, loading, error } = useFileContent(path);
26
-
27
- const { value, displayLabel } = useMemo(() => {
28
- if (!content) return { value: undefined, displayLabel: "" };
29
-
30
- const data = parseConfigFile(content, path);
31
- if (!data) return { value: undefined, displayLabel: "" };
32
-
33
- const extracted = extractPath(data, keyPath);
34
- const derivedLabel = label || deriveLabelFromPath(keyPath);
35
-
36
- return { value: extracted, displayLabel: derivedLabel };
37
- }, [content, path, keyPath, label]);
38
-
39
- if (loading) {
40
- return (
41
- <span className="inline-flex items-center gap-1.5 px-2 py-0.5 rounded-md bg-muted/50 border border-border/50">
42
- <span className="w-2 h-2 border border-muted-foreground/40 border-t-transparent rounded-full animate-spin" />
43
- </span>
44
- );
45
- }
46
-
47
- if (error || value === undefined) {
48
- return (
49
- <span className="inline-flex items-center gap-1.5 px-2 py-0.5 rounded-md bg-destructive/10 border border-destructive/30">
50
- <span className="text-[10px] font-mono text-destructive">—</span>
51
- </span>
52
- );
53
- }
54
-
55
- const type = getValueType(value);
56
- const formattedValue = formatValue(value);
57
-
58
- return (
59
- <span className="inline-flex items-center gap-1.5 px-2 py-0.5 rounded-md font-mono text-[11px]">
60
- <span className="text-muted-foreground">{displayLabel}</span>
61
- <span className="text-muted-foreground/40">=</span>
62
- <span
63
- className={cn(
64
- "font-medium tabular-nums",
65
- type === "number" && "text-foreground",
66
- type === "string" && "text-amber-600 dark:text-amber-500",
67
- type === "boolean" && "text-cyan-600 dark:text-cyan-500",
68
- type === "null" && "text-muted-foreground/50",
69
- type === "array" && "text-purple-600 dark:text-purple-400",
70
- type === "object" && "text-purple-600 dark:text-purple-400"
71
- )}
72
- >
73
- {type === "string" ? `"${formattedValue}"` : formattedValue}
74
- </span>
75
- {unit && <span className="text-muted-foreground/60">{unit}</span>}
76
- </span>
77
- );
78
- }