@uipath/apollo-react 4.10.0 → 4.11.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.
Files changed (62) hide show
  1. package/dist/canvas/components/AddNodePanel/AddNodePreview.cjs +12 -2
  2. package/dist/canvas/components/AddNodePanel/AddNodePreview.d.ts.map +1 -1
  3. package/dist/canvas/components/AddNodePanel/AddNodePreview.js +13 -3
  4. package/dist/canvas/components/BaseCanvas/CanvasThemeContext.cjs +4 -2
  5. package/dist/canvas/components/BaseCanvas/CanvasThemeContext.d.ts.map +1 -1
  6. package/dist/canvas/components/BaseCanvas/CanvasThemeContext.js +4 -2
  7. package/dist/canvas/components/BaseNode/BaseNode.cjs +7 -7
  8. package/dist/canvas/components/BaseNode/BaseNode.js +7 -7
  9. package/dist/canvas/components/BaseNode/BaseNodeContainer.cjs +1 -1
  10. package/dist/canvas/components/BaseNode/BaseNodeContainer.js +1 -1
  11. package/dist/canvas/components/ButtonHandle/CanvasInlineButton.cjs +56 -0
  12. package/dist/canvas/components/ButtonHandle/CanvasInlineButton.d.ts +8 -0
  13. package/dist/canvas/components/ButtonHandle/CanvasInlineButton.d.ts.map +1 -0
  14. package/dist/canvas/components/ButtonHandle/CanvasInlineButton.js +22 -0
  15. package/dist/canvas/components/ButtonHandle/HandleButton.cjs +3 -11
  16. package/dist/canvas/components/ButtonHandle/HandleButton.d.ts.map +1 -1
  17. package/dist/canvas/components/ButtonHandle/HandleButton.js +3 -11
  18. package/dist/canvas/components/FloatingCanvasPanel/FloatingCanvasPanel.cjs +16 -38
  19. package/dist/canvas/components/FloatingCanvasPanel/FloatingCanvasPanel.d.ts.map +1 -1
  20. package/dist/canvas/components/FloatingCanvasPanel/FloatingCanvasPanel.js +16 -28
  21. package/dist/canvas/components/FloatingCanvasPanel/PanelChrome.cjs +1 -1
  22. package/dist/canvas/components/FloatingCanvasPanel/PanelChrome.js +1 -1
  23. package/dist/canvas/components/Toolbar/EdgeToolbar/EdgeToolbar.cjs +13 -17
  24. package/dist/canvas/components/Toolbar/EdgeToolbar/EdgeToolbar.d.ts.map +1 -1
  25. package/dist/canvas/components/Toolbar/EdgeToolbar/EdgeToolbar.js +14 -18
  26. package/dist/canvas/components/Toolbar/EdgeToolbar/EdgeToolbar.types.d.ts +1 -1
  27. package/dist/canvas/components/Toolbar/EdgeToolbar/EdgeToolbar.types.d.ts.map +1 -1
  28. package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.cjs +149 -106
  29. package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.d.ts.map +1 -1
  30. package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.js +151 -108
  31. package/dist/canvas/components/Toolbar/NodeToolbar/useToolbarState.cjs +1 -1
  32. package/dist/canvas/components/Toolbar/NodeToolbar/useToolbarState.d.ts.map +1 -1
  33. package/dist/canvas/components/Toolbar/NodeToolbar/useToolbarState.js +1 -1
  34. package/dist/canvas/components/Toolbar/shared/ToolbarButton.cjs +7 -7
  35. package/dist/canvas/components/Toolbar/shared/ToolbarButton.js +7 -7
  36. package/dist/canvas/components/Toolbar/shared/ToolbarIconButton.cjs +64 -0
  37. package/dist/canvas/components/Toolbar/shared/ToolbarIconButton.d.ts +8 -0
  38. package/dist/canvas/components/Toolbar/shared/ToolbarIconButton.d.ts.map +1 -0
  39. package/dist/canvas/components/Toolbar/shared/ToolbarIconButton.js +30 -0
  40. package/dist/canvas/components/Toolbar/shared/index.cjs +4 -4
  41. package/dist/canvas/components/Toolbar/shared/index.d.ts +1 -1
  42. package/dist/canvas/components/Toolbar/shared/index.d.ts.map +1 -1
  43. package/dist/canvas/components/Toolbar/shared/index.js +1 -1
  44. package/dist/canvas/constants.cjs +1 -1
  45. package/dist/canvas/constants.d.ts +1 -1
  46. package/dist/canvas/constants.js +1 -1
  47. package/dist/canvas/storybook-utils/decorators.d.ts.map +1 -1
  48. package/dist/canvas/styles/tailwind.canvas.css +1 -1
  49. package/dist/canvas/styles/variables.css +16 -0
  50. package/package.json +1 -1
  51. package/dist/canvas/components/Toolbar/EdgeToolbar/EdgeToolbar.styles.cjs +0 -70
  52. package/dist/canvas/components/Toolbar/EdgeToolbar/EdgeToolbar.styles.d.ts +0 -8
  53. package/dist/canvas/components/Toolbar/EdgeToolbar/EdgeToolbar.styles.d.ts.map +0 -1
  54. package/dist/canvas/components/Toolbar/EdgeToolbar/EdgeToolbar.styles.js +0 -23
  55. package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.styles.cjs +0 -236
  56. package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.styles.d.ts +0 -26
  57. package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.styles.d.ts.map +0 -1
  58. package/dist/canvas/components/Toolbar/NodeToolbar/NodeToolbar.styles.js +0 -180
  59. package/dist/canvas/components/Toolbar/shared/ToolbarButton.styles.cjs +0 -78
  60. package/dist/canvas/components/Toolbar/shared/ToolbarButton.styles.d.ts +0 -9
  61. package/dist/canvas/components/Toolbar/shared/ToolbarButton.styles.d.ts.map +0 -1
  62. package/dist/canvas/components/Toolbar/shared/ToolbarButton.styles.js +0 -34
@@ -28,12 +28,16 @@ __webpack_require__.d(__webpack_exports__, {
28
28
  });
29
29
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
30
30
  const react_cjs_namespaceObject = require("../../xyflow/react.cjs");
31
+ const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
31
32
  const external_react_namespaceObject = require("react");
32
33
  const external_constants_cjs_namespaceObject = require("../../constants.cjs");
33
34
  const icon_registry_cjs_namespaceObject = require("../../utils/icon-registry.cjs");
34
35
  const BaseNodeInnerShape_cjs_namespaceObject = require("../BaseNode/BaseNodeInnerShape.cjs");
35
- const AddNodePreview = ({ selected, data, width, height })=>{
36
+ const AddNodePreview = ({ selected, data, width, height, dragging })=>{
36
37
  const nodeData = data;
38
+ const [isHovered, setIsHovered] = (0, external_react_namespaceObject.useState)(false);
39
+ const handlePointerEnter = (0, external_react_namespaceObject.useCallback)(()=>setIsHovered(true), []);
40
+ const handlePointerLeave = (0, external_react_namespaceObject.useCallback)(()=>setIsHovered(false), []);
37
41
  const icon = (0, external_react_namespaceObject.useMemo)(()=>{
38
42
  const IconComponent = (0, icon_registry_cjs_namespaceObject.getIcon)(nodeData?.iconName ?? 'square-dashed');
39
43
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(IconComponent, {});
@@ -44,6 +48,10 @@ const AddNodePreview = ({ selected, data, width, height })=>{
44
48
  const outputPosition = nodeData?.outputHandlePosition ?? react_cjs_namespaceObject.Position.Right;
45
49
  const containerWidth = width ?? external_constants_cjs_namespaceObject.DEFAULT_NODE_SIZE;
46
50
  const containerHeight = height ?? external_constants_cjs_namespaceObject.DEFAULT_NODE_SIZE;
51
+ const containerClassName = (0, external_react_namespaceObject.useMemo)(()=>(0, apollo_wind_namespaceObject.cn)('relative flex flex-col items-center justify-center bg-surface-overlay', 'w-(--node-w) h-(--node-h) rounded-(--node-radius)', 'border border-dashed', 'shadow-(--canvas-node-shadow-rest) transition-[box-shadow,border-color] duration-150', isHovered && 'shadow-(--canvas-node-shadow-hover)', dragging && 'shadow-(--canvas-node-shadow-lifted) cursor-grabbing'), [
52
+ isHovered,
53
+ dragging
54
+ ]);
47
55
  const containerStyle = (0, external_react_namespaceObject.useMemo)(()=>{
48
56
  const basis = Math.min(containerWidth, containerHeight);
49
57
  const gap = basis * (1 - external_constants_cjs_namespaceObject.NODE_INNER_SHAPE_RATIO);
@@ -69,8 +77,10 @@ const AddNodePreview = ({ selected, data, width, height })=>{
69
77
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
70
78
  children: [
71
79
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
72
- className: " relative flex flex-col items-center justify-center bg-surface-overlay w-(--node-w) h-(--node-h) rounded-(--node-radius) border border-dashed ",
80
+ className: containerClassName,
73
81
  style: containerStyle,
82
+ onPointerEnter: handlePointerEnter,
83
+ onPointerLeave: handlePointerLeave,
74
84
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(BaseNodeInnerShape_cjs_namespaceObject.BaseInnerShape, {
75
85
  children: icon
76
86
  })
@@ -1 +1 @@
1
- {"version":3,"file":"AddNodePreview.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/AddNodePanel/AddNodePreview.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AAC1E,OAAO,EAAU,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAa/B,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mBAAmB,CAAC,EAAE,QAAQ,CAAC;IAC/B,oBAAoB,CAAC,EAAE,QAAQ,CAAC;CACjC;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAwE9C,CAAC"}
1
+ {"version":3,"file":"AddNodePreview.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/AddNodePanel/AddNodePreview.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AAC1E,OAAO,EAAU,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AAE5E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAa/B,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mBAAmB,CAAC,EAAE,QAAQ,CAAC;IAC/B,oBAAoB,CAAC,EAAE,QAAQ,CAAC;CACjC;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CA4F9C,CAAC"}
@@ -1,11 +1,15 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Handle, Position } from "../../xyflow/react.js";
3
- import { useMemo } from "react";
3
+ import { cn } from "@uipath/apollo-wind";
4
+ import { useCallback, useMemo, useState } from "react";
4
5
  import { DEFAULT_NODE_SIZE, NODE_CONTAINER_RADIUS_RATIO, NODE_INNER_ICON_RATIO, NODE_INNER_RADIUS_RATIO, NODE_INNER_SHAPE_RATIO } from "../../constants.js";
5
6
  import { getIcon } from "../../utils/icon-registry.js";
6
7
  import { BaseInnerShape } from "../BaseNode/BaseNodeInnerShape.js";
7
- const AddNodePreview = ({ selected, data, width, height })=>{
8
+ const AddNodePreview = ({ selected, data, width, height, dragging })=>{
8
9
  const nodeData = data;
10
+ const [isHovered, setIsHovered] = useState(false);
11
+ const handlePointerEnter = useCallback(()=>setIsHovered(true), []);
12
+ const handlePointerLeave = useCallback(()=>setIsHovered(false), []);
9
13
  const icon = useMemo(()=>{
10
14
  const IconComponent = getIcon(nodeData?.iconName ?? 'square-dashed');
11
15
  return /*#__PURE__*/ jsx(IconComponent, {});
@@ -16,6 +20,10 @@ const AddNodePreview = ({ selected, data, width, height })=>{
16
20
  const outputPosition = nodeData?.outputHandlePosition ?? Position.Right;
17
21
  const containerWidth = width ?? DEFAULT_NODE_SIZE;
18
22
  const containerHeight = height ?? DEFAULT_NODE_SIZE;
23
+ const containerClassName = useMemo(()=>cn('relative flex flex-col items-center justify-center bg-surface-overlay', 'w-(--node-w) h-(--node-h) rounded-(--node-radius)', 'border border-dashed', 'shadow-(--canvas-node-shadow-rest) transition-[box-shadow,border-color] duration-150', isHovered && 'shadow-(--canvas-node-shadow-hover)', dragging && 'shadow-(--canvas-node-shadow-lifted) cursor-grabbing'), [
24
+ isHovered,
25
+ dragging
26
+ ]);
19
27
  const containerStyle = useMemo(()=>{
20
28
  const basis = Math.min(containerWidth, containerHeight);
21
29
  const gap = basis * (1 - NODE_INNER_SHAPE_RATIO);
@@ -41,8 +49,10 @@ const AddNodePreview = ({ selected, data, width, height })=>{
41
49
  return /*#__PURE__*/ jsxs(Fragment, {
42
50
  children: [
43
51
  /*#__PURE__*/ jsx("div", {
44
- className: " relative flex flex-col items-center justify-center bg-surface-overlay w-(--node-w) h-(--node-h) rounded-(--node-radius) border border-dashed ",
52
+ className: containerClassName,
45
53
  style: containerStyle,
54
+ onPointerEnter: handlePointerEnter,
55
+ onPointerLeave: handlePointerLeave,
46
56
  children: /*#__PURE__*/ jsx(BaseInnerShape, {
47
57
  children: icon
48
58
  })
@@ -34,10 +34,12 @@ const defaultValue = {
34
34
  isDarkMode: false
35
35
  };
36
36
  const CanvasThemeProvider = ({ children, isDarkMode })=>{
37
+ const parent = (0, external_react_namespaceObject.useContext)(CanvasThemeContext);
38
+ const resolved = isDarkMode ?? parent?.isDarkMode;
37
39
  const value = (0, external_react_namespaceObject.useMemo)(()=>({
38
- isDarkMode
40
+ isDarkMode: resolved
39
41
  }), [
40
- isDarkMode
42
+ resolved
41
43
  ]);
42
44
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(CanvasThemeContext.Provider, {
43
45
  value: value,
@@ -1 +1 @@
1
- {"version":3,"file":"CanvasThemeContext.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseCanvas/CanvasThemeContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,UAAU,uBAAuB;IAC/B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAMD,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAM3F,CAAC;AAMF,wBAAgB,cAAc,IAAI,uBAAuB,CAExD"}
1
+ {"version":3,"file":"CanvasThemeContext.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseCanvas/CanvasThemeContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,UAAU,uBAAuB;IAC/B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAMD,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAQ3F,CAAC;AAMF,wBAAgB,cAAc,IAAI,uBAAuB,CAExD"}
@@ -5,10 +5,12 @@ const defaultValue = {
5
5
  isDarkMode: false
6
6
  };
7
7
  const CanvasThemeProvider = ({ children, isDarkMode })=>{
8
+ const parent = useContext(CanvasThemeContext);
9
+ const resolved = isDarkMode ?? parent?.isDarkMode;
8
10
  const value = useMemo(()=>({
9
- isDarkMode
11
+ isDarkMode: resolved
10
12
  }), [
11
- isDarkMode
13
+ resolved
12
14
  ]);
13
15
  return /*#__PURE__*/ jsx(CanvasThemeContext.Provider, {
14
16
  value: value,
@@ -452,16 +452,16 @@ const BaseNodeComponent = (props)=>{
452
452
  displayFooter && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
453
453
  className: "basis-full pt-0.5 min-w-0 overflow-hidden",
454
454
  children: displayFooter
455
+ }),
456
+ toolbarConfig && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_Toolbar_index_cjs_namespaceObject.NodeToolbar, {
457
+ nodeId: id,
458
+ config: toolbarConfig,
459
+ expanded: selected,
460
+ hidden: dragging || multipleNodesSelected
455
461
  })
456
462
  ]
457
463
  }),
458
- handleElements,
459
- toolbarConfig && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_Toolbar_index_cjs_namespaceObject.NodeToolbar, {
460
- nodeId: id,
461
- config: toolbarConfig,
462
- expanded: selected,
463
- hidden: dragging || multipleNodesSelected
464
- })
464
+ handleElements
465
465
  ]
466
466
  });
467
467
  if (useSmartHandles) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(SmartHandle_cjs_namespaceObject.SmartHandleProvider, {
@@ -424,16 +424,16 @@ const BaseNodeComponent = (props)=>{
424
424
  displayFooter && /*#__PURE__*/ jsx("div", {
425
425
  className: "basis-full pt-0.5 min-w-0 overflow-hidden",
426
426
  children: displayFooter
427
+ }),
428
+ toolbarConfig && /*#__PURE__*/ jsx(NodeToolbar, {
429
+ nodeId: id,
430
+ config: toolbarConfig,
431
+ expanded: selected,
432
+ hidden: dragging || multipleNodesSelected
427
433
  })
428
434
  ]
429
435
  }),
430
- handleElements,
431
- toolbarConfig && /*#__PURE__*/ jsx(NodeToolbar, {
432
- nodeId: id,
433
- config: toolbarConfig,
434
- expanded: selected,
435
- hidden: dragging || multipleNodesSelected
436
- })
436
+ handleElements
437
437
  ]
438
438
  });
439
439
  if (useSmartHandles) return /*#__PURE__*/ jsx(SmartHandleProvider, {
@@ -55,7 +55,7 @@ const getStatusBorder = (status)=>{
55
55
  };
56
56
  const BaseContainer = ({ isSelected, isHovered, shape, interactionState, executionStatus, validationStatus, suggestionType, hasFooter, background, loading, children })=>{
57
57
  const activeStatus = suggestionType ?? validationStatus ?? executionStatus;
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) rounded-(--node-radius)', 'rectangle' === shape ? 'flex-row justify-start gap-3 p-(--node-gap)' : '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'), [
58
+ const className = (0, external_react_namespaceObject.useMemo)(()=>(0, apollo_wind_namespaceObject.cn)('relative flex items-center cursor-pointer bg-surface-overlay border border-border', 'w-(--node-w) h-(--node-h) rounded-(--node-radius)', 'shadow-(--canvas-node-shadow-rest) outline-offset-0 transition-[box-shadow,border-color] duration-150', 'rectangle' === shape ? 'flex-row justify-start gap-3 p-(--node-gap)' : 'flex-col justify-center', hasFooter && 'flex-wrap', getStatusBorder(activeStatus), isHovered && 'shadow-(--canvas-node-shadow-hover) border-border-hover', isSelected && 'outline outline-2 outline-foreground-accent-muted', 'disabled' === interactionState && 'opacity-50 cursor-not-allowed', 'drag' === interactionState && 'cursor-grabbing shadow-(--canvas-node-shadow-lifted)'), [
59
59
  shape,
60
60
  hasFooter,
61
61
  activeStatus,
@@ -26,7 +26,7 @@ const getStatusBorder = (status)=>{
26
26
  };
27
27
  const BaseContainer = ({ isSelected, isHovered, shape, interactionState, executionStatus, validationStatus, suggestionType, hasFooter, background, loading, children })=>{
28
28
  const activeStatus = suggestionType ?? validationStatus ?? executionStatus;
29
- const className = useMemo(()=>cn('relative flex items-center cursor-pointer bg-surface-overlay border-2 border-border', 'w-(--node-w) h-(--node-h) rounded-(--node-radius)', 'rectangle' === shape ? 'flex-row justify-start gap-3 p-(--node-gap)' : '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'), [
29
+ const className = useMemo(()=>cn('relative flex items-center cursor-pointer bg-surface-overlay border border-border', 'w-(--node-w) h-(--node-h) rounded-(--node-radius)', 'shadow-(--canvas-node-shadow-rest) outline-offset-0 transition-[box-shadow,border-color] duration-150', 'rectangle' === shape ? 'flex-row justify-start gap-3 p-(--node-gap)' : 'flex-col justify-center', hasFooter && 'flex-wrap', getStatusBorder(activeStatus), isHovered && 'shadow-(--canvas-node-shadow-hover) border-border-hover', isSelected && 'outline outline-2 outline-foreground-accent-muted', 'disabled' === interactionState && 'opacity-50 cursor-not-allowed', 'drag' === interactionState && 'cursor-grabbing shadow-(--canvas-node-shadow-lifted)'), [
30
30
  shape,
31
31
  hasFooter,
32
32
  activeStatus,
@@ -0,0 +1,56 @@
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
+ CanvasInlineButton: ()=>CanvasInlineButton
28
+ });
29
+ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
30
+ const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
31
+ const external_react_namespaceObject = require("react");
32
+ const icon_registry_cjs_namespaceObject = require("../../utils/icon-registry.cjs");
33
+ const CANVAS_INLINE_BUTTON_CLASS = "grid place-items-center w-7 h-7 rounded-[10px] border border-(--canvas-border) bg-(--canvas-background-raised) text-(--canvas-foreground) enabled:hover:bg-(--canvas-background-overlay) enabled:hover:border-(--canvas-primary-hover) enabled:hover:text-(--canvas-foreground) [transition:opacity_120ms_ease,color_120ms_ease,background-color_120ms_ease,border-color_120ms_ease]";
34
+ const CanvasInlineButton = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)(({ icon = 'plus', iconSize = 14, className, ...rest }, ref)=>{
35
+ const iconNode = 'string' == typeof icon ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icon_registry_cjs_namespaceObject.CanvasIcon, {
36
+ icon: icon,
37
+ size: iconSize
38
+ }) : /*#__PURE__*/ (0, external_react_namespaceObject.isValidElement)(icon) ? icon : null;
39
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Button, {
40
+ ref: ref,
41
+ variant: "outline",
42
+ size: "3xs",
43
+ icon: true,
44
+ className: (0, apollo_wind_namespaceObject.cn)(CANVAS_INLINE_BUTTON_CLASS, className),
45
+ ...rest,
46
+ children: iconNode
47
+ });
48
+ });
49
+ CanvasInlineButton.displayName = 'CanvasInlineButton';
50
+ exports.CanvasInlineButton = __webpack_exports__.CanvasInlineButton;
51
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
52
+ "CanvasInlineButton"
53
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
54
+ Object.defineProperty(exports, '__esModule', {
55
+ value: true
56
+ });
@@ -0,0 +1,8 @@
1
+ import { Button } from '@uipath/apollo-wind';
2
+ import { type ComponentPropsWithoutRef, type ReactNode } from 'react';
3
+ export interface CanvasInlineButtonProps extends Omit<ComponentPropsWithoutRef<typeof Button>, 'variant' | 'size' | 'icon' | 'children'> {
4
+ icon?: ReactNode;
5
+ iconSize?: number;
6
+ }
7
+ export declare const CanvasInlineButton: import("react").ForwardRefExoticComponent<CanvasInlineButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
8
+ //# sourceMappingURL=CanvasInlineButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CanvasInlineButton.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/ButtonHandle/CanvasInlineButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAM,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,KAAK,wBAAwB,EAA8B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAOlG,MAAM,WAAW,uBACf,SAAQ,IAAI,CAAC,wBAAwB,CAAC,OAAO,MAAM,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,CAAC;IAK/F,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAQD,eAAO,MAAM,kBAAkB,uHAsB9B,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Button, cn } from "@uipath/apollo-wind";
3
+ import { forwardRef, isValidElement } from "react";
4
+ import { CanvasIcon } from "../../utils/icon-registry.js";
5
+ const CANVAS_INLINE_BUTTON_CLASS = "grid place-items-center w-7 h-7 rounded-[10px] border border-(--canvas-border) bg-(--canvas-background-raised) text-(--canvas-foreground) enabled:hover:bg-(--canvas-background-overlay) enabled:hover:border-(--canvas-primary-hover) enabled:hover:text-(--canvas-foreground) [transition:opacity_120ms_ease,color_120ms_ease,background-color_120ms_ease,border-color_120ms_ease]";
6
+ const CanvasInlineButton = /*#__PURE__*/ forwardRef(({ icon = 'plus', iconSize = 14, className, ...rest }, ref)=>{
7
+ const iconNode = 'string' == typeof icon ? /*#__PURE__*/ jsx(CanvasIcon, {
8
+ icon: icon,
9
+ size: iconSize
10
+ }) : /*#__PURE__*/ isValidElement(icon) ? icon : null;
11
+ return /*#__PURE__*/ jsx(Button, {
12
+ ref: ref,
13
+ variant: "outline",
14
+ size: "3xs",
15
+ icon: true,
16
+ className: cn(CANVAS_INLINE_BUTTON_CLASS, className),
17
+ ...rest,
18
+ children: iconNode
19
+ });
20
+ });
21
+ CanvasInlineButton.displayName = 'CanvasInlineButton';
22
+ export { CanvasInlineButton };
@@ -30,10 +30,9 @@ __webpack_require__.d(__webpack_exports__, {
30
30
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
31
31
  const index_cjs_namespaceObject = require("../../layouts/index.cjs");
32
32
  const react_cjs_namespaceObject = require("../../xyflow/react.cjs");
33
- const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
34
33
  const external_react_namespaceObject = require("react");
35
34
  const CssUtil_cjs_namespaceObject = require("../../utils/CssUtil.cjs");
36
- const icon_registry_cjs_namespaceObject = require("../../utils/icon-registry.cjs");
35
+ const external_CanvasInlineButton_cjs_namespaceObject = require("./CanvasInlineButton.cjs");
37
36
  const BUTTON_POSITION = {
38
37
  [react_cjs_namespaceObject.Position.Top]: 'flex-col-reverse bottom-full left-1/2 -translate-x-1/2',
39
38
  [react_cjs_namespaceObject.Position.Bottom]: 'flex-col top-full left-1/2 -translate-x-1/2',
@@ -88,18 +87,11 @@ const HandleButton = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(({ v
88
87
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
89
88
  className: (0, CssUtil_cjs_namespaceObject.cx)('absolute flex items-center gap-1 pointer-events-none', BUTTON_POSITION[position]),
90
89
  children: [
91
- visible && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Button, {
90
+ visible && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CanvasInlineButton_cjs_namespaceObject.CanvasInlineButton, {
92
91
  "aria-label": "Add node",
93
- variant: "outline",
94
- size: "3xs",
95
- icon: true,
96
92
  onClick: handleClick,
97
93
  onPointerDown: handlePointerDown,
98
- className: "nodrag nopan pointer-events-auto rounded-[10px] animate-fade-in w-7 h-7",
99
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icon_registry_cjs_namespaceObject.CanvasIcon, {
100
- icon: "plus",
101
- size: 14
102
- })
94
+ className: "nodrag nopan pointer-events-auto animate-fade-in"
103
95
  }),
104
96
  label && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(InlineLabel, {
105
97
  label: label,
@@ -1 +1 @@
1
- {"version":3,"file":"HandleButton.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/ButtonHandle/HandleButton.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AAqBpE,eAAO,MAAM,YAAY,0IAUpB;IACD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,QAAQ,CAAC;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAC5C,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IACnD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,6CA+FF,CAAC;AAqCF,eAAO,MAAM,iBAAiB,8DACJ;IAAE,QAAQ,EAAE,QAAQ,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,oDAOlE,CAAC"}
1
+ {"version":3,"file":"HandleButton.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/ButtonHandle/HandleButton.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AAoBpE,eAAO,MAAM,YAAY,0IAUpB;IACD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,QAAQ,CAAC;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAC5C,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IACnD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,6CA0FF,CAAC;AAqCF,eAAO,MAAM,iBAAiB,8DACJ;IAAE,QAAQ,EAAE,QAAQ,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,oDAOlE,CAAC"}
@@ -1,10 +1,9 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Row } from "../../layouts/index.js";
3
3
  import { Position } from "../../xyflow/react.js";
4
- import { Button } from "@uipath/apollo-wind";
5
4
  import { memo, useCallback, useEffect, useRef } from "react";
6
5
  import { cx } from "../../utils/CssUtil.js";
7
- import { CanvasIcon } from "../../utils/icon-registry.js";
6
+ import { CanvasInlineButton } from "./CanvasInlineButton.js";
8
7
  const BUTTON_POSITION = {
9
8
  [Position.Top]: 'flex-col-reverse bottom-full left-1/2 -translate-x-1/2',
10
9
  [Position.Bottom]: 'flex-col top-full left-1/2 -translate-x-1/2',
@@ -59,18 +58,11 @@ const HandleButton = /*#__PURE__*/ memo(({ visible, labelVisible, position, onAc
59
58
  return /*#__PURE__*/ jsxs("div", {
60
59
  className: cx('absolute flex items-center gap-1 pointer-events-none', BUTTON_POSITION[position]),
61
60
  children: [
62
- visible && /*#__PURE__*/ jsx(Button, {
61
+ visible && /*#__PURE__*/ jsx(CanvasInlineButton, {
63
62
  "aria-label": "Add node",
64
- variant: "outline",
65
- size: "3xs",
66
- icon: true,
67
63
  onClick: handleClick,
68
64
  onPointerDown: handlePointerDown,
69
- className: "nodrag nopan pointer-events-auto rounded-[10px] animate-fade-in w-7 h-7",
70
- children: /*#__PURE__*/ jsx(CanvasIcon, {
71
- icon: "plus",
72
- size: 14
73
- })
65
+ className: "nodrag nopan pointer-events-auto animate-fade-in"
74
66
  }),
75
67
  label && /*#__PURE__*/ jsx(InlineLabel, {
76
68
  label: label,
@@ -1,14 +1,5 @@
1
1
  "use strict";
2
2
  var __webpack_require__ = {};
3
- (()=>{
4
- __webpack_require__.n = (module)=>{
5
- var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
6
- __webpack_require__.d(getter, {
7
- a: getter
8
- });
9
- return getter;
10
- };
11
- })();
12
3
  (()=>{
13
4
  __webpack_require__.d = (exports1, definition)=>{
14
5
  for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
@@ -36,30 +27,16 @@ __webpack_require__.d(__webpack_exports__, {
36
27
  FloatingCanvasPanel: ()=>FloatingCanvasPanel
37
28
  });
38
29
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
39
- const styled_namespaceObject = require("@emotion/styled");
40
- var styled_default = /*#__PURE__*/ __webpack_require__.n(styled_namespaceObject);
41
30
  const react_cjs_namespaceObject = require("../../xyflow/react.cjs");
31
+ const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
32
+ const external_react_namespaceObject = require("react");
42
33
  const external_react_dom_namespaceObject = require("react-dom");
43
34
  const external_CanvasPortal_cjs_namespaceObject = require("./CanvasPortal.cjs");
44
35
  const external_PanelChrome_cjs_namespaceObject = require("./PanelChrome.cjs");
45
36
  const external_useFloatingPosition_cjs_namespaceObject = require("./useFloatingPosition.cjs");
46
- const PanelContainer = styled_default().div`
47
- color: var(--canvas-foreground);
48
- background-color: var(--canvas-background);
49
- border: 1px solid var(--canvas-border-de-emp);
50
- border-radius: ${(props)=>props.isPinned ? '0' : '8px'};
51
- box-shadow: ${(props)=>props.isPinned ? 'none' : '0 4px 16px rgba(0, 0, 0, 0.12)'};
52
- font-size: 14px;
53
- min-width: ${(props)=>props.isPinned ? '320px' : '280px'};
54
- max-width: ${(props)=>props.isPinned ? '320px' : 'none'};
55
- width: ${(props)=>props.isPinned ? '320px' : 'auto'};
56
- height: ${(props)=>props.isPinned ? '100vh' : 'auto'};
57
- max-height: ${(props)=>props.isPinned ? '100vh' : '600px'};
58
- display: flex;
59
- flex-direction: column;
60
- transition: opacity 0.2s ease-in-out;
61
- border-left: ${(props)=>props.isPinned ? '1px solid var(--canvas-border-de-emp)' : 'none'};
62
- `;
37
+ const PANEL_BASE_CLASS = 'text-(--canvas-foreground) bg-(--canvas-background-raised) border border-(--canvas-border-de-emp) text-sm flex flex-col transition-opacity duration-200 ease-in-out';
38
+ const PANEL_FLOATING_CLASS = 'rounded-lg shadow-[0_4px_16px_rgba(0,0,0,0.12)] w-auto min-w-[280px] max-w-none h-auto max-h-[600px]';
39
+ const PANEL_PINNED_CLASS = 'rounded-none shadow-none w-[320px] min-w-[320px] max-w-[320px] h-screen max-h-screen';
63
40
  function FloatingCanvasPanel({ open = true, nodeId, anchorRect, placement = 'right-start', offset = 20, fallbackPlacement, isPinned = false, useFixedPosition = false, portalToBody = false, title, header, headerActions, children, onClose, scrollKey, onMouseEnter, onMouseLeave }) {
64
41
  const { computedAnchor, floatingStyles, refs, mergedReferenceRef } = (0, external_useFloatingPosition_cjs_namespaceObject.useFloatingPosition)({
65
42
  open,
@@ -69,6 +46,9 @@ function FloatingCanvasPanel({ open = true, nodeId, anchorRect, placement = 'rig
69
46
  offset,
70
47
  fallbackPlacement
71
48
  });
49
+ const panelClassName = (0, external_react_namespaceObject.useMemo)(()=>(0, apollo_wind_namespaceObject.cn)(PANEL_BASE_CLASS, isPinned ? PANEL_PINNED_CLASS : PANEL_FLOATING_CLASS), [
50
+ isPinned
51
+ ]);
72
52
  if (!open || !computedAnchor) return null;
73
53
  if (useFixedPosition && anchorRect) {
74
54
  const getScreenSpacePosition = ()=>{
@@ -113,11 +93,10 @@ function FloatingCanvasPanel({ open = true, nodeId, anchorRect, placement = 'rig
113
93
  }
114
94
  };
115
95
  const screenPosition = getScreenSpacePosition();
116
- const fixedContent = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(PanelContainer, {
117
- className: "nodrag nopan nowheel",
118
- isPinned: isPinned,
119
- onMouseEnter: onMouseEnter,
120
- onMouseLeave: onMouseLeave,
96
+ const fixedContent = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
97
+ className: (0, apollo_wind_namespaceObject.cn)('nodrag nopan nowheel', panelClassName),
98
+ onPointerEnter: onMouseEnter,
99
+ onPointerLeave: onMouseLeave,
121
100
  style: {
122
101
  position: 'fixed',
123
102
  ...screenPosition,
@@ -137,12 +116,11 @@ function FloatingCanvasPanel({ open = true, nodeId, anchorRect, placement = 'rig
137
116
  children: fixedContent
138
117
  });
139
118
  }
140
- const panelContent = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(PanelContainer, {
119
+ const panelContent = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
141
120
  ref: refs.setFloating,
142
- className: "nodrag nopan nowheel",
143
- isPinned: isPinned,
144
- onMouseEnter: onMouseEnter,
145
- onMouseLeave: onMouseLeave,
121
+ className: (0, apollo_wind_namespaceObject.cn)('nodrag nopan nowheel', panelClassName),
122
+ onPointerEnter: onMouseEnter,
123
+ onPointerLeave: onMouseLeave,
146
124
  style: {
147
125
  ...isPinned ? {} : floatingStyles,
148
126
  position: isPinned ? 'fixed' : 'absolute',
@@ -1 +1 @@
1
- {"version":3,"file":"FloatingCanvasPanel.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/FloatingCanvasPanel/FloatingCanvasPanel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,OAAO,EAAE,KAAK,UAAU,EAAuB,MAAM,uBAAuB,CAAC;AAoB7E,MAAM,MAAM,wBAAwB,GAAG;IAErC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAShB,iBAAiB,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAC;IAOnB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAM3B,YAAY,CAAC,EAAE,OAAO,CAAC;IAGvB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IAGnB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,EAClC,IAAW,EACX,MAAM,EACN,UAAU,EACV,SAAyB,EACzB,MAAW,EACX,iBAAiB,EACjB,QAAgB,EAChB,gBAAwB,EACxB,YAAoB,EACpB,KAAK,EACL,MAAM,EACN,aAAa,EACb,QAAQ,EACR,OAAO,EACP,SAAS,EACT,YAAY,EACZ,YAAY,GACb,EAAE,wBAAwB,kDA6I1B"}
1
+ {"version":3,"file":"FloatingCanvasPanel.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/FloatingCanvasPanel/FloatingCanvasPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC,OAAO,EAAE,KAAK,UAAU,EAAuB,MAAM,uBAAuB,CAAC;AAW7E,MAAM,MAAM,wBAAwB,GAAG;IAErC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAShB,iBAAiB,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAC;IAOnB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAM3B,YAAY,CAAC,EAAE,OAAO,CAAC;IAGvB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IAGnB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,EAClC,IAAW,EACX,MAAM,EACN,UAAU,EACV,SAAyB,EACzB,MAAW,EACX,iBAAiB,EACjB,QAAgB,EAChB,gBAAwB,EACxB,YAAoB,EACpB,KAAK,EACL,MAAM,EACN,aAAa,EACb,QAAQ,EACR,OAAO,EACP,SAAS,EACT,YAAY,EACZ,YAAY,GACb,EAAE,wBAAwB,kDAgJ1B"}
@@ -1,27 +1,14 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
- import styled from "@emotion/styled";
3
2
  import { ViewportPortal } from "../../xyflow/react.js";
3
+ import { cn } from "@uipath/apollo-wind";
4
+ import { useMemo } from "react";
4
5
  import { createPortal } from "react-dom";
5
6
  import { CanvasPortal } from "./CanvasPortal.js";
6
7
  import { PanelChrome } from "./PanelChrome.js";
7
8
  import { useFloatingPosition } from "./useFloatingPosition.js";
8
- const PanelContainer = styled.div`
9
- color: var(--canvas-foreground);
10
- background-color: var(--canvas-background);
11
- border: 1px solid var(--canvas-border-de-emp);
12
- border-radius: ${(props)=>props.isPinned ? '0' : '8px'};
13
- box-shadow: ${(props)=>props.isPinned ? 'none' : '0 4px 16px rgba(0, 0, 0, 0.12)'};
14
- font-size: 14px;
15
- min-width: ${(props)=>props.isPinned ? '320px' : '280px'};
16
- max-width: ${(props)=>props.isPinned ? '320px' : 'none'};
17
- width: ${(props)=>props.isPinned ? '320px' : 'auto'};
18
- height: ${(props)=>props.isPinned ? '100vh' : 'auto'};
19
- max-height: ${(props)=>props.isPinned ? '100vh' : '600px'};
20
- display: flex;
21
- flex-direction: column;
22
- transition: opacity 0.2s ease-in-out;
23
- border-left: ${(props)=>props.isPinned ? '1px solid var(--canvas-border-de-emp)' : 'none'};
24
- `;
9
+ const PANEL_BASE_CLASS = 'text-(--canvas-foreground) bg-(--canvas-background-raised) border border-(--canvas-border-de-emp) text-sm flex flex-col transition-opacity duration-200 ease-in-out';
10
+ const PANEL_FLOATING_CLASS = 'rounded-lg shadow-[0_4px_16px_rgba(0,0,0,0.12)] w-auto min-w-[280px] max-w-none h-auto max-h-[600px]';
11
+ const PANEL_PINNED_CLASS = 'rounded-none shadow-none w-[320px] min-w-[320px] max-w-[320px] h-screen max-h-screen';
25
12
  function FloatingCanvasPanel({ open = true, nodeId, anchorRect, placement = 'right-start', offset = 20, fallbackPlacement, isPinned = false, useFixedPosition = false, portalToBody = false, title, header, headerActions, children, onClose, scrollKey, onMouseEnter, onMouseLeave }) {
26
13
  const { computedAnchor, floatingStyles, refs, mergedReferenceRef } = useFloatingPosition({
27
14
  open,
@@ -31,6 +18,9 @@ function FloatingCanvasPanel({ open = true, nodeId, anchorRect, placement = 'rig
31
18
  offset,
32
19
  fallbackPlacement
33
20
  });
21
+ const panelClassName = useMemo(()=>cn(PANEL_BASE_CLASS, isPinned ? PANEL_PINNED_CLASS : PANEL_FLOATING_CLASS), [
22
+ isPinned
23
+ ]);
34
24
  if (!open || !computedAnchor) return null;
35
25
  if (useFixedPosition && anchorRect) {
36
26
  const getScreenSpacePosition = ()=>{
@@ -75,11 +65,10 @@ function FloatingCanvasPanel({ open = true, nodeId, anchorRect, placement = 'rig
75
65
  }
76
66
  };
77
67
  const screenPosition = getScreenSpacePosition();
78
- const fixedContent = /*#__PURE__*/ jsx(PanelContainer, {
79
- className: "nodrag nopan nowheel",
80
- isPinned: isPinned,
81
- onMouseEnter: onMouseEnter,
82
- onMouseLeave: onMouseLeave,
68
+ const fixedContent = /*#__PURE__*/ jsx("div", {
69
+ className: cn('nodrag nopan nowheel', panelClassName),
70
+ onPointerEnter: onMouseEnter,
71
+ onPointerLeave: onMouseLeave,
83
72
  style: {
84
73
  position: 'fixed',
85
74
  ...screenPosition,
@@ -99,12 +88,11 @@ function FloatingCanvasPanel({ open = true, nodeId, anchorRect, placement = 'rig
99
88
  children: fixedContent
100
89
  });
101
90
  }
102
- const panelContent = /*#__PURE__*/ jsx(PanelContainer, {
91
+ const panelContent = /*#__PURE__*/ jsx("div", {
103
92
  ref: refs.setFloating,
104
- className: "nodrag nopan nowheel",
105
- isPinned: isPinned,
106
- onMouseEnter: onMouseEnter,
107
- onMouseLeave: onMouseLeave,
93
+ className: cn('nodrag nopan nowheel', panelClassName),
94
+ onPointerEnter: onMouseEnter,
95
+ onPointerLeave: onMouseLeave,
108
96
  style: {
109
97
  ...isPinned ? {} : floatingStyles,
110
98
  position: isPinned ? 'fixed' : 'absolute',
@@ -45,7 +45,7 @@ const icon_registry_cjs_namespaceObject = require("../../utils/icon-registry.cjs
45
45
  const PanelHeader = styled_default().div`
46
46
  border-bottom: 1px solid var(--canvas-border-de-emp);
47
47
  padding: 8px 16px;
48
- background-color: var(--canvas-background);
48
+ background-color: var(--canvas-background-raised);
49
49
  border-radius: 8px 8px 0 0;
50
50
  flex-shrink: 0;
51
51
  `;
@@ -7,7 +7,7 @@ import { CanvasIcon } from "../../utils/icon-registry.js";
7
7
  const PanelHeader = styled.div`
8
8
  border-bottom: 1px solid var(--canvas-border-de-emp);
9
9
  padding: 8px 16px;
10
- background-color: var(--canvas-background);
10
+ background-color: var(--canvas-background-raised);
11
11
  border-radius: 8px 8px 0 0;
12
12
  flex-shrink: 0;
13
13
  `;
@@ -30,23 +30,15 @@ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
30
30
  const react_cjs_namespaceObject = require("../../../xyflow/react.cjs");
31
31
  const react_namespaceObject = require("motion/react");
32
32
  const external_react_namespaceObject = require("react");
33
- const index_cjs_namespaceObject = require("../shared/index.cjs");
34
- const external_EdgeToolbar_styles_cjs_namespaceObject = require("./EdgeToolbar.styles.cjs");
33
+ const CanvasInlineButton_cjs_namespaceObject = require("../../ButtonHandle/CanvasInlineButton.cjs");
35
34
  const EdgeToolbarComponent = ({ edgeId, visible, positioning, config, onMouseEnter, onMouseLeave })=>{
36
- const actionsWithHandlers = (0, external_react_namespaceObject.useMemo)(()=>config.actions.map((action)=>({
37
- ...action,
38
- onClick: ()=>action.onAction(edgeId, positioning.pathPosition)
39
- })), [
40
- config.actions,
41
- edgeId,
42
- positioning.pathPosition
43
- ]);
44
35
  const transform = (0, external_react_namespaceObject.useMemo)(()=>`translate(-50%, -50%) translate(${positioning.offsetPosition.x}px, ${positioning.offsetPosition.y}px)`, [
45
36
  positioning.offsetPosition
46
37
  ]);
47
38
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_cjs_namespaceObject.EdgeLabelRenderer, {
48
39
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_namespaceObject.AnimatePresence, {
49
- children: visible && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_EdgeToolbar_styles_cjs_namespaceObject.StyledEdgeToolbarContainer, {
40
+ children: visible && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_namespaceObject.motion.div, {
41
+ className: "nodrag nopan absolute top-0 left-0 pointer-events-auto z-[1000] flex flex-row items-center gap-1",
50
42
  initial: {
51
43
  opacity: 0
52
44
  },
@@ -63,14 +55,18 @@ const EdgeToolbarComponent = ({ edgeId, visible, positioning, config, onMouseEnt
63
55
  style: {
64
56
  transform
65
57
  },
66
- className: "nodrag nopan",
67
58
  onMouseEnter: onMouseEnter,
68
59
  onMouseLeave: onMouseLeave,
69
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_EdgeToolbar_styles_cjs_namespaceObject.StyledEdgeToolbarContent, {
70
- children: actionsWithHandlers.map((action)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.ToolbarButton, {
71
- action: action
72
- }, action.id))
73
- })
60
+ children: config.actions.map((action)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(CanvasInlineButton_cjs_namespaceObject.CanvasInlineButton, {
61
+ "aria-label": action.label ?? action.id,
62
+ disabled: action.disabled,
63
+ icon: action.icon ?? 'plus',
64
+ onClick: (e)=>{
65
+ e.stopPropagation();
66
+ e.preventDefault();
67
+ if (!action.disabled) action.onAction(edgeId, positioning.pathPosition);
68
+ }
69
+ }, action.id))
74
70
  }, `edge-toolbar-${edgeId}`)
75
71
  })
76
72
  });