@genai-fi/base 4.2.0 → 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.
@@ -1 +1 @@
1
- ._sidePanel_1j2co_1{background:#fff;display:flex;z-index:2;flex-shrink:0;position:relative;transition:opacity .3s ease-in;opacity:0}._sidePanel_1j2co_1._closed_1j2co_14{opacity:0;transition:width .3s cubic-bezier(.4,0,.2,1),opacity .3s ease-out}._sidePanel_1j2co_1._opening_1j2co_19{opacity:1;transition:width .3s cubic-bezier(.4,0,.2,1),opacity .3s ease-in}._sidePanel_1j2co_1._open_1j2co_19{opacity:1}._resizer_1j2co_28{width:30px;cursor:ew-resize;background-color:transparent;box-sizing:border-box;position:absolute;left:-8px;opacity:1;touch-action:none;-webkit-user-select:none;user-select:none;top:0;bottom:0;z-index:2}._noSelect_1j2co_43{-webkit-user-select:none;user-select:none}._resizerBar_1j2co_47{position:absolute;top:0;left:7px;width:2px;height:100%;background-color:#ddd;touch-action:none;-webkit-user-select:none;user-select:none}._resizer_1j2co_28:hover ._resizerBar_1j2co_47{background-color:#75a4e288}._resizer_1j2co_28._resizing_1j2co_62 ._resizerBar_1j2co_47{background-color:#75a4e2}._resizerHandle_1j2co_66{position:absolute;top:50%;left:2px;width:10px;height:60px;transform:translateY(-50%);background-color:#fff;border-radius:3px;border:2px solid #ddd;box-shadow:0 0 4px #ccc;display:flex;align-items:center;justify-content:center;touch-action:none;-webkit-user-select:none;user-select:none}._resizerHandle_1j2co_66._minimised_1j2co_84{left:-15px;width:20px}._resizerHandle_1j2co_66:focus{outline:2px solid #75a4e2;outline-offset:2px}._resizerHandle_1j2co_66:before{content:"";display:block;width:4px;height:20px;background:radial-gradient(circle,#bbb 1.5px,transparent 1.5px) 0 2px,radial-gradient(circle,#bbb 1.5px,transparent 1.5px) 0 8px,radial-gradient(circle,#bbb 1.5px,transparent 1.5px) 0 14px;background-repeat:no-repeat;background-size:4px 4px}._resizer_1j2co_28:hover ._resizerHandle_1j2co_66,._resizer_1j2co_28._resizing_1j2co_62 ._resizerHandle_1j2co_66{border-color:#75a4e2}._expand_1j2co_114{position:absolute;top:2rem;right:0;height:40px;width:30px;background-color:#fff;border-radius:3px;border:2px solid #ddd;cursor:pointer;display:flex;align-items:center;justify-content:center}._content_1j2co_130{flex-grow:1;overflow:auto;min-width:300px!important;position:relative}._closeButton_1j2co_137{position:absolute;top:.5rem;right:.5rem}
1
+ ._sidePanel_fhsa8_1{background:#fff;display:flex;z-index:2;flex-shrink:0;position:relative;transition:opacity .3s ease-in;opacity:0}._sidePanelHorizontal_fhsa8_14{flex-direction:column;width:100%}._sidePanel_fhsa8_1._closed_fhsa8_19{opacity:0;transition:width .3s cubic-bezier(.4,0,.2,1),height .3s cubic-bezier(.4,0,.2,1),opacity .3s ease-out}._sidePanel_fhsa8_1._opening_fhsa8_24{opacity:1;transition:width .3s cubic-bezier(.4,0,.2,1),height .3s cubic-bezier(.4,0,.2,1),opacity .3s ease-in}._sidePanel_fhsa8_1._open_fhsa8_24{opacity:1}._resizer_fhsa8_33{background-color:transparent;box-sizing:border-box;position:absolute;opacity:1;touch-action:none;-webkit-user-select:none;user-select:none;z-index:2}._resizerHorizontal_fhsa8_44{height:30px;width:100%;cursor:ns-resize;left:0;top:-8px;right:0}._resizerVertical_fhsa8_53{width:30px;cursor:ew-resize;left:-8px;top:0;bottom:0}._noSelect_fhsa8_61{-webkit-user-select:none;user-select:none}._resizerBar_fhsa8_65{position:absolute;top:0;left:7px;width:2px;height:100%;background-color:#ddd;touch-action:none;-webkit-user-select:none;user-select:none}._resizerHorizontal_fhsa8_44 ._resizerBar_fhsa8_65{top:7px;left:0;width:100%;height:2px}._resizer_fhsa8_33:hover ._resizerBar_fhsa8_65{background-color:#75a4e288}._resizer_fhsa8_33._resizing_fhsa8_87 ._resizerBar_fhsa8_65{background-color:#75a4e2}._resizerHandle_fhsa8_91{position:absolute;top:50%;left:2px;width:10px;height:60px;transform:translateY(-50%);background-color:#fff;border-radius:3px;border:2px solid #ddd;box-shadow:0 0 4px #ccc;display:flex;align-items:center;justify-content:center;touch-action:none;-webkit-user-select:none;user-select:none}._resizerHorizontal_fhsa8_44 ._resizerHandle_fhsa8_91{top:2px;left:50%;width:60px;height:10px;transform:translate(-50%)}._resizerHandle_fhsa8_91._minimised_fhsa8_117{left:-15px;width:20px}._resizerHorizontal_fhsa8_44 ._resizerHandle_fhsa8_91._minimised_fhsa8_117{top:-15px;height:20px;left:50%;width:60px;transform:translate(-50%)}._resizerHandle_fhsa8_91:focus{outline:2px solid #75a4e2;outline-offset:2px}._resizerVertical_fhsa8_53 ._resizerHandle_fhsa8_91:before{content:"";display:block;width:4px;height:20px;background:radial-gradient(circle,#bbb 1.5px,transparent 1.5px) 0 2px,radial-gradient(circle,#bbb 1.5px,transparent 1.5px) 0 8px,radial-gradient(circle,#bbb 1.5px,transparent 1.5px) 0 14px;background-repeat:no-repeat;background-size:4px 4px}._resizerHorizontal_fhsa8_44 ._resizerHandle_fhsa8_91:before{content:"";display:block;width:20px;height:4px;background:radial-gradient(circle,#bbb 1.5px,transparent 1.5px) 2px 0,radial-gradient(circle,#bbb 1.5px,transparent 1.5px) 8px 0,radial-gradient(circle,#bbb 1.5px,transparent 1.5px) 14px 0;background-repeat:no-repeat;background-size:4px 4px}._resizer_fhsa8_33:hover ._resizerHandle_fhsa8_91,._resizer_fhsa8_33._resizing_fhsa8_87 ._resizerHandle_fhsa8_91{border-color:#75a4e2}._expand_fhsa8_167{position:absolute;top:2rem;right:0;height:40px;width:30px;background-color:#fff;border-radius:3px;border:2px solid #ddd;cursor:pointer;display:flex;align-items:center;justify-content:center}._content_fhsa8_183{flex-grow:1;overflow:auto;min-width:300px!important;position:relative}._closeButton_fhsa8_190{position:absolute;top:.5rem;right:.5rem}
@@ -3,7 +3,7 @@ interface Props extends PropsWithChildren {
3
3
  open?: boolean;
4
4
  onClose?: () => void;
5
5
  onOpen?: () => void;
6
- position?: 'left' | 'right';
6
+ position?: 'right' | 'bottom';
7
7
  }
8
8
  export default function SidePanel({ children, open, onClose, onOpen, position }: Props): import("react/jsx-runtime").JSX.Element;
9
9
  export {};
@@ -1,103 +1,109 @@
1
- import { jsxs as h, jsx as r } from "react/jsx-runtime";
2
- import { useState as d, useRef as x, useEffect as w } from "react";
3
- import { C as E } from "../../Close-BGAFHd7i.js";
4
- import { IconButton as H } from "@mui/material";
5
- import '../../assets/SidePanel.css';const L = "_sidePanel_1j2co_1", N = "_closed_1j2co_14", P = "_opening_1j2co_19", $ = "_open_1j2co_19", C = "_resizer_1j2co_28", A = "_noSelect_1j2co_43", k = "_resizerBar_1j2co_47", X = "_resizing_1j2co_62", K = "_resizerHandle_1j2co_66", O = "_minimised_1j2co_84", U = "_content_1j2co_130", F = "_closeButton_1j2co_137", e = {
1
+ import { jsxs as g, jsx as a } from "react/jsx-runtime";
2
+ import { useState as m, useRef as B, useEffect as w } from "react";
3
+ import { C as A } from "../../Close-BGAFHd7i.js";
4
+ import { IconButton as D } from "@mui/material";
5
+ import '../../assets/SidePanel.css';const L = "_sidePanel_fhsa8_1", T = "_sidePanelHorizontal_fhsa8_14", C = "_closed_fhsa8_19", k = "_opening_fhsa8_24", V = "_open_fhsa8_24", W = "_resizer_fhsa8_33", Z = "_resizerHorizontal_fhsa8_44", U = "_resizerVertical_fhsa8_53", X = "_noSelect_fhsa8_61", j = "_resizerBar_fhsa8_65", K = "_resizing_fhsa8_87", O = "_resizerHandle_fhsa8_91", Y = "_minimised_fhsa8_117", F = "_content_fhsa8_183", G = "_closeButton_fhsa8_190", e = {
6
6
  sidePanel: L,
7
- closed: N,
8
- opening: P,
9
- open: $,
10
- resizer: C,
11
- noSelect: A,
12
- resizerBar: k,
13
- resizing: X,
14
- resizerHandle: K,
15
- minimised: O,
16
- content: U,
17
- closeButton: F
18
- }, g = 30, v = Math.max(300, Math.floor(window.innerWidth * 0.25)), z = "sidePanelWidth";
19
- function Q({ children: y, open: n, onClose: p, onOpen: M, position: c = "right" }) {
20
- const [m, i] = d(n ? v : 0), u = x(null), [a, j] = d(!1), [_, I] = d(!1), [D, S] = d(!n), W = x(
21
- window.sessionStorage.getItem(z) ? Number(window.sessionStorage.getItem(z)) : v
22
- ), o = Math.floor(window.innerWidth / 2);
7
+ sidePanelHorizontal: T,
8
+ closed: C,
9
+ opening: k,
10
+ open: V,
11
+ resizer: W,
12
+ resizerHorizontal: Z,
13
+ resizerVertical: U,
14
+ noSelect: X,
15
+ resizerBar: j,
16
+ resizing: K,
17
+ resizerHandle: O,
18
+ minimised: Y,
19
+ content: F,
20
+ closeButton: G
21
+ }, h = 30, N = 300, v = Math.max(N, Math.floor(window.innerWidth * 0.25)), M = "sidePanelWidth";
22
+ function ie({ children: R, open: r, onClose: S, onOpen: I, position: t = "right" }) {
23
+ const [l, s] = m(r ? v : 0), _ = B(null), [c, E] = m(!1), [f, H] = m(!1), [p, P] = m(!r), b = B(
24
+ window.sessionStorage.getItem(M) ? Number(window.sessionStorage.getItem(M)) : v
25
+ ), o = Math.max(
26
+ N,
27
+ Math.floor(t === "right" ? window.innerWidth / 2 : window.innerHeight / 2)
28
+ );
23
29
  w(() => {
24
- if (n)
25
- I(!0), S(!1);
30
+ if (r)
31
+ H(!0), P(!1);
26
32
  else {
27
- i(0);
28
- const t = setTimeout(() => {
29
- S(!0);
33
+ s(0);
34
+ const i = setTimeout(() => {
35
+ P(!0);
30
36
  }, 300);
31
- return () => clearTimeout(t);
37
+ return () => clearTimeout(i);
32
38
  }
33
- }, [n]), w(() => {
34
- if (_) {
35
- i(W.current || v);
36
- const t = setTimeout(() => {
37
- I(!1);
39
+ }, [r]), w(() => {
40
+ if (f) {
41
+ s(b.current || v);
42
+ const i = setTimeout(() => {
43
+ H(!1);
38
44
  }, 300);
39
- return () => clearTimeout(t);
45
+ return () => clearTimeout(i);
40
46
  }
41
- }, [_]), w(() => {
42
- if (a) {
43
- let t = function(f) {
44
- if (a && u.current) {
45
- const T = u.current.getBoundingClientRect(), b = c === "right" ? T.right - f.clientX : f.clientX - T.left, l = Math.max(Math.min(b, o), g);
46
- l - b > 10 ? i(0) : (W.current = l, i(l), window.sessionStorage.setItem(z, l.toString())), f.preventDefault();
47
+ }, [f]), w(() => {
48
+ if (c) {
49
+ let i = function(u) {
50
+ if (c && _.current) {
51
+ const x = _.current.getBoundingClientRect(), y = t === "right" ? x.right - u.clientX : x.bottom - u.clientY, d = Math.max(Math.min(y, o), h);
52
+ d - y > 10 ? s(0) : (b.current = d, s(d), window.sessionStorage.setItem(M, d.toString())), u.preventDefault();
47
53
  }
48
- }, s = function() {
49
- j(!1);
54
+ }, n = function() {
55
+ E(!1);
50
56
  };
51
- return window.addEventListener("pointermove", t, { passive: !1 }), window.addEventListener("pointerup", s), document.body.classList.add(e.noSelect), () => {
52
- window.removeEventListener("pointermove", t), window.removeEventListener("pointerup", s), document.body.classList.remove(e.noSelect);
57
+ return window.addEventListener("pointermove", i, { passive: !1 }), window.addEventListener("pointerup", n), document.body.classList.add(e.noSelect), () => {
58
+ window.removeEventListener("pointermove", i), window.removeEventListener("pointerup", n), document.body.classList.remove(e.noSelect);
53
59
  };
54
60
  }
55
- }, [a, c, o]);
56
- const B = m === 0, R = /* @__PURE__ */ h(
61
+ }, [c, t, o]);
62
+ const z = l === 0, $ = /* @__PURE__ */ g(
57
63
  "div",
58
64
  {
59
- className: `${e.resizer} ${a ? e.resizing : ""}`,
65
+ className: `${e.resizer} ${c ? e.resizing : ""} ${t === "right" ? e.resizerVertical : e.resizerHorizontal}`,
60
66
  onPointerDown: () => {
61
- j(!0), M && M();
67
+ E(!0), I && I();
62
68
  },
63
69
  children: [
64
- /* @__PURE__ */ r("div", { className: e.resizerBar }),
65
- n && /* @__PURE__ */ r(
70
+ /* @__PURE__ */ a("div", { className: e.resizerBar }),
71
+ r && /* @__PURE__ */ a(
66
72
  "div",
67
73
  {
68
- className: `${e.resizerHandle} ${B ? e.minimised : ""}`,
74
+ className: `${e.resizerHandle} ${z ? e.minimised : ""}`,
69
75
  role: "separator",
70
- "aria-orientation": "vertical",
76
+ "aria-orientation": t === "right" ? "vertical" : "horizontal",
71
77
  "aria-label": "Resize sidebar",
72
78
  tabIndex: 0,
73
- "aria-valuenow": m,
74
- "aria-valuemin": g,
79
+ "aria-valuenow": l,
80
+ "aria-valuemin": h,
75
81
  "aria-valuemax": o,
76
- onKeyDown: (t) => {
77
- t.key === "ArrowRight" ? i((s) => Math.min(o, Math.max(0, s - 50))) : t.key === "ArrowLeft" && i((s) => Math.max(g, Math.min(o, s + 50)));
82
+ onKeyDown: (i) => {
83
+ t === "right" ? i.key === "ArrowRight" ? s((n) => Math.min(o, Math.max(0, n - 50))) : i.key === "ArrowLeft" && s((n) => Math.max(h, Math.min(o, n + 50))) : i.key === "ArrowDown" ? s((n) => Math.min(o, Math.max(0, n - 50))) : i.key === "ArrowUp" && s((n) => Math.max(h, Math.min(o, n + 50)));
78
84
  }
79
85
  }
80
86
  )
81
87
  ]
82
88
  }
83
89
  );
84
- return /* @__PURE__ */ h(
90
+ return /* @__PURE__ */ g(
85
91
  "section",
86
92
  {
87
- className: `${e.sidePanel} ${n ? e.open : e.closed} ${_ ? e.opening : ""}`,
88
- style: { width: B ? 0 : m, visibility: D ? "hidden" : void 0 },
89
- ref: u,
90
- "aria-hidden": !n,
93
+ className: `${e.sidePanel} ${r ? e.open : e.closed} ${f ? e.opening : ""} ${t === "right" ? e.sidePanelVertical : e.sidePanelHorizontal}`,
94
+ style: t === "right" ? { width: z ? 0 : l, visibility: p ? "hidden" : void 0 } : { height: z ? 0 : l, visibility: p ? "hidden" : void 0 },
95
+ ref: _,
96
+ "aria-hidden": !r,
91
97
  children: [
92
- c === "right" && R,
93
- /* @__PURE__ */ h("div", { className: e.content, children: [
94
- p && /* @__PURE__ */ r("div", { className: e.closeButton, children: /* @__PURE__ */ r(
95
- H,
98
+ (t === "right" || t === "bottom") && $,
99
+ /* @__PURE__ */ g("div", { className: e.content, children: [
100
+ S && /* @__PURE__ */ a("div", { className: e.closeButton, children: /* @__PURE__ */ a(
101
+ D,
96
102
  {
97
- onClick: p,
103
+ onClick: S,
98
104
  "data-testid": "sidepanel-close-button",
99
- children: /* @__PURE__ */ r(
100
- E,
105
+ children: /* @__PURE__ */ a(
106
+ A,
101
107
  {
102
108
  fontSize: "medium",
103
109
  htmlColor: "#444"
@@ -105,13 +111,12 @@ function Q({ children: y, open: n, onClose: p, onOpen: M, position: c = "right"
105
111
  )
106
112
  }
107
113
  ) }),
108
- y
109
- ] }),
110
- c === "left" && R
114
+ R
115
+ ] })
111
116
  ]
112
117
  }
113
118
  );
114
119
  }
115
120
  export {
116
- Q as default
121
+ ie as default
117
122
  };
@@ -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 p } from "react/jsx-runtime";
2
- import { useState as v, useRef as l, useCallback as h, useEffect as x } from "react";
3
- import { extractNodesFromElements as y, generateLines as L } from "./lines.js";
4
- import { s as u, S as b } from "../../SvgLayer-DHFiKVQ9.js";
5
- import { LinesUpdateContext as g } from "./svgContext.js";
6
- function S({ children: o, connections: c }) {
7
- const [f, m] = v([]), e = l(null), n = l(), i = h(() => {
8
- const r = y(e.current), s = L(r, c);
9
- m(s);
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 x(() => {
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 d = s[t];
21
- n.current.observe(d);
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(g.Provider, { value: i, children: /* @__PURE__ */ p(
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(b, { lines: f }),
37
+ /* @__PURE__ */ a(k, { lines: d }),
38
38
  o
39
39
  ]
40
40
  }
41
41
  ) }) });
42
42
  }
43
43
  export {
44
- S as default
44
+ A as default
45
45
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@genai-fi/base",
3
- "version": "4.2.0",
3
+ "version": "4.2.2",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",