Merge branch 'next' into absolute-origin
This commit is contained in:
@@ -103,7 +103,7 @@
|
||||
$onConnectEndAction?.(event);
|
||||
},
|
||||
getTransform: () => [$viewport.x, $viewport.y, $viewport.zoom],
|
||||
getConnectionStartHandle: () => $connection.startHandle
|
||||
getFromHandle: () => $connection.startHandle
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +70,6 @@ export {
|
||||
type OnMoveStart,
|
||||
type OnMoveEnd,
|
||||
type Connection,
|
||||
type ConnectionStatus,
|
||||
ConnectionMode,
|
||||
type OnConnectStartParams,
|
||||
type OnConnectStart,
|
||||
|
||||
@@ -15,7 +15,8 @@ import {
|
||||
type CoordinateExtent,
|
||||
type UpdateConnection,
|
||||
errorMessages,
|
||||
type NodeOrigin
|
||||
type NodeOrigin,
|
||||
type ConnectionState
|
||||
} from '@xyflow/system';
|
||||
|
||||
import type { EdgeTypes, NodeTypes, Node, Edge, FitViewOptions, ConnectionData } from '$lib/types';
|
||||
@@ -350,12 +351,17 @@ export function createStore({
|
||||
// by creating an internal, unexposed store and using a derived store
|
||||
// we prevent using slow get() calls
|
||||
const currentConnection = writable<ConnectionData>(initConnectionUpdateData);
|
||||
const updateConnection: UpdateConnection = (newConnection: ConnectionData) => {
|
||||
currentConnection.set(newConnection);
|
||||
const updateConnection: UpdateConnection = (newConnection: ConnectionState) => {
|
||||
currentConnection.set({
|
||||
connectionStartHandle: newConnection.fromHandle,
|
||||
connectionEndHandle: newConnection.toHandle,
|
||||
connectionPosition: newConnection.position,
|
||||
connectionStatus: newConnection.isValid ? 'valid' : 'invalid'
|
||||
});
|
||||
};
|
||||
|
||||
function cancelConnection() {
|
||||
updateConnection(initConnectionUpdateData);
|
||||
currentConnection.set(initConnectionUpdateData);
|
||||
}
|
||||
|
||||
function reset() {
|
||||
|
||||
Reference in New Issue
Block a user