@d34dman/flowdrop 0.0.21 → 0.0.23
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/dist/components/App.svelte +69 -260
- package/dist/components/ConfigForm.svelte +357 -267
- package/dist/components/ConfigForm.svelte.d.ts +12 -3
- package/dist/components/ConfigPanel.svelte +160 -0
- package/dist/components/ConfigPanel.svelte.d.ts +32 -0
- package/dist/components/ReadOnlyDetails.svelte +168 -0
- package/dist/components/ReadOnlyDetails.svelte.d.ts +25 -0
- package/dist/components/WorkflowEditor.svelte +1 -1
- package/dist/components/form/FormArray.svelte +1049 -0
- package/dist/components/form/FormArray.svelte.d.ts +22 -0
- package/dist/components/form/FormCheckboxGroup.svelte +152 -0
- package/dist/components/form/FormCheckboxGroup.svelte.d.ts +15 -0
- package/dist/components/form/FormField.svelte +279 -0
- package/dist/components/form/FormField.svelte.d.ts +18 -0
- package/dist/components/form/FormFieldWrapper.svelte +133 -0
- package/dist/components/form/FormFieldWrapper.svelte.d.ts +18 -0
- package/dist/components/form/FormNumberField.svelte +109 -0
- package/dist/components/form/FormNumberField.svelte.d.ts +23 -0
- package/dist/components/form/FormSelect.svelte +126 -0
- package/dist/components/form/FormSelect.svelte.d.ts +18 -0
- package/dist/components/form/FormTextField.svelte +88 -0
- package/dist/components/form/FormTextField.svelte.d.ts +17 -0
- package/dist/components/form/FormTextarea.svelte +94 -0
- package/dist/components/form/FormTextarea.svelte.d.ts +19 -0
- package/dist/components/form/FormToggle.svelte +123 -0
- package/dist/components/form/FormToggle.svelte.d.ts +17 -0
- package/dist/components/form/index.d.ts +41 -0
- package/dist/components/form/index.js +45 -0
- package/dist/components/form/types.d.ts +208 -0
- package/dist/components/form/types.js +29 -0
- package/dist/components/nodes/GatewayNode.svelte +84 -12
- package/dist/components/nodes/NotesNode.svelte +89 -307
- package/dist/components/nodes/NotesNode.svelte.d.ts +3 -22
- package/dist/components/nodes/SimpleNode.svelte +41 -5
- package/dist/components/nodes/SimpleNode.svelte.d.ts +2 -1
- package/dist/components/nodes/SquareNode.svelte +41 -5
- package/dist/components/nodes/SquareNode.svelte.d.ts +2 -1
- package/dist/components/nodes/WorkflowNode.svelte +88 -5
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -4
- package/dist/stores/workflowStore.d.ts +15 -0
- package/dist/stores/workflowStore.js +28 -0
- package/dist/types/index.d.ts +77 -0
- package/dist/types/index.js +16 -0
- package/package.json +3 -3
- package/dist/components/ConfigSidebar.svelte +0 -916
- package/dist/components/ConfigSidebar.svelte.d.ts +0 -51
- package/dist/config/demo.d.ts +0 -58
- package/dist/config/demo.js +0 -142
- package/dist/data/samples.d.ts +0 -51
- package/dist/data/samples.js +0 -3245
|
@@ -2,13 +2,17 @@
|
|
|
2
2
|
Square Node Component
|
|
3
3
|
A simple square node with optional input and output ports
|
|
4
4
|
Styled with BEM syntax
|
|
5
|
+
|
|
6
|
+
UI Extensions Support:
|
|
7
|
+
- hideUnconnectedHandles: Hides trigger ports that are not connected to reduce visual clutter
|
|
5
8
|
-->
|
|
6
9
|
|
|
7
10
|
<script lang="ts">
|
|
8
11
|
import { Position, Handle } from '@xyflow/svelte';
|
|
9
|
-
import type { ConfigValues, NodeMetadata } from '../../types/index.js';
|
|
12
|
+
import type { ConfigValues, NodeMetadata, NodeExtensions } from '../../types/index.js';
|
|
10
13
|
import Icon from '@iconify/svelte';
|
|
11
14
|
import { getDataTypeColor } from '../../utils/colors.js';
|
|
15
|
+
import { connectedHandles } from '../../stores/workflowStore.js';
|
|
12
16
|
|
|
13
17
|
const props = $props<{
|
|
14
18
|
data: {
|
|
@@ -16,6 +20,7 @@
|
|
|
16
20
|
config: ConfigValues;
|
|
17
21
|
metadata: NodeMetadata;
|
|
18
22
|
nodeId?: string;
|
|
23
|
+
extensions?: NodeExtensions;
|
|
19
24
|
onConfigOpen?: (node: {
|
|
20
25
|
id: string;
|
|
21
26
|
type: string;
|
|
@@ -27,6 +32,37 @@
|
|
|
27
32
|
isError?: boolean;
|
|
28
33
|
}>();
|
|
29
34
|
|
|
35
|
+
/**
|
|
36
|
+
* Get the hideUnconnectedHandles setting from extensions
|
|
37
|
+
* Merges node type defaults with instance overrides
|
|
38
|
+
*/
|
|
39
|
+
const hideUnconnectedHandles = $derived(() => {
|
|
40
|
+
const typeDefault = props.data.metadata?.extensions?.ui?.hideUnconnectedHandles ?? false;
|
|
41
|
+
const instanceOverride = props.data.extensions?.ui?.hideUnconnectedHandles;
|
|
42
|
+
return instanceOverride ?? typeDefault;
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Check if a trigger port is connected
|
|
47
|
+
* @param portId - The port ID to check
|
|
48
|
+
* @param type - Whether this is an 'input' or 'output' port
|
|
49
|
+
*/
|
|
50
|
+
function isTriggerPortConnected(portId: string, type: 'input' | 'output'): boolean {
|
|
51
|
+
const handleId = `${props.data.nodeId}-${type}-${portId}`;
|
|
52
|
+
return $connectedHandles.has(handleId);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Check if a trigger port should be visible
|
|
57
|
+
* Always shows if hideUnconnectedHandles is disabled or if port is connected
|
|
58
|
+
*/
|
|
59
|
+
function shouldShowTriggerPort(portId: string, type: 'input' | 'output'): boolean {
|
|
60
|
+
if (!hideUnconnectedHandles()) {
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
return isTriggerPortConnected(portId, type);
|
|
64
|
+
}
|
|
65
|
+
|
|
30
66
|
// Removed local config state - now using global ConfigSidebar
|
|
31
67
|
|
|
32
68
|
// Prioritize metadata icon over config icon for square nodes (metadata is the node definition)
|
|
@@ -110,8 +146,8 @@
|
|
|
110
146
|
id={`${props.data.nodeId}-input-${firstDataInputPort.id}`}
|
|
111
147
|
/>
|
|
112
148
|
{/if}
|
|
113
|
-
{#if triggerInputPort}
|
|
114
|
-
<!-- Trigger Input - positioned at bottom-left -->
|
|
149
|
+
{#if triggerInputPort && shouldShowTriggerPort(triggerInputPort.id, 'input')}
|
|
150
|
+
<!-- Trigger Input - positioned at bottom-left (hidden if hideUnconnectedHandles enabled and not connected) -->
|
|
115
151
|
<Handle
|
|
116
152
|
type="target"
|
|
117
153
|
position={Position.Left}
|
|
@@ -179,8 +215,8 @@
|
|
|
179
215
|
)}; border-color: '#ffffff'; top: {hasBothOutputTypes ? '25%' : '50%'}; z-index: 30;"
|
|
180
216
|
/>
|
|
181
217
|
{/if}
|
|
182
|
-
{#if triggerOutputPort}
|
|
183
|
-
<!-- Trigger Output - positioned at bottom-right -->
|
|
218
|
+
{#if triggerOutputPort && shouldShowTriggerPort(triggerOutputPort.id, 'output')}
|
|
219
|
+
<!-- Trigger Output - positioned at bottom-right (hidden if hideUnconnectedHandles enabled and not connected) -->
|
|
184
220
|
<Handle
|
|
185
221
|
type="source"
|
|
186
222
|
position={Position.Right}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type { ConfigValues, NodeMetadata } from '../../types/index.js';
|
|
1
|
+
import type { ConfigValues, NodeMetadata, NodeExtensions } from '../../types/index.js';
|
|
2
2
|
type $$ComponentProps = {
|
|
3
3
|
data: {
|
|
4
4
|
label: string;
|
|
5
5
|
config: ConfigValues;
|
|
6
6
|
metadata: NodeMetadata;
|
|
7
7
|
nodeId?: string;
|
|
8
|
+
extensions?: NodeExtensions;
|
|
8
9
|
onConfigOpen?: (node: {
|
|
9
10
|
id: string;
|
|
10
11
|
type: string;
|
|
@@ -3,14 +3,19 @@
|
|
|
3
3
|
Renders individual nodes in the workflow editor with full functionality
|
|
4
4
|
Uses SvelteFlow's Handle for connection ports
|
|
5
5
|
Styled with BEM syntax
|
|
6
|
+
|
|
7
|
+
UI Extensions Support:
|
|
8
|
+
- hideUnconnectedHandles: Hides ports that are not connected to reduce visual clutter
|
|
6
9
|
-->
|
|
7
10
|
|
|
8
11
|
<script lang="ts">
|
|
9
12
|
import { Position, Handle } from '@xyflow/svelte';
|
|
10
|
-
import type { WorkflowNode } from '../../types/index.js';
|
|
13
|
+
import type { WorkflowNode, NodePort, DynamicPort } from '../../types/index.js';
|
|
14
|
+
import { dynamicPortToNodePort } from '../../types/index.js';
|
|
11
15
|
import Icon from '@iconify/svelte';
|
|
12
16
|
import { getNodeIcon } from '../../utils/icons.js';
|
|
13
17
|
import { getDataTypeColorToken, getCategoryColorToken } from '../../utils/colors.js';
|
|
18
|
+
import { connectedHandles } from '../../stores/workflowStore.js';
|
|
14
19
|
|
|
15
20
|
interface Props {
|
|
16
21
|
data: WorkflowNode['data'] & {
|
|
@@ -23,6 +28,84 @@
|
|
|
23
28
|
let props: Props = $props();
|
|
24
29
|
let isHandleInteraction = $state(false);
|
|
25
30
|
|
|
31
|
+
/**
|
|
32
|
+
* Get the hideUnconnectedHandles setting from extensions
|
|
33
|
+
* Merges node type defaults with instance overrides
|
|
34
|
+
*/
|
|
35
|
+
const hideUnconnectedHandles = $derived(() => {
|
|
36
|
+
const typeDefault = props.data.metadata?.extensions?.ui?.hideUnconnectedHandles ?? false;
|
|
37
|
+
const instanceOverride = props.data.extensions?.ui?.hideUnconnectedHandles;
|
|
38
|
+
return instanceOverride ?? typeDefault;
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Dynamic inputs from config - user-defined input ports
|
|
43
|
+
* Similar to how branches work in GatewayNode
|
|
44
|
+
*/
|
|
45
|
+
const dynamicInputs = $derived(
|
|
46
|
+
((props.data.config?.dynamicInputs as DynamicPort[]) || []).map((port) =>
|
|
47
|
+
dynamicPortToNodePort(port, 'input')
|
|
48
|
+
)
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Dynamic outputs from config - user-defined output ports
|
|
53
|
+
* Similar to how branches work in GatewayNode
|
|
54
|
+
*/
|
|
55
|
+
const dynamicOutputs = $derived(
|
|
56
|
+
((props.data.config?.dynamicOutputs as DynamicPort[]) || []).map((port) =>
|
|
57
|
+
dynamicPortToNodePort(port, 'output')
|
|
58
|
+
)
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Combined input ports: static metadata inputs + dynamic config inputs
|
|
63
|
+
*/
|
|
64
|
+
const allInputPorts = $derived([...props.data.metadata.inputs, ...dynamicInputs]);
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Combined output ports: static metadata outputs + dynamic config outputs
|
|
68
|
+
*/
|
|
69
|
+
const allOutputPorts = $derived([...props.data.metadata.outputs, ...dynamicOutputs]);
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Check if a port should be visible based on connection state and settings
|
|
73
|
+
* @param port - The port to check
|
|
74
|
+
* @param type - Whether this is an 'input' or 'output' port
|
|
75
|
+
* @returns true if the port should be visible
|
|
76
|
+
*/
|
|
77
|
+
function isPortVisible(port: NodePort, type: 'input' | 'output'): boolean {
|
|
78
|
+
// Always show if hideUnconnectedHandles is disabled
|
|
79
|
+
if (!hideUnconnectedHandles()) {
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Always show required ports
|
|
84
|
+
if (port.required) {
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Check if port is connected
|
|
89
|
+
const handleId = `${props.data.nodeId}-${type}-${port.id}`;
|
|
90
|
+
return $connectedHandles.has(handleId);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Derived list of visible input ports based on hideUnconnectedHandles setting
|
|
95
|
+
* Now includes both static and dynamic inputs
|
|
96
|
+
*/
|
|
97
|
+
const visibleInputPorts = $derived(
|
|
98
|
+
allInputPorts.filter((port) => isPortVisible(port, 'input'))
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Derived list of visible output ports based on hideUnconnectedHandles setting
|
|
103
|
+
* Now includes both static and dynamic outputs
|
|
104
|
+
*/
|
|
105
|
+
const visibleOutputPorts = $derived(
|
|
106
|
+
allOutputPorts.filter((port) => isPortVisible(port, 'output'))
|
|
107
|
+
);
|
|
108
|
+
|
|
26
109
|
/**
|
|
27
110
|
* Handle configuration value changes - now handled by global ConfigSidebar
|
|
28
111
|
*/
|
|
@@ -110,13 +193,13 @@
|
|
|
110
193
|
</div>
|
|
111
194
|
|
|
112
195
|
<!-- Input Ports Container -->
|
|
113
|
-
{#if
|
|
196
|
+
{#if visibleInputPorts.length > 0}
|
|
114
197
|
<div class="flowdrop-workflow-node__ports">
|
|
115
198
|
<div class="flowdrop-workflow-node__ports-header">
|
|
116
199
|
<h5 class="flowdrop-workflow-node__ports-title">Inputs</h5>
|
|
117
200
|
</div>
|
|
118
201
|
<div class="flowdrop-workflow-node__ports-list">
|
|
119
|
-
{#each
|
|
202
|
+
{#each visibleInputPorts as port (port.id)}
|
|
120
203
|
<div class="flowdrop-workflow-node__port">
|
|
121
204
|
<!-- Input Handle -->
|
|
122
205
|
<Handle
|
|
@@ -161,13 +244,13 @@
|
|
|
161
244
|
{/if}
|
|
162
245
|
|
|
163
246
|
<!-- Output Ports Container -->
|
|
164
|
-
{#if
|
|
247
|
+
{#if visibleOutputPorts.length > 0}
|
|
165
248
|
<div class="flowdrop-workflow-node__ports">
|
|
166
249
|
<div class="flowdrop-workflow-node__ports-header">
|
|
167
250
|
<h5 class="flowdrop-workflow-node__ports-title">Outputs</h5>
|
|
168
251
|
</div>
|
|
169
252
|
<div class="flowdrop-workflow-node__ports-list">
|
|
170
|
-
{#each
|
|
253
|
+
{#each visibleOutputPorts as port (port.id)}
|
|
171
254
|
<div class="flowdrop-workflow-node__port">
|
|
172
255
|
<!-- Port Info -->
|
|
173
256
|
<div class="flowdrop-flex--1 flowdrop-min-w--0 flowdrop-text--right">
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import './styles/base.css';
|
|
6
6
|
import './registry/builtinNodes.js';
|
|
7
|
-
export type { NodeCategory, NodeDataType, NodePort, NodeMetadata, ConfigValues, WorkflowNode, WorkflowEdge, Workflow, ApiResponse, NodesResponse, WorkflowResponse, WorkflowsResponse, ExecutionStatus, ExecutionResult, FlowDropConfig, WorkflowEvents, BuiltinNodeType } from './types/index.js';
|
|
7
|
+
export type { NodeCategory, NodeDataType, NodePort, NodeMetadata, NodeExtensions, NodeUIExtensions, ConfigValues, WorkflowNode, WorkflowEdge, Workflow, ApiResponse, NodesResponse, WorkflowResponse, WorkflowsResponse, ExecutionStatus, ExecutionResult, FlowDropConfig, WorkflowEvents, BuiltinNodeType } from './types/index.js';
|
|
8
8
|
export type { WorkflowEditorConfig, EditorFeatures, UIConfig, APIConfig, ExecutionConfig, StorageConfig } from './types/config.js';
|
|
9
9
|
export type { AuthProvider, StaticAuthConfig, CallbackAuthConfig } from './types/auth.js';
|
|
10
10
|
export { StaticAuthProvider, CallbackAuthProvider, NoAuthProvider } from './types/auth.js';
|
|
@@ -29,13 +29,13 @@ export { default as NodeStatusOverlay } from './components/NodeStatusOverlay.sve
|
|
|
29
29
|
export { default as MarkdownDisplay } from './components/MarkdownDisplay.svelte';
|
|
30
30
|
export { default as ConfigForm } from './components/ConfigForm.svelte';
|
|
31
31
|
export { default as ConfigModal } from './components/ConfigModal.svelte';
|
|
32
|
-
export { default as
|
|
32
|
+
export { default as ConfigPanel } from './components/ConfigPanel.svelte';
|
|
33
|
+
export { default as ReadOnlyDetails } from './components/ReadOnlyDetails.svelte';
|
|
33
34
|
export { default as ConnectionLine } from './components/ConnectionLine.svelte';
|
|
34
35
|
export { default as LogsSidebar } from './components/LogsSidebar.svelte';
|
|
35
36
|
export { default as PipelineStatus } from './components/PipelineStatus.svelte';
|
|
36
37
|
export { default as Navbar } from './components/Navbar.svelte';
|
|
37
38
|
export { default as Logo } from './components/Logo.svelte';
|
|
38
|
-
export { sampleNodes, sampleWorkflow } from './data/samples.js';
|
|
39
39
|
export * from './utils/icons.js';
|
|
40
40
|
export * from './utils/colors.js';
|
|
41
41
|
export * from './utils/connections.js';
|
|
@@ -55,7 +55,7 @@ export { globalSaveWorkflow, globalExportWorkflow, initializeGlobalSave } from '
|
|
|
55
55
|
export { fetchPortConfig, validatePortConfig } from './services/portConfigApi.js';
|
|
56
56
|
export { getDraftStorageKey, saveDraft, loadDraft, deleteDraft, hasDraft, getDraftMetadata, DraftAutoSaveManager } from './services/draftStorage.js';
|
|
57
57
|
export { EdgeStylingHelper, NodeOperationsHelper, WorkflowOperationsHelper, ConfigurationHelper } from './helpers/workflowEditorHelper.js';
|
|
58
|
-
export { workflowStore, workflowActions, workflowId, workflowName, workflowNodes, workflowEdges, workflowMetadata, workflowChanged, workflowValidation, workflowMetadataChanged, isDirtyStore, isDirty, markAsSaved, getWorkflow as getWorkflowFromStore, setOnDirtyStateChange, setOnWorkflowChange } from './stores/workflowStore.js';
|
|
58
|
+
export { workflowStore, workflowActions, workflowId, workflowName, workflowNodes, workflowEdges, workflowMetadata, workflowChanged, workflowValidation, workflowMetadataChanged, connectedHandles, isDirtyStore, isDirty, markAsSaved, getWorkflow as getWorkflowFromStore, setOnDirtyStateChange, setOnWorkflowChange } from './stores/workflowStore.js';
|
|
59
59
|
export * from './config/endpoints.js';
|
|
60
60
|
export { DEFAULT_PORT_CONFIG } from './config/defaultPortConfig.js';
|
|
61
61
|
export * from './config/runtimeConfig.js';
|
package/dist/index.js
CHANGED
|
@@ -30,14 +30,13 @@ export { default as NodeStatusOverlay } from './components/NodeStatusOverlay.sve
|
|
|
30
30
|
export { default as MarkdownDisplay } from './components/MarkdownDisplay.svelte';
|
|
31
31
|
export { default as ConfigForm } from './components/ConfigForm.svelte';
|
|
32
32
|
export { default as ConfigModal } from './components/ConfigModal.svelte';
|
|
33
|
-
export { default as
|
|
33
|
+
export { default as ConfigPanel } from './components/ConfigPanel.svelte';
|
|
34
|
+
export { default as ReadOnlyDetails } from './components/ReadOnlyDetails.svelte';
|
|
34
35
|
export { default as ConnectionLine } from './components/ConnectionLine.svelte';
|
|
35
36
|
export { default as LogsSidebar } from './components/LogsSidebar.svelte';
|
|
36
37
|
export { default as PipelineStatus } from './components/PipelineStatus.svelte';
|
|
37
38
|
export { default as Navbar } from './components/Navbar.svelte';
|
|
38
39
|
export { default as Logo } from './components/Logo.svelte';
|
|
39
|
-
// Export sample data for development
|
|
40
|
-
export { sampleNodes, sampleWorkflow } from './data/samples.js';
|
|
41
40
|
// Export utilities
|
|
42
41
|
export * from './utils/icons.js';
|
|
43
42
|
export * from './utils/colors.js';
|
|
@@ -66,7 +65,7 @@ export { getDraftStorageKey, saveDraft, loadDraft, deleteDraft, hasDraft, getDra
|
|
|
66
65
|
// Export helpers
|
|
67
66
|
export { EdgeStylingHelper, NodeOperationsHelper, WorkflowOperationsHelper, ConfigurationHelper } from './helpers/workflowEditorHelper.js';
|
|
68
67
|
// Export stores
|
|
69
|
-
export { workflowStore, workflowActions, workflowId, workflowName, workflowNodes, workflowEdges, workflowMetadata, workflowChanged, workflowValidation, workflowMetadataChanged,
|
|
68
|
+
export { workflowStore, workflowActions, workflowId, workflowName, workflowNodes, workflowEdges, workflowMetadata, workflowChanged, workflowValidation, workflowMetadataChanged, connectedHandles,
|
|
70
69
|
// Dirty state tracking
|
|
71
70
|
isDirtyStore, isDirty, markAsSaved, getWorkflow as getWorkflowFromStore, setOnDirtyStateChange, setOnWorkflowChange } from './stores/workflowStore.js';
|
|
72
71
|
// Export endpoint configuration
|
|
@@ -154,3 +154,18 @@ export declare const workflowMetadataChanged: import("svelte/store").Readable<{
|
|
|
154
154
|
updatedAt: string;
|
|
155
155
|
version: string;
|
|
156
156
|
}>;
|
|
157
|
+
/**
|
|
158
|
+
* Derived store for connected handles
|
|
159
|
+
*
|
|
160
|
+
* Provides a Set of all handle IDs that are currently connected to edges.
|
|
161
|
+
* Used by node components to implement hideUnconnectedHandles functionality.
|
|
162
|
+
*
|
|
163
|
+
* @example
|
|
164
|
+
* ```typescript
|
|
165
|
+
* import { connectedHandles } from './workflowStore.js';
|
|
166
|
+
*
|
|
167
|
+
* // Check if a specific handle is connected
|
|
168
|
+
* const isConnected = $connectedHandles.has('node-1-input-data');
|
|
169
|
+
* ```
|
|
170
|
+
*/
|
|
171
|
+
export declare const connectedHandles: import("svelte/store").Readable<Set<string>>;
|
|
@@ -470,3 +470,31 @@ export const workflowMetadataChanged = derived(workflowMetadata, (metadata) => (
|
|
|
470
470
|
updatedAt: metadata.updatedAt,
|
|
471
471
|
version: metadata.version ?? '1.0.0'
|
|
472
472
|
}));
|
|
473
|
+
/**
|
|
474
|
+
* Derived store for connected handles
|
|
475
|
+
*
|
|
476
|
+
* Provides a Set of all handle IDs that are currently connected to edges.
|
|
477
|
+
* Used by node components to implement hideUnconnectedHandles functionality.
|
|
478
|
+
*
|
|
479
|
+
* @example
|
|
480
|
+
* ```typescript
|
|
481
|
+
* import { connectedHandles } from './workflowStore.js';
|
|
482
|
+
*
|
|
483
|
+
* // Check if a specific handle is connected
|
|
484
|
+
* const isConnected = $connectedHandles.has('node-1-input-data');
|
|
485
|
+
* ```
|
|
486
|
+
*/
|
|
487
|
+
export const connectedHandles = derived(workflowEdges, (edges) => {
|
|
488
|
+
const handles = new Set();
|
|
489
|
+
edges.forEach((edge) => {
|
|
490
|
+
// Add source handle (output port)
|
|
491
|
+
if (edge.sourceHandle) {
|
|
492
|
+
handles.add(edge.sourceHandle);
|
|
493
|
+
}
|
|
494
|
+
// Add target handle (input port)
|
|
495
|
+
if (edge.targetHandle) {
|
|
496
|
+
handles.add(edge.targetHandle);
|
|
497
|
+
}
|
|
498
|
+
});
|
|
499
|
+
return handles;
|
|
500
|
+
});
|
package/dist/types/index.d.ts
CHANGED
|
@@ -70,6 +70,30 @@ export interface NodePort {
|
|
|
70
70
|
description?: string;
|
|
71
71
|
defaultValue?: unknown;
|
|
72
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Dynamic port configuration for user-defined inputs/outputs
|
|
75
|
+
* These are defined in the node's config and allow users to create
|
|
76
|
+
* custom input/output handles at runtime similar to gateway branches
|
|
77
|
+
*/
|
|
78
|
+
export interface DynamicPort {
|
|
79
|
+
/** Unique identifier for the port (used for handle IDs and connections) */
|
|
80
|
+
name: string;
|
|
81
|
+
/** Display label shown in the UI */
|
|
82
|
+
label: string;
|
|
83
|
+
/** Description of what this port accepts/provides */
|
|
84
|
+
description?: string;
|
|
85
|
+
/** Data type for the port (affects color and connection validation) */
|
|
86
|
+
dataType: NodeDataType;
|
|
87
|
+
/** Whether this port is required for execution */
|
|
88
|
+
required?: boolean;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Convert a DynamicPort to a NodePort
|
|
92
|
+
* @param port - The dynamic port configuration
|
|
93
|
+
* @param portType - Whether this is an input or output port
|
|
94
|
+
* @returns A NodePort compatible with the rendering system
|
|
95
|
+
*/
|
|
96
|
+
export declare function dynamicPortToNodePort(port: DynamicPort, portType: 'input' | 'output'): NodePort;
|
|
73
97
|
/**
|
|
74
98
|
* Built-in node types for explicit component rendering.
|
|
75
99
|
* These are the node types that ship with FlowDrop.
|
|
@@ -92,6 +116,48 @@ export type BuiltinNodeType = 'note' | 'simple' | 'square' | 'tool' | 'gateway'
|
|
|
92
116
|
* ```
|
|
93
117
|
*/
|
|
94
118
|
export type NodeType = BuiltinNodeType | (string & Record<never, never>);
|
|
119
|
+
/**
|
|
120
|
+
* UI-related extension settings for nodes
|
|
121
|
+
* Used to control visual behavior in the workflow editor
|
|
122
|
+
*/
|
|
123
|
+
export interface NodeUIExtensions {
|
|
124
|
+
/** Show/hide unconnected handles (ports) to reduce visual noise */
|
|
125
|
+
hideUnconnectedHandles?: boolean;
|
|
126
|
+
/** Custom styles or theme overrides */
|
|
127
|
+
style?: Record<string, unknown>;
|
|
128
|
+
/** Any other UI-specific settings */
|
|
129
|
+
[key: string]: unknown;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Custom extension properties for 3rd party integrations
|
|
133
|
+
* Allows storing additional configuration and UI state data
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* ```typescript
|
|
137
|
+
* const extensions: NodeExtensions = {
|
|
138
|
+
* ui: {
|
|
139
|
+
* hideUnconnectedHandles: true,
|
|
140
|
+
* style: { opacity: 0.8 }
|
|
141
|
+
* },
|
|
142
|
+
* "myapp:analytics": {
|
|
143
|
+
* trackUsage: true,
|
|
144
|
+
* customField: "value"
|
|
145
|
+
* }
|
|
146
|
+
* };
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
149
|
+
export interface NodeExtensions {
|
|
150
|
+
/**
|
|
151
|
+
* UI-related settings for the node
|
|
152
|
+
* Used to control visual behavior in the workflow editor
|
|
153
|
+
*/
|
|
154
|
+
ui?: NodeUIExtensions;
|
|
155
|
+
/**
|
|
156
|
+
* Namespaced extension data from 3rd party integrations
|
|
157
|
+
* Use your package/organization name as the key (e.g., "myapp", "acme:analyzer")
|
|
158
|
+
*/
|
|
159
|
+
[namespace: string]: unknown;
|
|
160
|
+
}
|
|
95
161
|
/**
|
|
96
162
|
* Node configuration metadata
|
|
97
163
|
*/
|
|
@@ -115,6 +181,11 @@ export interface NodeMetadata {
|
|
|
115
181
|
outputs: NodePort[];
|
|
116
182
|
configSchema?: ConfigSchema;
|
|
117
183
|
tags?: string[];
|
|
184
|
+
/**
|
|
185
|
+
* Custom extension properties for 3rd party integrations
|
|
186
|
+
* Allows storing additional configuration and UI state data at the node type level
|
|
187
|
+
*/
|
|
188
|
+
extensions?: NodeExtensions;
|
|
118
189
|
}
|
|
119
190
|
/**
|
|
120
191
|
* Common base interface for all schema properties
|
|
@@ -265,6 +336,12 @@ export interface WorkflowNode extends Node {
|
|
|
265
336
|
nodeId?: string;
|
|
266
337
|
/** Node execution tracking information */
|
|
267
338
|
executionInfo?: NodeExecutionInfo;
|
|
339
|
+
/**
|
|
340
|
+
* Per-instance extension properties for 3rd party integrations
|
|
341
|
+
* Overrides or extends the node type extensions defined in metadata.extensions
|
|
342
|
+
* Use for instance-specific UI states or custom data
|
|
343
|
+
*/
|
|
344
|
+
extensions?: NodeExtensions;
|
|
268
345
|
};
|
|
269
346
|
}
|
|
270
347
|
/**
|
package/dist/types/index.js
CHANGED
|
@@ -2,3 +2,19 @@
|
|
|
2
2
|
* Core types for the Workflow Library
|
|
3
3
|
*/
|
|
4
4
|
import { ConnectionLineType } from '@xyflow/svelte';
|
|
5
|
+
/**
|
|
6
|
+
* Convert a DynamicPort to a NodePort
|
|
7
|
+
* @param port - The dynamic port configuration
|
|
8
|
+
* @param portType - Whether this is an input or output port
|
|
9
|
+
* @returns A NodePort compatible with the rendering system
|
|
10
|
+
*/
|
|
11
|
+
export function dynamicPortToNodePort(port, portType) {
|
|
12
|
+
return {
|
|
13
|
+
id: port.name,
|
|
14
|
+
name: port.label,
|
|
15
|
+
type: portType,
|
|
16
|
+
dataType: port.dataType,
|
|
17
|
+
required: port.required ?? false,
|
|
18
|
+
description: port.description
|
|
19
|
+
};
|
|
20
|
+
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@d34dman/flowdrop",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.23",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "vite dev",
|
|
8
8
|
"build": "vite build && npm run prepack",
|
|
@@ -125,7 +125,8 @@
|
|
|
125
125
|
"vite": "^6.2.6",
|
|
126
126
|
"vite-plugin-devtools-json": "^0.2.1",
|
|
127
127
|
"vitest": "^3.2.3",
|
|
128
|
-
"vitest-browser-svelte": "^0.1.0"
|
|
128
|
+
"vitest-browser-svelte": "^0.1.0",
|
|
129
|
+
"@types/uuid": "^10.0.0"
|
|
129
130
|
},
|
|
130
131
|
"overrides": {
|
|
131
132
|
"@sveltejs/kit": {
|
|
@@ -136,7 +137,6 @@
|
|
|
136
137
|
"svelte"
|
|
137
138
|
],
|
|
138
139
|
"dependencies": {
|
|
139
|
-
"@types/uuid": "^10.0.0",
|
|
140
140
|
"@xyflow/svelte": "~1.2",
|
|
141
141
|
"marked": "^16.1.1",
|
|
142
142
|
"svelte-5-french-toast": "^2.0.6",
|