Skip to content

Commit

Permalink
Merge pull request #433 from Doltario/feat/add-get-dom-elements-export
Browse files Browse the repository at this point in the history
Add named export for getDomElements
  • Loading branch information
newcat authored Oct 26, 2024
2 parents 668adb4 + f4087fb commit 96ff993
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/renderer-vue/src/components/Minimap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<script setup lang="ts">
import { computed, onBeforeUnmount, onMounted, ref, watch } from "vue";
import { AbstractNode } from "@baklavajs/core";
import getDomElements, { getDomElementOfNode } from "../connection/domResolver";
import { getDomElements, getDomElementOfNode } from "../connection/domResolver";
import { getPortCoordinates } from "../connection/portCoordinates";
import { useGraph, useViewModel } from "../utility";
Expand Down
6 changes: 3 additions & 3 deletions packages/renderer-vue/src/connection/ConnectionWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { computed, defineComponent, ref, onBeforeUnmount, onMounted, nextTick, watch } from "vue";
import { Connection } from "@baklavajs/core";
import ConnectionView from "./ConnectionView.vue";
import resolveDom, { IResolvedDomElements } from "./domResolver";
import { getDomElements, IResolvedDomElements } from "./domResolver";
import { TemporaryConnectionState } from "./connection";
import { useGraph } from "../utility";
Expand Down Expand Up @@ -51,8 +51,8 @@ export default defineComponent({
};
const updateCoords = () => {
const from = resolveDom(props.connection.from);
const to = resolveDom(props.connection.to);
const from = getDomElements(props.connection.from);
const to = getDomElements(props.connection.to);
if (from.node && to.node) {
if (!resizeObserver) {
resizeObserver = new ResizeObserver(() => {
Expand Down
6 changes: 3 additions & 3 deletions packages/renderer-vue/src/connection/TemporaryConnection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { computed, defineComponent } from "vue";
import ConnectionView from "./ConnectionView.vue";
import { ITemporaryConnection, TemporaryConnectionState } from "./connection";
import resolveDom from "./domResolver";
import { getDomElements } from "./domResolver";
import { getPortCoordinates } from "./portCoordinates";
export default defineComponent({
Expand All @@ -38,9 +38,9 @@ export default defineComponent({
};
}
const start = getPortCoordinates(resolveDom(props.connection.from));
const start = getPortCoordinates(getDomElements(props.connection.from));
const end = props.connection.to
? getPortCoordinates(resolveDom(props.connection.to))
? getPortCoordinates(getDomElements(props.connection.to))
: [props.connection.mx || start[0], props.connection.my || start[1]];
if (props.connection.from.isInput) {
Expand Down
2 changes: 1 addition & 1 deletion packages/renderer-vue/src/connection/domResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function getDomElementOfNode(node: AbstractNode): HTMLElement | null {
return document.getElementById(node.id);
}

export default function getDomElements(ni: NodeInterface): IResolvedDomElements {
export function getDomElements(ni: NodeInterface): IResolvedDomElements {
const interfaceDOM = document.getElementById(ni.id);
const portDOM = interfaceDOM?.getElementsByClassName("__port");

Expand Down

0 comments on commit 96ff993

Please sign in to comment.