@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
|
@@ -19,6 +19,10 @@
|
|
|
19
19
|
|
|
20
20
|
<script lang="ts">
|
|
21
21
|
import Icon from '@iconify/svelte';
|
|
22
|
+
import Input from '../Input.svelte';
|
|
23
|
+
import Select from '../Select.svelte';
|
|
24
|
+
import Textarea from '../Textarea.svelte';
|
|
25
|
+
import IconButton from '../IconButton.svelte';
|
|
22
26
|
import type { FieldSchema } from './types.js';
|
|
23
27
|
import { m } from '../../messages/index.js';
|
|
24
28
|
|
|
@@ -284,40 +288,37 @@
|
|
|
284
288
|
<!-- Action buttons group -->
|
|
285
289
|
<div class="form-array__actions">
|
|
286
290
|
<!-- Move Up button -->
|
|
287
|
-
<
|
|
288
|
-
|
|
289
|
-
class="form-array__action-btn form-array__action-btn--move"
|
|
291
|
+
<IconButton
|
|
292
|
+
variant="primary"
|
|
290
293
|
onclick={() => moveItemUp(index)}
|
|
291
294
|
disabled={index === 0 || disabled}
|
|
292
|
-
|
|
295
|
+
ariaLabel={t.moveItemUp({ n: index + 1 })}
|
|
293
296
|
title={t.moveUp}
|
|
294
297
|
>
|
|
295
298
|
<Icon icon="heroicons:arrow-up" />
|
|
296
|
-
</
|
|
299
|
+
</IconButton>
|
|
297
300
|
|
|
298
301
|
<!-- Move Down button -->
|
|
299
|
-
<
|
|
300
|
-
|
|
301
|
-
class="form-array__action-btn form-array__action-btn--move"
|
|
302
|
+
<IconButton
|
|
303
|
+
variant="primary"
|
|
302
304
|
onclick={() => moveItemDown(index)}
|
|
303
305
|
disabled={index === items.length - 1 || disabled}
|
|
304
|
-
|
|
306
|
+
ariaLabel={t.moveItemDown({ n: index + 1 })}
|
|
305
307
|
title={t.moveDown}
|
|
306
308
|
>
|
|
307
309
|
<Icon icon="heroicons:arrow-down" />
|
|
308
|
-
</
|
|
310
|
+
</IconButton>
|
|
309
311
|
|
|
310
312
|
<!-- Delete button -->
|
|
311
|
-
<
|
|
312
|
-
|
|
313
|
-
class="form-array__action-btn form-array__action-btn--delete"
|
|
313
|
+
<IconButton
|
|
314
|
+
variant="danger"
|
|
314
315
|
onclick={() => removeItem(index)}
|
|
315
316
|
disabled={!canRemoveItem || disabled}
|
|
316
|
-
|
|
317
|
+
ariaLabel={t.deleteItem({ n: index + 1 })}
|
|
317
318
|
title={t.delete}
|
|
318
319
|
>
|
|
319
320
|
<Icon icon="heroicons:trash" />
|
|
320
|
-
</
|
|
321
|
+
</IconButton>
|
|
321
322
|
</div>
|
|
322
323
|
</div>
|
|
323
324
|
|
|
@@ -330,18 +331,16 @@
|
|
|
330
331
|
<!-- Simple type: render inline input -->
|
|
331
332
|
{#if itemSchema.type === 'string'}
|
|
332
333
|
{#if itemSchema.format === 'multiline'}
|
|
333
|
-
<
|
|
334
|
-
class="form-array__input form-array__textarea"
|
|
334
|
+
<Textarea
|
|
335
335
|
value={String(item ?? '')}
|
|
336
336
|
placeholder={itemSchema.placeholder ?? ''}
|
|
337
337
|
rows={3}
|
|
338
338
|
oninput={(e) => updateItem(index, e.currentTarget.value)}
|
|
339
339
|
{disabled}
|
|
340
|
-
|
|
340
|
+
/>
|
|
341
341
|
{:else}
|
|
342
|
-
<
|
|
342
|
+
<Input
|
|
343
343
|
type="text"
|
|
344
|
-
class="form-array__input"
|
|
345
344
|
value={String(item ?? '')}
|
|
346
345
|
placeholder={itemSchema.placeholder ?? ''}
|
|
347
346
|
oninput={(e) => updateItem(index, e.currentTarget.value)}
|
|
@@ -349,9 +348,9 @@
|
|
|
349
348
|
/>
|
|
350
349
|
{/if}
|
|
351
350
|
{:else if itemSchema.type === 'number' || itemSchema.type === 'integer'}
|
|
352
|
-
<
|
|
351
|
+
<Input
|
|
353
352
|
type="number"
|
|
354
|
-
class="
|
|
353
|
+
class="flowdrop-input--numeric"
|
|
355
354
|
value={item as number}
|
|
356
355
|
placeholder={itemSchema.placeholder ?? ''}
|
|
357
356
|
min={itemSchema.minimum}
|
|
@@ -380,8 +379,7 @@
|
|
|
380
379
|
</label>
|
|
381
380
|
{:else if itemSchema.enum}
|
|
382
381
|
<!-- Enum: render select -->
|
|
383
|
-
<
|
|
384
|
-
class="form-array__select"
|
|
382
|
+
<Select
|
|
385
383
|
value={String(item ?? '')}
|
|
386
384
|
onchange={(e) => updateItem(index, e.currentTarget.value)}
|
|
387
385
|
{disabled}
|
|
@@ -389,12 +387,11 @@
|
|
|
389
387
|
{#each itemSchema.enum as option (option)}
|
|
390
388
|
<option value={String(option)}>{String(option)}</option>
|
|
391
389
|
{/each}
|
|
392
|
-
</
|
|
390
|
+
</Select>
|
|
393
391
|
{:else}
|
|
394
392
|
<!-- Fallback to text -->
|
|
395
|
-
<
|
|
393
|
+
<Input
|
|
396
394
|
type="text"
|
|
397
|
-
class="form-array__input"
|
|
398
395
|
value={String(item ?? '')}
|
|
399
396
|
placeholder={itemSchema.placeholder ?? ''}
|
|
400
397
|
oninput={(e) => updateItem(index, e.currentTarget.value)}
|
|
@@ -425,9 +422,8 @@
|
|
|
425
422
|
|
|
426
423
|
<div class="form-array__subform-input">
|
|
427
424
|
{#if propFieldSchema.enum}
|
|
428
|
-
<
|
|
425
|
+
<Select
|
|
429
426
|
id="{id}-{index}-{propKey}"
|
|
430
|
-
class="form-array__select"
|
|
431
427
|
value={String(propValue ?? '')}
|
|
432
428
|
onchange={(e) =>
|
|
433
429
|
updateObjectProperty(index, propKey, e.currentTarget.value)}
|
|
@@ -436,23 +432,21 @@
|
|
|
436
432
|
{#each propFieldSchema.enum as option (option)}
|
|
437
433
|
<option value={String(option)}>{String(option)}</option>
|
|
438
434
|
{/each}
|
|
439
|
-
</
|
|
435
|
+
</Select>
|
|
440
436
|
{:else if propFieldSchema.type === 'string' && propFieldSchema.format === 'multiline'}
|
|
441
|
-
<
|
|
437
|
+
<Textarea
|
|
442
438
|
id="{id}-{index}-{propKey}"
|
|
443
|
-
class="form-array__input form-array__textarea"
|
|
444
439
|
value={String(propValue ?? '')}
|
|
445
440
|
placeholder={propFieldSchema.placeholder ?? ''}
|
|
446
441
|
rows={3}
|
|
447
442
|
oninput={(e) =>
|
|
448
443
|
updateObjectProperty(index, propKey, e.currentTarget.value)}
|
|
449
444
|
{disabled}
|
|
450
|
-
|
|
445
|
+
/>
|
|
451
446
|
{:else if propFieldSchema.type === 'string'}
|
|
452
|
-
<
|
|
447
|
+
<Input
|
|
453
448
|
id="{id}-{index}-{propKey}"
|
|
454
449
|
type="text"
|
|
455
|
-
class="form-array__input"
|
|
456
450
|
value={String(propValue ?? '')}
|
|
457
451
|
placeholder={propFieldSchema.placeholder ?? ''}
|
|
458
452
|
oninput={(e) =>
|
|
@@ -460,10 +454,10 @@
|
|
|
460
454
|
{disabled}
|
|
461
455
|
/>
|
|
462
456
|
{:else if propFieldSchema.type === 'number' || propFieldSchema.type === 'integer'}
|
|
463
|
-
<
|
|
457
|
+
<Input
|
|
464
458
|
id="{id}-{index}-{propKey}"
|
|
465
459
|
type="number"
|
|
466
|
-
class="
|
|
460
|
+
class="flowdrop-input--numeric"
|
|
467
461
|
value={propValue as number}
|
|
468
462
|
placeholder={propFieldSchema.placeholder ?? ''}
|
|
469
463
|
min={propFieldSchema.minimum}
|
|
@@ -493,10 +487,9 @@
|
|
|
493
487
|
</span>
|
|
494
488
|
</label>
|
|
495
489
|
{:else}
|
|
496
|
-
<
|
|
490
|
+
<Input
|
|
497
491
|
id="{id}-{index}-{propKey}"
|
|
498
492
|
type="text"
|
|
499
|
-
class="form-array__input"
|
|
500
493
|
value={String(propValue ?? '')}
|
|
501
494
|
placeholder={propFieldSchema.placeholder ?? ''}
|
|
502
495
|
oninput={(e) =>
|
|
@@ -596,7 +589,7 @@
|
|
|
596
589
|
flex-direction: column;
|
|
597
590
|
background-color: var(--fd-muted);
|
|
598
591
|
border: 1px solid var(--fd-border);
|
|
599
|
-
border-radius: var(--fd-radius
|
|
592
|
+
border-radius: var(--fd-control-radius);
|
|
600
593
|
overflow: hidden;
|
|
601
594
|
animation: itemFadeIn 0.25s ease-out forwards;
|
|
602
595
|
opacity: 0;
|
|
@@ -670,9 +663,7 @@
|
|
|
670
663
|
}
|
|
671
664
|
|
|
672
665
|
.form-array__item-toggle:focus-visible {
|
|
673
|
-
outline: none;
|
|
674
666
|
border-color: var(--fd-primary);
|
|
675
|
-
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
|
|
676
667
|
}
|
|
677
668
|
|
|
678
669
|
.form-array__item-toggle :global(svg) {
|
|
@@ -699,67 +690,8 @@
|
|
|
699
690
|
margin-left: auto;
|
|
700
691
|
}
|
|
701
692
|
|
|
702
|
-
.
|
|
703
|
-
|
|
704
|
-
align-items: center;
|
|
705
|
-
justify-content: center;
|
|
706
|
-
width: 2rem;
|
|
707
|
-
height: 2rem;
|
|
708
|
-
padding: 0;
|
|
709
|
-
border: 1px solid transparent;
|
|
710
|
-
border-radius: 0.375rem;
|
|
711
|
-
cursor: pointer;
|
|
712
|
-
transition: all 0.15s;
|
|
713
|
-
}
|
|
714
|
-
|
|
715
|
-
.form-array__action-btn :global(svg) {
|
|
716
|
-
width: 1rem;
|
|
717
|
-
height: 1rem;
|
|
718
|
-
}
|
|
719
|
-
|
|
720
|
-
.form-array__action-btn:focus-visible {
|
|
721
|
-
outline: none;
|
|
722
|
-
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
|
|
723
|
-
}
|
|
724
|
-
|
|
725
|
-
.form-array__action-btn:disabled {
|
|
726
|
-
opacity: 0.35;
|
|
727
|
-
cursor: not-allowed;
|
|
728
|
-
}
|
|
729
|
-
|
|
730
|
-
/* Move Up/Down buttons - Blue semantic color */
|
|
731
|
-
.form-array__action-btn--move {
|
|
732
|
-
background-color: var(--fd-primary-muted);
|
|
733
|
-
border-color: var(--fd-primary);
|
|
734
|
-
color: var(--fd-primary-hover);
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
.form-array__action-btn--move:hover:not(:disabled) {
|
|
738
|
-
background-color: var(--fd-primary-muted);
|
|
739
|
-
border-color: var(--fd-primary-hover);
|
|
740
|
-
color: var(--fd-primary-hover);
|
|
741
|
-
}
|
|
742
|
-
|
|
743
|
-
.form-array__action-btn--move:active:not(:disabled) {
|
|
744
|
-
background-color: var(--fd-primary);
|
|
745
|
-
}
|
|
746
|
-
|
|
747
|
-
/* Delete button - Red/Warning semantic color */
|
|
748
|
-
.form-array__action-btn--delete {
|
|
749
|
-
background-color: var(--fd-error-muted);
|
|
750
|
-
border-color: var(--fd-error);
|
|
751
|
-
color: var(--fd-error);
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
.form-array__action-btn--delete:hover:not(:disabled) {
|
|
755
|
-
background-color: var(--fd-error-muted);
|
|
756
|
-
border-color: var(--fd-error-hover);
|
|
757
|
-
color: var(--fd-error-hover);
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
.form-array__action-btn--delete:active:not(:disabled) {
|
|
761
|
-
background-color: var(--fd-error);
|
|
762
|
-
}
|
|
693
|
+
/* Action buttons (move/delete) now render through IconButton.svelte —
|
|
694
|
+
geometry + semantic tints live in base.css (.flowdrop-btn--icon*). */
|
|
763
695
|
|
|
764
696
|
/* ============================================
|
|
765
697
|
ITEM CONTENT
|
|
@@ -779,69 +711,6 @@
|
|
|
779
711
|
INPUTS (Simple Types)
|
|
780
712
|
============================================ */
|
|
781
713
|
|
|
782
|
-
.form-array__input {
|
|
783
|
-
width: 100%;
|
|
784
|
-
padding: 0.5rem 0.75rem;
|
|
785
|
-
border: 1px solid var(--fd-border);
|
|
786
|
-
border-radius: var(--fd-radius-md);
|
|
787
|
-
font-size: var(--fd-text-sm);
|
|
788
|
-
font-family: inherit;
|
|
789
|
-
color: var(--fd-foreground);
|
|
790
|
-
background-color: var(--fd-background);
|
|
791
|
-
transition: all var(--fd-transition-normal);
|
|
792
|
-
}
|
|
793
|
-
|
|
794
|
-
.form-array__input::placeholder {
|
|
795
|
-
color: var(--fd-muted-foreground);
|
|
796
|
-
}
|
|
797
|
-
|
|
798
|
-
.form-array__input:hover {
|
|
799
|
-
border-color: var(--fd-border-strong);
|
|
800
|
-
}
|
|
801
|
-
|
|
802
|
-
.form-array__input:focus {
|
|
803
|
-
outline: none;
|
|
804
|
-
border-color: var(--fd-primary);
|
|
805
|
-
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
|
|
806
|
-
}
|
|
807
|
-
|
|
808
|
-
.form-array__input--number {
|
|
809
|
-
font-variant-numeric: tabular-nums;
|
|
810
|
-
}
|
|
811
|
-
|
|
812
|
-
.form-array__textarea {
|
|
813
|
-
resize: vertical;
|
|
814
|
-
min-height: 4rem;
|
|
815
|
-
line-height: 1.5;
|
|
816
|
-
}
|
|
817
|
-
|
|
818
|
-
.form-array__select {
|
|
819
|
-
width: 100%;
|
|
820
|
-
padding: 0.5rem 2rem 0.5rem 0.75rem;
|
|
821
|
-
border: 1px solid var(--fd-border);
|
|
822
|
-
border-radius: var(--fd-radius-md);
|
|
823
|
-
font-size: var(--fd-text-sm);
|
|
824
|
-
font-family: inherit;
|
|
825
|
-
color: var(--fd-foreground);
|
|
826
|
-
background-color: var(--fd-background);
|
|
827
|
-
cursor: pointer;
|
|
828
|
-
appearance: none;
|
|
829
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
|
|
830
|
-
background-repeat: no-repeat;
|
|
831
|
-
background-position: right 0.5rem center;
|
|
832
|
-
background-size: 1rem;
|
|
833
|
-
}
|
|
834
|
-
|
|
835
|
-
.form-array__select:hover {
|
|
836
|
-
border-color: var(--fd-border-strong);
|
|
837
|
-
}
|
|
838
|
-
|
|
839
|
-
.form-array__select:focus {
|
|
840
|
-
outline: none;
|
|
841
|
-
border-color: var(--fd-primary);
|
|
842
|
-
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
|
|
843
|
-
}
|
|
844
|
-
|
|
845
714
|
/* ============================================
|
|
846
715
|
TOGGLE (Boolean in Array)
|
|
847
716
|
============================================ */
|
|
@@ -958,7 +827,7 @@
|
|
|
958
827
|
padding: 2rem 1rem;
|
|
959
828
|
background-color: var(--fd-muted);
|
|
960
829
|
border: 2px dashed var(--fd-border-strong);
|
|
961
|
-
border-radius: var(--fd-radius
|
|
830
|
+
border-radius: var(--fd-control-radius);
|
|
962
831
|
}
|
|
963
832
|
|
|
964
833
|
.form-array__empty :global(svg) {
|
|
@@ -986,7 +855,7 @@
|
|
|
986
855
|
gap: 0.5rem;
|
|
987
856
|
padding: 0.625rem 1rem;
|
|
988
857
|
border: 1px solid var(--fd-success);
|
|
989
|
-
border-radius: var(--fd-radius
|
|
858
|
+
border-radius: var(--fd-control-radius);
|
|
990
859
|
background-color: var(--fd-success-muted);
|
|
991
860
|
color: var(--fd-success-hover);
|
|
992
861
|
font-size: 0.8125rem;
|
|
@@ -1002,11 +871,6 @@
|
|
|
1002
871
|
color: var(--fd-success-hover);
|
|
1003
872
|
}
|
|
1004
873
|
|
|
1005
|
-
.form-array__add-btn:focus-visible {
|
|
1006
|
-
outline: none;
|
|
1007
|
-
box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3);
|
|
1008
|
-
}
|
|
1009
|
-
|
|
1010
874
|
.form-array__add-btn:active:not(:disabled) {
|
|
1011
875
|
background-color: var(--fd-success);
|
|
1012
876
|
}
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
import Icon from '@iconify/svelte';
|
|
26
26
|
import type { AutocompleteConfig, AuthProvider } from '../../types/index.js';
|
|
27
27
|
import type { FieldOption } from './types.js';
|
|
28
|
-
import {
|
|
28
|
+
import { authenticatedFetch } from '../../utils/fetchWithAuth.js';
|
|
29
29
|
import { logger } from '../../utils/logger.js';
|
|
30
30
|
import { m } from '../../messages/index.js';
|
|
31
31
|
|
|
@@ -245,16 +245,15 @@
|
|
|
245
245
|
|
|
246
246
|
let timeoutId: ReturnType<typeof setTimeout> | null = null;
|
|
247
247
|
try {
|
|
248
|
-
// Build headers with authentication (call getter to get current value)
|
|
249
|
-
const headers = await buildFetchHeaders(getAuthProvider?.());
|
|
250
|
-
|
|
251
248
|
timeoutId = setTimeout(() => controller.abort(), 5000);
|
|
252
249
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
250
|
+
// authenticatedFetch merges auth headers (call getter for current value)
|
|
251
|
+
// and applies the 401/403 lifecycle consistently with the rest of the lib.
|
|
252
|
+
const response = await authenticatedFetch(
|
|
253
|
+
buildUrl(query),
|
|
254
|
+
{ method: 'GET', signal: controller.signal },
|
|
255
|
+
{ authProvider: getAuthProvider?.() }
|
|
256
|
+
);
|
|
258
257
|
|
|
259
258
|
if (!response.ok) {
|
|
260
259
|
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
@@ -788,7 +787,6 @@
|
|
|
788
787
|
}
|
|
789
788
|
|
|
790
789
|
.form-autocomplete--disabled {
|
|
791
|
-
opacity: 0.6;
|
|
792
790
|
pointer-events: none;
|
|
793
791
|
}
|
|
794
792
|
|
|
@@ -805,7 +803,7 @@
|
|
|
805
803
|
font-size: var(--fd-text-sm);
|
|
806
804
|
font-family: inherit;
|
|
807
805
|
color: var(--fd-foreground);
|
|
808
|
-
background-color: var(--fd-
|
|
806
|
+
background-color: var(--fd-background);
|
|
809
807
|
transition: all var(--fd-transition-normal);
|
|
810
808
|
box-shadow: var(--fd-shadow-sm);
|
|
811
809
|
cursor: text;
|
|
@@ -818,11 +816,16 @@
|
|
|
818
816
|
}
|
|
819
817
|
|
|
820
818
|
.form-autocomplete__field--focused {
|
|
821
|
-
border-color: var(--fd-
|
|
819
|
+
border-color: var(--fd-ring);
|
|
822
820
|
background-color: var(--fd-background);
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
.form-autocomplete--disabled .form-autocomplete__field {
|
|
824
|
+
background-color: var(--fd-muted);
|
|
825
|
+
border-color: var(--fd-border-muted);
|
|
826
|
+
color: var(--fd-muted-foreground);
|
|
827
|
+
cursor: not-allowed;
|
|
828
|
+
opacity: 1;
|
|
826
829
|
}
|
|
827
830
|
|
|
828
831
|
/* Multiple mode - textarea-like styling */
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
padding: 0.75rem;
|
|
87
87
|
background-color: var(--fd-muted);
|
|
88
88
|
border: 1px solid var(--fd-border);
|
|
89
|
-
border-radius: var(--fd-radius
|
|
89
|
+
border-radius: var(--fd-control-radius);
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
.form-checkbox-item {
|
|
@@ -143,10 +143,6 @@
|
|
|
143
143
|
transform: scale(1);
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
.form-checkbox__input:focus-visible + .form-checkbox__custom {
|
|
147
|
-
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
146
|
.form-checkbox__label {
|
|
151
147
|
font-size: var(--fd-text-sm);
|
|
152
148
|
color: var(--fd-foreground);
|
|
@@ -364,7 +364,9 @@
|
|
|
364
364
|
border: 1px solid var(--fd-border);
|
|
365
365
|
border-radius: var(--fd-radius-lg);
|
|
366
366
|
overflow: hidden;
|
|
367
|
-
|
|
367
|
+
/* Match plain form fields (FormTextField/Textarea/Select): rest on the
|
|
368
|
+
input surface, not the recessed --fd-muted. */
|
|
369
|
+
background-color: var(--fd-background);
|
|
368
370
|
transition: all var(--fd-transition-normal);
|
|
369
371
|
box-shadow: var(--fd-shadow-sm);
|
|
370
372
|
}
|
|
@@ -374,12 +376,15 @@
|
|
|
374
376
|
background-color: var(--fd-background);
|
|
375
377
|
}
|
|
376
378
|
|
|
379
|
+
/* Compound widget: the focusable CodeMirror lives inside this container, so
|
|
380
|
+
the standard ring (centralized for simple elements) is drawn here via
|
|
381
|
+
:focus-within using the same --fd-ring tokens. Outline paints outside the
|
|
382
|
+
container's overflow, so it isn't clipped. */
|
|
377
383
|
.form-code-editor__container:focus-within {
|
|
378
384
|
border-color: var(--fd-primary);
|
|
379
385
|
background-color: var(--fd-background);
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
var(--fd-shadow-sm);
|
|
386
|
+
outline: var(--fd-ring-width) solid var(--fd-ring);
|
|
387
|
+
outline-offset: var(--fd-ring-offset);
|
|
383
388
|
}
|
|
384
389
|
|
|
385
390
|
.form-code-editor--error .form-code-editor__container {
|
|
@@ -388,9 +393,6 @@
|
|
|
388
393
|
|
|
389
394
|
.form-code-editor--error .form-code-editor__container:focus-within {
|
|
390
395
|
border-color: var(--fd-error);
|
|
391
|
-
box-shadow:
|
|
392
|
-
0 0 0 3px rgba(239, 68, 68, 0.12),
|
|
393
|
-
var(--fd-shadow-sm);
|
|
394
396
|
}
|
|
395
397
|
|
|
396
398
|
/* Dark theme overrides */
|
|
@@ -37,12 +37,14 @@
|
|
|
37
37
|
import FormSelect from './FormSelect.svelte';
|
|
38
38
|
import FormCheckboxGroup from './FormCheckboxGroup.svelte';
|
|
39
39
|
import FormArray from './FormArray.svelte';
|
|
40
|
+
import FormPorts from './FormPorts.svelte';
|
|
40
41
|
import FormCodeEditor from './FormCodeEditor.svelte';
|
|
41
42
|
import FormMarkdownEditor from './FormMarkdownEditor.svelte';
|
|
42
43
|
import FormTemplateEditor from './FormTemplateEditor.svelte';
|
|
43
44
|
import FormAutocomplete from './FormAutocomplete.svelte';
|
|
44
45
|
import type { FieldSchema } from './types.js';
|
|
45
46
|
import { getSchemaOptions } from './types.js';
|
|
47
|
+
import { resolveBaseFieldType } from './resolveFieldType.js';
|
|
46
48
|
import type { WorkflowNode, WorkflowEdge, AuthProvider } from '../../types/index.js';
|
|
47
49
|
import { getResolvedTheme } from '../../stores/settingsStore.svelte.js';
|
|
48
50
|
import { getInstance } from '../../stores/getInstance.svelte.js';
|
|
@@ -139,50 +141,15 @@
|
|
|
139
141
|
return 'template-editor';
|
|
140
142
|
}
|
|
141
143
|
|
|
142
|
-
//
|
|
143
|
-
if (schema.
|
|
144
|
-
return '
|
|
144
|
+
// Injected port order + exposure widget (the `ports` reserved config prop).
|
|
145
|
+
if (schema.format === 'ports') {
|
|
146
|
+
return 'ports';
|
|
145
147
|
}
|
|
146
148
|
|
|
147
|
-
//
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
// oneOf with labeled options (standard JSON Schema) -> select
|
|
153
|
-
// Must be checked before basic type checks since oneOf schemas often have type: 'string'
|
|
154
|
-
if (schema.oneOf && schema.oneOf.length > 0) {
|
|
155
|
-
return 'select-options';
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
// Multiline string -> textarea
|
|
159
|
-
if (schema.type === 'string' && schema.format === 'multiline') {
|
|
160
|
-
return 'textarea';
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
// Range slider for number/integer with format: "range"
|
|
164
|
-
if ((schema.type === 'number' || schema.type === 'integer') && schema.format === 'range') {
|
|
165
|
-
return 'range';
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
// String -> text field
|
|
169
|
-
if (schema.type === 'string') {
|
|
170
|
-
return 'text';
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
// Number or integer -> number field
|
|
174
|
-
if (schema.type === 'number' || schema.type === 'integer') {
|
|
175
|
-
return 'number';
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
// Boolean -> toggle
|
|
179
|
-
if (schema.type === 'boolean') {
|
|
180
|
-
return 'toggle';
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
// Future: Array type support
|
|
184
|
-
if (schema.type === 'array') {
|
|
185
|
-
return 'array';
|
|
149
|
+
// Shared basic field resolution (enum/oneOf/primitive types).
|
|
150
|
+
const base = resolveBaseFieldType(schema);
|
|
151
|
+
if (base) {
|
|
152
|
+
return base;
|
|
186
153
|
}
|
|
187
154
|
|
|
188
155
|
// Object type without specific format -> CodeMirror JSON editor
|
|
@@ -346,6 +313,15 @@
|
|
|
346
313
|
disabled={isReadOnly}
|
|
347
314
|
onChange={(val) => onChange(val)}
|
|
348
315
|
/>
|
|
316
|
+
{:else if fieldType === 'ports'}
|
|
317
|
+
<FormPorts
|
|
318
|
+
id={fieldKey}
|
|
319
|
+
{value}
|
|
320
|
+
ariaDescribedBy={descriptionId}
|
|
321
|
+
disabled={isReadOnly}
|
|
322
|
+
{node}
|
|
323
|
+
onChange={(val) => onChange(val)}
|
|
324
|
+
/>
|
|
349
325
|
{:else if fieldType === 'code-editor'}
|
|
350
326
|
<FormCodeEditor
|
|
351
327
|
id={fieldKey}
|