@runtypelabs/react-flow 0.1.3 → 0.1.5
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/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +15 -0
- package/dist/index.js +5 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -13
- package/dist/index.mjs.map +1 -1
- package/example/CHANGELOG.md +18 -0
- package/example/node_modules/.bin/tsc +2 -2
- package/example/node_modules/.bin/tsserver +2 -2
- package/example/node_modules/.bin/vite +2 -2
- package/example/package.json +1 -2
- package/example/src/App.tsx +3 -15
- package/package.json +2 -2
- package/src/hooks/useRuntypeFlow.ts +8 -19
package/dist/index.mjs
CHANGED
|
@@ -642,8 +642,7 @@ function useRuntypeFlow(options) {
|
|
|
642
642
|
setError(null);
|
|
643
643
|
try {
|
|
644
644
|
const flow = await client.flows.get(id);
|
|
645
|
-
const
|
|
646
|
-
const steps = Array.isArray(stepsResponse) ? stepsResponse : [];
|
|
645
|
+
const steps = Array.isArray(flow.flowSteps) ? flow.flowSteps : [];
|
|
647
646
|
let newNodes = flowStepsToNodes(steps, {
|
|
648
647
|
onChange: handleStepChange,
|
|
649
648
|
onDelete: handleStepDelete
|
|
@@ -679,22 +678,15 @@ function useRuntypeFlow(options) {
|
|
|
679
678
|
const steps = nodesToFlowSteps(nodes);
|
|
680
679
|
await client.flows.update(flowId, {
|
|
681
680
|
name: flowName,
|
|
682
|
-
description: flowDescription
|
|
683
|
-
|
|
684
|
-
const existingSteps = await client.flowSteps.getByFlow(flowId);
|
|
685
|
-
for (const step of existingSteps) {
|
|
686
|
-
await client.flowSteps.delete(step.id);
|
|
687
|
-
}
|
|
688
|
-
for (const step of steps) {
|
|
689
|
-
await client.flowSteps.create({
|
|
690
|
-
flowId,
|
|
681
|
+
description: flowDescription,
|
|
682
|
+
flow_steps: steps.map((step) => ({
|
|
691
683
|
type: step.type,
|
|
692
684
|
name: step.name,
|
|
693
685
|
order: step.order,
|
|
694
686
|
enabled: step.enabled,
|
|
695
687
|
config: step.config
|
|
696
|
-
})
|
|
697
|
-
}
|
|
688
|
+
}))
|
|
689
|
+
});
|
|
698
690
|
setHasUnsavedChanges(false);
|
|
699
691
|
lastSavedState.current = JSON.stringify(steps);
|
|
700
692
|
return {
|