treege 3.0.0-beta.26 → 3.0.0-beta.28
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/README.md +188 -24
- package/dist/ThemeContext-BBEqRK_Q.js +429 -0
- package/dist/{TreegeEditor-WqTXkYl3.js → TreegeEditor-Bi7GcSKl.js} +198 -197
- package/dist/TreegeRenderer-DbE0m_4e.js +1047 -0
- package/dist/editor.js +2 -2
- package/dist/main.js +50 -49
- package/dist/renderer/features/TreegeRenderer/native/TreegeRenderer.d.ts +19 -11
- package/dist/renderer/features/TreegeRenderer/native/components/DefaultFormWrapper.d.ts +7 -7
- package/dist/renderer/features/TreegeRenderer/native/components/DefaultGroup.d.ts +7 -7
- package/dist/renderer/features/TreegeRenderer/native/components/DefaultInputs.d.ts +26 -15
- package/dist/renderer/features/TreegeRenderer/native/components/DefaultSubmitButton.d.ts +9 -7
- package/dist/renderer/features/TreegeRenderer/native/components/DefaultSubmitButtonWrapper.d.ts +11 -0
- package/dist/renderer/features/TreegeRenderer/native/components/DefaultUI.d.ts +8 -7
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultAddressInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultAutocompleteInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultCheckboxInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultDateInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultDateRangeInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultFileInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultHiddenInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultHttpInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultNumberInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultPasswordInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultRadioInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultSelectInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultSwitchInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTextInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTextareaInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTimeInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTimeRangeInput.d.ts +3 -0
- package/dist/renderer/features/TreegeRenderer/useTreegeRenderer.d.ts +81 -23
- package/dist/renderer/features/TreegeRenderer/web/TreegeRenderer.d.ts +1 -1
- package/dist/renderer/hooks/useRenderNode.d.ts +55 -0
- package/dist/renderer/index.d.ts +1 -0
- package/dist/renderer/index.native.d.ts +19 -0
- package/dist/renderer/types/renderer.d.ts +20 -4
- package/dist/renderer/utils/sanitize.native.d.ts +69 -0
- package/dist/renderer/utils/submit.d.ts +1 -1
- package/dist/renderer-native.d.ts +2 -0
- package/dist/renderer-native.js +2833 -0
- package/dist/renderer.js +48 -47
- package/dist/separator-oCo7kxCK.js +364 -0
- package/dist/shared/constants/colors.d.ts +45 -0
- package/dist/shared/context/ThemeContext.d.ts +2 -0
- package/dist/shared/context/ThemeContext.native.d.ts +22 -0
- package/dist/shared/hooks/useThemeColors.d.ts +37 -0
- package/dist/shared/locales/ar.json.d.ts +13 -5
- package/dist/shared/locales/de.json.d.ts +13 -5
- package/dist/shared/locales/en.json.d.ts +13 -5
- package/dist/shared/locales/es.json.d.ts +13 -5
- package/dist/shared/locales/fr.json.d.ts +13 -5
- package/dist/shared/locales/it.json.d.ts +13 -5
- package/dist/shared/locales/pt.json.d.ts +13 -5
- package/dist/shared/types/node.d.ts +2 -2
- package/dist/useRenderNode-BACcrUML.js +863 -0
- package/package.json +24 -1
- package/dist/ThemeContext-BIT4DHqC.js +0 -764
- package/dist/TreegeRenderer-BSR_ez96.js +0 -1812
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { j as e, i as je, e as dt,
|
|
2
|
-
import { useNodes as
|
|
1
|
+
import { j as e, i as je, e as dt, L as oe, N as ye, c as Se, a as ct, b as ut, T as ht } from "./ThemeContext-BBEqRK_Q.js";
|
|
2
|
+
import { useNodes as Oe, useEdges as We, getBezierPath as Je, useReactFlow as ue, BaseEdge as qe, EdgeLabelRenderer as Xe, addEdge as mt, Handle as ie, Position as de, NodeResizer as pt, Panel as xt, ReactFlowProvider as gt, ReactFlow as jt, Background as Ct, BackgroundVariant as vt, MiniMap as ft, Controls as bt } from "@xyflow/react";
|
|
3
3
|
import { useForm as ne } from "@tanstack/react-form";
|
|
4
|
-
import { Waypoints as
|
|
5
|
-
import { useMemo as le, createContext as
|
|
4
|
+
import { Waypoints as Nt, X as se, Plus as X, Network as yt, Boxes as wt, Type as Qe, LucidePencilRuler as Ft, XIcon as et, WandSparkles as _e, Loader2 as St, Save as Et, EllipsisVertical as kt, Copy as Pt, Download as Dt, ArrowRightFromLine as Tt, Trash2 as tt, Variable as we, ChevronsUpDown as re, Check as At, PlusCircle as Vt } from "lucide-react";
|
|
5
|
+
import { useMemo as le, createContext as It, useContext as Ot, useState as z, memo as he, useCallback as $, useRef as Mt, useEffect as Lt, useId as Fe } from "react";
|
|
6
|
+
import { j as P, P as Me, g as Le, B as S, h as Be, F as N, L as j, I as k, f as M, k as Bt, S as _, m as R, n as Z, o as K, q as y, T as Ge, p as te, r as J, C as Gt, i as $t, a as zt, b as Ht, c as Re, d as Ve, t as $e, l as at, s as Ut } from "./separator-oCo7kxCK.js";
|
|
6
7
|
import * as Ce from "@radix-ui/react-scroll-area";
|
|
7
8
|
import { Slot as _t } from "@radix-ui/react-slot";
|
|
8
9
|
import { cva as Rt } from "class-variance-authority";
|
|
@@ -20,7 +21,7 @@ const Yt = "data:image/svg+xml,%3csvg%20width='462'%20height='144'%20viewBox='0%
|
|
|
20
21
|
className: "relative h-14 w-auto drop-shadow-[0_0px_35px] drop-shadow-blue-600"
|
|
21
22
|
}
|
|
22
23
|
) }), Ee = (t) => {
|
|
23
|
-
const s =
|
|
24
|
+
const s = Oe(), l = We();
|
|
24
25
|
return le(() => {
|
|
25
26
|
if (!t)
|
|
26
27
|
return [];
|
|
@@ -40,7 +41,7 @@ const Yt = "data:image/svg+xml,%3csvg%20width='462'%20height='144'%20viewBox='0%
|
|
|
40
41
|
};
|
|
41
42
|
});
|
|
42
43
|
}, [t, s, l]);
|
|
43
|
-
}, st =
|
|
44
|
+
}, st = It(null), qt = ({ children: t, value: s }) => {
|
|
44
45
|
const [l, i] = z(s?.flowId), h = le(
|
|
45
46
|
() => ({
|
|
46
47
|
...s,
|
|
@@ -56,17 +57,17 @@ const Yt = "data:image/svg+xml,%3csvg%20width='462'%20height='144'%20viewBox='0%
|
|
|
56
57
|
[l, s]
|
|
57
58
|
);
|
|
58
59
|
return /* @__PURE__ */ e.jsx(st.Provider, { value: h, children: t });
|
|
59
|
-
}, nt = () =>
|
|
60
|
+
}, nt = () => Ot(st) ?? {
|
|
60
61
|
flowId: void 0,
|
|
61
62
|
language: "en",
|
|
62
63
|
setFlowId: () => {
|
|
63
64
|
}
|
|
64
|
-
},
|
|
65
|
+
}, B = (t) => {
|
|
65
66
|
const l = nt().language;
|
|
66
67
|
return dt(l);
|
|
67
68
|
};
|
|
68
69
|
function ot({ className: t, children: s, ...l }) {
|
|
69
|
-
return /* @__PURE__ */ e.jsxs(Ce.Root, { "data-slot": "scroll-area", className:
|
|
70
|
+
return /* @__PURE__ */ e.jsxs(Ce.Root, { "data-slot": "scroll-area", className: P("relative", t), ...l, children: [
|
|
70
71
|
/* @__PURE__ */ e.jsx(
|
|
71
72
|
Ce.Viewport,
|
|
72
73
|
{
|
|
@@ -89,7 +90,7 @@ function Xt({
|
|
|
89
90
|
{
|
|
90
91
|
"data-slot": "scroll-area-scrollbar",
|
|
91
92
|
orientation: s,
|
|
92
|
-
className:
|
|
93
|
+
className: P(
|
|
93
94
|
"flex touch-none select-none p-px transition-colors",
|
|
94
95
|
s === "vertical" && "h-full w-2.5 border-l border-l-transparent",
|
|
95
96
|
s === "horizontal" && "h-2.5 flex-col border-t border-t-transparent",
|
|
@@ -113,14 +114,14 @@ const Qt = ({
|
|
|
113
114
|
style: c,
|
|
114
115
|
data: a
|
|
115
116
|
}) => {
|
|
116
|
-
const [r, u, m] =
|
|
117
|
+
const [r, u, m] = Je({
|
|
117
118
|
sourcePosition: n,
|
|
118
119
|
sourceX: l,
|
|
119
120
|
sourceY: i,
|
|
120
121
|
targetPosition: f,
|
|
121
122
|
targetX: h,
|
|
122
123
|
targetY: o
|
|
123
|
-
}), [p, x] = z(!1), { updateEdgeData: F } = ue(), g = Ee(s), w = a?.conditions && a.conditions.length > 0, C =
|
|
124
|
+
}), [p, x] = z(!1), { updateEdgeData: F } = ue(), g = Ee(s), w = a?.conditions && a.conditions.length > 0, C = B(), { handleSubmit: I, reset: b, Field: E } = ne({
|
|
124
125
|
defaultValues: {
|
|
125
126
|
conditions: a?.conditions || [{ field: g[0]?.nodeId ?? "", operator: "===", value: "" }],
|
|
126
127
|
isFallback: !!a?.isFallback,
|
|
@@ -149,24 +150,24 @@ const Qt = ({
|
|
|
149
150
|
const v = a.conditions;
|
|
150
151
|
if (v.length === 1)
|
|
151
152
|
return `${g.find((H) => H.nodeId === v[0].field)?.label || v[0].field} ${v[0].operator} ${v[0].value}`;
|
|
152
|
-
const
|
|
153
|
-
return
|
|
154
|
-
},
|
|
153
|
+
const G = v.filter((O) => O.logicalOperator === oe.AND).length, Ae = v.filter((O) => O.logicalOperator === oe.OR).length;
|
|
154
|
+
return G > 0 && Ae === 0 ? `${v.length} ${C("editor.conditionalEdge.conditionsAnd")}` : Ae > 0 && G === 0 ? `${v.length} ${C("editor.conditionalEdge.conditionsOr")}` : `${v.length} ${C("editor.conditionalEdge.conditionsMixed")}`;
|
|
155
|
+
}, D = () => a?.isFallback ? "var(--color-chart-4)" : w ? "var(--color-chart-2)" : "var(--color-chart-3)";
|
|
155
156
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
156
157
|
/* @__PURE__ */ e.jsx(
|
|
157
|
-
|
|
158
|
+
qe,
|
|
158
159
|
{
|
|
159
160
|
path: r,
|
|
160
161
|
markerEnd: d,
|
|
161
162
|
style: {
|
|
162
163
|
...c,
|
|
163
|
-
stroke:
|
|
164
|
+
stroke: D(),
|
|
164
165
|
strokeDasharray: a?.isFallback ? "5,5" : void 0,
|
|
165
166
|
strokeWidth: w || a?.isFallback ? 2 : c?.strokeWidth
|
|
166
167
|
}
|
|
167
168
|
}
|
|
168
169
|
),
|
|
169
|
-
/* @__PURE__ */ e.jsx(
|
|
170
|
+
/* @__PURE__ */ e.jsx(Xe, { children: /* @__PURE__ */ e.jsx(
|
|
170
171
|
"div",
|
|
171
172
|
{
|
|
172
173
|
className: "nodrag nopan absolute",
|
|
@@ -174,20 +175,20 @@ const Qt = ({
|
|
|
174
175
|
pointerEvents: "all",
|
|
175
176
|
transform: `translate(-50%, -50%) translate(${u}px,${m}px)`
|
|
176
177
|
},
|
|
177
|
-
children: /* @__PURE__ */ e.jsxs(
|
|
178
|
-
/* @__PURE__ */ e.jsx(
|
|
178
|
+
children: /* @__PURE__ */ e.jsxs(Me, { open: p, onOpenChange: x, children: [
|
|
179
|
+
/* @__PURE__ */ e.jsx(Le, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
179
180
|
S,
|
|
180
181
|
{
|
|
181
182
|
variant: w || a?.isFallback ? "default" : "secondary",
|
|
182
183
|
className: "h-8 px-2 text-xs",
|
|
183
184
|
onClick: A,
|
|
184
185
|
children: [
|
|
185
|
-
/* @__PURE__ */ e.jsx(
|
|
186
|
+
/* @__PURE__ */ e.jsx(Nt, { className: "mr-1 h-3 w-3" }),
|
|
186
187
|
w || a?.isFallback ? T() : C("editor.conditionalEdge.condition")
|
|
187
188
|
]
|
|
188
189
|
}
|
|
189
190
|
) }),
|
|
190
|
-
/* @__PURE__ */ e.jsx(
|
|
191
|
+
/* @__PURE__ */ e.jsx(Be, { className: "w-96 p-1", align: "center", onClick: (v) => v.stopPropagation(), children: /* @__PURE__ */ e.jsx(ot, { className: "flex max-h-150 flex-col p-3", children: /* @__PURE__ */ e.jsx(
|
|
191
192
|
"form",
|
|
192
193
|
{
|
|
193
194
|
onSubmit: (v) => {
|
|
@@ -202,23 +203,23 @@ const Qt = ({
|
|
|
202
203
|
/* @__PURE__ */ e.jsx(E, { name: "label", children: (v) => /* @__PURE__ */ e.jsxs(N, { children: [
|
|
203
204
|
/* @__PURE__ */ e.jsx(j, { htmlFor: v.name, children: C("editor.conditionalEdge.labelOptional") }),
|
|
204
205
|
/* @__PURE__ */ e.jsx(
|
|
205
|
-
|
|
206
|
+
k,
|
|
206
207
|
{
|
|
207
208
|
id: v.name,
|
|
208
209
|
placeholder: C("editor.conditionalEdge.labelPlaceholder"),
|
|
209
210
|
value: v.state.value,
|
|
210
|
-
onChange: (
|
|
211
|
+
onChange: (G) => v.handleChange(G.target.value)
|
|
211
212
|
}
|
|
212
213
|
),
|
|
213
214
|
/* @__PURE__ */ e.jsx(M, { children: C("editor.conditionalEdge.labelDesc") })
|
|
214
215
|
] }) }),
|
|
215
216
|
/* @__PURE__ */ e.jsx(E, { name: "isFallback", children: (v) => /* @__PURE__ */ e.jsx(N, { children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3 rounded-lg border bg-muted/20 p-3", children: [
|
|
216
217
|
/* @__PURE__ */ e.jsx(
|
|
217
|
-
|
|
218
|
+
Bt,
|
|
218
219
|
{
|
|
219
220
|
id: v.name,
|
|
220
221
|
checked: v.state.value,
|
|
221
|
-
onCheckedChange: (
|
|
222
|
+
onCheckedChange: (G) => v.handleChange(G)
|
|
222
223
|
}
|
|
223
224
|
),
|
|
224
225
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
@@ -227,9 +228,9 @@ const Qt = ({
|
|
|
227
228
|
] })
|
|
228
229
|
] }) }) }),
|
|
229
230
|
/* @__PURE__ */ e.jsx(E, { name: "conditions", mode: "array", children: (v) => {
|
|
230
|
-
const
|
|
231
|
+
const G = v.form.getFieldValue("isFallback");
|
|
231
232
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
|
|
232
|
-
/* @__PURE__ */ e.jsx(j, { className:
|
|
233
|
+
/* @__PURE__ */ e.jsx(j, { className: G ? "text-muted-foreground" : "", children: C("editor.conditionalEdge.conditions") }),
|
|
233
234
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
234
235
|
v.state.value?.map((Ae, O) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
235
236
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2 rounded-lg border bg-muted/30 p-3", children: [
|
|
@@ -238,7 +239,7 @@ const Qt = ({
|
|
|
238
239
|
/* @__PURE__ */ e.jsxs(
|
|
239
240
|
_,
|
|
240
241
|
{
|
|
241
|
-
disabled:
|
|
242
|
+
disabled: G,
|
|
242
243
|
value: H.state.value || "",
|
|
243
244
|
onValueChange: (Y) => H.handleChange(Y),
|
|
244
245
|
children: [
|
|
@@ -259,7 +260,7 @@ const Qt = ({
|
|
|
259
260
|
/* @__PURE__ */ e.jsxs(
|
|
260
261
|
_,
|
|
261
262
|
{
|
|
262
|
-
disabled:
|
|
263
|
+
disabled: G,
|
|
263
264
|
value: H.state.value || "===",
|
|
264
265
|
onValueChange: (Y) => H.handleChange(Y),
|
|
265
266
|
children: [
|
|
@@ -279,9 +280,9 @@ const Qt = ({
|
|
|
279
280
|
/* @__PURE__ */ e.jsx(E, { name: `conditions[${O}].value`, children: (H) => /* @__PURE__ */ e.jsxs(N, { className: "w-full", children: [
|
|
280
281
|
/* @__PURE__ */ e.jsx(j, { htmlFor: `value-${O}`, children: C("editor.conditionalEdge.value") }),
|
|
281
282
|
/* @__PURE__ */ e.jsx(
|
|
282
|
-
|
|
283
|
+
k,
|
|
283
284
|
{
|
|
284
|
-
disabled:
|
|
285
|
+
disabled: G,
|
|
285
286
|
id: `value-${O}`,
|
|
286
287
|
placeholder: C("editor.conditionalEdge.valuePlaceholder"),
|
|
287
288
|
value: H.state.value || "",
|
|
@@ -293,7 +294,7 @@ const Qt = ({
|
|
|
293
294
|
v.state.value && v.state.value.length > 1 && /* @__PURE__ */ e.jsxs(
|
|
294
295
|
S,
|
|
295
296
|
{
|
|
296
|
-
disabled:
|
|
297
|
+
disabled: G,
|
|
297
298
|
type: "button",
|
|
298
299
|
variant: "ghost",
|
|
299
300
|
size: "sm",
|
|
@@ -311,7 +312,7 @@ const Qt = ({
|
|
|
311
312
|
v.state.value && O < v.state.value.length - 1 && /* @__PURE__ */ e.jsx(E, { name: `conditions[${O}].logicalOperator`, children: (H) => /* @__PURE__ */ e.jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ e.jsxs(
|
|
312
313
|
_,
|
|
313
314
|
{
|
|
314
|
-
disabled:
|
|
315
|
+
disabled: G,
|
|
315
316
|
value: H.state.value || oe.AND,
|
|
316
317
|
onValueChange: (Y) => H.handleChange(Y),
|
|
317
318
|
children: [
|
|
@@ -327,7 +328,7 @@ const Qt = ({
|
|
|
327
328
|
/* @__PURE__ */ e.jsxs(
|
|
328
329
|
S,
|
|
329
330
|
{
|
|
330
|
-
disabled:
|
|
331
|
+
disabled: G,
|
|
331
332
|
type: "button",
|
|
332
333
|
variant: "outline",
|
|
333
334
|
size: "sm",
|
|
@@ -365,7 +366,7 @@ const Qt = ({
|
|
|
365
366
|
) })
|
|
366
367
|
] });
|
|
367
368
|
}, ea = he(Qt), ta = ({ id: t, sourceX: s, sourceY: l, targetX: i, targetY: h, sourcePosition: o, targetPosition: n, style: f, markerEnd: d, selected: c }) => {
|
|
368
|
-
const [a, r, u] =
|
|
369
|
+
const [a, r, u] = Je({
|
|
369
370
|
sourcePosition: o,
|
|
370
371
|
sourceX: s,
|
|
371
372
|
sourceY: l,
|
|
@@ -376,8 +377,8 @@ const Qt = ({
|
|
|
376
377
|
m((x) => x.filter((F) => F.id !== t));
|
|
377
378
|
};
|
|
378
379
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
379
|
-
/* @__PURE__ */ e.jsx(
|
|
380
|
-
/* @__PURE__ */ e.jsx(
|
|
380
|
+
/* @__PURE__ */ e.jsx(qe, { path: a, markerEnd: d, style: f }),
|
|
381
|
+
/* @__PURE__ */ e.jsx(Xe, { children: c && /* @__PURE__ */ e.jsx(
|
|
381
382
|
"div",
|
|
382
383
|
{
|
|
383
384
|
className: "button-edge__label nodrag nopan",
|
|
@@ -441,7 +442,7 @@ const rt = {
|
|
|
441
442
|
), f = $(
|
|
442
443
|
(u) => {
|
|
443
444
|
s((m) => {
|
|
444
|
-
const p =
|
|
445
|
+
const p = mt(u, m), x = u.source, F = i(x);
|
|
445
446
|
return p.filter((w) => w.source === x).length > 1 && F && je(F) ? p.map((w) => w.source === x ? {
|
|
446
447
|
...w,
|
|
447
448
|
data: {
|
|
@@ -513,7 +514,7 @@ const rt = {
|
|
|
513
514
|
},
|
|
514
515
|
[s, t]
|
|
515
516
|
);
|
|
516
|
-
}, Ue = ({ children: t, inGroup: s, isSubmit: l }) => /* @__PURE__ */ e.jsx("div", { className:
|
|
517
|
+
}, Ue = ({ children: t, inGroup: s, isSubmit: l }) => /* @__PURE__ */ e.jsx("div", { className: P("react-flow__node__wrapper", s && "in-group", l && "submit-type"), children: t }), la = Rt(
|
|
517
518
|
"inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
|
|
518
519
|
{
|
|
519
520
|
defaultVariants: {
|
|
@@ -538,15 +539,15 @@ function ve({
|
|
|
538
539
|
...i
|
|
539
540
|
}) {
|
|
540
541
|
const h = l ? _t : "span";
|
|
541
|
-
return /* @__PURE__ */ e.jsx(h, { "data-slot": "badge", className:
|
|
542
|
+
return /* @__PURE__ */ e.jsx(h, { "data-slot": "badge", className: P(la({ variant: s }), t), ...i });
|
|
542
543
|
}
|
|
543
544
|
const ia = ({ data: t, isConnectable: s, type: l, parentId: i, id: h }) => {
|
|
544
|
-
const n =
|
|
545
|
+
const n = B()(t?.label), f = He(h);
|
|
545
546
|
return /* @__PURE__ */ e.jsxs(Ue, { inGroup: !!i, children: [
|
|
546
547
|
/* @__PURE__ */ e.jsx(ie, { type: "target", position: de.Top, isConnectable: s, isConnectableStart: !1 }),
|
|
547
548
|
/* @__PURE__ */ e.jsx("div", { className: "mb-1 max-w-full overflow-hidden text-ellipsis text-nowrap text-2xl", children: n }),
|
|
548
549
|
/* @__PURE__ */ e.jsxs(ve, { variant: "destructive", className: "capitalize", children: [
|
|
549
|
-
/* @__PURE__ */ e.jsx(
|
|
550
|
+
/* @__PURE__ */ e.jsx(yt, {}),
|
|
550
551
|
l
|
|
551
552
|
] }),
|
|
552
553
|
/* @__PURE__ */ e.jsx(
|
|
@@ -562,21 +563,21 @@ const ia = ({ data: t, isConnectable: s, type: l, parentId: i, id: h }) => {
|
|
|
562
563
|
)
|
|
563
564
|
] });
|
|
564
565
|
}, da = he(ia), ca = ({ data: t }) => {
|
|
565
|
-
const l =
|
|
566
|
+
const l = B()(t?.label);
|
|
566
567
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
567
|
-
/* @__PURE__ */ e.jsx(
|
|
568
|
+
/* @__PURE__ */ e.jsx(pt, {}),
|
|
568
569
|
/* @__PURE__ */ e.jsx("div", { className: "-top-3.5 absolute left-6", children: /* @__PURE__ */ e.jsxs(ve, { className: "max-w-50 bg-chart-2", children: [
|
|
569
|
-
/* @__PURE__ */ e.jsx(
|
|
570
|
+
/* @__PURE__ */ e.jsx(wt, { className: "!w-3 !h-3" }),
|
|
570
571
|
l
|
|
571
572
|
] }) })
|
|
572
573
|
] });
|
|
573
574
|
}, ua = he(ca), ha = ({ data: t, isConnectable: s, parentId: l, id: i }) => {
|
|
574
|
-
const o =
|
|
575
|
+
const o = B()(t?.label), n = He(i);
|
|
575
576
|
return /* @__PURE__ */ e.jsxs(Ue, { inGroup: !!l, isSubmit: t?.type === "submit", children: [
|
|
576
577
|
/* @__PURE__ */ e.jsx(ie, { type: "target", position: de.Top, isConnectable: s, isConnectableStart: !1 }),
|
|
577
578
|
/* @__PURE__ */ e.jsx("div", { className: "mb-1 max-w-full overflow-hidden text-ellipsis text-nowrap text-2xl", children: o || t?.name }),
|
|
578
579
|
/* @__PURE__ */ e.jsx("div", { className: "flex gap-1", children: t?.type && /* @__PURE__ */ e.jsxs(ve, { variant: "blue", className: "capitalize", children: [
|
|
579
|
-
/* @__PURE__ */ e.jsx(
|
|
580
|
+
/* @__PURE__ */ e.jsx(Qe, {}),
|
|
580
581
|
t.type
|
|
581
582
|
] }) }),
|
|
582
583
|
/* @__PURE__ */ e.jsx(
|
|
@@ -592,17 +593,17 @@ const ia = ({ data: t, isConnectable: s, type: l, parentId: i, id: h }) => {
|
|
|
592
593
|
)
|
|
593
594
|
] });
|
|
594
595
|
}, ma = he(ha), pa = ({ data: t, isConnectable: s, type: l, parentId: i, id: h }) => {
|
|
595
|
-
const n =
|
|
596
|
+
const n = B()(t?.label), f = He(h);
|
|
596
597
|
return /* @__PURE__ */ e.jsxs(Ue, { inGroup: !!i, children: [
|
|
597
598
|
/* @__PURE__ */ e.jsx(ie, { type: "target", position: de.Top, isConnectable: s }),
|
|
598
599
|
/* @__PURE__ */ e.jsx("div", { className: "mb-1 max-w-full overflow-hidden text-ellipsis text-nowrap text-2xl capitalize", children: n }),
|
|
599
600
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
|
|
600
601
|
/* @__PURE__ */ e.jsxs(ve, { variant: "purple", children: [
|
|
601
|
-
/* @__PURE__ */ e.jsx(
|
|
602
|
+
/* @__PURE__ */ e.jsx(Ft, {}),
|
|
602
603
|
l
|
|
603
604
|
] }),
|
|
604
605
|
t?.type && /* @__PURE__ */ e.jsxs(ve, { variant: "outline", className: "capitalize", children: [
|
|
605
|
-
/* @__PURE__ */ e.jsx(
|
|
606
|
+
/* @__PURE__ */ e.jsx(Qe, {}),
|
|
606
607
|
t.type
|
|
607
608
|
] })
|
|
608
609
|
] }),
|
|
@@ -623,7 +624,7 @@ const ia = ({ data: t, isConnectable: s, type: l, parentId: i, id: h }) => {
|
|
|
623
624
|
[ye.group]: ua,
|
|
624
625
|
[ye.input]: ma,
|
|
625
626
|
[ye.ui]: xa
|
|
626
|
-
},
|
|
627
|
+
}, ke = `You are a Treege decision tree generator. You must generate valid JSON structures for decision trees.
|
|
627
628
|
|
|
628
629
|
IMPORTANT RULES:
|
|
629
630
|
1. Always respond with valid JSON only, no markdown, no code blocks, no explanations outside the JSON
|
|
@@ -983,12 +984,12 @@ Remember:
|
|
|
983
984
|
- For submit buttons, ALWAYS use type "input" with data.type "submit"
|
|
984
985
|
- For conditional edges, ALWAYS specify the value as a string and use proper operators (>=, <, ===, etc.)
|
|
985
986
|
- Never leave condition values empty - always provide the comparison value
|
|
986
|
-
`,
|
|
987
|
+
`, Pe = {
|
|
987
988
|
claude: "claude-3-5-haiku-20241022",
|
|
988
989
|
deepseek: "deepseek-chat",
|
|
989
990
|
gemini: "gemini-2.5-flash",
|
|
990
991
|
openai: "gpt-4o-mini"
|
|
991
|
-
},
|
|
992
|
+
}, De = 0.3;
|
|
992
993
|
function Te(t) {
|
|
993
994
|
try {
|
|
994
995
|
return JSON.parse(t);
|
|
@@ -1002,7 +1003,7 @@ function Te(t) {
|
|
|
1002
1003
|
}
|
|
1003
1004
|
}
|
|
1004
1005
|
async function ga(t) {
|
|
1005
|
-
const s = t.config.model ||
|
|
1006
|
+
const s = t.config.model || Pe.gemini, l = t.config.temperature ?? De, i = await fetch(
|
|
1006
1007
|
`https://generativelanguage.googleapis.com/v1beta/models/${s}:generateContent?key=${t.config.apiKey}`,
|
|
1007
1008
|
{
|
|
1008
1009
|
body: JSON.stringify({
|
|
@@ -1010,7 +1011,7 @@ async function ga(t) {
|
|
|
1010
1011
|
{
|
|
1011
1012
|
parts: [
|
|
1012
1013
|
{
|
|
1013
|
-
text: `${
|
|
1014
|
+
text: `${ke}
|
|
1014
1015
|
|
|
1015
1016
|
User request: ${t.prompt}`
|
|
1016
1017
|
}
|
|
@@ -1036,10 +1037,10 @@ User request: ${t.prompt}`
|
|
|
1036
1037
|
return Te(o);
|
|
1037
1038
|
}
|
|
1038
1039
|
async function ja(t) {
|
|
1039
|
-
const s = t.config.model ||
|
|
1040
|
+
const s = t.config.model || Pe.openai, l = t.config.temperature ?? De, i = await fetch("https://api.openai.com/v1/chat/completions", {
|
|
1040
1041
|
body: JSON.stringify({
|
|
1041
1042
|
messages: [
|
|
1042
|
-
{ content:
|
|
1043
|
+
{ content: ke, role: "system" },
|
|
1043
1044
|
{ content: t.prompt, role: "user" }
|
|
1044
1045
|
],
|
|
1045
1046
|
model: s,
|
|
@@ -1062,10 +1063,10 @@ async function ja(t) {
|
|
|
1062
1063
|
return Te(o);
|
|
1063
1064
|
}
|
|
1064
1065
|
async function Ca(t) {
|
|
1065
|
-
const s = t.config.model ||
|
|
1066
|
+
const s = t.config.model || Pe.deepseek, l = t.config.temperature ?? De, i = await fetch("https://api.deepseek.com/v1/chat/completions", {
|
|
1066
1067
|
body: JSON.stringify({
|
|
1067
1068
|
messages: [
|
|
1068
|
-
{ content:
|
|
1069
|
+
{ content: ke, role: "system" },
|
|
1069
1070
|
{ content: t.prompt, role: "user" }
|
|
1070
1071
|
],
|
|
1071
1072
|
model: s,
|
|
@@ -1088,12 +1089,12 @@ async function Ca(t) {
|
|
|
1088
1089
|
return Te(o);
|
|
1089
1090
|
}
|
|
1090
1091
|
async function va(t) {
|
|
1091
|
-
const s = t.config.model ||
|
|
1092
|
+
const s = t.config.model || Pe.claude, l = t.config.temperature ?? De, i = await fetch("https://api.anthropic.com/v1/messages", {
|
|
1092
1093
|
body: JSON.stringify({
|
|
1093
1094
|
max_tokens: 4096,
|
|
1094
1095
|
messages: [{ content: t.prompt, role: "user" }],
|
|
1095
1096
|
model: s,
|
|
1096
|
-
system:
|
|
1097
|
+
system: ke,
|
|
1097
1098
|
temperature: l
|
|
1098
1099
|
}),
|
|
1099
1100
|
headers: {
|
|
@@ -1140,7 +1141,7 @@ function wa({ className: t, ...s }) {
|
|
|
1140
1141
|
L.Overlay,
|
|
1141
1142
|
{
|
|
1142
1143
|
"data-slot": "dialog-overlay",
|
|
1143
|
-
className:
|
|
1144
|
+
className: P(
|
|
1144
1145
|
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in",
|
|
1145
1146
|
t
|
|
1146
1147
|
),
|
|
@@ -1160,7 +1161,7 @@ function Fa({
|
|
|
1160
1161
|
L.Content,
|
|
1161
1162
|
{
|
|
1162
1163
|
"data-slot": "dialog-content",
|
|
1163
|
-
className:
|
|
1164
|
+
className: P(
|
|
1164
1165
|
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in sm:max-w-lg",
|
|
1165
1166
|
t
|
|
1166
1167
|
),
|
|
@@ -1173,7 +1174,7 @@ function Fa({
|
|
|
1173
1174
|
"data-slot": "dialog-close",
|
|
1174
1175
|
className: "absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
1175
1176
|
children: [
|
|
1176
|
-
/* @__PURE__ */ e.jsx(
|
|
1177
|
+
/* @__PURE__ */ e.jsx(et, {}),
|
|
1177
1178
|
/* @__PURE__ */ e.jsx("span", { className: "sr-only", children: "Close" })
|
|
1178
1179
|
]
|
|
1179
1180
|
}
|
|
@@ -1184,19 +1185,19 @@ function Fa({
|
|
|
1184
1185
|
] });
|
|
1185
1186
|
}
|
|
1186
1187
|
function Sa({ className: t, ...s }) {
|
|
1187
|
-
return /* @__PURE__ */ e.jsx("div", { "data-slot": "dialog-header", className:
|
|
1188
|
+
return /* @__PURE__ */ e.jsx("div", { "data-slot": "dialog-header", className: P("flex flex-col gap-2 text-center sm:text-left", t), ...s });
|
|
1188
1189
|
}
|
|
1189
1190
|
function Ea({ className: t, ...s }) {
|
|
1190
|
-
return /* @__PURE__ */ e.jsx("div", { "data-slot": "dialog-footer", className:
|
|
1191
|
-
}
|
|
1192
|
-
function Da({ className: t, ...s }) {
|
|
1193
|
-
return /* @__PURE__ */ e.jsx(L.Title, { "data-slot": "dialog-title", className: k("font-semibold text-lg leading-none", t), ...s });
|
|
1191
|
+
return /* @__PURE__ */ e.jsx("div", { "data-slot": "dialog-footer", className: P("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", t), ...s });
|
|
1194
1192
|
}
|
|
1195
1193
|
function ka({ className: t, ...s }) {
|
|
1196
|
-
return /* @__PURE__ */ e.jsx(L.
|
|
1194
|
+
return /* @__PURE__ */ e.jsx(L.Title, { "data-slot": "dialog-title", className: P("font-semibold text-lg leading-none", t), ...s });
|
|
1195
|
+
}
|
|
1196
|
+
function Pa({ className: t, ...s }) {
|
|
1197
|
+
return /* @__PURE__ */ e.jsx(L.Description, { "data-slot": "dialog-description", className: P("text-muted-foreground text-sm", t), ...s });
|
|
1197
1198
|
}
|
|
1198
|
-
const
|
|
1199
|
-
const [l, i] = z(!1), [h, o] = z(""), [n, f] = z(!1), d =
|
|
1199
|
+
const Da = ({ aiConfig: t, onGenerate: s }) => {
|
|
1200
|
+
const [l, i] = z(!1), [h, o] = z(""), [n, f] = z(!1), d = B(), c = async () => {
|
|
1200
1201
|
if (!h.trim()) {
|
|
1201
1202
|
U.error(d("editor.aiGenerator.enterDescription"));
|
|
1202
1203
|
return;
|
|
@@ -1231,14 +1232,14 @@ const Pa = ({ aiConfig: t, onGenerate: s }) => {
|
|
|
1231
1232
|
};
|
|
1232
1233
|
return /* @__PURE__ */ e.jsxs(ba, { open: l, onOpenChange: i, children: [
|
|
1233
1234
|
/* @__PURE__ */ e.jsx(Na, { asChild: !0, children: /* @__PURE__ */ e.jsxs(S, { variant: "outline", size: "sm", disabled: !t?.apiKey, children: [
|
|
1234
|
-
/* @__PURE__ */ e.jsx(
|
|
1235
|
+
/* @__PURE__ */ e.jsx(_e, { className: "h-4 w-4 text-[#13d3b4]" }),
|
|
1235
1236
|
" ",
|
|
1236
1237
|
d("editor.aiGenerator.buttonLabel")
|
|
1237
1238
|
] }) }),
|
|
1238
1239
|
/* @__PURE__ */ e.jsxs(Fa, { className: "sm:max-w-[550px]", children: [
|
|
1239
1240
|
/* @__PURE__ */ e.jsxs(Sa, { children: [
|
|
1240
|
-
/* @__PURE__ */ e.jsx(
|
|
1241
|
-
/* @__PURE__ */ e.jsx(
|
|
1241
|
+
/* @__PURE__ */ e.jsx(ka, { children: d("editor.aiGenerator.title") }),
|
|
1242
|
+
/* @__PURE__ */ e.jsx(Pa, { children: d("editor.aiGenerator.titleDescription") })
|
|
1242
1243
|
] }),
|
|
1243
1244
|
/* @__PURE__ */ e.jsxs("div", { className: "grid gap-4 py-4", children: [
|
|
1244
1245
|
/* @__PURE__ */ e.jsxs("div", { className: "grid gap-2", children: [
|
|
@@ -1269,10 +1270,10 @@ const Pa = ({ aiConfig: t, onGenerate: s }) => {
|
|
|
1269
1270
|
/* @__PURE__ */ e.jsxs(Ea, { children: [
|
|
1270
1271
|
/* @__PURE__ */ e.jsx(S, { variant: "outline", onClick: () => i(!1), disabled: n, children: d("editor.aiGenerator.cancel") }),
|
|
1271
1272
|
/* @__PURE__ */ e.jsx(S, { onClick: c, disabled: n || !h.trim() || !t?.apiKey, children: n ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1272
|
-
/* @__PURE__ */ e.jsx(
|
|
1273
|
+
/* @__PURE__ */ e.jsx(St, { className: "h-4 w-4 animate-spin" }),
|
|
1273
1274
|
d("editor.aiGenerator.generating")
|
|
1274
1275
|
] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1275
|
-
/* @__PURE__ */ e.jsx(
|
|
1276
|
+
/* @__PURE__ */ e.jsx(_e, { className: "h-4 w-4 text-[--treege-color-primary]" }),
|
|
1276
1277
|
d("editor.aiGenerator.generate")
|
|
1277
1278
|
] }) })
|
|
1278
1279
|
] })
|
|
@@ -1291,7 +1292,7 @@ function Ne({ className: t, sideOffset: s = 4, ...l }) {
|
|
|
1291
1292
|
{
|
|
1292
1293
|
"data-slot": "dropdown-menu-content",
|
|
1293
1294
|
sideOffset: s,
|
|
1294
|
-
className:
|
|
1295
|
+
className: P(
|
|
1295
1296
|
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in",
|
|
1296
1297
|
t
|
|
1297
1298
|
),
|
|
@@ -1314,7 +1315,7 @@ function W({
|
|
|
1314
1315
|
"data-slot": "dropdown-menu-item",
|
|
1315
1316
|
"data-inset": s,
|
|
1316
1317
|
"data-variant": l,
|
|
1317
|
-
className:
|
|
1318
|
+
className: P(
|
|
1318
1319
|
"data-[variant=destructive]:*:[svg]:!text-destructive relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[disabled]:opacity-50 data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
1319
1320
|
t
|
|
1320
1321
|
),
|
|
@@ -1332,7 +1333,7 @@ function Ta({
|
|
|
1332
1333
|
{
|
|
1333
1334
|
"data-slot": "dropdown-menu-label",
|
|
1334
1335
|
"data-inset": s,
|
|
1335
|
-
className:
|
|
1336
|
+
className: P("px-2 py-1.5 font-medium text-sm data-[inset]:pl-8", t),
|
|
1336
1337
|
...l
|
|
1337
1338
|
}
|
|
1338
1339
|
);
|
|
@@ -1342,13 +1343,13 @@ function Ke({ className: t, ...s }) {
|
|
|
1342
1343
|
ae.Separator,
|
|
1343
1344
|
{
|
|
1344
1345
|
"data-slot": "dropdown-menu-separator",
|
|
1345
|
-
className:
|
|
1346
|
+
className: P("-mx-1 my-1 h-px bg-border", t),
|
|
1346
1347
|
...s
|
|
1347
1348
|
}
|
|
1348
1349
|
);
|
|
1349
1350
|
}
|
|
1350
1351
|
const Aa = ce(), Va = ({ onExportJson: t, onSave: s }) => {
|
|
1351
|
-
const { flowId: l, setFlowId: i, aiConfig: h } = nt(), { setNodes: o, setEdges: n, addNodes: f, screenToFlowPosition: d } = ue(), c = l || Aa, a =
|
|
1352
|
+
const { flowId: l, setFlowId: i, aiConfig: h } = nt(), { setNodes: o, setEdges: n, addNodes: f, screenToFlowPosition: d } = ue(), c = l || Aa, a = Oe(), r = We(), u = Mt(null), m = B(), p = () => {
|
|
1352
1353
|
const b = (window.innerWidth || 0) / 2, E = (window.innerHeight || 0) / 2, A = parseInt(getComputedStyle(document.documentElement).getPropertyValue("--node-width"), 10), V = parseInt(getComputedStyle(document.documentElement).getPropertyValue("--node-height"), 10), T = d({ x: b - A, y: E - V });
|
|
1353
1354
|
f([
|
|
1354
1355
|
{
|
|
@@ -1400,27 +1401,27 @@ const Aa = ce(), Va = ({ onExportJson: t, onSave: s }) => {
|
|
|
1400
1401
|
}, I = (b) => {
|
|
1401
1402
|
o(b.nodes), n(b.edges);
|
|
1402
1403
|
};
|
|
1403
|
-
return
|
|
1404
|
+
return Lt(() => {
|
|
1404
1405
|
const b = (E) => {
|
|
1405
1406
|
(E.ctrlKey || E.metaKey) && E.key === "s" && (E.preventDefault(), g());
|
|
1406
1407
|
};
|
|
1407
1408
|
return window.addEventListener("keydown", b), () => {
|
|
1408
1409
|
window.removeEventListener("keydown", b);
|
|
1409
1410
|
};
|
|
1410
|
-
}, [g]), /* @__PURE__ */ e.jsxs(
|
|
1411
|
-
/* @__PURE__ */ e.jsx(
|
|
1411
|
+
}, [g]), /* @__PURE__ */ e.jsxs(xt, { position: "top-right", className: "flex gap-2", children: [
|
|
1412
|
+
/* @__PURE__ */ e.jsx(Da, { aiConfig: h, onGenerate: I }),
|
|
1412
1413
|
/* @__PURE__ */ e.jsxs(S, { variant: "outline", size: "sm", onClick: p, children: [
|
|
1413
1414
|
/* @__PURE__ */ e.jsx(X, {}),
|
|
1414
1415
|
" ",
|
|
1415
1416
|
m("editor.actionsPanel.addNode")
|
|
1416
1417
|
] }),
|
|
1417
1418
|
/* @__PURE__ */ e.jsxs(S, { variant: "outline", size: "sm", onClick: g, children: [
|
|
1418
|
-
/* @__PURE__ */ e.jsx(
|
|
1419
|
+
/* @__PURE__ */ e.jsx(Et, {}),
|
|
1419
1420
|
" ",
|
|
1420
1421
|
m("common.save")
|
|
1421
1422
|
] }),
|
|
1422
1423
|
/* @__PURE__ */ e.jsxs(fe, { children: [
|
|
1423
|
-
/* @__PURE__ */ e.jsx(be, { asChild: !0, children: /* @__PURE__ */ e.jsx(S, { variant: "outline", size: "sm", children: /* @__PURE__ */ e.jsx(
|
|
1424
|
+
/* @__PURE__ */ e.jsx(be, { asChild: !0, children: /* @__PURE__ */ e.jsx(S, { variant: "outline", size: "sm", children: /* @__PURE__ */ e.jsx(kt, {}) }) }),
|
|
1424
1425
|
/* @__PURE__ */ e.jsxs(Ne, { align: "start", children: [
|
|
1425
1426
|
/* @__PURE__ */ e.jsx(Ta, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
1426
1427
|
/* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground text-xs", children: "Flow ID" }),
|
|
@@ -1431,7 +1432,7 @@ const Aa = ce(), Va = ({ onExportJson: t, onSave: s }) => {
|
|
|
1431
1432
|
className: "flex items-center gap-2 font-mono text-muted-foreground transition-colors hover:text-primary",
|
|
1432
1433
|
type: "button",
|
|
1433
1434
|
children: [
|
|
1434
|
-
/* @__PURE__ */ e.jsx(
|
|
1435
|
+
/* @__PURE__ */ e.jsx(Pt, { className: "h-3 w-3" }),
|
|
1435
1436
|
/* @__PURE__ */ e.jsx("span", { className: "truncate text-xs", children: c })
|
|
1436
1437
|
]
|
|
1437
1438
|
}
|
|
@@ -1440,19 +1441,19 @@ const Aa = ce(), Va = ({ onExportJson: t, onSave: s }) => {
|
|
|
1440
1441
|
/* @__PURE__ */ e.jsx(Ke, {}),
|
|
1441
1442
|
/* @__PURE__ */ e.jsxs(Ze, { children: [
|
|
1442
1443
|
/* @__PURE__ */ e.jsxs(W, { onClick: () => u?.current?.click(), children: [
|
|
1443
|
-
/* @__PURE__ */ e.jsx(
|
|
1444
|
+
/* @__PURE__ */ e.jsx(Dt, {}),
|
|
1444
1445
|
" ",
|
|
1445
1446
|
m("editor.actionsPanel.importJson")
|
|
1446
1447
|
] }),
|
|
1447
1448
|
/* @__PURE__ */ e.jsxs(W, { onClick: F, children: [
|
|
1448
|
-
/* @__PURE__ */ e.jsx(
|
|
1449
|
+
/* @__PURE__ */ e.jsx(Tt, {}),
|
|
1449
1450
|
" ",
|
|
1450
1451
|
m("editor.actionsPanel.exportJson")
|
|
1451
1452
|
] })
|
|
1452
1453
|
] }),
|
|
1453
1454
|
/* @__PURE__ */ e.jsx(Ke, {}),
|
|
1454
1455
|
/* @__PURE__ */ e.jsx(Ze, { children: /* @__PURE__ */ e.jsxs(W, { onClick: C, className: "text-destructive focus:text-destructive", children: [
|
|
1455
|
-
/* @__PURE__ */ e.jsx(
|
|
1456
|
+
/* @__PURE__ */ e.jsx(tt, { className: "text-destructive" }),
|
|
1456
1457
|
" ",
|
|
1457
1458
|
m("editor.actionsPanel.clear")
|
|
1458
1459
|
] }) })
|
|
@@ -1523,7 +1524,7 @@ const Aa = ce(), Va = ({ onExportJson: t, onSave: s }) => {
|
|
|
1523
1524
|
updateSelectedNodeType: n
|
|
1524
1525
|
};
|
|
1525
1526
|
}, ee = () => {
|
|
1526
|
-
const t =
|
|
1527
|
+
const t = Oe(), s = le(() => t.filter(Se), [t]), l = le(() => t.filter((h) => h.selected), [t]), i = le(() => t.find((h) => h.selected), [t]);
|
|
1527
1528
|
return {
|
|
1528
1529
|
groupNodes: s,
|
|
1529
1530
|
hasSelectedNodes: l.length > 0,
|
|
@@ -1532,7 +1533,7 @@ const Aa = ce(), Va = ({ onExportJson: t, onSave: s }) => {
|
|
|
1532
1533
|
selectedNodes: l
|
|
1533
1534
|
};
|
|
1534
1535
|
}, Oa = () => {
|
|
1535
|
-
const [t, s] = z("en"), { updateSelectedNodeData: l } = me(), { selectedNode: i } = ee(), h =
|
|
1536
|
+
const [t, s] = z("en"), { updateSelectedNodeData: l } = me(), { selectedNode: i } = ee(), h = B(), { Field: o } = ne({
|
|
1536
1537
|
defaultValues: {
|
|
1537
1538
|
label: i?.data?.label || { en: "" },
|
|
1538
1539
|
targetId: i?.data?.targetId || ""
|
|
@@ -1562,7 +1563,7 @@ const Aa = ce(), Va = ({ onExportJson: t, onSave: s }) => {
|
|
|
1562
1563
|
children: (n) => /* @__PURE__ */ e.jsxs(N, { className: "flex-1", children: [
|
|
1563
1564
|
/* @__PURE__ */ e.jsx(j, { htmlFor: n.name, children: h("editor.flowNodeForm.label") }),
|
|
1564
1565
|
/* @__PURE__ */ e.jsx(
|
|
1565
|
-
|
|
1566
|
+
k,
|
|
1566
1567
|
{
|
|
1567
1568
|
id: n.name,
|
|
1568
1569
|
name: n.name,
|
|
@@ -1591,7 +1592,7 @@ const Aa = ce(), Va = ({ onExportJson: t, onSave: s }) => {
|
|
|
1591
1592
|
" (Flow ID)"
|
|
1592
1593
|
] }),
|
|
1593
1594
|
/* @__PURE__ */ e.jsx(
|
|
1594
|
-
|
|
1595
|
+
k,
|
|
1595
1596
|
{
|
|
1596
1597
|
id: n.name,
|
|
1597
1598
|
name: n.name,
|
|
@@ -1636,7 +1637,7 @@ const Aa = ce(), Va = ({ onExportJson: t, onSave: s }) => {
|
|
|
1636
1637
|
children: (o) => /* @__PURE__ */ e.jsxs(N, { className: "flex-1", children: [
|
|
1637
1638
|
/* @__PURE__ */ e.jsx(j, { htmlFor: o.name, children: "Label" }),
|
|
1638
1639
|
/* @__PURE__ */ e.jsx(
|
|
1639
|
-
|
|
1640
|
+
k,
|
|
1640
1641
|
{
|
|
1641
1642
|
id: o.name,
|
|
1642
1643
|
name: o.name,
|
|
@@ -1657,8 +1658,8 @@ const Aa = ce(), Va = ({ onExportJson: t, onSave: s }) => {
|
|
|
1657
1658
|
] })
|
|
1658
1659
|
}
|
|
1659
1660
|
);
|
|
1660
|
-
}, La = ["POST", "PUT", "PATCH"],
|
|
1661
|
-
const { selectedNode: l } = ee(), i =
|
|
1661
|
+
}, La = ["POST", "PUT", "PATCH"], Ba = ({ value: t, onChange: s }) => {
|
|
1662
|
+
const { selectedNode: l } = ee(), i = B(), h = Ee(l?.id), { handleSubmit: o, Field: n, Subscribe: f } = ne({
|
|
1662
1663
|
defaultValues: {
|
|
1663
1664
|
body: t?.body || "",
|
|
1664
1665
|
fetchOnMount: t?.fetchOnMount ?? !t?.searchParam,
|
|
@@ -1670,7 +1671,7 @@ const Aa = ce(), Va = ({ onExportJson: t, onSave: s }) => {
|
|
|
1670
1671
|
},
|
|
1671
1672
|
responsePath: t?.responsePath || "",
|
|
1672
1673
|
searchParam: t?.searchParam || "",
|
|
1673
|
-
|
|
1674
|
+
sendAllFormValues: !!t?.sendAllFormValues,
|
|
1674
1675
|
showLoading: t?.showLoading !== !1,
|
|
1675
1676
|
url: t?.url || ""
|
|
1676
1677
|
},
|
|
@@ -1693,7 +1694,7 @@ const Aa = ce(), Va = ({ onExportJson: t, onSave: s }) => {
|
|
|
1693
1694
|
/* @__PURE__ */ e.jsx(j, { htmlFor: d.name, children: i("editor.httpConfigForm.apiUrl") }),
|
|
1694
1695
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
1695
1696
|
/* @__PURE__ */ e.jsx(
|
|
1696
|
-
|
|
1697
|
+
k,
|
|
1697
1698
|
{
|
|
1698
1699
|
id: d.name,
|
|
1699
1700
|
name: d.name,
|
|
@@ -1759,7 +1760,7 @@ const Aa = ce(), Va = ({ onExportJson: t, onSave: s }) => {
|
|
|
1759
1760
|
const r = `headers[${a}]`;
|
|
1760
1761
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-start gap-2", children: [
|
|
1761
1762
|
/* @__PURE__ */ e.jsx(n, { name: `headers[${a}].key`, children: (u) => /* @__PURE__ */ e.jsx(
|
|
1762
|
-
|
|
1763
|
+
k,
|
|
1763
1764
|
{
|
|
1764
1765
|
placeholder: i("editor.httpConfigForm.headerName"),
|
|
1765
1766
|
value: u.state.value || "",
|
|
@@ -1767,7 +1768,7 @@ const Aa = ce(), Va = ({ onExportJson: t, onSave: s }) => {
|
|
|
1767
1768
|
}
|
|
1768
1769
|
) }),
|
|
1769
1770
|
/* @__PURE__ */ e.jsx(n, { name: `headers[${a}].value`, children: (u) => /* @__PURE__ */ e.jsx(
|
|
1770
|
-
|
|
1771
|
+
k,
|
|
1771
1772
|
{
|
|
1772
1773
|
placeholder: i("editor.httpConfigForm.headerValue"),
|
|
1773
1774
|
value: u.state.value || "",
|
|
@@ -1805,10 +1806,10 @@ const Aa = ce(), Va = ({ onExportJson: t, onSave: s }) => {
|
|
|
1805
1806
|
)
|
|
1806
1807
|
] }) })
|
|
1807
1808
|
] }),
|
|
1808
|
-
/* @__PURE__ */ e.jsx(f, { selector: (d) => ({ method: d.values.method,
|
|
1809
|
-
/* @__PURE__ */ e.jsx(n, { name: "
|
|
1809
|
+
/* @__PURE__ */ e.jsx(f, { selector: (d) => ({ method: d.values.method, sendAllFormValues: d.values.sendAllFormValues }), children: ({ method: d, sendAllFormValues: c }) => La.includes(d || "") && /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
1810
|
+
/* @__PURE__ */ e.jsx(n, { name: "sendAllFormValues", children: (a) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
1810
1811
|
/* @__PURE__ */ e.jsx(J, { id: a.name, checked: a.state.value, onCheckedChange: (r) => a.handleChange(r) }),
|
|
1811
|
-
/* @__PURE__ */ e.jsx(j, { htmlFor: a.name, children: i("editor.httpConfigForm.
|
|
1812
|
+
/* @__PURE__ */ e.jsx(j, { htmlFor: a.name, children: i("editor.httpConfigForm.sendAllFormValues") })
|
|
1812
1813
|
] }) }),
|
|
1813
1814
|
/* @__PURE__ */ e.jsx(n, { name: "body", children: (a) => /* @__PURE__ */ e.jsxs(N, { children: [
|
|
1814
1815
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-2 flex items-center justify-between", children: [
|
|
@@ -1847,7 +1848,7 @@ const Aa = ce(), Va = ({ onExportJson: t, onSave: s }) => {
|
|
|
1847
1848
|
disabled: c
|
|
1848
1849
|
}
|
|
1849
1850
|
),
|
|
1850
|
-
/* @__PURE__ */ e.jsx(M, { children: i(c ? "editor.httpConfigForm.
|
|
1851
|
+
/* @__PURE__ */ e.jsx(M, { children: i(c ? "editor.httpConfigForm.sendAllFormValuesDesc" : "editor.httpConfigForm.requestBodyDesc") })
|
|
1851
1852
|
] }) })
|
|
1852
1853
|
] }) }),
|
|
1853
1854
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
@@ -1859,7 +1860,7 @@ const Aa = ce(), Va = ({ onExportJson: t, onSave: s }) => {
|
|
|
1859
1860
|
children: (d) => /* @__PURE__ */ e.jsxs(N, { children: [
|
|
1860
1861
|
/* @__PURE__ */ e.jsx(j, { htmlFor: d.name, children: i("editor.httpConfigForm.responsePath") }),
|
|
1861
1862
|
/* @__PURE__ */ e.jsx(
|
|
1862
|
-
|
|
1863
|
+
k,
|
|
1863
1864
|
{
|
|
1864
1865
|
id: d.name,
|
|
1865
1866
|
name: d.name,
|
|
@@ -1882,7 +1883,7 @@ const Aa = ce(), Va = ({ onExportJson: t, onSave: s }) => {
|
|
|
1882
1883
|
children: (d) => /* @__PURE__ */ e.jsxs(N, { children: [
|
|
1883
1884
|
/* @__PURE__ */ e.jsx(j, { htmlFor: d.name, children: i("editor.httpConfigForm.valueField") }),
|
|
1884
1885
|
/* @__PURE__ */ e.jsx(
|
|
1885
|
-
|
|
1886
|
+
k,
|
|
1886
1887
|
{
|
|
1887
1888
|
id: d.name,
|
|
1888
1889
|
name: d.name,
|
|
@@ -1903,7 +1904,7 @@ const Aa = ce(), Va = ({ onExportJson: t, onSave: s }) => {
|
|
|
1903
1904
|
children: (d) => /* @__PURE__ */ e.jsxs(N, { children: [
|
|
1904
1905
|
/* @__PURE__ */ e.jsx(j, { htmlFor: d.name, children: i("editor.httpConfigForm.labelField") }),
|
|
1905
1906
|
/* @__PURE__ */ e.jsx(
|
|
1906
|
-
|
|
1907
|
+
k,
|
|
1907
1908
|
{
|
|
1908
1909
|
id: d.name,
|
|
1909
1910
|
name: d.name,
|
|
@@ -1925,7 +1926,7 @@ const Aa = ce(), Va = ({ onExportJson: t, onSave: s }) => {
|
|
|
1925
1926
|
children: (d) => /* @__PURE__ */ e.jsxs(N, { children: [
|
|
1926
1927
|
/* @__PURE__ */ e.jsx(j, { htmlFor: d.name, children: i("editor.httpConfigForm.searchParameter") }),
|
|
1927
1928
|
/* @__PURE__ */ e.jsx(
|
|
1928
|
-
|
|
1929
|
+
k,
|
|
1929
1930
|
{
|
|
1930
1931
|
id: d.name,
|
|
1931
1932
|
name: d.name,
|
|
@@ -1969,15 +1970,15 @@ const Aa = ce(), Va = ({ onExportJson: t, onSave: s }) => {
|
|
|
1969
1970
|
)
|
|
1970
1971
|
] })
|
|
1971
1972
|
] }) });
|
|
1972
|
-
},
|
|
1973
|
-
const [l, i] = z("en"), { selectedNode: h } = ee(), o =
|
|
1973
|
+
}, Ga = ["POST", "PUT", "PATCH"], $a = ({ value: t, onChange: s }) => {
|
|
1974
|
+
const [l, i] = z("en"), { selectedNode: h } = ee(), o = B(), n = Ee(h?.id), { handleSubmit: f, Field: d, Subscribe: c } = ne({
|
|
1974
1975
|
defaultValues: {
|
|
1975
1976
|
body: t?.body || "",
|
|
1976
1977
|
errorMessage: t?.errorMessage || { en: "" },
|
|
1977
1978
|
headers: t?.headers || [],
|
|
1978
1979
|
method: t?.method || "POST",
|
|
1979
1980
|
redirectUrl: t?.redirectUrl || "",
|
|
1980
|
-
|
|
1981
|
+
sendAllFormValues: !!t?.sendAllFormValues,
|
|
1981
1982
|
showLoading: t?.showLoading !== !1,
|
|
1982
1983
|
successMessage: t?.successMessage || { en: "" },
|
|
1983
1984
|
url: t?.url || ""
|
|
@@ -2001,7 +2002,7 @@ const Aa = ce(), Va = ({ onExportJson: t, onSave: s }) => {
|
|
|
2001
2002
|
/* @__PURE__ */ e.jsx(j, { htmlFor: a.name, children: o("editor.submitConfigForm.apiUrl") }),
|
|
2002
2003
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
2003
2004
|
/* @__PURE__ */ e.jsx(
|
|
2004
|
-
|
|
2005
|
+
k,
|
|
2005
2006
|
{
|
|
2006
2007
|
id: a.name,
|
|
2007
2008
|
name: a.name,
|
|
@@ -2066,7 +2067,7 @@ const Aa = ce(), Va = ({ onExportJson: t, onSave: s }) => {
|
|
|
2066
2067
|
const m = `headers[${u}]`;
|
|
2067
2068
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-start gap-2", children: [
|
|
2068
2069
|
/* @__PURE__ */ e.jsx(d, { name: `headers[${u}].key`, children: (p) => /* @__PURE__ */ e.jsx(
|
|
2069
|
-
|
|
2070
|
+
k,
|
|
2070
2071
|
{
|
|
2071
2072
|
placeholder: o("editor.submitConfigForm.headerName"),
|
|
2072
2073
|
value: p.state.value || "",
|
|
@@ -2074,7 +2075,7 @@ const Aa = ce(), Va = ({ onExportJson: t, onSave: s }) => {
|
|
|
2074
2075
|
}
|
|
2075
2076
|
) }),
|
|
2076
2077
|
/* @__PURE__ */ e.jsx(d, { name: `headers[${u}].value`, children: (p) => /* @__PURE__ */ e.jsx(
|
|
2077
|
-
|
|
2078
|
+
k,
|
|
2078
2079
|
{
|
|
2079
2080
|
placeholder: o("editor.submitConfigForm.headerValue"),
|
|
2080
2081
|
value: p.state.value || "",
|
|
@@ -2112,10 +2113,10 @@ const Aa = ce(), Va = ({ onExportJson: t, onSave: s }) => {
|
|
|
2112
2113
|
)
|
|
2113
2114
|
] }) })
|
|
2114
2115
|
] }),
|
|
2115
|
-
/* @__PURE__ */ e.jsx(c, { selector: (a) => ({ method: a.values.method,
|
|
2116
|
-
/* @__PURE__ */ e.jsx(d, { name: "
|
|
2116
|
+
/* @__PURE__ */ e.jsx(c, { selector: (a) => ({ method: a.values.method, sendAllFormValues: a.values.sendAllFormValues }), children: ({ method: a, sendAllFormValues: r }) => Ga.includes(a || "") && /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
2117
|
+
/* @__PURE__ */ e.jsx(d, { name: "sendAllFormValues", children: (u) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
2117
2118
|
/* @__PURE__ */ e.jsx(J, { id: u.name, checked: u.state.value, onCheckedChange: (m) => u.handleChange(m) }),
|
|
2118
|
-
/* @__PURE__ */ e.jsx(j, { htmlFor: u.name, children: o("editor.submitConfigForm.
|
|
2119
|
+
/* @__PURE__ */ e.jsx(j, { htmlFor: u.name, children: o("editor.submitConfigForm.sendAllFormValues") })
|
|
2119
2120
|
] }) }),
|
|
2120
2121
|
/* @__PURE__ */ e.jsx(d, { name: "body", children: (u) => /* @__PURE__ */ e.jsxs(N, { children: [
|
|
2121
2122
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-2 flex items-center justify-between", children: [
|
|
@@ -2154,7 +2155,7 @@ const Aa = ce(), Va = ({ onExportJson: t, onSave: s }) => {
|
|
|
2154
2155
|
disabled: r
|
|
2155
2156
|
}
|
|
2156
2157
|
),
|
|
2157
|
-
/* @__PURE__ */ e.jsx(M, { children: o(r ? "editor.submitConfigForm.
|
|
2158
|
+
/* @__PURE__ */ e.jsx(M, { children: o(r ? "editor.submitConfigForm.sendAllFormValuesDesc" : "editor.submitConfigForm.requestBodyDesc") })
|
|
2158
2159
|
] }) })
|
|
2159
2160
|
] }) }),
|
|
2160
2161
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
@@ -2166,7 +2167,7 @@ const Aa = ce(), Va = ({ onExportJson: t, onSave: s }) => {
|
|
|
2166
2167
|
children: (a) => /* @__PURE__ */ e.jsxs(N, { children: [
|
|
2167
2168
|
/* @__PURE__ */ e.jsx(j, { htmlFor: a.name, children: o("editor.submitConfigForm.redirectUrl") }),
|
|
2168
2169
|
/* @__PURE__ */ e.jsx(
|
|
2169
|
-
|
|
2170
|
+
k,
|
|
2170
2171
|
{
|
|
2171
2172
|
id: a.name,
|
|
2172
2173
|
name: a.name,
|
|
@@ -2188,7 +2189,7 @@ const Aa = ce(), Va = ({ onExportJson: t, onSave: s }) => {
|
|
|
2188
2189
|
children: (a) => /* @__PURE__ */ e.jsxs(N, { className: "flex-1", children: [
|
|
2189
2190
|
/* @__PURE__ */ e.jsx(j, { htmlFor: a.name, children: o("editor.submitConfigForm.successMessage") }),
|
|
2190
2191
|
/* @__PURE__ */ e.jsx(
|
|
2191
|
-
|
|
2192
|
+
k,
|
|
2192
2193
|
{
|
|
2193
2194
|
id: a.name,
|
|
2194
2195
|
name: a.name,
|
|
@@ -2217,7 +2218,7 @@ const Aa = ce(), Va = ({ onExportJson: t, onSave: s }) => {
|
|
|
2217
2218
|
children: (a) => /* @__PURE__ */ e.jsxs(N, { className: "flex-1", children: [
|
|
2218
2219
|
/* @__PURE__ */ e.jsx(j, { htmlFor: a.name, children: o("editor.submitConfigForm.errorMessage") }),
|
|
2219
2220
|
/* @__PURE__ */ e.jsx(
|
|
2220
|
-
|
|
2221
|
+
k,
|
|
2221
2222
|
{
|
|
2222
2223
|
id: a.name,
|
|
2223
2224
|
name: a.name,
|
|
@@ -2267,64 +2268,64 @@ const Aa = ce(), Va = ({ onExportJson: t, onSave: s }) => {
|
|
|
2267
2268
|
allowClear: a = !0,
|
|
2268
2269
|
allowCreate: r = !0
|
|
2269
2270
|
}) => {
|
|
2270
|
-
const [u, m] = z(!1), [p, x] = z(""), F = (
|
|
2271
|
-
|
|
2271
|
+
const [u, m] = z(!1), [p, x] = z(""), F = (D) => D ?? "", g = (D) => D.trim().toLowerCase(), w = F(l), C = l !== null && l !== "", I = C ? t.find((D) => F(D.value) === w) : void 0, b = g(p), E = r && b !== "" && !t.some((D) => g(D.label) === b || g(D.value ?? "") === b), A = (D) => {
|
|
2272
|
+
D === w ? a && i?.("") : i?.(D), m(!1), x("");
|
|
2272
2273
|
}, V = () => {
|
|
2273
2274
|
p.trim() && (i?.(p.trim()), m(!1), x(""));
|
|
2274
2275
|
}, T = () => {
|
|
2275
2276
|
i?.(""), m(!1), x("");
|
|
2276
2277
|
};
|
|
2277
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2278
|
-
/* @__PURE__ */ e.jsx(
|
|
2278
|
+
return /* @__PURE__ */ e.jsxs(Me, { open: u, onOpenChange: m, children: [
|
|
2279
|
+
/* @__PURE__ */ e.jsx(Le, { asChild: !0, id: s, children: /* @__PURE__ */ e.jsxs(
|
|
2279
2280
|
S,
|
|
2280
2281
|
{
|
|
2281
2282
|
type: "button",
|
|
2282
2283
|
variant: "outline",
|
|
2283
2284
|
role: "combobox",
|
|
2284
2285
|
"aria-expanded": u,
|
|
2285
|
-
className:
|
|
2286
|
+
className: P("w-full justify-between font-normal", c),
|
|
2286
2287
|
children: [
|
|
2287
2288
|
/* @__PURE__ */ e.jsx("span", { className: "truncate", children: C && I ? I.label : h }),
|
|
2288
2289
|
/* @__PURE__ */ e.jsx(re, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
2289
2290
|
]
|
|
2290
2291
|
}
|
|
2291
2292
|
) }),
|
|
2292
|
-
/* @__PURE__ */ e.jsx(
|
|
2293
|
-
/* @__PURE__ */ e.jsx(
|
|
2294
|
-
/* @__PURE__ */ e.jsxs(
|
|
2295
|
-
/* @__PURE__ */ e.jsx(
|
|
2296
|
-
a && C && /* @__PURE__ */ e.jsx(
|
|
2293
|
+
/* @__PURE__ */ e.jsx(Be, { className: "w-full p-0", align: "start", children: /* @__PURE__ */ e.jsxs(Gt, { shouldFilter: !1, children: [
|
|
2294
|
+
/* @__PURE__ */ e.jsx($t, { placeholder: o, value: p, onValueChange: x }),
|
|
2295
|
+
/* @__PURE__ */ e.jsxs(zt, { children: [
|
|
2296
|
+
/* @__PURE__ */ e.jsx(Ht, { children: d }),
|
|
2297
|
+
a && C && /* @__PURE__ */ e.jsx(Re, { children: /* @__PURE__ */ e.jsxs(Ve, { value: "__clear__", onSelect: T, className: "mt-1 text-muted-foreground", children: [
|
|
2297
2298
|
/* @__PURE__ */ e.jsx(se, { className: "mr-2 h-4 w-4" }),
|
|
2298
2299
|
f
|
|
2299
2300
|
] }) }),
|
|
2300
|
-
/* @__PURE__ */ e.jsxs(
|
|
2301
|
+
/* @__PURE__ */ e.jsxs(Re, { children: [
|
|
2301
2302
|
E && /* @__PURE__ */ e.jsxs(Ve, { value: `__create__${p}`, onSelect: V, className: "text-primary", children: [
|
|
2302
2303
|
/* @__PURE__ */ e.jsx(X, { className: "mr-2 h-4 w-4" }),
|
|
2303
2304
|
n(p)
|
|
2304
2305
|
] }),
|
|
2305
|
-
t.filter((
|
|
2306
|
+
t.filter((D) => {
|
|
2306
2307
|
const v = p.toLowerCase();
|
|
2307
|
-
return
|
|
2308
|
-
}).map((
|
|
2308
|
+
return D.label.toLowerCase().includes(v) || (D.value?.toLowerCase() ?? "").includes(v);
|
|
2309
|
+
}).map((D, v) => /* @__PURE__ */ e.jsxs(
|
|
2309
2310
|
Ve,
|
|
2310
2311
|
{
|
|
2311
|
-
value:
|
|
2312
|
-
onSelect: () => A(
|
|
2312
|
+
value: D.label,
|
|
2313
|
+
onSelect: () => A(D?.value || ""),
|
|
2313
2314
|
children: [
|
|
2314
2315
|
/* @__PURE__ */ e.jsx(
|
|
2315
|
-
|
|
2316
|
+
At,
|
|
2316
2317
|
{
|
|
2317
2318
|
"aria-hidden": "true",
|
|
2318
|
-
className:
|
|
2319
|
+
className: P(
|
|
2319
2320
|
"mr-2 h-4 w-4",
|
|
2320
|
-
C && F(
|
|
2321
|
+
C && F(D.value) === w ? "opacity-100" : "opacity-0"
|
|
2321
2322
|
)
|
|
2322
2323
|
}
|
|
2323
2324
|
),
|
|
2324
|
-
|
|
2325
|
+
D.label
|
|
2325
2326
|
]
|
|
2326
2327
|
},
|
|
2327
|
-
|
|
2328
|
+
D.value ?? D.label ?? v
|
|
2328
2329
|
))
|
|
2329
2330
|
] })
|
|
2330
2331
|
] })
|
|
@@ -2379,9 +2380,9 @@ const Aa = ce(), Va = ({ onExportJson: t, onSave: s }) => {
|
|
|
2379
2380
|
time: "time",
|
|
2380
2381
|
timerange: "timerange"
|
|
2381
2382
|
}, Ra = ({ value: t, onValueChange: s }) => {
|
|
2382
|
-
const l =
|
|
2383
|
+
const l = B(), i = Fe();
|
|
2383
2384
|
return /* @__PURE__ */ e.jsxs(te, { children: [
|
|
2384
|
-
/* @__PURE__ */ e.jsx(
|
|
2385
|
+
/* @__PURE__ */ e.jsx($e, { htmlFor: i, children: l("editor.selectInputType.type") }),
|
|
2385
2386
|
/* @__PURE__ */ e.jsxs(_, { value: t, onValueChange: s, children: [
|
|
2386
2387
|
/* @__PURE__ */ e.jsx(R, { id: i, className: "w-full capitalize", children: /* @__PURE__ */ e.jsx(Z, { placeholder: "" }) }),
|
|
2387
2388
|
/* @__PURE__ */ e.jsx(K, { children: /* @__PURE__ */ e.jsx(te, { children: Object.values(_a).map((h) => /* @__PURE__ */ e.jsx(y, { value: h, className: "capitalize", children: h }, h)) }) })
|
|
@@ -2398,7 +2399,7 @@ function ge({ ...t }) {
|
|
|
2398
2399
|
return /* @__PURE__ */ e.jsx(ze.CollapsibleContent, { "data-slot": "collapsible-content", ...t });
|
|
2399
2400
|
}
|
|
2400
2401
|
const Za = () => {
|
|
2401
|
-
const [t, s] = z("en"), { selectedNode: l } = ee(), { updateSelectedNodeData: i } = me(), h = ["select", "radio", "autocomplete", "checkbox"].includes(l?.data?.type || ""), o = Ee(l?.id), n =
|
|
2402
|
+
const [t, s] = z("en"), { selectedNode: l } = ee(), { updateSelectedNodeData: i } = me(), h = ["select", "radio", "autocomplete", "checkbox"].includes(l?.data?.type || ""), o = Ee(l?.id), n = B(), f = l?.data?.type === "submit", { handleSubmit: d, Field: c } = ne({
|
|
2402
2403
|
defaultValues: {
|
|
2403
2404
|
defaultValue: l?.data?.defaultValue,
|
|
2404
2405
|
disablePast: l?.data?.disablePast,
|
|
@@ -2447,7 +2448,7 @@ const Za = () => {
|
|
|
2447
2448
|
children: (a) => /* @__PURE__ */ e.jsxs(N, { className: "flex-1", children: [
|
|
2448
2449
|
/* @__PURE__ */ e.jsx(j, { htmlFor: a.name, children: n("editor.inputNodeForm.label") }),
|
|
2449
2450
|
/* @__PURE__ */ e.jsx(
|
|
2450
|
-
|
|
2451
|
+
k,
|
|
2451
2452
|
{
|
|
2452
2453
|
autoFocus: !0,
|
|
2453
2454
|
id: a.name,
|
|
@@ -2475,7 +2476,7 @@ const Za = () => {
|
|
|
2475
2476
|
children: (a) => /* @__PURE__ */ e.jsxs(N, { className: "flex-1", children: [
|
|
2476
2477
|
/* @__PURE__ */ e.jsx(j, { htmlFor: a.name, children: n("editor.inputNodeForm.placeholder") }),
|
|
2477
2478
|
/* @__PURE__ */ e.jsx(
|
|
2478
|
-
|
|
2479
|
+
k,
|
|
2479
2480
|
{
|
|
2480
2481
|
id: a.name,
|
|
2481
2482
|
name: a.name,
|
|
@@ -2502,7 +2503,7 @@ const Za = () => {
|
|
|
2502
2503
|
children: (a) => /* @__PURE__ */ e.jsxs(N, { className: "flex-1", children: [
|
|
2503
2504
|
/* @__PURE__ */ e.jsx(j, { htmlFor: a.name, children: n("editor.inputNodeForm.helperText") }),
|
|
2504
2505
|
/* @__PURE__ */ e.jsx(
|
|
2505
|
-
|
|
2506
|
+
k,
|
|
2506
2507
|
{
|
|
2507
2508
|
id: a.name,
|
|
2508
2509
|
name: a.name,
|
|
@@ -2530,7 +2531,7 @@ const Za = () => {
|
|
|
2530
2531
|
] })
|
|
2531
2532
|
] }) }),
|
|
2532
2533
|
/* @__PURE__ */ e.jsx(ge, { className: "flex flex-col gap-4", children: /* @__PURE__ */ e.jsx(c, { name: "httpConfig", children: (a) => /* @__PURE__ */ e.jsx(
|
|
2533
|
-
|
|
2534
|
+
Ba,
|
|
2534
2535
|
{
|
|
2535
2536
|
value: a.state.value,
|
|
2536
2537
|
onChange: (r) => {
|
|
@@ -2581,7 +2582,7 @@ const Za = () => {
|
|
|
2581
2582
|
const m = `options[${u}]`;
|
|
2582
2583
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-start gap-2", children: [
|
|
2583
2584
|
/* @__PURE__ */ e.jsx(c, { name: `options[${u}].label`, children: (p) => /* @__PURE__ */ e.jsx(
|
|
2584
|
-
|
|
2585
|
+
k,
|
|
2585
2586
|
{
|
|
2586
2587
|
placeholder: n("editor.inputNodeForm.optionLabel"),
|
|
2587
2588
|
value: p.state.value?.[t] || "",
|
|
@@ -2594,7 +2595,7 @@ const Za = () => {
|
|
|
2594
2595
|
}
|
|
2595
2596
|
) }),
|
|
2596
2597
|
/* @__PURE__ */ e.jsx(c, { name: `options[${u}].value`, children: (p) => /* @__PURE__ */ e.jsx(
|
|
2597
|
-
|
|
2598
|
+
k,
|
|
2598
2599
|
{
|
|
2599
2600
|
placeholder: n("editor.inputNodeForm.optionValue"),
|
|
2600
2601
|
value: p.state.value || "",
|
|
@@ -2687,7 +2688,7 @@ const Za = () => {
|
|
|
2687
2688
|
children: (a) => /* @__PURE__ */ e.jsxs(N, { className: "flex-1", children: [
|
|
2688
2689
|
/* @__PURE__ */ e.jsx(j, { htmlFor: a.name, children: n("editor.inputNodeForm.errorMessage") }),
|
|
2689
2690
|
/* @__PURE__ */ e.jsx(
|
|
2690
|
-
|
|
2691
|
+
k,
|
|
2691
2692
|
{
|
|
2692
2693
|
id: a.name,
|
|
2693
2694
|
name: a.name,
|
|
@@ -2724,7 +2725,7 @@ const Za = () => {
|
|
|
2724
2725
|
children: (a) => /* @__PURE__ */ e.jsxs(N, { children: [
|
|
2725
2726
|
/* @__PURE__ */ e.jsx(j, { htmlFor: a.name, children: n("editor.inputNodeForm.name") }),
|
|
2726
2727
|
/* @__PURE__ */ e.jsx(
|
|
2727
|
-
|
|
2728
|
+
k,
|
|
2728
2729
|
{
|
|
2729
2730
|
id: a.name,
|
|
2730
2731
|
name: a.name,
|
|
@@ -2763,7 +2764,7 @@ const Za = () => {
|
|
|
2763
2764
|
return (u === "select" || u === "checkbox") && l?.data?.multiple ? /* @__PURE__ */ e.jsxs(N, { children: [
|
|
2764
2765
|
/* @__PURE__ */ e.jsx(j, { htmlFor: r.name, children: n("editor.inputNodeForm.defaultValuesCommaSeparated") }),
|
|
2765
2766
|
/* @__PURE__ */ e.jsx(
|
|
2766
|
-
|
|
2767
|
+
k,
|
|
2767
2768
|
{
|
|
2768
2769
|
id: r.name,
|
|
2769
2770
|
placeholder: n("editor.inputNodeForm.defaultValuesPlaceholder"),
|
|
@@ -2787,7 +2788,7 @@ const Za = () => {
|
|
|
2787
2788
|
] }) }) : /* @__PURE__ */ e.jsxs(N, { children: [
|
|
2788
2789
|
/* @__PURE__ */ e.jsx(j, { htmlFor: r.name, children: n("editor.inputNodeForm.staticValue") }),
|
|
2789
2790
|
/* @__PURE__ */ e.jsx(
|
|
2790
|
-
|
|
2791
|
+
k,
|
|
2791
2792
|
{
|
|
2792
2793
|
id: r.name,
|
|
2793
2794
|
placeholder: n("editor.inputNodeForm.staticValuePlaceholder"),
|
|
@@ -2856,7 +2857,7 @@ const Za = () => {
|
|
|
2856
2857
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
2857
2858
|
r.state.value?.map((u, m) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2858
2859
|
/* @__PURE__ */ e.jsx(c, { name: `defaultValue.objectMapping[${m}].sourceKey`, children: (p) => /* @__PURE__ */ e.jsx(
|
|
2859
|
-
|
|
2860
|
+
k,
|
|
2860
2861
|
{
|
|
2861
2862
|
placeholder: n("editor.inputNodeForm.sourceKey"),
|
|
2862
2863
|
value: p.state.value || "",
|
|
@@ -2865,7 +2866,7 @@ const Za = () => {
|
|
|
2865
2866
|
) }),
|
|
2866
2867
|
/* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground", children: "→" }),
|
|
2867
2868
|
/* @__PURE__ */ e.jsx(c, { name: `defaultValue.objectMapping[${m}].targetKey`, children: (p) => /* @__PURE__ */ e.jsx(
|
|
2868
|
-
|
|
2869
|
+
k,
|
|
2869
2870
|
{
|
|
2870
2871
|
placeholder: n("editor.inputNodeForm.targetKey"),
|
|
2871
2872
|
value: p.state.value || "",
|
|
@@ -2945,7 +2946,7 @@ const Za = () => {
|
|
|
2945
2946
|
children: (o) => /* @__PURE__ */ e.jsxs(N, { className: "flex-1", children: [
|
|
2946
2947
|
/* @__PURE__ */ e.jsx(j, { htmlFor: o.name, children: "Label" }),
|
|
2947
2948
|
/* @__PURE__ */ e.jsx(
|
|
2948
|
-
|
|
2949
|
+
k,
|
|
2949
2950
|
{
|
|
2950
2951
|
id: o.name,
|
|
2951
2952
|
name: o.name,
|
|
@@ -2969,7 +2970,7 @@ const Za = () => {
|
|
|
2969
2970
|
{
|
|
2970
2971
|
name: "type",
|
|
2971
2972
|
children: (o) => /* @__PURE__ */ e.jsxs(te, { children: [
|
|
2972
|
-
/* @__PURE__ */ e.jsx(
|
|
2973
|
+
/* @__PURE__ */ e.jsx($e, { htmlFor: o.name, children: "Type" }),
|
|
2973
2974
|
/* @__PURE__ */ e.jsxs(_, { value: o.state.value, onValueChange: (n) => o.handleChange(n), children: [
|
|
2974
2975
|
/* @__PURE__ */ e.jsx(R, { id: o.name, className: "w-full", children: /* @__PURE__ */ e.jsx(Z, { placeholder: "" }) }),
|
|
2975
2976
|
/* @__PURE__ */ e.jsx(K, { children: /* @__PURE__ */ e.jsxs(te, { children: [
|
|
@@ -2984,7 +2985,7 @@ const Za = () => {
|
|
|
2984
2985
|
}
|
|
2985
2986
|
);
|
|
2986
2987
|
}, Ya = () => {
|
|
2987
|
-
const [t, s] = z(""), [l, i] = z(!1), { selectedNode: h, groupNodes: o } = ee(), { setNodes: n } = ue(), f = h?.parentId || "none", d = Se(h), c =
|
|
2988
|
+
const [t, s] = z(""), [l, i] = z(!1), { selectedNode: h, groupNodes: o } = ee(), { setNodes: n } = ue(), f = h?.parentId || "none", d = Se(h), c = B(), a = Fe(), r = Fe();
|
|
2988
2989
|
if (d)
|
|
2989
2990
|
return null;
|
|
2990
2991
|
const u = (p) => {
|
|
@@ -3057,9 +3058,9 @@ const Za = () => {
|
|
|
3057
3058
|
o.map((p) => /* @__PURE__ */ e.jsx(y, { value: p.id, children: p.data.label?.en ? String(p.data.label?.en) : p.id }, p.id))
|
|
3058
3059
|
] }) })
|
|
3059
3060
|
] }),
|
|
3060
|
-
/* @__PURE__ */ e.jsxs(
|
|
3061
|
-
/* @__PURE__ */ e.jsx(
|
|
3062
|
-
/* @__PURE__ */ e.jsx(
|
|
3061
|
+
/* @__PURE__ */ e.jsxs(Me, { open: l, onOpenChange: i, children: [
|
|
3062
|
+
/* @__PURE__ */ e.jsx(Le, { asChild: !0, children: /* @__PURE__ */ e.jsx(S, { variant: "outline", size: "icon", title: "Create a new group", children: /* @__PURE__ */ e.jsx(Vt, { className: "h-4 w-4" }) }) }),
|
|
3063
|
+
/* @__PURE__ */ e.jsx(Be, { className: "w-80", align: "end", disablePortal: !0, children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
3063
3064
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3064
3065
|
/* @__PURE__ */ e.jsx("h4", { className: "font-medium leading-none", children: c("editor.selectNodeGroup.newGroup") }),
|
|
3065
3066
|
/* @__PURE__ */ e.jsx("p", { className: "text-muted-foreground text-sm", children: c("editor.selectNodeGroup.newGroupDescription") })
|
|
@@ -3067,7 +3068,7 @@ const Za = () => {
|
|
|
3067
3068
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3068
3069
|
/* @__PURE__ */ e.jsx(j, { htmlFor: r, children: c("editor.selectNodeGroup.groupName") }),
|
|
3069
3070
|
/* @__PURE__ */ e.jsx(
|
|
3070
|
-
|
|
3071
|
+
k,
|
|
3071
3072
|
{
|
|
3072
3073
|
autoFocus: !0,
|
|
3073
3074
|
id: r,
|
|
@@ -3089,9 +3090,9 @@ const Za = () => {
|
|
|
3089
3090
|
] })
|
|
3090
3091
|
] });
|
|
3091
3092
|
}, Wa = () => {
|
|
3092
|
-
const { selectedNode: t } = ee(), { updateSelectedNodeType: s } = me(), l = t?.type || "", i = Se(t), h =
|
|
3093
|
+
const { selectedNode: t } = ee(), { updateSelectedNodeType: s } = me(), l = t?.type || "", i = Se(t), h = B(), o = Fe();
|
|
3093
3094
|
return /* @__PURE__ */ e.jsxs(te, { children: [
|
|
3094
|
-
/* @__PURE__ */ e.jsx(
|
|
3095
|
+
/* @__PURE__ */ e.jsx($e, { htmlFor: o, children: h("editor.selectNodeType.nodeType") }),
|
|
3095
3096
|
/* @__PURE__ */ e.jsxs(_, { value: l, onValueChange: (n) => s(n), disabled: i, children: [
|
|
3096
3097
|
/* @__PURE__ */ e.jsx(R, { className: "w-full", id: o, children: /* @__PURE__ */ e.jsx(Z, { placeholder: h("editor.selectNodeType.nodeType") }) }),
|
|
3097
3098
|
/* @__PURE__ */ e.jsx(K, { children: /* @__PURE__ */ e.jsx(te, { children: Object.keys(it).filter((n) => i ? n === "group" : n !== "group").map((n) => /* @__PURE__ */ e.jsx(y, { value: n, children: h(`editor.selectNodeType.options.${n}`) }, n)) }) })
|
|
@@ -3112,7 +3113,7 @@ function Qa({ className: t, ...s }) {
|
|
|
3112
3113
|
Q.Overlay,
|
|
3113
3114
|
{
|
|
3114
3115
|
"data-slot": "alert-dialog-overlay",
|
|
3115
|
-
className:
|
|
3116
|
+
className: P(
|
|
3116
3117
|
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in",
|
|
3117
3118
|
t
|
|
3118
3119
|
),
|
|
@@ -3127,7 +3128,7 @@ function es({ className: t, ...s }) {
|
|
|
3127
3128
|
Q.Content,
|
|
3128
3129
|
{
|
|
3129
3130
|
"data-slot": "alert-dialog-content",
|
|
3130
|
-
className:
|
|
3131
|
+
className: P(
|
|
3131
3132
|
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in sm:max-w-lg",
|
|
3132
3133
|
t
|
|
3133
3134
|
),
|
|
@@ -3137,29 +3138,29 @@ function es({ className: t, ...s }) {
|
|
|
3137
3138
|
] });
|
|
3138
3139
|
}
|
|
3139
3140
|
function ts({ className: t, ...s }) {
|
|
3140
|
-
return /* @__PURE__ */ e.jsx("div", { "data-slot": "alert-dialog-header", className:
|
|
3141
|
+
return /* @__PURE__ */ e.jsx("div", { "data-slot": "alert-dialog-header", className: P("flex flex-col gap-2 text-center sm:text-left", t), ...s });
|
|
3141
3142
|
}
|
|
3142
3143
|
function as({ className: t, ...s }) {
|
|
3143
|
-
return /* @__PURE__ */ e.jsx("div", { "data-slot": "alert-dialog-footer", className:
|
|
3144
|
+
return /* @__PURE__ */ e.jsx("div", { "data-slot": "alert-dialog-footer", className: P("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", t), ...s });
|
|
3144
3145
|
}
|
|
3145
3146
|
function ss({ className: t, ...s }) {
|
|
3146
|
-
return /* @__PURE__ */ e.jsx(Q.Title, { "data-slot": "alert-dialog-title", className:
|
|
3147
|
+
return /* @__PURE__ */ e.jsx(Q.Title, { "data-slot": "alert-dialog-title", className: P("font-semibold text-lg", t), ...s });
|
|
3147
3148
|
}
|
|
3148
3149
|
function ns({ className: t, ...s }) {
|
|
3149
3150
|
return /* @__PURE__ */ e.jsx(
|
|
3150
3151
|
Q.Description,
|
|
3151
3152
|
{
|
|
3152
3153
|
"data-slot": "alert-dialog-description",
|
|
3153
|
-
className:
|
|
3154
|
+
className: P("text-muted-foreground text-sm", t),
|
|
3154
3155
|
...s
|
|
3155
3156
|
}
|
|
3156
3157
|
);
|
|
3157
3158
|
}
|
|
3158
3159
|
function os({ className: t, ...s }) {
|
|
3159
|
-
return /* @__PURE__ */ e.jsx(Q.Action, { className:
|
|
3160
|
+
return /* @__PURE__ */ e.jsx(Q.Action, { className: P(at(), t), ...s });
|
|
3160
3161
|
}
|
|
3161
3162
|
function rs({ className: t, ...s }) {
|
|
3162
|
-
return /* @__PURE__ */ e.jsx(Q.Cancel, { className:
|
|
3163
|
+
return /* @__PURE__ */ e.jsx(Q.Cancel, { className: P(at({ variant: "outline" }), t), ...s });
|
|
3163
3164
|
}
|
|
3164
3165
|
function ls({ ...t }) {
|
|
3165
3166
|
return /* @__PURE__ */ e.jsx(L.Root, { "data-slot": "sheet", ...t });
|
|
@@ -3172,7 +3173,7 @@ function ds({ className: t, ...s }) {
|
|
|
3172
3173
|
L.Overlay,
|
|
3173
3174
|
{
|
|
3174
3175
|
"data-slot": "sheet-overlay",
|
|
3175
|
-
className:
|
|
3176
|
+
className: P(
|
|
3176
3177
|
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in",
|
|
3177
3178
|
t
|
|
3178
3179
|
),
|
|
@@ -3192,7 +3193,7 @@ function cs({
|
|
|
3192
3193
|
L.Content,
|
|
3193
3194
|
{
|
|
3194
3195
|
"data-slot": "sheet-content",
|
|
3195
|
-
className:
|
|
3196
|
+
className: P(
|
|
3196
3197
|
"fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=open]:animate-in data-[state=closed]:duration-300 data-[state=open]:duration-500",
|
|
3197
3198
|
l === "right" && "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",
|
|
3198
3199
|
l === "left" && "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
|
|
@@ -3204,7 +3205,7 @@ function cs({
|
|
|
3204
3205
|
children: [
|
|
3205
3206
|
s,
|
|
3206
3207
|
/* @__PURE__ */ e.jsxs(L.Close, { className: "absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
|
|
3207
|
-
/* @__PURE__ */ e.jsx(
|
|
3208
|
+
/* @__PURE__ */ e.jsx(et, { className: "size-4" }),
|
|
3208
3209
|
/* @__PURE__ */ e.jsx("span", { className: "sr-only", children: "Close" })
|
|
3209
3210
|
] })
|
|
3210
3211
|
]
|
|
@@ -3213,19 +3214,19 @@ function cs({
|
|
|
3213
3214
|
] });
|
|
3214
3215
|
}
|
|
3215
3216
|
function us({ className: t, ...s }) {
|
|
3216
|
-
return /* @__PURE__ */ e.jsx("div", { "data-slot": "sheet-header", className:
|
|
3217
|
+
return /* @__PURE__ */ e.jsx("div", { "data-slot": "sheet-header", className: P("flex flex-col gap-1.5 p-4", t), ...s });
|
|
3217
3218
|
}
|
|
3218
3219
|
function hs({ className: t, ...s }) {
|
|
3219
|
-
return /* @__PURE__ */ e.jsx("div", { "data-slot": "sheet-footer", className:
|
|
3220
|
+
return /* @__PURE__ */ e.jsx("div", { "data-slot": "sheet-footer", className: P("mt-auto flex flex-col gap-2 p-4", t), ...s });
|
|
3220
3221
|
}
|
|
3221
3222
|
function ms({ className: t, ...s }) {
|
|
3222
|
-
return /* @__PURE__ */ e.jsx(L.Title, { "data-slot": "sheet-title", className:
|
|
3223
|
+
return /* @__PURE__ */ e.jsx(L.Title, { "data-slot": "sheet-title", className: P("font-semibold text-foreground", t), ...s });
|
|
3223
3224
|
}
|
|
3224
3225
|
function ps({ className: t, ...s }) {
|
|
3225
|
-
return /* @__PURE__ */ e.jsx(L.Description, { "data-slot": "sheet-description", className:
|
|
3226
|
+
return /* @__PURE__ */ e.jsx(L.Description, { "data-slot": "sheet-description", className: P("text-muted-foreground text-sm", t), ...s });
|
|
3226
3227
|
}
|
|
3227
3228
|
const xs = () => {
|
|
3228
|
-
const { selectedNode: t, hasSelectedNodes: s } = ee(), { clearSelection: l, deleteSelectedNode: i } = me(), h =
|
|
3229
|
+
const { selectedNode: t, hasSelectedNodes: s } = ee(), { clearSelection: l, deleteSelectedNode: i } = me(), h = B(), o = h(t?.data?.label), n = () => {
|
|
3229
3230
|
i(), l();
|
|
3230
3231
|
};
|
|
3231
3232
|
return /* @__PURE__ */ e.jsx(ls, { open: s, onOpenChange: l, children: /* @__PURE__ */ e.jsxs(cs, { className: "flex flex-col gap-0", children: [
|
|
@@ -3240,14 +3241,14 @@ const xs = () => {
|
|
|
3240
3241
|
/* @__PURE__ */ e.jsx(ot, { className: "flex min-h-0 flex-1 flex-col px-4", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 py-4", children: [
|
|
3241
3242
|
/* @__PURE__ */ e.jsx(Wa, {}),
|
|
3242
3243
|
/* @__PURE__ */ e.jsx(Ya, {}),
|
|
3243
|
-
/* @__PURE__ */ e.jsx(
|
|
3244
|
+
/* @__PURE__ */ e.jsx(Ut, {}),
|
|
3244
3245
|
je(t) && /* @__PURE__ */ e.jsx(Za, {}),
|
|
3245
|
-
|
|
3246
|
-
|
|
3246
|
+
ct(t) && /* @__PURE__ */ e.jsx(Ka, {}),
|
|
3247
|
+
ut(t) && /* @__PURE__ */ e.jsx(Oa, {}),
|
|
3247
3248
|
Se(t) && /* @__PURE__ */ e.jsx(Ma, {})
|
|
3248
3249
|
] }) }),
|
|
3249
3250
|
/* @__PURE__ */ e.jsx(hs, { className: "flex items-end border-t", children: /* @__PURE__ */ e.jsxs(Ja, { children: [
|
|
3250
|
-
/* @__PURE__ */ e.jsx(qa, { asChild: !0, children: /* @__PURE__ */ e.jsx(S, { variant: "ghost", size: "icon", children: /* @__PURE__ */ e.jsx(
|
|
3251
|
+
/* @__PURE__ */ e.jsx(qa, { asChild: !0, children: /* @__PURE__ */ e.jsx(S, { variant: "ghost", size: "icon", children: /* @__PURE__ */ e.jsx(tt, {}) }) }),
|
|
3251
3252
|
/* @__PURE__ */ e.jsxs(es, { children: [
|
|
3252
3253
|
/* @__PURE__ */ e.jsxs(ts, { children: [
|
|
3253
3254
|
/* @__PURE__ */ e.jsx(ss, { children: h("editor.nodeActionsSheet.deleteNode") }),
|
|
@@ -3278,7 +3279,7 @@ const xs = () => {
|
|
|
3278
3279
|
}, js = ({ flow: t, onExportJson: s, onSave: l, theme: i, className: h }) => {
|
|
3279
3280
|
const { onConnect: o, onConnectEnd: n, onEdgesDelete: f, isValidConnection: d } = lt();
|
|
3280
3281
|
return /* @__PURE__ */ e.jsxs(
|
|
3281
|
-
|
|
3282
|
+
jt,
|
|
3282
3283
|
{
|
|
3283
3284
|
fitView: !0,
|
|
3284
3285
|
colorMode: i,
|
|
@@ -3291,21 +3292,21 @@ const xs = () => {
|
|
|
3291
3292
|
onConnectEnd: n,
|
|
3292
3293
|
onEdgesDelete: f,
|
|
3293
3294
|
isValidConnection: d,
|
|
3294
|
-
className:
|
|
3295
|
+
className: P(h, "treege"),
|
|
3295
3296
|
children: [
|
|
3296
|
-
/* @__PURE__ */ e.jsx(
|
|
3297
|
+
/* @__PURE__ */ e.jsx(Ct, { gap: 10, variant: vt.Dots }),
|
|
3297
3298
|
/* @__PURE__ */ e.jsx(Va, { onExportJson: s, onSave: l }),
|
|
3298
3299
|
/* @__PURE__ */ e.jsx(Jt, { theme: i }),
|
|
3299
|
-
/* @__PURE__ */ e.jsx(
|
|
3300
|
-
/* @__PURE__ */ e.jsx(
|
|
3300
|
+
/* @__PURE__ */ e.jsx(ft, {}),
|
|
3301
|
+
/* @__PURE__ */ e.jsx(bt, {}),
|
|
3301
3302
|
/* @__PURE__ */ e.jsx(xs, {})
|
|
3302
3303
|
]
|
|
3303
3304
|
}
|
|
3304
3305
|
);
|
|
3305
|
-
},
|
|
3306
|
+
}, ks = ({ flow: t, onExportJson: s, onSave: l, theme: i = "dark", language: h = "en", aiConfig: o }) => /* @__PURE__ */ e.jsx(ht, { defaultTheme: i, storageKey: "treege-editor-theme", theme: i, children: /* @__PURE__ */ e.jsxs(qt, { value: { aiConfig: o, flowId: t?.id, language: h }, children: [
|
|
3306
3307
|
/* @__PURE__ */ e.jsx(gs, { position: "bottom-center" }),
|
|
3307
|
-
/* @__PURE__ */ e.jsx(
|
|
3308
|
+
/* @__PURE__ */ e.jsx(gt, { children: /* @__PURE__ */ e.jsx(js, { onExportJson: s, onSave: l, flow: t, theme: i }) })
|
|
3308
3309
|
] }) });
|
|
3309
3310
|
export {
|
|
3310
|
-
|
|
3311
|
+
ks as T
|
|
3311
3312
|
};
|