@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
@@ -0,0 +1,198 @@
1
+ /**
2
+ * Drafter — a fresh, modern "drafting workspace" skin for the whole editor
3
+ * environment (see ref-image.png): a fresh white shell around a mint/aqua
4
+ * canvas with soft cyan/teal technical grid lines, crisp engineering geometry
5
+ * and clean teal-ink text — not a neutral admin UI and not an all-cyan shell.
6
+ *
7
+ * Unlike a canvas-only skin, Drafter themes the entire shell so it reads as one
8
+ * designed environment:
9
+ * - App chrome (navbar, sidebars, inspector, status bars, form fields) stays
10
+ * white/near-white for a clean fresh product feel.
11
+ * - The mint/aqua personality lives in the canvas, node glass, focus rings,
12
+ * selected states and small technical accents.
13
+ * - Disabled/read-only surfaces use quiet light grey so state remains obvious.
14
+ * - Borders are mostly neutral hairlines; strong/focus borders + node outlines
15
+ * are teal/cyan ink (--fd-ring / --fd-border-strong / --fd-node-border).
16
+ * - Focus rings are cyan (--fd-ring), not the default blue.
17
+ * - Nodes are frosted glass with a faint inner highlight; the minimap + zoom
18
+ * controls share the same vocabulary.
19
+ * - Note/instruction cards read as cool annotations (translucent tint + slate
20
+ * ink border), never as a filled "success" card.
21
+ * - Emerald/green is reserved for primary actions, selection and live edges
22
+ * (--fd-primary) — it is not used for every outline.
23
+ *
24
+ * Data-type port colors and category icon colors are left untouched so they keep
25
+ * their full color against the draft surface. The square grid is rendered by
26
+ * WorkflowEditor via config.canvas.grid = 'lines'; --fd-grid-pattern-color
27
+ * colors it. Ships light + dark variants.
28
+ */
29
+ export const drafterSkin = {
30
+ tokens: {
31
+ /* ----- Shell surfaces: fresh white shell + pale mint chrome ----- */
32
+ /* Neutral greys read as cold admin chrome and fight the mint canvas, so the
33
+ quiet surfaces carry a faint aqua-mint tint instead. muted-foreground is
34
+ a darker teal-slate (≈6.5:1 on white) so secondary/helper text clears
35
+ WCAG AA comfortably — grey body text was the accessibility problem. */
36
+ background: '#ffffff',
37
+ foreground: '#10201c',
38
+ muted: '#eaf5f0',
39
+ 'muted-foreground': '#46635b',
40
+ subtle: '#e1f0ea',
41
+ card: '#ffffff',
42
+ 'card-foreground': '#10201c',
43
+ header: '#ffffff',
44
+ 'header-foreground': '#10201c',
45
+ 'header-gradient': 'linear-gradient(180deg, #ffffff 0%, #fbfefd 100%)',
46
+ 'surface-tint': 'rgba(20, 184, 166, 0.015)',
47
+ /* White sidebars/inspector with only a whisper of technical glass */
48
+ 'panel-bg': 'rgba(255, 255, 255, 0.94)',
49
+ 'panel-backdrop-filter': 'blur(10px) saturate(1.04)',
50
+ backdrop: 'rgba(255, 255, 255, 0.92)',
51
+ /* ----- Borders: soft mint hairlines; strong/focus = teal-cyan accent ----- */
52
+ border: '#d3e6df',
53
+ 'border-muted': '#e4f0eb',
54
+ 'border-strong': 'rgba(15, 118, 110, 0.42)',
55
+ ring: '#06b6d4',
56
+ /* ----- Canvas: fresh aqua-mint, soft cyan/teal square grid ----- */
57
+ 'canvas-bg': '#fbfefd',
58
+ 'grid-pattern-color': 'rgba(20, 184, 166, 0.08)',
59
+ /* ----- Nodes: frosted glass, faint inner highlight ----- */
60
+ 'node-bg': 'rgba(247, 252, 250, 0.7)',
61
+ 'node-header-bg': 'rgba(214, 245, 236, 0.6)',
62
+ 'node-backdrop-filter': 'blur(10px) saturate(1.15)',
63
+ 'node-radius': '2px',
64
+ 'node-shadow': 'inset 0 1px 0 0 rgba(255, 255, 255, 0.6)',
65
+ 'node-shadow-hover': 'inset 0 1px 0 0 rgba(255, 255, 255, 0.85)',
66
+ 'node-border': '#0f766e',
67
+ 'node-border-hover': '#0c5f59',
68
+ 'node-border-width': '1.25px',
69
+ /* Header divider matches the node outline ink (tracks light/dark node-border) */
70
+ 'node-header-divider-color': 'var(--fd-node-border)',
71
+ 'handle-border': '#ffffff',
72
+ /* Notes read as cool annotations, not filled success cards */
73
+ 'note-border': '#5b7891',
74
+ 'note-border-hover': '#48617a',
75
+ /* Status hues tuned to the cool palette: danger = rose (teal's warm
76
+ complement, not a generic red), warning = golden amber. Success/info stay
77
+ on the emerald/cyan family so they read as part of the theme. */
78
+ success: '#0d9488',
79
+ 'success-hover': '#0f766e',
80
+ info: '#0891b2',
81
+ 'info-hover': '#0e7490',
82
+ warning: '#d97706',
83
+ 'warning-hover': '#b45309',
84
+ error: '#e11d48',
85
+ 'error-hover': '#be123c',
86
+ /* Status/accent tints are FLAT + OPAQUE (not alpha) so the action buttons
87
+ that use them as fills (form add/move/delete, canvas toggles, secondary)
88
+ read as solid chips, never see-through to the grid. Values are the opaque
89
+ equivalent of the former translucent tints over the white shell. */
90
+ 'info-muted': '#e6f4f7',
91
+ 'success-muted': '#e7f4f3',
92
+ 'warning-muted': '#faefe1',
93
+ 'error-muted': '#fce8ed',
94
+ /* ----- Crisp drafting geometry + flat chrome (2–6px radius, no soft shadow) ----- */
95
+ 'radius-sm': '2px',
96
+ 'radius-md': '3px',
97
+ 'radius-lg': '4px',
98
+ 'radius-xl': '6px',
99
+ /* Form controls + their group containers (fields, array item boxes,
100
+ fieldsets) get the sharpest 2px corner so the config panel reads as
101
+ crisp drafting geometry, not rounded admin chrome. */
102
+ 'control-radius': '2px',
103
+ 'scrollbar-radius': '0',
104
+ 'shadow-sm': 'none',
105
+ 'shadow-md': 'none',
106
+ /* ----- Canvas overlays: light, instrument-like ----- */
107
+ 'minimap-bg': 'rgba(255, 255, 255, 0.72)',
108
+ 'minimap-mask-bg': 'rgba(15, 118, 110, 0.08)',
109
+ 'minimap-mask-stroke': 'rgba(15, 118, 110, 0.35)',
110
+ 'minimap-node-bg': 'rgba(15, 118, 110, 0.3)',
111
+ 'minimap-node-stroke': 'rgba(15, 118, 110, 0.45)',
112
+ 'controls-button-bg': '#ffffff',
113
+ 'controls-button-bg-hover': '#ccfbf1',
114
+ 'controls-button-color': '#0f766e',
115
+ 'controls-button-color-hover': '#0c5f59',
116
+ 'controls-button-border': 'rgba(15, 118, 110, 0.25)',
117
+ /* ----- Secondary = mint, accent = cyan, primary = the one allowed green ----- */
118
+ secondary: '#e4f1ed',
119
+ 'secondary-hover': '#cfe6e0',
120
+ 'secondary-foreground': '#0f3d36',
121
+ accent: '#06b6d4',
122
+ 'accent-hover': '#0891b2',
123
+ 'accent-foreground': '#ffffff',
124
+ 'accent-muted': '#e1f6fa',
125
+ primary: '#10b981',
126
+ 'primary-hover': '#059669',
127
+ 'primary-foreground': '#ffffff',
128
+ 'primary-muted': '#def5ed'
129
+ },
130
+ darkTokens: {
131
+ /* ----- Shell surfaces: deep teal-slate glass ----- */
132
+ background: '#0e2421',
133
+ foreground: '#d8f0ea',
134
+ muted: 'rgba(20, 60, 54, 0.6)',
135
+ 'muted-foreground': '#8fb3aa',
136
+ subtle: 'rgba(13, 47, 44, 0.7)',
137
+ card: 'rgba(18, 42, 38, 0.96)',
138
+ 'card-foreground': '#d8f0ea',
139
+ header: 'rgba(13, 40, 37, 0.7)',
140
+ 'header-foreground': '#d8f0ea',
141
+ 'header-gradient': 'linear-gradient(180deg, rgba(17, 42, 38, 0.9) 0%, rgba(12, 33, 30, 0.9) 100%)',
142
+ 'surface-tint': 'rgba(45, 212, 191, 0.04)',
143
+ 'panel-bg': 'rgba(14, 36, 33, 0.8)',
144
+ 'panel-backdrop-filter': 'blur(14px) saturate(1.2)',
145
+ backdrop: 'rgba(11, 31, 28, 0.8)',
146
+ border: 'rgba(45, 212, 191, 0.22)',
147
+ 'border-muted': 'rgba(45, 212, 191, 0.12)',
148
+ 'border-strong': 'rgba(45, 212, 191, 0.4)',
149
+ ring: '#22d3ee',
150
+ 'canvas-bg': '#0b1f1c',
151
+ 'grid-pattern-color': 'rgba(45, 212, 191, 0.16)',
152
+ 'node-bg': 'rgba(17, 38, 35, 0.62)',
153
+ 'node-header-bg': 'rgba(13, 47, 44, 0.6)',
154
+ 'node-backdrop-filter': 'blur(10px) saturate(1.2)',
155
+ 'node-shadow': 'inset 0 1px 0 0 rgba(255, 255, 255, 0.08)',
156
+ 'node-shadow-hover': 'inset 0 1px 0 0 rgba(255, 255, 255, 0.14)',
157
+ 'node-border': '#0d9488',
158
+ 'node-border-hover': '#2dd4bf',
159
+ 'handle-border': '#0b1f1c',
160
+ 'note-border': '#7d96b0',
161
+ 'note-border-hover': '#9fb4cb',
162
+ success: '#2dd4bf',
163
+ 'success-hover': '#5eead4',
164
+ info: '#22d3ee',
165
+ 'info-hover': '#67e8f9',
166
+ warning: '#fbbf24',
167
+ 'warning-hover': '#fcd34d',
168
+ error: '#fb7185',
169
+ 'error-hover': '#fda4af',
170
+ /* Flat + opaque tints (opaque equivalent of the former alpha tints over the
171
+ deep teal-slate shell) so button fills never go see-through. */
172
+ 'info-muted': '#10393a',
173
+ 'success-muted': '#123934',
174
+ 'warning-muted': '#2f3a21',
175
+ 'error-muted': '#2a2d2d',
176
+ 'minimap-bg': 'rgba(11, 31, 28, 0.7)',
177
+ 'minimap-mask-bg': 'rgba(45, 212, 191, 0.06)',
178
+ 'minimap-mask-stroke': 'rgba(45, 212, 191, 0.3)',
179
+ 'minimap-node-bg': 'rgba(45, 212, 191, 0.28)',
180
+ 'minimap-node-stroke': 'rgba(45, 212, 191, 0.45)',
181
+ 'controls-button-bg': '#102522',
182
+ 'controls-button-bg-hover': '#0d2d2a',
183
+ 'controls-button-color': '#2dd4bf',
184
+ 'controls-button-color-hover': '#5eead4',
185
+ 'controls-button-border': 'rgba(45, 212, 191, 0.3)',
186
+ secondary: '#0d2d2a',
187
+ 'secondary-hover': '#133a34',
188
+ 'secondary-foreground': '#d8f0ea',
189
+ accent: '#22d3ee',
190
+ 'accent-hover': '#67e8f9',
191
+ 'accent-foreground': '#03291c',
192
+ 'accent-muted': '#113d3e',
193
+ primary: '#34d399',
194
+ 'primary-hover': '#6ee7b7',
195
+ 'primary-foreground': '#03291c',
196
+ 'primary-muted': '#144034'
197
+ }
198
+ };
@@ -1,6 +1,7 @@
1
1
  import type { FlowDropSkin, FlowDropSkinName } from '../types/skin';
2
2
  import { defaultSkin } from './default';
3
3
  import { slateSkin } from './slate';
4
+ import { drafterSkin } from './drafter';
4
5
  /**
5
6
  * Resolve a skin prop to a complete FlowDropSkin object.
6
7
  *
@@ -10,4 +11,4 @@ import { slateSkin } from './slate';
10
11
  * → minimal skin tokens + { primary: '#e11d48' }
11
12
  */
12
13
  export declare function resolveSkin(skin: FlowDropSkin | FlowDropSkinName | undefined): FlowDropSkin;
13
- export { defaultSkin, slateSkin };
14
+ export { defaultSkin, slateSkin, drafterSkin };
@@ -1,8 +1,10 @@
1
1
  import { defaultSkin } from './default';
2
2
  import { slateSkin } from './slate';
3
+ import { drafterSkin } from './drafter';
3
4
  const builtinSkins = {
4
5
  default: defaultSkin,
5
- slate: slateSkin
6
+ slate: slateSkin,
7
+ drafter: drafterSkin
6
8
  };
7
9
  /**
8
10
  * Resolve a skin prop to a complete FlowDropSkin object.
@@ -27,4 +29,4 @@ export function resolveSkin(skin) {
27
29
  }
28
30
  return skin;
29
31
  }
30
- export { defaultSkin, slateSkin };
32
+ export { defaultSkin, slateSkin, drafterSkin };
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Per-instance API context for FlowDrop.
3
+ *
4
+ * Holds the endpoint configuration and auth provider for one FlowDrop
5
+ * instance and lazily exposes an {@link EnhancedFlowDropApiClient} built from
6
+ * them. Replaces the former module-level singleton in `services/api.ts`:
7
+ * each instance owns its own configuration so multiple editors can talk to
8
+ * different backends on a single page.
9
+ *
10
+ * Resolved in components via `getInstance().api`; configured at mount time by
11
+ * `mountFlowDropApp` / `mountPlayground` (or `<App>` when used directly).
12
+ *
13
+ * @module stores/apiContext
14
+ */
15
+ import type { EndpointConfig } from '../config/endpoints.js';
16
+ import type { AuthProvider } from '../types/auth.js';
17
+ import { EnhancedFlowDropApiClient } from '../api/enhanced-client.js';
18
+ /**
19
+ * Per-instance endpoint configuration, auth provider, and API client.
20
+ *
21
+ * The config is `null` until {@link configure} is called — mirroring the
22
+ * legacy "throws if not configured" contract. The client is created lazily on
23
+ * first access and rebuilt whenever the configuration changes.
24
+ */
25
+ export declare class ApiContext {
26
+ #private;
27
+ /** The current endpoint configuration, or null until {@link configure}d. */
28
+ get config(): EndpointConfig | null;
29
+ /** The current auth provider (defaults to {@link NoAuthProvider}). */
30
+ get authProvider(): AuthProvider;
31
+ /**
32
+ * The API client for this instance, created lazily from the configured
33
+ * endpoints and auth provider.
34
+ *
35
+ * @throws Error if the context has not been configured yet.
36
+ */
37
+ get client(): EnhancedFlowDropApiClient;
38
+ /**
39
+ * Configure this instance's endpoints and (optionally) auth provider.
40
+ * Discards any previously built client so the next access rebuilds it.
41
+ */
42
+ configure(config: EndpointConfig, authProvider?: AuthProvider): void;
43
+ /**
44
+ * Swap the auth provider at runtime — e.g. on login or logout — without
45
+ * reconfiguring endpoints or remounting. Propagates to the live client so
46
+ * in-flight components keep working against the same instance.
47
+ *
48
+ * Per-instance services read `fd.api.authProvider` per request, so they pick
49
+ * up the new provider on their next call automatically.
50
+ *
51
+ * @param authProvider - The new authentication provider
52
+ */
53
+ setAuthProvider(authProvider: AuthProvider): void;
54
+ /** Whether {@link configure} has been called with a usable config. */
55
+ isConfigured(): boolean;
56
+ }
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Per-instance API context for FlowDrop.
3
+ *
4
+ * Holds the endpoint configuration and auth provider for one FlowDrop
5
+ * instance and lazily exposes an {@link EnhancedFlowDropApiClient} built from
6
+ * them. Replaces the former module-level singleton in `services/api.ts`:
7
+ * each instance owns its own configuration so multiple editors can talk to
8
+ * different backends on a single page.
9
+ *
10
+ * Resolved in components via `getInstance().api`; configured at mount time by
11
+ * `mountFlowDropApp` / `mountPlayground` (or `<App>` when used directly).
12
+ *
13
+ * @module stores/apiContext
14
+ */
15
+ import { NoAuthProvider } from '../types/auth.js';
16
+ import { EnhancedFlowDropApiClient } from '../api/enhanced-client.js';
17
+ /**
18
+ * Per-instance endpoint configuration, auth provider, and API client.
19
+ *
20
+ * The config is `null` until {@link configure} is called — mirroring the
21
+ * legacy "throws if not configured" contract. The client is created lazily on
22
+ * first access and rebuilt whenever the configuration changes.
23
+ */
24
+ export class ApiContext {
25
+ #config = null;
26
+ #authProvider = new NoAuthProvider();
27
+ #client = null;
28
+ /** The current endpoint configuration, or null until {@link configure}d. */
29
+ get config() {
30
+ return this.#config;
31
+ }
32
+ /** The current auth provider (defaults to {@link NoAuthProvider}). */
33
+ get authProvider() {
34
+ return this.#authProvider;
35
+ }
36
+ /**
37
+ * The API client for this instance, created lazily from the configured
38
+ * endpoints and auth provider.
39
+ *
40
+ * @throws Error if the context has not been configured yet.
41
+ */
42
+ get client() {
43
+ if (!this.#config) {
44
+ throw new Error('Endpoint configuration not set. Configure the instance via fd.api.configure() ' +
45
+ '(done automatically by mountFlowDropApp / <App>) before using fd.api.client.');
46
+ }
47
+ return (this.#client ??= new EnhancedFlowDropApiClient(this.#config, this.#authProvider));
48
+ }
49
+ /**
50
+ * Configure this instance's endpoints and (optionally) auth provider.
51
+ * Discards any previously built client so the next access rebuilds it.
52
+ */
53
+ configure(config, authProvider) {
54
+ this.#config = config;
55
+ if (authProvider) {
56
+ this.#authProvider = authProvider;
57
+ }
58
+ // Drop the cached client so it picks up the new config/auth on next access.
59
+ this.#client = null;
60
+ }
61
+ /**
62
+ * Swap the auth provider at runtime — e.g. on login or logout — without
63
+ * reconfiguring endpoints or remounting. Propagates to the live client so
64
+ * in-flight components keep working against the same instance.
65
+ *
66
+ * Per-instance services read `fd.api.authProvider` per request, so they pick
67
+ * up the new provider on their next call automatically.
68
+ *
69
+ * @param authProvider - The new authentication provider
70
+ */
71
+ setAuthProvider(authProvider) {
72
+ this.#authProvider = authProvider;
73
+ // Keep the cached client (and its in-flight consumers) in sync.
74
+ this.#client?.setAuthProvider(authProvider);
75
+ }
76
+ /** Whether {@link configure} has been called with a usable config. */
77
+ isConfigured() {
78
+ return Boolean(this.#config);
79
+ }
80
+ }
@@ -3,30 +3,35 @@
3
3
  *
4
4
  * Manages category definitions with merged defaults and API-provided overrides.
5
5
  * Exposes lookup helpers for icon, color, and label resolution.
6
+ *
7
+ * The reactive state lives in the {@link CategoriesStore} class — one per
8
+ * FlowDrop instance, resolved in components via `getInstance().categories`.
9
+ *
10
+ * @module stores/categoriesStore
6
11
  */
7
12
  import type { CategoryDefinition, NodeCategory } from '../types/index.js';
8
13
  /**
9
- * Get all category definitions, sorted by weight.
10
- */
11
- export declare function getCategories(): CategoryDefinition[];
12
- /**
13
- * Initialize categories with API data, merging with defaults.
14
- * API categories override defaults by name; custom categories are appended.
15
- */
16
- export declare function initializeCategories(apiCategories: CategoryDefinition[]): void;
17
- /**
18
- * Get the display label for a category.
19
- */
20
- export declare function getCategoryLabel(category: NodeCategory): string;
21
- /**
22
- * Get the icon for a category.
23
- */
24
- export declare function getCategoryIcon(category: NodeCategory): string;
25
- /**
26
- * Get the color token for a category.
27
- */
28
- export declare function getCategoryColor(category: NodeCategory): string;
29
- /**
30
- * Get the full category definition, or undefined if not found.
14
+ * Per-instance category definitions with a derived name→definition lookup.
15
+ *
16
+ * Reads go through getters backed by `$state`/`$derived`, so they track
17
+ * reactively in templates and `$derived`, exactly like the legacy
18
+ * module-level functions did.
31
19
  */
32
- export declare function getCategoryDefinition(category: NodeCategory): CategoryDefinition | undefined;
20
+ export declare class CategoriesStore {
21
+ #private;
22
+ /** All category definitions, sorted by weight (reactive). */
23
+ get categories(): CategoryDefinition[];
24
+ /**
25
+ * Initialize categories with API data, merging with defaults.
26
+ * API categories override defaults by name; custom categories are appended.
27
+ */
28
+ initialize(apiCategories: CategoryDefinition[]): void;
29
+ /** Get the display label for a category. */
30
+ getLabel(category: NodeCategory): string;
31
+ /** Get the icon for a category. */
32
+ getIcon(category: NodeCategory): string;
33
+ /** Get the color token for a category. */
34
+ getColor(category: NodeCategory): string;
35
+ /** Get the full category definition, or undefined if not found. */
36
+ getDefinition(category: NodeCategory): CategoryDefinition | undefined;
37
+ }
@@ -3,75 +3,80 @@
3
3
  *
4
4
  * Manages category definitions with merged defaults and API-provided overrides.
5
5
  * Exposes lookup helpers for icon, color, and label resolution.
6
+ *
7
+ * The reactive state lives in the {@link CategoriesStore} class — one per
8
+ * FlowDrop instance, resolved in components via `getInstance().categories`.
9
+ *
10
+ * @module stores/categoriesStore
6
11
  */
7
12
  import { DEFAULT_CATEGORIES } from '../config/defaultCategories.js';
13
+ // =========================================================================
14
+ // CategoriesStore (per-instance reactive state)
15
+ // =========================================================================
8
16
  /**
9
- * Internal reactive state holding the category definitions.
10
- * Initialized with defaults, updated when API data is fetched.
11
- */
12
- let categoriesState = $state([...DEFAULT_CATEGORIES]);
13
- /**
14
- * Derived lookup map: category name → CategoryDefinition
17
+ * Per-instance category definitions with a derived name→definition lookup.
18
+ *
19
+ * Reads go through getters backed by `$state`/`$derived`, so they track
20
+ * reactively in templates and `$derived`, exactly like the legacy
21
+ * module-level functions did.
15
22
  */
16
- let categoryMap = $derived((() => {
17
- const map = new Map();
18
- for (const cat of categoriesState) {
19
- map.set(cat.name, cat);
23
+ export class CategoriesStore {
24
+ /**
25
+ * Reactive state holding the category definitions.
26
+ * Initialized with defaults, updated when API data is fetched.
27
+ */
28
+ #categories = $state([...DEFAULT_CATEGORIES]);
29
+ /** Derived lookup map: category name → CategoryDefinition. */
30
+ #categoryMap = $derived((() => {
31
+ const map = new Map();
32
+ for (const cat of this.#categories) {
33
+ map.set(cat.name, cat);
34
+ }
35
+ return map;
36
+ })());
37
+ /** All category definitions, sorted by weight (reactive). */
38
+ get categories() {
39
+ return [...this.#categories].sort((a, b) => (a.weight ?? 999) - (b.weight ?? 999));
20
40
  }
21
- return map;
22
- })());
23
- /**
24
- * Get all category definitions, sorted by weight.
25
- */
26
- export function getCategories() {
27
- return [...categoriesState].sort((a, b) => (a.weight ?? 999) - (b.weight ?? 999));
28
- }
29
- /**
30
- * Initialize categories with API data, merging with defaults.
31
- * API categories override defaults by name; custom categories are appended.
32
- */
33
- export function initializeCategories(apiCategories) {
34
- const defaultMap = new Map();
35
- for (const cat of DEFAULT_CATEGORIES) {
36
- defaultMap.set(cat.name, cat);
41
+ /**
42
+ * Initialize categories with API data, merging with defaults.
43
+ * API categories override defaults by name; custom categories are appended.
44
+ */
45
+ initialize(apiCategories) {
46
+ const defaultMap = new Map();
47
+ for (const cat of DEFAULT_CATEGORIES) {
48
+ defaultMap.set(cat.name, cat);
49
+ }
50
+ // API categories override defaults by name
51
+ for (const cat of apiCategories) {
52
+ defaultMap.set(cat.name, {
53
+ ...defaultMap.get(cat.name),
54
+ ...cat
55
+ });
56
+ }
57
+ this.#categories = Array.from(defaultMap.values());
37
58
  }
38
- // API categories override defaults by name
39
- for (const cat of apiCategories) {
40
- defaultMap.set(cat.name, {
41
- ...defaultMap.get(cat.name),
42
- ...cat
43
- });
59
+ /** Get the display label for a category. */
60
+ getLabel(category) {
61
+ const def = this.#categoryMap.get(category);
62
+ if (def?.label)
63
+ return def.label;
64
+ // Auto-generate: capitalize each word
65
+ return category
66
+ .split(/[\s_-]+/)
67
+ .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
68
+ .join(' ');
69
+ }
70
+ /** Get the icon for a category. */
71
+ getIcon(category) {
72
+ return this.#categoryMap.get(category)?.icon ?? 'mdi:folder';
73
+ }
74
+ /** Get the color token for a category. */
75
+ getColor(category) {
76
+ return this.#categoryMap.get(category)?.color ?? 'var(--fd-node-slate)';
77
+ }
78
+ /** Get the full category definition, or undefined if not found. */
79
+ getDefinition(category) {
80
+ return this.#categoryMap.get(category);
44
81
  }
45
- categoriesState = Array.from(defaultMap.values());
46
- }
47
- /**
48
- * Get the display label for a category.
49
- */
50
- export function getCategoryLabel(category) {
51
- const def = categoryMap.get(category);
52
- if (def?.label)
53
- return def.label;
54
- // Auto-generate: capitalize each word
55
- return category
56
- .split(/[\s_-]+/)
57
- .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
58
- .join(' ');
59
- }
60
- /**
61
- * Get the icon for a category.
62
- */
63
- export function getCategoryIcon(category) {
64
- return categoryMap.get(category)?.icon ?? 'mdi:folder';
65
- }
66
- /**
67
- * Get the color token for a category.
68
- */
69
- export function getCategoryColor(category) {
70
- return categoryMap.get(category)?.color ?? 'var(--fd-node-slate)';
71
- }
72
- /**
73
- * Get the full category definition, or undefined if not found.
74
- */
75
- export function getCategoryDefinition(category) {
76
- return categoryMap.get(category);
77
82
  }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Per-component access to the FlowDrop instance container.
3
+ *
4
+ * Components call `getInstance()` during init to resolve the instance
5
+ * provided by the nearest `<App>` / `<WorkflowEditor>` via Svelte context.
6
+ * When no provider exists (legacy single-instance usage), it falls back to
7
+ * the browser-only default instance.
8
+ *
9
+ * @module stores/getInstance
10
+ */
11
+ import { type FlowDropInstance } from './instanceContainer.svelte.js';
12
+ /**
13
+ * Context key under which the FlowDrop instance is provided.
14
+ * A Symbol (matching `messages/context.ts`) so consumer context can't collide.
15
+ */
16
+ export declare const FLOWDROP_INSTANCE_KEY: unique symbol;
17
+ /**
18
+ * Resolve the FlowDrop instance for the current component tree.
19
+ *
20
+ * Must be called during component initialisation (it reads Svelte context).
21
+ *
22
+ * Unlike the messages-context fallback (immutable defaults, silent), this
23
+ * fallback hands out *mutable shared state*, so it warns once in dev and
24
+ * throws during SSR rather than leaking state across server requests.
25
+ */
26
+ export declare function getInstance(): FlowDropInstance;
27
+ /**
28
+ * Resolve and provide the FlowDrop instance for a provider component
29
+ * (`<App>`, `<WorkflowEditor>`, `<Playground>`, `<PlaygroundStudio>`).
30
+ *
31
+ * Must be called during component initialisation. Resolution order:
32
+ * 1. An explicitly passed instance (from a mount function or consumer)
33
+ * 2. An instance already in context (provider nested inside another provider)
34
+ * 3. Browser: the page-default instance (legacy single-instance behavior)
35
+ * Server: a fresh per-render instance (no cross-request leakage)
36
+ *
37
+ * The resolved instance is (re-)provided via context for all children.
38
+ */
39
+ export declare function provideInstance(explicit?: FlowDropInstance): FlowDropInstance;