fix: some bundle stuff

This commit is contained in:
Braks
2021-07-10 14:28:21 +02:00
parent e87d13afb5
commit f685c7a20a
6 changed files with 13 additions and 18 deletions
+2 -2
View File
@@ -101,8 +101,8 @@ const EdgeCmp = defineComponent({
}
},
setup(props) {
const sourceHandleId = computed(() => props.edge.sourceHandle ?? null);
const targetHandleId = computed(() => props.edge.targetHandle ?? null);
const sourceHandleId = computed(() => props.edge.sourceHandle || null);
const targetHandleId = computed(() => props.edge.targetHandle || null);
const nodes = computed(() => getSourceTargetNodes(props.edge, props.nodes));
const onConnectEdge = (connection: Connection) => {
+3 -3
View File
@@ -42,9 +42,9 @@ const useZoomPanHelper = (): ZoomPanHelperFunctions => {
bounds,
width,
height,
options.minZoom ?? minZoom,
options.maxZoom ?? maxZoom,
options.padding ?? DEFAULT_PADDING
options.minZoom || minZoom,
options.maxZoom || maxZoom,
options.padding || DEFAULT_PADDING
);
const transform = zoomIdentity.translate(x, y).scale(zoom);
+2 -2
View File
@@ -174,8 +174,8 @@ export default function configureStore(
};
},
updateUserSelection(mousePos) {
const startX = this.userSelectionRect.startX ?? 0;
const startY = this.userSelectionRect.startY ?? 0;
const startX = this.userSelectionRect.startX || 0;
const startY = this.userSelectionRect.startY || 0;
const nextUserSelectRect: ReactFlowState['userSelectionRect'] = {
...this.userSelectionRect,
+2 -2
View File
@@ -268,14 +268,14 @@ const parseElements = (nodes: Node[], edges: Edge[]): Elements => {
export const onLoadGetElements = (currentStore: Store<'revue-flow', ReactFlowState>) => {
return (): Elements => {
return parseElements(currentStore.nodes ?? [], currentStore.edges ?? []);
return parseElements(currentStore.nodes || [], currentStore.edges || []);
};
};
export const onLoadToObject = (currentStore: Store<'revue-flow', ReactFlowState>) => {
return (): FlowExportObject => {
return {
elements: parseElements(currentStore.nodes ?? [], currentStore.edges ?? []),
elements: parseElements(currentStore.nodes || [], currentStore.edges || []),
position: [currentStore.transform[0], currentStore.transform[1]],
zoom: currentStore.transform[2]
};