@theoremjs/react 0.3.4-next.735.g8d504c6 → 0.3.4-next.753.g176c472
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 -4
- package/ui/LiveRunner.js +2 -2
- package/ui/ShapedData.js +6 -4
- package/ui/labels.d.ts +0 -8
- package/ui/labels.js +0 -8
- package/ui/transcript-copy-text.js +1 -0
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.753.g176c472",
|
|
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.753.g176c472",
|
|
64
|
+
"@theoremjs/web": "^0.3.4-next.753.g176c472"
|
|
65
65
|
},
|
|
66
66
|
"peerDependenciesMeta": {
|
|
67
67
|
"@astryxdesign/core": {
|
package/ui/ConsoleFrame.js
CHANGED
|
@@ -3,14 +3,16 @@ import { Button } from '@astryxdesign/core/Button';
|
|
|
3
3
|
import { Card } from '@astryxdesign/core/Card';
|
|
4
4
|
import { Center } from '@astryxdesign/core/Center';
|
|
5
5
|
import { HStack } from '@astryxdesign/core/HStack';
|
|
6
|
+
import { Icon } from '@astryxdesign/core/Icon';
|
|
6
7
|
import { useLocale } from '@astryxdesign/core/i18n';
|
|
7
8
|
import { Layout, LayoutContent } from '@astryxdesign/core/Layout';
|
|
8
9
|
import { useResizable } from '@astryxdesign/core/Resizable';
|
|
9
10
|
import { percent, pixel } from '@astryxdesign/core/Resizable/utils';
|
|
10
|
-
import { SegmentedControl, SegmentedControlItem } from '@astryxdesign/core/SegmentedControl';
|
|
11
11
|
import { Text } from '@astryxdesign/core/Text';
|
|
12
12
|
import { TextArea } from '@astryxdesign/core/TextArea';
|
|
13
|
+
import { ToggleButton } from '@astryxdesign/core/ToggleButton';
|
|
13
14
|
import { VStack } from '@astryxdesign/core/VStack';
|
|
15
|
+
import { IconCode, IconEye } from '@tabler/icons-react';
|
|
14
16
|
import { Children, createContext, use, useMemo, useRef, useState, useSyncExternalStore, } from 'react';
|
|
15
17
|
import { useLabels } from "./labels-provider.js";
|
|
16
18
|
import { PANEL_EDGE, PanelBody, PanelScroll, paneEdge, SidePanel, SidePanelHeader, } from "./SidePanel.js";
|
|
@@ -122,9 +124,9 @@ function runShortcut(run) {
|
|
|
122
124
|
export function RequestCard({ title, onRun, children, ...heading }) {
|
|
123
125
|
const t = useLabels();
|
|
124
126
|
const framed = use(ConsoleChrome);
|
|
125
|
-
const body = (_jsxs(VStack, { gap: 3, padding: framed ? undefined : 4, onKeyDown: runShortcut(onRun), children: [_jsxs(HStack, { gap: 2, hAlign: "between", vAlign: "center", children: [_jsx(Text, { type: "supporting", color: "secondary", as: "h3", children: title }), heading.onView ? (
|
|
126
|
-
heading.onView(
|
|
127
|
-
}
|
|
127
|
+
const body = (_jsxs(VStack, { gap: 3, padding: framed ? undefined : 4, onKeyDown: runShortcut(onRun), children: [_jsxs(HStack, { gap: 2, hAlign: "between", vAlign: "center", children: [_jsx(Text, { type: "supporting", color: "secondary", as: "h3", children: title }), heading.onView ? (_jsx(ToggleButton, { label: t('@theorem.data.json'), tooltip: t(heading.view === 'json' ? '@theorem.decision.fields' : '@theorem.data.json'), size: "sm", isIconOnly: true, isDisabled: !heading.hasFields, icon: _jsx(Icon, { icon: IconEye, size: "sm" }), pressedIcon: _jsx(Icon, { icon: IconCode, size: "sm" }), isPressed: heading.view === 'json', onPressedChange: (isJson) => {
|
|
128
|
+
heading.onView(isJson ? 'json' : 'fields');
|
|
129
|
+
} })) : (heading.actions)] }), children] }));
|
|
128
130
|
if (!framed)
|
|
129
131
|
return body;
|
|
130
132
|
return (_jsx(Card, { variant: "muted", padding: 4, className: "theorem-console-card", style: CONSOLE_CARD, children: body }));
|
package/ui/LiveRunner.js
CHANGED
|
@@ -38,9 +38,9 @@ const WAVE_HEIGHT = 320;
|
|
|
38
38
|
export function LiveRunner({ theme, mode, labels, ...props }) {
|
|
39
39
|
return (_jsx(TheoremThemeProvider, { theme: theme, mode: mode, children: _jsx(TheoremLabelsProvider, { labels: labels, children: _jsx(LiveRunnerBody, { ...props }) }) }));
|
|
40
40
|
}
|
|
41
|
-
function LiveRunnerBody({ iface, connection, trace,
|
|
41
|
+
function LiveRunnerBody({ iface, connection, trace, ...options }) {
|
|
42
42
|
const t = useLabels();
|
|
43
|
-
const model = useLiveRunnerModel(iface, connection,
|
|
43
|
+
const model = useLiveRunnerModel(iface, connection, options);
|
|
44
44
|
// why: Both panels size against the whole live layout, so a third means the same for each.
|
|
45
45
|
const layoutRef = useRef(null);
|
|
46
46
|
const inspector = useTraceInspector(iface, model.traces, trace);
|
package/ui/ShapedData.js
CHANGED
|
@@ -2,18 +2,20 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { CodeBlock } from '@astryxdesign/core/CodeBlock';
|
|
3
3
|
import { Collapsible, CollapsibleGroup } from '@astryxdesign/core/Collapsible';
|
|
4
4
|
import { HStack } from '@astryxdesign/core/HStack';
|
|
5
|
+
import { Icon } from '@astryxdesign/core/Icon';
|
|
5
6
|
import { useLocale } from '@astryxdesign/core/i18n';
|
|
6
7
|
import { useLightbox } from '@astryxdesign/core/Lightbox';
|
|
7
8
|
import { Link } from '@astryxdesign/core/Link';
|
|
8
9
|
import { List, ListItem } from '@astryxdesign/core/List';
|
|
9
10
|
import { Markdown } from '@astryxdesign/core/Markdown';
|
|
10
11
|
import { MetadataList, MetadataListItem } from '@astryxdesign/core/MetadataList';
|
|
11
|
-
import { SegmentedControl, SegmentedControlItem } from '@astryxdesign/core/SegmentedControl';
|
|
12
12
|
import { Table } from '@astryxdesign/core/Table';
|
|
13
13
|
import { Text } from '@astryxdesign/core/Text';
|
|
14
14
|
import { Thumbnail } from '@astryxdesign/core/Thumbnail';
|
|
15
|
+
import { ToggleButton } from '@astryxdesign/core/ToggleButton';
|
|
15
16
|
import { Token } from '@astryxdesign/core/Token';
|
|
16
17
|
import { VStack } from '@astryxdesign/core/VStack';
|
|
18
|
+
import { IconCode, IconEye } from '@tabler/icons-react';
|
|
17
19
|
import { fieldLabel, fieldReading, isPlain, isProse, isRow, json, layoutChars, MAX_ROWS, plainReading, rowHeading, shapeOf, splitFields, unpacked, withUnit, } from '@theoremjs/web/client';
|
|
18
20
|
import { Component, useMemo, useState } from 'react';
|
|
19
21
|
import { Arrive, useArrive } from "./arrive.js";
|
|
@@ -235,7 +237,7 @@ export function ShapedData({ value: raw, title, lead, ledKeys = [] }) {
|
|
|
235
237
|
}).format(LARGE_JSON_CHARS / 1000);
|
|
236
238
|
return (_jsxs(VStack, { gap: 2, children: [_jsx(Text, { type: "supporting", color: "secondary", children: title }), _jsx(Text, { type: "supporting", color: "secondary", children: t('@theorem.data.large', { size }) }), _jsx(Json, { text: text })] }));
|
|
237
239
|
}
|
|
238
|
-
return (_jsxs(VStack, { gap: 2, children: [_jsxs(HStack, { gap: 2, vAlign: "center", hAlign: "between", children: [_jsx(Text, { type: "supporting", color: "secondary", children: title }), structured && (
|
|
239
|
-
setView(
|
|
240
|
-
}
|
|
240
|
+
return (_jsxs(VStack, { gap: 2, children: [_jsxs(HStack, { gap: 2, vAlign: "center", hAlign: "between", children: [_jsx(Text, { type: "supporting", color: "secondary", children: title }), structured && (_jsx(ToggleButton, { label: t('@theorem.data.json'), tooltip: t(view === 'json' ? '@theorem.data.shaped' : '@theorem.data.json'), size: "sm", isIconOnly: true, icon: _jsx(Icon, { icon: IconEye, size: "sm" }), pressedIcon: _jsx(Icon, { icon: IconCode, size: "sm" }), isPressed: view === 'json', onPressedChange: (isJson) => {
|
|
241
|
+
setView(isJson ? 'json' : 'data');
|
|
242
|
+
} }))] }), view === 'json' && structured ? (_jsx(Json, { text: text })) : (_jsx(ShapeBoundary, { fallback: _jsx(Json, { text: text }), onFallback: () => setView('json'), children: _jsxs(VStack, { gap: 3, children: [lead, rest === undefined ? null : _jsx(Node, { value: rest, depth: 0 })] }) }))] }));
|
|
241
243
|
}
|
package/ui/labels.d.ts
CHANGED
|
@@ -250,10 +250,6 @@ export declare const THEOREM_UI_CATALOG: {
|
|
|
250
250
|
readonly description: "Tokens a reply used, under it, or an agent tool's called agent used, on its call row.";
|
|
251
251
|
readonly params: readonly ["count"];
|
|
252
252
|
};
|
|
253
|
-
readonly '@theorem.data.view': {
|
|
254
|
-
readonly defaultMessage: "View as";
|
|
255
|
-
readonly description: "Switch between tool data drawn by its shape and its JSON.";
|
|
256
|
-
};
|
|
257
253
|
readonly '@theorem.data.shaped': {
|
|
258
254
|
readonly defaultMessage: "Data";
|
|
259
255
|
readonly description: "Tool data drawn as fields, sections, and tables.";
|
|
@@ -467,10 +463,6 @@ export declare const THEOREM_UI_CATALOG: {
|
|
|
467
463
|
readonly description: "The state's size against the profile's limit, under the field.";
|
|
468
464
|
readonly params: readonly ["size", "limit"];
|
|
469
465
|
};
|
|
470
|
-
readonly '@theorem.decision.view': {
|
|
471
|
-
readonly defaultMessage: "Edit as";
|
|
472
|
-
readonly description: "Switch between the state as fields and as JSON.";
|
|
473
|
-
};
|
|
474
466
|
readonly '@theorem.decision.fields': {
|
|
475
467
|
readonly defaultMessage: "Fields";
|
|
476
468
|
readonly description: "The state edited field by field.";
|
package/ui/labels.js
CHANGED
|
@@ -234,10 +234,6 @@ export const THEOREM_UI_CATALOG = {
|
|
|
234
234
|
description: "Tokens a reply used, under it, or an agent tool's called agent used, on its call row.",
|
|
235
235
|
params: ['count'],
|
|
236
236
|
},
|
|
237
|
-
'@theorem.data.view': {
|
|
238
|
-
defaultMessage: 'View as',
|
|
239
|
-
description: 'Switch between tool data drawn by its shape and its JSON.',
|
|
240
|
-
},
|
|
241
237
|
'@theorem.data.shaped': {
|
|
242
238
|
defaultMessage: 'Data',
|
|
243
239
|
description: 'Tool data drawn as fields, sections, and tables.',
|
|
@@ -430,10 +426,6 @@ export const THEOREM_UI_CATALOG = {
|
|
|
430
426
|
description: "The state's size against the profile's limit, under the field.",
|
|
431
427
|
params: ['size', 'limit'],
|
|
432
428
|
},
|
|
433
|
-
'@theorem.decision.view': {
|
|
434
|
-
defaultMessage: 'Edit as',
|
|
435
|
-
description: 'Switch between the state as fields and as JSON.',
|
|
436
|
-
},
|
|
437
429
|
'@theorem.decision.fields': {
|
|
438
430
|
defaultMessage: 'Fields',
|
|
439
431
|
description: 'The state edited field by field.',
|