@hitachivantara/uikit-react-lab 6.0.0-next.1 → 6.0.0-next.2
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/dist/Flow/Background/Background.js +2 -2
- package/dist/Flow/Controls/Controls.js +1 -1
- package/dist/Flow/DroppableFlow.js +1 -1
- package/dist/Flow/Empty/Empty.js +1 -1
- package/dist/Flow/Flow.js +1 -1
- package/dist/Flow/Flow.styles.js +1 -1
- package/dist/Flow/Minimap/Minimap.js +1 -1
- package/dist/Flow/Node/BaseNode.js +1 -1
- package/dist/Flow/base.js +79 -400
- package/dist/Flow/hooks/useFlowInstance.js +1 -1
- package/dist/Flow/hooks/useFlowNode.js +4 -4
- package/dist/Flow/hooks/useNodeId.js +1 -1
- package/dist/Flow/nodes/DashboardNode.js +89 -0
- package/dist/Flow/nodes/DashboardNode.styles.js +16 -0
- package/dist/Flow/nodes/StickyNode.js +439 -0
- package/dist/index.d.ts +158 -59
- package/dist/index.js +18 -12
- package/package.json +7 -7
package/dist/Flow/base.js
CHANGED
|
@@ -1,114 +1,8 @@
|
|
|
1
1
|
import { css } from "@emotion/react";
|
|
2
|
-
import { theme } from "@hitachivantara/uikit-
|
|
2
|
+
import { theme } from "@hitachivantara/uikit-react-core";
|
|
3
3
|
const flowStyles = css`
|
|
4
4
|
/* this gets exported as style.css and can be used for the default theming */
|
|
5
5
|
/* these are the necessary styles for React Flow, they get used by base.css and style.css */
|
|
6
|
-
.react-flow {
|
|
7
|
-
direction: ltr;
|
|
8
|
-
|
|
9
|
-
--xy-edge-stroke-default: #b1b1b7;
|
|
10
|
-
--xy-edge-stroke-width-default: 1;
|
|
11
|
-
--xy-edge-stroke-selected-default: #555;
|
|
12
|
-
|
|
13
|
-
--xy-connectionline-stroke-default: #b1b1b7;
|
|
14
|
-
--xy-connectionline-stroke-width-default: 1;
|
|
15
|
-
|
|
16
|
-
--xy-attribution-background-color-default: rgba(255, 255, 255, 0.5);
|
|
17
|
-
|
|
18
|
-
--xy-minimap-background-color-default: #fff;
|
|
19
|
-
--xy-minimap-mask-background-color-default: rgba(240, 240, 240, 0.6);
|
|
20
|
-
--xy-minimap-mask-stroke-color-default: transparent;
|
|
21
|
-
--xy-minimap-mask-stroke-width-default: 1;
|
|
22
|
-
--xy-minimap-node-background-color-default: #e2e2e2;
|
|
23
|
-
--xy-minimap-node-stroke-color-default: transparent;
|
|
24
|
-
--xy-minimap-node-stroke-width-default: 2;
|
|
25
|
-
|
|
26
|
-
--xy-background-color-default: transparent;
|
|
27
|
-
--xy-background-pattern-dots-color-default: #91919a;
|
|
28
|
-
--xy-background-pattern-lines-color-default: #eee;
|
|
29
|
-
--xy-background-pattern-cross-color-default: #e2e2e2;
|
|
30
|
-
background-color: var(
|
|
31
|
-
--xy-background-color,
|
|
32
|
-
var(--xy-background-color-default)
|
|
33
|
-
);
|
|
34
|
-
--xy-node-color-default: inherit;
|
|
35
|
-
--xy-node-border-default: 1px solid #1a192b;
|
|
36
|
-
--xy-node-background-color-default: #fff;
|
|
37
|
-
--xy-node-group-background-color-default: rgba(240, 240, 240, 0.25);
|
|
38
|
-
--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, 0.08);
|
|
39
|
-
--xy-node-boxshadow-selected-default: 0 0 0 0.5px #1a192b;
|
|
40
|
-
--xy-node-border-radius-default: 3px;
|
|
41
|
-
|
|
42
|
-
--xy-handle-background-color-default: #1a192b;
|
|
43
|
-
--xy-handle-border-color-default: #fff;
|
|
44
|
-
|
|
45
|
-
--xy-selection-background-color-default: rgba(0, 89, 220, 0.08);
|
|
46
|
-
--xy-selection-border-default: 1px dotted rgba(0, 89, 220, 0.8);
|
|
47
|
-
|
|
48
|
-
--xy-controls-button-background-color-default: #fefefe;
|
|
49
|
-
--xy-controls-button-background-color-hover-default: #f4f4f4;
|
|
50
|
-
--xy-controls-button-color-default: inherit;
|
|
51
|
-
--xy-controls-button-color-hover-default: inherit;
|
|
52
|
-
--xy-controls-button-border-color-default: #eee;
|
|
53
|
-
--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, 0.08);
|
|
54
|
-
|
|
55
|
-
--xy-edge-label-background-color-default: #ffffff;
|
|
56
|
-
--xy-edge-label-color-default: inherit;
|
|
57
|
-
--xy-resize-background-color-default: #3367d9;
|
|
58
|
-
}
|
|
59
|
-
.react-flow.dark {
|
|
60
|
-
--xy-edge-stroke-default: #3e3e3e;
|
|
61
|
-
--xy-edge-stroke-width-default: 1;
|
|
62
|
-
--xy-edge-stroke-selected-default: #727272;
|
|
63
|
-
|
|
64
|
-
--xy-connectionline-stroke-default: #b1b1b7;
|
|
65
|
-
--xy-connectionline-stroke-width-default: 1;
|
|
66
|
-
|
|
67
|
-
--xy-attribution-background-color-default: rgba(150, 150, 150, 0.25);
|
|
68
|
-
|
|
69
|
-
--xy-minimap-background-color-default: #141414;
|
|
70
|
-
--xy-minimap-mask-background-color-default: rgba(60, 60, 60, 0.6);
|
|
71
|
-
--xy-minimap-mask-stroke-color-default: transparent;
|
|
72
|
-
--xy-minimap-mask-stroke-width-default: 1;
|
|
73
|
-
--xy-minimap-node-background-color-default: #2b2b2b;
|
|
74
|
-
--xy-minimap-node-stroke-color-default: transparent;
|
|
75
|
-
--xy-minimap-node-stroke-width-default: 2;
|
|
76
|
-
|
|
77
|
-
--xy-background-color-default: #141414;
|
|
78
|
-
--xy-background-pattern-dots-color-default: #777;
|
|
79
|
-
--xy-background-pattern-lines-color-default: #777;
|
|
80
|
-
--xy-background-pattern-cross-color-default: #777;
|
|
81
|
-
--xy-node-color-default: #f8f8f8;
|
|
82
|
-
--xy-node-border-default: 1px solid #3c3c3c;
|
|
83
|
-
--xy-node-background-color-default: #1e1e1e;
|
|
84
|
-
--xy-node-group-background-color-default: rgba(240, 240, 240, 0.25);
|
|
85
|
-
--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, 0.08);
|
|
86
|
-
--xy-node-boxshadow-selected-default: 0 0 0 0.5px #999;
|
|
87
|
-
|
|
88
|
-
--xy-handle-background-color-default: #bebebe;
|
|
89
|
-
--xy-handle-border-color-default: #1e1e1e;
|
|
90
|
-
|
|
91
|
-
--xy-selection-background-color-default: rgba(200, 200, 220, 0.08);
|
|
92
|
-
--xy-selection-border-default: 1px dotted rgba(200, 200, 220, 0.8);
|
|
93
|
-
|
|
94
|
-
--xy-controls-button-background-color-default: #2b2b2b;
|
|
95
|
-
--xy-controls-button-background-color-hover-default: #3e3e3e;
|
|
96
|
-
--xy-controls-button-color-default: #f8f8f8;
|
|
97
|
-
--xy-controls-button-color-hover-default: #fff;
|
|
98
|
-
--xy-controls-button-border-color-default: #5b5b5b;
|
|
99
|
-
--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, 0.08);
|
|
100
|
-
|
|
101
|
-
--xy-edge-label-background-color-default: #141414;
|
|
102
|
-
--xy-edge-label-color-default: #f8f8f8;
|
|
103
|
-
}
|
|
104
|
-
.react-flow__background {
|
|
105
|
-
background-color: var(
|
|
106
|
-
--xy-background-color-props,
|
|
107
|
-
var(--xy-background-color, var(--xy-background-color-default))
|
|
108
|
-
);
|
|
109
|
-
pointer-events: none;
|
|
110
|
-
z-index: -1;
|
|
111
|
-
}
|
|
112
6
|
.react-flow__container {
|
|
113
7
|
position: absolute;
|
|
114
8
|
width: 100%;
|
|
@@ -118,16 +12,16 @@ const flowStyles = css`
|
|
|
118
12
|
}
|
|
119
13
|
.react-flow__pane {
|
|
120
14
|
z-index: 1;
|
|
121
|
-
|
|
122
|
-
.react-flow__pane.draggable {
|
|
15
|
+
cursor: -webkit-grab;
|
|
123
16
|
cursor: grab;
|
|
124
17
|
}
|
|
125
|
-
.react-flow__pane.dragging {
|
|
126
|
-
cursor: grabbing;
|
|
127
|
-
}
|
|
128
18
|
.react-flow__pane.selection {
|
|
129
19
|
cursor: pointer;
|
|
130
20
|
}
|
|
21
|
+
.react-flow__pane.dragging {
|
|
22
|
+
cursor: -webkit-grabbing;
|
|
23
|
+
cursor: grabbing;
|
|
24
|
+
}
|
|
131
25
|
.react-flow__viewport {
|
|
132
26
|
transform-origin: 0 0;
|
|
133
27
|
z-index: 2;
|
|
@@ -153,41 +47,18 @@ const flowStyles = css`
|
|
|
153
47
|
stroke-width: 1;
|
|
154
48
|
fill: none;
|
|
155
49
|
}
|
|
156
|
-
.react-flow__connection-path {
|
|
157
|
-
stroke: var(
|
|
158
|
-
--xy-connectionline-stroke,
|
|
159
|
-
var(--xy-connectionline-stroke-default)
|
|
160
|
-
);
|
|
161
|
-
stroke-width: var(
|
|
162
|
-
--xy-connectionline-stroke-width,
|
|
163
|
-
var(--xy-connectionline-stroke-width-default)
|
|
164
|
-
);
|
|
165
|
-
fill: none;
|
|
166
|
-
}
|
|
167
|
-
.react-flow .react-flow__edges {
|
|
168
|
-
position: absolute;
|
|
169
|
-
top: 0;
|
|
170
|
-
left: 0;
|
|
171
|
-
width: 100%;
|
|
172
|
-
height: 100%;
|
|
173
|
-
}
|
|
174
|
-
.react-flow .react-flow__edges svg {
|
|
175
|
-
overflow: visible;
|
|
176
|
-
position: absolute;
|
|
177
|
-
pointer-events: none;
|
|
178
|
-
}
|
|
179
50
|
.react-flow__edge {
|
|
180
51
|
pointer-events: visibleStroke;
|
|
181
|
-
}
|
|
182
|
-
.react-flow__edge.selectable {
|
|
183
52
|
cursor: pointer;
|
|
184
53
|
}
|
|
185
54
|
.react-flow__edge.animated path {
|
|
186
55
|
stroke-dasharray: 5;
|
|
56
|
+
-webkit-animation: dashdraw 0.5s linear infinite;
|
|
187
57
|
animation: dashdraw 0.5s linear infinite;
|
|
188
58
|
}
|
|
189
59
|
.react-flow__edge.animated path.react-flow__edge-interaction {
|
|
190
60
|
stroke-dasharray: none;
|
|
61
|
+
-webkit-animation: none;
|
|
191
62
|
animation: none;
|
|
192
63
|
}
|
|
193
64
|
.react-flow__edge.inactive {
|
|
@@ -199,16 +70,16 @@ const flowStyles = css`
|
|
|
199
70
|
outline: none;
|
|
200
71
|
}
|
|
201
72
|
.react-flow__edge.selected .react-flow__edge-path,
|
|
202
|
-
.react-flow__edge
|
|
203
|
-
.react-flow__edge
|
|
204
|
-
stroke:
|
|
205
|
-
--xy-edge-stroke-selected,
|
|
206
|
-
var(--xy-edge-stroke-selected-default)
|
|
207
|
-
);
|
|
73
|
+
.react-flow__edge:focus .react-flow__edge-path,
|
|
74
|
+
.react-flow__edge:focus-visible .react-flow__edge-path {
|
|
75
|
+
stroke: #555;
|
|
208
76
|
}
|
|
209
77
|
.react-flow__edge-textwrapper {
|
|
210
78
|
pointer-events: all;
|
|
211
79
|
}
|
|
80
|
+
.react-flow__edge-textbg {
|
|
81
|
+
fill: white;
|
|
82
|
+
}
|
|
212
83
|
.react-flow__edge .react-flow__edge-text {
|
|
213
84
|
pointer-events: none;
|
|
214
85
|
-webkit-user-select: none;
|
|
@@ -220,12 +91,11 @@ const flowStyles = css`
|
|
|
220
91
|
}
|
|
221
92
|
.react-flow__connection .animated {
|
|
222
93
|
stroke-dasharray: 5;
|
|
94
|
+
-webkit-animation: dashdraw 0.5s linear infinite;
|
|
223
95
|
animation: dashdraw 0.5s linear infinite;
|
|
224
96
|
}
|
|
225
|
-
|
|
97
|
+
.react-flow__connectionline {
|
|
226
98
|
z-index: 1001;
|
|
227
|
-
overflow: visible;
|
|
228
|
-
position: absolute;
|
|
229
99
|
}
|
|
230
100
|
.react-flow__nodes {
|
|
231
101
|
pointer-events: none;
|
|
@@ -239,16 +109,11 @@ const flowStyles = css`
|
|
|
239
109
|
pointer-events: all;
|
|
240
110
|
transform-origin: 0 0;
|
|
241
111
|
box-sizing: border-box;
|
|
242
|
-
cursor:
|
|
243
|
-
}
|
|
244
|
-
.react-flow__node.selectable {
|
|
245
|
-
cursor: pointer;
|
|
246
|
-
}
|
|
247
|
-
.react-flow__node.draggable {
|
|
112
|
+
cursor: -webkit-grab;
|
|
248
113
|
cursor: grab;
|
|
249
|
-
pointer-events: all;
|
|
250
114
|
}
|
|
251
|
-
.react-flow__node.
|
|
115
|
+
.react-flow__node.dragging {
|
|
116
|
+
cursor: -webkit-grabbing;
|
|
252
117
|
cursor: grabbing;
|
|
253
118
|
}
|
|
254
119
|
.react-flow__nodesselection {
|
|
@@ -259,6 +124,7 @@ const flowStyles = css`
|
|
|
259
124
|
.react-flow__nodesselection-rect {
|
|
260
125
|
position: absolute;
|
|
261
126
|
pointer-events: all;
|
|
127
|
+
cursor: -webkit-grab;
|
|
262
128
|
cursor: grab;
|
|
263
129
|
}
|
|
264
130
|
.react-flow__handle {
|
|
@@ -268,17 +134,10 @@ const flowStyles = css`
|
|
|
268
134
|
min-height: 5px;
|
|
269
135
|
width: 6px;
|
|
270
136
|
height: 6px;
|
|
271
|
-
background
|
|
272
|
-
|
|
273
|
-
var(--xy-handle-background-color-default)
|
|
274
|
-
);
|
|
275
|
-
border: 1px solid
|
|
276
|
-
var(--xy-handle-border-color, var(--xy-handle-border-color-default));
|
|
137
|
+
background: #1a192b;
|
|
138
|
+
border: 1px solid white;
|
|
277
139
|
border-radius: 100%;
|
|
278
140
|
}
|
|
279
|
-
.react-flow__handle.connectingfrom {
|
|
280
|
-
pointer-events: all;
|
|
281
|
-
}
|
|
282
141
|
.react-flow__handle.connectionindicator {
|
|
283
142
|
pointer-events: all;
|
|
284
143
|
cursor: crosshair;
|
|
@@ -286,17 +145,17 @@ const flowStyles = css`
|
|
|
286
145
|
.react-flow__handle-bottom {
|
|
287
146
|
top: auto;
|
|
288
147
|
left: 50%;
|
|
289
|
-
bottom:
|
|
290
|
-
transform: translate(-50%,
|
|
148
|
+
bottom: -4px;
|
|
149
|
+
transform: translate(-50%, 0);
|
|
291
150
|
}
|
|
292
151
|
.react-flow__handle-top {
|
|
293
|
-
top: 0;
|
|
294
152
|
left: 50%;
|
|
295
|
-
|
|
153
|
+
top: -4px;
|
|
154
|
+
transform: translate(-50%, 0);
|
|
296
155
|
}
|
|
297
156
|
.react-flow__handle-left {
|
|
298
|
-
left: -4px;
|
|
299
157
|
top: 50%;
|
|
158
|
+
left: -4px;
|
|
300
159
|
transform: translate(0, -50%);
|
|
301
160
|
}
|
|
302
161
|
.react-flow__handle-right {
|
|
@@ -308,9 +167,6 @@ const flowStyles = css`
|
|
|
308
167
|
cursor: move;
|
|
309
168
|
pointer-events: all;
|
|
310
169
|
}
|
|
311
|
-
.react-flow__pane.selection .react-flow__panel {
|
|
312
|
-
pointer-events: none;
|
|
313
|
-
}
|
|
314
170
|
.react-flow__panel {
|
|
315
171
|
position: absolute;
|
|
316
172
|
z-index: 5;
|
|
@@ -322,28 +178,19 @@ const flowStyles = css`
|
|
|
322
178
|
.react-flow__panel.bottom {
|
|
323
179
|
bottom: 0;
|
|
324
180
|
}
|
|
325
|
-
.react-flow__panel.top.center,
|
|
326
|
-
.react-flow__panel.bottom.center {
|
|
327
|
-
left: 50%;
|
|
328
|
-
transform: translateX(-15px) translateX(-50%);
|
|
329
|
-
}
|
|
330
181
|
.react-flow__panel.left {
|
|
331
182
|
left: 0;
|
|
332
183
|
}
|
|
333
184
|
.react-flow__panel.right {
|
|
334
185
|
right: 0;
|
|
335
186
|
}
|
|
336
|
-
.react-flow__panel.
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
transform: translateY(-15px) translateY(-50%);
|
|
187
|
+
.react-flow__panel.center {
|
|
188
|
+
left: 50%;
|
|
189
|
+
transform: translateX(-50%);
|
|
340
190
|
}
|
|
341
191
|
.react-flow__attribution {
|
|
342
192
|
font-size: 10px;
|
|
343
|
-
background:
|
|
344
|
-
--xy-attribution-background-color,
|
|
345
|
-
var(--xy-attribution-background-color-default)
|
|
346
|
-
);
|
|
193
|
+
background: rgba(255, 255, 255, 0.5);
|
|
347
194
|
padding: 2px 3px;
|
|
348
195
|
margin: 0;
|
|
349
196
|
}
|
|
@@ -351,6 +198,11 @@ const flowStyles = css`
|
|
|
351
198
|
text-decoration: none;
|
|
352
199
|
color: #999;
|
|
353
200
|
}
|
|
201
|
+
@-webkit-keyframes dashdraw {
|
|
202
|
+
from {
|
|
203
|
+
stroke-dashoffset: 10;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
354
206
|
@keyframes dashdraw {
|
|
355
207
|
from {
|
|
356
208
|
stroke-dashoffset: 10;
|
|
@@ -364,149 +216,6 @@ const flowStyles = css`
|
|
|
364
216
|
-webkit-user-select: none;
|
|
365
217
|
-moz-user-select: none;
|
|
366
218
|
user-select: none;
|
|
367
|
-
left: 0;
|
|
368
|
-
top: 0;
|
|
369
|
-
}
|
|
370
|
-
.react-flow__viewport-portal {
|
|
371
|
-
position: absolute;
|
|
372
|
-
width: 100%;
|
|
373
|
-
height: 100%;
|
|
374
|
-
left: 0;
|
|
375
|
-
top: 0;
|
|
376
|
-
-webkit-user-select: none;
|
|
377
|
-
-moz-user-select: none;
|
|
378
|
-
user-select: none;
|
|
379
|
-
}
|
|
380
|
-
.react-flow__minimap {
|
|
381
|
-
background: var(
|
|
382
|
-
--xy-minimap-background-color-props,
|
|
383
|
-
var(
|
|
384
|
-
--xy-minimap-background-color,
|
|
385
|
-
var(--xy-minimap-background-color-default)
|
|
386
|
-
)
|
|
387
|
-
);
|
|
388
|
-
}
|
|
389
|
-
.react-flow__minimap-svg {
|
|
390
|
-
display: block;
|
|
391
|
-
}
|
|
392
|
-
.react-flow__minimap-mask {
|
|
393
|
-
fill: var(
|
|
394
|
-
--xy-minimap-mask-background-color-props,
|
|
395
|
-
var(
|
|
396
|
-
--xy-minimap-mask-background-color,
|
|
397
|
-
var(--xy-minimap-mask-background-color-default)
|
|
398
|
-
)
|
|
399
|
-
);
|
|
400
|
-
stroke: var(
|
|
401
|
-
--xy-minimap-mask-stroke-color-props,
|
|
402
|
-
var(
|
|
403
|
-
--xy-minimap-mask-stroke-color,
|
|
404
|
-
var(--xy-minimap-mask-stroke-color-default)
|
|
405
|
-
)
|
|
406
|
-
);
|
|
407
|
-
stroke-width: var(
|
|
408
|
-
--xy-minimap-mask-stroke-width-props,
|
|
409
|
-
var(
|
|
410
|
-
--xy-minimap-mask-stroke-width,
|
|
411
|
-
var(--xy-minimap-mask-stroke-width-default)
|
|
412
|
-
)
|
|
413
|
-
);
|
|
414
|
-
}
|
|
415
|
-
.react-flow__minimap-node {
|
|
416
|
-
fill: var(
|
|
417
|
-
--xy-minimap-node-background-color-props,
|
|
418
|
-
var(
|
|
419
|
-
--xy-minimap-node-background-color,
|
|
420
|
-
var(--xy-minimap-node-background-color-default)
|
|
421
|
-
)
|
|
422
|
-
);
|
|
423
|
-
stroke: var(
|
|
424
|
-
--xy-minimap-node-stroke-color-props,
|
|
425
|
-
var(
|
|
426
|
-
--xy-minimap-node-stroke-color,
|
|
427
|
-
var(--xy-minimap-node-stroke-color-default)
|
|
428
|
-
)
|
|
429
|
-
);
|
|
430
|
-
stroke-width: var(
|
|
431
|
-
--xy-minimap-node-stroke-width-props,
|
|
432
|
-
var(
|
|
433
|
-
--xy-minimap-node-stroke-width,
|
|
434
|
-
var(--xy-minimap-node-stroke-width-default)
|
|
435
|
-
)
|
|
436
|
-
);
|
|
437
|
-
}
|
|
438
|
-
.react-flow__background-pattern.dots {
|
|
439
|
-
fill: var(
|
|
440
|
-
--xy-background-pattern-color-props,
|
|
441
|
-
var(
|
|
442
|
-
--xy-background-pattern-color,
|
|
443
|
-
var(--xy-background-pattern-dots-color-default)
|
|
444
|
-
)
|
|
445
|
-
);
|
|
446
|
-
}
|
|
447
|
-
.react-flow__background-pattern.lines {
|
|
448
|
-
stroke: var(
|
|
449
|
-
--xy-background-pattern-color-props,
|
|
450
|
-
var(
|
|
451
|
-
--xy-background-pattern-color,
|
|
452
|
-
var(--xy-background-pattern-lines-color-default)
|
|
453
|
-
)
|
|
454
|
-
);
|
|
455
|
-
}
|
|
456
|
-
.react-flow__background-pattern.cross {
|
|
457
|
-
stroke: var(
|
|
458
|
-
--xy-background-pattern-color-props,
|
|
459
|
-
var(
|
|
460
|
-
--xy-background-pattern-color,
|
|
461
|
-
var(--xy-background-pattern-cross-color-default)
|
|
462
|
-
)
|
|
463
|
-
);
|
|
464
|
-
}
|
|
465
|
-
.react-flow__controls {
|
|
466
|
-
display: flex;
|
|
467
|
-
flex-direction: column;
|
|
468
|
-
box-shadow: var(
|
|
469
|
-
--xy-controls-box-shadow,
|
|
470
|
-
var(--xy-controls-box-shadow-default)
|
|
471
|
-
);
|
|
472
|
-
}
|
|
473
|
-
.react-flow__controls.horizontal {
|
|
474
|
-
flex-direction: row;
|
|
475
|
-
}
|
|
476
|
-
.react-flow__controls-button {
|
|
477
|
-
display: flex;
|
|
478
|
-
justify-content: center;
|
|
479
|
-
align-items: center;
|
|
480
|
-
height: 26px;
|
|
481
|
-
width: 26px;
|
|
482
|
-
padding: 4px;
|
|
483
|
-
border: none;
|
|
484
|
-
background: var(
|
|
485
|
-
--xy-controls-button-background-color,
|
|
486
|
-
var(--xy-controls-button-background-color-default)
|
|
487
|
-
);
|
|
488
|
-
border-bottom: 1px solid
|
|
489
|
-
var(
|
|
490
|
-
--xy-controls-button-border-color-props,
|
|
491
|
-
var(
|
|
492
|
-
--xy-controls-button-border-color,
|
|
493
|
-
var(--xy-controls-button-border-color-default)
|
|
494
|
-
)
|
|
495
|
-
);
|
|
496
|
-
color: var(
|
|
497
|
-
--xy-controls-button-color-props,
|
|
498
|
-
var(--xy-controls-button-color, var(--xy-controls-button-color-default))
|
|
499
|
-
);
|
|
500
|
-
cursor: pointer;
|
|
501
|
-
-webkit-user-select: none;
|
|
502
|
-
-moz-user-select: none;
|
|
503
|
-
user-select: none;
|
|
504
|
-
}
|
|
505
|
-
.react-flow__controls-button svg {
|
|
506
|
-
width: 100%;
|
|
507
|
-
max-width: 12px;
|
|
508
|
-
max-height: 12px;
|
|
509
|
-
fill: currentColor;
|
|
510
219
|
}
|
|
511
220
|
.react-flow__edge.updating .react-flow__edge-path {
|
|
512
221
|
stroke: #777;
|
|
@@ -518,6 +227,7 @@ const flowStyles = css`
|
|
|
518
227
|
.react-flow__node.selectable:focus-visible {
|
|
519
228
|
outline: none;
|
|
520
229
|
}
|
|
230
|
+
.react-flow__node-default,
|
|
521
231
|
.react-flow__node-input,
|
|
522
232
|
.react-flow__node-output {
|
|
523
233
|
padding: ${theme.space.sm};
|
|
@@ -531,51 +241,35 @@ const flowStyles = css`
|
|
|
531
241
|
.react-flow__node-group {
|
|
532
242
|
color: ${theme.colors.text};
|
|
533
243
|
text-align: center;
|
|
534
|
-
border: var(--xy-node-border, var(--xy-node-border-default));
|
|
535
|
-
background-color: var(
|
|
536
|
-
--xy-node-background-color,
|
|
537
|
-
var(--xy-node-background-color-default)
|
|
538
|
-
);
|
|
539
244
|
}
|
|
540
|
-
.react-flow__node-
|
|
245
|
+
.react-flow__node-default::before {
|
|
246
|
+
content: "Unknown node type";
|
|
247
|
+
display: block;
|
|
248
|
+
}
|
|
541
249
|
.react-flow__node-default.selectable:hover,
|
|
250
|
+
.react-flow__node-input.selectable:hover,
|
|
542
251
|
.react-flow__node-output.selectable:hover,
|
|
543
252
|
.react-flow__node-group.selectable:hover {
|
|
544
|
-
box-shadow: var(
|
|
545
|
-
--xy-node-boxshadow-hover,
|
|
546
|
-
var(--xy-node-boxshadow-hover-default)
|
|
547
|
-
);
|
|
548
253
|
}
|
|
549
|
-
.react-flow__node-input.selectable.selected,
|
|
550
|
-
.react-flow__node-input.selectable:focus,
|
|
551
|
-
.react-flow__node-input.selectable:focus-visible,
|
|
552
254
|
.react-flow__node-default.selectable.selected,
|
|
553
255
|
.react-flow__node-default.selectable:focus,
|
|
554
256
|
.react-flow__node-default.selectable:focus-visible,
|
|
257
|
+
.react-flow__node-input.selectable.selected,
|
|
258
|
+
.react-flow__node-input.selectable:focus,
|
|
259
|
+
.react-flow__node-input.selectable:focus-visible,
|
|
555
260
|
.react-flow__node-output.selectable.selected,
|
|
556
261
|
.react-flow__node-output.selectable:focus,
|
|
557
262
|
.react-flow__node-output.selectable:focus-visible,
|
|
558
263
|
.react-flow__node-group.selectable.selected,
|
|
559
264
|
.react-flow__node-group.selectable:focus,
|
|
560
265
|
.react-flow__node-group.selectable:focus-visible {
|
|
561
|
-
box-shadow: var(
|
|
562
|
-
--xy-node-boxshadow-selected,
|
|
563
|
-
var(--xy-node-boxshadow-selected-default)
|
|
564
|
-
);
|
|
565
266
|
}
|
|
566
267
|
.react-flow__node-group {
|
|
567
|
-
background-color:
|
|
568
|
-
--xy-node-group-background-color,
|
|
569
|
-
var(--xy-node-group-background-color-default)
|
|
570
|
-
);
|
|
268
|
+
background-color: rgba(240, 240, 240, 0.25);
|
|
571
269
|
}
|
|
572
270
|
.react-flow__nodesselection-rect,
|
|
573
271
|
.react-flow__selection {
|
|
574
|
-
background:
|
|
575
|
-
--xy-selection-background-color,
|
|
576
|
-
var(--xy-selection-background-color-default)
|
|
577
|
-
);
|
|
578
|
-
border: var(--xy-selection-border, var(--xy-selection-border-default));
|
|
272
|
+
background: rgba(0, 89, 220, 0.08);
|
|
579
273
|
}
|
|
580
274
|
.react-flow__nodesselection-rect:focus,
|
|
581
275
|
.react-flow__nodesselection-rect:focus-visible,
|
|
@@ -583,21 +277,32 @@ const flowStyles = css`
|
|
|
583
277
|
.react-flow__selection:focus-visible {
|
|
584
278
|
outline: none;
|
|
585
279
|
}
|
|
280
|
+
.react-flow__controls {
|
|
281
|
+
box-shadow: ${theme.colors.shadow};
|
|
282
|
+
}
|
|
283
|
+
.react-flow__controls-button {
|
|
284
|
+
border: none;
|
|
285
|
+
background: #fefefe;
|
|
286
|
+
border-bottom: 1px solid #eee;
|
|
287
|
+
box-sizing: content-box;
|
|
288
|
+
display: flex;
|
|
289
|
+
justify-content: center;
|
|
290
|
+
align-items: center;
|
|
291
|
+
width: 16px;
|
|
292
|
+
height: 16px;
|
|
293
|
+
cursor: pointer;
|
|
294
|
+
-webkit-user-select: none;
|
|
295
|
+
-moz-user-select: none;
|
|
296
|
+
user-select: none;
|
|
297
|
+
padding: 5px;
|
|
298
|
+
}
|
|
586
299
|
.react-flow__controls-button:hover {
|
|
587
|
-
background:
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
);
|
|
594
|
-
color: var(
|
|
595
|
-
--xy-controls-button-color-hover-props,
|
|
596
|
-
var(
|
|
597
|
-
--xy-controls-button-color-hover,
|
|
598
|
-
var(--xy-controls-button-color-hover-default)
|
|
599
|
-
)
|
|
600
|
-
);
|
|
300
|
+
background: #f4f4f4;
|
|
301
|
+
}
|
|
302
|
+
.react-flow__controls-button svg {
|
|
303
|
+
width: 100%;
|
|
304
|
+
max-width: 12px;
|
|
305
|
+
max-height: 12px;
|
|
601
306
|
}
|
|
602
307
|
.react-flow__controls-button:disabled {
|
|
603
308
|
pointer-events: none;
|
|
@@ -605,22 +310,8 @@ const flowStyles = css`
|
|
|
605
310
|
.react-flow__controls-button:disabled svg {
|
|
606
311
|
fill-opacity: 0.4;
|
|
607
312
|
}
|
|
608
|
-
.react-
|
|
609
|
-
|
|
610
|
-
}
|
|
611
|
-
.react-flow__controls.horizontal .react-flow__controls-button {
|
|
612
|
-
border-bottom: none;
|
|
613
|
-
border-right: 1px solid
|
|
614
|
-
var(
|
|
615
|
-
--xy-controls-button-border-color-props,
|
|
616
|
-
var(
|
|
617
|
-
--xy-controls-button-border-color,
|
|
618
|
-
var(--xy-controls-button-border-color-default)
|
|
619
|
-
)
|
|
620
|
-
);
|
|
621
|
-
}
|
|
622
|
-
.react-flow__controls.horizontal .react-flow__controls-button:last-child {
|
|
623
|
-
border-right: none;
|
|
313
|
+
.react-flow__minimap {
|
|
314
|
+
background-color: #fff;
|
|
624
315
|
}
|
|
625
316
|
.react-flow__resize-control {
|
|
626
317
|
position: absolute;
|
|
@@ -643,15 +334,12 @@ const flowStyles = css`
|
|
|
643
334
|
}
|
|
644
335
|
/* handle styles */
|
|
645
336
|
.react-flow__resize-control.handle {
|
|
646
|
-
width:
|
|
647
|
-
height:
|
|
337
|
+
width: 4px;
|
|
338
|
+
height: 4px;
|
|
648
339
|
border: 1px solid #fff;
|
|
649
340
|
border-radius: 1px;
|
|
650
|
-
background-color:
|
|
651
|
-
|
|
652
|
-
var(--xy-resize-background-color-default)
|
|
653
|
-
);
|
|
654
|
-
translate: -50% -50%;
|
|
341
|
+
background-color: ${theme.colors.primary};
|
|
342
|
+
transform: translate(-50%, -50%);
|
|
655
343
|
}
|
|
656
344
|
.react-flow__resize-control.handle.left {
|
|
657
345
|
left: 0;
|
|
@@ -685,7 +373,7 @@ const flowStyles = css`
|
|
|
685
373
|
.react-flow__resize-control.line {
|
|
686
374
|
border-color: ${theme.colors.primaryStrong};
|
|
687
375
|
border-width: 0;
|
|
688
|
-
border-style:
|
|
376
|
+
border-style: dashed;
|
|
689
377
|
}
|
|
690
378
|
.react-flow__resize-control.line.left,
|
|
691
379
|
.react-flow__resize-control.line.right {
|
|
@@ -717,15 +405,6 @@ const flowStyles = css`
|
|
|
717
405
|
border-bottom-width: 1px;
|
|
718
406
|
top: 100%;
|
|
719
407
|
}
|
|
720
|
-
.react-flow__edge-textbg {
|
|
721
|
-
fill: var(
|
|
722
|
-
--xy-edge-label-background-color,
|
|
723
|
-
var(--xy-edge-label-background-color-default)
|
|
724
|
-
);
|
|
725
|
-
}
|
|
726
|
-
.react-flow__edge-text {
|
|
727
|
-
fill: var(--xy-edge-label-color, var(--xy-edge-label-color-default));
|
|
728
|
-
}
|
|
729
408
|
`;
|
|
730
409
|
export {
|
|
731
410
|
flowStyles
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCallback, useMemo } from "react";
|
|
2
|
-
import { useStore, useNodes, useEdges } from "
|
|
2
|
+
import { useStore, useNodes, useEdges } from "reactflow";
|
|
3
3
|
import { shallow } from "zustand/shallow";
|
|
4
4
|
import { useFlowInstance } from "./useFlowInstance.js";
|
|
5
5
|
import { useNodeId } from "./useNodeId.js";
|
|
@@ -14,7 +14,7 @@ function relativePosition(positionA, positionB) {
|
|
|
14
14
|
function useFlowNode(id) {
|
|
15
15
|
const nodeId = useNodeId(id);
|
|
16
16
|
const nodeSelector = useCallback(
|
|
17
|
-
(state) => state.
|
|
17
|
+
(state) => state.getNodes().find((n) => n.id === nodeId),
|
|
18
18
|
[nodeId]
|
|
19
19
|
);
|
|
20
20
|
return useStore(nodeSelector, shallow);
|
|
@@ -49,7 +49,7 @@ function useFlowNodeParents(id) {
|
|
|
49
49
|
const inputEdges = useFlowNodeInputEdges(id);
|
|
50
50
|
const parentNodesSelector = useCallback(
|
|
51
51
|
(state) => {
|
|
52
|
-
return inputEdges.map((e) => state.
|
|
52
|
+
return inputEdges.map((e) => state.getNodes().find((n) => n.id === e.source)).filter((n) => n !== null);
|
|
53
53
|
},
|
|
54
54
|
[inputEdges]
|
|
55
55
|
);
|
|
@@ -98,7 +98,7 @@ function useFlowNodeUtils(id) {
|
|
|
98
98
|
...n,
|
|
99
99
|
parentId: node ? node.id : void 0,
|
|
100
100
|
extent,
|
|
101
|
-
position: node ? relativePosition(node.position, n.position) : n.position
|
|
101
|
+
position: node ? relativePosition(node.position, n.position) : n.positionAbsolute ?? n.position
|
|
102
102
|
};
|
|
103
103
|
}
|
|
104
104
|
return n;
|