@d34dman/flowdrop 0.0.1 → 0.0.3
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/README.md +307 -215
- package/dist/adapters/WorkflowAdapter.d.ts +1 -1
- package/dist/adapters/WorkflowAdapter.js +30 -30
- package/dist/api/client.d.ts +24 -1
- package/dist/api/client.js +55 -38
- package/dist/api/enhanced-client.d.ts +46 -0
- package/dist/api/enhanced-client.js +211 -0
- package/dist/clients/ApiClient.d.ts +19 -23
- package/dist/clients/ApiClient.js +36 -34
- package/dist/components/App.svelte +1299 -230
- package/dist/components/App.svelte.d.ts +21 -1
- package/dist/components/CanvasBanner.svelte +50 -44
- package/dist/components/CanvasBanner.svelte.d.ts +5 -19
- package/dist/components/ConfigForm.svelte +555 -0
- package/dist/components/ConfigForm.svelte.d.ts +32 -0
- package/dist/components/ConfigModal.svelte +261 -0
- package/dist/components/ConfigModal.svelte.d.ts +31 -0
- package/dist/components/ConfigSidebar.svelte +934 -0
- package/dist/components/ConfigSidebar.svelte.d.ts +51 -0
- package/dist/components/ConnectionLine.svelte +32 -0
- package/dist/components/ConnectionLine.svelte.d.ts +3 -0
- package/dist/components/GatewayNode.svelte +471 -0
- package/dist/components/GatewayNode.svelte.d.ts +15 -0
- package/dist/components/LoadingSpinner.svelte +23 -23
- package/dist/components/LoadingSpinner.svelte.d.ts +1 -1
- package/dist/components/Logo.svelte +82 -0
- package/dist/components/Logo.svelte.d.ts +26 -0
- package/dist/components/LogsSidebar.svelte +565 -0
- package/dist/components/LogsSidebar.svelte.d.ts +34 -0
- package/dist/components/MarkdownDisplay.svelte +28 -0
- package/dist/components/MarkdownDisplay.svelte.d.ts +7 -0
- package/dist/components/Navbar.svelte +663 -0
- package/dist/components/Navbar.svelte.d.ts +21 -0
- package/dist/components/NodeSidebar.svelte +629 -488
- package/dist/components/NodeSidebar.svelte.d.ts +1 -2
- package/dist/components/NodeStatusOverlay.svelte +327 -0
- package/dist/components/NodeStatusOverlay.svelte.d.ts +11 -0
- package/dist/components/NotesNode.svelte +566 -0
- package/dist/components/NotesNode.svelte.d.ts +43 -0
- package/dist/components/PipelineStatus.svelte +331 -0
- package/dist/components/PipelineStatus.svelte.d.ts +18 -0
- package/dist/components/SimpleNode.svelte +447 -0
- package/dist/components/SimpleNode.svelte.d.ts +24 -0
- package/dist/components/SquareNode.svelte +346 -0
- package/dist/components/SquareNode.svelte.d.ts +24 -0
- package/dist/components/StatusIcon.svelte +112 -0
- package/dist/components/StatusIcon.svelte.d.ts +10 -0
- package/dist/components/StatusLabel.svelte +33 -0
- package/dist/components/StatusLabel.svelte.d.ts +7 -0
- package/dist/components/ToolNode.svelte +385 -0
- package/dist/components/ToolNode.svelte.d.ts +36 -0
- package/dist/components/UniversalNode.svelte +126 -0
- package/dist/components/UniversalNode.svelte.d.ts +15 -0
- package/dist/components/WorkflowEditor.svelte +871 -528
- package/dist/components/WorkflowEditor.svelte.d.ts +15 -5
- package/dist/components/WorkflowNode.svelte +428 -542
- package/dist/components/WorkflowNode.svelte.d.ts +7 -3
- package/dist/config/apiConfig.d.ts +33 -0
- package/dist/config/apiConfig.js +39 -0
- package/dist/config/defaultPortConfig.d.ts +6 -0
- package/dist/config/defaultPortConfig.js +192 -0
- package/dist/config/demo.d.ts +58 -0
- package/dist/config/demo.js +142 -0
- package/dist/config/endpoints.d.ts +106 -0
- package/dist/config/endpoints.js +128 -0
- package/dist/data/samples.d.ts +38 -4
- package/dist/data/samples.js +2789 -737
- package/dist/examples/adapter-usage.d.ts +4 -4
- package/dist/examples/adapter-usage.js +21 -26
- package/dist/examples/api-client-usage.d.ts +6 -6
- package/dist/examples/api-client-usage.js +55 -54
- package/dist/index.d.ts +23 -15
- package/dist/index.js +23 -15
- package/dist/mocks/app-environment.d.ts +8 -0
- package/dist/mocks/app-environment.js +16 -0
- package/dist/mocks/app-forms.d.ts +2 -0
- package/dist/mocks/app-forms.js +21 -0
- package/dist/mocks/app-navigation.d.ts +5 -0
- package/dist/mocks/app-navigation.js +34 -0
- package/dist/mocks/app-stores.d.ts +14 -0
- package/dist/mocks/app-stores.js +26 -0
- package/dist/services/api.d.ts +13 -3
- package/dist/services/api.js +91 -36
- package/dist/services/globalSave.d.ts +20 -0
- package/dist/services/globalSave.js +165 -0
- package/dist/services/nodeExecutionService.d.ts +63 -0
- package/dist/services/nodeExecutionService.js +261 -0
- package/dist/services/portConfigApi.d.ts +14 -0
- package/dist/services/portConfigApi.js +69 -0
- package/dist/services/toastService.d.ts +147 -0
- package/dist/services/toastService.js +235 -0
- package/dist/services/workflowStorage.d.ts +2 -2
- package/dist/services/workflowStorage.js +10 -10
- package/dist/stores/workflowStore.d.ts +53 -0
- package/dist/stores/workflowStore.js +264 -0
- package/dist/styles/base.css +896 -363
- package/dist/svelte-app.d.ts +52 -5
- package/dist/svelte-app.js +128 -6
- package/dist/types/config.d.ts +291 -0
- package/dist/types/config.js +4 -0
- package/dist/types/index.d.ts +231 -19
- package/dist/types/index.js +1 -1
- package/dist/utils/colors.d.ts +67 -33
- package/dist/utils/colors.js +183 -118
- package/dist/utils/config.d.ts +41 -0
- package/dist/utils/config.js +248 -0
- package/dist/utils/connections.d.ts +40 -3
- package/dist/utils/connections.js +115 -44
- package/dist/utils/icons.d.ts +1 -1
- package/dist/utils/icons.js +71 -70
- package/dist/utils/nodeStatus.d.ts +53 -0
- package/dist/utils/nodeStatus.js +183 -0
- package/dist/utils/nodeTypes.d.ts +57 -0
- package/dist/utils/nodeTypes.js +109 -0
- package/dist/utils/nodeWrapper.d.ts +39 -0
- package/dist/utils/nodeWrapper.js +62 -0
- package/package.json +132 -97
- package/dist/app.css +0 -0
- package/dist/components/Node.svelte +0 -38
- package/dist/components/Node.svelte.d.ts +0 -4
|
@@ -0,0 +1,447 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Simple Node Component
|
|
3
|
+
A simple node with optional input and output ports
|
|
4
|
+
Styled with BEM syntax
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
<script lang="ts">
|
|
8
|
+
import { Position, Handle } from '@xyflow/svelte';
|
|
9
|
+
import type { NodeConfig, NodeMetadata } from '../types/index.js';
|
|
10
|
+
import Icon from '@iconify/svelte';
|
|
11
|
+
import { getDataTypeColor } from '../utils/colors.js';
|
|
12
|
+
|
|
13
|
+
const props = $props<{
|
|
14
|
+
data: {
|
|
15
|
+
label: string;
|
|
16
|
+
config: NodeConfig;
|
|
17
|
+
metadata: NodeMetadata;
|
|
18
|
+
nodeId?: string;
|
|
19
|
+
onConfigOpen?: (node: {
|
|
20
|
+
id: string;
|
|
21
|
+
type: string;
|
|
22
|
+
data: { label: string; config: NodeConfig; metadata: NodeMetadata };
|
|
23
|
+
}) => void;
|
|
24
|
+
};
|
|
25
|
+
selected?: boolean;
|
|
26
|
+
isProcessing?: boolean;
|
|
27
|
+
isError?: boolean;
|
|
28
|
+
}>();
|
|
29
|
+
|
|
30
|
+
// Removed local config state - now using global ConfigSidebar
|
|
31
|
+
|
|
32
|
+
// Prioritize metadata icon over config icon for simple nodes (metadata is the node definition)
|
|
33
|
+
let nodeIcon = $derived(
|
|
34
|
+
(props.data.metadata?.icon as string) || (props.data.config?.icon as string) || 'mdi:square'
|
|
35
|
+
);
|
|
36
|
+
let nodeColor = $derived(
|
|
37
|
+
(props.data.metadata?.color as string) || (props.data.config?.color as string) || '#6366f1'
|
|
38
|
+
);
|
|
39
|
+
let nodeLayout = $derived((props.data.config?.layout as string) || 'normal');
|
|
40
|
+
|
|
41
|
+
// Layout configurations
|
|
42
|
+
const layoutConfig = {
|
|
43
|
+
compact: {
|
|
44
|
+
width: '80px',
|
|
45
|
+
height: '80px',
|
|
46
|
+
iconSize: '2rem',
|
|
47
|
+
showHeader: false
|
|
48
|
+
},
|
|
49
|
+
normal: {
|
|
50
|
+
width: '18rem',
|
|
51
|
+
height: 'auto',
|
|
52
|
+
iconSize: '1rem',
|
|
53
|
+
showHeader: true
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
let currentLayout = $derived(
|
|
58
|
+
layoutConfig[nodeLayout as keyof typeof layoutConfig] || layoutConfig.normal
|
|
59
|
+
);
|
|
60
|
+
let isCompact = $derived(nodeLayout === 'compact');
|
|
61
|
+
|
|
62
|
+
// Handle configuration sidebar - now using global ConfigSidebar
|
|
63
|
+
function openConfigSidebar(): void {
|
|
64
|
+
if (props.data.onConfigOpen) {
|
|
65
|
+
// Create a WorkflowNodeType-like object for the global ConfigSidebar
|
|
66
|
+
const nodeForConfig = {
|
|
67
|
+
id: props.data.nodeId || 'unknown',
|
|
68
|
+
type: 'simple',
|
|
69
|
+
data: props.data
|
|
70
|
+
};
|
|
71
|
+
props.data.onConfigOpen(nodeForConfig);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Handle double-click to open config
|
|
76
|
+
function handleDoubleClick(): void {
|
|
77
|
+
openConfigSidebar();
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Handle single click - only handle selection, no config opening
|
|
81
|
+
function handleClick(): void {
|
|
82
|
+
// Node selection is handled by Svelte Flow
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Handle keyboard events
|
|
86
|
+
function handleKeydown(event: KeyboardEvent): void {
|
|
87
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
88
|
+
event.preventDefault();
|
|
89
|
+
handleDoubleClick();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Get first input/output ports for simple node representation
|
|
94
|
+
// Special handling for trigger ports - they should always be shown if present
|
|
95
|
+
let triggerInputPort = $derived(
|
|
96
|
+
props.data.metadata?.inputs?.find((port) => port.dataType === 'trigger')
|
|
97
|
+
);
|
|
98
|
+
let triggerOutputPort = $derived(
|
|
99
|
+
props.data.metadata?.outputs?.find((port) => port.dataType === 'trigger')
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
// Get first non-trigger ports for data connections
|
|
103
|
+
let firstDataInputPort = $derived(
|
|
104
|
+
props.data.metadata?.inputs?.find((port) => port.dataType !== 'trigger')
|
|
105
|
+
);
|
|
106
|
+
let firstDataOutputPort = $derived(
|
|
107
|
+
props.data.metadata?.outputs?.find((port) => port.dataType !== 'trigger')
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
// Use trigger port if present, otherwise use first data port
|
|
111
|
+
let firstInputPort = $derived(triggerInputPort || firstDataInputPort);
|
|
112
|
+
let firstOutputPort = $derived(triggerOutputPort || firstDataOutputPort);
|
|
113
|
+
|
|
114
|
+
let hasInput = $derived(!!firstInputPort);
|
|
115
|
+
let hasOutput = $derived(!!firstOutputPort);
|
|
116
|
+
|
|
117
|
+
// Check if we need to show both trigger and data ports
|
|
118
|
+
let hasBothInputTypes = $derived(!!triggerInputPort && !!firstDataInputPort);
|
|
119
|
+
let hasBothOutputTypes = $derived(!!triggerOutputPort && !!firstDataOutputPort);
|
|
120
|
+
</script>
|
|
121
|
+
|
|
122
|
+
<!-- Input Handles -->
|
|
123
|
+
{#if firstDataInputPort}
|
|
124
|
+
<!-- Data Input - positioned at top-left if both types exist, otherwise center -->
|
|
125
|
+
<Handle
|
|
126
|
+
type="target"
|
|
127
|
+
position={Position.Left}
|
|
128
|
+
style="background-color: {getDataTypeColor(
|
|
129
|
+
firstDataInputPort.dataType
|
|
130
|
+
)}; border-color: '#ffffff'; top: {hasBothInputTypes ? '25%' : '50%'}; z-index: 30;"
|
|
131
|
+
id={`${props.data.nodeId}-input-${firstDataInputPort.id}`}
|
|
132
|
+
/>
|
|
133
|
+
{/if}
|
|
134
|
+
{#if triggerInputPort}
|
|
135
|
+
<!-- Trigger Input - positioned at bottom-left -->
|
|
136
|
+
<Handle
|
|
137
|
+
type="target"
|
|
138
|
+
position={Position.Left}
|
|
139
|
+
style="background-color: {getDataTypeColor(
|
|
140
|
+
triggerInputPort.dataType
|
|
141
|
+
)}; border-color: '#ffffff'; top: {hasBothInputTypes ? '75%' : '50%'}; z-index: 30;"
|
|
142
|
+
id={`${props.data.nodeId}-input-${triggerInputPort.id}`}
|
|
143
|
+
/>
|
|
144
|
+
{/if}
|
|
145
|
+
|
|
146
|
+
<!-- Simple Node -->
|
|
147
|
+
<div
|
|
148
|
+
class="flowdrop-simple-node"
|
|
149
|
+
class:flowdrop-simple-node--compact={isCompact}
|
|
150
|
+
class:flowdrop-simple-node--normal={!isCompact}
|
|
151
|
+
class:flowdrop-simple-node--selected={props.selected}
|
|
152
|
+
class:flowdrop-simple-node--processing={props.isProcessing}
|
|
153
|
+
class:flowdrop-simple-node--error={props.isError}
|
|
154
|
+
onclick={handleClick}
|
|
155
|
+
ondblclick={handleDoubleClick}
|
|
156
|
+
onkeydown={handleKeydown}
|
|
157
|
+
role="button"
|
|
158
|
+
tabindex="0"
|
|
159
|
+
>
|
|
160
|
+
{#if isCompact}
|
|
161
|
+
<!-- Compact Layout: Just centered icon -->
|
|
162
|
+
<div class="flowdrop-simple-node__compact-content">
|
|
163
|
+
<Icon
|
|
164
|
+
icon={nodeIcon}
|
|
165
|
+
class="flowdrop-simple-node__compact-icon"
|
|
166
|
+
style="color: {nodeColor}; font-size: {currentLayout.iconSize};"
|
|
167
|
+
/>
|
|
168
|
+
</div>
|
|
169
|
+
{:else}
|
|
170
|
+
<!-- Normal Layout: Header with title and description -->
|
|
171
|
+
<div class="flowdrop-simple-node__header">
|
|
172
|
+
<div class="flowdrop-simple-node__header-content">
|
|
173
|
+
<!-- Node Icon -->
|
|
174
|
+
<div class="flowdrop-simple-node__icon-container" style="background-color: {nodeColor}">
|
|
175
|
+
<Icon icon={nodeIcon} class="flowdrop-simple-node__icon" />
|
|
176
|
+
</div>
|
|
177
|
+
|
|
178
|
+
<!-- Node Title -->
|
|
179
|
+
<h3 class="flowdrop-simple-node__title">
|
|
180
|
+
{props.data.label}
|
|
181
|
+
</h3>
|
|
182
|
+
</div>
|
|
183
|
+
|
|
184
|
+
<!-- Node Description -->
|
|
185
|
+
<p class="flowdrop-simple-node__description">
|
|
186
|
+
{props.data.metadata?.description || 'A configurable simple node'}
|
|
187
|
+
</p>
|
|
188
|
+
</div>
|
|
189
|
+
{/if}
|
|
190
|
+
|
|
191
|
+
<!-- Processing indicator -->
|
|
192
|
+
{#if props.isProcessing}
|
|
193
|
+
<div class="flowdrop-simple-node__processing">
|
|
194
|
+
<div class="flowdrop-simple-node__spinner"></div>
|
|
195
|
+
</div>
|
|
196
|
+
{/if}
|
|
197
|
+
|
|
198
|
+
<!-- Error indicator -->
|
|
199
|
+
{#if props.isError}
|
|
200
|
+
<div class="flowdrop-simple-node__error">
|
|
201
|
+
<Icon icon="mdi:alert-circle" class="flowdrop-simple-node__error-icon" />
|
|
202
|
+
</div>
|
|
203
|
+
{/if}
|
|
204
|
+
|
|
205
|
+
<!-- Config button -->
|
|
206
|
+
<button
|
|
207
|
+
class="flowdrop-simple-node__config-btn"
|
|
208
|
+
onclick={openConfigSidebar}
|
|
209
|
+
title="Configure node"
|
|
210
|
+
>
|
|
211
|
+
<Icon icon="mdi:cog" />
|
|
212
|
+
</button>
|
|
213
|
+
</div>
|
|
214
|
+
|
|
215
|
+
<!-- Output Handles -->
|
|
216
|
+
{#if firstDataOutputPort}
|
|
217
|
+
<!-- Data Output - positioned at top-right if both types exist, otherwise center -->
|
|
218
|
+
<Handle
|
|
219
|
+
type="source"
|
|
220
|
+
position={Position.Right}
|
|
221
|
+
id={`${props.data.nodeId}-output-${firstDataOutputPort.id}`}
|
|
222
|
+
style="background-color: {getDataTypeColor(
|
|
223
|
+
firstDataOutputPort.dataType
|
|
224
|
+
)}; border-color: '#ffffff'; top: {hasBothOutputTypes ? '25%' : '50%'}; z-index: 30;"
|
|
225
|
+
/>
|
|
226
|
+
{/if}
|
|
227
|
+
{#if triggerOutputPort}
|
|
228
|
+
<!-- Trigger Output - positioned at bottom-right -->
|
|
229
|
+
<Handle
|
|
230
|
+
type="source"
|
|
231
|
+
position={Position.Right}
|
|
232
|
+
id={`${props.data.nodeId}-output-${triggerOutputPort.id}`}
|
|
233
|
+
style="background-color: {getDataTypeColor(
|
|
234
|
+
triggerOutputPort.dataType
|
|
235
|
+
)}; border-color: '#ffffff'; top: {hasBothOutputTypes ? '75%' : '50%'}; z-index: 30;"
|
|
236
|
+
/>
|
|
237
|
+
{/if}
|
|
238
|
+
|
|
239
|
+
<!-- ConfigSidebar removed - now using global ConfigSidebar in WorkflowEditor -->
|
|
240
|
+
|
|
241
|
+
<style>
|
|
242
|
+
.flowdrop-simple-node {
|
|
243
|
+
position: relative;
|
|
244
|
+
background-color: #ffffff;
|
|
245
|
+
border: 2px solid #e5e7eb;
|
|
246
|
+
border-radius: 0.75rem;
|
|
247
|
+
display: flex;
|
|
248
|
+
flex-direction: column;
|
|
249
|
+
cursor: pointer;
|
|
250
|
+
transition: all 0.2s ease-in-out;
|
|
251
|
+
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
|
|
252
|
+
overflow: visible; /* Changed from hidden to visible to allow handles to be properly accessible */
|
|
253
|
+
z-index: 10;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/* Normal layout (default) */
|
|
257
|
+
.flowdrop-simple-node--normal {
|
|
258
|
+
width: 18rem;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/* Compact layout */
|
|
262
|
+
.flowdrop-simple-node--compact {
|
|
263
|
+
width: 80px;
|
|
264
|
+
height: 80px;
|
|
265
|
+
justify-content: center;
|
|
266
|
+
align-items: center;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.flowdrop-simple-node:hover {
|
|
270
|
+
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.flowdrop-simple-node--selected {
|
|
274
|
+
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
|
|
275
|
+
border: 2px solid #3b82f6;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.flowdrop-simple-node--processing {
|
|
279
|
+
opacity: 0.7;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.flowdrop-simple-node--error {
|
|
283
|
+
border-color: #ef4444 !important;
|
|
284
|
+
background-color: #fef2f2 !important;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.flowdrop-simple-node__header {
|
|
288
|
+
padding: 1rem;
|
|
289
|
+
background-color: #f9fafb;
|
|
290
|
+
border-radius: 0.75rem;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.flowdrop-simple-node__header-content {
|
|
294
|
+
display: flex;
|
|
295
|
+
align-items: center;
|
|
296
|
+
gap: 0.75rem;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.flowdrop-simple-node__icon-container {
|
|
300
|
+
display: flex;
|
|
301
|
+
align-items: center;
|
|
302
|
+
justify-content: center;
|
|
303
|
+
width: 2rem;
|
|
304
|
+
height: 2rem;
|
|
305
|
+
border-radius: 0.375rem;
|
|
306
|
+
flex-shrink: 0;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/* Compact layout styles */
|
|
310
|
+
.flowdrop-simple-node__compact-content {
|
|
311
|
+
display: flex;
|
|
312
|
+
align-items: center;
|
|
313
|
+
justify-content: center;
|
|
314
|
+
width: 100%;
|
|
315
|
+
height: 100%;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
:global(.flowdrop-simple-node__compact-icon) {
|
|
319
|
+
filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.flowdrop-simple-node__title {
|
|
323
|
+
font-size: 0.875rem;
|
|
324
|
+
font-weight: 500;
|
|
325
|
+
color: #1f2937;
|
|
326
|
+
margin: 0;
|
|
327
|
+
flex: 1;
|
|
328
|
+
min-width: 0;
|
|
329
|
+
line-height: 1.4;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.flowdrop-simple-node__description {
|
|
333
|
+
font-size: 0.75rem;
|
|
334
|
+
color: #6b7280;
|
|
335
|
+
margin: 0.25rem 0 0 0;
|
|
336
|
+
line-height: 1.3;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
/* Compact layout text constraints */
|
|
340
|
+
.flowdrop-simple-node--compact .flowdrop-simple-node__title {
|
|
341
|
+
overflow: hidden;
|
|
342
|
+
text-overflow: ellipsis;
|
|
343
|
+
white-space: nowrap;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.flowdrop-simple-node--compact .flowdrop-simple-node__description {
|
|
347
|
+
overflow: hidden;
|
|
348
|
+
text-overflow: ellipsis;
|
|
349
|
+
white-space: nowrap;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
:global(.flowdrop-simple-node__icon) {
|
|
353
|
+
color: white;
|
|
354
|
+
font-size: 1rem;
|
|
355
|
+
filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/* Label styling removed - now using header title */
|
|
359
|
+
|
|
360
|
+
.flowdrop-simple-node__processing {
|
|
361
|
+
position: absolute;
|
|
362
|
+
top: 4px;
|
|
363
|
+
right: 4px;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
.flowdrop-simple-node__spinner {
|
|
367
|
+
width: 12px;
|
|
368
|
+
height: 12px;
|
|
369
|
+
border: 1px solid rgba(255, 255, 255, 0.3);
|
|
370
|
+
border-top: 1px solid white;
|
|
371
|
+
border-radius: 50%;
|
|
372
|
+
animation: spin 1s linear infinite;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
.flowdrop-simple-node__error {
|
|
376
|
+
position: absolute;
|
|
377
|
+
top: 4px;
|
|
378
|
+
right: 4px;
|
|
379
|
+
color: #ef4444;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
:global(.flowdrop-simple-node__error-icon) {
|
|
383
|
+
width: 12px;
|
|
384
|
+
height: 12px;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
.flowdrop-simple-node__config-btn {
|
|
388
|
+
position: absolute;
|
|
389
|
+
top: 0.5rem;
|
|
390
|
+
right: 0.5rem;
|
|
391
|
+
width: 1.5rem;
|
|
392
|
+
height: 1.5rem;
|
|
393
|
+
background-color: rgba(255, 255, 255, 0.9);
|
|
394
|
+
border: 1px solid #e5e7eb;
|
|
395
|
+
border-radius: 0.25rem;
|
|
396
|
+
color: #6b7280;
|
|
397
|
+
cursor: pointer;
|
|
398
|
+
display: flex;
|
|
399
|
+
align-items: center;
|
|
400
|
+
justify-content: center;
|
|
401
|
+
opacity: 0;
|
|
402
|
+
transition: all 0.2s ease-in-out;
|
|
403
|
+
backdrop-filter: blur(4px);
|
|
404
|
+
z-index: 15;
|
|
405
|
+
font-size: 0.875rem;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
.flowdrop-simple-node:hover .flowdrop-simple-node__config-btn {
|
|
409
|
+
opacity: 1;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
.flowdrop-simple-node__config-btn:hover {
|
|
413
|
+
background-color: #f9fafb;
|
|
414
|
+
border-color: #d1d5db;
|
|
415
|
+
color: #374151;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
@keyframes spin {
|
|
419
|
+
to {
|
|
420
|
+
transform: rotate(360deg);
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
/* Handle styles - matching WorkflowNode exactly */
|
|
425
|
+
:global(.svelte-flow__node-simple .svelte-flow__handle) {
|
|
426
|
+
width: 18px !important;
|
|
427
|
+
height: 18px !important;
|
|
428
|
+
border-radius: 50% !important;
|
|
429
|
+
transition: all 0.2s ease-in-out !important;
|
|
430
|
+
cursor: pointer !important;
|
|
431
|
+
z-index: 20 !important;
|
|
432
|
+
pointer-events: auto !important;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
:global(.svelte-flow__node-simple .svelte-flow__handle-left) {
|
|
436
|
+
left: -6px !important;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
:global(.svelte-flow__node-simple .svelte-flow__handle-right) {
|
|
440
|
+
right: -6px !important;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
:global(.svelte-flow__node-simple .svelte-flow__handle:focus) {
|
|
444
|
+
outline: 2px solid #3b82f6 !important;
|
|
445
|
+
outline-offset: 2px !important;
|
|
446
|
+
}
|
|
447
|
+
</style>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { NodeConfig, NodeMetadata } from '../types/index.js';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
data: {
|
|
4
|
+
label: string;
|
|
5
|
+
config: NodeConfig;
|
|
6
|
+
metadata: NodeMetadata;
|
|
7
|
+
nodeId?: string;
|
|
8
|
+
onConfigOpen?: (node: {
|
|
9
|
+
id: string;
|
|
10
|
+
type: string;
|
|
11
|
+
data: {
|
|
12
|
+
label: string;
|
|
13
|
+
config: NodeConfig;
|
|
14
|
+
metadata: NodeMetadata;
|
|
15
|
+
};
|
|
16
|
+
}) => void;
|
|
17
|
+
};
|
|
18
|
+
selected?: boolean;
|
|
19
|
+
isProcessing?: boolean;
|
|
20
|
+
isError?: boolean;
|
|
21
|
+
};
|
|
22
|
+
declare const SimpleNode: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
23
|
+
type SimpleNode = ReturnType<typeof SimpleNode>;
|
|
24
|
+
export default SimpleNode;
|