@uipath/apollo-react 4.31.0 → 4.32.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.
@@ -160,6 +160,7 @@ function LoopNodeComponent(props) {
160
160
  const { id, type, data, selected = false, dragging = false, width = 0, height = 0, onAddFirstChild, onResize, toolbarConfig: toolbarConfigProp, adornments: adornmentsProp, executionStatusOverride, suggestionType: suggestionTypeProp, iterationState: iterationStateProp } = props;
161
161
  const nodeTypeRegistry = (0, index_cjs_namespaceObject.useOptionalNodeTypeRegistry)();
162
162
  const [isHovered, setIsHovered] = (0, external_react_namespaceObject.useState)(false);
163
+ const [isResizing, setIsResizing] = (0, external_react_namespaceObject.useState)(false);
163
164
  const resolvedData = data ?? EMPTY_DATA;
164
165
  const isLoading = !!resolvedData.loading;
165
166
  const suggestionType = suggestionTypeProp ?? resolvedData.suggestionType;
@@ -208,8 +209,10 @@ function LoopNodeComponent(props) {
208
209
  const isDropTarget = true === resolvedData.isDropTarget;
209
210
  const containerWidth = width || container_cjs_namespaceObject.DEFAULT_CONTAINER_WIDTH;
210
211
  const containerHeight = height || container_cjs_namespaceObject.DEFAULT_CONTAINER_HEIGHT;
211
- const showResizeControls = selected && !dragging && isDesignMode;
212
- const resizeMinimums = useContainerResizeMinimums(id, containerWidth, containerHeight, showResizeControls);
212
+ const resizeControlsMounted = isDesignMode && !dragging;
213
+ const resizeControlsVisible = resizeControlsMounted && (selected || isResizing);
214
+ const resizeMinimumsEnabled = resizeControlsMounted && (selected || isHovered || isResizing);
215
+ const resizeMinimums = useContainerResizeMinimums(id, containerWidth, containerHeight, resizeMinimumsEnabled);
213
216
  const nodeSizeStyle = {
214
217
  width: containerWidth,
215
218
  height: containerHeight,
@@ -259,6 +262,8 @@ function LoopNodeComponent(props) {
259
262
  }, [
260
263
  onResize
261
264
  ]);
265
+ const handleResizeStart = (0, external_react_namespaceObject.useCallback)(()=>setIsResizing(true), []);
266
+ const handleResizeEnd = (0, external_react_namespaceObject.useCallback)(()=>setIsResizing(false), []);
262
267
  const handleEmptyClick = (0, external_react_namespaceObject.useCallback)(()=>{
263
268
  onAddFirstChild?.();
264
269
  }, [
@@ -312,11 +317,13 @@ function LoopNodeComponent(props) {
312
317
  children: adornments[slot]
313
318
  }, slot) : null),
314
319
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ResizeCornerIndicators, {
315
- visible: showResizeControls
320
+ visible: resizeControlsVisible
316
321
  }),
317
- showResizeControls ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ResizeControls, {
322
+ resizeControlsMounted ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ResizeControls, {
318
323
  minimums: resizeMinimums,
319
- onResize: handleResize
324
+ onResize: handleResize,
325
+ onResizeStart: handleResizeStart,
326
+ onResizeEnd: handleResizeEnd
320
327
  }) : null,
321
328
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Header, {
322
329
  title: displayTitle,
@@ -382,6 +389,7 @@ function Header({ title, icon, loading, isParallel, iterationState, hasTopLeftAd
382
389
  paddingLeft: hasTopLeftAdornment ? LOOP_HEADER_ADORNMENT_PADDING : void 0,
383
390
  paddingRight: hasTopRightAdornment ? LOOP_HEADER_ADORNMENT_PADDING : void 0
384
391
  } : void 0;
392
+ const executionModeIcon = isParallel ? 'columns-3' : 'rows-3';
385
393
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
386
394
  className: (0, apollo_wind_namespaceObject.cn)('flex shrink-0 cursor-grab items-center justify-between gap-2.5 rounded-t-[18px]', '-mb-2.5 bg-surface-overlay px-3.5 pb-2.5 pt-2.5 text-foreground', 'active:cursor-grabbing'),
387
395
  style: headerStyle,
@@ -404,11 +412,11 @@ function Header({ title, icon, loading, isParallel, iterationState, hasTopLeftAd
404
412
  className: "flex h-6 shrink-0 items-center gap-1 rounded-full border border-border bg-surface px-2.5 text-[11px] font-semibold leading-4 text-foreground shadow-sm",
405
413
  children: [
406
414
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
407
- className: (0, apollo_wind_namespaceObject.cn)('flex shrink-0', isParallel && 'rotate-90'),
415
+ className: "flex shrink-0",
408
416
  "aria-hidden": true,
409
417
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icon_registry_cjs_namespaceObject.CanvasIcon, {
410
- icon: "align-justify",
411
- size: 11
418
+ icon: executionModeIcon,
419
+ size: 12
412
420
  })
413
421
  }),
414
422
  isParallel ? 'Parallel' : 'Sequential'
@@ -441,14 +449,16 @@ function BodyFrame({ isEmpty, isLoading }) {
441
449
  }) : null
442
450
  });
443
451
  }
444
- function ResizeControls({ minimums = DEFAULT_RESIZE_MINIMUMS, onResize }) {
452
+ function ResizeControls({ minimums = DEFAULT_RESIZE_MINIMUMS, onResize, onResizeStart, onResizeEnd }) {
445
453
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(jsx_runtime_namespaceObject.Fragment, {
446
454
  children: RESIZE_CONTROLS.map(({ position, widthSide, heightSide, cursor })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_cjs_namespaceObject.NodeResizeControl, {
447
455
  style: RESIZE_CONTROL_STYLE,
448
456
  position: position,
449
457
  minWidth: minimums[widthSide],
450
458
  minHeight: minimums[heightSide],
459
+ onResizeStart: onResizeStart,
451
460
  onResize: onResize,
461
+ onResizeEnd: onResizeEnd,
452
462
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
453
463
  className: "absolute bottom-0 right-0 h-5 w-5 pointer-events-auto",
454
464
  style: {
@@ -462,6 +472,7 @@ function ResizeCornerIndicators({ visible }) {
462
472
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(jsx_runtime_namespaceObject.Fragment, {
463
473
  children: RESIZE_CONTROLS.map(({ position, indicatorClassName })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
464
474
  "aria-hidden": true,
475
+ "data-testid": `loop-resize-corner-indicator-${position}`,
465
476
  className: (0, apollo_wind_namespaceObject.cn)('pointer-events-none absolute h-2 w-2 rounded-full bg-brand transition-opacity', indicatorClassName, visible ? 'opacity-100' : 'opacity-0')
466
477
  }, position))
467
478
  });
@@ -1 +1 @@
1
- {"version":3,"file":"LoopNode.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/LoopNode/LoopNode.tsx"],"names":[],"mappings":"AAwCA,OAAO,KAAK,EAAsB,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAsI1E,iBAAS,iBAAiB,CAAC,KAAK,EAAE,aAAa,2CA0P9C;AAED,eAAO,MAAM,QAAQ,+DAA0B,CAAC"}
1
+ {"version":3,"file":"LoopNode.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/LoopNode/LoopNode.tsx"],"names":[],"mappings":"AAwCA,OAAO,KAAK,EAAsB,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAsI1E,iBAAS,iBAAiB,CAAC,KAAK,EAAE,aAAa,2CAoQ9C;AAED,eAAO,MAAM,QAAQ,+DAA0B,CAAC"}
@@ -132,6 +132,7 @@ function LoopNodeComponent(props) {
132
132
  const { id, type, data, selected = false, dragging = false, width = 0, height = 0, onAddFirstChild, onResize, toolbarConfig: toolbarConfigProp, adornments: adornmentsProp, executionStatusOverride, suggestionType: suggestionTypeProp, iterationState: iterationStateProp } = props;
133
133
  const nodeTypeRegistry = useOptionalNodeTypeRegistry();
134
134
  const [isHovered, setIsHovered] = useState(false);
135
+ const [isResizing, setIsResizing] = useState(false);
135
136
  const resolvedData = data ?? EMPTY_DATA;
136
137
  const isLoading = !!resolvedData.loading;
137
138
  const suggestionType = suggestionTypeProp ?? resolvedData.suggestionType;
@@ -180,8 +181,10 @@ function LoopNodeComponent(props) {
180
181
  const isDropTarget = true === resolvedData.isDropTarget;
181
182
  const containerWidth = width || DEFAULT_CONTAINER_WIDTH;
182
183
  const containerHeight = height || DEFAULT_CONTAINER_HEIGHT;
183
- const showResizeControls = selected && !dragging && isDesignMode;
184
- const resizeMinimums = useContainerResizeMinimums(id, containerWidth, containerHeight, showResizeControls);
184
+ const resizeControlsMounted = isDesignMode && !dragging;
185
+ const resizeControlsVisible = resizeControlsMounted && (selected || isResizing);
186
+ const resizeMinimumsEnabled = resizeControlsMounted && (selected || isHovered || isResizing);
187
+ const resizeMinimums = useContainerResizeMinimums(id, containerWidth, containerHeight, resizeMinimumsEnabled);
185
188
  const nodeSizeStyle = {
186
189
  width: containerWidth,
187
190
  height: containerHeight,
@@ -231,6 +234,8 @@ function LoopNodeComponent(props) {
231
234
  }, [
232
235
  onResize
233
236
  ]);
237
+ const handleResizeStart = useCallback(()=>setIsResizing(true), []);
238
+ const handleResizeEnd = useCallback(()=>setIsResizing(false), []);
234
239
  const handleEmptyClick = useCallback(()=>{
235
240
  onAddFirstChild?.();
236
241
  }, [
@@ -284,11 +289,13 @@ function LoopNodeComponent(props) {
284
289
  children: adornments[slot]
285
290
  }, slot) : null),
286
291
  /*#__PURE__*/ jsx(ResizeCornerIndicators, {
287
- visible: showResizeControls
292
+ visible: resizeControlsVisible
288
293
  }),
289
- showResizeControls ? /*#__PURE__*/ jsx(ResizeControls, {
294
+ resizeControlsMounted ? /*#__PURE__*/ jsx(ResizeControls, {
290
295
  minimums: resizeMinimums,
291
- onResize: handleResize
296
+ onResize: handleResize,
297
+ onResizeStart: handleResizeStart,
298
+ onResizeEnd: handleResizeEnd
292
299
  }) : null,
293
300
  /*#__PURE__*/ jsx(Header, {
294
301
  title: displayTitle,
@@ -354,6 +361,7 @@ function Header({ title, icon, loading, isParallel, iterationState, hasTopLeftAd
354
361
  paddingLeft: hasTopLeftAdornment ? LOOP_HEADER_ADORNMENT_PADDING : void 0,
355
362
  paddingRight: hasTopRightAdornment ? LOOP_HEADER_ADORNMENT_PADDING : void 0
356
363
  } : void 0;
364
+ const executionModeIcon = isParallel ? 'columns-3' : 'rows-3';
357
365
  return /*#__PURE__*/ jsxs("div", {
358
366
  className: cn('flex shrink-0 cursor-grab items-center justify-between gap-2.5 rounded-t-[18px]', '-mb-2.5 bg-surface-overlay px-3.5 pb-2.5 pt-2.5 text-foreground', 'active:cursor-grabbing'),
359
367
  style: headerStyle,
@@ -376,11 +384,11 @@ function Header({ title, icon, loading, isParallel, iterationState, hasTopLeftAd
376
384
  className: "flex h-6 shrink-0 items-center gap-1 rounded-full border border-border bg-surface px-2.5 text-[11px] font-semibold leading-4 text-foreground shadow-sm",
377
385
  children: [
378
386
  /*#__PURE__*/ jsx("span", {
379
- className: cn('flex shrink-0', isParallel && 'rotate-90'),
387
+ className: "flex shrink-0",
380
388
  "aria-hidden": true,
381
389
  children: /*#__PURE__*/ jsx(CanvasIcon, {
382
- icon: "align-justify",
383
- size: 11
390
+ icon: executionModeIcon,
391
+ size: 12
384
392
  })
385
393
  }),
386
394
  isParallel ? 'Parallel' : 'Sequential'
@@ -413,14 +421,16 @@ function BodyFrame({ isEmpty, isLoading }) {
413
421
  }) : null
414
422
  });
415
423
  }
416
- function ResizeControls({ minimums = DEFAULT_RESIZE_MINIMUMS, onResize }) {
424
+ function ResizeControls({ minimums = DEFAULT_RESIZE_MINIMUMS, onResize, onResizeStart, onResizeEnd }) {
417
425
  return /*#__PURE__*/ jsx(Fragment, {
418
426
  children: RESIZE_CONTROLS.map(({ position, widthSide, heightSide, cursor })=>/*#__PURE__*/ jsx(NodeResizeControl, {
419
427
  style: RESIZE_CONTROL_STYLE,
420
428
  position: position,
421
429
  minWidth: minimums[widthSide],
422
430
  minHeight: minimums[heightSide],
431
+ onResizeStart: onResizeStart,
423
432
  onResize: onResize,
433
+ onResizeEnd: onResizeEnd,
424
434
  children: /*#__PURE__*/ jsx("div", {
425
435
  className: "absolute bottom-0 right-0 h-5 w-5 pointer-events-auto",
426
436
  style: {
@@ -434,6 +444,7 @@ function ResizeCornerIndicators({ visible }) {
434
444
  return /*#__PURE__*/ jsx(Fragment, {
435
445
  children: RESIZE_CONTROLS.map(({ position, indicatorClassName })=>/*#__PURE__*/ jsx("div", {
436
446
  "aria-hidden": true,
447
+ "data-testid": `loop-resize-corner-indicator-${position}`,
437
448
  className: cn('pointer-events-none absolute h-2 w-2 rounded-full bg-brand transition-opacity', indicatorClassName, visible ? 'opacity-100' : 'opacity-0')
438
449
  }, position))
439
450
  });
@@ -40,6 +40,7 @@ const ExecutionStatusIcon_cjs_namespaceObject = require("../ExecutionStatusIcon/
40
40
  const external_StageNode_styles_cjs_namespaceObject = require("./StageNode.styles.cjs");
41
41
  const external_StageNode_types_cjs_namespaceObject = require("./StageNode.types.cjs");
42
42
  const external_StageTitleInput_cjs_namespaceObject = require("./StageTitleInput.cjs");
43
+ const external_useExecutionStatusLabel_cjs_namespaceObject = require("./useExecutionStatusLabel.cjs");
43
44
  const external_useStageNodeLabels_cjs_namespaceObject = require("./useStageNodeLabels.cjs");
44
45
  const SLA_ICON_CONFIG = {
45
46
  warning: {
@@ -70,6 +71,7 @@ const CHIP_ICONS = {
70
71
  };
71
72
  const StageNodeHeaderInner = ({ props, isReadOnly, isException, status, handleTaskAddClick })=>{
72
73
  const labels = (0, external_useStageNodeLabels_cjs_namespaceObject.useStageNodeLabels)();
74
+ const getStatusName = (0, external_useExecutionStatusLabel_cjs_namespaceObject.useExecutionStatusLabel)();
73
75
  const { id, stageDetails, execution, onTaskAdd, onAddTaskFromToolbox, onStageTitleChange, loadingTaskIds } = props;
74
76
  const isAddTaskDisabled = (loadingTaskIds?.size ?? 0) > 0;
75
77
  const icon = stageDetails?.icon;
@@ -78,6 +80,8 @@ const StageNodeHeaderInner = ({ props, isReadOnly, isException, status, handleTa
78
80
  const slaText = execution?.stageStatus?.slaText;
79
81
  const slaIcon = execution?.stageStatus?.slaIcon;
80
82
  const slaIndicator = slaIcon ? SLA_ICON_CONFIG[slaIcon] : void 0;
83
+ const statusFallbackName = status ? getStatusName(status) : '';
84
+ const statusTooltip = statusLabel || statusFallbackName;
81
85
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_StageNode_styles_cjs_namespaceObject.StageHeader, {
82
86
  isException: isException,
83
87
  "data-testid": `stage-header-${id}`,
@@ -106,13 +110,13 @@ const StageNodeHeaderInner = ({ props, isReadOnly, isException, status, handleTa
106
110
  py: apollo_core_namespaceObject.Padding.PadS,
107
111
  children: [
108
112
  status && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CanvasTooltip_cjs_namespaceObject.CanvasTooltip, {
109
- content: statusLabel,
113
+ content: statusTooltip,
110
114
  placement: "top",
111
115
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Button, {
112
116
  variant: "ghost",
113
117
  size: "icon",
114
118
  className: "h-6 w-6",
115
- "aria-label": statusLabel,
119
+ "aria-label": statusTooltip,
116
120
  children: 'NotExecuted' === status ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icon_registry_cjs_namespaceObject.CanvasIcon, {
117
121
  icon: "hourglass",
118
122
  size: 20,
@@ -1 +1 @@
1
- {"version":3,"file":"StageNodeHeader.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/StageNodeHeader.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,cAAc,EAAgB,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAqJnF,eAAO,MAAM,eAAe,wGAxHzB;IACD,KAAK,EAAE,cAAc,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,kBAAkB,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;CACvD,6CAkHwD,CAAC"}
1
+ {"version":3,"file":"StageNodeHeader.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/StageNodeHeader.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,cAAc,EAAgB,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAyJnF,eAAO,MAAM,eAAe,wGA3HzB;IACD,KAAK,EAAE,cAAc,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,kBAAkB,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;CACvD,6CAqHwD,CAAC"}
@@ -12,6 +12,7 @@ import { getExecutionStatusColor } from "../ExecutionStatusIcon/ExecutionStatusI
12
12
  import { StageChip, StageHeader } from "./StageNode.styles.js";
13
13
  import { StageHeaderChipType } from "./StageNode.types.js";
14
14
  import { StageTitleInput } from "./StageTitleInput.js";
15
+ import { useExecutionStatusLabel } from "./useExecutionStatusLabel.js";
15
16
  import { useStageNodeLabels } from "./useStageNodeLabels.js";
16
17
  const SLA_ICON_CONFIG = {
17
18
  warning: {
@@ -42,6 +43,7 @@ const CHIP_ICONS = {
42
43
  };
43
44
  const StageNodeHeaderInner = ({ props, isReadOnly, isException, status, handleTaskAddClick })=>{
44
45
  const labels = useStageNodeLabels();
46
+ const getStatusName = useExecutionStatusLabel();
45
47
  const { id, stageDetails, execution, onTaskAdd, onAddTaskFromToolbox, onStageTitleChange, loadingTaskIds } = props;
46
48
  const isAddTaskDisabled = (loadingTaskIds?.size ?? 0) > 0;
47
49
  const icon = stageDetails?.icon;
@@ -50,6 +52,8 @@ const StageNodeHeaderInner = ({ props, isReadOnly, isException, status, handleTa
50
52
  const slaText = execution?.stageStatus?.slaText;
51
53
  const slaIcon = execution?.stageStatus?.slaIcon;
52
54
  const slaIndicator = slaIcon ? SLA_ICON_CONFIG[slaIcon] : void 0;
55
+ const statusFallbackName = status ? getStatusName(status) : '';
56
+ const statusTooltip = statusLabel || statusFallbackName;
53
57
  return /*#__PURE__*/ jsxs(StageHeader, {
54
58
  isException: isException,
55
59
  "data-testid": `stage-header-${id}`,
@@ -78,13 +82,13 @@ const StageNodeHeaderInner = ({ props, isReadOnly, isException, status, handleTa
78
82
  py: Padding.PadS,
79
83
  children: [
80
84
  status && /*#__PURE__*/ jsx(CanvasTooltip, {
81
- content: statusLabel,
85
+ content: statusTooltip,
82
86
  placement: "top",
83
87
  children: /*#__PURE__*/ jsx(Button, {
84
88
  variant: "ghost",
85
89
  size: "icon",
86
90
  className: "h-6 w-6",
87
- "aria-label": statusLabel,
91
+ "aria-label": statusTooltip,
88
92
  children: 'NotExecuted' === status ? /*#__PURE__*/ jsx(CanvasIcon, {
89
93
  icon: "hourglass",
90
94
  size: 20,
@@ -47,6 +47,7 @@ const external_CanvasTooltip_cjs_namespaceObject = require("../CanvasTooltip.cjs
47
47
  const external_ExecutionStatusIcon_index_cjs_namespaceObject = require("../ExecutionStatusIcon/index.cjs");
48
48
  const external_StageNode_styles_cjs_namespaceObject = require("./StageNode.styles.cjs");
49
49
  const external_StageTaskEntryConditionIcon_cjs_namespaceObject = require("./StageTaskEntryConditionIcon.cjs");
50
+ const external_useExecutionStatusLabel_cjs_namespaceObject = require("./useExecutionStatusLabel.cjs");
50
51
  const ProcessCanvasIcon = ()=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("svg", {
51
52
  viewBox: "0 0 24 24",
52
53
  fill: "none",
@@ -147,9 +148,12 @@ const TaskPlayButton = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(({
147
148
  });
148
149
  });
149
150
  const TaskContent = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(({ task, taskExecution, isDragging, onTaskPlay })=>{
151
+ const getStatusName = (0, external_useExecutionStatusLabel_cjs_namespaceObject.useExecutionStatusLabel)();
150
152
  const hasExecutionStatus = !!taskExecution?.status;
151
153
  const hasSecondRowContent = taskExecution && (taskExecution.duration || taskExecution.retryDuration || taskExecution.badge);
152
154
  const showPlayButtonSmall = onTaskPlay && hasExecutionStatus;
155
+ const taskStatusFallbackName = hasExecutionStatus ? getStatusName(taskExecution?.status) : '';
156
+ const taskStatusTooltip = taskExecution?.message || taskStatusFallbackName;
153
157
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(index_cjs_namespaceObject.Column, {
154
158
  flex: 1,
155
159
  style: {
@@ -196,21 +200,19 @@ const TaskContent = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(({ ta
196
200
  flexShrink: 0
197
201
  },
198
202
  children: [
199
- hasExecutionStatus && (taskExecution.message ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CanvasTooltip_cjs_namespaceObject.CanvasTooltip, {
200
- content: taskExecution.message,
203
+ hasExecutionStatus && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CanvasTooltip_cjs_namespaceObject.CanvasTooltip, {
204
+ content: taskStatusTooltip,
201
205
  placement: "top",
202
206
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Button, {
203
207
  variant: "ghost",
204
208
  size: "icon",
205
209
  className: "h-4 w-4",
206
- "aria-label": taskExecution.message,
210
+ "aria-label": taskStatusTooltip,
207
211
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ExecutionStatusIcon_index_cjs_namespaceObject.ExecutionStatusIcon, {
208
212
  status: taskExecution.status
209
213
  })
210
214
  })
211
- }) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ExecutionStatusIcon_index_cjs_namespaceObject.ExecutionStatusIcon, {
212
- status: taskExecution.status
213
- })),
215
+ }),
214
216
  !hasSecondRowContent && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageTaskEntryConditionIcon_cjs_namespaceObject.StageTaskEntryConditionIcon, {
215
217
  task: task,
216
218
  small: !!hasExecutionStatus
@@ -1 +1 @@
1
- {"version":3,"file":"TaskContent.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/TaskContent.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AA+F3E,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,aAAa,CAAC;IACpB,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAChD;AAED,eAAO,MAAM,WAAW,wFAC4B,gBAAgB,6CAqFnE,CAAC"}
1
+ {"version":3,"file":"TaskContent.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/TaskContent.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAgG3E,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,aAAa,CAAC;IACpB,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAChD;AAED,eAAO,MAAM,WAAW,wFAC4B,gBAAgB,6CAqFnE,CAAC"}
@@ -9,6 +9,7 @@ import { CanvasTooltip } from "../CanvasTooltip.js";
9
9
  import { ExecutionStatusIcon } from "../ExecutionStatusIcon/index.js";
10
10
  import { StageTaskIcon, StageTaskRetryDuration } from "./StageNode.styles.js";
11
11
  import { StageTaskEntryConditionIcon } from "./StageTaskEntryConditionIcon.js";
12
+ import { useExecutionStatusLabel } from "./useExecutionStatusLabel.js";
12
13
  const ProcessCanvasIcon = ()=>/*#__PURE__*/ jsxs("svg", {
13
14
  viewBox: "0 0 24 24",
14
15
  fill: "none",
@@ -109,9 +110,12 @@ const TaskPlayButton = /*#__PURE__*/ memo(({ taskId, onTaskPlay, small })=>{
109
110
  });
110
111
  });
111
112
  const TaskContent = /*#__PURE__*/ memo(({ task, taskExecution, isDragging, onTaskPlay })=>{
113
+ const getStatusName = useExecutionStatusLabel();
112
114
  const hasExecutionStatus = !!taskExecution?.status;
113
115
  const hasSecondRowContent = taskExecution && (taskExecution.duration || taskExecution.retryDuration || taskExecution.badge);
114
116
  const showPlayButtonSmall = onTaskPlay && hasExecutionStatus;
117
+ const taskStatusFallbackName = hasExecutionStatus ? getStatusName(taskExecution?.status) : '';
118
+ const taskStatusTooltip = taskExecution?.message || taskStatusFallbackName;
115
119
  return /*#__PURE__*/ jsxs(Column, {
116
120
  flex: 1,
117
121
  style: {
@@ -158,21 +162,19 @@ const TaskContent = /*#__PURE__*/ memo(({ task, taskExecution, isDragging, onTas
158
162
  flexShrink: 0
159
163
  },
160
164
  children: [
161
- hasExecutionStatus && (taskExecution.message ? /*#__PURE__*/ jsx(CanvasTooltip, {
162
- content: taskExecution.message,
165
+ hasExecutionStatus && /*#__PURE__*/ jsx(CanvasTooltip, {
166
+ content: taskStatusTooltip,
163
167
  placement: "top",
164
168
  children: /*#__PURE__*/ jsx(Button, {
165
169
  variant: "ghost",
166
170
  size: "icon",
167
171
  className: "h-4 w-4",
168
- "aria-label": taskExecution.message,
172
+ "aria-label": taskStatusTooltip,
169
173
  children: /*#__PURE__*/ jsx(ExecutionStatusIcon, {
170
174
  status: taskExecution.status
171
175
  })
172
176
  })
173
- }) : /*#__PURE__*/ jsx(ExecutionStatusIcon, {
174
- status: taskExecution.status
175
- })),
177
+ }),
176
178
  !hasSecondRowContent && /*#__PURE__*/ jsx(StageTaskEntryConditionIcon, {
177
179
  task: task,
178
180
  small: !!hasExecutionStatus
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ useExecutionStatusLabel: ()=>useExecutionStatusLabel
28
+ });
29
+ const external_react_namespaceObject = require("react");
30
+ const index_cjs_namespaceObject = require("../../../i18n/index.cjs");
31
+ function useExecutionStatusLabel() {
32
+ const { _ } = (0, index_cjs_namespaceObject.useSafeLingui)();
33
+ return (0, external_react_namespaceObject.useCallback)((status)=>{
34
+ switch(status){
35
+ case 'InProgress':
36
+ return _({
37
+ id: 'stage-node.status.in-progress',
38
+ message: 'In progress'
39
+ });
40
+ case 'Completed':
41
+ return _({
42
+ id: 'stage-node.status.completed',
43
+ message: 'Completed'
44
+ });
45
+ case 'Paused':
46
+ return _({
47
+ id: 'stage-node.status.paused',
48
+ message: 'Paused'
49
+ });
50
+ case 'Failed':
51
+ return _({
52
+ id: 'stage-node.status.failed',
53
+ message: 'Failed'
54
+ });
55
+ case 'Cancelled':
56
+ case 'UserCancelled':
57
+ return _({
58
+ id: 'stage-node.status.cancelled',
59
+ message: 'Cancelled'
60
+ });
61
+ case 'Terminated':
62
+ return _({
63
+ id: 'stage-node.status.terminated',
64
+ message: 'Terminated'
65
+ });
66
+ case 'NotExecuted':
67
+ return _({
68
+ id: 'stage-node.status.not-executed',
69
+ message: 'Not started'
70
+ });
71
+ case 'Warning':
72
+ return _({
73
+ id: 'stage-node.status.warning',
74
+ message: 'Warning'
75
+ });
76
+ default:
77
+ return '';
78
+ }
79
+ }, [
80
+ _
81
+ ]);
82
+ }
83
+ exports.useExecutionStatusLabel = __webpack_exports__.useExecutionStatusLabel;
84
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
85
+ "useExecutionStatusLabel"
86
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
87
+ Object.defineProperty(exports, '__esModule', {
88
+ value: true
89
+ });
@@ -0,0 +1,3 @@
1
+ import type { StageStatus, StageTaskStatus } from './StageNode.types';
2
+ export declare function useExecutionStatusLabel(): (status: StageStatus | StageTaskStatus | undefined) => string;
3
+ //# sourceMappingURL=useExecutionStatusLabel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useExecutionStatusLabel.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/useExecutionStatusLabel.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAStE,wBAAgB,uBAAuB,aAI1B,WAAW,GAAG,eAAe,GAAG,SAAS,KAAG,MAAM,CAyB9D"}
@@ -0,0 +1,55 @@
1
+ import { useCallback } from "react";
2
+ import { useSafeLingui } from "../../../i18n/index.js";
3
+ function useExecutionStatusLabel() {
4
+ const { _ } = useSafeLingui();
5
+ return useCallback((status)=>{
6
+ switch(status){
7
+ case 'InProgress':
8
+ return _({
9
+ id: 'stage-node.status.in-progress',
10
+ message: 'In progress'
11
+ });
12
+ case 'Completed':
13
+ return _({
14
+ id: 'stage-node.status.completed',
15
+ message: 'Completed'
16
+ });
17
+ case 'Paused':
18
+ return _({
19
+ id: 'stage-node.status.paused',
20
+ message: 'Paused'
21
+ });
22
+ case 'Failed':
23
+ return _({
24
+ id: 'stage-node.status.failed',
25
+ message: 'Failed'
26
+ });
27
+ case 'Cancelled':
28
+ case 'UserCancelled':
29
+ return _({
30
+ id: 'stage-node.status.cancelled',
31
+ message: 'Cancelled'
32
+ });
33
+ case 'Terminated':
34
+ return _({
35
+ id: 'stage-node.status.terminated',
36
+ message: 'Terminated'
37
+ });
38
+ case 'NotExecuted':
39
+ return _({
40
+ id: 'stage-node.status.not-executed',
41
+ message: 'Not started'
42
+ });
43
+ case 'Warning':
44
+ return _({
45
+ id: 'stage-node.status.warning',
46
+ message: 'Warning'
47
+ });
48
+ default:
49
+ return '';
50
+ }
51
+ }, [
52
+ _
53
+ ]);
54
+ }
55
+ export { useExecutionStatusLabel };
@@ -47,9 +47,10 @@ const external_remark_breaks_namespaceObject = require("remark-breaks");
47
47
  var external_remark_breaks_default = /*#__PURE__*/ __webpack_require__.n(external_remark_breaks_namespaceObject);
48
48
  const external_remark_gfm_namespaceObject = require("remark-gfm");
49
49
  var external_remark_gfm_default = /*#__PURE__*/ __webpack_require__.n(external_remark_gfm_namespaceObject);
50
+ const index_cjs_namespaceObject = require("../../../i18n/index.cjs");
50
51
  const external_constants_cjs_namespaceObject = require("../../constants.cjs");
51
52
  const external_NodeViewportOverlay_cjs_namespaceObject = require("../NodeViewportOverlay.cjs");
52
- const index_cjs_namespaceObject = require("../Toolbar/index.cjs");
53
+ const external_Toolbar_index_cjs_namespaceObject = require("../Toolbar/index.cjs");
53
54
  const external_FormattingToolbar_cjs_namespaceObject = require("./FormattingToolbar.cjs");
54
55
  const external_markdown_formatting_index_cjs_namespaceObject = require("./markdown-formatting/index.cjs");
55
56
  const external_StickyNoteNode_styles_cjs_namespaceObject = require("./StickyNoteNode.styles.cjs");
@@ -60,6 +61,7 @@ const external_useScrollCapture_cjs_namespaceObject = require("./useScrollCaptur
60
61
  const minWidth = 8 * external_constants_cjs_namespaceObject.GRID_SPACING;
61
62
  const minHeight = 8 * external_constants_cjs_namespaceObject.GRID_SPACING;
62
63
  const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = 'Add text', renderPlaceholderOnSelect = false, readOnly = false, onContentChange, onColorChange, onResize })=>{
64
+ const { _ } = (0, index_cjs_namespaceObject.useSafeLingui)();
63
65
  const { updateNodeData, deleteElements } = (0, react_cjs_namespaceObject.useReactFlow)();
64
66
  const [isEditing, setIsEditing] = (0, external_react_namespaceObject.useState)(!readOnly && (data.autoFocus ?? false));
65
67
  const [isResizing, setIsResizing] = (0, external_react_namespaceObject.useState)(false);
@@ -264,7 +266,10 @@ const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = '
264
266
  icon: "trash",
265
267
  size: 14
266
268
  }),
267
- label: 'Delete',
269
+ label: _({
270
+ id: 'sticky-note.toolbar.delete',
271
+ message: 'Delete'
272
+ }),
268
273
  onAction: handleDelete
269
274
  },
270
275
  {
@@ -273,7 +278,10 @@ const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = '
273
278
  icon: "pencil",
274
279
  size: 14
275
280
  }),
276
- label: 'Edit',
281
+ label: _({
282
+ id: 'sticky-note.toolbar.edit',
283
+ message: 'Edit'
284
+ }),
277
285
  onAction: handleEditClick
278
286
  },
279
287
  {
@@ -291,7 +299,10 @@ const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = '
291
299
  border: '1px solid transparent'
292
300
  }
293
301
  }),
294
- label: 'Color',
302
+ label: _({
303
+ id: 'sticky-note.toolbar.color',
304
+ message: 'Color'
305
+ }),
295
306
  onAction: handleToggleColorPicker
296
307
  }
297
308
  ];
@@ -303,6 +314,7 @@ const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = '
303
314
  align: 'center'
304
315
  };
305
316
  }, [
317
+ _,
306
318
  handleEditClick,
307
319
  handleToggleColorPicker,
308
320
  color,
@@ -440,7 +452,7 @@ const StickyNoteNodeComponent = ({ id, data, selected, dragging, placeholder = '
440
452
  })
441
453
  ]
442
454
  }),
443
- !readOnly && selected && !dragging && !isResizing && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.NodeToolbar, {
455
+ !readOnly && selected && !dragging && !isResizing && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_Toolbar_index_cjs_namespaceObject.NodeToolbar, {
444
456
  nodeId: id,
445
457
  config: toolbarConfig,
446
458
  expanded: true,
@@ -1 +1 @@
1
- {"version":3,"file":"StickyNoteNode.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StickyNoteNode/StickyNoteNode.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AAgC1E,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAiB,MAAM,wBAAwB,CAAC;AAM7F,MAAM,WAAW,mBAAoB,SAAQ,SAAS;IACpD,IAAI,EAAE,cAAc,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IACjD,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACpD;AAiaD,eAAO,MAAM,cAAc,sKAjZxB,mBAAmB,6CAiZqC,CAAC"}
1
+ {"version":3,"file":"StickyNoteNode.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StickyNoteNode/StickyNoteNode.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AAiC1E,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAiB,MAAM,wBAAwB,CAAC;AAM7F,MAAM,WAAW,mBAAoB,SAAQ,SAAS;IACpD,IAAI,EAAE,cAAc,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IACjD,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACpD;AAkaD,eAAO,MAAM,cAAc,sKAlZxB,mBAAmB,6CAkZqC,CAAC"}