@runtypelabs/react-flow 1.0.122 → 1.0.125
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/CHANGELOG.md +24 -0
- package/dist/index.js +13 -26
- package/dist/index.mjs +12 -24
- package/example/CHANGELOG.md +27 -0
- package/example/package.json +2 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @runtypelabs/react-flow
|
|
2
2
|
|
|
3
|
+
## 1.0.125
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 22e97cc: Refresh development tooling and use an isolated TypeScript 7.1 declaration emitter with tsdown.
|
|
8
|
+
- Updated dependencies [fdae910]
|
|
9
|
+
- Updated dependencies [22e97cc]
|
|
10
|
+
- @runtypelabs/sdk@11.8.2
|
|
11
|
+
|
|
12
|
+
## 1.0.124
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [b91d8ad]
|
|
17
|
+
- @runtypelabs/sdk@11.8.1
|
|
18
|
+
|
|
19
|
+
## 1.0.123
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies [5ab971e]
|
|
24
|
+
- Updated dependencies [35f7f5a]
|
|
25
|
+
- @runtypelabs/sdk@11.8.0
|
|
26
|
+
|
|
3
27
|
## 1.0.122
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// \0rolldown/runtime.js
|
|
3
3
|
var __create = Object.create;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -20,12 +20,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
20
20
|
value: mod,
|
|
21
21
|
enumerable: true
|
|
22
22
|
}) : target, mod));
|
|
23
|
-
//#endregion
|
|
24
23
|
let react = require("react");
|
|
25
24
|
react = __toESM(react);
|
|
26
25
|
let _xyflow_react = require("@xyflow/react");
|
|
27
26
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
28
|
-
|
|
27
|
+
// src/types/index.ts
|
|
29
28
|
/**
|
|
30
29
|
* Supported node types that have custom components
|
|
31
30
|
*/
|
|
@@ -42,8 +41,7 @@ const SUPPORTED_NODE_TYPES = [
|
|
|
42
41
|
function isSupportedNodeType(type) {
|
|
43
42
|
return SUPPORTED_NODE_TYPES.includes(type);
|
|
44
43
|
}
|
|
45
|
-
|
|
46
|
-
//#region src/utils/adapter.ts
|
|
44
|
+
// src/utils/adapter.ts
|
|
47
45
|
const NODE_HEIGHT = 200;
|
|
48
46
|
const NODE_SPACING_Y = 80;
|
|
49
47
|
const BRANCH_OFFSET_X = 350;
|
|
@@ -476,8 +474,7 @@ function cloneStep(step) {
|
|
|
476
474
|
config: JSON.parse(JSON.stringify(step.config))
|
|
477
475
|
};
|
|
478
476
|
}
|
|
479
|
-
|
|
480
|
-
//#region src/utils/layout.ts
|
|
477
|
+
// src/utils/layout.ts
|
|
481
478
|
const DEFAULT_NODE_WIDTH = 280;
|
|
482
479
|
const DEFAULT_NODE_HEIGHT = 150;
|
|
483
480
|
const HORIZONTAL_SPACING = 100;
|
|
@@ -666,8 +663,7 @@ function getNodesBoundingBox(nodes) {
|
|
|
666
663
|
height: maxY - minY
|
|
667
664
|
};
|
|
668
665
|
}
|
|
669
|
-
|
|
670
|
-
//#region src/hooks/useRuntypeFlow.ts
|
|
666
|
+
// src/hooks/useRuntypeFlow.ts
|
|
671
667
|
function useRuntypeFlow(options) {
|
|
672
668
|
const { client, flowId: initialFlowId, initialName = "", initialDescription = "", initialSteps = [], onChange, autoLayoutOnLoad = true } = options;
|
|
673
669
|
const [flowId, setFlowId] = (0, react.useState)(initialFlowId || null);
|
|
@@ -933,8 +929,7 @@ function useRuntypeFlow(options) {
|
|
|
933
929
|
hasUnsavedChanges
|
|
934
930
|
};
|
|
935
931
|
}
|
|
936
|
-
|
|
937
|
-
//#region src/hooks/useFlowValidation.ts
|
|
932
|
+
// src/hooks/useFlowValidation.ts
|
|
938
933
|
const promptValidation = { validate: (step) => {
|
|
939
934
|
const errors = [];
|
|
940
935
|
const config = step.config;
|
|
@@ -1137,8 +1132,7 @@ function useFlowValidation(options) {
|
|
|
1137
1132
|
}, [result.warnings])
|
|
1138
1133
|
};
|
|
1139
1134
|
}
|
|
1140
|
-
|
|
1141
|
-
//#region src/components/nodes/BaseNode.tsx
|
|
1135
|
+
// src/components/nodes/BaseNode.tsx
|
|
1142
1136
|
const styles$6 = {
|
|
1143
1137
|
container: (selected) => ({
|
|
1144
1138
|
minWidth: "280px",
|
|
@@ -1429,8 +1423,7 @@ const MailIcon$1 = () => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
|
1429
1423
|
rx: "2"
|
|
1430
1424
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7" })]
|
|
1431
1425
|
});
|
|
1432
|
-
|
|
1433
|
-
//#region src/components/nodes/PromptNode.tsx
|
|
1426
|
+
// src/components/nodes/PromptNode.tsx
|
|
1434
1427
|
const styles$5 = {
|
|
1435
1428
|
field: { marginBottom: "12px" },
|
|
1436
1429
|
label: {
|
|
@@ -1713,8 +1706,7 @@ const PromptNode = (0, react.memo)(function PromptNode(props) {
|
|
|
1713
1706
|
]
|
|
1714
1707
|
});
|
|
1715
1708
|
});
|
|
1716
|
-
|
|
1717
|
-
//#region src/components/nodes/FetchUrlNode.tsx
|
|
1709
|
+
// src/components/nodes/FetchUrlNode.tsx
|
|
1718
1710
|
const styles$4 = {
|
|
1719
1711
|
field: { marginBottom: "12px" },
|
|
1720
1712
|
label: {
|
|
@@ -2055,8 +2047,7 @@ const FetchUrlNode = (0, react.memo)(function FetchUrlNode(props) {
|
|
|
2055
2047
|
]
|
|
2056
2048
|
});
|
|
2057
2049
|
});
|
|
2058
|
-
|
|
2059
|
-
//#region src/components/nodes/CodeNode.tsx
|
|
2050
|
+
// src/components/nodes/CodeNode.tsx
|
|
2060
2051
|
const styles$3 = {
|
|
2061
2052
|
field: { marginBottom: "12px" },
|
|
2062
2053
|
label: {
|
|
@@ -2345,8 +2336,7 @@ const CodeNode = (0, react.memo)(function CodeNode(props) {
|
|
|
2345
2336
|
]
|
|
2346
2337
|
});
|
|
2347
2338
|
});
|
|
2348
|
-
|
|
2349
|
-
//#region src/components/nodes/ConditionalNode.tsx
|
|
2339
|
+
// src/components/nodes/ConditionalNode.tsx
|
|
2350
2340
|
const styles$2 = {
|
|
2351
2341
|
field: { marginBottom: "12px" },
|
|
2352
2342
|
label: {
|
|
@@ -2626,8 +2616,7 @@ const FalseIcon = () => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
|
2626
2616
|
y2: "18"
|
|
2627
2617
|
})]
|
|
2628
2618
|
});
|
|
2629
|
-
|
|
2630
|
-
//#region src/components/nodes/SendEmailNode.tsx
|
|
2619
|
+
// src/components/nodes/SendEmailNode.tsx
|
|
2631
2620
|
const styles$1 = {
|
|
2632
2621
|
field: { marginBottom: "12px" },
|
|
2633
2622
|
label: {
|
|
@@ -2964,8 +2953,7 @@ const SendEmailNode = (0, react.memo)(function SendEmailNode(props) {
|
|
|
2964
2953
|
]
|
|
2965
2954
|
});
|
|
2966
2955
|
});
|
|
2967
|
-
|
|
2968
|
-
//#region src/components/RuntypeFlowEditor.tsx
|
|
2956
|
+
// src/components/RuntypeFlowEditor.tsx
|
|
2969
2957
|
const styles = {
|
|
2970
2958
|
container: {
|
|
2971
2959
|
width: "100%",
|
|
@@ -3427,7 +3415,6 @@ function MailIcon() {
|
|
|
3427
3415
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7" })]
|
|
3428
3416
|
});
|
|
3429
3417
|
}
|
|
3430
|
-
//#endregion
|
|
3431
3418
|
exports.BaseNode = BaseNode;
|
|
3432
3419
|
exports.CodeNode = CodeNode;
|
|
3433
3420
|
exports.ConditionalNode = ConditionalNode;
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
2
2
|
import { Background, BackgroundVariant, ConnectionLineType, Controls, Handle, MiniMap, Panel, Position, ReactFlow, addEdge, useEdgesState, useNodesState } from "@xyflow/react";
|
|
3
3
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
|
|
4
|
+
// src/types/index.ts
|
|
5
5
|
/**
|
|
6
6
|
* Supported node types that have custom components
|
|
7
7
|
*/
|
|
@@ -18,8 +18,7 @@ const SUPPORTED_NODE_TYPES = [
|
|
|
18
18
|
function isSupportedNodeType(type) {
|
|
19
19
|
return SUPPORTED_NODE_TYPES.includes(type);
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
//#region src/utils/adapter.ts
|
|
21
|
+
// src/utils/adapter.ts
|
|
23
22
|
const NODE_HEIGHT = 200;
|
|
24
23
|
const NODE_SPACING_Y = 80;
|
|
25
24
|
const BRANCH_OFFSET_X = 350;
|
|
@@ -452,8 +451,7 @@ function cloneStep(step) {
|
|
|
452
451
|
config: JSON.parse(JSON.stringify(step.config))
|
|
453
452
|
};
|
|
454
453
|
}
|
|
455
|
-
|
|
456
|
-
//#region src/utils/layout.ts
|
|
454
|
+
// src/utils/layout.ts
|
|
457
455
|
const DEFAULT_NODE_WIDTH = 280;
|
|
458
456
|
const DEFAULT_NODE_HEIGHT = 150;
|
|
459
457
|
const HORIZONTAL_SPACING = 100;
|
|
@@ -642,8 +640,7 @@ function getNodesBoundingBox(nodes) {
|
|
|
642
640
|
height: maxY - minY
|
|
643
641
|
};
|
|
644
642
|
}
|
|
645
|
-
|
|
646
|
-
//#region src/hooks/useRuntypeFlow.ts
|
|
643
|
+
// src/hooks/useRuntypeFlow.ts
|
|
647
644
|
function useRuntypeFlow(options) {
|
|
648
645
|
const { client, flowId: initialFlowId, initialName = "", initialDescription = "", initialSteps = [], onChange, autoLayoutOnLoad = true } = options;
|
|
649
646
|
const [flowId, setFlowId] = useState(initialFlowId || null);
|
|
@@ -909,8 +906,7 @@ function useRuntypeFlow(options) {
|
|
|
909
906
|
hasUnsavedChanges
|
|
910
907
|
};
|
|
911
908
|
}
|
|
912
|
-
|
|
913
|
-
//#region src/hooks/useFlowValidation.ts
|
|
909
|
+
// src/hooks/useFlowValidation.ts
|
|
914
910
|
const promptValidation = { validate: (step) => {
|
|
915
911
|
const errors = [];
|
|
916
912
|
const config = step.config;
|
|
@@ -1113,8 +1109,7 @@ function useFlowValidation(options) {
|
|
|
1113
1109
|
}, [result.warnings])
|
|
1114
1110
|
};
|
|
1115
1111
|
}
|
|
1116
|
-
|
|
1117
|
-
//#region src/components/nodes/BaseNode.tsx
|
|
1112
|
+
// src/components/nodes/BaseNode.tsx
|
|
1118
1113
|
const styles$6 = {
|
|
1119
1114
|
container: (selected) => ({
|
|
1120
1115
|
minWidth: "280px",
|
|
@@ -1405,8 +1400,7 @@ const MailIcon$1 = () => /* @__PURE__ */ jsxs("svg", {
|
|
|
1405
1400
|
rx: "2"
|
|
1406
1401
|
}), /* @__PURE__ */ jsx("path", { d: "m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7" })]
|
|
1407
1402
|
});
|
|
1408
|
-
|
|
1409
|
-
//#region src/components/nodes/PromptNode.tsx
|
|
1403
|
+
// src/components/nodes/PromptNode.tsx
|
|
1410
1404
|
const styles$5 = {
|
|
1411
1405
|
field: { marginBottom: "12px" },
|
|
1412
1406
|
label: {
|
|
@@ -1689,8 +1683,7 @@ const PromptNode = memo(function PromptNode(props) {
|
|
|
1689
1683
|
]
|
|
1690
1684
|
});
|
|
1691
1685
|
});
|
|
1692
|
-
|
|
1693
|
-
//#region src/components/nodes/FetchUrlNode.tsx
|
|
1686
|
+
// src/components/nodes/FetchUrlNode.tsx
|
|
1694
1687
|
const styles$4 = {
|
|
1695
1688
|
field: { marginBottom: "12px" },
|
|
1696
1689
|
label: {
|
|
@@ -2031,8 +2024,7 @@ const FetchUrlNode = memo(function FetchUrlNode(props) {
|
|
|
2031
2024
|
]
|
|
2032
2025
|
});
|
|
2033
2026
|
});
|
|
2034
|
-
|
|
2035
|
-
//#region src/components/nodes/CodeNode.tsx
|
|
2027
|
+
// src/components/nodes/CodeNode.tsx
|
|
2036
2028
|
const styles$3 = {
|
|
2037
2029
|
field: { marginBottom: "12px" },
|
|
2038
2030
|
label: {
|
|
@@ -2321,8 +2313,7 @@ const CodeNode = memo(function CodeNode(props) {
|
|
|
2321
2313
|
]
|
|
2322
2314
|
});
|
|
2323
2315
|
});
|
|
2324
|
-
|
|
2325
|
-
//#region src/components/nodes/ConditionalNode.tsx
|
|
2316
|
+
// src/components/nodes/ConditionalNode.tsx
|
|
2326
2317
|
const styles$2 = {
|
|
2327
2318
|
field: { marginBottom: "12px" },
|
|
2328
2319
|
label: {
|
|
@@ -2602,8 +2593,7 @@ const FalseIcon = () => /* @__PURE__ */ jsxs("svg", {
|
|
|
2602
2593
|
y2: "18"
|
|
2603
2594
|
})]
|
|
2604
2595
|
});
|
|
2605
|
-
|
|
2606
|
-
//#region src/components/nodes/SendEmailNode.tsx
|
|
2596
|
+
// src/components/nodes/SendEmailNode.tsx
|
|
2607
2597
|
const styles$1 = {
|
|
2608
2598
|
field: { marginBottom: "12px" },
|
|
2609
2599
|
label: {
|
|
@@ -2940,8 +2930,7 @@ const SendEmailNode = memo(function SendEmailNode(props) {
|
|
|
2940
2930
|
]
|
|
2941
2931
|
});
|
|
2942
2932
|
});
|
|
2943
|
-
|
|
2944
|
-
//#region src/components/RuntypeFlowEditor.tsx
|
|
2933
|
+
// src/components/RuntypeFlowEditor.tsx
|
|
2945
2934
|
const styles = {
|
|
2946
2935
|
container: {
|
|
2947
2936
|
width: "100%",
|
|
@@ -3403,6 +3392,5 @@ function MailIcon() {
|
|
|
3403
3392
|
}), /* @__PURE__ */ jsx("path", { d: "m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7" })]
|
|
3404
3393
|
});
|
|
3405
3394
|
}
|
|
3406
|
-
//#endregion
|
|
3407
3395
|
export { BaseNode, CodeNode, ConditionalNode, FetchUrlNode, PromptNode, RuntypeFlowEditor, SUPPORTED_NODE_TYPES, SendEmailNode, autoLayout, centerNodes, cloneStep, createDefaultStep, createEdgesFromNodes, flowStepsToNodes, generateStepId, getDefaultStepName, getNodesBoundingBox, isSupportedNodeType, nodesToFlowSteps, snapToGrid, useFlowValidation, useRuntypeFlow };
|
|
3408
3396
|
|
package/example/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @runtypelabs/react-flow-example
|
|
2
2
|
|
|
3
|
+
## 0.0.252
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 22e97cc: Refresh development tooling and use an isolated TypeScript 7.1 declaration emitter with tsdown.
|
|
8
|
+
- Updated dependencies [fdae910]
|
|
9
|
+
- Updated dependencies [22e97cc]
|
|
10
|
+
- @runtypelabs/sdk@11.8.2
|
|
11
|
+
- @runtypelabs/react-flow@1.0.125
|
|
12
|
+
|
|
13
|
+
## 0.0.251
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [b91d8ad]
|
|
18
|
+
- @runtypelabs/sdk@11.8.1
|
|
19
|
+
- @runtypelabs/react-flow@1.0.124
|
|
20
|
+
|
|
21
|
+
## 0.0.250
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Updated dependencies [5ab971e]
|
|
26
|
+
- Updated dependencies [35f7f5a]
|
|
27
|
+
- @runtypelabs/sdk@11.8.0
|
|
28
|
+
- @runtypelabs/react-flow@1.0.123
|
|
29
|
+
|
|
3
30
|
## 0.0.249
|
|
4
31
|
|
|
5
32
|
### Patch Changes
|
package/example/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@runtypelabs/react-flow-example",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.252",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -21,6 +21,6 @@
|
|
|
21
21
|
"@types/react-dom": "^18.3.0",
|
|
22
22
|
"@vitejs/plugin-react": "^6.0.3",
|
|
23
23
|
"typescript": "^6.0.3",
|
|
24
|
-
"vite": "^8.
|
|
24
|
+
"vite": "^8.3.5"
|
|
25
25
|
}
|
|
26
26
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@runtypelabs/react-flow",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.125",
|
|
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": "11.
|
|
19
|
+
"@runtypelabs/sdk": "11.8.2"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
22
|
"@xyflow/react": "^12.0.0",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@xyflow/react": "^12.10.1",
|
|
30
30
|
"react": "19.2.8",
|
|
31
31
|
"react-dom": "18.3.1",
|
|
32
|
-
"tsdown": "^0.23.
|
|
32
|
+
"tsdown": "^0.23.2",
|
|
33
33
|
"typescript": "^6.0.3"
|
|
34
34
|
},
|
|
35
35
|
"keywords": [
|