Merge branch 'next' into absolute-origin
This commit is contained in:
@@ -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