@theoremjs/react 0.3.4-next.622.g75b9875 → 0.3.4-next.626.g7105a87

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theoremjs/react",
3
- "version": "0.3.4-next.622.g75b9875",
3
+ "version": "0.3.4-next.626.g7105a87",
4
4
  "description": "React bindings for Theorem: headless hooks + transport, an Astryx chat UI, and a Web-standard server handler.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -60,8 +60,8 @@
60
60
  "@stylexjs/stylex": "0.19.0",
61
61
  "react": "^19.0.0",
62
62
  "react-dom": "^19.0.0",
63
- "@theoremjs/agents": "^0.3.4-next.622.g75b9875",
64
- "@theoremjs/web": "^0.3.4-next.622.g75b9875"
63
+ "@theoremjs/agents": "^0.3.4-next.626.g7105a87",
64
+ "@theoremjs/web": "^0.3.4-next.626.g7105a87"
65
65
  },
66
66
  "peerDependenciesMeta": {
67
67
  "@astryxdesign/core": {
@@ -13,7 +13,7 @@ import { TextArea } from '@astryxdesign/core/TextArea';
13
13
  import { VStack } from '@astryxdesign/core/VStack';
14
14
  import { Children, createContext, use, useMemo, useRef, useState, useSyncExternalStore, } from 'react';
15
15
  import { useLabels } from "./labels-provider.js";
16
- import { PANEL_EDGE, PanelBody, PanelScroll, paneEdge, RAISED, SidePanel, SidePanelHeader, } from "./SidePanel.js";
16
+ import { PANEL_EDGE, PanelBody, PanelScroll, paneEdge, SidePanel, SidePanelHeader, } from "./SidePanel.js";
17
17
  import { textRows } from "./StateFields.js";
18
18
  import { WithTrace } from "./TraceInspectorPanel.js";
19
19
  import { CONSOLE_CARD } from "./trace-patterns.js";
@@ -39,7 +39,11 @@ function useNarrow() {
39
39
  * `wide` is a pair stacked on a narrow page, which takes the page's width.
40
40
  */
41
41
  function ConsoleSingle({ flush, wide, maxWidth, children, }) {
42
- return (_jsx(VStack, { height: "100%", paddingInlineStart: PANEL_EDGE, style: { ...(flush ? FLUSH_CARD : undefined), paddingInlineEnd: paneEdge(PANEL_EDGE) }, children: _jsx(Card, { variant: "transparent", height: "100%", padding: 0, style: flush ? { overflowY: 'auto' } : { ...RAISED, overflowY: 'auto' }, children: _jsx(Center, { axis: "horizontal", width: "100%", minHeight: "100%", children: _jsx(VStack, { width: "100%", maxWidth: wide ? undefined : maxWidth, gap: 3, padding: 4, children: children }) }) }) }));
42
+ const column = (_jsx(Center, { axis: "horizontal", width: "100%", minHeight: "100%", children: _jsx(VStack, { width: "100%", maxWidth: wide ? undefined : maxWidth, gap: 3, padding: 4, children: children }) }));
43
+ if (!flush)
44
+ return (_jsx(PanelBody, { inset: "all", padding: 0, isScrollable: true, children: column }));
45
+ // why: A flush page is already the raised panel, so it takes no block inset of its own.
46
+ return (_jsx(VStack, { height: "100%", paddingInlineStart: PANEL_EDGE, style: { ...FLUSH_CARD, paddingInlineEnd: paneEdge(PANEL_EDGE) }, children: _jsx(Card, { variant: "transparent", height: "100%", padding: 0, style: { overflowY: 'auto' }, children: column }) }));
43
47
  }
44
48
  /**
45
49
  * A console's page, for decisions and hosts alike: the trace toggle floats over
package/ui/LiveRunner.js CHANGED
@@ -20,7 +20,7 @@ import { useLiveRunnerModel } from "../components/live/use-live-runner-model.js"
20
20
  import { LiveCaptionsPanel } from "./LiveCaptionsPanel.js";
21
21
  import { liveStateLabel } from "./labels.js";
22
22
  import { TheoremLabelsProvider, useLabels } from "./labels-provider.js";
23
- import { PANEL_BOTTOM, PANEL_EDGE, SidePanel, SidePanelHeader, SidePanelToggle, useSidePanel, } from "./SidePanel.js";
23
+ import { PANEL_EDGE, SidePanel, SidePanelHeader, SidePanelToggle, useSidePanel, } from "./SidePanel.js";
24
24
  import { DEFAULT_CHAT_MAX_WIDTH } from "./TheoremChat.js";
25
25
  import { ApprovalCard, AuthChallengeCard, GATE_CARD_WIDTH } from "./ToolGateCard.js";
26
26
  import { useTraceInspector, WithTrace } from "./TraceInspectorPanel.js";
@@ -55,7 +55,7 @@ function LiveRunnerBody({ iface, connection, trace, slots, context, pageTools, }
55
55
  if (!model.callStarted) {
56
56
  return (_jsx(WithTrace, { inspector: inspector, children: _jsx(Layout, { ref: layoutRef, height: "fill", header: _jsx(SidePanelHeader, { children: inspector.toggle }), content: _jsx(LayoutContent, { padding: 0, children: _jsx(LiveLanding, { model: model }) }) }) }));
57
57
  }
58
- return (_jsxs(_Fragment, { children: [_jsx(WithTrace, { inspector: inspector, children: _jsx(Layout, { ref: layoutRef, height: "fill", header: _jsx(SidePanelHeader, { children: inspector.toggle }), content: _jsx(LayoutContent, { padding: 0, children: _jsx(Layout, { height: "fill", end: _jsx(SidePanel, { id: captions.id, labels: captionLabels, resizable: captions.resizable, open: captions.open, children: _jsx(LiveCaptions, { model: model }) }), content: _jsx(LayoutContent, { padding: 0, children: _jsx(VStack, { height: "100%", paddingInline: PANEL_EDGE, paddingBlockEnd: PANEL_BOTTOM, children: _jsx(LiveStage, { model: model, captionsToggle: captionsToggle }) }) }) }) }) }) }), _jsx(LiveToolGateDialog, { prompt: model.gatePrompt, agent: t('@theorem.agent.handle', { handle: model.handle }), onResolve: model.resolveGateDecision })] }));
58
+ return (_jsxs(_Fragment, { children: [_jsx(WithTrace, { inspector: inspector, children: _jsx(Layout, { ref: layoutRef, height: "fill", header: _jsx(SidePanelHeader, { children: inspector.toggle }), content: _jsx(LayoutContent, { padding: 0, children: _jsx(Layout, { height: "fill", end: _jsx(SidePanel, { id: captions.id, labels: captionLabels, resizable: captions.resizable, open: captions.open, children: _jsx(LiveCaptions, { model: model }) }), content: _jsx(LayoutContent, { padding: 0, children: _jsx(VStack, { height: "100%", padding: PANEL_EDGE, children: _jsx(LiveStage, { model: model, captionsToggle: captionsToggle }) }) }) }) }) }) }), _jsx(LiveToolGateDialog, { prompt: model.gatePrompt, agent: t('@theorem.agent.handle', { handle: model.handle }), onResolve: model.resolveGateDecision })] }));
59
59
  }
60
60
  /**
61
61
  * Before a call: the chat landing's greeting, with call buttons where the
package/ui/SidePanel.d.ts CHANGED
@@ -51,29 +51,23 @@ export type SidePanelProps = {
51
51
  className?: string;
52
52
  children?: ReactNode;
53
53
  };
54
- /** Page corners like the host's raised panels, no border or shadow; the card fill, so surface-filled cards read on it. */
55
- export declare const RAISED: {
56
- background: string;
57
- borderRadius: string;
58
- overflow: string;
59
- };
60
- /** A docked panel's inset: 12px off the outer edge, 16px off the bottom (the page inset). */
54
+ /** A raised panel's inset: 12px off the page's edges. */
61
55
  export declare const PANEL_EDGE = 3;
62
- export declare const PANEL_BOTTOM = 4;
63
56
  /**
64
57
  * A raised pane's gap from the page's end or bottom edge: `--theorem-pane-edge` where a host
65
58
  * sets it (0 where the host already insets its page), else `spacing`.
66
59
  */
67
- export declare function paneEdge(spacing: typeof PANEL_EDGE | typeof PANEL_BOTTOM): string;
68
- /** The raised card every docked panel and the content beside one share. */
69
- export declare function PanelBody({ padding, inset, className, children, }: {
60
+ export declare function paneEdge(spacing: typeof PANEL_EDGE): string;
61
+ /** The raised card every pane, docked panel and console shares, inset the same from top and bottom. */
62
+ export declare function PanelBody({ padding, inset, isScrollable, className, children, }: {
70
63
  padding?: 0;
71
64
  /**
72
65
  * `end` insets the trailing edge (a panel docked there, or the content
73
66
  * filling beside a start panel). `start` insets the leading edge. `beside`
74
- * insets both.
67
+ * and `all` inset both.
75
68
  */
76
- inset?: 'end' | 'start' | 'beside';
69
+ inset?: 'end' | 'start' | 'beside' | 'all';
70
+ isScrollable?: boolean;
77
71
  className?: string;
78
72
  children?: ReactNode;
79
73
  }): import("react").JSX.Element;
package/ui/SidePanel.js CHANGED
@@ -50,14 +50,13 @@ export function SidePanelToggle({ labels, icon, panelId, open, onToggle, size, }
50
50
  return (_jsx(IconButton, { label: action, size: size, tooltip: action, variant: open ? 'secondary' : 'ghost', "aria-expanded": open, "aria-controls": panelId, icon: icon, onClick: onToggle }));
51
51
  }
52
52
  /** Page corners like the host's raised panels, no border or shadow; the card fill, so surface-filled cards read on it. */
53
- export const RAISED = {
53
+ const RAISED = {
54
54
  background: 'var(--theorem-pane-background, var(--color-background-card))',
55
55
  borderRadius: 'var(--radius-page)',
56
56
  overflow: 'hidden',
57
57
  };
58
- /** A docked panel's inset: 12px off the outer edge, 16px off the bottom (the page inset). */
58
+ /** A raised panel's inset: 12px off the page's edges. */
59
59
  export const PANEL_EDGE = 3;
60
- export const PANEL_BOTTOM = 4;
61
60
  /**
62
61
  * A raised pane's gap from the page's end or bottom edge: `--theorem-pane-edge` where a host
63
62
  * sets it (0 where the host already insets its page), else `spacing`.
@@ -65,12 +64,12 @@ export const PANEL_BOTTOM = 4;
65
64
  export function paneEdge(spacing) {
66
65
  return `var(--theorem-pane-edge, var(--spacing-${String(spacing)}))`;
67
66
  }
68
- /** The raised card every docked panel and the content beside one share. */
69
- export function PanelBody({ padding, inset = 'end', className, children, }) {
70
- return (_jsx(VStack, { height: "100%", className: className, paddingInlineStart: inset === 'end' ? undefined : PANEL_EDGE, style: {
67
+ /** The raised card every pane, docked panel and console shares, inset the same from top and bottom. */
68
+ export function PanelBody({ padding, inset = 'end', isScrollable = false, className, children, }) {
69
+ return (_jsx(VStack, { height: "100%", className: className, paddingInlineStart: inset === 'end' ? undefined : PANEL_EDGE, paddingBlockStart: PANEL_EDGE, style: {
71
70
  paddingInlineEnd: inset === 'start' ? undefined : paneEdge(PANEL_EDGE),
72
- paddingBlockEnd: paneEdge(PANEL_BOTTOM),
73
- }, children: _jsx(Card, { variant: "transparent", height: "100%", padding: padding, style: RAISED, children: children }) }));
71
+ paddingBlockEnd: paneEdge(PANEL_EDGE),
72
+ }, children: _jsx(Card, { variant: "transparent", height: "100%", padding: padding, style: isScrollable ? { ...RAISED, overflowY: 'auto' } : RAISED, children: children }) }));
74
73
  }
75
74
  /** The scroll inside a panel card. The same area the trace uses, so a short body sizes to its rows. */
76
75
  export function PanelScroll({ label, padding, children, }) {
@@ -106,10 +105,7 @@ export function useWidth() {
106
105
  */
107
106
  export function RaisedPane({ id, header, children, }) {
108
107
  const { ref, width } = useWidth();
109
- return (_jsx(Layout, { height: "fill", style: { position: 'relative' }, header: header, content: _jsx(LayoutContent, { padding: 0, isScrollable: false, children: _jsx(VStack, { height: "100%", paddingInlineStart: PANEL_EDGE, paddingBlockStart: PANEL_EDGE, style: {
110
- paddingInlineEnd: paneEdge(PANEL_EDGE),
111
- paddingBlockEnd: paneEdge(PANEL_EDGE),
112
- }, children: _jsx(Card, { variant: "transparent", height: "100%", padding: 0, style: RAISED, children: _jsx("div", { id: id, ref: ref, style: { height: '100%' }, children: children(isSidePanelWide(width)) }) }) }) }) }));
108
+ return (_jsx(Layout, { height: "fill", style: { position: 'relative' }, header: header, content: _jsx(LayoutContent, { padding: 0, isScrollable: false, children: _jsx(PanelBody, { inset: "all", padding: 0, children: _jsx("div", { id: id, ref: ref, style: { height: '100%' }, children: children(isSidePanelWide(width)) }) }) }) }));
113
109
  }
114
110
  /** A raised pane's content. Narrow, the detail takes the overview's place; wide, it sits beside it. */
115
111
  export function PaneLayout({ isWide, label, detailLabel, lead, overview, detail, }) {