@floegence/floe-webapp-core 0.84.0 → 0.85.1
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.
- package/dist/components/file-browser/DragPreview.js +1 -1
- package/dist/components/graph/layout.js +51 -50
- package/dist/components/graph/positions.d.ts +3 -3
- package/dist/components/graph/positions.js +135 -100
- package/dist/components/graph/types.d.ts +3 -1
- package/dist/components/notes/NotesOverlay.js +1 -1
- package/dist/components/workbench/WorkbenchFilterBar.js +1 -1
- package/dist/components/workbench/WorkbenchLockButton.js +1 -1
- package/dist/components/workbench/WorkbenchOverlay.js +1 -1
- package/dist/node_modules/.pnpm/{solid-motionone@1.0.4_solid-js@1.9.15 → solid-motionone@1.0.4_solid-js@1.9.17}/node_modules/solid-motionone/dist/index.js +3 -3
- package/package.json +3 -3
- /package/dist/node_modules/.pnpm/{@solid-primitives_props@3.2.4_solid-js@1.9.15 → @solid-primitives_props@3.2.4_solid-js@1.9.17}/node_modules/@solid-primitives/props/dist/combineProps.js +0 -0
- /package/dist/node_modules/.pnpm/{@solid-primitives_refs@1.1.4_solid-js@1.9.15 → @solid-primitives_refs@1.1.4_solid-js@1.9.17}/node_modules/@solid-primitives/refs/dist/index.js +0 -0
- /package/dist/node_modules/.pnpm/{@solid-primitives_transition-group@1.1.2_solid-js@1.9.15 → @solid-primitives_transition-group@1.1.2_solid-js@1.9.17}/node_modules/@solid-primitives/transition-group/dist/index.js +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createComponent as o, Portal as N, insert as l, effect as u, className as $, memo as B, template as a, setAttribute as A } from "solid-js/web";
|
|
2
2
|
import { createSignal as F, createEffect as V, createMemo as d, Show as m, For as j } from "solid-js";
|
|
3
|
-
import { Presence as U, Motion as X } from "../../node_modules/.pnpm/solid-motionone@1.0.4_solid-js@1.9.
|
|
3
|
+
import { Presence as U, Motion as X } from "../../node_modules/.pnpm/solid-motionone@1.0.4_solid-js@1.9.17/node_modules/solid-motionone/dist/index.js";
|
|
4
4
|
import { cn as f } from "../../utils/cn.js";
|
|
5
5
|
import { useFileBrowserDrag as G } from "../../context/FileBrowserDragContext.js";
|
|
6
6
|
import { FileItemIcon as W } from "./FileIcons.js";
|
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
import { applyGraphPositions as v } from "./positions.js";
|
|
2
2
|
function $(i) {
|
|
3
|
-
const n = /* @__PURE__ */ new Set(), p = (
|
|
4
|
-
if (!
|
|
5
|
-
n.add(
|
|
6
|
-
}, s = new Map(i.nodes.map((
|
|
7
|
-
for (const
|
|
8
|
-
if (p(
|
|
9
|
-
throw new Error(`Invalid dimensions for graph node: ${
|
|
10
|
-
for (const r of
|
|
11
|
-
const a = /* @__PURE__ */ new Set([
|
|
12
|
-
let d =
|
|
3
|
+
const n = /* @__PURE__ */ new Set(), p = (t) => {
|
|
4
|
+
if (!t || n.has(t)) throw new Error(`Duplicate or empty graph ID: ${t}`);
|
|
5
|
+
n.add(t);
|
|
6
|
+
}, s = new Map(i.nodes.map((t) => [t.id, t]));
|
|
7
|
+
for (const t of i.nodes) {
|
|
8
|
+
if (p(t.id), ![t.width, t.height].every((r) => Number.isFinite(r) && r > 0))
|
|
9
|
+
throw new Error(`Invalid dimensions for graph node: ${t.id}`);
|
|
10
|
+
for (const r of t.ports ?? []) p(r.id);
|
|
11
|
+
const a = /* @__PURE__ */ new Set([t.id]);
|
|
12
|
+
let d = t.parentId;
|
|
13
13
|
for (; d !== void 0; ) {
|
|
14
14
|
const r = s.get(d);
|
|
15
15
|
if (!r || r.kind !== "group")
|
|
16
|
-
throw new Error(`Invalid parent for graph node: ${
|
|
17
|
-
if (a.has(d)) throw new Error(`Cyclic graph containment: ${
|
|
16
|
+
throw new Error(`Invalid parent for graph node: ${t.id}`);
|
|
17
|
+
if (a.has(d)) throw new Error(`Cyclic graph containment: ${t.id}`);
|
|
18
18
|
a.add(d), d = r.parentId;
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
for (const
|
|
22
|
-
p(
|
|
21
|
+
for (const t of i.edges) {
|
|
22
|
+
p(t.id);
|
|
23
23
|
for (const [a, d] of [
|
|
24
|
-
[
|
|
25
|
-
[
|
|
24
|
+
[t.source, t.sourcePort],
|
|
25
|
+
[t.target, t.targetPort]
|
|
26
26
|
]) {
|
|
27
27
|
const r = s.get(a);
|
|
28
28
|
if (!r || d !== void 0 && !r.ports?.some((c) => c.id === d))
|
|
29
|
-
throw new Error(`Invalid endpoint for graph edge: ${
|
|
29
|
+
throw new Error(`Invalid endpoint for graph edge: ${t.id}`);
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
async function O(i, n, p) {
|
|
34
34
|
$(i);
|
|
35
35
|
const s = n.groupPadding ?? { top: 64, right: 28, bottom: 28, left: 28 };
|
|
36
|
-
if (![...Object.values(s), n.spacing ?? 64].every((
|
|
36
|
+
if (![...Object.values(s), n.spacing ?? 64].every((e) => Number.isFinite(e) && e >= 0))
|
|
37
37
|
throw new Error("Graph layout spacing must be finite and nonnegative");
|
|
38
|
-
const
|
|
39
|
-
for (const
|
|
40
|
-
|
|
41
|
-
id:
|
|
42
|
-
width:
|
|
43
|
-
height:
|
|
44
|
-
...
|
|
45
|
-
ports:
|
|
38
|
+
const t = /* @__PURE__ */ new Map();
|
|
39
|
+
for (const e of i.nodes)
|
|
40
|
+
t.set(e.id, {
|
|
41
|
+
id: e.id,
|
|
42
|
+
width: e.width,
|
|
43
|
+
height: e.height,
|
|
44
|
+
...e.kind === "group" ? { children: [] } : {},
|
|
45
|
+
ports: e.ports?.map((o) => ({
|
|
46
46
|
id: o.id,
|
|
47
47
|
width: 1,
|
|
48
48
|
height: 1,
|
|
@@ -54,21 +54,21 @@ async function O(i, n, p) {
|
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
56
|
const a = [];
|
|
57
|
-
for (const
|
|
58
|
-
(
|
|
57
|
+
for (const e of i.nodes)
|
|
58
|
+
(e.parentId ? t.get(e.parentId).children : a).push(t.get(e.id));
|
|
59
59
|
const d = /* @__PURE__ */ new Set([
|
|
60
|
-
...i.nodes.flatMap((
|
|
61
|
-
...i.edges.map((
|
|
60
|
+
...i.nodes.flatMap((e) => [e.id, ...(e.ports ?? []).map((o) => o.id)]),
|
|
61
|
+
...i.edges.map((e) => e.id)
|
|
62
62
|
]);
|
|
63
63
|
let r = "$graph";
|
|
64
64
|
for (; d.has(r); ) r += "$";
|
|
65
65
|
const c = await p.layout({
|
|
66
66
|
id: r,
|
|
67
67
|
children: a,
|
|
68
|
-
edges: i.edges.map((
|
|
69
|
-
id:
|
|
70
|
-
sources: [
|
|
71
|
-
targets: [
|
|
68
|
+
edges: i.edges.map((e) => ({
|
|
69
|
+
id: e.id,
|
|
70
|
+
sources: [e.sourcePort ?? e.source],
|
|
71
|
+
targets: [e.targetPort ?? e.target]
|
|
72
72
|
})),
|
|
73
73
|
layoutOptions: {
|
|
74
74
|
"elk.algorithm": "layered",
|
|
@@ -80,9 +80,9 @@ async function O(i, n, p) {
|
|
|
80
80
|
"elk.layered.considerModelOrder.strategy": "NODES_AND_EDGES",
|
|
81
81
|
"elk.randomSeed": "1"
|
|
82
82
|
}
|
|
83
|
-
}), f = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Map(), I = (
|
|
84
|
-
for (const o of
|
|
85
|
-
const h = o.container ??
|
|
83
|
+
}), f = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Map(), I = (e) => {
|
|
84
|
+
for (const o of e.edges ?? []) {
|
|
85
|
+
const h = o.container ?? e.id, l = f.get(h) ?? { x: 0, y: 0 };
|
|
86
86
|
x.set(
|
|
87
87
|
o.id,
|
|
88
88
|
(o.sections ?? []).map(
|
|
@@ -93,30 +93,31 @@ async function O(i, n, p) {
|
|
|
93
93
|
)
|
|
94
94
|
);
|
|
95
95
|
}
|
|
96
|
-
for (const o of
|
|
97
|
-
}, E = (
|
|
98
|
-
const l = o + (
|
|
99
|
-
f.set(
|
|
100
|
-
for (const w of
|
|
96
|
+
for (const o of e.children ?? []) I(o);
|
|
97
|
+
}, E = (e, o, h) => {
|
|
98
|
+
const l = o + (e.x ?? 0), g = h + (e.y ?? 0);
|
|
99
|
+
f.set(e.id, { x: l, y: g, width: e.width ?? 0, height: e.height ?? 0 });
|
|
100
|
+
for (const w of e.children ?? []) E(w, l, g);
|
|
101
101
|
};
|
|
102
|
-
for (const
|
|
102
|
+
for (const e of c.children ?? []) E(e, 0, 0);
|
|
103
103
|
I(c);
|
|
104
|
-
const y = !n.positions?.length && n.anchor && f.get(n.anchor.nodeId), m = y ? n.anchor.position.x - y.x : 0, u = y ? n.anchor.position.y - y.y : 0, k = i.nodes.map((
|
|
105
|
-
const o = f.get(
|
|
106
|
-
return { ...
|
|
104
|
+
const y = !n.positions?.length && n.anchor && f.get(n.anchor.nodeId), m = y ? n.anchor.position.x - y.x : 0, u = y ? n.anchor.position.y - y.y : 0, k = i.nodes.map((e) => {
|
|
105
|
+
const o = f.get(e.id);
|
|
106
|
+
return { ...e, ...o, x: o.x + m, y: o.y + u };
|
|
107
107
|
});
|
|
108
108
|
return v(
|
|
109
109
|
{
|
|
110
110
|
nodes: k,
|
|
111
|
-
edges: i.edges.map((
|
|
112
|
-
...
|
|
113
|
-
sections: (x.get(
|
|
111
|
+
edges: i.edges.map((e) => ({
|
|
112
|
+
...e,
|
|
113
|
+
sections: (x.get(e.id) ?? []).map(
|
|
114
114
|
(o) => o.map((h) => ({ x: h.x + m, y: h.y + u }))
|
|
115
115
|
)
|
|
116
116
|
})),
|
|
117
117
|
bounds: { x: m, y: u, width: c.width ?? 0, height: c.height ?? 0 }
|
|
118
118
|
},
|
|
119
|
-
n
|
|
119
|
+
n,
|
|
120
|
+
i.nodes
|
|
120
121
|
);
|
|
121
122
|
}
|
|
122
123
|
export {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { GraphLayout, GraphLayoutOptions } from './types';
|
|
2
|
-
/** Apply
|
|
3
|
-
export declare function applyGraphPositions(layout: GraphLayout, options: GraphLayoutOptions): GraphLayout;
|
|
1
|
+
import type { GraphLayout, GraphLayoutOptions, GraphNode } from './types';
|
|
2
|
+
/** Apply explicit fixed or preferred positions, then route the resulting geometry once. */
|
|
3
|
+
export declare function applyGraphPositions(layout: GraphLayout, options: GraphLayoutOptions, input: readonly GraphNode[]): GraphLayout;
|
|
@@ -1,134 +1,169 @@
|
|
|
1
|
-
const
|
|
2
|
-
left:
|
|
3
|
-
top:
|
|
4
|
-
right:
|
|
5
|
-
bottom:
|
|
6
|
-
}),
|
|
7
|
-
(
|
|
1
|
+
const H = (e, n = 0) => ({
|
|
2
|
+
left: e.x - n,
|
|
3
|
+
top: e.y - n,
|
|
4
|
+
right: e.x + e.width + n,
|
|
5
|
+
bottom: e.y + e.height + n
|
|
6
|
+
}), N = (e, n) => e.x > n.left && e.x < n.right && e.y > n.top && e.y < n.bottom, W = (e, n, v) => !v.some(
|
|
7
|
+
(r) => e.x === n.x ? e.x > r.left && e.x < r.right && Math.max(e.y, n.y) > r.top && Math.min(e.y, n.y) < r.bottom : e.y > r.top && e.y < r.bottom && Math.max(e.x, n.x) > r.left && Math.min(e.x, n.x) < r.right
|
|
8
8
|
);
|
|
9
|
-
function
|
|
10
|
-
if (
|
|
9
|
+
function A(e, n, v) {
|
|
10
|
+
if (v.some((h) => N(e, h) || N(n, h)))
|
|
11
11
|
throw new Error("Pinned graph positions obstruct an edge endpoint");
|
|
12
|
-
const
|
|
13
|
-
.../* @__PURE__ */ new Set([
|
|
14
|
-
].sort((
|
|
15
|
-
.../* @__PURE__ */ new Set([
|
|
16
|
-
].sort((
|
|
17
|
-
let
|
|
18
|
-
for (
|
|
19
|
-
const c =
|
|
20
|
-
if (
|
|
21
|
-
|
|
12
|
+
const r = [
|
|
13
|
+
.../* @__PURE__ */ new Set([e.x, n.x, ...v.flatMap((h) => [h.left, h.right])])
|
|
14
|
+
].sort((h, t) => h - t), I = [
|
|
15
|
+
.../* @__PURE__ */ new Set([e.y, n.y, ...v.flatMap((h) => [h.top, h.bottom])])
|
|
16
|
+
].sort((h, t) => h - t), w = (h) => ({ x: r[h % r.length], y: I[Math.floor(h / r.length)] }), M = I.indexOf(e.y) * r.length + r.indexOf(e.x), b = I.indexOf(n.y) * r.length + r.indexOf(n.x), S = /* @__PURE__ */ new Map([[M, 0]]), O = /* @__PURE__ */ new Map(), y = [], E = (h) => {
|
|
17
|
+
let t = y.length;
|
|
18
|
+
for (y.push(h); t > 0; ) {
|
|
19
|
+
const c = t - 1 >> 1;
|
|
20
|
+
if (y[c].score <= h.score) break;
|
|
21
|
+
y[t] = y[c], t = c;
|
|
22
22
|
}
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
const
|
|
26
|
-
if (
|
|
23
|
+
y[t] = h;
|
|
24
|
+
}, T = () => {
|
|
25
|
+
const h = y[0], t = y.pop();
|
|
26
|
+
if (y.length) {
|
|
27
27
|
let c = 0;
|
|
28
|
-
for (; c * 2 + 1 <
|
|
29
|
-
let
|
|
30
|
-
if (
|
|
31
|
-
|
|
28
|
+
for (; c * 2 + 1 < y.length; ) {
|
|
29
|
+
let p = c * 2 + 1;
|
|
30
|
+
if (p + 1 < y.length && y[p + 1].score < y[p].score && p++, y[p].score >= t.score) break;
|
|
31
|
+
y[c] = y[p], c = p;
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
y[c] = t;
|
|
34
34
|
}
|
|
35
|
-
return
|
|
35
|
+
return h;
|
|
36
36
|
};
|
|
37
|
-
|
|
38
|
-
let
|
|
39
|
-
for (;
|
|
40
|
-
const
|
|
41
|
-
if (
|
|
42
|
-
if (
|
|
43
|
-
const x = [
|
|
44
|
-
let
|
|
45
|
-
for (;
|
|
46
|
-
|
|
47
|
-
return x.reverse(), x.filter((
|
|
48
|
-
const
|
|
49
|
-
return !
|
|
37
|
+
E({ id: M, score: 0, cost: 0 });
|
|
38
|
+
let P = 0;
|
|
39
|
+
for (; y.length && P++ < 5e4; ) {
|
|
40
|
+
const h = T();
|
|
41
|
+
if (h.cost !== S.get(h.id)) continue;
|
|
42
|
+
if (h.id === b) {
|
|
43
|
+
const x = [w(b)];
|
|
44
|
+
let s = b;
|
|
45
|
+
for (; s !== M; )
|
|
46
|
+
s = O.get(s), x.push(w(s));
|
|
47
|
+
return x.reverse(), x.filter((a, o) => {
|
|
48
|
+
const f = x[o - 1], m = x[o + 1];
|
|
49
|
+
return !f || !m || !(f.x === a.x && a.x === m.x || f.y === a.y && a.y === m.y);
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
|
-
const
|
|
53
|
-
c ?
|
|
54
|
-
c + 1 <
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
const t = w(h.id), c = h.id % r.length, p = Math.floor(h.id / r.length), d = [
|
|
53
|
+
c ? h.id - 1 : -1,
|
|
54
|
+
c + 1 < r.length ? h.id + 1 : -1,
|
|
55
|
+
p ? h.id - r.length : -1,
|
|
56
|
+
p + 1 < I.length ? h.id + r.length : -1
|
|
57
57
|
];
|
|
58
|
-
for (const x of
|
|
58
|
+
for (const x of d) {
|
|
59
59
|
if (x < 0) continue;
|
|
60
|
-
const
|
|
61
|
-
|
|
60
|
+
const s = w(x), a = h.cost + Math.abs(t.x - s.x) + Math.abs(t.y - s.y);
|
|
61
|
+
a >= (S.get(x) ?? 1 / 0) || !W(t, s, v) || (S.set(x, a), O.set(x, h.id), E({ id: x, cost: a, score: a + Math.abs(s.x - n.x) + Math.abs(s.y - n.y) }));
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
throw new Error("Pinned graph positions cannot be routed within the layout budget");
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
if (!
|
|
68
|
-
const
|
|
69
|
-
for (const t of
|
|
70
|
-
if (!
|
|
66
|
+
function F(e, n, v) {
|
|
67
|
+
if (!n.positions?.length) return e;
|
|
68
|
+
const r = new Map(e.nodes.map((t) => [t.id, { ...t }])), I = /* @__PURE__ */ new Map();
|
|
69
|
+
for (const t of n.positions) {
|
|
70
|
+
if (!r.has(t.nodeId) || I.has(t.nodeId) || !Number.isFinite(t.x) || !Number.isFinite(t.y))
|
|
71
71
|
throw new Error(`Invalid graph position: ${t.nodeId}`);
|
|
72
|
-
|
|
72
|
+
I.set(t.nodeId, t);
|
|
73
73
|
}
|
|
74
|
-
const
|
|
75
|
-
for (const t of
|
|
74
|
+
const w = /* @__PURE__ */ new Map();
|
|
75
|
+
for (const t of r.values())
|
|
76
76
|
if (t.parentId) {
|
|
77
|
-
const
|
|
78
|
-
|
|
77
|
+
const c = w.get(t.parentId) ?? [];
|
|
78
|
+
c.push(t), w.set(t.parentId, c);
|
|
79
79
|
}
|
|
80
|
-
const
|
|
81
|
-
const
|
|
82
|
-
t.x =
|
|
83
|
-
const
|
|
84
|
-
for (const
|
|
85
|
-
if (!
|
|
86
|
-
const
|
|
87
|
-
if (
|
|
80
|
+
const M = n.groupPadding ?? { top: 64, left: 28, right: 28, bottom: 28 }, b = n.positionMode === "preferred", S = new Map(v.map((t) => [t.id, t])), O = (t, c, p) => {
|
|
81
|
+
const d = { x: t.x, y: t.y }, x = I.get(t.id);
|
|
82
|
+
t.x = x?.x ?? t.x + c, t.y = x?.y ?? t.y + p;
|
|
83
|
+
const s = w.get(t.id) ?? [];
|
|
84
|
+
for (const l of s) O(l, t.x - d.x, t.y - d.y);
|
|
85
|
+
if (!s.length || b) return;
|
|
86
|
+
const a = Math.min(...s.map((l) => l.x)) - M.left, o = Math.min(...s.map((l) => l.y)) - M.top;
|
|
87
|
+
if (x && (a < t.x || o < t.y))
|
|
88
88
|
throw new Error(`Pinned child lies outside group content: ${t.id}`);
|
|
89
89
|
const f = Math.max(
|
|
90
90
|
t.x + t.width,
|
|
91
|
-
...
|
|
92
|
-
),
|
|
91
|
+
...s.map((l) => l.x + l.width + M.right)
|
|
92
|
+
), m = Math.max(
|
|
93
93
|
t.y + t.height,
|
|
94
|
-
...
|
|
94
|
+
...s.map((l) => l.y + l.height + M.bottom)
|
|
95
95
|
);
|
|
96
|
-
|
|
96
|
+
x || (t.x = Math.min(t.x, a), t.y = Math.min(t.y, o)), t.width = f - t.x, t.height = m - t.y;
|
|
97
97
|
};
|
|
98
|
-
for (const t of
|
|
99
|
-
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
98
|
+
for (const t of r.values()) t.parentId || O(t, 0, 0);
|
|
99
|
+
if (b) {
|
|
100
|
+
const t = Math.max(16, n.spacing ?? 64), c = (s, a, o) => {
|
|
101
|
+
s.x += a, s.y += o;
|
|
102
|
+
for (const f of w.get(s.id) ?? []) c(f, a, o);
|
|
103
|
+
}, p = (s) => {
|
|
104
|
+
const a = [];
|
|
105
|
+
for (const o of [...s].sort(
|
|
106
|
+
(f, m) => f.y - m.y || f.x - m.x || f.id.localeCompare(m.id)
|
|
107
|
+
)) {
|
|
108
|
+
const f = { x: o.x, y: o.y };
|
|
109
|
+
for (const i of [...a].sort((g, u) => g.x - u.x))
|
|
110
|
+
o.y < i.y + i.height + t && o.y + o.height + t > i.y && f.x < i.x + i.width + t && f.x + o.width + t > i.x && (f.x = i.x + i.width + t);
|
|
111
|
+
const m = { x: o.x, y: o.y };
|
|
112
|
+
for (const i of [...a].sort((g, u) => g.y - u.y))
|
|
113
|
+
o.x < i.x + i.width + t && o.x + o.width + t > i.x && m.y < i.y + i.height + t && m.y + o.height + t > i.y && (m.y = i.y + i.height + t);
|
|
114
|
+
const l = f.x - o.x < m.y - o.y ? f : m;
|
|
115
|
+
c(o, l.x - o.x, l.y - o.y), a.push(o);
|
|
116
|
+
}
|
|
117
|
+
}, d = (s) => {
|
|
118
|
+
const a = w.get(s.id) ?? [];
|
|
119
|
+
if (!a.length) return;
|
|
120
|
+
for (const g of a) d(g);
|
|
121
|
+
p(a);
|
|
122
|
+
const o = Math.max(12, M.left), f = Math.max(12, M.top), m = Math.max(12, M.right), l = Math.max(12, M.bottom), i = I.get(s.id);
|
|
123
|
+
s.x = Math.min(i?.x ?? 1 / 0, Math.min(...a.map((g) => g.x)) - o), s.y = Math.min(i?.y ?? 1 / 0, Math.min(...a.map((g) => g.y)) - f), s.width = Math.max(
|
|
124
|
+
S.get(s.id).width,
|
|
125
|
+
Math.max(...a.map((g) => g.x + g.width)) + m - s.x
|
|
126
|
+
), s.height = Math.max(
|
|
127
|
+
S.get(s.id).height,
|
|
128
|
+
Math.max(...a.map((g) => g.y + g.height)) + l - s.y
|
|
129
|
+
);
|
|
130
|
+
}, x = [...r.values()].filter((s) => !s.parentId);
|
|
131
|
+
for (const s of x) d(s);
|
|
132
|
+
p(x);
|
|
133
|
+
}
|
|
134
|
+
const y = e.edges.map((t) => {
|
|
135
|
+
const c = r.get(t.source), p = r.get(t.target), d = (i, g, u) => i.ports?.find((k) => k.id === g)?.side ?? u, x = c.x + c.width / 2 <= p.x + p.width / 2, s = (i, g) => {
|
|
136
|
+
const u = { x: i.x + i.width / 2, y: i.y + i.height / 2 };
|
|
137
|
+
return g === "NORTH" ? [
|
|
138
|
+
{ x: u.x, y: i.y },
|
|
139
|
+
{ x: u.x, y: i.y - 8 }
|
|
140
|
+
] : g === "SOUTH" ? [
|
|
141
|
+
{ x: u.x, y: i.y + i.height },
|
|
142
|
+
{ x: u.x, y: i.y + i.height + 8 }
|
|
143
|
+
] : g === "WEST" ? [
|
|
144
|
+
{ x: i.x, y: u.y },
|
|
145
|
+
{ x: i.x - 8, y: u.y }
|
|
111
146
|
] : [
|
|
112
|
-
{ x:
|
|
113
|
-
{ x:
|
|
147
|
+
{ x: i.x + i.width, y: u.y },
|
|
148
|
+
{ x: i.x + i.width + 8, y: u.y }
|
|
114
149
|
];
|
|
115
|
-
}, [
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
),
|
|
119
|
-
return { ...t, sections: [[
|
|
120
|
-
}),
|
|
150
|
+
}, [a, o] = s(c, d(c, t.sourcePort, x ? "EAST" : "WEST")), [f, m] = s(
|
|
151
|
+
p,
|
|
152
|
+
d(p, t.targetPort, c === p ? "NORTH" : x ? "WEST" : "EAST")
|
|
153
|
+
), l = [...r.values()].filter((i) => i.kind !== "group").map((i) => H(i, 4));
|
|
154
|
+
return { ...t, sections: [[a, ...A(o, m, l), f]] };
|
|
155
|
+
}), E = [...r.values()], T = y.flatMap((t) => t.sections.flat()), P = Math.min(...E.map((t) => t.x), ...T.map((t) => t.x)), h = Math.min(...E.map((t) => t.y), ...T.map((t) => t.y));
|
|
121
156
|
return {
|
|
122
|
-
nodes:
|
|
123
|
-
edges:
|
|
157
|
+
nodes: E,
|
|
158
|
+
edges: y,
|
|
124
159
|
bounds: {
|
|
125
|
-
x:
|
|
126
|
-
y:
|
|
127
|
-
width: Math.max(...
|
|
128
|
-
height: Math.max(...
|
|
160
|
+
x: P,
|
|
161
|
+
y: h,
|
|
162
|
+
width: Math.max(...E.map((t) => t.x + t.width), ...T.map((t) => t.x)) - P,
|
|
163
|
+
height: Math.max(...E.map((t) => t.y + t.height), ...T.map((t) => t.y)) - h
|
|
129
164
|
}
|
|
130
165
|
};
|
|
131
166
|
}
|
|
132
167
|
export {
|
|
133
|
-
|
|
168
|
+
F as applyGraphPositions
|
|
134
169
|
};
|
|
@@ -46,10 +46,12 @@ export interface GraphLayout {
|
|
|
46
46
|
bounds: GraphBounds;
|
|
47
47
|
}
|
|
48
48
|
export interface GraphLayoutOptions {
|
|
49
|
-
/** Absolute world positions. Descendants move with
|
|
49
|
+
/** Absolute world positions. Descendants move with their group. Invalid positions always fail. */
|
|
50
50
|
positions?: readonly (GraphPoint & {
|
|
51
51
|
nodeId: string;
|
|
52
52
|
})[];
|
|
53
|
+
/** Fixed (default) rejects impossible geometry. Preferred retains clear positions and separates colliding siblings, resizing groups around their content before routing. */
|
|
54
|
+
positionMode?: 'fixed' | 'preferred';
|
|
53
55
|
direction?: 'RIGHT' | 'DOWN' | 'LEFT' | 'UP';
|
|
54
56
|
spacing?: number;
|
|
55
57
|
groupPadding?: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createComponent as n, insert as l, addEventListener as v, effect as C, setAttribute as F, Portal as d, memo as P, template as c, delegateEvents as L } from "solid-js/web";
|
|
2
2
|
import { createMemo as R, createEffect as f, onCleanup as _, Show as s } from "solid-js";
|
|
3
|
-
import { Motion as w } from "../../node_modules/.pnpm/solid-motionone@1.0.4_solid-js@1.9.
|
|
3
|
+
import { Motion as w } from "../../node_modules/.pnpm/solid-motionone@1.0.4_solid-js@1.9.17/node_modules/solid-motionone/dist/index.js";
|
|
4
4
|
import { easing as B, duration as k } from "../../utils/animations.js";
|
|
5
5
|
import { useOverlayMask as K } from "../../hooks/useOverlayMask.js";
|
|
6
6
|
import { X as Z } from "../icons/index.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { insert as m, createComponent as d, effect as K, setAttribute as I, memo as B, className as He, template as $, Dynamic as Ke, Portal as We, setStyleProperty as Ne, use as Ve, delegateEvents as Ge } from "solid-js/web";
|
|
2
2
|
import { createSignal as de, onCleanup as p, createEffect as ee, createMemo as A, Show as R, For as te, Index as Ue } from "solid-js";
|
|
3
|
-
import { Motion as W } from "../../node_modules/.pnpm/solid-motionone@1.0.4_solid-js@1.9.
|
|
3
|
+
import { Motion as W } from "../../node_modules/.pnpm/solid-motionone@1.0.4_solid-js@1.9.17/node_modules/solid-motionone/dist/index.js";
|
|
4
4
|
import { easing as N, duration as V } from "../../utils/animations.js";
|
|
5
5
|
import { Plus as qe } from "../icons/index.js";
|
|
6
6
|
import { startHotInteraction as ze } from "../../utils/hotInteraction.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { insert as n, createComponent as c, memo as s, effect as d, setAttribute as u, template as k, delegateEvents as v } from "solid-js/web";
|
|
2
|
-
import { Motion as m } from "../../node_modules/.pnpm/solid-motionone@1.0.4_solid-js@1.9.
|
|
2
|
+
import { Motion as m } from "../../node_modules/.pnpm/solid-motionone@1.0.4_solid-js@1.9.17/node_modules/solid-motionone/dist/index.js";
|
|
3
3
|
import { easing as f, duration as h } from "../../utils/animations.js";
|
|
4
4
|
import { Lock as g, Unlock as _ } from "../icons/index.js";
|
|
5
5
|
var L = /* @__PURE__ */ k("<button type=button class=workbench-lock-button data-floe-surface=floating data-floe-canvas-interactive=true><span class=workbench-lock-button__icon>"), w = /* @__PURE__ */ k("<span class=workbench-lock-button__kbd>");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createComponent as r, insert as l, template as s, delegateEvents as y } from "solid-js/web";
|
|
2
2
|
import { Show as f } from "solid-js";
|
|
3
|
-
import { Motion as i } from "../../node_modules/.pnpm/solid-motionone@1.0.4_solid-js@1.9.
|
|
3
|
+
import { Motion as i } from "../../node_modules/.pnpm/solid-motionone@1.0.4_solid-js@1.9.17/node_modules/solid-motionone/dist/index.js";
|
|
4
4
|
import { easing as h, duration as c } from "../../utils/animations.js";
|
|
5
5
|
import { useOverlayMask as b } from "../../hooks/useOverlayMask.js";
|
|
6
6
|
import { X as v } from "../icons/index.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createComponent as m, mergeProps as v, Dynamic as x } from "solid-js/web";
|
|
2
2
|
import { createSignal as p, createContext as d, splitProps as P, useContext as l, createEffect as u, onCleanup as S, batch as c } from "solid-js";
|
|
3
|
-
import { resolveFirst as E } from "../../../../@solid-primitives_refs@1.1.4_solid-js@1.9.
|
|
4
|
-
import { createSwitchTransition as y } from "../../../../@solid-primitives_transition-group@1.1.2_solid-js@1.9.
|
|
5
|
-
import { combineStyle as C } from "../../../../@solid-primitives_props@3.2.4_solid-js@1.9.
|
|
3
|
+
import { resolveFirst as E } from "../../../../@solid-primitives_refs@1.1.4_solid-js@1.9.17/node_modules/@solid-primitives/refs/dist/index.js";
|
|
4
|
+
import { createSwitchTransition as y } from "../../../../@solid-primitives_transition-group@1.1.2_solid-js@1.9.17/node_modules/@solid-primitives/transition-group/dist/index.js";
|
|
5
|
+
import { combineStyle as C } from "../../../../@solid-primitives_props@3.2.4_solid-js@1.9.17/node_modules/@solid-primitives/props/dist/combineProps.js";
|
|
6
6
|
import { createMotionState as h, mountedStates as M } from "../../../../@motionone_dom@10.18.0/node_modules/@motionone/dom/dist/state/index.es.js";
|
|
7
7
|
import { createStyles as T } from "../../../../@motionone_dom@10.18.0/node_modules/@motionone/dom/dist/animate/utils/style-object.es.js";
|
|
8
8
|
var g = d(), D = (t) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@floegence/floe-webapp-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.85.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
"clean": "rm -rf dist *.tsbuildinfo"
|
|
157
157
|
},
|
|
158
158
|
"peerDependencies": {
|
|
159
|
-
"solid-js": "^1.
|
|
159
|
+
"solid-js": "^1.9.17"
|
|
160
160
|
},
|
|
161
161
|
"dependencies": {
|
|
162
162
|
"clsx": "^2.1.1",
|
|
@@ -173,7 +173,7 @@
|
|
|
173
173
|
},
|
|
174
174
|
"devDependencies": {
|
|
175
175
|
"@tailwindcss/vite": "^4.3.3",
|
|
176
|
-
"solid-js": "^1.9.
|
|
176
|
+
"solid-js": "^1.9.17",
|
|
177
177
|
"tailwindcss": "^4.3.3",
|
|
178
178
|
"typescript": "^5.9.3",
|
|
179
179
|
"vite": "^7.3.6",
|
|
File without changes
|
|
File without changes
|