@vybestack/llxprt-ui 0.7.0-nightly.251215.66bf0bc39 → 0.7.0-nightly.251216.6bcf96e64
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.
- package/bun.lock +1 -1
- package/package.json +2 -2
- package/src/ui/components/HeaderBar.tsx +38 -11
package/bun.lock
CHANGED
|
@@ -244,7 +244,7 @@
|
|
|
244
244
|
|
|
245
245
|
"@rollup/rollup-win32-x64-msvc": ["@rollup/rollup-win32-x64-msvc@4.53.4", "", { "os": "win32", "cpu": "x64" }, "sha512-Sbx45u/Lbb5RyptSbX7/3deP+/lzEmZ0BTSHxwxN/IMOZDZf8S0AGo0hJD5n/LQssxb5Z3B4og4P2X6Dd8acCA=="],
|
|
246
246
|
|
|
247
|
-
"@standard-schema/spec": ["@standard-schema/spec@1.
|
|
247
|
+
"@standard-schema/spec": ["@standard-schema/spec@1.1.0", "", {}, "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w=="],
|
|
248
248
|
|
|
249
249
|
"@testing-library/dom": ["@testing-library/dom@10.4.1", "", { "dependencies": { "@babel/code-frame": "^7.10.4", "@babel/runtime": "^7.12.5", "@types/aria-query": "^5.0.1", "aria-query": "5.3.0", "dom-accessibility-api": "^0.5.9", "lz-string": "^1.5.0", "picocolors": "1.1.1", "pretty-format": "^27.0.2" } }, "sha512-o4PXJQidqJl82ckFaXUeoAW+XysPLauYI43Abki5hABd853iMhitooc6znOnczgbTYmEP6U6/y1ZyKAIsvMKGg=="],
|
|
250
250
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vybestack/llxprt-ui",
|
|
3
|
-
"version": "0.7.0-nightly.
|
|
3
|
+
"version": "0.7.0-nightly.251216.6bcf96e64",
|
|
4
4
|
"description": "Experimental terminal UI for llxprt-code",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"react": "^19.2.1"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@vybestack/llxprt-code-core": "^0.7.0-nightly.
|
|
44
|
+
"@vybestack/llxprt-code-core": "^0.7.0-nightly.251216.6bcf96e64"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@eslint/js": "^9.39.1",
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
|
-
import {
|
|
2
|
+
import { resolve } from 'node:path';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import type { ThemeDefinition } from '../../features/theme';
|
|
5
5
|
|
|
6
|
-
const DEFAULT_LOGO_PATH = fileURLToPath(
|
|
7
|
-
new URL('../../../llxprt.png', import.meta.url),
|
|
8
|
-
);
|
|
9
6
|
const LOGO_ASPECT_RATIO = 415 / 260;
|
|
10
7
|
|
|
11
8
|
interface HeaderBarProps {
|
|
@@ -13,14 +10,44 @@ interface HeaderBarProps {
|
|
|
13
10
|
readonly theme: ThemeDefinition;
|
|
14
11
|
}
|
|
15
12
|
|
|
16
|
-
|
|
13
|
+
function getPackageRoot(): string | undefined {
|
|
14
|
+
// Bun: import.meta.dir
|
|
15
|
+
// Node 20.11+: import.meta.dirname
|
|
16
|
+
const meta = import.meta as ImportMeta & {
|
|
17
|
+
readonly dir: string;
|
|
18
|
+
readonly dirname: string;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
return meta.dir || meta.dirname;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function HeaderBar({ text, theme }: HeaderBarProps) {
|
|
17
25
|
const headerHeight = 3;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
26
|
+
|
|
27
|
+
const packageRoot = getPackageRoot();
|
|
28
|
+
|
|
29
|
+
let logoPath: string;
|
|
30
|
+
try {
|
|
31
|
+
const root = packageRoot ?? process.cwd();
|
|
32
|
+
|
|
33
|
+
// Try theme-specific logo first
|
|
34
|
+
const themeLogoPath = resolve(
|
|
35
|
+
root,
|
|
36
|
+
'..',
|
|
37
|
+
'..',
|
|
38
|
+
'logos',
|
|
39
|
+
`${theme.slug}.png`,
|
|
40
|
+
);
|
|
41
|
+
if (existsSync(themeLogoPath)) {
|
|
42
|
+
logoPath = themeLogoPath;
|
|
43
|
+
} else {
|
|
44
|
+
// Fall back to default logo
|
|
45
|
+
logoPath = resolve(root, '..', '..', 'llxprt.png');
|
|
46
|
+
}
|
|
47
|
+
} catch {
|
|
48
|
+
// Last resort fallback - use relative path for edge cases
|
|
49
|
+
logoPath = `../../../logos/${theme.slug}.png`;
|
|
50
|
+
}
|
|
24
51
|
|
|
25
52
|
return (
|
|
26
53
|
<box
|