@goplasmatic/dataflow-ui 2.0.8 → 2.0.10
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 +42 -0
- package/dist/index.cjs +178 -122
- package/dist/index.d.ts +2 -67
- package/dist/index.js +178 -122
- 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,6 +4322,16 @@ 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
|
overflow: auto;
|
|
@@ -4546,6 +4556,38 @@ svg.react-flow__connectionline {
|
|
|
4546
4556
|
DEBUGGER STYLES
|
|
4547
4557
|
============================================ */
|
|
4548
4558
|
|
|
4559
|
+
/* Visualizer container with title bar */
|
|
4560
|
+
|
|
4561
|
+
.df-visualizer-container {
|
|
4562
|
+
display: flex;
|
|
4563
|
+
flex-direction: column;
|
|
4564
|
+
height: 100%;
|
|
4565
|
+
overflow: hidden;
|
|
4566
|
+
}
|
|
4567
|
+
|
|
4568
|
+
.df-visualizer-title-bar {
|
|
4569
|
+
display: flex;
|
|
4570
|
+
align-items: center;
|
|
4571
|
+
justify-content: space-between;
|
|
4572
|
+
padding: 8px 12px;
|
|
4573
|
+
border-bottom: 1px solid var(--df-border-color);
|
|
4574
|
+
background: var(--df-bg-secondary);
|
|
4575
|
+
flex-shrink: 0;
|
|
4576
|
+
}
|
|
4577
|
+
|
|
4578
|
+
.df-visualizer-title {
|
|
4579
|
+
font-weight: 600;
|
|
4580
|
+
font-size: 14px;
|
|
4581
|
+
color: var(--df-text-primary);
|
|
4582
|
+
}
|
|
4583
|
+
|
|
4584
|
+
/* Make horizontal layout fill remaining space */
|
|
4585
|
+
|
|
4586
|
+
.df-visualizer-container .df-visualizer-horizontal {
|
|
4587
|
+
flex: 1;
|
|
4588
|
+
min-height: 0;
|
|
4589
|
+
}
|
|
4590
|
+
|
|
4549
4591
|
/* Debug mode layout */
|
|
4550
4592
|
|
|
4551
4593
|
.df-debug-mode {
|
package/dist/index.cjs
CHANGED
|
@@ -177,6 +177,15 @@ const Check = createLucideIcon("Check", [["path", { d: "M20 6 9 17l-5-5", key: "
|
|
|
177
177
|
const ChevronDown = createLucideIcon("ChevronDown", [
|
|
178
178
|
["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]
|
|
179
179
|
]);
|
|
180
|
+
/**
|
|
181
|
+
* @license lucide-react v0.462.0 - ISC
|
|
182
|
+
*
|
|
183
|
+
* This source code is licensed under the ISC license.
|
|
184
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
+
*/
|
|
186
|
+
const ChevronLeft = createLucideIcon("ChevronLeft", [
|
|
187
|
+
["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]
|
|
188
|
+
]);
|
|
180
189
|
/**
|
|
181
190
|
* @license lucide-react v0.462.0 - ISC
|
|
182
191
|
*
|
|
@@ -186,6 +195,26 @@ const ChevronDown = createLucideIcon("ChevronDown", [
|
|
|
186
195
|
const ChevronRight = createLucideIcon("ChevronRight", [
|
|
187
196
|
["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]
|
|
188
197
|
]);
|
|
198
|
+
/**
|
|
199
|
+
* @license lucide-react v0.462.0 - ISC
|
|
200
|
+
*
|
|
201
|
+
* This source code is licensed under the ISC license.
|
|
202
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
203
|
+
*/
|
|
204
|
+
const ChevronsLeft = createLucideIcon("ChevronsLeft", [
|
|
205
|
+
["path", { d: "m11 17-5-5 5-5", key: "13zhaf" }],
|
|
206
|
+
["path", { d: "m18 17-5-5 5-5", key: "h8a8et" }]
|
|
207
|
+
]);
|
|
208
|
+
/**
|
|
209
|
+
* @license lucide-react v0.462.0 - ISC
|
|
210
|
+
*
|
|
211
|
+
* This source code is licensed under the ISC license.
|
|
212
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
213
|
+
*/
|
|
214
|
+
const ChevronsRight = createLucideIcon("ChevronsRight", [
|
|
215
|
+
["path", { d: "m6 17 5-5-5-5", key: "xnjwq" }],
|
|
216
|
+
["path", { d: "m13 17 5-5-5-5", key: "17xmmf" }]
|
|
217
|
+
]);
|
|
189
218
|
/**
|
|
190
219
|
* @license lucide-react v0.462.0 - ISC
|
|
191
220
|
*
|
|
@@ -11028,7 +11057,7 @@ let CATEGORY_COLORS, DataLogicEditor, OPERATORS, applyTreeLayout, jsonLogicToNod
|
|
|
11028
11057
|
}
|
|
11029
11058
|
]
|
|
11030
11059
|
];
|
|
11031
|
-
const
|
|
11060
|
+
const ChevronLeft2 = createLucideIcon2("chevron-left", __iconNode$o);
|
|
11032
11061
|
const __iconNode$n = [
|
|
11033
11062
|
[
|
|
11034
11063
|
"path",
|
|
@@ -18888,7 +18917,7 @@ let CATEGORY_COLORS, DataLogicEditor, OPERATORS, applyTreeLayout, jsonLogicToNod
|
|
|
18888
18917
|
onClick: stepBackward,
|
|
18889
18918
|
disabled: isAtStart,
|
|
18890
18919
|
title: "Step backward (Left Arrow)",
|
|
18891
|
-
children: jsxRuntime.jsx(
|
|
18920
|
+
children: jsxRuntime.jsx(ChevronLeft2, {
|
|
18892
18921
|
size: 18
|
|
18893
18922
|
})
|
|
18894
18923
|
}),
|
|
@@ -20304,7 +20333,7 @@ function getParentFolderIds(path) {
|
|
|
20304
20333
|
return ids;
|
|
20305
20334
|
}
|
|
20306
20335
|
function TreeView({ workflows, selection: selection2, onSelect, debugMode = false }) {
|
|
20307
|
-
const debuggerContext =
|
|
20336
|
+
const debuggerContext = useDebuggerOptional();
|
|
20308
20337
|
const effectiveDebugContext = debugMode ? debuggerContext : null;
|
|
20309
20338
|
const folderTree = require$$0.useMemo(() => buildFolderTree(workflows), [workflows]);
|
|
20310
20339
|
const sortedRootFolders = require$$0.useMemo(() => {
|
|
@@ -21063,6 +21092,7 @@ function IntegratedDebugToolbar({
|
|
|
21063
21092
|
reset,
|
|
21064
21093
|
stepForward,
|
|
21065
21094
|
stepBackward,
|
|
21095
|
+
goToStep,
|
|
21066
21096
|
startExecution,
|
|
21067
21097
|
executeTrace,
|
|
21068
21098
|
setExecutionError,
|
|
@@ -21112,6 +21142,16 @@ function IntegratedDebugToolbar({
|
|
|
21112
21142
|
reset();
|
|
21113
21143
|
lastExecutionRef.current = null;
|
|
21114
21144
|
}, [reset]);
|
|
21145
|
+
const goToFirst = require$$0.useCallback(() => {
|
|
21146
|
+
if (hasTrace) {
|
|
21147
|
+
stop();
|
|
21148
|
+
}
|
|
21149
|
+
}, [hasTrace, stop]);
|
|
21150
|
+
const goToLast = require$$0.useCallback(() => {
|
|
21151
|
+
if (hasTrace && totalSteps > 0) {
|
|
21152
|
+
goToStep(totalSteps - 1);
|
|
21153
|
+
}
|
|
21154
|
+
}, [hasTrace, totalSteps, goToStep]);
|
|
21115
21155
|
require$$0.useEffect(() => {
|
|
21116
21156
|
if (!autoExecute || !isEngineReady || workflows.length === 0) return;
|
|
21117
21157
|
const timeoutId = setTimeout(() => {
|
|
@@ -21129,7 +21169,7 @@ function IntegratedDebugToolbar({
|
|
|
21129
21169
|
e.preventDefault();
|
|
21130
21170
|
if (playbackState === "playing") {
|
|
21131
21171
|
pause();
|
|
21132
|
-
} else if (hasTrace) {
|
|
21172
|
+
} else if (hasTrace && !isAtEnd) {
|
|
21133
21173
|
play();
|
|
21134
21174
|
}
|
|
21135
21175
|
break;
|
|
@@ -21145,9 +21185,17 @@ function IntegratedDebugToolbar({
|
|
|
21145
21185
|
stepBackward();
|
|
21146
21186
|
}
|
|
21147
21187
|
break;
|
|
21148
|
-
case "
|
|
21188
|
+
case "Home":
|
|
21149
21189
|
e.preventDefault();
|
|
21150
|
-
|
|
21190
|
+
if (hasTrace) {
|
|
21191
|
+
goToFirst();
|
|
21192
|
+
}
|
|
21193
|
+
break;
|
|
21194
|
+
case "End":
|
|
21195
|
+
e.preventDefault();
|
|
21196
|
+
if (hasTrace) {
|
|
21197
|
+
goToLast();
|
|
21198
|
+
}
|
|
21151
21199
|
break;
|
|
21152
21200
|
case "r":
|
|
21153
21201
|
if (e.metaKey || e.ctrlKey) {
|
|
@@ -21157,7 +21205,7 @@ function IntegratedDebugToolbar({
|
|
|
21157
21205
|
break;
|
|
21158
21206
|
}
|
|
21159
21207
|
},
|
|
21160
|
-
[playbackState, hasTrace, isAtEnd, isAtStart, play, pause,
|
|
21208
|
+
[playbackState, hasTrace, isAtEnd, isAtStart, play, pause, stepForward, stepBackward, goToFirst, goToLast, handleReset]
|
|
21161
21209
|
);
|
|
21162
21210
|
require$$0.useEffect(() => {
|
|
21163
21211
|
window.addEventListener("keydown", handleKeyDown);
|
|
@@ -21199,6 +21247,16 @@ function IntegratedDebugToolbar({
|
|
|
21199
21247
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-debug-toolbar-step-text", children: getStepText() })
|
|
21200
21248
|
] }),
|
|
21201
21249
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-toolbar-controls", children: [
|
|
21250
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21251
|
+
"button",
|
|
21252
|
+
{
|
|
21253
|
+
className: "df-debug-toolbar-btn",
|
|
21254
|
+
onClick: goToFirst,
|
|
21255
|
+
disabled: !hasTrace || isAtStart || isExecuting,
|
|
21256
|
+
title: "First step (Home)",
|
|
21257
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ChevronsLeft, { size: 14 })
|
|
21258
|
+
}
|
|
21259
|
+
),
|
|
21202
21260
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21203
21261
|
"button",
|
|
21204
21262
|
{
|
|
@@ -21206,7 +21264,7 @@ function IntegratedDebugToolbar({
|
|
|
21206
21264
|
onClick: stepBackward,
|
|
21207
21265
|
disabled: !hasTrace || isAtStart || isExecuting,
|
|
21208
21266
|
title: "Previous step (Left Arrow)",
|
|
21209
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
21267
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ChevronLeft, { size: 14 })
|
|
21210
21268
|
}
|
|
21211
21269
|
),
|
|
21212
21270
|
playbackState === "playing" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -21235,17 +21293,17 @@ function IntegratedDebugToolbar({
|
|
|
21235
21293
|
onClick: stepForward,
|
|
21236
21294
|
disabled: !hasTrace || isAtEnd || isExecuting,
|
|
21237
21295
|
title: "Next step (Right Arrow)",
|
|
21238
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
21296
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ChevronRight, { size: 14 })
|
|
21239
21297
|
}
|
|
21240
21298
|
),
|
|
21241
21299
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21242
21300
|
"button",
|
|
21243
21301
|
{
|
|
21244
21302
|
className: "df-debug-toolbar-btn",
|
|
21245
|
-
onClick:
|
|
21246
|
-
disabled: !hasTrace || isExecuting,
|
|
21247
|
-
title: "
|
|
21248
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
21303
|
+
onClick: goToLast,
|
|
21304
|
+
disabled: !hasTrace || isAtEnd || isExecuting,
|
|
21305
|
+
title: "Last step (End)",
|
|
21306
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ChevronsRight, { size: 14 })
|
|
21249
21307
|
}
|
|
21250
21308
|
)
|
|
21251
21309
|
] }),
|
|
@@ -22339,13 +22397,13 @@ function VisualizerInner({
|
|
|
22339
22397
|
onTaskSelect,
|
|
22340
22398
|
onWorkflowSelect,
|
|
22341
22399
|
executionResult,
|
|
22342
|
-
debugMode = false,
|
|
22343
|
-
showDebugToolbar = false,
|
|
22344
22400
|
debugConfig,
|
|
22345
22401
|
debugPayload
|
|
22346
22402
|
}) {
|
|
22347
22403
|
const { resolvedTheme } = useTheme();
|
|
22348
|
-
const
|
|
22404
|
+
const debugMode = (debugConfig == null ? void 0 : debugConfig.enabled) ?? false;
|
|
22405
|
+
const debuggerContext = useDebuggerOptional();
|
|
22406
|
+
const effectiveDebugContext = debugMode ? debuggerContext : null;
|
|
22349
22407
|
const [selection2, setSelection] = require$$0.useState({ type: "none" });
|
|
22350
22408
|
const [leftPanelWidth, setLeftPanelWidth] = require$$0.useState(280);
|
|
22351
22409
|
const [isDragging, setIsDragging] = require$$0.useState(false);
|
|
@@ -22409,114 +22467,117 @@ function VisualizerInner({
|
|
|
22409
22467
|
};
|
|
22410
22468
|
}, [isVerticalDragging]);
|
|
22411
22469
|
const selectionInfo = getSelectionInfo(selection2);
|
|
22412
|
-
const hasDebugTrace = debugMode && (
|
|
22413
|
-
const displayMessage = hasDebugTrace ?
|
|
22414
|
-
const currentChanges = hasDebugTrace ?
|
|
22415
|
-
const currentStepIndex = hasDebugTrace ?
|
|
22470
|
+
const hasDebugTrace = debugMode && (effectiveDebugContext == null ? void 0 : effectiveDebugContext.hasTrace);
|
|
22471
|
+
const displayMessage = hasDebugTrace ? effectiveDebugContext == null ? void 0 : effectiveDebugContext.currentMessage : executionResult;
|
|
22472
|
+
const currentChanges = hasDebugTrace ? effectiveDebugContext == null ? void 0 : effectiveDebugContext.currentChanges : [];
|
|
22473
|
+
const currentStepIndex = hasDebugTrace ? effectiveDebugContext == null ? void 0 : effectiveDebugContext.state.currentStepIndex : -1;
|
|
22416
22474
|
const highlightedPaths = require$$0.useMemo(() => {
|
|
22417
22475
|
if (!currentChanges || currentChanges.length === 0) return void 0;
|
|
22418
22476
|
return currentChanges.map((change) => change.path);
|
|
22419
22477
|
}, [currentChanges]);
|
|
22420
22478
|
const isDraggingAny = isDragging || isVerticalDragging;
|
|
22421
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
22422
|
-
"div",
|
|
22423
|
-
|
|
22424
|
-
|
|
22425
|
-
|
|
22426
|
-
|
|
22427
|
-
|
|
22428
|
-
|
|
22429
|
-
|
|
22430
|
-
|
|
22431
|
-
|
|
22432
|
-
|
|
22433
|
-
|
|
22434
|
-
|
|
22435
|
-
|
|
22436
|
-
|
|
22437
|
-
|
|
22438
|
-
|
|
22439
|
-
|
|
22440
|
-
|
|
22441
|
-
|
|
22442
|
-
|
|
22443
|
-
|
|
22479
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `df-visualizer-container df-theme-${resolvedTheme}`, children: [
|
|
22480
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-visualizer-title-bar", children: [
|
|
22481
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-visualizer-title", children: "Workflows" }),
|
|
22482
|
+
debugMode && debugConfig && /* @__PURE__ */ jsxRuntime.jsx(
|
|
22483
|
+
IntegratedDebugToolbar,
|
|
22484
|
+
{
|
|
22485
|
+
workflows,
|
|
22486
|
+
payload: debugPayload ?? debugConfig.initialPayload,
|
|
22487
|
+
autoExecute: debugConfig.autoExecute,
|
|
22488
|
+
onExecutionComplete: debugConfig.onExecutionComplete,
|
|
22489
|
+
onExecutionError: debugConfig.onExecutionError
|
|
22490
|
+
}
|
|
22491
|
+
)
|
|
22492
|
+
] }),
|
|
22493
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
22494
|
+
"div",
|
|
22495
|
+
{
|
|
22496
|
+
ref: containerRef,
|
|
22497
|
+
className: `df-visualizer-horizontal ${isDraggingAny ? "df-dragging" : ""}`,
|
|
22498
|
+
children: [
|
|
22499
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
22500
|
+
"div",
|
|
22501
|
+
{
|
|
22502
|
+
ref: leftPanelRef,
|
|
22503
|
+
className: "df-visualizer-left",
|
|
22504
|
+
style: { width: leftPanelWidth },
|
|
22505
|
+
children: [
|
|
22506
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
22507
|
+
"div",
|
|
22508
|
+
{
|
|
22509
|
+
className: `df-visualizer-left-tree ${displayMessage ? "df-with-result" : ""}`,
|
|
22510
|
+
style: displayMessage ? { height: `${treePanelHeight}%` } : void 0,
|
|
22511
|
+
children: [
|
|
22512
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-visualizer-left-header", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-visualizer-left-title", children: "Explorer" }) }),
|
|
22513
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-visualizer-left-content", children: workflows.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-empty-state", children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: "No workflows to display" }) }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
22514
|
+
TreeView,
|
|
22444
22515
|
{
|
|
22445
22516
|
workflows,
|
|
22446
|
-
|
|
22447
|
-
|
|
22448
|
-
|
|
22449
|
-
onExecutionError: debugConfig.onExecutionError
|
|
22517
|
+
selection: selection2,
|
|
22518
|
+
onSelect: handleSelection,
|
|
22519
|
+
debugMode
|
|
22450
22520
|
}
|
|
22451
|
-
)
|
|
22452
|
-
]
|
|
22453
|
-
|
|
22454
|
-
|
|
22455
|
-
|
|
22456
|
-
|
|
22457
|
-
|
|
22458
|
-
|
|
22459
|
-
|
|
22460
|
-
|
|
22461
|
-
|
|
22462
|
-
|
|
22463
|
-
|
|
22464
|
-
|
|
22465
|
-
|
|
22466
|
-
|
|
22467
|
-
|
|
22468
|
-
|
|
22469
|
-
|
|
22470
|
-
|
|
22471
|
-
|
|
22472
|
-
|
|
22473
|
-
|
|
22474
|
-
|
|
22475
|
-
|
|
22476
|
-
|
|
22477
|
-
|
|
22478
|
-
|
|
22479
|
-
|
|
22480
|
-
|
|
22481
|
-
|
|
22482
|
-
|
|
22483
|
-
|
|
22484
|
-
|
|
22485
|
-
|
|
22486
|
-
|
|
22487
|
-
|
|
22488
|
-
|
|
22489
|
-
|
|
22490
|
-
|
|
22491
|
-
|
|
22492
|
-
|
|
22493
|
-
|
|
22494
|
-
|
|
22495
|
-
|
|
22496
|
-
|
|
22497
|
-
|
|
22498
|
-
|
|
22499
|
-
|
|
22500
|
-
|
|
22501
|
-
|
|
22502
|
-
|
|
22503
|
-
|
|
22504
|
-
|
|
22505
|
-
|
|
22506
|
-
|
|
22507
|
-
|
|
22508
|
-
|
|
22509
|
-
|
|
22510
|
-
|
|
22511
|
-
selectionInfo && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-details-header", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-details-header-info", children: [
|
|
22512
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-details-header-title", children: selectionInfo.title }),
|
|
22513
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-details-header-subtitle", children: selectionInfo.subtitle })
|
|
22514
|
-
] }) }),
|
|
22515
|
-
/* @__PURE__ */ jsxRuntime.jsx(DetailsPanel, { selection: selection2 })
|
|
22516
|
-
] })
|
|
22517
|
-
]
|
|
22518
|
-
}
|
|
22519
|
-
) });
|
|
22521
|
+
) })
|
|
22522
|
+
]
|
|
22523
|
+
}
|
|
22524
|
+
),
|
|
22525
|
+
displayMessage && /* @__PURE__ */ jsxRuntime.jsx(
|
|
22526
|
+
"div",
|
|
22527
|
+
{
|
|
22528
|
+
className: `df-visualizer-divider-horizontal ${isVerticalDragging ? "df-divider-active" : ""}`,
|
|
22529
|
+
onMouseDown: handleVerticalMouseDown
|
|
22530
|
+
}
|
|
22531
|
+
),
|
|
22532
|
+
displayMessage && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
22533
|
+
"div",
|
|
22534
|
+
{
|
|
22535
|
+
className: "df-visualizer-result-panel",
|
|
22536
|
+
style: { height: `${100 - treePanelHeight}%` },
|
|
22537
|
+
children: [
|
|
22538
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-visualizer-result-header", children: [
|
|
22539
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-visualizer-result-title", children: hasDebugTrace ? currentStepIndex !== void 0 && currentStepIndex >= 0 ? `Step ${currentStepIndex + 1}` : "Ready" : "Result" }),
|
|
22540
|
+
hasDebugTrace && currentChanges && currentChanges.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "df-visualizer-result-changes", children: [
|
|
22541
|
+
currentChanges.length,
|
|
22542
|
+
" change",
|
|
22543
|
+
currentChanges.length !== 1 ? "s" : ""
|
|
22544
|
+
] })
|
|
22545
|
+
] }),
|
|
22546
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-visualizer-result-content", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
22547
|
+
JsonEditor,
|
|
22548
|
+
{
|
|
22549
|
+
value: JSON.stringify(displayMessage, null, 2),
|
|
22550
|
+
onChange: () => {
|
|
22551
|
+
},
|
|
22552
|
+
readOnly: true,
|
|
22553
|
+
theme: resolvedTheme === "dark" ? "dark" : "light",
|
|
22554
|
+
highlightedPaths
|
|
22555
|
+
}
|
|
22556
|
+
) })
|
|
22557
|
+
]
|
|
22558
|
+
}
|
|
22559
|
+
)
|
|
22560
|
+
]
|
|
22561
|
+
}
|
|
22562
|
+
),
|
|
22563
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
22564
|
+
"div",
|
|
22565
|
+
{
|
|
22566
|
+
className: `df-visualizer-divider ${isDragging ? "df-divider-active" : ""}`,
|
|
22567
|
+
onMouseDown: handleMouseDown
|
|
22568
|
+
}
|
|
22569
|
+
),
|
|
22570
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-visualizer-right", children: [
|
|
22571
|
+
selectionInfo && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-details-header", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-details-header-info", children: [
|
|
22572
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-details-header-title", children: selectionInfo.title }),
|
|
22573
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "df-details-header-subtitle", children: selectionInfo.subtitle })
|
|
22574
|
+
] }) }),
|
|
22575
|
+
/* @__PURE__ */ jsxRuntime.jsx(DetailsPanel, { selection: selection2 })
|
|
22576
|
+
] })
|
|
22577
|
+
]
|
|
22578
|
+
}
|
|
22579
|
+
)
|
|
22580
|
+
] }) });
|
|
22520
22581
|
}
|
|
22521
22582
|
function WorkflowVisualizer({
|
|
22522
22583
|
workflows,
|
|
@@ -22525,12 +22586,10 @@ function WorkflowVisualizer({
|
|
|
22525
22586
|
theme = "system",
|
|
22526
22587
|
className = "",
|
|
22527
22588
|
executionResult,
|
|
22528
|
-
debugMode = false,
|
|
22529
22589
|
debugConfig,
|
|
22530
22590
|
debugPayload
|
|
22531
22591
|
}) {
|
|
22532
22592
|
if (debugConfig == null ? void 0 : debugConfig.enabled) {
|
|
22533
|
-
const showControls = debugConfig.showControls !== false;
|
|
22534
22593
|
return /* @__PURE__ */ jsxRuntime.jsx(ThemeProvider, { defaultTheme: theme, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
22535
22594
|
DebuggerProvider,
|
|
22536
22595
|
{
|
|
@@ -22544,8 +22603,6 @@ function WorkflowVisualizer({
|
|
|
22544
22603
|
onTaskSelect,
|
|
22545
22604
|
onWorkflowSelect,
|
|
22546
22605
|
executionResult,
|
|
22547
|
-
debugMode: true,
|
|
22548
|
-
showDebugToolbar: showControls,
|
|
22549
22606
|
debugConfig,
|
|
22550
22607
|
debugPayload
|
|
22551
22608
|
}
|
|
@@ -22559,8 +22616,7 @@ function WorkflowVisualizer({
|
|
|
22559
22616
|
workflows,
|
|
22560
22617
|
onTaskSelect,
|
|
22561
22618
|
onWorkflowSelect,
|
|
22562
|
-
executionResult
|
|
22563
|
-
debugMode
|
|
22619
|
+
executionResult
|
|
22564
22620
|
}
|
|
22565
22621
|
) }) });
|
|
22566
22622
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -116,18 +116,6 @@ export declare interface DebugConfig {
|
|
|
116
116
|
* @default false
|
|
117
117
|
*/
|
|
118
118
|
autoExecute?: boolean;
|
|
119
|
-
/**
|
|
120
|
-
* Show playback controls in the header.
|
|
121
|
-
* @default true
|
|
122
|
-
*/
|
|
123
|
-
showControls?: boolean;
|
|
124
|
-
/**
|
|
125
|
-
* Position of the debug controls.
|
|
126
|
-
* - 'header': Show controls in the explorer header (default)
|
|
127
|
-
* - 'bottom': Show controls in a bottom toolbar
|
|
128
|
-
* @default 'header'
|
|
129
|
-
*/
|
|
130
|
-
controlsPosition?: 'header' | 'bottom';
|
|
131
119
|
/**
|
|
132
120
|
* Callback fired when execution completes successfully.
|
|
133
121
|
*/
|
|
@@ -457,52 +445,6 @@ declare interface JsonViewerProps {
|
|
|
457
445
|
className?: string;
|
|
458
446
|
}
|
|
459
447
|
|
|
460
|
-
/**
|
|
461
|
-
* Legacy execution step type (for backwards compatibility)
|
|
462
|
-
* @deprecated Use ExecutionStep instead
|
|
463
|
-
*/
|
|
464
|
-
export declare interface LegacyExecutionStep {
|
|
465
|
-
/** Unique ID for this step */
|
|
466
|
-
id: string;
|
|
467
|
-
/** Type of step */
|
|
468
|
-
type: 'workflow-condition' | 'workflow-start' | 'workflow-end' | 'task-condition' | 'task-start' | 'task-end';
|
|
469
|
-
/** Associated workflow */
|
|
470
|
-
workflow: Workflow;
|
|
471
|
-
/** Associated task (if applicable) */
|
|
472
|
-
task?: Task;
|
|
473
|
-
/** Result of condition evaluation (if applicable) */
|
|
474
|
-
conditionResult?: ConditionResult;
|
|
475
|
-
/** Message state before this step */
|
|
476
|
-
messageBefore: Message;
|
|
477
|
-
/** Message state after this step */
|
|
478
|
-
messageAfter: Message;
|
|
479
|
-
/** State of this node */
|
|
480
|
-
state: DebugNodeState;
|
|
481
|
-
/** Timestamp when this step occurred */
|
|
482
|
-
timestamp: number;
|
|
483
|
-
/** Duration of this step in ms (for task-end) */
|
|
484
|
-
duration?: number;
|
|
485
|
-
/** Error if this step failed */
|
|
486
|
-
error?: ErrorInfo;
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
/**
|
|
490
|
-
* Legacy trace type (for backwards compatibility)
|
|
491
|
-
* @deprecated Use ExecutionTrace instead
|
|
492
|
-
*/
|
|
493
|
-
export declare interface LegacyWorkflowExecutionTrace {
|
|
494
|
-
/** All execution steps */
|
|
495
|
-
steps: LegacyExecutionStep[];
|
|
496
|
-
/** Initial message before any processing */
|
|
497
|
-
initialMessage: Message;
|
|
498
|
-
/** Final message after all processing */
|
|
499
|
-
finalMessage: Message;
|
|
500
|
-
/** Total execution duration in ms */
|
|
501
|
-
totalDuration: number;
|
|
502
|
-
/** Whether execution completed successfully */
|
|
503
|
-
success: boolean;
|
|
504
|
-
}
|
|
505
|
-
|
|
506
448
|
/**
|
|
507
449
|
* Map function input configuration
|
|
508
450
|
*/
|
|
@@ -597,8 +539,6 @@ declare interface SearchInputProps {
|
|
|
597
539
|
className?: string;
|
|
598
540
|
}
|
|
599
541
|
|
|
600
|
-
export declare type SelectionType = TreeSelectionType;
|
|
601
|
-
|
|
602
542
|
/**
|
|
603
543
|
* Result of a step (executed or skipped)
|
|
604
544
|
*/
|
|
@@ -809,11 +749,11 @@ declare interface WorkflowFlowViewProps {
|
|
|
809
749
|
onWorkflowSelect?: (workflow: Workflow) => void;
|
|
810
750
|
onWorkflowConditionClick?: (workflow: Workflow) => void;
|
|
811
751
|
onTaskConditionClick?: (task: Task, workflow: Workflow) => void;
|
|
812
|
-
selection?:
|
|
752
|
+
selection?: TreeSelectionType;
|
|
813
753
|
highlightedTaskIds?: Set<string>;
|
|
814
754
|
}
|
|
815
755
|
|
|
816
|
-
export declare function WorkflowVisualizer({ workflows, onWorkflowSelect, onTaskSelect, theme, className, executionResult,
|
|
756
|
+
export declare function WorkflowVisualizer({ workflows, onWorkflowSelect, onTaskSelect, theme, className, executionResult, debugConfig, debugPayload, }: WorkflowVisualizerProps): JSX_2.Element;
|
|
817
757
|
|
|
818
758
|
export declare interface WorkflowVisualizerProps {
|
|
819
759
|
/** Array of workflow definitions to display */
|
|
@@ -828,11 +768,6 @@ export declare interface WorkflowVisualizerProps {
|
|
|
828
768
|
className?: string;
|
|
829
769
|
/** Execution result to display in the result panel */
|
|
830
770
|
executionResult?: Message | null;
|
|
831
|
-
/**
|
|
832
|
-
* Enable debug mode with step-by-step visualization.
|
|
833
|
-
* Use this when wrapping with your own DebuggerProvider.
|
|
834
|
-
*/
|
|
835
|
-
debugMode?: boolean;
|
|
836
771
|
/**
|
|
837
772
|
* Debug configuration for integrated debug mode.
|
|
838
773
|
* When enabled, automatically wraps with DebuggerProvider and shows controls.
|
package/dist/index.js
CHANGED
|
@@ -175,6 +175,15 @@ const Check = createLucideIcon("Check", [["path", { d: "M20 6 9 17l-5-5", key: "
|
|
|
175
175
|
const ChevronDown = createLucideIcon("ChevronDown", [
|
|
176
176
|
["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]
|
|
177
177
|
]);
|
|
178
|
+
/**
|
|
179
|
+
* @license lucide-react v0.462.0 - ISC
|
|
180
|
+
*
|
|
181
|
+
* This source code is licensed under the ISC license.
|
|
182
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
183
|
+
*/
|
|
184
|
+
const ChevronLeft = createLucideIcon("ChevronLeft", [
|
|
185
|
+
["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]
|
|
186
|
+
]);
|
|
178
187
|
/**
|
|
179
188
|
* @license lucide-react v0.462.0 - ISC
|
|
180
189
|
*
|
|
@@ -184,6 +193,26 @@ const ChevronDown = createLucideIcon("ChevronDown", [
|
|
|
184
193
|
const ChevronRight = createLucideIcon("ChevronRight", [
|
|
185
194
|
["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]
|
|
186
195
|
]);
|
|
196
|
+
/**
|
|
197
|
+
* @license lucide-react v0.462.0 - ISC
|
|
198
|
+
*
|
|
199
|
+
* This source code is licensed under the ISC license.
|
|
200
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
201
|
+
*/
|
|
202
|
+
const ChevronsLeft = createLucideIcon("ChevronsLeft", [
|
|
203
|
+
["path", { d: "m11 17-5-5 5-5", key: "13zhaf" }],
|
|
204
|
+
["path", { d: "m18 17-5-5 5-5", key: "h8a8et" }]
|
|
205
|
+
]);
|
|
206
|
+
/**
|
|
207
|
+
* @license lucide-react v0.462.0 - ISC
|
|
208
|
+
*
|
|
209
|
+
* This source code is licensed under the ISC license.
|
|
210
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
211
|
+
*/
|
|
212
|
+
const ChevronsRight = createLucideIcon("ChevronsRight", [
|
|
213
|
+
["path", { d: "m6 17 5-5-5-5", key: "xnjwq" }],
|
|
214
|
+
["path", { d: "m13 17 5-5-5-5", key: "17xmmf" }]
|
|
215
|
+
]);
|
|
187
216
|
/**
|
|
188
217
|
* @license lucide-react v0.462.0 - ISC
|
|
189
218
|
*
|
|
@@ -11026,7 +11055,7 @@ let CATEGORY_COLORS, DataLogicEditor, OPERATORS, applyTreeLayout, jsonLogicToNod
|
|
|
11026
11055
|
}
|
|
11027
11056
|
]
|
|
11028
11057
|
];
|
|
11029
|
-
const
|
|
11058
|
+
const ChevronLeft2 = createLucideIcon2("chevron-left", __iconNode$o);
|
|
11030
11059
|
const __iconNode$n = [
|
|
11031
11060
|
[
|
|
11032
11061
|
"path",
|
|
@@ -18886,7 +18915,7 @@ let CATEGORY_COLORS, DataLogicEditor, OPERATORS, applyTreeLayout, jsonLogicToNod
|
|
|
18886
18915
|
onClick: stepBackward,
|
|
18887
18916
|
disabled: isAtStart,
|
|
18888
18917
|
title: "Step backward (Left Arrow)",
|
|
18889
|
-
children: jsx(
|
|
18918
|
+
children: jsx(ChevronLeft2, {
|
|
18890
18919
|
size: 18
|
|
18891
18920
|
})
|
|
18892
18921
|
}),
|
|
@@ -20302,7 +20331,7 @@ function getParentFolderIds(path) {
|
|
|
20302
20331
|
return ids;
|
|
20303
20332
|
}
|
|
20304
20333
|
function TreeView({ workflows, selection: selection2, onSelect, debugMode = false }) {
|
|
20305
|
-
const debuggerContext =
|
|
20334
|
+
const debuggerContext = useDebuggerOptional();
|
|
20306
20335
|
const effectiveDebugContext = debugMode ? debuggerContext : null;
|
|
20307
20336
|
const folderTree = useMemo(() => buildFolderTree(workflows), [workflows]);
|
|
20308
20337
|
const sortedRootFolders = useMemo(() => {
|
|
@@ -21061,6 +21090,7 @@ function IntegratedDebugToolbar({
|
|
|
21061
21090
|
reset,
|
|
21062
21091
|
stepForward,
|
|
21063
21092
|
stepBackward,
|
|
21093
|
+
goToStep,
|
|
21064
21094
|
startExecution,
|
|
21065
21095
|
executeTrace,
|
|
21066
21096
|
setExecutionError,
|
|
@@ -21110,6 +21140,16 @@ function IntegratedDebugToolbar({
|
|
|
21110
21140
|
reset();
|
|
21111
21141
|
lastExecutionRef.current = null;
|
|
21112
21142
|
}, [reset]);
|
|
21143
|
+
const goToFirst = useCallback(() => {
|
|
21144
|
+
if (hasTrace) {
|
|
21145
|
+
stop();
|
|
21146
|
+
}
|
|
21147
|
+
}, [hasTrace, stop]);
|
|
21148
|
+
const goToLast = useCallback(() => {
|
|
21149
|
+
if (hasTrace && totalSteps > 0) {
|
|
21150
|
+
goToStep(totalSteps - 1);
|
|
21151
|
+
}
|
|
21152
|
+
}, [hasTrace, totalSteps, goToStep]);
|
|
21113
21153
|
useEffect(() => {
|
|
21114
21154
|
if (!autoExecute || !isEngineReady || workflows.length === 0) return;
|
|
21115
21155
|
const timeoutId = setTimeout(() => {
|
|
@@ -21127,7 +21167,7 @@ function IntegratedDebugToolbar({
|
|
|
21127
21167
|
e.preventDefault();
|
|
21128
21168
|
if (playbackState === "playing") {
|
|
21129
21169
|
pause();
|
|
21130
|
-
} else if (hasTrace) {
|
|
21170
|
+
} else if (hasTrace && !isAtEnd) {
|
|
21131
21171
|
play();
|
|
21132
21172
|
}
|
|
21133
21173
|
break;
|
|
@@ -21143,9 +21183,17 @@ function IntegratedDebugToolbar({
|
|
|
21143
21183
|
stepBackward();
|
|
21144
21184
|
}
|
|
21145
21185
|
break;
|
|
21146
|
-
case "
|
|
21186
|
+
case "Home":
|
|
21147
21187
|
e.preventDefault();
|
|
21148
|
-
|
|
21188
|
+
if (hasTrace) {
|
|
21189
|
+
goToFirst();
|
|
21190
|
+
}
|
|
21191
|
+
break;
|
|
21192
|
+
case "End":
|
|
21193
|
+
e.preventDefault();
|
|
21194
|
+
if (hasTrace) {
|
|
21195
|
+
goToLast();
|
|
21196
|
+
}
|
|
21149
21197
|
break;
|
|
21150
21198
|
case "r":
|
|
21151
21199
|
if (e.metaKey || e.ctrlKey) {
|
|
@@ -21155,7 +21203,7 @@ function IntegratedDebugToolbar({
|
|
|
21155
21203
|
break;
|
|
21156
21204
|
}
|
|
21157
21205
|
},
|
|
21158
|
-
[playbackState, hasTrace, isAtEnd, isAtStart, play, pause,
|
|
21206
|
+
[playbackState, hasTrace, isAtEnd, isAtStart, play, pause, stepForward, stepBackward, goToFirst, goToLast, handleReset]
|
|
21159
21207
|
);
|
|
21160
21208
|
useEffect(() => {
|
|
21161
21209
|
window.addEventListener("keydown", handleKeyDown);
|
|
@@ -21197,6 +21245,16 @@ function IntegratedDebugToolbar({
|
|
|
21197
21245
|
/* @__PURE__ */ jsx("span", { className: "df-debug-toolbar-step-text", children: getStepText() })
|
|
21198
21246
|
] }),
|
|
21199
21247
|
/* @__PURE__ */ jsxs("div", { className: "df-debug-toolbar-controls", children: [
|
|
21248
|
+
/* @__PURE__ */ jsx(
|
|
21249
|
+
"button",
|
|
21250
|
+
{
|
|
21251
|
+
className: "df-debug-toolbar-btn",
|
|
21252
|
+
onClick: goToFirst,
|
|
21253
|
+
disabled: !hasTrace || isAtStart || isExecuting,
|
|
21254
|
+
title: "First step (Home)",
|
|
21255
|
+
children: /* @__PURE__ */ jsx(ChevronsLeft, { size: 14 })
|
|
21256
|
+
}
|
|
21257
|
+
),
|
|
21200
21258
|
/* @__PURE__ */ jsx(
|
|
21201
21259
|
"button",
|
|
21202
21260
|
{
|
|
@@ -21204,7 +21262,7 @@ function IntegratedDebugToolbar({
|
|
|
21204
21262
|
onClick: stepBackward,
|
|
21205
21263
|
disabled: !hasTrace || isAtStart || isExecuting,
|
|
21206
21264
|
title: "Previous step (Left Arrow)",
|
|
21207
|
-
children: /* @__PURE__ */ jsx(
|
|
21265
|
+
children: /* @__PURE__ */ jsx(ChevronLeft, { size: 14 })
|
|
21208
21266
|
}
|
|
21209
21267
|
),
|
|
21210
21268
|
playbackState === "playing" ? /* @__PURE__ */ jsx(
|
|
@@ -21233,17 +21291,17 @@ function IntegratedDebugToolbar({
|
|
|
21233
21291
|
onClick: stepForward,
|
|
21234
21292
|
disabled: !hasTrace || isAtEnd || isExecuting,
|
|
21235
21293
|
title: "Next step (Right Arrow)",
|
|
21236
|
-
children: /* @__PURE__ */ jsx(
|
|
21294
|
+
children: /* @__PURE__ */ jsx(ChevronRight, { size: 14 })
|
|
21237
21295
|
}
|
|
21238
21296
|
),
|
|
21239
21297
|
/* @__PURE__ */ jsx(
|
|
21240
21298
|
"button",
|
|
21241
21299
|
{
|
|
21242
21300
|
className: "df-debug-toolbar-btn",
|
|
21243
|
-
onClick:
|
|
21244
|
-
disabled: !hasTrace || isExecuting,
|
|
21245
|
-
title: "
|
|
21246
|
-
children: /* @__PURE__ */ jsx(
|
|
21301
|
+
onClick: goToLast,
|
|
21302
|
+
disabled: !hasTrace || isAtEnd || isExecuting,
|
|
21303
|
+
title: "Last step (End)",
|
|
21304
|
+
children: /* @__PURE__ */ jsx(ChevronsRight, { size: 14 })
|
|
21247
21305
|
}
|
|
21248
21306
|
)
|
|
21249
21307
|
] }),
|
|
@@ -22337,13 +22395,13 @@ function VisualizerInner({
|
|
|
22337
22395
|
onTaskSelect,
|
|
22338
22396
|
onWorkflowSelect,
|
|
22339
22397
|
executionResult,
|
|
22340
|
-
debugMode = false,
|
|
22341
|
-
showDebugToolbar = false,
|
|
22342
22398
|
debugConfig,
|
|
22343
22399
|
debugPayload
|
|
22344
22400
|
}) {
|
|
22345
22401
|
const { resolvedTheme } = useTheme();
|
|
22346
|
-
const
|
|
22402
|
+
const debugMode = (debugConfig == null ? void 0 : debugConfig.enabled) ?? false;
|
|
22403
|
+
const debuggerContext = useDebuggerOptional();
|
|
22404
|
+
const effectiveDebugContext = debugMode ? debuggerContext : null;
|
|
22347
22405
|
const [selection2, setSelection] = useState({ type: "none" });
|
|
22348
22406
|
const [leftPanelWidth, setLeftPanelWidth] = useState(280);
|
|
22349
22407
|
const [isDragging, setIsDragging] = useState(false);
|
|
@@ -22407,114 +22465,117 @@ function VisualizerInner({
|
|
|
22407
22465
|
};
|
|
22408
22466
|
}, [isVerticalDragging]);
|
|
22409
22467
|
const selectionInfo = getSelectionInfo(selection2);
|
|
22410
|
-
const hasDebugTrace = debugMode && (
|
|
22411
|
-
const displayMessage = hasDebugTrace ?
|
|
22412
|
-
const currentChanges = hasDebugTrace ?
|
|
22413
|
-
const currentStepIndex = hasDebugTrace ?
|
|
22468
|
+
const hasDebugTrace = debugMode && (effectiveDebugContext == null ? void 0 : effectiveDebugContext.hasTrace);
|
|
22469
|
+
const displayMessage = hasDebugTrace ? effectiveDebugContext == null ? void 0 : effectiveDebugContext.currentMessage : executionResult;
|
|
22470
|
+
const currentChanges = hasDebugTrace ? effectiveDebugContext == null ? void 0 : effectiveDebugContext.currentChanges : [];
|
|
22471
|
+
const currentStepIndex = hasDebugTrace ? effectiveDebugContext == null ? void 0 : effectiveDebugContext.state.currentStepIndex : -1;
|
|
22414
22472
|
const highlightedPaths = useMemo(() => {
|
|
22415
22473
|
if (!currentChanges || currentChanges.length === 0) return void 0;
|
|
22416
22474
|
return currentChanges.map((change) => change.path);
|
|
22417
22475
|
}, [currentChanges]);
|
|
22418
22476
|
const isDraggingAny = isDragging || isVerticalDragging;
|
|
22419
|
-
return /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxs(
|
|
22420
|
-
"div",
|
|
22421
|
-
|
|
22422
|
-
|
|
22423
|
-
|
|
22424
|
-
|
|
22425
|
-
|
|
22426
|
-
|
|
22427
|
-
|
|
22428
|
-
|
|
22429
|
-
|
|
22430
|
-
|
|
22431
|
-
|
|
22432
|
-
|
|
22433
|
-
|
|
22434
|
-
|
|
22435
|
-
|
|
22436
|
-
|
|
22437
|
-
|
|
22438
|
-
|
|
22439
|
-
|
|
22440
|
-
|
|
22441
|
-
|
|
22477
|
+
return /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxs("div", { className: `df-visualizer-container df-theme-${resolvedTheme}`, children: [
|
|
22478
|
+
/* @__PURE__ */ jsxs("div", { className: "df-visualizer-title-bar", children: [
|
|
22479
|
+
/* @__PURE__ */ jsx("span", { className: "df-visualizer-title", children: "Workflows" }),
|
|
22480
|
+
debugMode && debugConfig && /* @__PURE__ */ jsx(
|
|
22481
|
+
IntegratedDebugToolbar,
|
|
22482
|
+
{
|
|
22483
|
+
workflows,
|
|
22484
|
+
payload: debugPayload ?? debugConfig.initialPayload,
|
|
22485
|
+
autoExecute: debugConfig.autoExecute,
|
|
22486
|
+
onExecutionComplete: debugConfig.onExecutionComplete,
|
|
22487
|
+
onExecutionError: debugConfig.onExecutionError
|
|
22488
|
+
}
|
|
22489
|
+
)
|
|
22490
|
+
] }),
|
|
22491
|
+
/* @__PURE__ */ jsxs(
|
|
22492
|
+
"div",
|
|
22493
|
+
{
|
|
22494
|
+
ref: containerRef,
|
|
22495
|
+
className: `df-visualizer-horizontal ${isDraggingAny ? "df-dragging" : ""}`,
|
|
22496
|
+
children: [
|
|
22497
|
+
/* @__PURE__ */ jsxs(
|
|
22498
|
+
"div",
|
|
22499
|
+
{
|
|
22500
|
+
ref: leftPanelRef,
|
|
22501
|
+
className: "df-visualizer-left",
|
|
22502
|
+
style: { width: leftPanelWidth },
|
|
22503
|
+
children: [
|
|
22504
|
+
/* @__PURE__ */ jsxs(
|
|
22505
|
+
"div",
|
|
22506
|
+
{
|
|
22507
|
+
className: `df-visualizer-left-tree ${displayMessage ? "df-with-result" : ""}`,
|
|
22508
|
+
style: displayMessage ? { height: `${treePanelHeight}%` } : void 0,
|
|
22509
|
+
children: [
|
|
22510
|
+
/* @__PURE__ */ jsx("div", { className: "df-visualizer-left-header", children: /* @__PURE__ */ jsx("span", { className: "df-visualizer-left-title", children: "Explorer" }) }),
|
|
22511
|
+
/* @__PURE__ */ jsx("div", { className: "df-visualizer-left-content", children: workflows.length === 0 ? /* @__PURE__ */ jsx("div", { className: "df-empty-state", children: /* @__PURE__ */ jsx("p", { children: "No workflows to display" }) }) : /* @__PURE__ */ jsx(
|
|
22512
|
+
TreeView,
|
|
22442
22513
|
{
|
|
22443
22514
|
workflows,
|
|
22444
|
-
|
|
22445
|
-
|
|
22446
|
-
|
|
22447
|
-
onExecutionError: debugConfig.onExecutionError
|
|
22515
|
+
selection: selection2,
|
|
22516
|
+
onSelect: handleSelection,
|
|
22517
|
+
debugMode
|
|
22448
22518
|
}
|
|
22449
|
-
)
|
|
22450
|
-
]
|
|
22451
|
-
|
|
22452
|
-
|
|
22453
|
-
|
|
22454
|
-
|
|
22455
|
-
|
|
22456
|
-
|
|
22457
|
-
|
|
22458
|
-
|
|
22459
|
-
|
|
22460
|
-
|
|
22461
|
-
|
|
22462
|
-
|
|
22463
|
-
|
|
22464
|
-
|
|
22465
|
-
|
|
22466
|
-
|
|
22467
|
-
|
|
22468
|
-
|
|
22469
|
-
|
|
22470
|
-
|
|
22471
|
-
|
|
22472
|
-
|
|
22473
|
-
|
|
22474
|
-
|
|
22475
|
-
|
|
22476
|
-
|
|
22477
|
-
|
|
22478
|
-
|
|
22479
|
-
|
|
22480
|
-
|
|
22481
|
-
|
|
22482
|
-
|
|
22483
|
-
|
|
22484
|
-
|
|
22485
|
-
|
|
22486
|
-
|
|
22487
|
-
|
|
22488
|
-
|
|
22489
|
-
|
|
22490
|
-
|
|
22491
|
-
|
|
22492
|
-
|
|
22493
|
-
|
|
22494
|
-
|
|
22495
|
-
|
|
22496
|
-
|
|
22497
|
-
|
|
22498
|
-
|
|
22499
|
-
|
|
22500
|
-
|
|
22501
|
-
|
|
22502
|
-
|
|
22503
|
-
|
|
22504
|
-
|
|
22505
|
-
|
|
22506
|
-
|
|
22507
|
-
|
|
22508
|
-
|
|
22509
|
-
selectionInfo && /* @__PURE__ */ jsx("div", { className: "df-details-header", children: /* @__PURE__ */ jsxs("div", { className: "df-details-header-info", children: [
|
|
22510
|
-
/* @__PURE__ */ jsx("span", { className: "df-details-header-title", children: selectionInfo.title }),
|
|
22511
|
-
/* @__PURE__ */ jsx("span", { className: "df-details-header-subtitle", children: selectionInfo.subtitle })
|
|
22512
|
-
] }) }),
|
|
22513
|
-
/* @__PURE__ */ jsx(DetailsPanel, { selection: selection2 })
|
|
22514
|
-
] })
|
|
22515
|
-
]
|
|
22516
|
-
}
|
|
22517
|
-
) });
|
|
22519
|
+
) })
|
|
22520
|
+
]
|
|
22521
|
+
}
|
|
22522
|
+
),
|
|
22523
|
+
displayMessage && /* @__PURE__ */ jsx(
|
|
22524
|
+
"div",
|
|
22525
|
+
{
|
|
22526
|
+
className: `df-visualizer-divider-horizontal ${isVerticalDragging ? "df-divider-active" : ""}`,
|
|
22527
|
+
onMouseDown: handleVerticalMouseDown
|
|
22528
|
+
}
|
|
22529
|
+
),
|
|
22530
|
+
displayMessage && /* @__PURE__ */ jsxs(
|
|
22531
|
+
"div",
|
|
22532
|
+
{
|
|
22533
|
+
className: "df-visualizer-result-panel",
|
|
22534
|
+
style: { height: `${100 - treePanelHeight}%` },
|
|
22535
|
+
children: [
|
|
22536
|
+
/* @__PURE__ */ jsxs("div", { className: "df-visualizer-result-header", children: [
|
|
22537
|
+
/* @__PURE__ */ jsx("span", { className: "df-visualizer-result-title", children: hasDebugTrace ? currentStepIndex !== void 0 && currentStepIndex >= 0 ? `Step ${currentStepIndex + 1}` : "Ready" : "Result" }),
|
|
22538
|
+
hasDebugTrace && currentChanges && currentChanges.length > 0 && /* @__PURE__ */ jsxs("span", { className: "df-visualizer-result-changes", children: [
|
|
22539
|
+
currentChanges.length,
|
|
22540
|
+
" change",
|
|
22541
|
+
currentChanges.length !== 1 ? "s" : ""
|
|
22542
|
+
] })
|
|
22543
|
+
] }),
|
|
22544
|
+
/* @__PURE__ */ jsx("div", { className: "df-visualizer-result-content", children: /* @__PURE__ */ jsx(
|
|
22545
|
+
JsonEditor,
|
|
22546
|
+
{
|
|
22547
|
+
value: JSON.stringify(displayMessage, null, 2),
|
|
22548
|
+
onChange: () => {
|
|
22549
|
+
},
|
|
22550
|
+
readOnly: true,
|
|
22551
|
+
theme: resolvedTheme === "dark" ? "dark" : "light",
|
|
22552
|
+
highlightedPaths
|
|
22553
|
+
}
|
|
22554
|
+
) })
|
|
22555
|
+
]
|
|
22556
|
+
}
|
|
22557
|
+
)
|
|
22558
|
+
]
|
|
22559
|
+
}
|
|
22560
|
+
),
|
|
22561
|
+
/* @__PURE__ */ jsx(
|
|
22562
|
+
"div",
|
|
22563
|
+
{
|
|
22564
|
+
className: `df-visualizer-divider ${isDragging ? "df-divider-active" : ""}`,
|
|
22565
|
+
onMouseDown: handleMouseDown
|
|
22566
|
+
}
|
|
22567
|
+
),
|
|
22568
|
+
/* @__PURE__ */ jsxs("div", { className: "df-visualizer-right", children: [
|
|
22569
|
+
selectionInfo && /* @__PURE__ */ jsx("div", { className: "df-details-header", children: /* @__PURE__ */ jsxs("div", { className: "df-details-header-info", children: [
|
|
22570
|
+
/* @__PURE__ */ jsx("span", { className: "df-details-header-title", children: selectionInfo.title }),
|
|
22571
|
+
/* @__PURE__ */ jsx("span", { className: "df-details-header-subtitle", children: selectionInfo.subtitle })
|
|
22572
|
+
] }) }),
|
|
22573
|
+
/* @__PURE__ */ jsx(DetailsPanel, { selection: selection2 })
|
|
22574
|
+
] })
|
|
22575
|
+
]
|
|
22576
|
+
}
|
|
22577
|
+
)
|
|
22578
|
+
] }) });
|
|
22518
22579
|
}
|
|
22519
22580
|
function WorkflowVisualizer({
|
|
22520
22581
|
workflows,
|
|
@@ -22523,12 +22584,10 @@ function WorkflowVisualizer({
|
|
|
22523
22584
|
theme = "system",
|
|
22524
22585
|
className = "",
|
|
22525
22586
|
executionResult,
|
|
22526
|
-
debugMode = false,
|
|
22527
22587
|
debugConfig,
|
|
22528
22588
|
debugPayload
|
|
22529
22589
|
}) {
|
|
22530
22590
|
if (debugConfig == null ? void 0 : debugConfig.enabled) {
|
|
22531
|
-
const showControls = debugConfig.showControls !== false;
|
|
22532
22591
|
return /* @__PURE__ */ jsx(ThemeProvider, { defaultTheme: theme, children: /* @__PURE__ */ jsx(
|
|
22533
22592
|
DebuggerProvider,
|
|
22534
22593
|
{
|
|
@@ -22542,8 +22601,6 @@ function WorkflowVisualizer({
|
|
|
22542
22601
|
onTaskSelect,
|
|
22543
22602
|
onWorkflowSelect,
|
|
22544
22603
|
executionResult,
|
|
22545
|
-
debugMode: true,
|
|
22546
|
-
showDebugToolbar: showControls,
|
|
22547
22604
|
debugConfig,
|
|
22548
22605
|
debugPayload
|
|
22549
22606
|
}
|
|
@@ -22557,8 +22614,7 @@ function WorkflowVisualizer({
|
|
|
22557
22614
|
workflows,
|
|
22558
22615
|
onTaskSelect,
|
|
22559
22616
|
onWorkflowSelect,
|
|
22560
|
-
executionResult
|
|
22561
|
-
debugMode
|
|
22617
|
+
executionResult
|
|
22562
22618
|
}
|
|
22563
22619
|
) }) });
|
|
22564
22620
|
}
|
package/package.json
CHANGED