@flowdrop/flowdrop 2.0.0-beta.5 → 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 +24 -2
- package/dist/components/App.svelte +1 -10
- 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/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 +13 -39
- package/dist/components/nodes/GatewayNode.svelte +20 -56
- package/dist/components/nodes/SimpleNode.svelte +23 -49
- package/dist/components/nodes/SquareNode.svelte +23 -49
- package/dist/components/nodes/TerminalNode.svelte +25 -31
- package/dist/components/nodes/WorkflowNode.svelte +37 -84
- package/dist/core/index.d.ts +1 -1
- package/dist/openapi/v1/openapi.yaml +33 -21
- package/dist/schemas/v1/workflow.schema.json +16 -14
- package/dist/stores/workflowStore.svelte.d.ts +1 -1
- package/dist/stores/workflowStore.svelte.js +1 -1
- package/dist/types/index.d.ts +45 -20
- package/dist/utils/colors.d.ts +27 -0
- package/dist/utils/colors.js +23 -0
- package/dist/utils/portUtils.d.ts +47 -11
- package/dist/utils/portUtils.js +67 -14
- package/package.json +1 -1
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
A simple node with optional input and output ports
|
|
4
4
|
Styled with BEM syntax
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
-
|
|
6
|
+
Port rendering:
|
|
7
|
+
- Exposure (data.config.ports, falling back to each port's exposedByDefault)
|
|
8
|
+
decides which ports render — a not-exposed port is hidden.
|
|
9
|
+
- Order: data.config.ports order overrides the metadata default (displayOrder);
|
|
10
|
+
unlisted ports follow in default order.
|
|
10
11
|
-->
|
|
11
12
|
|
|
12
13
|
<script lang="ts">
|
|
@@ -16,13 +17,14 @@
|
|
|
16
17
|
NodeMetadata,
|
|
17
18
|
NodeExtensions,
|
|
18
19
|
NodePort,
|
|
19
|
-
DynamicPort
|
|
20
|
+
DynamicPort,
|
|
21
|
+
PortsConfig
|
|
20
22
|
} from '../../types/index.js';
|
|
21
23
|
import { dynamicPortToNodePort } from '../../types/index.js';
|
|
22
24
|
import Icon from '@iconify/svelte';
|
|
23
|
-
import {
|
|
25
|
+
import { getPortColorToken, getCategoryColorToken } from '../../utils/colors.js';
|
|
24
26
|
import { getInstance } from '../../stores/getInstance.svelte.js';
|
|
25
|
-
import {
|
|
27
|
+
import { orderPortsFor, getPortTop, isPortVisible } from '../../utils/portUtils.js';
|
|
26
28
|
import NodeConfigButton from './NodeConfigButton.svelte';
|
|
27
29
|
import AlertCircleIcon from '../icons/AlertCircleIcon.svelte';
|
|
28
30
|
|
|
@@ -50,21 +52,11 @@
|
|
|
50
52
|
const checker = fd.portCompatibility;
|
|
51
53
|
|
|
52
54
|
/**
|
|
53
|
-
*
|
|
55
|
+
* Per-instance port order + exposure, in config. Order overrides the metadata
|
|
56
|
+
* default; exposure is semantic (a not-exposed port is hidden, not wireable,
|
|
57
|
+
* not runtime-overridable).
|
|
54
58
|
*/
|
|
55
|
-
const
|
|
56
|
-
props.data.extensions?.ui?.hideUnconnectedHandles ??
|
|
57
|
-
props.data.metadata?.extensions?.ui?.hideUnconnectedHandles ??
|
|
58
|
-
false
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
const hiddenPorts = $derived(
|
|
62
|
-
props.data.extensions?.ui?.hiddenPorts ?? props.data.metadata?.extensions?.ui?.hiddenPorts ?? {}
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
const portOrder = $derived(
|
|
66
|
-
props.data.extensions?.ui?.portOrder ?? props.data.metadata?.extensions?.ui?.portOrder ?? {}
|
|
67
|
-
);
|
|
59
|
+
const portsConfig = $derived((props.data.config?.ports as PortsConfig | undefined) ?? {});
|
|
68
60
|
|
|
69
61
|
// Prioritize metadata icon over config icon for simple nodes (metadata is the node definition)
|
|
70
62
|
let nodeIcon = $derived(
|
|
@@ -124,38 +116,20 @@
|
|
|
124
116
|
* All visible input ports in user-defined order.
|
|
125
117
|
*/
|
|
126
118
|
const visibleInputPorts = $derived(
|
|
127
|
-
|
|
119
|
+
orderPortsFor(
|
|
128
120
|
[...(props.data.metadata?.inputs ?? []), ...dynamicInputs],
|
|
129
|
-
|
|
130
|
-
).filter((p: NodePort) =>
|
|
131
|
-
isPortVisible(
|
|
132
|
-
p,
|
|
133
|
-
'input',
|
|
134
|
-
hiddenPorts,
|
|
135
|
-
hideUnconnectedHandles,
|
|
136
|
-
fd.workflow.connectedHandles,
|
|
137
|
-
props.id
|
|
138
|
-
)
|
|
139
|
-
)
|
|
121
|
+
portsConfig.inputs
|
|
122
|
+
).filter((p: NodePort) => isPortVisible(p, 'input', portsConfig))
|
|
140
123
|
);
|
|
141
124
|
|
|
142
125
|
/**
|
|
143
126
|
* All visible output ports in user-defined order.
|
|
144
127
|
*/
|
|
145
128
|
const visibleOutputPorts = $derived(
|
|
146
|
-
|
|
129
|
+
orderPortsFor(
|
|
147
130
|
[...(props.data.metadata?.outputs ?? []), ...dynamicOutputs],
|
|
148
|
-
|
|
149
|
-
).filter((p: NodePort) =>
|
|
150
|
-
isPortVisible(
|
|
151
|
-
p,
|
|
152
|
-
'output',
|
|
153
|
-
hiddenPorts,
|
|
154
|
-
hideUnconnectedHandles,
|
|
155
|
-
fd.workflow.connectedHandles,
|
|
156
|
-
props.id
|
|
157
|
-
)
|
|
158
|
-
)
|
|
131
|
+
portsConfig.outputs
|
|
132
|
+
).filter((p: NodePort) => isPortVisible(p, 'output', portsConfig))
|
|
159
133
|
);
|
|
160
134
|
|
|
161
135
|
/**
|
|
@@ -174,9 +148,9 @@
|
|
|
174
148
|
<Handle
|
|
175
149
|
type="target"
|
|
176
150
|
position={Position.Left}
|
|
177
|
-
style="--fd-handle-fill: var(--fd-port-skin-color, {
|
|
151
|
+
style="--fd-handle-fill: var(--fd-port-skin-color, {getPortColorToken(
|
|
178
152
|
checker,
|
|
179
|
-
port
|
|
153
|
+
port
|
|
180
154
|
)}); --fd-handle-border-color: var(--fd-handle-border); top: {getPortTop(
|
|
181
155
|
index,
|
|
182
156
|
visibleInputPorts.length
|
|
@@ -246,9 +220,9 @@
|
|
|
246
220
|
<Handle
|
|
247
221
|
type="source"
|
|
248
222
|
position={Position.Right}
|
|
249
|
-
style="--fd-handle-fill: var(--fd-port-skin-color, {
|
|
223
|
+
style="--fd-handle-fill: var(--fd-port-skin-color, {getPortColorToken(
|
|
250
224
|
checker,
|
|
251
|
-
port
|
|
225
|
+
port
|
|
252
226
|
)}); --fd-handle-border-color: var(--fd-handle-border); top: {getPortTop(
|
|
253
227
|
index,
|
|
254
228
|
visibleOutputPorts.length
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
A simple square node with optional input and output ports
|
|
4
4
|
Styled with BEM syntax
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
-
|
|
6
|
+
Port rendering:
|
|
7
|
+
- Exposure (data.config.ports, falling back to each port's exposedByDefault)
|
|
8
|
+
decides which ports render — a not-exposed port is hidden.
|
|
9
|
+
- Order: data.config.ports order overrides the metadata default (displayOrder);
|
|
10
|
+
unlisted ports follow in default order.
|
|
10
11
|
-->
|
|
11
12
|
|
|
12
13
|
<script lang="ts">
|
|
@@ -16,14 +17,15 @@
|
|
|
16
17
|
NodeMetadata,
|
|
17
18
|
NodeExtensions,
|
|
18
19
|
NodePort,
|
|
19
|
-
DynamicPort
|
|
20
|
+
DynamicPort,
|
|
21
|
+
PortsConfig
|
|
20
22
|
} from '../../types/index.js';
|
|
21
23
|
import { dynamicPortToNodePort } from '../../types/index.js';
|
|
22
24
|
import Icon from '@iconify/svelte';
|
|
23
|
-
import {
|
|
25
|
+
import { getPortColorToken, getCategoryColorToken } from '../../utils/colors.js';
|
|
24
26
|
import { getNodeIcon } from '../../utils/icons.js';
|
|
25
27
|
import { getInstance } from '../../stores/getInstance.svelte.js';
|
|
26
|
-
import {
|
|
28
|
+
import { orderPortsFor, getPortTop, isPortVisible } from '../../utils/portUtils.js';
|
|
27
29
|
import NodeConfigButton from './NodeConfigButton.svelte';
|
|
28
30
|
import AlertCircleIcon from '../icons/AlertCircleIcon.svelte';
|
|
29
31
|
|
|
@@ -51,21 +53,11 @@
|
|
|
51
53
|
const checker = fd.portCompatibility;
|
|
52
54
|
|
|
53
55
|
/**
|
|
54
|
-
*
|
|
56
|
+
* Per-instance port order + exposure, in config. Order overrides the metadata
|
|
57
|
+
* default; exposure is semantic (a not-exposed port is hidden, not wireable,
|
|
58
|
+
* not runtime-overridable).
|
|
55
59
|
*/
|
|
56
|
-
const
|
|
57
|
-
props.data.extensions?.ui?.hideUnconnectedHandles ??
|
|
58
|
-
props.data.metadata?.extensions?.ui?.hideUnconnectedHandles ??
|
|
59
|
-
false
|
|
60
|
-
);
|
|
61
|
-
|
|
62
|
-
const hiddenPorts = $derived(
|
|
63
|
-
props.data.extensions?.ui?.hiddenPorts ?? props.data.metadata?.extensions?.ui?.hiddenPorts ?? {}
|
|
64
|
-
);
|
|
65
|
-
|
|
66
|
-
const portOrder = $derived(
|
|
67
|
-
props.data.extensions?.ui?.portOrder ?? props.data.metadata?.extensions?.ui?.portOrder ?? {}
|
|
68
|
-
);
|
|
60
|
+
const portsConfig = $derived((props.data.config?.ports as PortsConfig | undefined) ?? {});
|
|
69
61
|
|
|
70
62
|
/**
|
|
71
63
|
* Get icon using the same resolution as WorkflowNode
|
|
@@ -120,38 +112,20 @@
|
|
|
120
112
|
* All visible input ports in user-defined order.
|
|
121
113
|
*/
|
|
122
114
|
const visibleInputPorts = $derived(
|
|
123
|
-
|
|
115
|
+
orderPortsFor(
|
|
124
116
|
[...(props.data.metadata?.inputs ?? []), ...dynamicInputs],
|
|
125
|
-
|
|
126
|
-
).filter((p: NodePort) =>
|
|
127
|
-
isPortVisible(
|
|
128
|
-
p,
|
|
129
|
-
'input',
|
|
130
|
-
hiddenPorts,
|
|
131
|
-
hideUnconnectedHandles,
|
|
132
|
-
fd.workflow.connectedHandles,
|
|
133
|
-
props.id
|
|
134
|
-
)
|
|
135
|
-
)
|
|
117
|
+
portsConfig.inputs
|
|
118
|
+
).filter((p: NodePort) => isPortVisible(p, 'input', portsConfig))
|
|
136
119
|
);
|
|
137
120
|
|
|
138
121
|
/**
|
|
139
122
|
* All visible output ports in user-defined order.
|
|
140
123
|
*/
|
|
141
124
|
const visibleOutputPorts = $derived(
|
|
142
|
-
|
|
125
|
+
orderPortsFor(
|
|
143
126
|
[...(props.data.metadata?.outputs ?? []), ...dynamicOutputs],
|
|
144
|
-
|
|
145
|
-
).filter((p: NodePort) =>
|
|
146
|
-
isPortVisible(
|
|
147
|
-
p,
|
|
148
|
-
'output',
|
|
149
|
-
hiddenPorts,
|
|
150
|
-
hideUnconnectedHandles,
|
|
151
|
-
fd.workflow.connectedHandles,
|
|
152
|
-
props.id
|
|
153
|
-
)
|
|
154
|
-
)
|
|
127
|
+
portsConfig.outputs
|
|
128
|
+
).filter((p: NodePort) => isPortVisible(p, 'output', portsConfig))
|
|
155
129
|
);
|
|
156
130
|
|
|
157
131
|
/**
|
|
@@ -171,9 +145,9 @@
|
|
|
171
145
|
<Handle
|
|
172
146
|
type="target"
|
|
173
147
|
position={Position.Left}
|
|
174
|
-
style="--fd-handle-fill: var(--fd-port-skin-color, {
|
|
148
|
+
style="--fd-handle-fill: var(--fd-port-skin-color, {getPortColorToken(
|
|
175
149
|
checker,
|
|
176
|
-
port
|
|
150
|
+
port
|
|
177
151
|
)}); --fd-handle-border-color: var(--fd-handle-border); top: {getPortTop(
|
|
178
152
|
index,
|
|
179
153
|
visibleInputPorts.length
|
|
@@ -237,9 +211,9 @@
|
|
|
237
211
|
<Handle
|
|
238
212
|
type="source"
|
|
239
213
|
position={Position.Right}
|
|
240
|
-
style="--fd-handle-fill: var(--fd-port-skin-color, {
|
|
214
|
+
style="--fd-handle-fill: var(--fd-port-skin-color, {getPortColorToken(
|
|
241
215
|
checker,
|
|
242
|
-
port
|
|
216
|
+
port
|
|
243
217
|
)}); --fd-handle-border-color: var(--fd-handle-border); top: {getPortTop(
|
|
244
218
|
index,
|
|
245
219
|
visibleOutputPorts.length
|
|
@@ -10,12 +10,19 @@
|
|
|
10
10
|
|
|
11
11
|
<script lang="ts">
|
|
12
12
|
import { Position, Handle } from '@xyflow/svelte';
|
|
13
|
-
import type {
|
|
13
|
+
import type {
|
|
14
|
+
ConfigValues,
|
|
15
|
+
NodeMetadata,
|
|
16
|
+
NodeExtensions,
|
|
17
|
+
NodePort,
|
|
18
|
+
PortsConfig
|
|
19
|
+
} from '../../types/index.js';
|
|
14
20
|
import Icon from '@iconify/svelte';
|
|
15
21
|
import NodeConfigButton from './NodeConfigButton.svelte';
|
|
16
|
-
import {
|
|
22
|
+
import { getPortColorToken, getCategoryColorToken } from '../../utils/colors.js';
|
|
17
23
|
import { getNodeIcon } from '../../utils/icons.js';
|
|
18
24
|
import { getCircleHandlePosition } from '../../utils/handlePositioning.js';
|
|
25
|
+
import { orderPortsFor, isPortVisible } from '../../utils/portUtils.js';
|
|
19
26
|
import { getInstance } from '../../stores/getInstance.svelte.js';
|
|
20
27
|
|
|
21
28
|
/**
|
|
@@ -142,28 +149,11 @@
|
|
|
142
149
|
let variantConfig = $derived(VARIANT_CONFIGS[variant]);
|
|
143
150
|
|
|
144
151
|
/**
|
|
145
|
-
*
|
|
146
|
-
*
|
|
152
|
+
* Per-instance port order + exposure, in config. Order overrides the metadata
|
|
153
|
+
* default; exposure is semantic (a not-exposed port is hidden, not wireable,
|
|
154
|
+
* not runtime-overridable).
|
|
147
155
|
*/
|
|
148
|
-
const
|
|
149
|
-
props.data.extensions?.ui?.hideUnconnectedHandles ??
|
|
150
|
-
props.data.metadata?.extensions?.ui?.hideUnconnectedHandles ??
|
|
151
|
-
false
|
|
152
|
-
);
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Check if a port should be visible based on connection state and settings
|
|
156
|
-
*/
|
|
157
|
-
function isPortVisible(port: NodePort, type: 'input' | 'output'): boolean {
|
|
158
|
-
if (!hideUnconnectedHandles) {
|
|
159
|
-
return true;
|
|
160
|
-
}
|
|
161
|
-
if (port.required) {
|
|
162
|
-
return true;
|
|
163
|
-
}
|
|
164
|
-
const handleId = `${props.id}-${type}-${port.id}`;
|
|
165
|
-
return fd.workflow.connectedHandles.has(handleId);
|
|
166
|
-
}
|
|
156
|
+
const portsConfig = $derived((props.data.config?.ports as PortsConfig | undefined) ?? {});
|
|
167
157
|
|
|
168
158
|
/**
|
|
169
159
|
* Get icon using the same resolution as WorkflowNode
|
|
@@ -271,17 +261,21 @@
|
|
|
271
261
|
);
|
|
272
262
|
|
|
273
263
|
/**
|
|
274
|
-
*
|
|
264
|
+
* Exposed input ports, in effective order.
|
|
275
265
|
*/
|
|
276
266
|
let visibleInputPorts = $derived(
|
|
277
|
-
inputPorts.filter((port: NodePort) =>
|
|
267
|
+
orderPortsFor(inputPorts, portsConfig.inputs).filter((port: NodePort) =>
|
|
268
|
+
isPortVisible(port, 'input', portsConfig)
|
|
269
|
+
)
|
|
278
270
|
);
|
|
279
271
|
|
|
280
272
|
/**
|
|
281
|
-
*
|
|
273
|
+
* Exposed output ports, in effective order.
|
|
282
274
|
*/
|
|
283
275
|
let visibleOutputPorts = $derived(
|
|
284
|
-
outputPorts.filter((port: NodePort) =>
|
|
276
|
+
orderPortsFor(outputPorts, portsConfig.outputs).filter((port: NodePort) =>
|
|
277
|
+
isPortVisible(port, 'output', portsConfig)
|
|
278
|
+
)
|
|
285
279
|
);
|
|
286
280
|
|
|
287
281
|
/**
|
|
@@ -344,9 +338,9 @@
|
|
|
344
338
|
<Handle
|
|
345
339
|
type="target"
|
|
346
340
|
position={Position.Left}
|
|
347
|
-
style="--fd-handle-fill: {
|
|
341
|
+
style="--fd-handle-fill: {getPortColorToken(
|
|
348
342
|
checker,
|
|
349
|
-
port
|
|
343
|
+
port
|
|
350
344
|
)}; --fd-handle-border-color: var(--fd-handle-border); left: {pos.left}px; top: {pos.top}px; transform: translate(-50%, -50%); z-index: 30;"
|
|
351
345
|
id={`${props.id}-input-${port.id}`}
|
|
352
346
|
/>
|
|
@@ -368,9 +362,9 @@
|
|
|
368
362
|
type="source"
|
|
369
363
|
position={Position.Right}
|
|
370
364
|
id={`${props.id}-output-${port.id}`}
|
|
371
|
-
style="--fd-handle-fill: {
|
|
365
|
+
style="--fd-handle-fill: {getPortColorToken(
|
|
372
366
|
checker,
|
|
373
|
-
port
|
|
367
|
+
port
|
|
374
368
|
)}; --fd-handle-border-color: var(--fd-handle-border); left: {pos.left}px; top: {pos.top}px; transform: translate(-50%, -50%); z-index: 30;"
|
|
375
369
|
/>
|
|
376
370
|
{/each}
|
|
@@ -4,26 +4,27 @@
|
|
|
4
4
|
Uses SvelteFlow's Handle for connection ports
|
|
5
5
|
Styled with BEM syntax
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
-
|
|
9
|
-
|
|
10
|
-
-
|
|
7
|
+
Port rendering:
|
|
8
|
+
- Exposure (data.config.ports, falling back to each port's exposedByDefault)
|
|
9
|
+
decides which ports render — a not-exposed port is hidden.
|
|
10
|
+
- Order: data.config.ports order overrides the metadata default (displayOrder);
|
|
11
|
+
cosmetic only, no effect on execution.
|
|
11
12
|
-->
|
|
12
13
|
|
|
13
14
|
<script lang="ts">
|
|
14
15
|
import { Position, Handle } from '@xyflow/svelte';
|
|
15
|
-
import type { WorkflowNode,
|
|
16
|
+
import type { WorkflowNode, DynamicPort, PortsConfig } from '../../types/index.js';
|
|
16
17
|
import { dynamicPortToNodePort } from '../../types/index.js';
|
|
17
18
|
import Icon from '@iconify/svelte';
|
|
18
19
|
import { getNodeIcon } from '../../utils/icons.js';
|
|
19
20
|
import NodeConfigButton from './NodeConfigButton.svelte';
|
|
20
21
|
import {
|
|
21
|
-
getDataTypeColorToken,
|
|
22
22
|
getCategoryColorToken,
|
|
23
|
-
|
|
23
|
+
getPortColorToken,
|
|
24
|
+
getPortBackgroundColorForPort
|
|
24
25
|
} from '../../utils/colors.js';
|
|
25
26
|
import { getInstance } from '../../stores/getInstance.svelte.js';
|
|
26
|
-
import {
|
|
27
|
+
import { orderPortsFor, isPortVisible } from '../../utils/portUtils.js';
|
|
27
28
|
import { m } from '../../messages/index.js';
|
|
28
29
|
|
|
29
30
|
interface Props {
|
|
@@ -61,30 +62,11 @@
|
|
|
61
62
|
);
|
|
62
63
|
|
|
63
64
|
/**
|
|
64
|
-
*
|
|
65
|
-
*
|
|
65
|
+
* Per-instance port order + exposure, in config. Order overrides the metadata
|
|
66
|
+
* default; exposure is semantic (a not-exposed port is hidden, not wireable,
|
|
67
|
+
* not runtime-overridable).
|
|
66
68
|
*/
|
|
67
|
-
const
|
|
68
|
-
props.data.extensions?.ui?.hideUnconnectedHandles ??
|
|
69
|
-
props.data.metadata?.extensions?.ui?.hideUnconnectedHandles ??
|
|
70
|
-
false
|
|
71
|
-
);
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Get the portOrder setting from extensions (visual-only, no effect on execution)
|
|
75
|
-
* Merges node type defaults with instance overrides
|
|
76
|
-
*/
|
|
77
|
-
const portOrder = $derived(
|
|
78
|
-
props.data.extensions?.ui?.portOrder ?? props.data.metadata?.extensions?.ui?.portOrder ?? {}
|
|
79
|
-
);
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Get the hiddenPorts setting from extensions (visual-only, no effect on execution)
|
|
83
|
-
* Merges node type defaults with instance overrides
|
|
84
|
-
*/
|
|
85
|
-
const hiddenPorts = $derived(
|
|
86
|
-
props.data.extensions?.ui?.hiddenPorts ?? props.data.metadata?.extensions?.ui?.hiddenPorts ?? {}
|
|
87
|
-
);
|
|
69
|
+
const portsConfig = $derived((props.data.config?.ports as PortsConfig | undefined) ?? {});
|
|
88
70
|
|
|
89
71
|
/**
|
|
90
72
|
* Dynamic inputs from config - user-defined input ports
|
|
@@ -108,61 +90,32 @@
|
|
|
108
90
|
|
|
109
91
|
/**
|
|
110
92
|
* Combined input ports: static metadata inputs + dynamic config inputs,
|
|
111
|
-
*
|
|
93
|
+
* in effective order (metadata default, then config override; cosmetic).
|
|
112
94
|
*/
|
|
113
95
|
const allInputPorts = $derived(
|
|
114
|
-
|
|
96
|
+
orderPortsFor([...props.data.metadata.inputs, ...dynamicInputs], portsConfig.inputs)
|
|
115
97
|
);
|
|
116
98
|
|
|
117
99
|
/**
|
|
118
100
|
* Combined output ports: static metadata outputs + dynamic config outputs,
|
|
119
|
-
*
|
|
101
|
+
* in effective order (metadata default, then config override; cosmetic).
|
|
120
102
|
*/
|
|
121
103
|
const allOutputPorts = $derived(
|
|
122
|
-
|
|
104
|
+
orderPortsFor([...props.data.metadata.outputs, ...dynamicOutputs], portsConfig.outputs)
|
|
123
105
|
);
|
|
124
106
|
|
|
125
107
|
/**
|
|
126
|
-
*
|
|
127
|
-
* @param port - The port to check
|
|
128
|
-
* @param type - Whether this is an 'input' or 'output' port
|
|
129
|
-
* @returns true if the port should be visible
|
|
108
|
+
* Derived list of exposed input ports (static + dynamic).
|
|
130
109
|
*/
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
type === 'input'
|
|
135
|
-
? hiddenPorts.inputs?.includes(port.id)
|
|
136
|
-
: hiddenPorts.outputs?.includes(port.id);
|
|
137
|
-
if (manuallyHidden) return false;
|
|
138
|
-
|
|
139
|
-
// Always show if hideUnconnectedHandles is disabled
|
|
140
|
-
if (!hideUnconnectedHandles) {
|
|
141
|
-
return true;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
// Always show required ports
|
|
145
|
-
if (port.required) {
|
|
146
|
-
return true;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
// Check if port is connected
|
|
150
|
-
const handleId = `${props.id}-${type}-${port.id}`;
|
|
151
|
-
return fd.workflow.connectedHandles.has(handleId);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Derived list of visible input ports based on hideUnconnectedHandles setting
|
|
156
|
-
* Now includes both static and dynamic inputs
|
|
157
|
-
*/
|
|
158
|
-
const visibleInputPorts = $derived(allInputPorts.filter((port) => isPortVisible(port, 'input')));
|
|
110
|
+
const visibleInputPorts = $derived(
|
|
111
|
+
allInputPorts.filter((port) => isPortVisible(port, 'input', portsConfig))
|
|
112
|
+
);
|
|
159
113
|
|
|
160
114
|
/**
|
|
161
|
-
* Derived list of
|
|
162
|
-
* Now includes both static and dynamic outputs
|
|
115
|
+
* Derived list of exposed output ports (static + dynamic).
|
|
163
116
|
*/
|
|
164
117
|
const visibleOutputPorts = $derived(
|
|
165
|
-
allOutputPorts.filter((port) => isPortVisible(port, 'output'))
|
|
118
|
+
allOutputPorts.filter((port) => isPortVisible(port, 'output', portsConfig))
|
|
166
119
|
);
|
|
167
120
|
|
|
168
121
|
/**
|
|
@@ -248,9 +201,9 @@
|
|
|
248
201
|
position={Position.Left}
|
|
249
202
|
id={`${props.id}-input-${port.id}`}
|
|
250
203
|
class="flowdrop-workflow-node__handle"
|
|
251
|
-
style="top: var(--fd-node-port-row-height); transform: translateY(-50%); --fd-handle-fill: var(--fd-port-skin-color, {
|
|
204
|
+
style="top: var(--fd-node-port-row-height); transform: translateY(-50%); --fd-handle-fill: var(--fd-port-skin-color, {getPortColorToken(
|
|
252
205
|
checker,
|
|
253
|
-
port
|
|
206
|
+
port
|
|
254
207
|
)}); --fd-handle-border-color: var(--fd-handle-border);"
|
|
255
208
|
tabindex={-1}
|
|
256
209
|
/>
|
|
@@ -261,14 +214,14 @@
|
|
|
261
214
|
<span class="flowdrop-text--xs flowdrop-font--medium">{port.name}</span>
|
|
262
215
|
<span
|
|
263
216
|
class="flowdrop-badge flowdrop-badge--sm"
|
|
264
|
-
style="background-color: {
|
|
217
|
+
style="background-color: {getPortBackgroundColorForPort(
|
|
265
218
|
checker,
|
|
266
|
-
port
|
|
219
|
+
port,
|
|
267
220
|
15
|
|
268
|
-
)}; color: {
|
|
221
|
+
)}; color: {getPortColorToken(
|
|
269
222
|
checker,
|
|
270
|
-
port
|
|
271
|
-
)}; border: 1px solid {
|
|
223
|
+
port
|
|
224
|
+
)}; border: 1px solid {getPortBackgroundColorForPort(checker, port, 30)};"
|
|
272
225
|
>
|
|
273
226
|
{port.dataType}
|
|
274
227
|
</span>
|
|
@@ -304,14 +257,14 @@
|
|
|
304
257
|
<span class="flowdrop-text--xs flowdrop-font--medium">{port.name}</span>
|
|
305
258
|
<span
|
|
306
259
|
class="flowdrop-badge flowdrop-badge--sm"
|
|
307
|
-
style="background-color: {
|
|
260
|
+
style="background-color: {getPortBackgroundColorForPort(
|
|
308
261
|
checker,
|
|
309
|
-
port
|
|
262
|
+
port,
|
|
310
263
|
15
|
|
311
|
-
)}; color: {
|
|
264
|
+
)}; color: {getPortColorToken(
|
|
312
265
|
checker,
|
|
313
|
-
port
|
|
314
|
-
)}; border: 1px solid {
|
|
266
|
+
port
|
|
267
|
+
)}; border: 1px solid {getPortBackgroundColorForPort(checker, port, 30)};"
|
|
315
268
|
>
|
|
316
269
|
{port.dataType}
|
|
317
270
|
</span>
|
|
@@ -329,9 +282,9 @@
|
|
|
329
282
|
position={Position.Right}
|
|
330
283
|
id={`${props.id}-output-${port.id}`}
|
|
331
284
|
class="flowdrop-workflow-node__handle"
|
|
332
|
-
style="top: var(--fd-node-port-row-height); transform: translateY(-50%); --fd-handle-fill: var(--fd-port-skin-color, {
|
|
285
|
+
style="top: var(--fd-node-port-row-height); transform: translateY(-50%); --fd-handle-fill: var(--fd-port-skin-color, {getPortColorToken(
|
|
333
286
|
checker,
|
|
334
|
-
port
|
|
287
|
+
port
|
|
335
288
|
)}); --fd-handle-border-color: var(--fd-handle-border);"
|
|
336
289
|
tabindex={-1}
|
|
337
290
|
/>
|
package/dist/core/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
export type { WorkflowFormat, BuiltinWorkflowFormat } from '../types/index.js';
|
|
18
18
|
export { DEFAULT_WORKFLOW_FORMAT } from '../types/index.js';
|
|
19
|
-
export type { NodeCategory, BuiltinNodeCategory, CategoryDefinition, NodeDataType, NodePort, DynamicPort, Branch, NodeMetadata, NodeExtensions, NodeUIExtensions, ConfigValues, WorkflowNode, WorkflowEdge, Workflow, ApiResponse, NodesResponse, WorkflowResponse, WorkflowsResponse, ExecutionStatus, ExecutionResult, FlowDropConfig, WorkflowEvents, BuiltinNodeType, PortConfig, PortCompatibilityRule, ConfigSchema, ConfigProperty, HttpMethod, DynamicSchemaEndpoint, ExternalEditLink, ConfigEditOptions, EdgeCategory, UISchemaElementType, UISchemaElementBase, UISchemaControl, UISchemaVerticalLayout, UISchemaGroup, UISchemaElement } from '../types/index.js';
|
|
19
|
+
export type { NodeCategory, BuiltinNodeCategory, CategoryDefinition, NodeDataType, NodePort, DynamicPort, Branch, NodeMetadata, NodeExtensions, NodeUIExtensions, PortsConfig, PortConfigEntry, ConfigValues, WorkflowNode, WorkflowEdge, Workflow, ApiResponse, NodesResponse, WorkflowResponse, WorkflowsResponse, ExecutionStatus, ExecutionResult, FlowDropConfig, WorkflowEvents, BuiltinNodeType, PortConfig, PortCompatibilityRule, ConfigSchema, ConfigProperty, HttpMethod, DynamicSchemaEndpoint, ExternalEditLink, ConfigEditOptions, EdgeCategory, UISchemaElementType, UISchemaElementBase, UISchemaControl, UISchemaVerticalLayout, UISchemaGroup, UISchemaElement } from '../types/index.js';
|
|
20
20
|
export { isUISchemaControl, isUISchemaVerticalLayout, isUISchemaGroup } from '../types/index.js';
|
|
21
21
|
export type { WorkflowEditorConfig, EditorFeatures, UIConfig, APIConfig, ExecutionConfig, StorageConfig } from '../types/config.js';
|
|
22
22
|
export type { AuthProvider, StaticAuthConfig, CallbackAuthConfig } from '../types/auth.js';
|