windmill-components 1.503.1 → 1.503.4
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/package/components/AppWrapper.svelte +3 -0
- package/package/components/Dev.svelte +94 -4
- package/package/components/FlowBuilder.svelte +89 -7
- package/package/components/FlowPreviewContent.svelte +309 -278
- package/package/components/FlowPreviewContent.svelte.d.ts +33 -19
- package/package/components/FlowPreviewResult.svelte +74 -0
- package/package/components/FlowPreviewResult.svelte.d.ts +21 -0
- package/package/components/FlowStatusViewer.svelte +3 -1
- package/package/components/FlowStatusViewer.svelte.d.ts +2 -0
- package/package/components/FlowStatusViewerInner.svelte +15 -70
- package/package/components/FlowStatusWaitingForEvents.svelte +5 -2
- package/package/components/FlowStatusWaitingForEvents.svelte.d.ts +1 -0
- package/package/components/FlowWrapper.svelte +3 -0
- package/package/components/ModuleTest.svelte +26 -24
- package/package/components/ResourcePicker.svelte +11 -3
- package/package/components/ScriptWrapper.svelte +3 -0
- package/package/components/common/button/Button.svelte +2 -1
- package/package/components/common/button/Button.svelte.d.ts +2 -1
- package/package/components/flows/FlowEditor.svelte +23 -2
- package/package/components/flows/FlowEditor.svelte.d.ts +23 -3
- package/package/components/flows/content/FlowEditorPanel.svelte +4 -3
- package/package/components/flows/content/FlowEditorPanel.svelte.d.ts +12 -2
- package/package/components/flows/content/FlowInput.svelte +2 -2
- package/package/components/flows/content/FlowInput.svelte.d.ts +1 -1
- package/package/components/flows/content/FlowResult.svelte +35 -0
- package/package/components/flows/content/FlowResult.svelte.d.ts +17 -0
- package/package/components/flows/header/FlowPreviewButtons.svelte +81 -46
- package/package/components/flows/map/FlowGraphPreviewButton.svelte +94 -0
- package/package/components/flows/map/FlowGraphPreviewButton.svelte.d.ts +17 -0
- package/package/components/flows/map/FlowModuleSchemaItem.svelte +296 -285
- package/package/components/flows/map/FlowModuleSchemaItem.svelte.d.ts +6 -0
- package/package/components/flows/map/FlowModuleSchemaMap.svelte +20 -1
- package/package/components/flows/map/FlowModuleSchemaMap.svelte.d.ts +20 -1
- package/package/components/flows/map/MapItem.svelte +25 -3
- package/package/components/flows/map/MapItem.svelte.d.ts +6 -1
- package/package/components/flows/map/VirtualItem.svelte +55 -3
- package/package/components/flows/map/VirtualItem.svelte.d.ts +13 -1
- package/package/components/flows/map/VirtualItemWrapper.svelte +33 -29
- package/package/components/flows/map/VirtualItemWrapper.svelte.d.ts +1 -0
- package/package/components/flows/propPicker/OutputPicker.svelte +17 -2
- package/package/components/flows/propPicker/OutputPicker.svelte.d.ts +4 -0
- package/package/components/flows/propPicker/OutputPickerInner.svelte +2 -2
- package/package/components/flows/propPicker/OutputPickerInner.svelte.d.ts +1 -0
- package/package/components/flows/types.d.ts +3 -0
- package/package/components/flows/utils.d.ts +9 -0
- package/package/components/flows/utils.js +39 -0
- package/package/components/graph/FlowGraphV2.svelte +27 -4
- package/package/components/graph/FlowGraphV2.svelte.d.ts +18 -2
- package/package/components/graph/ViewportResizer.svelte +33 -1
- package/package/components/graph/ViewportResizer.svelte.d.ts +5 -1
- package/package/components/graph/graphBuilder.svelte.d.ts +26 -1
- package/package/components/graph/graphBuilder.svelte.js +13 -3
- package/package/components/graph/renderers/edges/BaseEdge.svelte +69 -2
- package/package/components/graph/renderers/edges/BaseEdge.svelte.d.ts +10 -0
- package/package/components/graph/renderers/nodes/InputNode.svelte +19 -1
- package/package/components/graph/renderers/nodes/ModuleNode.svelte +17 -2
- package/package/components/graph/renderers/nodes/ResultNode.svelte +9 -8
- package/package/components/modulesTest.svelte.d.ts +12 -0
- package/package/components/modulesTest.svelte.js +8 -0
- package/package/components/preview/FlowPreviewStatus.svelte +9 -4
- package/package/components/preview/FlowPreviewStatus.svelte.d.ts +6 -18
- package/package/components/schema/EditableSchemaSdkWrapper.svelte +3 -0
- package/package/components/workspaceSettings/AISettings.svelte +1 -0
- package/package/gen/schemas.gen.d.ts +0 -3
- package/package/gen/schemas.gen.js +0 -3
- package/package/gen/types.gen.d.ts +0 -1
- package/package/utils.js +2 -0
- package/package.json +1 -1
- package/package/components/flows/header/FlowPreviewButtons.svelte.d.ts +0 -26
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type FlowModule } from '../../gen';
|
|
1
|
+
import { type FlowModule, type Job } from '../../gen';
|
|
2
2
|
import { type GraphModuleState } from '.';
|
|
3
3
|
import { type Writable } from 'svelte/store';
|
|
4
4
|
import '@xyflow/svelte/dist/base.css';
|
|
@@ -28,6 +28,15 @@ interface Props {
|
|
|
28
28
|
editMode?: boolean;
|
|
29
29
|
allowSimplifiedPoll?: boolean;
|
|
30
30
|
expandedSubflows?: Record<string, FlowModule[]>;
|
|
31
|
+
isOwner?: boolean;
|
|
32
|
+
isRunning?: boolean;
|
|
33
|
+
individualStepTests?: boolean;
|
|
34
|
+
flowJob?: Job | undefined;
|
|
35
|
+
showJobStatus?: boolean;
|
|
36
|
+
suspendStatus?: Writable<Record<string, {
|
|
37
|
+
job: Job;
|
|
38
|
+
nb: number;
|
|
39
|
+
}>>;
|
|
31
40
|
onDelete?: (id: string) => void;
|
|
32
41
|
onInsert?: (detail: {
|
|
33
42
|
sourceId?: string;
|
|
@@ -70,7 +79,14 @@ interface Props {
|
|
|
70
79
|
onTestUpTo?: ((id: string) => void) | undefined;
|
|
71
80
|
onSelectedIteration?: onSelectedIteration;
|
|
72
81
|
onEditInput?: (moduleId: string, key: string) => void;
|
|
82
|
+
onTestFlow?: () => void;
|
|
83
|
+
onCancelTestFlow?: () => void;
|
|
84
|
+
onOpenPreview?: () => void;
|
|
85
|
+
onHideJobStatus?: () => void;
|
|
86
|
+
flowHasChanged?: boolean;
|
|
73
87
|
}
|
|
74
|
-
declare const FlowGraphV2: import("svelte").Component<Props, {
|
|
88
|
+
declare const FlowGraphV2: import("svelte").Component<Props, {
|
|
89
|
+
isNodeVisible: (nodeId: string) => boolean;
|
|
90
|
+
}, "expandedSubflows">;
|
|
75
91
|
type FlowGraphV2 = ReturnType<typeof FlowGraphV2>;
|
|
76
92
|
export default FlowGraphV2;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">import { useSvelteFlow } from '@xyflow/svelte';
|
|
2
2
|
import { untrack } from 'svelte';
|
|
3
|
-
|
|
3
|
+
import { NODE } from './util';
|
|
4
|
+
let { width, nodes, height } = $props();
|
|
4
5
|
const { setViewport, getViewport } = useSvelteFlow();
|
|
5
6
|
$effect(() => {
|
|
6
7
|
;
|
|
@@ -19,4 +20,35 @@ function onWidthChange(width) {
|
|
|
19
20
|
x: viewport.x + diff / 2
|
|
20
21
|
});
|
|
21
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Check if a node is fully visible in the current viewport with margin
|
|
25
|
+
* @param nodeId - The ID of the node to check
|
|
26
|
+
* @returns boolean - true if node is fully visible with 20px margin, false otherwise
|
|
27
|
+
*/
|
|
28
|
+
export function isNodeVisible(nodeId) {
|
|
29
|
+
const node = nodes.find((n) => n.id === nodeId);
|
|
30
|
+
const viewport = getViewport();
|
|
31
|
+
if (!node || !viewport)
|
|
32
|
+
return false;
|
|
33
|
+
const { x, y, zoom } = viewport;
|
|
34
|
+
const nodeX = node.position.x;
|
|
35
|
+
const nodeY = node.position.y;
|
|
36
|
+
// 20px margin scaled by zoom level
|
|
37
|
+
const margin = 20 / zoom;
|
|
38
|
+
// Calculate viewport bounds with margin
|
|
39
|
+
const viewportLeft = -x / zoom + margin;
|
|
40
|
+
const viewportTop = -y / zoom + margin;
|
|
41
|
+
const viewportRight = viewportLeft + width / zoom - 2 * margin;
|
|
42
|
+
const viewportBottom = viewportTop + height / zoom - 2 * margin;
|
|
43
|
+
// Calculate node bounds
|
|
44
|
+
const nodeLeft = nodeX;
|
|
45
|
+
const nodeTop = nodeY;
|
|
46
|
+
const nodeRight = nodeX + NODE.width;
|
|
47
|
+
const nodeBottom = nodeY + NODE.height;
|
|
48
|
+
// Node is visible only if it's completely within viewport bounds with margin
|
|
49
|
+
return (nodeLeft > viewportLeft &&
|
|
50
|
+
nodeRight < viewportRight &&
|
|
51
|
+
nodeTop > viewportTop &&
|
|
52
|
+
nodeBottom < viewportBottom);
|
|
53
|
+
}
|
|
22
54
|
</script>
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
declare const ViewportResizer: import("svelte").Component<{
|
|
2
2
|
width: any;
|
|
3
|
-
|
|
3
|
+
nodes: any;
|
|
4
|
+
height: any;
|
|
5
|
+
}, {
|
|
6
|
+
isNodeVisible: (nodeId: string) => boolean;
|
|
7
|
+
}, "">;
|
|
4
8
|
type ViewportResizer = ReturnType<typeof ViewportResizer>;
|
|
5
9
|
export default ViewportResizer;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { FlowModule, RawScript, Script } from '../../gen';
|
|
1
|
+
import type { FlowModule, Job, RawScript, Script } from '../../gen';
|
|
2
2
|
import { type Edge } from '@xyflow/svelte';
|
|
3
3
|
import type { GraphModuleState } from './model';
|
|
4
|
+
import type { Writable } from 'svelte/store';
|
|
4
5
|
export type InsertKind = 'script' | 'forloop' | 'whileloop' | 'branchone' | 'branchall' | 'flow' | 'trigger' | 'approval' | 'end';
|
|
5
6
|
export type InlineScript = {
|
|
6
7
|
language: RawScript['language'];
|
|
@@ -55,6 +56,10 @@ export type GraphEventHandlers = {
|
|
|
55
56
|
}) => void;
|
|
56
57
|
testUpTo: (id: string) => void;
|
|
57
58
|
editInput: (moduleId: string, key: string) => void;
|
|
59
|
+
testFlow: () => void;
|
|
60
|
+
cancelTestFlow: () => void;
|
|
61
|
+
openPreview: () => void;
|
|
62
|
+
hideJobStatus: () => void;
|
|
58
63
|
};
|
|
59
64
|
export type SimplifiableFlow = {
|
|
60
65
|
simplifiedFlow: boolean;
|
|
@@ -77,6 +82,11 @@ export type InputN = {
|
|
|
77
82
|
cache: boolean;
|
|
78
83
|
earlyStop: boolean;
|
|
79
84
|
editMode: boolean;
|
|
85
|
+
isRunning: boolean;
|
|
86
|
+
individualStepTests: boolean;
|
|
87
|
+
flowJob: Job | undefined;
|
|
88
|
+
showJobStatus: boolean;
|
|
89
|
+
flowHasChanged: boolean;
|
|
80
90
|
};
|
|
81
91
|
};
|
|
82
92
|
export type ModuleN = {
|
|
@@ -91,6 +101,8 @@ export type ModuleN = {
|
|
|
91
101
|
flowModuleStates: Record<string, GraphModuleState> | undefined;
|
|
92
102
|
insertable: boolean;
|
|
93
103
|
editMode: boolean;
|
|
104
|
+
flowJob: Job | undefined;
|
|
105
|
+
isOwner: boolean;
|
|
94
106
|
};
|
|
95
107
|
};
|
|
96
108
|
export type BranchAllStartN = {
|
|
@@ -143,6 +155,9 @@ export type ResultN = {
|
|
|
143
155
|
data: {
|
|
144
156
|
success: boolean | undefined;
|
|
145
157
|
eventHandlers: GraphEventHandlers;
|
|
158
|
+
editMode: boolean;
|
|
159
|
+
job: Job | undefined;
|
|
160
|
+
showJobStatus: boolean;
|
|
146
161
|
};
|
|
147
162
|
};
|
|
148
163
|
export type WhileLoopStartN = {
|
|
@@ -227,6 +242,16 @@ export declare function graphBuilder(modules: FlowModule[] | undefined, extra: {
|
|
|
227
242
|
cache: boolean;
|
|
228
243
|
earlyStop: boolean;
|
|
229
244
|
editMode: boolean;
|
|
245
|
+
isOwner: boolean;
|
|
246
|
+
isRunning: boolean;
|
|
247
|
+
individualStepTests: boolean;
|
|
248
|
+
flowJob: Job | undefined;
|
|
249
|
+
showJobStatus: boolean;
|
|
250
|
+
suspendStatus: Writable<Record<string, {
|
|
251
|
+
job: Job;
|
|
252
|
+
nb: number;
|
|
253
|
+
}>>;
|
|
254
|
+
flowHasChanged: boolean;
|
|
230
255
|
}, failureModule: FlowModule | undefined, preprocessorModule: FlowModule | undefined, eventHandlers: GraphEventHandlers, success: boolean | undefined, useDataflow: boolean | undefined, selectedId: string | undefined, moving: string | undefined, simplifiableFlow: SimplifiableFlow | undefined, flowPathForTriggerNode: string | undefined, expandedSubflows: Record<string, FlowModule[]>): {
|
|
231
256
|
nodes: NodeLayout[];
|
|
232
257
|
edges: Edge[];
|
|
@@ -57,7 +57,9 @@ export function graphBuilder(modules, extra, failureModule, preprocessorModule,
|
|
|
57
57
|
moving: moving,
|
|
58
58
|
flowModuleStates: extra.flowModuleStates,
|
|
59
59
|
insertable: extra.insertable,
|
|
60
|
-
editMode: extra.editMode
|
|
60
|
+
editMode: extra.editMode,
|
|
61
|
+
isOwner: extra.isOwner,
|
|
62
|
+
flowJob: extra.flowJob
|
|
61
63
|
},
|
|
62
64
|
type: 'module'
|
|
63
65
|
});
|
|
@@ -132,7 +134,12 @@ export function graphBuilder(modules, extra, failureModule, preprocessorModule,
|
|
|
132
134
|
disableAi: extra.disableAi,
|
|
133
135
|
cache: extra.cache,
|
|
134
136
|
earlyStop: extra.earlyStop,
|
|
135
|
-
editMode: extra.editMode
|
|
137
|
+
editMode: extra.editMode,
|
|
138
|
+
isRunning: extra.isRunning,
|
|
139
|
+
individualStepTests: extra.individualStepTests,
|
|
140
|
+
flowJob: extra.flowJob,
|
|
141
|
+
showJobStatus: extra.showJobStatus,
|
|
142
|
+
flowHasChanged: extra.flowHasChanged
|
|
136
143
|
}
|
|
137
144
|
};
|
|
138
145
|
let triggerNode = undefined;
|
|
@@ -165,7 +172,10 @@ export function graphBuilder(modules, extra, failureModule, preprocessorModule,
|
|
|
165
172
|
id: 'result',
|
|
166
173
|
data: {
|
|
167
174
|
eventHandlers: eventHandlers,
|
|
168
|
-
success: success
|
|
175
|
+
success: success,
|
|
176
|
+
editMode: extra.editMode,
|
|
177
|
+
job: extra.flowJob,
|
|
178
|
+
showJobStatus: extra.showJobStatus
|
|
169
179
|
},
|
|
170
180
|
type: 'result'
|
|
171
181
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
<script lang="ts">import InsertModuleButton from '../../../flows/map/InsertModuleButton.svelte';
|
|
2
2
|
import { getBezierPath, BaseEdge, EdgeLabel } from '@xyflow/svelte';
|
|
3
|
-
import { ClipboardCopy } from 'lucide-svelte';
|
|
3
|
+
import { ClipboardCopy, Hourglass } from 'lucide-svelte';
|
|
4
4
|
import { getContext } from 'svelte';
|
|
5
5
|
import { getStraightLinePath } from '../utils';
|
|
6
6
|
import { twMerge } from 'tailwind-merge';
|
|
7
|
+
import { workspaceStore } from '../../../../stores';
|
|
8
|
+
import FlowStatusWaitingForEvents from '../../../FlowStatusWaitingForEvents.svelte';
|
|
7
9
|
const { useDataflow } = getContext('FlowGraphContext');
|
|
8
10
|
let {
|
|
9
11
|
// id,
|
|
@@ -22,10 +24,15 @@ let [edgePath] = $derived(getBezierPath({
|
|
|
22
24
|
let completeEdge = $derived(targetY - sourceY > 100
|
|
23
25
|
? `${edgePath} ${getStraightLinePath({ sourceX, sourceY, targetY })}`
|
|
24
26
|
: edgePath);
|
|
27
|
+
// TODO: this is a hack to show the waiting for events indicator on the edge a proper way would be to have a edge state
|
|
28
|
+
// and handle the edge state in the graph builder
|
|
29
|
+
let waitingForEvents = $derived(data?.flowModuleStates?.[data.targetId]?.type === 'WaitingForEvents' ||
|
|
30
|
+
data?.flowModuleStates?.[`${data.sourceId}-v`]?.type === 'WaitingForEvents');
|
|
31
|
+
const suspendStatus = $derived(data?.suspendStatus);
|
|
25
32
|
</script>
|
|
26
33
|
|
|
27
34
|
<EdgeLabel x={sourceX} y={sourceY + 28} class="base-edge" style="">
|
|
28
|
-
{#if data?.insertable && !$useDataflow && !data?.moving}
|
|
35
|
+
{#if data?.insertable && !$useDataflow && !data?.moving && !waitingForEvents}
|
|
29
36
|
<div
|
|
30
37
|
class={twMerge('edgeButtonContainer nodrag nopan top-0')}
|
|
31
38
|
style:transform="translate(-50%, -50%)"
|
|
@@ -95,6 +102,42 @@ let completeEdge = $derived(targetY - sourceY > 100
|
|
|
95
102
|
{/if}
|
|
96
103
|
</div>
|
|
97
104
|
{/if}
|
|
105
|
+
|
|
106
|
+
{#if waitingForEvents && data.flowJob && data.flowJob.type === 'QueuedJob'}
|
|
107
|
+
<div
|
|
108
|
+
class="px-2 py-0.5 rounded-md bg-surface shadow-md text-violet-700 dark:text-violet-400 text-xs flex items-center gap-1"
|
|
109
|
+
>
|
|
110
|
+
<Hourglass size={12} />
|
|
111
|
+
<div class="flex">
|
|
112
|
+
<span class="dot">.</span>
|
|
113
|
+
<span class="dot">.</span>
|
|
114
|
+
<span class="dot">.</span>
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
<div
|
|
118
|
+
class={'fixed top-1/2 -translate-y-1/2 left-[170px] h-fit w-fit rounded-md bg-surface flex items-center justify-center p-2 ml-2 shadow-md'}
|
|
119
|
+
>
|
|
120
|
+
{#if data?.flowJob && data.flowJob.flow_status?.modules?.[data.flowJob.flow_status?.step]?.type === 'WaitingForEvents'}
|
|
121
|
+
<FlowStatusWaitingForEvents
|
|
122
|
+
job={data.flowJob}
|
|
123
|
+
workspaceId={$workspaceStore!}
|
|
124
|
+
isOwner={data.isOwner}
|
|
125
|
+
light
|
|
126
|
+
/>
|
|
127
|
+
{:else if $suspendStatus && Object.keys($suspendStatus).length > 0}
|
|
128
|
+
<div class="flex gap-2 flex-col">
|
|
129
|
+
{#each Object.values($suspendStatus) as suspendCount (suspendCount.job.id)}
|
|
130
|
+
<FlowStatusWaitingForEvents
|
|
131
|
+
job={suspendCount.job}
|
|
132
|
+
workspaceId={$workspaceStore!}
|
|
133
|
+
isOwner={data.isOwner}
|
|
134
|
+
light
|
|
135
|
+
/>
|
|
136
|
+
{/each}
|
|
137
|
+
</div>
|
|
138
|
+
{/if}
|
|
139
|
+
</div>
|
|
140
|
+
{/if}
|
|
98
141
|
</EdgeLabel>
|
|
99
142
|
|
|
100
143
|
<BaseEdge path={completeEdge} {markerEnd} class={$useDataflow ? 'hidden' : ''} />
|
|
@@ -106,4 +149,28 @@ let completeEdge = $derived(targetY - sourceY > 100
|
|
|
106
149
|
/* everything inside EdgeLabelRenderer has no pointer events by default */
|
|
107
150
|
/* if you have an interactive element, set pointer-events: all */
|
|
108
151
|
pointer-events: all;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.dot {
|
|
155
|
+
opacity: 0;
|
|
156
|
+
animation: dotFade 1.5s infinite;
|
|
157
|
+
letter-spacing: 1px;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.dot:nth-child(2) {
|
|
161
|
+
animation-delay: 0.5s;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.dot:nth-child(3) {
|
|
165
|
+
animation-delay: 1s;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
@keyframes dotFade {
|
|
169
|
+
0%,
|
|
170
|
+
100% {
|
|
171
|
+
opacity: 0;
|
|
172
|
+
}
|
|
173
|
+
50% {
|
|
174
|
+
opacity: 1;
|
|
175
|
+
}
|
|
109
176
|
}</style>
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { BaseEdge, type EdgeProps } from '@xyflow/svelte';
|
|
2
|
+
import type { Writable } from 'svelte/store';
|
|
2
3
|
import type { GraphEventHandlers } from '../../graphBuilder.svelte';
|
|
4
|
+
import type { Job } from '../../../../gen';
|
|
5
|
+
import type { GraphModuleState } from '../../model';
|
|
3
6
|
type $$ComponentProps = EdgeProps & {
|
|
4
7
|
data: {
|
|
5
8
|
insertable: boolean;
|
|
@@ -12,6 +15,13 @@ type $$ComponentProps = EdgeProps & {
|
|
|
12
15
|
enableTrigger: boolean;
|
|
13
16
|
disableAi: boolean;
|
|
14
17
|
disableMoveIds: string[];
|
|
18
|
+
flowModuleStates: Record<string, GraphModuleState> | undefined;
|
|
19
|
+
isOwner: boolean;
|
|
20
|
+
flowJob: Job | undefined;
|
|
21
|
+
suspendStatus?: Writable<Record<string, {
|
|
22
|
+
job: Job;
|
|
23
|
+
nb: number;
|
|
24
|
+
}>>;
|
|
15
25
|
};
|
|
16
26
|
};
|
|
17
27
|
declare const BaseEdge: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
@@ -54,11 +54,29 @@ let topFlowInput = $derived(flowStore?.val && previewArgs && flowStore?.val?.sch
|
|
|
54
54
|
}}
|
|
55
55
|
inputJson={topFlowInput}
|
|
56
56
|
prefix="flow_input"
|
|
57
|
-
|
|
57
|
+
nodeKind="input"
|
|
58
58
|
cache={data.cache}
|
|
59
59
|
earlyStop={data.earlyStop}
|
|
60
60
|
editMode={data.editMode}
|
|
61
61
|
onEditInput={data.eventHandlers.editInput}
|
|
62
|
+
onTestFlow={() => {
|
|
63
|
+
data.eventHandlers.testFlow()
|
|
64
|
+
}}
|
|
65
|
+
isRunning={data.isRunning}
|
|
66
|
+
onCancelTestFlow={() => {
|
|
67
|
+
data.eventHandlers.cancelTestFlow()
|
|
68
|
+
}}
|
|
69
|
+
onOpenPreview={() => {
|
|
70
|
+
data.eventHandlers.openPreview()
|
|
71
|
+
}}
|
|
72
|
+
onHideJobStatus={() => {
|
|
73
|
+
data.eventHandlers.hideJobStatus()
|
|
74
|
+
}}
|
|
75
|
+
individualStepTests={data.individualStepTests}
|
|
76
|
+
job={data.flowJob}
|
|
77
|
+
showJobStatus={data.showJobStatus}
|
|
78
|
+
flowHasChanged={data.flowHasChanged}
|
|
79
|
+
{darkMode}
|
|
62
80
|
/>
|
|
63
81
|
{/snippet}
|
|
64
82
|
</NodeWrapper>
|
|
@@ -53,8 +53,18 @@ let type = $derived.by(() => {
|
|
|
53
53
|
'/' +
|
|
54
54
|
(moduleState?.iteration_total ?? '?')
|
|
55
55
|
: ''}
|
|
56
|
-
bgColor={getStateColor(
|
|
57
|
-
|
|
56
|
+
bgColor={getStateColor(
|
|
57
|
+
data.editMode ? undefined : type,
|
|
58
|
+
darkMode,
|
|
59
|
+
true,
|
|
60
|
+
moduleState?.skipped
|
|
61
|
+
)}
|
|
62
|
+
bgHoverColor={getStateHoverColor(
|
|
63
|
+
data.editMode ? undefined : type,
|
|
64
|
+
darkMode,
|
|
65
|
+
true,
|
|
66
|
+
moduleState?.skipped
|
|
67
|
+
)}
|
|
58
68
|
moving={data.moving}
|
|
59
69
|
duration_ms={moduleState?.duration_ms}
|
|
60
70
|
retries={moduleState?.retries}
|
|
@@ -82,6 +92,11 @@ let type = $derived.by(() => {
|
|
|
82
92
|
data.eventHandlers.updateMock(detail)
|
|
83
93
|
}}
|
|
84
94
|
onEditInput={data.eventHandlers.editInput}
|
|
95
|
+
flowJob={data.flowJob}
|
|
96
|
+
isOwner={data.isOwner}
|
|
97
|
+
{type}
|
|
98
|
+
{darkMode}
|
|
99
|
+
skipped={moduleState?.skipped}
|
|
85
100
|
/>
|
|
86
101
|
|
|
87
102
|
<div class="absolute -bottom-10 left-1/2 transform -translate-x-1/2 z-10">
|
|
@@ -4,6 +4,7 @@ import { getStateColor, getStateHoverColor } from '../../util';
|
|
|
4
4
|
import { getContext } from 'svelte';
|
|
5
5
|
let { data } = $props();
|
|
6
6
|
const { selectedId } = getContext('FlowGraphContext');
|
|
7
|
+
const type = $derived(data.success == undefined ? undefined : data.success ? 'Success' : 'Failure');
|
|
7
8
|
</script>
|
|
8
9
|
|
|
9
10
|
<NodeWrapper enableSourceHandle={false}>
|
|
@@ -14,17 +15,17 @@ const { selectedId } = getContext('FlowGraphContext');
|
|
|
14
15
|
selectable={true}
|
|
15
16
|
selected={$selectedId === 'Result'}
|
|
16
17
|
hideId={true}
|
|
17
|
-
bgColor={getStateColor(
|
|
18
|
-
|
|
19
|
-
darkMode
|
|
20
|
-
)}
|
|
21
|
-
bgHoverColor={getStateHoverColor(
|
|
22
|
-
data.success == undefined ? undefined : data.success ? 'Success' : 'Failure',
|
|
23
|
-
darkMode
|
|
24
|
-
)}
|
|
18
|
+
bgColor={getStateColor(type, darkMode)}
|
|
19
|
+
bgHoverColor={getStateHoverColor(type, darkMode)}
|
|
25
20
|
on:select={(e) => {
|
|
26
21
|
setTimeout(() => data?.eventHandlers?.select(e.detail))
|
|
27
22
|
}}
|
|
23
|
+
nodeKind="result"
|
|
24
|
+
editMode={data.editMode}
|
|
25
|
+
job={data.job}
|
|
26
|
+
{type}
|
|
27
|
+
showJobStatus={data.showJobStatus}
|
|
28
|
+
{darkMode}
|
|
28
29
|
/>
|
|
29
30
|
{/snippet}
|
|
30
31
|
</NodeWrapper>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Job } from '../gen';
|
|
2
|
+
type moduleTestState = {
|
|
3
|
+
loading: boolean;
|
|
4
|
+
cancel?: () => Promise<void>;
|
|
5
|
+
testJob?: Job;
|
|
6
|
+
};
|
|
7
|
+
export declare class ModulesTestStates {
|
|
8
|
+
states: Record<string, moduleTestState>;
|
|
9
|
+
runTestCb?: (moduleId: string) => void;
|
|
10
|
+
constructor(runTestCb?: (moduleId: string) => void);
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
<script lang="ts">import { base } from '../../base';
|
|
2
2
|
import JobStatus from '../JobStatus.svelte';
|
|
3
3
|
import { ExternalLinkIcon } from 'lucide-svelte';
|
|
4
|
-
import { getContext } from 'svelte';
|
|
5
4
|
import { truncateRev } from '../../utils';
|
|
6
|
-
|
|
7
|
-
let { hideJobId } =
|
|
5
|
+
import { twMerge } from 'tailwind-merge';
|
|
6
|
+
let { job, hideJobId = false, extra } = $props();
|
|
8
7
|
</script>
|
|
9
8
|
|
|
10
|
-
<div
|
|
9
|
+
<div
|
|
10
|
+
class={twMerge(
|
|
11
|
+
'grid grid-cols-2 gap-4 mb-1 text-tertiary dark:text-gray-400',
|
|
12
|
+
extra && job && !hideJobId ? 'grid-cols-3' : 'grid-cols-2'
|
|
13
|
+
)}
|
|
14
|
+
>
|
|
11
15
|
<JobStatus {job} />
|
|
12
16
|
{#if job && !hideJobId}
|
|
13
17
|
<div>
|
|
@@ -24,4 +28,5 @@ let { hideJobId } = getContext('FlowStatusViewer');
|
|
|
24
28
|
</div>
|
|
25
29
|
</div>
|
|
26
30
|
{/if}
|
|
31
|
+
{@render extra?.()}
|
|
27
32
|
</div>
|
|
@@ -1,21 +1,9 @@
|
|
|
1
1
|
import type { CompletedJob, QueuedJob } from '../../gen';
|
|
2
|
-
interface
|
|
3
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
-
$$bindings?: Bindings;
|
|
5
|
-
} & Exports;
|
|
6
|
-
(internal: unknown, props: Props & {
|
|
7
|
-
$$events?: Events;
|
|
8
|
-
$$slots?: Slots;
|
|
9
|
-
}): Exports & {
|
|
10
|
-
$set?: any;
|
|
11
|
-
$on?: any;
|
|
12
|
-
};
|
|
13
|
-
z_$$bindings?: Bindings;
|
|
14
|
-
}
|
|
15
|
-
declare const FlowPreviewStatus: $$__sveltets_2_IsomorphicComponent<{
|
|
2
|
+
interface Props {
|
|
16
3
|
job: QueuedJob | CompletedJob;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
4
|
+
hideJobId?: boolean;
|
|
5
|
+
extra?: import('svelte').Snippet;
|
|
6
|
+
}
|
|
7
|
+
declare const FlowPreviewStatus: import("svelte").Component<Props, {}, "">;
|
|
8
|
+
type FlowPreviewStatus = ReturnType<typeof FlowPreviewStatus>;
|
|
21
9
|
export default FlowPreviewStatus;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
<script lang="ts">import EditableSchemaWrapper from './EditableSchemaWrapper.svelte';
|
|
2
2
|
let { schema: oldSchema, ...props } = $props();
|
|
3
3
|
let schema = $state(oldSchema);
|
|
4
|
+
$effect(() => {
|
|
5
|
+
schema = oldSchema;
|
|
6
|
+
});
|
|
4
7
|
</script>
|
|
5
8
|
|
|
6
9
|
<EditableSchemaWrapper {schema} {...props} />
|
|
@@ -163,6 +163,7 @@ async function onAiProviderChange(provider) {
|
|
|
163
163
|
<!-- this can be removed once the parent component moves to runes -->
|
|
164
164
|
<!-- svelte-ignore binding_property_non_reactive -->
|
|
165
165
|
<ResourcePicker
|
|
166
|
+
selectFirst
|
|
166
167
|
resourceType={provider === 'openai' && usingOpenaiClientCredentialsOauth
|
|
167
168
|
? 'openai_client_credentials_oauth'
|
|
168
169
|
: provider}
|
|
@@ -1630,9 +1630,6 @@ export declare const $AuditLog: {
|
|
|
1630
1630
|
readonly parameters: {
|
|
1631
1631
|
readonly type: "object";
|
|
1632
1632
|
};
|
|
1633
|
-
readonly span: {
|
|
1634
|
-
readonly type: "string";
|
|
1635
|
-
};
|
|
1636
1633
|
};
|
|
1637
1634
|
readonly required: readonly ["id", "timestamp", "username", "operation", "action_kind"];
|
|
1638
1635
|
};
|
package/package/utils.js
CHANGED
|
@@ -322,6 +322,8 @@ export function pointerDownOutside(node, options) {
|
|
|
322
322
|
event.stopPropagation();
|
|
323
323
|
}
|
|
324
324
|
node.dispatchEvent(new CustomEvent('pointerdown_outside', { detail: event }));
|
|
325
|
+
if (typeof options === 'object')
|
|
326
|
+
options.onClickOutside?.(event);
|
|
325
327
|
return false;
|
|
326
328
|
}
|
|
327
329
|
}
|
package/package.json
CHANGED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
interface Props {
|
|
2
|
-
loading?: boolean;
|
|
3
|
-
}
|
|
4
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
5
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
6
|
-
$$bindings?: Bindings;
|
|
7
|
-
} & Exports;
|
|
8
|
-
(internal: unknown, props: Props & {
|
|
9
|
-
$$events?: Events;
|
|
10
|
-
$$slots?: Slots;
|
|
11
|
-
}): Exports & {
|
|
12
|
-
$set?: any;
|
|
13
|
-
$on?: any;
|
|
14
|
-
};
|
|
15
|
-
z_$$bindings?: Bindings;
|
|
16
|
-
}
|
|
17
|
-
declare const FlowPreviewButtons: $$__sveltets_2_IsomorphicComponent<Props, {
|
|
18
|
-
openTriggers: CustomEvent<any>;
|
|
19
|
-
} & {
|
|
20
|
-
[evt: string]: CustomEvent<any>;
|
|
21
|
-
}, {}, {
|
|
22
|
-
openPreview: (test?: boolean) => Promise<void>;
|
|
23
|
-
testUpTo: () => void;
|
|
24
|
-
}, "">;
|
|
25
|
-
type FlowPreviewButtons = InstanceType<typeof FlowPreviewButtons>;
|
|
26
|
-
export default FlowPreviewButtons;
|