fix fullscren
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
import type { ComponentProps, ReactNode } from "react";
|
import type { ComponentProps, ReactNode } from "react";
|
||||||
import { NodeResizer } from "@xyflow/react";
|
import { NodeResizer } from "@xyflow/react";
|
||||||
|
import { useContext } from "react";
|
||||||
|
|
||||||
|
import FlowContext from "@/lib/graph/flowContext";
|
||||||
import { useConnectionPathRole } from "@/lib/graph/flowContext";
|
import { useConnectionPathRole } from "@/lib/graph/flowContext";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
|
|
||||||
@@ -35,6 +37,8 @@ export function BaseNode({
|
|||||||
resizeConstraints,
|
resizeConstraints,
|
||||||
...props
|
...props
|
||||||
}: BaseNodeProps) {
|
}: BaseNodeProps) {
|
||||||
|
const flowContext = useContext(FlowContext);
|
||||||
|
const isFullscreenInstance = Boolean(nodeId && flowContext?.fullscreenNodeId === nodeId);
|
||||||
const connectionPathRole = useConnectionPathRole(nodeId);
|
const connectionPathRole = useConnectionPathRole(nodeId);
|
||||||
const hasSize =
|
const hasSize =
|
||||||
dimensions &&
|
dimensions &&
|
||||||
@@ -81,7 +85,7 @@ export function BaseNode({
|
|||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
{resizable && nodeId && (
|
{resizable && nodeId && !isFullscreenInstance && (
|
||||||
<NodeResizer
|
<NodeResizer
|
||||||
nodeId={nodeId}
|
nodeId={nodeId}
|
||||||
isVisible={selected}
|
isVisible={selected}
|
||||||
@@ -93,7 +97,7 @@ export function BaseNode({
|
|||||||
handleClassName="base-node-resize-handle nodrag nopan"
|
handleClassName="base-node-resize-handle nodrag nopan"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{handles}
|
{!isFullscreenInstance && handles}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user