windmill-components 1.695.1 → 1.698.0
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/sharedUtils/assets/tokens/colorTokensConfig.d.ts +2 -0
- package/dist/sharedUtils/base.d.ts +1 -0
- package/dist/sharedUtils/cloud.d.ts +1 -0
- package/dist/sharedUtils/common.d.ts +111 -0
- package/dist/sharedUtils/components/apps/components/display/dbtable/queries/count.d.ts +5 -0
- package/dist/sharedUtils/components/apps/components/display/dbtable/queries/delete.d.ts +5 -0
- package/dist/sharedUtils/components/apps/components/display/dbtable/queries/insert.d.ts +5 -0
- package/dist/sharedUtils/components/apps/components/display/dbtable/queries/select.d.ts +13 -0
- package/dist/sharedUtils/components/apps/components/display/dbtable/queries/update.d.ts +11 -0
- package/dist/sharedUtils/components/apps/components/display/dbtable/utils.d.ts +95 -0
- package/dist/sharedUtils/components/apps/editor/appPolicy.d.ts +6 -0
- package/dist/sharedUtils/components/apps/editor/appUtilsCore.d.ts +7 -0
- package/dist/sharedUtils/components/apps/editor/appUtilsS3.d.ts +33 -0
- package/dist/sharedUtils/components/apps/editor/commonAppUtils.d.ts +10 -0
- package/dist/sharedUtils/components/apps/editor/component/components.d.ts +5371 -0
- package/dist/sharedUtils/components/apps/editor/component/default-codes.d.ts +3 -0
- package/dist/sharedUtils/components/apps/editor/component/index.d.ts +3 -0
- package/dist/sharedUtils/components/apps/editor/component/sets.d.ts +7 -0
- package/dist/sharedUtils/components/apps/editor/componentsPanel/componentDefaultProps.d.ts +3 -0
- package/dist/sharedUtils/components/apps/gridUtils.d.ts +14 -0
- package/dist/sharedUtils/components/apps/inputType.d.ts +178 -0
- package/dist/sharedUtils/components/apps/rx.d.ts +29 -0
- package/dist/sharedUtils/components/apps/sharedTypes.d.ts +21 -0
- package/dist/sharedUtils/components/apps/types.d.ts +274 -0
- package/dist/sharedUtils/components/assets/lib.d.ts +25 -0
- package/dist/sharedUtils/components/common/alert/model.d.ts +2 -0
- package/dist/sharedUtils/components/common/badge/model.d.ts +8 -0
- package/dist/sharedUtils/components/common/button/model.d.ts +45 -0
- package/dist/sharedUtils/components/common/fileInput/model.d.ts +1 -0
- package/dist/sharedUtils/components/common/index.d.ts +24 -0
- package/dist/sharedUtils/components/common/skeleton/model.d.ts +21 -0
- package/dist/sharedUtils/components/dbTypes.d.ts +14 -0
- package/dist/sharedUtils/components/diff_drawer.d.ts +26 -0
- package/dist/sharedUtils/components/ducklake.d.ts +1 -0
- package/dist/sharedUtils/components/flows/scheduleUtils.d.ts +7 -0
- package/dist/sharedUtils/components/icons/index.d.ts +101 -0
- package/dist/sharedUtils/components/random_positive_adjetive.d.ts +1 -0
- package/dist/sharedUtils/components/raw_apps/rawAppPolicy.d.ts +10 -0
- package/dist/sharedUtils/components/raw_apps/utils.d.ts +15 -0
- package/dist/sharedUtils/components/triggers/email/utils.d.ts +4 -0
- package/dist/sharedUtils/components/triggers/gcp/utils.d.ts +2 -0
- package/dist/sharedUtils/components/triggers/http/utils.d.ts +11 -0
- package/dist/sharedUtils/components/triggers/kafka/utils.d.ts +2 -0
- package/dist/sharedUtils/components/triggers/mqtt/utils.d.ts +2 -0
- package/dist/sharedUtils/components/triggers/nats/utils.d.ts +2 -0
- package/dist/sharedUtils/components/triggers/postgres/utils.d.ts +8 -0
- package/dist/sharedUtils/components/triggers/sqs/utils.d.ts +2 -0
- package/dist/sharedUtils/components/triggers/triggers.svelte.d.ts +32 -0
- package/dist/sharedUtils/components/triggers/utils.d.ts +80 -0
- package/dist/sharedUtils/components/triggers/websocket/utils.d.ts +2 -0
- package/dist/sharedUtils/components/triggers.d.ts +20 -0
- package/dist/sharedUtils/gen/core/ApiError.d.ts +10 -0
- package/dist/sharedUtils/gen/core/ApiRequestOptions.d.ts +13 -0
- package/dist/sharedUtils/gen/core/ApiResult.d.ts +7 -0
- package/dist/sharedUtils/gen/core/CancelablePromise.d.ts +26 -0
- package/dist/sharedUtils/gen/core/OpenAPI.d.ts +27 -0
- package/dist/sharedUtils/gen/core/request.d.ts +29 -0
- package/dist/sharedUtils/gen/index.d.ts +6 -0
- package/dist/sharedUtils/gen/schemas.gen.d.ts +7036 -0
- package/dist/sharedUtils/gen/services.gen.d.ts +6047 -0
- package/dist/sharedUtils/gen/types.gen.d.ts +21881 -0
- package/dist/sharedUtils/history.svelte.d.ts +9 -0
- package/dist/sharedUtils/hub.d.ts +49 -0
- package/dist/sharedUtils/jsr.json +6 -0
- package/dist/sharedUtils/lib.d.ts +5 -0
- package/dist/sharedUtils/lib.es.js +1588 -0
- package/dist/sharedUtils/package.json +12 -0
- package/dist/sharedUtils/schema.d.ts +3 -0
- package/dist/sharedUtils/stores.d.ts +97 -0
- package/dist/sharedUtils/svelte5Utils.svelte.d.ts +80 -0
- package/dist/sharedUtils/toast.d.ts +8 -0
- package/dist/sharedUtils/utils.d.ts +265 -0
- package/package/components/AppConnectInner.svelte +38 -5
- package/package/components/CompareWorkspaces.svelte +142 -486
- package/package/components/Editor.svelte +5 -4
- package/package/components/Editor.svelte.d.ts +1 -0
- package/package/components/FilterSearchbar.svelte +3 -1
- package/package/components/FilterSearchbar.svelte.d.ts +1 -0
- package/package/components/ForkWorkspaceBanner.svelte +16 -0
- package/package/components/LogViewer.svelte +51 -60
- package/package/components/OnBehalfOfSelector.svelte +10 -7
- package/package/components/ResourceEditor.svelte +198 -311
- package/package/components/ResourceEditor.svelte.d.ts +3 -3
- package/package/components/ResourceEditorDrawer.svelte +17 -6
- package/package/components/ResourceForm.svelte +235 -0
- package/package/components/ResourceForm.svelte.d.ts +25 -0
- package/package/components/RunsPage.svelte +1 -0
- package/package/components/ScriptBuilder.svelte +1 -0
- package/package/components/ScriptEditor.svelte +10 -3
- package/package/components/ScriptEditor.svelte.d.ts +1 -0
- package/package/components/TaggedTextInput.svelte +4 -1
- package/package/components/TaggedTextInput.svelte.d.ts +2 -0
- package/package/components/VariableEditor.svelte +177 -199
- package/package/components/VariableEditor.svelte.d.ts +1 -2
- package/package/components/VariableForm.svelte +133 -0
- package/package/components/VariableForm.svelte.d.ts +22 -0
- package/package/components/WsSpecificVersions.svelte +39 -0
- package/package/components/WsSpecificVersions.svelte.d.ts +9 -0
- package/package/components/apps/components/helpers/RunnableComponent.svelte.d.ts +0 -1
- package/package/components/apps/editor/AppEditorHeaderDeploy.svelte.d.ts +1 -1
- package/package/components/common/table/AppRow.svelte +2 -1
- package/package/components/common/table/AppRow.svelte.d.ts +1 -0
- package/package/components/common/table/FlowRow.svelte +2 -1
- package/package/components/common/table/FlowRow.svelte.d.ts +1 -0
- package/package/components/common/table/RawAppRow.svelte +2 -1
- package/package/components/common/table/RawAppRow.svelte.d.ts +1 -0
- package/package/components/common/table/Row.svelte +11 -3
- package/package/components/common/table/Row.svelte.d.ts +2 -1
- package/package/components/common/table/RowIcon.svelte +18 -2
- package/package/components/common/table/RowIcon.svelte.d.ts +1 -1
- package/package/components/common/table/ScriptRow.svelte +2 -1
- package/package/components/common/table/ScriptRow.svelte.d.ts +1 -0
- package/package/components/copilot/autocomplete/Autocompletor.d.ts +3 -1
- package/package/components/copilot/autocomplete/Autocompletor.js +5 -2
- package/package/components/copilot/autocomplete/request.d.ts +1 -0
- package/package/components/copilot/autocomplete/request.js +1 -1
- package/package/components/copilot/chat/AIChatManager.svelte.js +14 -4
- package/package/components/copilot/chat/AiChatLayout.svelte +2 -0
- package/package/components/copilot/chat/ContextManager.svelte.d.ts +1 -0
- package/package/components/copilot/chat/CreatedResourceActionDrawers.svelte +129 -0
- package/package/components/copilot/chat/CreatedResourceActionDrawers.svelte.d.ts +4 -0
- package/package/components/copilot/chat/ToolExecutionDisplay.svelte +14 -6
- package/package/components/copilot/chat/ToolMessageActions.svelte +73 -0
- package/package/components/copilot/chat/ToolMessageActions.svelte.d.ts +7 -0
- package/package/components/copilot/chat/createdResourceActions.svelte.d.ts +6 -0
- package/package/components/copilot/chat/createdResourceActions.svelte.js +29 -0
- package/package/components/copilot/chat/script/core.d.ts +6 -2
- package/package/components/copilot/chat/script/core.js +13 -7
- package/package/components/copilot/chat/script/wacPrompt.test.d.ts +1 -0
- package/package/components/copilot/chat/script/wacPrompt.test.js +25 -0
- package/package/components/copilot/chat/shared.d.ts +12 -0
- package/package/components/copilot/chat/shared.test.js +23 -2
- package/package/components/copilot/chat/workspaceTools.js +34 -4
- package/package/components/flows/content/ScriptEditorDrawer.svelte +1 -0
- package/package/components/graph/wacToFlow.js +1 -1
- package/package/components/graph/wacToFlow.test.d.ts +1 -0
- package/package/components/graph/wacToFlow.test.js +17 -0
- package/package/components/home/Item.svelte +5 -1
- package/package/components/home/Item.svelte.d.ts +1 -0
- package/package/components/home/ItemsList.svelte +260 -3
- package/package/components/instanceSettings/SecretBackendConfig.svelte +457 -88
- package/package/components/runs/useJobsLoader.svelte.js +5 -11
- package/package/components/sidebar/WorkspaceMenu.svelte +19 -5
- package/package/externalDomain.d.ts +2 -0
- package/package/externalDomain.js +16 -0
- package/package/gen/core/OpenAPI.js +1 -1
- package/package/gen/types.gen.d.ts +0 -112
- package/package/hubPaths.json +2 -2
- package/package/system_prompts/index.d.ts +1 -1
- package/package/system_prompts/index.js +22 -3
- package/package/system_prompts/prompts.d.ts +2 -2
- package/package/system_prompts/prompts.js +6 -3
- package/package/utils_deployable.d.ts +162 -638
- package/package/utils_deployable.js +75 -143
- package/package/utils_workspace_deploy.d.ts +10 -4
- package/package/utils_workspace_deploy.js +167 -42
- package/package.json +7 -3
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
<script lang="ts">import { emptyString, isOwner, urlize } from '../utils';
|
|
2
|
+
import { Alert, Skeleton } from './common';
|
|
3
|
+
import Path from './Path.svelte';
|
|
4
|
+
import LabelsInput from './LabelsInput.svelte';
|
|
5
|
+
import Required from './Required.svelte';
|
|
6
|
+
import { userStore, workspaceStore } from '../stores';
|
|
7
|
+
import SchemaForm from './SchemaForm.svelte';
|
|
8
|
+
import SimpleEditor from './SimpleEditor.svelte';
|
|
9
|
+
import FilesetEditor from './FilesetEditor.svelte';
|
|
10
|
+
import Toggle from './Toggle.svelte';
|
|
11
|
+
import TestConnection from './TestConnection.svelte';
|
|
12
|
+
import { Pen } from 'lucide-svelte';
|
|
13
|
+
import Markdown from 'svelte-exmarkdown';
|
|
14
|
+
import autosize from '../autosize';
|
|
15
|
+
import GfmMarkdown from './GfmMarkdown.svelte';
|
|
16
|
+
import TestTriggerConnection from './triggers/TestTriggerConnection.svelte';
|
|
17
|
+
import GitHubAppIntegration from './GitHubAppIntegration.svelte';
|
|
18
|
+
import Button from './common/button/Button.svelte';
|
|
19
|
+
import ResourceGen from './copilot/ResourceGen.svelte';
|
|
20
|
+
import SyncResourceTypes from './SyncResourceTypes.svelte';
|
|
21
|
+
import Label from './Label.svelte';
|
|
22
|
+
let { path = $bindable(), initialPath, hidePath = false, labels = $bindable(), description = $bindable(), args = $bindable(), wsSpecific = $bindable(), isValid = $bindable(), viewJsonSchema = $bindable(), jsonError = $bindable(), deployTo, can_write, resource_type, resourceTypeInfo, resourceSchema, loadingSchema, resourceToEdit, onLoadResourceType } = $props();
|
|
23
|
+
let editDescription = $state(false);
|
|
24
|
+
let rawCode = $state(undefined);
|
|
25
|
+
let textFileContent = $state('');
|
|
26
|
+
function parseJson() {
|
|
27
|
+
try {
|
|
28
|
+
args = JSON.parse(rawCode ?? '');
|
|
29
|
+
jsonError = '';
|
|
30
|
+
}
|
|
31
|
+
catch (e) {
|
|
32
|
+
jsonError = e.message;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function parseTextFileContent() {
|
|
36
|
+
args = { content: textFileContent };
|
|
37
|
+
}
|
|
38
|
+
$effect(() => {
|
|
39
|
+
if (rawCode !== undefined)
|
|
40
|
+
parseJson();
|
|
41
|
+
});
|
|
42
|
+
$effect(() => {
|
|
43
|
+
if (viewJsonSchema && rawCode === undefined) {
|
|
44
|
+
rawCode = JSON.stringify(args, null, 2);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
$effect(() => {
|
|
48
|
+
if (textFileContent)
|
|
49
|
+
parseTextFileContent();
|
|
50
|
+
});
|
|
51
|
+
$effect(() => {
|
|
52
|
+
if (resourceTypeInfo?.format_extension && !resourceTypeInfo?.is_fileset && !viewJsonSchema) {
|
|
53
|
+
textFileContent = args?.content ?? '';
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
{#if !hidePath}
|
|
59
|
+
<div>
|
|
60
|
+
{#if !can_write}
|
|
61
|
+
<div class="my-2">
|
|
62
|
+
<Alert type="warning" title="Only read access">
|
|
63
|
+
You only have read access to this resource and cannot edit it
|
|
64
|
+
</Alert>
|
|
65
|
+
</div>
|
|
66
|
+
{/if}
|
|
67
|
+
<Label label="Path">
|
|
68
|
+
<Path
|
|
69
|
+
disabled={initialPath != '' && !isOwner(initialPath, $userStore, $workspaceStore)}
|
|
70
|
+
bind:path
|
|
71
|
+
{initialPath}
|
|
72
|
+
namePlaceholder="resource"
|
|
73
|
+
kind="resource"
|
|
74
|
+
/>
|
|
75
|
+
</Label>
|
|
76
|
+
</div>
|
|
77
|
+
{/if}
|
|
78
|
+
<LabelsInput bind:labels class="-mt-4" />
|
|
79
|
+
|
|
80
|
+
{#if deployTo}
|
|
81
|
+
<Label
|
|
82
|
+
label="Workspace specific"
|
|
83
|
+
tooltip="Prevents this resource from being deployed to prod/staging. When enabled, any variable referenced via $var: inside the resource value is also automatically marked workspace-specific. Disabling this toggle does not un-mark those variables — they may be referenced by other resources."
|
|
84
|
+
>
|
|
85
|
+
<Toggle bind:checked={wsSpecific} />
|
|
86
|
+
</Label>
|
|
87
|
+
{/if}
|
|
88
|
+
|
|
89
|
+
{#if !emptyString(resourceTypeInfo?.description)}
|
|
90
|
+
<div class="flex flex-col gap-1">
|
|
91
|
+
<h4 class="text-xs text-emphasis font-semibold">{resourceTypeInfo?.name} description</h4>
|
|
92
|
+
<div class="text-xs text-primary font-normal">
|
|
93
|
+
<Markdown md={urlize(resourceTypeInfo?.description ?? '', 'md')} />
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
{/if}
|
|
97
|
+
|
|
98
|
+
<div class="flex flex-col gap-1">
|
|
99
|
+
<h4 class="inline-flex items-center gap-2 text-xs text-emphasis font-semibold"
|
|
100
|
+
>Resource description <Required required={false} />
|
|
101
|
+
{#if can_write}
|
|
102
|
+
<Button
|
|
103
|
+
variant="subtle"
|
|
104
|
+
unifiedSize="xs"
|
|
105
|
+
btnClasses={editDescription ? 'bg-surface-hover' : ''}
|
|
106
|
+
startIcon={{ icon: Pen }}
|
|
107
|
+
on:click={() => (editDescription = !editDescription)}
|
|
108
|
+
/>
|
|
109
|
+
{/if}
|
|
110
|
+
</h4>
|
|
111
|
+
{#if can_write && editDescription}
|
|
112
|
+
<div class="relative">
|
|
113
|
+
<div class="text-2xs text-primary absolute -top-4 right-0">GH Markdown</div>
|
|
114
|
+
<textarea
|
|
115
|
+
class="text-xs text-primary font-normal"
|
|
116
|
+
disabled={!can_write}
|
|
117
|
+
use:autosize
|
|
118
|
+
bind:value={description}
|
|
119
|
+
placeholder="Describe what this resource is for"
|
|
120
|
+
></textarea>
|
|
121
|
+
</div>
|
|
122
|
+
{:else if description == undefined || description == ''}
|
|
123
|
+
<div class="text-xs text-secondary font-normal">No description provided</div>
|
|
124
|
+
{:else}
|
|
125
|
+
<div class="text-xs text-primary font-normal">
|
|
126
|
+
<GfmMarkdown md={description} noPadding />
|
|
127
|
+
</div>
|
|
128
|
+
{/if}
|
|
129
|
+
</div>
|
|
130
|
+
|
|
131
|
+
<div class="flex flex-col gap-1">
|
|
132
|
+
<div class="w-full flex gap-4 flex-row-reverse items-center">
|
|
133
|
+
<Toggle
|
|
134
|
+
bind:checked={viewJsonSchema}
|
|
135
|
+
on:change={(e) => {
|
|
136
|
+
if (e.detail) {
|
|
137
|
+
rawCode = JSON.stringify(args, null, 2)
|
|
138
|
+
} else if (resourceTypeInfo?.format_extension && !resourceTypeInfo?.is_fileset) {
|
|
139
|
+
textFileContent = args?.content ?? ''
|
|
140
|
+
}
|
|
141
|
+
}}
|
|
142
|
+
options={{
|
|
143
|
+
right: 'As JSON'
|
|
144
|
+
}}
|
|
145
|
+
/>
|
|
146
|
+
<ResourceGen
|
|
147
|
+
bind:args
|
|
148
|
+
resourceType={resource_type}
|
|
149
|
+
resourceName={path}
|
|
150
|
+
resourceDescription={description}
|
|
151
|
+
{resourceSchema}
|
|
152
|
+
/>
|
|
153
|
+
{#if resourceToEdit?.resource_type === 'nats' || resourceToEdit?.resource_type === 'kafka'}
|
|
154
|
+
<TestTriggerConnection kind={resourceToEdit?.resource_type} args={{ connection: args }} />
|
|
155
|
+
{:else}
|
|
156
|
+
<TestConnection resourceType={resourceToEdit?.resource_type} {args} />
|
|
157
|
+
{/if}
|
|
158
|
+
{#if resource_type === 'git_repository' && $workspaceStore && ($userStore?.is_admin || $userStore?.is_super_admin)}
|
|
159
|
+
<GitHubAppIntegration
|
|
160
|
+
resourceType={resource_type}
|
|
161
|
+
{args}
|
|
162
|
+
{description}
|
|
163
|
+
onArgsUpdate={(newArgs) => {
|
|
164
|
+
args = newArgs
|
|
165
|
+
if (viewJsonSchema) {
|
|
166
|
+
rawCode = JSON.stringify(args, null, 2)
|
|
167
|
+
}
|
|
168
|
+
}}
|
|
169
|
+
onDescriptionUpdate={(newDescription) => (description = newDescription)}
|
|
170
|
+
/>
|
|
171
|
+
{/if}
|
|
172
|
+
</div>
|
|
173
|
+
|
|
174
|
+
<div>
|
|
175
|
+
{#if loadingSchema}
|
|
176
|
+
<Skeleton layout={[[4]]} />
|
|
177
|
+
{:else if !viewJsonSchema && resourceTypeInfo?.is_fileset}
|
|
178
|
+
<div class="mt-1 flex items-center gap-2">
|
|
179
|
+
<h5 class="inline-flex items-center gap-4">Fileset</h5>
|
|
180
|
+
<ResourceGen
|
|
181
|
+
bind:args
|
|
182
|
+
resourceType={resource_type}
|
|
183
|
+
resourceName={path}
|
|
184
|
+
resourceDescription={description}
|
|
185
|
+
{resourceSchema}
|
|
186
|
+
isFileset
|
|
187
|
+
/>
|
|
188
|
+
</div>
|
|
189
|
+
<FilesetEditor bind:args />
|
|
190
|
+
{:else if !viewJsonSchema && resourceSchema && resourceSchema?.properties}
|
|
191
|
+
{#if resourceTypeInfo?.format_extension}
|
|
192
|
+
<h5 class="mt-1 inline-flex items-center gap-4">
|
|
193
|
+
File content ({resourceTypeInfo.format_extension})
|
|
194
|
+
</h5>
|
|
195
|
+
<div class="">
|
|
196
|
+
<SimpleEditor
|
|
197
|
+
autoHeight
|
|
198
|
+
lang={resourceTypeInfo.format_extension}
|
|
199
|
+
bind:code={textFileContent}
|
|
200
|
+
fixedOverflowWidgets={false}
|
|
201
|
+
/>
|
|
202
|
+
</div>
|
|
203
|
+
{:else}
|
|
204
|
+
<SchemaForm
|
|
205
|
+
onlyMaskPassword
|
|
206
|
+
noDelete
|
|
207
|
+
disabled={!can_write}
|
|
208
|
+
compact
|
|
209
|
+
schema={resourceSchema}
|
|
210
|
+
bind:args
|
|
211
|
+
bind:isValid
|
|
212
|
+
/>
|
|
213
|
+
{/if}
|
|
214
|
+
{:else if !can_write}
|
|
215
|
+
<input type="text" disabled value={rawCode} />
|
|
216
|
+
{:else}
|
|
217
|
+
{#if !viewJsonSchema}
|
|
218
|
+
<div class="flex flex-col gap-2 mb-4">
|
|
219
|
+
<p class="text-red-500 dark:text-red-400 text-xs">
|
|
220
|
+
Resource type '{resource_type}' not found in your workspace
|
|
221
|
+
</p>
|
|
222
|
+
<SyncResourceTypes onSynced={() => onLoadResourceType?.()} />
|
|
223
|
+
<p class="italic text-secondary text-xs"> Define the value in JSON directly </p>
|
|
224
|
+
</div>
|
|
225
|
+
{/if}
|
|
226
|
+
|
|
227
|
+
{#if !emptyString(jsonError)}<span class="text-red-400 text-xs mb-1 flex flex-row-reverse"
|
|
228
|
+
>{jsonError}</span
|
|
229
|
+
>{:else}<div class="py-2"></div>{/if}
|
|
230
|
+
<div class="bg-surface-tertiary rounded-md border py-2.5">
|
|
231
|
+
<SimpleEditor autoHeight lang="json" bind:code={rawCode} />
|
|
232
|
+
</div>
|
|
233
|
+
{/if}
|
|
234
|
+
</div>
|
|
235
|
+
</div>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Schema } from '../common';
|
|
2
|
+
import type { Resource, ResourceType } from '../gen';
|
|
3
|
+
interface Props {
|
|
4
|
+
path: string;
|
|
5
|
+
initialPath: string;
|
|
6
|
+
hidePath?: boolean;
|
|
7
|
+
labels: string[] | undefined;
|
|
8
|
+
description: string;
|
|
9
|
+
args: Record<string, any>;
|
|
10
|
+
wsSpecific: boolean;
|
|
11
|
+
isValid: boolean;
|
|
12
|
+
viewJsonSchema: boolean;
|
|
13
|
+
jsonError: string;
|
|
14
|
+
deployTo: string | undefined;
|
|
15
|
+
can_write: boolean;
|
|
16
|
+
resource_type: string | undefined;
|
|
17
|
+
resourceTypeInfo: ResourceType | undefined;
|
|
18
|
+
resourceSchema: Schema | undefined;
|
|
19
|
+
loadingSchema: boolean;
|
|
20
|
+
resourceToEdit: Resource | undefined;
|
|
21
|
+
onLoadResourceType?: () => void;
|
|
22
|
+
}
|
|
23
|
+
declare const ResourceForm: import("svelte").Component<Props, {}, "path" | "description" | "args" | "labels" | "wsSpecific" | "isValid" | "viewJsonSchema" | "jsonError">;
|
|
24
|
+
type ResourceForm = ReturnType<typeof ResourceForm>;
|
|
25
|
+
export default ResourceForm;
|
|
@@ -57,7 +57,7 @@ import { resource, watch } from 'runed';
|
|
|
57
57
|
import { createScriptRecording } from './recording/scriptRecording.svelte';
|
|
58
58
|
import { setActiveRecording } from './recording/flowRecording.svelte';
|
|
59
59
|
import DropdownV2 from './DropdownV2.svelte';
|
|
60
|
-
let { schema = $bindable(), code = $bindable(), path, lang, kind = undefined, template = 'script', tag, fixedOverflowWidgets = true, noSyncFromGithub = false, editor = $bindable(undefined), diffEditor = $bindable(undefined), collabMode = false, edit = true, noHistory = false, saveToWorkspace = false, watchChanges = false, customUi = undefined, args = $bindable(), selectedTab = $bindable('main'), hasPreprocessor = $bindable(false), captureTable = $bindable(undefined), showCaptures = true, stablePathForCaptures = '', lastSavedCode = undefined, lastDeployedCode = undefined, disableAi = false, assets = $bindable(), modules = $bindable(undefined), editorBarRight, enablePreprocessorSnippet = false } = $props();
|
|
60
|
+
let { schema = $bindable(), code = $bindable(), path, lang, kind = undefined, autoKind = undefined, template = 'script', tag, fixedOverflowWidgets = true, noSyncFromGithub = false, editor = $bindable(undefined), diffEditor = $bindable(undefined), collabMode = false, edit = true, noHistory = false, saveToWorkspace = false, watchChanges = false, customUi = undefined, args = $bindable(), selectedTab = $bindable('main'), hasPreprocessor = $bindable(false), captureTable = $bindable(undefined), showCaptures = true, stablePathForCaptures = '', lastSavedCode = undefined, lastDeployedCode = undefined, disableAi = false, assets = $bindable(), modules = $bindable(undefined), editorBarRight, enablePreprocessorSnippet = false } = $props();
|
|
61
61
|
let initialArgs = structuredClone($state.snapshot(args));
|
|
62
62
|
let jsonView = $state(false);
|
|
63
63
|
let schemaHeight = $state(0);
|
|
@@ -986,7 +986,12 @@ function collabUrl() {
|
|
|
986
986
|
return (`${url}?collab=1&workspace=${encodeURIComponent($workspaceStore ?? '')}&lang=${encodeURIComponent(lang ?? '')}` +
|
|
987
987
|
(edit ? '' : `&path=${path}`));
|
|
988
988
|
}
|
|
989
|
-
|
|
989
|
+
const WAC_CONTEXT_LANGUAGES = ['python3', 'bun'];
|
|
990
|
+
let isWac = $derived(template === 'wac_python' ||
|
|
991
|
+
template === 'wac_typescript' ||
|
|
992
|
+
autoKind === 'wac' ||
|
|
993
|
+
(code && lang ? isWorkflowAsCode(code, lang) : false));
|
|
994
|
+
let workflowAsCodeAiContext = $derived(activeModuleTab === null && isWac && WAC_CONTEXT_LANGUAGES.includes(lang ?? ''));
|
|
990
995
|
let showTabs = $derived(hasPreprocessor || isWac);
|
|
991
996
|
$effect(() => {
|
|
992
997
|
!hasPreprocessor && (selectedTab = 'main');
|
|
@@ -1049,7 +1054,8 @@ $effect(() => {
|
|
|
1049
1054
|
path,
|
|
1050
1055
|
lastSavedCode,
|
|
1051
1056
|
lastDeployedCode,
|
|
1052
|
-
diffMode
|
|
1057
|
+
diffMode,
|
|
1058
|
+
workflowAsCode: workflowAsCodeAiContext
|
|
1053
1059
|
};
|
|
1054
1060
|
untrack(() => {
|
|
1055
1061
|
aiChatManager.scriptEditorOptions = options;
|
|
@@ -1818,6 +1824,7 @@ $effect(() => {
|
|
|
1818
1824
|
automaticLayout={true}
|
|
1819
1825
|
{fixedOverflowWidgets}
|
|
1820
1826
|
{args}
|
|
1827
|
+
workflowAsCode={workflowAsCodeAiContext}
|
|
1821
1828
|
{enablePreprocessorSnippet}
|
|
1822
1829
|
preparedAssetsSqlQueries={preparedSqlQueries.current}
|
|
1823
1830
|
customTag={tag}
|
|
@@ -11,6 +11,7 @@ interface Props {
|
|
|
11
11
|
path: string | undefined;
|
|
12
12
|
lang: Preview['language'];
|
|
13
13
|
kind?: string | undefined;
|
|
14
|
+
autoKind?: string | undefined;
|
|
14
15
|
template?: 'pgsql' | 'mysql' | 'script' | 'docker' | 'powershell' | 'bunnative' | 'claudesandbox' | 'wac_python' | 'wac_typescript' | 'ci_test_bun' | 'ci_test_python';
|
|
15
16
|
tag: string | undefined;
|
|
16
17
|
initialArgs?: Record<string, any>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script lang="ts">let { tags, value = $bindable(''), placeholder = '', highlights, onCurrentTagChange, onTextSegmentAtCursorChange, class: className = '' } = $props();
|
|
1
|
+
<script lang="ts">let { tags, value = $bindable(''), placeholder = '', highlights, onCurrentTagChange, onTextSegmentAtCursorChange, onKeyDown, autofocus, class: className = '' } = $props();
|
|
2
2
|
let contentEditableDiv;
|
|
3
3
|
let isUpdating = false;
|
|
4
4
|
$effect(() => {
|
|
@@ -270,6 +270,7 @@ function handleKeyup(e) {
|
|
|
270
270
|
updateCurrentTag(cursorPos);
|
|
271
271
|
}
|
|
272
272
|
function handleKeyDown(e) {
|
|
273
|
+
onKeyDown?.(e);
|
|
273
274
|
if (e.key === 'ArrowDown' || e.key === 'ArrowUp' || e.key === 'Enter')
|
|
274
275
|
return;
|
|
275
276
|
const cursorPos = getCursorPosition();
|
|
@@ -427,6 +428,7 @@ export function focusAtEnd() {
|
|
|
427
428
|
}
|
|
428
429
|
</script>
|
|
429
430
|
|
|
431
|
+
<!-- svelte-ignore a11y_autofocus -->
|
|
430
432
|
<div
|
|
431
433
|
bind:this={contentEditableDiv}
|
|
432
434
|
contenteditable="true"
|
|
@@ -441,6 +443,7 @@ export function focusAtEnd() {
|
|
|
441
443
|
role="textbox"
|
|
442
444
|
tabindex="0"
|
|
443
445
|
spellcheck="false"
|
|
446
|
+
{autofocus}
|
|
444
447
|
></div>
|
|
445
448
|
|
|
446
449
|
<style>
|