@uipath/apollo-react 4.6.1 → 4.6.2-pr525.30a5d08

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.
Files changed (49) hide show
  1. package/dist/canvas/components/BaseNode/BaseNode.cjs +74 -75
  2. package/dist/canvas/components/BaseNode/BaseNode.d.ts.map +1 -1
  3. package/dist/canvas/components/BaseNode/BaseNode.js +69 -70
  4. package/dist/canvas/components/BaseNode/BaseNodeBadgeSlot.cjs +68 -0
  5. package/dist/canvas/components/BaseNode/BaseNodeBadgeSlot.d.ts +9 -0
  6. package/dist/canvas/components/BaseNode/BaseNodeBadgeSlot.d.ts.map +1 -0
  7. package/dist/canvas/components/BaseNode/BaseNodeBadgeSlot.js +34 -0
  8. package/dist/canvas/components/BaseNode/BaseNodeConfigContext.d.ts +2 -1
  9. package/dist/canvas/components/BaseNode/BaseNodeConfigContext.d.ts.map +1 -1
  10. package/dist/canvas/components/BaseNode/BaseNodeContainer.cjs +88 -0
  11. package/dist/canvas/components/BaseNode/BaseNodeContainer.d.ts +21 -0
  12. package/dist/canvas/components/BaseNode/BaseNodeContainer.d.ts.map +1 -0
  13. package/dist/canvas/components/BaseNode/BaseNodeContainer.js +51 -0
  14. package/dist/canvas/components/BaseNode/BaseNodeInnerShape.cjs +49 -0
  15. package/dist/canvas/components/BaseNode/BaseNodeInnerShape.d.ts +9 -0
  16. package/dist/canvas/components/BaseNode/BaseNodeInnerShape.d.ts.map +1 -0
  17. package/dist/canvas/components/BaseNode/BaseNodeInnerShape.js +15 -0
  18. package/dist/canvas/components/BaseNode/BaseNodeMissingManifest.cjs +62 -0
  19. package/dist/canvas/components/BaseNode/BaseNodeMissingManifest.d.ts +9 -0
  20. package/dist/canvas/components/BaseNode/BaseNodeMissingManifest.d.ts.map +1 -0
  21. package/dist/canvas/components/BaseNode/BaseNodeMissingManifest.js +28 -0
  22. package/dist/canvas/components/BaseNode/NodeLabel.cjs +64 -18
  23. package/dist/canvas/components/BaseNode/NodeLabel.d.ts +8 -1
  24. package/dist/canvas/components/BaseNode/NodeLabel.d.ts.map +1 -1
  25. package/dist/canvas/components/BaseNode/NodeLabel.js +58 -15
  26. package/dist/canvas/components/ButtonHandle/ButtonHandleStyleUtils.cjs +4 -7
  27. package/dist/canvas/components/ButtonHandle/ButtonHandleStyleUtils.d.ts.map +1 -1
  28. package/dist/canvas/components/ButtonHandle/ButtonHandleStyleUtils.js +4 -7
  29. package/dist/canvas/components/CodedAgent/CodedAgentFlow.cjs +4 -4
  30. package/dist/canvas/components/CodedAgent/CodedAgentFlow.js +4 -4
  31. package/dist/canvas/components/StageNode/StageNode.cjs +3 -8
  32. package/dist/canvas/components/StageNode/StageNode.d.ts.map +1 -1
  33. package/dist/canvas/components/StageNode/StageNode.js +3 -8
  34. package/dist/canvas/constants.cjs +60 -0
  35. package/dist/canvas/constants.d.ts +15 -0
  36. package/dist/canvas/constants.d.ts.map +1 -1
  37. package/dist/canvas/constants.js +16 -1
  38. package/dist/canvas/index.cjs +39 -35
  39. package/dist/canvas/index.d.ts +1 -0
  40. package/dist/canvas/index.d.ts.map +1 -1
  41. package/dist/canvas/index.js +1 -0
  42. package/dist/canvas/storybook-utils/manifests/node-definitions.d.ts.map +1 -1
  43. package/dist/canvas/styles/reactflow-reset.css +12 -0
  44. package/dist/canvas/styles/tailwind.canvas.css +1 -1
  45. package/package.json +3 -3
  46. package/dist/canvas/components/BaseNode/BaseNode.styles.cjs +0 -410
  47. package/dist/canvas/components/BaseNode/BaseNode.styles.d.ts +0 -75
  48. package/dist/canvas/components/BaseNode/BaseNode.styles.d.ts.map +0 -1
  49. package/dist/canvas/components/BaseNode/BaseNode.styles.js +0 -342
@@ -1,342 +0,0 @@
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 };