@eccenca/gui-elements 23.2.0 → 23.3.0-rc.0
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 +38 -0
- package/dist/cjs/cmem/react-flow/ReactFlow/ReactFlow.js +5 -1
- package/dist/cjs/cmem/react-flow/ReactFlow/ReactFlow.js.map +1 -1
- package/dist/cjs/cmem/react-flow/StickyNoteModal/StickyNoteModal.js +9 -11
- package/dist/cjs/cmem/react-flow/StickyNoteModal/StickyNoteModal.js.map +1 -1
- package/dist/cjs/cmem/react-flow/extensions/ReactFlowHotkeyContext.js +12 -0
- package/dist/cjs/cmem/react-flow/extensions/ReactFlowHotkeyContext.js.map +1 -0
- package/dist/cjs/components/Application/ApplicationHeader.js +2 -3
- package/dist/cjs/components/Application/ApplicationHeader.js.map +1 -1
- package/dist/cjs/components/Dialog/Modal.js +17 -8
- package/dist/cjs/components/Dialog/Modal.js.map +1 -1
- package/dist/cjs/components/Dialog/SimpleDialog.js +15 -2
- package/dist/cjs/components/Dialog/SimpleDialog.js.map +1 -1
- package/dist/cjs/components/Icon/IconButton.js +1 -1
- package/dist/cjs/components/Icon/IconButton.js.map +1 -1
- package/dist/cjs/components/Icon/canonicalIconNames.js +1 -0
- package/dist/cjs/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/cjs/components/OverviewItem/OverviewItemDepiction.js +3 -6
- package/dist/cjs/components/OverviewItem/OverviewItemDepiction.js.map +1 -1
- package/dist/cjs/components/PropertyValuePair/PropertyName.js +3 -3
- package/dist/cjs/components/PropertyValuePair/PropertyName.js.map +1 -1
- package/dist/cjs/components/Separation/Spacing.js +18 -4
- package/dist/cjs/components/Separation/Spacing.js.map +1 -1
- package/dist/cjs/components/TextField/TextField.js +23 -3
- package/dist/cjs/components/TextField/TextField.js.map +1 -1
- package/dist/cjs/extensions/codemirror/CodeMirror.js +39 -7
- package/dist/cjs/extensions/codemirror/CodeMirror.js.map +1 -1
- package/dist/cjs/extensions/react-flow/handles/HandleDefault.js +26 -5
- package/dist/cjs/extensions/react-flow/handles/HandleDefault.js.map +1 -1
- package/dist/cjs/extensions/react-flow/handles/HandleTools.js +27 -0
- package/dist/cjs/extensions/react-flow/handles/HandleTools.js.map +1 -0
- package/dist/cjs/extensions/react-flow/index.js +2 -0
- package/dist/cjs/extensions/react-flow/index.js.map +1 -1
- package/dist/cjs/extensions/react-flow/nodes/NodeContent.js +25 -5
- package/dist/cjs/extensions/react-flow/nodes/NodeContent.js.map +1 -1
- package/dist/esm/cmem/markdown/Markdown.js +1 -1
- package/dist/esm/cmem/react-flow/ReactFlow/ReactFlow.js +5 -1
- package/dist/esm/cmem/react-flow/ReactFlow/ReactFlow.js.map +1 -1
- package/dist/esm/cmem/react-flow/StickyNoteModal/StickyNoteModal.js +9 -11
- package/dist/esm/cmem/react-flow/StickyNoteModal/StickyNoteModal.js.map +1 -1
- package/dist/esm/cmem/react-flow/extensions/ReactFlowHotkeyContext.js +6 -0
- package/dist/esm/cmem/react-flow/extensions/ReactFlowHotkeyContext.js.map +1 -0
- package/dist/esm/components/Application/ApplicationHeader.js +2 -3
- package/dist/esm/components/Application/ApplicationHeader.js.map +1 -1
- package/dist/esm/components/Dialog/Modal.js +18 -9
- package/dist/esm/components/Dialog/Modal.js.map +1 -1
- package/dist/esm/components/Dialog/SimpleDialog.js +14 -1
- package/dist/esm/components/Dialog/SimpleDialog.js.map +1 -1
- package/dist/esm/components/Icon/IconButton.js +1 -1
- package/dist/esm/components/Icon/IconButton.js.map +1 -1
- package/dist/esm/components/Icon/canonicalIconNames.js +1 -0
- package/dist/esm/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/esm/components/OverviewItem/OverviewItemDepiction.js +3 -6
- package/dist/esm/components/OverviewItem/OverviewItemDepiction.js.map +1 -1
- package/dist/esm/components/PropertyValuePair/PropertyName.js +3 -3
- package/dist/esm/components/PropertyValuePair/PropertyName.js.map +1 -1
- package/dist/esm/components/Separation/Spacing.js +28 -4
- package/dist/esm/components/Separation/Spacing.js.map +1 -1
- package/dist/esm/components/TextField/TextField.js +25 -5
- package/dist/esm/components/TextField/TextField.js.map +1 -1
- package/dist/esm/extensions/codemirror/CodeMirror.js +49 -6
- package/dist/esm/extensions/codemirror/CodeMirror.js.map +1 -1
- package/dist/esm/extensions/react-flow/handles/HandleDefault.js +45 -8
- package/dist/esm/extensions/react-flow/handles/HandleDefault.js.map +1 -1
- package/dist/esm/extensions/react-flow/handles/HandleTools.js +31 -0
- package/dist/esm/extensions/react-flow/handles/HandleTools.js.map +1 -0
- package/dist/esm/extensions/react-flow/index.js +2 -0
- package/dist/esm/extensions/react-flow/index.js.map +1 -1
- package/dist/esm/extensions/react-flow/nodes/NodeContent.js +32 -12
- package/dist/esm/extensions/react-flow/nodes/NodeContent.js.map +1 -1
- package/dist/types/cmem/react-flow/extensions/ReactFlowHotkeyContext.d.ts +8 -0
- package/dist/types/components/Application/ApplicationHeader.d.ts +1 -2
- package/dist/types/components/Dialog/Modal.d.ts +13 -6
- package/dist/types/components/Dialog/SimpleDialog.d.ts +12 -1
- package/dist/types/components/Icon/canonicalIconNames.d.ts +1 -1
- package/dist/types/components/PropertyValuePair/PropertyName.d.ts +7 -1
- package/dist/types/components/Separation/Spacing.d.ts +2 -2
- package/dist/types/components/TextField/TextField.d.ts +4 -2
- package/dist/types/extensions/codemirror/CodeMirror.d.ts +17 -3
- package/dist/types/extensions/react-flow/handles/HandleDefault.d.ts +2 -2
- package/dist/types/extensions/react-flow/handles/HandleTools.d.ts +6 -0
- package/dist/types/extensions/react-flow/index.d.ts +2 -0
- package/dist/types/extensions/react-flow/nodes/NodeContent.d.ts +21 -1
- package/package.json +14 -12
- package/scripts/compile-sass.ts +1 -1
- package/src/cmem/react-flow/ReactFlow/ReactFlow.tsx +10 -0
- package/src/cmem/react-flow/StickyNoteModal/StickyNoteModal.tsx +10 -12
- package/src/cmem/react-flow/extensions/ReactFlowHotkeyContext.ts +14 -0
- package/src/components/Application/ApplicationHeader.tsx +8 -13
- package/src/components/Application/_header.scss +17 -17
- package/src/components/Application/_toolbar.scss +22 -33
- package/src/components/AutoSuggestion/tests/AutoSuggestion.test.tsx +34 -21
- package/src/components/AutoSuggestion/tests/SingleLineCodeEditor.test.tsx +20 -9
- package/src/components/Dialog/Modal.tsx +62 -37
- package/src/components/Dialog/SimpleDialog.tsx +19 -1
- package/src/components/Dialog/dialog.scss +29 -17
- package/src/components/Icon/IconButton.tsx +1 -1
- package/src/components/Icon/canonicalIconNames.tsx +2 -0
- package/src/components/OverviewItem/OverviewItemDepiction.tsx +8 -16
- package/src/components/PropertyValuePair/PropertyName.tsx +15 -4
- package/src/components/Separation/Spacing.tsx +12 -8
- package/src/components/TextField/TextField.tsx +32 -6
- package/src/components/Tooltip/tooltip.scss +15 -1
- package/src/extensions/codemirror/CodeMirror.tsx +62 -8
- package/src/extensions/codemirror/_codemirror.scss +53 -8
- package/src/extensions/react-flow/edges/stories/EdgeDefault.stories.tsx +43 -44
- package/src/extensions/react-flow/handles/HandleDefault.tsx +40 -33
- package/src/extensions/react-flow/handles/HandleTools.tsx +22 -0
- package/src/extensions/react-flow/handles/_handles.scss +64 -44
- package/src/extensions/react-flow/handles/stories/HandleDefault.stories.tsx +33 -27
- package/src/extensions/react-flow/index.ts +2 -0
- package/src/extensions/react-flow/nodes/NodeContent.tsx +62 -2
- package/src/extensions/react-flow/nodes/_nodes.scss +170 -110
- package/src/extensions/react-flow/nodes/stories/NodeDefault.stories.tsx +32 -34
|
@@ -1,72 +1,87 @@
|
|
|
1
1
|
div.react-flow__handle {
|
|
2
|
-
|
|
3
|
-
background-color: currentColor;
|
|
4
|
-
border-color: currentColor;
|
|
2
|
+
z-index: 2;
|
|
5
3
|
width: $eccgui-size-block-whitespace * 0.5;
|
|
6
4
|
height: $eccgui-size-block-whitespace * 0.5;
|
|
7
|
-
|
|
5
|
+
color: $reactflow-node-border-color;
|
|
6
|
+
background-color: currentcolor;
|
|
7
|
+
border-color: currentcolor;
|
|
8
8
|
border-radius: 100%;
|
|
9
9
|
|
|
10
10
|
.react-flow__node-default & {
|
|
11
|
-
background-color:
|
|
11
|
+
background-color: currentcolor;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
content: " ";
|
|
14
|
+
&::before {
|
|
16
15
|
position: absolute;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
top: $eccgui-size-block-whitespace * -0.5;
|
|
20
|
-
left: $eccgui-size-block-whitespace * -0.5;
|
|
21
|
-
bottom: $eccgui-size-block-whitespace * -0.5;
|
|
22
|
-
right: $eccgui-size-block-whitespace * -0.5;
|
|
23
|
-
opacity: 0.61;
|
|
16
|
+
inset: $eccgui-size-block-whitespace * -0.5;
|
|
17
|
+
z-index: 1;
|
|
24
18
|
display: none;
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
content: " ";
|
|
20
|
+
background-color: currentcolor;
|
|
21
|
+
border: solid 1px currentcolor;
|
|
27
22
|
border-radius: 100%;
|
|
23
|
+
opacity: 0.61;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&.clickable {
|
|
27
|
+
&::after {
|
|
28
|
+
position: absolute;
|
|
29
|
+
inset: $eccgui-size-block-whitespace * -0.75;
|
|
30
|
+
z-index: -1;
|
|
31
|
+
display: none;
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
content: " ";
|
|
34
|
+
border-radius: 100%;
|
|
35
|
+
outline: dotted $eccgui-size-block-whitespace * 0.25 currentcolor;
|
|
36
|
+
}
|
|
28
37
|
}
|
|
29
38
|
|
|
30
39
|
&:hover {
|
|
31
|
-
|
|
32
|
-
box-shadow: 0 0 $eccgui-size-block-whitespace * 0.5 $eccgui-size-block-whitespace * 0.25
|
|
40
|
+
&::before {
|
|
41
|
+
box-shadow: 0 0 $eccgui-size-block-whitespace * 0.5 $eccgui-size-block-whitespace * 0.25 currentcolor;
|
|
33
42
|
}
|
|
34
43
|
}
|
|
35
44
|
|
|
36
45
|
&.#{eccgui}-graphviz__handle--highlight-configuration {
|
|
37
46
|
border-radius: 0;
|
|
38
47
|
|
|
39
|
-
|
|
48
|
+
&::before {
|
|
40
49
|
border-radius: 0;
|
|
41
50
|
}
|
|
42
51
|
}
|
|
43
52
|
|
|
44
53
|
.react-flow__node:hover &.connectable {
|
|
45
|
-
|
|
54
|
+
&::before {
|
|
46
55
|
display: block;
|
|
47
56
|
}
|
|
48
57
|
}
|
|
49
58
|
|
|
50
|
-
|
|
59
|
+
.react-flow__node:hover &.clickable {
|
|
60
|
+
&::after {
|
|
61
|
+
display: block;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&.react-flow__handle-connecting:hover,
|
|
66
|
+
&.invalid-handle {
|
|
51
67
|
color: $eccgui-color-danger-text;
|
|
52
|
-
|
|
68
|
+
|
|
69
|
+
&::before {
|
|
53
70
|
display: block;
|
|
54
71
|
}
|
|
55
72
|
}
|
|
56
73
|
|
|
57
|
-
&.react-flow__handle-valid:hover,
|
|
74
|
+
&.react-flow__handle-valid:hover,
|
|
75
|
+
&.valid-handle {
|
|
58
76
|
color: $eccgui-color-success-text;
|
|
59
77
|
}
|
|
60
78
|
}
|
|
61
79
|
|
|
62
80
|
.#{$eccgui}-graphviz__handle__content {
|
|
63
81
|
position: absolute;
|
|
64
|
-
|
|
65
|
-
right: 0;
|
|
66
|
-
bottom: 0;
|
|
67
|
-
left: 0;
|
|
68
|
-
cursor: help;
|
|
82
|
+
inset: 0;
|
|
69
83
|
overflow: hidden;
|
|
84
|
+
cursor: help;
|
|
70
85
|
}
|
|
71
86
|
|
|
72
87
|
div.react-flow__handle-right {
|
|
@@ -93,28 +108,22 @@ div.react-flow__handle-bottom {
|
|
|
93
108
|
.#{$eccgui}-graphviz__node--minimal-circular {
|
|
94
109
|
.react-flow__node:not(.selected) & {
|
|
95
110
|
& ~ .react-flow__handle {
|
|
96
|
-
|
|
97
|
-
left: $reactflow-node-basesize * 0.5;
|
|
98
|
-
right: auto;
|
|
99
|
-
bottom: auto;
|
|
100
|
-
transform: translateX(-50%) translateY(-50%);
|
|
111
|
+
inset: 50% auto auto $reactflow-node-basesize * 0.5;
|
|
101
112
|
z-index: 0;
|
|
102
|
-
opacity: 0;
|
|
103
|
-
height: $reactflow-node-basesize;
|
|
104
113
|
width: $reactflow-node-basesize;
|
|
114
|
+
height: $reactflow-node-basesize;
|
|
115
|
+
opacity: 0;
|
|
116
|
+
transform: translateX(-50%) translateY(-50%);
|
|
105
117
|
}
|
|
106
118
|
}
|
|
107
119
|
|
|
108
120
|
& ~ .react-flow__handle:not(.connectable) {
|
|
109
|
-
|
|
110
|
-
left: $reactflow-node-basesize * 0.5;
|
|
111
|
-
right: auto;
|
|
112
|
-
bottom: auto;
|
|
113
|
-
transform: translateX(-50%) translateY(-50%);
|
|
121
|
+
inset: 50% auto auto $reactflow-node-basesize * 0.5;
|
|
114
122
|
z-index: 0;
|
|
115
|
-
opacity: 0;
|
|
116
|
-
height: $reactflow-node-basesize;
|
|
117
123
|
width: $reactflow-node-basesize;
|
|
124
|
+
height: $reactflow-node-basesize;
|
|
125
|
+
opacity: 0;
|
|
126
|
+
transform: translateX(-50%) translateY(-50%);
|
|
118
127
|
}
|
|
119
128
|
}
|
|
120
129
|
|
|
@@ -132,23 +141,34 @@ div.react-flow__handle-bottom {
|
|
|
132
141
|
|
|
133
142
|
.#{$eccgui}-graphviz__node--hidehandles {
|
|
134
143
|
& ~ .react-flow__handle:not(.connectable) {
|
|
135
|
-
|
|
144
|
+
z-index: -1;
|
|
136
145
|
width: 1px;
|
|
146
|
+
height: 1px;
|
|
137
147
|
visibility: hidden;
|
|
138
148
|
border: none;
|
|
139
|
-
z-index: -1;
|
|
140
149
|
|
|
141
150
|
&.react-flow__handle-top {
|
|
142
151
|
top: 0;
|
|
143
152
|
}
|
|
153
|
+
|
|
144
154
|
&.react-flow__handle-right {
|
|
145
155
|
right: 0;
|
|
146
156
|
}
|
|
157
|
+
|
|
147
158
|
&.react-flow__handle-bottom {
|
|
148
159
|
bottom: 0;
|
|
149
160
|
}
|
|
161
|
+
|
|
150
162
|
&.react-flow__handle-left {
|
|
151
163
|
left: 0;
|
|
152
164
|
}
|
|
153
165
|
}
|
|
154
166
|
}
|
|
167
|
+
|
|
168
|
+
.#{$eccgui}-graphviz__handletools-target {
|
|
169
|
+
position: absolute;
|
|
170
|
+
top: 0;
|
|
171
|
+
left: 0;
|
|
172
|
+
width: 100%;
|
|
173
|
+
height: 100%;
|
|
174
|
+
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import React, { useCallback, useEffect, useState } from "react";
|
|
2
|
+
import { Elements, ReactFlowProvider } from "react-flow-renderer";
|
|
3
|
+
import { Meta, StoryFn } from "@storybook/react";
|
|
4
|
+
|
|
5
|
+
import { HandleDefault, HandleProps, HandleTools, ReactFlow } from "./../../../../../index";
|
|
5
6
|
import { edgeTypes } from "./../../edges/edgeTypes";
|
|
6
7
|
|
|
7
8
|
const HandleDefaultDataProps = (data: HandleProps["data"]) => {
|
|
8
9
|
// this is only a mock to get it as sub element in the table
|
|
9
10
|
return <>{data.extendedTooltip}</>;
|
|
10
|
-
}
|
|
11
|
+
};
|
|
11
12
|
|
|
12
13
|
export default {
|
|
13
|
-
title: "Extensions/React Flow/
|
|
14
|
+
title: "Extensions/React Flow/Handle",
|
|
14
15
|
component: HandleDefault,
|
|
15
|
-
subcomponents: { HandleDefaultDataProps },
|
|
16
|
-
argTypes: {
|
|
17
|
-
|
|
18
|
-
} as ComponentMeta<typeof HandleDefault>;
|
|
16
|
+
subcomponents: { HandleDefaultDataProps, HandleTools },
|
|
17
|
+
argTypes: {},
|
|
18
|
+
} as Meta<typeof HandleDefault>;
|
|
19
19
|
|
|
20
20
|
const HandleDefaultExample = (args: any) => {
|
|
21
21
|
const [reactflowInstance, setReactflowInstance] = useState(null);
|
|
@@ -30,9 +30,7 @@ const HandleDefaultExample = (args: any) => {
|
|
|
30
30
|
label: "Default ",
|
|
31
31
|
content: "Example content.",
|
|
32
32
|
minimalShape: "none",
|
|
33
|
-
handles: [
|
|
34
|
-
{ ...args }
|
|
35
|
-
],
|
|
33
|
+
handles: [{ ...args }],
|
|
36
34
|
},
|
|
37
35
|
position: { x: 50, y: 200 },
|
|
38
36
|
},
|
|
@@ -48,24 +46,32 @@ const HandleDefaultExample = (args: any) => {
|
|
|
48
46
|
[reactflowInstance]
|
|
49
47
|
);
|
|
50
48
|
|
|
51
|
-
return
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
49
|
+
return (
|
|
50
|
+
<ReactFlowProvider>
|
|
51
|
+
<ReactFlow
|
|
52
|
+
elements={elements}
|
|
53
|
+
style={{ height: "400px" }}
|
|
54
|
+
onLoad={onLoad}
|
|
55
|
+
edgeTypes={edgeTypes}
|
|
56
|
+
defaultZoom={1}
|
|
57
|
+
/>
|
|
58
|
+
</ReactFlowProvider>
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
61
|
|
|
62
|
-
const Template:
|
|
63
|
-
<HandleDefaultExample {...args} />
|
|
64
|
-
);
|
|
62
|
+
const Template: StoryFn<typeof HandleDefault> = (args) => <HandleDefaultExample {...args} />;
|
|
65
63
|
|
|
66
64
|
export const Default = Template.bind({});
|
|
67
65
|
Default.args = {
|
|
68
66
|
type: "target",
|
|
69
67
|
tooltip: "this is a target handle",
|
|
70
|
-
isConnectable:
|
|
68
|
+
isConnectable: true,
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export const UsingHandleTools = Template.bind({});
|
|
72
|
+
UsingHandleTools.args = {
|
|
73
|
+
type: "source",
|
|
74
|
+
tooltip: "this is a handle with tools overlay",
|
|
75
|
+
isConnectable: true,
|
|
76
|
+
children: <HandleTools>Content could be an menu, or something else.</HandleTools>,
|
|
71
77
|
};
|
|
@@ -7,6 +7,8 @@ export * from "./nodes/NodeContentExtension";
|
|
|
7
7
|
export * from "./nodes/NodeTools";
|
|
8
8
|
export * from "./nodes/nodeUtils";
|
|
9
9
|
export * from "./handles/HandleDefault";
|
|
10
|
+
export * from "./handles/HandleContent";
|
|
11
|
+
export * from "./handles/HandleTools";
|
|
10
12
|
export * from "./edges/EdgeDefault";
|
|
11
13
|
export * from "./edges/EdgeStep";
|
|
12
14
|
export * from "./edges/EdgeTools";
|
|
@@ -38,6 +38,23 @@ export type NodeDimensions = {
|
|
|
38
38
|
height: number;
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
+
type IntroductionTime = {
|
|
42
|
+
/**
|
|
43
|
+
* The delay time in ms before the introduction animation is displayed.
|
|
44
|
+
* Until the animation starts the node is invisible.
|
|
45
|
+
*/
|
|
46
|
+
delay?: number;
|
|
47
|
+
/**
|
|
48
|
+
* The time in ms the introdcution animation runs.
|
|
49
|
+
*/
|
|
50
|
+
run: number;
|
|
51
|
+
/**
|
|
52
|
+
* Animation used for the visual introduction.
|
|
53
|
+
* `outline` is used as default animation.
|
|
54
|
+
*/
|
|
55
|
+
animation?: "landing" | "outline";
|
|
56
|
+
};
|
|
57
|
+
|
|
41
58
|
interface NodeContentData<CONTENT_PROPS = any> {
|
|
42
59
|
/**
|
|
43
60
|
* Name of icon that should be displayed before the node label.
|
|
@@ -167,6 +184,10 @@ export interface NodeContentProps<NODE_DATA, NODE_CONTENT_PROPS = any>
|
|
|
167
184
|
* The node is displayed with some animated shadow for highlighting purposes.
|
|
168
185
|
*/
|
|
169
186
|
animated?: boolean;
|
|
187
|
+
/**
|
|
188
|
+
* Time in ms used for a short animation of the node to visualize it was added or updated.
|
|
189
|
+
*/
|
|
190
|
+
introductionTime?: number | IntroductionTime;
|
|
170
191
|
|
|
171
192
|
/** Additional data stored in the node. */
|
|
172
193
|
businessData?: NODE_DATA;
|
|
@@ -324,6 +345,7 @@ export function NodeContent<CONTENT_PROPS = any>({
|
|
|
324
345
|
style = {},
|
|
325
346
|
showUnconnectableHandles = false,
|
|
326
347
|
animated = false,
|
|
348
|
+
introductionTime = 0,
|
|
327
349
|
onNodeResize,
|
|
328
350
|
nodeDimensions,
|
|
329
351
|
// forwarded props
|
|
@@ -386,7 +408,7 @@ export function NodeContent<CONTENT_PROPS = any>({
|
|
|
386
408
|
}
|
|
387
409
|
}, [nodeContentRef, onNodeResize, minimalShape, nodeDimensions]);
|
|
388
410
|
|
|
389
|
-
//update node dimensions when resized
|
|
411
|
+
// update node dimensions when resized
|
|
390
412
|
React.useEffect(() => {
|
|
391
413
|
if (nodeDimensions) {
|
|
392
414
|
setWidth(nodeDimensions.width);
|
|
@@ -394,6 +416,26 @@ export function NodeContent<CONTENT_PROPS = any>({
|
|
|
394
416
|
}
|
|
395
417
|
}, [nodeDimensions]);
|
|
396
418
|
|
|
419
|
+
// remove introduction class
|
|
420
|
+
React.useEffect(() => {
|
|
421
|
+
if (nodeContentRef && introductionTime) {
|
|
422
|
+
const timeDelay = typeof introductionTime === "object" ? introductionTime.delay ?? 0 : 0;
|
|
423
|
+
const timeRun = typeof introductionTime === "object" ? introductionTime.run : introductionTime;
|
|
424
|
+
setTimeout(() => {
|
|
425
|
+
nodeContentRef.current.className = nodeContentRef.current.className.replace(
|
|
426
|
+
`${eccgui}-graphviz__node--introduction`,
|
|
427
|
+
`${eccgui}-graphviz__node--introduction-runs`
|
|
428
|
+
);
|
|
429
|
+
}, timeDelay);
|
|
430
|
+
setTimeout(() => {
|
|
431
|
+
nodeContentRef.current.className = nodeContentRef.current.className.replace(
|
|
432
|
+
`${eccgui}-graphviz__node--introduction-runs`,
|
|
433
|
+
""
|
|
434
|
+
);
|
|
435
|
+
}, timeDelay + timeRun);
|
|
436
|
+
}
|
|
437
|
+
}, [nodeContentRef, introductionTime]);
|
|
438
|
+
|
|
397
439
|
if (handles.length > 0) {
|
|
398
440
|
handles.forEach((handle) => {
|
|
399
441
|
if (handle.position) {
|
|
@@ -430,12 +472,26 @@ export function NodeContent<CONTENT_PROPS = any>({
|
|
|
430
472
|
|
|
431
473
|
const resizableStyles =
|
|
432
474
|
!!onNodeResize === true && minimalShape === "none" && width + height > 0 ? { width, height } : {};
|
|
475
|
+
|
|
476
|
+
const introductionStyles = introductionTime
|
|
477
|
+
? ({
|
|
478
|
+
"--node-introduction-time": `${
|
|
479
|
+
typeof introductionTime === "object" ? introductionTime.run : introductionTime
|
|
480
|
+
}ms`,
|
|
481
|
+
} as React.CSSProperties)
|
|
482
|
+
: {};
|
|
433
483
|
const nodeContent = (
|
|
434
484
|
<>
|
|
435
485
|
<section
|
|
436
486
|
ref={nodeContentRef}
|
|
437
487
|
{...otherProps}
|
|
438
|
-
style={{
|
|
488
|
+
style={{
|
|
489
|
+
...style,
|
|
490
|
+
...highlightCustomPropertySettings,
|
|
491
|
+
...styleExpandDimensions,
|
|
492
|
+
...resizableStyles,
|
|
493
|
+
...introductionStyles,
|
|
494
|
+
}}
|
|
439
495
|
className={
|
|
440
496
|
`${eccgui}-graphviz__node` +
|
|
441
497
|
` ${eccgui}-graphviz__node--${size}` +
|
|
@@ -452,9 +508,13 @@ export function NodeContent<CONTENT_PROPS = any>({
|
|
|
452
508
|
? " " + gethighlightedStateClasses(highlightedState, `${eccgui}-graphviz__node`)
|
|
453
509
|
: "") +
|
|
454
510
|
(animated ? ` ${eccgui}-graphviz__node--animated` : "") +
|
|
511
|
+
(introductionTime ? ` ${eccgui}-graphviz__node--introduction` : "") +
|
|
455
512
|
(showUnconnectableHandles === false ? ` ${eccgui}-graphviz__node--hidehandles` : "") +
|
|
456
513
|
(letPassWheelEvents === false ? ` nowheel` : "")
|
|
457
514
|
}
|
|
515
|
+
data-introduction-animation={
|
|
516
|
+
typeof introductionTime === "object" ? introductionTime.animation : undefined
|
|
517
|
+
}
|
|
458
518
|
>
|
|
459
519
|
<header
|
|
460
520
|
className={
|