@logicplanes/kaeso-ui 0.6.0-rc.1 → 0.6.0-rc.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.
- package/ai/component-guides.md +5 -5
- package/ai/component-registry.json +4 -4
- package/ai/component-registry.md +4 -4
- package/ai/icons.md +2 -2
- package/ai/tokens.md +1 -1
- package/dist/chunks/icon-CPNoEw5s.js +102 -0
- package/dist/chunks/icon-CPNoEw5s.js.map +1 -0
- package/dist/components/flow-canvas.js +226 -286
- package/dist/components/flow-canvas.js.map +1 -1
- package/dist/components/icon.js +1 -1
- package/dist/index.js +1 -1
- package/dist/types/components/flow-canvas/layout.d.ts +2 -4
- package/dist/types/icons/groups.d.ts +1 -1
- package/dist/types/icons/vocabulary.d.ts +2 -2
- package/package.json +2 -2
- package/dist/chunks/icon-BNP2eYlj.js +0 -102
- package/dist/chunks/icon-BNP2eYlj.js.map +0 -1
|
@@ -7,11 +7,11 @@ import { c as i } from "../chunks/menu-CRZ-O7Ok.js";
|
|
|
7
7
|
import { r as a } from "../chunks/status-dot-BJ_xdPOz.js";
|
|
8
8
|
import { forwardRef as o, useCallback as s, useEffect as c, useId as l, useLayoutEffect as u, useMemo as d, useRef as f, useState as p } from "react";
|
|
9
9
|
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
10
|
-
import { Add01Icon as
|
|
11
|
-
var
|
|
10
|
+
import { Add01Icon as g, ArrowExpand01Icon as ee, MinusSignIcon as te, MoreHorizontalIcon as ne } from "@hugeicons/core-free-icons";
|
|
11
|
+
var _ = 176, v = 40, y = 24, b = 12, x = (e, t) => e ? t ? {
|
|
12
12
|
l: Math.min(e.l, t.l),
|
|
13
13
|
r: Math.max(e.r, t.r)
|
|
14
|
-
} : e : t ?? null,
|
|
14
|
+
} : e : t ?? null, S = (e, t) => t < e.contour.length ? e.contour[t] ?? null : e.tail, C = (e, t) => t === 0 ? e : {
|
|
15
15
|
items: e.items.map((e) => ({
|
|
16
16
|
...e,
|
|
17
17
|
x: e.x + t
|
|
@@ -25,26 +25,21 @@ var g = 176, _ = 40, v = 24, y = 12, b = 176, x = 44, S = 104, C = (e, t) => e ?
|
|
|
25
25
|
r: e.tail.r + t
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
|
-
function
|
|
28
|
+
function re(e, t) {
|
|
29
29
|
let n = Math.max(e.contour.length, t.contour.length) + 1, r = -Infinity;
|
|
30
30
|
for (let i = 0; i < n; i++) {
|
|
31
|
-
let n =
|
|
32
|
-
n && a && (r = Math.max(r, n.r - a.l +
|
|
31
|
+
let n = S(e, i), a = S(t, i);
|
|
32
|
+
n && a && (r = Math.max(r, n.r - a.l + v));
|
|
33
33
|
}
|
|
34
34
|
return r === -Infinity ? 0 : r;
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
let t = Infinity;
|
|
38
|
-
for (let n of e.contour.slice(1)) t = Math.min(t, n.l);
|
|
39
|
-
return e.tail && (t = Math.min(t, e.tail.l)), t;
|
|
40
|
-
}
|
|
41
|
-
function O(e) {
|
|
36
|
+
function ie(e) {
|
|
42
37
|
let t = [], n = null, r = [];
|
|
43
|
-
for (let t of e) r.push(...t.items), n =
|
|
38
|
+
for (let t of e) r.push(...t.items), n = x(n, t.tail);
|
|
44
39
|
let i = Math.max(0, ...e.map((e) => e.contour.length));
|
|
45
40
|
for (let n = 0; n < i; n++) {
|
|
46
41
|
let r = null;
|
|
47
|
-
for (let t of e) r =
|
|
42
|
+
for (let t of e) r = x(r, S(t, n));
|
|
48
43
|
t.push(r ?? {
|
|
49
44
|
l: 0,
|
|
50
45
|
r: 0
|
|
@@ -56,11 +51,11 @@ function O(e) {
|
|
|
56
51
|
tail: n
|
|
57
52
|
};
|
|
58
53
|
}
|
|
59
|
-
function
|
|
54
|
+
function ae(e, t) {
|
|
60
55
|
return t.node ? t.node.id : `${e}::${t.id}`;
|
|
61
56
|
}
|
|
62
|
-
function
|
|
63
|
-
let i =
|
|
57
|
+
function w(e, t, n, r) {
|
|
58
|
+
let i = ae(t, n);
|
|
64
59
|
return e.order.push(i), e.placed.set(i, {
|
|
65
60
|
key: i,
|
|
66
61
|
kind: "slot",
|
|
@@ -75,7 +70,7 @@ function A(e, t, n, r) {
|
|
|
75
70
|
children: []
|
|
76
71
|
}), i;
|
|
77
72
|
}
|
|
78
|
-
function
|
|
73
|
+
function T(e, t, n, r, i) {
|
|
79
74
|
let a = e.id, o = e.children ?? [];
|
|
80
75
|
t.order.push(a), t.placed.set(a, {
|
|
81
76
|
key: a,
|
|
@@ -88,56 +83,14 @@ function j(e, t, n, r, i) {
|
|
|
88
83
|
node: e,
|
|
89
84
|
edge: r,
|
|
90
85
|
parent: n,
|
|
91
|
-
children: o.map((e) =>
|
|
86
|
+
children: o.map((e) => ae(a, e))
|
|
92
87
|
});
|
|
93
88
|
let s = {
|
|
94
89
|
l: -120,
|
|
95
90
|
r: 120
|
|
96
|
-
}
|
|
97
|
-
if (e.terminal) {
|
|
98
|
-
let e = o[0];
|
|
99
|
-
if (!e) return {
|
|
100
|
-
items: [{
|
|
101
|
-
key: a,
|
|
102
|
-
x: 0,
|
|
103
|
-
level: 0
|
|
104
|
-
}],
|
|
105
|
-
contour: [s],
|
|
106
|
-
tail: null
|
|
107
|
-
};
|
|
108
|
-
if (!e.node) {
|
|
109
|
-
let n = A(t, a, e, i + 1);
|
|
110
|
-
return {
|
|
111
|
-
items: [{
|
|
112
|
-
key: a,
|
|
113
|
-
x: 0,
|
|
114
|
-
level: 0
|
|
115
|
-
}, {
|
|
116
|
-
key: n,
|
|
117
|
-
x: b,
|
|
118
|
-
level: 0
|
|
119
|
-
}],
|
|
120
|
-
contour: [{
|
|
121
|
-
l: s.l,
|
|
122
|
-
r: 188
|
|
123
|
-
}],
|
|
124
|
-
tail: null
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
let n = j(e.node, t, a, e, i + 1), r = T(n, Math.max(368, s.l - D(n)));
|
|
128
|
-
return {
|
|
129
|
-
items: [{
|
|
130
|
-
key: a,
|
|
131
|
-
x: 0,
|
|
132
|
-
level: 0
|
|
133
|
-
}, ...r.items],
|
|
134
|
-
contour: [C(s, r.contour[0]), ...r.contour.slice(1)],
|
|
135
|
-
tail: r.tail
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
let c = o.map((e) => e.node ? j(e.node, t, a, e, i + 1) : {
|
|
91
|
+
}, c = o.map((e) => e.node ? T(e.node, t, a, e, i + 1) : {
|
|
139
92
|
items: [{
|
|
140
|
-
key:
|
|
93
|
+
key: w(t, a, e, i + 1),
|
|
141
94
|
x: 0,
|
|
142
95
|
level: 0
|
|
143
96
|
}],
|
|
@@ -148,14 +101,14 @@ function j(e, t, n, r, i) {
|
|
|
148
101
|
tail: null
|
|
149
102
|
}), l = [], u = null;
|
|
150
103
|
for (let e of c) {
|
|
151
|
-
let t = u ?
|
|
152
|
-
l.push(t), u = u ?
|
|
104
|
+
let t = u ? C(e, re(u, e)) : e;
|
|
105
|
+
l.push(t), u = u ? ie([u, t]) : t;
|
|
153
106
|
}
|
|
154
107
|
if (l.length > 0) {
|
|
155
108
|
let e = l.map((e) => e.items[0].x), t = -(e[0] + e[e.length - 1]) / 2;
|
|
156
|
-
l = l.map((e) =>
|
|
109
|
+
l = l.map((e) => C(e, t));
|
|
157
110
|
}
|
|
158
|
-
let d = l.length > 0 ?
|
|
111
|
+
let d = l.length > 0 ? ie(l) : null;
|
|
159
112
|
return {
|
|
160
113
|
items: [{
|
|
161
114
|
key: a,
|
|
@@ -169,95 +122,78 @@ function j(e, t, n, r, i) {
|
|
|
169
122
|
tail: d?.tail ?? null
|
|
170
123
|
};
|
|
171
124
|
}
|
|
172
|
-
var
|
|
173
|
-
function
|
|
125
|
+
var E = (e) => Math.round(e * 2) / 2;
|
|
126
|
+
function D(e, t, n, r, i) {
|
|
174
127
|
if (Math.abs(n - e) < 1) return `M${e} ${t}V${r}`;
|
|
175
|
-
let a = n > e ? 1 : -1, o = Math.min(
|
|
128
|
+
let a = n > e ? 1 : -1, o = Math.min(b, Math.abs(n - e) / 2, Math.abs(i - t), Math.abs(r - i));
|
|
176
129
|
return `M${e} ${t}V${i - o}Q${e} ${i} ${e + a * o} ${i}H${n - a * o}Q${n} ${i} ${n} ${i + o}V${r}`;
|
|
177
130
|
}
|
|
178
|
-
function
|
|
179
|
-
let
|
|
131
|
+
function oe(e) {
|
|
132
|
+
let t = {
|
|
180
133
|
placed: /* @__PURE__ */ new Map(),
|
|
181
134
|
order: []
|
|
182
|
-
},
|
|
183
|
-
for (let e of
|
|
184
|
-
let
|
|
185
|
-
|
|
135
|
+
}, n = T(e, t, null, void 0, 0);
|
|
136
|
+
for (let e of n.items) {
|
|
137
|
+
let n = t.placed.get(e.key);
|
|
138
|
+
n.x = E(e.x), n.y = n.kind === "slot" ? e.level * _ + 28 : e.level * _;
|
|
186
139
|
}
|
|
187
|
-
let
|
|
188
|
-
for (let e of
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
from: r.key,
|
|
205
|
-
to: e,
|
|
206
|
-
d: `M${c} ${i}H${n.x - n.w / 2}`,
|
|
207
|
-
variant: s,
|
|
208
|
-
label: o.label,
|
|
209
|
-
labelAt: d,
|
|
210
|
-
insertAt: f,
|
|
211
|
-
edge: o
|
|
212
|
-
});
|
|
213
|
-
continue;
|
|
214
|
-
}
|
|
215
|
-
let c = n.y, u = r.y + 80 + v, d = N(r.x, r.y + 80, n.x, c, u), f = Math.abs(n.x - r.x) < 1 ? r.y + 80 : u, p = c - f, m = l(o) ? {
|
|
216
|
-
x: n.x,
|
|
217
|
-
y: M(f + Math.min(22, p / 3))
|
|
218
|
-
} : null, h = n.kind === "node" ? {
|
|
219
|
-
x: n.x,
|
|
220
|
-
y: M(m ? c - 20 : f + p / 2)
|
|
140
|
+
let r = t.placed;
|
|
141
|
+
for (let e of t.order) {
|
|
142
|
+
let t = r.get(e), n = t.parent === null ? void 0 : r.get(t.parent);
|
|
143
|
+
t.kind === "slot" && n?.node?.terminal && (t.y = n.y + 80 + 32);
|
|
144
|
+
}
|
|
145
|
+
let i = [], a = 0, o = Infinity, s = -Infinity;
|
|
146
|
+
for (let e of r.values()) a = Math.max(a, e.y + e.h), o = Math.min(o, e.x - e.w / 2), s = Math.max(s, e.x + e.w / 2);
|
|
147
|
+
let c = (e) => e.label !== void 0 && e.label !== null && e.label !== "";
|
|
148
|
+
for (let e of t.order) {
|
|
149
|
+
let t = r.get(e);
|
|
150
|
+
if (t.parent === null) continue;
|
|
151
|
+
let n = r.get(t.parent), a = t.edge, o = a.variant ?? "default", s = t.y, l = n.y + 80 + y, u = D(n.x, n.y + 80, t.x, s, l), d = Math.abs(t.x - n.x) < 1 ? n.y + 80 : l, f = s - d, p = t.kind === "node" && c(a) ? {
|
|
152
|
+
x: t.x,
|
|
153
|
+
y: E(d + Math.min(22, f / 3))
|
|
154
|
+
} : null, m = t.kind === "node" ? {
|
|
155
|
+
x: t.x,
|
|
156
|
+
y: E(p ? s - 20 : d + f / 2)
|
|
221
157
|
} : null;
|
|
222
|
-
|
|
158
|
+
i.push({
|
|
223
159
|
key: `wire:${e}`,
|
|
224
|
-
from:
|
|
160
|
+
from: n.key,
|
|
225
161
|
to: e,
|
|
226
|
-
d,
|
|
227
|
-
variant:
|
|
228
|
-
label:
|
|
229
|
-
labelAt:
|
|
230
|
-
insertAt:
|
|
231
|
-
edge:
|
|
162
|
+
d: u,
|
|
163
|
+
variant: o,
|
|
164
|
+
label: a.label,
|
|
165
|
+
labelAt: p,
|
|
166
|
+
insertAt: m,
|
|
167
|
+
edge: a
|
|
232
168
|
});
|
|
233
169
|
}
|
|
234
170
|
return {
|
|
235
|
-
items:
|
|
236
|
-
order:
|
|
237
|
-
wires:
|
|
171
|
+
items: r,
|
|
172
|
+
order: t.order,
|
|
173
|
+
wires: i,
|
|
238
174
|
bounds: {
|
|
239
|
-
minX:
|
|
240
|
-
maxX:
|
|
175
|
+
minX: o,
|
|
176
|
+
maxX: s,
|
|
241
177
|
minY: 0,
|
|
242
|
-
maxY:
|
|
178
|
+
maxY: a
|
|
243
179
|
}
|
|
244
180
|
};
|
|
245
181
|
}
|
|
246
182
|
//#endregion
|
|
247
183
|
//#region src/components/flow-canvas/flow-canvas.tsx
|
|
248
|
-
var
|
|
184
|
+
var se = {
|
|
249
185
|
success: "var(--k-success-text)",
|
|
250
186
|
warning: "var(--k-warning-text)",
|
|
251
187
|
danger: "var(--k-danger-text)"
|
|
252
|
-
},
|
|
188
|
+
}, ce = {
|
|
253
189
|
danger: "ring-invalid",
|
|
254
190
|
warning: "ring-warning",
|
|
255
191
|
success: "ring-success",
|
|
256
192
|
neutral: void 0
|
|
257
|
-
},
|
|
193
|
+
}, le = { background: {
|
|
258
194
|
dots: { classes: "flow-canvas-dots" },
|
|
259
195
|
plain: { classes: "" }
|
|
260
|
-
} },
|
|
196
|
+
} }, O = { background: "dots" }, k = [
|
|
261
197
|
.25,
|
|
262
198
|
.33,
|
|
263
199
|
.5,
|
|
@@ -266,13 +202,13 @@ var ae = {
|
|
|
266
202
|
1,
|
|
267
203
|
1.2,
|
|
268
204
|
1.5
|
|
269
|
-
],
|
|
205
|
+
], A = .25, j = 1.5, M = .67, N = 48, P = 64, F = 24, ue = 16, de = 4, I = (e) => Math.min(j, Math.max(A, e)), fe = (e, t) => t > 0 ? k.find((t) => t > e + .001) ?? j : [...k].reverse().find((t) => t < e - .001) ?? A, L = (e) => Math.round(e * 100) / 100;
|
|
270
206
|
function pe(e, t, n) {
|
|
271
|
-
let r = t > 256 ?
|
|
207
|
+
let r = t > 256 ? P : 0, i = t - r, a = e.maxX - e.minX + 96, o = e.maxY - e.minY + 96, s = i > 0 && n > 0 ? Math.min(1, i / a, n / o) : 1, c = I(Math.max(M, s)), l = c * a <= i ? r + i / 2 - c * (e.minX + e.maxX) / 2 : Math.min(r + N * c - c * e.minX, Math.max(r + i - N * c - c * e.maxX, r + i / 2));
|
|
272
208
|
return {
|
|
273
209
|
k: c,
|
|
274
210
|
x: Math.round(l),
|
|
275
|
-
y: Math.round(
|
|
211
|
+
y: Math.round(N * c - e.minY * c)
|
|
276
212
|
};
|
|
277
213
|
}
|
|
278
214
|
function me(e) {
|
|
@@ -291,131 +227,135 @@ function he(e, t) {
|
|
|
291
227
|
return r && r in t ? /* @__PURE__ */ m("span", { children: t[r] }, n) : e;
|
|
292
228
|
});
|
|
293
229
|
}
|
|
294
|
-
var ge = (e) => e ? e.label ?? (typeof e.title == "string" ? e.title : typeof e.kind == "string" ? e.kind : void 0) : void 0,
|
|
295
|
-
let
|
|
230
|
+
var ge = (e) => e ? e.label ?? (typeof e.title == "string" ? e.title : typeof e.kind == "string" ? e.kind : void 0) : void 0, R = /* @__PURE__ */ o(function({ root: o, selected: _ = null, onSelect: v, addMenu: y, nodeActions: b, onDelete: x, trace: S, busy: C, background: re = "dots", className: ie, "aria-label": ae }, w) {
|
|
231
|
+
let T = t(), E = `k-flow-hint-${l().replace(/[^\w-]/g, "")}`, D = !!y, O = d(() => D ? o : me(o), [o, D]), k = d(() => oe(O), [O]), M = d(() => S ? new Set(S) : null, [S]), P = f(null), R = f(/* @__PURE__ */ new Map()), [z, _e] = p({
|
|
296
232
|
w: 0,
|
|
297
233
|
h: 0
|
|
298
|
-
}),
|
|
299
|
-
|
|
300
|
-
let [
|
|
234
|
+
}), B = f(z);
|
|
235
|
+
B.current = z;
|
|
236
|
+
let [V, H] = p({
|
|
301
237
|
x: 0,
|
|
302
|
-
y:
|
|
238
|
+
y: N,
|
|
303
239
|
k: 1
|
|
304
|
-
}),
|
|
240
|
+
}), ve = f(!1), [U, ye] = p(null), [be, xe] = p(null), [Se, Ce] = p(!1), W = f(/* @__PURE__ */ new Map()), G = f(null);
|
|
305
241
|
u(() => {
|
|
306
|
-
let e =
|
|
242
|
+
let e = P.current;
|
|
307
243
|
if (!e) return;
|
|
308
|
-
let t = () =>
|
|
244
|
+
let t = () => _e({
|
|
309
245
|
w: e.clientWidth,
|
|
310
246
|
h: e.clientHeight
|
|
311
247
|
});
|
|
312
248
|
return t(), n([e], t);
|
|
313
249
|
}, []), u(() => {
|
|
314
|
-
|
|
315
|
-
}, [
|
|
316
|
-
let
|
|
317
|
-
|
|
318
|
-
let i =
|
|
250
|
+
ve.current || z.w === 0 || z.h === 0 || (ve.current = !0, H(pe(k.bounds, z.w, z.h)));
|
|
251
|
+
}, [k, z]);
|
|
252
|
+
let we = s((e, t, n) => {
|
|
253
|
+
H((r) => {
|
|
254
|
+
let i = I(r.k * e), a = i / r.k;
|
|
319
255
|
return {
|
|
320
256
|
k: i,
|
|
321
|
-
x:
|
|
322
|
-
y:
|
|
257
|
+
x: L(t - (t - r.x) * a),
|
|
258
|
+
y: L(n - (n - r.y) * a)
|
|
323
259
|
};
|
|
324
260
|
});
|
|
325
|
-
}, []),
|
|
326
|
-
let n = fe(t.k, e), r =
|
|
261
|
+
}, []), K = s((e) => H((t) => {
|
|
262
|
+
let n = fe(t.k, e), r = B.current.w / 2, i = B.current.h / 2;
|
|
327
263
|
return {
|
|
328
264
|
k: n,
|
|
329
|
-
x:
|
|
330
|
-
y:
|
|
265
|
+
x: L(r - (r - t.x) * n / t.k),
|
|
266
|
+
y: L(i - (i - t.y) * n / t.k)
|
|
331
267
|
};
|
|
332
|
-
}), []),
|
|
333
|
-
let t =
|
|
334
|
-
t &&
|
|
335
|
-
let { w: n, h: r } =
|
|
268
|
+
}), []), Te = s(() => H(pe(k.bounds, B.current.w, B.current.h)), [k]), q = s((e) => {
|
|
269
|
+
let t = k.items.get(e);
|
|
270
|
+
t && H((e) => {
|
|
271
|
+
let { w: n, h: r } = B.current;
|
|
336
272
|
if (n === 0 || r === 0) return e;
|
|
337
273
|
let i = e.x + (t.x - t.w / 2) * e.k, a = e.x + (t.x + t.w / 2) * e.k, o = e.y + t.y * e.k, s = e.y + (t.y + t.h) * e.k, c = 0, l = 0;
|
|
338
|
-
return i <
|
|
274
|
+
return i < F ? c = F - i : a > n - F && (c = Math.max(n - F - a, F - i)), o < F ? l = F - o : s > r - F && (l = Math.max(r - F - s, F - o)), c === 0 && l === 0 ? e : {
|
|
339
275
|
...e,
|
|
340
|
-
x:
|
|
341
|
-
y:
|
|
276
|
+
x: L(e.x + c),
|
|
277
|
+
y: L(e.y + l)
|
|
342
278
|
};
|
|
343
279
|
});
|
|
344
|
-
}, [
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
}, [
|
|
348
|
-
|
|
280
|
+
}, [k]), J = f(q);
|
|
281
|
+
J.current = q, c(() => {
|
|
282
|
+
_ && J.current(_);
|
|
283
|
+
}, [_]);
|
|
284
|
+
let Y = S?.[S.length - 1];
|
|
285
|
+
c(() => {
|
|
286
|
+
Y && J.current(Y);
|
|
287
|
+
}, [Y]), c(() => {
|
|
288
|
+
let e = P.current;
|
|
349
289
|
if (!e) return;
|
|
350
290
|
let t = (t) => {
|
|
351
291
|
t.preventDefault();
|
|
352
292
|
let n = t.deltaMode === 1 ? ue : t.deltaMode === 2 ? e.clientHeight : 1;
|
|
353
293
|
if (t.ctrlKey || t.metaKey) {
|
|
354
294
|
let r = e.getBoundingClientRect();
|
|
355
|
-
|
|
356
|
-
} else
|
|
295
|
+
we(Math.exp(-t.deltaY * n * .01), t.clientX - r.left, t.clientY - r.top);
|
|
296
|
+
} else H((e) => ({
|
|
357
297
|
...e,
|
|
358
|
-
x:
|
|
359
|
-
y:
|
|
298
|
+
x: L(e.x - t.deltaX * n),
|
|
299
|
+
y: L(e.y - t.deltaY * n)
|
|
360
300
|
}));
|
|
361
301
|
};
|
|
362
302
|
return e.addEventListener("wheel", t, { passive: !1 }), () => e.removeEventListener("wheel", t);
|
|
363
|
-
}, [
|
|
364
|
-
let
|
|
365
|
-
let [e, t] = [...
|
|
303
|
+
}, [we]);
|
|
304
|
+
let Ee = () => {
|
|
305
|
+
let [e, t] = [...W.current.values()];
|
|
366
306
|
if (!e) {
|
|
367
|
-
|
|
307
|
+
G.current = null;
|
|
368
308
|
return;
|
|
369
309
|
}
|
|
370
310
|
let n = t ? {
|
|
371
311
|
d: Math.hypot(t.x - e.x, t.y - e.y) || 1,
|
|
372
|
-
k:
|
|
312
|
+
k: V.k
|
|
373
313
|
} : null, r = t ? (e.x + t.x) / 2 : e.x, i = t ? (e.y + t.y) / 2 : e.y;
|
|
374
|
-
|
|
314
|
+
G.current = {
|
|
375
315
|
x: r,
|
|
376
316
|
y: i,
|
|
377
|
-
view:
|
|
378
|
-
moved:
|
|
317
|
+
view: V,
|
|
318
|
+
moved: G.current?.moved ?? !1,
|
|
379
319
|
pinch: n
|
|
380
320
|
};
|
|
381
|
-
},
|
|
382
|
-
e.currentTarget.contains(e.target) && (e.target.closest("[data-flow-interactive]") || (e.pointerType !== "mouse" || e.button === 0) && (e.currentTarget.setPointerCapture?.(e.pointerId),
|
|
321
|
+
}, De = (e) => {
|
|
322
|
+
e.currentTarget.contains(e.target) && (e.target.closest("[data-flow-interactive]") || (e.pointerType !== "mouse" || e.button === 0) && (e.currentTarget.setPointerCapture?.(e.pointerId), W.current.set(e.pointerId, {
|
|
383
323
|
x: e.clientX,
|
|
384
324
|
y: e.clientY
|
|
385
|
-
}),
|
|
386
|
-
},
|
|
387
|
-
if (!
|
|
388
|
-
|
|
325
|
+
}), Ee()));
|
|
326
|
+
}, Oe = (e) => {
|
|
327
|
+
if (!W.current.has(e.pointerId)) return;
|
|
328
|
+
W.current.set(e.pointerId, {
|
|
389
329
|
x: e.clientX,
|
|
390
330
|
y: e.clientY
|
|
391
331
|
});
|
|
392
|
-
let t =
|
|
332
|
+
let t = G.current;
|
|
393
333
|
if (!t) return;
|
|
394
|
-
let [n, r] = [...
|
|
334
|
+
let [n, r] = [...W.current.values()];
|
|
395
335
|
if (t.pinch && n && r) {
|
|
396
|
-
let i = e.currentTarget.getBoundingClientRect(), a =
|
|
397
|
-
t.moved = !0,
|
|
336
|
+
let i = e.currentTarget.getBoundingClientRect(), a = I(t.pinch.k * (Math.hypot(r.x - n.x, r.y - n.y) / t.pinch.d)), o = (n.x + r.x) / 2 - i.left, s = (n.y + r.y) / 2 - i.top, c = a / t.view.k, l = t.x - i.left, u = t.y - i.top;
|
|
337
|
+
t.moved = !0, H({
|
|
398
338
|
k: a,
|
|
399
|
-
x:
|
|
400
|
-
y:
|
|
339
|
+
x: L(o - (l - t.view.x) * c),
|
|
340
|
+
y: L(s - (u - t.view.y) * c)
|
|
401
341
|
});
|
|
402
342
|
return;
|
|
403
343
|
}
|
|
404
344
|
if (!n) return;
|
|
405
345
|
let i = n.x - t.x, a = n.y - t.y;
|
|
406
|
-
!t.moved && Math.abs(i) + Math.abs(a) < de || (t.moved ||
|
|
346
|
+
!t.moved && Math.abs(i) + Math.abs(a) < de || (t.moved || Ce(!0), t.moved = !0, H({
|
|
407
347
|
...t.view,
|
|
408
|
-
x:
|
|
409
|
-
y:
|
|
348
|
+
x: L(t.view.x + i),
|
|
349
|
+
y: L(t.view.y + a)
|
|
410
350
|
}));
|
|
411
|
-
},
|
|
412
|
-
if (!
|
|
413
|
-
let t =
|
|
414
|
-
|
|
415
|
-
},
|
|
416
|
-
e && (
|
|
417
|
-
},
|
|
418
|
-
let n = t.parent ?
|
|
351
|
+
}, ke = (e) => {
|
|
352
|
+
if (!W.current.delete(e.pointerId)) return;
|
|
353
|
+
let t = G.current?.moved ?? !1;
|
|
354
|
+
W.current.size > 0 ? Ee() : (G.current = null, Ce(!1), !t && e.type === "pointerup" && v?.(null));
|
|
355
|
+
}, Ae = U && k.items.has(U) ? U : _ && k.items.has(_) ? _ : O.id, je = (e) => {
|
|
356
|
+
e && (ye(e), R.current.get(e)?.focus({ preventScroll: !0 }), q(e));
|
|
357
|
+
}, Me = (e, t) => {
|
|
358
|
+
let n = t.parent ? k.items.get(t.parent).children : [t.key], r = n.indexOf(t.key), i;
|
|
419
359
|
switch (e.key) {
|
|
420
360
|
case "ArrowDown":
|
|
421
361
|
i = t.children[0];
|
|
@@ -430,62 +370,62 @@ var ge = (e) => e ? e.label ?? (typeof e.title == "string" ? e.title : typeof e.
|
|
|
430
370
|
i = n[r + 1];
|
|
431
371
|
break;
|
|
432
372
|
case "Home":
|
|
433
|
-
i =
|
|
373
|
+
i = O.id;
|
|
434
374
|
break;
|
|
435
375
|
case "End":
|
|
436
|
-
i =
|
|
376
|
+
i = k.order[k.order.length - 1];
|
|
437
377
|
break;
|
|
438
378
|
case "Escape":
|
|
439
|
-
if (
|
|
440
|
-
e.preventDefault(),
|
|
379
|
+
if (_ === null) return;
|
|
380
|
+
e.preventDefault(), v?.(null);
|
|
441
381
|
return;
|
|
442
382
|
case "+":
|
|
443
383
|
case "=":
|
|
444
|
-
e.preventDefault(),
|
|
384
|
+
e.preventDefault(), K(1);
|
|
445
385
|
return;
|
|
446
386
|
case "-":
|
|
447
|
-
e.preventDefault(),
|
|
387
|
+
e.preventDefault(), K(-1);
|
|
448
388
|
return;
|
|
449
389
|
case "0":
|
|
450
|
-
e.preventDefault(),
|
|
390
|
+
e.preventDefault(), Te();
|
|
451
391
|
return;
|
|
452
392
|
default:
|
|
453
393
|
if (t.kind !== "node") return;
|
|
454
|
-
e.key === "Enter" || e.key === " " ? (e.preventDefault(),
|
|
394
|
+
e.key === "Enter" || e.key === " " ? (e.preventDefault(), v?.(t.key)) : (e.key === "Delete" || e.key === "Backspace") && x ? (e.preventDefault(), x(t.key)) : (e.key === "ContextMenu" || e.key === "F10" && e.shiftKey) && b?.(t.key) && (e.preventDefault(), xe(t.key));
|
|
455
395
|
return;
|
|
456
396
|
}
|
|
457
|
-
e.preventDefault(),
|
|
458
|
-
},
|
|
459
|
-
t ?
|
|
460
|
-
},
|
|
461
|
-
let t =
|
|
462
|
-
return t?.kind === "slot" ? t.edge?.addLabel ??
|
|
463
|
-
},
|
|
397
|
+
e.preventDefault(), je(i);
|
|
398
|
+
}, Ne = (e) => (t) => {
|
|
399
|
+
t ? R.current.set(e, t) : R.current.delete(e);
|
|
400
|
+
}, Pe = (e) => {
|
|
401
|
+
let t = k.items.get(e);
|
|
402
|
+
return t?.kind === "slot" ? t.edge?.addLabel ?? T("flowCanvas.add", "Add a step") : t?.node?.title;
|
|
403
|
+
}, Fe = (e, t) => ({
|
|
464
404
|
left: e.x - e.w / 2,
|
|
465
405
|
top: e.y,
|
|
466
406
|
width: e.w,
|
|
467
407
|
height: e.h,
|
|
468
408
|
...t
|
|
469
|
-
}),
|
|
409
|
+
}), Ie = (e, t) => _ !== null && (e === _ || t === _), X = (e, t) => !M || M.has(e) && M.has(t), Z = (e) => e.edge?.tone && X(e.from, e.to) ? e.edge.tone : void 0, Le = (e) => {
|
|
470
410
|
let t = Z(e);
|
|
471
|
-
return t ?
|
|
472
|
-
}, Q = (e) => !!M && X(e.from, e.to),
|
|
473
|
-
"--k-flow-dot-gap": `${
|
|
474
|
-
"--k-flow-dot-x": `${
|
|
475
|
-
"--k-flow-dot-y": `${
|
|
476
|
-
}, $ = { transform: `translate(${
|
|
411
|
+
return t ? se[t] : M ? X(e.from, e.to) ? "var(--k-text)" : "var(--k-line)" : Ie(e.from, e.to) ? "var(--k-text-secondary)" : "var(--k-text-tertiary)";
|
|
412
|
+
}, Q = (e) => !!M && X(e.from, e.to), Re = [...k.wires].sort((e, t) => Number(Q(e)) + Number(!!Z(e)) - (Number(Q(t)) + Number(!!Z(t)))), ze = {
|
|
413
|
+
"--k-flow-dot-gap": `${L(ue * V.k)}px`,
|
|
414
|
+
"--k-flow-dot-x": `${V.x}px`,
|
|
415
|
+
"--k-flow-dot-y": `${V.y}px`
|
|
416
|
+
}, $ = { transform: `translate(${V.x}px, ${V.y}px) scale(${V.k})` }, Be = T("flowCanvas.connection", "{from} to {to}"), Ve = T("flowCanvas.connectionLabelled", "{from} to {to}, {label}");
|
|
477
417
|
return /* @__PURE__ */ h("div", {
|
|
478
418
|
ref: (e) => {
|
|
479
|
-
|
|
419
|
+
P.current = e, typeof w == "function" ? w(e) : w && (w.current = e);
|
|
480
420
|
},
|
|
481
421
|
"data-flow-canvas": "",
|
|
482
|
-
...
|
|
483
|
-
className: e("relative h-full min-h-0 w-full touch-none overflow-hidden bg-panel select-none cursor-grab dragging:cursor-grabbing",
|
|
484
|
-
style:
|
|
485
|
-
onPointerDown:
|
|
486
|
-
onPointerMove:
|
|
487
|
-
onPointerUp:
|
|
488
|
-
onPointerCancel:
|
|
422
|
+
...Se ? { "data-dragging": "" } : {},
|
|
423
|
+
className: e("relative h-full min-h-0 w-full touch-none overflow-hidden bg-panel select-none cursor-grab dragging:cursor-grabbing", le.background[re].classes, ie),
|
|
424
|
+
style: ze,
|
|
425
|
+
onPointerDown: De,
|
|
426
|
+
onPointerMove: Oe,
|
|
427
|
+
onPointerUp: ke,
|
|
428
|
+
onPointerCancel: ke,
|
|
489
429
|
children: [
|
|
490
430
|
/* @__PURE__ */ h("div", {
|
|
491
431
|
"aria-hidden": !0,
|
|
@@ -495,15 +435,15 @@ var ge = (e) => e ? e.label ?? (typeof e.title == "string" ? e.title : typeof e.
|
|
|
495
435
|
className: "absolute top-0 left-0 overflow-visible",
|
|
496
436
|
width: 1,
|
|
497
437
|
height: 1,
|
|
498
|
-
children:
|
|
499
|
-
let t = Z(e), n = !!
|
|
438
|
+
children: Re.map((e) => {
|
|
439
|
+
let t = Z(e), n = !!C && Q(e) && !t;
|
|
500
440
|
return /* @__PURE__ */ m("path", {
|
|
501
441
|
"data-flow-wire": e.key,
|
|
502
442
|
...t ? { "data-tone": t } : {},
|
|
503
443
|
...n ? { "data-flowing": "" } : {},
|
|
504
444
|
d: e.d,
|
|
505
445
|
fill: "none",
|
|
506
|
-
stroke:
|
|
446
|
+
stroke: Le(e),
|
|
507
447
|
strokeWidth: Q(e) ? 2 : 1.5,
|
|
508
448
|
strokeLinecap: "round",
|
|
509
449
|
strokeLinejoin: "round",
|
|
@@ -511,7 +451,7 @@ var ge = (e) => e ? e.label ?? (typeof e.title == "string" ? e.title : typeof e.
|
|
|
511
451
|
...e.variant === "fallback" || n ? { strokeDasharray: "4 5" } : {}
|
|
512
452
|
}, e.key);
|
|
513
453
|
})
|
|
514
|
-
}),
|
|
454
|
+
}), k.wires.map((t) => t.labelAt && /* @__PURE__ */ m("span", {
|
|
515
455
|
"data-flow-label": t.to,
|
|
516
456
|
className: e("absolute flex h-20 -translate-x-1/2 -translate-y-1/2 items-center rounded-pill bg-panel px-8 text-caption font-medium whitespace-nowrap text-fg-secondary shadow-ring", !X(t.from, t.to) && "text-fg-tertiary"),
|
|
517
457
|
style: {
|
|
@@ -521,10 +461,10 @@ var ge = (e) => e ? e.label ?? (typeof e.title == "string" ? e.title : typeof e.
|
|
|
521
461
|
children: t.label
|
|
522
462
|
}, `label:${t.key}`))]
|
|
523
463
|
}),
|
|
524
|
-
|
|
464
|
+
y && /* @__PURE__ */ m("div", {
|
|
525
465
|
className: "pointer-events-none absolute top-0 left-0 origin-top-left",
|
|
526
466
|
style: $,
|
|
527
|
-
children:
|
|
467
|
+
children: k.wires.map((e) => e.insertAt && e.edge && /* @__PURE__ */ m("span", {
|
|
528
468
|
"data-flow-interactive": "",
|
|
529
469
|
className: "pointer-events-auto absolute -translate-x-1/2 -translate-y-1/2",
|
|
530
470
|
style: {
|
|
@@ -532,14 +472,14 @@ var ge = (e) => e ? e.label ?? (typeof e.title == "string" ? e.title : typeof e.
|
|
|
532
472
|
top: e.insertAt.y
|
|
533
473
|
},
|
|
534
474
|
children: /* @__PURE__ */ h(i, { children: [/* @__PURE__ */ m(i.Trigger, { children: /* @__PURE__ */ m(r, {
|
|
535
|
-
icon:
|
|
475
|
+
icon: g,
|
|
536
476
|
variant: "secondary",
|
|
537
477
|
size: "xs",
|
|
538
478
|
tabIndex: -1,
|
|
539
|
-
"aria-label": e.edge.insertLabel ??
|
|
479
|
+
"aria-label": e.edge.insertLabel ?? T("flowCanvas.insert", "Insert a step here")
|
|
540
480
|
}) }), /* @__PURE__ */ m(i.Content, {
|
|
541
481
|
align: "center",
|
|
542
|
-
children:
|
|
482
|
+
children: y({
|
|
543
483
|
edge: e.edge.id,
|
|
544
484
|
insert: !0
|
|
545
485
|
})
|
|
@@ -548,56 +488,56 @@ var ge = (e) => e ? e.label ?? (typeof e.title == "string" ? e.title : typeof e.
|
|
|
548
488
|
}),
|
|
549
489
|
/* @__PURE__ */ m("div", {
|
|
550
490
|
role: "tree",
|
|
551
|
-
"aria-label":
|
|
552
|
-
"aria-describedby":
|
|
553
|
-
"aria-busy":
|
|
491
|
+
"aria-label": ae,
|
|
492
|
+
"aria-describedby": E,
|
|
493
|
+
"aria-busy": C || void 0,
|
|
554
494
|
className: "absolute top-0 left-0 origin-top-left",
|
|
555
495
|
style: $,
|
|
556
|
-
children:
|
|
557
|
-
let n =
|
|
496
|
+
children: k.order.map((t) => {
|
|
497
|
+
let n = k.items.get(t), o = n.level + 1, s = n.parent ? k.items.get(n.parent).children : [t], c = {
|
|
558
498
|
role: "treeitem",
|
|
559
499
|
"aria-level": o,
|
|
560
500
|
"aria-setsize": s.length,
|
|
561
501
|
"aria-posinset": s.indexOf(t) + 1,
|
|
562
|
-
tabIndex:
|
|
502
|
+
tabIndex: Ae === t ? 0 : -1,
|
|
563
503
|
"data-flow-item": t,
|
|
564
504
|
"data-flow-interactive": "",
|
|
565
|
-
onFocus: () =>
|
|
566
|
-
onKeyDown: (e) =>
|
|
505
|
+
onFocus: () => ye(t),
|
|
506
|
+
onKeyDown: (e) => Me(e, n)
|
|
567
507
|
};
|
|
568
508
|
if (n.kind === "slot") {
|
|
569
509
|
let e = n.edge;
|
|
570
510
|
return /* @__PURE__ */ m("span", {
|
|
571
511
|
className: "absolute flex items-center justify-center",
|
|
572
|
-
style:
|
|
512
|
+
style: Fe(n),
|
|
573
513
|
children: /* @__PURE__ */ h(i, { children: [/* @__PURE__ */ m(i.Trigger, { children: /* @__PURE__ */ m(r, {
|
|
574
|
-
ref:
|
|
514
|
+
ref: Ne(t),
|
|
575
515
|
...c,
|
|
576
516
|
"aria-selected": !1,
|
|
577
|
-
icon:
|
|
517
|
+
icon: g,
|
|
578
518
|
variant: "secondary",
|
|
579
519
|
size: "xs",
|
|
580
|
-
"aria-label": e.addLabel ??
|
|
520
|
+
"aria-label": e.addLabel ?? T("flowCanvas.add", "Add a step")
|
|
581
521
|
}) }), /* @__PURE__ */ m(i.Content, {
|
|
582
522
|
align: "start",
|
|
583
|
-
children:
|
|
523
|
+
children: y({
|
|
584
524
|
edge: e.id,
|
|
585
525
|
insert: !1
|
|
586
526
|
})
|
|
587
527
|
})] })
|
|
588
528
|
}, t);
|
|
589
529
|
}
|
|
590
|
-
let l = n.node, u = !!M && !M.has(t), d =
|
|
530
|
+
let l = n.node, u = !!M && !M.has(t), d = b?.(t), f = ge(l) ?? "";
|
|
591
531
|
return /* @__PURE__ */ h("div", {
|
|
592
|
-
ref:
|
|
532
|
+
ref: Ne(t),
|
|
593
533
|
...c,
|
|
594
|
-
"aria-selected":
|
|
534
|
+
"aria-selected": _ === t,
|
|
595
535
|
...d ? { "aria-haspopup": "menu" } : {},
|
|
596
536
|
...l["data-force"] ? { "data-force": l["data-force"] } : {},
|
|
597
537
|
...M ? { "data-trace": M.has(t) ? "on" : "off" } : {},
|
|
598
|
-
onClick: () =>
|
|
599
|
-
className: e("absolute flex cursor-pointer flex-col justify-center gap-2 rounded-well bg-panel px-12 py-10 text-left shadow-control transition-control outline-none focus-ring", "hover:shadow-control-hover selected:bg-item-hover selected:shadow-control-selected selected:hover:shadow-control-selected forced-colors:outline-1 forced-colors:outline-solid", l.status &&
|
|
600
|
-
style:
|
|
538
|
+
onClick: () => v?.(t),
|
|
539
|
+
className: e("absolute flex cursor-pointer flex-col justify-center gap-2 rounded-well bg-panel px-12 py-10 text-left shadow-control transition-control outline-none focus-ring", "hover:shadow-control-hover selected:bg-item-hover selected:shadow-control-selected selected:hover:shadow-control-selected forced-colors:outline-1 forced-colors:outline-solid", l.status && ce[l.status.tone], u && "shadow-ring", d && "pr-40"),
|
|
540
|
+
style: Fe(n),
|
|
601
541
|
children: [
|
|
602
542
|
/* @__PURE__ */ h("span", {
|
|
603
543
|
className: "flex h-16 min-w-0 items-center justify-between gap-8 text-caption font-medium text-fg-tertiary",
|
|
@@ -634,16 +574,16 @@ var ge = (e) => e ? e.label ?? (typeof e.title == "string" ? e.title : typeof e.
|
|
|
634
574
|
className: "absolute top-1/2 right-8 -translate-y-1/2",
|
|
635
575
|
onClick: (e) => e.stopPropagation(),
|
|
636
576
|
onFocus: (e) => {
|
|
637
|
-
e.stopPropagation(),
|
|
577
|
+
e.stopPropagation(), R.current.get(t)?.focus({ preventScroll: !0 });
|
|
638
578
|
},
|
|
639
579
|
children: /* @__PURE__ */ h(i, {
|
|
640
|
-
open:
|
|
641
|
-
onOpenChange: (e) =>
|
|
580
|
+
open: be === t,
|
|
581
|
+
onOpenChange: (e) => xe(e ? t : null),
|
|
642
582
|
children: [/* @__PURE__ */ m(i.Trigger, { children: /* @__PURE__ */ m(r, {
|
|
643
|
-
icon:
|
|
583
|
+
icon: ne,
|
|
644
584
|
size: "xs",
|
|
645
585
|
tabIndex: -1,
|
|
646
|
-
"aria-label":
|
|
586
|
+
"aria-label": T("flowCanvas.actionsFor", "Actions for {name}", { name: f })
|
|
647
587
|
}) }), /* @__PURE__ */ m(i.Content, {
|
|
648
588
|
align: "start",
|
|
649
589
|
children: d
|
|
@@ -659,53 +599,53 @@ var ge = (e) => e ? e.label ?? (typeof e.title == "string" ? e.title : typeof e.
|
|
|
659
599
|
className: "absolute bottom-24 left-24 flex flex-col gap-8",
|
|
660
600
|
children: [
|
|
661
601
|
/* @__PURE__ */ m(r, {
|
|
662
|
-
icon:
|
|
602
|
+
icon: g,
|
|
663
603
|
variant: "secondary",
|
|
664
604
|
tooltipSide: "right",
|
|
665
|
-
"aria-label":
|
|
666
|
-
disabled:
|
|
667
|
-
onClick: () =>
|
|
605
|
+
"aria-label": T("flowCanvas.zoomIn", "Zoom in"),
|
|
606
|
+
disabled: V.k >= j,
|
|
607
|
+
onClick: () => K(1)
|
|
668
608
|
}),
|
|
669
609
|
/* @__PURE__ */ m(r, {
|
|
670
|
-
icon:
|
|
610
|
+
icon: te,
|
|
671
611
|
variant: "secondary",
|
|
672
612
|
tooltipSide: "right",
|
|
673
|
-
"aria-label":
|
|
674
|
-
disabled:
|
|
675
|
-
onClick: () =>
|
|
613
|
+
"aria-label": T("flowCanvas.zoomOut", "Zoom out"),
|
|
614
|
+
disabled: V.k <= A,
|
|
615
|
+
onClick: () => K(-1)
|
|
676
616
|
}),
|
|
677
617
|
/* @__PURE__ */ m(r, {
|
|
678
|
-
icon:
|
|
618
|
+
icon: ee,
|
|
679
619
|
variant: "secondary",
|
|
680
620
|
tooltipSide: "right",
|
|
681
|
-
"aria-label":
|
|
682
|
-
onClick:
|
|
621
|
+
"aria-label": T("flowCanvas.fit", "Fit to view"),
|
|
622
|
+
onClick: Te
|
|
683
623
|
})
|
|
684
624
|
]
|
|
685
625
|
}),
|
|
686
626
|
/* @__PURE__ */ m("p", {
|
|
687
|
-
id:
|
|
627
|
+
id: E,
|
|
688
628
|
className: "sr-only",
|
|
689
|
-
children:
|
|
629
|
+
children: T("flowCanvas.keys", "Arrow keys move between steps, Enter selects one, plus and minus zoom, and 0 fits the view.")
|
|
690
630
|
}),
|
|
691
631
|
/* @__PURE__ */ m("ul", {
|
|
692
632
|
className: "sr-only",
|
|
693
|
-
children:
|
|
694
|
-
from:
|
|
695
|
-
to:
|
|
633
|
+
children: k.wires.map((e) => /* @__PURE__ */ m("li", { children: he(e.label ? Ve : Be, {
|
|
634
|
+
from: Pe(e.from),
|
|
635
|
+
to: Pe(e.to),
|
|
696
636
|
label: e.label
|
|
697
637
|
}) }, e.key))
|
|
698
638
|
})
|
|
699
639
|
]
|
|
700
640
|
});
|
|
701
641
|
});
|
|
702
|
-
process.env.NODE_ENV !== "production" && (
|
|
642
|
+
process.env.NODE_ENV !== "production" && (R.displayName = "FlowCanvas");
|
|
703
643
|
//#endregion
|
|
704
644
|
//#region src/components/flow-canvas/flow-workspace.tsx
|
|
705
|
-
var
|
|
645
|
+
var z = { width: {
|
|
706
646
|
default: { classes: "lg:w-400" },
|
|
707
647
|
wide: { classes: "lg:w-480" }
|
|
708
|
-
} },
|
|
648
|
+
} }, _e = { width: "default" }, B = /* @__PURE__ */ o(function({ children: t, panel: n, panelLabel: r, width: i = "default", className: a, ...o }, s) {
|
|
709
649
|
return /* @__PURE__ */ h("div", {
|
|
710
650
|
ref: s,
|
|
711
651
|
"data-flow-workspace": "",
|
|
@@ -718,13 +658,13 @@ var U = { width: {
|
|
|
718
658
|
}), n && /* @__PURE__ */ m("aside", {
|
|
719
659
|
...r ? { "aria-label": r } : {},
|
|
720
660
|
"data-flow-workspace-panel": "",
|
|
721
|
-
className: e("relative shrink-0 max-lg:divider-t lg:min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:scrollbar-quiet lg:divider-l",
|
|
661
|
+
className: e("relative shrink-0 max-lg:divider-t lg:min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:scrollbar-quiet lg:divider-l", z.width[i].classes),
|
|
722
662
|
children: n
|
|
723
663
|
})]
|
|
724
664
|
});
|
|
725
665
|
});
|
|
726
|
-
process.env.NODE_ENV !== "production" && (
|
|
727
|
-
var
|
|
666
|
+
process.env.NODE_ENV !== "production" && (B.displayName = "FlowWorkspace");
|
|
667
|
+
var V = /* @__PURE__ */ o(function({ title: t, description: n, actions: r, children: i, className: a, ...o }, s) {
|
|
728
668
|
let c = `k-flow-panel-${l().replace(/[^\w-]/g, "")}`;
|
|
729
669
|
return /* @__PURE__ */ h("section", {
|
|
730
670
|
ref: s,
|
|
@@ -754,9 +694,9 @@ var K = /* @__PURE__ */ o(function({ title: t, description: n, actions: r, child
|
|
|
754
694
|
]
|
|
755
695
|
});
|
|
756
696
|
});
|
|
757
|
-
process.env.NODE_ENV !== "production" && (
|
|
758
|
-
var
|
|
697
|
+
process.env.NODE_ENV !== "production" && (V.displayName = "FlowWorkspace.Panel");
|
|
698
|
+
var H = /* @__PURE__ */ Object.assign(B, { Panel: V });
|
|
759
699
|
//#endregion
|
|
760
|
-
export {
|
|
700
|
+
export { R as FlowCanvas, H as FlowWorkspace, V as FlowWorkspacePanel, O as KAESO_FLOW_CANVAS_DEFAULT_VARIANTS, le as KAESO_FLOW_CANVAS_VARIANTS, _e as KAESO_FLOW_WORKSPACE_DEFAULT_VARIANTS, z as KAESO_FLOW_WORKSPACE_VARIANTS };
|
|
761
701
|
|
|
762
702
|
//# sourceMappingURL=flow-canvas.js.map
|