windmill-components 1.34.0 → 1.35.42
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/components/AppConnect.svelte +1 -1
- package/components/ArgInput.svelte +2 -2
- package/components/ArgInput.svelte.d.ts +2 -2
- package/components/CenteredPage.svelte +2 -2
- package/components/Editor.svelte +7 -82
- package/components/Editor.svelte.d.ts +0 -2
- package/components/EditorBar.svelte +45 -39
- package/components/FlowBuilder.svelte +4 -4
- package/components/FlowJobResult.svelte +17 -18
- package/components/FlowModulesViewer.svelte +97 -0
- package/components/FlowModulesViewer.svelte.d.ts +17 -0
- package/components/FlowPreview.svelte +35 -34
- package/components/FlowPreviewContent.svelte +4 -1
- package/components/FlowStatusViewer.svelte +31 -49
- package/components/FlowViewer.svelte +60 -159
- package/components/FlowViewer.svelte.d.ts +0 -1
- package/components/IconedResourceType.svelte +3 -3
- package/components/InputTransformForm.svelte +2 -2
- package/components/ModuleStep.svelte +1 -1
- package/components/Multiselect.svelte +1 -1
- package/components/SchemaEditor.svelte +2 -2
- package/components/SchemaViewer.svelte +58 -68
- package/components/ScriptBuilder.svelte +118 -132
- package/components/ScriptEditor.svelte +115 -338
- package/components/ScriptEditor.svelte.d.ts +0 -2
- package/components/ScriptSchema.svelte +45 -44
- package/components/SharedBadge.svelte +1 -1
- package/components/SimpleEditor.svelte +143 -0
- package/components/SimpleEditor.svelte.d.ts +35 -0
- package/components/{Drawer.svelte → common/drawer/Drawer.svelte} +0 -0
- package/components/{Drawer.svelte.d.ts → common/drawer/Drawer.svelte.d.ts} +0 -0
- package/components/common/drawer/DrawerContent.svelte +19 -0
- package/components/common/drawer/DrawerContent.svelte.d.ts +20 -0
- package/components/common/menu/Menu.svelte +57 -0
- package/components/common/menu/Menu.svelte.d.ts +23 -0
- package/components/common/menu/MenuItem.svelte +9 -0
- package/components/common/menu/MenuItem.svelte.d.ts +27 -0
- package/components/common/tabs/Tab.svelte +17 -0
- package/components/{tabs → common/tabs}/Tab.svelte.d.ts +1 -2
- package/components/common/tabs/TabContent.svelte +12 -0
- package/components/common/tabs/TabContent.svelte.d.ts +19 -0
- package/components/common/tabs/Tabs.svelte +20 -0
- package/components/common/tabs/Tabs.svelte.d.ts +24 -0
- package/components/flows/FlowModuleHeader.svelte +1 -2
- package/components/flows/FlowSettings.svelte +41 -37
- package/components/flows/flowState.js +2 -2
- package/components/flows/flowStateUtils.js +7 -9
- package/components/flows/flowStore.js +24 -0
- package/components/flows/utils.d.ts +1 -1
- package/components/flows/utils.js +9 -9
- package/components/icons/GithubIcon.svelte +17 -0
- package/components/icons/GithubIcon.svelte.d.ts +17 -0
- package/components/jobs/JobDetail.svelte +176 -0
- package/components/jobs/JobDetail.svelte.d.ts +17 -0
- package/components/landing/FlowGettingStarted.svelte +95 -0
- package/components/landing/FlowGettingStarted.svelte.d.ts +19 -0
- package/components/landing/FlowLandingBox.svelte +69 -0
- package/components/landing/FlowLandingBox.svelte.d.ts +17 -0
- package/components/landing/RessourceGettingStarted.svelte +51 -0
- package/components/landing/RessourceGettingStarted.svelte.d.ts +19 -0
- package/components/landing/ScriptBox.svelte +81 -0
- package/components/landing/ScriptBox.svelte.d.ts +17 -0
- package/components/landing/ScriptGettingStarted.svelte +93 -0
- package/components/landing/ScriptGettingStarted.svelte.d.ts +19 -0
- package/components/script_editor/LogPanel.svelte +172 -0
- package/components/script_editor/LogPanel.svelte.d.ts +22 -0
- package/components/sidebar/MenuLink.svelte +49 -0
- package/components/sidebar/MenuLink.svelte.d.ts +21 -0
- package/components/sidebar/SidebarContent.svelte +55 -0
- package/components/sidebar/SidebarContent.svelte.d.ts +16 -0
- package/components/sidebar/UserMenu.svelte +62 -0
- package/components/sidebar/UserMenu.svelte.d.ts +16 -0
- package/components/sidebar/WorkspaceMenu.svelte +66 -0
- package/components/sidebar/WorkspaceMenu.svelte.d.ts +16 -0
- package/editorUtils.d.ts +25 -0
- package/editorUtils.js +43 -0
- package/gen/core/OpenAPI.js +1 -1
- package/gen/models/FlowModule.d.ts +5 -3
- package/gen/models/ForloopFlow.d.ts +2 -2
- package/gen/services/ScriptService.d.ts +4 -6
- package/gen/services/ScriptService.js +2 -2
- package/logout.js +1 -1
- package/package.json +33 -15
- package/script_helpers.js +1 -1
- package/stores.d.ts +0 -1
- package/stores.js +0 -1
- package/utils.d.ts +1 -0
- package/utils.js +4 -1
- package/components/tabs/Tab.svelte +0 -12
- package/components/tabs/TabPanel.svelte +0 -11
- package/components/tabs/TabPanel.svelte.d.ts +0 -20
- package/components/tabs/Tabs.svelte +0 -3
- package/components/tabs/Tabs.svelte.d.ts +0 -23
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
<script>import {
|
|
2
|
-
import {
|
|
3
|
-
import { arePreviewsReady, workspaceStore } from '../stores';
|
|
1
|
+
<script>import { JobService } from '../gen';
|
|
2
|
+
import { workspaceStore } from '../stores';
|
|
4
3
|
import FlowJobResult from './FlowJobResult.svelte';
|
|
5
|
-
import IconedPath from './IconedPath.svelte';
|
|
6
4
|
import FlowPreviewStatus from './preview/FlowPreviewStatus.svelte';
|
|
7
5
|
import { Button } from 'flowbite-svelte';
|
|
8
6
|
import Icon from 'svelte-awesome';
|
|
9
7
|
import { faChevronDown, faChevronUp } from '@fortawesome/free-solid-svg-icons';
|
|
10
|
-
import ProgressBar from './ProgressBar.svelte';
|
|
11
8
|
import { createEventDispatcher } from 'svelte';
|
|
9
|
+
import { onDestroy } from 'svelte';
|
|
12
10
|
const dispatch = createEventDispatcher();
|
|
13
11
|
export let jobId;
|
|
14
12
|
export let root = false;
|
|
@@ -19,20 +17,7 @@ export let jobResult = {
|
|
|
19
17
|
loopJobs: []
|
|
20
18
|
};
|
|
21
19
|
let forloop_selected = '';
|
|
22
|
-
let
|
|
23
|
-
function shouldReset() {
|
|
24
|
-
if (jobId != lastJobid) {
|
|
25
|
-
lastJobid = jobId;
|
|
26
|
-
jobResult = {
|
|
27
|
-
job: undefined,
|
|
28
|
-
innerJobs: [],
|
|
29
|
-
loopJobs: []
|
|
30
|
-
};
|
|
31
|
-
loadJobInProgress();
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
let lastJobid = jobId;
|
|
35
|
-
$: jobId && shouldReset();
|
|
20
|
+
let timeout;
|
|
36
21
|
async function loadJobInProgress() {
|
|
37
22
|
const job = await JobService.getJob({
|
|
38
23
|
workspace: $workspaceStore ?? '',
|
|
@@ -40,44 +25,41 @@ async function loadJobInProgress() {
|
|
|
40
25
|
});
|
|
41
26
|
jobResult.job = job;
|
|
42
27
|
jobResult = jobResult;
|
|
43
|
-
if (job
|
|
44
|
-
|
|
45
|
-
isReady[isReadyIndex - 1] = true;
|
|
46
|
-
return isReady;
|
|
47
|
-
});
|
|
28
|
+
if (job?.type !== 'CompletedJob') {
|
|
29
|
+
timeout = setTimeout(() => loadJobInProgress(), 500);
|
|
48
30
|
}
|
|
49
|
-
else {
|
|
50
|
-
|
|
31
|
+
else if (root) {
|
|
32
|
+
dispatch('jobsLoaded', jobResult);
|
|
51
33
|
}
|
|
52
34
|
}
|
|
53
|
-
$:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
35
|
+
$: hasModules =
|
|
36
|
+
jobResult.job &&
|
|
37
|
+
Array.isArray(jobResult.job?.raw_flow?.modules) &&
|
|
38
|
+
jobResult.job?.raw_flow?.modules.length > 1;
|
|
39
|
+
function updateJobId() {
|
|
40
|
+
if (jobId !== jobResult.job?.id) {
|
|
41
|
+
loadJobInProgress();
|
|
59
42
|
}
|
|
60
43
|
}
|
|
61
|
-
$:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
$: loadJobInProgress();
|
|
44
|
+
$: jobId && updateJobId();
|
|
45
|
+
onDestroy(() => {
|
|
46
|
+
timeout && clearTimeout(timeout);
|
|
47
|
+
});
|
|
66
48
|
</script>
|
|
67
49
|
|
|
68
|
-
{#if job}
|
|
50
|
+
{#if jobResult.job}
|
|
69
51
|
<div class="flow-root w-full space-y-4">
|
|
70
52
|
<h3 class="text-md leading-6 font-bold text-gray-900 border-b pb-2">Preview results</h3>
|
|
71
|
-
<FlowPreviewStatus {job} />
|
|
72
|
-
{#if `result` in job}
|
|
73
|
-
<FlowJobResult {job} />
|
|
74
|
-
{:else if job.logs}
|
|
53
|
+
<FlowPreviewStatus job={jobResult.job} />
|
|
54
|
+
{#if `result` in jobResult.job}
|
|
55
|
+
<FlowJobResult job={jobResult.job} />
|
|
56
|
+
{:else if jobResult.job.logs}
|
|
75
57
|
<div class="text-xs p-4 bg-gray-50 overflow-auto max-h-80 border">
|
|
76
|
-
<pre class="w-full">{job.logs}</pre>
|
|
58
|
+
<pre class="w-full">{jobResult.job.logs}</pre>
|
|
77
59
|
</div>
|
|
78
60
|
{/if}
|
|
79
61
|
|
|
80
|
-
{#if Array.isArray(forloopJobIds) && forloopJobIds?.length > 0 && Array.isArray(loopJobs)}
|
|
62
|
+
{#if Array.isArray(forloopJobIds) && forloopJobIds?.length > 0 && Array.isArray(jobResult.loopJobs)}
|
|
81
63
|
<h3 class="text-md leading-6 font-bold text-gray-900 border-b mb-4">
|
|
82
64
|
Loop results ({forloopJobIds.length} items)
|
|
83
65
|
</h3>
|
|
@@ -102,27 +84,27 @@ $: loadJobInProgress();
|
|
|
102
84
|
/>
|
|
103
85
|
</Button>
|
|
104
86
|
<div class="border p-6" class:hidden={forloop_selected != loopJobId}>
|
|
105
|
-
<svelte:self jobId={loopJobId} bind:jobResult={loopJobs[j]} />
|
|
87
|
+
<svelte:self jobId={loopJobId} bind:jobResult={jobResult.loopJobs[j]} />
|
|
106
88
|
</div>
|
|
107
89
|
{/each}
|
|
108
|
-
{:else if hasModules && Array.isArray(innerJobs)}
|
|
90
|
+
{:else if hasModules && Array.isArray(jobResult.innerJobs)}
|
|
109
91
|
<ul class="w-full">
|
|
110
92
|
<h3 class="text-md leading-6 font-bold text-gray-900 border-b mb-4 py-2">
|
|
111
93
|
Detailed results
|
|
112
94
|
</h3>
|
|
113
95
|
|
|
114
|
-
{#each job?.flow_status?.modules ?? [] as module, i}
|
|
96
|
+
{#each jobResult.job?.flow_status?.modules ?? [] as module, i}
|
|
115
97
|
<p class="text-gray-500 mb-6 w-full ">
|
|
116
98
|
Step
|
|
117
99
|
<span class="font-medium text-gray-900"> {i + 1} </span> out of
|
|
118
|
-
<span class="font-medium text-gray-900">{job?.raw_flow?.modules.length}</span>
|
|
100
|
+
<span class="font-medium text-gray-900">{jobResult.job?.raw_flow?.modules.length}</span>
|
|
119
101
|
</p>
|
|
120
102
|
|
|
121
103
|
{#if ['InProgress', 'Success', 'Error'].includes(module.type)}
|
|
122
104
|
<li class="w-full border p-6 space-y-2">
|
|
123
105
|
<svelte:self
|
|
124
106
|
jobId={module.job}
|
|
125
|
-
bind:jobResult={innerJobs[i]}
|
|
107
|
+
bind:jobResult={jobResult.innerJobs[i]}
|
|
126
108
|
forloopJobIds={module.forloop_jobs}
|
|
127
109
|
/>
|
|
128
110
|
</li>
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
<script>import
|
|
2
|
-
import Highlight from 'svelte-highlight';
|
|
1
|
+
<script>import Highlight from 'svelte-highlight';
|
|
3
2
|
import json from 'svelte-highlight/languages/json';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import Tabs from './Tabs.svelte';
|
|
3
|
+
import Tabs from './common/tabs/Tabs.svelte';
|
|
4
|
+
import Tab from './common/tabs/Tab.svelte';
|
|
5
|
+
import TabContent from './common/tabs/TabContent.svelte';
|
|
8
6
|
import SchemaViewer from './SchemaViewer.svelte';
|
|
9
7
|
import FieldHeader from './FieldHeader.svelte';
|
|
10
|
-
import InputTransformsViewer from './InputTransformsViewer.svelte';
|
|
11
8
|
import SvelteMarkdown from 'svelte-markdown';
|
|
12
|
-
import
|
|
9
|
+
import FlowModulesViewer from './FlowModulesViewer.svelte';
|
|
13
10
|
export let flow;
|
|
14
11
|
export let initialOpen = undefined;
|
|
15
12
|
let flowFiltered = {
|
|
@@ -18,7 +15,6 @@ let flowFiltered = {
|
|
|
18
15
|
value: flow.value,
|
|
19
16
|
schema: flow.schema
|
|
20
17
|
};
|
|
21
|
-
export let embedded = false;
|
|
22
18
|
export let tab = 'ui';
|
|
23
19
|
let open = {};
|
|
24
20
|
if (initialOpen) {
|
|
@@ -29,155 +25,60 @@ function toAny(x) {
|
|
|
29
25
|
}
|
|
30
26
|
</script>
|
|
31
27
|
|
|
32
|
-
{
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
['json', 'JSON'],
|
|
37
|
-
['schema', 'Input schema of the flow']
|
|
38
|
-
]}
|
|
39
|
-
bind:tab
|
|
40
|
-
/>
|
|
41
|
-
{/if}
|
|
42
|
-
{#if tab == 'ui'}
|
|
43
|
-
<div class="flow-root w-full pb-4">
|
|
44
|
-
{#if !embedded}
|
|
45
|
-
<h2 class="my-4">{flow.summary}</h2>
|
|
46
|
-
<SvelteMarkdown source={flow.description ?? ''} />
|
|
28
|
+
<Tabs bind:selected={tab}>
|
|
29
|
+
<Tab value="ui">Flow rendered</Tab>
|
|
30
|
+
<Tab value="json">Json</Tab>
|
|
31
|
+
<Tab value="schema">Input schema of the flow</Tab>
|
|
47
32
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
<
|
|
53
|
-
{#each Object.entries(flow.schema.properties) as [inp, v]}
|
|
54
|
-
<li class="list-disc flex flex-row">
|
|
55
|
-
<FieldHeader
|
|
56
|
-
label={inp}
|
|
57
|
-
required={flow.schema.required?.includes(inp)}
|
|
58
|
-
type={toAny(v)?.type}
|
|
59
|
-
contentEncoding={toAny(v)?.contentEncoding}
|
|
60
|
-
format={toAny(v)?.format}
|
|
61
|
-
itemsType={toAny(v)?.itemsType}
|
|
62
|
-
/><span class="ml-4 mt-2 text-xs"
|
|
63
|
-
>{toAny(v)?.default != undefined
|
|
64
|
-
? 'default: ' + JSON.stringify(toAny(v)?.default)
|
|
65
|
-
: ''}</span
|
|
66
|
-
>
|
|
67
|
-
</li>
|
|
68
|
-
{/each}
|
|
69
|
-
</ul>
|
|
70
|
-
{:else}
|
|
71
|
-
<div class="text-gray-700 text-xs italic mb-4">No inputs</div>
|
|
72
|
-
{/if}
|
|
73
|
-
{/if}
|
|
33
|
+
<svelte:fragment slot="content">
|
|
34
|
+
<TabContent value="ui">
|
|
35
|
+
<div class="flow-root w-full pb-4">
|
|
36
|
+
<h2 class="my-4">{flow.summary}</h2>
|
|
37
|
+
<SvelteMarkdown source={flow.description ?? ''} />
|
|
74
38
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
<div class="w-full h-full mt-6">
|
|
122
|
-
<iframe
|
|
123
|
-
style="height: 400px;"
|
|
124
|
-
class="w-full h-full text-sm"
|
|
125
|
-
title="embedded script from hub"
|
|
126
|
-
frameborder="0"
|
|
127
|
-
src="https://hub.windmill.dev/embed/script/{mod?.value?.path?.substring(
|
|
128
|
-
4
|
|
129
|
-
)}"
|
|
130
|
-
/>
|
|
131
|
-
</div>
|
|
132
|
-
</div>
|
|
133
|
-
{/if}
|
|
134
|
-
</div>
|
|
135
|
-
{/if}
|
|
136
|
-
{:else if mod?.value?.type == 'rawscript'}
|
|
137
|
-
<button
|
|
138
|
-
on:click={() => (open[i] = !open[i])}
|
|
139
|
-
class="mb-2 underline text-black"
|
|
140
|
-
>
|
|
141
|
-
Raw {mod?.value?.language} script {open[i] ? '(-)' : '(+)'}</button
|
|
142
|
-
>
|
|
143
|
-
|
|
144
|
-
{#if open[i]}
|
|
145
|
-
<div transition:slide class="border border-black p-2 bg-gray-50 w-full">
|
|
146
|
-
<InputTransformsViewer inputTransforms={mod?.input_transform} />
|
|
147
|
-
|
|
148
|
-
<Highlight
|
|
149
|
-
language={mod?.value?.language == 'deno' ? typescript : python}
|
|
150
|
-
code={mod?.value?.content}
|
|
151
|
-
/>
|
|
152
|
-
</div>
|
|
153
|
-
{/if}
|
|
154
|
-
{:else if mod?.value?.type == 'flow'}
|
|
155
|
-
Flow at path {mod?.value?.path}
|
|
156
|
-
{:else if mod?.value?.type == 'forloopflow'}
|
|
157
|
-
For loop over all the elements of the list returned as a result of step {i}:
|
|
158
|
-
<svelte:self flow={mod?.value} embedded={true} />
|
|
159
|
-
{/if}
|
|
160
|
-
</p>
|
|
161
|
-
</div>
|
|
162
|
-
</div>
|
|
163
|
-
</div>
|
|
164
|
-
</div>
|
|
165
|
-
</li>
|
|
166
|
-
{/each}
|
|
167
|
-
</ul>
|
|
168
|
-
</div>
|
|
169
|
-
{:else if tab == 'json'}
|
|
170
|
-
<div class="relative">
|
|
171
|
-
<button
|
|
172
|
-
on:click={async () => {
|
|
173
|
-
await navigator.clipboard.writeText(JSON.stringify(flowFiltered, null, 4))
|
|
174
|
-
}}
|
|
175
|
-
class="absolute default-secondary-button-v2 bg-white/30 right-0 my-2 ml-4"
|
|
176
|
-
>copy content</button
|
|
177
|
-
>
|
|
178
|
-
<Highlight language={json} code={JSON.stringify(flowFiltered, null, 4)} />
|
|
179
|
-
</div>
|
|
180
|
-
{:else if tab == 'schema'}
|
|
181
|
-
<div class="my-4" />
|
|
182
|
-
<SchemaViewer schema={flow.schema} />
|
|
183
|
-
{/if}
|
|
39
|
+
<p class="font-black text-lg w-full my-4">
|
|
40
|
+
<span>Inputs</span>
|
|
41
|
+
</p>
|
|
42
|
+
{#if flow.schema && flow.schema.properties && Object.keys(flow.schema.properties).length > 0 && flow.schema}
|
|
43
|
+
<ul class="my-2">
|
|
44
|
+
{#each Object.entries(flow.schema.properties) as [inp, v]}
|
|
45
|
+
<li class="list-disc flex flex-row">
|
|
46
|
+
<FieldHeader
|
|
47
|
+
label={inp}
|
|
48
|
+
required={flow.schema.required?.includes(inp)}
|
|
49
|
+
type={toAny(v)?.type}
|
|
50
|
+
contentEncoding={toAny(v)?.contentEncoding}
|
|
51
|
+
format={toAny(v)?.format}
|
|
52
|
+
itemsType={toAny(v)?.itemsType}
|
|
53
|
+
/><span class="ml-4 mt-2 text-xs"
|
|
54
|
+
>{toAny(v)?.default != undefined
|
|
55
|
+
? 'default: ' + JSON.stringify(toAny(v)?.default)
|
|
56
|
+
: ''}</span
|
|
57
|
+
>
|
|
58
|
+
</li>
|
|
59
|
+
{/each}
|
|
60
|
+
</ul>
|
|
61
|
+
{:else}
|
|
62
|
+
<div class="text-gray-700 text-xs italic mb-4">No inputs</div>
|
|
63
|
+
{/if}
|
|
64
|
+
<FlowModulesViewer modules={flow?.value?.modules} />
|
|
65
|
+
</div>
|
|
66
|
+
</TabContent>
|
|
67
|
+
<TabContent value="json">
|
|
68
|
+
<div class="relative">
|
|
69
|
+
<button
|
|
70
|
+
on:click={async () => {
|
|
71
|
+
await navigator.clipboard.writeText(JSON.stringify(flowFiltered, null, 4))
|
|
72
|
+
}}
|
|
73
|
+
class="absolute default-secondary-button-v2 bg-white/30 right-0 my-2 ml-4"
|
|
74
|
+
>copy content</button
|
|
75
|
+
>
|
|
76
|
+
<Highlight language={json} code={JSON.stringify(flowFiltered, null, 4)} />
|
|
77
|
+
</div>
|
|
78
|
+
</TabContent>
|
|
79
|
+
<TabContent value="schema">
|
|
80
|
+
<div class="my-4" />
|
|
81
|
+
<SchemaViewer schema={flow.schema} />
|
|
82
|
+
</TabContent>
|
|
83
|
+
</svelte:fragment>
|
|
84
|
+
</Tabs>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
<script>import
|
|
2
|
-
import Icon from 'svelte-awesome';
|
|
1
|
+
<script>import Icon from 'svelte-awesome';
|
|
3
2
|
import AirtableIcon from './icons/AirtableIcon.svelte';
|
|
4
3
|
import DbIcon from './icons/DbIcon.svelte';
|
|
5
4
|
import DiscordIcon from './icons/DiscordIcon.svelte';
|
|
6
5
|
import GcalIcon from './icons/GcalIcon.svelte';
|
|
7
6
|
import GCloudIcon from './icons/GCloudIcon.svelte';
|
|
8
7
|
import GdriveIcon from './icons/GdriveIcon.svelte';
|
|
8
|
+
import GithubIcon from './icons/GithubIcon.svelte';
|
|
9
9
|
import GitlabIcon from './icons/GItlabIcon.svelte';
|
|
10
10
|
import GmailIcon from './icons/GmailIcon.svelte';
|
|
11
11
|
import GSheetsIcon from './icons/GSheetsIcon.svelte';
|
|
@@ -42,7 +42,7 @@ export let width = '24px';
|
|
|
42
42
|
{:else if name === 'slack'}
|
|
43
43
|
<Slack {height} {width} />
|
|
44
44
|
{:else if name === 'github'}
|
|
45
|
-
<
|
|
45
|
+
<GithubIcon />
|
|
46
46
|
{:else if name === 'gmail'}
|
|
47
47
|
<GmailIcon {height} {width} />
|
|
48
48
|
{:else if name === 'gsheets'}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
import { Button, Tooltip } from 'flowbite-svelte';
|
|
3
3
|
import Icon from 'svelte-awesome';
|
|
4
4
|
import ArgInput from './ArgInput.svelte';
|
|
5
|
-
import Editor from './Editor.svelte';
|
|
6
5
|
import FieldHeader from './FieldHeader.svelte';
|
|
7
6
|
import DynamicInputHelpBox from './flows/DynamicInputHelpBox.svelte';
|
|
8
7
|
import { codeToStaticTemplate, getDefaultExpr, isCodeInjection } from './flows/utils';
|
|
9
8
|
import OverlayPropertyPicker from './propertyPicker/OverlayPropertyPicker.svelte';
|
|
9
|
+
import SimpleEditor from './SimpleEditor.svelte';
|
|
10
10
|
import Toggle from './Toggle.svelte';
|
|
11
11
|
export let schema;
|
|
12
12
|
export let arg;
|
|
@@ -188,7 +188,7 @@ $: checked = propertyType == 'javascript';
|
|
|
188
188
|
}}
|
|
189
189
|
>
|
|
190
190
|
<div class="border rounded p-2 mt-2 border-gray-300">
|
|
191
|
-
<
|
|
191
|
+
<SimpleEditor
|
|
192
192
|
bind:this={monacos[argName]}
|
|
193
193
|
on:focus={() => focusProp(argName, true)}
|
|
194
194
|
bind:code={arg.expr}
|
|
@@ -114,7 +114,7 @@ $: opened = $stepOpened === String(indexes.join('-'));
|
|
|
114
114
|
inputTransform={true}
|
|
115
115
|
importPath={String(indexes.join('-'))}
|
|
116
116
|
bind:pickableProperties={stepPropPicker.pickableProperties}
|
|
117
|
-
bind:args={mod.
|
|
117
|
+
bind:args={mod.input_transforms}
|
|
118
118
|
bind:extraLib={stepPropPicker.extraLib}
|
|
119
119
|
/>
|
|
120
120
|
{/if}
|
|
@@ -3,9 +3,9 @@ import { faPen, faPlus, faTrash } from '@fortawesome/free-solid-svg-icons';
|
|
|
3
3
|
import { Button } from 'flowbite-svelte';
|
|
4
4
|
import { createEventDispatcher } from 'svelte';
|
|
5
5
|
import Icon from 'svelte-awesome';
|
|
6
|
-
import Editor from './Editor.svelte';
|
|
7
6
|
import SchemaEditorProperty from './SchemaEditorProperty.svelte';
|
|
8
7
|
import SchemaModal, { DEFAULT_PROPERTY, schemaToModal } from './SchemaModal.svelte';
|
|
8
|
+
import SimpleEditor from './SimpleEditor.svelte';
|
|
9
9
|
import TableCustom from './TableCustom.svelte';
|
|
10
10
|
import Toggle from './Toggle.svelte';
|
|
11
11
|
import Tooltip from './Tooltip.svelte';
|
|
@@ -208,7 +208,7 @@ function switchTab() {
|
|
|
208
208
|
</div>
|
|
209
209
|
{:else}
|
|
210
210
|
<div class="border rounded mt-4 p-2">
|
|
211
|
-
<
|
|
211
|
+
<SimpleEditor
|
|
212
212
|
on:change={() => {
|
|
213
213
|
try {
|
|
214
214
|
schema = JSON.parse(schemaString)
|
|
@@ -2,77 +2,67 @@
|
|
|
2
2
|
import Highlight from 'svelte-highlight';
|
|
3
3
|
import json from 'svelte-highlight/languages/json';
|
|
4
4
|
import TableCustom from './TableCustom.svelte';
|
|
5
|
+
import Tab from './common/tabs/Tab.svelte';
|
|
6
|
+
import TabContent from './common/tabs/TabContent.svelte';
|
|
7
|
+
import Tabs from './common/tabs/Tabs.svelte';
|
|
5
8
|
export let schema = emptySchema();
|
|
6
|
-
let viewJsonSchema = false;
|
|
7
9
|
</script>
|
|
8
10
|
|
|
9
11
|
<div class="w-full">
|
|
10
|
-
<
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
</button>
|
|
26
|
-
</div>
|
|
27
|
-
</div>
|
|
28
|
-
<!--json schema or table view-->
|
|
29
|
-
<div class="border-t py-1">
|
|
30
|
-
<div class={viewJsonSchema ? 'hidden' : ''}>
|
|
31
|
-
{#if schema && schema.properties && Object.keys(schema.properties).length > 0 && schema.required}
|
|
32
|
-
<div class="flex flex-row">
|
|
33
|
-
<TableCustom>
|
|
34
|
-
<tr slot="header-row" class="underline">
|
|
35
|
-
<th>name</th>
|
|
36
|
-
<th>type</th>
|
|
37
|
-
<th>description</th>
|
|
38
|
-
<th>default</th>
|
|
39
|
-
<th>format</th>
|
|
40
|
-
<th>required</th>
|
|
41
|
-
</tr>
|
|
42
|
-
<tbody slot="body">
|
|
43
|
-
{#each Object.entries(schema.properties) as [name, property] (name)}
|
|
44
|
-
<tr>
|
|
45
|
-
<td>{name}</td>
|
|
46
|
-
<td
|
|
47
|
-
>{#if !property.type} any {:else} {property.type} {/if}</td
|
|
48
|
-
>
|
|
49
|
-
<td>{property.description}</td>
|
|
50
|
-
<td
|
|
51
|
-
>{property.default == '<function call>'
|
|
52
|
-
? '<function call>'
|
|
53
|
-
: property.default
|
|
54
|
-
? JSON.stringify(property.default)
|
|
55
|
-
: ''}</td
|
|
56
|
-
>
|
|
57
|
-
<td
|
|
58
|
-
>{property.format ?? ''}
|
|
59
|
-
{property.contentEncoding ? `(encoding: ${property.contentEncoding})` : ''}</td
|
|
60
|
-
>
|
|
61
|
-
<td
|
|
62
|
-
>{#if schema.required.includes(name)}
|
|
63
|
-
<span class="text-red-600 font-bold text-lg">*</span>
|
|
64
|
-
{/if}</td
|
|
65
|
-
>
|
|
12
|
+
<Tabs selected="arguments">
|
|
13
|
+
<Tab value="arguments">Arguments</Tab>
|
|
14
|
+
<Tab value="advanced">Advanced</Tab>
|
|
15
|
+
<svelte:fragment slot="content">
|
|
16
|
+
<TabContent value="arguments">
|
|
17
|
+
{#if schema && schema.properties && Object.keys(schema.properties).length > 0 && schema.required}
|
|
18
|
+
<div class="flex flex-row">
|
|
19
|
+
<TableCustom>
|
|
20
|
+
<tr slot="header-row" class="underline">
|
|
21
|
+
<th>name</th>
|
|
22
|
+
<th>type</th>
|
|
23
|
+
<th>description</th>
|
|
24
|
+
<th>default</th>
|
|
25
|
+
<th>format</th>
|
|
26
|
+
<th>required</th>
|
|
66
27
|
</tr>
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
28
|
+
<tbody slot="body">
|
|
29
|
+
{#each Object.entries(schema.properties) as [name, property] (name)}
|
|
30
|
+
<tr>
|
|
31
|
+
<td>{name}</td>
|
|
32
|
+
<td
|
|
33
|
+
>{#if !property.type} any {:else} {property.type} {/if}</td
|
|
34
|
+
>
|
|
35
|
+
<td>{property.description}</td>
|
|
36
|
+
<td
|
|
37
|
+
>{property.default == '<function call>'
|
|
38
|
+
? '<function call>'
|
|
39
|
+
: property.default
|
|
40
|
+
? JSON.stringify(property.default)
|
|
41
|
+
: ''}</td
|
|
42
|
+
>
|
|
43
|
+
<td
|
|
44
|
+
>{property.format ?? ''}
|
|
45
|
+
{property.contentEncoding
|
|
46
|
+
? `(encoding: ${property.contentEncoding})`
|
|
47
|
+
: ''}</td
|
|
48
|
+
>
|
|
49
|
+
<td
|
|
50
|
+
>{#if schema.required.includes(name)}
|
|
51
|
+
<span class="text-red-600 font-bold text-lg">*</span>
|
|
52
|
+
{/if}</td
|
|
53
|
+
>
|
|
54
|
+
</tr>
|
|
55
|
+
{/each}
|
|
56
|
+
</tbody>
|
|
57
|
+
</TableCustom>
|
|
58
|
+
</div>
|
|
59
|
+
{:else}
|
|
60
|
+
<div class="text-gray-700 text-xs italic">This script has no arguments</div>
|
|
61
|
+
{/if}
|
|
62
|
+
</TabContent>
|
|
63
|
+
<TabContent value="advanced">
|
|
64
|
+
<Highlight language={json} code={JSON.stringify(schema, null, 4)} />
|
|
65
|
+
</TabContent>
|
|
66
|
+
</svelte:fragment>
|
|
67
|
+
</Tabs>
|
|
78
68
|
</div>
|