@goplasmatic/dataflow-ui 2.0.11 → 2.0.13
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/dist/dataflow-ui.css +34 -0
- package/dist/index.cjs +106 -21
- package/dist/index.d.ts +11 -0
- package/dist/index.js +106 -21
- package/package.json +1 -1
package/dist/dataflow-ui.css
CHANGED
|
@@ -5902,6 +5902,40 @@ svg.react-flow__connectionline {
|
|
|
5902
5902
|
color: white;
|
|
5903
5903
|
}
|
|
5904
5904
|
|
|
5905
|
+
.df-debug-toolbar-options {
|
|
5906
|
+
display: flex;
|
|
5907
|
+
align-items: center;
|
|
5908
|
+
gap: 4px;
|
|
5909
|
+
padding-left: 8px;
|
|
5910
|
+
border-left: 1px solid var(--df-border-color);
|
|
5911
|
+
}
|
|
5912
|
+
|
|
5913
|
+
.df-debug-toolbar-checkbox-label {
|
|
5914
|
+
display: flex;
|
|
5915
|
+
align-items: center;
|
|
5916
|
+
gap: 4px;
|
|
5917
|
+
font-size: 11px;
|
|
5918
|
+
color: var(--df-text-secondary);
|
|
5919
|
+
cursor: pointer;
|
|
5920
|
+
user-select: none;
|
|
5921
|
+
}
|
|
5922
|
+
|
|
5923
|
+
.df-debug-toolbar-checkbox-label:hover {
|
|
5924
|
+
color: var(--df-text-primary);
|
|
5925
|
+
}
|
|
5926
|
+
|
|
5927
|
+
.df-debug-toolbar-checkbox {
|
|
5928
|
+
width: 14px;
|
|
5929
|
+
height: 14px;
|
|
5930
|
+
cursor: pointer;
|
|
5931
|
+
accent-color: var(--df-accent-primary);
|
|
5932
|
+
}
|
|
5933
|
+
|
|
5934
|
+
.df-debug-toolbar-checkbox:disabled {
|
|
5935
|
+
opacity: 0.5;
|
|
5936
|
+
cursor: not-allowed;
|
|
5937
|
+
}
|
|
5938
|
+
|
|
5905
5939
|
.df-debug-toolbar-actions {
|
|
5906
5940
|
display: flex;
|
|
5907
5941
|
align-items: center;
|
package/dist/index.cjs
CHANGED
|
@@ -581,8 +581,18 @@ const initialState = {
|
|
|
581
581
|
// 500ms between steps
|
|
582
582
|
inputPayload: null,
|
|
583
583
|
isExecuting: false,
|
|
584
|
-
executionError: null
|
|
584
|
+
executionError: null,
|
|
585
|
+
skipFailedConditions: false
|
|
585
586
|
};
|
|
587
|
+
function getFilteredStepIndices(trace, skipFailedConditions) {
|
|
588
|
+
if (!trace || trace.steps.length === 0) {
|
|
589
|
+
return [];
|
|
590
|
+
}
|
|
591
|
+
if (!skipFailedConditions) {
|
|
592
|
+
return trace.steps.map((_2, i) => i);
|
|
593
|
+
}
|
|
594
|
+
return trace.steps.map((step, i) => ({ step, index: i })).filter(({ step }) => step.result !== "skipped").map(({ index: index2 }) => index2);
|
|
595
|
+
}
|
|
586
596
|
function debuggerReducer(state, action) {
|
|
587
597
|
switch (action.type) {
|
|
588
598
|
case "ACTIVATE":
|
|
@@ -651,29 +661,58 @@ function debuggerReducer(state, action) {
|
|
|
651
661
|
playbackState: "stopped",
|
|
652
662
|
executionError: null
|
|
653
663
|
};
|
|
654
|
-
case "STEP_FORWARD":
|
|
664
|
+
case "STEP_FORWARD": {
|
|
655
665
|
if (!state.trace || state.trace.steps.length === 0) {
|
|
656
666
|
return state;
|
|
657
667
|
}
|
|
658
|
-
|
|
668
|
+
const filteredIndices = getFilteredStepIndices(state.trace, state.skipFailedConditions);
|
|
669
|
+
if (filteredIndices.length === 0) {
|
|
670
|
+
return state;
|
|
671
|
+
}
|
|
672
|
+
const currentFilteredPos = filteredIndices.findIndex((i) => i === state.currentStepIndex);
|
|
673
|
+
let nextIndex;
|
|
674
|
+
if (state.currentStepIndex === -1) {
|
|
675
|
+
nextIndex = filteredIndices[0];
|
|
676
|
+
} else if (currentFilteredPos === -1) {
|
|
677
|
+
nextIndex = filteredIndices[0];
|
|
678
|
+
} else if (currentFilteredPos >= filteredIndices.length - 1) {
|
|
659
679
|
return {
|
|
660
680
|
...state,
|
|
661
681
|
playbackState: "paused"
|
|
662
|
-
// Auto-pause at end
|
|
663
682
|
};
|
|
683
|
+
} else {
|
|
684
|
+
nextIndex = filteredIndices[currentFilteredPos + 1];
|
|
664
685
|
}
|
|
665
686
|
return {
|
|
666
687
|
...state,
|
|
667
|
-
currentStepIndex:
|
|
688
|
+
currentStepIndex: nextIndex
|
|
668
689
|
};
|
|
669
|
-
|
|
670
|
-
|
|
690
|
+
}
|
|
691
|
+
case "STEP_BACKWARD": {
|
|
692
|
+
if (!state.trace || state.currentStepIndex <= -1) {
|
|
693
|
+
return state;
|
|
694
|
+
}
|
|
695
|
+
const filteredIndices = getFilteredStepIndices(state.trace, state.skipFailedConditions);
|
|
696
|
+
if (filteredIndices.length === 0) {
|
|
697
|
+
return {
|
|
698
|
+
...state,
|
|
699
|
+
currentStepIndex: -1,
|
|
700
|
+
playbackState: "paused"
|
|
701
|
+
};
|
|
702
|
+
}
|
|
703
|
+
const currentFilteredPos = filteredIndices.findIndex((i) => i === state.currentStepIndex);
|
|
704
|
+
let prevIndex;
|
|
705
|
+
if (currentFilteredPos <= 0) {
|
|
706
|
+
prevIndex = -1;
|
|
707
|
+
} else {
|
|
708
|
+
prevIndex = filteredIndices[currentFilteredPos - 1];
|
|
709
|
+
}
|
|
671
710
|
return {
|
|
672
711
|
...state,
|
|
673
|
-
currentStepIndex:
|
|
712
|
+
currentStepIndex: prevIndex,
|
|
674
713
|
playbackState: "paused"
|
|
675
|
-
// Pause on manual step
|
|
676
714
|
};
|
|
715
|
+
}
|
|
677
716
|
case "GO_TO_STEP":
|
|
678
717
|
if (!state.trace || action.index < 0 || action.index >= state.trace.steps.length) return state;
|
|
679
718
|
return {
|
|
@@ -687,6 +726,25 @@ function debuggerReducer(state, action) {
|
|
|
687
726
|
...state,
|
|
688
727
|
playbackSpeed: Math.max(100, Math.min(2e3, action.speed))
|
|
689
728
|
};
|
|
729
|
+
case "SET_SKIP_FAILED_CONDITIONS": {
|
|
730
|
+
if (action.skip && state.trace && state.currentStepIndex >= 0) {
|
|
731
|
+
const currentStep = state.trace.steps[state.currentStepIndex];
|
|
732
|
+
if (currentStep && currentStep.result === "skipped") {
|
|
733
|
+
const filteredIndices = getFilteredStepIndices(state.trace, true);
|
|
734
|
+
const nextValidIndex = filteredIndices.find((i) => i > state.currentStepIndex);
|
|
735
|
+
const prevValidIndex = [...filteredIndices].reverse().find((i) => i < state.currentStepIndex);
|
|
736
|
+
return {
|
|
737
|
+
...state,
|
|
738
|
+
skipFailedConditions: action.skip,
|
|
739
|
+
currentStepIndex: nextValidIndex ?? prevValidIndex ?? -1
|
|
740
|
+
};
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
return {
|
|
744
|
+
...state,
|
|
745
|
+
skipFailedConditions: action.skip
|
|
746
|
+
};
|
|
747
|
+
}
|
|
690
748
|
default:
|
|
691
749
|
return state;
|
|
692
750
|
}
|
|
@@ -730,6 +788,10 @@ function DebuggerProvider({
|
|
|
730
788
|
const stepBackward = require$$0.useCallback(() => dispatch2({ type: "STEP_BACKWARD" }), []);
|
|
731
789
|
const goToStep = require$$0.useCallback((index2) => dispatch2({ type: "GO_TO_STEP", index: index2 }), []);
|
|
732
790
|
const setSpeed = require$$0.useCallback((speed) => dispatch2({ type: "SET_SPEED", speed }), []);
|
|
791
|
+
const setSkipFailedConditions = require$$0.useCallback(
|
|
792
|
+
(skip) => dispatch2({ type: "SET_SKIP_FAILED_CONDITIONS", skip }),
|
|
793
|
+
[]
|
|
794
|
+
);
|
|
733
795
|
const runExecution = require$$0.useCallback(
|
|
734
796
|
async (workflows, payload) => {
|
|
735
797
|
var _a;
|
|
@@ -782,11 +844,13 @@ function DebuggerProvider({
|
|
|
782
844
|
const currentStep = state.trace && state.currentStepIndex >= 0 ? state.trace.steps[state.currentStepIndex] : null;
|
|
783
845
|
const currentMessage = state.trace && state.currentStepIndex >= 0 ? getMessageAtStep(state.trace, state.currentStepIndex) : null;
|
|
784
846
|
const currentChanges = state.trace && state.currentStepIndex >= 0 ? getChangesAtStep(state.trace, state.currentStepIndex) : [];
|
|
785
|
-
const
|
|
847
|
+
const filteredStepIndices = getFilteredStepIndices(state.trace, state.skipFailedConditions);
|
|
848
|
+
const totalSteps = filteredStepIndices.length;
|
|
849
|
+
const currentFilteredPos = state.currentStepIndex >= 0 ? filteredStepIndices.findIndex((i) => i === state.currentStepIndex) : -1;
|
|
786
850
|
const isAtStart = state.currentStepIndex <= -1;
|
|
787
|
-
const isAtEnd =
|
|
851
|
+
const isAtEnd = currentFilteredPos >= totalSteps - 1 && currentFilteredPos >= 0;
|
|
788
852
|
const hasTrace = state.trace !== null && totalSteps > 0;
|
|
789
|
-
const progress = totalSteps > 0 &&
|
|
853
|
+
const progress = totalSteps > 0 && currentFilteredPos >= 0 ? (currentFilteredPos + 1) / totalSteps : 0;
|
|
790
854
|
const value = {
|
|
791
855
|
state,
|
|
792
856
|
dispatch: dispatch2,
|
|
@@ -804,6 +868,7 @@ function DebuggerProvider({
|
|
|
804
868
|
stepBackward,
|
|
805
869
|
goToStep,
|
|
806
870
|
setSpeed,
|
|
871
|
+
setSkipFailedConditions,
|
|
807
872
|
runExecution,
|
|
808
873
|
currentStep,
|
|
809
874
|
currentMessage,
|
|
@@ -813,7 +878,10 @@ function DebuggerProvider({
|
|
|
813
878
|
hasTrace,
|
|
814
879
|
progress,
|
|
815
880
|
totalSteps,
|
|
816
|
-
|
|
881
|
+
currentFilteredPosition: currentFilteredPos,
|
|
882
|
+
filteredStepIndices,
|
|
883
|
+
isEngineReady,
|
|
884
|
+
skipFailedConditions: state.skipFailedConditions
|
|
817
885
|
};
|
|
818
886
|
return /* @__PURE__ */ jsxRuntime.jsx(DebuggerContext.Provider, { value, children: children2 });
|
|
819
887
|
}
|
|
@@ -21101,9 +21169,13 @@ function IntegratedDebugToolbar({
|
|
|
21101
21169
|
isAtEnd,
|
|
21102
21170
|
hasTrace,
|
|
21103
21171
|
totalSteps,
|
|
21104
|
-
|
|
21172
|
+
currentFilteredPosition,
|
|
21173
|
+
filteredStepIndices,
|
|
21174
|
+
isEngineReady,
|
|
21175
|
+
skipFailedConditions,
|
|
21176
|
+
setSkipFailedConditions
|
|
21105
21177
|
} = useDebugger();
|
|
21106
|
-
const { playbackState,
|
|
21178
|
+
const { playbackState, isExecuting, executionError, trace } = state;
|
|
21107
21179
|
const lastExecutionRef = require$$0.useRef(null);
|
|
21108
21180
|
const handleExecute = require$$0.useCallback(async () => {
|
|
21109
21181
|
var _a, _b;
|
|
@@ -21148,10 +21220,10 @@ function IntegratedDebugToolbar({
|
|
|
21148
21220
|
}
|
|
21149
21221
|
}, [hasTrace, stop]);
|
|
21150
21222
|
const goToLast = require$$0.useCallback(() => {
|
|
21151
|
-
if (hasTrace &&
|
|
21152
|
-
goToStep(
|
|
21223
|
+
if (hasTrace && filteredStepIndices.length > 0) {
|
|
21224
|
+
goToStep(filteredStepIndices[filteredStepIndices.length - 1]);
|
|
21153
21225
|
}
|
|
21154
|
-
}, [hasTrace,
|
|
21226
|
+
}, [hasTrace, filteredStepIndices, goToStep]);
|
|
21155
21227
|
require$$0.useEffect(() => {
|
|
21156
21228
|
if (!autoExecute || !isEngineReady || workflows.length === 0) return;
|
|
21157
21229
|
const timeoutId = setTimeout(() => {
|
|
@@ -21236,10 +21308,10 @@ function IntegratedDebugToolbar({
|
|
|
21236
21308
|
if (!hasTrace) {
|
|
21237
21309
|
return "Ready";
|
|
21238
21310
|
}
|
|
21239
|
-
if (
|
|
21311
|
+
if (currentFilteredPosition < 0) {
|
|
21240
21312
|
return "Ready";
|
|
21241
21313
|
}
|
|
21242
|
-
return `Step ${
|
|
21314
|
+
return `Step ${currentFilteredPosition + 1} / ${totalSteps}`;
|
|
21243
21315
|
};
|
|
21244
21316
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `df-debug-toolbar-integrated ${className}`, children: [
|
|
21245
21317
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "df-debug-toolbar-status", children: [
|
|
@@ -21307,6 +21379,19 @@ function IntegratedDebugToolbar({
|
|
|
21307
21379
|
}
|
|
21308
21380
|
)
|
|
21309
21381
|
] }),
|
|
21382
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-debug-toolbar-options", children: /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "df-debug-toolbar-checkbox-label", children: [
|
|
21383
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21384
|
+
"input",
|
|
21385
|
+
{
|
|
21386
|
+
type: "checkbox",
|
|
21387
|
+
checked: skipFailedConditions,
|
|
21388
|
+
onChange: (e) => setSkipFailedConditions(e.target.checked),
|
|
21389
|
+
className: "df-debug-toolbar-checkbox",
|
|
21390
|
+
disabled: isExecuting
|
|
21391
|
+
}
|
|
21392
|
+
),
|
|
21393
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Filter Workflows" })
|
|
21394
|
+
] }) }),
|
|
21310
21395
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "df-debug-toolbar-actions", children: hasTrace ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
21311
21396
|
"button",
|
|
21312
21397
|
{
|
|
@@ -22323,7 +22408,7 @@ function JsonEditor({
|
|
|
22323
22408
|
acceptSuggestionOnEnter: "off",
|
|
22324
22409
|
formatOnPaste: true,
|
|
22325
22410
|
formatOnType: false,
|
|
22326
|
-
glyphMargin:
|
|
22411
|
+
glyphMargin: false
|
|
22327
22412
|
}
|
|
22328
22413
|
}
|
|
22329
22414
|
) });
|
package/dist/index.d.ts
CHANGED
|
@@ -162,6 +162,9 @@ export declare type DebuggerAction = {
|
|
|
162
162
|
} | {
|
|
163
163
|
type: 'SET_SPEED';
|
|
164
164
|
speed: number;
|
|
165
|
+
} | {
|
|
166
|
+
type: 'SET_SKIP_FAILED_CONDITIONS';
|
|
167
|
+
skip: boolean;
|
|
165
168
|
};
|
|
166
169
|
|
|
167
170
|
/**
|
|
@@ -184,6 +187,7 @@ declare interface DebuggerContextValue {
|
|
|
184
187
|
stepBackward: () => void;
|
|
185
188
|
goToStep: (index: number) => void;
|
|
186
189
|
setSpeed: (speed: number) => void;
|
|
190
|
+
setSkipFailedConditions: (skip: boolean) => void;
|
|
187
191
|
runExecution: (workflows: Workflow[], payload: Record<string, unknown>) => Promise<ExecutionTrace | null>;
|
|
188
192
|
currentStep: ExecutionStep | null;
|
|
189
193
|
currentMessage: Message | null;
|
|
@@ -193,7 +197,12 @@ declare interface DebuggerContextValue {
|
|
|
193
197
|
hasTrace: boolean;
|
|
194
198
|
progress: number;
|
|
195
199
|
totalSteps: number;
|
|
200
|
+
/** Current position within filtered steps (0-indexed), -1 if at ready state */
|
|
201
|
+
currentFilteredPosition: number;
|
|
202
|
+
/** Array of actual step indices that are shown (for navigation) */
|
|
203
|
+
filteredStepIndices: number[];
|
|
196
204
|
isEngineReady: boolean;
|
|
205
|
+
skipFailedConditions: boolean;
|
|
197
206
|
}
|
|
198
207
|
|
|
199
208
|
/**
|
|
@@ -247,6 +256,8 @@ export declare interface DebuggerState {
|
|
|
247
256
|
isExecuting: boolean;
|
|
248
257
|
/** Error during execution */
|
|
249
258
|
executionError: string | null;
|
|
259
|
+
/** Whether to skip steps with failed conditions (result: 'skipped') */
|
|
260
|
+
skipFailedConditions: boolean;
|
|
250
261
|
}
|
|
251
262
|
|
|
252
263
|
/**
|
package/dist/index.js
CHANGED
|
@@ -579,8 +579,18 @@ const initialState = {
|
|
|
579
579
|
// 500ms between steps
|
|
580
580
|
inputPayload: null,
|
|
581
581
|
isExecuting: false,
|
|
582
|
-
executionError: null
|
|
582
|
+
executionError: null,
|
|
583
|
+
skipFailedConditions: false
|
|
583
584
|
};
|
|
585
|
+
function getFilteredStepIndices(trace, skipFailedConditions) {
|
|
586
|
+
if (!trace || trace.steps.length === 0) {
|
|
587
|
+
return [];
|
|
588
|
+
}
|
|
589
|
+
if (!skipFailedConditions) {
|
|
590
|
+
return trace.steps.map((_2, i) => i);
|
|
591
|
+
}
|
|
592
|
+
return trace.steps.map((step, i) => ({ step, index: i })).filter(({ step }) => step.result !== "skipped").map(({ index: index2 }) => index2);
|
|
593
|
+
}
|
|
584
594
|
function debuggerReducer(state, action) {
|
|
585
595
|
switch (action.type) {
|
|
586
596
|
case "ACTIVATE":
|
|
@@ -649,29 +659,58 @@ function debuggerReducer(state, action) {
|
|
|
649
659
|
playbackState: "stopped",
|
|
650
660
|
executionError: null
|
|
651
661
|
};
|
|
652
|
-
case "STEP_FORWARD":
|
|
662
|
+
case "STEP_FORWARD": {
|
|
653
663
|
if (!state.trace || state.trace.steps.length === 0) {
|
|
654
664
|
return state;
|
|
655
665
|
}
|
|
656
|
-
|
|
666
|
+
const filteredIndices = getFilteredStepIndices(state.trace, state.skipFailedConditions);
|
|
667
|
+
if (filteredIndices.length === 0) {
|
|
668
|
+
return state;
|
|
669
|
+
}
|
|
670
|
+
const currentFilteredPos = filteredIndices.findIndex((i) => i === state.currentStepIndex);
|
|
671
|
+
let nextIndex;
|
|
672
|
+
if (state.currentStepIndex === -1) {
|
|
673
|
+
nextIndex = filteredIndices[0];
|
|
674
|
+
} else if (currentFilteredPos === -1) {
|
|
675
|
+
nextIndex = filteredIndices[0];
|
|
676
|
+
} else if (currentFilteredPos >= filteredIndices.length - 1) {
|
|
657
677
|
return {
|
|
658
678
|
...state,
|
|
659
679
|
playbackState: "paused"
|
|
660
|
-
// Auto-pause at end
|
|
661
680
|
};
|
|
681
|
+
} else {
|
|
682
|
+
nextIndex = filteredIndices[currentFilteredPos + 1];
|
|
662
683
|
}
|
|
663
684
|
return {
|
|
664
685
|
...state,
|
|
665
|
-
currentStepIndex:
|
|
686
|
+
currentStepIndex: nextIndex
|
|
666
687
|
};
|
|
667
|
-
|
|
668
|
-
|
|
688
|
+
}
|
|
689
|
+
case "STEP_BACKWARD": {
|
|
690
|
+
if (!state.trace || state.currentStepIndex <= -1) {
|
|
691
|
+
return state;
|
|
692
|
+
}
|
|
693
|
+
const filteredIndices = getFilteredStepIndices(state.trace, state.skipFailedConditions);
|
|
694
|
+
if (filteredIndices.length === 0) {
|
|
695
|
+
return {
|
|
696
|
+
...state,
|
|
697
|
+
currentStepIndex: -1,
|
|
698
|
+
playbackState: "paused"
|
|
699
|
+
};
|
|
700
|
+
}
|
|
701
|
+
const currentFilteredPos = filteredIndices.findIndex((i) => i === state.currentStepIndex);
|
|
702
|
+
let prevIndex;
|
|
703
|
+
if (currentFilteredPos <= 0) {
|
|
704
|
+
prevIndex = -1;
|
|
705
|
+
} else {
|
|
706
|
+
prevIndex = filteredIndices[currentFilteredPos - 1];
|
|
707
|
+
}
|
|
669
708
|
return {
|
|
670
709
|
...state,
|
|
671
|
-
currentStepIndex:
|
|
710
|
+
currentStepIndex: prevIndex,
|
|
672
711
|
playbackState: "paused"
|
|
673
|
-
// Pause on manual step
|
|
674
712
|
};
|
|
713
|
+
}
|
|
675
714
|
case "GO_TO_STEP":
|
|
676
715
|
if (!state.trace || action.index < 0 || action.index >= state.trace.steps.length) return state;
|
|
677
716
|
return {
|
|
@@ -685,6 +724,25 @@ function debuggerReducer(state, action) {
|
|
|
685
724
|
...state,
|
|
686
725
|
playbackSpeed: Math.max(100, Math.min(2e3, action.speed))
|
|
687
726
|
};
|
|
727
|
+
case "SET_SKIP_FAILED_CONDITIONS": {
|
|
728
|
+
if (action.skip && state.trace && state.currentStepIndex >= 0) {
|
|
729
|
+
const currentStep = state.trace.steps[state.currentStepIndex];
|
|
730
|
+
if (currentStep && currentStep.result === "skipped") {
|
|
731
|
+
const filteredIndices = getFilteredStepIndices(state.trace, true);
|
|
732
|
+
const nextValidIndex = filteredIndices.find((i) => i > state.currentStepIndex);
|
|
733
|
+
const prevValidIndex = [...filteredIndices].reverse().find((i) => i < state.currentStepIndex);
|
|
734
|
+
return {
|
|
735
|
+
...state,
|
|
736
|
+
skipFailedConditions: action.skip,
|
|
737
|
+
currentStepIndex: nextValidIndex ?? prevValidIndex ?? -1
|
|
738
|
+
};
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
return {
|
|
742
|
+
...state,
|
|
743
|
+
skipFailedConditions: action.skip
|
|
744
|
+
};
|
|
745
|
+
}
|
|
688
746
|
default:
|
|
689
747
|
return state;
|
|
690
748
|
}
|
|
@@ -728,6 +786,10 @@ function DebuggerProvider({
|
|
|
728
786
|
const stepBackward = useCallback(() => dispatch2({ type: "STEP_BACKWARD" }), []);
|
|
729
787
|
const goToStep = useCallback((index2) => dispatch2({ type: "GO_TO_STEP", index: index2 }), []);
|
|
730
788
|
const setSpeed = useCallback((speed) => dispatch2({ type: "SET_SPEED", speed }), []);
|
|
789
|
+
const setSkipFailedConditions = useCallback(
|
|
790
|
+
(skip) => dispatch2({ type: "SET_SKIP_FAILED_CONDITIONS", skip }),
|
|
791
|
+
[]
|
|
792
|
+
);
|
|
731
793
|
const runExecution = useCallback(
|
|
732
794
|
async (workflows, payload) => {
|
|
733
795
|
var _a;
|
|
@@ -780,11 +842,13 @@ function DebuggerProvider({
|
|
|
780
842
|
const currentStep = state.trace && state.currentStepIndex >= 0 ? state.trace.steps[state.currentStepIndex] : null;
|
|
781
843
|
const currentMessage = state.trace && state.currentStepIndex >= 0 ? getMessageAtStep(state.trace, state.currentStepIndex) : null;
|
|
782
844
|
const currentChanges = state.trace && state.currentStepIndex >= 0 ? getChangesAtStep(state.trace, state.currentStepIndex) : [];
|
|
783
|
-
const
|
|
845
|
+
const filteredStepIndices = getFilteredStepIndices(state.trace, state.skipFailedConditions);
|
|
846
|
+
const totalSteps = filteredStepIndices.length;
|
|
847
|
+
const currentFilteredPos = state.currentStepIndex >= 0 ? filteredStepIndices.findIndex((i) => i === state.currentStepIndex) : -1;
|
|
784
848
|
const isAtStart = state.currentStepIndex <= -1;
|
|
785
|
-
const isAtEnd =
|
|
849
|
+
const isAtEnd = currentFilteredPos >= totalSteps - 1 && currentFilteredPos >= 0;
|
|
786
850
|
const hasTrace = state.trace !== null && totalSteps > 0;
|
|
787
|
-
const progress = totalSteps > 0 &&
|
|
851
|
+
const progress = totalSteps > 0 && currentFilteredPos >= 0 ? (currentFilteredPos + 1) / totalSteps : 0;
|
|
788
852
|
const value = {
|
|
789
853
|
state,
|
|
790
854
|
dispatch: dispatch2,
|
|
@@ -802,6 +866,7 @@ function DebuggerProvider({
|
|
|
802
866
|
stepBackward,
|
|
803
867
|
goToStep,
|
|
804
868
|
setSpeed,
|
|
869
|
+
setSkipFailedConditions,
|
|
805
870
|
runExecution,
|
|
806
871
|
currentStep,
|
|
807
872
|
currentMessage,
|
|
@@ -811,7 +876,10 @@ function DebuggerProvider({
|
|
|
811
876
|
hasTrace,
|
|
812
877
|
progress,
|
|
813
878
|
totalSteps,
|
|
814
|
-
|
|
879
|
+
currentFilteredPosition: currentFilteredPos,
|
|
880
|
+
filteredStepIndices,
|
|
881
|
+
isEngineReady,
|
|
882
|
+
skipFailedConditions: state.skipFailedConditions
|
|
815
883
|
};
|
|
816
884
|
return /* @__PURE__ */ jsx(DebuggerContext.Provider, { value, children: children2 });
|
|
817
885
|
}
|
|
@@ -21099,9 +21167,13 @@ function IntegratedDebugToolbar({
|
|
|
21099
21167
|
isAtEnd,
|
|
21100
21168
|
hasTrace,
|
|
21101
21169
|
totalSteps,
|
|
21102
|
-
|
|
21170
|
+
currentFilteredPosition,
|
|
21171
|
+
filteredStepIndices,
|
|
21172
|
+
isEngineReady,
|
|
21173
|
+
skipFailedConditions,
|
|
21174
|
+
setSkipFailedConditions
|
|
21103
21175
|
} = useDebugger();
|
|
21104
|
-
const { playbackState,
|
|
21176
|
+
const { playbackState, isExecuting, executionError, trace } = state;
|
|
21105
21177
|
const lastExecutionRef = useRef(null);
|
|
21106
21178
|
const handleExecute = useCallback(async () => {
|
|
21107
21179
|
var _a, _b;
|
|
@@ -21146,10 +21218,10 @@ function IntegratedDebugToolbar({
|
|
|
21146
21218
|
}
|
|
21147
21219
|
}, [hasTrace, stop]);
|
|
21148
21220
|
const goToLast = useCallback(() => {
|
|
21149
|
-
if (hasTrace &&
|
|
21150
|
-
goToStep(
|
|
21221
|
+
if (hasTrace && filteredStepIndices.length > 0) {
|
|
21222
|
+
goToStep(filteredStepIndices[filteredStepIndices.length - 1]);
|
|
21151
21223
|
}
|
|
21152
|
-
}, [hasTrace,
|
|
21224
|
+
}, [hasTrace, filteredStepIndices, goToStep]);
|
|
21153
21225
|
useEffect(() => {
|
|
21154
21226
|
if (!autoExecute || !isEngineReady || workflows.length === 0) return;
|
|
21155
21227
|
const timeoutId = setTimeout(() => {
|
|
@@ -21234,10 +21306,10 @@ function IntegratedDebugToolbar({
|
|
|
21234
21306
|
if (!hasTrace) {
|
|
21235
21307
|
return "Ready";
|
|
21236
21308
|
}
|
|
21237
|
-
if (
|
|
21309
|
+
if (currentFilteredPosition < 0) {
|
|
21238
21310
|
return "Ready";
|
|
21239
21311
|
}
|
|
21240
|
-
return `Step ${
|
|
21312
|
+
return `Step ${currentFilteredPosition + 1} / ${totalSteps}`;
|
|
21241
21313
|
};
|
|
21242
21314
|
return /* @__PURE__ */ jsxs("div", { className: `df-debug-toolbar-integrated ${className}`, children: [
|
|
21243
21315
|
/* @__PURE__ */ jsxs("div", { className: "df-debug-toolbar-status", children: [
|
|
@@ -21305,6 +21377,19 @@ function IntegratedDebugToolbar({
|
|
|
21305
21377
|
}
|
|
21306
21378
|
)
|
|
21307
21379
|
] }),
|
|
21380
|
+
/* @__PURE__ */ jsx("div", { className: "df-debug-toolbar-options", children: /* @__PURE__ */ jsxs("label", { className: "df-debug-toolbar-checkbox-label", children: [
|
|
21381
|
+
/* @__PURE__ */ jsx(
|
|
21382
|
+
"input",
|
|
21383
|
+
{
|
|
21384
|
+
type: "checkbox",
|
|
21385
|
+
checked: skipFailedConditions,
|
|
21386
|
+
onChange: (e) => setSkipFailedConditions(e.target.checked),
|
|
21387
|
+
className: "df-debug-toolbar-checkbox",
|
|
21388
|
+
disabled: isExecuting
|
|
21389
|
+
}
|
|
21390
|
+
),
|
|
21391
|
+
/* @__PURE__ */ jsx("span", { children: "Filter Workflows" })
|
|
21392
|
+
] }) }),
|
|
21308
21393
|
/* @__PURE__ */ jsx("div", { className: "df-debug-toolbar-actions", children: hasTrace ? /* @__PURE__ */ jsxs(
|
|
21309
21394
|
"button",
|
|
21310
21395
|
{
|
|
@@ -22321,7 +22406,7 @@ function JsonEditor({
|
|
|
22321
22406
|
acceptSuggestionOnEnter: "off",
|
|
22322
22407
|
formatOnPaste: true,
|
|
22323
22408
|
formatOnType: false,
|
|
22324
|
-
glyphMargin:
|
|
22409
|
+
glyphMargin: false
|
|
22325
22410
|
}
|
|
22326
22411
|
}
|
|
22327
22412
|
) });
|
package/package.json
CHANGED