Skip to content

Commit a230b0c

Browse files
committed
remove support for react flow v10
1 parent 1d11c32 commit a230b0c

18 files changed

Lines changed: 29 additions & 927 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ This is a major release, and it might be not compatible with your current usage
1414
- `<CodeAutocompleteField />`:
1515
- outerDivAttributes parameter: Allows to set parameter of the container div element of the code complete field.
1616

17+
### Removed
18+
19+
- support for React Flow v10 was completely removed
20+
1721
### Fixed
1822

1923
- <CodeMirror />:
@@ -26,6 +30,10 @@ This is a major release, and it might be not compatible with your current usage
2630
- `<Modal />`:
2731
- Add 'nopan', 'nowheel' and 'nodrag' classes to Modal's overlay classes in order to always prevent react-flow to react to drag and pan actions in modals.
2832

33+
### Deprecated
34+
35+
- support for React Flow v9 will be removed
36+
2937

3038
## [24.3.0] - 2025-06-05
3139

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@
9393
"react": "^16.13.1",
9494
"react-dom": "^16.13.1",
9595
"react-flow-renderer": "9.7.4",
96-
"react-flow-renderer-lts": "npm:react-flow-renderer@^10.3.17",
9796
"react-inlinesvg": "^3.0.3",
9897
"react-markdown": "^10.1.0",
9998
"react-markdown-deprecated": "npm:react-markdown@^8.0.7",

src/cmem/react-flow/ReactFlow/ReactFlow.stories.tsx

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,6 @@ import {
66
FlowElement,
77
Position,
88
} from "react-flow-renderer";
9-
import {
10-
Background as BackgroundV10,
11-
BackgroundVariant as BackgroundVariantV10,
12-
Edge as Edge10,
13-
Node as Node10,
14-
OnInit as OnInitV10,
15-
ReactFlowInstance as ReactFlowInstanceV10,
16-
useEdgesState as useEdgesState10,
17-
useNodesState as useNodesState10,
18-
} from "react-flow-renderer-lts";
199
import { Meta, StoryFn } from "@storybook/react";
2010
import { fn } from "@storybook/test";
2111
import {
@@ -31,7 +21,6 @@ import {
3121
ApplicationContainer,
3222
EdgeTools,
3323
MiniMap,
34-
MiniMapV10,
3524
MiniMapV12,
3625
NodeTools,
3726
ReactFlowExtended,
@@ -425,7 +414,7 @@ export default {
425414
},
426415
flowVersion: {
427416
control: "select",
428-
options: [undefined, "v9", "v10", "v12"],
417+
options: [undefined, "v9", "v12"],
429418
},
430419
},
431420
} as Meta<typeof ReactFlowExtended>;
@@ -490,33 +479,6 @@ const ReactFlowExampleV9: FC<ReactFlowExtendedProps> = (args) => {
490479
);
491480
};
492481

493-
const ReactFlowExampleV10: FC<ReactFlowExtendedProps> = (args) => {
494-
const [reactFlowInstance, setReactFlowInstance] = React.useState<ReactFlowInstanceV10 | undefined>(undefined);
495-
const [nodes, ,] = useNodesState10(nodeExamples[args.configuration ?? "unspecified"].nodes as Node10[]);
496-
const [edges, ,] = useEdgesState10(nodeExamples[args.configuration ?? "unspecified"].edges as Edge10[]);
497-
498-
const onInit: OnInitV10 = React.useCallback((_reactFlowInstance: ReactFlowInstanceV10) => {
499-
setReactFlowInstance(_reactFlowInstance);
500-
}, []);
501-
502-
const reactFlowExtendedProps = {
503-
...args,
504-
defaultZoom: 1,
505-
nodes,
506-
edges,
507-
onInit,
508-
} as ReactFlowExtendedProps;
509-
510-
return (
511-
<ApplicationContainer monitorDropzonesFor={args.dropzoneFor} style={{ background: "white" }}>
512-
<ReactFlowExtended {...reactFlowExtendedProps}>
513-
<MiniMapV10 flowInstance={reactFlowInstance} enableNavigation={true} />
514-
<BackgroundV10 variant={BackgroundVariantV10.Lines} gap={16} />
515-
</ReactFlowExtended>
516-
</ApplicationContainer>
517-
);
518-
};
519-
520482
const ReactFlowExampleV12: FC<ReactFlowExtendedProps> = (args) => {
521483
const [nodes, ,] = useNodesState12(nodeExamples[args.configuration ?? "unspecified"].nodes as Node12[]);
522484
const [edges, ,] = useEdgesState12(nodeExamples[args.configuration ?? "unspecified"].edges as Edge12[]);
@@ -549,8 +511,6 @@ const ReactFlowExample: FC<ReactFlowExtendedProps> = (args) => {
549511
case undefined:
550512
case "v9":
551513
return <ReactFlowExampleV9 {...args} />;
552-
case "v10":
553-
return <ReactFlowExampleV10 {...args} />;
554514
case "v12":
555515
return <ReactFlowExampleV12 {...args} />;
556516
default:

src/cmem/react-flow/ReactFlow/ReactFlow.tsx

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
11
import React, {ReactElement, Ref} from "react";
22
import { KeyCode as KeyCodeV9 } from "react-flow-renderer";
3-
import { KeyCode as KeyCodeV10 } from "react-flow-renderer-lts";
43
import { KeyCode as KeyCodeV12} from "@xyflow/react";
54

65
import { CLASSPREFIX as eccgui } from "../../../configuration/constants";
76
import { ReactFlowMarkers } from "../../../extensions/react-flow/markers/ReactFlowMarkers";
87
import { ReactFlowVersions } from "../../../extensions/react-flow/versionsupport";
98
import { ReactFlowHotkeyContext } from "../extensions/ReactFlowHotkeyContext";
109
import { useReactFlowScrollOnDragV9 } from "../extensions/scrollOnDragHook";
11-
import { useReactFlowScrollOnDragV10 } from "../extensions/scrollOnDragHookV10";
1210

1311
import * as graphConfig from "./../configuration/graph";
1412
import * as linkingConfig from "./../configuration/linking";
1513
import * as unspecifiedConfig from "./../configuration/unspecified";
1614
import * as workflowConfig from "./../configuration/workflow";
1715
import { ReactFlowV9Container, ReactFlowV9ContainerProps } from "./ReactFlowV9";
18-
import { ReactFlowV10Container, ReactFlowV10ContainerProps } from "./ReactFlowV10";
1916
import { ReactFlowV12Container, ReactFlowV12ContainerProps } from "./ReactFlowV12";
2017

2118
export interface ReactFlowExtendedExtraProps {
@@ -55,13 +52,6 @@ interface ReactFlowExtendedVersion9SupportProps {
5552
flowVersion?: ReactFlowVersions.V9;
5653
}
5754

58-
interface ReactFlowExtendedVersion10SupportProps {
59-
/**
60-
* Set version of `ReactFlow` that is used internally.
61-
*/
62-
flowVersion: ReactFlowVersions.V10;
63-
}
64-
6555
interface ReactFlowExtendedVersion12SupportProps {
6656
/**
6757
* Set version of `ReactFlow` that is used internally.
@@ -74,16 +64,15 @@ interface ReactFlowExtendedVersion12SupportProps {
7464
}
7565

7666
export type ReactFlowExtendedPropsV9 = ReactFlowExtendedVersion9SupportProps & ReactFlowV9ContainerProps & ReactFlowExtendedExtraProps & ReactFlowExtendedScrollProps
77-
export type ReactFlowExtendedPropsV10 = ReactFlowExtendedVersion10SupportProps & ReactFlowV10ContainerProps & ReactFlowExtendedExtraProps & ReactFlowExtendedScrollProps
7867
export type ReactFlowExtendedPropsV12 = ReactFlowExtendedVersion12SupportProps & ReactFlowV12ContainerProps & ReactFlowExtendedExtraProps
7968

80-
export type ReactFlowExtendedProps = ReactFlowExtendedPropsV9 | ReactFlowExtendedPropsV10 | ReactFlowExtendedPropsV12
69+
export type ReactFlowExtendedProps = ReactFlowExtendedPropsV9 | ReactFlowExtendedPropsV12
8170

8271
/**
8372
* `ReactFlow` container extension that includes pre-configured nodes and edges for
8473
* Corporate Memory tools.
8574
*
86-
* @param T The concrete type of the corresponding version, i.e. either one of ReactFlowExtendedPropsV9, ReactFlowExtendedPropsV10 or ReactFlowExtendedPropsV12
75+
* @param T The concrete type of the corresponding version, i.e. either one of ReactFlowExtendedPropsV9 or ReactFlowExtendedPropsV12
8776
*/
8877
const ReactFlowExtendedPlain = <T extends ReactFlowExtendedProps>({
8978
configuration = "unspecified",
@@ -157,14 +146,6 @@ const ReactFlowExtendedPlain = <T extends ReactFlowExtendedProps>({
157146
zoomActivationKeyCode: hotKeysDisabled ? undefined : (zoomActivationKeyCode as KeyCodeV9),
158147
};
159148
break;
160-
case "v10":
161-
keyCodeConfig = {
162-
selectionKeyCode: hotKeysDisabled ? undefined : (selectionKeyCode as KeyCodeV10),
163-
deleteKeyCode: hotKeysDisabled ? undefined : (deleteKeyCode as KeyCodeV10),
164-
multiSelectionKeyCode: hotKeysDisabled ? undefined : (multiSelectionKeyCode as KeyCodeV10),
165-
zoomActivationKeyCode: hotKeysDisabled ? undefined : (zoomActivationKeyCode as KeyCodeV10),
166-
};
167-
break;
168149
case "v12":
169150
keyCodeConfig = {
170151
selectionKeyCode: hotKeysDisabled ? null : (selectionKeyCode as KeyCodeV12),
@@ -183,12 +164,6 @@ const ReactFlowExtendedPlain = <T extends ReactFlowExtendedProps>({
183164
scrollOnDrag,
184165
});
185166
break;
186-
case "v10":
187-
scrollOnDragFunctions = useReactFlowScrollOnDragV10({
188-
reactFlowProps: originalProps as ReactFlowV10ContainerProps,
189-
scrollOnDrag,
190-
});
191-
break;
192167
// should not be necessary for v12
193168
}
194169

@@ -207,13 +182,6 @@ const ReactFlowExtendedPlain = <T extends ReactFlowExtendedProps>({
207182
<ReactFlowMarkers />
208183
</ReactFlowV9Container>
209184
);
210-
case "v10":
211-
return (
212-
<ReactFlowV10Container ref={innerRef} {...(containerConfig as ReactFlowV10ContainerProps)}>
213-
{children}
214-
<ReactFlowMarkers />
215-
</ReactFlowV10Container>
216-
);
217185
case "v12":
218186
return (
219187
<ReactFlowV12Container ref={innerRef} {...(containerConfig as ReactFlowV12ContainerProps)}>

src/cmem/react-flow/ReactFlow/ReactFlowV10.tsx

Lines changed: 0 additions & 54 deletions
This file was deleted.

src/cmem/react-flow/configuration/graph.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { EdgeDefault } from "./../../../extensions/react-flow/edges/EdgeDefault";
22
import { NodeDefault } from "./../../../extensions/react-flow/nodes/NodeDefault";
33
import { GRAPH_NODE_TYPES } from "./typing";
4-
import {ComponentType} from "react";
5-
import {NodeProps} from "react-flow-renderer-lts";
4+
//import {ComponentType} from "react";
5+
//import {NodeProps} from "react-flow-renderer-lts";
66

77
const edgeTypes = {
88
default: EdgeDefault,
@@ -16,7 +16,7 @@ const edgeTypes = {
1616
danger: EdgeDefault,
1717
};
1818

19-
const nodeTypes: Record<GRAPH_NODE_TYPES, React.ReactNode & ComponentType<NodeProps>> = {
19+
const nodeTypes: Record<GRAPH_NODE_TYPES, React.ReactNode /*& ComponentType<NodeProps>*/> = {
2020
default: NodeDefault,
2121
graph: NodeDefault,
2222
class: NodeDefault,

src/cmem/react-flow/configuration/linking.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { EdgeStep } from "./../../../extensions/react-flow/edges/EdgeStep";
22
import { NodeDefault } from "./../../../extensions/react-flow/nodes/NodeDefault";
33
import { StickyNoteNode } from "./../nodes/StickyNoteNode";
44
import { LINKING_NODE_TYPES } from "./typing";
5-
import {ComponentType} from "react";
6-
import {NodeProps} from "react-flow-renderer-lts";
5+
//import {ComponentType} from "react";
6+
//import {NodeProps} from "react-flow-renderer-lts";
77

88
const edgeTypes = {
99
default: EdgeStep,
@@ -14,7 +14,7 @@ const edgeTypes = {
1414
danger: EdgeStep,
1515
};
1616

17-
const nodeTypes: Record<LINKING_NODE_TYPES, React.ReactNode & ComponentType<NodeProps>> = {
17+
const nodeTypes: Record<LINKING_NODE_TYPES, React.ReactNode /*& ComponentType<NodeProps>*/> = {
1818
default: NodeDefault,
1919
sourcepath: NodeDefault,
2020
targetpath: NodeDefault,

src/cmem/react-flow/configuration/workflow.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { EdgeStep } from "./../../../extensions/react-flow/edges/EdgeStep";
22
import { NodeDefault } from "./../../../extensions/react-flow/nodes/NodeDefault";
33
import { StickyNoteNode } from "./../nodes/StickyNoteNode";
44
import { WORKFLOW_NODE_TYPES } from "./typing";
5-
import {ComponentType} from "react";
6-
import {NodeProps} from "react-flow-renderer-lts";
5+
//import {ComponentType} from "react";
6+
//import {NodeProps} from "react-flow-renderer-lts";
77

88
const edgeTypes = {
99
default: EdgeStep,
@@ -12,7 +12,7 @@ const edgeTypes = {
1212
danger: EdgeStep,
1313
};
1414

15-
const nodeTypes: Record<WORKFLOW_NODE_TYPES, React.ReactNode & ComponentType<NodeProps>> = {
15+
const nodeTypes: Record<WORKFLOW_NODE_TYPES, React.ReactNode /*& ComponentType<NodeProps>*/> = {
1616
default: NodeDefault,
1717
dataset: NodeDefault,
1818
linking: NodeDefault,

0 commit comments

Comments
 (0)