@theoremjs/react 0.3.4-next.622.g75b9875 → 0.3.4-next.624.g1a1ecd4
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 +6 -2
- package/ui/SidePanel.d.ts +5 -6
- package/ui/SidePanel.js +9 -5
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.624.g1a1ecd4",
|
|
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.624.g1a1ecd4",
|
|
64
|
+
"@theoremjs/web": "^0.3.4-next.624.g1a1ecd4"
|
|
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, RaisedFrame, 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
|
-
|
|
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(RaisedFrame, { 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/SidePanel.d.ts
CHANGED
|
@@ -51,12 +51,6 @@ 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
54
|
/** A docked panel's inset: 12px off the outer edge, 16px off the bottom (the page inset). */
|
|
61
55
|
export declare const PANEL_EDGE = 3;
|
|
62
56
|
export declare const PANEL_BOTTOM = 4;
|
|
@@ -96,6 +90,11 @@ export declare function useWidth(): {
|
|
|
96
90
|
ref: (node: HTMLDivElement | null) => (() => void) | undefined;
|
|
97
91
|
width: number;
|
|
98
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;
|
|
99
98
|
/**
|
|
100
99
|
* A raised pane that fills its place, inset from the sides. Its content is
|
|
101
100
|
* told whether the pane is wide enough for two readable columns.
|
package/ui/SidePanel.js
CHANGED
|
@@ -50,7 +50,7 @@ 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
|
-
|
|
53
|
+
const RAISED = {
|
|
54
54
|
background: 'var(--theorem-pane-background, var(--color-background-card))',
|
|
55
55
|
borderRadius: 'var(--radius-page)',
|
|
56
56
|
overflow: 'hidden',
|
|
@@ -100,16 +100,20 @@ export function useWidth() {
|
|
|
100
100
|
}, []);
|
|
101
101
|
return { ref, width };
|
|
102
102
|
}
|
|
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
|
+
}
|
|
103
110
|
/**
|
|
104
111
|
* A raised pane that fills its place, inset from the sides. Its content is
|
|
105
112
|
* told whether the pane is wide enough for two readable columns.
|
|
106
113
|
*/
|
|
107
114
|
export function RaisedPane({ id, header, children, }) {
|
|
108
115
|
const { ref, width } = useWidth();
|
|
109
|
-
return (_jsx(Layout, { height: "fill", style: { position: 'relative' }, header: header, content: _jsx(LayoutContent, { padding: 0, isScrollable: false, children: _jsx(
|
|
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)) }) }) }) }) }));
|
|
116
|
+
return (_jsx(Layout, { height: "fill", style: { position: 'relative' }, header: header, content: _jsx(LayoutContent, { padding: 0, isScrollable: false, children: _jsx(RaisedFrame, { children: _jsx("div", { id: id, ref: ref, style: { height: '100%' }, children: children(isSidePanelWide(width)) }) }) }) }));
|
|
113
117
|
}
|
|
114
118
|
/** A raised pane's content. Narrow, the detail takes the overview's place; wide, it sits beside it. */
|
|
115
119
|
export function PaneLayout({ isWide, label, detailLabel, lead, overview, detail, }) {
|