windmill-components 1.83.4 → 1.85.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/components/AppConnect.svelte +2 -2
- package/components/ArgInfo.svelte +4 -6
- package/components/ArgInput.svelte +12 -12
- package/components/ArgInput.svelte.d.ts +1 -2
- package/components/CronInput.svelte +1 -1
- package/components/DisplayResult.svelte +5 -7
- package/components/Dropdown.svelte +5 -4
- package/components/Editor.svelte +47 -47
- package/components/EditorBar.svelte +58 -27
- package/components/FlowBuilder.svelte +65 -59
- package/components/FlowGraphViewer.svelte +3 -8
- package/components/FlowPreviewContent.svelte +11 -9
- package/components/FlowStatusViewer.svelte +54 -44
- package/components/FolderEditor.svelte +2 -10
- package/components/FolderUsageInfo.svelte +1 -1
- package/components/GroupEditor.svelte +6 -15
- package/components/HighlightCode.svelte +1 -1
- package/components/InlineCodeCopy.svelte +2 -1
- package/components/InputTransformForm.svelte +1 -2
- package/components/InputTransformSchemaForm.svelte +1 -1
- package/components/InputTransformsViewer.svelte +1 -1
- package/components/LightweightArgInput.svelte +9 -0
- package/components/LightweightSchemaForm.svelte +1 -1
- package/components/Modal.svelte +2 -2
- package/components/ModulePreview.svelte +10 -10
- package/components/ModuleStatus.svelte +0 -1
- package/components/Multiselect.svelte +1 -0
- package/components/ObjectResourceInput.svelte +1 -23
- package/components/Path.svelte +42 -92
- package/components/Range.svelte +1 -4
- package/components/ResourceEditor.svelte +6 -6
- package/components/ResourcePicker.svelte +2 -2
- package/components/RunForm.svelte +5 -6
- package/components/ScheduleEditor.svelte +10 -10
- package/components/SchemaModal.svelte +1 -0
- package/components/SchemaModal.svelte.d.ts +1 -1
- package/components/ScriptEditor.svelte +0 -1
- package/components/SearchItems.svelte +1 -1
- package/components/SharedBadge.svelte +0 -1
- package/components/SimpleEditor.svelte +10 -36
- package/components/TemplateEditor.svelte +8 -29
- package/components/apps/components/display/AppBarChart.svelte +5 -5
- package/components/apps/components/display/AppImage.svelte +1 -1
- package/components/apps/components/display/AppPdf.svelte +12 -11
- package/components/apps/components/display/AppPdf.svelte.d.ts +1 -0
- package/components/apps/components/display/AppText.svelte +10 -10
- package/components/apps/components/display/table/AppAggridTable.svelte +25 -12
- package/components/apps/components/display/table/AppAggridTable.svelte.d.ts +1 -1
- package/components/apps/components/display/table/AppTable.svelte +1 -2
- package/components/apps/components/display/table/AppTableFooter.svelte +0 -1
- package/components/apps/components/helpers/NonRunnableComponent.svelte +1 -3
- package/components/apps/components/helpers/RunnableComponent.svelte +16 -0
- package/components/apps/components/helpers/eval.d.ts +4 -0
- package/components/apps/components/helpers/eval.js +3 -1
- package/components/apps/components/inputs/AppMultiSelect.svelte +2 -2
- package/components/apps/components/inputs/AppRangeInput.svelte +5 -5
- package/components/apps/components/inputs/AppTextInput.svelte +11 -7
- package/components/apps/components/layout/AppTabs.svelte +1 -1
- package/components/apps/editor/AppEditor.svelte +13 -17
- package/components/apps/editor/AppEditorHeader.svelte +37 -2
- package/components/apps/editor/SubGridEditor.svelte +5 -7
- package/components/apps/editor/appUtils.d.ts +2 -0
- package/components/apps/editor/appUtils.js +30 -1
- package/components/apps/editor/component/ComponentWrapper.svelte +6 -2
- package/components/apps/editor/componentsPanel/CssSettings.svelte +0 -2
- package/components/apps/editor/componentsPanel/QuickStyleMenu.svelte +2 -2
- package/components/apps/editor/contextPanel/ContextPanel.svelte +1 -2
- package/components/apps/editor/contextPanel/components/IdEditor.svelte +90 -0
- package/components/apps/editor/contextPanel/components/IdEditor.svelte.d.ts +18 -0
- package/components/apps/editor/contextPanel/components/OutputHeader.svelte +92 -21
- package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelList.svelte +3 -3
- package/components/apps/editor/settingsPanel/TableActions.svelte +1 -1
- package/components/apps/editor/settingsPanel/mainInput/WorkspaceFlowList.svelte +2 -5
- package/components/apps/editor/settingsPanel/mainInput/WorkspaceScriptList.svelte +2 -5
- package/components/apps/svelte-grid/utils/helper.js +1 -1
- package/components/apps/types.d.ts +6 -0
- package/components/apps/utils.d.ts +1 -3
- package/components/apps/utils.js +2 -30
- package/components/common/badge/Badge.svelte +0 -1
- package/components/common/button/ButtonPopup.svelte +13 -10
- package/components/common/drawer/Drawer.svelte +2 -2
- package/components/common/drawer/DrawerContent.svelte +1 -5
- package/components/common/popup/Popup.svelte +7 -3
- package/components/common/popup/Popup.svelte.d.ts +6 -0
- package/components/common/table/AppRow.svelte +0 -1
- package/components/common/table/FlowRow.svelte +0 -1
- package/components/common/table/ScriptRow.svelte +0 -1
- package/components/flows/CreateActionsApp.svelte +2 -2
- package/components/flows/content/DynamicInputHelpBox.svelte +1 -0
- package/components/flows/content/FlowBranchesAllWrapper.svelte +2 -2
- package/components/flows/content/FlowBranchesOneWrapper.svelte +2 -2
- package/components/flows/content/FlowInputsFlow.svelte +1 -1
- package/components/flows/content/FlowInputsFlow.svelte.d.ts +1 -3
- package/components/flows/content/FlowModuleComponent.svelte +26 -28
- package/components/flows/content/FlowModuleWrapper.svelte +0 -1
- package/components/flows/content/FlowRetries.svelte +1 -2
- package/components/flows/content/ScriptEditorDrawer.svelte +1 -1
- package/components/flows/flowStateUtils.d.ts +0 -3
- package/components/flows/flowStateUtils.js +3 -23
- package/components/flows/header/FlowPreviewButtons.svelte +0 -1
- package/components/flows/idUtils.d.ts +4 -0
- package/components/flows/idUtils.js +47 -0
- package/components/flows/map/FlowModuleSchemaItem.svelte +6 -6
- package/components/flows/map/MapItem.svelte +9 -9
- package/components/flows/map/MapItem.svelte.d.ts +0 -1
- package/components/flows/utils.d.ts +0 -2
- package/components/flows/utils.js +3 -35
- package/components/graph/FlowGraph.svelte +1 -1
- package/components/graph/svelvet/collapsible/controllers/util.js +3 -14
- package/components/graph/svelvet/container/views/GraphView.svelte +9 -14
- package/components/graph/svelvet/container/views/Svelvet.svelte +1 -0
- package/components/graph/svelvet/edges/controllers/anchorCbDev.js +5 -5
- package/components/graph/svelvet/edges/controllers/util.js +1 -1
- package/components/graph/svelvet/edges/models/Edge.js +2 -2
- package/components/graph/svelvet/edges/views/Edges/SimpleBezierEdge.svelte +1 -1
- package/components/graph/svelvet/nodes/models/Node.js +0 -1
- package/components/graph/svelvet/nodes/views/Node.svelte +0 -1
- package/components/graph/svelvet/nodes/views/Node.svelte.d.ts +0 -1
- package/components/graph/svelvet/store/controllers/util.d.ts +1 -1
- package/components/graph/svelvet/store/controllers/util.js +3 -3
- package/components/home/ItemsList.svelte +11 -11
- package/components/propertyPicker/ObjectViewer.svelte +0 -5
- package/components/propertyPicker/ObjectViewer.svelte.d.ts +0 -1
- package/components/sidebar/WorkspaceMenu.svelte +8 -4
- package/editorUtils.d.ts +3 -0
- package/editorUtils.js +5 -2
- package/gen/core/OpenAPI.js +1 -1
- package/gen/index.d.ts +1 -1
- package/gen/index.js +1 -0
- package/gen/models/MainArgSignature.d.ts +8 -0
- package/gen/models/MainArgSignature.js +8 -1
- package/infer.js +3 -0
- package/init_scripts/python_init_code.d.ts +1 -1
- package/init_scripts/python_init_code.js +2 -2
- package/package.json +673 -674
- package/stores.js +14 -1
- package/user.d.ts +1 -1
- package/user.js +6 -6
- package/components/graph/svelvet/editEdges/views/EditEdge.svelte +0 -151
- package/components/graph/svelvet/editEdges/views/EditEdge.svelte.d.ts +0 -20
- package/components/path_store.d.ts +0 -1
- package/components/path_store.js +0 -2
package/components/Path.svelte
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
|
+
<script context="module">"use strict";
|
|
2
|
+
const lastMetaUsed = writable(undefined);
|
|
3
|
+
</script>
|
|
4
|
+
|
|
1
5
|
<script>import { pathToMeta } from '../common';
|
|
2
|
-
import { AppService, FlowService, FolderService,
|
|
6
|
+
import { AppService, FlowService, FolderService, ResourceService, ScheduleService, ScriptService, VariableService } from '../gen';
|
|
3
7
|
import { superadmin, userStore, workspaceStore } from '../stores';
|
|
8
|
+
import { faEye, faPlus } from '@fortawesome/free-solid-svg-icons';
|
|
4
9
|
import { createEventDispatcher } from 'svelte';
|
|
5
|
-
import
|
|
10
|
+
import { Icon } from 'svelte-awesome';
|
|
11
|
+
import { writable } from 'svelte/store';
|
|
6
12
|
import { Button, Drawer, DrawerContent } from './common';
|
|
7
|
-
import
|
|
8
|
-
import ToggleButtonGroup from './common/toggleButton/ToggleButtonGroup.svelte';
|
|
13
|
+
import Badge from './common/badge/Badge.svelte';
|
|
9
14
|
import ToggleButton from './common/toggleButton/ToggleButton.svelte';
|
|
10
|
-
import
|
|
11
|
-
import Tooltip from './Tooltip.svelte';
|
|
15
|
+
import ToggleButtonGroup from './common/toggleButton/ToggleButtonGroup.svelte';
|
|
12
16
|
import FolderEditor from './FolderEditor.svelte';
|
|
13
|
-
import GroupEditor from './GroupEditor.svelte';
|
|
14
17
|
import { random_adj } from './random_positive_adjetive';
|
|
15
|
-
import
|
|
18
|
+
import Required from './Required.svelte';
|
|
19
|
+
import Tooltip from './Tooltip.svelte';
|
|
16
20
|
let meta = undefined;
|
|
17
21
|
export let namePlaceholder = '';
|
|
18
22
|
export let initialPath;
|
|
@@ -24,12 +28,15 @@ export let kind;
|
|
|
24
28
|
let inputP = undefined;
|
|
25
29
|
const dispatch = createEventDispatcher();
|
|
26
30
|
let folders = [];
|
|
27
|
-
let groups = [];
|
|
28
31
|
$: meta && onMetaChange();
|
|
29
32
|
function onMetaChange() {
|
|
30
33
|
if (meta) {
|
|
31
34
|
path = metaToPath(meta);
|
|
32
35
|
validate(meta, path, kind);
|
|
36
|
+
$lastMetaUsed = {
|
|
37
|
+
...meta,
|
|
38
|
+
name: ''
|
|
39
|
+
};
|
|
33
40
|
}
|
|
34
41
|
}
|
|
35
42
|
function metaToPath(meta) {
|
|
@@ -47,12 +54,17 @@ function handleKeyUp(event) {
|
|
|
47
54
|
}
|
|
48
55
|
export async function reset() {
|
|
49
56
|
if (path == '' || path == 'u//') {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
57
|
+
if ($lastMetaUsed == undefined) {
|
|
58
|
+
meta = {
|
|
59
|
+
ownerKind: 'user',
|
|
60
|
+
name: random_adj() + '_' + namePlaceholder,
|
|
61
|
+
owner: ''
|
|
62
|
+
};
|
|
63
|
+
meta.owner = $userStore.username.split('@')[0].replace(/[^a-zA-Z0-9]/g, '');
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
meta = { ...$lastMetaUsed, name: random_adj() + '_' + namePlaceholder };
|
|
67
|
+
}
|
|
56
68
|
let newMeta = { ...meta };
|
|
57
69
|
while (await pathExists(metaToPath(newMeta), kind)) {
|
|
58
70
|
disabled = true;
|
|
@@ -73,20 +85,18 @@ async function loadFolders() {
|
|
|
73
85
|
let initialFolder = '';
|
|
74
86
|
if (initialPath?.split('/')?.[0] == 'f') {
|
|
75
87
|
initialFolder = initialPath?.split('/')?.[1];
|
|
76
|
-
initialFolders.push(initialFolder);
|
|
88
|
+
initialFolders.push({ name: initialFolder, write: true });
|
|
77
89
|
}
|
|
78
90
|
folders = initialFolders.concat((await FolderService.listFolderNames({
|
|
79
91
|
workspace: $workspaceStore
|
|
80
|
-
}))
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
workspace: $workspaceStore
|
|
89
|
-
}));
|
|
92
|
+
}))
|
|
93
|
+
.filter((x) => x != initialFolder)
|
|
94
|
+
.map((x) => ({
|
|
95
|
+
name: x,
|
|
96
|
+
write: ($userStore?.folders?.includes(x) == true ?? false) ||
|
|
97
|
+
($userStore?.is_admin ?? false) ||
|
|
98
|
+
($userStore?.is_super_admin ?? false)
|
|
99
|
+
})));
|
|
90
100
|
}
|
|
91
101
|
async function validate(meta, path, kind) {
|
|
92
102
|
error = '';
|
|
@@ -164,7 +174,6 @@ function validateName(meta) {
|
|
|
164
174
|
$: {
|
|
165
175
|
if ($workspaceStore && $userStore) {
|
|
166
176
|
loadFolders();
|
|
167
|
-
loadGroups();
|
|
168
177
|
initPath();
|
|
169
178
|
}
|
|
170
179
|
}
|
|
@@ -192,54 +201,14 @@ async function addFolder() {
|
|
|
192
201
|
requestBody: { name: newFolderName }
|
|
193
202
|
});
|
|
194
203
|
folderCreated = newFolderName;
|
|
195
|
-
|
|
196
|
-
meta.owner = newFolderName;
|
|
197
|
-
}
|
|
204
|
+
$userStore?.folders?.push(newFolderName);
|
|
198
205
|
loadFolders();
|
|
199
|
-
}
|
|
200
|
-
let newGroup;
|
|
201
|
-
let viewGroup;
|
|
202
|
-
let newGroupName;
|
|
203
|
-
let groupCreated = undefined;
|
|
204
|
-
async function addGroup() {
|
|
205
|
-
await GroupService.createGroup({
|
|
206
|
-
workspace: $workspaceStore ?? '',
|
|
207
|
-
requestBody: { name: newGroupName }
|
|
208
|
-
});
|
|
209
|
-
groupCreated = newGroupName;
|
|
210
206
|
if (meta) {
|
|
211
|
-
meta.owner =
|
|
207
|
+
meta.owner = newFolderName;
|
|
212
208
|
}
|
|
213
|
-
loadGroups();
|
|
214
209
|
}
|
|
215
210
|
</script>
|
|
216
211
|
|
|
217
|
-
<Drawer bind:this={newGroup}>
|
|
218
|
-
<DrawerContent
|
|
219
|
-
title="New Folder"
|
|
220
|
-
on:close={() => {
|
|
221
|
-
newGroup.closeDrawer()
|
|
222
|
-
groupCreated = undefined
|
|
223
|
-
}}
|
|
224
|
-
>
|
|
225
|
-
<div class="flex flex-row">
|
|
226
|
-
<input class="mr-2" placeholder="New group name" bind:value={newGroupName} />
|
|
227
|
-
<Button size="md" endIcon={{ icon: faPlus }} disabled={!newGroupName} on:click={addGroup}>
|
|
228
|
-
New group
|
|
229
|
-
</Button>
|
|
230
|
-
</div>
|
|
231
|
-
{#if groupCreated}
|
|
232
|
-
<div class="mt-8" />
|
|
233
|
-
<GroupEditor name={groupCreated} />
|
|
234
|
-
{/if}
|
|
235
|
-
</DrawerContent>
|
|
236
|
-
</Drawer>
|
|
237
|
-
<Drawer bind:this={viewGroup}>
|
|
238
|
-
<DrawerContent title="Folder {meta?.owner}" on:close={viewGroup.closeDrawer}>
|
|
239
|
-
<GroupEditor name={meta?.owner ?? ''} />
|
|
240
|
-
</DrawerContent>
|
|
241
|
-
</Drawer>
|
|
242
|
-
|
|
243
212
|
<Drawer bind:this={newFolder}>
|
|
244
213
|
<DrawerContent
|
|
245
214
|
title="New Folder"
|
|
@@ -276,6 +245,7 @@ async function addGroup() {
|
|
|
276
245
|
<div class="flex flex-col sm:flex-row items-center gap-2 sm:gap-4 pb-0 mb-1">
|
|
277
246
|
{#if meta != undefined}
|
|
278
247
|
<div class="flex gap-4 shrink">
|
|
248
|
+
<!-- svelte-ignore a11y-label-has-associated-control -->
|
|
279
249
|
<label class="block">
|
|
280
250
|
<span class="text-gray-700 text-sm whitespace-nowrap">Owner</span>
|
|
281
251
|
|
|
@@ -322,8 +292,8 @@ async function addGroup() {
|
|
|
322
292
|
|
|
323
293
|
<div class="flex flex-row gap-1 w-full">
|
|
324
294
|
<select class="grow w-full" {disabled} bind:value={meta.owner}>
|
|
325
|
-
{#each folders as
|
|
326
|
-
<option>{
|
|
295
|
+
{#each folders as { name, write }}
|
|
296
|
+
<option disabled={!write}>{name}{write ? '' : ' (read-only)'}</option>
|
|
327
297
|
{/each}
|
|
328
298
|
</select>
|
|
329
299
|
<Button variant="border" size="xs" on:click={viewFolder.openDrawer}>
|
|
@@ -334,27 +304,6 @@ async function addGroup() {
|
|
|
334
304
|
></div
|
|
335
305
|
>
|
|
336
306
|
</label>
|
|
337
|
-
{:else if meta.ownerKind === 'group'}
|
|
338
|
-
<label class="block grow w-48">
|
|
339
|
-
<span class="text-gray-700 text-sm"
|
|
340
|
-
>Group <Tooltip>Item will be owned by the group and hence all its member</Tooltip
|
|
341
|
-
></span
|
|
342
|
-
>
|
|
343
|
-
|
|
344
|
-
<div class="flex flex-row gap-1">
|
|
345
|
-
<select class="grow w-full" {disabled} bind:value={meta.owner}>
|
|
346
|
-
{#each groups as g}
|
|
347
|
-
<option>{g}</option>
|
|
348
|
-
{/each}
|
|
349
|
-
</select>
|
|
350
|
-
<Button variant="border" size="xs" on:click={viewGroup.openDrawer}>
|
|
351
|
-
<Icon scale={0.8} data={faEye} /></Button
|
|
352
|
-
>
|
|
353
|
-
<Button variant="border" size="xs" on:click={newGroup.openDrawer}>
|
|
354
|
-
<Icon scale={0.8} data={faPlus} /></Button
|
|
355
|
-
></div
|
|
356
|
-
>
|
|
357
|
-
</label>
|
|
358
307
|
{/if}
|
|
359
308
|
</div>
|
|
360
309
|
<label class="block grow w-full max-w-md">
|
|
@@ -362,6 +311,7 @@ async function addGroup() {
|
|
|
362
311
|
Name
|
|
363
312
|
<Required required={true} />
|
|
364
313
|
</span>
|
|
314
|
+
<!-- svelte-ignore a11y-autofocus -->
|
|
365
315
|
<input
|
|
366
316
|
{disabled}
|
|
367
317
|
type="text"
|
package/components/Range.svelte
CHANGED
|
@@ -51,10 +51,6 @@
|
|
|
51
51
|
onDragStart(e)
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
function onHover(e) {
|
|
55
|
-
thumbHover = thumbHover ? false : true
|
|
56
|
-
}
|
|
57
|
-
|
|
58
54
|
function onDragStart(e) {
|
|
59
55
|
// If mouse event add a pointer events shield
|
|
60
56
|
if (e.type === 'mousedown') document.body.append(mouseEventShield)
|
|
@@ -182,6 +178,7 @@
|
|
|
182
178
|
>
|
|
183
179
|
<div class="range__track" bind:this={container}>
|
|
184
180
|
<div class="range__track--highlighted" bind:this={progressBar} />
|
|
181
|
+
<!-- svelte-ignore a11y-mouse-events-have-key-events -->
|
|
185
182
|
<div
|
|
186
183
|
class="range__thumb"
|
|
187
184
|
class:range__thumb--holding={holding}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
<script>import { ResourceService
|
|
1
|
+
<script>import { ResourceService } from '../gen';
|
|
2
2
|
import { canWrite, emptyString, sendUserToast } from '../utils';
|
|
3
3
|
import { createEventDispatcher } from 'svelte';
|
|
4
|
+
import { Alert, Button, Drawer, Skeleton } from './common';
|
|
4
5
|
import Path from './Path.svelte';
|
|
5
6
|
import Required from './Required.svelte';
|
|
6
|
-
import { Alert, Button, Drawer, Skeleton } from './common';
|
|
7
7
|
import { userStore, workspaceStore } from '../stores';
|
|
8
|
-
import DrawerContent from './common/drawer/DrawerContent.svelte';
|
|
9
|
-
import autosize from 'svelte-autosize';
|
|
10
|
-
import SimpleEditor from './SimpleEditor.svelte';
|
|
11
8
|
import { faSave } from '@fortawesome/free-solid-svg-icons';
|
|
9
|
+
import autosize from 'svelte-autosize';
|
|
10
|
+
import DrawerContent from './common/drawer/DrawerContent.svelte';
|
|
12
11
|
import SchemaForm from './SchemaForm.svelte';
|
|
12
|
+
import SimpleEditor from './SimpleEditor.svelte';
|
|
13
13
|
import Toggle from './Toggle.svelte';
|
|
14
14
|
let path = '';
|
|
15
15
|
let initialPath = '';
|
|
@@ -118,7 +118,7 @@ function switchTab(asJson) {
|
|
|
118
118
|
on:close={drawer.closeDrawer}
|
|
119
119
|
>
|
|
120
120
|
<div>
|
|
121
|
-
<div class="flex flex-col gap-3 py-3
|
|
121
|
+
<div class="flex flex-col gap-3 py-3 text-gray-700">
|
|
122
122
|
<div>
|
|
123
123
|
{#if !can_write}
|
|
124
124
|
<div class="m-2">
|
|
@@ -3,11 +3,11 @@ import { workspaceStore } from '../stores';
|
|
|
3
3
|
import { faPen, faPlus, faRotateRight } from '@fortawesome/free-solid-svg-icons';
|
|
4
4
|
import { createEventDispatcher } from 'svelte';
|
|
5
5
|
import Icon from 'svelte-awesome';
|
|
6
|
-
import { Button } from './common';
|
|
7
6
|
import Select from 'svelte-select';
|
|
7
|
+
import { SELECT_INPUT_DEFAULT_STYLE } from '../defaults';
|
|
8
8
|
import AppConnect from './AppConnect.svelte';
|
|
9
|
+
import { Button } from './common';
|
|
9
10
|
import ResourceEditor from './ResourceEditor.svelte';
|
|
10
|
-
import { SELECT_INPUT_DEFAULT_STYLE } from '../defaults';
|
|
11
11
|
const dispatch = createEventDispatcher();
|
|
12
12
|
export let initialValue = undefined;
|
|
13
13
|
export let value = initialValue;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
<script>import {
|
|
2
|
-
import { decodeArgs, defaultIfEmptyString, displayDaysAgo, emptyString, getToday, truncateHash } from '../utils';
|
|
1
|
+
<script>import { defaultIfEmptyString, displayDaysAgo, emptyString, getToday, truncateHash } from '../utils';
|
|
3
2
|
import { slide } from 'svelte/transition';
|
|
3
|
+
import { runFormStore, userStore } from '../stores';
|
|
4
4
|
import { faChevronDown, faChevronUp } from '@fortawesome/free-solid-svg-icons';
|
|
5
|
-
import
|
|
5
|
+
import CliHelpBox from './CliHelpBox.svelte';
|
|
6
6
|
import { Badge, Button } from './common';
|
|
7
|
+
import InlineCodeCopy from './InlineCodeCopy.svelte';
|
|
8
|
+
import SchemaForm from './SchemaForm.svelte';
|
|
7
9
|
import SharedBadge from './SharedBadge.svelte';
|
|
8
10
|
import Toggle from './Toggle.svelte';
|
|
9
|
-
import { runFormStore, userStore } from '../stores';
|
|
10
11
|
import Tooltip from './Tooltip.svelte';
|
|
11
|
-
import CliHelpBox from './CliHelpBox.svelte';
|
|
12
|
-
import InlineCodeCopy from './InlineCodeCopy.svelte';
|
|
13
12
|
export let runnable;
|
|
14
13
|
export let runAction;
|
|
15
14
|
export let buttonText = 'Run';
|
|
@@ -6,20 +6,20 @@
|
|
|
6
6
|
}
|
|
7
7
|
</script>
|
|
8
8
|
|
|
9
|
-
<script>import
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
9
|
+
<script>import Toggle from './Toggle.svelte';
|
|
10
|
+
import { FlowService, ScheduleService, Script, ScriptService } from '../gen';
|
|
11
|
+
import { canWrite, emptyString, formatCron, sendUserToast } from '../utils';
|
|
12
|
+
import { Alert, Button } from './common';
|
|
13
|
+
import Drawer from './common/drawer/Drawer.svelte';
|
|
14
|
+
import DrawerContent from './common/drawer/DrawerContent.svelte';
|
|
15
|
+
import CronInput, { OFFSET } from './CronInput.svelte';
|
|
12
16
|
import Path from './Path.svelte';
|
|
13
|
-
import
|
|
14
|
-
import Tooltip from './Tooltip.svelte';
|
|
15
|
-
import { userStore, workspaceStore } from '../stores';
|
|
17
|
+
import Required from './Required.svelte';
|
|
16
18
|
import SchemaForm from './SchemaForm.svelte';
|
|
17
19
|
import ScriptPicker from './ScriptPicker.svelte';
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
+
import Tooltip from './Tooltip.svelte';
|
|
21
|
+
import { userStore, workspaceStore } from '../stores';
|
|
20
22
|
import { faSave } from '@fortawesome/free-solid-svg-icons';
|
|
21
|
-
import Drawer from './common/drawer/Drawer.svelte';
|
|
22
|
-
import DrawerContent from './common/drawer/DrawerContent.svelte';
|
|
23
23
|
import { createEventDispatcher } from 'svelte';
|
|
24
24
|
let initialPath = '';
|
|
25
25
|
let edit = true;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
import type { SchemaProperty } from '../common';
|
|
3
3
|
export declare const ARG_TYPES: readonly ["integer", "number", "string", "boolean", "object", "array"];
|
|
4
|
-
export type ArgType = typeof ARG_TYPES[number];
|
|
4
|
+
export type ArgType = (typeof ARG_TYPES)[number];
|
|
5
5
|
export interface ModalSchemaProperty {
|
|
6
6
|
selectedType?: string;
|
|
7
7
|
description: string;
|
|
@@ -13,7 +13,7 @@ function filterItems() {
|
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
15
|
// pre-filter
|
|
16
|
-
let idxs = uf.filter(plaintextItems, filter);
|
|
16
|
+
let idxs = uf.filter(plaintextItems, filter) ?? [];
|
|
17
17
|
let info = uf.info(idxs, plaintextItems, filter);
|
|
18
18
|
let order = uf.sort(info, plaintextItems, filter);
|
|
19
19
|
let result = [];
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
<script>import { browser
|
|
2
|
-
import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker';
|
|
3
|
-
import jsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker';
|
|
4
|
-
import yamlWorker from 'monaco-yaml/yaml.worker?worker';
|
|
5
|
-
import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker';
|
|
6
|
-
import { buildWorkerDefinition } from 'monaco-editor-workers';
|
|
7
|
-
import { createEventDispatcher, onDestroy, onMount } from 'svelte';
|
|
1
|
+
<script>import { browser } from '$app/environment';
|
|
8
2
|
import { createHash, editorConfig, langToExt, updateOptions } from '../editorUtils';
|
|
9
|
-
import {
|
|
3
|
+
import { editor as meditor, KeyCode, KeyMod, languages, Uri as mUri } from 'monaco-editor';
|
|
4
|
+
import { createEventDispatcher, onDestroy, onMount } from 'svelte';
|
|
10
5
|
import libStdContent from '../es5.d.ts.txt?raw';
|
|
6
|
+
import { buildWorkerDefinition } from 'monaco-editor-workers';
|
|
11
7
|
meditor.defineTheme('myTheme', {
|
|
12
8
|
base: 'vs',
|
|
13
9
|
inherit: true,
|
|
@@ -44,30 +40,7 @@ export let autoHeight = false;
|
|
|
44
40
|
export let fixedOverflowWidgets = true;
|
|
45
41
|
const dispatch = createEventDispatcher();
|
|
46
42
|
const uri = `file:///${hash}.${langToExt(lang)}`;
|
|
47
|
-
|
|
48
|
-
if (dev) {
|
|
49
|
-
buildWorkerDefinition('../../../node_modules/monaco-editor-workers/dist/workers', import.meta.url, false);
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
// @ts-ignore
|
|
53
|
-
self.MonacoEnvironment = {
|
|
54
|
-
getWorker: function (_moduleId, label) {
|
|
55
|
-
if (label === 'json') {
|
|
56
|
-
return new jsonWorker();
|
|
57
|
-
}
|
|
58
|
-
else if (label === 'yaml') {
|
|
59
|
-
return new yamlWorker();
|
|
60
|
-
}
|
|
61
|
-
else if (label === 'typescript' || label === 'javascript') {
|
|
62
|
-
return new tsWorker();
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
return new editorWorker();
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
}
|
|
43
|
+
buildWorkerDefinition('../../../workers', import.meta.url, false);
|
|
71
44
|
export function getCode() {
|
|
72
45
|
return editor?.getValue() ?? '';
|
|
73
46
|
}
|
|
@@ -99,7 +72,11 @@ let width = 0;
|
|
|
99
72
|
async function loadMonaco() {
|
|
100
73
|
model = meditor.createModel(code, lang, mUri.parse(uri));
|
|
101
74
|
model.updateOptions(updateOptions);
|
|
102
|
-
|
|
75
|
+
let widgets = document.getElementById('monaco-widgets-root') ?? undefined;
|
|
76
|
+
editor = meditor.create(divEl, {
|
|
77
|
+
...editorConfig(model, code, lang, automaticLayout, fixedOverflowWidgets),
|
|
78
|
+
overflowWidgetsDomNode: widgets
|
|
79
|
+
});
|
|
103
80
|
let timeoutModel = undefined;
|
|
104
81
|
editor.onDidChangeModelContent((event) => {
|
|
105
82
|
timeoutModel && clearTimeout(timeoutModel);
|
|
@@ -116,18 +93,15 @@ async function loadMonaco() {
|
|
|
116
93
|
});
|
|
117
94
|
});
|
|
118
95
|
if (autoHeight) {
|
|
119
|
-
let ignoreEvent = false;
|
|
120
96
|
const updateHeight = () => {
|
|
121
97
|
const contentHeight = Math.min(1000, editor.getContentHeight());
|
|
122
98
|
if (divEl) {
|
|
123
99
|
divEl.style.height = `${contentHeight}px`;
|
|
124
100
|
}
|
|
125
101
|
try {
|
|
126
|
-
ignoreEvent = true;
|
|
127
102
|
editor.layout({ width, height: contentHeight });
|
|
128
103
|
}
|
|
129
104
|
finally {
|
|
130
|
-
ignoreEvent = false;
|
|
131
105
|
}
|
|
132
106
|
};
|
|
133
107
|
editor.onDidContentSizeChange(updateHeight);
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
<script>import { browser
|
|
2
|
-
import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker';
|
|
3
|
-
import { buildWorkerDefinition } from 'monaco-editor-workers';
|
|
4
|
-
import { createEventDispatcher, onDestroy, onMount } from 'svelte';
|
|
1
|
+
<script>import { browser } from '$app/environment';
|
|
5
2
|
import { convertKind, createDocumentationString, createHash, displayPartsToString, editorConfig, updateOptions } from '../editorUtils';
|
|
6
|
-
import { languages, editor as meditor, Uri as mUri, Range } from 'monaco-editor';
|
|
7
3
|
import libStdContent from '../es5.d.ts.txt?raw';
|
|
8
|
-
import
|
|
4
|
+
import { editor as meditor, languages, Range, Uri as mUri } from 'monaco-editor';
|
|
5
|
+
import { buildWorkerDefinition } from 'monaco-editor-workers';
|
|
6
|
+
import { createEventDispatcher, onDestroy, onMount } from 'svelte';
|
|
9
7
|
languages.typescript.javascriptDefaults.setCompilerOptions({
|
|
10
8
|
target: languages.typescript.ScriptTarget.Latest,
|
|
11
9
|
allowNonTsExtensions: true,
|
|
@@ -344,24 +342,7 @@ if (typeof code != 'string') {
|
|
|
344
342
|
const lang = 'template';
|
|
345
343
|
const dispatch = createEventDispatcher();
|
|
346
344
|
const uri = `file:///${hash}.ts`;
|
|
347
|
-
|
|
348
|
-
if (dev) {
|
|
349
|
-
buildWorkerDefinition('../../../node_modules/monaco-editor-workers/dist/workers', import.meta.url, false);
|
|
350
|
-
}
|
|
351
|
-
else {
|
|
352
|
-
// @ts-ignore
|
|
353
|
-
self.MonacoEnvironment = {
|
|
354
|
-
getWorker: function (_moduleId, label) {
|
|
355
|
-
if (label == 'typescript' || label == 'javascript') {
|
|
356
|
-
return new tsWorker();
|
|
357
|
-
}
|
|
358
|
-
else {
|
|
359
|
-
return new editorWorker();
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
};
|
|
363
|
-
}
|
|
364
|
-
}
|
|
345
|
+
buildWorkerDefinition('../../../workers', import.meta.url, false);
|
|
365
346
|
export function insertAtCursor(code) {
|
|
366
347
|
if (editor) {
|
|
367
348
|
editor.trigger('keyboard', 'type', { text: code });
|
|
@@ -379,11 +360,13 @@ export function getCode() {
|
|
|
379
360
|
let cip;
|
|
380
361
|
let extraModel;
|
|
381
362
|
let width = 0;
|
|
363
|
+
let widgets = document.getElementById('monaco-widgets-root') ?? undefined;
|
|
382
364
|
async function loadMonaco() {
|
|
383
365
|
model = meditor.createModel(code, lang, mUri.parse(uri));
|
|
384
366
|
model.updateOptions(updateOptions);
|
|
385
367
|
editor = meditor.create(divEl, {
|
|
386
368
|
...editorConfig(model, code, lang, automaticLayout, fixedOverflowWidgets),
|
|
369
|
+
overflowWidgetsDomNode: widgets,
|
|
387
370
|
lineNumbers: 'off',
|
|
388
371
|
fontSize,
|
|
389
372
|
suggestOnTriggerCharacters: true,
|
|
@@ -473,19 +456,15 @@ async function loadMonaco() {
|
|
|
473
456
|
}, 200);
|
|
474
457
|
});
|
|
475
458
|
if (autoHeight) {
|
|
476
|
-
let ignoreEvent = false;
|
|
477
459
|
const updateHeight = () => {
|
|
478
460
|
const contentHeight = Math.min(1000, editor.getContentHeight());
|
|
479
461
|
if (divEl) {
|
|
480
462
|
divEl.style.height = `${contentHeight}px`;
|
|
481
463
|
}
|
|
482
464
|
try {
|
|
483
|
-
ignoreEvent = true;
|
|
484
465
|
editor.layout({ width, height: contentHeight });
|
|
485
466
|
}
|
|
486
|
-
|
|
487
|
-
ignoreEvent = false;
|
|
488
|
-
}
|
|
467
|
+
catch { }
|
|
489
468
|
};
|
|
490
469
|
editor.onDidContentSizeChange(updateHeight);
|
|
491
470
|
updateHeight();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
<script>import {
|
|
2
|
-
import { Chart as ChartJS, Title, Tooltip, Legend, LineElement, LinearScale, PointElement, CategoryScale, BarElement } from 'chart.js';
|
|
3
|
-
import RunnableWrapper from '../helpers/RunnableWrapper.svelte';
|
|
4
|
-
import InputValue from '../helpers/InputValue.svelte';
|
|
5
|
-
import { concatCustomCss } from '../../utils';
|
|
1
|
+
<script>import { BarElement, CategoryScale, Chart as ChartJS, Legend, LinearScale, LineElement, PointElement, Title, Tooltip } from 'chart.js';
|
|
6
2
|
import { getContext } from 'svelte';
|
|
3
|
+
import { Bar, Line } from 'svelte-chartjs';
|
|
7
4
|
import { initOutput } from '../../editor/appUtils';
|
|
5
|
+
import { concatCustomCss } from '../../utils';
|
|
6
|
+
import InputValue from '../helpers/InputValue.svelte';
|
|
7
|
+
import RunnableWrapper from '../helpers/RunnableWrapper.svelte';
|
|
8
8
|
export let id;
|
|
9
9
|
export let componentInput;
|
|
10
10
|
export let configuration;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script>import { getContext } from 'svelte';
|
|
2
2
|
import { twMerge } from 'tailwind-merge';
|
|
3
3
|
import { initConfig, initOutput } from '../../editor/appUtils';
|
|
4
|
-
import { components
|
|
4
|
+
import { components } from '../../editor/component';
|
|
5
5
|
import { concatCustomCss } from '../../utils';
|
|
6
6
|
import Loader from '../helpers/Loader.svelte';
|
|
7
7
|
import ResolveConfig from '../helpers/ResolveConfig.svelte';
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
<script>import {
|
|
2
|
-
import { twMerge } from 'tailwind-merge';
|
|
1
|
+
<script>import { Download, Loader2, MoveHorizontal, ZoomIn, ZoomOut } from 'lucide-svelte';
|
|
3
2
|
import { getDocument } from 'pdfjs-dist';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
import 'pdfjs-dist/build/pdf.worker.entry';
|
|
4
|
+
import { getContext } from 'svelte';
|
|
5
|
+
import { fade } from 'svelte/transition';
|
|
6
|
+
import { twMerge } from 'tailwind-merge';
|
|
6
7
|
import { throttle } from '../../../../utils';
|
|
7
8
|
import { Button } from '../../../common';
|
|
8
|
-
import { Download, Loader2, MoveHorizontal, ZoomIn, ZoomOut } from 'lucide-svelte';
|
|
9
|
-
import { fade } from 'svelte/transition';
|
|
10
9
|
import { findGridItem, initOutput } from '../../editor/appUtils';
|
|
10
|
+
import { concatCustomCss } from '../../utils';
|
|
11
|
+
import InputValue from '../helpers/InputValue.svelte';
|
|
11
12
|
export let id;
|
|
12
13
|
export let configuration;
|
|
13
14
|
export let customCss = undefined;
|
|
@@ -174,13 +175,13 @@ $: css = concatCustomCss($app.css?.pdfcomponent, customCss);
|
|
|
174
175
|
<InputValue {id} input={configuration.zoom} bind:value={zoom} />
|
|
175
176
|
|
|
176
177
|
{#if render}
|
|
177
|
-
<div class="relative w-full h-full bg-gray-100">
|
|
178
|
+
<div class="relative flex flex-col w-full h-full bg-gray-100">
|
|
178
179
|
{#if source && zoom}
|
|
179
180
|
{#if pages?.length}
|
|
180
181
|
<div
|
|
181
182
|
bind:clientWidth={controlsWidth}
|
|
182
183
|
bind:clientHeight={controlsHeight}
|
|
183
|
-
class="
|
|
184
|
+
class="sticky flex {$mode !== 'preview'
|
|
184
185
|
? 'w-[calc(100%-2px)] top-[1px]'
|
|
185
186
|
: 'w-full top-0'} {wideView
|
|
186
187
|
? 'justify-center gap-14'
|
|
@@ -285,12 +286,12 @@ $: css = concatCustomCss($app.css?.pdfcomponent, customCss);
|
|
|
285
286
|
bind:this={wrapper}
|
|
286
287
|
on:scroll={throttledScroll}
|
|
287
288
|
class={twMerge('w-full h-full overflow-auto', css?.container?.class ?? '', 'bg-gray-100')}
|
|
288
|
-
style=
|
|
289
|
+
style={css?.container?.style ?? ''}
|
|
289
290
|
/>
|
|
290
291
|
{/if}
|
|
291
292
|
{#if $mode !== 'preview' && $selectedComponent?.includes(id)}
|
|
292
293
|
<button
|
|
293
|
-
class="fixed z-10 bottom-0 left-0 px-2 py-0.5 bg-indigo-500/90
|
|
294
|
+
class="fixed z-10 bottom-0 left-0 px-2 py-0.5 bg-indigo-500/90
|
|
294
295
|
hover:bg-indigo-500 focus:bg-indigo-500 duration-200 text-white text-2xs"
|
|
295
296
|
on:click={() => syncZoomValue()}
|
|
296
297
|
>
|
|
@@ -299,7 +300,7 @@ $: css = concatCustomCss($app.css?.pdfcomponent, customCss);
|
|
|
299
300
|
{/if}
|
|
300
301
|
{#if error}
|
|
301
302
|
<div
|
|
302
|
-
class="absolute inset-0 z-20 center-center
|
|
303
|
+
class="absolute inset-0 z-20 center-center
|
|
303
304
|
bg-gray-100 text-center text-gray-600 text-sm"
|
|
304
305
|
>
|
|
305
306
|
{error}
|