@uipath/apollo-react 4.5.4-pr525.f7c19ae → 4.6.0-pr525.51f590d

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 (24) hide show
  1. package/dist/canvas/components/BaseNode/BaseNodeBadgeSlot.cjs +3 -2
  2. package/dist/canvas/components/BaseNode/BaseNodeBadgeSlot.d.ts +1 -1
  3. package/dist/canvas/components/BaseNode/BaseNodeBadgeSlot.d.ts.map +1 -1
  4. package/dist/canvas/components/BaseNode/BaseNodeBadgeSlot.js +3 -2
  5. package/dist/canvas/components/BaseNode/BaseNodeContainer.cjs +25 -8
  6. package/dist/canvas/components/BaseNode/BaseNodeContainer.d.ts.map +1 -1
  7. package/dist/canvas/components/BaseNode/BaseNodeContainer.js +25 -8
  8. package/dist/canvas/components/BaseNode/BaseNodeInnerShape.cjs +21 -6
  9. package/dist/canvas/components/BaseNode/BaseNodeInnerShape.d.ts +1 -1
  10. package/dist/canvas/components/BaseNode/BaseNodeInnerShape.d.ts.map +1 -1
  11. package/dist/canvas/components/BaseNode/BaseNodeInnerShape.js +22 -7
  12. package/dist/canvas/components/BaseNode/NodeLabel.cjs +5 -5
  13. package/dist/canvas/components/BaseNode/NodeLabel.d.ts.map +1 -1
  14. package/dist/canvas/components/BaseNode/NodeLabel.js +5 -5
  15. package/dist/canvas/components/FloatingCanvasPanel/FloatingCanvasPanel.cjs +3 -2
  16. package/dist/canvas/components/FloatingCanvasPanel/FloatingCanvasPanel.d.ts +2 -1
  17. package/dist/canvas/components/FloatingCanvasPanel/FloatingCanvasPanel.d.ts.map +1 -1
  18. package/dist/canvas/components/FloatingCanvasPanel/FloatingCanvasPanel.js +3 -2
  19. package/dist/canvas/components/FloatingCanvasPanel/useFloatingPosition.cjs +4 -2
  20. package/dist/canvas/components/FloatingCanvasPanel/useFloatingPosition.d.ts +2 -1
  21. package/dist/canvas/components/FloatingCanvasPanel/useFloatingPosition.d.ts.map +1 -1
  22. package/dist/canvas/components/FloatingCanvasPanel/useFloatingPosition.js +4 -2
  23. package/dist/canvas/styles/tailwind.canvas.css +1 -1
  24. package/package.json +1 -1
@@ -27,8 +27,9 @@ __webpack_require__.d(__webpack_exports__, {
27
27
  BaseBadgeSlot: ()=>BaseBadgeSlot
28
28
  });
29
29
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
30
+ const external_react_namespaceObject = require("react");
30
31
  const external_constants_cjs_namespaceObject = require("../../constants.cjs");
31
- const BaseBadgeSlot = ({ position, shape, children })=>{
32
+ const BaseBadgeSlot = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(({ position, shape, children })=>{
32
33
  const offset = 'circle' === shape ? external_constants_cjs_namespaceObject.NODE_BADGE_INSET_CIRCLE : external_constants_cjs_namespaceObject.NODE_BADGE_INSET_SQUARE;
33
34
  const style = {
34
35
  width: external_constants_cjs_namespaceObject.NODE_BADGE_SIZE,
@@ -57,7 +58,7 @@ const BaseBadgeSlot = ({ position, shape, children })=>{
57
58
  style: style,
58
59
  children: children
59
60
  });
60
- };
61
+ });
61
62
  exports.BaseBadgeSlot = __webpack_exports__.BaseBadgeSlot;
62
63
  for(var __rspack_i in __webpack_exports__)if (-1 === [
63
64
  "BaseBadgeSlot"
@@ -4,6 +4,6 @@ interface BaseBadgeSlotProps {
4
4
  shape?: NodeShape;
5
5
  children: React.ReactNode;
6
6
  }
7
- export declare const BaseBadgeSlot: ({ position, shape, children }: BaseBadgeSlotProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const BaseBadgeSlot: import("react").MemoExoticComponent<({ position, shape, children }: BaseBadgeSlotProps) => import("react/jsx-runtime").JSX.Element>;
8
8
  export {};
9
9
  //# sourceMappingURL=BaseNodeBadgeSlot.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseNodeBadgeSlot.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseNode/BaseNodeBadgeSlot.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,UAAU,GAAG,WAAW,GAAG,aAAa,GAAG,cAAc,CAAC;IACpE,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,aAAa,GAAI,+BAA+B,kBAAkB,4CA0B9E,CAAC"}
1
+ {"version":3,"file":"BaseNodeBadgeSlot.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseNode/BaseNodeBadgeSlot.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,UAAU,GAAG,WAAW,GAAG,aAAa,GAAG,cAAc,CAAC;IACpE,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,aAAa,sEAAwC,kBAAkB,6CA0BlF,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
+ import { memo } from "react";
2
3
  import { NODE_BADGE_INSET_CIRCLE, NODE_BADGE_INSET_SQUARE, NODE_BADGE_SIZE } from "../../constants.js";
3
- const BaseBadgeSlot = ({ position, shape, children })=>{
4
+ const BaseBadgeSlot = /*#__PURE__*/ memo(({ position, shape, children })=>{
4
5
  const offset = 'circle' === shape ? NODE_BADGE_INSET_CIRCLE : NODE_BADGE_INSET_SQUARE;
5
6
  const style = {
6
7
  width: NODE_BADGE_SIZE,
@@ -29,5 +30,5 @@ const BaseBadgeSlot = ({ position, shape, children })=>{
29
30
  style: style,
30
31
  children: children
31
32
  });
32
- };
33
+ });
33
34
  export { BaseBadgeSlot };
@@ -29,6 +29,7 @@ __webpack_require__.d(__webpack_exports__, {
29
29
  });
30
30
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
31
31
  const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
32
+ const external_react_namespaceObject = require("react");
32
33
  const external_constants_cjs_namespaceObject = require("../../constants.cjs");
33
34
  const getStatusBorder = (status)=>{
34
35
  switch(status){
@@ -36,7 +37,7 @@ const getStatusBorder = (status)=>{
36
37
  return 'border-info animate-glow [--glow-color:var(--info)]';
37
38
  case 'Completed':
38
39
  case 'add':
39
- return 'border-success animate-glow [--glow-color:var(--success)]';
40
+ return 'border-success';
40
41
  case 'Paused':
41
42
  case 'Warning':
42
43
  case 'WARNING':
@@ -59,19 +60,35 @@ const BaseContainer = ({ isSelected, isHovered, shape, interactionState, executi
59
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);
60
61
  const containerRadius = radiusBasis * external_constants_cjs_namespaceObject.NODE_CONTAINER_RADIUS_RATIO;
61
62
  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'), [
64
+ shape,
65
+ hasFooter,
66
+ activeStatus,
67
+ isSelected,
68
+ isHovered,
69
+ interactionState
70
+ ]);
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
+ ]);
62
84
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
63
85
  "data-testid": "base-container",
64
86
  "data-execution-status": executionStatus,
65
87
  "data-interaction-state": interactionState,
66
88
  "data-validation-status": validationStatus,
67
89
  "data-suggestion-type": suggestionType,
68
- className: (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'),
69
- style: {
70
- width,
71
- height,
72
- background,
73
- borderRadius: 'circle' === shape || hasFooter ? void 0 : containerRadius
74
- },
90
+ className: className,
91
+ style: style,
75
92
  "aria-busy": loading || void 0,
76
93
  children: children
77
94
  });
@@ -1 +1 @@
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,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,4CA4CpB,CAAC"}
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,5 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { cn } from "@uipath/apollo-wind";
3
+ import { useMemo } from "react";
3
4
  import { DEFAULT_NODE_SIZE, NODE_CONTAINER_RADIUS_RATIO } from "../../constants.js";
4
5
  const getStatusBorder = (status)=>{
5
6
  switch(status){
@@ -7,7 +8,7 @@ const getStatusBorder = (status)=>{
7
8
  return 'border-info animate-glow [--glow-color:var(--info)]';
8
9
  case 'Completed':
9
10
  case 'add':
10
- return 'border-success animate-glow [--glow-color:var(--success)]';
11
+ return 'border-success';
11
12
  case 'Paused':
12
13
  case 'Warning':
13
14
  case 'WARNING':
@@ -30,19 +31,35 @@ const BaseContainer = ({ isSelected, isHovered, shape, interactionState, executi
30
31
  const radiusBasis = 'rectangle' === shape ? numericHeight ?? DEFAULT_NODE_SIZE : Math.min(numericWidth ?? DEFAULT_NODE_SIZE, numericHeight ?? DEFAULT_NODE_SIZE);
31
32
  const containerRadius = radiusBasis * NODE_CONTAINER_RADIUS_RATIO;
32
33
  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'), [
35
+ shape,
36
+ hasFooter,
37
+ activeStatus,
38
+ isSelected,
39
+ isHovered,
40
+ interactionState
41
+ ]);
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
+ ]);
33
55
  return /*#__PURE__*/ jsx("div", {
34
56
  "data-testid": "base-container",
35
57
  "data-execution-status": executionStatus,
36
58
  "data-interaction-state": interactionState,
37
59
  "data-validation-status": validationStatus,
38
60
  "data-suggestion-type": suggestionType,
39
- className: 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'),
40
- style: {
41
- width,
42
- height,
43
- background,
44
- borderRadius: 'circle' === shape || hasFooter ? void 0 : containerRadius
45
- },
61
+ className: className,
62
+ style: style,
46
63
  "aria-busy": loading || void 0,
47
64
  children: children
48
65
  });
@@ -28,24 +28,39 @@ __webpack_require__.d(__webpack_exports__, {
28
28
  });
29
29
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
30
30
  const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
31
+ const external_react_namespaceObject = require("react");
31
32
  const external_constants_cjs_namespaceObject = require("../../constants.cjs");
32
- const BaseInnerShape = ({ shape, color, background, hasFooter, loading, containerWidth = external_constants_cjs_namespaceObject.DEFAULT_NODE_SIZE, containerHeight = external_constants_cjs_namespaceObject.DEFAULT_NODE_SIZE, children })=>{
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 })=>{
33
35
  const effectiveContainerHeight = hasFooter ? external_constants_cjs_namespaceObject.DEFAULT_NODE_SIZE : containerHeight;
34
36
  const effectiveContainerWidth = hasFooter ? external_constants_cjs_namespaceObject.DEFAULT_NODE_SIZE : containerWidth;
35
37
  const basis = 'rectangle' === shape ? effectiveContainerHeight : Math.min(effectiveContainerWidth, effectiveContainerHeight);
36
38
  const innerSize = basis * external_constants_cjs_namespaceObject.NODE_INNER_SHAPE_RATIO;
37
39
  const iconSize = basis * external_constants_cjs_namespaceObject.NODE_INNER_ICON_RATIO;
38
40
  const innerRadius = basis * external_constants_cjs_namespaceObject.NODE_INNER_RADIUS_RATIO;
39
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
40
- className: (0, apollo_wind_namespaceObject.cn)('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'),
41
- style: {
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)(()=>({
42
46
  width: innerSize,
43
47
  height: innerSize,
44
48
  borderRadius: 'circle' === shape || hasFooter ? void 0 : innerRadius,
45
49
  color,
46
50
  background,
47
51
  '--canvas-icon-size': `${iconSize}px`
48
- },
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,
49
64
  children: loading ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Skeleton, {
50
65
  "data-testid": "skeleton-icon",
51
66
  className: "rounded-lg",
@@ -55,7 +70,7 @@ const BaseInnerShape = ({ shape, color, background, hasFooter, loading, containe
55
70
  }
56
71
  }) : children
57
72
  });
58
- };
73
+ });
59
74
  exports.BaseInnerShape = __webpack_exports__.BaseInnerShape;
60
75
  for(var __rspack_i in __webpack_exports__)if (-1 === [
61
76
  "BaseInnerShape"
@@ -9,6 +9,6 @@ interface BaseInnerShapeProps {
9
9
  containerHeight?: number;
10
10
  children: React.ReactNode;
11
11
  }
12
- export declare const BaseInnerShape: ({ shape, color, background, hasFooter, loading, containerWidth, containerHeight, children, }: BaseInnerShapeProps) => import("react/jsx-runtime").JSX.Element;
12
+ export declare const BaseInnerShape: import("react").MemoExoticComponent<({ shape, color, background, hasFooter, loading, containerWidth, containerHeight, children, }: BaseInnerShapeProps) => import("react/jsx-runtime").JSX.Element>;
13
13
  export {};
14
14
  //# sourceMappingURL=BaseNodeInnerShape.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseNodeInnerShape.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseNode/BaseNodeInnerShape.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,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,GAAI,8FAS5B,mBAAmB,4CAgDrB,CAAC"}
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,23 +1,38 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { Skeleton, cn } from "@uipath/apollo-wind";
2
+ import { Skeleton } from "@uipath/apollo-wind";
3
+ import { memo, useMemo } from "react";
3
4
  import { DEFAULT_NODE_SIZE, NODE_INNER_ICON_RATIO, NODE_INNER_RADIUS_RATIO, NODE_INNER_SHAPE_RATIO } from "../../constants.js";
4
- const BaseInnerShape = ({ shape, color, background, hasFooter, loading, containerWidth = DEFAULT_NODE_SIZE, containerHeight = DEFAULT_NODE_SIZE, children })=>{
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 })=>{
5
7
  const effectiveContainerHeight = hasFooter ? DEFAULT_NODE_SIZE : containerHeight;
6
8
  const effectiveContainerWidth = hasFooter ? DEFAULT_NODE_SIZE : containerWidth;
7
9
  const basis = 'rectangle' === shape ? effectiveContainerHeight : Math.min(effectiveContainerWidth, effectiveContainerHeight);
8
10
  const innerSize = basis * NODE_INNER_SHAPE_RATIO;
9
11
  const iconSize = basis * NODE_INNER_ICON_RATIO;
10
12
  const innerRadius = basis * NODE_INNER_RADIUS_RATIO;
11
- return /*#__PURE__*/ jsx("div", {
12
- className: cn('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'),
13
- style: {
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(()=>({
14
18
  width: innerSize,
15
19
  height: innerSize,
16
20
  borderRadius: 'circle' === shape || hasFooter ? void 0 : innerRadius,
17
21
  color,
18
22
  background,
19
23
  '--canvas-icon-size': `${iconSize}px`
20
- },
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,
21
36
  children: loading ? /*#__PURE__*/ jsx(Skeleton, {
22
37
  "data-testid": "skeleton-icon",
23
38
  className: "rounded-lg",
@@ -27,5 +42,5 @@ const BaseInnerShape = ({ shape, color, background, hasFooter, loading, containe
27
42
  }
28
43
  }) : children
29
44
  });
30
- };
45
+ });
31
46
  export { BaseInnerShape };
@@ -28,9 +28,9 @@ __webpack_require__.d(__webpack_exports__, {
28
28
  NodeLabel: ()=>NodeLabel
29
29
  });
30
30
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
31
- const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
32
31
  const external_react_namespaceObject = require("react");
33
32
  const external_constants_cjs_namespaceObject = require("../../constants.cjs");
33
+ const CssUtil_cjs_namespaceObject = require("../../utils/CssUtil.cjs");
34
34
  const external_CanvasTooltip_cjs_namespaceObject = require("../CanvasTooltip.cjs");
35
35
  const BaseTextContainer = ({ hasBottomHandles, shape, children })=>{
36
36
  if ('rectangle' === shape) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
@@ -38,7 +38,7 @@ const BaseTextContainer = ({ hasBottomHandles, shape, children })=>{
38
38
  children: children
39
39
  });
40
40
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
41
- className: (0, apollo_wind_namespaceObject.cn)('absolute left-1/2 w-[150%] flex flex-col z-10 transition-transform duration-200', hasBottomHandles ? 'items-start text-left translate-x-[20%] translate-y-1/2' : 'items-center text-center -translate-x-1/2 translate-y-full'),
41
+ className: (0, CssUtil_cjs_namespaceObject.cx)('absolute left-1/2 w-[150%] flex flex-col z-10 transition-transform duration-200', hasBottomHandles ? 'items-start text-left translate-x-[20%] translate-y-1/2' : 'items-center text-center -translate-x-1/2 translate-y-full'),
42
42
  style: {
43
43
  bottom: hasBottomHandles ? external_constants_cjs_namespaceObject.NODE_TEXT_BOTTOM_OFFSET_WITH_HANDLES : external_constants_cjs_namespaceObject.NODE_TEXT_BOTTOM_OFFSET
44
44
  },
@@ -58,7 +58,7 @@ const ConditionalTooltip = ({ content, children })=>{
58
58
  const Header = ({ shape, backgroundColor, onDoubleClick, children, 'data-testid': dataTestId })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
59
59
  "data-testid": dataTestId,
60
60
  onDoubleClick: onDoubleClick,
61
- className: (0, apollo_wind_namespaceObject.cn)('text-center text-sm leading-[18px] font-semibold text-foreground overflow-hidden', backgroundColor && 'px-1.5 py-0.5 rounded-sm', 'rectangle' === shape ? 'w-full text-left whitespace-nowrap text-ellipsis' : 'break-all line-clamp-3'),
61
+ className: (0, CssUtil_cjs_namespaceObject.cx)('text-center text-sm leading-[18px] font-semibold text-foreground overflow-hidden', backgroundColor && 'px-1.5 py-0.5 rounded-sm', 'rectangle' === shape ? 'w-full text-left whitespace-nowrap text-ellipsis' : 'wrap-break-word line-clamp-3'),
62
62
  style: backgroundColor ? {
63
63
  backgroundColor
64
64
  } : void 0,
@@ -67,7 +67,7 @@ const Header = ({ shape, backgroundColor, onDoubleClick, children, 'data-testid'
67
67
  const SubHeader = ({ shape, onDoubleClick, children, 'data-testid': dataTestId })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
68
68
  "data-testid": dataTestId,
69
69
  onDoubleClick: onDoubleClick,
70
- className: (0, apollo_wind_namespaceObject.cn)('text-center text-xs leading-[18px] text-foreground-muted break-all overflow-hidden', 'rectangle' === shape ? 'w-full text-left line-clamp-2' : 'line-clamp-5'),
70
+ className: (0, CssUtil_cjs_namespaceObject.cx)('text-center text-xs leading-[18px] text-foreground-muted wrap-break-word overflow-hidden', 'rectangle' === shape ? 'w-full text-left line-clamp-2' : 'line-clamp-5'),
71
71
  children: children
72
72
  });
73
73
  const EditableLabel = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)(({ shape, backgroundColor, variant, value, placeholder, rows, onChange, onKeyDown, onBlur, 'aria-label': ariaLabel }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("textarea", {
@@ -79,7 +79,7 @@ const EditableLabel = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRe
79
79
  onChange: onChange,
80
80
  onKeyDown: onKeyDown,
81
81
  onBlur: onBlur,
82
- className: (0, apollo_wind_namespaceObject.cn)('nodrag nowheel resize-none font-[inherit] text-foreground border-none rounded-sm outline-1 outline-dashed outline-border-de-emp max-w-full', 'subtext' === variant ? 'text-xs leading-[18px] font-normal mb-0' : 'text-sm leading-[18px] font-semibold mb-0.5', 'rectangle' === shape ? 'field-sizing-fixed w-full' : 'field-sizing-content text-center', backgroundColor && 'px-1.5 py-0.5'),
82
+ className: (0, CssUtil_cjs_namespaceObject.cx)('nodrag nowheel resize-none font-[inherit] text-foreground border-none rounded-sm outline-1 outline-dashed outline-border-de-emp max-w-full', 'subtext' === variant ? 'text-xs leading-[18px] font-normal mb-0' : 'text-sm leading-[18px] font-semibold mb-0.5', 'rectangle' === shape ? 'field-sizing-fixed w-full' : 'field-sizing-content text-center', backgroundColor && 'px-1.5 py-0.5'),
83
83
  style: backgroundColor ? {
84
84
  backgroundColor
85
85
  } : void 0
@@ -1 +1 @@
1
- {"version":3,"file":"NodeLabel.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseNode/NodeLabel.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG9C,UAAU,sBAAsB;IAC9B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,iBAAiB,GAAI,wCAI/B,sBAAsB,4CAmBxB,CAAC;AA+IF,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAClE;AA+KD,eAAO,MAAM,SAAS,mLAjKnB,cAAc,6CAiK+B,CAAC"}
1
+ {"version":3,"file":"NodeLabel.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/BaseNode/NodeLabel.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI9C,UAAU,sBAAsB;IAC9B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,iBAAiB,GAAI,wCAI/B,sBAAsB,4CAmBxB,CAAC;AA+IF,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAClE;AA+KD,eAAO,MAAM,SAAS,mLAjKnB,cAAc,6CAiK+B,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
- import { cn } from "@uipath/apollo-wind";
3
2
  import { forwardRef, memo, useCallback, useEffect, useRef, useState } from "react";
4
3
  import { NODE_TEXT_BOTTOM_OFFSET, NODE_TEXT_BOTTOM_OFFSET_WITH_HANDLES } from "../../constants.js";
4
+ import { cx } from "../../utils/CssUtil.js";
5
5
  import { CanvasTooltip } from "../CanvasTooltip.js";
6
6
  const BaseTextContainer = ({ hasBottomHandles, shape, children })=>{
7
7
  if ('rectangle' === shape) return /*#__PURE__*/ jsx("div", {
@@ -9,7 +9,7 @@ const BaseTextContainer = ({ hasBottomHandles, shape, children })=>{
9
9
  children: children
10
10
  });
11
11
  return /*#__PURE__*/ jsx("div", {
12
- className: cn('absolute left-1/2 w-[150%] flex flex-col z-10 transition-transform duration-200', hasBottomHandles ? 'items-start text-left translate-x-[20%] translate-y-1/2' : 'items-center text-center -translate-x-1/2 translate-y-full'),
12
+ className: cx('absolute left-1/2 w-[150%] flex flex-col z-10 transition-transform duration-200', hasBottomHandles ? 'items-start text-left translate-x-[20%] translate-y-1/2' : 'items-center text-center -translate-x-1/2 translate-y-full'),
13
13
  style: {
14
14
  bottom: hasBottomHandles ? NODE_TEXT_BOTTOM_OFFSET_WITH_HANDLES : NODE_TEXT_BOTTOM_OFFSET
15
15
  },
@@ -29,7 +29,7 @@ const ConditionalTooltip = ({ content, children })=>{
29
29
  const Header = ({ shape, backgroundColor, onDoubleClick, children, 'data-testid': dataTestId })=>/*#__PURE__*/ jsx("div", {
30
30
  "data-testid": dataTestId,
31
31
  onDoubleClick: onDoubleClick,
32
- className: cn('text-center text-sm leading-[18px] font-semibold text-foreground overflow-hidden', backgroundColor && 'px-1.5 py-0.5 rounded-sm', 'rectangle' === shape ? 'w-full text-left whitespace-nowrap text-ellipsis' : 'break-all line-clamp-3'),
32
+ className: cx('text-center text-sm leading-[18px] font-semibold text-foreground overflow-hidden', backgroundColor && 'px-1.5 py-0.5 rounded-sm', 'rectangle' === shape ? 'w-full text-left whitespace-nowrap text-ellipsis' : 'wrap-break-word line-clamp-3'),
33
33
  style: backgroundColor ? {
34
34
  backgroundColor
35
35
  } : void 0,
@@ -38,7 +38,7 @@ const Header = ({ shape, backgroundColor, onDoubleClick, children, 'data-testid'
38
38
  const SubHeader = ({ shape, onDoubleClick, children, 'data-testid': dataTestId })=>/*#__PURE__*/ jsx("div", {
39
39
  "data-testid": dataTestId,
40
40
  onDoubleClick: onDoubleClick,
41
- className: cn('text-center text-xs leading-[18px] text-foreground-muted break-all overflow-hidden', 'rectangle' === shape ? 'w-full text-left line-clamp-2' : 'line-clamp-5'),
41
+ className: cx('text-center text-xs leading-[18px] text-foreground-muted wrap-break-word overflow-hidden', 'rectangle' === shape ? 'w-full text-left line-clamp-2' : 'line-clamp-5'),
42
42
  children: children
43
43
  });
44
44
  const EditableLabel = /*#__PURE__*/ forwardRef(({ shape, backgroundColor, variant, value, placeholder, rows, onChange, onKeyDown, onBlur, 'aria-label': ariaLabel }, ref)=>/*#__PURE__*/ jsx("textarea", {
@@ -50,7 +50,7 @@ const EditableLabel = /*#__PURE__*/ forwardRef(({ shape, backgroundColor, varian
50
50
  onChange: onChange,
51
51
  onKeyDown: onKeyDown,
52
52
  onBlur: onBlur,
53
- className: cn('nodrag nowheel resize-none font-[inherit] text-foreground border-none rounded-sm outline-1 outline-dashed outline-border-de-emp max-w-full', 'subtext' === variant ? 'text-xs leading-[18px] font-normal mb-0' : 'text-sm leading-[18px] font-semibold mb-0.5', 'rectangle' === shape ? 'field-sizing-fixed w-full' : 'field-sizing-content text-center', backgroundColor && 'px-1.5 py-0.5'),
53
+ className: cx('nodrag nowheel resize-none font-[inherit] text-foreground border-none rounded-sm outline-1 outline-dashed outline-border-de-emp max-w-full', 'subtext' === variant ? 'text-xs leading-[18px] font-normal mb-0' : 'text-sm leading-[18px] font-semibold mb-0.5', 'rectangle' === shape ? 'field-sizing-fixed w-full' : 'field-sizing-content text-center', backgroundColor && 'px-1.5 py-0.5'),
54
54
  style: backgroundColor ? {
55
55
  backgroundColor
56
56
  } : void 0
@@ -60,13 +60,14 @@ const PanelContainer = styled_default().div`
60
60
  transition: opacity 0.2s ease-in-out;
61
61
  border-left: ${(props)=>props.isPinned ? '1px solid var(--canvas-border-de-emp)' : 'none'};
62
62
  `;
63
- function FloatingCanvasPanel({ open = true, nodeId, anchorRect, placement = 'right-start', offset = 20, isPinned = false, useFixedPosition = false, portalToBody = false, title, header, headerActions, children, onClose, scrollKey, onMouseEnter, onMouseLeave }) {
63
+ 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
64
  const { computedAnchor, floatingStyles, refs, mergedReferenceRef } = (0, external_useFloatingPosition_cjs_namespaceObject.useFloatingPosition)({
65
65
  open,
66
66
  nodeId,
67
67
  anchorRect,
68
68
  placement,
69
- offset
69
+ offset,
70
+ fallbackPlacement
70
71
  });
71
72
  if (!open || !computedAnchor) return null;
72
73
  if (useFixedPosition && anchorRect) {
@@ -7,6 +7,7 @@ export type FloatingCanvasPanelProps = {
7
7
  anchorRect?: AnchorRect;
8
8
  placement?: Placement;
9
9
  offset?: number;
10
+ fallbackPlacement?: 'none' | 'start' | 'end';
10
11
  isPinned?: boolean;
11
12
  useFixedPosition?: boolean;
12
13
  portalToBody?: boolean;
@@ -19,5 +20,5 @@ export type FloatingCanvasPanelProps = {
19
20
  onMouseEnter?: () => void;
20
21
  onMouseLeave?: () => void;
21
22
  };
22
- export declare function FloatingCanvasPanel({ open, nodeId, anchorRect, placement, offset, isPinned, useFixedPosition, portalToBody, title, header, headerActions, children, onClose, scrollKey, onMouseEnter, onMouseLeave, }: FloatingCanvasPanelProps): import("react/jsx-runtime").JSX.Element | null;
23
+ export declare function FloatingCanvasPanel({ open, nodeId, anchorRect, placement, offset, fallbackPlacement, isPinned, useFixedPosition, portalToBody, title, header, headerActions, children, onClose, scrollKey, onMouseEnter, onMouseLeave, }: FloatingCanvasPanelProps): import("react/jsx-runtime").JSX.Element | null;
23
24
  //# sourceMappingURL=FloatingCanvasPanel.d.ts.map
@@ -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;IAChB,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,QAAgB,EAChB,gBAAwB,EACxB,YAAoB,EACpB,KAAK,EACL,MAAM,EACN,aAAa,EACb,QAAQ,EACR,OAAO,EACP,SAAS,EACT,YAAY,EACZ,YAAY,GACb,EAAE,wBAAwB,kDA4I1B"}
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"}
@@ -22,13 +22,14 @@ const PanelContainer = styled.div`
22
22
  transition: opacity 0.2s ease-in-out;
23
23
  border-left: ${(props)=>props.isPinned ? '1px solid var(--canvas-border-de-emp)' : 'none'};
24
24
  `;
25
- function FloatingCanvasPanel({ open = true, nodeId, anchorRect, placement = 'right-start', offset = 20, isPinned = false, useFixedPosition = false, portalToBody = false, title, header, headerActions, children, onClose, scrollKey, onMouseEnter, onMouseLeave }) {
25
+ 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
26
  const { computedAnchor, floatingStyles, refs, mergedReferenceRef } = useFloatingPosition({
27
27
  open,
28
28
  nodeId,
29
29
  anchorRect,
30
30
  placement,
31
- offset
31
+ offset,
32
+ fallbackPlacement
32
33
  });
33
34
  if (!open || !computedAnchor) return null;
34
35
  if (useFixedPosition && anchorRect) {
@@ -29,7 +29,7 @@ __webpack_require__.d(__webpack_exports__, {
29
29
  const react_namespaceObject = require("@floating-ui/react");
30
30
  const react_cjs_namespaceObject = require("../../xyflow/react.cjs");
31
31
  const external_react_namespaceObject = require("react");
32
- function useFloatingPosition({ open = true, nodeId, anchorRect, placement = 'right-start', offset: offsetValue = 20 }) {
32
+ function useFloatingPosition({ open = true, nodeId, anchorRect, placement = 'right-start', offset: offsetValue = 20, fallbackPlacement = 'none' }) {
33
33
  const referenceRef = (0, external_react_namespaceObject.useRef)(null);
34
34
  const internalNode = (0, react_cjs_namespaceObject.useInternalNode)(nodeId || '');
35
35
  const computedAnchor = (0, external_react_namespaceObject.useMemo)(()=>{
@@ -56,7 +56,9 @@ function useFloatingPosition({ open = true, nodeId, anchorRect, placement = 'rig
56
56
  open: !!open && !!computedAnchor,
57
57
  middleware: [
58
58
  (0, react_namespaceObject.offset)(offsetValue),
59
- (0, react_namespaceObject.flip)()
59
+ (0, react_namespaceObject.flip)({
60
+ fallbackAxisSideDirection: fallbackPlacement
61
+ })
60
62
  ],
61
63
  whileElementsMounted: react_namespaceObject.autoUpdate
62
64
  });
@@ -12,6 +12,7 @@ export interface UseFloatingPositionOptions {
12
12
  anchorRect?: AnchorRect;
13
13
  placement?: Placement;
14
14
  offset?: number;
15
+ fallbackPlacement?: 'none' | 'start' | 'end';
15
16
  }
16
17
  export interface UseFloatingPositionReturn {
17
18
  computedAnchor: AnchorRect | null;
@@ -22,5 +23,5 @@ export interface UseFloatingPositionReturn {
22
23
  };
23
24
  mergedReferenceRef: ((instance: Element | null) => void) | null;
24
25
  }
25
- export declare function useFloatingPosition({ open, nodeId, anchorRect, placement, offset: offsetValue, }: UseFloatingPositionOptions): UseFloatingPositionReturn;
26
+ export declare function useFloatingPosition({ open, nodeId, anchorRect, placement, offset: offsetValue, fallbackPlacement, }: UseFloatingPositionOptions): UseFloatingPositionReturn;
26
27
  //# sourceMappingURL=useFloatingPosition.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFloatingPosition.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/FloatingCanvasPanel/useFloatingPosition.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,SAAS,EAGf,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,WAAW,EAA8B,MAAM,OAAO,CAAC;AAEzF,MAAM,MAAM,UAAU,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjF,MAAM,WAAW,0BAA0B;IACzC,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;CACjB;AAED,MAAM,WAAW,yBAAyB;IACxC,cAAc,EAAE,UAAU,GAAG,IAAI,CAAC;IAClC,cAAc,EAAE,aAAa,CAAC;IAC9B,IAAI,EAAE;QACJ,YAAY,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;QACnC,WAAW,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;KACvC,CAAC;IACF,kBAAkB,EAAE,CAAC,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC;CACjE;AAED,wBAAgB,mBAAmB,CAAC,EAClC,IAAW,EACX,MAAM,EACN,UAAU,EACV,SAAyB,EACzB,MAAM,EAAE,WAAgB,GACzB,EAAE,0BAA0B,GAAG,yBAAyB,CA8CxD"}
1
+ {"version":3,"file":"useFloatingPosition.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/FloatingCanvasPanel/useFloatingPosition.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,SAAS,EAGf,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,WAAW,EAA8B,MAAM,OAAO,CAAC;AAEzF,MAAM,MAAM,UAAU,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjF,MAAM,WAAW,0BAA0B;IACzC,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;IAChB,iBAAiB,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;CAC9C;AAED,MAAM,WAAW,yBAAyB;IACxC,cAAc,EAAE,UAAU,GAAG,IAAI,CAAC;IAClC,cAAc,EAAE,aAAa,CAAC;IAC9B,IAAI,EAAE;QACJ,YAAY,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;QACnC,WAAW,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;KACvC,CAAC;IACF,kBAAkB,EAAE,CAAC,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC;CACjE;AAED,wBAAgB,mBAAmB,CAAC,EAClC,IAAW,EACX,MAAM,EACN,UAAU,EACV,SAAyB,EACzB,MAAM,EAAE,WAAgB,EACxB,iBAA0B,GAC3B,EAAE,0BAA0B,GAAG,yBAAyB,CA8CxD"}
@@ -1,7 +1,7 @@
1
1
  import { autoUpdate, flip, offset, useFloating, useMergeRefs } from "@floating-ui/react";
2
2
  import { useInternalNode } from "../../xyflow/react.js";
3
3
  import { useEffect, useMemo, useRef } from "react";
4
- function useFloatingPosition({ open = true, nodeId, anchorRect, placement = 'right-start', offset: offsetValue = 20 }) {
4
+ function useFloatingPosition({ open = true, nodeId, anchorRect, placement = 'right-start', offset: offsetValue = 20, fallbackPlacement = 'none' }) {
5
5
  const referenceRef = useRef(null);
6
6
  const internalNode = useInternalNode(nodeId || '');
7
7
  const computedAnchor = useMemo(()=>{
@@ -28,7 +28,9 @@ function useFloatingPosition({ open = true, nodeId, anchorRect, placement = 'rig
28
28
  open: !!open && !!computedAnchor,
29
29
  middleware: [
30
30
  offset(offsetValue),
31
- flip()
31
+ flip({
32
+ fallbackAxisSideDirection: fallbackPlacement
33
+ })
32
34
  ],
33
35
  whileElementsMounted: autoUpdate
34
36
  });