@flowdrop/flowdrop 1.15.0 → 2.0.0-beta.10

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 (323) hide show
  1. package/CHANGELOG.md +648 -0
  2. package/MIGRATION-2.0.md +642 -0
  3. package/README.md +28 -28
  4. package/dist/adapters/WorkflowAdapter.d.ts +1 -1
  5. package/dist/adapters/WorkflowAdapter.js +18 -13
  6. package/dist/adapters/agentspec/AgentSpecAdapter.js +10 -10
  7. package/dist/adapters/agentspec/defaultNodeTypes.js +9 -9
  8. package/dist/api/enhanced-client.js +6 -11
  9. package/dist/chat/batchFeedback.d.ts +39 -0
  10. package/dist/chat/batchFeedback.js +51 -0
  11. package/dist/commands/executor.js +66 -27
  12. package/dist/commands/storeIntegration.svelte.d.ts +4 -1
  13. package/dist/commands/storeIntegration.svelte.js +36 -21
  14. package/dist/commands/types.d.ts +2 -0
  15. package/dist/commands/types.js +5 -5
  16. package/dist/components/App.svelte +696 -565
  17. package/dist/components/App.svelte.d.ts +63 -16
  18. package/dist/components/Button.stories.svelte +65 -0
  19. package/dist/components/Button.stories.svelte.d.ts +19 -0
  20. package/dist/components/Button.svelte +62 -0
  21. package/dist/components/Button.svelte.d.ts +24 -0
  22. package/dist/components/CanvasIconButton.svelte +76 -0
  23. package/dist/components/CanvasIconButton.svelte.d.ts +18 -0
  24. package/dist/components/ConfigForm.svelte +181 -552
  25. package/dist/components/ConfigForm.svelte.d.ts +24 -7
  26. package/dist/components/ConfigModal.svelte +16 -3
  27. package/dist/components/ConfigPanel.svelte +234 -15
  28. package/dist/components/ConfigPanel.svelte.d.ts +6 -0
  29. package/dist/components/ConnectionLine.svelte +4 -2
  30. package/dist/components/EditorStatusBar.stories.svelte +44 -0
  31. package/dist/components/EditorStatusBar.stories.svelte.d.ts +27 -0
  32. package/dist/components/EditorStatusBar.svelte +99 -0
  33. package/dist/components/EditorStatusBar.svelte.d.ts +15 -0
  34. package/dist/components/IconButton.svelte +80 -0
  35. package/dist/components/IconButton.svelte.d.ts +30 -0
  36. package/dist/components/Input.svelte +74 -0
  37. package/dist/components/Input.svelte.d.ts +17 -0
  38. package/dist/components/LogoWordmark.svelte +113 -0
  39. package/dist/components/LogoWordmark.svelte.d.ts +26 -0
  40. package/dist/components/Navbar.svelte +78 -64
  41. package/dist/components/Navbar.svelte.d.ts +3 -0
  42. package/dist/components/NodeSidebar.svelte +48 -171
  43. package/dist/components/NodeStatusOverlay.svelte +94 -6
  44. package/dist/components/NodeSwapPicker.svelte +22 -38
  45. package/dist/components/PipelineStatus.svelte +22 -68
  46. package/dist/components/PipelineStatus.svelte.d.ts +3 -0
  47. package/dist/components/PortCoordinateTracker.svelte +5 -6
  48. package/dist/components/PortMappingRow.svelte +0 -2
  49. package/dist/components/SchemaForm.stories.svelte +1 -3
  50. package/dist/components/SchemaForm.svelte +22 -39
  51. package/dist/components/SchemaForm.svelte.d.ts +0 -8
  52. package/dist/components/Select.svelte +53 -0
  53. package/dist/components/Select.svelte.d.ts +15 -0
  54. package/dist/components/SettingsModal.svelte +8 -8
  55. package/dist/components/SettingsPanel.svelte +44 -10
  56. package/dist/components/SwapMappingEditor.svelte +67 -49
  57. package/dist/components/SwapMappingEditor.svelte.d.ts +0 -2
  58. package/dist/components/Textarea.svelte +39 -0
  59. package/dist/components/Textarea.svelte.d.ts +12 -0
  60. package/dist/components/ThemeToggle.svelte +15 -94
  61. package/dist/components/UniversalNode.svelte +45 -11
  62. package/dist/components/UniversalNode.svelte.d.ts +1 -1
  63. package/dist/components/WorkflowEditor.svelte +183 -162
  64. package/dist/components/WorkflowEditor.svelte.d.ts +39 -10
  65. package/dist/components/chat/AIChatPanel.svelte +99 -90
  66. package/dist/components/chat/AIChatPanel.svelte.d.ts +0 -4
  67. package/dist/components/chat/CommandPreview.svelte +2 -1
  68. package/dist/components/console/CommandConsole.svelte +7 -5
  69. package/dist/components/console/ConsoleAutocomplete.svelte +11 -12
  70. package/dist/components/console/ConsoleAutocomplete.svelte.d.ts +6 -0
  71. package/dist/components/console/ConsoleInput.svelte +18 -9
  72. package/dist/components/console/ConsoleOutput.svelte +4 -3
  73. package/dist/components/form/FormArray.svelte +42 -182
  74. package/dist/components/form/FormArray.svelte.d.ts +2 -1
  75. package/dist/components/form/FormAutocomplete.svelte +26 -21
  76. package/dist/components/form/FormCheckboxGroup.svelte +1 -5
  77. package/dist/components/form/FormCodeEditor.svelte +9 -7
  78. package/dist/components/form/FormField.svelte +22 -44
  79. package/dist/components/form/FormFieldLight.svelte +56 -50
  80. package/dist/components/form/FormFieldLight.svelte.d.ts +12 -0
  81. package/dist/components/form/FormFieldset.svelte +45 -11
  82. package/dist/components/form/FormMarkdownEditor.svelte +17 -9
  83. package/dist/components/form/FormNumberField.svelte +4 -36
  84. package/dist/components/form/FormPorts.svelte +262 -0
  85. package/dist/components/form/FormPorts.svelte.d.ts +13 -0
  86. package/dist/components/form/FormRangeField.svelte +62 -30
  87. package/dist/components/form/FormSelect.svelte +13 -75
  88. package/dist/components/form/FormTemplateEditor.svelte +17 -7
  89. package/dist/components/form/FormTextField.svelte +3 -35
  90. package/dist/components/form/FormTextarea.svelte +4 -39
  91. package/dist/components/form/FormToggle.svelte +5 -16
  92. package/dist/components/form/FormToggle.svelte.d.ts +4 -2
  93. package/dist/components/form/FormUISchemaRenderer.svelte +3 -1
  94. package/dist/components/form/resolveFieldType.d.ts +24 -0
  95. package/dist/components/form/resolveFieldType.js +55 -0
  96. package/dist/components/form/templateAutocomplete.js +1 -5
  97. package/dist/components/form/types.d.ts +1 -14
  98. package/dist/components/icons/CloseIcon.svelte +6 -0
  99. package/dist/components/icons/CloseIcon.svelte.d.ts +26 -0
  100. package/dist/components/icons/CommandLineIcon.svelte +15 -0
  101. package/dist/components/icons/CommandLineIcon.svelte.d.ts +26 -0
  102. package/dist/components/icons/MenuIcon.svelte +4 -0
  103. package/dist/components/icons/MenuIcon.svelte.d.ts +26 -0
  104. package/dist/components/icons/MenuOpenIcon.svelte +6 -0
  105. package/dist/components/icons/MenuOpenIcon.svelte.d.ts +26 -0
  106. package/dist/components/interrupt/ChoicePrompt.svelte +0 -10
  107. package/dist/components/interrupt/ConfirmationPrompt.svelte +0 -5
  108. package/dist/components/interrupt/FormPrompt.svelte +3 -2
  109. package/dist/components/interrupt/InterruptBubble.svelte +25 -27
  110. package/dist/components/interrupt/ReviewPrompt.svelte +10 -23
  111. package/dist/components/interrupt/TextInputPrompt.svelte +2 -7
  112. package/dist/components/layouts/MainLayout.svelte +24 -18
  113. package/dist/components/layouts/MainLayout.svelte.d.ts +4 -0
  114. package/dist/components/nodes/AtomNode.svelte +70 -72
  115. package/dist/components/nodes/AtomNode.svelte.d.ts +1 -1
  116. package/dist/components/nodes/GatewayNode.svelte +134 -172
  117. package/dist/components/nodes/GatewayNode.svelte.d.ts +1 -1
  118. package/dist/components/nodes/IdeaNode.svelte +79 -98
  119. package/dist/components/nodes/IdeaNode.svelte.d.ts +8 -4
  120. package/dist/components/nodes/NodeConfigButton.svelte +86 -0
  121. package/dist/components/nodes/NodeConfigButton.svelte.d.ts +15 -0
  122. package/dist/components/nodes/NotesNode.svelte +76 -85
  123. package/dist/components/nodes/NotesNode.svelte.d.ts +8 -4
  124. package/dist/components/nodes/SimpleNode.svelte +68 -137
  125. package/dist/components/nodes/SimpleNode.svelte.d.ts +4 -4
  126. package/dist/components/nodes/SquareNode.svelte +122 -169
  127. package/dist/components/nodes/SquareNode.svelte.d.ts +4 -4
  128. package/dist/components/nodes/TerminalNode.svelte +70 -127
  129. package/dist/components/nodes/TerminalNode.svelte.d.ts +4 -4
  130. package/dist/components/nodes/ToolNode.svelte +99 -104
  131. package/dist/components/nodes/ToolNode.svelte.d.ts +6 -6
  132. package/dist/components/nodes/WorkflowNode.svelte +145 -195
  133. package/dist/components/nodes/WorkflowNode.svelte.d.ts +1 -1
  134. package/dist/components/playground/ChatInput.svelte +11 -15
  135. package/dist/components/playground/ChatPanel.svelte +6 -49
  136. package/dist/components/playground/ChatPanel.svelte.d.ts +0 -14
  137. package/dist/components/playground/ControlPanel.svelte +134 -123
  138. package/dist/components/playground/ControlPanel.svelte.d.ts +3 -0
  139. package/dist/components/playground/ExecutionLogs.svelte +11 -9
  140. package/dist/components/playground/InputCollector.svelte +22 -57
  141. package/dist/components/playground/MessageStream.svelte +17 -23
  142. package/dist/components/playground/PipelineKanbanView.svelte +69 -8
  143. package/dist/components/playground/PipelineKanbanView.svelte.d.ts +2 -0
  144. package/dist/components/playground/PipelinePanel.svelte +31 -8
  145. package/dist/components/playground/PipelinePanel.svelte.d.ts +2 -0
  146. package/dist/components/playground/PipelineTableView.svelte +188 -44
  147. package/dist/components/playground/PipelineTableView.svelte.d.ts +2 -0
  148. package/dist/components/playground/Playground.svelte +154 -105
  149. package/dist/components/playground/Playground.svelte.d.ts +5 -0
  150. package/dist/components/playground/PlaygroundApp.svelte +12 -2
  151. package/dist/components/playground/PlaygroundApp.svelte.d.ts +6 -0
  152. package/dist/components/playground/PlaygroundModal.svelte +18 -3
  153. package/dist/components/playground/PlaygroundModal.svelte.d.ts +6 -0
  154. package/dist/components/playground/PlaygroundStudio.svelte +40 -37
  155. package/dist/components/playground/PlaygroundStudio.svelte.d.ts +6 -0
  156. package/dist/components/playground/SessionManager.svelte +9 -12
  157. package/dist/components/playground/pipelineViewUtils.svelte.d.ts +30 -1
  158. package/dist/components/playground/pipelineViewUtils.svelte.js +40 -3
  159. package/dist/components/surfaces/SurfaceOverlay.svelte +153 -0
  160. package/dist/components/surfaces/SurfaceOverlay.svelte.d.ts +14 -0
  161. package/dist/components/surfaces/TabbedSurface.svelte +133 -0
  162. package/dist/components/surfaces/TabbedSurface.svelte.d.ts +27 -0
  163. package/dist/config/endpoints.d.ts +23 -7
  164. package/dist/config/endpoints.js +30 -10
  165. package/dist/core/index.d.ts +6 -7
  166. package/dist/core/index.js +8 -12
  167. package/dist/display/index.d.ts +6 -3
  168. package/dist/display/index.js +7 -5
  169. package/dist/editor/index.d.ts +20 -21
  170. package/dist/editor/index.js +26 -36
  171. package/dist/form/code.d.ts +25 -15
  172. package/dist/form/code.js +44 -41
  173. package/dist/form/fieldRegistry.d.ts +17 -13
  174. package/dist/form/fieldRegistry.js +32 -12
  175. package/dist/form/full.d.ts +19 -14
  176. package/dist/form/full.js +26 -28
  177. package/dist/form/index.d.ts +3 -4
  178. package/dist/form/index.js +6 -5
  179. package/dist/form/markdown.d.ts +13 -8
  180. package/dist/form/markdown.js +22 -23
  181. package/dist/helpers/proximityConnect.d.ts +3 -2
  182. package/dist/helpers/proximityConnect.js +2 -5
  183. package/dist/helpers/workflowEditorHelper.d.ts +14 -5
  184. package/dist/helpers/workflowEditorHelper.js +32 -30
  185. package/dist/index.d.ts +28 -24
  186. package/dist/index.js +27 -50
  187. package/dist/messages/defaults.d.ts +2 -5
  188. package/dist/messages/defaults.js +3 -6
  189. package/dist/messages/index.d.ts +1 -2
  190. package/dist/messages/index.js +1 -2
  191. package/dist/mocks/app-forms.d.ts +6 -2
  192. package/dist/mocks/app-forms.js +11 -4
  193. package/dist/openapi/v1/openapi.yaml +38 -26
  194. package/dist/playground/index.d.ts +4 -5
  195. package/dist/playground/index.js +4 -32
  196. package/dist/playground/mount.d.ts +34 -5
  197. package/dist/playground/mount.js +58 -24
  198. package/dist/registry/{BaseRegistry.d.ts → BaseRegistry.svelte.d.ts} +22 -1
  199. package/dist/registry/{BaseRegistry.js → BaseRegistry.svelte.js} +37 -1
  200. package/dist/registry/builtinFormats.d.ts +9 -18
  201. package/dist/registry/builtinFormats.js +9 -39
  202. package/dist/registry/builtinNodeTypes.d.ts +53 -0
  203. package/dist/registry/builtinNodeTypes.js +67 -0
  204. package/dist/registry/builtinNodes.d.ts +2 -64
  205. package/dist/registry/builtinNodes.js +7 -103
  206. package/dist/registry/index.d.ts +3 -4
  207. package/dist/registry/index.js +4 -6
  208. package/dist/registry/nodeComponentRegistry.d.ts +184 -16
  209. package/dist/registry/nodeComponentRegistry.js +235 -17
  210. package/dist/registry/workflowFormatRegistry.d.ts +14 -9
  211. package/dist/registry/workflowFormatRegistry.js +24 -8
  212. package/dist/{schema → schemas}/index.d.ts +2 -2
  213. package/dist/{schema → schemas}/index.js +2 -2
  214. package/dist/schemas/v1/workflow.schema.json +19 -17
  215. package/dist/services/agentSpecExecutionService.d.ts +0 -2
  216. package/dist/services/agentSpecExecutionService.js +0 -3
  217. package/dist/services/apiVariableService.d.ts +2 -1
  218. package/dist/services/apiVariableService.js +16 -47
  219. package/dist/services/autoSaveService.d.ts +7 -0
  220. package/dist/services/autoSaveService.js +6 -4
  221. package/dist/services/categoriesApi.js +3 -6
  222. package/dist/services/chatService.d.ts +9 -4
  223. package/dist/services/chatService.js +23 -28
  224. package/dist/services/draftStorage.d.ts +129 -13
  225. package/dist/services/draftStorage.js +185 -37
  226. package/dist/services/dynamicSchemaService.d.ts +33 -5
  227. package/dist/services/dynamicSchemaService.js +67 -55
  228. package/dist/services/globalSave.d.ts +13 -12
  229. package/dist/services/globalSave.js +29 -51
  230. package/dist/services/historyService.d.ts +39 -11
  231. package/dist/services/historyService.js +60 -18
  232. package/dist/services/interruptService.d.ts +15 -9
  233. package/dist/services/interruptService.js +35 -37
  234. package/dist/services/nodeExecutionService.d.ts +18 -3
  235. package/dist/services/nodeExecutionService.js +71 -45
  236. package/dist/services/playgroundService.d.ts +16 -10
  237. package/dist/services/playgroundService.js +42 -43
  238. package/dist/services/portConfigApi.js +3 -6
  239. package/dist/services/settingsService.d.ts +9 -4
  240. package/dist/services/settingsService.js +23 -12
  241. package/dist/services/variableService.d.ts +2 -1
  242. package/dist/services/variableService.js +2 -2
  243. package/dist/services/workflowStorage.js +6 -6
  244. package/dist/skins/drafter.d.ts +30 -0
  245. package/dist/skins/drafter.js +198 -0
  246. package/dist/skins/index.d.ts +2 -1
  247. package/dist/skins/index.js +4 -2
  248. package/dist/stores/apiContext.d.ts +56 -0
  249. package/dist/stores/apiContext.js +80 -0
  250. package/dist/stores/categoriesStore.svelte.d.ts +28 -23
  251. package/dist/stores/categoriesStore.svelte.js +69 -64
  252. package/dist/stores/getInstance.svelte.d.ts +39 -0
  253. package/dist/stores/getInstance.svelte.js +65 -0
  254. package/dist/stores/historyStore.svelte.d.ts +89 -91
  255. package/dist/stores/historyStore.svelte.js +159 -158
  256. package/dist/stores/instanceContainer.svelte.d.ts +111 -0
  257. package/dist/stores/instanceContainer.svelte.js +119 -0
  258. package/dist/stores/interruptStore.svelte.d.ts +112 -82
  259. package/dist/stores/interruptStore.svelte.js +253 -226
  260. package/dist/stores/pipelinePanelStore.svelte.d.ts +27 -3
  261. package/dist/stores/pipelinePanelStore.svelte.js +61 -14
  262. package/dist/stores/playgroundStore.svelte.d.ts +169 -222
  263. package/dist/stores/playgroundStore.svelte.js +513 -580
  264. package/dist/stores/portCoordinateStore.svelte.d.ts +57 -51
  265. package/dist/stores/portCoordinateStore.svelte.js +109 -98
  266. package/dist/stores/settingsStore.svelte.d.ts +17 -1
  267. package/dist/stores/settingsStore.svelte.js +79 -12
  268. package/dist/stores/workflowStore.svelte.d.ts +212 -210
  269. package/dist/stores/workflowStore.svelte.js +527 -502
  270. package/dist/stories/EdgeDecorator.svelte +5 -2
  271. package/dist/stories/NodeDecorator.svelte +5 -3
  272. package/dist/styles/base.css +285 -14
  273. package/dist/styles/tokens.css +60 -2
  274. package/dist/svelte-app.d.ts +78 -11
  275. package/dist/svelte-app.js +210 -141
  276. package/dist/themes/drafter.d.ts +2 -0
  277. package/dist/themes/drafter.js +15 -0
  278. package/dist/themes/index.d.ts +2 -1
  279. package/dist/themes/index.js +8 -2
  280. package/dist/types/auth.d.ts +9 -51
  281. package/dist/types/auth.js +4 -54
  282. package/dist/types/events.d.ts +24 -3
  283. package/dist/types/events.js +2 -1
  284. package/dist/types/index.d.ts +117 -32
  285. package/dist/types/index.js +0 -1
  286. package/dist/types/navbar.d.ts +7 -0
  287. package/dist/types/playground.d.ts +18 -3
  288. package/dist/types/settings.d.ts +30 -1
  289. package/dist/types/settings.js +5 -2
  290. package/dist/types/skin.d.ts +1 -1
  291. package/dist/types/theme.d.ts +16 -2
  292. package/dist/types/uischema.d.ts +5 -0
  293. package/dist/utils/colors.d.ts +74 -21
  294. package/dist/utils/colors.js +92 -68
  295. package/dist/utils/connections.d.ts +9 -15
  296. package/dist/utils/connections.js +33 -88
  297. package/dist/utils/duration.d.ts +13 -0
  298. package/dist/utils/duration.js +45 -0
  299. package/dist/utils/edgeStyling.js +9 -5
  300. package/dist/utils/fetchWithAuth.d.ts +36 -15
  301. package/dist/utils/fetchWithAuth.js +53 -23
  302. package/dist/utils/icons.d.ts +5 -2
  303. package/dist/utils/icons.js +6 -5
  304. package/dist/utils/nodeIds.d.ts +1 -1
  305. package/dist/utils/nodeIds.js +1 -1
  306. package/dist/utils/nodeSwap.d.ts +6 -2
  307. package/dist/utils/nodeSwap.js +62 -129
  308. package/dist/utils/nodeTypes.d.ts +17 -8
  309. package/dist/utils/nodeTypes.js +27 -20
  310. package/dist/utils/performanceUtils.js +7 -0
  311. package/dist/utils/portUtils.d.ts +47 -11
  312. package/dist/utils/portUtils.js +67 -14
  313. package/dist/utils/portal.d.ts +18 -0
  314. package/dist/utils/portal.js +34 -0
  315. package/dist/utils/schemaMerge.d.ts +25 -0
  316. package/dist/utils/schemaMerge.js +61 -0
  317. package/package.json +7 -5
  318. package/dist/messages/deprecation.d.ts +0 -20
  319. package/dist/messages/deprecation.js +0 -33
  320. package/dist/registry/plugin.d.ts +0 -215
  321. package/dist/registry/plugin.js +0 -249
  322. package/dist/services/api.d.ts +0 -129
  323. package/dist/services/api.js +0 -217
@@ -8,7 +8,8 @@
8
8
  import '@xyflow/svelte/dist/style.css';
9
9
  import UniversalNode from '../components/UniversalNode.svelte';
10
10
  import FlowDropEdge from '../components/FlowDropEdge.svelte';
11
- import { registerBuiltinNodes } from '../registry/builtinNodes.js';
11
+ import { getDefaultInstance } from '../stores/instanceContainer.svelte.js';
12
+ import { provideInstance } from '../stores/getInstance.svelte.js';
12
13
  import { EDGE_MARKER_SIZES } from '../config/constants.js';
13
14
 
14
15
  interface Props {
@@ -33,7 +34,9 @@
33
34
  targetHandleId = 'input'
34
35
  }: Props = $props();
35
36
 
36
- registerBuiltinNodes();
37
+ // Provide an instance so UniversalNode can resolve built-in node components
38
+ // (the registry is seeded with BUILTIN_NODE_COMPONENTS at construction).
39
+ provideInstance(getDefaultInstance());
37
40
 
38
41
  const nodeTypes = {
39
42
  universalNode: UniversalNode
@@ -7,12 +7,14 @@
7
7
  import type { Node, ColorMode } from '@xyflow/svelte';
8
8
  import '@xyflow/svelte/dist/style.css';
9
9
  import UniversalNode from '../components/UniversalNode.svelte';
10
- import { registerBuiltinNodes } from '../registry/builtinNodes.js';
10
+ import { getDefaultInstance } from '../stores/instanceContainer.svelte.js';
11
+ import { provideInstance } from '../stores/getInstance.svelte.js';
11
12
 
12
13
  let { data, selected = false }: { data: Record<string, unknown>; selected?: boolean } = $props();
13
14
 
14
- // Ensure built-in node components are registered
15
- registerBuiltinNodes();
15
+ // Provide an instance so UniversalNode can resolve built-in node components
16
+ // (the registry is seeded with BUILTIN_NODE_COMPONENTS at construction).
17
+ provideInstance(getDefaultInstance());
16
18
 
17
19
  const nodeTypes = {
18
20
  universalNode: UniversalNode
@@ -8,6 +8,36 @@
8
8
  box-sizing: border-box;
9
9
  }
10
10
 
11
+ /* Drop the UA default margin on paragraphs so block text sits on the grid;
12
+ contexts that want spacing (e.g. .markdown-display p) opt back in. */
13
+ p {
14
+ margin: 0;
15
+ }
16
+
17
+ /* ───────────────────────────────────────────────────────────────────────────
18
+ Standardized focus ring — THE single source of truth.
19
+
20
+ The entire library draws ONE focus ring: a solid outline in --fd-ring, sized
21
+ by --fd-ring-width / --fd-ring-offset. Components must NOT declare their own
22
+ focus rings (no per-element :focus outline/box-shadow). :focus-visible keeps
23
+ it to keyboard navigation; browsers still surface it for text fields on
24
+ click. Scoped to the library roots so it never leaks into the host app.
25
+ ─────────────────────────────────────────────────────────────────────────── */
26
+ .flowdrop-root :focus-visible,
27
+ .svelte-flow :focus-visible {
28
+ outline: var(--fd-ring-width) solid var(--fd-ring);
29
+ outline-offset: var(--fd-ring-offset);
30
+ }
31
+
32
+ /* xyflow hard-disables the node wrapper outline
33
+ (.svelte-flow__node.selectable:focus-visible { outline: none }). That wrapper
34
+ is our single focusable node element, so re-assert the standard ring at
35
+ matching specificity. */
36
+ .svelte-flow .svelte-flow__node.selectable:focus-visible {
37
+ outline: var(--fd-ring-width) solid var(--fd-ring);
38
+ outline-offset: var(--fd-ring-offset);
39
+ }
40
+
11
41
  /* Layout utilities */
12
42
  .flowdrop-layout {
13
43
  display: flex;
@@ -93,9 +123,11 @@
93
123
  background-color: var(--fd-primary);
94
124
  }
95
125
 
126
+ /* Handles are tabindex="-1" (programmatic focus only, so :focus-visible won't
127
+ fire) — keep a :focus ring, but draw it from the same tokens. */
96
128
  .svelte-flow .svelte-flow__handle:focus {
97
- outline: 2px solid var(--fd-ring);
98
- outline-offset: 2px;
129
+ outline: var(--fd-ring-width) solid var(--fd-ring);
130
+ outline-offset: var(--fd-ring-offset);
99
131
  }
100
132
 
101
133
  /* Centralized handle edge positioning — offset derived from --fd-handle-size */
@@ -117,6 +149,7 @@
117
149
  display: inline-flex;
118
150
  align-items: center;
119
151
  justify-content: center;
152
+ gap: var(--fd-space-xs);
120
153
  padding: var(--fd-space-xs) var(--fd-space-xl);
121
154
  border: 1px solid transparent;
122
155
  border-radius: var(--fd-radius-md);
@@ -135,10 +168,7 @@
135
168
  border-color: var(--fd-border);
136
169
  }
137
170
 
138
- .flowdrop-btn:focus {
139
- outline: 2px solid var(--fd-ring);
140
- outline-offset: 2px;
141
- }
171
+ /* Focus ring is centralized (see top of file). */
142
172
 
143
173
  .flowdrop-btn--primary {
144
174
  background-color: var(--fd-primary);
@@ -195,38 +225,278 @@
195
225
  min-height: var(--fd-space-6xl);
196
226
  }
197
227
 
198
- /* Input styles */
228
+ /* ───────────────────────────────────────────────────────────────────────────
229
+ Icon buttons — square, icon-only. The typed primitive IconButton.svelte
230
+ routes here (the same way Button.svelte routes through .flowdrop-btn). It
231
+ composes onto .flowdrop-btn, then overrides geometry to a fixed square and
232
+ layers a tint variant. Corners follow --fd-control-radius so the Drafter
233
+ theme gets crisp icon buttons alongside its form controls.
234
+
235
+ Sizes: md (default) is 32px with a 16px glyph — the dominant size across the
236
+ library (form-array actions, modal closes, toolbars). sm maps to the
237
+ canonical --fd-size-icon-btn token (28px); lg is 36px (canvas-scale). */
238
+ .flowdrop-btn--icon {
239
+ width: 2rem;
240
+ height: 2rem;
241
+ min-height: 0;
242
+ padding: 0;
243
+ border-radius: var(--fd-control-radius);
244
+ color: var(--fd-muted-foreground);
245
+ }
246
+
247
+ .flowdrop-btn--icon svg {
248
+ width: 1rem;
249
+ height: 1rem;
250
+ }
251
+
252
+ .flowdrop-btn--icon.flowdrop-btn--sm {
253
+ width: var(--fd-size-icon-btn);
254
+ height: var(--fd-size-icon-btn);
255
+ padding: 0;
256
+ }
257
+
258
+ .flowdrop-btn--icon.flowdrop-btn--sm svg {
259
+ width: 0.875rem;
260
+ height: 0.875rem;
261
+ }
262
+
263
+ .flowdrop-btn--icon.flowdrop-btn--lg {
264
+ width: 2.25rem;
265
+ height: 2.25rem;
266
+ padding: 0;
267
+ }
268
+
269
+ .flowdrop-btn--icon.flowdrop-btn--lg svg {
270
+ width: 1.125rem;
271
+ height: 1.125rem;
272
+ }
273
+
274
+ /* Ghost (default for icon buttons) — transparent until hover. */
275
+ .flowdrop-btn--icon.flowdrop-btn--ghost:hover:not(:disabled) {
276
+ background-color: var(--fd-muted);
277
+ color: var(--fd-foreground);
278
+ border-color: transparent;
279
+ }
280
+
281
+ /* Default — flat --fd-background surface with a resting border. */
282
+ .flowdrop-btn--icon-default {
283
+ background-color: var(--fd-background);
284
+ border-color: var(--fd-border);
285
+ }
286
+
287
+ .flowdrop-btn--icon-default:hover:not(:disabled) {
288
+ background-color: var(--fd-muted);
289
+ color: var(--fd-foreground);
290
+ }
291
+
292
+ /* Tinted semantic variants — muted fill + semantic border/text, solid on press.
293
+ Unlike the solid text-button --primary, the icon flavour stays a quiet tint
294
+ so a row of action buttons reads as a group, not a wall of colour. */
295
+ .flowdrop-btn--icon-primary {
296
+ background-color: var(--fd-primary-muted);
297
+ border-color: var(--fd-primary);
298
+ color: var(--fd-primary-hover);
299
+ }
300
+
301
+ .flowdrop-btn--icon-primary:hover:not(:disabled) {
302
+ border-color: var(--fd-primary-hover);
303
+ color: var(--fd-primary-hover);
304
+ }
305
+
306
+ .flowdrop-btn--icon-primary:active:not(:disabled) {
307
+ background-color: var(--fd-primary);
308
+ }
309
+
310
+ .flowdrop-btn--icon-danger {
311
+ background-color: var(--fd-error-muted);
312
+ border-color: var(--fd-error);
313
+ color: var(--fd-error);
314
+ }
315
+
316
+ .flowdrop-btn--icon-danger:hover:not(:disabled) {
317
+ border-color: var(--fd-error-hover);
318
+ color: var(--fd-error-hover);
319
+ }
320
+
321
+ .flowdrop-btn--icon-danger:active:not(:disabled) {
322
+ background-color: var(--fd-error);
323
+ }
324
+
325
+ .flowdrop-btn--icon-success {
326
+ background-color: var(--fd-success-muted);
327
+ border-color: var(--fd-success);
328
+ color: var(--fd-success);
329
+ }
330
+
331
+ .flowdrop-btn--icon-success:hover:not(:disabled) {
332
+ border-color: var(--fd-success-hover);
333
+ color: var(--fd-success-hover);
334
+ }
335
+
336
+ .flowdrop-btn--icon-success:active:not(:disabled) {
337
+ background-color: var(--fd-success);
338
+ }
339
+
340
+ /* Active / toggled state (e.g. a pressed canvas control) — primary tint. */
341
+ .flowdrop-btn--icon.is-active {
342
+ color: var(--fd-primary);
343
+ background-color: var(--fd-primary-muted);
344
+ border-color: var(--fd-primary);
345
+ }
346
+
347
+ .flowdrop-btn--icon:disabled {
348
+ opacity: 0.35;
349
+ cursor: not-allowed;
350
+ }
351
+
352
+ /* ───────────────────────────────────────────────────────────────────────────
353
+ Form controls — THE single source of truth for input/select/textarea look.
354
+
355
+ The typed primitives Input.svelte / Select.svelte / Textarea.svelte route
356
+ here (the same way Button.svelte routes through .flowdrop-btn) so every field
357
+ across the library — config form, sidebar search, playground, prompts —
358
+ renders identically. Resting fields are ALWAYS the flat --fd-background
359
+ surface; `:disabled` is the ONLY muted state. Components must not re-declare
360
+ control backgrounds/borders locally. */
199
361
  .flowdrop-input {
200
362
  display: block;
201
363
  width: 100%;
202
- padding: var(--fd-space-xs) var(--fd-space-md);
364
+ padding: 0.625rem 0.875rem;
203
365
  border: 1px solid var(--fd-border);
204
- border-radius: var(--fd-radius-md);
366
+ border-radius: var(--fd-control-radius);
205
367
  font-size: var(--fd-text-sm);
368
+ font-family: inherit;
206
369
  line-height: 1.25rem;
207
370
  color: var(--fd-foreground);
208
371
  background-color: var(--fd-background);
372
+ box-shadow: var(--fd-shadow-sm);
209
373
  transition:
210
374
  border-color var(--fd-transition-normal),
211
375
  box-shadow var(--fd-transition-normal);
212
376
  }
213
377
 
378
+ .flowdrop-input::placeholder {
379
+ color: var(--fd-muted-foreground);
380
+ }
381
+
382
+ /* Active-field hint only; the focus ring itself is centralized (top of file). */
383
+ .flowdrop-input:hover:not(:disabled):not(:focus) {
384
+ border-color: var(--fd-border-strong);
385
+ }
386
+
214
387
  .flowdrop-input:focus {
215
- outline: none;
216
- border-color: var(--fd-primary);
217
- box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
388
+ border-color: var(--fd-ring);
389
+ }
390
+
391
+ .flowdrop-input:disabled {
392
+ background-color: var(--fd-muted);
393
+ border-color: var(--fd-border-muted);
394
+ color: var(--fd-muted-foreground);
395
+ cursor: not-allowed;
396
+ }
397
+
398
+ /* Invalid keeps its error border even on hover. */
399
+ .flowdrop-input--invalid,
400
+ .flowdrop-input--invalid:hover:not(:disabled) {
401
+ border-color: var(--fd-error);
218
402
  }
219
403
 
404
+ /* Sizes */
220
405
  .flowdrop-input--sm {
221
- padding: var(--fd-space-2xs) var(--fd-space-xs);
406
+ padding: 0.375rem 0.625rem;
222
407
  font-size: var(--fd-text-xs);
223
408
  }
224
409
 
225
410
  .flowdrop-input--lg {
226
- padding: var(--fd-space-md) var(--fd-space-xl);
411
+ padding: 0.75rem 1rem;
227
412
  font-size: var(--fd-text-base);
228
413
  }
229
414
 
415
+ /* Tabular figures for numeric entry (aligned digits). */
416
+ .flowdrop-input--numeric {
417
+ font-variant-numeric: tabular-nums;
418
+ }
419
+
420
+ /* Multiline */
421
+ .flowdrop-input--textarea {
422
+ min-height: 5rem;
423
+ line-height: 1.5;
424
+ resize: vertical;
425
+ }
426
+
427
+ /* Select: room for the chevron overlay; native arrow removed. */
428
+ .flowdrop-input--select {
429
+ padding-right: 2.5rem;
430
+ cursor: pointer;
431
+ appearance: none;
432
+ -webkit-appearance: none;
433
+ }
434
+
435
+ /* Select shell carries the chevron; the <select> keeps the field look. */
436
+ .flowdrop-select-wrap {
437
+ position: relative;
438
+ width: 100%;
439
+ }
440
+
441
+ .flowdrop-select-wrap__icon {
442
+ position: absolute;
443
+ right: 0.75rem;
444
+ top: 50%;
445
+ transform: translateY(-50%);
446
+ display: flex;
447
+ pointer-events: none;
448
+ color: var(--fd-muted-foreground);
449
+ transition: color var(--fd-transition-fast);
450
+ }
451
+
452
+ .flowdrop-select-wrap:focus-within .flowdrop-select-wrap__icon {
453
+ color: var(--fd-primary);
454
+ }
455
+
456
+ .flowdrop-select-wrap__icon svg {
457
+ width: 1rem;
458
+ height: 1rem;
459
+ }
460
+
461
+ /* Input with a leading/trailing affordance (e.g. a search magnifier). */
462
+ .flowdrop-input-wrap {
463
+ position: relative;
464
+ width: 100%;
465
+ display: flex;
466
+ align-items: center;
467
+ }
468
+
469
+ .flowdrop-input-wrap__icon {
470
+ position: absolute;
471
+ top: 50%;
472
+ transform: translateY(-50%);
473
+ display: flex;
474
+ align-items: center;
475
+ pointer-events: none;
476
+ color: var(--fd-muted-foreground);
477
+ }
478
+
479
+ .flowdrop-input-wrap__icon--leading {
480
+ left: 0.75rem;
481
+ }
482
+
483
+ .flowdrop-input-wrap__icon--trailing {
484
+ right: 0.75rem;
485
+ }
486
+
487
+ .flowdrop-input-wrap__icon svg {
488
+ width: 1rem;
489
+ height: 1rem;
490
+ }
491
+
492
+ .flowdrop-input--has-leading {
493
+ padding-left: 2.25rem;
494
+ }
495
+
496
+ .flowdrop-input--has-trailing {
497
+ padding-right: 2.25rem;
498
+ }
499
+
230
500
  /* Card styles */
231
501
  .flowdrop-card {
232
502
  background-color: var(--fd-card);
@@ -1092,6 +1362,7 @@
1092
1362
  --fd-notes-node-width: 500px;
1093
1363
  --fd-notes-node-min-width: 250px;
1094
1364
  --fd-notes-node-max-width: 500px;
1365
+ --fd-notes-node-min-height: 200px;
1095
1366
  --fd-notes-node-backdrop-filter: blur(8px);
1096
1367
  }
1097
1368
 
@@ -127,6 +127,13 @@
127
127
  --fd-card: #ffffff; /* @public */
128
128
  --fd-card-foreground: var(--_gray-9); /* @public */
129
129
 
130
+ /* ----- CHROME PANELS (sidebar + config/inspector panel) -----
131
+ Large editor-shell panels read from these so a theme can make them
132
+ glassy/translucent without touching every other surface. Default to the
133
+ opaque app background + no blur, so existing themes are unchanged. */
134
+ --fd-panel-bg: var(--fd-background); /* @public sidebar + config panel surface */
135
+ --fd-panel-backdrop-filter: none; /* @public glass/frost behind translucent panels; e.g. blur(14px) */
136
+
130
137
  /* ----- HEADER (Distinct header styling) ----- */
131
138
  --fd-header: #f5f7fa; /* @public */
132
139
  --fd-header-foreground: var(--_gray-8); /* @public */
@@ -140,10 +147,45 @@
140
147
  --fd-border-muted: var(--_gray-3); /* @public */
141
148
  --fd-border-strong: var(--_gray-5); /* @public */
142
149
  --fd-ring: var(--_blue-2); /* @public */
150
+ /* Focus-ring geometry. The whole library draws ONE focus ring from these
151
+ (see base.css). Color is theme-aware (--fd-ring); width/offset are not, so
152
+ they live only here. */
153
+ --fd-ring-width: 2px; /* @public */
154
+ --fd-ring-offset: 2px; /* @public */
155
+
156
+ /* ----- EDITOR CANVAS & NODE SURFACES -----
157
+ Scoped surfaces for the graph editor, kept separate from the general app
158
+ "chrome" (navbar, sidebars, panels) so a theme can restyle the canvas/nodes
159
+ without tinting the rest of the UI. Each defaults to its chrome equivalent,
160
+ so overriding the base token (e.g. --fd-card) still cascades here. */
161
+ --fd-canvas-bg: var(--fd-background); /* @public editor canvas (grid) background */
162
+ --fd-node-bg: var(--fd-card); /* @public node body surface */
163
+ --fd-node-header-bg: var(--fd-header); /* @public node header surface */
164
+ --fd-node-radius: var(
165
+ --fd-radius-xl
166
+ ); /* @public node card corner radius; lower for sharper corners */
167
+ --fd-node-shadow: var(
168
+ --fd-shadow-md
169
+ ); /* @public node resting elevation; 'none' for a flat look */
170
+ --fd-node-shadow-hover: var(
171
+ --fd-shadow-lg
172
+ ); /* @public node hover/selected elevation; 'none' for a flat look */
173
+ --fd-node-backdrop-filter: none; /* @public glass/frost effect behind translucent node bodies; e.g. blur(10px) */
143
174
 
144
175
  /* ----- NODE BORDERS (Higher contrast for visibility when zoomed out) ----- */
145
176
  --fd-node-border: var(--_gray-5); /* @public */
146
177
  --fd-node-border-hover: var(--_gray-6); /* @public */
178
+ --fd-node-border-width: 1.5px; /* @public node outline thickness; lower for a thinner look */
179
+ /* Note nodes can carry their own outline so themes can read them as
180
+ informational/annotation rather than a process node. Defaults to the
181
+ shared node border so existing themes are unchanged. */
182
+ --fd-note-border: var(--fd-node-border); /* @public notes-node outline */
183
+ --fd-note-border-hover: var(--fd-node-border-hover); /* @public notes-node outline (hover) */
184
+
185
+ /* ----- CANVAS GRID (pattern color for the editor background grid; any theme
186
+ can recolor whichever grid variant it picks via config.canvas.grid).
187
+ Default matches xyflow's dot-grid color so the default theme is unchanged. */
188
+ --fd-grid-pattern-color: #91919a; /* @public */
147
189
 
148
190
  /* ----- PRIMARY (Interactive/Brand) ----- */
149
191
  --fd-primary: var(--_blue-2); /* @public */
@@ -211,6 +253,12 @@
211
253
  --fd-radius-2xl: 1rem; /* @public 16px */
212
254
  --fd-radius-full: 9999px; /* @public */
213
255
 
256
+ /* Corner radius shared by form controls (input/select/textarea) and their
257
+ group containers (array item boxes, fieldsets, checkbox groups, config
258
+ sections). Defaults to --fd-radius-lg; themes can tighten it independently
259
+ of cards/panels — e.g. Drafter sets 2px for crisp drafting corners. */
260
+ --fd-control-radius: var(--fd-radius-lg); /* @public */
261
+
214
262
  /* ----- SHADOWS (Refined layered shadows for modern depth) ----- */
215
263
  --fd-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.04), 0 1px 3px rgb(0 0 0 / 0.06); /* @public */
216
264
  --fd-shadow-md: 0 4px 8px rgb(0 0 0 / 0.06), 0 2px 4px rgb(0 0 0 / 0.04); /* @public */
@@ -307,6 +355,7 @@
307
355
  --fd-scrollbar-thumb: var(--_gray-4); /* @internal */
308
356
  --fd-scrollbar-thumb-hover: var(--_gray-5); /* @internal */
309
357
  --fd-scrollbar-track: var(--_gray-2); /* @internal */
358
+ --fd-scrollbar-radius: 4px; /* @public scrollbar thumb/track corner radius; 0 for square */
310
359
 
311
360
  /* ----- BACKDROP/OVERLAY ----- */
312
361
  --fd-backdrop: rgba(255, 255, 255, 0.8); /* @internal */
@@ -324,11 +373,17 @@
324
373
 
325
374
  /* ----- NODE LAYOUT (Dimensions and port alignment; multiples of 10 for grid) ----- */
326
375
  --fd-node-grid-step: 10; /* @internal — layout algorithm detail */
327
- --fd-node-default-width: 290px; /* @public */
376
+ --fd-node-default-width: 280px; /* @public */
328
377
  --fd-node-header-height: 60px; /* @public */
329
- --fd-node-header-title-height: 40px; /* @internal */
378
+ --fd-node-header-title-height: 40px; /* @internal — fits icon + up to 2 text lines */
330
379
  --fd-node-header-desc-line: 20px; /* @internal */
331
380
  --fd-node-header-gap: 10px; /* @internal */
381
+ /* Divider absorbed into header bottom padding so header height stays on the
382
+ 20px grid regardless of border thickness. */
383
+ --fd-node-header-divider-width: 1px; /* @public */
384
+ --fd-node-header-divider-color: var(
385
+ --fd-border-muted
386
+ ); /* @public — header bottom divider color */
332
387
  --fd-node-port-row-height: 20px; /* @internal */
333
388
  --fd-node-terminal-size: 80px; /* @public */
334
389
  --fd-node-square-size: 80px; /* @public */
@@ -395,6 +450,9 @@
395
450
  --fd-node-border: #4a4a52;
396
451
  --fd-node-border-hover: #5a5a62;
397
452
 
453
+ /* ----- CANVAS GRID (matches xyflow's dark dot-grid color) ----- */
454
+ --fd-grid-pattern-color: #777;
455
+
398
456
  /* ----- NODE COLORS (port type labels/badges - lighter for readability on dark surfaces) ----- */
399
457
  --fd-node-emerald: #34d399;
400
458
  --fd-node-blue: #60a5fa;
@@ -12,8 +12,9 @@ import type { AuthProvider } from './types/auth.js';
12
12
  import type { FlowDropEventHandlers, FlowDropFeatures } from './types/events.js';
13
13
  import type { FlowDropTheme, FlowDropThemeName } from './types/theme.js';
14
14
  import type { WorkflowFormatAdapter } from './registry/workflowFormatRegistry.js';
15
- import './registry/builtinFormats.js';
16
- import type { PartialSettings, SettingsCategory } from './types/settings.js';
15
+ import { type FlowDropInstance } from './stores/instanceContainer.svelte.js';
16
+ import { type DraftStorageOption } from './services/draftStorage.js';
17
+ import type { PartialSettings, SettingsCategory, SurfacePlacement } from './types/settings.js';
17
18
  import type { NavbarAction } from './types/navbar.js';
18
19
  export type { NavbarAction };
19
20
  /**
@@ -38,20 +39,36 @@ export interface FlowDropMountOptions {
38
39
  showNavbar?: boolean;
39
40
  /** Disable the node sidebar */
40
41
  disableSidebar?: boolean;
41
- /** Lock the workflow (prevent changes) */
42
- lockWorkflow?: boolean;
43
- /** Read-only mode */
44
- readOnly?: boolean;
42
+ /**
43
+ * Default host for the config panel: `sidebar` (default), `modal`, or
44
+ * `below`. Seeds the user setting on first load; a later user change wins.
45
+ */
46
+ configPlacement?: SurfacePlacement;
47
+ /**
48
+ * Default host for the console / AI Assistant group: `below` (default),
49
+ * `sidebar`, or `modal`. Seeds the user setting on first load; a later user
50
+ * change wins.
51
+ */
52
+ consolePlacement?: SurfacePlacement;
53
+ /**
54
+ * Editor interaction mode. Replaces the former `readOnly` + `lockWorkflow`
55
+ * mount options (2.0). `'edit'` (default) allows editing; `'readonly'` and
56
+ * `'locked'` disable all canvas interaction (identical behavior today — see
57
+ * App's `mode` prop JSDoc for the full matrix). Migration: `readOnly: true`
58
+ * → `mode: 'readonly'`; `lockWorkflow: true` → `mode: 'locked'`.
59
+ * @default 'edit'
60
+ */
61
+ mode?: 'edit' | 'readonly' | 'locked';
45
62
  /** Pipeline ID for status display */
46
63
  pipelineId?: string;
47
- /** Node execution statuses */
48
- nodeStatuses?: Record<string, 'pending' | 'running' | 'completed' | 'error'>;
49
64
  /** Custom navbar title */
50
65
  navbarTitle?: string;
51
66
  /** Custom navbar actions */
52
67
  navbarActions?: NavbarAction[];
53
68
  /** Show settings gear icon in navbar */
54
69
  showSettings?: boolean;
70
+ /** Show the "Connected" status indicator in the navbar (default: true) */
71
+ showStatus?: boolean;
55
72
  /** Authentication provider for API requests */
56
73
  authProvider?: AuthProvider;
57
74
  /** Event handlers for workflow lifecycle */
@@ -60,8 +77,28 @@ export interface FlowDropMountOptions {
60
77
  features?: FlowDropFeatures;
61
78
  /** Initial settings overrides (theme, behavior, editor, ui, api) */
62
79
  settings?: PartialSettings;
63
- /** Custom storage key for localStorage drafts */
80
+ /** Custom storage key for workflow drafts */
64
81
  draftStorageKey?: string;
82
+ /**
83
+ * Where workflow drafts are persisted.
84
+ *
85
+ * - `'local'` (default): `localStorage` — drafts survive reloads and remain
86
+ * stored on the device even after the tab or browser is closed, until
87
+ * saved or cleared. Call `clearAllDrafts()` on logout for shared devices.
88
+ * - `'session'`: `sessionStorage` — drafts are scoped to the tab and removed
89
+ * when it closes (they do not survive crash-and-reopen).
90
+ * - A custom `DraftStorageAdapter` — note the adapter interface is
91
+ * synchronous, so it suits in-memory stores and write-through caches;
92
+ * async backends (IndexedDB, network) need a sync cache in front.
93
+ *
94
+ * The resolved adapter is captured per mount, so multiple FlowDrop
95
+ * instances on one page can use different backends.
96
+ *
97
+ * Note: neither built-in backend protects against same-origin script access
98
+ * (XSS). End users can additionally opt out of draft persistence at runtime
99
+ * via the "Store Drafts in Browser" behavior setting.
100
+ */
101
+ draftStorage?: DraftStorageOption;
65
102
  /** Custom workflow format adapters to register */
66
103
  formatAdapters?: WorkflowFormatAdapter[];
67
104
  /** Visual theme — named built-in ('default' | 'minimal') or custom theme object */
@@ -72,11 +109,32 @@ export interface FlowDropMountOptions {
72
109
  showSettingsSyncButton?: boolean;
73
110
  /** Show the reset buttons in the settings modal */
74
111
  showSettingsResetButton?: boolean;
112
+ /**
113
+ * Identifier for this FlowDrop instance.
114
+ *
115
+ * When omitted, the first mount on the page becomes the *default* instance
116
+ * (id `default`). Additional mounts get auto-generated ids (`fd-1`,
117
+ * `fd-2`, …). Every instance scopes its draft/panel storage keys by id
118
+ * (`flowdrop:draft:<id>:…`); the default instance migrates 1.x bare keys
119
+ * on first read.
120
+ *
121
+ * Pass an explicit id whenever you mount more than one editor with drafts
122
+ * enabled, so keys stay stable across page loads.
123
+ */
124
+ instanceId?: string;
75
125
  }
76
126
  /**
77
127
  * Return type for mounted FlowDrop app
78
128
  */
79
129
  export interface MountedFlowDropApp {
130
+ /**
131
+ * This mount's state container — workflow, history, playground, interrupts,
132
+ * categories, and the rest. The 2.0 replacement for the removed
133
+ * module-level store APIs: where 1.x called `workflowActions.addNode(...)`
134
+ * or `historyService.undo()`, call `app.instance.workflow.addNode(...)` /
135
+ * `app.instance.history.undo()` on the mount that owns the editor.
136
+ */
137
+ instance: FlowDropInstance;
80
138
  /**
81
139
  * Destroy the app and clean up resources
82
140
  */
@@ -102,7 +160,8 @@ export interface MountedFlowDropApp {
102
160
  */
103
161
  export: () => void;
104
162
  /**
105
- * Clear all FlowDrop workflow drafts from `localStorage`.
163
+ * Clear all FlowDrop workflow drafts from the configured draft storage
164
+ * (`localStorage` unless changed via the `draftStorage` mount option).
106
165
  *
107
166
  * Removes every key beginning with `flowdrop:draft:` plus the custom
108
167
  * `draftStorageKey` configured at mount time (if any). Call this from
@@ -148,12 +207,20 @@ export declare function mountFlowDropApp(container: HTMLElement, options?: FlowD
148
207
  * @returns Promise resolving to a MountedFlowDropApp instance
149
208
  */
150
209
  export declare function mountWorkflowEditor(container: HTMLElement, options?: {
210
+ /** Initial workflow to load into the editor */
151
211
  workflow?: Workflow;
152
- nodes?: NodeMetadata[];
153
212
  endpointConfig?: EndpointConfig;
154
213
  portConfig?: PortConfig;
155
214
  categories?: CategoryDefinition[];
156
215
  authProvider?: AuthProvider;
216
+ /** Instance identifier — see {@link FlowDropMountOptions.instanceId}. */
217
+ instanceId?: string;
218
+ /**
219
+ * Register the built-in markdown/code/template editors. Batteries-included
220
+ * by default (chunks load lazily). See {@link FlowDropFeatures.builtinEditors}.
221
+ * @default true
222
+ */
223
+ builtinEditors?: boolean;
157
224
  }): Promise<MountedFlowDropApp>;
158
225
  /**
159
226
  * Unmount a FlowDrop app