@genai-fi/base 4.2.1 → 4.2.2
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.
|
@@ -2,6 +2,8 @@ import { PropsWithChildren } from 'react';
|
|
|
2
2
|
import { IConnection } from './lines';
|
|
3
3
|
interface Props extends PropsWithChildren {
|
|
4
4
|
connections: IConnection[];
|
|
5
|
+
columns?: number;
|
|
6
|
+
ignoredColumns?: number;
|
|
5
7
|
}
|
|
6
|
-
export default function WorkflowLayout({ children, connections }: Props): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default function WorkflowLayout({ children, connections, columns, ignoredColumns }: Props): import("react/jsx-runtime").JSX.Element;
|
|
7
9
|
export {};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { extractNodesFromElements as
|
|
4
|
-
import { s as u, S as
|
|
5
|
-
import { LinesUpdateContext as
|
|
6
|
-
function
|
|
7
|
-
const [
|
|
8
|
-
const r =
|
|
9
|
-
|
|
1
|
+
import { jsx as a, jsxs as h } from "react/jsx-runtime";
|
|
2
|
+
import { useState as x, useRef as f, useCallback as y, useEffect as L } from "react";
|
|
3
|
+
import { extractNodesFromElements as b, generateLines as g } from "./lines.js";
|
|
4
|
+
import { s as u, S as k } from "../../SvgLayer-DHFiKVQ9.js";
|
|
5
|
+
import { LinesUpdateContext as w } from "./svgContext.js";
|
|
6
|
+
function A({ children: o, connections: c, columns: l, ignoredColumns: m }) {
|
|
7
|
+
const [d, p] = x([]), e = f(null), n = f(), i = y(() => {
|
|
8
|
+
const r = b(e.current), s = g(r, c);
|
|
9
|
+
p(s);
|
|
10
10
|
}, [c]);
|
|
11
|
-
return
|
|
11
|
+
return L(() => {
|
|
12
12
|
if (e.current) {
|
|
13
13
|
const r = () => {
|
|
14
14
|
e.current && i();
|
|
@@ -17,29 +17,29 @@ function S({ children: o, connections: c }) {
|
|
|
17
17
|
const s = e.current.children;
|
|
18
18
|
if (s)
|
|
19
19
|
for (let t = 0; t < s.length; ++t) {
|
|
20
|
-
const
|
|
21
|
-
n.current.observe(
|
|
20
|
+
const v = s[t];
|
|
21
|
+
n.current.observe(v);
|
|
22
22
|
}
|
|
23
23
|
return r(), () => {
|
|
24
24
|
var t;
|
|
25
25
|
(t = n.current) == null || t.disconnect();
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
}, [c, i]), /* @__PURE__ */ a("div", { className: u.workspace, children: /* @__PURE__ */ a(
|
|
28
|
+
}, [c, i]), /* @__PURE__ */ a("div", { className: u.workspace, children: /* @__PURE__ */ a(w.Provider, { value: i, children: /* @__PURE__ */ h(
|
|
29
29
|
"div",
|
|
30
30
|
{
|
|
31
31
|
className: u.container,
|
|
32
32
|
ref: e,
|
|
33
33
|
style: {
|
|
34
|
-
gridTemplateColumns: `repeat(${Array.isArray(o) ? o.filter((r) => !!r).length : 1}, max-content)`
|
|
34
|
+
gridTemplateColumns: `repeat(${l !== void 0 ? l : Array.isArray(o) ? o.filter((r) => !!r).length - (m || 0) : 1}, max-content)`
|
|
35
35
|
},
|
|
36
36
|
children: [
|
|
37
|
-
/* @__PURE__ */ a(
|
|
37
|
+
/* @__PURE__ */ a(k, { lines: d }),
|
|
38
38
|
o
|
|
39
39
|
]
|
|
40
40
|
}
|
|
41
41
|
) }) });
|
|
42
42
|
}
|
|
43
43
|
export {
|
|
44
|
-
|
|
44
|
+
A as default
|
|
45
45
|
};
|