@hlang-tech/editor-ui 0.4.0 → 0.5.0
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/README.md +10 -2
- package/lib/index.d.mts +90 -7
- package/lib/index.d.ts +90 -7
- package/lib/index.js +409 -336
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +393 -326
- package/lib/index.mjs.map +1 -1
- package/lib/panels/PanelHead.css +119 -0
- package/lib/panels/ParamForm.css +5 -0
- package/lib/panels/RunLog.css +3 -59
- package/lib/styles.css +2 -0
- package/lib/toolbar/ReadOnlyBadge.css +35 -0
- package/lib/toolbar/Toolbar.css +11 -0
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -52,9 +52,9 @@ See the [playground](https://github.com/hlang-tech/hlang/tree/main/examples/edit
|
|
|
52
52
|
| Area | Exports |
|
|
53
53
|
| --- | --- |
|
|
54
54
|
| Nodes and edges | `HlangNode`, `AssetNodeChrome`, `PillNodeChrome`, `NodeChrome`, `PortRow`, `SignalBar`, `NodeBodySlot`, `FlowEdge`, `createHlangFlowTypes` |
|
|
55
|
-
| Shell and toolbar | `EditorShell`, `Toolbar`, `UndoRedo`, `RunButton`, `ToolbarStat`, `ToolbarGhostButton`, `ToolCluster` |
|
|
55
|
+
| Shell and toolbar | `EditorShell`, `Toolbar`, `UndoRedo`, `RunButton`, `ToolbarStat`, `ToolbarGhostButton`, `ToolCluster`, `ReadOnlyBadge` |
|
|
56
56
|
| Canvas | `CanvasChrome`, `CanvasDock`, `EmptyState` |
|
|
57
|
-
| Panels | `OutlineTree`, `RailTabs`, `AssetGrid`, `InspectorPanel`, `ParamForm`, `PositionPanel`, `PreviewPanel`, `DiagnosticBadge` |
|
|
57
|
+
| Panels | `OutlineTree`, `RailTabs`, `AssetGrid`, `InspectorPanel`, `ParamForm`, `PositionPanel`, `PreviewPanel`, `DiagnosticBadge`, `RunLog`, `PanelHead`, `PanelAction` |
|
|
58
58
|
| Creating nodes | `NodeSearch`, `useNodeSearch`, `useNodeSearchTriggers` (double-click the canvas, or drop a connection on empty space) |
|
|
59
59
|
| Interaction | `useEditorHotkeys`, `NodeContextMenu`, `useNodeContextMenu`, `NodeInteractionProvider`, `Cheatsheet`, `ToastProvider` |
|
|
60
60
|
| Live execution | `LiveSignalProvider`, `LiveSignalStore`, `useLiveSignals`, `useNodeLiveState`, `useEdgeFlowing` |
|
|
@@ -64,6 +64,14 @@ See the [playground](https://github.com/hlang-tech/hlang/tree/main/examples/edit
|
|
|
64
64
|
|
|
65
65
|
`useEditorHotkeys(core)` binds undo (`⌘Z`), redo (`⇧⌘Z` or `⌘Y`), copy, cut, paste, duplicate (`⌘D`), select all (`⌘A`), and delete (`Delete` or `Backspace`). `Ctrl` replaces `⌘` on Windows and Linux. Shortcuts are ignored while a text field has focus.
|
|
66
66
|
|
|
67
|
+
### Read-only editors
|
|
68
|
+
|
|
69
|
+
When the core is read-only (`core.mode`), the inspector, the connection inspector and the position panel disable their fields, and the node-search triggers open nothing. Pass `readOnly` to `CanvasDock` to keep only its view controls, and leave `rename` out of `NodeInteraction` so a node's name cannot be edited in place. `ReadOnlyBadge` says so in the toolbar.
|
|
70
|
+
|
|
71
|
+
### Panel headers
|
|
72
|
+
|
|
73
|
+
`PanelHead` and `PanelAction` respond to the header's own width, not the window's: a narrow header shows its actions as icons (the labels stay their accessible names and tooltips) and then drops its status.
|
|
74
|
+
|
|
67
75
|
### Live execution
|
|
68
76
|
|
|
69
77
|
`useLiveSignals(core, handle)` feeds a run's activity and errors into a `LiveSignalStore`. Nodes and edges subscribe by id, so only the elements whose state changes re-render.
|
package/lib/index.d.mts
CHANGED
|
@@ -396,6 +396,21 @@ declare function ToolbarGhostButton({ children, onClick, title, }: {
|
|
|
396
396
|
readonly title?: string;
|
|
397
397
|
}): ReactElement;
|
|
398
398
|
|
|
399
|
+
/**
|
|
400
|
+
* `ReadOnlyBadge` — says, in the toolbar, that the graph can be looked at
|
|
401
|
+
* and run but not changed (the editor core is read-only; see editor-core's
|
|
402
|
+
* `IEditorModeService`). The host says why in `title`. In a narrow toolbar it
|
|
403
|
+
* keeps only its lock; the label stays its accessible name.
|
|
404
|
+
*/
|
|
405
|
+
|
|
406
|
+
interface ReadOnlyBadgeProps {
|
|
407
|
+
/** The badge's text. */
|
|
408
|
+
readonly label?: string;
|
|
409
|
+
/** Why the editor is read-only, shown as its tooltip. */
|
|
410
|
+
readonly title?: string;
|
|
411
|
+
}
|
|
412
|
+
declare function ReadOnlyBadge({ label, title }: ReadOnlyBadgeProps): ReactElement;
|
|
413
|
+
|
|
399
414
|
/**
|
|
400
415
|
* `ToolCluster` — the centred group of canvas tools in the top bar (nover-style):
|
|
401
416
|
* a row of icon buttons with optional separators, in the black/silver glass
|
|
@@ -438,6 +453,10 @@ declare function CanvasChrome({ background }: CanvasChromeProps): ReactElement;
|
|
|
438
453
|
* glass language. It replaces React Flow's default corner Controls + MiniMap
|
|
439
454
|
* with one calm, centred dock.
|
|
440
455
|
*
|
|
456
|
+
* A read-only dock (`readOnly`) keeps only the view controls (zoom, fit):
|
|
457
|
+
* undo, redo, the pointer modes and add-node all change the graph or exist
|
|
458
|
+
* to edit it.
|
|
459
|
+
*
|
|
441
460
|
* Presentation only: it renders buttons and the current zoom %, and calls back
|
|
442
461
|
* to the host for every action. It holds no React Flow or graph state — the host
|
|
443
462
|
* wires the callbacks to `useReactFlow()` (zoom/fit) and the node search (add).
|
|
@@ -461,8 +480,10 @@ interface CanvasDockProps {
|
|
|
461
480
|
readonly onRedo: () => void;
|
|
462
481
|
readonly canUndo: boolean;
|
|
463
482
|
readonly canRedo: boolean;
|
|
483
|
+
/** Show the view controls only: the graph cannot be edited. */
|
|
484
|
+
readonly readOnly?: boolean;
|
|
464
485
|
}
|
|
465
|
-
declare function CanvasDock({ zoom, onZoomIn, onZoomOut, onFitView, onAdd, mode, onModeChange, onUndo, onRedo, canUndo, canRedo, }: CanvasDockProps): ReactElement;
|
|
486
|
+
declare function CanvasDock({ zoom, onZoomIn, onZoomOut, onFitView, onAdd, mode, onModeChange, onUndo, onRedo, canUndo, canRedo, readOnly, }: CanvasDockProps): ReactElement;
|
|
466
487
|
|
|
467
488
|
/**
|
|
468
489
|
* `EmptyState` — a quiet, centered hint shown over an empty canvas. Purely
|
|
@@ -529,6 +550,59 @@ interface PreviewPanelProps {
|
|
|
529
550
|
}
|
|
530
551
|
declare function PreviewPanel({ imageUrl, title, status }: PreviewPanelProps): ReactElement;
|
|
531
552
|
|
|
553
|
+
/**
|
|
554
|
+
* `PanelHead` and `PanelAction` — the header row of a docked panel (the
|
|
555
|
+
* console, the run log): what the panel is, a short status, and its actions.
|
|
556
|
+
*
|
|
557
|
+
* The header responds to its own width, not the window's (a container query,
|
|
558
|
+
* as VS Code's and DevTools' panel toolbars do): when it is narrow the actions
|
|
559
|
+
* drop their labels and keep their icons, and then the status gives way. A
|
|
560
|
+
* label that is not shown is still the button's accessible name, and its
|
|
561
|
+
* tooltip.
|
|
562
|
+
*/
|
|
563
|
+
|
|
564
|
+
interface PanelHeadProps {
|
|
565
|
+
/** What the panel is: its title, or the host's tabs. */
|
|
566
|
+
readonly leading: ReactNode;
|
|
567
|
+
/** A short status after it, e.g. a count; the first thing to go when the panel is narrow. */
|
|
568
|
+
readonly meta?: ReactNode;
|
|
569
|
+
/** The panel's actions, usually `PanelAction`s. */
|
|
570
|
+
readonly children?: ReactNode;
|
|
571
|
+
}
|
|
572
|
+
declare function PanelHead({ leading, meta, children }: PanelHeadProps): ReactElement;
|
|
573
|
+
interface PanelActionProps {
|
|
574
|
+
readonly icon: ReactNode;
|
|
575
|
+
/** The action's name: shown when there is room, and always its accessible name. */
|
|
576
|
+
readonly label: string;
|
|
577
|
+
readonly onClick: () => void;
|
|
578
|
+
/** For a toggle: whether it is on. Leave out for a plain action. */
|
|
579
|
+
readonly pressed?: boolean;
|
|
580
|
+
readonly disabled?: boolean;
|
|
581
|
+
/** The tooltip; the label by default. */
|
|
582
|
+
readonly title?: string;
|
|
583
|
+
}
|
|
584
|
+
declare function PanelAction({ icon, label, onClick, pressed, disabled, title }: PanelActionProps): ReactElement;
|
|
585
|
+
|
|
586
|
+
/**
|
|
587
|
+
* Per-type node icons. A small registry mapping a node `code` to a crisp
|
|
588
|
+
* line-glyph (1.5px stroke, currentColor), with a kind fallback (R/T/W). Used
|
|
589
|
+
* by the outline tree and the node chrome so every node reads by its ROLE, not
|
|
590
|
+
* a generic letter — the difference between a tool and a spreadsheet.
|
|
591
|
+
*
|
|
592
|
+
* Icons are inline SVG (not emoji) for a premium, monochrome, scalable look;
|
|
593
|
+
* they inherit `color` so callers tint them by kind or silver.
|
|
594
|
+
*/
|
|
595
|
+
|
|
596
|
+
interface IconProps {
|
|
597
|
+
readonly size?: number;
|
|
598
|
+
}
|
|
599
|
+
/** Funnel — show only what involves the selection. */
|
|
600
|
+
declare function FilterIcon({ size }: IconProps): ReactElement;
|
|
601
|
+
/** Arrow onto a line — keep the newest entry in view. */
|
|
602
|
+
declare function FollowIcon({ size }: IconProps): ReactElement;
|
|
603
|
+
/** Circle with a stroke through it — clear the log (DevTools' glyph). */
|
|
604
|
+
declare function ClearIcon({ size }: IconProps): ReactElement;
|
|
605
|
+
|
|
532
606
|
/**
|
|
533
607
|
* `RailTabs` — the segmented tab strip at the top of a side rail (Outline /
|
|
534
608
|
* Insert / Assets, nover-style), in the black/silver glass language. Purely
|
|
@@ -659,8 +733,10 @@ interface ParamFormProps {
|
|
|
659
733
|
readonly fields: readonly ParamField[];
|
|
660
734
|
/** Commit a single field's new value (undoable, handled by the caller). */
|
|
661
735
|
readonly onCommit: (key: string, value: ParamValue) => void;
|
|
736
|
+
/** Disables every field, e.g. in a read-only editor. */
|
|
737
|
+
readonly disabled?: boolean;
|
|
662
738
|
}
|
|
663
|
-
declare function ParamForm({ fields, onCommit }: ParamFormProps): ReactElement;
|
|
739
|
+
declare function ParamForm({ fields, onCommit, disabled }: ParamFormProps): ReactElement;
|
|
664
740
|
|
|
665
741
|
/**
|
|
666
742
|
* `useNodeParams` — reactively read a node's params and commit edits through the
|
|
@@ -845,6 +921,9 @@ declare function NodeSearch({ controller }: NodeSearchProps): ReactElement | nul
|
|
|
845
921
|
* only for the pane, never for nodes/edges/handles) rather than a raw DOM
|
|
846
922
|
* double-click, so this never reaches into React Flow's internal markup.
|
|
847
923
|
*
|
|
924
|
+
* A read-only editor (`core.mode.readOnly`) opens nothing: the palette only
|
|
925
|
+
* adds nodes, which a read-only graph refuses.
|
|
926
|
+
*
|
|
848
927
|
* Screen→flow coordinate conversion uses the React Flow instance, so created
|
|
849
928
|
* nodes land under the pointer regardless of pan/zoom. This hook must be used
|
|
850
929
|
* within a `ReactFlowProvider` (React Flow's own requirement for `useReactFlow`).
|
|
@@ -966,15 +1045,19 @@ declare function NodeContextMenu({ controller, items }: NodeContextMenuProps): R
|
|
|
966
1045
|
* `NodeInteractionContext` — optional per-node interaction wiring supplied by the
|
|
967
1046
|
* host (diagnostics to badge, rename to commit). Node chrome reads it to render a
|
|
968
1047
|
* diagnostic badge and to support inline rename, but degrades gracefully to a
|
|
969
|
-
* plain
|
|
1048
|
+
* plain node that cannot be renamed when no provider is present, or when the
|
|
1049
|
+
* host leaves `rename` out (a read-only editor) — so editor-ui stays usable
|
|
970
1050
|
* without the full editor wiring.
|
|
971
1051
|
*/
|
|
972
1052
|
|
|
973
1053
|
interface NodeInteraction {
|
|
974
1054
|
/** The most severe diagnostic on a node, or undefined. */
|
|
975
1055
|
diagnosticFor(id: NodeId): Diagnostic | undefined;
|
|
976
|
-
/**
|
|
977
|
-
|
|
1056
|
+
/**
|
|
1057
|
+
* Commit a rename (host routes it through the command service). Without it,
|
|
1058
|
+
* a node's name cannot be edited in place.
|
|
1059
|
+
*/
|
|
1060
|
+
readonly rename?: (id: NodeId, name: string) => void;
|
|
978
1061
|
}
|
|
979
1062
|
interface NodeInteractionProviderProps {
|
|
980
1063
|
readonly value: NodeInteraction;
|
|
@@ -1462,5 +1545,5 @@ declare function LivePulse({ nodeId }: {
|
|
|
1462
1545
|
readonly nodeId: string;
|
|
1463
1546
|
}): ReactElement | null;
|
|
1464
1547
|
|
|
1465
|
-
export { AssetGrid, AssetNodeChrome, CanvasChrome, CanvasDock, Cheatsheet, ConnectionInspector, DEFAULT_EDGE_CAPACITY, DEFAULT_MIN_CANVAS_HEIGHT, DiagnosticBadge, EditorShell, EditorUIThemeProvider, EmptyState, FOLLOW_SLACK_PX, FOOTER_KEY_STEP, FlowEdge, FooterResizer, HlangNode, InspectorPanel, KIND_ROLE, KIND_TOKEN, LivePulse, LiveSignalProvider, LiveSignalStore, NodeBodySlot, NodeChrome, NodeContextMenu, NodeInteractionProvider, NodeRunStats, NodeSearch, OutlineTree, PREVIEW_LENGTH, ParamForm, PillNodeChrome, PortRow, PositionPanel, PreviewPanel, RUN_LOG_CAPACITY, RailTabs, RunButton, RunLog, RunTrace, RunTraceProvider, SELF_LOOP_CLEARANCE, SELF_LOOP_RADIUS, SignalBar, TOKEN_NAMES, ToastProvider, ToolCluster, Toolbar, ToolbarGhostButton, ToolbarStat, UndoRedo, boundsFields, capacityLabel, clampFooter, connectableCandidates, createHlangFlowTypes, createTheme, defaultLiveDeps, deriveParamSchema, descriptorCandidates, footerBounds, formatDuration, formatElapsed, fuzzyRank, fuzzyScore, involves, isEditableTarget, nextBounds, previewValue, resizeByKey, searchNodes, selfLoopPath, toggleCollapsed, tokenVar, useEdgeBounds, useEdgeFlowing, useEdgePulse, useEditorHotkeys, useFollowScroll, useFooterResize, useLiveSignalStore, useLiveSignals, useNodeContextMenu, useNodeInteraction, useNodeLiveState, useNodeParams, useNodePulse, useNodeSearch, useNodeSearchTriggers, useRunTrace, useRunTraceStore, useRunTraceVersion, useToast };
|
|
1466
|
-
export type { AssetGridProps, AssetItem, AssetNodeChromeProps, CanvasChromeProps, CanvasDockProps, CanvasMode, CheatsheetProps, ConnectableResult, ConnectionEnd, ContextMenuItem, DeliverySignal, DiagnosticBadgeProps, EdgeBoundsHandle, EdgeIndexEntry, EditorHotkeysOptions, EditorShellProps, EditorUIThemeProviderProps, EmptyStateProps, FollowScroll, FooterBounds, FooterResize, FooterResizeOptions, FooterResizerProps, FooterSize, FuzzyCandidate, FuzzyMatch, FuzzyResult, HlangFlowTypes, InspectorPanelProps, LiveSignalProviderProps, LiveSignalStoreDeps, NodeBodySlotProps, NodeCandidate, NodeChromeProps, NodeContextMenuController, NodeContextMenuProps, NodeContextMenuState, NodeInteraction, NodeInteractionProviderProps, NodeLiveState, NodeParamsHandle, NodeRunSummary, NodeSearchController, NodeSearchProps, NodeSearchResult, NodeSearchResultView, NodeSearchState, NodeSearchTriggerOptions, NodeSearchTriggers, OutlineTreeProps, ParamField, ParamFieldBase, ParamFormProps, PendingConnection, PillNodeChromeProps, PointerPosition, PortRowProps, PositionPanelProps, PreviewPanelProps, RailTab, RailTabsProps, RunButtonProps, RunDeliveryEntry, RunErrorEntry, RunLogEntry, RunLogProps, RunTraceOptions, RunTraceProviderProps, SelfLoop, SelfLoopInput, ShortcutGroup, ShortcutRow, ThemeOverride, ToastApi, ToastProviderProps, TokenName, ToolClusterProps, ToolItem, ToolbarProps, TouchPositions, UndoRedoProps };
|
|
1548
|
+
export { AssetGrid, AssetNodeChrome, CanvasChrome, CanvasDock, Cheatsheet, ClearIcon, ConnectionInspector, DEFAULT_EDGE_CAPACITY, DEFAULT_MIN_CANVAS_HEIGHT, DiagnosticBadge, EditorShell, EditorUIThemeProvider, EmptyState, FOLLOW_SLACK_PX, FOOTER_KEY_STEP, FilterIcon, FlowEdge, FollowIcon, FooterResizer, HlangNode, InspectorPanel, KIND_ROLE, KIND_TOKEN, LivePulse, LiveSignalProvider, LiveSignalStore, NodeBodySlot, NodeChrome, NodeContextMenu, NodeInteractionProvider, NodeRunStats, NodeSearch, OutlineTree, PREVIEW_LENGTH, PanelAction, PanelHead, ParamForm, PillNodeChrome, PortRow, PositionPanel, PreviewPanel, RUN_LOG_CAPACITY, RailTabs, ReadOnlyBadge, RunButton, RunLog, RunTrace, RunTraceProvider, SELF_LOOP_CLEARANCE, SELF_LOOP_RADIUS, SignalBar, TOKEN_NAMES, ToastProvider, ToolCluster, Toolbar, ToolbarGhostButton, ToolbarStat, UndoRedo, boundsFields, capacityLabel, clampFooter, connectableCandidates, createHlangFlowTypes, createTheme, defaultLiveDeps, deriveParamSchema, descriptorCandidates, footerBounds, formatDuration, formatElapsed, fuzzyRank, fuzzyScore, involves, isEditableTarget, nextBounds, previewValue, resizeByKey, searchNodes, selfLoopPath, toggleCollapsed, tokenVar, useEdgeBounds, useEdgeFlowing, useEdgePulse, useEditorHotkeys, useFollowScroll, useFooterResize, useLiveSignalStore, useLiveSignals, useNodeContextMenu, useNodeInteraction, useNodeLiveState, useNodeParams, useNodePulse, useNodeSearch, useNodeSearchTriggers, useRunTrace, useRunTraceStore, useRunTraceVersion, useToast };
|
|
1549
|
+
export type { AssetGridProps, AssetItem, AssetNodeChromeProps, CanvasChromeProps, CanvasDockProps, CanvasMode, CheatsheetProps, ConnectableResult, ConnectionEnd, ContextMenuItem, DeliverySignal, DiagnosticBadgeProps, EdgeBoundsHandle, EdgeIndexEntry, EditorHotkeysOptions, EditorShellProps, EditorUIThemeProviderProps, EmptyStateProps, FollowScroll, FooterBounds, FooterResize, FooterResizeOptions, FooterResizerProps, FooterSize, FuzzyCandidate, FuzzyMatch, FuzzyResult, HlangFlowTypes, InspectorPanelProps, LiveSignalProviderProps, LiveSignalStoreDeps, NodeBodySlotProps, NodeCandidate, NodeChromeProps, NodeContextMenuController, NodeContextMenuProps, NodeContextMenuState, NodeInteraction, NodeInteractionProviderProps, NodeLiveState, NodeParamsHandle, NodeRunSummary, NodeSearchController, NodeSearchProps, NodeSearchResult, NodeSearchResultView, NodeSearchState, NodeSearchTriggerOptions, NodeSearchTriggers, OutlineTreeProps, PanelActionProps, PanelHeadProps, ParamField, ParamFieldBase, ParamFormProps, PendingConnection, PillNodeChromeProps, PointerPosition, PortRowProps, PositionPanelProps, PreviewPanelProps, RailTab, RailTabsProps, ReadOnlyBadgeProps, RunButtonProps, RunDeliveryEntry, RunErrorEntry, RunLogEntry, RunLogProps, RunTraceOptions, RunTraceProviderProps, SelfLoop, SelfLoopInput, ShortcutGroup, ShortcutRow, ThemeOverride, ToastApi, ToastProviderProps, TokenName, ToolClusterProps, ToolItem, ToolbarProps, TouchPositions, UndoRedoProps };
|
package/lib/index.d.ts
CHANGED
|
@@ -396,6 +396,21 @@ declare function ToolbarGhostButton({ children, onClick, title, }: {
|
|
|
396
396
|
readonly title?: string;
|
|
397
397
|
}): ReactElement;
|
|
398
398
|
|
|
399
|
+
/**
|
|
400
|
+
* `ReadOnlyBadge` — says, in the toolbar, that the graph can be looked at
|
|
401
|
+
* and run but not changed (the editor core is read-only; see editor-core's
|
|
402
|
+
* `IEditorModeService`). The host says why in `title`. In a narrow toolbar it
|
|
403
|
+
* keeps only its lock; the label stays its accessible name.
|
|
404
|
+
*/
|
|
405
|
+
|
|
406
|
+
interface ReadOnlyBadgeProps {
|
|
407
|
+
/** The badge's text. */
|
|
408
|
+
readonly label?: string;
|
|
409
|
+
/** Why the editor is read-only, shown as its tooltip. */
|
|
410
|
+
readonly title?: string;
|
|
411
|
+
}
|
|
412
|
+
declare function ReadOnlyBadge({ label, title }: ReadOnlyBadgeProps): ReactElement;
|
|
413
|
+
|
|
399
414
|
/**
|
|
400
415
|
* `ToolCluster` — the centred group of canvas tools in the top bar (nover-style):
|
|
401
416
|
* a row of icon buttons with optional separators, in the black/silver glass
|
|
@@ -438,6 +453,10 @@ declare function CanvasChrome({ background }: CanvasChromeProps): ReactElement;
|
|
|
438
453
|
* glass language. It replaces React Flow's default corner Controls + MiniMap
|
|
439
454
|
* with one calm, centred dock.
|
|
440
455
|
*
|
|
456
|
+
* A read-only dock (`readOnly`) keeps only the view controls (zoom, fit):
|
|
457
|
+
* undo, redo, the pointer modes and add-node all change the graph or exist
|
|
458
|
+
* to edit it.
|
|
459
|
+
*
|
|
441
460
|
* Presentation only: it renders buttons and the current zoom %, and calls back
|
|
442
461
|
* to the host for every action. It holds no React Flow or graph state — the host
|
|
443
462
|
* wires the callbacks to `useReactFlow()` (zoom/fit) and the node search (add).
|
|
@@ -461,8 +480,10 @@ interface CanvasDockProps {
|
|
|
461
480
|
readonly onRedo: () => void;
|
|
462
481
|
readonly canUndo: boolean;
|
|
463
482
|
readonly canRedo: boolean;
|
|
483
|
+
/** Show the view controls only: the graph cannot be edited. */
|
|
484
|
+
readonly readOnly?: boolean;
|
|
464
485
|
}
|
|
465
|
-
declare function CanvasDock({ zoom, onZoomIn, onZoomOut, onFitView, onAdd, mode, onModeChange, onUndo, onRedo, canUndo, canRedo, }: CanvasDockProps): ReactElement;
|
|
486
|
+
declare function CanvasDock({ zoom, onZoomIn, onZoomOut, onFitView, onAdd, mode, onModeChange, onUndo, onRedo, canUndo, canRedo, readOnly, }: CanvasDockProps): ReactElement;
|
|
466
487
|
|
|
467
488
|
/**
|
|
468
489
|
* `EmptyState` — a quiet, centered hint shown over an empty canvas. Purely
|
|
@@ -529,6 +550,59 @@ interface PreviewPanelProps {
|
|
|
529
550
|
}
|
|
530
551
|
declare function PreviewPanel({ imageUrl, title, status }: PreviewPanelProps): ReactElement;
|
|
531
552
|
|
|
553
|
+
/**
|
|
554
|
+
* `PanelHead` and `PanelAction` — the header row of a docked panel (the
|
|
555
|
+
* console, the run log): what the panel is, a short status, and its actions.
|
|
556
|
+
*
|
|
557
|
+
* The header responds to its own width, not the window's (a container query,
|
|
558
|
+
* as VS Code's and DevTools' panel toolbars do): when it is narrow the actions
|
|
559
|
+
* drop their labels and keep their icons, and then the status gives way. A
|
|
560
|
+
* label that is not shown is still the button's accessible name, and its
|
|
561
|
+
* tooltip.
|
|
562
|
+
*/
|
|
563
|
+
|
|
564
|
+
interface PanelHeadProps {
|
|
565
|
+
/** What the panel is: its title, or the host's tabs. */
|
|
566
|
+
readonly leading: ReactNode;
|
|
567
|
+
/** A short status after it, e.g. a count; the first thing to go when the panel is narrow. */
|
|
568
|
+
readonly meta?: ReactNode;
|
|
569
|
+
/** The panel's actions, usually `PanelAction`s. */
|
|
570
|
+
readonly children?: ReactNode;
|
|
571
|
+
}
|
|
572
|
+
declare function PanelHead({ leading, meta, children }: PanelHeadProps): ReactElement;
|
|
573
|
+
interface PanelActionProps {
|
|
574
|
+
readonly icon: ReactNode;
|
|
575
|
+
/** The action's name: shown when there is room, and always its accessible name. */
|
|
576
|
+
readonly label: string;
|
|
577
|
+
readonly onClick: () => void;
|
|
578
|
+
/** For a toggle: whether it is on. Leave out for a plain action. */
|
|
579
|
+
readonly pressed?: boolean;
|
|
580
|
+
readonly disabled?: boolean;
|
|
581
|
+
/** The tooltip; the label by default. */
|
|
582
|
+
readonly title?: string;
|
|
583
|
+
}
|
|
584
|
+
declare function PanelAction({ icon, label, onClick, pressed, disabled, title }: PanelActionProps): ReactElement;
|
|
585
|
+
|
|
586
|
+
/**
|
|
587
|
+
* Per-type node icons. A small registry mapping a node `code` to a crisp
|
|
588
|
+
* line-glyph (1.5px stroke, currentColor), with a kind fallback (R/T/W). Used
|
|
589
|
+
* by the outline tree and the node chrome so every node reads by its ROLE, not
|
|
590
|
+
* a generic letter — the difference between a tool and a spreadsheet.
|
|
591
|
+
*
|
|
592
|
+
* Icons are inline SVG (not emoji) for a premium, monochrome, scalable look;
|
|
593
|
+
* they inherit `color` so callers tint them by kind or silver.
|
|
594
|
+
*/
|
|
595
|
+
|
|
596
|
+
interface IconProps {
|
|
597
|
+
readonly size?: number;
|
|
598
|
+
}
|
|
599
|
+
/** Funnel — show only what involves the selection. */
|
|
600
|
+
declare function FilterIcon({ size }: IconProps): ReactElement;
|
|
601
|
+
/** Arrow onto a line — keep the newest entry in view. */
|
|
602
|
+
declare function FollowIcon({ size }: IconProps): ReactElement;
|
|
603
|
+
/** Circle with a stroke through it — clear the log (DevTools' glyph). */
|
|
604
|
+
declare function ClearIcon({ size }: IconProps): ReactElement;
|
|
605
|
+
|
|
532
606
|
/**
|
|
533
607
|
* `RailTabs` — the segmented tab strip at the top of a side rail (Outline /
|
|
534
608
|
* Insert / Assets, nover-style), in the black/silver glass language. Purely
|
|
@@ -659,8 +733,10 @@ interface ParamFormProps {
|
|
|
659
733
|
readonly fields: readonly ParamField[];
|
|
660
734
|
/** Commit a single field's new value (undoable, handled by the caller). */
|
|
661
735
|
readonly onCommit: (key: string, value: ParamValue) => void;
|
|
736
|
+
/** Disables every field, e.g. in a read-only editor. */
|
|
737
|
+
readonly disabled?: boolean;
|
|
662
738
|
}
|
|
663
|
-
declare function ParamForm({ fields, onCommit }: ParamFormProps): ReactElement;
|
|
739
|
+
declare function ParamForm({ fields, onCommit, disabled }: ParamFormProps): ReactElement;
|
|
664
740
|
|
|
665
741
|
/**
|
|
666
742
|
* `useNodeParams` — reactively read a node's params and commit edits through the
|
|
@@ -845,6 +921,9 @@ declare function NodeSearch({ controller }: NodeSearchProps): ReactElement | nul
|
|
|
845
921
|
* only for the pane, never for nodes/edges/handles) rather than a raw DOM
|
|
846
922
|
* double-click, so this never reaches into React Flow's internal markup.
|
|
847
923
|
*
|
|
924
|
+
* A read-only editor (`core.mode.readOnly`) opens nothing: the palette only
|
|
925
|
+
* adds nodes, which a read-only graph refuses.
|
|
926
|
+
*
|
|
848
927
|
* Screen→flow coordinate conversion uses the React Flow instance, so created
|
|
849
928
|
* nodes land under the pointer regardless of pan/zoom. This hook must be used
|
|
850
929
|
* within a `ReactFlowProvider` (React Flow's own requirement for `useReactFlow`).
|
|
@@ -966,15 +1045,19 @@ declare function NodeContextMenu({ controller, items }: NodeContextMenuProps): R
|
|
|
966
1045
|
* `NodeInteractionContext` — optional per-node interaction wiring supplied by the
|
|
967
1046
|
* host (diagnostics to badge, rename to commit). Node chrome reads it to render a
|
|
968
1047
|
* diagnostic badge and to support inline rename, but degrades gracefully to a
|
|
969
|
-
* plain
|
|
1048
|
+
* plain node that cannot be renamed when no provider is present, or when the
|
|
1049
|
+
* host leaves `rename` out (a read-only editor) — so editor-ui stays usable
|
|
970
1050
|
* without the full editor wiring.
|
|
971
1051
|
*/
|
|
972
1052
|
|
|
973
1053
|
interface NodeInteraction {
|
|
974
1054
|
/** The most severe diagnostic on a node, or undefined. */
|
|
975
1055
|
diagnosticFor(id: NodeId): Diagnostic | undefined;
|
|
976
|
-
/**
|
|
977
|
-
|
|
1056
|
+
/**
|
|
1057
|
+
* Commit a rename (host routes it through the command service). Without it,
|
|
1058
|
+
* a node's name cannot be edited in place.
|
|
1059
|
+
*/
|
|
1060
|
+
readonly rename?: (id: NodeId, name: string) => void;
|
|
978
1061
|
}
|
|
979
1062
|
interface NodeInteractionProviderProps {
|
|
980
1063
|
readonly value: NodeInteraction;
|
|
@@ -1462,5 +1545,5 @@ declare function LivePulse({ nodeId }: {
|
|
|
1462
1545
|
readonly nodeId: string;
|
|
1463
1546
|
}): ReactElement | null;
|
|
1464
1547
|
|
|
1465
|
-
export { AssetGrid, AssetNodeChrome, CanvasChrome, CanvasDock, Cheatsheet, ConnectionInspector, DEFAULT_EDGE_CAPACITY, DEFAULT_MIN_CANVAS_HEIGHT, DiagnosticBadge, EditorShell, EditorUIThemeProvider, EmptyState, FOLLOW_SLACK_PX, FOOTER_KEY_STEP, FlowEdge, FooterResizer, HlangNode, InspectorPanel, KIND_ROLE, KIND_TOKEN, LivePulse, LiveSignalProvider, LiveSignalStore, NodeBodySlot, NodeChrome, NodeContextMenu, NodeInteractionProvider, NodeRunStats, NodeSearch, OutlineTree, PREVIEW_LENGTH, ParamForm, PillNodeChrome, PortRow, PositionPanel, PreviewPanel, RUN_LOG_CAPACITY, RailTabs, RunButton, RunLog, RunTrace, RunTraceProvider, SELF_LOOP_CLEARANCE, SELF_LOOP_RADIUS, SignalBar, TOKEN_NAMES, ToastProvider, ToolCluster, Toolbar, ToolbarGhostButton, ToolbarStat, UndoRedo, boundsFields, capacityLabel, clampFooter, connectableCandidates, createHlangFlowTypes, createTheme, defaultLiveDeps, deriveParamSchema, descriptorCandidates, footerBounds, formatDuration, formatElapsed, fuzzyRank, fuzzyScore, involves, isEditableTarget, nextBounds, previewValue, resizeByKey, searchNodes, selfLoopPath, toggleCollapsed, tokenVar, useEdgeBounds, useEdgeFlowing, useEdgePulse, useEditorHotkeys, useFollowScroll, useFooterResize, useLiveSignalStore, useLiveSignals, useNodeContextMenu, useNodeInteraction, useNodeLiveState, useNodeParams, useNodePulse, useNodeSearch, useNodeSearchTriggers, useRunTrace, useRunTraceStore, useRunTraceVersion, useToast };
|
|
1466
|
-
export type { AssetGridProps, AssetItem, AssetNodeChromeProps, CanvasChromeProps, CanvasDockProps, CanvasMode, CheatsheetProps, ConnectableResult, ConnectionEnd, ContextMenuItem, DeliverySignal, DiagnosticBadgeProps, EdgeBoundsHandle, EdgeIndexEntry, EditorHotkeysOptions, EditorShellProps, EditorUIThemeProviderProps, EmptyStateProps, FollowScroll, FooterBounds, FooterResize, FooterResizeOptions, FooterResizerProps, FooterSize, FuzzyCandidate, FuzzyMatch, FuzzyResult, HlangFlowTypes, InspectorPanelProps, LiveSignalProviderProps, LiveSignalStoreDeps, NodeBodySlotProps, NodeCandidate, NodeChromeProps, NodeContextMenuController, NodeContextMenuProps, NodeContextMenuState, NodeInteraction, NodeInteractionProviderProps, NodeLiveState, NodeParamsHandle, NodeRunSummary, NodeSearchController, NodeSearchProps, NodeSearchResult, NodeSearchResultView, NodeSearchState, NodeSearchTriggerOptions, NodeSearchTriggers, OutlineTreeProps, ParamField, ParamFieldBase, ParamFormProps, PendingConnection, PillNodeChromeProps, PointerPosition, PortRowProps, PositionPanelProps, PreviewPanelProps, RailTab, RailTabsProps, RunButtonProps, RunDeliveryEntry, RunErrorEntry, RunLogEntry, RunLogProps, RunTraceOptions, RunTraceProviderProps, SelfLoop, SelfLoopInput, ShortcutGroup, ShortcutRow, ThemeOverride, ToastApi, ToastProviderProps, TokenName, ToolClusterProps, ToolItem, ToolbarProps, TouchPositions, UndoRedoProps };
|
|
1548
|
+
export { AssetGrid, AssetNodeChrome, CanvasChrome, CanvasDock, Cheatsheet, ClearIcon, ConnectionInspector, DEFAULT_EDGE_CAPACITY, DEFAULT_MIN_CANVAS_HEIGHT, DiagnosticBadge, EditorShell, EditorUIThemeProvider, EmptyState, FOLLOW_SLACK_PX, FOOTER_KEY_STEP, FilterIcon, FlowEdge, FollowIcon, FooterResizer, HlangNode, InspectorPanel, KIND_ROLE, KIND_TOKEN, LivePulse, LiveSignalProvider, LiveSignalStore, NodeBodySlot, NodeChrome, NodeContextMenu, NodeInteractionProvider, NodeRunStats, NodeSearch, OutlineTree, PREVIEW_LENGTH, PanelAction, PanelHead, ParamForm, PillNodeChrome, PortRow, PositionPanel, PreviewPanel, RUN_LOG_CAPACITY, RailTabs, ReadOnlyBadge, RunButton, RunLog, RunTrace, RunTraceProvider, SELF_LOOP_CLEARANCE, SELF_LOOP_RADIUS, SignalBar, TOKEN_NAMES, ToastProvider, ToolCluster, Toolbar, ToolbarGhostButton, ToolbarStat, UndoRedo, boundsFields, capacityLabel, clampFooter, connectableCandidates, createHlangFlowTypes, createTheme, defaultLiveDeps, deriveParamSchema, descriptorCandidates, footerBounds, formatDuration, formatElapsed, fuzzyRank, fuzzyScore, involves, isEditableTarget, nextBounds, previewValue, resizeByKey, searchNodes, selfLoopPath, toggleCollapsed, tokenVar, useEdgeBounds, useEdgeFlowing, useEdgePulse, useEditorHotkeys, useFollowScroll, useFooterResize, useLiveSignalStore, useLiveSignals, useNodeContextMenu, useNodeInteraction, useNodeLiveState, useNodeParams, useNodePulse, useNodeSearch, useNodeSearchTriggers, useRunTrace, useRunTraceStore, useRunTraceVersion, useToast };
|
|
1549
|
+
export type { AssetGridProps, AssetItem, AssetNodeChromeProps, CanvasChromeProps, CanvasDockProps, CanvasMode, CheatsheetProps, ConnectableResult, ConnectionEnd, ContextMenuItem, DeliverySignal, DiagnosticBadgeProps, EdgeBoundsHandle, EdgeIndexEntry, EditorHotkeysOptions, EditorShellProps, EditorUIThemeProviderProps, EmptyStateProps, FollowScroll, FooterBounds, FooterResize, FooterResizeOptions, FooterResizerProps, FooterSize, FuzzyCandidate, FuzzyMatch, FuzzyResult, HlangFlowTypes, InspectorPanelProps, LiveSignalProviderProps, LiveSignalStoreDeps, NodeBodySlotProps, NodeCandidate, NodeChromeProps, NodeContextMenuController, NodeContextMenuProps, NodeContextMenuState, NodeInteraction, NodeInteractionProviderProps, NodeLiveState, NodeParamsHandle, NodeRunSummary, NodeSearchController, NodeSearchProps, NodeSearchResult, NodeSearchResultView, NodeSearchState, NodeSearchTriggerOptions, NodeSearchTriggers, OutlineTreeProps, PanelActionProps, PanelHeadProps, ParamField, ParamFieldBase, ParamFormProps, PendingConnection, PillNodeChromeProps, PointerPosition, PortRowProps, PositionPanelProps, PreviewPanelProps, RailTab, RailTabsProps, ReadOnlyBadgeProps, RunButtonProps, RunDeliveryEntry, RunErrorEntry, RunLogEntry, RunLogProps, RunTraceOptions, RunTraceProviderProps, SelfLoop, SelfLoopInput, ShortcutGroup, ShortcutRow, ThemeOverride, ToastApi, ToastProviderProps, TokenName, ToolClusterProps, ToolItem, ToolbarProps, TouchPositions, UndoRedoProps };
|