@d34dman/flowdrop 0.0.19 โ†’ 0.0.20

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.
Files changed (2) hide show
  1. package/README.md +161 -345
  2. package/package.json +7 -2
package/README.md CHANGED
@@ -1,429 +1,245 @@
1
- # FlowDrop
1
+ <p align="center">
2
+ <img src="static/logo.svg" alt="FlowDrop" width="120" />
3
+ </p>
2
4
 
3
- A visual workflow editor component library built with Svelte 5 and @xyflow/svelte. Create complex workflows with drag-and-drop functionality, node-based editing, and configurable API integration.
5
+ <h1 align="center">FlowDrop</h1>
4
6
 
5
- ## ๐Ÿš€ Features
7
+ <p align="center">
8
+ <strong>Build beautiful workflow editors in minutes, not months.</strong>
9
+ </p>
6
10
 
7
- - **Visual Workflow Editor**: Drag-and-drop interface for building node-based workflows
8
- - **Svelte 5 Components**: Modern, reactive components with runes
9
- - **Configurable API Client**: Flexible endpoint configuration for backend integration
10
- - **Runtime Configuration**: Build once, deploy anywhere with environment variables
11
- - **Node System**: Extensible node types with customizable configuration
12
- - **Real-time Updates**: Live workflow state management with stores
13
- - **Framework Agnostic**: Can be integrated into any web application
14
- - **TypeScript Support**: Full type definitions included
15
- - **Docker Ready**: Production-ready Dockerfile and Docker Compose configuration
11
+ <p align="center">
12
+ An awesome workflow editor built with Svelte 5 and @xyflow/svelte.<br/>
13
+ You own the backend. You own the data. You own the orchestration.
14
+ </p>
16
15
 
17
- ### Enterprise Features (v0.0.16+)
16
+ <p align="center">
17
+ <a href="#quickstart">Quickstart</a> โ€ข
18
+ <a href="#features">Features</a> โ€ข
19
+ <a href="#integration">Integration</a> โ€ข
20
+ <a href="#documentation">Docs</a>
21
+ </p>
18
22
 
19
- - **Pluggable Authentication**: AuthProvider interface for OAuth, JWT, SSO integration
20
- - **Workflow Lifecycle Events**: Hooks for save, load, change, and unmount events
21
- - **Dirty State Tracking**: Monitor unsaved changes with reactive stores
22
- - **Draft Auto-Save**: Automatic localStorage drafts with configurable intervals
23
- - **Feature Flags**: Customize behavior for security and UX requirements
23
+ <p align="center">
24
+ <img src="static/FlowDrop-Screenshot.jpg" alt="FlowDrop Screenshot" width="800" />
25
+ </p>
26
+ <p align="center">
27
+ <em>Build AI-powered workflows with drag-and-drop simplicity. Connect nodes, configure inputs/outputs, and visualize your entire pipeline.</em>
28
+ </p>
24
29
 
25
- ## ๐Ÿ“ฆ Installation
30
+ ## Why FlowDrop?
26
31
 
27
- ```bash
28
- npm install @d34dman/flowdrop
29
- ```
32
+ Most workflow tools are SaaS platforms that lock you in. Your data lives on their servers. Your execution logic runs in their cloud. You pay per workflow, per user, per run.
30
33
 
31
- ## ๐Ÿ“ Project Structure
32
-
33
- ```
34
- @d34dman/flowdrop/
35
- โ”œโ”€โ”€ dist/ # Built library files
36
- โ”‚ โ”œโ”€โ”€ components/ # Svelte components
37
- โ”‚ โ”œโ”€โ”€ types/ # TypeScript definitions
38
- โ”‚ โ”œโ”€โ”€ services/ # API and state management
39
- โ”‚ โ”œโ”€โ”€ utils/ # Utility functions
40
- โ”‚ โ””โ”€โ”€ styles/ # CSS styles
41
- โ”œโ”€โ”€ src/ # Source code
42
- โ”‚ โ””โ”€โ”€ lib/ # Library source
43
- โ”‚ โ”œโ”€โ”€ components/ # Svelte components
44
- โ”‚ โ”œโ”€โ”€ services/ # Services and APIs
45
- โ”‚ โ”œโ”€โ”€ stores/ # State management
46
- โ”‚ โ””โ”€โ”€ types/ # Type definitions
47
- โ””โ”€โ”€ api/ # API documentation
48
- ```
34
+ **FlowDrop is different.**
49
35
 
50
- ## ๐ŸŽฏ Usage
36
+ FlowDrop is a pure visual editor. You implement the backend. You control the orchestration. Your workflows run on your infrastructure, with your security policies, at your scale.
51
37
 
52
- ### Basic Import
38
+ No vendor lock-in. No data leaving your walls. No surprise bills.
53
39
 
54
- ```javascript
55
- import { WorkflowEditor } from '@d34dman/flowdrop';
56
- import '@d34dman/flowdrop/styles/base.css';
40
+ ```bash
41
+ npm install @d34dman/flowdrop
57
42
  ```
58
43
 
59
- ### Using the WorkflowEditor Component
44
+ You get a production-ready workflow UI. You keep full control of everything else.
45
+
46
+
47
+ ## Quickstart
60
48
 
61
49
  ```svelte
62
50
  <script lang="ts">
63
- import { WorkflowEditor } from '@d34dman/flowdrop';
64
- import type { NodeMetadata, Workflow } from '@d34dman/flowdrop';
65
-
66
- let nodes: NodeMetadata[] = [
67
- {
68
- id: 'text_input',
69
- name: 'Text Input',
70
- category: 'input_output',
71
- description: 'User input field',
72
- inputs: [],
73
- outputs: [{ id: 'value', name: 'Value', type: 'output', dataType: 'string' }]
74
- }
75
- ];
76
-
77
- let workflow: Workflow = {
78
- id: 'workflow_1',
79
- name: 'My Workflow',
80
- nodes: [],
81
- edges: []
82
- };
51
+ import { WorkflowEditor } from "@d34dman/flowdrop";
52
+ import "@d34dman/flowdrop/styles/base.css";
83
53
  </script>
84
54
 
85
- <WorkflowEditor {nodes} />
55
+ <WorkflowEditor />
86
56
  ```
87
57
 
88
- ### Integration Methods
58
+ **5 lines. One fully-functional workflow editor.**
89
59
 
90
- #### 1. As a Svelte Component (Recommended)
60
+
61
+ ## Features
62
+
63
+ | | |
64
+ | --------------------------- | ------------------------------------------------------------------------- |
65
+ | ๐ŸŽจ **Visual Editor Only** | Pure UI component. No hidden backend, no external dependencies |
66
+ | ๐Ÿ” **You Own Everything** | Your data, your servers, your orchestration logic, your security policies |
67
+ | ๐Ÿ”Œ **Backend Agnostic** | Connect to any API: Drupal, Laravel, Express, FastAPI, or your own |
68
+ | ๐Ÿงฉ **7 Built-in Node Types** | From simple icons to complex gateway logic |
69
+ | ๐ŸŽญ **Framework Flexible** | Use as Svelte component or mount into React, Vue, Angular, or vanilla JS |
70
+ | ๐Ÿณ **Deploy Anywhere** | Runtime config means build once, deploy everywhere |
71
+
72
+
73
+ ## Node Types
74
+
75
+ FlowDrop ships with 7 beautifully designed node types:
76
+
77
+ | Type | Purpose |
78
+ | ---------- | --------------------------------------- |
79
+ | `default` | Full-featured nodes with inputs/outputs |
80
+ | `simple` | Compact, space-efficient layout |
81
+ | `square` | Icon-only minimal design |
82
+ | `tool` | AI agent tool nodes |
83
+ | `gateway` | Conditional branching logic |
84
+ | `terminal` | Start/end workflow points |
85
+ | `note` | Markdown documentation blocks |
86
+
87
+ <p align="center">
88
+ <img src="static/Node-Types.jpg" alt="FlowDrop Node Types" width="800" />
89
+ </p>
90
+ <p align="center">
91
+ <em>From simple triggers to complex branching logic, each node type is designed for specific workflow patterns.</em>
92
+ </p>
93
+
94
+ ## Integration
95
+
96
+ ### Svelte (Native)
91
97
 
92
98
  ```svelte
93
99
  <script>
94
- import { WorkflowEditor, NodeSidebar } from '@d34dman/flowdrop';
100
+ import { WorkflowEditor, NodeSidebar } from "@d34dman/flowdrop";
95
101
  </script>
96
102
 
97
- <div class="editor-container">
98
- <NodeSidebar {nodes} />
99
- <WorkflowEditor {nodes} />
103
+ <div class="flex h-screen">
104
+ <NodeSidebar {nodes} />
105
+ <WorkflowEditor {nodes} />
100
106
  </div>
101
107
  ```
102
108
 
103
- #### 2. Using Mount Functions (Vanilla JS/Other Frameworks)
109
+ ### Vanilla JS / React / Vue / Angular
104
110
 
105
111
  ```javascript
106
- import { mountWorkflowEditor } from '@d34dman/flowdrop';
107
-
108
- const container = document.getElementById('workflow-container');
109
- const editor = mountWorkflowEditor(container, {
110
- nodes: availableNodes,
111
- endpointConfig: {
112
- baseUrl: '/api/flowdrop',
113
- endpoints: {
114
- workflows: {
115
- list: '/workflows',
116
- get: '/workflows/{id}',
117
- create: '/workflows',
118
- update: '/workflows/{id}'
119
- }
120
- }
121
- }
112
+ import { mountFlowDropApp, createEndpointConfig } from "@d34dman/flowdrop";
113
+
114
+ const app = await mountFlowDropApp(document.getElementById("editor"), {
115
+ workflow: myWorkflow,
116
+ endpointConfig: createEndpointConfig("/api/flowdrop"),
117
+ eventHandlers: {
118
+ onDirtyStateChange: (isDirty) => console.log("Unsaved changes:", isDirty),
119
+ onAfterSave: (workflow) => console.log("Saved!", workflow)
120
+ }
122
121
  });
123
122
 
124
- // Cleanup
125
- editor.destroy();
123
+ // Full control over the editor
124
+ app.save();
125
+ app.getWorkflow();
126
+ app.destroy();
126
127
  ```
127
128
 
128
- #### 3. Enterprise Integration (v0.0.16+)
129
+ ### Enterprise Integration
129
130
 
130
131
  ```javascript
131
- import { mountFlowDropApp, createEndpointConfig, CallbackAuthProvider } from '@d34dman/flowdrop';
132
+ import { mountFlowDropApp, CallbackAuthProvider } from "@d34dman/flowdrop";
132
133
 
133
134
  const app = await mountFlowDropApp(container, {
134
- workflow: myWorkflow,
135
- endpointConfig: createEndpointConfig('/api/flowdrop'),
136
-
137
- // Dynamic authentication with token refresh
138
- authProvider: new CallbackAuthProvider({
139
- getToken: () => authService.getAccessToken(),
140
- onUnauthorized: () => authService.refreshToken()
141
- }),
142
-
143
- // Workflow lifecycle hooks
144
- eventHandlers: {
145
- onDirtyStateChange: (isDirty) => updateSaveButton(isDirty),
146
- onAfterSave: (workflow) => showSuccess('Saved!'),
147
- onBeforeUnmount: (workflow, isDirty) => {
148
- if (isDirty) saveDraft(workflow);
149
- }
150
- },
151
-
152
- // Feature configuration
153
- features: {
154
- autoSaveDraft: true,
155
- autoSaveDraftInterval: 30000,
156
- showToasts: true
157
- }
135
+ // Dynamic token refresh
136
+ authProvider: new CallbackAuthProvider({
137
+ getToken: () => authService.getAccessToken(),
138
+ onUnauthorized: () => authService.refreshToken()
139
+ }),
140
+
141
+ // Lifecycle hooks
142
+ eventHandlers: {
143
+ onBeforeUnmount: (workflow, isDirty) => {
144
+ if (isDirty) saveDraft(workflow);
145
+ }
146
+ },
147
+
148
+ // Auto-save, toasts, and more
149
+ features: {
150
+ autoSaveDraft: true,
151
+ autoSaveDraftInterval: 30000
152
+ }
158
153
  });
159
-
160
- // Access instance methods
161
- if (app.isDirty()) {
162
- await app.save();
163
- }
164
-
165
- // Get current workflow data
166
- const workflow = app.getWorkflow();
167
-
168
- // Cleanup
169
- app.destroy();
170
- ```
171
-
172
- #### 3. Integration with Backend Frameworks
173
-
174
- ##### Drupal Example
175
-
176
- ```javascript
177
- Drupal.behaviors.flowdropEditor = {
178
- attach: function (context, settings) {
179
- const container = context.querySelector('.flowdrop-container');
180
- if (container && window.FlowDrop) {
181
- window.FlowDrop.mountWorkflowEditor(container, {
182
- endpointConfig: settings.flowdrop.endpointConfig,
183
- nodes: settings.flowdrop.nodes
184
- });
185
- }
186
- }
187
- };
188
154
  ```
189
155
 
190
- ## ๐Ÿ“š Core Components
191
-
192
- ### WorkflowEditor
193
-
194
- Main editor component for creating and editing workflows.
195
-
196
- **Props:**
197
-
198
- - `nodes`: Array of available node types
199
- - `endpointConfig`: API endpoint configuration
200
- - `height`: Editor height (default: "100vh")
201
- - `width`: Editor width (default: "100%")
202
- - `lockWorkflow`: Disable editing
203
- - `readOnly`: Read-only mode
204
-
205
- ### NodeSidebar
206
-
207
- Sidebar displaying available node types.
208
-
209
- **Props:**
210
-
211
- - `nodes`: Array of node types to display
212
-
213
- ### ConfigSidebar
214
-
215
- Configuration panel for selected nodes.
216
156
 
217
- **Props:**
157
+ ## API Configuration
218
158
 
219
- - `isOpen`: Sidebar visibility
220
- - `configSchema`: JSON schema for configuration
221
- - `configValues`: Current configuration values
222
- - `onSave`: Save handler
223
- - `onClose`: Close handler
224
-
225
- ## ๐Ÿ”ง API Configuration
226
-
227
- Configure the API client to connect to your backend:
159
+ Connect to any backend in seconds:
228
160
 
229
161
  ```typescript
230
- import { createEndpointConfig } from '@d34dman/flowdrop';
162
+ import { createEndpointConfig } from "@d34dman/flowdrop";
231
163
 
232
164
  const config = createEndpointConfig({
233
- baseUrl: 'https://api.example.com',
234
- endpoints: {
235
- nodes: {
236
- list: '/nodes',
237
- get: '/nodes/{id}'
238
- },
239
- workflows: {
240
- list: '/workflows',
241
- get: '/workflows/{id}',
242
- create: '/workflows',
243
- update: '/workflows/{id}',
244
- delete: '/workflows/{id}',
245
- execute: '/workflows/{id}/execute'
246
- }
247
- },
248
- timeout: 30000,
249
- auth: {
250
- type: 'bearer',
251
- token: 'your-token'
252
- }
165
+ baseUrl: "https://api.example.com",
166
+ endpoints: {
167
+ nodes: { list: "/nodes", get: "/nodes/{id}" },
168
+ workflows: {
169
+ list: "/workflows",
170
+ get: "/workflows/{id}",
171
+ create: "/workflows",
172
+ update: "/workflows/{id}",
173
+ execute: "/workflows/{id}/execute"
174
+ }
175
+ },
176
+ auth: { type: "bearer", token: "your-token" }
253
177
  });
254
178
  ```
255
179
 
256
- ## ๐ŸŽจ Customization
257
180
 
258
- ### Styling
181
+ ## Customization
259
182
 
260
- Override CSS custom properties:
183
+ Make it yours with CSS custom properties:
261
184
 
262
185
  ```css
263
186
  :root {
264
- --flowdrop-background-color: #f9fafb;
265
- --flowdrop-primary-color: #3b82f6;
266
- --flowdrop-border-color: #e5e7eb;
267
- --flowdrop-text-color: #1f2937;
187
+ --flowdrop-background-color: #0a0a0a;
188
+ --flowdrop-primary-color: #6366f1;
189
+ --flowdrop-border-color: #27272a;
190
+ --flowdrop-text-color: #fafafa;
268
191
  }
269
192
  ```
270
193
 
271
- ### Node Types
272
-
273
- FlowDrop includes 7 built-in visual node types that control how nodes are rendered:
274
-
275
- | Type | Description | Use Case |
276
- | ---------- | ------------------------------------------------------- | ------------------------ |
277
- | `default` | Full-featured workflow node with inputs/outputs display | Standard nodes |
278
- | `simple` | Compact layout with header, icon, and description | Space-efficient nodes |
279
- | `square` | Minimal square node showing only an icon | Icon-only representation |
280
- | `tool` | Specialized node for agent tools with tool metadata | AI agent tools |
281
- | `gateway` | Branching control flow with multiple output branches | Conditional logic |
282
- | `terminal` | Circular node for workflow start/end/exit points | Workflow boundaries |
283
- | `note` | Documentation note with markdown support | Comments/documentation |
284
-
285
- #### Terminal Nodes
286
-
287
- Terminal nodes are special circular nodes for workflow boundaries:
288
-
289
- ```typescript
290
- // Start node - output only
291
- const startNode: NodeMetadata = {
292
- id: 'workflow-start',
293
- name: 'Start',
294
- type: 'terminal',
295
- tags: ['start'],
296
- inputs: [],
297
- outputs: [{ id: 'trigger', name: 'Go', type: 'output', dataType: 'trigger' }]
298
- };
299
-
300
- // End node - input only
301
- const endNode: NodeMetadata = {
302
- id: 'workflow-end',
303
- name: 'End',
304
- type: 'terminal',
305
- tags: ['end'],
306
- inputs: [{ id: 'done', name: 'Done', type: 'input', dataType: 'trigger' }],
307
- outputs: []
308
- };
309
- ```
310
-
311
194
 
312
- ## ๐Ÿ”Œ Backend Integration
195
+ ## Deploy
313
196
 
314
- FlowDrop is backend-agnostic. Implement the API endpoints expected by the client:
315
-
316
- ### Required Endpoints
317
-
318
- - `GET /api/nodes` - List available node types
319
- - `GET /api/workflows` - List workflows
320
- - `GET /api/workflows/{id}` - Get workflow
321
- - `POST /api/workflows` - Create workflow
322
- - `PUT /api/workflows/{id}` - Update workflow
323
- - `DELETE /api/workflows/{id}` - Delete workflow
324
- - `POST /api/workflows/{id}/execute` - Execute workflow
325
-
326
- See `API.md` for detailed endpoint specifications.
327
-
328
- ## ๐Ÿงช Testing
197
+ ### Docker (Recommended)
329
198
 
330
199
  ```bash
331
- # Unit tests
332
- npm run test:unit
333
-
334
- # E2E tests
335
- npm run test:e2e
336
-
337
- # All tests
338
- npm test
200
+ cp env.example .env
201
+ docker-compose up -d
339
202
  ```
340
203
 
341
- ## ๐Ÿ› ๏ธ Development
204
+ ### Node.js
342
205
 
343
206
  ```bash
344
- # Install dependencies
345
- npm install
346
-
347
- # Development server
348
- npm run dev
349
-
350
- # Build library
351
207
  npm run build
352
-
353
- # Build for production
354
- npm run build:production
355
-
356
- # Linting
357
- npm run lint
358
-
359
- # Format code
360
- npm run format
208
+ FLOWDROP_API_BASE_URL=http://your-backend/api node build
361
209
  ```
362
210
 
363
- ## ๐Ÿ“– Documentation
364
-
365
- - **API.md** - REST API specification
366
- - **CHANGELOG.md** - Version history
367
-
368
- ## ๐Ÿค Contributing
211
+ Runtime configuration means you build once and deploy to staging, production, or anywhere else with just environment variables.
369
212
 
370
- Not accepting contributions until the library stabilizes. Stay tuned.
371
213
 
372
- ## ๐Ÿ“„ License
373
214
 
374
- MIT
215
+ ## Documentation
375
216
 
376
- ## ๐Ÿ†˜ Support
217
+ | Resource | Description |
218
+ | ---------------------------------- | ------------------------ |
219
+ | [API.md](./API.md) | REST API specification |
220
+ | [DOCKER.md](./DOCKER.md) | Docker deployment guide |
221
+ | [QUICK_START.md](./QUICK_START.md) | Get running in 5 minutes |
222
+ | [CHANGELOG.md](./CHANGELOG.md) | Version history |
377
223
 
378
- - Check the API documentation in `API.md`
379
- - Create an issue in the project repository
380
- - Review the examples in `src/lib/examples/`
381
-
382
- ## ๐Ÿšข Deployment
383
-
384
- FlowDrop uses **runtime configuration** instead of build-time environment variables, allowing you to build once and deploy to multiple environments.
385
-
386
- ### Quick Start with Docker
224
+ ## Development
387
225
 
388
226
  ```bash
389
- # Copy environment file
390
- cp env.example .env
391
-
392
- # Edit .env with your configuration
393
- # Set FLOWDROP_API_BASE_URL to your backend API URL
394
-
395
- # Start with Docker Compose
396
- docker-compose up -d
227
+ npm install # Install dependencies
228
+ npm run dev # Start dev server
229
+ npm run build # Build library
230
+ npm test # Run all tests
397
231
  ```
398
232
 
399
- ### Environment Variables
400
-
401
- **Production (Runtime):**
402
-
403
- - `FLOWDROP_API_BASE_URL` - Backend API URL
404
- - `FLOWDROP_THEME` - UI theme (light/dark/auto)
405
- - `FLOWDROP_TIMEOUT` - Request timeout in milliseconds
406
- - `FLOWDROP_AUTH_TYPE` - Authentication type (none/bearer/api_key/custom)
407
- - `FLOWDROP_AUTH_TOKEN` - Authentication token
408
-
409
- ### Build for Production
410
233
 
411
- ```bash
412
- # Install dependencies
413
- npm ci
414
-
415
- # Build the application
416
- npm run build
417
-
418
- # Set environment variables and start
419
- export FLOWDROP_API_BASE_URL=http://your-backend:8080/api/flowdrop
420
- node build
421
- ```
234
+ ## Contributing
422
235
 
423
- For detailed deployment instructions, see:
236
+ FlowDrop is stabilizing. Contributions will open soon. Star the repo to stay updated.
424
237
 
425
- - [DOCKER.md](./DOCKER.md) - Docker quick start
426
238
 
427
- ---
239
+ <p align="center">
240
+ <strong>FlowDrop</strong> - The visual workflow editor you own completely
241
+ </p>
428
242
 
429
- **FlowDrop** - Visual workflow editing for modern web applications
243
+ <p align="center">
244
+ Built with โค๏ธ Svelte 5 and @xyflow/svelte
245
+ </p>
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.19",
5
+ "version": "0.0.20",
6
6
  "scripts": {
7
7
  "dev": "vite dev",
8
8
  "build": "vite build && npm run prepack",
@@ -99,7 +99,7 @@
99
99
  "@storybook/sveltekit": "^9.0.15",
100
100
  "@sveltejs/adapter-auto": "^6.0.0",
101
101
  "@sveltejs/adapter-node": "^5.4.0",
102
- "@sveltejs/kit": "^2.16.0",
102
+ "@sveltejs/kit": "^2.49.2",
103
103
  "@sveltejs/package": "^2.0.0",
104
104
  "@sveltejs/vite-plugin-svelte": "^5.0.0",
105
105
  "@types/marked": "^6.0.0",
@@ -127,6 +127,11 @@
127
127
  "vitest": "^3.2.3",
128
128
  "vitest-browser-svelte": "^0.1.0"
129
129
  },
130
+ "overrides": {
131
+ "@sveltejs/kit": {
132
+ "cookie": "0.7.2"
133
+ }
134
+ },
130
135
  "keywords": [
131
136
  "svelte"
132
137
  ],