@theoremjs/studio 0.3.4-next.456.gff60088 → 0.3.4-next.458.gbf7b487

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.
Files changed (26) hide show
  1. package/package.json +4 -4
  2. package/page/assets/{Banner-DBzTZFXK.js → Banner-C4MPbvft.js} +2 -2
  3. package/page/assets/{ConsoleFrame-xxYOJ87g.js → ConsoleFrame-BkzieVRC.js} +1 -1
  4. package/page/assets/{ContextMenu-BeVF9aNZ.js → ContextMenu-BGP2gdee.js} +2 -2
  5. package/page/assets/{ToolResultCharts-DBMZY7TW.js → ToolResultCharts-xDwNDd-T.js} +1 -1
  6. package/page/assets/{TraceInspector-CzHEXIY1.js → TraceInspector-CHpdhiVX.js} +1 -1
  7. package/page/assets/{TraceOverview-Bxg_mg5E.js → TraceOverview-DCGew7UN.js} +1 -1
  8. package/page/assets/{browser-engine-9AzaOhwz.js → browser-engine-Ca2pvYX0.js} +1 -1
  9. package/page/assets/{browser-transport-C4SkWngw.js → browser-transport-DYgEItHi.js} +3 -3
  10. package/page/assets/{export-agent-Bp0s2CsN.js → export-agent-5rXmF-g1.js} +1 -1
  11. package/page/assets/{guardrail-tester-CS65cwR5.js → guardrail-tester-B-ZfQFVu.js} +1 -1
  12. package/page/assets/{index--GBhZcW8.js → index-Dajtrq_Z.js} +6 -6
  13. package/page/assets/{studio-code-pane-B5U9m4Ds.js → studio-code-pane-CKYRitdD.js} +1 -1
  14. package/page/assets/{studio-console-UkWyi9VN.js → studio-console-DwhqnNyw.js} +1 -1
  15. package/page/assets/{studio-decision-CCqMemnt.js → studio-decision-Ckj4UNNt.js} +1 -1
  16. package/page/assets/{studio-embedding-RTptdueU.js → studio-embedding-8qL_dVlz.js} +1 -1
  17. package/page/assets/{studio-host-console-4UbIwUY0.js → studio-host-console-BXwwloN4.js} +2 -2
  18. package/page/assets/{studio-labels-I9r-0TcO.js → studio-labels-C1pvg0JC.js} +1 -1
  19. package/page/assets/{studio-live-Cn-wK5-R.js → studio-live-26srJ74m.js} +1 -1
  20. package/page/assets/{studio-map-BWTX2beg.js → studio-map-C5zsJusF.js} +1 -1
  21. package/page/assets/{studio-trace-replay-BaTeqFr0.js → studio-trace-replay-B38TicvO.js} +1 -1
  22. package/page/assets/{use-one-call-C0-dw_94.js → use-one-call-DjVkallj.js} +1 -1
  23. package/page/index.html +5 -5
  24. package/ui/tree-map.css +43 -0
  25. package/ui/tree-map.d.ts +7 -1
  26. package/ui/tree-map.js +10 -5
package/ui/tree-map.css CHANGED
@@ -13,3 +13,46 @@
13
13
  .studio-tree-map-lines .map-line {
14
14
  stroke: color-mix(in srgb, var(--color-border-emphasized) 60%, var(--color-background-surface));
15
15
  }
16
+
17
+ /*
18
+ * Feeds draw in as the loader's map draws (read-map.css), one after another: the line from the
19
+ * tree, then the token at its end. Hidden, they leave in the reverse order.
20
+ * invariant: Transitions, not keyframes, so drawing and leaving both ease, and a turn mid-draw
21
+ * goes back from where it is.
22
+ */
23
+ .studio-tree-map {
24
+ --feed-step: 70ms;
25
+ }
26
+
27
+ .studio-tree-map-lines [data-feed] {
28
+ stroke-dasharray: 1;
29
+ stroke-dashoffset: 0;
30
+ transition: stroke-dashoffset var(--duration-medium, 240ms) var(--ease-standard, ease-out)
31
+ calc(var(--feed-i) * var(--feed-step));
32
+ }
33
+
34
+ .studio-tree-map > [data-feed] {
35
+ transition: opacity var(--duration-medium, 240ms) var(--ease-standard, ease-out)
36
+ calc(var(--feed-i) * var(--feed-step) + var(--duration-medium, 240ms));
37
+ }
38
+
39
+ .studio-tree-map[data-feeds="hidden"] > [data-feed] {
40
+ opacity: 0;
41
+ transition-delay: calc((var(--feed-n) - var(--feed-i)) * var(--feed-step));
42
+ }
43
+
44
+ .studio-tree-map[data-feeds="hidden"] .studio-tree-map-lines [data-feed] {
45
+ stroke-dashoffset: var(--feed-from);
46
+ transition-delay: calc(
47
+ (var(--feed-n) - var(--feed-i)) *
48
+ var(--feed-step) +
49
+ var(--duration-medium, 240ms)
50
+ );
51
+ }
52
+
53
+ @media (prefers-reduced-motion: reduce) {
54
+ .studio-tree-map-lines [data-feed],
55
+ .studio-tree-map > [data-feed] {
56
+ transition: none;
57
+ }
58
+ }
package/ui/tree-map.d.ts CHANGED
@@ -3,5 +3,11 @@ export interface StudioTreeMapProps {
3
3
  workspace: StudioWorkspace;
4
4
  /** The keys of the agents to draw, in the workspace's order; every agent when unset. */
5
5
  agents?: readonly string[] | undefined;
6
+ /**
7
+ * Whether what feeds the tree is drawn beside it. Turned on, each feed draws in after the one
8
+ * before, its line from the tree first, as the loader's map draws; turned off, they leave in the
9
+ * reverse order. Shown when unset.
10
+ */
11
+ feeds?: 'shown' | 'hidden' | undefined;
6
12
  }
7
- export declare function StudioTreeMap({ workspace, agents }: StudioTreeMapProps): import("react").JSX.Element;
13
+ export declare function StudioTreeMap({ workspace, agents, feeds: shown }: StudioTreeMapProps): import("react").JSX.Element;
package/ui/tree-map.js CHANGED
@@ -142,7 +142,9 @@ function linePath(from, to) {
142
142
  const x = from.x + TRUNK;
143
143
  return `M ${x} ${from.y + HALF} V ${to.y - TURN} Q ${x} ${to.y} ${x + TURN} ${to.y} H ${to.x - LINE_GAP}`;
144
144
  }
145
- export function StudioTreeMap({ workspace, agents }) {
145
+ /** The order a feed draws in, and which end its line starts from: 1 the path's start, -1 its end. */
146
+ const feedStyle = (index, from = 1) => ({ '--feed-i': index, '--feed-from': from });
147
+ export function StudioTreeMap({ workspace, agents, feeds: shown = 'shown' }) {
146
148
  const root = useRef(null);
147
149
  const rows = rowsOf(workspace, agents);
148
150
  const feeds = feedsOf(workspace, rows);
@@ -166,12 +168,14 @@ export function StudioTreeMap({ workspace, agents }) {
166
168
  return above && feed.depth <= above.depth ? [railFor(feed, above)] : [];
167
169
  });
168
170
  const width = Math.max(GUESS, ...feeds.map(feedRight), ...rails) + PAD;
169
- return (_jsxs("div", { ref: root, className: "studio-tree-map", style: { width, height }, children: [_jsxs("svg", { className: "studio-tree-map-lines", width: width, height: height, "aria-hidden": "true", children: [rows.map((row) => row.parent && (_jsx("path", { className: "map-line", d: linePath(row.parent, row) }, rowId(row)))), feeds.flatMap((feed) => feed.into.map((id) => {
171
+ const order = new Map(feeds.map((feed, index) => [feed.id, index]));
172
+ return (_jsxs("div", { ref: root, className: "studio-tree-map", "data-feeds": shown, style: { width, height, '--feed-n': feeds.length }, children: [_jsxs("svg", { className: "studio-tree-map-lines", width: width, height: height, "aria-hidden": "true", children: [rows.map((row) => row.parent && (_jsx("path", { className: "map-line", d: linePath(row.parent, row) }, rowId(row)))), feeds.flatMap((feed) => feed.into.map((id) => {
170
173
  const row = byId.get(id);
171
174
  if (!row)
172
175
  return null;
173
176
  const { d } = mapCurve({ x: feedX - LINE_GAP, y: feed.y }, { x: right(row) + LINE_GAP, y: row.y });
174
- return _jsx("path", { className: "map-line", d: d }, `${feed.id}>${id}`);
177
+ // The line runs from the feed to the row; it draws from the row.
178
+ return (_jsx("path", { className: "map-line", d: d, pathLength: 1, "data-feed": "", style: feedStyle(order.get(feed.id) ?? 0, -1) }, `${feed.id}>${id}`));
175
179
  })), feeds.map((feed) => {
176
180
  const above = feed.under === undefined ? undefined : feedById.get(feed.under);
177
181
  if (above === undefined)
@@ -182,9 +186,10 @@ export function StudioTreeMap({ workspace, agents }) {
182
186
  const d = feed.depth > above.depth
183
187
  ? linePath(from, { x: feedLeft(feed), y: feed.y })
184
188
  : sidePath({ x: feedRight(feed) + LINE_GAP, y: feed.y }, { x: feedRight(above) + LINE_GAP, y: above.y }, railFor(feed, above));
185
- return _jsx("path", { className: "map-line", d: d }, `${feed.id}^`);
189
+ // A turn in runs from the feed above; a line round the side runs from this one.
190
+ return (_jsx("path", { className: "map-line", d: d, pathLength: 1, "data-feed": "", style: feedStyle(order.get(feed.id) ?? 0, feed.depth > above.depth ? 1 : -1) }, `${feed.id}^`));
186
191
  })] }), rows.map((row) => {
187
192
  const draft = drafts.get(row.agent) ?? createBlankDraft();
188
193
  return (_jsx(MapToken, { id: rowId(row), label: row.node.label, icon: nodeIcon(draft, row.node.ref), x: row.x, y: row.y }, rowId(row)));
189
- }), feeds.map((feed) => (_jsx(MapToken, { id: feed.id, label: feed.label, icon: feed.icon, x: feedLeft(feed), y: feed.y }, feed.id)))] }));
194
+ }), feeds.map((feed) => (_jsx(MapToken, { id: feed.id, label: feed.label, icon: feed.icon, x: feedLeft(feed), y: feed.y, "data-feed": "", style: feedStyle(order.get(feed.id) ?? 0) }, feed.id)))] }));
190
195
  }