@tangle-network/sandbox-ui 0.37.0 → 0.38.0

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.
@@ -1579,19 +1579,21 @@ function DashboardLayoutInner({
1579
1579
  badge: item.badge,
1580
1580
  showLabel: showLabels
1581
1581
  }
1582
- ) : /* @__PURE__ */ jsx14(Link, { href: item.href, to: item.href, children: /* @__PURE__ */ jsx14(
1582
+ ) : /* @__PURE__ */ jsx14(
1583
1583
  RailButton,
1584
1584
  {
1585
1585
  icon: item.icon,
1586
1586
  label: item.label,
1587
1587
  isActive: activeNavId === item.id,
1588
- showLabel: showLabels
1588
+ showLabel: showLabels,
1589
+ asChild: true,
1590
+ children: /* @__PURE__ */ jsx14(Link, { href: item.href, to: item.href })
1589
1591
  }
1590
- ) })
1592
+ )
1591
1593
  ] }, item.id);
1592
1594
  }) }),
1593
1595
  /* @__PURE__ */ jsxs13(SidebarRailFooter, { children: [
1594
- onSettingsClick ? /* @__PURE__ */ jsx14(RailButton, { icon: SettingsIconSmall, label: "Settings", onClick: onSettingsClick, showLabel: showLabels }) : /* @__PURE__ */ jsx14(Link, { href: settingsHref, to: settingsHref, children: /* @__PURE__ */ jsx14(RailButton, { icon: SettingsIconSmall, label: "Settings", showLabel: showLabels }) }),
1596
+ onSettingsClick ? /* @__PURE__ */ jsx14(RailButton, { icon: SettingsIconSmall, label: "Settings", onClick: onSettingsClick, showLabel: showLabels }) : /* @__PURE__ */ jsx14(RailButton, { icon: SettingsIconSmall, label: "Settings", showLabel: showLabels, asChild: true, children: /* @__PURE__ */ jsx14(Link, { href: settingsHref, to: settingsHref }) }),
1595
1597
  railFooter,
1596
1598
  /* @__PURE__ */ jsx14(RailSeparator, {}),
1597
1599
  /* @__PURE__ */ jsx14(
package/dist/dashboard.js CHANGED
@@ -52,7 +52,7 @@ import {
52
52
  canAdminSandbox,
53
53
  parseInsufficientBalance,
54
54
  useSidebar
55
- } from "./chunk-4PCDRCDA.js";
55
+ } from "./chunk-EX3UZWLB.js";
56
56
  import {
57
57
  BillingDashboard,
58
58
  InfoPanel,
package/dist/index.js CHANGED
@@ -199,7 +199,7 @@ import {
199
199
  canAdminSandbox,
200
200
  parseInsufficientBalance,
201
201
  useSidebar
202
- } from "./chunk-4PCDRCDA.js";
202
+ } from "./chunk-EX3UZWLB.js";
203
203
  import {
204
204
  BillingDashboard,
205
205
  InfoPanel,
@@ -37,6 +37,13 @@ interface TerminalViewProps {
37
37
  subtitle?: string;
38
38
  /** @deprecated No longer used — the PTY provides its own prompt. */
39
39
  prompt?: string;
40
+ /**
41
+ * Monospace font size in CSS pixels. Default 13. Changing it updates
42
+ * the live terminal and refits so xterm recomputes cols/rows from the
43
+ * new measured cell size instead of re-creating the terminal (which
44
+ * would drop scrollback).
45
+ */
46
+ fontSize?: number;
40
47
  /** Whether the terminal tab is currently active and visible. */
41
48
  isActive?: boolean;
42
49
  /**
@@ -47,6 +54,6 @@ interface TerminalViewProps {
47
54
  connectionId?: string;
48
55
  }
49
56
  declare const DEFAULT_TERMINAL_THEME: TerminalTheme;
50
- declare function TerminalView({ apiUrl, token, theme, title, subtitle, isActive, connectionId, }: TerminalViewProps): react_jsx_runtime.JSX.Element;
57
+ declare function TerminalView({ apiUrl, token, theme, title, subtitle, isActive, connectionId, fontSize, }: TerminalViewProps): react_jsx_runtime.JSX.Element;
51
58
 
52
59
  export { DEFAULT_TERMINAL_THEME, type TerminalTheme, TerminalView, type TerminalViewProps };
package/dist/terminal.js CHANGED
@@ -40,12 +40,16 @@ function TerminalView({
40
40
  title = "Terminal",
41
41
  subtitle = "Connected to PTY session",
42
42
  isActive = true,
43
- connectionId
43
+ connectionId,
44
+ fontSize = 13
44
45
  }) {
45
46
  const resolvedTheme = useMemo(
46
47
  () => ({ ...DEFAULT_TERMINAL_THEME, ...theme }),
47
48
  [theme]
48
49
  );
50
+ const resolvedFontSize = Number.isFinite(fontSize) && fontSize > 0 ? fontSize : 13;
51
+ const fontSizeRef = useRef(resolvedFontSize);
52
+ fontSizeRef.current = resolvedFontSize;
49
53
  const containerRef = useRef(null);
50
54
  const termRef = useRef(null);
51
55
  const fitAddonRef = useRef(null);
@@ -74,7 +78,7 @@ function TerminalView({
74
78
  const term = new Terminal({
75
79
  theme: resolvedTheme,
76
80
  fontFamily: '"JetBrains Mono", "Fira Code", "Cascadia Code", Menlo, monospace',
77
- fontSize: 13,
81
+ fontSize: fontSizeRef.current,
78
82
  lineHeight: 1.4,
79
83
  cursorBlink: true,
80
84
  cursorStyle: "bar",
@@ -152,6 +156,13 @@ function TerminalView({
152
156
  termRef.current.options.theme = resolvedTheme;
153
157
  }
154
158
  }, [resolvedTheme]);
159
+ useEffect(() => {
160
+ const term = termRef.current;
161
+ if (!term || term.options.fontSize === resolvedFontSize) return;
162
+ term.options.fontSize = resolvedFontSize;
163
+ const rafId = requestAnimationFrame(() => fitAddonRef.current?.fit());
164
+ return () => cancelAnimationFrame(rafId);
165
+ }, [resolvedFontSize]);
155
166
  useEffect(() => {
156
167
  if (isConnected && termRef.current) {
157
168
  resizeTerminal(termRef.current.cols, termRef.current.rows).catch(console.error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/sandbox-ui",
3
- "version": "0.37.0",
3
+ "version": "0.38.0",
4
4
  "description": "Unified UI component library for Tangle Sandbox — primitives, chat, dashboard, terminal, editor, and workspace components",
5
5
  "repository": {
6
6
  "type": "git",