@goplasmatic/dataflow-ui 2.0.9 → 2.0.11
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 +43 -15
- package/dist/dataflow-ui.css +33 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -82,33 +82,52 @@ interface WorkflowVisualizerProps {
|
|
|
82
82
|
theme?: 'light' | 'dark' | 'system';
|
|
83
83
|
className?: string;
|
|
84
84
|
executionResult?: Message | null;
|
|
85
|
-
|
|
85
|
+
debugConfig?: DebugConfig;
|
|
86
|
+
debugPayload?: Record<string, unknown>;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
interface DebugConfig {
|
|
90
|
+
enabled: boolean;
|
|
91
|
+
engineFactory?: EngineFactory;
|
|
92
|
+
initialPayload?: Record<string, unknown>;
|
|
93
|
+
autoExecute?: boolean;
|
|
94
|
+
onExecutionComplete?: (trace: ExecutionTrace) => void;
|
|
95
|
+
onExecutionError?: (error: string) => void;
|
|
86
96
|
}
|
|
87
97
|
```
|
|
88
98
|
|
|
89
99
|
### Debug Mode
|
|
90
100
|
|
|
91
|
-
Enable step-by-step execution visualization:
|
|
101
|
+
Enable step-by-step execution visualization with integrated debug controls:
|
|
92
102
|
|
|
93
103
|
```tsx
|
|
94
|
-
import { WorkflowVisualizer,
|
|
104
|
+
import { WorkflowVisualizer, defaultEngineFactory } from '@goplasmatic/dataflow-ui';
|
|
95
105
|
|
|
96
106
|
function DebugView() {
|
|
107
|
+
const payload = { data: { input: 'hello' } };
|
|
108
|
+
|
|
97
109
|
return (
|
|
98
|
-
<
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
110
|
+
<WorkflowVisualizer
|
|
111
|
+
workflows={workflows}
|
|
112
|
+
debugConfig={{
|
|
113
|
+
enabled: true,
|
|
114
|
+
engineFactory: defaultEngineFactory,
|
|
115
|
+
autoExecute: true,
|
|
116
|
+
}}
|
|
117
|
+
debugPayload={payload}
|
|
118
|
+
/>
|
|
102
119
|
);
|
|
103
120
|
}
|
|
104
121
|
```
|
|
105
122
|
|
|
123
|
+
The debug controls (play, pause, step forward/backward) are automatically displayed in the visualizer header when `debugConfig.enabled` is true.
|
|
124
|
+
|
|
106
125
|
### Custom WASM Engine
|
|
107
126
|
|
|
108
127
|
Use a custom WASM engine with plugins or custom functions:
|
|
109
128
|
|
|
110
129
|
```tsx
|
|
111
|
-
import { WorkflowVisualizer,
|
|
130
|
+
import { WorkflowVisualizer, DataflowEngine, EngineFactory } from '@goplasmatic/dataflow-ui';
|
|
112
131
|
import { MyCustomWasmEngine } from './my-custom-wasm';
|
|
113
132
|
|
|
114
133
|
// Implement the DataflowEngine interface
|
|
@@ -129,11 +148,19 @@ class MyEngineAdapter implements DataflowEngine {
|
|
|
129
148
|
}
|
|
130
149
|
}
|
|
131
150
|
|
|
151
|
+
const customEngineFactory: EngineFactory = (workflows) => new MyEngineAdapter(workflows);
|
|
152
|
+
|
|
132
153
|
function CustomDebugView() {
|
|
133
154
|
return (
|
|
134
|
-
<
|
|
135
|
-
|
|
136
|
-
|
|
155
|
+
<WorkflowVisualizer
|
|
156
|
+
workflows={workflows}
|
|
157
|
+
debugConfig={{
|
|
158
|
+
enabled: true,
|
|
159
|
+
engineFactory: customEngineFactory,
|
|
160
|
+
autoExecute: true,
|
|
161
|
+
}}
|
|
162
|
+
debugPayload={{ data: { input: 'test' } }}
|
|
163
|
+
/>
|
|
137
164
|
);
|
|
138
165
|
}
|
|
139
166
|
```
|
|
@@ -141,10 +168,9 @@ function CustomDebugView() {
|
|
|
141
168
|
## Exports
|
|
142
169
|
|
|
143
170
|
### Components
|
|
144
|
-
- `WorkflowVisualizer` - Main visualization component
|
|
171
|
+
- `WorkflowVisualizer` - Main visualization component with integrated debug controls
|
|
145
172
|
- `TreeView` - Standalone tree view
|
|
146
|
-
- `
|
|
147
|
-
- `DebuggerProvider` - Debug state context provider
|
|
173
|
+
- `DebuggerProvider` - Debug state context provider (for advanced use cases)
|
|
148
174
|
|
|
149
175
|
### Hooks
|
|
150
176
|
- `useTheme` - Access theme state
|
|
@@ -158,7 +184,9 @@ function CustomDebugView() {
|
|
|
158
184
|
- `EngineFactory` - Type for engine factory functions
|
|
159
185
|
|
|
160
186
|
### Types
|
|
161
|
-
|
|
187
|
+
- `Workflow`, `Task`, `Message` - Core workflow types
|
|
188
|
+
- `ExecutionTrace`, `ExecutionStep` - Execution trace types
|
|
189
|
+
- `DebugConfig` - Debug mode configuration
|
|
162
190
|
|
|
163
191
|
## Peer Dependencies
|
|
164
192
|
|
package/dist/dataflow-ui.css
CHANGED
|
@@ -4322,12 +4322,44 @@ svg.react-flow__connectionline {
|
|
|
4322
4322
|
color: var(--df-text-secondary);
|
|
4323
4323
|
}
|
|
4324
4324
|
|
|
4325
|
+
.df-visualizer-result-changes {
|
|
4326
|
+
font-size: 10px;
|
|
4327
|
+
font-weight: 500;
|
|
4328
|
+
color: var(--df-success);
|
|
4329
|
+
background: color-mix(in srgb, var(--df-success) 15%, transparent);
|
|
4330
|
+
padding: 2px 6px;
|
|
4331
|
+
border-radius: 10px;
|
|
4332
|
+
margin-left: auto;
|
|
4333
|
+
}
|
|
4334
|
+
|
|
4325
4335
|
.df-visualizer-result-content {
|
|
4326
4336
|
flex: 1;
|
|
4327
|
-
|
|
4337
|
+
min-height: 0;
|
|
4338
|
+
overflow: hidden;
|
|
4328
4339
|
background: var(--df-bg-primary);
|
|
4329
4340
|
}
|
|
4330
4341
|
|
|
4342
|
+
/* Monaco Editor Wrapper */
|
|
4343
|
+
|
|
4344
|
+
.df-monaco-editor-wrapper {
|
|
4345
|
+
height: 100%;
|
|
4346
|
+
min-height: 100%;
|
|
4347
|
+
}
|
|
4348
|
+
|
|
4349
|
+
/* Monaco Editor Line Highlighting (for debug mode) */
|
|
4350
|
+
|
|
4351
|
+
.df-highlighted-line {
|
|
4352
|
+
background-color: color-mix(in srgb, var(--df-success) 15%, transparent) !important;
|
|
4353
|
+
border-left: 3px solid var(--df-success) !important;
|
|
4354
|
+
}
|
|
4355
|
+
|
|
4356
|
+
.df-highlighted-glyph {
|
|
4357
|
+
background-color: var(--df-success);
|
|
4358
|
+
width: 4px !important;
|
|
4359
|
+
margin-left: 3px;
|
|
4360
|
+
border-radius: 2px;
|
|
4361
|
+
}
|
|
4362
|
+
|
|
4331
4363
|
.df-result-json {
|
|
4332
4364
|
margin: 0;
|
|
4333
4365
|
padding: 12px;
|
package/package.json
CHANGED