@floegence/floe-webapp-core 0.101.28 → 0.101.29
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.
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
function w() {
|
|
2
|
-
const
|
|
2
|
+
const t = new Worker(new URL("../../assets/layout-worker-CsLsdMKZ.js", import.meta.url), { type: "module" });
|
|
3
3
|
let a, d = 0;
|
|
4
|
-
const
|
|
5
|
-
a = e,
|
|
6
|
-
for (const r of
|
|
4
|
+
const o = /* @__PURE__ */ new Map(), n = (e) => {
|
|
5
|
+
a = e, t.terminate();
|
|
6
|
+
for (const r of o.values())
|
|
7
7
|
r.cleanup(), r.reject(e);
|
|
8
|
-
|
|
8
|
+
o.clear();
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
t.addEventListener(
|
|
11
11
|
"error",
|
|
12
12
|
(e) => n(new Error(e.message || "Graph layout worker failed"))
|
|
13
|
-
),
|
|
13
|
+
), t.addEventListener(
|
|
14
14
|
"messageerror",
|
|
15
15
|
() => n(new Error("Invalid graph layout worker response"))
|
|
16
|
-
),
|
|
16
|
+
), t.addEventListener("message", ({ data: e }) => {
|
|
17
17
|
if (!e || !Number.isInteger(e.id)) {
|
|
18
18
|
n(new Error("Invalid graph layout worker response"));
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
|
-
const r =
|
|
21
|
+
const r = o.get(e.id);
|
|
22
22
|
if (r) {
|
|
23
23
|
if (!e.error && (r.kind === "layout" ? !e.layout : !Array.isArray(e.edges))) {
|
|
24
24
|
n(new Error("Invalid graph layout worker response"));
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
o.delete(e.id), r.cleanup(), e.error ? r.reject(new Error(e.error)) : r.resolve(r.kind === "layout" ? e.layout : e.edges);
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
30
|
const p = (e, r) => a ? Promise.reject(a) : r?.aborted ? Promise.reject(new DOMException("Graph routing canceled", "AbortError")) : new Promise((l, s) => {
|
|
31
31
|
const i = ++d, u = () => {
|
|
32
|
-
|
|
32
|
+
o.delete(i) && (r?.removeEventListener("abort", u), t.postMessage({ id: i, cancel: !0 }), s(new DOMException("Graph routing canceled", "AbortError")));
|
|
33
33
|
};
|
|
34
|
-
|
|
34
|
+
o.set(i, {
|
|
35
35
|
kind: e.kind,
|
|
36
36
|
resolve: (c) => l(c),
|
|
37
37
|
reject: s,
|
|
38
38
|
cleanup: () => r?.removeEventListener("abort", u)
|
|
39
39
|
}), r?.addEventListener("abort", u, { once: !0 });
|
|
40
40
|
try {
|
|
41
|
-
|
|
41
|
+
t.postMessage({ id: i, ...e });
|
|
42
42
|
} catch (c) {
|
|
43
|
-
|
|
43
|
+
o.delete(i), r?.removeEventListener("abort", u), s(c);
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
46
|
return {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { GraphLayout, GraphLayoutOptions } from './types';
|
|
2
2
|
/** Joint orthogonal routing through the final rectangular geometry. */
|
|
3
|
-
export declare function routeGraphGeometry(layout: GraphLayout, options?: Pick<GraphLayoutOptions, 'edgeClearance' | 'routing'>): Promise<GraphLayout>;
|
|
3
|
+
export declare function routeGraphGeometry(layout: GraphLayout, options?: Pick<GraphLayoutOptions, 'edgeClearance' | 'edgeAnchorInset' | 'routing'>): Promise<GraphLayout>;
|
|
@@ -52,6 +52,8 @@ export interface GraphLayoutOptions {
|
|
|
52
52
|
groupLayouts?: Readonly<Record<string, GraphGroupLayout>>;
|
|
53
53
|
/** Clearance around routing obstacles in world units. Defaults to 4; never changes node geometry. */
|
|
54
54
|
edgeClearance?: number;
|
|
55
|
+
/** Automatic border-anchor distance from corners. Defaults to 8, capped at one quarter of the side. Named ports stay exact. */
|
|
56
|
+
edgeAnchorInset?: number;
|
|
55
57
|
/** Desired width/height when packing disconnected objects, including group members. */
|
|
56
58
|
aspectRatio?: number;
|
|
57
59
|
/** Absolute world positions. Descendants move with their group. Invalid positions always fail. */
|
|
@@ -76,7 +78,7 @@ export interface GraphLayoutOptions {
|
|
|
76
78
|
position: GraphPoint;
|
|
77
79
|
};
|
|
78
80
|
}
|
|
79
|
-
export type GraphRoutingOptions = Pick<GraphLayoutOptions, 'edgeClearance'>;
|
|
81
|
+
export type GraphRoutingOptions = Pick<GraphLayoutOptions, 'edgeClearance' | 'edgeAnchorInset'>;
|
|
80
82
|
export interface GraphGroupLayout {
|
|
81
83
|
/** Row fills left to right; column fills top to bottom. Omitted rules retain automatic layout. */
|
|
82
84
|
flow: 'row' | 'column';
|