@uipath/apollo-react 4.39.3 → 4.39.4

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.
@@ -363,7 +363,8 @@ const ResourceNode = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(({ d
363
363
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_utils_index_cjs_namespaceObject.CanvasIcon, {
364
364
  icon: "circle",
365
365
  size: 14,
366
- color: "#cc3d45"
366
+ color: "#cc3d45",
367
+ fill: "#cc3d45"
367
368
  });
368
369
  }, [
369
370
  hasBreakpoint
@@ -335,7 +335,8 @@ const ResourceNode = /*#__PURE__*/ memo(({ data, selected, id, mode, hasError =
335
335
  return /*#__PURE__*/ jsx(CanvasIcon, {
336
336
  icon: "circle",
337
337
  size: 14,
338
- color: "#cc3d45"
338
+ color: "#cc3d45",
339
+ fill: "#cc3d45"
339
340
  });
340
341
  }, [
341
342
  hasBreakpoint
@@ -135,10 +135,13 @@ function getIcon(iconId) {
135
135
  if (icon) return icon;
136
136
  const pascalCaseId = kebabToPascal(iconId);
137
137
  const LucideIcon = external_lucide_react_namespaceObject.icons[pascalCaseId];
138
- if (LucideIcon) return ({ w, h, color })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(LucideIcon, {
138
+ if (LucideIcon) return ({ w, h, color, fill })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(LucideIcon, {
139
139
  width: w ?? 24,
140
140
  height: h ?? 24,
141
- color: color
141
+ color: color,
142
+ ...fill?.length && {
143
+ fill
144
+ }
142
145
  });
143
146
  const BoxIcon = external_lucide_react_namespaceObject.icons.Box;
144
147
  return ({ w, h, color })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(BoxIcon, {
@@ -147,7 +150,7 @@ function getIcon(iconId) {
147
150
  color: color
148
151
  });
149
152
  }
150
- const icon_registry_CanvasIcon = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(function({ icon, size = 16, color }) {
153
+ const icon_registry_CanvasIcon = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(function({ icon, size = 16, color, fill }) {
151
154
  const Icon = (0, external_react_namespaceObject.useMemo)(()=>icon ? getIcon(icon) : null, [
152
155
  icon
153
156
  ]);
@@ -155,7 +158,8 @@ const icon_registry_CanvasIcon = /*#__PURE__*/ (0, external_react_namespaceObjec
155
158
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Icon, {
156
159
  w: size,
157
160
  h: size,
158
- color: color
161
+ color: color,
162
+ fill: fill
159
163
  });
160
164
  });
161
165
  const NodeIcon = icon_registry_CanvasIcon;
@@ -3,12 +3,14 @@ export type IconComponent = (props: {
3
3
  w?: number;
4
4
  h?: number;
5
5
  color?: string;
6
+ fill?: string;
6
7
  }) => JSX.Element;
7
8
  export declare function getIcon(iconId?: string): IconComponent;
8
9
  export interface CanvasIconProps {
9
10
  icon?: string;
10
11
  size?: number;
11
12
  color?: string;
13
+ fill?: string;
12
14
  }
13
15
  export declare const CanvasIcon: import("react").NamedExoticComponent<CanvasIconProps>;
14
16
  export declare const NodeIcon: import("react").NamedExoticComponent<CanvasIconProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"icon-registry.d.ts","sourceRoot":"","sources":["../../../src/canvas/utils/icon-registry.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,GAAG,EAAiB,MAAM,OAAO,CAAC;AAGhD,MAAM,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE;IAAE,CAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,KAAK,GAAG,CAAC,OAAO,CAAC;AAuD/F,wBAAgB,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,aAAa,CAuCtD;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAMD,eAAO,MAAM,UAAU,uDAIrB,CAAC;AAGH,eAAO,MAAM,QAAQ,uDAAa,CAAC"}
1
+ {"version":3,"file":"icon-registry.d.ts","sourceRoot":"","sources":["../../../src/canvas/utils/icon-registry.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,GAAG,EAAiB,MAAM,OAAO,CAAC;AAGhD,MAAM,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE;IAClC,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,KAAK,GAAG,CAAC,OAAO,CAAC;AAuDlB,wBAAgB,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,aAAa,CAyCtD;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAMD,eAAO,MAAM,UAAU,uDASrB,CAAC;AAGH,eAAO,MAAM,QAAQ,uDAAa,CAAC"}
@@ -105,10 +105,13 @@ function getIcon(iconId) {
105
105
  if (icon) return icon;
106
106
  const pascalCaseId = kebabToPascal(iconId);
107
107
  const LucideIcon = icons[pascalCaseId];
108
- if (LucideIcon) return ({ w, h, color })=>/*#__PURE__*/ jsx(LucideIcon, {
108
+ if (LucideIcon) return ({ w, h, color, fill })=>/*#__PURE__*/ jsx(LucideIcon, {
109
109
  width: w ?? 24,
110
110
  height: h ?? 24,
111
- color: color
111
+ color: color,
112
+ ...fill?.length && {
113
+ fill
114
+ }
112
115
  });
113
116
  const BoxIcon = icons.Box;
114
117
  return ({ w, h, color })=>/*#__PURE__*/ jsx(BoxIcon, {
@@ -117,7 +120,7 @@ function getIcon(iconId) {
117
120
  color: color
118
121
  });
119
122
  }
120
- const icon_registry_CanvasIcon = /*#__PURE__*/ memo(function({ icon, size = 16, color }) {
123
+ const icon_registry_CanvasIcon = /*#__PURE__*/ memo(function({ icon, size = 16, color, fill }) {
121
124
  const Icon = useMemo(()=>icon ? getIcon(icon) : null, [
122
125
  icon
123
126
  ]);
@@ -125,7 +128,8 @@ const icon_registry_CanvasIcon = /*#__PURE__*/ memo(function({ icon, size = 16,
125
128
  return /*#__PURE__*/ jsx(Icon, {
126
129
  w: size,
127
130
  h: size,
128
- color: color
131
+ color: color,
132
+ fill: fill
129
133
  });
130
134
  });
131
135
  const NodeIcon = icon_registry_CanvasIcon;
@@ -48,6 +48,15 @@ const SPAN_STATUS = {
48
48
  };
49
49
  const NODE_ID_DELIMITER = '=>';
50
50
  const EDGE_ID_DELIMITER = '::';
51
+ const parseSpanAttributes = (span)=>{
52
+ if (!span.Attributes) return null;
53
+ try {
54
+ return JSON.parse(span.Attributes);
55
+ } catch {
56
+ return null;
57
+ }
58
+ };
59
+ const spanStatus = (span)=>Number.isFinite(span.Status) ? span.Status : SPAN_STATUS.RUNNING;
51
60
  const getResourceNodeId = (resource)=>resource.id;
52
61
  const normalizeToolName = (resource)=>{
53
62
  if ('escalation' === resource.type) return `escalate_${resource.name.toLowerCase().replace(/\s/g, '_')}`;
@@ -57,11 +66,11 @@ const normalizeToolName = (resource)=>{
57
66
  };
58
67
  const hasResourceStatus = (resource, spans, targetStatus)=>{
59
68
  for (const span of spans){
60
- const attributes = span.Attributes ? JSON.parse(span.Attributes) : null;
69
+ const attributes = parseSpanAttributes(span);
61
70
  if (attributes) {
62
71
  if ('context' === resource.type || 'escalation' === resource.type || 'tool' === resource.type || 'mcp' === resource.type || 'a2a' === resource.type) {
63
72
  const normalizedToolName = normalizeToolName(resource);
64
- if (attributes.toolName === normalizedToolName && span.Status === targetStatus) return true;
73
+ if ('string' == typeof attributes.toolName && attributes.toolName.toLowerCase() === normalizedToolName.toLowerCase() && spanStatus(span) === targetStatus) return true;
65
74
  }
66
75
  }
67
76
  }
@@ -75,9 +84,9 @@ const hasResourceSuccess = (resource, spans)=>{
75
84
  };
76
85
  const hasModelStatus = (_model, spans, targetStatus)=>{
77
86
  for (const span of spans){
78
- const attributes = span.Attributes ? JSON.parse(span.Attributes) : null;
87
+ const attributes = parseSpanAttributes(span);
79
88
  if (attributes) {
80
- if ('completion' === attributes.type && span.Status === targetStatus) return true;
89
+ if ('completion' === attributes.type && spanStatus(span) === targetStatus) return true;
81
90
  }
82
91
  }
83
92
  return false;
@@ -90,10 +99,10 @@ const hasModelSuccess = (model, spans)=>{
90
99
  };
91
100
  const hasAgentRunning = (spans)=>{
92
101
  for (const span of spans){
93
- const attributes = span.Attributes ? JSON.parse(span.Attributes) : null;
102
+ const attributes = parseSpanAttributes(span);
94
103
  if (attributes) {
95
104
  if ('agentRun' === attributes.type) {
96
- const isRunning = span.Status === SPAN_STATUS.RUNNING;
105
+ const isRunning = spanStatus(span) === SPAN_STATUS.RUNNING;
97
106
  return isRunning;
98
107
  }
99
108
  }
@@ -1 +1 @@
1
- {"version":3,"file":"props-helpers.d.ts","sourceRoot":"","sources":["../../../src/canvas/utils/props-helpers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,qBAAqB,EACrB,wBAAwB,EACzB,MAAM,UAAU,CAAC;AAUlB,eAAO,MAAM,iBAAiB,OAAO,CAAC;AACtC,eAAO,MAAM,iBAAiB,OAAO,CAAC;AAiDtC,eAAO,MAAM,kBAAkB,GAAI,UAAU,iBAAiB,EAAE,OAAO,QAAQ,EAAE,KAAG,OAEnF,CAAC;AAGF,eAAO,MAAM,gBAAgB,GAAI,UAAU,iBAAiB,EAAE,OAAO,QAAQ,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B,EAAE,CAAA;CAqEhE,CAAC"}
@@ -9,6 +9,15 @@ const SPAN_STATUS = {
9
9
  };
10
10
  const NODE_ID_DELIMITER = '=>';
11
11
  const EDGE_ID_DELIMITER = '::';
12
+ const parseSpanAttributes = (span)=>{
13
+ if (!span.Attributes) return null;
14
+ try {
15
+ return JSON.parse(span.Attributes);
16
+ } catch {
17
+ return null;
18
+ }
19
+ };
20
+ const spanStatus = (span)=>Number.isFinite(span.Status) ? span.Status : SPAN_STATUS.RUNNING;
12
21
  const getResourceNodeId = (resource)=>resource.id;
13
22
  const normalizeToolName = (resource)=>{
14
23
  if ('escalation' === resource.type) return `escalate_${resource.name.toLowerCase().replace(/\s/g, '_')}`;
@@ -18,11 +27,11 @@ const normalizeToolName = (resource)=>{
18
27
  };
19
28
  const hasResourceStatus = (resource, spans, targetStatus)=>{
20
29
  for (const span of spans){
21
- const attributes = span.Attributes ? JSON.parse(span.Attributes) : null;
30
+ const attributes = parseSpanAttributes(span);
22
31
  if (attributes) {
23
32
  if ('context' === resource.type || 'escalation' === resource.type || 'tool' === resource.type || 'mcp' === resource.type || 'a2a' === resource.type) {
24
33
  const normalizedToolName = normalizeToolName(resource);
25
- if (attributes.toolName === normalizedToolName && span.Status === targetStatus) return true;
34
+ if ('string' == typeof attributes.toolName && attributes.toolName.toLowerCase() === normalizedToolName.toLowerCase() && spanStatus(span) === targetStatus) return true;
26
35
  }
27
36
  }
28
37
  }
@@ -36,9 +45,9 @@ const hasResourceSuccess = (resource, spans)=>{
36
45
  };
37
46
  const hasModelStatus = (_model, spans, targetStatus)=>{
38
47
  for (const span of spans){
39
- const attributes = span.Attributes ? JSON.parse(span.Attributes) : null;
48
+ const attributes = parseSpanAttributes(span);
40
49
  if (attributes) {
41
- if ('completion' === attributes.type && span.Status === targetStatus) return true;
50
+ if ('completion' === attributes.type && spanStatus(span) === targetStatus) return true;
42
51
  }
43
52
  }
44
53
  return false;
@@ -51,10 +60,10 @@ const hasModelSuccess = (model, spans)=>{
51
60
  };
52
61
  const hasAgentRunning = (spans)=>{
53
62
  for (const span of spans){
54
- const attributes = span.Attributes ? JSON.parse(span.Attributes) : null;
63
+ const attributes = parseSpanAttributes(span);
55
64
  if (attributes) {
56
65
  if ('agentRun' === attributes.type) {
57
- const isRunning = span.Status === SPAN_STATUS.RUNNING;
66
+ const isRunning = spanStatus(span) === SPAN_STATUS.RUNNING;
58
67
  return isRunning;
59
68
  }
60
69
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/apollo-react",
3
- "version": "4.39.3",
3
+ "version": "4.39.4",
4
4
  "description": "Apollo Design System - React component library with Material UI theming",
5
5
  "repository": {
6
6
  "type": "git",