@theoremjs/react 0.3.4-next.624.g1a1ecd4 → 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 +3 -3
- package/ui/ConsoleFrame.js +2 -2
- package/ui/LiveRunner.js +2 -2
- package/ui/SidePanel.d.ts +7 -12
- package/ui/SidePanel.js +7 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theoremjs/react",
|
|
3
|
-
"version": "0.3.4-next.
|
|
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.
|
|
64
|
-
"@theoremjs/web": "^0.3.4-next.
|
|
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": {
|
package/ui/ConsoleFrame.js
CHANGED
|
@@ -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,
|
|
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";
|
|
@@ -41,7 +41,7 @@ function useNarrow() {
|
|
|
41
41
|
function ConsoleSingle({ flush, wide, maxWidth, children, }) {
|
|
42
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
43
|
if (!flush)
|
|
44
|
-
return _jsx(
|
|
44
|
+
return (_jsx(PanelBody, { inset: "all", padding: 0, isScrollable: true, children: column }));
|
|
45
45
|
// why: A flush page is already the raised panel, so it takes no block inset of its own.
|
|
46
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 }) }));
|
|
47
47
|
}
|
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 {
|
|
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%",
|
|
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,23 +51,23 @@ export type SidePanelProps = {
|
|
|
51
51
|
className?: string;
|
|
52
52
|
children?: ReactNode;
|
|
53
53
|
};
|
|
54
|
-
/** A
|
|
54
|
+
/** A raised panel's inset: 12px off the page's edges. */
|
|
55
55
|
export declare const PANEL_EDGE = 3;
|
|
56
|
-
export declare const PANEL_BOTTOM = 4;
|
|
57
56
|
/**
|
|
58
57
|
* A raised pane's gap from the page's end or bottom edge: `--theorem-pane-edge` where a host
|
|
59
58
|
* sets it (0 where the host already insets its page), else `spacing`.
|
|
60
59
|
*/
|
|
61
|
-
export declare function paneEdge(spacing: typeof PANEL_EDGE
|
|
62
|
-
/** The raised card every docked panel and the
|
|
63
|
-
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, }: {
|
|
64
63
|
padding?: 0;
|
|
65
64
|
/**
|
|
66
65
|
* `end` insets the trailing edge (a panel docked there, or the content
|
|
67
66
|
* filling beside a start panel). `start` insets the leading edge. `beside`
|
|
68
|
-
*
|
|
67
|
+
* and `all` inset both.
|
|
69
68
|
*/
|
|
70
|
-
inset?: 'end' | 'start' | 'beside';
|
|
69
|
+
inset?: 'end' | 'start' | 'beside' | 'all';
|
|
70
|
+
isScrollable?: boolean;
|
|
71
71
|
className?: string;
|
|
72
72
|
children?: ReactNode;
|
|
73
73
|
}): import("react").JSX.Element;
|
|
@@ -90,11 +90,6 @@ export declare function useWidth(): {
|
|
|
90
90
|
ref: (node: HTMLDivElement | null) => (() => void) | undefined;
|
|
91
91
|
width: number;
|
|
92
92
|
};
|
|
93
|
-
/** The raised card a pane fills its place with, inset from every edge. */
|
|
94
|
-
export declare function RaisedFrame({ isScrollable, children, }: {
|
|
95
|
-
isScrollable?: boolean;
|
|
96
|
-
children: ReactNode;
|
|
97
|
-
}): import("react").JSX.Element;
|
|
98
93
|
/**
|
|
99
94
|
* A raised pane that fills its place, inset from the sides. Its content is
|
|
100
95
|
* told whether the pane is wide enough for two readable columns.
|
package/ui/SidePanel.js
CHANGED
|
@@ -55,9 +55,8 @@ const RAISED = {
|
|
|
55
55
|
borderRadius: 'var(--radius-page)',
|
|
56
56
|
overflow: 'hidden',
|
|
57
57
|
};
|
|
58
|
-
/** A
|
|
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
|
|
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(
|
|
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, }) {
|
|
@@ -100,20 +99,13 @@ export function useWidth() {
|
|
|
100
99
|
}, []);
|
|
101
100
|
return { ref, width };
|
|
102
101
|
}
|
|
103
|
-
/** The raised card a pane fills its place with, inset from every edge. */
|
|
104
|
-
export function RaisedFrame({ isScrollable = false, children, }) {
|
|
105
|
-
return (_jsx(VStack, { height: "100%", paddingInlineStart: PANEL_EDGE, paddingBlockStart: PANEL_EDGE, style: {
|
|
106
|
-
paddingInlineEnd: paneEdge(PANEL_EDGE),
|
|
107
|
-
paddingBlockEnd: paneEdge(PANEL_EDGE),
|
|
108
|
-
}, children: _jsx(Card, { variant: "transparent", height: "100%", padding: 0, style: isScrollable ? { ...RAISED, overflowY: 'auto' } : RAISED, children: children }) }));
|
|
109
|
-
}
|
|
110
102
|
/**
|
|
111
103
|
* A raised pane that fills its place, inset from the sides. Its content is
|
|
112
104
|
* told whether the pane is wide enough for two readable columns.
|
|
113
105
|
*/
|
|
114
106
|
export function RaisedPane({ id, header, children, }) {
|
|
115
107
|
const { ref, width } = useWidth();
|
|
116
|
-
return (_jsx(Layout, { height: "fill", style: { position: 'relative' }, header: header, content: _jsx(LayoutContent, { padding: 0, isScrollable: false, children: _jsx(
|
|
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)) }) }) }) }));
|
|
117
109
|
}
|
|
118
110
|
/** A raised pane's content. Narrow, the detail takes the overview's place; wide, it sits beside it. */
|
|
119
111
|
export function PaneLayout({ isWide, label, detailLabel, lead, overview, detail, }) {
|