@runtypelabs/react-flow 0.3.3 → 0.3.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @runtypelabs/react-flow@0.3.3 build /home/runner/_work/core/core/packages/react-flow
2
+ > @runtypelabs/react-flow@0.3.5 build /home/runner/_work/core/core/packages/react-flow
3
3
  > tsup
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -10,7 +10,7 @@
10
10
  CLI Cleaning output folder
11
11
  CJS Build start
12
12
  ESM Build start
13
- CJS dist/index.js 105.43 KB
14
- CJS ⚡️ Build success in 167ms
15
- ESM dist/index.mjs 101.38 KB
16
- ESM ⚡️ Build success in 167ms
13
+ ESM dist/index.mjs 101.53 KB
14
+ ESM ⚡️ Build success in 390ms
15
+ CJS dist/index.js 105.58 KB
16
+ CJS ⚡️ Build success in 390ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @runtypelabs/react-flow
2
2
 
3
+ ## 0.3.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 2a11be5: Enforce strict TypeScript checking across all projects in CI
8
+ - Updated dependencies [b3a580e]
9
+ - @runtypelabs/sdk@1.21.2
10
+
11
+ ## 0.3.4
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies [c5e0c1d]
16
+ - @runtypelabs/sdk@1.21.1
17
+
3
18
  ## 0.3.3
4
19
 
5
20
  ### Patch Changes
package/dist/index.js CHANGED
@@ -661,7 +661,14 @@ function useRuntypeFlow(options) {
661
661
  setError(null);
662
662
  try {
663
663
  const flow = await client.flows.get(id);
664
- const steps = Array.isArray(flow.flowSteps) ? flow.flowSteps : [];
664
+ const steps = Array.isArray(flow.flowSteps) ? flow.flowSteps.map((s) => ({
665
+ id: s.id,
666
+ type: s.type,
667
+ name: s.name,
668
+ order: s.order,
669
+ enabled: s.enabled,
670
+ config: s.config
671
+ })) : [];
665
672
  let newNodes = flowStepsToNodes(steps, {
666
673
  onChange: handleStepChange,
667
674
  onDelete: handleStepDelete
@@ -698,7 +705,7 @@ function useRuntypeFlow(options) {
698
705
  await client.flows.update(flowId, {
699
706
  name: flowName,
700
707
  description: flowDescription,
701
- flow_steps: steps.map((step) => ({
708
+ flowSteps: steps.map((step) => ({
702
709
  type: step.type,
703
710
  name: step.name,
704
711
  order: step.order,
@@ -728,8 +735,7 @@ function useRuntypeFlow(options) {
728
735
  try {
729
736
  const flow = await client.flows.create({
730
737
  name,
731
- description,
732
- prompts: []
738
+ description
733
739
  });
734
740
  setFlowId(flow.id);
735
741
  setFlowName(name);
package/dist/index.mjs CHANGED
@@ -659,7 +659,14 @@ function useRuntypeFlow(options) {
659
659
  setError(null);
660
660
  try {
661
661
  const flow = await client.flows.get(id);
662
- const steps = Array.isArray(flow.flowSteps) ? flow.flowSteps : [];
662
+ const steps = Array.isArray(flow.flowSteps) ? flow.flowSteps.map((s) => ({
663
+ id: s.id,
664
+ type: s.type,
665
+ name: s.name,
666
+ order: s.order,
667
+ enabled: s.enabled,
668
+ config: s.config
669
+ })) : [];
663
670
  let newNodes = flowStepsToNodes(steps, {
664
671
  onChange: handleStepChange,
665
672
  onDelete: handleStepDelete
@@ -696,7 +703,7 @@ function useRuntypeFlow(options) {
696
703
  await client.flows.update(flowId, {
697
704
  name: flowName,
698
705
  description: flowDescription,
699
- flow_steps: steps.map((step) => ({
706
+ flowSteps: steps.map((step) => ({
700
707
  type: step.type,
701
708
  name: step.name,
702
709
  order: step.order,
@@ -726,8 +733,7 @@ function useRuntypeFlow(options) {
726
733
  try {
727
734
  const flow = await client.flows.create({
728
735
  name,
729
- description,
730
- prompts: []
736
+ description
731
737
  });
732
738
  setFlowId(flow.id);
733
739
  setFlowName(name);
@@ -1,5 +1,22 @@
1
1
  # @runtypelabs/react-flow-example
2
2
 
3
+ ## 0.0.53
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [2a11be5]
8
+ - Updated dependencies [b3a580e]
9
+ - @runtypelabs/react-flow@0.3.5
10
+ - @runtypelabs/sdk@1.21.2
11
+
12
+ ## 0.0.52
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies [c5e0c1d]
17
+ - @runtypelabs/sdk@1.21.1
18
+ - @runtypelabs/react-flow@0.3.4
19
+
3
20
  ## 0.0.51
4
21
 
5
22
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runtypelabs/react-flow-example",
3
- "version": "0.0.51",
3
+ "version": "0.0.53",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "scripts": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runtypelabs/react-flow",
3
- "version": "0.3.3",
3
+ "version": "0.3.5",
4
4
  "description": "React Flow adapter for building visual flow editors with Runtype",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -16,7 +16,7 @@
16
16
  "*.css"
17
17
  ],
18
18
  "dependencies": {
19
- "@runtypelabs/sdk": "1.21.0"
19
+ "@runtypelabs/sdk": "1.21.2"
20
20
  },
21
21
  "peerDependencies": {
22
22
  "@xyflow/react": "^12.0.0",
@@ -3,12 +3,10 @@ import {
3
3
  useNodesState,
4
4
  useEdgesState,
5
5
  addEdge,
6
- type OnNodesChange,
7
- type OnEdgesChange,
8
6
  type OnConnect,
9
7
  type Connection,
10
8
  } from '@xyflow/react'
11
- import type { RuntypeClient } from '@runtypelabs/sdk'
9
+ import type { RuntypeClient, CreateFlowRequest } from '@runtypelabs/sdk'
12
10
  import type { FlowStep, RuntypeNode, RuntypeEdge, SavedFlow, UseRuntypeFlowReturn } from '../types'
13
11
  import {
14
12
  flowStepsToNodes,
@@ -136,7 +134,16 @@ export function useRuntypeFlow(options: UseRuntypeFlowOptions): UseRuntypeFlowRe
136
134
  const flow = await client.flows.get(id)
137
135
 
138
136
  // Use flow steps from the flow response (consolidated endpoint)
139
- const steps: FlowStep[] = Array.isArray(flow.flowSteps) ? flow.flowSteps : []
137
+ const steps: FlowStep[] = Array.isArray(flow.flowSteps)
138
+ ? flow.flowSteps.map((s) => ({
139
+ id: s.id,
140
+ type: s.type as FlowStep['type'],
141
+ name: s.name,
142
+ order: s.order,
143
+ enabled: s.enabled,
144
+ config: s.config as FlowStep['config'],
145
+ }))
146
+ : []
140
147
 
141
148
  // Convert to React Flow nodes
142
149
  let newNodes = flowStepsToNodes(steps, {
@@ -189,12 +196,12 @@ export function useRuntypeFlow(options: UseRuntypeFlowOptions): UseRuntypeFlowRe
189
196
  await client.flows.update(flowId, {
190
197
  name: flowName,
191
198
  description: flowDescription,
192
- flow_steps: steps.map((step) => ({
193
- type: step.type,
199
+ flowSteps: steps.map((step) => ({
200
+ type: step.type as NonNullable<CreateFlowRequest['flowSteps']>[number]['type'],
194
201
  name: step.name,
195
202
  order: step.order,
196
203
  enabled: step.enabled,
197
- config: step.config,
204
+ config: step.config as NonNullable<CreateFlowRequest['flowSteps']>[number]['config'],
198
205
  })),
199
206
  })
200
207
 
@@ -227,7 +234,6 @@ export function useRuntypeFlow(options: UseRuntypeFlowOptions): UseRuntypeFlowRe
227
234
  const flow = await client.flows.create({
228
235
  name,
229
236
  description,
230
- prompts: [],
231
237
  })
232
238
 
233
239
  setFlowId(flow.id)