@flowdrop/flowdrop 1.15.0 → 2.0.0-beta.10
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/CHANGELOG.md +648 -0
- package/MIGRATION-2.0.md +642 -0
- package/README.md +28 -28
- package/dist/adapters/WorkflowAdapter.d.ts +1 -1
- package/dist/adapters/WorkflowAdapter.js +18 -13
- package/dist/adapters/agentspec/AgentSpecAdapter.js +10 -10
- package/dist/adapters/agentspec/defaultNodeTypes.js +9 -9
- package/dist/api/enhanced-client.js +6 -11
- package/dist/chat/batchFeedback.d.ts +39 -0
- package/dist/chat/batchFeedback.js +51 -0
- package/dist/commands/executor.js +66 -27
- package/dist/commands/storeIntegration.svelte.d.ts +4 -1
- package/dist/commands/storeIntegration.svelte.js +36 -21
- package/dist/commands/types.d.ts +2 -0
- package/dist/commands/types.js +5 -5
- package/dist/components/App.svelte +696 -565
- package/dist/components/App.svelte.d.ts +63 -16
- package/dist/components/Button.stories.svelte +65 -0
- package/dist/components/Button.stories.svelte.d.ts +19 -0
- package/dist/components/Button.svelte +62 -0
- package/dist/components/Button.svelte.d.ts +24 -0
- package/dist/components/CanvasIconButton.svelte +76 -0
- package/dist/components/CanvasIconButton.svelte.d.ts +18 -0
- package/dist/components/ConfigForm.svelte +181 -552
- package/dist/components/ConfigForm.svelte.d.ts +24 -7
- package/dist/components/ConfigModal.svelte +16 -3
- package/dist/components/ConfigPanel.svelte +234 -15
- package/dist/components/ConfigPanel.svelte.d.ts +6 -0
- package/dist/components/ConnectionLine.svelte +4 -2
- package/dist/components/EditorStatusBar.stories.svelte +44 -0
- package/dist/components/EditorStatusBar.stories.svelte.d.ts +27 -0
- package/dist/components/EditorStatusBar.svelte +99 -0
- package/dist/components/EditorStatusBar.svelte.d.ts +15 -0
- package/dist/components/IconButton.svelte +80 -0
- package/dist/components/IconButton.svelte.d.ts +30 -0
- package/dist/components/Input.svelte +74 -0
- package/dist/components/Input.svelte.d.ts +17 -0
- package/dist/components/LogoWordmark.svelte +113 -0
- package/dist/components/LogoWordmark.svelte.d.ts +26 -0
- package/dist/components/Navbar.svelte +78 -64
- package/dist/components/Navbar.svelte.d.ts +3 -0
- package/dist/components/NodeSidebar.svelte +48 -171
- package/dist/components/NodeStatusOverlay.svelte +94 -6
- package/dist/components/NodeSwapPicker.svelte +22 -38
- package/dist/components/PipelineStatus.svelte +22 -68
- package/dist/components/PipelineStatus.svelte.d.ts +3 -0
- package/dist/components/PortCoordinateTracker.svelte +5 -6
- package/dist/components/PortMappingRow.svelte +0 -2
- package/dist/components/SchemaForm.stories.svelte +1 -3
- package/dist/components/SchemaForm.svelte +22 -39
- package/dist/components/SchemaForm.svelte.d.ts +0 -8
- package/dist/components/Select.svelte +53 -0
- package/dist/components/Select.svelte.d.ts +15 -0
- package/dist/components/SettingsModal.svelte +8 -8
- package/dist/components/SettingsPanel.svelte +44 -10
- package/dist/components/SwapMappingEditor.svelte +67 -49
- package/dist/components/SwapMappingEditor.svelte.d.ts +0 -2
- package/dist/components/Textarea.svelte +39 -0
- package/dist/components/Textarea.svelte.d.ts +12 -0
- package/dist/components/ThemeToggle.svelte +15 -94
- package/dist/components/UniversalNode.svelte +45 -11
- package/dist/components/UniversalNode.svelte.d.ts +1 -1
- package/dist/components/WorkflowEditor.svelte +183 -162
- package/dist/components/WorkflowEditor.svelte.d.ts +39 -10
- package/dist/components/chat/AIChatPanel.svelte +99 -90
- package/dist/components/chat/AIChatPanel.svelte.d.ts +0 -4
- package/dist/components/chat/CommandPreview.svelte +2 -1
- package/dist/components/console/CommandConsole.svelte +7 -5
- package/dist/components/console/ConsoleAutocomplete.svelte +11 -12
- package/dist/components/console/ConsoleAutocomplete.svelte.d.ts +6 -0
- package/dist/components/console/ConsoleInput.svelte +18 -9
- package/dist/components/console/ConsoleOutput.svelte +4 -3
- package/dist/components/form/FormArray.svelte +42 -182
- package/dist/components/form/FormArray.svelte.d.ts +2 -1
- package/dist/components/form/FormAutocomplete.svelte +26 -21
- package/dist/components/form/FormCheckboxGroup.svelte +1 -5
- package/dist/components/form/FormCodeEditor.svelte +9 -7
- package/dist/components/form/FormField.svelte +22 -44
- package/dist/components/form/FormFieldLight.svelte +56 -50
- package/dist/components/form/FormFieldLight.svelte.d.ts +12 -0
- package/dist/components/form/FormFieldset.svelte +45 -11
- package/dist/components/form/FormMarkdownEditor.svelte +17 -9
- package/dist/components/form/FormNumberField.svelte +4 -36
- package/dist/components/form/FormPorts.svelte +262 -0
- package/dist/components/form/FormPorts.svelte.d.ts +13 -0
- package/dist/components/form/FormRangeField.svelte +62 -30
- package/dist/components/form/FormSelect.svelte +13 -75
- package/dist/components/form/FormTemplateEditor.svelte +17 -7
- package/dist/components/form/FormTextField.svelte +3 -35
- package/dist/components/form/FormTextarea.svelte +4 -39
- package/dist/components/form/FormToggle.svelte +5 -16
- package/dist/components/form/FormToggle.svelte.d.ts +4 -2
- package/dist/components/form/FormUISchemaRenderer.svelte +3 -1
- package/dist/components/form/resolveFieldType.d.ts +24 -0
- package/dist/components/form/resolveFieldType.js +55 -0
- package/dist/components/form/templateAutocomplete.js +1 -5
- package/dist/components/form/types.d.ts +1 -14
- package/dist/components/icons/CloseIcon.svelte +6 -0
- package/dist/components/icons/CloseIcon.svelte.d.ts +26 -0
- package/dist/components/icons/CommandLineIcon.svelte +15 -0
- package/dist/components/icons/CommandLineIcon.svelte.d.ts +26 -0
- package/dist/components/icons/MenuIcon.svelte +4 -0
- package/dist/components/icons/MenuIcon.svelte.d.ts +26 -0
- package/dist/components/icons/MenuOpenIcon.svelte +6 -0
- package/dist/components/icons/MenuOpenIcon.svelte.d.ts +26 -0
- package/dist/components/interrupt/ChoicePrompt.svelte +0 -10
- package/dist/components/interrupt/ConfirmationPrompt.svelte +0 -5
- package/dist/components/interrupt/FormPrompt.svelte +3 -2
- package/dist/components/interrupt/InterruptBubble.svelte +25 -27
- package/dist/components/interrupt/ReviewPrompt.svelte +10 -23
- package/dist/components/interrupt/TextInputPrompt.svelte +2 -7
- package/dist/components/layouts/MainLayout.svelte +24 -18
- package/dist/components/layouts/MainLayout.svelte.d.ts +4 -0
- package/dist/components/nodes/AtomNode.svelte +70 -72
- package/dist/components/nodes/AtomNode.svelte.d.ts +1 -1
- package/dist/components/nodes/GatewayNode.svelte +134 -172
- package/dist/components/nodes/GatewayNode.svelte.d.ts +1 -1
- package/dist/components/nodes/IdeaNode.svelte +79 -98
- package/dist/components/nodes/IdeaNode.svelte.d.ts +8 -4
- package/dist/components/nodes/NodeConfigButton.svelte +86 -0
- package/dist/components/nodes/NodeConfigButton.svelte.d.ts +15 -0
- package/dist/components/nodes/NotesNode.svelte +76 -85
- package/dist/components/nodes/NotesNode.svelte.d.ts +8 -4
- package/dist/components/nodes/SimpleNode.svelte +68 -137
- package/dist/components/nodes/SimpleNode.svelte.d.ts +4 -4
- package/dist/components/nodes/SquareNode.svelte +122 -169
- package/dist/components/nodes/SquareNode.svelte.d.ts +4 -4
- package/dist/components/nodes/TerminalNode.svelte +70 -127
- package/dist/components/nodes/TerminalNode.svelte.d.ts +4 -4
- package/dist/components/nodes/ToolNode.svelte +99 -104
- package/dist/components/nodes/ToolNode.svelte.d.ts +6 -6
- package/dist/components/nodes/WorkflowNode.svelte +145 -195
- package/dist/components/nodes/WorkflowNode.svelte.d.ts +1 -1
- package/dist/components/playground/ChatInput.svelte +11 -15
- package/dist/components/playground/ChatPanel.svelte +6 -49
- package/dist/components/playground/ChatPanel.svelte.d.ts +0 -14
- package/dist/components/playground/ControlPanel.svelte +134 -123
- package/dist/components/playground/ControlPanel.svelte.d.ts +3 -0
- package/dist/components/playground/ExecutionLogs.svelte +11 -9
- package/dist/components/playground/InputCollector.svelte +22 -57
- package/dist/components/playground/MessageStream.svelte +17 -23
- package/dist/components/playground/PipelineKanbanView.svelte +69 -8
- package/dist/components/playground/PipelineKanbanView.svelte.d.ts +2 -0
- package/dist/components/playground/PipelinePanel.svelte +31 -8
- package/dist/components/playground/PipelinePanel.svelte.d.ts +2 -0
- package/dist/components/playground/PipelineTableView.svelte +188 -44
- package/dist/components/playground/PipelineTableView.svelte.d.ts +2 -0
- package/dist/components/playground/Playground.svelte +154 -105
- package/dist/components/playground/Playground.svelte.d.ts +5 -0
- package/dist/components/playground/PlaygroundApp.svelte +12 -2
- package/dist/components/playground/PlaygroundApp.svelte.d.ts +6 -0
- package/dist/components/playground/PlaygroundModal.svelte +18 -3
- package/dist/components/playground/PlaygroundModal.svelte.d.ts +6 -0
- package/dist/components/playground/PlaygroundStudio.svelte +40 -37
- package/dist/components/playground/PlaygroundStudio.svelte.d.ts +6 -0
- package/dist/components/playground/SessionManager.svelte +9 -12
- package/dist/components/playground/pipelineViewUtils.svelte.d.ts +30 -1
- package/dist/components/playground/pipelineViewUtils.svelte.js +40 -3
- package/dist/components/surfaces/SurfaceOverlay.svelte +153 -0
- package/dist/components/surfaces/SurfaceOverlay.svelte.d.ts +14 -0
- package/dist/components/surfaces/TabbedSurface.svelte +133 -0
- package/dist/components/surfaces/TabbedSurface.svelte.d.ts +27 -0
- package/dist/config/endpoints.d.ts +23 -7
- package/dist/config/endpoints.js +30 -10
- package/dist/core/index.d.ts +6 -7
- package/dist/core/index.js +8 -12
- package/dist/display/index.d.ts +6 -3
- package/dist/display/index.js +7 -5
- package/dist/editor/index.d.ts +20 -21
- package/dist/editor/index.js +26 -36
- package/dist/form/code.d.ts +25 -15
- package/dist/form/code.js +44 -41
- package/dist/form/fieldRegistry.d.ts +17 -13
- package/dist/form/fieldRegistry.js +32 -12
- package/dist/form/full.d.ts +19 -14
- package/dist/form/full.js +26 -28
- package/dist/form/index.d.ts +3 -4
- package/dist/form/index.js +6 -5
- package/dist/form/markdown.d.ts +13 -8
- package/dist/form/markdown.js +22 -23
- package/dist/helpers/proximityConnect.d.ts +3 -2
- package/dist/helpers/proximityConnect.js +2 -5
- package/dist/helpers/workflowEditorHelper.d.ts +14 -5
- package/dist/helpers/workflowEditorHelper.js +32 -30
- package/dist/index.d.ts +28 -24
- package/dist/index.js +27 -50
- package/dist/messages/defaults.d.ts +2 -5
- package/dist/messages/defaults.js +3 -6
- package/dist/messages/index.d.ts +1 -2
- package/dist/messages/index.js +1 -2
- package/dist/mocks/app-forms.d.ts +6 -2
- package/dist/mocks/app-forms.js +11 -4
- package/dist/openapi/v1/openapi.yaml +38 -26
- package/dist/playground/index.d.ts +4 -5
- package/dist/playground/index.js +4 -32
- package/dist/playground/mount.d.ts +34 -5
- package/dist/playground/mount.js +58 -24
- package/dist/registry/{BaseRegistry.d.ts → BaseRegistry.svelte.d.ts} +22 -1
- package/dist/registry/{BaseRegistry.js → BaseRegistry.svelte.js} +37 -1
- package/dist/registry/builtinFormats.d.ts +9 -18
- package/dist/registry/builtinFormats.js +9 -39
- package/dist/registry/builtinNodeTypes.d.ts +53 -0
- package/dist/registry/builtinNodeTypes.js +67 -0
- package/dist/registry/builtinNodes.d.ts +2 -64
- package/dist/registry/builtinNodes.js +7 -103
- package/dist/registry/index.d.ts +3 -4
- package/dist/registry/index.js +4 -6
- package/dist/registry/nodeComponentRegistry.d.ts +184 -16
- package/dist/registry/nodeComponentRegistry.js +235 -17
- package/dist/registry/workflowFormatRegistry.d.ts +14 -9
- package/dist/registry/workflowFormatRegistry.js +24 -8
- package/dist/{schema → schemas}/index.d.ts +2 -2
- package/dist/{schema → schemas}/index.js +2 -2
- package/dist/schemas/v1/workflow.schema.json +19 -17
- package/dist/services/agentSpecExecutionService.d.ts +0 -2
- package/dist/services/agentSpecExecutionService.js +0 -3
- package/dist/services/apiVariableService.d.ts +2 -1
- package/dist/services/apiVariableService.js +16 -47
- package/dist/services/autoSaveService.d.ts +7 -0
- package/dist/services/autoSaveService.js +6 -4
- package/dist/services/categoriesApi.js +3 -6
- package/dist/services/chatService.d.ts +9 -4
- package/dist/services/chatService.js +23 -28
- package/dist/services/draftStorage.d.ts +129 -13
- package/dist/services/draftStorage.js +185 -37
- package/dist/services/dynamicSchemaService.d.ts +33 -5
- package/dist/services/dynamicSchemaService.js +67 -55
- package/dist/services/globalSave.d.ts +13 -12
- package/dist/services/globalSave.js +29 -51
- package/dist/services/historyService.d.ts +39 -11
- package/dist/services/historyService.js +60 -18
- package/dist/services/interruptService.d.ts +15 -9
- package/dist/services/interruptService.js +35 -37
- package/dist/services/nodeExecutionService.d.ts +18 -3
- package/dist/services/nodeExecutionService.js +71 -45
- package/dist/services/playgroundService.d.ts +16 -10
- package/dist/services/playgroundService.js +42 -43
- package/dist/services/portConfigApi.js +3 -6
- package/dist/services/settingsService.d.ts +9 -4
- package/dist/services/settingsService.js +23 -12
- package/dist/services/variableService.d.ts +2 -1
- package/dist/services/variableService.js +2 -2
- package/dist/services/workflowStorage.js +6 -6
- package/dist/skins/drafter.d.ts +30 -0
- package/dist/skins/drafter.js +198 -0
- package/dist/skins/index.d.ts +2 -1
- package/dist/skins/index.js +4 -2
- package/dist/stores/apiContext.d.ts +56 -0
- package/dist/stores/apiContext.js +80 -0
- package/dist/stores/categoriesStore.svelte.d.ts +28 -23
- package/dist/stores/categoriesStore.svelte.js +69 -64
- package/dist/stores/getInstance.svelte.d.ts +39 -0
- package/dist/stores/getInstance.svelte.js +65 -0
- package/dist/stores/historyStore.svelte.d.ts +89 -91
- package/dist/stores/historyStore.svelte.js +159 -158
- package/dist/stores/instanceContainer.svelte.d.ts +111 -0
- package/dist/stores/instanceContainer.svelte.js +119 -0
- package/dist/stores/interruptStore.svelte.d.ts +112 -82
- package/dist/stores/interruptStore.svelte.js +253 -226
- package/dist/stores/pipelinePanelStore.svelte.d.ts +27 -3
- package/dist/stores/pipelinePanelStore.svelte.js +61 -14
- package/dist/stores/playgroundStore.svelte.d.ts +169 -222
- package/dist/stores/playgroundStore.svelte.js +513 -580
- package/dist/stores/portCoordinateStore.svelte.d.ts +57 -51
- package/dist/stores/portCoordinateStore.svelte.js +109 -98
- package/dist/stores/settingsStore.svelte.d.ts +17 -1
- package/dist/stores/settingsStore.svelte.js +79 -12
- package/dist/stores/workflowStore.svelte.d.ts +212 -210
- package/dist/stores/workflowStore.svelte.js +527 -502
- package/dist/stories/EdgeDecorator.svelte +5 -2
- package/dist/stories/NodeDecorator.svelte +5 -3
- package/dist/styles/base.css +285 -14
- package/dist/styles/tokens.css +60 -2
- package/dist/svelte-app.d.ts +78 -11
- package/dist/svelte-app.js +210 -141
- package/dist/themes/drafter.d.ts +2 -0
- package/dist/themes/drafter.js +15 -0
- package/dist/themes/index.d.ts +2 -1
- package/dist/themes/index.js +8 -2
- package/dist/types/auth.d.ts +9 -51
- package/dist/types/auth.js +4 -54
- package/dist/types/events.d.ts +24 -3
- package/dist/types/events.js +2 -1
- package/dist/types/index.d.ts +117 -32
- package/dist/types/index.js +0 -1
- package/dist/types/navbar.d.ts +7 -0
- package/dist/types/playground.d.ts +18 -3
- package/dist/types/settings.d.ts +30 -1
- package/dist/types/settings.js +5 -2
- package/dist/types/skin.d.ts +1 -1
- package/dist/types/theme.d.ts +16 -2
- package/dist/types/uischema.d.ts +5 -0
- package/dist/utils/colors.d.ts +74 -21
- package/dist/utils/colors.js +92 -68
- package/dist/utils/connections.d.ts +9 -15
- package/dist/utils/connections.js +33 -88
- package/dist/utils/duration.d.ts +13 -0
- package/dist/utils/duration.js +45 -0
- package/dist/utils/edgeStyling.js +9 -5
- package/dist/utils/fetchWithAuth.d.ts +36 -15
- package/dist/utils/fetchWithAuth.js +53 -23
- package/dist/utils/icons.d.ts +5 -2
- package/dist/utils/icons.js +6 -5
- package/dist/utils/nodeIds.d.ts +1 -1
- package/dist/utils/nodeIds.js +1 -1
- package/dist/utils/nodeSwap.d.ts +6 -2
- package/dist/utils/nodeSwap.js +62 -129
- package/dist/utils/nodeTypes.d.ts +17 -8
- package/dist/utils/nodeTypes.js +27 -20
- package/dist/utils/performanceUtils.js +7 -0
- package/dist/utils/portUtils.d.ts +47 -11
- package/dist/utils/portUtils.js +67 -14
- package/dist/utils/portal.d.ts +18 -0
- package/dist/utils/portal.js +34 -0
- package/dist/utils/schemaMerge.d.ts +25 -0
- package/dist/utils/schemaMerge.js +61 -0
- package/package.json +7 -5
- package/dist/messages/deprecation.d.ts +0 -20
- package/dist/messages/deprecation.js +0 -33
- package/dist/registry/plugin.d.ts +0 -215
- package/dist/registry/plugin.js +0 -249
- package/dist/services/api.d.ts +0 -129
- package/dist/services/api.js +0 -217
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
-->
|
|
10
10
|
|
|
11
11
|
<script lang="ts">
|
|
12
|
+
import Textarea from '../Textarea.svelte';
|
|
13
|
+
|
|
12
14
|
interface Props {
|
|
13
15
|
/** Field identifier */
|
|
14
16
|
id: string;
|
|
@@ -48,9 +50,8 @@
|
|
|
48
50
|
}
|
|
49
51
|
</script>
|
|
50
52
|
|
|
51
|
-
<
|
|
53
|
+
<Textarea
|
|
52
54
|
{id}
|
|
53
|
-
class="form-textarea"
|
|
54
55
|
value={value ?? ''}
|
|
55
56
|
{placeholder}
|
|
56
57
|
{rows}
|
|
@@ -58,40 +59,4 @@
|
|
|
58
59
|
aria-describedby={ariaDescribedBy}
|
|
59
60
|
aria-required={required}
|
|
60
61
|
oninput={handleInput}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
<style>
|
|
64
|
-
.form-textarea {
|
|
65
|
-
width: 100%;
|
|
66
|
-
padding: 0.625rem 0.875rem;
|
|
67
|
-
border: 1px solid var(--fd-border);
|
|
68
|
-
border-radius: var(--fd-radius-lg);
|
|
69
|
-
font-size: var(--fd-text-sm);
|
|
70
|
-
font-family: inherit;
|
|
71
|
-
color: var(--fd-foreground);
|
|
72
|
-
background-color: var(--fd-muted);
|
|
73
|
-
transition: all var(--fd-transition-normal);
|
|
74
|
-
box-shadow: var(--fd-shadow-sm);
|
|
75
|
-
resize: vertical;
|
|
76
|
-
min-height: 5rem;
|
|
77
|
-
line-height: 1.5;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.form-textarea::placeholder {
|
|
81
|
-
color: var(--fd-muted-foreground);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.form-textarea:hover {
|
|
85
|
-
border-color: var(--fd-border-strong);
|
|
86
|
-
background-color: var(--fd-background);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.form-textarea:focus {
|
|
90
|
-
outline: none;
|
|
91
|
-
border-color: var(--fd-primary);
|
|
92
|
-
background-color: var(--fd-background);
|
|
93
|
-
box-shadow:
|
|
94
|
-
0 0 0 3px rgba(59, 130, 246, 0.12),
|
|
95
|
-
var(--fd-shadow-sm);
|
|
96
|
-
}
|
|
97
|
-
</style>
|
|
62
|
+
/>
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
-->
|
|
10
10
|
|
|
11
11
|
<script lang="ts">
|
|
12
|
-
import { m
|
|
12
|
+
import { m } from '../../messages/index.js';
|
|
13
13
|
|
|
14
14
|
interface Props {
|
|
15
15
|
/** Field identifier */
|
|
@@ -17,11 +17,13 @@
|
|
|
17
17
|
/** Current value */
|
|
18
18
|
value: boolean;
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* Per-instance label for the on state (e.g. "Hidden" for a visibility
|
|
21
|
+
* toggle). Falls back to the global `messages.form.toggle.enabled`.
|
|
21
22
|
*/
|
|
22
23
|
onLabel?: string;
|
|
23
24
|
/**
|
|
24
|
-
*
|
|
25
|
+
* Per-instance label for the off state. Falls back to the global
|
|
26
|
+
* `messages.form.toggle.disabled`.
|
|
25
27
|
*/
|
|
26
28
|
offLabel?: string;
|
|
27
29
|
/** Whether the field is disabled (read-only) */
|
|
@@ -42,15 +44,6 @@
|
|
|
42
44
|
onChange
|
|
43
45
|
}: Props = $props();
|
|
44
46
|
|
|
45
|
-
// svelte-ignore state_referenced_locally — deprecation warns once per mount; later prop rebinds aren't relevant
|
|
46
|
-
if (onLabel !== undefined) {
|
|
47
|
-
warnDeprecatedProp('FormToggle', 'onLabel', 'messages.form.toggle.enabled');
|
|
48
|
-
}
|
|
49
|
-
// svelte-ignore state_referenced_locally
|
|
50
|
-
if (offLabel !== undefined) {
|
|
51
|
-
warnDeprecatedProp('FormToggle', 'offLabel', 'messages.form.toggle.disabled');
|
|
52
|
-
}
|
|
53
|
-
|
|
54
47
|
const resolvedOnLabel = $derived(onLabel ?? m().form.toggle.enabled);
|
|
55
48
|
const resolvedOffLabel = $derived(offLabel ?? m().form.toggle.disabled);
|
|
56
49
|
|
|
@@ -127,10 +120,6 @@
|
|
|
127
120
|
transform: translateX(1.25rem);
|
|
128
121
|
}
|
|
129
122
|
|
|
130
|
-
.form-toggle__input:focus-visible + .form-toggle__track {
|
|
131
|
-
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
123
|
.form-toggle__label {
|
|
135
124
|
font-size: var(--fd-text-sm);
|
|
136
125
|
color: var(--fd-muted-foreground);
|
|
@@ -4,11 +4,13 @@ interface Props {
|
|
|
4
4
|
/** Current value */
|
|
5
5
|
value: boolean;
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Per-instance label for the on state (e.g. "Hidden" for a visibility
|
|
8
|
+
* toggle). Falls back to the global `messages.form.toggle.enabled`.
|
|
8
9
|
*/
|
|
9
10
|
onLabel?: string;
|
|
10
11
|
/**
|
|
11
|
-
*
|
|
12
|
+
* Per-instance label for the off state. Falls back to the global
|
|
13
|
+
* `messages.form.toggle.disabled`.
|
|
12
14
|
*/
|
|
13
15
|
offLabel?: string;
|
|
14
16
|
/** Whether the field is disabled (read-only) */
|
|
@@ -16,7 +16,9 @@
|
|
|
16
16
|
import type { ConfigSchema, WorkflowNode, WorkflowEdge, AuthProvider } from '../../types/index.js';
|
|
17
17
|
import type { FieldSchema } from './types.js';
|
|
18
18
|
import { resolveScopeToKey } from '../../utils/uischema.js';
|
|
19
|
-
|
|
19
|
+
// Use the registry-based light field factory so the UISchema renderer (and
|
|
20
|
+
// SchemaForm/ConfigForm above it) never statically pull in CodeMirror.
|
|
21
|
+
import FormField from './FormFieldLight.svelte';
|
|
20
22
|
import FormFieldset from './FormFieldset.svelte';
|
|
21
23
|
import Self from './FormUISchemaRenderer.svelte';
|
|
22
24
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { FieldSchema } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* The dependency-free field kinds that {@link FormField} and
|
|
4
|
+
* {@link FormFieldLight} render identically — i.e. everything that does not
|
|
5
|
+
* pull in a heavy editor or depend on the field registry.
|
|
6
|
+
*/
|
|
7
|
+
export type BaseFieldType = 'checkbox-group' | 'select-enum' | 'select-options' | 'textarea' | 'range' | 'text' | 'number' | 'toggle' | 'array';
|
|
8
|
+
/**
|
|
9
|
+
* Resolve the basic field type for a schema — the single source of truth for
|
|
10
|
+
* the decision both the full and light field factories share.
|
|
11
|
+
*
|
|
12
|
+
* Returns `null` when none of the basic cases match, so each caller can apply
|
|
13
|
+
* its OWN special-case handling and fallback in its own order. The heavy and
|
|
14
|
+
* entry-point-specific cases (hidden, autocomplete, code/markdown/template
|
|
15
|
+
* editors, `object` → editor, registry-resolved components) are deliberately
|
|
16
|
+
* NOT decided here: `FormField` and `FormFieldLight` route those differently
|
|
17
|
+
* (static imports vs. the lazy field registry that keeps the `/form` light
|
|
18
|
+
* entry free of heavy deps), and must keep doing so before delegating here.
|
|
19
|
+
*
|
|
20
|
+
* Order matters and mirrors the original in-component chains: `enum` and
|
|
21
|
+
* `oneOf` are checked before the primitive `type` branches because option
|
|
22
|
+
* schemas frequently carry `type: 'string'`.
|
|
23
|
+
*/
|
|
24
|
+
export declare function resolveBaseFieldType(schema: FieldSchema): BaseFieldType | null;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve the basic field type for a schema — the single source of truth for
|
|
3
|
+
* the decision both the full and light field factories share.
|
|
4
|
+
*
|
|
5
|
+
* Returns `null` when none of the basic cases match, so each caller can apply
|
|
6
|
+
* its OWN special-case handling and fallback in its own order. The heavy and
|
|
7
|
+
* entry-point-specific cases (hidden, autocomplete, code/markdown/template
|
|
8
|
+
* editors, `object` → editor, registry-resolved components) are deliberately
|
|
9
|
+
* NOT decided here: `FormField` and `FormFieldLight` route those differently
|
|
10
|
+
* (static imports vs. the lazy field registry that keeps the `/form` light
|
|
11
|
+
* entry free of heavy deps), and must keep doing so before delegating here.
|
|
12
|
+
*
|
|
13
|
+
* Order matters and mirrors the original in-component chains: `enum` and
|
|
14
|
+
* `oneOf` are checked before the primitive `type` branches because option
|
|
15
|
+
* schemas frequently carry `type: 'string'`.
|
|
16
|
+
*/
|
|
17
|
+
export function resolveBaseFieldType(schema) {
|
|
18
|
+
// Enum with multiple selection -> checkbox group
|
|
19
|
+
if (schema.enum && schema.multiple) {
|
|
20
|
+
return 'checkbox-group';
|
|
21
|
+
}
|
|
22
|
+
// Enum with single selection -> select
|
|
23
|
+
if (schema.enum) {
|
|
24
|
+
return 'select-enum';
|
|
25
|
+
}
|
|
26
|
+
// oneOf with labeled options (standard JSON Schema) -> select
|
|
27
|
+
if (schema.oneOf && schema.oneOf.length > 0) {
|
|
28
|
+
return 'select-options';
|
|
29
|
+
}
|
|
30
|
+
// Multiline string -> textarea
|
|
31
|
+
if (schema.type === 'string' && schema.format === 'multiline') {
|
|
32
|
+
return 'textarea';
|
|
33
|
+
}
|
|
34
|
+
// Range slider for number/integer with format: "range"
|
|
35
|
+
if ((schema.type === 'number' || schema.type === 'integer') && schema.format === 'range') {
|
|
36
|
+
return 'range';
|
|
37
|
+
}
|
|
38
|
+
// String -> text field
|
|
39
|
+
if (schema.type === 'string') {
|
|
40
|
+
return 'text';
|
|
41
|
+
}
|
|
42
|
+
// Number or integer -> number field
|
|
43
|
+
if (schema.type === 'number' || schema.type === 'integer') {
|
|
44
|
+
return 'number';
|
|
45
|
+
}
|
|
46
|
+
// Boolean -> toggle
|
|
47
|
+
if (schema.type === 'boolean') {
|
|
48
|
+
return 'toggle';
|
|
49
|
+
}
|
|
50
|
+
// Array -> array field
|
|
51
|
+
if (schema.type === 'array') {
|
|
52
|
+
return 'array';
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* @module components/form/templateAutocomplete
|
|
12
12
|
*/
|
|
13
13
|
import { autocompletion } from '@codemirror/autocomplete';
|
|
14
|
-
import { getChildVariables, getArrayIndexSuggestions, isArrayVariable
|
|
14
|
+
import { getChildVariables, getArrayIndexSuggestions, isArrayVariable } from '../../services/variableService.js';
|
|
15
15
|
/**
|
|
16
16
|
* Icon type hints for different variable types in autocomplete dropdown.
|
|
17
17
|
*/
|
|
@@ -56,10 +56,6 @@ function extractVariablePath(text, pos) {
|
|
|
56
56
|
if (openBracePos === -1) {
|
|
57
57
|
return null;
|
|
58
58
|
}
|
|
59
|
-
// Check if there's a closing }} after cursor (still inside expression)
|
|
60
|
-
const afterCursor = text.slice(pos);
|
|
61
|
-
const closingMatch = afterCursor.match(/^\s*\}\}/);
|
|
62
|
-
const hasClosing = closingMatch !== null;
|
|
63
59
|
// Extract the content between {{ and cursor
|
|
64
60
|
const contentStart = openBracePos + 2;
|
|
65
61
|
const content = text.slice(contentStart, pos).trimStart();
|
|
@@ -95,8 +95,7 @@ export interface BaseFieldProps<T = unknown> {
|
|
|
95
95
|
/**
|
|
96
96
|
* Properties for text input fields
|
|
97
97
|
*/
|
|
98
|
-
export
|
|
99
|
-
}
|
|
98
|
+
export type TextFieldProps = BaseFieldProps<string>;
|
|
100
99
|
/**
|
|
101
100
|
* Properties for multiline text fields (textarea)
|
|
102
101
|
*/
|
|
@@ -432,18 +431,6 @@ export interface SchemaFormProps {
|
|
|
432
431
|
* @default false
|
|
433
432
|
*/
|
|
434
433
|
showActions?: boolean;
|
|
435
|
-
/**
|
|
436
|
-
* Label text for the save button.
|
|
437
|
-
* Only used when showActions is true.
|
|
438
|
-
* @default "Save"
|
|
439
|
-
*/
|
|
440
|
-
saveLabel?: string;
|
|
441
|
-
/**
|
|
442
|
-
* Label text for the cancel button.
|
|
443
|
-
* Only used when showActions is true.
|
|
444
|
-
* @default "Cancel"
|
|
445
|
-
*/
|
|
446
|
-
cancelLabel?: string;
|
|
447
434
|
/**
|
|
448
435
|
* Callback fired when the Save button is clicked.
|
|
449
436
|
* Receives the final form values after collecting from DOM.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<!-- Inline SVG equivalent of mdi:close (Material Design Icons) -->
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
|
|
3
|
+
<path
|
|
4
|
+
d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"
|
|
5
|
+
/>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default CloseIcon;
|
|
2
|
+
type CloseIcon = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
|
+
}, {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare const CloseIcon: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
+
[x: string]: never;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}, {}, string>;
|
|
14
|
+
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> {
|
|
15
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
+
$$bindings?: Bindings;
|
|
17
|
+
} & Exports;
|
|
18
|
+
(internal: unknown, props: {
|
|
19
|
+
$$events?: Events;
|
|
20
|
+
$$slots?: Slots;
|
|
21
|
+
}): Exports & {
|
|
22
|
+
$set?: any;
|
|
23
|
+
$on?: any;
|
|
24
|
+
};
|
|
25
|
+
z_$$bindings?: Bindings;
|
|
26
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<!-- Inline SVG equivalent of heroicons:command-line (outline) -->
|
|
2
|
+
<svg
|
|
3
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
4
|
+
viewBox="0 0 24 24"
|
|
5
|
+
fill="none"
|
|
6
|
+
stroke="currentColor"
|
|
7
|
+
stroke-width="1.5"
|
|
8
|
+
stroke-linecap="round"
|
|
9
|
+
stroke-linejoin="round"
|
|
10
|
+
aria-hidden="true"
|
|
11
|
+
>
|
|
12
|
+
<path
|
|
13
|
+
d="M6.75 7.5l3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0021 18V6a2.25 2.25 0 00-2.25-2.25H5.25A2.25 2.25 0 003 6v12a2.25 2.25 0 002.25 2.25z"
|
|
14
|
+
/>
|
|
15
|
+
</svg>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default CommandLineIcon;
|
|
2
|
+
type CommandLineIcon = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
|
+
}, {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare const CommandLineIcon: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
+
[x: string]: never;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}, {}, string>;
|
|
14
|
+
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> {
|
|
15
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
+
$$bindings?: Bindings;
|
|
17
|
+
} & Exports;
|
|
18
|
+
(internal: unknown, props: {
|
|
19
|
+
$$events?: Events;
|
|
20
|
+
$$slots?: Slots;
|
|
21
|
+
}): Exports & {
|
|
22
|
+
$set?: any;
|
|
23
|
+
$on?: any;
|
|
24
|
+
};
|
|
25
|
+
z_$$bindings?: Bindings;
|
|
26
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default MenuIcon;
|
|
2
|
+
type MenuIcon = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
|
+
}, {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare const MenuIcon: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
+
[x: string]: never;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}, {}, string>;
|
|
14
|
+
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> {
|
|
15
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
+
$$bindings?: Bindings;
|
|
17
|
+
} & Exports;
|
|
18
|
+
(internal: unknown, props: {
|
|
19
|
+
$$events?: Events;
|
|
20
|
+
$$slots?: Slots;
|
|
21
|
+
}): Exports & {
|
|
22
|
+
$set?: any;
|
|
23
|
+
$on?: any;
|
|
24
|
+
};
|
|
25
|
+
z_$$bindings?: Bindings;
|
|
26
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<!-- Inline SVG equivalent of mdi:menu-open (Material Design Icons) -->
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
|
|
3
|
+
<path
|
|
4
|
+
d="M21,15.61L19.59,17L14.58,12L19.59,7L21,8.39L17.44,12L21,15.61M3,6H16V8H3V6M3,13V11H13V13H3M3,18V16H16V18H3Z"
|
|
5
|
+
/>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default MenuOpenIcon;
|
|
2
|
+
type MenuOpenIcon = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
|
+
}, {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare const MenuOpenIcon: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
+
[x: string]: never;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}, {}, string>;
|
|
14
|
+
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> {
|
|
15
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
+
$$bindings?: Bindings;
|
|
17
|
+
} & Exports;
|
|
18
|
+
(internal: unknown, props: {
|
|
19
|
+
$$events?: Events;
|
|
20
|
+
$$slots?: Slots;
|
|
21
|
+
}): Exports & {
|
|
22
|
+
$set?: any;
|
|
23
|
+
$on?: any;
|
|
24
|
+
};
|
|
25
|
+
z_$$bindings?: Bindings;
|
|
26
|
+
}
|
|
@@ -313,11 +313,6 @@
|
|
|
313
313
|
border: 0;
|
|
314
314
|
}
|
|
315
315
|
|
|
316
|
-
.choice-prompt__option:focus-within {
|
|
317
|
-
outline: 2px solid var(--fd-ring);
|
|
318
|
-
outline-offset: 2px;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
316
|
.choice-prompt__checkmark {
|
|
322
317
|
flex-shrink: 0;
|
|
323
318
|
font-size: 1.25rem;
|
|
@@ -390,11 +385,6 @@
|
|
|
390
385
|
transform: translateY(-1px);
|
|
391
386
|
}
|
|
392
387
|
|
|
393
|
-
.choice-prompt__submit:focus-visible {
|
|
394
|
-
outline: 2px solid var(--fd-ring);
|
|
395
|
-
outline-offset: 2px;
|
|
396
|
-
}
|
|
397
|
-
|
|
398
388
|
.choice-prompt__submit:disabled {
|
|
399
389
|
opacity: 0.5;
|
|
400
390
|
cursor: not-allowed;
|
|
@@ -44,7 +44,8 @@
|
|
|
44
44
|
}: Props = $props();
|
|
45
45
|
|
|
46
46
|
/** Local state for form values */
|
|
47
|
-
//
|
|
47
|
+
// initial default, user fills the form
|
|
48
|
+
// svelte-ignore state_referenced_locally
|
|
48
49
|
let formValues = $state<Record<string, unknown>>(config.defaultValues ?? {});
|
|
49
50
|
|
|
50
51
|
/** Display values - either resolved or current form values */
|
|
@@ -131,7 +132,7 @@
|
|
|
131
132
|
<div class="form-prompt__resolved-values">
|
|
132
133
|
<h4 class="form-prompt__resolved-title">{interrupt.form.submittedValuesTitle}</h4>
|
|
133
134
|
<div class="form-prompt__values-list">
|
|
134
|
-
{#each Object.entries(config.schema.properties ?? {}) as [key, field]}
|
|
135
|
+
{#each Object.entries(config.schema.properties ?? {}) as [key, field] (key)}
|
|
135
136
|
{@const value = displayValues[key]}
|
|
136
137
|
{@const fieldTitle = ((field as Record<string, unknown>).title as string) ?? key}
|
|
137
138
|
<div class="form-prompt__value-item">
|
|
@@ -33,11 +33,8 @@
|
|
|
33
33
|
getErrorMessage,
|
|
34
34
|
getResolvedValue
|
|
35
35
|
} from '../../types/interruptState.js';
|
|
36
|
-
import {
|
|
37
|
-
|
|
38
|
-
interruptActions,
|
|
39
|
-
type InterruptWithState
|
|
40
|
-
} from '../../stores/interruptStore.svelte.js';
|
|
36
|
+
import { type InterruptWithState } from '../../stores/interruptStore.svelte.js';
|
|
37
|
+
import { getInstance } from '../../stores/getInstance.svelte.js';
|
|
41
38
|
import { interruptService } from '../../services/interruptService.js';
|
|
42
39
|
import { logger } from '../../utils/logger.js';
|
|
43
40
|
import { m } from '../../messages/index.js';
|
|
@@ -72,12 +69,14 @@
|
|
|
72
69
|
tags
|
|
73
70
|
}: Props = $props();
|
|
74
71
|
|
|
72
|
+
const fd = getInstance();
|
|
73
|
+
|
|
75
74
|
/**
|
|
76
75
|
* Get the current interrupt state from the store.
|
|
77
76
|
* This ensures we react to store updates (like status changes).
|
|
78
77
|
*/
|
|
79
78
|
const currentInterrupt = $derived(
|
|
80
|
-
|
|
79
|
+
fd.interrupts.getMap().get(initialInterrupt.id) ?? addMachineState(initialInterrupt)
|
|
81
80
|
);
|
|
82
81
|
|
|
83
82
|
const hierarchyItems = $derived(hierarchy ?? []);
|
|
@@ -191,7 +190,7 @@
|
|
|
191
190
|
*/
|
|
192
191
|
async function handleResolve(value: unknown): Promise<void> {
|
|
193
192
|
// Start the submission - state machine validates this transition
|
|
194
|
-
const startResult =
|
|
193
|
+
const startResult = fd.interrupts.startSubmit(currentInterrupt.id, value);
|
|
195
194
|
if (!startResult.valid) {
|
|
196
195
|
logger.warn('[InterruptBubble] Cannot submit:', startResult.error);
|
|
197
196
|
return;
|
|
@@ -199,19 +198,24 @@
|
|
|
199
198
|
|
|
200
199
|
try {
|
|
201
200
|
// Call API if service is configured
|
|
202
|
-
if (interruptService.isConfigured()) {
|
|
203
|
-
await interruptService.resolveInterrupt(
|
|
201
|
+
if (interruptService.isConfigured(fd.api.config)) {
|
|
202
|
+
await interruptService.resolveInterrupt(
|
|
203
|
+
fd.api.config,
|
|
204
|
+
currentInterrupt.id,
|
|
205
|
+
value,
|
|
206
|
+
fd.api.authProvider
|
|
207
|
+
);
|
|
204
208
|
}
|
|
205
209
|
|
|
206
210
|
// Mark as successful - transitions to resolved state
|
|
207
|
-
|
|
211
|
+
fd.interrupts.submitSuccess(currentInterrupt.id);
|
|
208
212
|
|
|
209
213
|
// Notify parent to refresh messages
|
|
210
214
|
onResolved?.();
|
|
211
215
|
} catch (err) {
|
|
212
216
|
// Mark as failed - transitions to error state (can retry)
|
|
213
217
|
const errorMessage = err instanceof Error ? err.message : 'Failed to submit response';
|
|
214
|
-
|
|
218
|
+
fd.interrupts.submitFailure(currentInterrupt.id, errorMessage);
|
|
215
219
|
logger.error('[InterruptBubble] Resolve error:', err);
|
|
216
220
|
}
|
|
217
221
|
}
|
|
@@ -221,7 +225,7 @@
|
|
|
221
225
|
*/
|
|
222
226
|
async function handleCancel(): Promise<void> {
|
|
223
227
|
// Start the cancel - state machine validates this transition
|
|
224
|
-
const startResult =
|
|
228
|
+
const startResult = fd.interrupts.startCancel(currentInterrupt.id);
|
|
225
229
|
if (!startResult.valid) {
|
|
226
230
|
logger.warn('[InterruptBubble] Cannot cancel:', startResult.error);
|
|
227
231
|
return;
|
|
@@ -229,19 +233,23 @@
|
|
|
229
233
|
|
|
230
234
|
try {
|
|
231
235
|
// Call API if service is configured
|
|
232
|
-
if (interruptService.isConfigured()) {
|
|
233
|
-
await interruptService.cancelInterrupt(
|
|
236
|
+
if (interruptService.isConfigured(fd.api.config)) {
|
|
237
|
+
await interruptService.cancelInterrupt(
|
|
238
|
+
fd.api.config,
|
|
239
|
+
currentInterrupt.id,
|
|
240
|
+
fd.api.authProvider
|
|
241
|
+
);
|
|
234
242
|
}
|
|
235
243
|
|
|
236
244
|
// Mark as successful - transitions to cancelled state
|
|
237
|
-
|
|
245
|
+
fd.interrupts.submitSuccess(currentInterrupt.id);
|
|
238
246
|
|
|
239
247
|
// Notify parent to refresh messages
|
|
240
248
|
onResolved?.();
|
|
241
249
|
} catch (err) {
|
|
242
250
|
// Mark as failed - transitions to error state (can retry)
|
|
243
251
|
const errorMessage = err instanceof Error ? err.message : 'Failed to cancel';
|
|
244
|
-
|
|
252
|
+
fd.interrupts.submitFailure(currentInterrupt.id, errorMessage);
|
|
245
253
|
logger.error('[InterruptBubble] Cancel error:', err);
|
|
246
254
|
}
|
|
247
255
|
}
|
|
@@ -250,7 +258,7 @@
|
|
|
250
258
|
* Handle retry after error
|
|
251
259
|
*/
|
|
252
260
|
function handleRetry(): void {
|
|
253
|
-
|
|
261
|
+
fd.interrupts.retry(currentInterrupt.id);
|
|
254
262
|
}
|
|
255
263
|
|
|
256
264
|
// Typed config getters for each prompt type
|
|
@@ -553,11 +561,6 @@
|
|
|
553
561
|
background-color: var(--fd-error-hover);
|
|
554
562
|
}
|
|
555
563
|
|
|
556
|
-
.interrupt-bubble__retry-btn:focus-visible {
|
|
557
|
-
outline: 2px solid var(--fd-ring);
|
|
558
|
-
outline-offset: 2px;
|
|
559
|
-
}
|
|
560
|
-
|
|
561
564
|
/* Body - prompt content area, full width */
|
|
562
565
|
.interrupt-bubble__body {
|
|
563
566
|
padding: var(--fd-space-xl);
|
|
@@ -640,11 +643,6 @@
|
|
|
640
643
|
background-color: var(--fd-error-muted);
|
|
641
644
|
}
|
|
642
645
|
|
|
643
|
-
.interrupt-bubble__cancel-btn:focus-visible {
|
|
644
|
-
outline: 2px solid var(--fd-ring);
|
|
645
|
-
outline-offset: 2px;
|
|
646
|
-
}
|
|
647
|
-
|
|
648
646
|
.interrupt-bubble__cancel-btn:disabled {
|
|
649
647
|
opacity: 0.5;
|
|
650
648
|
cursor: not-allowed;
|