windmill-components 1.550.0 → 1.555.1
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/aiStore.d.ts +13 -0
- package/package/aiStore.js +70 -0
- package/package/common.d.ts +2 -1
- package/package/components/AIProviderPicker.svelte +25 -8
- package/package/components/ArgEnum.svelte +3 -2
- package/package/components/ArgEnum.svelte.d.ts +1 -0
- package/package/components/ArgInput.svelte +235 -174
- package/package/components/ArgInput.svelte.d.ts +4 -1
- package/package/components/ArrayTypeNarrowing.svelte +38 -32
- package/package/components/AutoscalingEvents.svelte +21 -5
- package/package/components/AutoscalingEvents.svelte.d.ts +4 -18
- package/package/components/DateTimeInput.svelte +8 -6
- package/package/components/DeployButton.svelte +1 -1
- package/package/components/Dev.svelte +6 -4
- package/package/components/EditableSchemaForm.svelte +7 -6
- package/package/components/Editor.svelte +2 -1
- package/package/components/EditorSettings.svelte +5 -5
- package/package/components/EditorSettings.svelte.d.ts +4 -18
- package/package/components/FakeMonacoPlaceHolder.svelte +4 -2
- package/package/components/FakeMonacoPlaceHolder.svelte.d.ts +1 -0
- package/package/components/FieldHeader.svelte +5 -7
- package/package/components/FirstStepInputs.svelte +1 -1
- package/package/components/FlowLoopIterationPreview.svelte.d.ts +1 -1
- package/package/components/FlowPlugConnect.svelte +8 -2
- package/package/components/FlowPlugConnect.svelte.d.ts +1 -0
- package/package/components/FlowPreviewContent.svelte +113 -92
- package/package/components/FlowPreviewContent.svelte.d.ts +3 -3
- package/package/components/FlowStatusViewer.svelte +3 -2
- package/package/components/FlowStatusViewerInner.svelte +1 -1
- package/package/components/FolderEditor.svelte +6 -7
- package/package/components/GroupEditor.svelte +148 -141
- package/package/components/GroupEditor.svelte.d.ts +5 -4
- package/package/components/InputTransformForm.svelte +88 -82
- package/package/components/InputTransformSchemaForm.svelte +5 -4
- package/package/components/InstanceSetting.svelte +17 -9
- package/package/components/JsonEditor.svelte +18 -9
- package/package/components/JsonEditor.svelte.d.ts +1 -1
- package/package/components/JsonInputs.svelte +1 -1
- package/package/components/ModulePreviewForm.svelte +23 -19
- package/package/components/NumberTypeNarrowing.svelte +32 -16
- package/package/components/ObjectStoreConfigSettings.svelte +27 -19
- package/package/components/Path.svelte +2 -8
- package/package/components/Path.svelte.d.ts +1 -1
- package/package/components/ResourceEditor.svelte +3 -10
- package/package/components/ResourcePicker.svelte +85 -72
- package/package/components/ResourcePicker.svelte.d.ts +2 -0
- package/package/components/RunChart.svelte +1 -1
- package/package/components/RunForm.svelte +11 -7
- package/package/components/S3ArrayHelperButton.svelte +12 -6
- package/package/components/S3ArrayHelperButton.svelte.d.ts +1 -0
- package/package/components/S3FilePicker.svelte +1 -1
- package/package/components/SchemaForm.svelte +18 -10
- package/package/components/SchemaForm.svelte.d.ts +7 -1
- package/package/components/SchemaFormWithArgPicker.svelte +1 -1
- package/package/components/ScriptBuilder.svelte +2 -2
- package/package/components/ScriptEditor.svelte +4 -3
- package/package/components/ScriptEditor.svelte.d.ts +1 -1
- package/package/components/ShareModal.svelte +4 -4
- package/package/components/SimpleEditor.svelte +6 -2
- package/package/components/SimpleEditor.svelte.d.ts +3 -0
- package/package/components/StringTypeNarrowing.svelte +5 -1
- package/package/components/SuperadminSettingsInner.svelte +3 -3
- package/package/components/TemplateEditor.svelte +18 -9
- package/package/components/Toast.svelte +2 -7
- package/package/components/Toast.svelte.d.ts +4 -18
- package/package/components/Toggle.svelte +17 -7
- package/package/components/ToggleHubWorkspaceQuick.svelte +3 -3
- package/package/components/WorkerGroup.svelte +2 -14
- package/package/components/apps/components/buttons/AppButton.svelte +57 -39
- package/package/components/apps/components/display/dbtable/InsertRow.svelte +32 -2
- package/package/components/apps/components/display/dbtable/queries/insert.js +2 -1
- package/package/components/apps/components/display/dbtable/utils.d.ts +8 -8
- package/package/components/apps/components/display/table/utils.js +13 -3
- package/package/components/apps/components/helpers/RunnableComponent.svelte +3 -3
- package/package/components/apps/components/inputs/currency/CurrencyInput.svelte +2 -1
- package/package/components/apps/editor/AppEditorHeader.svelte +33 -271
- package/package/components/apps/editor/AppEditorHeaderDeploy.svelte +233 -0
- package/package/components/apps/editor/AppEditorHeaderDeploy.svelte.d.ts +18 -0
- package/package/components/apps/editor/AppEditorHeaderDeployInitialDraft.svelte +47 -0
- package/package/components/apps/editor/AppEditorHeaderDeployInitialDraft.svelte.d.ts +8 -0
- package/package/components/apps/editor/GridEditor.svelte +7 -2
- package/package/components/apps/editor/appDeploy.svelte.d.ts +1 -0
- package/package/components/apps/editor/appDeploy.svelte.js +6 -0
- package/package/components/apps/editor/appUtils.d.ts +1 -0
- package/package/components/apps/editor/appUtils.js +30 -1
- package/package/components/apps/editor/component/ComponentNavigation.svelte +3 -1
- package/package/components/apps/editor/component/components.d.ts +3 -3
- package/package/components/apps/editor/component/components.js +1 -1
- package/package/components/apps/editor/contextPanel/ComponentOutputViewer.svelte +1 -1
- package/package/components/apps/editor/inlineScriptsPanel/EmptyInlineScript.svelte +6 -4
- package/package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte.d.ts +1 -1
- package/package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorDrawer.svelte.d.ts +1 -1
- package/package/components/apps/editor/inlineScriptsPanel/InlineScriptRunnableByPath.svelte.d.ts +1 -1
- package/package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte +58 -8
- package/package/components/auditLogs/AuditLogsFilters.svelte +1 -1
- package/package/components/common/ResizeTransitionWrapper.svelte +39 -0
- package/package/components/common/ResizeTransitionWrapper.svelte.d.ts +12 -0
- package/package/components/common/badge/CountBadge.svelte +29 -0
- package/package/components/common/badge/CountBadge.svelte.d.ts +8 -0
- package/package/components/common/button/Button.svelte +1 -0
- package/package/components/common/button/ConnectionButton.svelte +6 -1
- package/package/components/common/button/ConnectionButton.svelte.d.ts +2 -0
- package/package/components/common/button/RefreshButton.svelte +8 -4
- package/package/components/common/button/RefreshButton.svelte.d.ts +3 -0
- package/package/components/common/calendarPicker/CalendarPicker.svelte +1 -1
- package/package/components/common/fileInput/FileInput.svelte +7 -6
- package/package/components/common/fileUpload/S3ArgInput.svelte +11 -9
- package/package/components/common/fileUpload/S3ArgInput.svelte.d.ts +1 -0
- package/package/components/common/popup/PopupV2.svelte +6 -0
- package/package/components/common/toggleButton-v2/ToggleButton.svelte +17 -26
- package/package/components/common/toggleButton-v2/ToggleButton.svelte.d.ts +16 -30
- package/package/components/common/toggleButton-v2/ToggleButtonGroup.svelte +1 -1
- package/package/components/common/toggleButton-v2/ToggleButtonMore.svelte +3 -3
- package/package/components/common/toggleButton-v2/ToggleButtonMore.svelte.d.ts +1 -0
- package/package/components/copilot/CodeCompletionStatus.svelte +2 -1
- package/package/components/copilot/CronGen.svelte +1 -1
- package/package/components/copilot/FlowInlineScriptAIButton.svelte +2 -2
- package/package/components/copilot/IteratorGen.svelte +30 -25
- package/package/components/copilot/IteratorGen.svelte.d.ts +8 -7
- package/package/components/copilot/MetadataGen.svelte +4 -3
- package/package/components/copilot/PredicateGen.svelte +15 -12
- package/package/components/copilot/PredicateGen.svelte.d.ts +5 -4
- package/package/components/copilot/RegexGen.svelte +1 -1
- package/package/components/copilot/ScriptFix.svelte +1 -1
- package/package/components/copilot/ScriptGen.svelte +2 -1
- package/package/components/copilot/StepGenQuick.svelte +15 -16
- package/package/components/copilot/StepGenQuick.svelte.d.ts +14 -13
- package/package/components/copilot/StepInputGen.svelte +50 -36
- package/package/components/copilot/StepInputGen.svelte.d.ts +13 -10
- package/package/components/copilot/StepInputsGen.svelte +18 -19
- package/package/components/copilot/StepInputsGen.svelte.d.ts +4 -18
- package/package/components/copilot/autocomplete/Autocompletor.js +1 -1
- package/package/components/copilot/autocomplete/request.js +1 -1
- package/package/components/copilot/chat/AIChat.svelte +2 -1
- package/package/components/copilot/chat/AIChatManager.svelte.js +2 -1
- package/package/components/copilot/chat/AiChatLayout.svelte +2 -1
- package/package/components/copilot/chat/ProviderModelSelector.svelte +10 -9
- package/package/components/copilot/chat/ProviderModelSelector.svelte.d.ts +2 -17
- package/package/components/copilot/chat/flow/FlowAIButton.svelte +1 -1
- package/package/components/copilot/chat/script/core.js +2 -1
- package/package/components/copilot/chat/shared.js +2 -1
- package/package/components/copilot/lib.js +2 -1
- package/package/components/details/DetailPageLayout.svelte +3 -2
- package/package/components/details/DetailPageLayout.svelte.d.ts +1 -0
- package/package/components/flows/CreateActionsFlow.svelte +1 -1
- package/package/components/flows/FlowChatInterface.svelte +404 -0
- package/package/components/flows/FlowChatInterface.svelte.d.ts +19 -0
- package/package/components/flows/FlowChatMessage.svelte +41 -0
- package/package/components/flows/FlowChatMessage.svelte.d.ts +9 -0
- package/package/components/flows/FlowConversationsSidebar.svelte +213 -0
- package/package/components/flows/FlowConversationsSidebar.svelte.d.ts +15 -0
- package/package/components/flows/FlowEditor.svelte.d.ts +1 -1
- package/package/components/flows/FlowModuleIcon.svelte +10 -10
- package/package/components/flows/common/FlowCard.svelte +10 -2
- package/package/components/flows/common/FlowCard.svelte.d.ts +1 -0
- package/package/components/flows/common/FlowCardHeader.svelte +2 -1
- package/package/components/flows/common/FlowCardHeader.svelte.d.ts +1 -0
- package/package/components/flows/content/DynamicInputHelpBox.svelte +4 -4
- package/package/components/flows/content/FlowEditorPanel.svelte.d.ts +1 -1
- package/package/components/flows/content/FlowInput.svelte +381 -259
- package/package/components/flows/content/FlowInput.svelte.d.ts +1 -1
- package/package/components/flows/content/FlowInputsQuick.svelte +55 -34
- package/package/components/flows/content/FlowInputsQuick.svelte.d.ts +2 -2
- package/package/components/flows/content/FlowModuleComponent.svelte +5 -10
- package/package/components/flows/flowInfers.d.ts +60 -0
- package/package/components/flows/flowInfers.js +72 -66
- package/package/components/flows/{flowStore.d.ts → flowStore.svelte.d.ts} +1 -0
- package/package/components/flows/header/FlowPreviewButtons.svelte +1 -1
- package/package/components/flows/map/FlowErrorHandlerItem.svelte +4 -2
- package/package/components/flows/map/FlowErrorHandlerItem.svelte.d.ts +1 -0
- package/package/components/flows/map/FlowModuleSchemaItem.svelte +1 -1
- package/package/components/flows/map/FlowModuleSchemaMap.svelte +5 -2
- package/package/components/flows/map/FlowStickyNode.svelte +2 -2
- package/package/components/flows/map/FlowStickyNode.svelte.d.ts +1 -0
- package/package/components/flows/map/InsertModuleButton.svelte +5 -2
- package/package/components/flows/map/InsertModuleButton.svelte.d.ts +4 -3
- package/package/components/flows/map/InsertModuleInner.svelte +3 -1
- package/package/components/flows/map/InsertModuleInner.svelte.d.ts +2 -2
- package/package/components/flows/map/VirtualItem.svelte +1 -2
- package/package/components/flows/pickers/PickHubScriptQuick.svelte +8 -3
- package/package/components/flows/pickers/PickHubScriptQuick.svelte.d.ts +1 -1
- package/package/components/flows/pickers/WorkspaceScriptPickerQuick.svelte +15 -12
- package/package/components/flows/propPicker/PropPickerWrapper.svelte +1 -15
- package/package/components/graph/FlowGraphV2.svelte +2 -1
- package/package/components/graph/FlowGraphV2.svelte.d.ts +1 -0
- package/package/components/graph/graphBuilder.svelte.d.ts +2 -0
- package/package/components/graph/graphBuilder.svelte.js +1 -0
- package/package/components/graph/renderers/edges/BaseEdge.svelte +1 -0
- package/package/components/graph/renderers/nodes/InputNode.svelte +13 -2
- package/package/components/graph/renderers/triggers/TriggersBadge.svelte +2 -27
- package/package/components/instanceSettings.js +17 -0
- package/package/components/progressBar/ProgressBar.svelte +1 -1
- package/package/components/raw_apps/FileEditorIcon.svelte +1 -1
- package/package/components/raw_apps/FileEditorIcon.svelte.d.ts +4 -18
- package/package/components/raw_apps/RawAppBackgroundRunner.svelte +2 -8
- package/package/components/raw_apps/RawAppBackgroundRunner.svelte.d.ts +4 -18
- package/package/components/raw_apps/RawAppEditor.svelte +6 -7
- package/package/components/raw_apps/RawAppEditorHeader.svelte +48 -301
- package/package/components/raw_apps/RawAppEditorHeader.svelte.d.ts +18 -19
- package/package/components/raw_apps/RawAppInlineScriptEditor.svelte +10 -16
- package/package/components/raw_apps/RawAppInlineScriptEditor.svelte.d.ts +13 -13
- package/package/components/raw_apps/RawAppInlineScriptPanelList.svelte +8 -11
- package/package/components/raw_apps/RawAppInlineScriptPanelList.svelte.d.ts +1 -2
- package/package/components/raw_apps/RawAppInlineScriptRunnable.svelte +0 -1
- package/package/components/raw_apps/RawAppInlineScriptsPanel.svelte +7 -13
- package/package/components/raw_apps/RawAppInlineScriptsPanel.svelte.d.ts +8 -8
- package/package/components/raw_apps/RawAppPreview.svelte +3 -7
- package/package/components/raw_apps/RawAppPreview.svelte.d.ts +5 -19
- package/package/components/raw_apps/utils.d.ts +1 -1
- package/package/components/raw_apps/utils.js +3 -3
- package/package/components/runs/RunOption.svelte +2 -2
- package/package/components/runs/RunsFilter.svelte +15 -12
- package/package/components/runs/RunsFilter.svelte.d.ts +1 -1
- package/package/components/schema/EditableSchemaDrawer.svelte +19 -18
- package/package/components/schema/FlowPropertyEditor.svelte +9 -2
- package/package/components/schema/FlowPropertyEditor.svelte.d.ts +1 -1
- package/package/components/schema/PropertyEditor.svelte +22 -26
- package/package/components/schema/SchemaFormDND.svelte +3 -2
- package/package/components/schema/SchemaFormDND.svelte.d.ts +1 -0
- package/package/components/select/DraggableTags.svelte +2 -2
- package/package/components/select/MultiSelect.svelte +14 -8
- package/package/components/select/Select.svelte +12 -5
- package/package/components/select/Select.svelte.d.ts +11 -0
- package/package/components/select/SelectDropdown.svelte +98 -46
- package/package/components/select/SelectDropdown.svelte.d.ts +10 -0
- package/package/components/select/utils.svelte.js +2 -0
- package/package/components/settings/CreateToken.svelte +76 -49
- package/package/components/settings/WorkspaceUserSettings.svelte +20 -17
- package/package/components/sidebar/CriticalAlertTable.svelte +2 -1
- package/package/components/sidebar/Linkify.svelte +14 -0
- package/package/components/sidebar/Linkify.svelte.d.ts +5 -0
- package/package/components/sidebar/WorkspaceMenu.svelte +8 -3
- package/package/components/table/tableUtils.js +1 -1
- package/package/components/text_input/TextInput.svelte +30 -0
- package/package/components/text_input/TextInput.svelte.d.ts +17 -0
- package/package/components/triggers/TriggersEditor.svelte +11 -1
- package/package/components/triggers/triggers.svelte.d.ts +1 -1
- package/package/components/triggers/triggers.svelte.js +8 -4
- package/package/components/tutorials/FlowBuilderTutorialErrorHandler.svelte +2 -2
- package/package/components/tutorials/FlowBuilderTutorialForLoop.svelte +3 -0
- package/package/components/tutorials/FlowBuilderTutorialSimpleFlow.svelte +49 -17
- package/package/components/tutorials/Tutorial.svelte +9 -0
- package/package/components/tutorials/Tutorial.svelte.d.ts +1 -0
- package/package/components/tutorials/app/AppTutorial.svelte +41 -57
- package/package/components/tutorials/app/BackgroundRunnablesTutorial.svelte +3 -5
- package/package/components/tutorials/app/ConnectionTutorial.svelte +2 -2
- package/package/components/tutorials/utils.js +2 -154
- package/package/components/vscode.js +16 -8
- package/package/components/workspaceSettings/AISettings.svelte +4 -3
- package/package/components/workspaceSettings/CreateWorkspace.svelte +2 -2
- package/package/components/workspaceSettings/DucklakeSettings.svelte +64 -7
- package/package/components/workspaceSettings/StorageSettings.svelte +24 -26
- package/package/editorUtils.d.ts +1 -1
- package/package/gen/core/OpenAPI.js +1 -1
- package/package/gen/schemas.gen.d.ts +82 -1
- package/package/gen/schemas.gen.js +82 -1
- package/package/gen/services.gen.d.ts +175 -1
- package/package/gen/services.gen.js +345 -2
- package/package/gen/types.gen.d.ts +1324 -549
- package/package/script_helpers.js +5 -5
- package/package/services/JobManager.js +4 -2
- package/package/stores.d.ts +4 -13
- package/package/stores.js +5 -68
- package/package/toast.js +2 -1
- package/package/utils.d.ts +1 -0
- package/package/utils.js +3 -0
- package/package.json +5 -5
- /package/package/components/flows/{flowStore.js → flowStore.svelte.js} +0 -0
|
@@ -1,75 +1,42 @@
|
|
|
1
|
-
<script lang="ts">import {
|
|
1
|
+
<script lang="ts">import { Badge, Drawer, DrawerContent } from '../common';
|
|
2
2
|
import Button from '../common/button/Button.svelte';
|
|
3
|
-
import Path from '../Path.svelte';
|
|
4
|
-
import Toggle from '../Toggle.svelte';
|
|
5
3
|
import { AppService, DraftService } from '../../gen';
|
|
6
4
|
import { enterpriseLicense, userStore, workspaceStore } from '../../stores';
|
|
7
|
-
import { Bug, DiffIcon, FileJson, FileUp, History,
|
|
5
|
+
import { Bug, DiffIcon, FileJson, FileUp, History, MoreVertical, Pen, Save } from 'lucide-svelte';
|
|
8
6
|
import { createEventDispatcher } from 'svelte';
|
|
9
7
|
import { cleanValueProperties, orderedJsonStringify, replaceFalseWithUndefined, defaultIfEmptyString } from '../../utils';
|
|
10
8
|
// import { allItems, toStatic } from '../apps/editor/settingsPanel/utils'
|
|
11
9
|
import AppExportButton from '../apps/editor/AppExportButton.svelte';
|
|
12
10
|
import UnsavedConfirmationModal from '../common/confirmationModal/UnsavedConfirmationModal.svelte';
|
|
13
|
-
import Tooltip from '../Tooltip.svelte';
|
|
14
11
|
import { sendUserToast } from '../../toast';
|
|
15
12
|
import DeploymentHistory from '../apps/editor/DeploymentHistory.svelte';
|
|
16
13
|
import Awareness from '../Awareness.svelte';
|
|
17
14
|
import Summary from '../Summary.svelte';
|
|
18
15
|
import DeployOverrideConfirmationModal from '../common/confirmationModal/DeployOverrideConfirmationModal.svelte';
|
|
19
|
-
import { isCloudHosted } from '../../cloud';
|
|
20
|
-
import { base } from '../../base';
|
|
21
|
-
import ClipboardPanel from '../details/ClipboardPanel.svelte';
|
|
22
16
|
import AppJobsDrawer from '../apps/editor/AppJobsDrawer.svelte';
|
|
23
17
|
import { collectStaticFields, hash } from '../apps/editor/commonAppUtils';
|
|
24
18
|
import DropdownV2 from '../DropdownV2.svelte';
|
|
25
19
|
import { stateSnapshot } from '../../svelte5Utils.svelte';
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
//
|
|
33
|
-
//
|
|
34
|
-
// //subtle not available, trying pure js
|
|
35
|
-
// const hash = new Sha256()
|
|
36
|
-
// hash.update(message ?? '')
|
|
37
|
-
// const result = Array.from(await hash.digest())
|
|
38
|
-
// const hex = result.map((b) => b.toString(16).padStart(2, '0')).join('') // convert bytes to hex string
|
|
39
|
-
// return hex
|
|
40
|
-
// }
|
|
41
|
-
// }
|
|
42
|
-
export let summary;
|
|
43
|
-
export let policy;
|
|
44
|
-
export let diffDrawer = undefined;
|
|
45
|
-
export let savedApp = undefined;
|
|
46
|
-
export let version = undefined;
|
|
47
|
-
export let newApp;
|
|
48
|
-
export let newPath = '';
|
|
49
|
-
export let appPath;
|
|
50
|
-
export let runnables;
|
|
51
|
-
export let files;
|
|
52
|
-
export let jobs;
|
|
53
|
-
export let jobsById;
|
|
54
|
-
export let getBundle;
|
|
55
|
-
let newEditedPath = '';
|
|
56
|
-
$: app = files ? { runnables: $runnables, files } : undefined;
|
|
57
|
-
let deployedValue = undefined; // Value to diff against
|
|
58
|
-
let deployedBy = undefined; // Author
|
|
59
|
-
let confirmCallback = () => { }; // What happens when user clicks `override` in warning
|
|
60
|
-
let open = false; // Is confirmation modal open
|
|
20
|
+
import AppEditorHeaderDeployInitialDraft from '../apps/editor/AppEditorHeaderDeployInitialDraft.svelte';
|
|
21
|
+
import AppEditorHeaderDeploy from '../apps/editor/AppEditorHeaderDeploy.svelte';
|
|
22
|
+
let { summary = $bindable(), policy = $bindable(), diffDrawer = undefined, savedApp = $bindable(undefined), version = $bindable(undefined), newApp, newPath = '', appPath, runnables, files, jobs = $bindable(), jobsById = $bindable(), getBundle } = $props();
|
|
23
|
+
let newEditedPath = $state('');
|
|
24
|
+
let deployedValue = $state(undefined); // Value to diff against
|
|
25
|
+
let deployedBy = $state(undefined); // Author
|
|
26
|
+
let confirmCallback = $state(() => { }); // What happens when user clicks `override` in warning
|
|
27
|
+
let open = $state(false); // Is confirmation modal open
|
|
61
28
|
// const { app, summary, appPath, jobs, jobsById, staticExporter } = getContext('AppViewerContext')
|
|
62
|
-
const loading = {
|
|
29
|
+
const loading = $state({
|
|
63
30
|
publish: false,
|
|
64
31
|
save: false,
|
|
65
32
|
saveDraft: false
|
|
66
|
-
};
|
|
67
|
-
let pathError =
|
|
68
|
-
let appExport;
|
|
69
|
-
let draftDrawerOpen = false;
|
|
70
|
-
let saveDrawerOpen = false;
|
|
71
|
-
let historyBrowserDrawerOpen = false;
|
|
72
|
-
let deploymentMsg = undefined;
|
|
33
|
+
});
|
|
34
|
+
let pathError = $state('');
|
|
35
|
+
let appExport = $state();
|
|
36
|
+
let draftDrawerOpen = $state(false);
|
|
37
|
+
let saveDrawerOpen = $state(false);
|
|
38
|
+
let historyBrowserDrawerOpen = $state(false);
|
|
39
|
+
let deploymentMsg = $state(undefined);
|
|
73
40
|
function closeSaveDrawer() {
|
|
74
41
|
saveDrawerOpen = false;
|
|
75
42
|
}
|
|
@@ -82,7 +49,7 @@ async function computeTriggerables() {
|
|
|
82
49
|
policy.on_behalf_of = $userStore?.username.includes('@')
|
|
83
50
|
? $userStore?.username
|
|
84
51
|
: `u/${$userStore?.username}`;
|
|
85
|
-
policy.triggerables_v2 = Object.fromEntries((await Promise.all(Object.values(
|
|
52
|
+
policy.triggerables_v2 = Object.fromEntries((await Promise.all(Object.values(runnables).map(async (runnable) => {
|
|
86
53
|
return await processRunnable(runnable.name, runnable, runnable.fields);
|
|
87
54
|
}))));
|
|
88
55
|
return policy;
|
|
@@ -263,14 +230,6 @@ async function updateApp(npath) {
|
|
|
263
230
|
dispatch('savedNewAppPath', npath);
|
|
264
231
|
}
|
|
265
232
|
}
|
|
266
|
-
let secretUrl = undefined;
|
|
267
|
-
$: appPath && appPath != '' && secretUrl == undefined && getSecretUrl();
|
|
268
|
-
async function getSecretUrl() {
|
|
269
|
-
secretUrl = await AppService.getPublicSecretOfApp({
|
|
270
|
-
workspace: $workspaceStore,
|
|
271
|
-
path: appPath
|
|
272
|
-
});
|
|
273
|
-
}
|
|
274
233
|
async function setPublishState() {
|
|
275
234
|
await computeTriggerables();
|
|
276
235
|
await AppService.updateApp({
|
|
@@ -455,7 +414,7 @@ async function saveDraft(forceSave = false) {
|
|
|
455
414
|
throw e;
|
|
456
415
|
}
|
|
457
416
|
}
|
|
458
|
-
let onLatest = true;
|
|
417
|
+
let onLatest = $state(true);
|
|
459
418
|
async function compareVersions() {
|
|
460
419
|
if (version === undefined) {
|
|
461
420
|
return;
|
|
@@ -472,9 +431,6 @@ async function compareVersions() {
|
|
|
472
431
|
onLatest = true;
|
|
473
432
|
}
|
|
474
433
|
}
|
|
475
|
-
$: saveDrawerOpen && compareVersions();
|
|
476
|
-
let dirtyPath = false;
|
|
477
|
-
let path = undefined;
|
|
478
434
|
let moreItems = [
|
|
479
435
|
{
|
|
480
436
|
displayName: 'Deployment history',
|
|
@@ -488,7 +444,7 @@ let moreItems = [
|
|
|
488
444
|
displayName: 'Export',
|
|
489
445
|
icon: FileJson,
|
|
490
446
|
action: () => {
|
|
491
|
-
appExport
|
|
447
|
+
appExport?.open(app);
|
|
492
448
|
}
|
|
493
449
|
},
|
|
494
450
|
{
|
|
@@ -526,37 +482,9 @@ let moreItems = [
|
|
|
526
482
|
}
|
|
527
483
|
];
|
|
528
484
|
const dispatch = createEventDispatcher();
|
|
529
|
-
let customPath = savedApp?.custom_path;
|
|
530
|
-
let
|
|
531
|
-
let
|
|
532
|
-
$: fullCustomUrl = `${window.location.origin}${base}/a/${isCloudHosted() ? $workspaceStore + '/' : ''}${customPath}`;
|
|
533
|
-
async function appExists(customPath) {
|
|
534
|
-
return await AppService.customPathExists({
|
|
535
|
-
workspace: $workspaceStore,
|
|
536
|
-
customPath
|
|
537
|
-
});
|
|
538
|
-
}
|
|
539
|
-
let validateTimeout = undefined;
|
|
540
|
-
async function validateCustomPath(customPath) {
|
|
541
|
-
customPathError = '';
|
|
542
|
-
if (validateTimeout) {
|
|
543
|
-
clearTimeout(validateTimeout);
|
|
544
|
-
}
|
|
545
|
-
validateTimeout = setTimeout(async () => {
|
|
546
|
-
if (!/^[\w-]+(\/[\w-]+)*$/.test(customPath)) {
|
|
547
|
-
customPathError = 'Invalid path';
|
|
548
|
-
}
|
|
549
|
-
else if (customPath !== savedApp?.custom_path && (await appExists(customPath))) {
|
|
550
|
-
customPathError = 'Path already taken';
|
|
551
|
-
}
|
|
552
|
-
else {
|
|
553
|
-
customPathError = '';
|
|
554
|
-
}
|
|
555
|
-
validateTimeout = undefined;
|
|
556
|
-
}, 500);
|
|
557
|
-
}
|
|
558
|
-
$: customPath !== undefined && validateCustomPath(customPath);
|
|
559
|
-
let jobsDrawerOpen = false;
|
|
485
|
+
let customPath = $state(savedApp?.custom_path);
|
|
486
|
+
let customPathError = $state('');
|
|
487
|
+
let jobsDrawerOpen = $state(false);
|
|
560
488
|
function getInitialAndModifiedValues() {
|
|
561
489
|
return {
|
|
562
490
|
savedValue: savedApp,
|
|
@@ -569,6 +497,10 @@ function getInitialAndModifiedValues() {
|
|
|
569
497
|
}
|
|
570
498
|
};
|
|
571
499
|
}
|
|
500
|
+
let app = $derived(files ? { runnables: runnables, files } : undefined);
|
|
501
|
+
$effect(() => {
|
|
502
|
+
saveDrawerOpen && compareVersions();
|
|
503
|
+
});
|
|
572
504
|
</script>
|
|
573
505
|
|
|
574
506
|
<UnsavedConfirmationModal {diffDrawer} {getInitialAndModifiedValues} />
|
|
@@ -591,45 +523,6 @@ function getInitialAndModifiedValues() {
|
|
|
591
523
|
{#if appPath == ''}
|
|
592
524
|
<Drawer bind:open={draftDrawerOpen} size="800px">
|
|
593
525
|
<DrawerContent title="Initial draft save" on:close={() => closeDraftDrawer()}>
|
|
594
|
-
<Alert bgClass="mb-4" title="Require path" type="info">
|
|
595
|
-
Choose a path to save the initial draft of the app.
|
|
596
|
-
</Alert>
|
|
597
|
-
<h3>Summary</h3>
|
|
598
|
-
<div class="w-full pt-2">
|
|
599
|
-
<!-- svelte-ignore a11y-autofocus -->
|
|
600
|
-
<input
|
|
601
|
-
autofocus
|
|
602
|
-
type="text"
|
|
603
|
-
placeholder="App summary"
|
|
604
|
-
class="text-sm w-full font-semibold"
|
|
605
|
-
on:keydown|stopPropagation
|
|
606
|
-
bind:value={summary}
|
|
607
|
-
on:keyup={() => {
|
|
608
|
-
if (appPath == '' && summary?.length > 0 && !dirtyPath) {
|
|
609
|
-
path?.setName(
|
|
610
|
-
summary
|
|
611
|
-
.toLowerCase()
|
|
612
|
-
.replace(/[^a-z0-9_]/g, '_')
|
|
613
|
-
.replace(/-+/g, '_')
|
|
614
|
-
.replace(/^-|-$/g, '')
|
|
615
|
-
)
|
|
616
|
-
}
|
|
617
|
-
}}
|
|
618
|
-
/>
|
|
619
|
-
</div>
|
|
620
|
-
<div class="py-2"></div>
|
|
621
|
-
<Path
|
|
622
|
-
autofocus={false}
|
|
623
|
-
bind:this={path}
|
|
624
|
-
bind:error={pathError}
|
|
625
|
-
bind:path={newEditedPath}
|
|
626
|
-
bind:dirty={dirtyPath}
|
|
627
|
-
initialPath=""
|
|
628
|
-
namePlaceholder="app"
|
|
629
|
-
kind="app"
|
|
630
|
-
/>
|
|
631
|
-
<div class="py-4"></div>
|
|
632
|
-
|
|
633
526
|
{#snippet actions()}
|
|
634
527
|
<div>
|
|
635
528
|
<Button
|
|
@@ -641,64 +534,12 @@ function getInitialAndModifiedValues() {
|
|
|
641
534
|
</Button>
|
|
642
535
|
</div>
|
|
643
536
|
{/snippet}
|
|
537
|
+
<AppEditorHeaderDeployInitialDraft {summary} {appPath} bind:pathError bind:newEditedPath />
|
|
644
538
|
</DrawerContent>
|
|
645
539
|
</Drawer>
|
|
646
540
|
{/if}
|
|
647
541
|
<Drawer bind:open={saveDrawerOpen} size="800px">
|
|
648
542
|
<DrawerContent title="Deploy" on:close={() => closeSaveDrawer()}>
|
|
649
|
-
{#if !onLatest}
|
|
650
|
-
<Alert title="You're not on the latest app version. " type="warning">
|
|
651
|
-
By deploying, you may overwrite changes made by other users. Press 'Deploy' to see diff.
|
|
652
|
-
</Alert>
|
|
653
|
-
<div class="py-2"></div>
|
|
654
|
-
{/if}
|
|
655
|
-
<span class="text-secondary text-sm font-bold">Summary</span>
|
|
656
|
-
<div class="w-full pt-2">
|
|
657
|
-
<!-- svelte-ignore a11y-autofocus -->
|
|
658
|
-
<input
|
|
659
|
-
autofocus
|
|
660
|
-
type="text"
|
|
661
|
-
placeholder="App summary"
|
|
662
|
-
class="text-sm w-full"
|
|
663
|
-
bind:value={summary}
|
|
664
|
-
on:keydown|stopPropagation
|
|
665
|
-
on:keyup={() => {
|
|
666
|
-
if (appPath == '' && summary?.length > 0 && !dirtyPath) {
|
|
667
|
-
path?.setName(
|
|
668
|
-
summary
|
|
669
|
-
.toLowerCase()
|
|
670
|
-
.replace(/[^a-z0-9_]/g, '_')
|
|
671
|
-
.replace(/-+/g, '_')
|
|
672
|
-
.replace(/^-|-$/g, '')
|
|
673
|
-
)
|
|
674
|
-
}
|
|
675
|
-
}}
|
|
676
|
-
/>
|
|
677
|
-
</div>
|
|
678
|
-
<div class="py-4"></div>
|
|
679
|
-
<span class="text-secondary text-sm font-bold">Deployment message</span>
|
|
680
|
-
<div class="w-full pt-2">
|
|
681
|
-
<!-- svelte-ignore a11y-autofocus -->
|
|
682
|
-
<input
|
|
683
|
-
type="text"
|
|
684
|
-
placeholder="Optional deployment message"
|
|
685
|
-
class="text-sm w-full"
|
|
686
|
-
bind:value={deploymentMsg}
|
|
687
|
-
/>
|
|
688
|
-
</div>
|
|
689
|
-
<div class="py-4"></div>
|
|
690
|
-
<span class="text-secondary text-sm font-bold">Path</span>
|
|
691
|
-
<Path
|
|
692
|
-
bind:this={path}
|
|
693
|
-
bind:dirty={dirtyPath}
|
|
694
|
-
bind:error={pathError}
|
|
695
|
-
bind:path={newEditedPath}
|
|
696
|
-
initialPath={newPath}
|
|
697
|
-
namePlaceholder="app"
|
|
698
|
-
kind="app"
|
|
699
|
-
autofocus={false}
|
|
700
|
-
/>
|
|
701
|
-
|
|
702
543
|
{#snippet actions()}
|
|
703
544
|
<div class="flex flex-row gap-4">
|
|
704
545
|
<Button
|
|
@@ -758,116 +599,22 @@ function getInitialAndModifiedValues() {
|
|
|
758
599
|
</Button>
|
|
759
600
|
</div>
|
|
760
601
|
{/snippet}
|
|
761
|
-
<div class="py-2"></div>
|
|
762
|
-
{#if appPath == ''}
|
|
763
|
-
<Alert title="Require saving" type="error">
|
|
764
|
-
Save this app once before you can publish it
|
|
765
|
-
</Alert>
|
|
766
|
-
{:else}
|
|
767
|
-
<Alert title="App executed on behalf of you">
|
|
768
|
-
A viewer of the app will execute the runnables of the app on behalf of the publisher (you)
|
|
769
|
-
<Tooltip>
|
|
770
|
-
It ensures that all required resources/runnable visible for publisher but not for viewer
|
|
771
|
-
at time of creating the app would prevent the execution of the app. To guarantee tight
|
|
772
|
-
security, a policy is computed at time of deployment of the app which only allow the
|
|
773
|
-
scripts/flows referred to in the app to be called on behalf of. Furthermore, static
|
|
774
|
-
parameters are not overridable. Hence, users will only be able to use the app as intended
|
|
775
|
-
by the publisher without risk for leaking resources not used in the app.
|
|
776
|
-
</Tooltip>
|
|
777
|
-
</Alert>
|
|
778
|
-
|
|
779
|
-
<div class="mt-10"></div>
|
|
780
|
-
|
|
781
|
-
<h2>Public URL</h2>
|
|
782
|
-
<div class="mt-4"></div>
|
|
783
|
-
|
|
784
|
-
<div class="flex gap-2 items-center">
|
|
785
|
-
<Toggle
|
|
786
|
-
options={{
|
|
787
|
-
left: `Require login and read-access`,
|
|
788
|
-
right: `No login required`
|
|
789
|
-
}}
|
|
790
|
-
checked={policy.execution_mode == 'anonymous'}
|
|
791
|
-
on:change={(e) => {
|
|
792
|
-
policy.execution_mode = e.detail ? 'anonymous' : 'publisher'
|
|
793
|
-
setPublishState()
|
|
794
|
-
}}
|
|
795
|
-
/>
|
|
796
|
-
</div>
|
|
797
|
-
|
|
798
|
-
<div class="my-6 box">
|
|
799
|
-
<div class="text-secondary">
|
|
800
|
-
<div>Public URL</div>
|
|
801
|
-
</div>
|
|
802
|
-
{#if secretUrl}
|
|
803
|
-
{@const href = `${window.location.origin}${base}/public/${$workspaceStore}/${secretUrl}`}
|
|
804
|
-
<ClipboardPanel content={href} size="md" />
|
|
805
|
-
{:else}<Loader2 class="animate-spin" />
|
|
806
|
-
{/if}
|
|
807
|
-
<div class="text-xs text-secondary mt-1">
|
|
808
|
-
Share this url directly or embed it using an iframe (if requiring login, top-level domain
|
|
809
|
-
of embedding app must be the same as the one of Windmill)
|
|
810
|
-
</div>
|
|
811
602
|
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
}}
|
|
828
|
-
checked={customPath !== undefined}
|
|
829
|
-
options={{
|
|
830
|
-
right: 'Use a custom URL'
|
|
831
|
-
}}
|
|
832
|
-
disabled={!$enterpriseLicense || !($userStore?.is_admin || $userStore?.is_super_admin)}
|
|
833
|
-
/>
|
|
834
|
-
|
|
835
|
-
{#if customPath !== undefined}
|
|
836
|
-
<div class="text-secondary text-sm flex items-center gap-1 w-full justify-between">
|
|
837
|
-
<div>Custom path</div>
|
|
838
|
-
</div>
|
|
839
|
-
<input
|
|
840
|
-
disabled={!($userStore?.is_admin || $userStore?.is_super_admin)}
|
|
841
|
-
type="text"
|
|
842
|
-
autocomplete="off"
|
|
843
|
-
bind:value={customPath}
|
|
844
|
-
class={customPathError === ''
|
|
845
|
-
? ''
|
|
846
|
-
: 'border border-red-700 bg-red-100 border-opacity-30 focus:border-red-700 focus:border-opacity-30 focus-visible:ring-red-700 focus-visible:ring-opacity-25 focus-visible:border-red-700'}
|
|
847
|
-
on:input={() => {
|
|
848
|
-
dirtyCustomPath = true
|
|
849
|
-
}}
|
|
850
|
-
/>
|
|
851
|
-
<div class="text-secondary text-sm flex items-center gap-1 mt-2 w-full justify-between">
|
|
852
|
-
<div>Custom public URL</div>
|
|
853
|
-
</div>
|
|
854
|
-
<ClipboardPanel content={fullCustomUrl} size="md" />
|
|
855
|
-
|
|
856
|
-
<div class="text-red-600 dark:text-red-400 text-2xs mt-1.5"
|
|
857
|
-
>{dirtyCustomPath ? customPathError : ''}
|
|
858
|
-
</div>
|
|
859
|
-
{/if}
|
|
860
|
-
</div>
|
|
861
|
-
</div>
|
|
862
|
-
<Alert type="info" title="Only latest deployed app is publicly available">
|
|
863
|
-
You will still need to deploy the app to make visible the latest changes
|
|
864
|
-
</Alert>
|
|
865
|
-
|
|
866
|
-
<a
|
|
867
|
-
href="https://www.windmill.dev/docs/advanced/external_auth_with_jwt#embed-public-apps-using-your-own-authentification"
|
|
868
|
-
class="mt-4 text-2xs">Embed this app in your own product to be used by your own users</a
|
|
869
|
-
>
|
|
870
|
-
{/if}
|
|
603
|
+
<AppEditorHeaderDeploy
|
|
604
|
+
{newPath}
|
|
605
|
+
{policy}
|
|
606
|
+
{setPublishState}
|
|
607
|
+
{appPath}
|
|
608
|
+
{onLatest}
|
|
609
|
+
{savedApp}
|
|
610
|
+
{summary}
|
|
611
|
+
bind:customPath
|
|
612
|
+
bind:deploymentMsg
|
|
613
|
+
bind:customPathError
|
|
614
|
+
bind:pathError
|
|
615
|
+
bind:newEditedPath
|
|
616
|
+
hideSecretUrl={true}
|
|
617
|
+
/>
|
|
871
618
|
</DrawerContent>
|
|
872
619
|
</Drawer>
|
|
873
620
|
|
|
@@ -903,7 +650,7 @@ function getInitialAndModifiedValues() {
|
|
|
903
650
|
<div class="flex justify-start w-full border rounded-md overflow-hidden">
|
|
904
651
|
<div>
|
|
905
652
|
<button
|
|
906
|
-
|
|
653
|
+
onclick={async () => {
|
|
907
654
|
saveDrawerOpen = true
|
|
908
655
|
setTimeout(() => {
|
|
909
656
|
document.getElementById('path')?.focus()
|
|
@@ -924,7 +671,7 @@ function getInitialAndModifiedValues() {
|
|
|
924
671
|
value={defaultIfEmptyString(newEditedPath, newPath)}
|
|
925
672
|
size={defaultIfEmptyString(newEditedPath, newPath)?.length || 50}
|
|
926
673
|
class="font-mono !text-xs !min-w-[96px] !max-w-[300px] !w-full !h-[28px] !my-0 !py-0 !border-l-0 !rounded-l-none !border-0 !shadow-none"
|
|
927
|
-
|
|
674
|
+
onfocus={({ currentTarget }) => {
|
|
928
675
|
currentTarget.select()
|
|
929
676
|
}}
|
|
930
677
|
/>
|
|
@@ -936,13 +683,13 @@ function getInitialAndModifiedValues() {
|
|
|
936
683
|
{/if}
|
|
937
684
|
<div class="flex flex-row gap-2 justify-end items-center overflow-visible">
|
|
938
685
|
<DropdownV2 items={moreItems} class="h-auto">
|
|
939
|
-
|
|
686
|
+
{#snippet buttonReplacement()}
|
|
940
687
|
<Button nonCaptureEvent size="xs" color="light">
|
|
941
688
|
<div class="flex flex-row items-center">
|
|
942
689
|
<MoreVertical size={14} />
|
|
943
690
|
</div>
|
|
944
691
|
</Button>
|
|
945
|
-
|
|
692
|
+
{/snippet}
|
|
946
693
|
</DropdownV2>
|
|
947
694
|
|
|
948
695
|
<div class="hidden md:inline relative overflow-visible">
|
|
@@ -1,21 +1,7 @@
|
|
|
1
1
|
import { type Policy } from '../../gen';
|
|
2
2
|
import type DiffDrawer from '../DiffDrawer.svelte';
|
|
3
3
|
import type { HiddenRunnable } from '../apps/types';
|
|
4
|
-
|
|
5
|
-
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> {
|
|
6
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
7
|
-
$$bindings?: Bindings;
|
|
8
|
-
} & Exports;
|
|
9
|
-
(internal: unknown, props: Props & {
|
|
10
|
-
$$events?: Events;
|
|
11
|
-
$$slots?: Slots;
|
|
12
|
-
}): Exports & {
|
|
13
|
-
$set?: any;
|
|
14
|
-
$on?: any;
|
|
15
|
-
};
|
|
16
|
-
z_$$bindings?: Bindings;
|
|
17
|
-
}
|
|
18
|
-
declare const RawAppEditorHeader: $$__sveltets_2_IsomorphicComponent<{
|
|
4
|
+
interface Props {
|
|
19
5
|
summary: string;
|
|
20
6
|
policy: Policy;
|
|
21
7
|
diffDrawer?: DiffDrawer | undefined;
|
|
@@ -32,7 +18,7 @@ declare const RawAppEditorHeader: $$__sveltets_2_IsomorphicComponent<{
|
|
|
32
18
|
newApp: boolean;
|
|
33
19
|
newPath?: string;
|
|
34
20
|
appPath: string;
|
|
35
|
-
runnables:
|
|
21
|
+
runnables: Record<string, HiddenRunnable>;
|
|
36
22
|
files: Record<string, string> | undefined;
|
|
37
23
|
jobs: string[];
|
|
38
24
|
jobsById: Record<string, any>;
|
|
@@ -40,11 +26,24 @@ declare const RawAppEditorHeader: $$__sveltets_2_IsomorphicComponent<{
|
|
|
40
26
|
js: string;
|
|
41
27
|
css: string;
|
|
42
28
|
}>;
|
|
43
|
-
}
|
|
44
|
-
|
|
29
|
+
}
|
|
30
|
+
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> {
|
|
31
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
32
|
+
$$bindings?: Bindings;
|
|
33
|
+
} & Exports;
|
|
34
|
+
(internal: unknown, props: Props & {
|
|
35
|
+
$$events?: Events;
|
|
36
|
+
$$slots?: Slots;
|
|
37
|
+
}): Exports & {
|
|
38
|
+
$set?: any;
|
|
39
|
+
$on?: any;
|
|
40
|
+
};
|
|
41
|
+
z_$$bindings?: Bindings;
|
|
42
|
+
}
|
|
43
|
+
declare const RawAppEditorHeader: $$__sveltets_2_IsomorphicComponent<Props, {
|
|
45
44
|
restore: CustomEvent<any>;
|
|
46
45
|
} & {
|
|
47
46
|
[evt: string]: CustomEvent<any>;
|
|
48
|
-
}, {}, {},
|
|
47
|
+
}, {}, {}, "summary" | "jobs" | "version" | "policy" | "jobsById" | "savedApp">;
|
|
49
48
|
type RawAppEditorHeader = InstanceType<typeof RawAppEditorHeader>;
|
|
50
49
|
export default RawAppEditorHeader;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
<script lang="ts">import
|
|
1
|
+
<script lang="ts">import { createBubbler, stopPropagation } from 'svelte/legacy';
|
|
2
|
+
const bubble = createBubbler();
|
|
3
|
+
import Button from '../common/button/Button.svelte';
|
|
2
4
|
import { createEventDispatcher, onMount } from 'svelte';
|
|
3
5
|
import { Maximize2, Trash2 } from 'lucide-svelte';
|
|
4
6
|
import { inferArgs } from '../../infer';
|
|
@@ -12,18 +14,10 @@ import InlineScriptEditorDrawer from '../apps/editor/inlineScriptsPanel/InlineSc
|
|
|
12
14
|
import CacheTtlPopup from '../apps/editor/inlineScriptsPanel/CacheTtlPopup.svelte';
|
|
13
15
|
import RunButton from '../RunButton.svelte';
|
|
14
16
|
import { computeFields } from '../apps/editor/inlineScriptsPanel/utils';
|
|
15
|
-
let inlineScriptEditorDrawer;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
export let fields = {};
|
|
20
|
-
export let path;
|
|
21
|
-
export let isLoading = false;
|
|
22
|
-
export let onRun;
|
|
23
|
-
export let onCancel;
|
|
24
|
-
export let editor = undefined;
|
|
25
|
-
let diffEditor;
|
|
26
|
-
let validCode = true;
|
|
17
|
+
let inlineScriptEditorDrawer = $state();
|
|
18
|
+
let { inlineScript = $bindable(), name = $bindable(undefined), id, fields = $bindable({}), path, isLoading = false, onRun, onCancel, editor = $bindable(undefined) } = $props();
|
|
19
|
+
let diffEditor = $state();
|
|
20
|
+
let validCode = $state(true);
|
|
27
21
|
async function inferInlineScriptSchema(language, content, schema) {
|
|
28
22
|
try {
|
|
29
23
|
await inferArgs(language, content, schema);
|
|
@@ -50,7 +44,7 @@ async function syncFields() {
|
|
|
50
44
|
}
|
|
51
45
|
}
|
|
52
46
|
const dispatch = createEventDispatcher();
|
|
53
|
-
let drawerIsOpen = undefined;
|
|
47
|
+
let drawerIsOpen = $state(undefined);
|
|
54
48
|
</script>
|
|
55
49
|
|
|
56
50
|
{#if inlineScript}
|
|
@@ -73,11 +67,11 @@ let drawerIsOpen = undefined;
|
|
|
73
67
|
{#if name !== undefined}
|
|
74
68
|
<div class="flex flex-row gap-2 w-full items-center">
|
|
75
69
|
<input
|
|
76
|
-
|
|
70
|
+
onkeydown={stopPropagation(bubble('keydown'))}
|
|
77
71
|
bind:value={name}
|
|
78
72
|
placeholder="Inline script name"
|
|
79
73
|
class="!text-xs !rounded-sm !shadow-none"
|
|
80
|
-
|
|
74
|
+
onkeyup={() => {
|
|
81
75
|
// $app = $app
|
|
82
76
|
// if (stateId) {
|
|
83
77
|
// $stateId++
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import Editor from '../Editor.svelte';
|
|
2
2
|
import type { InlineScript } from '../apps/types';
|
|
3
3
|
import type { AppInput } from '../apps/inputType';
|
|
4
|
+
interface Props {
|
|
5
|
+
inlineScript: InlineScript | undefined;
|
|
6
|
+
name?: string | undefined;
|
|
7
|
+
id: string;
|
|
8
|
+
fields?: Record<string, AppInput>;
|
|
9
|
+
path: string;
|
|
10
|
+
isLoading?: boolean;
|
|
11
|
+
onRun: () => Promise<void>;
|
|
12
|
+
onCancel: () => Promise<void>;
|
|
13
|
+
editor?: Editor | undefined;
|
|
14
|
+
}
|
|
4
15
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
5
16
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
6
17
|
$$bindings?: Bindings;
|
|
@@ -14,22 +25,11 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
|
|
|
14
25
|
};
|
|
15
26
|
z_$$bindings?: Bindings;
|
|
16
27
|
}
|
|
17
|
-
declare const RawAppInlineScriptEditor: $$__sveltets_2_IsomorphicComponent<{
|
|
18
|
-
inlineScript: InlineScript | undefined;
|
|
19
|
-
name?: string | undefined;
|
|
20
|
-
id: string;
|
|
21
|
-
fields?: Record<string, AppInput>;
|
|
22
|
-
path: string;
|
|
23
|
-
isLoading?: boolean;
|
|
24
|
-
onRun: () => Promise<void>;
|
|
25
|
-
onCancel: () => Promise<void>;
|
|
26
|
-
editor?: Editor | undefined;
|
|
27
|
-
}, {
|
|
28
|
-
keydown: KeyboardEvent;
|
|
28
|
+
declare const RawAppInlineScriptEditor: $$__sveltets_2_IsomorphicComponent<Props, {
|
|
29
29
|
createScriptFromInlineScript: CustomEvent<any>;
|
|
30
30
|
delete: CustomEvent<any>;
|
|
31
31
|
} & {
|
|
32
32
|
[evt: string]: CustomEvent<any>;
|
|
33
|
-
}, {}, {},
|
|
33
|
+
}, {}, {}, "name" | "fields" | "inlineScript" | "editor">;
|
|
34
34
|
type RawAppInlineScriptEditor = InstanceType<typeof RawAppInlineScriptEditor>;
|
|
35
35
|
export default RawAppInlineScriptEditor;
|
|
@@ -7,16 +7,13 @@ import HideButton from '../apps/editor/settingsPanel/HideButton.svelte';
|
|
|
7
7
|
import { getNextId } from '../flows/idUtils';
|
|
8
8
|
let { selectedRunnable = $bindable(), runnables } = $props();
|
|
9
9
|
function createBackgroundScript() {
|
|
10
|
-
const nid = getNextId(Object.keys(
|
|
10
|
+
const nid = getNextId(Object.keys(runnables ?? {}));
|
|
11
11
|
const newScriptPath = `Backend Runnable ${nid}`;
|
|
12
|
-
runnables
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
18
|
-
return r;
|
|
19
|
-
});
|
|
12
|
+
runnables[nid] = {
|
|
13
|
+
name: newScriptPath,
|
|
14
|
+
inlineScript: undefined,
|
|
15
|
+
type: 'runnableByName'
|
|
16
|
+
};
|
|
20
17
|
selectedRunnable = nid;
|
|
21
18
|
}
|
|
22
19
|
const dispatch = createEventDispatcher();
|
|
@@ -51,8 +48,8 @@ const dispatch = createEventDispatcher();
|
|
|
51
48
|
<div class="w-full flex flex-col gap-6 py-1">
|
|
52
49
|
<div>
|
|
53
50
|
<div class="flex flex-col gap-1 w-full">
|
|
54
|
-
{#if Object.keys(
|
|
55
|
-
{#each Object.entries(
|
|
51
|
+
{#if Object.keys(runnables ?? {}).length > 0}
|
|
52
|
+
{#each Object.entries(runnables ?? {}) as [id, runnable]}
|
|
56
53
|
{#if runnable}
|
|
57
54
|
<button
|
|
58
55
|
{id}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type { Writable } from 'svelte/store';
|
|
2
1
|
import type { Runnable } from '../apps/inputType';
|
|
3
2
|
interface Props {
|
|
4
3
|
selectedRunnable: string | undefined;
|
|
5
|
-
runnables:
|
|
4
|
+
runnables: Record<string, Runnable>;
|
|
6
5
|
}
|
|
7
6
|
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> {
|
|
8
7
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|