@d34dman/flowdrop 0.0.4 → 0.0.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/README.md +107 -104
- package/dist/components/App.svelte +67 -64
- package/dist/components/App.svelte.d.ts +1 -0
- package/dist/components/Navbar.svelte +1 -11
- package/dist/components/NodeSidebar.svelte +2 -1
- package/dist/components/NodeStatusOverlay.svelte +0 -1
- package/dist/components/NodeStatusOverlay.svelte.d.ts +0 -1
- package/dist/components/PipelineStatus.svelte +0 -37
- package/dist/components/SimpleNode.svelte +0 -7
- package/dist/components/SquareNode.svelte +0 -7
- package/dist/components/UniversalNode.svelte +0 -8
- package/dist/components/WorkflowEditor.svelte +63 -456
- package/dist/components/WorkflowNode.svelte +1 -8
- package/dist/config/apiConfig.d.ts +2 -1
- package/dist/config/apiConfig.js +3 -2
- package/dist/helpers/workflowEditorHelper.d.ts +87 -0
- package/dist/helpers/workflowEditorHelper.js +365 -0
- package/dist/index.d.ts +31 -1
- package/dist/index.js +30 -1
- package/dist/mocks/app-navigation.d.ts +4 -4
- package/dist/mocks/app-navigation.js +4 -4
- package/dist/services/api.js +13 -18
- package/dist/services/globalSave.js +12 -12
- package/dist/svelte-app.js +2 -3
- package/dist/utils/config.d.ts +5 -1
- package/dist/utils/config.js +9 -17
- package/package.json +2 -1
|
@@ -26,23 +26,23 @@ async function ensureApiConfiguration() {
|
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
catch
|
|
29
|
+
catch {
|
|
30
30
|
// Could not check existing API configuration, initializing
|
|
31
31
|
}
|
|
32
32
|
// API configuration is not initialized, so let's initialize it
|
|
33
|
-
// Use
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
import.meta.env.VITE_FLOWDROP_API_URL ||
|
|
38
|
-
(() => {
|
|
39
|
-
// If we're in development (localhost:5173), use relative path
|
|
33
|
+
// Use runtime detection to determine appropriate API base URL
|
|
34
|
+
const apiBaseUrl = (() => {
|
|
35
|
+
// If we're in development (localhost:5173), use relative path
|
|
36
|
+
if (typeof window !== 'undefined') {
|
|
40
37
|
if (window.location.hostname === 'localhost' && window.location.port === '5173') {
|
|
41
38
|
return '/api/flowdrop';
|
|
42
39
|
}
|
|
43
40
|
// Otherwise, use the current domain
|
|
44
41
|
return `${window.location.protocol}//${window.location.host}/api/flowdrop`;
|
|
45
|
-
}
|
|
42
|
+
}
|
|
43
|
+
// Fallback to relative path
|
|
44
|
+
return '/api/flowdrop';
|
|
45
|
+
})();
|
|
46
46
|
const config = createEndpointConfig(apiBaseUrl, {
|
|
47
47
|
auth: {
|
|
48
48
|
type: 'none' // No authentication for now
|
|
@@ -96,7 +96,7 @@ export async function globalSaveWorkflow() {
|
|
|
96
96
|
updatedAt: new Date().toISOString()
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
|
-
|
|
99
|
+
await workflowApi.saveWorkflow(finalWorkflow);
|
|
100
100
|
// Dismiss loading toast and show success toast
|
|
101
101
|
if (loadingToast)
|
|
102
102
|
dismissToast(loadingToast);
|
|
@@ -157,9 +157,9 @@ export async function globalExportWorkflow() {
|
|
|
157
157
|
*/
|
|
158
158
|
export function initializeGlobalSave() {
|
|
159
159
|
if (typeof window !== 'undefined') {
|
|
160
|
-
// @ts-
|
|
160
|
+
// @ts-expect-error - Adding to window for external access
|
|
161
161
|
window.flowdropGlobalSave = globalSaveWorkflow;
|
|
162
|
-
// @ts-
|
|
162
|
+
// @ts-expect-error - Adding to window for external access
|
|
163
163
|
window.flowdropGlobalExport = globalExportWorkflow;
|
|
164
164
|
}
|
|
165
165
|
}
|
package/dist/svelte-app.js
CHANGED
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
import { mount } from 'svelte';
|
|
7
7
|
import WorkflowEditor from './components/WorkflowEditor.svelte';
|
|
8
8
|
import App from './components/App.svelte';
|
|
9
|
-
import { createEndpointConfig } from './config/endpoints.js';
|
|
10
9
|
import { initializePortCompatibility } from './utils/connections.js';
|
|
11
10
|
import { DEFAULT_PORT_CONFIG } from './config/defaultPortConfig.js';
|
|
12
11
|
import { fetchPortConfig } from './services/portConfigApi.js';
|
|
@@ -17,7 +16,7 @@ import { fetchPortConfig } from './services/portConfigApi.js';
|
|
|
17
16
|
* @param options - Configuration options for the app
|
|
18
17
|
*/
|
|
19
18
|
export async function mountFlowDropApp(container, options = {}) {
|
|
20
|
-
const { workflow,
|
|
19
|
+
const { workflow, endpointConfig, portConfig, height = '100vh', width = '100%', showNavbar = false, disableSidebar, lockWorkflow, readOnly, nodeStatuses, pipelineId, navbarTitle, navbarActions } = options;
|
|
21
20
|
// Create endpoint configuration
|
|
22
21
|
let config;
|
|
23
22
|
if (endpointConfig) {
|
|
@@ -94,7 +93,7 @@ export async function mountFlowDropApp(container, options = {}) {
|
|
|
94
93
|
* Simpler alternative to mountFlowDropApp - only mounts the editor without navbar
|
|
95
94
|
*/
|
|
96
95
|
export async function mountWorkflowEditor(container, options = {}) {
|
|
97
|
-
const {
|
|
96
|
+
const { nodes = [], endpointConfig, portConfig } = options;
|
|
98
97
|
// Create endpoint configuration
|
|
99
98
|
let config;
|
|
100
99
|
if (endpointConfig) {
|
package/dist/utils/config.d.ts
CHANGED
|
@@ -36,6 +36,10 @@ export declare function mergeConfig(userConfig: Partial<WorkflowEditorConfig>, d
|
|
|
36
36
|
*/
|
|
37
37
|
export declare function validateConfig(config: WorkflowEditorConfig): string[];
|
|
38
38
|
/**
|
|
39
|
-
* Create configuration
|
|
39
|
+
* Create default configuration
|
|
40
|
+
* For library usage, all configuration should be provided at runtime
|
|
41
|
+
* This function is kept for backward compatibility but returns defaults
|
|
42
|
+
*
|
|
43
|
+
* @deprecated Use createDefaultConfig() instead and pass runtime configuration
|
|
40
44
|
*/
|
|
41
45
|
export declare function createConfigFromEnv(): WorkflowEditorConfig;
|
package/dist/utils/config.js
CHANGED
|
@@ -225,24 +225,16 @@ export function validateConfig(config) {
|
|
|
225
225
|
return errors;
|
|
226
226
|
}
|
|
227
227
|
/**
|
|
228
|
-
* Create configuration
|
|
228
|
+
* Create default configuration
|
|
229
|
+
* For library usage, all configuration should be provided at runtime
|
|
230
|
+
* This function is kept for backward compatibility but returns defaults
|
|
231
|
+
*
|
|
232
|
+
* @deprecated Use createDefaultConfig() instead and pass runtime configuration
|
|
229
233
|
*/
|
|
230
234
|
export function createConfigFromEnv() {
|
|
231
|
-
|
|
235
|
+
// Return default configuration without environment variables
|
|
236
|
+
// Configuration should be provided at runtime via props/parameters
|
|
237
|
+
const apiBaseUrl = '/api/flowdrop';
|
|
232
238
|
const endpointConfig = createEndpointConfig(apiBaseUrl);
|
|
233
|
-
|
|
234
|
-
// Override with environment variables
|
|
235
|
-
if (import.meta.env.VITE_FLOWDROP_THEME) {
|
|
236
|
-
config.theme = import.meta.env.VITE_FLOWDROP_THEME;
|
|
237
|
-
}
|
|
238
|
-
if (import.meta.env.VITE_FLOWDROP_TIMEOUT) {
|
|
239
|
-
config.api.timeout = parseInt(import.meta.env.VITE_FLOWDROP_TIMEOUT);
|
|
240
|
-
}
|
|
241
|
-
if (import.meta.env.VITE_FLOWDROP_AUTH_TYPE) {
|
|
242
|
-
config.api.auth.type = import.meta.env.VITE_FLOWDROP_AUTH_TYPE;
|
|
243
|
-
}
|
|
244
|
-
if (import.meta.env.VITE_FLOWDROP_AUTH_TOKEN) {
|
|
245
|
-
config.api.auth.token = import.meta.env.VITE_FLOWDROP_AUTH_TOKEN;
|
|
246
|
-
}
|
|
247
|
-
return config;
|
|
239
|
+
return createDefaultConfig(endpointConfig);
|
|
248
240
|
}
|
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.6",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "vite dev",
|
|
8
8
|
"build": "vite build && npm run prepack",
|
|
@@ -80,6 +80,7 @@
|
|
|
80
80
|
"./styles/base.css": "./dist/styles/base.css"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
83
|
+
"@sveltejs/kit": "^2.0.0",
|
|
83
84
|
"svelte": "^5.0.0"
|
|
84
85
|
},
|
|
85
86
|
"devDependencies": {
|