@artemis-studio/plugin-sdk 2026.9.48 → 2026.9.50
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/index.js +1 -0
- package/package.json +1 -1
- package/types/sdk/index.d.ts +1 -0
- package/types/ui/CodeEditor.d.ts +15 -6
- package/types/ui/DiagramView.d.ts +25 -0
- package/types/ui/VirtualTable.d.ts +6 -1
- package/types/ui/codeMirrorTheme.d.ts +4 -2
- package/types/ui/diagram.d.ts +31 -0
- package/types/ui/graph/elk.d.ts +3 -0
package/index.js
CHANGED
|
@@ -10,6 +10,7 @@ export const CONTRACT = outsideStudio('CONTRACT');
|
|
|
10
10
|
export const CapabilityGate = outsideStudio('CapabilityGate');
|
|
11
11
|
export const CodeEditor = outsideStudio('CodeEditor');
|
|
12
12
|
export const ConfirmByTyping = outsideStudio('ConfirmByTyping');
|
|
13
|
+
export const DiagramView = outsideStudio('DiagramView');
|
|
13
14
|
export const METRIC_RANGES = outsideStudio('METRIC_RANGES');
|
|
14
15
|
export const MetricChart = outsideStudio('MetricChart');
|
|
15
16
|
export const NAV_GROUPS = outsideStudio('NAV_GROUPS');
|
package/package.json
CHANGED
package/types/sdk/index.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export { gateFor, type GateVerdict } from '../ui/capabilityGate.ts';
|
|
|
20
20
|
export { useMe } from '../kernel/auth/api.ts';
|
|
21
21
|
export { CodeEditor, type CodeDiagnostic, type CodeEditorProps } from '../ui/CodeEditor.tsx';
|
|
22
22
|
export { ConfirmByTyping } from '../ui/ConfirmByTyping.tsx';
|
|
23
|
+
export { DiagramView, type DiagramEdge, type DiagramNode, type DiagramViewProps } from '../ui/DiagramView.tsx';
|
|
23
24
|
export { NodeOutcomeSummary, OutcomeSummary, type OutcomeRow } from '../ui/NodeOutcomeSummary.tsx';
|
|
24
25
|
export { Pager } from '../ui/Pager.tsx';
|
|
25
26
|
export { VirtualTable, type GridColumn } from '../ui/VirtualTable.tsx';
|
package/types/ui/CodeEditor.d.ts
CHANGED
|
@@ -10,12 +10,21 @@ export interface CodeEditorProps {
|
|
|
10
10
|
/** The visible label, which is also the editor's accessible name. */
|
|
11
11
|
label: string;
|
|
12
12
|
minHeight?: number;
|
|
13
|
+
/** Past this height the editor scrolls inside itself. */
|
|
14
|
+
maxHeight?: number;
|
|
15
|
+
/** Wrap long lines instead of scrolling them sideways. */
|
|
16
|
+
lineWrapping?: boolean;
|
|
13
17
|
}
|
|
14
18
|
/**
|
|
15
|
-
* A document editor for YAML or JSON: CodeMirror with line numbers
|
|
16
|
-
* gutter, coloured from `theme.css` like the
|
|
17
|
-
* itself. The caller passes the server's
|
|
18
|
-
* line and column and summarised in a
|
|
19
|
-
* that the document has problems without
|
|
19
|
+
* A document editor for YAML or JSON: CodeMirror with line numbers, folding, a
|
|
20
|
+
* lint gutter, bracket matching and search, coloured from `theme.css` like the
|
|
21
|
+
* SQL console. It validates nothing itself. The caller passes the server's
|
|
22
|
+
* diagnostics, which are marked at their line and column and summarised in a
|
|
23
|
+
* live region, so a screen reader hears that the document has problems without
|
|
24
|
+
* hunting for the marks.
|
|
25
|
+
*
|
|
26
|
+
* Tab indents, so an editable editor would otherwise trap the keyboard. Escape
|
|
27
|
+
* hands the next Tab back to the browser (CodeMirror's tab-focus mode), and the
|
|
28
|
+
* hint under the editor says so.
|
|
20
29
|
*/
|
|
21
|
-
export declare function CodeEditor({ value, onChange, language, diagnostics, readOnly, label, minHeight, }: CodeEditorProps): import("react").JSX.Element;
|
|
30
|
+
export declare function CodeEditor({ value, onChange, language, diagnostics, readOnly, label, minHeight, maxHeight, lineWrapping, }: CodeEditorProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type DiagramEdge, type DiagramNode } from './diagram.ts';
|
|
2
|
+
export type { DiagramEdge, DiagramNode };
|
|
3
|
+
export interface DiagramViewProps {
|
|
4
|
+
nodes: DiagramNode[];
|
|
5
|
+
edges: DiagramEdge[];
|
|
6
|
+
selectedId?: string | null;
|
|
7
|
+
onSelect?: (id: string) => void;
|
|
8
|
+
/** Which way the arrows run. Default: down. */
|
|
9
|
+
direction?: 'DOWN' | 'RIGHT';
|
|
10
|
+
/** The frame's height in pixels. Default 480. */
|
|
11
|
+
height?: number;
|
|
12
|
+
/** Names the diagram for screen readers. */
|
|
13
|
+
'aria-label': string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A read-only diagram of boxes and arrows, laid out automatically (ELK layered, in a worker) and
|
|
17
|
+
* drawn in Studio's theme (ADR-0117). Nothing is dragged, connected or deleted: it shows a
|
|
18
|
+
* structure and reports which box was chosen.
|
|
19
|
+
*
|
|
20
|
+
* <p>The diagram is one tab stop. Arrow keys move between boxes in reading order, Enter or Space
|
|
21
|
+
* selects one, and the selection is announced. A box with a problem says so in words, on the box
|
|
22
|
+
* and in its accessible name, so colour is never the only signal. Positions change only when the
|
|
23
|
+
* boxes or arrows do, never when a label does.
|
|
24
|
+
*/
|
|
25
|
+
export declare function DiagramView({ nodes, edges, selectedId, onSelect, direction, height, 'aria-label': ariaLabel, }: DiagramViewProps): import("react").JSX.Element;
|
|
@@ -58,6 +58,11 @@ interface VirtualTableProps<T> {
|
|
|
58
58
|
rowMenu?: RowMenu<T>;
|
|
59
59
|
/** Sized to its rows, up to a short cap, instead of to the viewport: a handful of rows in a pane. */
|
|
60
60
|
compact?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Remembers the column widths each viewer sets, in this browser (ADR-0116). Stable and unique
|
|
63
|
+
* per grid; a plugin prefixes its id. Without one, widths last as long as the grid is shown.
|
|
64
|
+
*/
|
|
65
|
+
storageKey?: string;
|
|
61
66
|
}
|
|
62
67
|
/**
|
|
63
68
|
* A virtualized data grid: one CSS grid track list, declared once and shared by
|
|
@@ -81,5 +86,5 @@ interface VirtualTableProps<T> {
|
|
|
81
86
|
* key, so a refresh or a re-sort does not move it to another row, and its row is
|
|
82
87
|
* always rendered however far it is scrolled.
|
|
83
88
|
*/
|
|
84
|
-
export declare function VirtualTable<T>({ columns, data, label, sort, onSortChange, onRowClick, rowKey, emptyLabel, rowClassName, selectable, selected, onToggleRow, onToggleAll, onAtTopChange, rowMenu, compact, }: VirtualTableProps<T>): import("react").JSX.Element;
|
|
89
|
+
export declare function VirtualTable<T>({ columns, data, label, sort, onSortChange, onRowClick, rowKey, emptyLabel, rowClassName, selectable, selected, onToggleRow, onToggleAll, onAtTopChange, rowMenu, compact, storageKey, }: VirtualTableProps<T>): import("react").JSX.Element;
|
|
85
90
|
export {};
|
|
@@ -2,8 +2,10 @@ import { HighlightStyle } from "@codemirror/language";
|
|
|
2
2
|
/**
|
|
3
3
|
* Every colour comes from `theme.css`, so the editor follows the colour scheme
|
|
4
4
|
* with the rest of the console and neither scheme is inferred from the other
|
|
5
|
-
* (non-negotiable #6).
|
|
6
|
-
*
|
|
5
|
+
* (non-negotiable #6). A SQL identifier deliberately stays body text, so the eye
|
|
6
|
+
* lands on what was typed rather than on the syntax. A YAML or JSON document is
|
|
7
|
+
* mostly keys and values, so those two carry colour, and the punctuation that
|
|
8
|
+
* holds them together steps back.
|
|
7
9
|
*/
|
|
8
10
|
export declare const codeHighlight: HighlightStyle;
|
|
9
11
|
export declare const codeTheme: import("@codemirror/state").Extension;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** The plain data `DiagramView` draws, and the words it reads out (ADR-0117). */
|
|
2
|
+
/** One box of a `DiagramView`. Everything is plain data, shown as text. */
|
|
3
|
+
export interface DiagramNode {
|
|
4
|
+
id: string;
|
|
5
|
+
/** The box's name, one line. */
|
|
6
|
+
label: string;
|
|
7
|
+
/** What kind of thing it is, in words ("Call a service"). Shown above the label. */
|
|
8
|
+
kind?: string;
|
|
9
|
+
/** A second line under the label ("inventory POST /reserve"). */
|
|
10
|
+
detail?: string;
|
|
11
|
+
/** Something is wrong with it: shown in words and colour, and read out with the node. */
|
|
12
|
+
state?: 'error' | 'warning';
|
|
13
|
+
/** Why, for a node with a state. */
|
|
14
|
+
reason?: string;
|
|
15
|
+
}
|
|
16
|
+
/** One arrow of a `DiagramView`, from `source` to `target`. */
|
|
17
|
+
export interface DiagramEdge {
|
|
18
|
+
id: string;
|
|
19
|
+
source: string;
|
|
20
|
+
target: string;
|
|
21
|
+
label?: string;
|
|
22
|
+
/** Drawn dashed: a secondary path. Its meaning belongs in its label. */
|
|
23
|
+
dashed?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/** What positions depend on: which nodes exist and how they connect. A new label moves nothing. */
|
|
26
|
+
export declare function layoutSignature(nodes: DiagramNode[], edges: DiagramEdge[], direction: string): string;
|
|
27
|
+
/**
|
|
28
|
+
* The accessible name of a node: kind, label and detail, the labels of the arrows into it (which a
|
|
29
|
+
* screen reader otherwise never meets), and any problem.
|
|
30
|
+
*/
|
|
31
|
+
export declare function nodeName(n: DiagramNode, via?: string[]): string;
|