mirror of
https://github.com/chartdb/chartdb.git
synced 2025-11-12 18:06:35 +00:00
* feat: create relationships on canvas modal * feat: create relationships on canvas modal * feat: create relationships on canvas modal * fix * fix * fix * fix
37 lines
1.0 KiB
TypeScript
37 lines
1.0 KiB
TypeScript
import React from 'react';
|
|
import { type NodeProps, type Node, Handle, Position } from '@xyflow/react';
|
|
|
|
export const TEMP_CURSOR_NODE_ID = '__temp_cursor_node__';
|
|
export const TEMP_CURSOR_HANDLE_ID = '__temp-cursor-target__';
|
|
|
|
export type TempCursorNodeType = Node<
|
|
{
|
|
// Empty data object - this is just a cursor position marker
|
|
},
|
|
'temp-cursor'
|
|
>;
|
|
|
|
export const TempCursorNode: React.FC<NodeProps<TempCursorNodeType>> =
|
|
React.memo(() => {
|
|
// Invisible node that just serves as a connection point
|
|
return (
|
|
<div
|
|
style={{
|
|
width: 1,
|
|
height: 1,
|
|
opacity: 0,
|
|
pointerEvents: 'none',
|
|
}}
|
|
>
|
|
<Handle
|
|
id={TEMP_CURSOR_HANDLE_ID}
|
|
className="!invisible"
|
|
position={Position.Right}
|
|
type="target"
|
|
/>
|
|
</div>
|
|
);
|
|
});
|
|
|
|
TempCursorNode.displayName = 'TempCursorNode';
|