@uipath/apollo-react 4.6.2-pr525.30a5d08 → 4.6.3
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/canvas/components/AddNodePanel/AddNodeManager.cjs +1 -1
- package/dist/canvas/components/AddNodePanel/AddNodeManager.js +2 -2
- package/dist/canvas/components/BaseNode/BaseNode.cjs +75 -74
- package/dist/canvas/components/BaseNode/BaseNode.d.ts.map +1 -1
- package/dist/canvas/components/BaseNode/BaseNode.js +70 -69
- package/dist/canvas/components/BaseNode/BaseNode.styles.cjs +410 -0
- package/dist/canvas/components/BaseNode/BaseNode.styles.d.ts +75 -0
- package/dist/canvas/components/BaseNode/BaseNode.styles.d.ts.map +1 -0
- package/dist/canvas/components/BaseNode/BaseNode.styles.js +342 -0
- package/dist/canvas/components/BaseNode/BaseNodeConfigContext.d.ts +1 -2
- package/dist/canvas/components/BaseNode/BaseNodeConfigContext.d.ts.map +1 -1
- package/dist/canvas/components/BaseNode/NodeLabel.cjs +18 -64
- package/dist/canvas/components/BaseNode/NodeLabel.d.ts +1 -8
- package/dist/canvas/components/BaseNode/NodeLabel.d.ts.map +1 -1
- package/dist/canvas/components/BaseNode/NodeLabel.js +15 -58
- package/dist/canvas/components/ButtonHandle/ButtonHandleStyleUtils.cjs +7 -4
- package/dist/canvas/components/ButtonHandle/ButtonHandleStyleUtils.d.ts.map +1 -1
- package/dist/canvas/components/ButtonHandle/ButtonHandleStyleUtils.js +7 -4
- package/dist/canvas/components/CodedAgent/CodedAgentFlow.cjs +4 -4
- package/dist/canvas/components/CodedAgent/CodedAgentFlow.js +4 -4
- package/dist/canvas/components/NodeInspector.cjs +3 -2
- package/dist/canvas/components/NodeInspector.d.ts.map +1 -1
- package/dist/canvas/components/NodeInspector.js +3 -2
- package/dist/canvas/components/Toolbox/Toolbox.cjs +6 -5
- package/dist/canvas/components/Toolbox/Toolbox.d.ts.map +1 -1
- package/dist/canvas/components/Toolbox/Toolbox.js +6 -5
- package/dist/canvas/constants.cjs +26 -62
- package/dist/canvas/constants.d.ts +6 -15
- package/dist/canvas/constants.d.ts.map +1 -1
- package/dist/canvas/constants.js +7 -16
- package/dist/canvas/index.cjs +35 -39
- package/dist/canvas/index.d.ts +0 -1
- package/dist/canvas/index.d.ts.map +1 -1
- package/dist/canvas/index.js +0 -1
- package/dist/canvas/storybook-utils/manifests/node-definitions.d.ts.map +1 -1
- package/dist/canvas/styles/tailwind.canvas.css +1 -1
- package/package.json +1 -1
- package/dist/canvas/components/BaseNode/BaseNodeBadgeSlot.cjs +0 -68
- package/dist/canvas/components/BaseNode/BaseNodeBadgeSlot.d.ts +0 -9
- package/dist/canvas/components/BaseNode/BaseNodeBadgeSlot.d.ts.map +0 -1
- package/dist/canvas/components/BaseNode/BaseNodeBadgeSlot.js +0 -34
- package/dist/canvas/components/BaseNode/BaseNodeContainer.cjs +0 -88
- package/dist/canvas/components/BaseNode/BaseNodeContainer.d.ts +0 -21
- package/dist/canvas/components/BaseNode/BaseNodeContainer.d.ts.map +0 -1
- package/dist/canvas/components/BaseNode/BaseNodeContainer.js +0 -51
- package/dist/canvas/components/BaseNode/BaseNodeInnerShape.cjs +0 -49
- package/dist/canvas/components/BaseNode/BaseNodeInnerShape.d.ts +0 -9
- package/dist/canvas/components/BaseNode/BaseNodeInnerShape.d.ts.map +0 -1
- package/dist/canvas/components/BaseNode/BaseNodeInnerShape.js +0 -15
- package/dist/canvas/components/BaseNode/BaseNodeMissingManifest.cjs +0 -62
- package/dist/canvas/components/BaseNode/BaseNodeMissingManifest.d.ts +0 -9
- package/dist/canvas/components/BaseNode/BaseNodeMissingManifest.d.ts.map +0 -1
- package/dist/canvas/components/BaseNode/BaseNodeMissingManifest.js +0 -28
- package/dist/canvas/styles/reactflow-reset.css +0 -12
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
import { css } from "@emotion/react";
|
|
2
|
+
import styled from "@emotion/styled";
|
|
3
|
+
import { Skeleton } from "@uipath/apollo-wind";
|
|
4
|
+
import { getExecutionStatusBorder, pulseAnimation } from "../../styles/execution-status.js";
|
|
5
|
+
const GRID_UNIT = 16;
|
|
6
|
+
const NODE_HEIGHT_DEFAULT = 6 * GRID_UNIT;
|
|
7
|
+
const NODE_HEIGHT_FOOTER_BUTTON = 9 * GRID_UNIT;
|
|
8
|
+
const NODE_HEIGHT_FOOTER_SINGLE = 10 * GRID_UNIT;
|
|
9
|
+
const NODE_HEIGHT_FOOTER_DOUBLE = 11 * GRID_UNIT;
|
|
10
|
+
const getIconDimensions = (shape, nodeHeight, nodeWidth)=>{
|
|
11
|
+
const height = nodeHeight ?? 96;
|
|
12
|
+
const width = nodeWidth ?? 96;
|
|
13
|
+
const widthDimension = height !== width && 'rectangle' === shape ? height : width;
|
|
14
|
+
const widthScaleFactor = widthDimension / 96;
|
|
15
|
+
const iconWidth = 72 * widthScaleFactor;
|
|
16
|
+
const heightScaleFactor = height / 96;
|
|
17
|
+
const isExpandable = height !== width && 'rectangle' !== shape;
|
|
18
|
+
const iconHeight = isExpandable ? 84 * heightScaleFactor : 72 * heightScaleFactor;
|
|
19
|
+
return {
|
|
20
|
+
iconWidth,
|
|
21
|
+
iconHeight
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
const getValidationStatusBorder = (validationStatus)=>{
|
|
25
|
+
switch(validationStatus){
|
|
26
|
+
case 'ERROR':
|
|
27
|
+
case 'CRITICAL':
|
|
28
|
+
return css`
|
|
29
|
+
border-color: var(--canvas-error-icon);
|
|
30
|
+
background: var(--canvas-error-background);
|
|
31
|
+
animation: ${pulseAnimation('--canvas-error-icon')} 2s infinite;
|
|
32
|
+
`;
|
|
33
|
+
default:
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
const getInteractionStateBorder = (interactionState)=>{
|
|
38
|
+
switch(interactionState){
|
|
39
|
+
case 'hover':
|
|
40
|
+
return css`
|
|
41
|
+
outline: 4px solid var(--canvas-secondary-focused);
|
|
42
|
+
`;
|
|
43
|
+
case 'disabled':
|
|
44
|
+
return css`
|
|
45
|
+
opacity: 0.5;
|
|
46
|
+
cursor: not-allowed;
|
|
47
|
+
`;
|
|
48
|
+
case 'drag':
|
|
49
|
+
return css`
|
|
50
|
+
cursor: grabbing;
|
|
51
|
+
opacity: 0.8;
|
|
52
|
+
`;
|
|
53
|
+
default:
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
const getSuggestionTypeBorder = (suggestionType)=>{
|
|
58
|
+
const borderColorVar = getSuggestionTypeBorderColorVar(suggestionType);
|
|
59
|
+
const backgroundColorVar = getSuggestionTypeBackgroundColorVar(suggestionType);
|
|
60
|
+
if (!borderColorVar || !backgroundColorVar) return null;
|
|
61
|
+
return css`
|
|
62
|
+
border-color: var(${borderColorVar});
|
|
63
|
+
background: var(${backgroundColorVar});
|
|
64
|
+
animation: ${pulseAnimation(borderColorVar)} 2s infinite;
|
|
65
|
+
`;
|
|
66
|
+
};
|
|
67
|
+
const getSuggestionTypeBorderColorVar = (suggestionType)=>{
|
|
68
|
+
switch(suggestionType){
|
|
69
|
+
case 'add':
|
|
70
|
+
return '--canvas-success-icon';
|
|
71
|
+
case 'update':
|
|
72
|
+
return '--canvas-warning-icon';
|
|
73
|
+
case 'delete':
|
|
74
|
+
return '--canvas-error-icon';
|
|
75
|
+
default:
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
const getSuggestionTypeBackgroundColorVar = (suggestionType)=>{
|
|
80
|
+
switch(suggestionType){
|
|
81
|
+
case 'add':
|
|
82
|
+
return '--canvas-success-background';
|
|
83
|
+
case 'update':
|
|
84
|
+
return '--canvas-warning-background';
|
|
85
|
+
case 'delete':
|
|
86
|
+
return '--canvas-error-background';
|
|
87
|
+
default:
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
const BaseContainer = styled.div`
|
|
92
|
+
position: relative;
|
|
93
|
+
width: ${({ shape, width })=>{
|
|
94
|
+
const defaultWidth = 'rectangle' === shape ? 288 : 96;
|
|
95
|
+
if (width && 96 !== width && 288 !== width) return `${width}px`;
|
|
96
|
+
return `${defaultWidth}px`;
|
|
97
|
+
}};
|
|
98
|
+
height: ${({ height, hasFooter, footerVariant })=>{
|
|
99
|
+
if (hasFooter) switch(footerVariant){
|
|
100
|
+
case 'button':
|
|
101
|
+
return `${NODE_HEIGHT_FOOTER_BUTTON}px`;
|
|
102
|
+
case 'single':
|
|
103
|
+
return `${NODE_HEIGHT_FOOTER_SINGLE}px`;
|
|
104
|
+
case 'double':
|
|
105
|
+
return `${NODE_HEIGHT_FOOTER_DOUBLE}px`;
|
|
106
|
+
default:
|
|
107
|
+
return 'auto';
|
|
108
|
+
}
|
|
109
|
+
return height ? `${height}px` : `${NODE_HEIGHT_DEFAULT}px`;
|
|
110
|
+
}};
|
|
111
|
+
background: ${({ backgroundColor })=>backgroundColor || 'var(--canvas-background)'};
|
|
112
|
+
border: 1.5px solid var(--canvas-border-de-emp);
|
|
113
|
+
border-radius: ${({ shape })=>{
|
|
114
|
+
if ('circle' === shape) return '50%';
|
|
115
|
+
return '16px';
|
|
116
|
+
}};
|
|
117
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
118
|
+
display: flex;
|
|
119
|
+
flex-direction: ${({ shape })=>'rectangle' === shape ? 'row' : 'column'};
|
|
120
|
+
flex-wrap: ${({ hasFooter })=>hasFooter ? 'wrap' : 'nowrap'};
|
|
121
|
+
align-items: center;
|
|
122
|
+
justify-content: ${({ shape })=>'rectangle' === shape ? 'flex-start' : 'center'};
|
|
123
|
+
gap: ${({ shape })=>'rectangle' === shape ? '12px' : '0'};
|
|
124
|
+
padding: ${({ shape, height, hasFooter })=>{
|
|
125
|
+
if ('rectangle' === shape) {
|
|
126
|
+
if (hasFooter) return '16px';
|
|
127
|
+
const scaleFactor = height ? height / 100 : 1;
|
|
128
|
+
return `${14 * scaleFactor}px`;
|
|
129
|
+
}
|
|
130
|
+
return '0';
|
|
131
|
+
}};
|
|
132
|
+
cursor: pointer;
|
|
133
|
+
|
|
134
|
+
${({ executionStatus })=>getExecutionStatusBorder(executionStatus)}
|
|
135
|
+
${({ validationStatus })=>getValidationStatusBorder(validationStatus)}
|
|
136
|
+
${({ interactionState })=>getInteractionStateBorder(interactionState)}
|
|
137
|
+
${({ suggestionType })=>getSuggestionTypeBorder(suggestionType)}
|
|
138
|
+
|
|
139
|
+
${({ selected, suggestionType })=>{
|
|
140
|
+
if (selected && suggestionType) {
|
|
141
|
+
const borderColorVar = getSuggestionTypeBorderColorVar(suggestionType);
|
|
142
|
+
return css`
|
|
143
|
+
border-color: var(${borderColorVar});
|
|
144
|
+
outline: 4px solid color-mix(in srgb, var(${borderColorVar}) 40%, transparent);
|
|
145
|
+
`;
|
|
146
|
+
}
|
|
147
|
+
if (selected) return css`
|
|
148
|
+
border-color: var(--canvas-primary);
|
|
149
|
+
outline: 4px solid var(--canvas-secondary-pressed);
|
|
150
|
+
`;
|
|
151
|
+
return '';
|
|
152
|
+
}}
|
|
153
|
+
`;
|
|
154
|
+
const BaseIconWrapper = styled.div`
|
|
155
|
+
${({ height, width, shape })=>{
|
|
156
|
+
const { iconWidth, iconHeight } = getIconDimensions(shape, height, width);
|
|
157
|
+
return css`
|
|
158
|
+
width: ${iconWidth}px;
|
|
159
|
+
height: ${iconHeight}px;
|
|
160
|
+
`;
|
|
161
|
+
}}
|
|
162
|
+
display: flex;
|
|
163
|
+
align-items: center;
|
|
164
|
+
justify-content: center;
|
|
165
|
+
color: ${({ color })=>color || 'var(--canvas-foreground)'};
|
|
166
|
+
background: ${({ backgroundColor })=>backgroundColor || 'var(--canvas-background-secondary)'};
|
|
167
|
+
border-radius: ${({ shape })=>{
|
|
168
|
+
if ('circle' === shape) return '50%';
|
|
169
|
+
return '8px';
|
|
170
|
+
}};
|
|
171
|
+
|
|
172
|
+
svg {
|
|
173
|
+
width: ${({ width })=>{
|
|
174
|
+
const scaleFactor = width ? width / 96 : 1;
|
|
175
|
+
return `${40 * scaleFactor}px`;
|
|
176
|
+
}};
|
|
177
|
+
height: ${({ height })=>{
|
|
178
|
+
const scaleFactor = height ? height / 96 : 1;
|
|
179
|
+
return `${40 * scaleFactor}px`;
|
|
180
|
+
}};
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
img {
|
|
184
|
+
width: ${({ width })=>{
|
|
185
|
+
const scaleFactor = width ? width / 96 : 1;
|
|
186
|
+
return `${40 * scaleFactor}px`;
|
|
187
|
+
}};
|
|
188
|
+
height: ${({ height })=>{
|
|
189
|
+
const scaleFactor = height ? height / 96 : 1;
|
|
190
|
+
return `${40 * scaleFactor}px`;
|
|
191
|
+
}};
|
|
192
|
+
object-fit: contain;
|
|
193
|
+
}
|
|
194
|
+
`;
|
|
195
|
+
const BaseTextContainer = styled.div`
|
|
196
|
+
${({ shape, hasBottomHandles })=>'rectangle' === shape ? css`
|
|
197
|
+
flex: 1;
|
|
198
|
+
min-width: 0;
|
|
199
|
+
display: flex;
|
|
200
|
+
flex-direction: column;
|
|
201
|
+
align-items: flex-start;
|
|
202
|
+
text-align: left;
|
|
203
|
+
` : css`
|
|
204
|
+
position: absolute;
|
|
205
|
+
bottom: ${hasBottomHandles ? '-40px' : '-8px'};
|
|
206
|
+
width: 150%;
|
|
207
|
+
left: 50%;
|
|
208
|
+
transform: translateX(-50%) translateY(100%);
|
|
209
|
+
display: flex;
|
|
210
|
+
flex-direction: column;
|
|
211
|
+
align-items: center;
|
|
212
|
+
text-align: center;
|
|
213
|
+
z-index: 10;
|
|
214
|
+
transition: transform 0.2s ease-in-out;
|
|
215
|
+
|
|
216
|
+
/* When there's a bottom handle, offset text to the right to avoid overlapping */
|
|
217
|
+
${hasBottomHandles && css`
|
|
218
|
+
transform: translateX(20%) translateY(50%);
|
|
219
|
+
text-align: left;
|
|
220
|
+
`}
|
|
221
|
+
`}
|
|
222
|
+
`;
|
|
223
|
+
const BaseHeader = styled.div`
|
|
224
|
+
font-weight: 600;
|
|
225
|
+
font-size: 13px;
|
|
226
|
+
color: var(--canvas-foreground);
|
|
227
|
+
${({ backgroundColor })=>backgroundColor && css`
|
|
228
|
+
background-color: ${backgroundColor};
|
|
229
|
+
padding: 2px 6px;
|
|
230
|
+
border-radius: 4px;
|
|
231
|
+
`}
|
|
232
|
+
line-height: 1.4;
|
|
233
|
+
margin-bottom: 2px;
|
|
234
|
+
overflow: hidden;
|
|
235
|
+
${({ shape })=>'rectangle' === shape ? css`
|
|
236
|
+
width: 100%;
|
|
237
|
+
white-space: nowrap;
|
|
238
|
+
text-overflow: ellipsis;
|
|
239
|
+
` : css`
|
|
240
|
+
word-break: break-word;
|
|
241
|
+
display: -webkit-box;
|
|
242
|
+
-webkit-box-orient: vertical;
|
|
243
|
+
-webkit-line-clamp: 3;
|
|
244
|
+
`}
|
|
245
|
+
`;
|
|
246
|
+
const BaseSubHeader = styled.div`
|
|
247
|
+
font-size: 11px;
|
|
248
|
+
color: var(--canvas-foreground-de-emp);
|
|
249
|
+
line-height: 1.3;
|
|
250
|
+
word-break: break-word;
|
|
251
|
+
overflow: hidden;
|
|
252
|
+
display: -webkit-box;
|
|
253
|
+
-webkit-box-orient: vertical;
|
|
254
|
+
${({ shape })=>'rectangle' === shape ? css`
|
|
255
|
+
width: 100%;
|
|
256
|
+
-webkit-line-clamp: 2;
|
|
257
|
+
` : css`
|
|
258
|
+
-webkit-line-clamp: 5;
|
|
259
|
+
`}
|
|
260
|
+
`;
|
|
261
|
+
const EditableLabel = styled.textarea`
|
|
262
|
+
resize: none;
|
|
263
|
+
field-sizing: ${({ shape })=>'rectangle' === shape ? 'fixed' : 'content'};
|
|
264
|
+
font-weight: ${({ variant })=>'subtext' === variant ? '400' : '600'};
|
|
265
|
+
font-size: ${({ variant })=>'subtext' === variant ? '11px' : '13px'};
|
|
266
|
+
line-height: ${({ variant })=>'subtext' === variant ? '1.3' : '1.4'};
|
|
267
|
+
font-family: inherit;
|
|
268
|
+
color: var(--canvas-foreground);
|
|
269
|
+
border: none;
|
|
270
|
+
border-radius: 4px;
|
|
271
|
+
outline: 1px dashed var(--canvas-border-de-emp);
|
|
272
|
+
margin-bottom: ${({ variant })=>'subtext' === variant ? 0 : '2px'};
|
|
273
|
+
max-width: 100%;
|
|
274
|
+
|
|
275
|
+
${({ backgroundColor })=>backgroundColor ? css`
|
|
276
|
+
background-color: ${backgroundColor};
|
|
277
|
+
padding: 2px 6px;
|
|
278
|
+
` : 'background-color: color-mix(in srgb, var(--canvas-background) 10%, transparent);'}
|
|
279
|
+
|
|
280
|
+
${({ shape })=>'rectangle' === shape ? css`
|
|
281
|
+
width: 100%;
|
|
282
|
+
` : css`
|
|
283
|
+
text-align: center;
|
|
284
|
+
`}
|
|
285
|
+
`;
|
|
286
|
+
const EmptyLabelPlaceholder = styled.div`
|
|
287
|
+
font-weight: 600;
|
|
288
|
+
font-size: 13px;
|
|
289
|
+
line-height: 1.4;
|
|
290
|
+
color: var(--canvas-foreground-de-emp);
|
|
291
|
+
background: transparent;
|
|
292
|
+
border: 1px dashed var(--canvas-border-de-emp);
|
|
293
|
+
border-radius: 4px;
|
|
294
|
+
cursor: pointer;
|
|
295
|
+
opacity: 0;
|
|
296
|
+
transition: opacity 0.2s ease;
|
|
297
|
+
min-width: 20px;
|
|
298
|
+
min-height: 20px;
|
|
299
|
+
|
|
300
|
+
&:hover {
|
|
301
|
+
opacity: 1;
|
|
302
|
+
background-color: color-mix(in srgb, var(--canvas-background) 10%, transparent);
|
|
303
|
+
}
|
|
304
|
+
`;
|
|
305
|
+
const BaseBadgeSlot = styled.div`
|
|
306
|
+
display: flex;
|
|
307
|
+
align-items: center;
|
|
308
|
+
justify-content: center;
|
|
309
|
+
width: 20px;
|
|
310
|
+
height: 20px;
|
|
311
|
+
background: transparent;
|
|
312
|
+
position: absolute;
|
|
313
|
+
${({ position, shape })=>{
|
|
314
|
+
const offset = 'circle' === shape ? '12px' : '6px';
|
|
315
|
+
switch(position){
|
|
316
|
+
case 'top-left':
|
|
317
|
+
return `top: ${offset}; left: ${offset};`;
|
|
318
|
+
case 'top-right':
|
|
319
|
+
return `top: ${offset}; right: ${offset};`;
|
|
320
|
+
case 'bottom-left':
|
|
321
|
+
return `bottom: ${offset}; left: ${offset};`;
|
|
322
|
+
case 'bottom-right':
|
|
323
|
+
return `bottom: ${offset}; right: ${offset};`;
|
|
324
|
+
}
|
|
325
|
+
}}
|
|
326
|
+
`;
|
|
327
|
+
const BaseSkeletonIcon = styled(Skeleton, {
|
|
328
|
+
shouldForwardProp: (prop)=>'shape' !== prop && 'nodeHeight' !== prop && 'nodeWidth' !== prop
|
|
329
|
+
})`
|
|
330
|
+
flex-grow: 0;
|
|
331
|
+
flex-shrink: 0;
|
|
332
|
+
${({ shape, nodeHeight, nodeWidth })=>{
|
|
333
|
+
const { iconWidth, iconHeight } = getIconDimensions(shape, nodeHeight, nodeWidth);
|
|
334
|
+
const isCircle = 'circle' === shape;
|
|
335
|
+
return css`
|
|
336
|
+
width: ${iconWidth}px;
|
|
337
|
+
height: ${iconHeight}px;
|
|
338
|
+
border-radius: ${isCircle ? '50%' : '8px'};
|
|
339
|
+
`;
|
|
340
|
+
}}
|
|
341
|
+
`;
|
|
342
|
+
export { BaseBadgeSlot, BaseContainer, BaseHeader, BaseIconWrapper, BaseSkeletonIcon, BaseSubHeader, BaseTextContainer, EditableLabel, EmptyLabelPlaceholder };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { HandleGroupManifest } from '../../schema/node-definition';
|
|
2
|
-
import type { ElementStatusValues } from '../../types/execution';
|
|
3
2
|
import type { HandleActionEvent } from '../ButtonHandle/ButtonHandle';
|
|
4
3
|
import type { NodeToolbarConfig } from '../Toolbar';
|
|
5
4
|
import type { FooterVariant, NodeAdornments } from './BaseNode.types';
|
|
@@ -19,7 +18,7 @@ export interface BaseNodeOverrideConfig {
|
|
|
19
18
|
adornments?: NodeAdornments;
|
|
20
19
|
suggestionType?: 'add' | 'update' | 'delete';
|
|
21
20
|
disabled?: boolean;
|
|
22
|
-
executionStatusOverride?:
|
|
21
|
+
executionStatusOverride?: string;
|
|
23
22
|
labelTooltip?: string;
|
|
24
23
|
labelBackgroundColor?: string;
|
|
25
24
|
footerVariant?: FooterVariant;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseNodeConfigContext.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseNode/BaseNodeConfigContext.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"BaseNodeConfigContext.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseNode/BaseNodeConfigContext.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AActE,MAAM,WAAW,sBAAsB;IAErC,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACpD,qBAAqB,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,aAAa,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,KAAK,OAAO,CAAC;IACzF,+BAA+B,CAAC,EAAE,CAAC,IAAI,EAAE;QACvC,YAAY,EAAE,OAAO,CAAC;QACtB,UAAU,EAAE,OAAO,CAAC;QACpB,SAAS,EAAE,OAAO,CAAC;KACpB,KAAK,OAAO,CAAC;IAGd,aAAa,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACzC,oBAAoB,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAC7C,UAAU,CAAC,EAAE,cAAc,CAAC;IAG5B,cAAc,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uBAAuB,CAAC,EAAE,MAAM,CAAC;IAGjC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAClC,iBAAiB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACpC,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACjC;AAMD,eAAO,MAAM,8BAA8B,kDAAyC,CAAC;AAMrF,wBAAgB,yBAAyB,IAAI,sBAAsB,CAElE"}
|
|
@@ -24,27 +24,12 @@ var __webpack_require__ = {};
|
|
|
24
24
|
var __webpack_exports__ = {};
|
|
25
25
|
__webpack_require__.r(__webpack_exports__);
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
BaseTextContainer: ()=>BaseTextContainer,
|
|
28
27
|
NodeLabel: ()=>NodeLabel
|
|
29
28
|
});
|
|
30
29
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
31
30
|
const external_react_namespaceObject = require("react");
|
|
32
|
-
const external_constants_cjs_namespaceObject = require("../../constants.cjs");
|
|
33
|
-
const CssUtil_cjs_namespaceObject = require("../../utils/CssUtil.cjs");
|
|
34
31
|
const external_CanvasTooltip_cjs_namespaceObject = require("../CanvasTooltip.cjs");
|
|
35
|
-
const
|
|
36
|
-
if ('rectangle' === shape) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
37
|
-
className: "flex flex-1 min-w-0 flex-col items-start text-left",
|
|
38
|
-
children: children
|
|
39
|
-
});
|
|
40
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
41
|
-
className: (0, CssUtil_cjs_namespaceObject.cx)('absolute left-1/2 w-[150%] flex flex-col z-10 transition-transform duration-200', hasBottomHandles ? 'items-start text-left translate-x-[20%] translate-y-1/2' : 'items-center text-center -translate-x-1/2 translate-y-full'),
|
|
42
|
-
style: {
|
|
43
|
-
bottom: hasBottomHandles ? external_constants_cjs_namespaceObject.NODE_TEXT_BOTTOM_OFFSET_WITH_HANDLES : external_constants_cjs_namespaceObject.NODE_TEXT_BOTTOM_OFFSET
|
|
44
|
-
},
|
|
45
|
-
children: children
|
|
46
|
-
});
|
|
47
|
-
};
|
|
32
|
+
const external_BaseNode_styles_cjs_namespaceObject = require("./BaseNode.styles.cjs");
|
|
48
33
|
const ConditionalTooltip = ({ content, children })=>{
|
|
49
34
|
if (!content) return children;
|
|
50
35
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CanvasTooltip_cjs_namespaceObject.CanvasTooltip, {
|
|
@@ -55,43 +40,6 @@ const ConditionalTooltip = ({ content, children })=>{
|
|
|
55
40
|
children: children
|
|
56
41
|
});
|
|
57
42
|
};
|
|
58
|
-
const Header = ({ shape, backgroundColor, onDoubleClick, children, 'data-testid': dataTestId })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
59
|
-
"data-testid": dataTestId,
|
|
60
|
-
onDoubleClick: onDoubleClick,
|
|
61
|
-
className: (0, CssUtil_cjs_namespaceObject.cx)('text-center text-sm leading-[18px] font-semibold text-foreground overflow-hidden', backgroundColor && 'px-1.5 py-0.5 rounded-sm', 'rectangle' === shape ? 'w-full text-left whitespace-nowrap text-ellipsis' : 'wrap-break-word line-clamp-3'),
|
|
62
|
-
style: backgroundColor ? {
|
|
63
|
-
backgroundColor
|
|
64
|
-
} : void 0,
|
|
65
|
-
children: children
|
|
66
|
-
});
|
|
67
|
-
const SubHeader = ({ shape, onDoubleClick, children, 'data-testid': dataTestId })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
68
|
-
"data-testid": dataTestId,
|
|
69
|
-
onDoubleClick: onDoubleClick,
|
|
70
|
-
className: (0, CssUtil_cjs_namespaceObject.cx)('text-center text-xs leading-[18px] text-foreground-muted wrap-break-word overflow-hidden', 'rectangle' === shape ? 'w-full text-left line-clamp-2' : 'line-clamp-5'),
|
|
71
|
-
children: children
|
|
72
|
-
});
|
|
73
|
-
const EditableLabel = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)(({ shape, backgroundColor, variant, value, placeholder, rows, onChange, onKeyDown, onBlur, 'aria-label': ariaLabel }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("textarea", {
|
|
74
|
-
ref: ref,
|
|
75
|
-
value: value,
|
|
76
|
-
placeholder: placeholder,
|
|
77
|
-
rows: rows,
|
|
78
|
-
"aria-label": ariaLabel,
|
|
79
|
-
onChange: onChange,
|
|
80
|
-
onKeyDown: onKeyDown,
|
|
81
|
-
onBlur: onBlur,
|
|
82
|
-
className: (0, CssUtil_cjs_namespaceObject.cx)('nodrag nowheel resize-none font-[inherit] text-foreground border-none rounded-sm outline-1 outline-dashed outline-border-de-emp max-w-full', 'subtext' === variant ? 'text-xs leading-[18px] font-normal mb-0' : 'text-sm leading-[18px] font-semibold mb-0.5', 'rectangle' === shape ? 'field-sizing-fixed w-full' : 'field-sizing-content text-center', backgroundColor && 'px-1.5 py-0.5'),
|
|
83
|
-
style: backgroundColor ? {
|
|
84
|
-
backgroundColor
|
|
85
|
-
} : void 0
|
|
86
|
-
}));
|
|
87
|
-
EditableLabel.displayName = 'EditableLabel';
|
|
88
|
-
const EmptyLabelPlaceholder = ({ onDoubleClick })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
|
|
89
|
-
type: "button",
|
|
90
|
-
onDoubleClick: onDoubleClick,
|
|
91
|
-
className: "nodrag nowheel text-sm leading-[18px] font-semibold text-foreground-muted bg-transparent border border-dashed border-border-de-emp rounded-sm cursor-pointer opacity-0 transition-opacity duration-200 min-w-5 min-h-5 hover:opacity-100",
|
|
92
|
-
"aria-label": "Add node label",
|
|
93
|
-
"data-testid": "empty-label-placeholder"
|
|
94
|
-
});
|
|
95
43
|
const NodeLabelInternal = ({ label = '', subLabel = '', labelTooltip, labelBackgroundColor, shape, hasBottomHandles, selected, dragging, centerAdornment, readonly, onChange })=>{
|
|
96
44
|
const [isEditing, setIsEditing] = (0, external_react_namespaceObject.useState)(false);
|
|
97
45
|
const [localLabel, setLocalLabel] = (0, external_react_namespaceObject.useState)('');
|
|
@@ -102,7 +50,7 @@ const NodeLabelInternal = ({ label = '', subLabel = '', labelTooltip, labelBackg
|
|
|
102
50
|
const handleSave = (0, external_react_namespaceObject.useCallback)(()=>{
|
|
103
51
|
setIsEditing(false);
|
|
104
52
|
setFocusTarget(null);
|
|
105
|
-
if (localLabel !== label || localSubLabel !== subLabel) onChange
|
|
53
|
+
if (localLabel !== label || localSubLabel !== subLabel) onChange({
|
|
106
54
|
label: localLabel,
|
|
107
55
|
subLabel: localSubLabel
|
|
108
56
|
});
|
|
@@ -176,23 +124,27 @@ const NodeLabelInternal = ({ label = '', subLabel = '', labelTooltip, labelBackg
|
|
|
176
124
|
}, [
|
|
177
125
|
handleSave
|
|
178
126
|
]);
|
|
179
|
-
if (!label && !subLabel && !isEditing) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(BaseTextContainer, {
|
|
127
|
+
if (!label && !subLabel && !isEditing) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_BaseNode_styles_cjs_namespaceObject.BaseTextContainer, {
|
|
180
128
|
hasBottomHandles: hasBottomHandles,
|
|
181
129
|
shape: shape,
|
|
182
130
|
children: [
|
|
183
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(EmptyLabelPlaceholder, {
|
|
184
|
-
onDoubleClick: readonly ? void 0 : handleDoubleClick(labelInputRef)
|
|
131
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_BaseNode_styles_cjs_namespaceObject.EmptyLabelPlaceholder, {
|
|
132
|
+
onDoubleClick: readonly ? void 0 : handleDoubleClick(labelInputRef),
|
|
133
|
+
className: "nodrag nowheel",
|
|
134
|
+
role: "button",
|
|
135
|
+
"aria-label": "Add node label",
|
|
136
|
+
"data-testid": "empty-label-placeholder"
|
|
185
137
|
}),
|
|
186
138
|
centerAdornment
|
|
187
139
|
]
|
|
188
140
|
});
|
|
189
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(BaseTextContainer, {
|
|
141
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_BaseNode_styles_cjs_namespaceObject.BaseTextContainer, {
|
|
190
142
|
hasBottomHandles: hasBottomHandles,
|
|
191
143
|
shape: shape,
|
|
192
144
|
children: [
|
|
193
145
|
isEditing ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
194
146
|
children: [
|
|
195
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(EditableLabel, {
|
|
147
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_BaseNode_styles_cjs_namespaceObject.EditableLabel, {
|
|
196
148
|
ref: labelInputRef,
|
|
197
149
|
value: localLabel,
|
|
198
150
|
onChange: (e)=>setLocalLabel(e.target.value),
|
|
@@ -201,11 +153,13 @@ const NodeLabelInternal = ({ label = '', subLabel = '', labelTooltip, labelBackg
|
|
|
201
153
|
shape: shape,
|
|
202
154
|
variant: "normal",
|
|
203
155
|
backgroundColor: labelBackgroundColor,
|
|
156
|
+
className: "nodrag nowheel",
|
|
204
157
|
placeholder: "Name",
|
|
205
158
|
rows: 'rectangle' === shape ? 1 : void 0,
|
|
159
|
+
role: "textbox",
|
|
206
160
|
"aria-label": "Edit node name"
|
|
207
161
|
}),
|
|
208
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(EditableLabel, {
|
|
162
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_BaseNode_styles_cjs_namespaceObject.EditableLabel, {
|
|
209
163
|
ref: subLabelInputRef,
|
|
210
164
|
value: localSubLabel,
|
|
211
165
|
onChange: (e)=>setLocalSubLabel(e.target.value),
|
|
@@ -213,22 +167,24 @@ const NodeLabelInternal = ({ label = '', subLabel = '', labelTooltip, labelBackg
|
|
|
213
167
|
onBlur: handleBlur,
|
|
214
168
|
shape: shape,
|
|
215
169
|
variant: "subtext",
|
|
170
|
+
className: "nodrag nowheel",
|
|
216
171
|
placeholder: "Description",
|
|
217
172
|
rows: 'rectangle' === shape ? 2 : void 0,
|
|
173
|
+
role: "textbox",
|
|
218
174
|
"aria-label": "Edit node description"
|
|
219
175
|
})
|
|
220
176
|
]
|
|
221
177
|
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(ConditionalTooltip, {
|
|
222
178
|
content: labelTooltip,
|
|
223
179
|
children: [
|
|
224
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
180
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_BaseNode_styles_cjs_namespaceObject.BaseHeader, {
|
|
225
181
|
shape: shape,
|
|
226
182
|
backgroundColor: labelBackgroundColor,
|
|
227
183
|
onDoubleClick: readonly ? void 0 : handleDoubleClick(labelInputRef),
|
|
228
184
|
"data-testid": "node-label",
|
|
229
185
|
children: label
|
|
230
186
|
}),
|
|
231
|
-
subLabel && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
187
|
+
subLabel && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_BaseNode_styles_cjs_namespaceObject.BaseSubHeader, {
|
|
232
188
|
shape: shape,
|
|
233
189
|
onDoubleClick: readonly ? void 0 : handleDoubleClick(subLabelInputRef),
|
|
234
190
|
"data-testid": "node-sublabel",
|
|
@@ -241,10 +197,8 @@ const NodeLabelInternal = ({ label = '', subLabel = '', labelTooltip, labelBackg
|
|
|
241
197
|
});
|
|
242
198
|
};
|
|
243
199
|
const NodeLabel = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(NodeLabelInternal);
|
|
244
|
-
exports.BaseTextContainer = __webpack_exports__.BaseTextContainer;
|
|
245
200
|
exports.NodeLabel = __webpack_exports__.NodeLabel;
|
|
246
201
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
247
|
-
"BaseTextContainer",
|
|
248
202
|
"NodeLabel"
|
|
249
203
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
250
204
|
Object.defineProperty(exports, '__esModule', {
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
import type { NodeShape } from '../../schema';
|
|
2
|
-
interface BaseTextContainerProps {
|
|
3
|
-
hasBottomHandles?: boolean;
|
|
4
|
-
shape?: NodeShape;
|
|
5
|
-
children: React.ReactNode;
|
|
6
|
-
}
|
|
7
|
-
export declare const BaseTextContainer: ({ hasBottomHandles, shape, children, }: BaseTextContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
2
|
export interface NodeLabelProps {
|
|
9
3
|
label?: string;
|
|
10
4
|
subLabel?: string;
|
|
@@ -16,11 +10,10 @@ export interface NodeLabelProps {
|
|
|
16
10
|
dragging?: boolean;
|
|
17
11
|
centerAdornment?: React.ReactNode;
|
|
18
12
|
readonly?: boolean;
|
|
19
|
-
onChange
|
|
13
|
+
onChange: (values: {
|
|
20
14
|
label: string;
|
|
21
15
|
subLabel: string;
|
|
22
16
|
}) => void;
|
|
23
17
|
}
|
|
24
18
|
export declare const NodeLabel: import("react").MemoExoticComponent<({ label, subLabel, labelTooltip, labelBackgroundColor, shape, hasBottomHandles, selected, dragging, centerAdornment, readonly, onChange, }: NodeLabelProps) => import("react/jsx-runtime").JSX.Element>;
|
|
25
|
-
export {};
|
|
26
19
|
//# sourceMappingURL=NodeLabel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeLabel.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseNode/NodeLabel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NodeLabel.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseNode/NodeLabel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAU9C,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CACjE;AAwMD,eAAO,MAAM,SAAS,mLAzKnB,cAAc,6CAyK+B,CAAC"}
|