@burdenoff/fluidgrids-fe-sdk 2026.701.8 → 2026.703.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{WorkflowBuilder-N6AMMWYX.js → WorkflowBuilder-BWB3552Z.js} +3 -3
- package/dist/{WorkflowBuilder-N6AMMWYX.js.map → WorkflowBuilder-BWB3552Z.js.map} +1 -1
- package/dist/{chunk-GX57DKBG.js → chunk-5GIC24CM.js} +501 -316
- package/dist/chunk-5GIC24CM.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-GX57DKBG.js.map +0 -1
|
@@ -14,11 +14,11 @@ import { useParams, useNavigate } from 'react-router-dom';
|
|
|
14
14
|
import { useShallow, shallow } from 'zustand/shallow';
|
|
15
15
|
import * as React2 from 'react';
|
|
16
16
|
import React2__default, { forwardRef, useState, useImperativeHandle, useRef, useEffect, useMemo, createContext, lazy, memo, useCallback, useContext, useLayoutEffect, Suspense, useDeferredValue } from 'react';
|
|
17
|
-
import { Handle, Position, getBezierPath, MarkerType, useStore, useReactFlow, getConnectedEdges, useNodeId, ReactFlowProvider, ReactFlow, Background, useOnSelectionChange, MiniMap,
|
|
17
|
+
import { Handle, Position, getBezierPath, MarkerType, useStore, useReactFlow, getConnectedEdges, useNodeId, ReactFlowProvider, ReactFlow, Background, useOnSelectionChange, MiniMap, EdgeLabelRenderer, getOutgoers, useNodes, useNodesState, useEdgesState, addEdge, Controls, Panel } from '@xyflow/react';
|
|
18
18
|
import { produce } from 'immer';
|
|
19
19
|
import { nanoid } from 'nanoid/non-secure';
|
|
20
20
|
import { cn } from '@burdenoff/fe-libs/utils';
|
|
21
|
-
import { Textarea, Input, Button, Card, Badge, CardContent as CardContent$1,
|
|
21
|
+
import { Textarea, Input, Button, Card, Badge, CardContent as CardContent$1, DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuLabel, DropdownMenuItem, DropdownMenuSeparator, Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, DialogDescription, Sheet, SheetTrigger, SheetContent, SheetHeader, SheetTitle, Popover, PopoverTrigger, PopoverContent, Toaster, Tabs, TabsList, TabsTrigger, TabsContent, CardHeader as CardHeader$1, CardTitle as CardTitle$1, CardDescription as CardDescription$1, ScrollArea, TooltipProvider, Tooltip, TooltipTrigger, TooltipContent, Label, Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from '@burdenoff/fe-libs/ui';
|
|
22
22
|
import { Icon } from '@iconify/react';
|
|
23
23
|
import * as AdaptiveCards from 'adaptivecards';
|
|
24
24
|
import { formatDistanceToNow } from 'date-fns';
|
|
@@ -41,27 +41,6 @@ import { ErrorBoundary } from '@burdenoff/fe-libs/shared/components';
|
|
|
41
41
|
function ThemeProvider({ children }) {
|
|
42
42
|
return /* @__PURE__ */ jsx(ThemeProvider$1, { children });
|
|
43
43
|
}
|
|
44
|
-
|
|
45
|
-
// src/builder/components/flow-builder/components/blocks/types.ts
|
|
46
|
-
var HeaderGradientColors = {
|
|
47
|
-
purple: "from-purple-700",
|
|
48
|
-
red: "from-red-700",
|
|
49
|
-
blue: "from-blue-700",
|
|
50
|
-
green: "from-green-700",
|
|
51
|
-
yellow: "from-yellow-700",
|
|
52
|
-
pink: "from-pink-700",
|
|
53
|
-
orange: "from-orange-700",
|
|
54
|
-
teal: "from-teal-700",
|
|
55
|
-
lime: "from-lime-700",
|
|
56
|
-
indigo: "from-indigo-700",
|
|
57
|
-
fuchsia: "from-fuchsia-700",
|
|
58
|
-
emerald: "from-emerald-700",
|
|
59
|
-
cyan: "from-cyan-700",
|
|
60
|
-
rose: "from-rose-700",
|
|
61
|
-
sky: "from-sky-700",
|
|
62
|
-
gray: "from-gray-200",
|
|
63
|
-
slate: "from-slate-700"
|
|
64
|
-
};
|
|
65
44
|
function useDeleteNode() {
|
|
66
45
|
const { getNode, getEdges, deleteElements } = useReactFlow();
|
|
67
46
|
const [deleteNode, deleteEdge] = useFlowStore(
|
|
@@ -88,6 +67,7 @@ function useDeleteNode() {
|
|
|
88
67
|
function CustomHandle({
|
|
89
68
|
className,
|
|
90
69
|
isConnectable,
|
|
70
|
+
accent,
|
|
91
71
|
...props
|
|
92
72
|
}) {
|
|
93
73
|
const { nodeLookup, edges } = useStore(({ nodeLookup: nodeLookup2, edges: edges2 }) => ({
|
|
@@ -110,11 +90,19 @@ function CustomHandle({
|
|
|
110
90
|
Handle,
|
|
111
91
|
{
|
|
112
92
|
className: cn(
|
|
113
|
-
"cursor-crosshair",
|
|
114
|
-
"size-3
|
|
93
|
+
"cursor-crosshair transition-transform hover:scale-110",
|
|
94
|
+
!accent && "size-3 border-2 border-card-foreground/40 hover:border-primary/50",
|
|
115
95
|
className
|
|
116
96
|
),
|
|
117
97
|
isConnectable: isHandleConnectable,
|
|
98
|
+
style: accent ? {
|
|
99
|
+
width: 14,
|
|
100
|
+
height: 14,
|
|
101
|
+
borderRadius: "50%",
|
|
102
|
+
background: "var(--card, #fff)",
|
|
103
|
+
border: `2.5px solid ${accent}`,
|
|
104
|
+
boxShadow: `0 0 0 3px color-mix(in srgb, ${accent} 12%, transparent)`
|
|
105
|
+
} : void 0,
|
|
118
106
|
...props
|
|
119
107
|
}
|
|
120
108
|
) });
|
|
@@ -7313,6 +7301,19 @@ function ArrayField({
|
|
|
7313
7301
|
description && /* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: description })
|
|
7314
7302
|
] });
|
|
7315
7303
|
}
|
|
7304
|
+
function slimNodeDataToCurrentOperation(data) {
|
|
7305
|
+
const nodeData = data.nodeData;
|
|
7306
|
+
if (!nodeData) return data;
|
|
7307
|
+
const opName = data.operation_name;
|
|
7308
|
+
const rawOps = nodeData.operations;
|
|
7309
|
+
const opsArray = Array.isArray(rawOps) ? rawOps : Array.isArray(rawOps?.operations) ? rawOps.operations : [];
|
|
7310
|
+
const current = opName ? opsArray.find((o) => o?.name === opName) : void 0;
|
|
7311
|
+
if (!current) {
|
|
7312
|
+
const { nodeData: _omit, ...rest } = data;
|
|
7313
|
+
return rest;
|
|
7314
|
+
}
|
|
7315
|
+
return { ...data, nodeData: { ...nodeData, operations: [current] } };
|
|
7316
|
+
}
|
|
7316
7317
|
function useSaveWorkflow() {
|
|
7317
7318
|
const [isSaving, setIsSaving] = useState(false);
|
|
7318
7319
|
const params = useParams();
|
|
@@ -7335,9 +7336,12 @@ function useSaveWorkflow() {
|
|
|
7335
7336
|
const preparedWorkflow = {
|
|
7336
7337
|
...workflow,
|
|
7337
7338
|
nodes: workflow.nodes?.map((n) => {
|
|
7338
|
-
const
|
|
7339
|
-
|
|
7340
|
-
|
|
7339
|
+
const slimData = slimNodeDataToCurrentOperation(
|
|
7340
|
+
n.data ?? {}
|
|
7341
|
+
);
|
|
7342
|
+
const { nodeData: _slimNodeData, ...flattenedData } = slimData;
|
|
7343
|
+
void _slimNodeData;
|
|
7344
|
+
return { ...n, data: slimData, ...flattenedData };
|
|
7341
7345
|
})
|
|
7342
7346
|
};
|
|
7343
7347
|
const definitionJson = {
|
|
@@ -7764,12 +7768,255 @@ function NodePropertyPanel({
|
|
|
7764
7768
|
] })
|
|
7765
7769
|
] });
|
|
7766
7770
|
}
|
|
7767
|
-
var
|
|
7768
|
-
|
|
7769
|
-
|
|
7770
|
-
|
|
7771
|
-
]
|
|
7772
|
-
|
|
7771
|
+
var BRAND_ACCENTS = [
|
|
7772
|
+
[/gmail|google/, "#ea4335"],
|
|
7773
|
+
[/slack/, "#611f69"],
|
|
7774
|
+
[/github/, "#334155"],
|
|
7775
|
+
[/gitlab/, "#fc6d26"],
|
|
7776
|
+
[/stripe/, "#635bff"],
|
|
7777
|
+
[/discord/, "#5865f2"],
|
|
7778
|
+
[/notion/, "#111827"],
|
|
7779
|
+
[/telegram/, "#2aabee"],
|
|
7780
|
+
[/whatsapp/, "#25d366"],
|
|
7781
|
+
[/openai/, "#10a37f"],
|
|
7782
|
+
[/anthropic|claude/, "#d97757"],
|
|
7783
|
+
[/twilio/, "#f22f46"],
|
|
7784
|
+
[/sheet|excel/, "#21a366"],
|
|
7785
|
+
[/http|api|webhook|rest/, "#6366f1"],
|
|
7786
|
+
[/db|sql|postgres|mysql|mongo/, "#0ea5e9"]
|
|
7787
|
+
];
|
|
7788
|
+
var HASH_PALETTE = [
|
|
7789
|
+
"#6366f1",
|
|
7790
|
+
"#0ea5e9",
|
|
7791
|
+
"#10b981",
|
|
7792
|
+
"#f59e0b",
|
|
7793
|
+
"#ef4444",
|
|
7794
|
+
"#a855f7",
|
|
7795
|
+
"#ec4899",
|
|
7796
|
+
"#14b8a6",
|
|
7797
|
+
"#f97316",
|
|
7798
|
+
"#8b5cf6"
|
|
7799
|
+
];
|
|
7800
|
+
function nodeAccent(key) {
|
|
7801
|
+
const k = (key || "").toLowerCase();
|
|
7802
|
+
for (const [re, hex] of BRAND_ACCENTS) if (re.test(k)) return hex;
|
|
7803
|
+
let h = 0;
|
|
7804
|
+
for (let i = 0; i < k.length; i++) h = h * 31 + k.charCodeAt(i) >>> 0;
|
|
7805
|
+
return HASH_PALETTE[h % HASH_PALETTE.length];
|
|
7806
|
+
}
|
|
7807
|
+
function tint(hex, pct = 14) {
|
|
7808
|
+
return `color-mix(in srgb, ${hex} ${pct}%, transparent)`;
|
|
7809
|
+
}
|
|
7810
|
+
var NodeCard = React2.forwardRef(
|
|
7811
|
+
({
|
|
7812
|
+
className,
|
|
7813
|
+
selected = false,
|
|
7814
|
+
executionStatus = "idle",
|
|
7815
|
+
itemCount,
|
|
7816
|
+
isTrigger = false,
|
|
7817
|
+
accent = "#3b82f6",
|
|
7818
|
+
onSettings,
|
|
7819
|
+
onExecute,
|
|
7820
|
+
onDelete,
|
|
7821
|
+
isExecuting = false,
|
|
7822
|
+
infoButton,
|
|
7823
|
+
children,
|
|
7824
|
+
...props
|
|
7825
|
+
}, ref) => {
|
|
7826
|
+
const [hovered, setHovered] = React2.useState(false);
|
|
7827
|
+
const statusRing = executionStatus === "running" ? "ring-2 ring-[var(--color-status-success-border)] animate-pulse-border" : executionStatus === "success" ? "ring-2 ring-[var(--color-status-success-border)]" : executionStatus === "error" ? "ring-2 ring-[var(--color-status-error-border)]" : "";
|
|
7828
|
+
return /* @__PURE__ */ jsxs(
|
|
7829
|
+
"div",
|
|
7830
|
+
{
|
|
7831
|
+
className: "group/node relative",
|
|
7832
|
+
onMouseEnter: () => setHovered(true),
|
|
7833
|
+
onMouseLeave: () => setHovered(false),
|
|
7834
|
+
children: [
|
|
7835
|
+
itemCount !== void 0 && itemCount > 0 && /* @__PURE__ */ jsx("div", { className: "absolute -top-7 left-1/2 -translate-x-1/2 z-10", children: /* @__PURE__ */ jsxs("div", { className: "rounded-full border border-border bg-card px-2 py-0.5 text-[10px] font-medium text-muted-foreground shadow-sm", children: [
|
|
7836
|
+
itemCount,
|
|
7837
|
+
" item",
|
|
7838
|
+
itemCount !== 1 ? "s" : ""
|
|
7839
|
+
] }) }),
|
|
7840
|
+
(onSettings || onExecute || onDelete || infoButton) && /* @__PURE__ */ jsxs(
|
|
7841
|
+
"div",
|
|
7842
|
+
{
|
|
7843
|
+
className: cn(
|
|
7844
|
+
"absolute right-1 z-20 flex items-center gap-0.5 rounded-lg border border-border bg-card p-0.5 shadow-md transition-all duration-150",
|
|
7845
|
+
hovered ? "pointer-events-auto opacity-100" : "pointer-events-none opacity-0"
|
|
7846
|
+
),
|
|
7847
|
+
style: {
|
|
7848
|
+
// Inline offset (not a `-top-*` class) so it survives the host
|
|
7849
|
+
// app's Tailwind scan of fe-sdk source, which drops some spacing
|
|
7850
|
+
// utilities. The toolbar is ~30px tall; top:-15px centers it on
|
|
7851
|
+
// the card's top edge (half outside, half over the card).
|
|
7852
|
+
top: -15,
|
|
7853
|
+
transform: hovered ? "translateY(0)" : "translateY(4px)"
|
|
7854
|
+
},
|
|
7855
|
+
onDoubleClick: (e) => e.stopPropagation(),
|
|
7856
|
+
children: [
|
|
7857
|
+
onSettings && /* @__PURE__ */ jsx(ToolbarButton, { title: "Configure", onClick: onSettings, children: /* @__PURE__ */ jsx(Icon, { icon: "lucide:sliders-horizontal", className: "size-4" }) }),
|
|
7858
|
+
onExecute && /* @__PURE__ */ jsx(
|
|
7859
|
+
ToolbarButton,
|
|
7860
|
+
{
|
|
7861
|
+
title: "Execute step",
|
|
7862
|
+
onClick: onExecute,
|
|
7863
|
+
disabled: isExecuting,
|
|
7864
|
+
children: isExecuting ? /* @__PURE__ */ jsx(
|
|
7865
|
+
Icon,
|
|
7866
|
+
{
|
|
7867
|
+
icon: "svg-spinners:ring-resize",
|
|
7868
|
+
className: "size-4 text-[var(--color-status-success-text)]"
|
|
7869
|
+
}
|
|
7870
|
+
) : /* @__PURE__ */ jsx(
|
|
7871
|
+
Icon,
|
|
7872
|
+
{
|
|
7873
|
+
icon: "mdi:play",
|
|
7874
|
+
className: "size-4 text-[var(--color-status-success-text)]"
|
|
7875
|
+
}
|
|
7876
|
+
)
|
|
7877
|
+
}
|
|
7878
|
+
),
|
|
7879
|
+
infoButton,
|
|
7880
|
+
onDelete && /* @__PURE__ */ jsx(ToolbarButton, { title: "Delete", onClick: onDelete, children: /* @__PURE__ */ jsx(
|
|
7881
|
+
Icon,
|
|
7882
|
+
{
|
|
7883
|
+
icon: "mynaui:trash",
|
|
7884
|
+
className: "size-4 text-[var(--color-status-error-text)]"
|
|
7885
|
+
}
|
|
7886
|
+
) })
|
|
7887
|
+
]
|
|
7888
|
+
}
|
|
7889
|
+
),
|
|
7890
|
+
/* @__PURE__ */ jsxs(
|
|
7891
|
+
"div",
|
|
7892
|
+
{
|
|
7893
|
+
ref,
|
|
7894
|
+
"data-selected": selected,
|
|
7895
|
+
className: cn(
|
|
7896
|
+
"relative w-72 rounded-xl border border-border bg-card shadow-sm will-change-transform",
|
|
7897
|
+
statusRing,
|
|
7898
|
+
executionStatus === "success" && "animate-success-glow",
|
|
7899
|
+
className
|
|
7900
|
+
),
|
|
7901
|
+
style: {
|
|
7902
|
+
borderTop: `3px solid ${accent}`,
|
|
7903
|
+
transition: "transform 0.15s ease, box-shadow 0.15s ease",
|
|
7904
|
+
transform: hovered ? "translateY(-2px)" : "none",
|
|
7905
|
+
boxShadow: hovered ? "0 2px 4px rgba(16,24,40,0.06), 0 16px 34px -12px rgba(16,24,40,0.24)" : void 0
|
|
7906
|
+
},
|
|
7907
|
+
...props,
|
|
7908
|
+
children: [
|
|
7909
|
+
/* @__PURE__ */ jsx(
|
|
7910
|
+
"div",
|
|
7911
|
+
{
|
|
7912
|
+
className: "pointer-events-none absolute -inset-0.5 transition-opacity duration-150",
|
|
7913
|
+
style: {
|
|
7914
|
+
borderRadius: 14,
|
|
7915
|
+
opacity: selected || hovered ? 1 : 0,
|
|
7916
|
+
boxShadow: selected ? `0 0 0 2px ${accent}, 0 0 0 5px ${tint(accent, 18)}` : `0 0 0 2px ${accent}`
|
|
7917
|
+
}
|
|
7918
|
+
}
|
|
7919
|
+
),
|
|
7920
|
+
isTrigger && /* @__PURE__ */ jsx(
|
|
7921
|
+
"div",
|
|
7922
|
+
{
|
|
7923
|
+
className: "absolute -top-2 -left-2 z-10 flex size-5 items-center justify-center rounded-full shadow-md ring-2 ring-card",
|
|
7924
|
+
style: { backgroundColor: "var(--color-status-success-text)" },
|
|
7925
|
+
children: /* @__PURE__ */ jsx(
|
|
7926
|
+
Icon,
|
|
7927
|
+
{
|
|
7928
|
+
icon: "mdi:lightning-bolt",
|
|
7929
|
+
className: "size-3",
|
|
7930
|
+
style: { color: "var(--color-status-success-text-inverse)" }
|
|
7931
|
+
}
|
|
7932
|
+
)
|
|
7933
|
+
}
|
|
7934
|
+
),
|
|
7935
|
+
children
|
|
7936
|
+
]
|
|
7937
|
+
}
|
|
7938
|
+
),
|
|
7939
|
+
executionStatus === "success" && /* @__PURE__ */ jsx(StatusCorner, { icon: "mdi:check", tone: "success" }),
|
|
7940
|
+
executionStatus === "error" && /* @__PURE__ */ jsx(StatusCorner, { icon: "mdi:close", tone: "error" }),
|
|
7941
|
+
executionStatus === "running" && /* @__PURE__ */ jsx(StatusCorner, { icon: "svg-spinners:ring-resize", tone: "success" })
|
|
7942
|
+
]
|
|
7943
|
+
}
|
|
7944
|
+
);
|
|
7945
|
+
}
|
|
7946
|
+
);
|
|
7947
|
+
NodeCard.displayName = "NodeCard";
|
|
7948
|
+
function ToolbarButton({
|
|
7949
|
+
title,
|
|
7950
|
+
onClick,
|
|
7951
|
+
disabled,
|
|
7952
|
+
children
|
|
7953
|
+
}) {
|
|
7954
|
+
return /* @__PURE__ */ jsx(
|
|
7955
|
+
"button",
|
|
7956
|
+
{
|
|
7957
|
+
type: "button",
|
|
7958
|
+
title,
|
|
7959
|
+
disabled,
|
|
7960
|
+
onClick: (e) => {
|
|
7961
|
+
e.stopPropagation();
|
|
7962
|
+
onClick?.();
|
|
7963
|
+
},
|
|
7964
|
+
className: "flex size-6 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50",
|
|
7965
|
+
children
|
|
7966
|
+
}
|
|
7967
|
+
);
|
|
7968
|
+
}
|
|
7969
|
+
function StatusCorner({
|
|
7970
|
+
icon,
|
|
7971
|
+
tone
|
|
7972
|
+
}) {
|
|
7973
|
+
const bg = tone === "success" ? "var(--color-status-success-bg)" : "var(--color-status-error-bg)";
|
|
7974
|
+
const fg = tone === "success" ? "var(--color-status-success-text-inverse)" : "var(--color-status-error-text-inverse)";
|
|
7975
|
+
return /* @__PURE__ */ jsx("div", { className: "absolute -bottom-1.5 -right-1.5 z-10", children: /* @__PURE__ */ jsx(
|
|
7976
|
+
"div",
|
|
7977
|
+
{
|
|
7978
|
+
className: "rounded-full p-0.5 shadow-md animate-in zoom-in duration-200",
|
|
7979
|
+
style: { backgroundColor: bg },
|
|
7980
|
+
children: /* @__PURE__ */ jsx(Icon, { icon, className: "size-3", style: { color: fg } })
|
|
7981
|
+
}
|
|
7982
|
+
) });
|
|
7983
|
+
}
|
|
7984
|
+
var NodeCardHeader = React2.forwardRef(
|
|
7985
|
+
({ icon, appName, accentKey }, ref) => {
|
|
7986
|
+
const accent = nodeAccent(accentKey);
|
|
7987
|
+
return /* @__PURE__ */ jsxs("div", { ref, className: "flex items-center gap-2.5 px-3 pb-3 pt-4", children: [
|
|
7988
|
+
/* @__PURE__ */ jsx(
|
|
7989
|
+
"div",
|
|
7990
|
+
{
|
|
7991
|
+
className: "flex size-8 shrink-0 items-center justify-center rounded-lg",
|
|
7992
|
+
style: {
|
|
7993
|
+
backgroundColor: tint(accent, 13),
|
|
7994
|
+
color: accent,
|
|
7995
|
+
border: `1px solid ${tint(accent, 26)}`
|
|
7996
|
+
},
|
|
7997
|
+
children: /* @__PURE__ */ jsx(Icon, { icon, className: "size-[18px]" })
|
|
7998
|
+
}
|
|
7999
|
+
),
|
|
8000
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: appName })
|
|
8001
|
+
] });
|
|
8002
|
+
}
|
|
8003
|
+
);
|
|
8004
|
+
NodeCardHeader.displayName = "NodeCardHeader";
|
|
8005
|
+
var NodeCardBody = React2.forwardRef(
|
|
8006
|
+
({ operationName, description }, ref) => /* @__PURE__ */ jsxs(
|
|
8007
|
+
"div",
|
|
8008
|
+
{
|
|
8009
|
+
ref,
|
|
8010
|
+
className: "rounded-b-xl border-t border-border/60 px-3 pb-3 pt-2.5",
|
|
8011
|
+
children: [
|
|
8012
|
+
/* @__PURE__ */ jsx("div", { className: "text-[10px] font-semibold uppercase tracking-wider text-muted-foreground", children: "Operation" }),
|
|
8013
|
+
/* @__PURE__ */ jsx("div", { className: "mt-0.5 truncate font-mono text-[13px] font-bold text-card-foreground", children: operationName }),
|
|
8014
|
+
description ? /* @__PURE__ */ jsx("p", { className: "mt-1 line-clamp-2 text-xs leading-snug text-muted-foreground", children: description }) : null
|
|
8015
|
+
]
|
|
8016
|
+
}
|
|
8017
|
+
)
|
|
8018
|
+
);
|
|
8019
|
+
NodeCardBody.displayName = "NodeCardBody";
|
|
7773
8020
|
var nodeDetails = {
|
|
7774
8021
|
node_type: "gmail_reader",
|
|
7775
8022
|
version: "1.0.0",
|
|
@@ -7984,212 +8231,6 @@ function NodeInfoButtonWithModal({
|
|
|
7984
8231
|
] })
|
|
7985
8232
|
] });
|
|
7986
8233
|
}
|
|
7987
|
-
var NodeCard = React2.forwardRef(
|
|
7988
|
-
({ className, executionStatus = "idle", itemCount, children, ...props }, ref) => {
|
|
7989
|
-
const statusClasses = {
|
|
7990
|
-
idle: "",
|
|
7991
|
-
running: "ring-2 ring-[var(--color-status-success-border)] animate-pulse-border",
|
|
7992
|
-
success: "ring-2 ring-[var(--color-status-success-border)]",
|
|
7993
|
-
error: "ring-2 ring-[var(--color-status-error-border)]"
|
|
7994
|
-
};
|
|
7995
|
-
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
7996
|
-
itemCount !== void 0 && itemCount > 0 && /* @__PURE__ */ jsx("div", { className: "absolute -top-6 left-1/2 -translate-x-1/2 z-10", children: /* @__PURE__ */ jsxs("div", { className: "bg-card border border-card-foreground/20 px-2 py-0.5 rounded text-[10px] text-card-foreground/70 whitespace-nowrap shadow-sm", children: [
|
|
7997
|
-
itemCount,
|
|
7998
|
-
" item",
|
|
7999
|
-
itemCount !== 1 ? "s" : ""
|
|
8000
|
-
] }) }),
|
|
8001
|
-
/* @__PURE__ */ jsx(
|
|
8002
|
-
"div",
|
|
8003
|
-
{
|
|
8004
|
-
ref,
|
|
8005
|
-
className: cn(
|
|
8006
|
-
"w-72 border border-card-foreground/10 rounded-sm bg-card/50 shadow-sm backdrop-blur-xl transition-all duration-200 divide-y divide-card-foreground/10 data-[selected=true]:border-border-primary hover:border-border-primary",
|
|
8007
|
-
statusClasses[executionStatus],
|
|
8008
|
-
executionStatus === "success" && "animate-success-glow",
|
|
8009
|
-
className
|
|
8010
|
-
),
|
|
8011
|
-
...props,
|
|
8012
|
-
children
|
|
8013
|
-
}
|
|
8014
|
-
),
|
|
8015
|
-
executionStatus === "success" && /* @__PURE__ */ jsx("div", { className: "absolute -bottom-1.5 -right-1.5 z-10", children: /* @__PURE__ */ jsx("div", { className: "bg-[var(--color-status-success-bg)] rounded-full p-0.5 shadow-md animate-in zoom-in duration-200", children: /* @__PURE__ */ jsx(
|
|
8016
|
-
Icon,
|
|
8017
|
-
{
|
|
8018
|
-
icon: "mdi:check",
|
|
8019
|
-
className: "size-3 text-[var(--color-status-success-text-inverse)]"
|
|
8020
|
-
}
|
|
8021
|
-
) }) }),
|
|
8022
|
-
executionStatus === "error" && /* @__PURE__ */ jsx("div", { className: "absolute -bottom-1.5 -right-1.5 z-10", children: /* @__PURE__ */ jsx("div", { className: "bg-[var(--color-status-error-bg)] rounded-full p-0.5 shadow-md animate-in zoom-in duration-200", children: /* @__PURE__ */ jsx(
|
|
8023
|
-
Icon,
|
|
8024
|
-
{
|
|
8025
|
-
icon: "mdi:close",
|
|
8026
|
-
className: "size-3 text-[var(--color-status-error-text-inverse)]"
|
|
8027
|
-
}
|
|
8028
|
-
) }) }),
|
|
8029
|
-
executionStatus === "running" && /* @__PURE__ */ jsx("div", { className: "absolute -bottom-1.5 -right-1.5 z-10", children: /* @__PURE__ */ jsx("div", { className: "bg-[var(--color-status-success-bg)] rounded-full p-0.5 shadow-md", children: /* @__PURE__ */ jsx(
|
|
8030
|
-
Icon,
|
|
8031
|
-
{
|
|
8032
|
-
icon: "svg-spinners:ring-resize",
|
|
8033
|
-
className: "size-3 text-[var(--color-status-success-text-inverse)]"
|
|
8034
|
-
}
|
|
8035
|
-
) }) })
|
|
8036
|
-
] });
|
|
8037
|
-
}
|
|
8038
|
-
);
|
|
8039
|
-
NodeCard.displayName = "NodeCard";
|
|
8040
|
-
var NodeCardHeader = React2.forwardRef(
|
|
8041
|
-
({
|
|
8042
|
-
className,
|
|
8043
|
-
icon,
|
|
8044
|
-
title,
|
|
8045
|
-
handleDeleteNode,
|
|
8046
|
-
handleShowNodeProperties,
|
|
8047
|
-
handleExecuteStep,
|
|
8048
|
-
isExecuting,
|
|
8049
|
-
executionStatus,
|
|
8050
|
-
gradientColor,
|
|
8051
|
-
...props
|
|
8052
|
-
}, ref) => {
|
|
8053
|
-
const gradientColorClass = HeaderGradientColors[gradientColor];
|
|
8054
|
-
return /* @__PURE__ */ jsxs(
|
|
8055
|
-
"div",
|
|
8056
|
-
{
|
|
8057
|
-
ref,
|
|
8058
|
-
className: `relative overflow-clip rounded-sm bg-card/50 ${className}`,
|
|
8059
|
-
...props,
|
|
8060
|
-
children: [
|
|
8061
|
-
/* @__PURE__ */ jsx("div", { className: "absolute inset-0", children: /* @__PURE__ */ jsx(
|
|
8062
|
-
"div",
|
|
8063
|
-
{
|
|
8064
|
-
className: `absolute h-full w-3/5 ${gradientColor ? gradientColorClass : "from-primary/40"} to-transparent bg-gradient-to-r`
|
|
8065
|
-
}
|
|
8066
|
-
) }),
|
|
8067
|
-
/* @__PURE__ */ jsxs("div", { className: "relative h-9 flex items-center justify-between gap-x-4 px-0.5 py-0.5", children: [
|
|
8068
|
-
/* @__PURE__ */ jsx("div", { className: "flex grow items-center pl-1 gap-2", children: /* @__PURE__ */ jsx(HeaderWithIcon, { icon, title }) }),
|
|
8069
|
-
/* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-x-0.5 pr-0.5", children: [
|
|
8070
|
-
/* @__PURE__ */ jsx("div", { className: "mx-1 h-4 w-px bg-card-foreground/10" }),
|
|
8071
|
-
/* @__PURE__ */ jsx(
|
|
8072
|
-
Button,
|
|
8073
|
-
{
|
|
8074
|
-
type: "button",
|
|
8075
|
-
size: "icon",
|
|
8076
|
-
variant: "ghost",
|
|
8077
|
-
className: "size-7",
|
|
8078
|
-
onClick: handleShowNodeProperties,
|
|
8079
|
-
children: /* @__PURE__ */ jsx(Icon, { icon: "mynaui:cog-solid", className: "size-4" })
|
|
8080
|
-
}
|
|
8081
|
-
),
|
|
8082
|
-
handleExecuteStep && /* @__PURE__ */ jsx(
|
|
8083
|
-
Button,
|
|
8084
|
-
{
|
|
8085
|
-
type: "button",
|
|
8086
|
-
size: "icon",
|
|
8087
|
-
variant: "ghost",
|
|
8088
|
-
className: "size-7 transition-transform hover:scale-110",
|
|
8089
|
-
onClick: (e) => {
|
|
8090
|
-
e.stopPropagation();
|
|
8091
|
-
handleExecuteStep();
|
|
8092
|
-
},
|
|
8093
|
-
disabled: isExecuting,
|
|
8094
|
-
title: "Execute step",
|
|
8095
|
-
children: isExecuting ? /* @__PURE__ */ jsx(
|
|
8096
|
-
Icon,
|
|
8097
|
-
{
|
|
8098
|
-
icon: "svg-spinners:ring-resize",
|
|
8099
|
-
className: "size-4 text-accent"
|
|
8100
|
-
}
|
|
8101
|
-
) : executionStatus === "success" ? /* @__PURE__ */ jsx(
|
|
8102
|
-
Icon,
|
|
8103
|
-
{
|
|
8104
|
-
icon: "mdi:check-circle",
|
|
8105
|
-
className: "size-4 text-[var(--color-status-success-text)]"
|
|
8106
|
-
}
|
|
8107
|
-
) : executionStatus === "error" ? /* @__PURE__ */ jsx(
|
|
8108
|
-
Icon,
|
|
8109
|
-
{
|
|
8110
|
-
icon: "mdi:close-circle",
|
|
8111
|
-
className: "size-4 text-[var(--color-status-error-text)]"
|
|
8112
|
-
}
|
|
8113
|
-
) : /* @__PURE__ */ jsx(
|
|
8114
|
-
Icon,
|
|
8115
|
-
{
|
|
8116
|
-
icon: "mdi:play",
|
|
8117
|
-
className: "size-4 text-[var(--color-status-warning-text)]"
|
|
8118
|
-
}
|
|
8119
|
-
)
|
|
8120
|
-
}
|
|
8121
|
-
),
|
|
8122
|
-
/* @__PURE__ */ jsx(
|
|
8123
|
-
Button,
|
|
8124
|
-
{
|
|
8125
|
-
type: "button",
|
|
8126
|
-
variant: "ghost",
|
|
8127
|
-
size: "icon",
|
|
8128
|
-
className: "size-7 transition-transform hover:scale-110",
|
|
8129
|
-
onClick: handleDeleteNode,
|
|
8130
|
-
children: /* @__PURE__ */ jsx(
|
|
8131
|
-
Icon,
|
|
8132
|
-
{
|
|
8133
|
-
icon: "basil:trash-solid",
|
|
8134
|
-
className: "size-4 text-[var(--color-status-error-text)]"
|
|
8135
|
-
}
|
|
8136
|
-
)
|
|
8137
|
-
}
|
|
8138
|
-
),
|
|
8139
|
-
/* @__PURE__ */ jsx(
|
|
8140
|
-
NodeInfoButtonWithModal,
|
|
8141
|
-
{
|
|
8142
|
-
metadata: {
|
|
8143
|
-
className,
|
|
8144
|
-
icon,
|
|
8145
|
-
title,
|
|
8146
|
-
handleDeleteNode,
|
|
8147
|
-
handleShowNodeProperties,
|
|
8148
|
-
gradientColor,
|
|
8149
|
-
...props
|
|
8150
|
-
}
|
|
8151
|
-
}
|
|
8152
|
-
)
|
|
8153
|
-
] })
|
|
8154
|
-
] })
|
|
8155
|
-
]
|
|
8156
|
-
}
|
|
8157
|
-
);
|
|
8158
|
-
}
|
|
8159
|
-
);
|
|
8160
|
-
NodeCardHeader.displayName = "NodeCardHeader";
|
|
8161
|
-
var NodeCardDescription = React2.forwardRef(({ className, description, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("px-4 py-2", className), ...props, children: /* @__PURE__ */ jsx("div", { className: "text-xs text-card-foreground", children: description }) }));
|
|
8162
|
-
NodeCardDescription.displayName = "NodeCardDescription";
|
|
8163
|
-
var NodeCardContent = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
8164
|
-
"div",
|
|
8165
|
-
{
|
|
8166
|
-
ref,
|
|
8167
|
-
className: cn(
|
|
8168
|
-
"flex flex-col divide-y divide-card-foreground/10",
|
|
8169
|
-
className
|
|
8170
|
-
),
|
|
8171
|
-
...props
|
|
8172
|
-
}
|
|
8173
|
-
));
|
|
8174
|
-
NodeCardContent.displayName = "NodeCardContent";
|
|
8175
|
-
var NodeCardFooter = React2.forwardRef(
|
|
8176
|
-
({ className, nodeId, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
8177
|
-
"div",
|
|
8178
|
-
{
|
|
8179
|
-
ref,
|
|
8180
|
-
className: `bg-card-foreground/10 overflow-clip rounded-sm px-4 py-2 text-[10px] text-card-foreground/50 ${className}`,
|
|
8181
|
-
...props,
|
|
8182
|
-
children: [
|
|
8183
|
-
"Node: ",
|
|
8184
|
-
/* @__PURE__ */ jsxs("span", { className: "font-semibold", children: [
|
|
8185
|
-
"#",
|
|
8186
|
-
nodeId
|
|
8187
|
-
] })
|
|
8188
|
-
]
|
|
8189
|
-
}
|
|
8190
|
-
)
|
|
8191
|
-
);
|
|
8192
|
-
NodeCardFooter.displayName = "NodeCardFooter";
|
|
8193
8234
|
var TRIGGER_WORKFLOW = TriggerWorkflowDocument;
|
|
8194
8235
|
var WORKFLOW_RUN = WorkflowRunDocument;
|
|
8195
8236
|
var TERMINAL_STATUSES = /* @__PURE__ */ new Set([
|
|
@@ -8773,7 +8814,7 @@ var getNodeMetadata = (value) => {
|
|
|
8773
8814
|
}, [data?.isAdapterInstance, edges, id, nodeLookup]);
|
|
8774
8815
|
const nodeType = value?.type;
|
|
8775
8816
|
const meta = useMemo(() => getNodeDetail(nodeType), [nodeType]);
|
|
8776
|
-
const {
|
|
8817
|
+
const { setNodes } = useReactFlow();
|
|
8777
8818
|
const [
|
|
8778
8819
|
showNodePropertiesOf,
|
|
8779
8820
|
isExecuting,
|
|
@@ -8832,81 +8873,68 @@ var getNodeMetadata = (value) => {
|
|
|
8832
8873
|
const nodeStatus = nodeStatuses[id] || "idle";
|
|
8833
8874
|
const executionStatus = nodeStatus === "success" ? "success" : nodeStatus === "error" ? "error" : nodeStatus === "running" ? "running" : "idle";
|
|
8834
8875
|
const itemCount = nodeItemCounts[id];
|
|
8876
|
+
const isTrigger = (data?.operation_type || "").toLowerCase() === "trigger" || (value?.type || "").toLowerCase().includes("trigger");
|
|
8877
|
+
const appName = (meta.title || nodeType || "Node").split(/\s+/)[0].toUpperCase();
|
|
8878
|
+
const operationDisplay = nodeType === "integration/channel" ? (() => {
|
|
8879
|
+
const explicitRole = data.args?.state?.role;
|
|
8880
|
+
const isAction = explicitRole === "action" || !explicitRole && edges.some((e) => e.target === id);
|
|
8881
|
+
return isAction ? "sendChannelMessage" : "onChannelMessageReceived";
|
|
8882
|
+
})() : nodeType === "store/conversation" ? "storeAndForward" : data?.operation_name || "Not configured";
|
|
8883
|
+
const nodeDescription = data?.nodeData?.description || meta?.description || "";
|
|
8884
|
+
const isLogicNode = /(^|[:/])(if|switch|merge|loop|filter|branch|router|condition|aggregate)/.test(
|
|
8885
|
+
(value?.type || "").toLowerCase()
|
|
8886
|
+
);
|
|
8887
|
+
const roleAccent = isTrigger ? "#10b981" : isLogicNode ? "#f59e0b" : "#3b82f6";
|
|
8835
8888
|
return /* @__PURE__ */ jsxs("div", { children: [
|
|
8836
8889
|
/* @__PURE__ */ jsxs(
|
|
8837
8890
|
NodeCard,
|
|
8838
8891
|
{
|
|
8839
8892
|
"data-selected": selected,
|
|
8893
|
+
selected,
|
|
8840
8894
|
onDoubleClick: handleOpenNdv,
|
|
8841
8895
|
executionStatus,
|
|
8842
8896
|
itemCount,
|
|
8897
|
+
isTrigger,
|
|
8898
|
+
accent: roleAccent,
|
|
8899
|
+
isExecuting: isThisNodeExecuting,
|
|
8900
|
+
onSettings: handleShowNodeProperties,
|
|
8901
|
+
onExecute: handleExecuteStep,
|
|
8902
|
+
onDelete: handleDeleteNode,
|
|
8903
|
+
infoButton: /* @__PURE__ */ jsx(
|
|
8904
|
+
NodeInfoButtonWithModal,
|
|
8905
|
+
{
|
|
8906
|
+
metadata: {
|
|
8907
|
+
icon: meta.icon,
|
|
8908
|
+
title: meta.title,
|
|
8909
|
+
description: nodeDescription,
|
|
8910
|
+
gradientColor: meta.gradientColor
|
|
8911
|
+
}
|
|
8912
|
+
}
|
|
8913
|
+
),
|
|
8843
8914
|
children: [
|
|
8844
8915
|
/* @__PURE__ */ jsx(
|
|
8845
8916
|
NodeCardHeader,
|
|
8846
8917
|
{
|
|
8847
8918
|
icon: meta.icon,
|
|
8848
|
-
|
|
8849
|
-
|
|
8850
|
-
|
|
8851
|
-
|
|
8852
|
-
|
|
8853
|
-
|
|
8854
|
-
|
|
8919
|
+
appName,
|
|
8920
|
+
accentKey: value?.type || meta.title
|
|
8921
|
+
}
|
|
8922
|
+
),
|
|
8923
|
+
/* @__PURE__ */ jsx(
|
|
8924
|
+
NodeCardBody,
|
|
8925
|
+
{
|
|
8926
|
+
operationName: operationDisplay,
|
|
8927
|
+
description: nodeDescription
|
|
8855
8928
|
}
|
|
8856
8929
|
),
|
|
8857
|
-
/* @__PURE__ */ jsxs(NodeCardContent, { children: [
|
|
8858
|
-
nodeType === "integration/channel" || nodeType === "store/conversation" ? /* @__PURE__ */ jsx("div", { className: "flex flex-col p-4", children: /* @__PURE__ */ jsx("div", { className: "text-xs font-medium text-card-foreground", children: nodeType === "integration/channel" ? (() => {
|
|
8859
|
-
const explicitRole = data.args?.state?.role;
|
|
8860
|
-
const isAction = explicitRole === "action" || !explicitRole && edges.some((e) => e.target === id);
|
|
8861
|
-
return isAction ? "Send Message" : "Receive Messages";
|
|
8862
|
-
})() : "Store & Forward" }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8863
|
-
/* @__PURE__ */ jsx("div", { className: "flex flex-col p-4", children: /* @__PURE__ */ jsx("div", { className: "text-xs font-medium text-card-foreground", children: "Select Operation" }) }),
|
|
8864
|
-
value?.operations && /* @__PURE__ */ jsx("div", { className: "space-y-4 ", children: /* @__PURE__ */ jsxs(
|
|
8865
|
-
Select,
|
|
8866
|
-
{
|
|
8867
|
-
value: data?.operation_name,
|
|
8868
|
-
onValueChange: (val) => {
|
|
8869
|
-
const op = value?.operations?.find(
|
|
8870
|
-
(operation) => operation.name === val
|
|
8871
|
-
);
|
|
8872
|
-
if (op) {
|
|
8873
|
-
updateNode(id, {
|
|
8874
|
-
data: {
|
|
8875
|
-
...getNode(id)?.data,
|
|
8876
|
-
operation_name: op.name,
|
|
8877
|
-
operation_type: op.type,
|
|
8878
|
-
args: {
|
|
8879
|
-
state: { ...op?.adaptive_card?.defaultValue },
|
|
8880
|
-
context: getNode(id)?.data?.args?.context
|
|
8881
|
-
}
|
|
8882
|
-
}
|
|
8883
|
-
});
|
|
8884
|
-
}
|
|
8885
|
-
},
|
|
8886
|
-
children: [
|
|
8887
|
-
/* @__PURE__ */ jsx(SelectTrigger, { children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "Select Operation" }) }),
|
|
8888
|
-
/* @__PURE__ */ jsx(SelectContent, { children: value?.operations?.map((operation) => /* @__PURE__ */ jsx(
|
|
8889
|
-
SelectItem,
|
|
8890
|
-
{
|
|
8891
|
-
value: operation.name,
|
|
8892
|
-
children: operation.name
|
|
8893
|
-
},
|
|
8894
|
-
operation.name
|
|
8895
|
-
)) })
|
|
8896
|
-
]
|
|
8897
|
-
}
|
|
8898
|
-
) })
|
|
8899
|
-
] }),
|
|
8900
|
-
/* @__PURE__ */ jsx(NodeCardDescription, { description: meta?.description ?? "" }),
|
|
8901
|
-
/* @__PURE__ */ jsx(NodeCardFooter, { nodeId: id })
|
|
8902
|
-
] }),
|
|
8903
8930
|
/* @__PURE__ */ jsx(
|
|
8904
8931
|
CustomHandle,
|
|
8905
8932
|
{
|
|
8906
8933
|
type: "target",
|
|
8907
8934
|
id: "target",
|
|
8908
8935
|
position: Position.Left,
|
|
8909
|
-
isConnectable
|
|
8936
|
+
isConnectable,
|
|
8937
|
+
accent: roleAccent
|
|
8910
8938
|
}
|
|
8911
8939
|
),
|
|
8912
8940
|
/* @__PURE__ */ jsx(
|
|
@@ -8915,7 +8943,8 @@ var getNodeMetadata = (value) => {
|
|
|
8915
8943
|
type: "source",
|
|
8916
8944
|
id: "source",
|
|
8917
8945
|
position: Position.Right,
|
|
8918
|
-
isConnectable
|
|
8946
|
+
isConnectable,
|
|
8947
|
+
accent: roleAccent
|
|
8919
8948
|
}
|
|
8920
8949
|
)
|
|
8921
8950
|
]
|
|
@@ -9310,6 +9339,12 @@ function SidebarPanelHeading({
|
|
|
9310
9339
|
}
|
|
9311
9340
|
);
|
|
9312
9341
|
}
|
|
9342
|
+
var HeaderWithIcon = ({ icon, title }) => {
|
|
9343
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
|
|
9344
|
+
/* @__PURE__ */ jsx(Icon, { icon, className: `size-4` }),
|
|
9345
|
+
/* @__PURE__ */ jsx("div", { className: "ml-2.5 flex items-center text-xs font-medium leading-none tracking-wide uppercase opacity-80", children: /* @__PURE__ */ jsx("span", { className: "translate-y-px", children: title }) })
|
|
9346
|
+
] });
|
|
9347
|
+
};
|
|
9313
9348
|
function truncateMiddle(text, maxLength) {
|
|
9314
9349
|
if (text.length <= maxLength) return text;
|
|
9315
9350
|
const half = maxLength / 2;
|
|
@@ -11453,6 +11488,7 @@ gql$1`
|
|
|
11453
11488
|
|
|
11454
11489
|
// src/builder/contants/symbols.ts
|
|
11455
11490
|
var NODE_TYPE_DRAG_DATA_FORMAT = "application/flow-builder.node-type";
|
|
11491
|
+
var NODE_OPERATION_DRAG_DATA_FORMAT = "application/flow-builder.node-operation";
|
|
11456
11492
|
function StoreNodeListItem({
|
|
11457
11493
|
name,
|
|
11458
11494
|
description,
|
|
@@ -11852,6 +11888,99 @@ var UninstallNodeDialog = ({
|
|
|
11852
11888
|
] })
|
|
11853
11889
|
] }) });
|
|
11854
11890
|
};
|
|
11891
|
+
function isTriggerOperation(op) {
|
|
11892
|
+
return op.role === "trigger" || !!op.delivery || op.type === "subscription";
|
|
11893
|
+
}
|
|
11894
|
+
function StoreNodeOperations({ nodeType }) {
|
|
11895
|
+
const [, bump] = useState(0);
|
|
11896
|
+
useEffect(() => onNodeTypesUpdate(() => bump((n) => n + 1)), []);
|
|
11897
|
+
const config2 = nodeType ? NODE_CONFIGS.find((c) => c.type === nodeType) : void 0;
|
|
11898
|
+
const operations = config2?.operations ?? [];
|
|
11899
|
+
const handleDragStart = useCallback(
|
|
11900
|
+
(e, opName) => {
|
|
11901
|
+
if (!nodeType) return;
|
|
11902
|
+
e.dataTransfer.setData(NODE_TYPE_DRAG_DATA_FORMAT, nodeType);
|
|
11903
|
+
if (opName)
|
|
11904
|
+
e.dataTransfer.setData(NODE_OPERATION_DRAG_DATA_FORMAT, opName);
|
|
11905
|
+
e.dataTransfer.effectAllowed = "move";
|
|
11906
|
+
},
|
|
11907
|
+
[nodeType]
|
|
11908
|
+
);
|
|
11909
|
+
if (!nodeType) return null;
|
|
11910
|
+
if (operations.length === 0) {
|
|
11911
|
+
return /* @__PURE__ */ jsx("div", { className: "px-3 pt-3 pb-1", children: /* @__PURE__ */ jsxs(
|
|
11912
|
+
"button",
|
|
11913
|
+
{
|
|
11914
|
+
draggable: true,
|
|
11915
|
+
onDragStart: (e) => handleDragStart(e),
|
|
11916
|
+
title: "Drag to add to canvas",
|
|
11917
|
+
className: "w-full flex items-center gap-2.5 px-2 py-2 rounded-md hover:bg-muted/60 transition-colors text-left group",
|
|
11918
|
+
style: { cursor: "grab" },
|
|
11919
|
+
children: [
|
|
11920
|
+
/* @__PURE__ */ jsx("div", { className: "size-7 shrink-0 rounded-md bg-muted flex items-center justify-center", children: /* @__PURE__ */ jsx(Icon, { icon: "mynaui:plus", className: "size-3.5 text-primary" }) }),
|
|
11921
|
+
/* @__PURE__ */ jsx("span", { className: "flex-1 text-sm font-medium text-foreground group-hover:text-primary transition-colors", children: "Add to canvas" }),
|
|
11922
|
+
/* @__PURE__ */ jsx(
|
|
11923
|
+
Icon,
|
|
11924
|
+
{
|
|
11925
|
+
icon: "mynaui:drag-dots-vertical",
|
|
11926
|
+
className: "size-4 shrink-0 text-foreground/40 group-hover:text-primary transition-colors"
|
|
11927
|
+
}
|
|
11928
|
+
)
|
|
11929
|
+
]
|
|
11930
|
+
}
|
|
11931
|
+
) });
|
|
11932
|
+
}
|
|
11933
|
+
return /* @__PURE__ */ jsxs("div", { className: "px-3 pt-3 pb-1", children: [
|
|
11934
|
+
/* @__PURE__ */ jsx("p", { className: "px-1 pb-2 text-xs font-medium text-muted-foreground", children: "Operations \u2014 drag one onto the canvas" }),
|
|
11935
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-col gap-0.5", children: operations.map((op) => {
|
|
11936
|
+
const isTrigger = isTriggerOperation(op);
|
|
11937
|
+
return /* @__PURE__ */ jsxs(
|
|
11938
|
+
"button",
|
|
11939
|
+
{
|
|
11940
|
+
draggable: true,
|
|
11941
|
+
onDragStart: (e) => handleDragStart(e, op.name),
|
|
11942
|
+
title: `${op.name} \u2014 drag to add to canvas`,
|
|
11943
|
+
className: "w-full flex items-center gap-2.5 px-2 py-2 rounded-md hover:bg-muted/60 transition-colors text-left group",
|
|
11944
|
+
style: { cursor: "grab" },
|
|
11945
|
+
children: [
|
|
11946
|
+
/* @__PURE__ */ jsx("div", { className: "size-7 shrink-0 rounded-md bg-muted flex items-center justify-center", children: /* @__PURE__ */ jsx(
|
|
11947
|
+
Icon,
|
|
11948
|
+
{
|
|
11949
|
+
icon: isTrigger ? "solar:play-bold" : "mynaui:bolt",
|
|
11950
|
+
className: "size-3.5 text-primary"
|
|
11951
|
+
}
|
|
11952
|
+
) }),
|
|
11953
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
11954
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
11955
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-foreground group-hover:text-primary transition-colors truncate", children: op.name }),
|
|
11956
|
+
/* @__PURE__ */ jsx(
|
|
11957
|
+
"span",
|
|
11958
|
+
{
|
|
11959
|
+
className: "shrink-0 inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-semibold",
|
|
11960
|
+
style: {
|
|
11961
|
+
background: isTrigger ? "var(--color-status-info-bgSubtle)" : "var(--color-status-neutral-bgSubtle, var(--muted))",
|
|
11962
|
+
color: isTrigger ? "var(--color-status-info-text)" : "var(--muted-foreground)"
|
|
11963
|
+
},
|
|
11964
|
+
children: isTrigger ? "Trigger" : "Action"
|
|
11965
|
+
}
|
|
11966
|
+
)
|
|
11967
|
+
] }),
|
|
11968
|
+
op.description && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground truncate mt-0.5 leading-snug", children: op.description })
|
|
11969
|
+
] }),
|
|
11970
|
+
/* @__PURE__ */ jsx(
|
|
11971
|
+
Icon,
|
|
11972
|
+
{
|
|
11973
|
+
icon: "mynaui:drag-dots-vertical",
|
|
11974
|
+
className: "size-4 shrink-0 text-foreground/40 group-hover:text-primary transition-colors"
|
|
11975
|
+
}
|
|
11976
|
+
)
|
|
11977
|
+
]
|
|
11978
|
+
},
|
|
11979
|
+
op.name
|
|
11980
|
+
);
|
|
11981
|
+
}) })
|
|
11982
|
+
] });
|
|
11983
|
+
}
|
|
11855
11984
|
function formatDownloads(count2) {
|
|
11856
11985
|
if (count2 >= 1e6) return `${(count2 / 1e6).toFixed(1)}M`;
|
|
11857
11986
|
if (count2 >= 1e3) return `${(count2 / 1e3).toFixed(1)}k`;
|
|
@@ -11877,6 +12006,8 @@ function StoreNodeDetail({ node, onBack }) {
|
|
|
11877
12006
|
const context = useContext(FluidGridsContext);
|
|
11878
12007
|
const workspaceId = context?.workspaceId ?? getFluidGridsConfig().workspaceId;
|
|
11879
12008
|
const isInstalled = installedAppIds.has(node.id);
|
|
12009
|
+
const manifestNodeType = node.manifest?.nodeType;
|
|
12010
|
+
const nodeType = manifestNodeType ?? (isInstalled ? `store/${node.slug}` : void 0);
|
|
11880
12011
|
const installation = installationsMap.get(node.id);
|
|
11881
12012
|
const installedVersion = installation?.installedVersion;
|
|
11882
12013
|
const installationId = installation?.installationId;
|
|
@@ -12093,6 +12224,7 @@ function StoreNodeDetail({ node, onBack }) {
|
|
|
12093
12224
|
] })
|
|
12094
12225
|
] }),
|
|
12095
12226
|
node.description && /* @__PURE__ */ jsx("p", { className: "text-sm text-foreground/80 leading-relaxed mb-4", children: node.description }),
|
|
12227
|
+
isInstalled && /* @__PURE__ */ jsx("div", { className: "mb-4 -mx-3 rounded-lg border border-border/50", children: /* @__PURE__ */ jsx(StoreNodeOperations, { nodeType }) }),
|
|
12096
12228
|
node.publisher && /* @__PURE__ */ jsxs("div", { className: "mb-4 p-2.5 rounded-lg bg-muted/50 flex items-center gap-2", children: [
|
|
12097
12229
|
/* @__PURE__ */ jsx("div", { className: "size-6 rounded bg-muted flex items-center justify-center shrink-0", children: /* @__PURE__ */ jsx("span", { className: "text-xs font-bold text-muted-foreground", children: node.publisher.name.charAt(0) }) }),
|
|
12098
12230
|
/* @__PURE__ */ jsx("span", { className: "text-xs text-foreground font-medium flex-1 min-w-0 truncate", children: node.publisher.name }),
|
|
@@ -18337,15 +18469,7 @@ function CustomDeletableEdge(props) {
|
|
|
18337
18469
|
const isRunning = sourceNodeStatus === "running";
|
|
18338
18470
|
const isSuccess = sourceNodeStatus === "success";
|
|
18339
18471
|
const isError = sourceNodeStatus === "error";
|
|
18340
|
-
const [edgePath] =
|
|
18341
|
-
sourceX,
|
|
18342
|
-
sourceY,
|
|
18343
|
-
sourcePosition,
|
|
18344
|
-
targetX,
|
|
18345
|
-
targetY,
|
|
18346
|
-
targetPosition
|
|
18347
|
-
});
|
|
18348
|
-
const bezierResult = getBezierPath({
|
|
18472
|
+
const [edgePath, labelX, labelY] = getBezierPath({
|
|
18349
18473
|
sourceX,
|
|
18350
18474
|
sourceY,
|
|
18351
18475
|
sourcePosition,
|
|
@@ -18353,8 +18477,6 @@ function CustomDeletableEdge(props) {
|
|
|
18353
18477
|
targetY,
|
|
18354
18478
|
targetPosition
|
|
18355
18479
|
});
|
|
18356
|
-
const labelX = bezierResult[1];
|
|
18357
|
-
const labelY = bezierResult[2];
|
|
18358
18480
|
useEffect(() => {
|
|
18359
18481
|
const edges = getEdges();
|
|
18360
18482
|
const currentEdge = edges?.find((e) => e.id === id);
|
|
@@ -18909,10 +19031,18 @@ function CustomDeletableEdge(props) {
|
|
|
18909
19031
|
return {
|
|
18910
19032
|
stroke: "var(--color-text-tertiary)",
|
|
18911
19033
|
// Theme-aware default color
|
|
18912
|
-
strokeWidth:
|
|
19034
|
+
strokeWidth: 2
|
|
18913
19035
|
};
|
|
18914
19036
|
};
|
|
18915
19037
|
const edgeStyle = getEdgeStyle();
|
|
19038
|
+
const isIdle = !isRunning && !isSuccess && !isError;
|
|
19039
|
+
const srcType = (sourceNodeData?.type || "").toLowerCase();
|
|
19040
|
+
const srcOpType = (sourceNodeData?.data?.operation_type || "").toLowerCase();
|
|
19041
|
+
const srcIsTrigger = srcOpType === "trigger" || srcType.includes("trigger");
|
|
19042
|
+
const srcIsLogic = /(if|switch|merge|loop|filter|branch|router|condition|aggregate)/.test(
|
|
19043
|
+
srcType
|
|
19044
|
+
);
|
|
19045
|
+
const flowAccent = srcIsTrigger ? "#10b981" : srcIsLogic ? "#f59e0b" : "#3b82f6";
|
|
18916
19046
|
const edgeClassName = [isRunning && "animated-edge edge-glow"].filter(Boolean).join(" ");
|
|
18917
19047
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
18918
19048
|
/* @__PURE__ */ jsx(
|
|
@@ -18945,10 +19075,30 @@ function CustomDeletableEdge(props) {
|
|
|
18945
19075
|
className: edgeClassName,
|
|
18946
19076
|
d: edgePath,
|
|
18947
19077
|
fill: "none",
|
|
18948
|
-
style: edgeStyle,
|
|
19078
|
+
style: isIdle ? { stroke: flowAccent, strokeWidth: 1.25, strokeOpacity: 0.22 } : edgeStyle,
|
|
18949
19079
|
markerEnd
|
|
18950
19080
|
}
|
|
18951
19081
|
),
|
|
19082
|
+
isIdle && /* @__PURE__ */ jsx(
|
|
19083
|
+
"path",
|
|
19084
|
+
{
|
|
19085
|
+
d: edgePath,
|
|
19086
|
+
fill: "none",
|
|
19087
|
+
stroke: flowAccent,
|
|
19088
|
+
strokeWidth: 2,
|
|
19089
|
+
strokeDasharray: "6 8",
|
|
19090
|
+
style: { pointerEvents: "none" },
|
|
19091
|
+
children: /* @__PURE__ */ jsx(
|
|
19092
|
+
"animate",
|
|
19093
|
+
{
|
|
19094
|
+
attributeName: "stroke-dashoffset",
|
|
19095
|
+
values: "0;-14",
|
|
19096
|
+
dur: "0.55s",
|
|
19097
|
+
repeatCount: "indefinite"
|
|
19098
|
+
}
|
|
19099
|
+
)
|
|
19100
|
+
}
|
|
19101
|
+
),
|
|
18952
19102
|
isRunning && /* @__PURE__ */ jsx(
|
|
18953
19103
|
"path",
|
|
18954
19104
|
{
|
|
@@ -19132,10 +19282,31 @@ var useAddNodeOnEdgeDropStore = create()(
|
|
|
19132
19282
|
}
|
|
19133
19283
|
})
|
|
19134
19284
|
);
|
|
19285
|
+
function buildOperationSeed(type, operationName, existingData) {
|
|
19286
|
+
const config2 = NODE_CONFIGS.find((c) => c.type === type);
|
|
19287
|
+
if (!config2) return null;
|
|
19288
|
+
const operations = config2.operations ?? [];
|
|
19289
|
+
const op = operations.find((o) => o.name === operationName);
|
|
19290
|
+
if (!op) return null;
|
|
19291
|
+
const manifest = config2.defaultData?.nodeData;
|
|
19292
|
+
const prevArgs = existingData.args ?? {};
|
|
19293
|
+
return {
|
|
19294
|
+
...existingData,
|
|
19295
|
+
operation_name: op.name,
|
|
19296
|
+
operation_type: op.type,
|
|
19297
|
+
args: {
|
|
19298
|
+
// Preserve default context/credentials; seed state from the op defaults.
|
|
19299
|
+
...prevArgs,
|
|
19300
|
+
state: { ...op.adaptive_card?.defaultValue ?? {} }
|
|
19301
|
+
},
|
|
19302
|
+
// Slim manifest: keep node-level metadata but only the pinned operation.
|
|
19303
|
+
nodeData: { ...manifest ?? {}, operations: [op] }
|
|
19304
|
+
};
|
|
19305
|
+
}
|
|
19135
19306
|
function useInsertNode() {
|
|
19136
19307
|
const { addNodes, screenToFlowPosition, getNodes, updateNode } = useReactFlow();
|
|
19137
19308
|
return useCallback(
|
|
19138
|
-
(type, pos) => {
|
|
19309
|
+
(type, pos, operationName) => {
|
|
19139
19310
|
const _pos = pos || screenToFlowPosition({
|
|
19140
19311
|
x: window.innerWidth / 2,
|
|
19141
19312
|
y: window.innerHeight / 2
|
|
@@ -19149,6 +19320,14 @@ function useInsertNode() {
|
|
|
19149
19320
|
position: _pos,
|
|
19150
19321
|
selected: true
|
|
19151
19322
|
});
|
|
19323
|
+
if (operationName) {
|
|
19324
|
+
const seeded = buildOperationSeed(
|
|
19325
|
+
type,
|
|
19326
|
+
operationName,
|
|
19327
|
+
newNode.data ?? {}
|
|
19328
|
+
);
|
|
19329
|
+
if (seeded) newNode.data = seeded;
|
|
19330
|
+
}
|
|
19152
19331
|
addNodes(newNode);
|
|
19153
19332
|
return newNode;
|
|
19154
19333
|
},
|
|
@@ -19254,12 +19433,14 @@ function useDragDropFlowBuilder() {
|
|
|
19254
19433
|
e.preventDefault();
|
|
19255
19434
|
const type = e.dataTransfer.getData(NODE_TYPE_DRAG_DATA_FORMAT);
|
|
19256
19435
|
if (typeof type === "undefined" || !type) return;
|
|
19436
|
+
const operationName = e.dataTransfer.getData(NODE_OPERATION_DRAG_DATA_FORMAT) || void 0;
|
|
19257
19437
|
insertNode(
|
|
19258
19438
|
type,
|
|
19259
19439
|
screenToFlowPosition({
|
|
19260
19440
|
x: e.clientX,
|
|
19261
19441
|
y: e.clientY
|
|
19262
|
-
})
|
|
19442
|
+
}),
|
|
19443
|
+
operationName
|
|
19263
19444
|
);
|
|
19264
19445
|
},
|
|
19265
19446
|
[insertNode, screenToFlowPosition]
|
|
@@ -19550,9 +19731,12 @@ function AddNodeFloatingMenu({
|
|
|
19550
19731
|
};
|
|
19551
19732
|
});
|
|
19552
19733
|
const fromHandleId = _incomingNodeMetadetails?.fromHandle?.id;
|
|
19734
|
+
const connectableNodes = AVAILABLE_NODES.filter(
|
|
19735
|
+
(node) => node.publishType !== "STORE"
|
|
19736
|
+
);
|
|
19553
19737
|
return {
|
|
19554
19738
|
availableNodes: mapNodesWithMetadata(
|
|
19555
|
-
fromHandleId === "source" || fromHandleId === "target" ?
|
|
19739
|
+
fromHandleId === "source" || fromHandleId === "target" ? connectableNodes.map((node) => node.type) : connectableNodes.filter(
|
|
19556
19740
|
(node) => node?.manifest?.kind?.includes(fromHandleId ?? "")
|
|
19557
19741
|
).map((node) => node.type)
|
|
19558
19742
|
),
|
|
@@ -21528,7 +21712,7 @@ var edgeTypes2 = {
|
|
|
21528
21712
|
deletable: CustomDeletableEdge
|
|
21529
21713
|
};
|
|
21530
21714
|
var edgeOptions = {
|
|
21531
|
-
type: "
|
|
21715
|
+
type: "deletable",
|
|
21532
21716
|
markerEnd: {
|
|
21533
21717
|
type: MarkerType.ArrowClosed,
|
|
21534
21718
|
width: 21,
|
|
@@ -21741,7 +21925,7 @@ var FlowBuilder = () => {
|
|
|
21741
21925
|
ReactFlow,
|
|
21742
21926
|
{
|
|
21743
21927
|
proOptions: { hideAttribution: true },
|
|
21744
|
-
onInit: ({ fitView }) => fitView().then(),
|
|
21928
|
+
onInit: ({ fitView }) => fitView({ minZoom: 1, maxZoom: 1 }).then(),
|
|
21745
21929
|
nodeTypes: nodeTypes3,
|
|
21746
21930
|
nodes,
|
|
21747
21931
|
onNodesChange: handleNodesChange,
|
|
@@ -21762,6 +21946,7 @@ var FlowBuilder = () => {
|
|
|
21762
21946
|
snapGrid: [16, 16],
|
|
21763
21947
|
snapToGrid: true,
|
|
21764
21948
|
fitView: true,
|
|
21949
|
+
fitViewOptions: { minZoom: 1, maxZoom: 1 },
|
|
21765
21950
|
defaultEdgeOptions: edgeOptions,
|
|
21766
21951
|
children: /* @__PURE__ */ jsx(Background, { gap: 24 })
|
|
21767
21952
|
}
|
|
@@ -22036,5 +22221,5 @@ function WorkflowBuilder() {
|
|
|
22036
22221
|
}
|
|
22037
22222
|
|
|
22038
22223
|
export { Card2 as Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ConfigSchemaForm, ConnectionFormDialog, ConnectionSelector, FluidGridsProvider, ProviderPicker, TemplateCard, WorkflowBuilder, getProviderForm, listCustomBlocks, refetchStoreNodes, registerCustomBlock, resolveUiSpec, stripSubmitActions, useConnection, useConnectionDialog, useConnections, useConnectionsByProvider, useCreateConnection, useFluidGridsContext, useImportWorkflowTemplate, useInitiateOAuth, useNodeExecution, useProviderByKey, useProviderCatalog, useProviders, useWorkflowTemplates };
|
|
22039
|
-
//# sourceMappingURL=chunk-
|
|
22040
|
-
//# sourceMappingURL=chunk-
|
|
22224
|
+
//# sourceMappingURL=chunk-5GIC24CM.js.map
|
|
22225
|
+
//# sourceMappingURL=chunk-5GIC24CM.js.map
|