@d34dman/flowdrop 0.0.1 → 0.0.2
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 +129 -97
- package/dist/components/Node.svelte +0 -38
- package/dist/components/Node.svelte.d.ts +0 -4
package/dist/utils/colors.js
CHANGED
|
@@ -3,73 +3,117 @@
|
|
|
3
3
|
* Ensures consistent category colors across sidebar and canvas
|
|
4
4
|
* Uses BEM syntax for CSS classes
|
|
5
5
|
*/
|
|
6
|
+
import { getPortCompatibilityChecker } from './connections.js';
|
|
6
7
|
/**
|
|
7
8
|
* Category color mapping to reference tokens (CSS variables)
|
|
8
9
|
*/
|
|
9
10
|
export const CATEGORY_COLOR_TOKENS = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
11
|
+
inputs: 'var(--color-ref-emerald-500)',
|
|
12
|
+
outputs: 'var(--color-ref-blue-600)',
|
|
13
|
+
prompts: 'var(--color-ref-amber-500)',
|
|
14
|
+
models: 'var(--color-ref-indigo-500)',
|
|
15
|
+
processing: 'var(--color-ref-teal-500)',
|
|
16
|
+
logic: 'var(--color-ref-purple-600)',
|
|
17
|
+
data: 'var(--color-ref-orange-500)',
|
|
18
|
+
helpers: 'var(--color-ref-slate-500)',
|
|
19
|
+
tools: 'var(--color-ref-amber-500)',
|
|
20
|
+
'vector stores': 'var(--color-ref-emerald-500)',
|
|
21
|
+
embeddings: 'var(--color-ref-indigo-500)',
|
|
22
|
+
memories: 'var(--color-ref-blue-600)',
|
|
23
|
+
agents: 'var(--color-ref-teal-500)',
|
|
24
|
+
ai: 'var(--color-ref-purple-500)',
|
|
25
|
+
bundles: 'var(--color-ref-slate-500)'
|
|
24
26
|
};
|
|
25
27
|
/**
|
|
26
28
|
* Data type color mapping to reference tokens (CSS variables)
|
|
29
|
+
* @deprecated Use getDataTypeColorToken() with port configuration instead
|
|
27
30
|
*/
|
|
28
31
|
export const DATA_TYPE_COLOR_TOKENS = {
|
|
29
|
-
string:
|
|
30
|
-
text:
|
|
31
|
-
number:
|
|
32
|
-
integer:
|
|
33
|
-
float:
|
|
34
|
-
boolean:
|
|
35
|
-
array:
|
|
36
|
-
list:
|
|
37
|
-
object:
|
|
38
|
-
json:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
32
|
+
string: 'var(--color-ref-emerald-500)',
|
|
33
|
+
text: 'var(--color-ref-emerald-500)',
|
|
34
|
+
number: 'var(--color-ref-blue-600)',
|
|
35
|
+
integer: 'var(--color-ref-blue-600)',
|
|
36
|
+
float: 'var(--color-ref-blue-600)',
|
|
37
|
+
boolean: 'var(--color-ref-purple-600)',
|
|
38
|
+
array: 'var(--color-ref-amber-500)',
|
|
39
|
+
list: 'var(--color-ref-amber-500)',
|
|
40
|
+
object: 'var(--color-ref-orange-500)',
|
|
41
|
+
json: 'var(--color-ref-orange-500)',
|
|
42
|
+
mixed: 'var(--color-ref-orange-500)',
|
|
43
|
+
file: 'var(--color-ref-red-500)',
|
|
44
|
+
document: 'var(--color-ref-red-500)',
|
|
45
|
+
image: 'var(--color-ref-pink-500)',
|
|
46
|
+
picture: 'var(--color-ref-pink-500)',
|
|
47
|
+
audio: 'var(--color-ref-indigo-500)',
|
|
48
|
+
sound: 'var(--color-ref-indigo-500)',
|
|
49
|
+
video: 'var(--color-ref-teal-500)',
|
|
50
|
+
movie: 'var(--color-ref-teal-500)',
|
|
51
|
+
url: 'var(--color-ref-cyan-500)',
|
|
52
|
+
email: 'var(--color-ref-cyan-500)',
|
|
53
|
+
date: 'var(--color-ref-lime-500)',
|
|
54
|
+
datetime: 'var(--color-ref-lime-500)',
|
|
55
|
+
time: 'var(--color-ref-lime-500)',
|
|
56
|
+
tool: 'var(--color-ref-amber-500)',
|
|
57
|
+
trigger: 'var(--color-ref-gray-950)',
|
|
58
|
+
branch: 'var(--color-ref-purple-500)'
|
|
52
59
|
};
|
|
53
60
|
/**
|
|
54
61
|
* Get the reference color token for a category
|
|
55
62
|
*/
|
|
56
63
|
export function getCategoryColorToken(category) {
|
|
57
|
-
return CATEGORY_COLOR_TOKENS[category] ||
|
|
64
|
+
return CATEGORY_COLOR_TOKENS[category] || 'var(--color-ref-slate-500)';
|
|
58
65
|
}
|
|
59
66
|
/**
|
|
60
|
-
* Get the reference color token for a data type
|
|
67
|
+
* Get the reference color token for a data type (configurable version)
|
|
61
68
|
*/
|
|
62
69
|
export function getDataTypeColorToken(dataType) {
|
|
63
|
-
|
|
70
|
+
try {
|
|
71
|
+
const checker = getPortCompatibilityChecker();
|
|
72
|
+
const config = checker.getDataTypeConfig(dataType);
|
|
73
|
+
if (config?.color) {
|
|
74
|
+
return config.color;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
// Fallback to static color mapping if port checker not initialized
|
|
79
|
+
// console.warn("Port compatibility checker not initialized, using fallback colors");
|
|
80
|
+
}
|
|
81
|
+
return DATA_TYPE_COLOR_TOKENS[dataType.toLowerCase()] || 'var(--color-ref-slate-500)';
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Get data type configuration from port config
|
|
85
|
+
*/
|
|
86
|
+
export function getDataTypeConfig(dataType) {
|
|
87
|
+
try {
|
|
88
|
+
const checker = getPortCompatibilityChecker();
|
|
89
|
+
return checker.getDataTypeConfig(dataType);
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
console.warn('Port compatibility checker not initialized:', error);
|
|
93
|
+
return undefined;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Get all available data types from port configuration
|
|
98
|
+
*/
|
|
99
|
+
export function getAvailableDataTypes() {
|
|
100
|
+
try {
|
|
101
|
+
const checker = getPortCompatibilityChecker();
|
|
102
|
+
return checker.getEnabledDataTypes();
|
|
103
|
+
}
|
|
104
|
+
catch (error) {
|
|
105
|
+
console.warn('Port compatibility checker not initialized:', error);
|
|
106
|
+
return [];
|
|
107
|
+
}
|
|
64
108
|
}
|
|
65
109
|
/**
|
|
66
110
|
* Default colors for fallback cases
|
|
67
111
|
*/
|
|
68
112
|
export const DEFAULT_COLORS = {
|
|
69
|
-
background:
|
|
70
|
-
accent:
|
|
71
|
-
text:
|
|
72
|
-
border:
|
|
113
|
+
background: 'flowdrop-color--base-light',
|
|
114
|
+
accent: 'flowdrop-color--neutral',
|
|
115
|
+
text: 'flowdrop-color--base-text',
|
|
116
|
+
border: 'flowdrop-color--base-border'
|
|
73
117
|
};
|
|
74
118
|
/**
|
|
75
119
|
* Get category colors
|
|
@@ -77,18 +121,7 @@ export const DEFAULT_COLORS = {
|
|
|
77
121
|
* @returns The color configuration for the category
|
|
78
122
|
*/
|
|
79
123
|
export function getCategoryColors(category) {
|
|
80
|
-
|
|
81
|
-
if (colorToken) {
|
|
82
|
-
// Convert color token to BEM color class
|
|
83
|
-
const colorName = colorToken.replace("var(--color-ref-", "").replace(")", "");
|
|
84
|
-
return {
|
|
85
|
-
background: `flowdrop-color--${colorName.split("-")[0]}-light`,
|
|
86
|
-
accent: `flowdrop-color--${colorName.split("-")[0]}`,
|
|
87
|
-
text: `flowdrop-color--${colorName.split("-")[0]}-text`,
|
|
88
|
-
border: `flowdrop-color--${colorName.split("-")[0]}-border`
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
return DEFAULT_COLORS;
|
|
124
|
+
return CATEGORY_COLOR_TOKENS[category] || 'var(--color-ref-slate-500)';
|
|
92
125
|
}
|
|
93
126
|
/**
|
|
94
127
|
* Get category background color
|
|
@@ -96,15 +129,15 @@ export function getCategoryColors(category) {
|
|
|
96
129
|
* @returns The background color class
|
|
97
130
|
*/
|
|
98
131
|
export function getCategoryBackground(category) {
|
|
99
|
-
return getCategoryColors(category)
|
|
132
|
+
return getCategoryColors(category);
|
|
100
133
|
}
|
|
101
134
|
/**
|
|
102
|
-
* Get category accent color
|
|
135
|
+
* Get category accent color
|
|
103
136
|
* @param category - The node category
|
|
104
137
|
* @returns The accent color class
|
|
105
138
|
*/
|
|
106
139
|
export function getCategoryAccent(category) {
|
|
107
|
-
return getCategoryColors(category)
|
|
140
|
+
return getCategoryColors(category);
|
|
108
141
|
}
|
|
109
142
|
/**
|
|
110
143
|
* Get category text color
|
|
@@ -112,7 +145,7 @@ export function getCategoryAccent(category) {
|
|
|
112
145
|
* @returns The text color class
|
|
113
146
|
*/
|
|
114
147
|
export function getCategoryText(category) {
|
|
115
|
-
return getCategoryColors(category)
|
|
148
|
+
return getCategoryColors(category);
|
|
116
149
|
}
|
|
117
150
|
/**
|
|
118
151
|
* Get category border color
|
|
@@ -120,50 +153,56 @@ export function getCategoryText(category) {
|
|
|
120
153
|
* @returns The border color class
|
|
121
154
|
*/
|
|
122
155
|
export function getCategoryBorder(category) {
|
|
123
|
-
return getCategoryColors(category)
|
|
156
|
+
return getCategoryColors(category);
|
|
124
157
|
}
|
|
125
158
|
/**
|
|
126
|
-
* Get node colors based on category and
|
|
159
|
+
* Get node colors based on category and state
|
|
127
160
|
* @param category - The node category
|
|
128
|
-
* @param isError - Whether the node
|
|
161
|
+
* @param isError - Whether the node is in error state
|
|
129
162
|
* @param isProcessing - Whether the node is processing
|
|
130
163
|
* @param isSelected - Whether the node is selected
|
|
131
|
-
* @returns The color configuration
|
|
164
|
+
* @returns The color configuration object
|
|
132
165
|
*/
|
|
133
166
|
export function getNodeColors(category, isError = false, isProcessing = false, isSelected = false) {
|
|
167
|
+
const baseColor = getCategoryColors(category);
|
|
134
168
|
if (isError) {
|
|
135
169
|
return {
|
|
136
|
-
background:
|
|
137
|
-
accent:
|
|
138
|
-
text:
|
|
139
|
-
border:
|
|
170
|
+
background: 'var(--color-ref-red-50)',
|
|
171
|
+
accent: 'var(--color-ref-red-500)',
|
|
172
|
+
text: 'var(--color-ref-red-900)',
|
|
173
|
+
border: 'var(--color-ref-red-200)'
|
|
140
174
|
};
|
|
141
175
|
}
|
|
142
176
|
if (isProcessing) {
|
|
143
177
|
return {
|
|
144
|
-
background:
|
|
145
|
-
accent:
|
|
146
|
-
text:
|
|
147
|
-
border:
|
|
178
|
+
background: 'var(--color-ref-blue-50)',
|
|
179
|
+
accent: 'var(--color-ref-blue-500)',
|
|
180
|
+
text: 'var(--color-ref-blue-900)',
|
|
181
|
+
border: 'var(--color-ref-blue-200)'
|
|
148
182
|
};
|
|
149
183
|
}
|
|
150
184
|
if (isSelected) {
|
|
151
185
|
return {
|
|
152
|
-
background:
|
|
153
|
-
accent:
|
|
154
|
-
text:
|
|
155
|
-
border:
|
|
186
|
+
background: 'var(--color-ref-indigo-50)',
|
|
187
|
+
accent: 'var(--color-ref-indigo-500)',
|
|
188
|
+
text: 'var(--color-ref-indigo-900)',
|
|
189
|
+
border: 'var(--color-ref-indigo-200)'
|
|
156
190
|
};
|
|
157
191
|
}
|
|
158
|
-
return
|
|
192
|
+
return {
|
|
193
|
+
background: baseColor,
|
|
194
|
+
accent: baseColor,
|
|
195
|
+
text: 'var(--color-ref-slate-900)',
|
|
196
|
+
border: baseColor
|
|
197
|
+
};
|
|
159
198
|
}
|
|
160
199
|
/**
|
|
161
200
|
* Get node background color
|
|
162
201
|
* @param category - The node category
|
|
163
|
-
* @param isError - Whether the node
|
|
202
|
+
* @param isError - Whether the node is in error state
|
|
164
203
|
* @param isProcessing - Whether the node is processing
|
|
165
204
|
* @param isSelected - Whether the node is selected
|
|
166
|
-
* @returns The background color
|
|
205
|
+
* @returns The background color
|
|
167
206
|
*/
|
|
168
207
|
export function getNodeBackground(category, isError = false, isProcessing = false, isSelected = false) {
|
|
169
208
|
return getNodeColors(category, isError, isProcessing, isSelected).background;
|
|
@@ -171,10 +210,10 @@ export function getNodeBackground(category, isError = false, isProcessing = fals
|
|
|
171
210
|
/**
|
|
172
211
|
* Get node accent color
|
|
173
212
|
* @param category - The node category
|
|
174
|
-
* @param isError - Whether the node
|
|
213
|
+
* @param isError - Whether the node is in error state
|
|
175
214
|
* @param isProcessing - Whether the node is processing
|
|
176
215
|
* @param isSelected - Whether the node is selected
|
|
177
|
-
* @returns The accent color
|
|
216
|
+
* @returns The accent color
|
|
178
217
|
*/
|
|
179
218
|
export function getNodeAccent(category, isError = false, isProcessing = false, isSelected = false) {
|
|
180
219
|
return getNodeColors(category, isError, isProcessing, isSelected).accent;
|
|
@@ -182,10 +221,10 @@ export function getNodeAccent(category, isError = false, isProcessing = false, i
|
|
|
182
221
|
/**
|
|
183
222
|
* Get node text color
|
|
184
223
|
* @param category - The node category
|
|
185
|
-
* @param isError - Whether the node
|
|
224
|
+
* @param isError - Whether the node is in error state
|
|
186
225
|
* @param isProcessing - Whether the node is processing
|
|
187
226
|
* @param isSelected - Whether the node is selected
|
|
188
|
-
* @returns The text color
|
|
227
|
+
* @returns The text color
|
|
189
228
|
*/
|
|
190
229
|
export function getNodeText(category, isError = false, isProcessing = false, isSelected = false) {
|
|
191
230
|
return getNodeColors(category, isError, isProcessing, isSelected).text;
|
|
@@ -193,48 +232,74 @@ export function getNodeText(category, isError = false, isProcessing = false, isS
|
|
|
193
232
|
/**
|
|
194
233
|
* Get node border color
|
|
195
234
|
* @param category - The node category
|
|
196
|
-
* @param isError - Whether the node
|
|
235
|
+
* @param isError - Whether the node is in error state
|
|
197
236
|
* @param isProcessing - Whether the node is processing
|
|
198
237
|
* @param isSelected - Whether the node is selected
|
|
199
|
-
* @returns The border color
|
|
238
|
+
* @returns The border color
|
|
200
239
|
*/
|
|
201
240
|
export function getNodeBorder(category, isError = false, isProcessing = false, isSelected = false) {
|
|
202
241
|
return getNodeColors(category, isError, isProcessing, isSelected).border;
|
|
203
242
|
}
|
|
204
243
|
/**
|
|
205
|
-
*
|
|
206
|
-
*
|
|
207
|
-
|
|
208
|
-
export const dataTypeColors = {
|
|
209
|
-
string: "flowdrop-color--emerald",
|
|
210
|
-
text: "flowdrop-color--emerald",
|
|
211
|
-
number: "flowdrop-color--blue",
|
|
212
|
-
integer: "flowdrop-color--blue",
|
|
213
|
-
float: "flowdrop-color--blue",
|
|
214
|
-
boolean: "flowdrop-color--purple",
|
|
215
|
-
array: "flowdrop-color--amber",
|
|
216
|
-
list: "flowdrop-color--amber",
|
|
217
|
-
object: "flowdrop-color--orange",
|
|
218
|
-
json: "flowdrop-color--orange",
|
|
219
|
-
file: "flowdrop-color--red",
|
|
220
|
-
document: "flowdrop-color--red",
|
|
221
|
-
image: "flowdrop-color--pink",
|
|
222
|
-
picture: "flowdrop-color--pink",
|
|
223
|
-
audio: "flowdrop-color--indigo",
|
|
224
|
-
sound: "flowdrop-color--indigo",
|
|
225
|
-
video: "flowdrop-color--teal",
|
|
226
|
-
movie: "flowdrop-color--teal",
|
|
227
|
-
url: "flowdrop-color--cyan",
|
|
228
|
-
email: "flowdrop-color--cyan",
|
|
229
|
-
date: "flowdrop-color--lime",
|
|
230
|
-
datetime: "flowdrop-color--lime",
|
|
231
|
-
time: "flowdrop-color--lime"
|
|
232
|
-
};
|
|
233
|
-
/**
|
|
234
|
-
* Get data type color class
|
|
235
|
-
* @param dataType - The data type string
|
|
236
|
-
* @returns The color class for the data type
|
|
244
|
+
* Get data type color
|
|
245
|
+
* @param dataType - The data type
|
|
246
|
+
* @returns The color for the data type
|
|
237
247
|
*/
|
|
238
248
|
export function getDataTypeColor(dataType) {
|
|
239
|
-
return
|
|
249
|
+
return getDataTypeColorToken(dataType);
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Parse typed array notation and get display information
|
|
253
|
+
* @param dataType - The data type (e.g., "string[]", "number", "object[]")
|
|
254
|
+
* @returns Object with display information
|
|
255
|
+
*/
|
|
256
|
+
export function parseDataTypeDisplay(dataType) {
|
|
257
|
+
// Check if it's a typed array (ends with [])
|
|
258
|
+
const isArray = dataType.endsWith('[]');
|
|
259
|
+
if (isArray) {
|
|
260
|
+
const elementType = dataType.slice(0, -2); // Remove []
|
|
261
|
+
const config = getDataTypeConfig(dataType);
|
|
262
|
+
return {
|
|
263
|
+
baseType: dataType,
|
|
264
|
+
isArray: true,
|
|
265
|
+
displayName: config?.name || `${elementType}[]`,
|
|
266
|
+
elementType: elementType
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
else {
|
|
270
|
+
const config = getDataTypeConfig(dataType);
|
|
271
|
+
return {
|
|
272
|
+
baseType: dataType,
|
|
273
|
+
isArray: false,
|
|
274
|
+
displayName: config?.name || dataType
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Get formatted display text for a data type
|
|
280
|
+
* @param dataType - The data type
|
|
281
|
+
* @returns Formatted display text
|
|
282
|
+
*/
|
|
283
|
+
export function getDataTypeDisplayText(dataType) {
|
|
284
|
+
const parsed = parseDataTypeDisplay(dataType);
|
|
285
|
+
return parsed.displayName;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Check if a data type represents an array
|
|
289
|
+
* @param dataType - The data type
|
|
290
|
+
* @returns True if it's an array type
|
|
291
|
+
*/
|
|
292
|
+
export function isArrayDataType(dataType) {
|
|
293
|
+
return dataType.endsWith('[]') || dataType === 'array' || dataType === 'list';
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Get the element type from an array data type
|
|
297
|
+
* @param arrayDataType - The array data type (e.g., "string[]")
|
|
298
|
+
* @returns The element type (e.g., "string") or null if not an array
|
|
299
|
+
*/
|
|
300
|
+
export function getArrayElementType(arrayDataType) {
|
|
301
|
+
if (arrayDataType.endsWith('[]')) {
|
|
302
|
+
return arrayDataType.slice(0, -2);
|
|
303
|
+
}
|
|
304
|
+
return null;
|
|
240
305
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration utilities for FlowDrop Editor
|
|
3
|
+
*/
|
|
4
|
+
import type { WorkflowEditorConfig, EditorFeatures, UIConfig, APIConfig, ExecutionConfig, StorageConfig } from '../types/config.js';
|
|
5
|
+
import type { EndpointConfig } from '../config/endpoints.js';
|
|
6
|
+
/**
|
|
7
|
+
* Create default editor features configuration
|
|
8
|
+
*/
|
|
9
|
+
export declare function createDefaultFeatures(): EditorFeatures;
|
|
10
|
+
/**
|
|
11
|
+
* Create default UI configuration
|
|
12
|
+
*/
|
|
13
|
+
export declare function createDefaultUIConfig(): UIConfig;
|
|
14
|
+
/**
|
|
15
|
+
* Create default API configuration
|
|
16
|
+
*/
|
|
17
|
+
export declare function createDefaultAPIConfig(): APIConfig;
|
|
18
|
+
/**
|
|
19
|
+
* Create default execution configuration
|
|
20
|
+
*/
|
|
21
|
+
export declare function createDefaultExecutionConfig(): ExecutionConfig;
|
|
22
|
+
/**
|
|
23
|
+
* Create default storage configuration
|
|
24
|
+
*/
|
|
25
|
+
export declare function createDefaultStorageConfig(): StorageConfig;
|
|
26
|
+
/**
|
|
27
|
+
* Create default workflow editor configuration
|
|
28
|
+
*/
|
|
29
|
+
export declare function createDefaultConfig(endpointConfig?: EndpointConfig): WorkflowEditorConfig;
|
|
30
|
+
/**
|
|
31
|
+
* Merge configuration with defaults
|
|
32
|
+
*/
|
|
33
|
+
export declare function mergeConfig(userConfig: Partial<WorkflowEditorConfig>, defaultConfig: WorkflowEditorConfig): WorkflowEditorConfig;
|
|
34
|
+
/**
|
|
35
|
+
* Validate configuration
|
|
36
|
+
*/
|
|
37
|
+
export declare function validateConfig(config: WorkflowEditorConfig): string[];
|
|
38
|
+
/**
|
|
39
|
+
* Create configuration from environment variables
|
|
40
|
+
*/
|
|
41
|
+
export declare function createConfigFromEnv(): WorkflowEditorConfig;
|