@uipath/apollo-react 4.6.0-pr525.51f590d → 4.6.0-pr525.7da9748

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.
@@ -229,6 +229,31 @@ const BaseNodeComponent = (props)=>{
229
229
  display.subLabel
230
230
  ]);
231
231
  const displayFooter = footerComponent;
232
+ const hasFooter = !!displayFooter;
233
+ const containerWidth = getContainerWidth(displayShape, width);
234
+ const containerHeight = getContainerHeight(height, hasFooter, displayFooterVariant);
235
+ const nodeVars = (0, external_react_namespaceObject.useMemo)(()=>{
236
+ const numH = 'number' == typeof containerHeight ? containerHeight : void 0;
237
+ const radiusBasis = 'rectangle' === displayShape ? numH ?? external_constants_cjs_namespaceObject.DEFAULT_NODE_SIZE : Math.min(containerWidth, numH ?? external_constants_cjs_namespaceObject.DEFAULT_NODE_SIZE);
238
+ const nodeRadius = 'circle' === displayShape ? '50%' : hasFooter ? '16px' : `${radiusBasis * external_constants_cjs_namespaceObject.NODE_CONTAINER_RADIUS_RATIO}px`;
239
+ const effectiveH = hasFooter ? external_constants_cjs_namespaceObject.DEFAULT_NODE_SIZE : numH ?? external_constants_cjs_namespaceObject.DEFAULT_NODE_SIZE;
240
+ const effectiveW = hasFooter ? external_constants_cjs_namespaceObject.DEFAULT_NODE_SIZE : containerWidth;
241
+ const basis = 'rectangle' === displayShape ? effectiveH : Math.min(effectiveW, effectiveH);
242
+ const innerRadius = 'circle' === displayShape ? '50%' : hasFooter ? '16px' : `${basis * external_constants_cjs_namespaceObject.NODE_INNER_RADIUS_RATIO}px`;
243
+ return {
244
+ '--node-w': `${containerWidth}px`,
245
+ '--node-h': numH ? `${numH}px` : 'auto',
246
+ '--node-radius': nodeRadius,
247
+ '--inner-size': `${basis * external_constants_cjs_namespaceObject.NODE_INNER_SHAPE_RATIO}px`,
248
+ '--inner-radius': innerRadius,
249
+ '--icon-size': `${basis * external_constants_cjs_namespaceObject.NODE_INNER_ICON_RATIO}px`
250
+ };
251
+ }, [
252
+ containerWidth,
253
+ containerHeight,
254
+ displayShape,
255
+ hasFooter
256
+ ]);
232
257
  const interactionState = (0, external_react_namespaceObject.useMemo)(()=>{
233
258
  if (disabled) return 'disabled';
234
259
  if (dragging) return 'drag';
@@ -345,6 +370,7 @@ const BaseNodeComponent = (props)=>{
345
370
  if (!manifest) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
346
371
  ref: containerRef,
347
372
  className: "relative",
373
+ style: nodeVars,
348
374
  onMouseEnter: handleMouseEnter,
349
375
  onMouseLeave: handleMouseLeave,
350
376
  onFocus: handleFocus,
@@ -356,12 +382,10 @@ const BaseNodeComponent = (props)=>{
356
382
  interactionState: interactionState
357
383
  })
358
384
  });
359
- const hasFooter = !!displayFooter;
360
- const containerWidth = getContainerWidth(displayShape, width);
361
- const containerHeight = getContainerHeight(height, hasFooter, displayFooterVariant);
362
385
  const nodeContent = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
363
386
  ref: containerRef,
364
387
  className: "relative",
388
+ style: nodeVars,
365
389
  onMouseEnter: handleMouseEnter,
366
390
  onMouseLeave: handleMouseLeave,
367
391
  onFocus: handleFocus,
@@ -375,20 +399,14 @@ const BaseNodeComponent = (props)=>{
375
399
  executionStatus: executionStatus,
376
400
  validationStatus: validationState?.validationStatus,
377
401
  suggestionType: suggestionType,
378
- width: containerWidth,
379
- height: containerHeight,
380
402
  hasFooter: hasFooter,
381
403
  background: displayBackground,
382
404
  loading: data.loading,
383
405
  children: [
384
406
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_BaseNodeInnerShape_cjs_namespaceObject.BaseInnerShape, {
385
- shape: displayShape,
386
407
  color: displayColor,
387
408
  background: displayIconBackground,
388
409
  loading: data.loading,
389
- hasFooter: hasFooter,
390
- containerWidth: containerWidth,
391
- containerHeight: 'number' == typeof containerHeight ? containerHeight : void 0,
392
410
  children: data.loading ? null : Icon
393
411
  }),
394
412
  adornments?.topLeft && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_BaseNodeBadgeSlot_cjs_namespaceObject.BaseBadgeSlot, {
@@ -1 +1 @@
1
- {"version":3,"file":"BaseNode.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseNode/BaseNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAkB,MAAM,0CAA0C,CAAC;AAkChG,OAAO,KAAK,EACV,YAAY,EAIb,MAAM,kBAAkB,CAAC;AAyiB1B,eAAO,MAAM,QAAQ,8CAjgBa,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,6CAigBhB,CAAC"}
1
+ {"version":3,"file":"BaseNode.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseNode/BaseNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAkB,MAAM,0CAA0C,CAAC;AAsChG,OAAO,KAAK,EACV,YAAY,EAIb,MAAM,kBAAkB,CAAC;AAqlB1B,eAAO,MAAM,QAAQ,8CA7iBa,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,6CA6iBhB,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Position, useReactFlow, useStore, useUpdateNodeInternals } from "../../xyflow/react.js";
3
3
  import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
4
- import { DEFAULT_NODE_SIZE, DEFAULT_RECTANGLE_NODE_WIDTH, GRID_SPACING, NODE_HEIGHT_DEFAULT, NODE_HEIGHT_FOOTER_BUTTON, NODE_HEIGHT_FOOTER_DOUBLE, NODE_HEIGHT_FOOTER_SINGLE } from "../../constants.js";
4
+ import { DEFAULT_NODE_SIZE, DEFAULT_RECTANGLE_NODE_WIDTH, GRID_SPACING, NODE_CONTAINER_RADIUS_RATIO, NODE_HEIGHT_DEFAULT, NODE_HEIGHT_FOOTER_BUTTON, NODE_HEIGHT_FOOTER_DOUBLE, NODE_HEIGHT_FOOTER_SINGLE, NODE_INNER_ICON_RATIO, NODE_INNER_RADIUS_RATIO, NODE_INNER_SHAPE_RATIO } from "../../constants.js";
5
5
  import { useNodeTypeRegistry } from "../../core/index.js";
6
6
  import { useElementValidationStatus, useNodeExecutionState } from "../../hooks/index.js";
7
7
  import { resolveAdornments } from "../../utils/adornment-resolver.js";
@@ -201,6 +201,31 @@ const BaseNodeComponent = (props)=>{
201
201
  display.subLabel
202
202
  ]);
203
203
  const displayFooter = footerComponent;
204
+ const hasFooter = !!displayFooter;
205
+ const containerWidth = getContainerWidth(displayShape, width);
206
+ const containerHeight = getContainerHeight(height, hasFooter, displayFooterVariant);
207
+ const nodeVars = useMemo(()=>{
208
+ const numH = 'number' == typeof containerHeight ? containerHeight : void 0;
209
+ const radiusBasis = 'rectangle' === displayShape ? numH ?? DEFAULT_NODE_SIZE : Math.min(containerWidth, numH ?? DEFAULT_NODE_SIZE);
210
+ const nodeRadius = 'circle' === displayShape ? '50%' : hasFooter ? '16px' : `${radiusBasis * NODE_CONTAINER_RADIUS_RATIO}px`;
211
+ const effectiveH = hasFooter ? DEFAULT_NODE_SIZE : numH ?? DEFAULT_NODE_SIZE;
212
+ const effectiveW = hasFooter ? DEFAULT_NODE_SIZE : containerWidth;
213
+ const basis = 'rectangle' === displayShape ? effectiveH : Math.min(effectiveW, effectiveH);
214
+ const innerRadius = 'circle' === displayShape ? '50%' : hasFooter ? '16px' : `${basis * NODE_INNER_RADIUS_RATIO}px`;
215
+ return {
216
+ '--node-w': `${containerWidth}px`,
217
+ '--node-h': numH ? `${numH}px` : 'auto',
218
+ '--node-radius': nodeRadius,
219
+ '--inner-size': `${basis * NODE_INNER_SHAPE_RATIO}px`,
220
+ '--inner-radius': innerRadius,
221
+ '--icon-size': `${basis * NODE_INNER_ICON_RATIO}px`
222
+ };
223
+ }, [
224
+ containerWidth,
225
+ containerHeight,
226
+ displayShape,
227
+ hasFooter
228
+ ]);
204
229
  const interactionState = useMemo(()=>{
205
230
  if (disabled) return 'disabled';
206
231
  if (dragging) return 'drag';
@@ -317,6 +342,7 @@ const BaseNodeComponent = (props)=>{
317
342
  if (!manifest) return /*#__PURE__*/ jsx("div", {
318
343
  ref: containerRef,
319
344
  className: "relative",
345
+ style: nodeVars,
320
346
  onMouseEnter: handleMouseEnter,
321
347
  onMouseLeave: handleMouseLeave,
322
348
  onFocus: handleFocus,
@@ -328,12 +354,10 @@ const BaseNodeComponent = (props)=>{
328
354
  interactionState: interactionState
329
355
  })
330
356
  });
331
- const hasFooter = !!displayFooter;
332
- const containerWidth = getContainerWidth(displayShape, width);
333
- const containerHeight = getContainerHeight(height, hasFooter, displayFooterVariant);
334
357
  const nodeContent = /*#__PURE__*/ jsxs("div", {
335
358
  ref: containerRef,
336
359
  className: "relative",
360
+ style: nodeVars,
337
361
  onMouseEnter: handleMouseEnter,
338
362
  onMouseLeave: handleMouseLeave,
339
363
  onFocus: handleFocus,
@@ -347,20 +371,14 @@ const BaseNodeComponent = (props)=>{
347
371
  executionStatus: executionStatus,
348
372
  validationStatus: validationState?.validationStatus,
349
373
  suggestionType: suggestionType,
350
- width: containerWidth,
351
- height: containerHeight,
352
374
  hasFooter: hasFooter,
353
375
  background: displayBackground,
354
376
  loading: data.loading,
355
377
  children: [
356
378
  /*#__PURE__*/ jsx(BaseInnerShape, {
357
- shape: displayShape,
358
379
  color: displayColor,
359
380
  background: displayIconBackground,
360
381
  loading: data.loading,
361
- hasFooter: hasFooter,
362
- containerWidth: containerWidth,
363
- containerHeight: 'number' == typeof containerHeight ? containerHeight : void 0,
364
382
  children: data.loading ? null : Icon
365
383
  }),
366
384
  adornments?.topLeft && /*#__PURE__*/ jsx(BaseBadgeSlot, {
@@ -30,7 +30,6 @@ __webpack_require__.d(__webpack_exports__, {
30
30
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
31
31
  const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
32
32
  const external_react_namespaceObject = require("react");
33
- const external_constants_cjs_namespaceObject = require("../../constants.cjs");
34
33
  const getStatusBorder = (status)=>{
35
34
  switch(status){
36
35
  case 'InProgress':
@@ -54,13 +53,9 @@ const getStatusBorder = (status)=>{
54
53
  return '';
55
54
  }
56
55
  };
57
- const BaseContainer = ({ isSelected, isHovered, shape, interactionState, executionStatus, validationStatus, suggestionType, width, height, hasFooter, background, loading, children })=>{
58
- const numericWidth = 'number' == typeof width ? width : void 0;
59
- const numericHeight = 'number' == typeof height ? height : void 0;
60
- const radiusBasis = 'rectangle' === shape ? numericHeight ?? external_constants_cjs_namespaceObject.DEFAULT_NODE_SIZE : Math.min(numericWidth ?? external_constants_cjs_namespaceObject.DEFAULT_NODE_SIZE, numericHeight ?? external_constants_cjs_namespaceObject.DEFAULT_NODE_SIZE);
61
- const containerRadius = radiusBasis * external_constants_cjs_namespaceObject.NODE_CONTAINER_RADIUS_RATIO;
56
+ const BaseContainer = ({ isSelected, isHovered, shape, interactionState, executionStatus, validationStatus, suggestionType, hasFooter, background, loading, children })=>{
62
57
  const activeStatus = suggestionType ?? validationStatus ?? executionStatus;
63
- const className = (0, external_react_namespaceObject.useMemo)(()=>(0, apollo_wind_namespaceObject.cn)('relative flex items-center cursor-pointer bg-surface-overlay border-2 border-border', 'circle' === shape ? 'rounded-full' : '', 'rectangle' === shape ? 'flex-row justify-start gap-3 p-2' : 'flex-col justify-center', hasFooter && 'flex-wrap rounded-2xl', getStatusBorder(activeStatus), !isSelected && isHovered && 'border-foreground-muted', isSelected && 'border-brand', isSelected && isHovered && 'border-foreground-accent-muted', 'disabled' === interactionState && 'opacity-50 cursor-not-allowed', 'drag' === interactionState && 'cursor-grabbing opacity-80'), [
58
+ const className = (0, external_react_namespaceObject.useMemo)(()=>(0, apollo_wind_namespaceObject.cn)('relative flex items-center cursor-pointer bg-surface-overlay border-2 border-border', 'w-(--node-w) h-(--node-h) [border-radius:var(--node-radius)]', 'rectangle' === shape ? 'flex-row justify-start gap-3 p-2' : 'flex-col justify-center', hasFooter && 'flex-wrap', getStatusBorder(activeStatus), !isSelected && isHovered && 'border-foreground-muted', isSelected && 'border-brand', isSelected && isHovered && 'border-foreground-accent-muted', 'disabled' === interactionState && 'opacity-50 cursor-not-allowed', 'drag' === interactionState && 'cursor-grabbing opacity-80'), [
64
59
  shape,
65
60
  hasFooter,
66
61
  activeStatus,
@@ -68,19 +63,6 @@ const BaseContainer = ({ isSelected, isHovered, shape, interactionState, executi
68
63
  isHovered,
69
64
  interactionState
70
65
  ]);
71
- const style = (0, external_react_namespaceObject.useMemo)(()=>({
72
- width,
73
- height,
74
- background,
75
- borderRadius: 'circle' === shape || hasFooter ? void 0 : containerRadius
76
- }), [
77
- width,
78
- height,
79
- background,
80
- shape,
81
- hasFooter,
82
- containerRadius
83
- ]);
84
66
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
85
67
  "data-testid": "base-container",
86
68
  "data-execution-status": executionStatus,
@@ -88,7 +70,9 @@ const BaseContainer = ({ isSelected, isHovered, shape, interactionState, executi
88
70
  "data-validation-status": validationStatus,
89
71
  "data-suggestion-type": suggestionType,
90
72
  className: className,
91
- style: style,
73
+ style: background ? {
74
+ background
75
+ } : void 0,
92
76
  "aria-busy": loading || void 0,
93
77
  children: children
94
78
  });
@@ -11,13 +11,11 @@ interface BaseContainerProps {
11
11
  executionStatus?: ElementStatusValues;
12
12
  validationStatus?: ValidationErrorSeverity;
13
13
  suggestionType?: SuggestionType;
14
- width?: number;
15
- height?: number | 'auto';
16
14
  hasFooter?: boolean;
17
15
  background?: string;
18
16
  loading?: boolean;
19
17
  children: React.ReactNode;
20
18
  }
21
- export declare const BaseContainer: ({ isSelected, isHovered, shape, interactionState, executionStatus, validationStatus, suggestionType, width, height, hasFooter, background, loading, children, }: BaseContainerProps) => import("react/jsx-runtime").JSX.Element;
19
+ export declare const BaseContainer: ({ isSelected, isHovered, shape, interactionState, executionStatus, validationStatus, suggestionType, hasFooter, background, loading, children, }: BaseContainerProps) => import("react/jsx-runtime").JSX.Element;
22
20
  export {};
23
21
  //# sourceMappingURL=BaseNodeContainer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseNodeContainer.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseNode/BaseNodeContainer.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,eAAO,MAAM,eAAe,GAC1B,SAAS,mBAAmB,GAAG,uBAAuB,GAAG,cAAc,KACtE,MAsBF,CAAC;AAEF,UAAU,kBAAkB;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,mBAAmB,CAAC;IACtC,gBAAgB,CAAC,EAAE,uBAAuB,CAAC;IAC3C,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AACD,eAAO,MAAM,aAAa,GAAI,iKAc3B,kBAAkB,4CA2DpB,CAAC"}
1
+ {"version":3,"file":"BaseNodeContainer.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseNode/BaseNodeContainer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,eAAO,MAAM,eAAe,GAC1B,SAAS,mBAAmB,GAAG,uBAAuB,GAAG,cAAc,KACtE,MAsBF,CAAC;AAEF,UAAU,kBAAkB;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,mBAAmB,CAAC;IACtC,gBAAgB,CAAC,EAAE,uBAAuB,CAAC;IAC3C,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,aAAa,GAAI,kJAY3B,kBAAkB,4CAoCpB,CAAC"}
@@ -1,7 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { cn } from "@uipath/apollo-wind";
3
3
  import { useMemo } from "react";
4
- import { DEFAULT_NODE_SIZE, NODE_CONTAINER_RADIUS_RATIO } from "../../constants.js";
5
4
  const getStatusBorder = (status)=>{
6
5
  switch(status){
7
6
  case 'InProgress':
@@ -25,13 +24,9 @@ const getStatusBorder = (status)=>{
25
24
  return '';
26
25
  }
27
26
  };
28
- const BaseContainer = ({ isSelected, isHovered, shape, interactionState, executionStatus, validationStatus, suggestionType, width, height, hasFooter, background, loading, children })=>{
29
- const numericWidth = 'number' == typeof width ? width : void 0;
30
- const numericHeight = 'number' == typeof height ? height : void 0;
31
- const radiusBasis = 'rectangle' === shape ? numericHeight ?? DEFAULT_NODE_SIZE : Math.min(numericWidth ?? DEFAULT_NODE_SIZE, numericHeight ?? DEFAULT_NODE_SIZE);
32
- const containerRadius = radiusBasis * NODE_CONTAINER_RADIUS_RATIO;
27
+ const BaseContainer = ({ isSelected, isHovered, shape, interactionState, executionStatus, validationStatus, suggestionType, hasFooter, background, loading, children })=>{
33
28
  const activeStatus = suggestionType ?? validationStatus ?? executionStatus;
34
- const className = useMemo(()=>cn('relative flex items-center cursor-pointer bg-surface-overlay border-2 border-border', 'circle' === shape ? 'rounded-full' : '', 'rectangle' === shape ? 'flex-row justify-start gap-3 p-2' : 'flex-col justify-center', hasFooter && 'flex-wrap rounded-2xl', getStatusBorder(activeStatus), !isSelected && isHovered && 'border-foreground-muted', isSelected && 'border-brand', isSelected && isHovered && 'border-foreground-accent-muted', 'disabled' === interactionState && 'opacity-50 cursor-not-allowed', 'drag' === interactionState && 'cursor-grabbing opacity-80'), [
29
+ const className = useMemo(()=>cn('relative flex items-center cursor-pointer bg-surface-overlay border-2 border-border', 'w-(--node-w) h-(--node-h) [border-radius:var(--node-radius)]', 'rectangle' === shape ? 'flex-row justify-start gap-3 p-2' : 'flex-col justify-center', hasFooter && 'flex-wrap', getStatusBorder(activeStatus), !isSelected && isHovered && 'border-foreground-muted', isSelected && 'border-brand', isSelected && isHovered && 'border-foreground-accent-muted', 'disabled' === interactionState && 'opacity-50 cursor-not-allowed', 'drag' === interactionState && 'cursor-grabbing opacity-80'), [
35
30
  shape,
36
31
  hasFooter,
37
32
  activeStatus,
@@ -39,19 +34,6 @@ const BaseContainer = ({ isSelected, isHovered, shape, interactionState, executi
39
34
  isHovered,
40
35
  interactionState
41
36
  ]);
42
- const style = useMemo(()=>({
43
- width,
44
- height,
45
- background,
46
- borderRadius: 'circle' === shape || hasFooter ? void 0 : containerRadius
47
- }), [
48
- width,
49
- height,
50
- background,
51
- shape,
52
- hasFooter,
53
- containerRadius
54
- ]);
55
37
  return /*#__PURE__*/ jsx("div", {
56
38
  "data-testid": "base-container",
57
39
  "data-execution-status": executionStatus,
@@ -59,7 +41,9 @@ const BaseContainer = ({ isSelected, isHovered, shape, interactionState, executi
59
41
  "data-validation-status": validationStatus,
60
42
  "data-suggestion-type": suggestionType,
61
43
  className: className,
62
- style: style,
44
+ style: background ? {
45
+ background
46
+ } : void 0,
63
47
  "aria-busy": loading || void 0,
64
48
  children: children
65
49
  });
@@ -29,48 +29,19 @@ __webpack_require__.d(__webpack_exports__, {
29
29
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
30
30
  const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
31
31
  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
- const BaseInnerShape = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(({ shape, color, background, hasFooter, loading, containerWidth = external_constants_cjs_namespaceObject.DEFAULT_NODE_SIZE, containerHeight = external_constants_cjs_namespaceObject.DEFAULT_NODE_SIZE, children })=>{
35
- const effectiveContainerHeight = hasFooter ? external_constants_cjs_namespaceObject.DEFAULT_NODE_SIZE : containerHeight;
36
- const effectiveContainerWidth = hasFooter ? external_constants_cjs_namespaceObject.DEFAULT_NODE_SIZE : containerWidth;
37
- const basis = 'rectangle' === shape ? effectiveContainerHeight : Math.min(effectiveContainerWidth, effectiveContainerHeight);
38
- const innerSize = basis * external_constants_cjs_namespaceObject.NODE_INNER_SHAPE_RATIO;
39
- const iconSize = basis * external_constants_cjs_namespaceObject.NODE_INNER_ICON_RATIO;
40
- const innerRadius = basis * external_constants_cjs_namespaceObject.NODE_INNER_RADIUS_RATIO;
41
- const className = (0, external_react_namespaceObject.useMemo)(()=>(0, CssUtil_cjs_namespaceObject.cx)('flex items-center justify-center overflow-hidden bg-surface text-foreground', 'circle' === shape ? 'rounded-full' : '', hasFooter ? 'rounded-2xl' : '', '[&>svg]:w-(--canvas-icon-size) [&>svg]:h-(--canvas-icon-size)', '[&>img]:w-(--canvas-icon-size) [&>img]:h-(--canvas-icon-size) [&>img]:object-contain'), [
42
- shape,
43
- hasFooter
44
- ]);
45
- const style = (0, external_react_namespaceObject.useMemo)(()=>({
46
- width: innerSize,
47
- height: innerSize,
48
- borderRadius: 'circle' === shape || hasFooter ? void 0 : innerRadius,
32
+ const INNER_SHAPE_CLASS = "flex items-center justify-center overflow-hidden bg-surface text-foreground w-(--inner-size) h-(--inner-size) [border-radius:var(--inner-radius)] [&>svg]:w-(--icon-size) [&>svg]:h-(--icon-size) [&>img]:w-(--icon-size) [&>img]:h-(--icon-size) [&>img]:object-contain";
33
+ const SKELETON_CLASS = 'rounded-lg w-(--icon-size) h-(--icon-size)';
34
+ const BaseInnerShape = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(({ loading, color, background, children })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
35
+ className: INNER_SHAPE_CLASS,
36
+ style: color || background ? {
49
37
  color,
50
- background,
51
- '--canvas-icon-size': `${iconSize}px`
52
- }), [
53
- innerSize,
54
- innerRadius,
55
- shape,
56
- hasFooter,
57
- color,
58
- background,
59
- iconSize
60
- ]);
61
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
62
- className: className,
63
- style: style,
38
+ background
39
+ } : void 0,
64
40
  children: loading ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Skeleton, {
65
41
  "data-testid": "skeleton-icon",
66
- className: "rounded-lg",
67
- style: {
68
- width: iconSize,
69
- height: iconSize
70
- }
42
+ className: SKELETON_CLASS
71
43
  }) : children
72
- });
73
- });
44
+ }));
74
45
  exports.BaseInnerShape = __webpack_exports__.BaseInnerShape;
75
46
  for(var __rspack_i in __webpack_exports__)if (-1 === [
76
47
  "BaseInnerShape"
@@ -1,14 +1,9 @@
1
- import type { NodeShape } from '../../schema';
2
1
  interface BaseInnerShapeProps {
3
- shape?: NodeShape;
2
+ loading?: boolean;
4
3
  color?: string;
5
4
  background?: string;
6
- hasFooter?: boolean;
7
- loading?: boolean;
8
- containerWidth?: number;
9
- containerHeight?: number;
10
5
  children: React.ReactNode;
11
6
  }
12
- export declare const BaseInnerShape: import("react").MemoExoticComponent<({ shape, color, background, hasFooter, loading, containerWidth, containerHeight, children, }: BaseInnerShapeProps) => import("react/jsx-runtime").JSX.Element>;
7
+ export declare const BaseInnerShape: import("react").MemoExoticComponent<({ loading, color, background, children }: BaseInnerShapeProps) => import("react/jsx-runtime").JSX.Element>;
13
8
  export {};
14
9
  //# sourceMappingURL=BaseNodeInnerShape.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseNodeInnerShape.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseNode/BaseNodeInnerShape.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG9C,UAAU,mBAAmB;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AACD,eAAO,MAAM,cAAc,qIAUtB,mBAAmB,6CAuDvB,CAAC"}
1
+ {"version":3,"file":"BaseNodeInnerShape.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseNode/BaseNodeInnerShape.tsx"],"names":[],"mappings":"AAGA,UAAU,mBAAmB;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAeD,eAAO,MAAM,cAAc,iFACkB,mBAAmB,6CAQ/D,CAAC"}
@@ -1,46 +1,17 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { Skeleton } from "@uipath/apollo-wind";
3
- import { memo, useMemo } from "react";
4
- import { DEFAULT_NODE_SIZE, NODE_INNER_ICON_RATIO, NODE_INNER_RADIUS_RATIO, NODE_INNER_SHAPE_RATIO } from "../../constants.js";
5
- import { cx } from "../../utils/CssUtil.js";
6
- const BaseInnerShape = /*#__PURE__*/ memo(({ shape, color, background, hasFooter, loading, containerWidth = DEFAULT_NODE_SIZE, containerHeight = DEFAULT_NODE_SIZE, children })=>{
7
- const effectiveContainerHeight = hasFooter ? DEFAULT_NODE_SIZE : containerHeight;
8
- const effectiveContainerWidth = hasFooter ? DEFAULT_NODE_SIZE : containerWidth;
9
- const basis = 'rectangle' === shape ? effectiveContainerHeight : Math.min(effectiveContainerWidth, effectiveContainerHeight);
10
- const innerSize = basis * NODE_INNER_SHAPE_RATIO;
11
- const iconSize = basis * NODE_INNER_ICON_RATIO;
12
- const innerRadius = basis * NODE_INNER_RADIUS_RATIO;
13
- const className = useMemo(()=>cx('flex items-center justify-center overflow-hidden bg-surface text-foreground', 'circle' === shape ? 'rounded-full' : '', hasFooter ? 'rounded-2xl' : '', '[&>svg]:w-(--canvas-icon-size) [&>svg]:h-(--canvas-icon-size)', '[&>img]:w-(--canvas-icon-size) [&>img]:h-(--canvas-icon-size) [&>img]:object-contain'), [
14
- shape,
15
- hasFooter
16
- ]);
17
- const style = useMemo(()=>({
18
- width: innerSize,
19
- height: innerSize,
20
- borderRadius: 'circle' === shape || hasFooter ? void 0 : innerRadius,
3
+ import { memo } from "react";
4
+ const INNER_SHAPE_CLASS = "flex items-center justify-center overflow-hidden bg-surface text-foreground w-(--inner-size) h-(--inner-size) [border-radius:var(--inner-radius)] [&>svg]:w-(--icon-size) [&>svg]:h-(--icon-size) [&>img]:w-(--icon-size) [&>img]:h-(--icon-size) [&>img]:object-contain";
5
+ const SKELETON_CLASS = 'rounded-lg w-(--icon-size) h-(--icon-size)';
6
+ const BaseInnerShape = /*#__PURE__*/ memo(({ loading, color, background, children })=>/*#__PURE__*/ jsx("div", {
7
+ className: INNER_SHAPE_CLASS,
8
+ style: color || background ? {
21
9
  color,
22
- background,
23
- '--canvas-icon-size': `${iconSize}px`
24
- }), [
25
- innerSize,
26
- innerRadius,
27
- shape,
28
- hasFooter,
29
- color,
30
- background,
31
- iconSize
32
- ]);
33
- return /*#__PURE__*/ jsx("div", {
34
- className: className,
35
- style: style,
10
+ background
11
+ } : void 0,
36
12
  children: loading ? /*#__PURE__*/ jsx(Skeleton, {
37
13
  "data-testid": "skeleton-icon",
38
- className: "rounded-lg",
39
- style: {
40
- width: iconSize,
41
- height: iconSize
42
- }
14
+ className: SKELETON_CLASS
43
15
  }) : children
44
- });
45
- });
16
+ }));
46
17
  export { BaseInnerShape };
@@ -37,13 +37,8 @@ const MissingManifestNode = ({ type, isSelected, isHovered, interactionState })=
37
37
  isSelected: isSelected,
38
38
  isHovered: isHovered,
39
39
  interactionState: interactionState,
40
- width: external_constants_cjs_namespaceObject.DEFAULT_NODE_SIZE,
41
- height: external_constants_cjs_namespaceObject.DEFAULT_NODE_SIZE,
42
40
  children: [
43
41
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_BaseNodeInnerShape_cjs_namespaceObject.BaseInnerShape, {
44
- shape: "square",
45
- containerWidth: external_constants_cjs_namespaceObject.DEFAULT_NODE_SIZE,
46
- containerHeight: external_constants_cjs_namespaceObject.DEFAULT_NODE_SIZE,
47
42
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.CanvasIcon, {
48
43
  icon: "circle-alert",
49
44
  size: external_constants_cjs_namespaceObject.NODE_ERROR_ICON_SIZE,
@@ -1 +1 @@
1
- {"version":3,"file":"BaseNodeMissingManifest.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseNode/BaseNodeMissingManifest.tsx"],"names":[],"mappings":"AAMA,UAAU,wBAAwB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,mBAAmB,GAAI,oDAKjC,wBAAwB,4CAmB1B,CAAC"}
1
+ {"version":3,"file":"BaseNodeMissingManifest.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseNode/BaseNodeMissingManifest.tsx"],"names":[],"mappings":"AAMA,UAAU,wBAAwB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,mBAAmB,GAAI,oDAKjC,wBAAwB,4CAY1B,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { DEFAULT_NODE_SIZE, NODE_ERROR_ICON_SIZE } from "../../constants.js";
2
+ import { NODE_ERROR_ICON_SIZE } from "../../constants.js";
3
3
  import { CanvasIcon } from "../../utils/index.js";
4
4
  import { BaseContainer } from "./BaseNodeContainer.js";
5
5
  import { BaseInnerShape } from "./BaseNodeInnerShape.js";
@@ -9,13 +9,8 @@ const MissingManifestNode = ({ type, isSelected, isHovered, interactionState })=
9
9
  isSelected: isSelected,
10
10
  isHovered: isHovered,
11
11
  interactionState: interactionState,
12
- width: DEFAULT_NODE_SIZE,
13
- height: DEFAULT_NODE_SIZE,
14
12
  children: [
15
13
  /*#__PURE__*/ jsx(BaseInnerShape, {
16
- shape: "square",
17
- containerWidth: DEFAULT_NODE_SIZE,
18
- containerHeight: DEFAULT_NODE_SIZE,
19
14
  children: /*#__PURE__*/ jsx(CanvasIcon, {
20
15
  icon: "circle-alert",
21
16
  size: NODE_ERROR_ICON_SIZE,