@flowdrop/flowdrop 2.0.0-beta.4 → 2.0.0-beta.6
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 +35 -0
- 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/commands/executor.js +5 -6
- package/dist/commands/types.js +5 -5
- package/dist/components/App.svelte +5 -14
- package/dist/components/ConfigForm.svelte +6 -505
- package/dist/components/ConfigForm.svelte.d.ts +4 -6
- package/dist/components/ConfigModal.svelte +0 -1
- package/dist/components/NodeSidebar.svelte +4 -4
- package/dist/components/NodeSwapPicker.svelte +2 -2
- package/dist/components/UniversalNode.svelte +5 -4
- package/dist/components/UniversalNode.svelte.d.ts +1 -1
- package/dist/components/console/ConsoleInput.svelte +3 -3
- package/dist/components/form/FormField.svelte +15 -0
- package/dist/components/form/FormFieldLight.svelte +14 -0
- package/dist/components/form/FormPorts.svelte +262 -0
- package/dist/components/form/FormPorts.svelte.d.ts +13 -0
- package/dist/components/nodes/AtomNode.svelte +16 -42
- package/dist/components/nodes/AtomNode.svelte.d.ts +1 -1
- package/dist/components/nodes/GatewayNode.svelte +26 -65
- package/dist/components/nodes/GatewayNode.svelte.d.ts +1 -1
- package/dist/components/nodes/IdeaNode.svelte +10 -8
- package/dist/components/nodes/IdeaNode.svelte.d.ts +8 -4
- package/dist/components/nodes/NotesNode.svelte +6 -4
- package/dist/components/nodes/NotesNode.svelte.d.ts +8 -4
- package/dist/components/nodes/SimpleNode.svelte +31 -55
- package/dist/components/nodes/SimpleNode.svelte.d.ts +4 -4
- package/dist/components/nodes/SquareNode.svelte +31 -55
- package/dist/components/nodes/SquareNode.svelte.d.ts +4 -4
- package/dist/components/nodes/TerminalNode.svelte +34 -38
- package/dist/components/nodes/TerminalNode.svelte.d.ts +4 -4
- package/dist/components/nodes/ToolNode.svelte +10 -8
- package/dist/components/nodes/ToolNode.svelte.d.ts +6 -6
- package/dist/components/nodes/WorkflowNode.svelte +43 -93
- package/dist/components/nodes/WorkflowNode.svelte.d.ts +1 -1
- package/dist/components/playground/PipelineKanbanView.svelte +2 -2
- package/dist/components/playground/PipelineTableView.svelte +2 -2
- package/dist/core/index.d.ts +1 -1
- package/dist/helpers/workflowEditorHelper.js +4 -5
- package/dist/openapi/v1/openapi.yaml +33 -21
- package/dist/registry/nodeComponentRegistry.d.ts +2 -1
- package/dist/schemas/v1/workflow.schema.json +16 -14
- package/dist/services/dynamicSchemaService.d.ts +2 -2
- package/dist/services/dynamicSchemaService.js +8 -8
- package/dist/stores/playgroundStore.svelte.js +1 -1
- package/dist/stores/workflowStore.svelte.d.ts +1 -1
- package/dist/stores/workflowStore.svelte.js +1 -19
- package/dist/types/index.d.ts +51 -27
- package/dist/utils/colors.d.ts +27 -0
- package/dist/utils/colors.js +23 -0
- package/dist/utils/connections.js +6 -6
- 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/portUtils.d.ts +47 -11
- package/dist/utils/portUtils.js +67 -14
- package/package.json +1 -1
|
@@ -24,19 +24,13 @@
|
|
|
24
24
|
ConfigSchema,
|
|
25
25
|
WorkflowNode,
|
|
26
26
|
WorkflowEdge,
|
|
27
|
-
NodeUIExtensions,
|
|
28
|
-
NodePort,
|
|
29
|
-
DynamicPort,
|
|
30
27
|
ConfigEditOptions,
|
|
31
28
|
AuthProvider
|
|
32
29
|
} from '../types/index.js';
|
|
33
|
-
import { dynamicPortToNodePort } from '../types/index.js';
|
|
34
30
|
import type { UISchemaElement } from '../types/uischema.js';
|
|
35
31
|
// Import the light, registry-based field factory and light fields directly
|
|
36
32
|
// (not via the form barrel, which aggregates the heavy CodeMirror editors).
|
|
37
33
|
import FormField from './form/FormFieldLight.svelte';
|
|
38
|
-
import FormFieldWrapper from './form/FormFieldWrapper.svelte';
|
|
39
|
-
import FormToggle from './form/FormToggle.svelte';
|
|
40
34
|
import FormUISchemaRenderer from './form/FormUISchemaRenderer.svelte';
|
|
41
35
|
import type { FieldSchema } from './form/types.js';
|
|
42
36
|
import {
|
|
@@ -50,8 +44,6 @@
|
|
|
50
44
|
import { provideInstance } from '../stores/getInstance.svelte.js';
|
|
51
45
|
import { getAvailableVariables } from '../services/variableService.js';
|
|
52
46
|
import { logger } from '../utils/logger.js';
|
|
53
|
-
import { getDataTypeColorToken, getPortBackgroundColor } from '../utils/colors.js';
|
|
54
|
-
import { applyPortOrder } from '../utils/portUtils.js';
|
|
55
47
|
import { mergeWithDefaults, cascadeClearAutocompleteDependents } from '../utils/formMerge.js';
|
|
56
48
|
|
|
57
49
|
interface Props {
|
|
@@ -68,8 +60,6 @@
|
|
|
68
60
|
uiSchema?: UISchemaElement;
|
|
69
61
|
/** Direct config values (used when node is not provided) */
|
|
70
62
|
values?: Record<string, unknown>;
|
|
71
|
-
/** Whether to show UI extension settings section */
|
|
72
|
-
showUIExtensions?: boolean;
|
|
73
63
|
/** Optional workflow ID for context in external links */
|
|
74
64
|
workflowId?: string;
|
|
75
65
|
/** Whether to also save the workflow when saving config */
|
|
@@ -87,9 +77,9 @@
|
|
|
87
77
|
/** Auth provider for API requests (used for template variable API mode) */
|
|
88
78
|
authProvider?: AuthProvider;
|
|
89
79
|
/** Callback when any field value changes (fired on blur for immediate sync) */
|
|
90
|
-
onChange?: (config: Record<string, unknown
|
|
91
|
-
/** Callback when form is saved
|
|
92
|
-
onSave?: (config: Record<string, unknown
|
|
80
|
+
onChange?: (config: Record<string, unknown>) => void;
|
|
81
|
+
/** Callback when form is saved */
|
|
82
|
+
onSave?: (config: Record<string, unknown>) => void;
|
|
93
83
|
/** Callback when form is cancelled */
|
|
94
84
|
onCancel?: () => void;
|
|
95
85
|
}
|
|
@@ -99,7 +89,6 @@
|
|
|
99
89
|
schema,
|
|
100
90
|
uiSchema,
|
|
101
91
|
values,
|
|
102
|
-
showUIExtensions = true,
|
|
103
92
|
workflowId,
|
|
104
93
|
saveWorkflowWhenSavingConfig = false,
|
|
105
94
|
workflowNodes = [],
|
|
@@ -119,7 +108,6 @@
|
|
|
119
108
|
// instance on the server (no cross-request leakage); no destroy here for the
|
|
120
109
|
// same reasons as SchemaForm (shared/default in the browser, no SSR teardown).
|
|
121
110
|
const fd = provideInstance();
|
|
122
|
-
const checker = fd.portCompatibility;
|
|
123
111
|
|
|
124
112
|
// Set context for child components (e.g., FormAutocomplete)
|
|
125
113
|
// Use getter functions to ensure child components always get the current prop value,
|
|
@@ -234,49 +222,6 @@
|
|
|
234
222
|
*/
|
|
235
223
|
let isSavingWorkflow = $state(false);
|
|
236
224
|
|
|
237
|
-
/**
|
|
238
|
-
* Get initial UI extensions from node (instance level overrides type level)
|
|
239
|
-
*/
|
|
240
|
-
const initialUIExtensions = $derived.by<NodeUIExtensions>(() => {
|
|
241
|
-
if (!node) return {};
|
|
242
|
-
// Merge type-level defaults with instance-level overrides
|
|
243
|
-
const typeDefaults = node.data.metadata?.extensions?.ui ?? {};
|
|
244
|
-
const instanceOverrides = node.data.extensions?.ui ?? {};
|
|
245
|
-
return { ...typeDefaults, ...instanceOverrides };
|
|
246
|
-
});
|
|
247
|
-
|
|
248
|
-
/**
|
|
249
|
-
* UI Extension values for display settings.
|
|
250
|
-
* Writable derived: recomputes from the node when it changes (covering both
|
|
251
|
-
* "different node opened" and the post-save round-trip through node.data),
|
|
252
|
-
* while local port-management edits overwrite it wholesale via reassignment.
|
|
253
|
-
* NOTE: the derived value is not a deep $state proxy — update it only by
|
|
254
|
-
* reassigning the whole object, never by mutating a property.
|
|
255
|
-
*/
|
|
256
|
-
let uiExtensionValues = $derived.by<NodeUIExtensions>(() => ({
|
|
257
|
-
hideUnconnectedHandles: initialUIExtensions.hideUnconnectedHandles ?? false,
|
|
258
|
-
portOrder: initialUIExtensions.portOrder
|
|
259
|
-
? {
|
|
260
|
-
inputs: initialUIExtensions.portOrder.inputs
|
|
261
|
-
? [...initialUIExtensions.portOrder.inputs]
|
|
262
|
-
: undefined,
|
|
263
|
-
outputs: initialUIExtensions.portOrder.outputs
|
|
264
|
-
? [...initialUIExtensions.portOrder.outputs]
|
|
265
|
-
: undefined
|
|
266
|
-
}
|
|
267
|
-
: undefined,
|
|
268
|
-
hiddenPorts: initialUIExtensions.hiddenPorts
|
|
269
|
-
? {
|
|
270
|
-
inputs: initialUIExtensions.hiddenPorts.inputs
|
|
271
|
-
? [...initialUIExtensions.hiddenPorts.inputs]
|
|
272
|
-
: undefined,
|
|
273
|
-
outputs: initialUIExtensions.hiddenPorts.outputs
|
|
274
|
-
? [...initialUIExtensions.hiddenPorts.outputs]
|
|
275
|
-
: undefined
|
|
276
|
-
}
|
|
277
|
-
: undefined
|
|
278
|
-
}));
|
|
279
|
-
|
|
280
225
|
/**
|
|
281
226
|
* Fetch dynamic schema when needed
|
|
282
227
|
*/
|
|
@@ -357,86 +302,6 @@
|
|
|
357
302
|
}
|
|
358
303
|
});
|
|
359
304
|
|
|
360
|
-
/**
|
|
361
|
-
* All input ports in current display order for the port management UI.
|
|
362
|
-
* Combines static metadata inputs + dynamic config inputs, sorted by portOrder.
|
|
363
|
-
*/
|
|
364
|
-
const allInputPortsForUI = $derived.by<NodePort[]>(() => {
|
|
365
|
-
if (!node) return [];
|
|
366
|
-
const staticInputs = node.data.metadata.inputs ?? [];
|
|
367
|
-
const dynInputs = ((node.data.config?.dynamicInputs as DynamicPort[]) || []).map((p) =>
|
|
368
|
-
dynamicPortToNodePort(p, 'input')
|
|
369
|
-
);
|
|
370
|
-
return applyPortOrder([...staticInputs, ...dynInputs], uiExtensionValues.portOrder?.inputs);
|
|
371
|
-
});
|
|
372
|
-
|
|
373
|
-
/**
|
|
374
|
-
* All output ports in current display order for the port management UI.
|
|
375
|
-
* Combines static metadata outputs + dynamic config outputs, sorted by portOrder.
|
|
376
|
-
*/
|
|
377
|
-
const allOutputPortsForUI = $derived.by<NodePort[]>(() => {
|
|
378
|
-
if (!node) return [];
|
|
379
|
-
const staticOutputs = node.data.metadata.outputs ?? [];
|
|
380
|
-
const dynOutputs = ((node.data.config?.dynamicOutputs as DynamicPort[]) || []).map((p) =>
|
|
381
|
-
dynamicPortToNodePort(p, 'output')
|
|
382
|
-
);
|
|
383
|
-
return applyPortOrder([...staticOutputs, ...dynOutputs], uiExtensionValues.portOrder?.outputs);
|
|
384
|
-
});
|
|
385
|
-
|
|
386
|
-
/**
|
|
387
|
-
* Move a port one position up or down in the display order.
|
|
388
|
-
*/
|
|
389
|
-
function movePort(direction: 'inputs' | 'outputs', portId: string, delta: -1 | 1): void {
|
|
390
|
-
const list = direction === 'inputs' ? allInputPortsForUI : allOutputPortsForUI;
|
|
391
|
-
const idx = list.findIndex((p) => p.id === portId);
|
|
392
|
-
if (idx === -1) return;
|
|
393
|
-
const newIdx = idx + delta;
|
|
394
|
-
if (newIdx < 0 || newIdx >= list.length) return;
|
|
395
|
-
const newOrder = list.map((p) => p.id);
|
|
396
|
-
[newOrder[idx], newOrder[newIdx]] = [newOrder[newIdx], newOrder[idx]];
|
|
397
|
-
uiExtensionValues = {
|
|
398
|
-
...uiExtensionValues,
|
|
399
|
-
portOrder: {
|
|
400
|
-
...uiExtensionValues.portOrder,
|
|
401
|
-
[direction]: newOrder
|
|
402
|
-
}
|
|
403
|
-
};
|
|
404
|
-
handleFormBlur();
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
/**
|
|
408
|
-
* Toggle manual visibility of a port. Required ports cannot be hidden.
|
|
409
|
-
*/
|
|
410
|
-
function togglePortHidden(direction: 'inputs' | 'outputs', portId: string): void {
|
|
411
|
-
const current = uiExtensionValues.hiddenPorts?.[direction] ?? [];
|
|
412
|
-
const isHidden = current.includes(portId);
|
|
413
|
-
const next = isHidden ? current.filter((id) => id !== portId) : [...current, portId];
|
|
414
|
-
uiExtensionValues = {
|
|
415
|
-
...uiExtensionValues,
|
|
416
|
-
hiddenPorts: {
|
|
417
|
-
...uiExtensionValues.hiddenPorts,
|
|
418
|
-
[direction]: next.length > 0 ? next : undefined
|
|
419
|
-
}
|
|
420
|
-
};
|
|
421
|
-
handleFormBlur();
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
/**
|
|
425
|
-
* Reset all port customizations (order + hidden) for a direction back to defaults.
|
|
426
|
-
*/
|
|
427
|
-
function resetPortCustomizations(direction: 'inputs' | 'outputs'): void {
|
|
428
|
-
const order = { ...uiExtensionValues.portOrder };
|
|
429
|
-
const hidden = { ...uiExtensionValues.hiddenPorts };
|
|
430
|
-
delete order[direction];
|
|
431
|
-
delete hidden[direction];
|
|
432
|
-
uiExtensionValues = {
|
|
433
|
-
...uiExtensionValues,
|
|
434
|
-
portOrder: Object.keys(order).length > 0 ? order : undefined,
|
|
435
|
-
hiddenPorts: Object.keys(hidden).length > 0 ? hidden : undefined
|
|
436
|
-
};
|
|
437
|
-
handleFormBlur();
|
|
438
|
-
}
|
|
439
|
-
|
|
440
305
|
/**
|
|
441
306
|
* Check if a field is required based on schema
|
|
442
307
|
*/
|
|
@@ -471,8 +336,7 @@
|
|
|
471
336
|
*/
|
|
472
337
|
function handleFormBlur(): void {
|
|
473
338
|
if (onChange) {
|
|
474
|
-
|
|
475
|
-
onChange({ ...configValues }, extensions);
|
|
339
|
+
onChange({ ...configValues });
|
|
476
340
|
// Discharge the edits buffer at the commit boundary. Subsequent prop
|
|
477
341
|
// changes (parent absorbing the commit, undo/redo, collaboration) then
|
|
478
342
|
// flow through `initialConfig` cleanly instead of being shadowed by a
|
|
@@ -483,8 +347,7 @@
|
|
|
483
347
|
|
|
484
348
|
/**
|
|
485
349
|
* Handle form submission
|
|
486
|
-
* Collects
|
|
487
|
-
* Optionally saves the workflow if the option is enabled
|
|
350
|
+
* Collects config values and optionally saves the workflow.
|
|
488
351
|
*/
|
|
489
352
|
async function handleSave(): Promise<void> {
|
|
490
353
|
// Collect all form values including hidden fields
|
|
@@ -531,13 +394,8 @@
|
|
|
531
394
|
);
|
|
532
395
|
}
|
|
533
396
|
|
|
534
|
-
// Pass UI extensions only if enabled
|
|
535
397
|
if (onSave) {
|
|
536
|
-
|
|
537
|
-
onSave(updatedConfig, uiExtensionValues);
|
|
538
|
-
} else {
|
|
539
|
-
onSave(updatedConfig);
|
|
540
|
-
}
|
|
398
|
+
onSave(updatedConfig);
|
|
541
399
|
}
|
|
542
400
|
|
|
543
401
|
// Save workflow if the option is enabled
|
|
@@ -754,192 +612,6 @@
|
|
|
754
612
|
</div>
|
|
755
613
|
{/if}
|
|
756
614
|
|
|
757
|
-
<!-- UI Extensions Section -->
|
|
758
|
-
{#if showUIExtensions && node}
|
|
759
|
-
<div class="config-form__extensions">
|
|
760
|
-
<div class="config-form__extensions-header">
|
|
761
|
-
<Icon icon="heroicons:adjustments-horizontal" class="config-form__extensions-icon" />
|
|
762
|
-
<span>Display Settings</span>
|
|
763
|
-
</div>
|
|
764
|
-
<div class="config-form__extensions-content">
|
|
765
|
-
<!-- Hide Unconnected Handles Toggle -->
|
|
766
|
-
<FormFieldWrapper
|
|
767
|
-
id="ext-hideUnconnectedHandles"
|
|
768
|
-
label="Hide Unconnected Ports"
|
|
769
|
-
description="Hide input and output ports that are not connected to reduce visual clutter"
|
|
770
|
-
>
|
|
771
|
-
<FormToggle
|
|
772
|
-
id="ext-hideUnconnectedHandles"
|
|
773
|
-
value={Boolean(uiExtensionValues.hideUnconnectedHandles)}
|
|
774
|
-
onLabel="Hidden"
|
|
775
|
-
offLabel="Visible"
|
|
776
|
-
ariaDescribedBy="ext-hideUnconnectedHandles-description"
|
|
777
|
-
onChange={(val) => {
|
|
778
|
-
uiExtensionValues = { ...uiExtensionValues, hideUnconnectedHandles: val };
|
|
779
|
-
handleFormBlur();
|
|
780
|
-
}}
|
|
781
|
-
/>
|
|
782
|
-
</FormFieldWrapper>
|
|
783
|
-
|
|
784
|
-
<!-- Input Port Order & Visibility -->
|
|
785
|
-
{#if allInputPortsForUI.length > 0}
|
|
786
|
-
<div class="config-form__port-order">
|
|
787
|
-
<div class="config-form__port-order-header">
|
|
788
|
-
<span class="config-form__port-order-label">Input Ports</span>
|
|
789
|
-
{#if uiExtensionValues.portOrder?.inputs?.length || uiExtensionValues.hiddenPorts?.inputs?.length}
|
|
790
|
-
<button
|
|
791
|
-
type="button"
|
|
792
|
-
class="config-form__port-order-reset"
|
|
793
|
-
onclick={() => resetPortCustomizations('inputs')}
|
|
794
|
-
title="Reset to default order and visibility"
|
|
795
|
-
>
|
|
796
|
-
<Icon icon="heroicons:arrow-uturn-left" />
|
|
797
|
-
Reset
|
|
798
|
-
</button>
|
|
799
|
-
{/if}
|
|
800
|
-
</div>
|
|
801
|
-
<ul class="config-form__port-order-list">
|
|
802
|
-
{#each allInputPortsForUI as port, i (port.id)}
|
|
803
|
-
{@const isHidden =
|
|
804
|
-
uiExtensionValues.hiddenPorts?.inputs?.includes(port.id) ?? false}
|
|
805
|
-
{@const isRequired = port.required ?? false}
|
|
806
|
-
<li
|
|
807
|
-
class="config-form__port-order-item"
|
|
808
|
-
class:config-form__port-order-item--hidden={isHidden}
|
|
809
|
-
>
|
|
810
|
-
<span class="config-form__port-order-name">{port.name}</span>
|
|
811
|
-
<span
|
|
812
|
-
class="config-form__port-order-badge"
|
|
813
|
-
style="background-color:{getPortBackgroundColor(
|
|
814
|
-
checker,
|
|
815
|
-
port.dataType,
|
|
816
|
-
15
|
|
817
|
-
)};color:{getDataTypeColorToken(
|
|
818
|
-
checker,
|
|
819
|
-
port.dataType
|
|
820
|
-
)};border:1px solid {getPortBackgroundColor(checker, port.dataType, 30)}"
|
|
821
|
-
>
|
|
822
|
-
{port.dataType}
|
|
823
|
-
</span>
|
|
824
|
-
<div class="config-form__port-order-actions">
|
|
825
|
-
<button
|
|
826
|
-
type="button"
|
|
827
|
-
disabled={isRequired}
|
|
828
|
-
title={isRequired
|
|
829
|
-
? 'Required ports cannot be hidden'
|
|
830
|
-
: isHidden
|
|
831
|
-
? 'Show port'
|
|
832
|
-
: 'Hide port'}
|
|
833
|
-
class:active={isHidden}
|
|
834
|
-
onclick={() => togglePortHidden('inputs', port.id)}
|
|
835
|
-
>
|
|
836
|
-
<Icon icon={isHidden ? 'heroicons:eye-slash' : 'heroicons:eye'} />
|
|
837
|
-
</button>
|
|
838
|
-
<button
|
|
839
|
-
type="button"
|
|
840
|
-
disabled={i === 0 || allInputPortsForUI.length === 1}
|
|
841
|
-
onclick={() => movePort('inputs', port.id, -1)}
|
|
842
|
-
title="Move up"
|
|
843
|
-
>
|
|
844
|
-
<Icon icon="heroicons:chevron-up" />
|
|
845
|
-
</button>
|
|
846
|
-
<button
|
|
847
|
-
type="button"
|
|
848
|
-
disabled={i === allInputPortsForUI.length - 1 ||
|
|
849
|
-
allInputPortsForUI.length === 1}
|
|
850
|
-
onclick={() => movePort('inputs', port.id, 1)}
|
|
851
|
-
title="Move down"
|
|
852
|
-
>
|
|
853
|
-
<Icon icon="heroicons:chevron-down" />
|
|
854
|
-
</button>
|
|
855
|
-
</div>
|
|
856
|
-
</li>
|
|
857
|
-
{/each}
|
|
858
|
-
</ul>
|
|
859
|
-
</div>
|
|
860
|
-
{/if}
|
|
861
|
-
|
|
862
|
-
<!-- Output Port Order & Visibility -->
|
|
863
|
-
{#if allOutputPortsForUI.length > 0}
|
|
864
|
-
<div class="config-form__port-order">
|
|
865
|
-
<div class="config-form__port-order-header">
|
|
866
|
-
<span class="config-form__port-order-label">Output Ports</span>
|
|
867
|
-
{#if uiExtensionValues.portOrder?.outputs?.length || uiExtensionValues.hiddenPorts?.outputs?.length}
|
|
868
|
-
<button
|
|
869
|
-
type="button"
|
|
870
|
-
class="config-form__port-order-reset"
|
|
871
|
-
onclick={() => resetPortCustomizations('outputs')}
|
|
872
|
-
title="Reset to default order and visibility"
|
|
873
|
-
>
|
|
874
|
-
<Icon icon="heroicons:arrow-uturn-left" />
|
|
875
|
-
Reset
|
|
876
|
-
</button>
|
|
877
|
-
{/if}
|
|
878
|
-
</div>
|
|
879
|
-
<ul class="config-form__port-order-list">
|
|
880
|
-
{#each allOutputPortsForUI as port, i (port.id)}
|
|
881
|
-
{@const isHidden =
|
|
882
|
-
uiExtensionValues.hiddenPorts?.outputs?.includes(port.id) ?? false}
|
|
883
|
-
{@const isRequired = port.required ?? false}
|
|
884
|
-
<li
|
|
885
|
-
class="config-form__port-order-item"
|
|
886
|
-
class:config-form__port-order-item--hidden={isHidden}
|
|
887
|
-
>
|
|
888
|
-
<span class="config-form__port-order-name">{port.name}</span>
|
|
889
|
-
<span
|
|
890
|
-
class="config-form__port-order-badge"
|
|
891
|
-
style="background-color:{getPortBackgroundColor(
|
|
892
|
-
checker,
|
|
893
|
-
port.dataType,
|
|
894
|
-
15
|
|
895
|
-
)};color:{getDataTypeColorToken(
|
|
896
|
-
checker,
|
|
897
|
-
port.dataType
|
|
898
|
-
)};border:1px solid {getPortBackgroundColor(checker, port.dataType, 30)}"
|
|
899
|
-
>
|
|
900
|
-
{port.dataType}
|
|
901
|
-
</span>
|
|
902
|
-
<div class="config-form__port-order-actions">
|
|
903
|
-
<button
|
|
904
|
-
type="button"
|
|
905
|
-
disabled={isRequired}
|
|
906
|
-
title={isRequired
|
|
907
|
-
? 'Required ports cannot be hidden'
|
|
908
|
-
: isHidden
|
|
909
|
-
? 'Show port'
|
|
910
|
-
: 'Hide port'}
|
|
911
|
-
class:active={isHidden}
|
|
912
|
-
onclick={() => togglePortHidden('outputs', port.id)}
|
|
913
|
-
>
|
|
914
|
-
<Icon icon={isHidden ? 'heroicons:eye-slash' : 'heroicons:eye'} />
|
|
915
|
-
</button>
|
|
916
|
-
<button
|
|
917
|
-
type="button"
|
|
918
|
-
disabled={i === 0 || allOutputPortsForUI.length === 1}
|
|
919
|
-
onclick={() => movePort('outputs', port.id, -1)}
|
|
920
|
-
title="Move up"
|
|
921
|
-
>
|
|
922
|
-
<Icon icon="heroicons:chevron-up" />
|
|
923
|
-
</button>
|
|
924
|
-
<button
|
|
925
|
-
type="button"
|
|
926
|
-
disabled={i === allOutputPortsForUI.length - 1 ||
|
|
927
|
-
allOutputPortsForUI.length === 1}
|
|
928
|
-
onclick={() => movePort('outputs', port.id, 1)}
|
|
929
|
-
title="Move down"
|
|
930
|
-
>
|
|
931
|
-
<Icon icon="heroicons:chevron-down" />
|
|
932
|
-
</button>
|
|
933
|
-
</div>
|
|
934
|
-
</li>
|
|
935
|
-
{/each}
|
|
936
|
-
</ul>
|
|
937
|
-
</div>
|
|
938
|
-
{/if}
|
|
939
|
-
</div>
|
|
940
|
-
</div>
|
|
941
|
-
{/if}
|
|
942
|
-
|
|
943
615
|
<!-- Footer Actions - Only shown when onSave is provided and onChange is not -->
|
|
944
616
|
<!-- With onChange (on-blur sync), changes are saved automatically, so no Save button needed -->
|
|
945
617
|
{#if onSave && !onChange}
|
|
@@ -1093,177 +765,6 @@
|
|
|
1093
765
|
transform: translateY(0);
|
|
1094
766
|
}
|
|
1095
767
|
|
|
1096
|
-
/* ============================================
|
|
1097
|
-
UI EXTENSIONS SECTION
|
|
1098
|
-
============================================ */
|
|
1099
|
-
|
|
1100
|
-
.config-form__extensions {
|
|
1101
|
-
background-color: var(--fd-muted);
|
|
1102
|
-
border: 1px solid var(--fd-border);
|
|
1103
|
-
border-radius: var(--fd-control-radius);
|
|
1104
|
-
overflow: hidden;
|
|
1105
|
-
margin-top: var(--fd-space-xs);
|
|
1106
|
-
}
|
|
1107
|
-
|
|
1108
|
-
.config-form__extensions-header {
|
|
1109
|
-
display: flex;
|
|
1110
|
-
align-items: center;
|
|
1111
|
-
gap: var(--fd-space-xs);
|
|
1112
|
-
padding: var(--fd-space-md) var(--fd-space-xl);
|
|
1113
|
-
background-color: var(--fd-subtle);
|
|
1114
|
-
border-bottom: 1px solid var(--fd-border);
|
|
1115
|
-
font-size: 0.8125rem;
|
|
1116
|
-
font-weight: 600;
|
|
1117
|
-
color: var(--fd-foreground);
|
|
1118
|
-
}
|
|
1119
|
-
|
|
1120
|
-
.config-form__extensions-header :global(svg) {
|
|
1121
|
-
width: 1rem;
|
|
1122
|
-
height: 1rem;
|
|
1123
|
-
color: var(--fd-muted-foreground);
|
|
1124
|
-
}
|
|
1125
|
-
|
|
1126
|
-
.config-form__extensions-content {
|
|
1127
|
-
padding: var(--fd-space-xl);
|
|
1128
|
-
display: flex;
|
|
1129
|
-
flex-direction: column;
|
|
1130
|
-
gap: var(--fd-space-xl);
|
|
1131
|
-
}
|
|
1132
|
-
|
|
1133
|
-
/* ============================================
|
|
1134
|
-
PORT ORDER & VISIBILITY
|
|
1135
|
-
============================================ */
|
|
1136
|
-
|
|
1137
|
-
.config-form__port-order {
|
|
1138
|
-
border-top: 1px solid var(--fd-border-muted);
|
|
1139
|
-
padding-top: var(--fd-space-md);
|
|
1140
|
-
margin-top: calc(var(--fd-space-xl) * -0.25);
|
|
1141
|
-
}
|
|
1142
|
-
|
|
1143
|
-
.config-form__port-order-header {
|
|
1144
|
-
display: flex;
|
|
1145
|
-
align-items: center;
|
|
1146
|
-
justify-content: space-between;
|
|
1147
|
-
margin-bottom: var(--fd-space-xs);
|
|
1148
|
-
}
|
|
1149
|
-
|
|
1150
|
-
.config-form__port-order-label {
|
|
1151
|
-
font-size: var(--fd-text-xs);
|
|
1152
|
-
font-weight: 600;
|
|
1153
|
-
color: var(--fd-muted-foreground);
|
|
1154
|
-
text-transform: uppercase;
|
|
1155
|
-
letter-spacing: 0.05em;
|
|
1156
|
-
}
|
|
1157
|
-
|
|
1158
|
-
.config-form__port-order-reset {
|
|
1159
|
-
background: none;
|
|
1160
|
-
border: none;
|
|
1161
|
-
font-size: var(--fd-text-xs);
|
|
1162
|
-
color: var(--fd-muted-foreground);
|
|
1163
|
-
cursor: pointer;
|
|
1164
|
-
display: inline-flex;
|
|
1165
|
-
align-items: center;
|
|
1166
|
-
gap: var(--fd-space-3xs);
|
|
1167
|
-
padding: 0;
|
|
1168
|
-
transition: color var(--fd-transition-fast);
|
|
1169
|
-
}
|
|
1170
|
-
|
|
1171
|
-
.config-form__port-order-reset:hover {
|
|
1172
|
-
color: var(--fd-foreground);
|
|
1173
|
-
}
|
|
1174
|
-
|
|
1175
|
-
.config-form__port-order-reset :global(svg) {
|
|
1176
|
-
width: 0.75rem;
|
|
1177
|
-
height: 0.75rem;
|
|
1178
|
-
}
|
|
1179
|
-
|
|
1180
|
-
.config-form__port-order-list {
|
|
1181
|
-
list-style: none;
|
|
1182
|
-
margin: 0;
|
|
1183
|
-
padding: 0;
|
|
1184
|
-
display: flex;
|
|
1185
|
-
flex-direction: column;
|
|
1186
|
-
gap: var(--fd-space-3xs);
|
|
1187
|
-
}
|
|
1188
|
-
|
|
1189
|
-
.config-form__port-order-item {
|
|
1190
|
-
display: flex;
|
|
1191
|
-
align-items: center;
|
|
1192
|
-
gap: var(--fd-space-xs);
|
|
1193
|
-
padding: var(--fd-space-3xs) var(--fd-space-xs);
|
|
1194
|
-
background: var(--fd-muted);
|
|
1195
|
-
border-radius: var(--fd-radius-sm);
|
|
1196
|
-
border: 1px solid var(--fd-border-muted);
|
|
1197
|
-
transition: opacity var(--fd-transition-fast);
|
|
1198
|
-
}
|
|
1199
|
-
|
|
1200
|
-
.config-form__port-order-item--hidden {
|
|
1201
|
-
opacity: 0.4;
|
|
1202
|
-
}
|
|
1203
|
-
|
|
1204
|
-
.config-form__port-order-name {
|
|
1205
|
-
flex: 1;
|
|
1206
|
-
font-size: var(--fd-text-xs);
|
|
1207
|
-
font-weight: 500;
|
|
1208
|
-
color: var(--fd-foreground);
|
|
1209
|
-
min-width: 0;
|
|
1210
|
-
overflow: hidden;
|
|
1211
|
-
text-overflow: ellipsis;
|
|
1212
|
-
white-space: nowrap;
|
|
1213
|
-
}
|
|
1214
|
-
|
|
1215
|
-
.config-form__port-order-badge {
|
|
1216
|
-
padding: 0.125rem var(--fd-space-3xs);
|
|
1217
|
-
border-radius: var(--fd-radius-sm);
|
|
1218
|
-
font-size: 0.625rem;
|
|
1219
|
-
font-weight: 500;
|
|
1220
|
-
text-transform: uppercase;
|
|
1221
|
-
letter-spacing: 0.04em;
|
|
1222
|
-
flex-shrink: 0;
|
|
1223
|
-
}
|
|
1224
|
-
|
|
1225
|
-
.config-form__port-order-actions {
|
|
1226
|
-
display: flex;
|
|
1227
|
-
gap: var(--fd-space-3xs);
|
|
1228
|
-
flex-shrink: 0;
|
|
1229
|
-
}
|
|
1230
|
-
|
|
1231
|
-
.config-form__port-order-actions button {
|
|
1232
|
-
width: 1.25rem;
|
|
1233
|
-
height: 1.25rem;
|
|
1234
|
-
display: flex;
|
|
1235
|
-
align-items: center;
|
|
1236
|
-
justify-content: center;
|
|
1237
|
-
background: var(--fd-card);
|
|
1238
|
-
border: 1px solid var(--fd-border);
|
|
1239
|
-
border-radius: var(--fd-radius-sm);
|
|
1240
|
-
color: var(--fd-muted-foreground);
|
|
1241
|
-
cursor: pointer;
|
|
1242
|
-
padding: 0;
|
|
1243
|
-
transition: all var(--fd-transition-fast);
|
|
1244
|
-
}
|
|
1245
|
-
|
|
1246
|
-
.config-form__port-order-actions button:hover:not(:disabled) {
|
|
1247
|
-
background: var(--fd-backdrop);
|
|
1248
|
-
color: var(--fd-foreground);
|
|
1249
|
-
border-color: var(--fd-border-strong);
|
|
1250
|
-
}
|
|
1251
|
-
|
|
1252
|
-
.config-form__port-order-actions button:disabled {
|
|
1253
|
-
opacity: 0.3;
|
|
1254
|
-
cursor: not-allowed;
|
|
1255
|
-
}
|
|
1256
|
-
|
|
1257
|
-
.config-form__port-order-actions button.active {
|
|
1258
|
-
color: var(--fd-foreground);
|
|
1259
|
-
border-color: var(--fd-border-strong);
|
|
1260
|
-
}
|
|
1261
|
-
|
|
1262
|
-
.config-form__port-order-actions button :global(svg) {
|
|
1263
|
-
width: 0.75rem;
|
|
1264
|
-
height: 0.75rem;
|
|
1265
|
-
}
|
|
1266
|
-
|
|
1267
768
|
/* ============================================
|
|
1268
769
|
DEBUG SECTION
|
|
1269
770
|
============================================ */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ConfigSchema, WorkflowNode, WorkflowEdge,
|
|
1
|
+
import type { ConfigSchema, WorkflowNode, WorkflowEdge, AuthProvider } from '../types/index.js';
|
|
2
2
|
import type { UISchemaElement } from '../types/uischema.js';
|
|
3
3
|
interface Props {
|
|
4
4
|
/** Optional workflow node (if provided, schema and values are derived from it) */
|
|
@@ -14,8 +14,6 @@ interface Props {
|
|
|
14
14
|
uiSchema?: UISchemaElement;
|
|
15
15
|
/** Direct config values (used when node is not provided) */
|
|
16
16
|
values?: Record<string, unknown>;
|
|
17
|
-
/** Whether to show UI extension settings section */
|
|
18
|
-
showUIExtensions?: boolean;
|
|
19
17
|
/** Optional workflow ID for context in external links */
|
|
20
18
|
workflowId?: string;
|
|
21
19
|
/** Whether to also save the workflow when saving config */
|
|
@@ -33,9 +31,9 @@ interface Props {
|
|
|
33
31
|
/** Auth provider for API requests (used for template variable API mode) */
|
|
34
32
|
authProvider?: AuthProvider;
|
|
35
33
|
/** Callback when any field value changes (fired on blur for immediate sync) */
|
|
36
|
-
onChange?: (config: Record<string, unknown
|
|
37
|
-
/** Callback when form is saved
|
|
38
|
-
onSave?: (config: Record<string, unknown
|
|
34
|
+
onChange?: (config: Record<string, unknown>) => void;
|
|
35
|
+
/** Callback when form is saved */
|
|
36
|
+
onSave?: (config: Record<string, unknown>) => void;
|
|
39
37
|
/** Callback when form is cancelled */
|
|
40
38
|
onCancel?: () => void;
|
|
41
39
|
}
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
// Create a new node instance from the node type
|
|
122
122
|
const newNodeData = {
|
|
123
123
|
type: 'node',
|
|
124
|
-
nodeType: nodeType.
|
|
124
|
+
nodeType: nodeType.node_type_id,
|
|
125
125
|
nodeData: {
|
|
126
126
|
label: nodeType.name,
|
|
127
127
|
config: extractConfigDefaults(nodeType.configSchema),
|
|
@@ -246,7 +246,7 @@
|
|
|
246
246
|
</div>
|
|
247
247
|
{:else}
|
|
248
248
|
<div class="flowdrop-node-list">
|
|
249
|
-
{#each filteredNodes as nodeType (nodeType.
|
|
249
|
+
{#each filteredNodes as nodeType (nodeType.node_type_id)}
|
|
250
250
|
<div
|
|
251
251
|
class="flowdrop-card flowdrop-card--compact flowdrop-node-item"
|
|
252
252
|
draggable="true"
|
|
@@ -299,7 +299,7 @@
|
|
|
299
299
|
{getCategoryDisplayName(category).toUpperCase()}
|
|
300
300
|
</div>
|
|
301
301
|
<div class="fd-sidebar-flat-list" role="list">
|
|
302
|
-
{#each categoryNodes as nodeType (nodeType.
|
|
302
|
+
{#each categoryNodes as nodeType (nodeType.node_type_id)}
|
|
303
303
|
<div
|
|
304
304
|
class="fd-sidebar-flat-item"
|
|
305
305
|
role="listitem"
|
|
@@ -339,7 +339,7 @@
|
|
|
339
339
|
</summary>
|
|
340
340
|
<div class="flowdrop-details__content">
|
|
341
341
|
<div class="flowdrop-node-list" role="list">
|
|
342
|
-
{#each categoryNodes as nodeType (nodeType.
|
|
342
|
+
{#each categoryNodes as nodeType (nodeType.node_type_id)}
|
|
343
343
|
<div
|
|
344
344
|
class="flowdrop-card flowdrop-card--compact flowdrop-node-item"
|
|
345
345
|
role="listitem"
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
{fd.categories.getLabel(category).toUpperCase()}
|
|
146
146
|
</div>
|
|
147
147
|
<div class="swap-picker__flat-list">
|
|
148
|
-
{#each categoryNodes as nodeType (nodeType.
|
|
148
|
+
{#each categoryNodes as nodeType (nodeType.node_type_id)}
|
|
149
149
|
<button class="swap-picker__flat-item" onclick={() => onSelect(nodeType)}>
|
|
150
150
|
<span
|
|
151
151
|
class="swap-picker__flat-dot"
|
|
@@ -174,7 +174,7 @@
|
|
|
174
174
|
</span>
|
|
175
175
|
</div>
|
|
176
176
|
<div class="swap-picker__category-items">
|
|
177
|
-
{#each categoryNodes as nodeType (nodeType.
|
|
177
|
+
{#each categoryNodes as nodeType (nodeType.node_type_id)}
|
|
178
178
|
<button class="swap-picker__item" onclick={() => onSelect(nodeType)}>
|
|
179
179
|
<span
|
|
180
180
|
class="swap-picker__item-icon"
|