@hlang-org/editor-ui 0.3.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/edges/FlowEdge.css +55 -0
- package/lib/index.d.mts +567 -25
- package/lib/index.d.ts +567 -25
- package/lib/index.js +1659 -432
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +1586 -401
- package/lib/index.mjs.map +1 -1
- package/lib/live/LivePulse.css +21 -0
- package/lib/nodes/AssetNode.css +9 -7
- package/lib/nodes/HlangNode.css +9 -7
- package/lib/nodes/PillNode.css +9 -7
- package/lib/panels/InspectorPanel.css +59 -0
- package/lib/panels/PanelHead.css +119 -0
- package/lib/panels/ParamForm.css +16 -0
- package/lib/panels/RunLog.css +119 -0
- package/lib/shell/EditorShell.css +82 -0
- package/lib/styles.css +4 -0
- package/lib/toolbar/ReadOnlyBadge.css +35 -0
- package/lib/toolbar/Toolbar.css +11 -0
- package/package.json +5 -5
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/edges/FlowEdge.css
CHANGED
|
@@ -78,3 +78,58 @@
|
|
|
78
78
|
box-shadow: var(--hl-glass-edge), 0 2px 8px -3px rgba(0, 0, 0, 0.6);
|
|
79
79
|
white-space: nowrap;
|
|
80
80
|
}
|
|
81
|
+
|
|
82
|
+
/* One flash per message the edge carried (see FlowEdge), fading out. */
|
|
83
|
+
.hl-edge-pulse {
|
|
84
|
+
fill: none;
|
|
85
|
+
stroke: var(--hl-spark);
|
|
86
|
+
stroke-width: 2.5;
|
|
87
|
+
pointer-events: none;
|
|
88
|
+
opacity: 0;
|
|
89
|
+
filter: drop-shadow(0 0 6px color-mix(in oklab, var(--hl-spark) 70%, transparent));
|
|
90
|
+
animation: hl-edge-pulse 0.6s var(--hl-ease);
|
|
91
|
+
}
|
|
92
|
+
.hl-edge.is-error .hl-edge-pulse {
|
|
93
|
+
stroke: var(--hl-error);
|
|
94
|
+
filter: drop-shadow(0 0 6px color-mix(in oklab, var(--hl-error) 70%, transparent));
|
|
95
|
+
}
|
|
96
|
+
@keyframes hl-edge-pulse {
|
|
97
|
+
0% {
|
|
98
|
+
opacity: 1;
|
|
99
|
+
}
|
|
100
|
+
100% {
|
|
101
|
+
opacity: 0;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/* A bounded connection's capacity, in FBP notation: `[4]`. A connection that
|
|
106
|
+
drops its oldest message when full is lossy, so its badge takes the
|
|
107
|
+
warning hue. */
|
|
108
|
+
.hl-edge-capacity {
|
|
109
|
+
position: absolute;
|
|
110
|
+
pointer-events: none;
|
|
111
|
+
padding: 2px 7px;
|
|
112
|
+
border-radius: var(--hl-r-pill);
|
|
113
|
+
border: 1px solid var(--hl-line-strong);
|
|
114
|
+
font-size: 11px;
|
|
115
|
+
line-height: 1.4;
|
|
116
|
+
white-space: nowrap;
|
|
117
|
+
color: var(--hl-silver-hi);
|
|
118
|
+
/* Opaque, so the label stays legible over the line it labels. */
|
|
119
|
+
background: var(--hl-surface-2);
|
|
120
|
+
}
|
|
121
|
+
.hl-edge-capacity.is-lossy {
|
|
122
|
+
border-color: color-mix(in oklab, var(--hl-warning) 45%, var(--hl-line-strong));
|
|
123
|
+
}
|
|
124
|
+
.hl-edge-capacity.is-lossy {
|
|
125
|
+
color: var(--hl-warning);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/* A selected connection (the one the inspector shows): a brighter, thicker
|
|
129
|
+
silver line, so it is clear which connection is being edited. */
|
|
130
|
+
.hl-edge.is-selected .hl-edge-flow {
|
|
131
|
+
stroke: var(--hl-silver-hi);
|
|
132
|
+
stroke-width: 2.25;
|
|
133
|
+
opacity: 1;
|
|
134
|
+
filter: drop-shadow(0 0 4px color-mix(in oklab, var(--hl-silver) 60%, transparent));
|
|
135
|
+
}
|