@d34dman/flowdrop 0.0.25 → 0.0.27

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 (40) hide show
  1. package/README.md +52 -62
  2. package/dist/components/App.svelte +12 -2
  3. package/dist/components/ConfigForm.svelte +500 -9
  4. package/dist/components/ConfigForm.svelte.d.ts +2 -0
  5. package/dist/components/ConfigModal.svelte +4 -70
  6. package/dist/components/ConfigPanel.svelte +4 -9
  7. package/dist/components/EdgeRefresher.svelte +41 -0
  8. package/dist/components/EdgeRefresher.svelte.d.ts +9 -0
  9. package/dist/components/ReadOnlyDetails.svelte +3 -1
  10. package/dist/components/UniversalNode.svelte +6 -3
  11. package/dist/components/WorkflowEditor.svelte +30 -0
  12. package/dist/components/WorkflowEditor.svelte.d.ts +3 -1
  13. package/dist/components/form/FormCheckboxGroup.svelte +2 -9
  14. package/dist/components/form/FormField.svelte +1 -12
  15. package/dist/components/form/FormFieldWrapper.svelte +2 -10
  16. package/dist/components/form/FormFieldWrapper.svelte.d.ts +1 -1
  17. package/dist/components/form/FormMarkdownEditor.svelte +0 -2
  18. package/dist/components/form/FormNumberField.svelte +5 -6
  19. package/dist/components/form/FormRangeField.svelte +3 -13
  20. package/dist/components/form/FormSelect.svelte +4 -5
  21. package/dist/components/form/FormSelect.svelte.d.ts +1 -1
  22. package/dist/components/form/FormTextField.svelte +3 -4
  23. package/dist/components/form/FormTextarea.svelte +3 -4
  24. package/dist/components/form/FormToggle.svelte +2 -3
  25. package/dist/components/form/index.d.ts +14 -14
  26. package/dist/components/form/index.js +14 -14
  27. package/dist/components/form/types.d.ts +2 -2
  28. package/dist/components/form/types.js +1 -1
  29. package/dist/components/nodes/NotesNode.svelte +39 -45
  30. package/dist/components/nodes/NotesNode.svelte.d.ts +1 -1
  31. package/dist/components/nodes/SimpleNode.svelte +92 -142
  32. package/dist/components/nodes/SquareNode.svelte +75 -58
  33. package/dist/components/nodes/WorkflowNode.svelte +1 -3
  34. package/dist/index.d.ts +3 -1
  35. package/dist/index.js +2 -0
  36. package/dist/services/dynamicSchemaService.d.ts +108 -0
  37. package/dist/services/dynamicSchemaService.js +445 -0
  38. package/dist/styles/base.css +1 -1
  39. package/dist/types/index.d.ts +213 -0
  40. package/package.json +163 -155
package/README.md CHANGED
@@ -51,13 +51,12 @@ npm install @d34dman/flowdrop
51
51
 
52
52
  You get a production-ready workflow UI. You keep full control of everything else.
53
53
 
54
-
55
54
  ## Quickstart
56
55
 
57
56
  ```svelte
58
57
  <script lang="ts">
59
- import { WorkflowEditor } from "@d34dman/flowdrop";
60
- import "@d34dman/flowdrop/styles/base.css";
58
+ import { WorkflowEditor } from '@d34dman/flowdrop';
59
+ import '@d34dman/flowdrop/styles/base.css';
61
60
  </script>
62
61
 
63
62
  <WorkflowEditor />
@@ -65,11 +64,10 @@ You get a production-ready workflow UI. You keep full control of everything else
65
64
 
66
65
  **5 lines. One fully-functional workflow editor.**
67
66
 
68
-
69
67
  ## Features
70
68
 
71
- | | |
72
- | --------------------------- | ------------------------------------------------------------------------- |
69
+ | | |
70
+ | ---------------------------- | ------------------------------------------------------------------------- |
73
71
  | 🎨 **Visual Editor Only** | Pure UI component. No hidden backend, no external dependencies |
74
72
  | 🔐 **You Own Everything** | Your data, your servers, your orchestration logic, your security policies |
75
73
  | 🔌 **Backend Agnostic** | Connect to any API: Drupal, Laravel, Express, FastAPI, or your own |
@@ -77,7 +75,6 @@ You get a production-ready workflow UI. You keep full control of everything else
77
75
  | 🎭 **Framework Flexible** | Use as Svelte component or mount into React, Vue, Angular, or vanilla JS |
78
76
  | 🐳 **Deploy Anywhere** | Runtime config means build once, deploy everywhere |
79
77
 
80
-
81
78
  ## Node Types
82
79
 
83
80
  FlowDrop ships with 7 beautifully designed node types:
@@ -105,27 +102,27 @@ FlowDrop ships with 7 beautifully designed node types:
105
102
 
106
103
  ```svelte
107
104
  <script>
108
- import { WorkflowEditor, NodeSidebar } from "@d34dman/flowdrop";
105
+ import { WorkflowEditor, NodeSidebar } from '@d34dman/flowdrop';
109
106
  </script>
110
107
 
111
108
  <div class="flex h-screen">
112
- <NodeSidebar {nodes} />
113
- <WorkflowEditor {nodes} />
109
+ <NodeSidebar {nodes} />
110
+ <WorkflowEditor {nodes} />
114
111
  </div>
115
112
  ```
116
113
 
117
114
  ### Vanilla JS / React / Vue / Angular
118
115
 
119
116
  ```javascript
120
- import { mountFlowDropApp, createEndpointConfig } from "@d34dman/flowdrop";
121
-
122
- const app = await mountFlowDropApp(document.getElementById("editor"), {
123
- workflow: myWorkflow,
124
- endpointConfig: createEndpointConfig("/api/flowdrop"),
125
- eventHandlers: {
126
- onDirtyStateChange: (isDirty) => console.log("Unsaved changes:", isDirty),
127
- onAfterSave: (workflow) => console.log("Saved!", workflow)
128
- }
117
+ import { mountFlowDropApp, createEndpointConfig } from '@d34dman/flowdrop';
118
+
119
+ const app = await mountFlowDropApp(document.getElementById('editor'), {
120
+ workflow: myWorkflow,
121
+ endpointConfig: createEndpointConfig('/api/flowdrop'),
122
+ eventHandlers: {
123
+ onDirtyStateChange: (isDirty) => console.log('Unsaved changes:', isDirty),
124
+ onAfterSave: (workflow) => console.log('Saved!', workflow)
125
+ }
129
126
  });
130
127
 
131
128
  // Full control over the editor
@@ -137,69 +134,66 @@ app.destroy();
137
134
  ### Enterprise Integration
138
135
 
139
136
  ```javascript
140
- import { mountFlowDropApp, CallbackAuthProvider } from "@d34dman/flowdrop";
137
+ import { mountFlowDropApp, CallbackAuthProvider } from '@d34dman/flowdrop';
141
138
 
142
139
  const app = await mountFlowDropApp(container, {
143
- // Dynamic token refresh
144
- authProvider: new CallbackAuthProvider({
145
- getToken: () => authService.getAccessToken(),
146
- onUnauthorized: () => authService.refreshToken()
147
- }),
148
-
149
- // Lifecycle hooks
150
- eventHandlers: {
151
- onBeforeUnmount: (workflow, isDirty) => {
152
- if (isDirty) saveDraft(workflow);
153
- }
154
- },
155
-
156
- // Auto-save, toasts, and more
157
- features: {
158
- autoSaveDraft: true,
159
- autoSaveDraftInterval: 30000
160
- }
140
+ // Dynamic token refresh
141
+ authProvider: new CallbackAuthProvider({
142
+ getToken: () => authService.getAccessToken(),
143
+ onUnauthorized: () => authService.refreshToken()
144
+ }),
145
+
146
+ // Lifecycle hooks
147
+ eventHandlers: {
148
+ onBeforeUnmount: (workflow, isDirty) => {
149
+ if (isDirty) saveDraft(workflow);
150
+ }
151
+ },
152
+
153
+ // Auto-save, toasts, and more
154
+ features: {
155
+ autoSaveDraft: true,
156
+ autoSaveDraftInterval: 30000
157
+ }
161
158
  });
162
159
  ```
163
160
 
164
-
165
161
  ## API Configuration
166
162
 
167
163
  Connect to any backend in seconds:
168
164
 
169
165
  ```typescript
170
- import { createEndpointConfig } from "@d34dman/flowdrop";
166
+ import { createEndpointConfig } from '@d34dman/flowdrop';
171
167
 
172
168
  const config = createEndpointConfig({
173
- baseUrl: "https://api.example.com",
174
- endpoints: {
175
- nodes: { list: "/nodes", get: "/nodes/{id}" },
176
- workflows: {
177
- list: "/workflows",
178
- get: "/workflows/{id}",
179
- create: "/workflows",
180
- update: "/workflows/{id}",
181
- execute: "/workflows/{id}/execute"
182
- }
183
- },
184
- auth: { type: "bearer", token: "your-token" }
169
+ baseUrl: 'https://api.example.com',
170
+ endpoints: {
171
+ nodes: { list: '/nodes', get: '/nodes/{id}' },
172
+ workflows: {
173
+ list: '/workflows',
174
+ get: '/workflows/{id}',
175
+ create: '/workflows',
176
+ update: '/workflows/{id}',
177
+ execute: '/workflows/{id}/execute'
178
+ }
179
+ },
180
+ auth: { type: 'bearer', token: 'your-token' }
185
181
  });
186
182
  ```
187
183
 
188
-
189
184
  ## Customization
190
185
 
191
186
  Make it yours with CSS custom properties:
192
187
 
193
188
  ```css
194
189
  :root {
195
- --flowdrop-background-color: #0a0a0a;
196
- --flowdrop-primary-color: #6366f1;
197
- --flowdrop-border-color: #27272a;
198
- --flowdrop-text-color: #fafafa;
190
+ --flowdrop-background-color: #0a0a0a;
191
+ --flowdrop-primary-color: #6366f1;
192
+ --flowdrop-border-color: #27272a;
193
+ --flowdrop-text-color: #fafafa;
199
194
  }
200
195
  ```
201
196
 
202
-
203
197
  ## Deploy
204
198
 
205
199
  ### Docker (Recommended)
@@ -218,8 +212,6 @@ FLOWDROP_API_BASE_URL=http://your-backend/api node build
218
212
 
219
213
  Runtime configuration means you build once and deploy to staging, production, or anywhere else with just environment variables.
220
214
 
221
-
222
-
223
215
  ## Documentation
224
216
 
225
217
  | Resource | Description |
@@ -238,12 +230,10 @@ npm run build # Build library
238
230
  npm test # Run all tests
239
231
  ```
240
232
 
241
-
242
233
  ## Contributing
243
234
 
244
235
  FlowDrop is stabilizing. Contributions will open soon. Star the repo to stay updated.
245
236
 
246
-
247
237
  <p align="center">
248
238
  <strong>FlowDrop</strong> - The visual workflow editor you own completely
249
239
  </p>
@@ -14,7 +14,13 @@
14
14
  import ConfigPanel from './ConfigPanel.svelte';
15
15
  import Navbar from './Navbar.svelte';
16
16
  import { api, setEndpointConfig } from '../services/api.js';
17
- import type { NodeMetadata, Workflow, WorkflowNode, ConfigSchema, NodeUIExtensions } from '../types/index.js';
17
+ import type {
18
+ NodeMetadata,
19
+ Workflow,
20
+ WorkflowNode,
21
+ ConfigSchema,
22
+ NodeUIExtensions
23
+ } from '../types/index.js';
18
24
  import { createEndpointConfig } from '../config/endpoints.js';
19
25
  import type { EndpointConfig } from '../config/endpoints.js';
20
26
  import type { AuthProvider } from '../types/auth.js';
@@ -663,7 +669,8 @@
663
669
  >
664
670
  <ConfigForm
665
671
  node={currentNode}
666
- onSave={(updatedConfig, uiExtensions?: NodeUIExtensions) => {
672
+ workflowId={$workflowStore?.id}
673
+ onSave={async (updatedConfig, uiExtensions?: NodeUIExtensions) => {
667
674
  if (selectedNodeId && currentNode) {
668
675
  // Build the updated node data
669
676
  const updatedData = {
@@ -687,6 +694,9 @@
687
694
  // NOTE: We do NOT change the node's type field anymore
688
695
  // All nodes use 'universalNode' and UniversalNode handles internal switching
689
696
  workflowActions.updateNode(selectedNodeId, nodeUpdates);
697
+
698
+ // Refresh edge positions just in case. This is a safe bet.
699
+ await workflowEditorRef.refreshEdgePositions(selectedNodeId);
690
700
  }
691
701
 
692
702
  closeConfigSidebar();