@flowdrop/flowdrop 2.0.0-beta.1 → 2.0.0-beta.11
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 +210 -0
- package/MIGRATION-2.0.md +173 -3
- package/README.md +5 -5
- package/dist/adapters/WorkflowAdapter.js +4 -5
- package/dist/adapters/agentspec/AgentSpecAdapter.js +3 -3
- package/dist/adapters/agentspec/defaultNodeTypes.js +9 -9
- package/dist/api/enhanced-client.js +6 -11
- package/dist/chat/batchFeedback.js +1 -1
- package/dist/chat/commandClassifier.d.ts +11 -0
- package/dist/chat/commandClassifier.js +20 -0
- package/dist/chat/historyBuilder.d.ts +39 -0
- package/dist/chat/historyBuilder.js +82 -0
- package/dist/chat/index.d.ts +2 -1
- package/dist/chat/index.js +2 -1
- package/dist/chat/responseParser.js +16 -12
- package/dist/commands/executor.js +51 -26
- package/dist/commands/parser.d.ts +12 -0
- package/dist/commands/parser.js +33 -6
- package/dist/commands/storeIntegration.svelte.js +11 -1
- package/dist/commands/types.js +5 -5
- package/dist/components/App.svelte +547 -386
- package/dist/components/App.svelte.d.ts +16 -8
- 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 +194 -565
- package/dist/components/ConfigForm.svelte.d.ts +24 -7
- package/dist/components/ConfigModal.svelte +9 -1
- package/dist/components/ConfigPanel.svelte +234 -15
- package/dist/components/ConfigPanel.svelte.d.ts +6 -0
- 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 +17 -63
- package/dist/components/Navbar.svelte.d.ts +3 -0
- package/dist/components/NodeSidebar.svelte +21 -126
- package/dist/components/NodeSwapPicker.svelte +12 -30
- package/dist/components/PipelineStatus.svelte +6 -1
- package/dist/components/PipelineStatus.svelte.d.ts +3 -0
- package/dist/components/PortMappingRow.svelte +0 -2
- package/dist/components/SchemaForm.svelte +4 -14
- package/dist/components/Select.svelte +53 -0
- package/dist/components/Select.svelte.d.ts +15 -0
- package/dist/components/SettingsModal.svelte +0 -5
- package/dist/components/SettingsPanel.svelte +33 -6
- 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 +36 -4
- package/dist/components/UniversalNode.svelte.d.ts +1 -1
- package/dist/components/WorkflowEditor.svelte +71 -54
- package/dist/components/WorkflowEditor.svelte.d.ts +21 -0
- package/dist/components/chat/AIChatPanel.svelte +49 -8
- package/dist/components/chat/CommandPreview.svelte +10 -1
- package/dist/components/console/ConsoleAutocomplete.svelte +1 -1
- package/dist/components/console/ConsoleInput.svelte +3 -3
- package/dist/components/console/ConsoleOutput.svelte +2 -2
- package/dist/components/form/FormArray.svelte +37 -173
- package/dist/components/form/FormAutocomplete.svelte +18 -15
- package/dist/components/form/FormCheckboxGroup.svelte +1 -5
- package/dist/components/form/FormCodeEditor.svelte +9 -7
- package/dist/components/form/FormField.svelte +18 -42
- package/dist/components/form/FormFieldLight.svelte +52 -48
- package/dist/components/form/FormFieldLight.svelte.d.ts +12 -0
- package/dist/components/form/FormFieldset.svelte +45 -11
- package/dist/components/form/FormMarkdownEditor.svelte +8 -5
- package/dist/components/form/FormNumberField.svelte +4 -36
- package/dist/components/form/FormPorts.svelte +280 -0
- package/dist/components/form/FormPorts.svelte.d.ts +13 -0
- package/dist/components/form/FormRangeField.svelte +63 -30
- package/dist/components/form/FormSelect.svelte +13 -75
- package/dist/components/form/FormTemplateEditor.svelte +6 -4
- package/dist/components/form/FormTextField.svelte +3 -35
- package/dist/components/form/FormTextarea.svelte +4 -39
- package/dist/components/form/FormToggle.svelte +27 -6
- package/dist/components/form/FormToggle.svelte.d.ts +5 -0
- 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/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/InterruptBubble.svelte +11 -12
- package/dist/components/interrupt/ReviewPrompt.svelte +0 -20
- package/dist/components/interrupt/TextInputPrompt.svelte +0 -6
- package/dist/components/layouts/MainLayout.svelte +4 -5
- package/dist/components/nodes/AtomNode.svelte +62 -76
- package/dist/components/nodes/AtomNode.svelte.d.ts +1 -1
- package/dist/components/nodes/GatewayNode.svelte +117 -164
- package/dist/components/nodes/GatewayNode.svelte.d.ts +1 -1
- package/dist/components/nodes/IdeaNode.svelte +72 -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 +59 -133
- package/dist/components/nodes/SimpleNode.svelte.d.ts +4 -4
- package/dist/components/nodes/SquareNode.svelte +110 -164
- package/dist/components/nodes/SquareNode.svelte.d.ts +4 -4
- package/dist/components/nodes/TerminalNode.svelte +62 -124
- package/dist/components/nodes/TerminalNode.svelte.d.ts +4 -4
- package/dist/components/nodes/ToolNode.svelte +92 -103
- package/dist/components/nodes/ToolNode.svelte.d.ts +6 -6
- package/dist/components/nodes/WorkflowNode.svelte +132 -191
- package/dist/components/nodes/WorkflowNode.svelte.d.ts +1 -1
- package/dist/components/playground/ChatInput.svelte +316 -27
- package/dist/components/playground/ChatInput.svelte.d.ts +31 -1
- package/dist/components/playground/ControlPanel.svelte +22 -0
- package/dist/components/playground/ControlPanel.svelte.d.ts +13 -0
- package/dist/components/playground/InputCollector.svelte +11 -48
- package/dist/components/playground/PipelineKanbanView.svelte +6 -4
- package/dist/components/playground/PipelineKanbanView.svelte.d.ts +2 -0
- package/dist/components/playground/PipelinePanel.svelte +20 -3
- package/dist/components/playground/PipelinePanel.svelte.d.ts +2 -0
- package/dist/components/playground/PipelineTableView.svelte +6 -4
- package/dist/components/playground/PipelineTableView.svelte.d.ts +2 -0
- package/dist/components/playground/Playground.svelte +292 -28
- package/dist/components/playground/Playground.svelte.d.ts +3 -0
- package/dist/components/playground/PlaygroundApp.svelte +6 -1
- package/dist/components/playground/PlaygroundApp.svelte.d.ts +3 -0
- package/dist/components/playground/PlaygroundModal.svelte +5 -0
- package/dist/components/playground/PlaygroundModal.svelte.d.ts +3 -0
- package/dist/components/playground/PlaygroundStudio.svelte +7 -6
- package/dist/components/playground/PlaygroundStudio.svelte.d.ts +3 -0
- package/dist/components/playground/pipelineViewUtils.svelte.d.ts +2 -1
- package/dist/components/playground/pipelineViewUtils.svelte.js +2 -2
- 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 +71 -1
- package/dist/config/endpoints.js +46 -5
- package/dist/core/index.d.ts +2 -3
- package/dist/core/index.js +2 -6
- package/dist/display/index.d.ts +6 -1
- package/dist/display/index.js +9 -1
- package/dist/editor/index.d.ts +1 -1
- package/dist/editor/index.js +1 -1
- package/dist/form/full.d.ts +2 -1
- package/dist/form/full.js +4 -1
- package/dist/form/index.d.ts +0 -1
- package/dist/form/index.js +3 -2
- package/dist/helpers/workflowEditorHelper.d.ts +4 -2
- package/dist/helpers/workflowEditorHelper.js +8 -8
- package/dist/messages/defaults.d.ts +98 -0
- package/dist/messages/defaults.js +58 -1
- package/dist/messages/index.d.ts +1 -1
- package/dist/messages/index.js +1 -1
- package/dist/openapi/v1/openapi.yaml +35 -23
- package/dist/playground/commands/args.d.ts +32 -0
- package/dist/playground/commands/args.js +50 -0
- package/dist/playground/commands/dispatch.d.ts +143 -0
- package/dist/playground/commands/dispatch.js +162 -0
- package/dist/playground/commands/index.d.ts +14 -0
- package/dist/playground/commands/index.js +10 -0
- package/dist/playground/commands/parser.d.ts +38 -0
- package/dist/playground/commands/parser.js +163 -0
- package/dist/playground/commands/registry.d.ts +42 -0
- package/dist/playground/commands/registry.js +122 -0
- package/dist/playground/commands/suggest.d.ts +37 -0
- package/dist/playground/commands/suggest.js +46 -0
- package/dist/playground/commands/types.d.ts +111 -0
- package/dist/playground/commands/types.js +15 -0
- package/dist/playground/index.d.ts +21 -2
- package/dist/playground/index.js +27 -2
- package/dist/playground/mount.d.ts +19 -5
- package/dist/playground/mount.js +16 -8
- package/dist/playground/runAction.d.ts +48 -0
- package/dist/playground/runAction.js +31 -0
- package/dist/registry/builtinNodeTypes.d.ts +53 -0
- package/dist/registry/builtinNodeTypes.js +67 -0
- package/dist/registry/builtinNodes.d.ts +2 -39
- package/dist/registry/builtinNodes.js +6 -53
- package/dist/registry/nodeComponentRegistry.d.ts +2 -1
- package/dist/schemas/v1/workflow.schema.json +16 -14
- package/dist/services/agentSpecExecutionService.d.ts +0 -2
- package/dist/services/agentSpecExecutionService.js +0 -2
- package/dist/services/apiVariableService.js +12 -26
- package/dist/services/categoriesApi.js +3 -6
- package/dist/services/chatService.d.ts +4 -3
- package/dist/services/chatService.js +13 -18
- package/dist/services/dynamicSchemaService.d.ts +31 -4
- package/dist/services/dynamicSchemaService.js +62 -33
- package/dist/services/historyService.d.ts +30 -8
- package/dist/services/historyService.js +51 -15
- package/dist/services/interruptService.d.ts +7 -6
- package/dist/services/interruptService.js +19 -21
- package/dist/services/pipelineSignalService.d.ts +97 -0
- package/dist/services/pipelineSignalService.js +94 -0
- package/dist/services/playgroundService.d.ts +21 -8
- package/dist/services/playgroundService.js +45 -25
- 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/workflowLaunchService.d.ts +74 -0
- package/dist/services/workflowLaunchService.js +74 -0
- 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 +11 -0
- package/dist/stores/apiContext.js +15 -0
- package/dist/stores/categoriesStore.svelte.js +0 -1
- package/dist/stores/historyStore.svelte.d.ts +17 -3
- package/dist/stores/historyStore.svelte.js +30 -3
- package/dist/stores/instanceContainer.svelte.js +5 -0
- package/dist/stores/playgroundStore.svelte.js +1 -3
- package/dist/stores/settingsStore.svelte.d.ts +13 -0
- package/dist/stores/settingsStore.svelte.js +32 -0
- package/dist/stores/workflowStore.svelte.d.ts +42 -5
- package/dist/stores/workflowStore.svelte.js +109 -32
- package/dist/styles/base.css +285 -14
- package/dist/styles/tokens.css +60 -2
- package/dist/svelte-app.d.ts +18 -1
- package/dist/svelte-app.js +75 -110
- 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/chat.d.ts +5 -1
- package/dist/types/events.d.ts +18 -0
- package/dist/types/events.js +2 -1
- package/dist/types/index.d.ts +84 -29
- package/dist/types/index.js +0 -1
- package/dist/types/settings.d.ts +28 -1
- package/dist/types/settings.js +6 -3
- 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/canvasSelection.d.ts +25 -0
- package/dist/utils/canvasSelection.js +37 -0
- package/dist/utils/colors.d.ts +27 -0
- package/dist/utils/colors.js +23 -0
- package/dist/utils/connections.js +20 -56
- 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/nodeFormSchema.d.ts +51 -0
- package/dist/utils/nodeFormSchema.js +87 -0
- package/dist/utils/nodeIds.d.ts +1 -1
- package/dist/utils/nodeIds.js +1 -1
- package/dist/utils/nodeSwap.js +3 -6
- package/dist/utils/nodeTypes.js +1 -1
- 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 +2 -1
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
<script lang="ts">
|
|
9
9
|
import type { NodeMetadata, NodeCategory, WorkflowFormat, WorkflowNode } from '../types/index.js';
|
|
10
10
|
import Icon from '@iconify/svelte';
|
|
11
|
+
import Input from './Input.svelte';
|
|
11
12
|
import { getNodeIcon, getCategoryIcon } from '../utils/icons.js';
|
|
12
13
|
import { getCategoryColorToken } from '../utils/colors.js';
|
|
13
14
|
import { m } from '../messages/index.js';
|
|
@@ -115,12 +116,17 @@
|
|
|
115
116
|
|
|
116
117
|
<!-- Search (hidden in minimal via --fd-sidebar-search-display) -->
|
|
117
118
|
<div class="swap-picker__search">
|
|
118
|
-
<
|
|
119
|
+
<Input
|
|
119
120
|
type="text"
|
|
120
121
|
placeholder="Search node types..."
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
aria-label="Search node types"
|
|
123
|
+
value={searchInput}
|
|
124
|
+
oninput={(e) => (searchInput = e.currentTarget.value)}
|
|
125
|
+
>
|
|
126
|
+
{#snippet leading()}
|
|
127
|
+
<Icon icon="mdi:magnify" />
|
|
128
|
+
{/snippet}
|
|
129
|
+
</Input>
|
|
124
130
|
</div>
|
|
125
131
|
|
|
126
132
|
<!-- Node list -->
|
|
@@ -139,7 +145,7 @@
|
|
|
139
145
|
{fd.categories.getLabel(category).toUpperCase()}
|
|
140
146
|
</div>
|
|
141
147
|
<div class="swap-picker__flat-list">
|
|
142
|
-
{#each categoryNodes as nodeType (nodeType.
|
|
148
|
+
{#each categoryNodes as nodeType (nodeType.node_type_id)}
|
|
143
149
|
<button class="swap-picker__flat-item" onclick={() => onSelect(nodeType)}>
|
|
144
150
|
<span
|
|
145
151
|
class="swap-picker__flat-dot"
|
|
@@ -168,7 +174,7 @@
|
|
|
168
174
|
</span>
|
|
169
175
|
</div>
|
|
170
176
|
<div class="swap-picker__category-items">
|
|
171
|
-
{#each categoryNodes as nodeType (nodeType.
|
|
177
|
+
{#each categoryNodes as nodeType (nodeType.node_type_id)}
|
|
172
178
|
<button class="swap-picker__item" onclick={() => onSelect(nodeType)}>
|
|
173
179
|
<span
|
|
174
180
|
class="swap-picker__item-icon"
|
|
@@ -298,30 +304,6 @@
|
|
|
298
304
|
flex-shrink: 0;
|
|
299
305
|
}
|
|
300
306
|
|
|
301
|
-
.swap-picker__input {
|
|
302
|
-
width: 100%;
|
|
303
|
-
padding: 0.5rem 0.75rem;
|
|
304
|
-
border: 1px solid var(--fd-border-strong);
|
|
305
|
-
border-radius: var(--fd-radius-md);
|
|
306
|
-
font-size: var(--fd-text-sm);
|
|
307
|
-
color: var(--fd-foreground);
|
|
308
|
-
background-color: var(--fd-background);
|
|
309
|
-
box-sizing: border-box;
|
|
310
|
-
transition:
|
|
311
|
-
border-color var(--fd-transition-normal),
|
|
312
|
-
box-shadow var(--fd-transition-normal);
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
.swap-picker__input:focus {
|
|
316
|
-
outline: none;
|
|
317
|
-
border-color: var(--fd-ring);
|
|
318
|
-
box-shadow: 0 0 0 3px color-mix(in srgb, var(--fd-ring) 20%, transparent);
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
.swap-picker__input::placeholder {
|
|
322
|
-
color: var(--fd-muted-foreground);
|
|
323
|
-
}
|
|
324
|
-
|
|
325
307
|
.swap-picker__list {
|
|
326
308
|
flex: 1;
|
|
327
309
|
overflow-y: auto;
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
import { createEndpointConfig } from '../config/endpoints.js';
|
|
13
13
|
import type { Workflow } from '../types/index.js';
|
|
14
14
|
import type { EndpointConfig } from '../config/endpoints.js';
|
|
15
|
+
import type { AuthProvider } from '../types/auth.js';
|
|
15
16
|
import { logger } from '../utils/logger.js';
|
|
16
17
|
import { m } from '../messages/index.js';
|
|
17
18
|
|
|
@@ -21,6 +22,8 @@
|
|
|
21
22
|
apiClient?: EnhancedFlowDropApiClient;
|
|
22
23
|
baseUrl?: string;
|
|
23
24
|
endpointConfig?: EndpointConfig;
|
|
25
|
+
/** Auth provider used when this component builds its own API client from endpointConfig/baseUrl. */
|
|
26
|
+
authProvider?: AuthProvider;
|
|
24
27
|
runLabel?: string;
|
|
25
28
|
/** When true, suppresses breadcrumb and layout events (used inside playground panel) */
|
|
26
29
|
isEmbedded?: boolean;
|
|
@@ -43,6 +46,7 @@
|
|
|
43
46
|
apiClient,
|
|
44
47
|
baseUrl,
|
|
45
48
|
endpointConfig,
|
|
49
|
+
authProvider,
|
|
46
50
|
onActionsReady,
|
|
47
51
|
runLabel,
|
|
48
52
|
isEmbedded = false,
|
|
@@ -59,7 +63,8 @@
|
|
|
59
63
|
const client =
|
|
60
64
|
apiClient ||
|
|
61
65
|
new EnhancedFlowDropApiClient(
|
|
62
|
-
endpointConfig ?? createEndpointConfig(baseUrl || '/api/flowdrop')
|
|
66
|
+
endpointConfig ?? createEndpointConfig(baseUrl || '/api/flowdrop'),
|
|
67
|
+
authProvider
|
|
63
68
|
);
|
|
64
69
|
|
|
65
70
|
// Pipeline status — drives breadcrumb label and the 5s poll while running
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { EnhancedFlowDropApiClient } from '../api/enhanced-client.js';
|
|
2
2
|
import type { Workflow } from '../types/index.js';
|
|
3
3
|
import type { EndpointConfig } from '../config/endpoints.js';
|
|
4
|
+
import type { AuthProvider } from '../types/auth.js';
|
|
4
5
|
interface Props {
|
|
5
6
|
pipelineId: string;
|
|
6
7
|
workflow: Workflow;
|
|
7
8
|
apiClient?: EnhancedFlowDropApiClient;
|
|
8
9
|
baseUrl?: string;
|
|
9
10
|
endpointConfig?: EndpointConfig;
|
|
11
|
+
/** Auth provider used when this component builds its own API client from endpointConfig/baseUrl. */
|
|
12
|
+
authProvider?: AuthProvider;
|
|
10
13
|
runLabel?: string;
|
|
11
14
|
/** When true, suppresses breadcrumb and layout events (used inside playground panel) */
|
|
12
15
|
isEmbedded?: boolean;
|
|
@@ -59,9 +59,11 @@
|
|
|
59
59
|
import type { ConfigSchema, AuthProvider } from '../types/index.js';
|
|
60
60
|
import type { UISchemaElement } from '../types/uischema.js';
|
|
61
61
|
import { provideInstance } from '../stores/getInstance.svelte.js';
|
|
62
|
-
|
|
62
|
+
// Registry-based light field factory — heavy editors (CodeMirror) are resolved
|
|
63
|
+
// at runtime via fd.fields, so importing SchemaForm never statically pulls them.
|
|
64
|
+
import FormField from './form/FormFieldLight.svelte';
|
|
63
65
|
import FormUISchemaRenderer from './form/FormUISchemaRenderer.svelte';
|
|
64
|
-
import type { FieldSchema } from './form/
|
|
66
|
+
import type { FieldSchema } from './form/types.js';
|
|
65
67
|
import { m } from '../messages/index.js';
|
|
66
68
|
import { mergeWithDefaults, cascadeClearAutocompleteDependents } from '../utils/formMerge.js';
|
|
67
69
|
|
|
@@ -471,11 +473,6 @@
|
|
|
471
473
|
color: var(--fd-foreground);
|
|
472
474
|
}
|
|
473
475
|
|
|
474
|
-
.schema-form__button--secondary:focus-visible {
|
|
475
|
-
outline: none;
|
|
476
|
-
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
|
|
477
|
-
}
|
|
478
|
-
|
|
479
476
|
.schema-form__button--primary {
|
|
480
477
|
background: linear-gradient(135deg, var(--fd-primary) 0%, var(--fd-primary-hover) 100%);
|
|
481
478
|
color: var(--fd-primary-foreground);
|
|
@@ -496,13 +493,6 @@
|
|
|
496
493
|
transform: translateY(0);
|
|
497
494
|
}
|
|
498
495
|
|
|
499
|
-
.schema-form__button--primary:focus-visible {
|
|
500
|
-
outline: none;
|
|
501
|
-
box-shadow:
|
|
502
|
-
0 0 0 3px rgba(59, 130, 246, 0.4),
|
|
503
|
-
0 4px 12px rgba(59, 130, 246, 0.35);
|
|
504
|
-
}
|
|
505
|
-
|
|
506
496
|
.schema-form__button-spinner {
|
|
507
497
|
width: 1rem;
|
|
508
498
|
height: 1rem;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Select — typed wrapper over the shared `.flowdrop-input` system (base.css).
|
|
3
|
+
|
|
4
|
+
Renders the field shell (`.flowdrop-input .flowdrop-input--select`) plus a
|
|
5
|
+
built-in chevron overlay (`.flowdrop-select-wrap`), so selects match the exact
|
|
6
|
+
look of Input/Textarea. The native arrow is removed; the chevron tints to
|
|
7
|
+
--fd-primary on focus. Pass <option>/<optgroup> as children. Native attributes
|
|
8
|
+
(value, disabled, id, aria-*, onchange…) forward to the underlying <select>.
|
|
9
|
+
|
|
10
|
+
Internal for now; see Button.svelte / Input.svelte for the pattern.
|
|
11
|
+
-->
|
|
12
|
+
|
|
13
|
+
<script lang="ts">
|
|
14
|
+
import type { Snippet } from 'svelte';
|
|
15
|
+
import type { HTMLSelectAttributes } from 'svelte/elements';
|
|
16
|
+
|
|
17
|
+
// Omit native numeric `size` so our design-token size (matching Button) wins.
|
|
18
|
+
interface Props extends Omit<HTMLSelectAttributes, 'size'> {
|
|
19
|
+
/** Size — `md` is the base; `sm`/`lg` add a modifier */
|
|
20
|
+
size?: 'sm' | 'md' | 'lg';
|
|
21
|
+
/** Renders the error-border state */
|
|
22
|
+
invalid?: boolean;
|
|
23
|
+
/** Extra classes appended to the <select> */
|
|
24
|
+
class?: string;
|
|
25
|
+
/** The <option>/<optgroup> elements */
|
|
26
|
+
children: Snippet;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
let { size = 'md', invalid = false, class: className = '', children, ...rest }: Props = $props();
|
|
30
|
+
|
|
31
|
+
const selectClass = $derived(
|
|
32
|
+
[
|
|
33
|
+
'flowdrop-input',
|
|
34
|
+
'flowdrop-input--select',
|
|
35
|
+
size === 'md' ? '' : `flowdrop-input--${size}`,
|
|
36
|
+
invalid ? 'flowdrop-input--invalid' : '',
|
|
37
|
+
className
|
|
38
|
+
]
|
|
39
|
+
.filter(Boolean)
|
|
40
|
+
.join(' ')
|
|
41
|
+
);
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<div class="flowdrop-select-wrap">
|
|
45
|
+
<select class={selectClass} {...rest}>
|
|
46
|
+
{@render children()}
|
|
47
|
+
</select>
|
|
48
|
+
<span class="flowdrop-select-wrap__icon" aria-hidden="true">
|
|
49
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
50
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M6 9l6 6 6-6" />
|
|
51
|
+
</svg>
|
|
52
|
+
</span>
|
|
53
|
+
</div>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { HTMLSelectAttributes } from 'svelte/elements';
|
|
3
|
+
interface Props extends Omit<HTMLSelectAttributes, 'size'> {
|
|
4
|
+
/** Size — `md` is the base; `sm`/`lg` add a modifier */
|
|
5
|
+
size?: 'sm' | 'md' | 'lg';
|
|
6
|
+
/** Renders the error-border state */
|
|
7
|
+
invalid?: boolean;
|
|
8
|
+
/** Extra classes appended to the <select> */
|
|
9
|
+
class?: string;
|
|
10
|
+
/** The <option>/<optgroup> elements */
|
|
11
|
+
children: Snippet;
|
|
12
|
+
}
|
|
13
|
+
declare const Select: import("svelte").Component<Props, {}, "">;
|
|
14
|
+
type Select = ReturnType<typeof Select>;
|
|
15
|
+
export default Select;
|
|
@@ -198,9 +198,32 @@
|
|
|
198
198
|
description: 'Visual style and layout of the editor',
|
|
199
199
|
oneOf: [
|
|
200
200
|
{ const: 'default', title: 'Default' },
|
|
201
|
-
{ const: 'minimal', title: 'Minimal' }
|
|
201
|
+
{ const: 'minimal', title: 'Minimal' },
|
|
202
|
+
{ const: 'drafter', title: 'Drafter' }
|
|
202
203
|
],
|
|
203
204
|
default: 'default'
|
|
205
|
+
},
|
|
206
|
+
configPlacement: {
|
|
207
|
+
type: 'string',
|
|
208
|
+
title: 'Config Panel Location',
|
|
209
|
+
description: 'Where the node/workflow configuration panel opens',
|
|
210
|
+
oneOf: [
|
|
211
|
+
{ const: 'sidebar', title: 'Right sidebar' },
|
|
212
|
+
{ const: 'modal', title: 'Modal window' },
|
|
213
|
+
{ const: 'below', title: 'Bottom panel' }
|
|
214
|
+
],
|
|
215
|
+
default: 'sidebar'
|
|
216
|
+
},
|
|
217
|
+
consolePlacement: {
|
|
218
|
+
type: 'string',
|
|
219
|
+
title: 'Console / AI Assistant Location',
|
|
220
|
+
description: 'Where the console and AI Assistant open',
|
|
221
|
+
oneOf: [
|
|
222
|
+
{ const: 'sidebar', title: 'Right sidebar' },
|
|
223
|
+
{ const: 'modal', title: 'Modal window' },
|
|
224
|
+
{ const: 'below', title: 'Bottom panel' }
|
|
225
|
+
],
|
|
226
|
+
default: 'below'
|
|
204
227
|
}
|
|
205
228
|
}
|
|
206
229
|
},
|
|
@@ -250,6 +273,15 @@
|
|
|
250
273
|
title: 'AI Assistant Auto-retry',
|
|
251
274
|
description: 'Automatically ask the AI to self-correct when commands fail',
|
|
252
275
|
default: true
|
|
276
|
+
},
|
|
277
|
+
chatAllowLayoutChanges: {
|
|
278
|
+
type: 'boolean',
|
|
279
|
+
title: 'AI Assistant Layout Changes',
|
|
280
|
+
description:
|
|
281
|
+
'Let the AI assistant re-arrange node positions (layout auto / layout beautify). ' +
|
|
282
|
+
'Turn off to keep a hand-crafted layout — those commands are then skipped and ' +
|
|
283
|
+
'the rest of the batch still applies.',
|
|
284
|
+
default: true
|
|
253
285
|
}
|
|
254
286
|
}
|
|
255
287
|
},
|
|
@@ -538,11 +570,6 @@
|
|
|
538
570
|
color: var(--fd-primary-foreground);
|
|
539
571
|
}
|
|
540
572
|
|
|
541
|
-
.flowdrop-settings-panel__tab:focus {
|
|
542
|
-
outline: none;
|
|
543
|
-
box-shadow: 0 0 0 2px var(--fd-ring);
|
|
544
|
-
}
|
|
545
|
-
|
|
546
573
|
:global(.flowdrop-settings-panel__tab-icon) {
|
|
547
574
|
font-size: var(--fd-text-base);
|
|
548
575
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Textarea — typed wrapper over the shared `.flowdrop-input` system (base.css),
|
|
3
|
+
with the `.flowdrop-input--textarea` modifier (min-height + vertical resize).
|
|
4
|
+
|
|
5
|
+
Shares the exact field look of Input/Select so multiline fields render
|
|
6
|
+
identically. All styling lives in base.css. Native attributes (value,
|
|
7
|
+
placeholder, rows, disabled, id, aria-*, oninput…) forward to <textarea>.
|
|
8
|
+
|
|
9
|
+
Internal for now; see Button.svelte / Input.svelte for the pattern.
|
|
10
|
+
-->
|
|
11
|
+
|
|
12
|
+
<script lang="ts">
|
|
13
|
+
import type { HTMLTextareaAttributes } from 'svelte/elements';
|
|
14
|
+
|
|
15
|
+
interface Props extends HTMLTextareaAttributes {
|
|
16
|
+
/** Size — `md` is the base; `sm`/`lg` add a modifier */
|
|
17
|
+
size?: 'sm' | 'md' | 'lg';
|
|
18
|
+
/** Renders the error-border state */
|
|
19
|
+
invalid?: boolean;
|
|
20
|
+
/** Extra classes appended to the textarea */
|
|
21
|
+
class?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
let { size = 'md', invalid = false, class: className = '', ...rest }: Props = $props();
|
|
25
|
+
|
|
26
|
+
const textareaClass = $derived(
|
|
27
|
+
[
|
|
28
|
+
'flowdrop-input',
|
|
29
|
+
'flowdrop-input--textarea',
|
|
30
|
+
size === 'md' ? '' : `flowdrop-input--${size}`,
|
|
31
|
+
invalid ? 'flowdrop-input--invalid' : '',
|
|
32
|
+
className
|
|
33
|
+
]
|
|
34
|
+
.filter(Boolean)
|
|
35
|
+
.join(' ')
|
|
36
|
+
);
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<textarea class={textareaClass} {...rest}></textarea>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { HTMLTextareaAttributes } from 'svelte/elements';
|
|
2
|
+
interface Props extends HTMLTextareaAttributes {
|
|
3
|
+
/** Size — `md` is the base; `sm`/`lg` add a modifier */
|
|
4
|
+
size?: 'sm' | 'md' | 'lg';
|
|
5
|
+
/** Renders the error-border state */
|
|
6
|
+
invalid?: boolean;
|
|
7
|
+
/** Extra classes appended to the textarea */
|
|
8
|
+
class?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const Textarea: import("svelte").Component<Props, {}, "">;
|
|
11
|
+
type Textarea = ReturnType<typeof Textarea>;
|
|
12
|
+
export default Textarea;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
Theme Toggle Component
|
|
3
|
-
A button that cycles through light, dark, and auto theme modes
|
|
4
|
-
Displays
|
|
5
|
-
|
|
3
|
+
A button that cycles through light, dark, and auto theme modes.
|
|
4
|
+
Displays the icon for the current theme state.
|
|
5
|
+
|
|
6
|
+
Built on the shared Button primitive so it stays visually and dimensionally
|
|
7
|
+
aligned with every other control (height, focus ring, hover) for free.
|
|
6
8
|
-->
|
|
7
9
|
|
|
8
10
|
<script lang="ts">
|
|
9
11
|
import Icon from '@iconify/svelte';
|
|
12
|
+
import Button from './Button.svelte';
|
|
10
13
|
import { getTheme, getResolvedTheme, cycleTheme } from '../stores/settingsStore.svelte.js';
|
|
11
14
|
import type { ThemePreference } from '../types/settings.js';
|
|
12
15
|
|
|
@@ -47,7 +50,7 @@
|
|
|
47
50
|
}
|
|
48
51
|
|
|
49
52
|
/**
|
|
50
|
-
* Get
|
|
53
|
+
* Get the label text for the current theme
|
|
51
54
|
*/
|
|
52
55
|
const themeLabel = $derived(getThemeLabel(getTheme()));
|
|
53
56
|
|
|
@@ -80,105 +83,23 @@
|
|
|
80
83
|
const next = currentTheme === 'light' ? 'Dark' : 'Auto';
|
|
81
84
|
return `Theme: ${currentTheme === 'light' ? 'Light' : 'Dark'}. Click to switch to ${next}`;
|
|
82
85
|
}
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Handle click to cycle theme
|
|
86
|
-
*/
|
|
87
|
-
function handleClick(): void {
|
|
88
|
-
cycleTheme();
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Handle keyboard events for accessibility
|
|
93
|
-
*/
|
|
94
|
-
function handleKeydown(event: KeyboardEvent): void {
|
|
95
|
-
if (event.key === 'Enter' || event.key === ' ') {
|
|
96
|
-
event.preventDefault();
|
|
97
|
-
cycleTheme();
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
86
|
</script>
|
|
101
87
|
|
|
102
|
-
<
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
88
|
+
<Button
|
|
89
|
+
variant="outline"
|
|
90
|
+
{size}
|
|
91
|
+
class={className}
|
|
106
92
|
title={tooltipText}
|
|
107
|
-
|
|
108
|
-
|
|
93
|
+
ariaLabel={tooltipText}
|
|
94
|
+
onclick={cycleTheme}
|
|
109
95
|
>
|
|
110
|
-
<
|
|
111
|
-
<Icon icon={themeIcon} />
|
|
112
|
-
</span>
|
|
96
|
+
<Icon icon={themeIcon} />
|
|
113
97
|
{#if showLabel}
|
|
114
98
|
<span class="flowdrop-theme-toggle__label">{themeLabel}</span>
|
|
115
99
|
{/if}
|
|
116
|
-
</
|
|
100
|
+
</Button>
|
|
117
101
|
|
|
118
102
|
<style>
|
|
119
|
-
.flowdrop-theme-toggle {
|
|
120
|
-
display: inline-flex;
|
|
121
|
-
align-items: center;
|
|
122
|
-
justify-content: center;
|
|
123
|
-
gap: var(--fd-space-xs);
|
|
124
|
-
border: 1px solid var(--fd-border);
|
|
125
|
-
border-radius: var(--fd-radius-md);
|
|
126
|
-
background-color: var(--fd-background);
|
|
127
|
-
color: var(--fd-foreground);
|
|
128
|
-
cursor: pointer;
|
|
129
|
-
transition: all var(--fd-transition-normal);
|
|
130
|
-
font-family: inherit;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.flowdrop-theme-toggle:hover {
|
|
134
|
-
background-color: var(--fd-muted);
|
|
135
|
-
border-color: var(--fd-border-strong);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
.flowdrop-theme-toggle:focus {
|
|
139
|
-
outline: none;
|
|
140
|
-
box-shadow: 0 0 0 2px var(--fd-ring);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
.flowdrop-theme-toggle:active {
|
|
144
|
-
transform: scale(0.98);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
/* Size variants */
|
|
148
|
-
.flowdrop-theme-toggle--sm {
|
|
149
|
-
padding: var(--fd-space-3xs) var(--fd-space-xs);
|
|
150
|
-
font-size: var(--fd-text-xs);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
.flowdrop-theme-toggle--sm .flowdrop-theme-toggle__icon {
|
|
154
|
-
font-size: var(--fd-text-sm);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
.flowdrop-theme-toggle--md {
|
|
158
|
-
padding: var(--fd-space-xs) var(--fd-space-md);
|
|
159
|
-
font-size: var(--fd-text-sm);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
.flowdrop-theme-toggle--md .flowdrop-theme-toggle__icon {
|
|
163
|
-
font-size: var(--fd-text-base);
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
.flowdrop-theme-toggle--lg {
|
|
167
|
-
padding: var(--fd-space-md) var(--fd-space-xl);
|
|
168
|
-
font-size: var(--fd-text-base);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
.flowdrop-theme-toggle--lg .flowdrop-theme-toggle__icon {
|
|
172
|
-
font-size: var(--fd-text-lg);
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
.flowdrop-theme-toggle__icon {
|
|
176
|
-
display: flex;
|
|
177
|
-
align-items: center;
|
|
178
|
-
justify-content: center;
|
|
179
|
-
line-height: 1;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
103
|
.flowdrop-theme-toggle__label {
|
|
183
104
|
font-weight: 500;
|
|
184
105
|
}
|
|
@@ -17,12 +17,16 @@
|
|
|
17
17
|
|
|
18
18
|
const fd = getInstance();
|
|
19
19
|
|
|
20
|
+
// Element ref used only to reach xyflow's node wrapper (our ancestor).
|
|
21
|
+
let universalNodeEl: HTMLDivElement;
|
|
22
|
+
|
|
20
23
|
let {
|
|
24
|
+
id,
|
|
21
25
|
data,
|
|
22
26
|
selected = false
|
|
23
27
|
}: {
|
|
28
|
+
id: string;
|
|
24
29
|
data: WorkflowNode['data'] & {
|
|
25
|
-
nodeId?: string;
|
|
26
30
|
onConfigOpen?: (node: { id: string; type: string; data: WorkflowNode['data'] }) => void;
|
|
27
31
|
};
|
|
28
32
|
selected?: boolean;
|
|
@@ -61,6 +65,34 @@
|
|
|
61
65
|
shouldShowNodeStatus(executionInfo) && resolvedComponentName !== 'note'
|
|
62
66
|
);
|
|
63
67
|
|
|
68
|
+
// Keyboard activation lives on xyflow's node wrapper — the single focusable,
|
|
69
|
+
// arrow-movable element SvelteFlow manages. Because the wrapper is our
|
|
70
|
+
// ancestor, its keydown events never bubble down into our markup, so we bind
|
|
71
|
+
// directly to it. Enter/Space opens the node's config, mirroring the
|
|
72
|
+
// double-click (and single-click for square/atom) mouse paths. Node selection
|
|
73
|
+
// and arrow-key movement remain SvelteFlow's job.
|
|
74
|
+
$effect(() => {
|
|
75
|
+
const wrapper = universalNodeEl?.closest<HTMLElement>('.svelte-flow__node');
|
|
76
|
+
if (!wrapper) return;
|
|
77
|
+
|
|
78
|
+
function onWrapperKeydown(event: KeyboardEvent): void {
|
|
79
|
+
// Only when the node itself is focused — not an inner field (e.g. an
|
|
80
|
+
// editable note) — so we don't hijack typing.
|
|
81
|
+
if (event.target !== wrapper) return;
|
|
82
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
83
|
+
event.preventDefault();
|
|
84
|
+
data.onConfigOpen?.({
|
|
85
|
+
id,
|
|
86
|
+
type: resolvedComponentName,
|
|
87
|
+
data
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
wrapper.addEventListener('keydown', onWrapperKeydown);
|
|
93
|
+
return () => wrapper.removeEventListener('keydown', onWrapperKeydown);
|
|
94
|
+
});
|
|
95
|
+
|
|
64
96
|
/**
|
|
65
97
|
* Get the node component for the given type from the registry.
|
|
66
98
|
*
|
|
@@ -129,18 +161,18 @@
|
|
|
129
161
|
}
|
|
130
162
|
</script>
|
|
131
163
|
|
|
132
|
-
<div class="universal-node">
|
|
164
|
+
<div class="universal-node" bind:this={universalNodeEl}>
|
|
133
165
|
<!-- Render the node component dynamically (Svelte 5 dynamic component syntax) -->
|
|
134
166
|
{#if nodeComponent}
|
|
135
167
|
<!-- Svelte 5 dynamic component limitation; reactivity maintained via $derived -->
|
|
136
168
|
{@const NodeComponent = nodeComponent}
|
|
137
|
-
<NodeComponent {data} {selected} />
|
|
169
|
+
<NodeComponent {id} {data} {selected} />
|
|
138
170
|
{/if}
|
|
139
171
|
|
|
140
172
|
<!-- Status overlay - only show if there's meaningful status information -->
|
|
141
173
|
{#if shouldShowStatus}
|
|
142
174
|
<NodeStatusOverlay
|
|
143
|
-
nodeId={
|
|
175
|
+
nodeId={id}
|
|
144
176
|
{executionInfo}
|
|
145
177
|
position={getStatusPosition()}
|
|
146
178
|
size={getStatusSize()}
|