@antelopejs/dms-database 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6,6 +6,11 @@ import {
|
|
|
6
6
|
type VueFlowStore,
|
|
7
7
|
} from "@vue-flow/core";
|
|
8
8
|
import dagre from "@dagrejs/dagre";
|
|
9
|
+
import type { ShallowUnwrapRef } from "vue";
|
|
10
|
+
import DiagramNoteNode from "./DiagramNoteNode.vue";
|
|
11
|
+
import DiagramRelationEdge from "./DiagramRelationEdge.vue";
|
|
12
|
+
import DiagramStubNode from "./DiagramStubNode.vue";
|
|
13
|
+
import DiagramTableNode from "./DiagramTableNode.vue";
|
|
9
14
|
import type { SchemaSummary } from "../composables/useDatabaseSchemas";
|
|
10
15
|
import type {
|
|
11
16
|
DiagramNote,
|
|
@@ -192,7 +197,9 @@ const {
|
|
|
192
197
|
// exposes the full imperative VueFlow controller (setNodes/setEdges/fitView/
|
|
193
198
|
// viewport/findNode/onNodeDrag…) via a template ref; all the ERD business
|
|
194
199
|
// logic below (dagre auto-layout, edge routing, undo/redo, notes) stays here.
|
|
195
|
-
|
|
200
|
+
// Vue's expose proxy unwraps the controller's refs: `edges` is the array
|
|
201
|
+
// itself, not a Ref (`edges.value` is undefined and threw on every drag).
|
|
202
|
+
const canvas = shallowRef<ShallowUnwrapRef<VueFlowStore> | null>(null);
|
|
196
203
|
// Our own wrapper element — used to measure the visible canvas for note placement.
|
|
197
204
|
const canvasWrapper = ref<HTMLElement | null>(null);
|
|
198
205
|
|
|
@@ -788,15 +795,19 @@ async function applyChanges() {
|
|
|
788
795
|
}
|
|
789
796
|
}
|
|
790
797
|
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
798
|
+
// Imported directly, not resolved by name: the DMS registers its global
|
|
799
|
+
// components as async components, and the async relation edge was mounted
|
|
800
|
+
// with the HTML namespace — its <path> was created as an HTML element inside
|
|
801
|
+
// the edges <svg>, so no relation line was drawn.
|
|
802
|
+
const nodeTypes = markRaw({
|
|
803
|
+
[TABLE_NODE_TYPE]: DiagramTableNode,
|
|
804
|
+
[STUB_NODE_TYPE]: DiagramStubNode,
|
|
805
|
+
[NOTE_NODE_TYPE]: DiagramNoteNode,
|
|
806
|
+
});
|
|
796
807
|
|
|
797
|
-
const edgeTypes = {
|
|
798
|
-
[RELATION_EDGE_TYPE]:
|
|
799
|
-
};
|
|
808
|
+
const edgeTypes = markRaw({
|
|
809
|
+
[RELATION_EDGE_TYPE]: DiagramRelationEdge,
|
|
810
|
+
});
|
|
800
811
|
|
|
801
812
|
const zoomPercent = computed(
|
|
802
813
|
() => `${Math.round(liveViewport.value.zoom * 100)}%`,
|
|
@@ -810,7 +821,7 @@ function widthForNodeType(type: string | undefined): number {
|
|
|
810
821
|
function recomputeEdgesForNode(nodeId: string) {
|
|
811
822
|
const instance = canvas.value;
|
|
812
823
|
if (!instance) return;
|
|
813
|
-
for (const edge of instance.edges
|
|
824
|
+
for (const edge of instance.edges) {
|
|
814
825
|
if (edge.source !== nodeId && edge.target !== nodeId) continue;
|
|
815
826
|
const sNode = instance.findNode(edge.source);
|
|
816
827
|
const tNode = instance.findNode(edge.target);
|