Merge branch 'next' into fix-svelte-reset
This commit is contained in:
@@ -56,7 +56,8 @@
|
||||
onconnect: onConnectAction,
|
||||
onconnectstart: onConnectStartAction,
|
||||
onconnectend: onConnectEndAction,
|
||||
flowId
|
||||
flowId,
|
||||
connection
|
||||
} = store;
|
||||
|
||||
function onPointerDown(event: MouseEvent | TouchEvent) {
|
||||
@@ -123,6 +124,16 @@
|
||||
prevConnections = connections ?? new Map();
|
||||
}
|
||||
|
||||
$: connectingFrom =
|
||||
$connection.startHandle?.nodeId === nodeId &&
|
||||
$connection.startHandle?.type === type &&
|
||||
$connection.startHandle?.handleId === handleId;
|
||||
$: connectingTo =
|
||||
$connection.endHandle?.nodeId === nodeId &&
|
||||
$connection.endHandle?.type === type &&
|
||||
$connection.endHandle?.handleId === handleId;
|
||||
$: valid = connectingTo && $connection.status === 'valid';
|
||||
|
||||
// @todo implement connectablestart, connectableend
|
||||
</script>
|
||||
|
||||
@@ -141,6 +152,11 @@ The Handle component is the part of a node that can be used to connect nodes.
|
||||
'nodrag',
|
||||
'nopan',
|
||||
position,
|
||||
{
|
||||
valid,
|
||||
connectingto: connectingTo,
|
||||
connectingfrom: connectingFrom
|
||||
},
|
||||
className
|
||||
])}
|
||||
class:source={!isTarget}
|
||||
|
||||
@@ -197,7 +197,7 @@
|
||||
style:z-index={zIndex}
|
||||
style:transform="translate({positionOriginX}px, {positionOriginY}px)"
|
||||
style:visibility={initialized ? 'visible' : 'hidden'}
|
||||
style="{inlineStyleDimensions.width} {inlineStyleDimensions.height} {style ?? ''};"
|
||||
style="{style ?? ''};{inlineStyleDimensions.width}{inlineStyleDimensions.height}"
|
||||
on:click={onSelectNodeHandler}
|
||||
on:mouseenter={(event) => dispatch('nodemouseenter', { node, event })}
|
||||
on:mouseleave={(event) => dispatch('nodemouseleave', { node, event })}
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
let className: $$Props['class'] = '';
|
||||
export { className as class };
|
||||
|
||||
const { nodeLookup, snapGrid, viewport, nodes } = useStore();
|
||||
const { nodeLookup, snapGrid, viewport, nodes, nodeOrigin } = useStore();
|
||||
|
||||
const contextNodeId = getContext<string>('svelteflow__node_id');
|
||||
$: id = typeof nodeId === 'string' ? nodeId : contextNodeId;
|
||||
@@ -64,7 +64,8 @@
|
||||
nodeLookup: $nodeLookup,
|
||||
transform: [$viewport.x, $viewport.y, $viewport.zoom],
|
||||
snapGrid: $snapGrid ?? undefined,
|
||||
snapToGrid: !!$snapGrid
|
||||
snapToGrid: !!$snapGrid,
|
||||
nodeOrigin: $nodeOrigin
|
||||
};
|
||||
},
|
||||
onChange: (change: XYResizerChange, childChanges: XYResizerChildChange[]) => {
|
||||
|
||||
Reference in New Issue
Block a user