@uipath/apollo-react 4.5.4 → 4.6.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.
- package/dist/canvas/components/FloatingCanvasPanel/FloatingCanvasPanel.cjs +3 -2
- package/dist/canvas/components/FloatingCanvasPanel/FloatingCanvasPanel.d.ts +2 -1
- package/dist/canvas/components/FloatingCanvasPanel/FloatingCanvasPanel.d.ts.map +1 -1
- package/dist/canvas/components/FloatingCanvasPanel/FloatingCanvasPanel.js +3 -2
- package/dist/canvas/components/FloatingCanvasPanel/useFloatingPosition.cjs +4 -2
- package/dist/canvas/components/FloatingCanvasPanel/useFloatingPosition.d.ts +2 -1
- package/dist/canvas/components/FloatingCanvasPanel/useFloatingPosition.d.ts.map +1 -1
- package/dist/canvas/components/FloatingCanvasPanel/useFloatingPosition.js +4 -2
- package/package.json +1 -1
|
@@ -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;
|
|
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;
|
|
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
|
});
|