windmill-components 1.501.14 → 1.501.15
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 +0 -0
- package/package/components/AppWrapper.svelte.d.ts +26 -0
- package/package/components/EditorBar.svelte +1 -1
- package/package/components/FlowBuilder.svelte +2 -2
- package/package/components/FlowBuilder.svelte.d.ts +4 -60
- package/package/components/FlowWrapper.svelte +6 -0
- package/package/components/FlowWrapper.svelte.d.ts +4 -0
- package/package/components/InstanceSetting.svelte +2 -2
- package/package/components/ModulePreviewResultViewer.svelte +11 -21
- package/package/components/ModulePreviewResultViewer.svelte.d.ts +1 -1
- package/package/components/ModuleTest.svelte +4 -1
- package/package/components/ObjectStoreConfigSettings.svelte +49 -3
- package/package/components/ObjectStoreConfigSettings.svelte.d.ts +4 -0
- package/package/components/ScriptBuilder.svelte +3 -3
- package/package/components/ScriptBuilder.svelte.d.ts +4 -56
- package/package/components/ScriptWrapper.svelte +10 -0
- package/package/components/ScriptWrapper.svelte.d.ts +4 -0
- package/package/components/apps/editor/AppEditor.svelte.d.ts +2 -27
- package/package/components/apps/editor/AppEditorHeader.svelte +2 -2
- package/package/components/apps/editor/AppEditorHeader.svelte.d.ts +2 -2
- package/package/components/apps/types.d.ts +24 -0
- package/package/components/common/confirmationModal/DeployOverrideConfirmationModal.svelte +1 -6
- package/package/components/common/confirmationModal/DeployOverrideConfirmationModal.svelte.d.ts +6 -20
- package/package/components/copilot/chat/AIChatDisplay.svelte +51 -50
- package/package/components/copilot/chat/ContextTextarea.svelte +20 -16
- package/package/components/diff_drawer.d.ts +26 -0
- package/package/components/diff_drawer.js +1 -0
- package/package/components/flow_builder.d.ts +52 -0
- package/package/components/flow_builder.js +1 -0
- package/package/components/flows/content/FlowModuleComponent.svelte +5 -2
- package/package/components/flows/map/FlowModuleSchemaItem.svelte +57 -58
- package/package/components/flows/map/FlowModuleSchemaItem.svelte.d.ts +1 -0
- package/package/components/flows/map/MapItem.svelte +1 -0
- package/package/components/flows/propPicker/OutputPickerInner.svelte +23 -14
- package/package/components/flows/propPicker/OutputPickerInner.svelte.d.ts +2 -1
- package/package/components/raw_apps/RawAppEditorHeader.svelte +2 -2
- package/package/components/schema/EditableSchemaSdkWrapper.svelte +6 -0
- package/package/components/schema/EditableSchemaSdkWrapper.svelte.d.ts +3 -0
- package/package/components/schema/editable_schema_wrapper.d.ts +0 -0
- package/package/components/schema/editable_schema_wrapper.js +1 -0
- package/package/components/script_builder.d.ts +49 -0
- package/package/components/script_builder.js +1 -0
- package/package/components/workspaceSettings/StorageSettings.svelte +7 -3
- package/package/workspace_settings.d.ts +1 -1
- package/package/workspace_settings.js +13 -0
- package/package.json +25 -25
|
@@ -152,67 +152,68 @@ function restartGeneration(messageIndex) {
|
|
|
152
152
|
>
|
|
153
153
|
<div class="flex flex-col" bind:clientHeight={height}>
|
|
154
154
|
{#each messages as message, messageIndex}
|
|
155
|
-
{
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
<div
|
|
163
|
-
class={twMerge(
|
|
164
|
-
'text-sm py-1 mx-2',
|
|
165
|
-
message.role === 'user' &&
|
|
166
|
-
'px-2 border border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-900 rounded-lg mb-2 relative group',
|
|
167
|
-
message.role === 'user' && messageIndex > 0 && 'mt-6',
|
|
168
|
-
(message.role === 'assistant' || message.role === 'tool') && 'px-[1px]',
|
|
169
|
-
message.role === 'tool' && 'text-tertiary'
|
|
170
|
-
)}
|
|
171
|
-
>
|
|
172
|
-
{#if message.role === 'assistant'}
|
|
173
|
-
<AssistantMessage {message} />
|
|
174
|
-
{:else}
|
|
175
|
-
{message.content}
|
|
155
|
+
<div class={twMerge(message.role === 'user' && messageIndex > 0 && 'mt-6', 'mb-2')}>
|
|
156
|
+
{#if message.role === 'user' && message.contextElements}
|
|
157
|
+
<div class="flex flex-row gap-1 mb-1 overflow-scroll no-scrollbar px-2">
|
|
158
|
+
{#each message.contextElements as element}
|
|
159
|
+
<ContextElementBadge contextElement={element} />
|
|
160
|
+
{/each}
|
|
161
|
+
</div>
|
|
176
162
|
{/if}
|
|
163
|
+
<div
|
|
164
|
+
class={twMerge(
|
|
165
|
+
'text-sm py-1 mx-2',
|
|
166
|
+
message.role === 'user' &&
|
|
167
|
+
'px-2 border border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-900 rounded-lg relative group',
|
|
168
|
+
(message.role === 'assistant' || message.role === 'tool') && 'px-[1px]',
|
|
169
|
+
message.role === 'tool' && 'text-tertiary'
|
|
170
|
+
)}
|
|
171
|
+
>
|
|
172
|
+
{#if message.role === 'assistant'}
|
|
173
|
+
<AssistantMessage {message} />
|
|
174
|
+
{:else}
|
|
175
|
+
{message.content}
|
|
176
|
+
{/if}
|
|
177
177
|
|
|
178
|
-
|
|
178
|
+
{#if message.role === 'user' && isLastUserMessage(messageIndex) && !aiChatManager.loading}
|
|
179
|
+
<div
|
|
180
|
+
class="absolute top-1 right-1 opacity-0 group-hover:opacity-100 transition-opacity"
|
|
181
|
+
>
|
|
182
|
+
<Button
|
|
183
|
+
size="xs2"
|
|
184
|
+
variant="border"
|
|
185
|
+
color="light"
|
|
186
|
+
iconOnly
|
|
187
|
+
title="Restart generation"
|
|
188
|
+
startIcon={{ icon: RefreshCwIcon }}
|
|
189
|
+
btnClasses="!p-1 !h-6 !w-6"
|
|
190
|
+
on:click={() => restartGeneration(messageIndex)}
|
|
191
|
+
/>
|
|
192
|
+
</div>
|
|
193
|
+
{/if}
|
|
194
|
+
</div>
|
|
195
|
+
{#if message.role === 'user' && message.snapshot}
|
|
179
196
|
<div
|
|
180
|
-
class="
|
|
197
|
+
class="mx-2 text-sm text-tertiary flex flex-row items-center justify-between gap-2 mt-2"
|
|
181
198
|
>
|
|
199
|
+
Saved a flow snapshot
|
|
182
200
|
<Button
|
|
183
201
|
size="xs2"
|
|
184
202
|
variant="border"
|
|
185
203
|
color="light"
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
204
|
+
on:click={() => {
|
|
205
|
+
if (message.snapshot) {
|
|
206
|
+
aiChatManager.flowAiChatHelpers?.revertToSnapshot(message.snapshot)
|
|
207
|
+
}
|
|
208
|
+
}}
|
|
209
|
+
title="Revert to snapshot"
|
|
210
|
+
startIcon={{ icon: Undo2Icon }}
|
|
211
|
+
>
|
|
212
|
+
Revert
|
|
213
|
+
</Button>
|
|
192
214
|
</div>
|
|
193
215
|
{/if}
|
|
194
216
|
</div>
|
|
195
|
-
{#if message.role === 'user' && message.snapshot}
|
|
196
|
-
<div
|
|
197
|
-
class="mx-2 text-sm text-tertiary flex flex-row items-center justify-between gap-2 mb-2"
|
|
198
|
-
>
|
|
199
|
-
Saved a flow snapshot
|
|
200
|
-
<Button
|
|
201
|
-
size="xs2"
|
|
202
|
-
variant="border"
|
|
203
|
-
color="light"
|
|
204
|
-
on:click={() => {
|
|
205
|
-
if (message.snapshot) {
|
|
206
|
-
aiChatManager.flowAiChatHelpers?.revertToSnapshot(message.snapshot)
|
|
207
|
-
}
|
|
208
|
-
}}
|
|
209
|
-
title="Revert to snapshot"
|
|
210
|
-
startIcon={{ icon: Undo2Icon }}
|
|
211
|
-
>
|
|
212
|
-
Revert
|
|
213
|
-
</Button>
|
|
214
|
-
</div>
|
|
215
|
-
{/if}
|
|
216
217
|
{/each}
|
|
217
218
|
{#if aiChatManager.loading && !aiChatManager.currentReply}
|
|
218
219
|
<div class="mb-6 py-1 px-2">
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
import { tick } from 'svelte';
|
|
3
3
|
import AvailableContextList from './AvailableContextList.svelte';
|
|
4
4
|
import { aiChatManager } from './AIChatManager.svelte';
|
|
5
|
+
import Portal from '../../Portal.svelte';
|
|
6
|
+
import { zIndexes } from '../../../zIndexes';
|
|
5
7
|
const { availableContext, selectedContext, isFirstMessage, disabled, onUpdateInstructions, onSendRequest, onAddContext } = $props();
|
|
6
8
|
let showContextTooltip = $state(false);
|
|
7
9
|
let contextTooltipWord = $state('');
|
|
@@ -296,22 +298,24 @@ export function focus() {
|
|
|
296
298
|
</div>
|
|
297
299
|
|
|
298
300
|
{#if showContextTooltip}
|
|
299
|
-
<
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
301
|
+
<Portal target="body">
|
|
302
|
+
<div
|
|
303
|
+
bind:this={tooltipElement}
|
|
304
|
+
class="absolute bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md shadow-lg"
|
|
305
|
+
style="left: {tooltipPosition.x}px; top: {tooltipPosition.y}px; z-index: {zIndexes.tooltip};"
|
|
306
|
+
>
|
|
307
|
+
<AvailableContextList
|
|
308
|
+
{availableContext}
|
|
309
|
+
{selectedContext}
|
|
310
|
+
onSelect={(element) => {
|
|
311
|
+
handleContextSelection(element)
|
|
312
|
+
}}
|
|
313
|
+
showAllAvailable={true}
|
|
314
|
+
stringSearch={contextTooltipWord.slice(1)}
|
|
315
|
+
selectedIndex={selectedSuggestionIndex}
|
|
316
|
+
/>
|
|
317
|
+
</div>
|
|
318
|
+
</Portal>
|
|
315
319
|
{/if}
|
|
316
320
|
|
|
317
321
|
<style>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Value } from "../utils";
|
|
2
|
+
export type DiffDrawerDiff = {
|
|
3
|
+
mode: 'normal';
|
|
4
|
+
deployed: Value;
|
|
5
|
+
draft: Value | undefined;
|
|
6
|
+
current: Value;
|
|
7
|
+
defaultDiffType?: 'deployed' | 'draft';
|
|
8
|
+
button?: {
|
|
9
|
+
text: string;
|
|
10
|
+
onClick: () => void;
|
|
11
|
+
};
|
|
12
|
+
} | {
|
|
13
|
+
mode: 'simple';
|
|
14
|
+
original: Value;
|
|
15
|
+
current: Value;
|
|
16
|
+
title: string;
|
|
17
|
+
button?: {
|
|
18
|
+
text: string;
|
|
19
|
+
onClick: () => void;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export interface DiffDrawerI {
|
|
23
|
+
openDrawer: () => void;
|
|
24
|
+
closeDrawer: () => void;
|
|
25
|
+
setDiff: (diff: DiffDrawerDiff) => void;
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export type FlowBuilderProps = {
|
|
2
|
+
initialPath?: string;
|
|
3
|
+
pathStoreInit?: string | undefined;
|
|
4
|
+
newFlow: boolean;
|
|
5
|
+
selectedId: string | undefined;
|
|
6
|
+
initialArgs?: Record<string, any>;
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
flowStore: StateStore<OpenFlow>;
|
|
9
|
+
flowStateStore: Writable<FlowState>;
|
|
10
|
+
savedFlow?: FlowWithDraftAndDraftTriggers | undefined;
|
|
11
|
+
diffDrawer?: DiffDrawer | undefined;
|
|
12
|
+
customUi?: FlowBuilderWhitelabelCustomUi;
|
|
13
|
+
disableAi?: boolean;
|
|
14
|
+
disabledFlowInputs?: boolean;
|
|
15
|
+
savedPrimarySchedule?: ScheduleTrigger | undefined;
|
|
16
|
+
version?: number | undefined;
|
|
17
|
+
setSavedraftCb?: ((cb: () => void) => void) | undefined;
|
|
18
|
+
draftTriggersFromUrl?: Trigger[] | undefined;
|
|
19
|
+
selectedTriggerIndexFromUrl?: number | undefined;
|
|
20
|
+
children?: import('svelte').Snippet;
|
|
21
|
+
loadedFromHistoryFromUrl?: {
|
|
22
|
+
flowJobInitial: boolean | undefined;
|
|
23
|
+
stepsState: Record<string, stepState>;
|
|
24
|
+
};
|
|
25
|
+
noInitial?: boolean;
|
|
26
|
+
onSaveInitial?: ({ path, id }: {
|
|
27
|
+
path: string;
|
|
28
|
+
id: string;
|
|
29
|
+
}) => void;
|
|
30
|
+
onSaveDraft?: ({ path, savedAtNewPath, newFlow }: {
|
|
31
|
+
path: string;
|
|
32
|
+
savedAtNewPath: boolean;
|
|
33
|
+
newFlow: boolean;
|
|
34
|
+
}) => void;
|
|
35
|
+
onSaveDraftError?: ({ error }: {
|
|
36
|
+
error: any;
|
|
37
|
+
}) => void;
|
|
38
|
+
onSaveDraftOnlyAtNewPath?: ({ path, selectedId }: {
|
|
39
|
+
path: string;
|
|
40
|
+
selectedId: string;
|
|
41
|
+
}) => void;
|
|
42
|
+
onDeploy?: ({ path }: {
|
|
43
|
+
path: string;
|
|
44
|
+
}) => void;
|
|
45
|
+
onDeployError?: ({ error }: {
|
|
46
|
+
error: any;
|
|
47
|
+
}) => void;
|
|
48
|
+
onDetails?: ({ path }: {
|
|
49
|
+
path: string;
|
|
50
|
+
}) => void;
|
|
51
|
+
onHistoryRestore?: () => void;
|
|
52
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -176,7 +176,10 @@ $effect(() => {
|
|
|
176
176
|
$selectedId && untrack(() => onSelectedIdChange());
|
|
177
177
|
});
|
|
178
178
|
$effect(() => {
|
|
179
|
-
if (
|
|
179
|
+
if (testJob && testJob.type === 'CompletedJob') {
|
|
180
|
+
lastJob = $state.snapshot(testJob);
|
|
181
|
+
}
|
|
182
|
+
else if ($workspaceStore && $pathStore && flowModule?.id && $flowStateStore) {
|
|
180
183
|
untrack(() => getLastJob());
|
|
181
184
|
}
|
|
182
185
|
});
|
|
@@ -781,7 +784,7 @@ $effect(() => {
|
|
|
781
784
|
{testIsLoading}
|
|
782
785
|
disableMock={preprocessorModule || failureModule}
|
|
783
786
|
disableHistory={failureModule}
|
|
784
|
-
|
|
787
|
+
loadingJob={stepHistoryLoader?.stepStates[flowModule.id]?.loadingJobs}
|
|
785
788
|
/>
|
|
786
789
|
</Pane>
|
|
787
790
|
{/if}
|
|
@@ -20,7 +20,7 @@ import { Button } from '../../common';
|
|
|
20
20
|
import ModuleTest from '../../ModuleTest.svelte';
|
|
21
21
|
import { getStepHistoryLoaderContext } from '../../stepHistoryLoader.svelte';
|
|
22
22
|
import { aiModuleActionToBgColor } from '../../copilot/chat/flow/utils';
|
|
23
|
-
let { selected = false, deletable = false, retry = false, cache = false, earlyStop = false, skip = false, suspend = false, sleep = false, mock = { enabled: false }, bold = false, id = undefined, label, path = '', modType = undefined, bgColor = '', bgHoverColor = '', concurrency = false, retries = undefined, warningMessage = undefined, isTrigger = false, editMode = false, alwaysShowOutputPicker = false, loopStatus = undefined, icon, onTestUpTo, inputTransform, onUpdateMock, onEditInput } = $props();
|
|
23
|
+
let { selected = false, deletable = false, retry = false, cache = false, earlyStop = false, skip = false, suspend = false, sleep = false, mock = { enabled: false }, bold = false, id = undefined, label, path = '', modType = undefined, bgColor = '', bgHoverColor = '', concurrency = false, retries = undefined, warningMessage = undefined, isTrigger = false, editMode = false, alwaysShowOutputPicker = false, loopStatus = undefined, icon, onTestUpTo, inputTransform, onUpdateMock, onEditInput, enableTestRun = false } = $props();
|
|
24
24
|
let pickableIds = $state(undefined);
|
|
25
25
|
const flowEditorContext = getContext('FlowEditorContext');
|
|
26
26
|
const flowInputsStore = flowEditorContext?.flowInputsStore;
|
|
@@ -69,16 +69,12 @@ function updateLastJob(flowStateStore) {
|
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
71
|
$effect(() => {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
let nlastJob = $derived.by(() => {
|
|
75
|
-
if (testJob) {
|
|
76
|
-
return { ...testJob, preview: true };
|
|
72
|
+
if (testJob && testJob.type === 'CompletedJob') {
|
|
73
|
+
lastJob = $state.snapshot(testJob);
|
|
77
74
|
}
|
|
78
|
-
if (
|
|
79
|
-
|
|
75
|
+
else if (flowStateStore && $flowStateStore) {
|
|
76
|
+
untrack(() => updateLastJob($flowStateStore));
|
|
80
77
|
}
|
|
81
|
-
return undefined;
|
|
82
78
|
});
|
|
83
79
|
let isConnectingCandidate = $derived(!!id && !!$flowPropPickerConfig && !!pickableIds && Object.keys(pickableIds).includes(id));
|
|
84
80
|
const outputPickerVisible = $derived(editMode && (isConnectingCandidate || alwaysShowOutputPicker) && !!id);
|
|
@@ -329,7 +325,8 @@ const action = $derived(getAiModuleAction(id));
|
|
|
329
325
|
prefix={'results'}
|
|
330
326
|
connectingData={isConnecting ? connectingData : undefined}
|
|
331
327
|
{mock}
|
|
332
|
-
lastJob
|
|
328
|
+
{lastJob}
|
|
329
|
+
{testJob}
|
|
333
330
|
moduleId={id}
|
|
334
331
|
onSelect={selectConnection}
|
|
335
332
|
{onUpdateMock}
|
|
@@ -349,56 +346,58 @@ const action = $derived(getAiModuleAction(id));
|
|
|
349
346
|
</div>
|
|
350
347
|
|
|
351
348
|
{#if deletable && !action}
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
{
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
{
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
349
|
+
{#if enableTestRun}
|
|
350
|
+
<div
|
|
351
|
+
class="absolute top-1/2 -translate-y-1/2 -translate-x-[100%] -left-[0] flex items-center w-fit px-2 h-9 min-w-14"
|
|
352
|
+
>
|
|
353
|
+
{#if (hover || selected) && outputPickerVisible}
|
|
354
|
+
<div transition:fade={{ duration: 100 }}>
|
|
355
|
+
{#if !testIsLoading}
|
|
356
|
+
<Button
|
|
357
|
+
size="sm"
|
|
358
|
+
color="dark"
|
|
359
|
+
title="Run"
|
|
360
|
+
btnClasses="p-1.5"
|
|
361
|
+
on:click={() => {
|
|
362
|
+
outputPicker?.toggleOpen(true)
|
|
363
|
+
moduleTest?.loadArgsAndRunTest()
|
|
364
|
+
}}
|
|
365
|
+
dropdownItems={[
|
|
366
|
+
{
|
|
367
|
+
label: 'Test up to here',
|
|
368
|
+
onClick: () => {
|
|
369
|
+
if (id) {
|
|
370
|
+
onTestUpTo?.(id)
|
|
371
|
+
}
|
|
373
372
|
}
|
|
374
373
|
}
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
374
|
+
]}
|
|
375
|
+
dropdownBtnClasses="!w-4 px-1"
|
|
376
|
+
>
|
|
377
|
+
{#if testIsLoading}
|
|
378
|
+
<Loader2 size={12} class="animate-spin" />
|
|
379
|
+
{:else}
|
|
380
|
+
<Play size={12} />
|
|
381
|
+
{/if}
|
|
382
|
+
</Button>
|
|
383
|
+
{:else}
|
|
384
|
+
<Button
|
|
385
|
+
size="xs"
|
|
386
|
+
color="red"
|
|
387
|
+
variant="contained"
|
|
388
|
+
btnClasses="!h-[25.5px] !w-[44.5px] !p-1.5 gap-0.5"
|
|
389
|
+
on:click={async () => {
|
|
390
|
+
moduleTest?.cancelJob()
|
|
391
|
+
}}
|
|
392
|
+
>
|
|
393
|
+
<Loader2 size={10} class="animate-spin mr-0.5" />
|
|
394
|
+
<X size={14} />
|
|
395
|
+
</Button>
|
|
396
|
+
{/if}
|
|
397
|
+
</div>
|
|
398
|
+
{/if}
|
|
399
|
+
</div>
|
|
400
|
+
{/if}
|
|
402
401
|
<button
|
|
403
402
|
class="absolute -top-[10px] -right-[10px] rounded-full h-[20px] w-[20px] trash center-center text-secondary
|
|
404
403
|
outline-[1px] outline dark:outline-gray-500 outline-gray-300 bg-surface duration-0 hover:bg-red-400 hover:text-white
|
|
@@ -36,6 +36,7 @@ interface Props {
|
|
|
36
36
|
return_value?: unknown;
|
|
37
37
|
}) => void;
|
|
38
38
|
onEditInput?: (moduleId: string, key: string) => void;
|
|
39
|
+
enableTestRun?: boolean;
|
|
39
40
|
}
|
|
40
41
|
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> {
|
|
41
42
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
@@ -178,6 +178,7 @@ let parentLoop = $derived(flowStore?.val && mod ? checkIfParentLoop(flowStore.va
|
|
|
178
178
|
inputTransform={mod.value.type !== 'identity' ? mod.value.input_transforms : undefined}
|
|
179
179
|
{onTestUpTo}
|
|
180
180
|
{onEditInput}
|
|
181
|
+
enableTestRun
|
|
181
182
|
>
|
|
182
183
|
{#snippet icon()}
|
|
183
184
|
<div>
|
|
@@ -27,7 +27,7 @@ import { twMerge } from 'tailwind-merge';
|
|
|
27
27
|
import DisplayResultControlBar from '../../DisplayResultControlBar.svelte';
|
|
28
28
|
import { base } from '../../../base';
|
|
29
29
|
import { fade } from 'svelte/transition';
|
|
30
|
-
let { lastJob = undefined, prefix = '', allowCopy = false, connectingData = undefined, mock = $bindable({ enabled: false }), moduleId = '', fullResult = false, closeOnOutsideClick = false, getLogs = false, selectedJob = $bindable(undefined), forceJson = $bindable(false), isLoading = $bindable(false), preview = $bindable(undefined), hideHeaderBar = false, simpleViewer = undefined, path = '', loopStatus = undefined, customHeight = undefined, rightMargin = false, disableMock = false, disableHistory = false, derivedHistoryOpen = $bindable(false), historyOffset = { mainAxis: 8, crossAxis: -4.5 }, clazz, copilot_fix, onSelect, onUpdateMock, onEditInput, selectionId, initial } = $props();
|
|
30
|
+
let { lastJob = undefined, testJob = undefined, prefix = '', allowCopy = false, connectingData = undefined, mock = $bindable({ enabled: false }), moduleId = '', fullResult = false, closeOnOutsideClick = false, getLogs = false, selectedJob = $bindable(undefined), forceJson = $bindable(false), isLoading = $bindable(false), preview = $bindable(undefined), hideHeaderBar = false, simpleViewer = undefined, path = '', loopStatus = undefined, customHeight = undefined, rightMargin = false, disableMock = false, disableHistory = false, derivedHistoryOpen = $bindable(false), historyOffset = { mainAxis: 8, crossAxis: -4.5 }, clazz, copilot_fix, onSelect, onUpdateMock, onEditInput, selectionId, initial } = $props();
|
|
31
31
|
let jsonView = $state(false);
|
|
32
32
|
let clientHeight = $state(0);
|
|
33
33
|
let tmpMock = $state(undefined);
|
|
@@ -41,25 +41,25 @@ function checkOverflow() {
|
|
|
41
41
|
hasOverflow = contentEl.scrollHeight > contentEl.clientHeight;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
function selectJob(
|
|
45
|
-
if (
|
|
46
|
-
selectedJob =
|
|
44
|
+
function selectJob(nJob) {
|
|
45
|
+
if (nJob && 'result' in nJob) {
|
|
46
|
+
selectedJob = nJob;
|
|
47
47
|
}
|
|
48
|
-
else if (
|
|
49
|
-
selectedJob =
|
|
48
|
+
else if (job && 'result' in job) {
|
|
49
|
+
selectedJob = job;
|
|
50
50
|
}
|
|
51
51
|
else {
|
|
52
52
|
selectedJob = undefined;
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
$effect(() => {
|
|
56
|
-
if (!
|
|
56
|
+
if (!job || !('result' in job)) {
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
|
-
selectJob(
|
|
60
|
-
if (
|
|
59
|
+
selectJob(job);
|
|
60
|
+
if (job.preview && mock?.enabled) {
|
|
61
61
|
preview = 'job';
|
|
62
|
-
|
|
62
|
+
job.preview = false;
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
65
|
function togglePreview(nPrev) {
|
|
@@ -159,6 +159,15 @@ $effect(() => {
|
|
|
159
159
|
untrack(() => updateCanEditWithDblClick(newValue));
|
|
160
160
|
}
|
|
161
161
|
});
|
|
162
|
+
let job = $derived.by(() => {
|
|
163
|
+
if (testJob) {
|
|
164
|
+
return { ...testJob, preview: testJob.type === 'CompletedJob' };
|
|
165
|
+
}
|
|
166
|
+
if (lastJob) {
|
|
167
|
+
return { ...lastJob, preview: false };
|
|
168
|
+
}
|
|
169
|
+
return undefined;
|
|
170
|
+
});
|
|
162
171
|
let popoverHeight = $derived(customHeight ?? (clientHeight > 0 ? clientHeight : 0));
|
|
163
172
|
const isLoadingAndNotMock = $derived(isLoading && !mock?.enabled);
|
|
164
173
|
const copilot_fix_render = $derived(copilot_fix);
|
|
@@ -227,7 +236,7 @@ const copilot_fix_render = $derived(copilot_fix);
|
|
|
227
236
|
togglePreview('mock')
|
|
228
237
|
return
|
|
229
238
|
}
|
|
230
|
-
if (detail.id ===
|
|
239
|
+
if (detail.id === job?.id && !mock?.enabled) {
|
|
231
240
|
togglePreview(undefined)
|
|
232
241
|
return
|
|
233
242
|
}
|
|
@@ -266,7 +275,7 @@ const copilot_fix_render = $derived(copilot_fix);
|
|
|
266
275
|
<div
|
|
267
276
|
class={twMerge(
|
|
268
277
|
'w-grow min-w-0 flex gap-1 items-center h-[27px] rounded-md group',
|
|
269
|
-
preview || selectedJob?.id !==
|
|
278
|
+
preview || selectedJob?.id !== job?.id ? 'p-[2px] bg-surface-secondary' : ''
|
|
270
279
|
)}
|
|
271
280
|
>
|
|
272
281
|
{#if loopStatus?.type === 'self'}
|
|
@@ -302,7 +311,7 @@ const copilot_fix_render = $derived(copilot_fix);
|
|
|
302
311
|
job={selectedJob}
|
|
303
312
|
class={twMerge(
|
|
304
313
|
'min-w-16 text-secondary',
|
|
305
|
-
preview || selectedJob?.id !==
|
|
314
|
+
preview || selectedJob?.id !== job?.id ? 'bg-surface shadow-sm h-[23px]' : ''
|
|
306
315
|
)}
|
|
307
316
|
/>
|
|
308
317
|
{/if}
|
|
@@ -589,7 +598,7 @@ const copilot_fix_render = $derived(copilot_fix);
|
|
|
589
598
|
pureViewer={false}
|
|
590
599
|
/>
|
|
591
600
|
{/if}
|
|
592
|
-
{:else if !
|
|
601
|
+
{:else if !job}
|
|
593
602
|
<div class="flex flex-col items-center justify-center h-full">
|
|
594
603
|
<p class="text-xs text-secondary">
|
|
595
604
|
Test this step to see results{#if !disableMock}
|
|
@@ -574,8 +574,8 @@ function getInitialAndModifiedValues() {
|
|
|
574
574
|
<UnsavedConfirmationModal {diffDrawer} {getInitialAndModifiedValues} />
|
|
575
575
|
|
|
576
576
|
<DeployOverrideConfirmationModal
|
|
577
|
-
|
|
578
|
-
|
|
577
|
+
{deployedBy}
|
|
578
|
+
{confirmCallback}
|
|
579
579
|
bind:open
|
|
580
580
|
{diffDrawer}
|
|
581
581
|
bind:deployedValue
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export interface ScriptBuilderProps {
|
|
2
|
+
script: NewScript & {
|
|
3
|
+
draft_triggers?: Trigger[];
|
|
4
|
+
};
|
|
5
|
+
fullyLoaded?: boolean;
|
|
6
|
+
initialPath?: string;
|
|
7
|
+
template?: 'docker' | 'bunnative' | 'script';
|
|
8
|
+
initialArgs?: Record<string, any>;
|
|
9
|
+
lockedLanguage?: boolean;
|
|
10
|
+
showMeta?: boolean;
|
|
11
|
+
neverShowMeta?: boolean;
|
|
12
|
+
diffDrawer?: DiffDrawer | undefined;
|
|
13
|
+
savedScript?: NewScriptWithDraftAndDraftTriggers | undefined;
|
|
14
|
+
searchParams?: URLSearchParams;
|
|
15
|
+
disableHistoryChange?: boolean;
|
|
16
|
+
replaceStateFn?: (url: string) => void;
|
|
17
|
+
customUi?: ScriptBuilderWhitelabelCustomUi;
|
|
18
|
+
savedPrimarySchedule?: ScheduleTrigger | undefined;
|
|
19
|
+
functionExports?: ((exports: ScriptBuilderFunctionExports) => void) | undefined;
|
|
20
|
+
children?: import('svelte').Snippet;
|
|
21
|
+
onDeploy?: (e: {
|
|
22
|
+
path: string;
|
|
23
|
+
hash: string;
|
|
24
|
+
}) => void;
|
|
25
|
+
onDeployError?: (e: {
|
|
26
|
+
path: string;
|
|
27
|
+
error: any;
|
|
28
|
+
}) => void;
|
|
29
|
+
onSaveInitial?: (e: {
|
|
30
|
+
path: string;
|
|
31
|
+
hash: string;
|
|
32
|
+
}) => void;
|
|
33
|
+
onHistoryRestore?: () => void;
|
|
34
|
+
onSaveDraftOnlyAtNewPath?: (e: {
|
|
35
|
+
path: string;
|
|
36
|
+
}) => void;
|
|
37
|
+
onSaveDraft?: (e: {
|
|
38
|
+
path: string;
|
|
39
|
+
savedAtNewPath: boolean;
|
|
40
|
+
script: NewScript;
|
|
41
|
+
}) => void;
|
|
42
|
+
onSeeDetails?: (e: {
|
|
43
|
+
path: string;
|
|
44
|
+
}) => void;
|
|
45
|
+
onSaveDraftError?: (e: {
|
|
46
|
+
path: string;
|
|
47
|
+
error: any;
|
|
48
|
+
}) => void;
|
|
49
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|