@flowdrop/flowdrop 2.13.0 → 2.14.0

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 (294) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/dist/commands/executor.js +58 -8
  3. package/dist/commands/parser.js +3 -3
  4. package/dist/commands/types.d.ts +2 -0
  5. package/dist/components/App.svelte +1 -1
  6. package/dist/components/App.svelte.d.ts +1 -1
  7. package/dist/components/Button.svelte +7 -7
  8. package/dist/components/Button.svelte.d.ts +10 -0
  9. package/dist/components/CanvasBanner.svelte +19 -6
  10. package/dist/components/CanvasBanner.svelte.d.ts +15 -3
  11. package/dist/components/CanvasContextMenu.svelte +9 -9
  12. package/dist/components/CanvasContextMenu.svelte.d.ts +10 -0
  13. package/dist/components/CanvasToolbar.svelte +8 -7
  14. package/dist/components/CanvasToolbar.svelte.d.ts +10 -0
  15. package/dist/components/CanvasZoomControls.svelte +10 -9
  16. package/dist/components/CanvasZoomControls.svelte.d.ts +13 -0
  17. package/dist/components/ConfigForm.svelte +9 -17
  18. package/dist/components/ConfigForm.svelte.d.ts +10 -0
  19. package/dist/components/ConfigPanel.svelte +9 -5
  20. package/dist/components/ConfigPanel.svelte.d.ts +10 -0
  21. package/dist/components/EditorStatusBar.svelte +6 -5
  22. package/dist/components/EditorStatusBar.svelte.d.ts +7 -0
  23. package/dist/components/FlowDropEdge.svelte +15 -12
  24. package/dist/components/FlowDropEdge.svelte.d.ts +16 -0
  25. package/dist/components/InterfaceTag.svelte +13 -15
  26. package/dist/components/InterfaceTag.svelte.d.ts +19 -0
  27. package/dist/components/LoadingSpinner.svelte +8 -2
  28. package/dist/components/LoadingSpinner.svelte.d.ts +9 -0
  29. package/dist/components/Logo.svelte +11 -0
  30. package/dist/components/Logo.svelte.d.ts +9 -0
  31. package/dist/components/LogoWordmark.svelte +8 -3
  32. package/dist/components/LogoWordmark.svelte.d.ts +9 -0
  33. package/dist/components/LoopbackLanes.svelte +12 -6
  34. package/dist/components/LoopbackLanes.svelte.d.ts +13 -0
  35. package/dist/components/MarkdownDisplay.svelte +10 -3
  36. package/dist/components/MarkdownDisplay.svelte.d.ts +11 -0
  37. package/dist/components/Navbar.svelte +13 -5
  38. package/dist/components/Navbar.svelte.d.ts +14 -0
  39. package/dist/components/NodeInspector.svelte +7 -8
  40. package/dist/components/NodeInspector.svelte.d.ts +10 -0
  41. package/dist/components/NodeSidebar.svelte +9 -3
  42. package/dist/components/NodeSidebar.svelte.d.ts +10 -0
  43. package/dist/components/NodeStatusOverlay.svelte +30 -19
  44. package/dist/components/NodeStatusOverlay.svelte.d.ts +19 -0
  45. package/dist/components/NodeSwapPicker.svelte +1 -1
  46. package/dist/components/RunBar.svelte +10 -13
  47. package/dist/components/RunBar.svelte.d.ts +15 -0
  48. package/dist/components/RunsMenu.svelte +14 -13
  49. package/dist/components/RunsMenu.svelte.d.ts +15 -0
  50. package/dist/components/SchemaForm.svelte +10 -13
  51. package/dist/components/SchemaForm.svelte.d.ts +51 -0
  52. package/dist/components/SettingsPanel.svelte +5 -5
  53. package/dist/components/StatusIcon.svelte +14 -3
  54. package/dist/components/StatusIcon.svelte.d.ts +15 -0
  55. package/dist/components/StatusLabel.svelte +10 -2
  56. package/dist/components/StatusLabel.svelte.d.ts +11 -0
  57. package/dist/components/ThemeToggle.svelte +8 -5
  58. package/dist/components/ThemeToggle.svelte.d.ts +10 -0
  59. package/dist/components/UniversalNode.svelte +13 -5
  60. package/dist/components/UniversalNode.svelte.d.ts +15 -0
  61. package/dist/components/WorkflowInterfaceEntryCard.svelte +1 -1
  62. package/dist/components/WorkflowInterfaceEntryComposer.svelte +1 -2
  63. package/dist/components/ZoomTier.svelte +13 -10
  64. package/dist/components/ZoomTier.svelte.d.ts +14 -0
  65. package/dist/components/console/CommandConsole.svelte +9 -3
  66. package/dist/components/console/CommandConsole.svelte.d.ts +10 -0
  67. package/dist/components/console/ConsoleAutocomplete.svelte +4 -4
  68. package/dist/components/console/ConsoleAutocomplete.svelte.d.ts +5 -0
  69. package/dist/components/console/ConsoleInput.svelte +6 -4
  70. package/dist/components/console/ConsoleInput.svelte.d.ts +7 -0
  71. package/dist/components/console/ConsoleOutput.svelte +5 -3
  72. package/dist/components/console/ConsoleOutput.svelte.d.ts +6 -0
  73. package/dist/components/console/ConsoleStrip.svelte +9 -5
  74. package/dist/components/console/ConsoleStrip.svelte.d.ts +10 -0
  75. package/dist/components/form/FieldFactory.svelte +6 -2
  76. package/dist/components/form/FieldFactory.svelte.d.ts +46 -0
  77. package/dist/components/form/FormArray.svelte +9 -16
  78. package/dist/components/form/FormArray.svelte.d.ts +10 -0
  79. package/dist/components/form/FormArrayRows.svelte +8 -8
  80. package/dist/components/form/FormArrayRows.svelte.d.ts +11 -0
  81. package/dist/components/form/FormAutocomplete.svelte +6 -3
  82. package/dist/components/form/FormAutocomplete.svelte.d.ts +23 -0
  83. package/dist/components/form/FormCheckboxGroup.svelte +5 -5
  84. package/dist/components/form/FormCheckboxGroup.svelte.d.ts +6 -0
  85. package/dist/components/form/FormCodeEditor.svelte +8 -13
  86. package/dist/components/form/FormCodeEditor.svelte.d.ts +9 -0
  87. package/dist/components/form/FormField.svelte +7 -8
  88. package/dist/components/form/FormField.svelte.d.ts +10 -0
  89. package/dist/components/form/FormFieldLight.svelte +6 -5
  90. package/dist/components/form/FormFieldLight.svelte.d.ts +8 -0
  91. package/dist/components/form/FormFieldWrapper.svelte +8 -8
  92. package/dist/components/form/FormFieldWrapper.svelte.d.ts +9 -0
  93. package/dist/components/form/FormFieldset.svelte +6 -12
  94. package/dist/components/form/FormFieldset.svelte.d.ts +7 -0
  95. package/dist/components/form/FormMarkdownEditor.svelte +8 -15
  96. package/dist/components/form/FormMarkdownEditor.svelte.d.ts +9 -0
  97. package/dist/components/form/FormNumberField.svelte +5 -7
  98. package/dist/components/form/FormNumberField.svelte.d.ts +6 -0
  99. package/dist/components/form/FormPorts.svelte +133 -27
  100. package/dist/components/form/FormPorts.svelte.d.ts +19 -0
  101. package/dist/components/form/FormRangeField.svelte +5 -9
  102. package/dist/components/form/FormRangeField.svelte.d.ts +6 -0
  103. package/dist/components/form/FormSelect.svelte +5 -7
  104. package/dist/components/form/FormSelect.svelte.d.ts +6 -0
  105. package/dist/components/form/FormTemplateEditor.svelte +8 -16
  106. package/dist/components/form/FormTemplateEditor.svelte.d.ts +9 -0
  107. package/dist/components/form/FormTextField.svelte +5 -7
  108. package/dist/components/form/FormTextField.svelte.d.ts +6 -0
  109. package/dist/components/form/FormTextarea.svelte +5 -7
  110. package/dist/components/form/FormTextarea.svelte.d.ts +6 -0
  111. package/dist/components/form/FormToggle.svelte +6 -8
  112. package/dist/components/form/FormToggle.svelte.d.ts +7 -0
  113. package/dist/components/form/FormUISchemaRenderer.svelte +5 -9
  114. package/dist/components/form/FormUISchemaRenderer.svelte.d.ts +7 -0
  115. package/dist/components/interrupt/ChoicePrompt.svelte +6 -6
  116. package/dist/components/interrupt/ChoicePrompt.svelte.d.ts +7 -0
  117. package/dist/components/interrupt/ConfirmationPrompt.svelte +6 -5
  118. package/dist/components/interrupt/ConfirmationPrompt.svelte.d.ts +7 -0
  119. package/dist/components/interrupt/FormPrompt.svelte +6 -6
  120. package/dist/components/interrupt/FormPrompt.svelte.d.ts +7 -0
  121. package/dist/components/interrupt/InterruptBubble.svelte +10 -9
  122. package/dist/components/interrupt/InterruptBubble.svelte.d.ts +11 -0
  123. package/dist/components/interrupt/ReviewPrompt.svelte +5 -6
  124. package/dist/components/interrupt/ReviewPrompt.svelte.d.ts +7 -0
  125. package/dist/components/interrupt/TextInputPrompt.svelte +6 -6
  126. package/dist/components/interrupt/TextInputPrompt.svelte.d.ts +7 -0
  127. package/dist/components/nodes/AtomNode.svelte +31 -6
  128. package/dist/components/nodes/AtomNode.svelte.d.ts +15 -0
  129. package/dist/components/nodes/CaptionNode.svelte +50 -7
  130. package/dist/components/nodes/CaptionNode.svelte.d.ts +13 -0
  131. package/dist/components/nodes/GatewayNode.svelte +18 -11
  132. package/dist/components/nodes/GatewayNode.svelte.d.ts +21 -0
  133. package/dist/components/nodes/IdeaNode.svelte +47 -6
  134. package/dist/components/nodes/IdeaNode.svelte.d.ts +17 -0
  135. package/dist/components/nodes/NodeCard.svelte +26 -18
  136. package/dist/components/nodes/NodeCard.svelte.d.ts +20 -0
  137. package/dist/components/nodes/NodeConfigButton.svelte +15 -2
  138. package/dist/components/nodes/NodeConfigButton.svelte.d.ts +11 -0
  139. package/dist/components/nodes/NodeProblemMark.svelte +15 -10
  140. package/dist/components/nodes/NodeProblemMark.svelte.d.ts +16 -0
  141. package/dist/components/nodes/NodeTip.svelte +10 -7
  142. package/dist/components/nodes/NodeTip.svelte.d.ts +13 -0
  143. package/dist/components/nodes/NotesNode.svelte +30 -0
  144. package/dist/components/nodes/NotesNode.svelte.d.ts +14 -0
  145. package/dist/components/nodes/SimpleNode.svelte +35 -8
  146. package/dist/components/nodes/SimpleNode.svelte.d.ts +17 -0
  147. package/dist/components/nodes/SquareNode.svelte +38 -8
  148. package/dist/components/nodes/SquareNode.svelte.d.ts +17 -0
  149. package/dist/components/nodes/TerminalNode.svelte +24 -10
  150. package/dist/components/nodes/TerminalNode.svelte.d.ts +17 -0
  151. package/dist/components/nodes/ToolNode.svelte +14 -5
  152. package/dist/components/nodes/ToolNode.svelte.d.ts +15 -0
  153. package/dist/components/nodes/WorkflowNode.svelte +18 -15
  154. package/dist/components/nodes/WorkflowNode.svelte.d.ts +21 -0
  155. package/dist/components/playground/ChatBubble.svelte +4 -3
  156. package/dist/components/playground/ChatBubble.svelte.d.ts +5 -0
  157. package/dist/components/playground/ChatInput.svelte +11 -6
  158. package/dist/components/playground/ChatInput.svelte.d.ts +14 -0
  159. package/dist/components/playground/ChatPanel.svelte +15 -7
  160. package/dist/components/playground/ChatPanel.svelte.d.ts +17 -0
  161. package/dist/components/playground/ControlPanel.svelte +26 -9
  162. package/dist/components/playground/ControlPanel.svelte.d.ts +29 -0
  163. package/dist/components/playground/DockedPlayground.svelte +7 -10
  164. package/dist/components/playground/DockedPlayground.svelte.d.ts +10 -0
  165. package/dist/components/playground/ExecutionConsole.svelte +10 -5
  166. package/dist/components/playground/ExecutionConsole.svelte.d.ts +12 -0
  167. package/dist/components/playground/ExecutionList.svelte +13 -0
  168. package/dist/components/playground/ExecutionList.svelte.d.ts +11 -0
  169. package/dist/components/playground/ExecutionLogs.svelte +6 -9
  170. package/dist/components/playground/ExecutionLogs.svelte.d.ts +7 -0
  171. package/dist/components/playground/HeaderMenu.svelte +6 -8
  172. package/dist/components/playground/HeaderMenu.svelte.d.ts +9 -0
  173. package/dist/components/playground/HierarchyTrail.svelte +6 -6
  174. package/dist/components/playground/HierarchyTrail.svelte.d.ts +8 -0
  175. package/dist/components/playground/InputCollector.svelte +6 -5
  176. package/dist/components/playground/InputCollector.svelte.d.ts +7 -0
  177. package/dist/components/playground/InputFields.svelte +8 -12
  178. package/dist/components/playground/InputFields.svelte.d.ts +9 -0
  179. package/dist/components/playground/InterfaceInputForm.svelte +6 -13
  180. package/dist/components/playground/InterfaceInputForm.svelte.d.ts +9 -0
  181. package/dist/components/playground/InterfaceJsonInput.svelte +6 -5
  182. package/dist/components/playground/InterfaceJsonInput.svelte.d.ts +8 -0
  183. package/dist/components/playground/LogRow.svelte +4 -5
  184. package/dist/components/playground/LogRow.svelte.d.ts +6 -0
  185. package/dist/components/playground/MessageBubble.svelte +13 -7
  186. package/dist/components/playground/MessageBubble.svelte.d.ts +15 -0
  187. package/dist/components/playground/MessageCard.svelte +5 -2
  188. package/dist/components/playground/MessageCard.svelte.d.ts +6 -0
  189. package/dist/components/playground/MessageMarkdown.svelte +8 -9
  190. package/dist/components/playground/MessageMarkdown.svelte.d.ts +11 -0
  191. package/dist/components/playground/MessageNotice.svelte +7 -0
  192. package/dist/components/playground/MessageNotice.svelte.d.ts +5 -0
  193. package/dist/components/playground/MessageStream.svelte +8 -6
  194. package/dist/components/playground/MessageStream.svelte.d.ts +11 -0
  195. package/dist/components/playground/MessageTagChip.svelte +7 -7
  196. package/dist/components/playground/MessageTagChip.svelte.d.ts +10 -0
  197. package/dist/components/playground/MessageTagStrip.svelte +6 -3
  198. package/dist/components/playground/MessageTagStrip.svelte.d.ts +8 -0
  199. package/dist/components/playground/OriginBadge.svelte +7 -4
  200. package/dist/components/playground/OriginBadge.svelte.d.ts +8 -0
  201. package/dist/components/playground/PipelineKanbanView.svelte +14 -0
  202. package/dist/components/playground/PipelineKanbanView.svelte.d.ts +12 -0
  203. package/dist/components/playground/PipelinePanel.svelte +14 -0
  204. package/dist/components/playground/PipelinePanel.svelte.d.ts +12 -0
  205. package/dist/components/playground/PipelineTableView.svelte +14 -0
  206. package/dist/components/playground/PipelineTableView.svelte.d.ts +12 -0
  207. package/dist/components/playground/Playground.svelte +17 -11
  208. package/dist/components/playground/Playground.svelte.d.ts +20 -0
  209. package/dist/components/playground/PlaygroundApp.svelte +24 -10
  210. package/dist/components/playground/PlaygroundApp.svelte.d.ts +26 -0
  211. package/dist/components/playground/PlaygroundHeader.svelte +8 -12
  212. package/dist/components/playground/PlaygroundHeader.svelte.d.ts +11 -0
  213. package/dist/components/playground/PlaygroundModal.svelte +6 -8
  214. package/dist/components/playground/PlaygroundModal.svelte.d.ts +7 -0
  215. package/dist/components/playground/PlaygroundStudio.svelte +9 -0
  216. package/dist/components/playground/PlaygroundStudio.svelte.d.ts +7 -0
  217. package/dist/components/playground/PlaygroundSurface.svelte +19 -14
  218. package/dist/components/playground/PlaygroundSurface.svelte.d.ts +20 -0
  219. package/dist/components/playground/SessionManager.svelte +6 -5
  220. package/dist/components/playground/SessionManager.svelte.d.ts +7 -0
  221. package/dist/components/playground/StepsSummary.svelte +8 -9
  222. package/dist/components/playground/StepsSummary.svelte.d.ts +10 -0
  223. package/dist/components/primitives/Button.svelte +15 -7
  224. package/dist/components/primitives/Button.svelte.d.ts +18 -1
  225. package/dist/components/primitives/Card.svelte +8 -6
  226. package/dist/components/primitives/Card.svelte.d.ts +11 -0
  227. package/dist/components/primitives/Checkbox.svelte +8 -5
  228. package/dist/components/primitives/Checkbox.svelte.d.ts +11 -0
  229. package/dist/components/primitives/Chip.svelte +8 -4
  230. package/dist/components/primitives/Chip.svelte.d.ts +11 -0
  231. package/dist/components/primitives/Combobox.svelte +27 -18
  232. package/dist/components/primitives/Combobox.svelte.d.ts +33 -0
  233. package/dist/components/primitives/Composer.svelte +15 -16
  234. package/dist/components/primitives/Composer.svelte.d.ts +20 -0
  235. package/dist/components/primitives/EmptyState.svelte +9 -3
  236. package/dist/components/primitives/EmptyState.svelte.d.ts +11 -0
  237. package/dist/components/primitives/Field.svelte +12 -9
  238. package/dist/components/primitives/Field.svelte.d.ts +16 -0
  239. package/dist/components/primitives/IconButton.svelte +10 -5
  240. package/dist/components/primitives/IconButton.svelte.d.ts +13 -0
  241. package/dist/components/primitives/Menu.svelte +15 -14
  242. package/dist/components/primitives/Menu.svelte.d.ts +20 -0
  243. package/dist/components/primitives/Notice.svelte +11 -8
  244. package/dist/components/primitives/Notice.svelte.d.ts +14 -0
  245. package/dist/components/primitives/PanelHeader.svelte +10 -7
  246. package/dist/components/primitives/PanelHeader.svelte.d.ts +13 -0
  247. package/dist/components/primitives/Segmented.svelte +11 -4
  248. package/dist/components/primitives/Segmented.svelte.d.ts +14 -0
  249. package/dist/components/primitives/Select.svelte +13 -16
  250. package/dist/components/primitives/Select.svelte.d.ts +18 -0
  251. package/dist/components/primitives/StatusPill.svelte +11 -8
  252. package/dist/components/primitives/StatusPill.svelte.d.ts +15 -0
  253. package/dist/components/primitives/Switch.svelte +9 -6
  254. package/dist/components/primitives/Switch.svelte.d.ts +12 -0
  255. package/dist/components/primitives/Tabs.svelte +16 -15
  256. package/dist/components/primitives/Tabs.svelte.d.ts +22 -0
  257. package/dist/components/primitives/Toolbar.svelte +14 -13
  258. package/dist/components/primitives/Toolbar.svelte.d.ts +18 -0
  259. package/dist/components/primitives/ToolbarSeparator.svelte +5 -4
  260. package/dist/components/primitives/ToolbarSeparator.svelte.d.ts +7 -0
  261. package/dist/core/index.d.ts +1 -1
  262. package/dist/core/index.js +1 -1
  263. package/dist/layout/index.d.ts +1 -1
  264. package/dist/layout/index.js +1 -1
  265. package/dist/layout/toWorkflow.d.ts +8 -7
  266. package/dist/layout/toWorkflow.js +20 -40
  267. package/dist/messages/defaults.d.ts +24 -0
  268. package/dist/messages/defaults.js +15 -0
  269. package/dist/skins/graphite.d.ts +1 -1
  270. package/dist/skins/graphite.js +1 -1
  271. package/dist/stores/settingsStore.svelte.js +3 -0
  272. package/dist/stores/workflowStore.svelte.js +24 -7
  273. package/dist/styles/base.css +2 -126
  274. package/dist/styles/tokenAliases.js +1 -0
  275. package/dist/styles/tokens.css +9 -5
  276. package/dist/svelte-app.d.ts +1 -1
  277. package/dist/themes/classic.d.ts +9 -0
  278. package/dist/themes/classic.js +16 -0
  279. package/dist/themes/index.d.ts +7 -2
  280. package/dist/themes/index.js +20 -10
  281. package/dist/types/index.d.ts +7 -0
  282. package/dist/types/settings.d.ts +6 -2
  283. package/dist/types/theme.d.ts +6 -2
  284. package/dist/utils/playgroundChat.d.ts +10 -0
  285. package/dist/utils/playgroundChat.js +25 -0
  286. package/dist/utils/portExposure.d.ts +24 -1
  287. package/dist/utils/portExposure.js +46 -13
  288. package/dist/utils/portUtils.d.ts +5 -1
  289. package/dist/utils/portUtils.js +15 -4
  290. package/package.json +2 -1
  291. package/dist/components/IconButton.svelte +0 -80
  292. package/dist/components/IconButton.svelte.d.ts +0 -30
  293. package/dist/themes/default.d.ts +0 -2
  294. package/dist/themes/default.js +0 -9
@@ -7,6 +7,7 @@
7
7
  * @module types/settings
8
8
  */
9
9
  import { type ZoomTierConfig } from '../utils/zoomTier.js';
10
+ import type { FlowDropThemeName } from './theme.js';
10
11
  /**
11
12
  * Theme preference options
12
13
  * - 'light': Force light theme
@@ -158,8 +159,11 @@ export interface UISettings {
158
159
  sidebarCollapsed: boolean;
159
160
  /** Enable compact mode for denser UI */
160
161
  compactMode: boolean;
161
- /** Active theme name — overridden by the theme prop when explicitly provided */
162
- theme: 'default' | 'minimal' | 'drafter' | 'graphite';
162
+ /**
163
+ * Active theme name — overridden by the theme prop when explicitly provided.
164
+ * A saved `'default'` (the old name of `'classic'`) is read as `'classic'`.
165
+ */
166
+ theme: FlowDropThemeName;
163
167
  /** Whether the command console panel is open */
164
168
  consoleOpen: boolean;
165
169
  /** Height of the command console panel in pixels (opens at 220, saved on resize) */
@@ -66,7 +66,7 @@ export interface FlowDropThemeConfig {
66
66
  /**
67
67
  * A FlowDrop theme bundles a visual skin (CSS tokens) with UI config (behavioral defaults).
68
68
  *
69
- * Built-in themes: 'default' | 'minimal' | 'drafter' | 'graphite'
69
+ * Built-in themes: 'graphite' (the editor's default) | 'classic' | 'minimal' | 'drafter'
70
70
  *
71
71
  * @example
72
72
  * // Use a built-in theme by name
@@ -84,4 +84,8 @@ export interface FlowDropTheme {
84
84
  /** Behavioral configuration defaults */
85
85
  config?: FlowDropThemeConfig;
86
86
  }
87
- export type FlowDropThemeName = 'default' | 'minimal' | 'drafter' | 'graphite';
87
+ /**
88
+ * Names of the built-in themes. `'default'` is the old name of `'classic'`
89
+ * and still resolves to it; it is removed in 3.0.
90
+ */
91
+ export type FlowDropThemeName = 'classic' | 'minimal' | 'drafter' | 'graphite' | 'default';
@@ -105,6 +105,16 @@ export declare function rewritePlaygroundReplies(playground: WorkflowPlayground
105
105
  oldPortId: string;
106
106
  newPortId: string;
107
107
  }>): WorkflowPlayground | undefined;
108
+ /**
109
+ * The workflow once the nodes `removed` names are gone: Playground replies on
110
+ * them are dropped, so the stored binding never prints a reply from a node the
111
+ * workflow no longer has (the server refuses such a save). The inputs stay:
112
+ * they name interface entries, not nodes. When that leaves settings that bind
113
+ * nothing, the interface's deprecated `turn` marks go too, or they would take
114
+ * over as the chat. The same object when no reply is on a removed node, or
115
+ * nothing is stored.
116
+ */
117
+ export declare function withoutRepliesOnNodes<W extends Pick<Workflow, 'playground' | 'interface'>>(workflow: W, removed: ReadonlySet<string>): W;
108
118
  /**
109
119
  * Whether the interface still carries a deprecated `turn` mark this library
110
120
  * knows (one `withoutInterfaceTurns` removes).
@@ -226,6 +226,31 @@ export function rewritePlaygroundReplies(playground, oldNodeId, newNodeId, portM
226
226
  });
227
227
  return withPlaygroundChat(playground, { ...chat, replies });
228
228
  }
229
+ /**
230
+ * The workflow once the nodes `removed` names are gone: Playground replies on
231
+ * them are dropped, so the stored binding never prints a reply from a node the
232
+ * workflow no longer has (the server refuses such a save). The inputs stay:
233
+ * they name interface entries, not nodes. When that leaves settings that bind
234
+ * nothing, the interface's deprecated `turn` marks go too, or they would take
235
+ * over as the chat. The same object when no reply is on a removed node, or
236
+ * nothing is stored.
237
+ */
238
+ export function withoutRepliesOnNodes(workflow, removed) {
239
+ if (!workflow.playground?.chat || removed.size === 0)
240
+ return workflow;
241
+ const chat = normalizePlaygroundChat(workflow.playground.chat);
242
+ if (!chat.replies.some((reply) => removed.has(reply.node_id)))
243
+ return workflow;
244
+ const playground = withPlaygroundChat(workflow.playground, {
245
+ ...chat,
246
+ replies: chat.replies.filter((reply) => !removed.has(reply.node_id))
247
+ });
248
+ const next = { ...workflow, playground };
249
+ if (playground.chat === null && workflow.interface !== undefined) {
250
+ next.interface = withoutInterfaceTurns(workflow.interface);
251
+ }
252
+ return next;
253
+ }
229
254
  /**
230
255
  * Whether the interface still carries a deprecated `turn` mark this library
231
256
  * knows (one `withoutInterfaceTurns` removes).
@@ -23,10 +23,33 @@ export interface PortExposureCandidate {
23
23
  * of it (they are always drawn).
24
24
  */
25
25
  export declare function nodePortsFor(node: Pick<WorkflowNode, 'data'>, direction: PortsDirection): NodePort[];
26
+ /** Why an exposed port can't be hidden right now. */
27
+ export type ExposureBlock = {
28
+ kind: 'locked';
29
+ } | {
30
+ kind: 'wired';
31
+ count: number;
32
+ } | {
33
+ kind: 'published';
34
+ };
35
+ /** Whether the node type fixes a port as always shown (a trigger's event input included). */
36
+ export declare function isExposureLocked(node: Pick<WorkflowNode, 'id' | 'data'>, direction: PortsDirection, port: NodePort): boolean;
37
+ /**
38
+ * Edges on each of the node's ports, counted in one pass. Keyed
39
+ * `${direction}:${portId}`. An edge counts on a port when its handle is the
40
+ * port's full handle id or the bare port id.
41
+ */
42
+ export declare function countPortWires(node: Pick<WorkflowNode, 'id'>, workflow: Workflow): Map<string, number>;
43
+ /**
44
+ * Why an exposed port can't be hidden, or `null` when it can. Locked (the node
45
+ * type decides) comes before wired, which comes before published on the
46
+ * workflow interface. `wires` is {@link countPortWires} for the node.
47
+ */
48
+ export declare function hideBlock(node: Pick<WorkflowNode, 'id' | 'data'>, workflow: Workflow, direction: PortsDirection, port: NodePort, wires: ReadonlyMap<string, number>): ExposureBlock | null;
26
49
  /**
27
50
  * Exposed data ports with no edge on them, the ones worth hiding. Left out:
28
51
  * reserved ports (error output, trigger and tool types), control-flow ports
29
- * (loop-back), a trigger's event input (always exposed), ports published on
52
+ * (loop-back), locked ports (a trigger's event input), ports published on
30
53
  * the workflow interface (hiding them would break the binding), and a required
31
54
  * input with no config value (hiding it would only hide the missing value).
32
55
  */
@@ -29,13 +29,48 @@ export function nodePortsFor(node, direction) {
29
29
  ...dynamic.map((port) => dynamicPortToNodePort(port, isInputs ? 'input' : 'output'))
30
30
  ];
31
31
  }
32
- /** Whether any edge of the workflow touches a port's handle. */
33
- function hasEdgeOnPort(workflow, nodeId, direction, portId) {
34
- const isInputs = direction === 'inputs';
35
- const handleId = buildHandleId(nodeId, isInputs ? 'input' : 'output', portId);
36
- return workflow.edges.some((edge) => isInputs
37
- ? edge.target === nodeId && (edge.targetHandle === handleId || edge.targetHandle === portId)
38
- : edge.source === nodeId && (edge.sourceHandle === handleId || edge.sourceHandle === portId));
32
+ /** Whether the node type fixes a port as always shown (a trigger's event input included). */
33
+ export function isExposureLocked(node, direction, port) {
34
+ return Boolean(port.exposureLocked || (direction === 'inputs' && isTriggerEventInput(node, port.id)));
35
+ }
36
+ /**
37
+ * Edges on each of the node's ports, counted in one pass. Keyed
38
+ * `${direction}:${portId}`. An edge counts on a port when its handle is the
39
+ * port's full handle id or the bare port id.
40
+ */
41
+ export function countPortWires(node, workflow) {
42
+ const counts = new Map();
43
+ const add = (direction, type, handle) => {
44
+ if (!handle)
45
+ return;
46
+ const prefix = buildHandleId(node.id, type, '');
47
+ const portId = handle.startsWith(prefix) ? handle.slice(prefix.length) : handle;
48
+ const key = `${direction}:${portId}`;
49
+ counts.set(key, (counts.get(key) ?? 0) + 1);
50
+ };
51
+ for (const edge of workflow.edges) {
52
+ if (edge.source === node.id)
53
+ add('outputs', 'output', edge.sourceHandle ?? undefined);
54
+ if (edge.target === node.id)
55
+ add('inputs', 'input', edge.targetHandle ?? undefined);
56
+ }
57
+ return counts;
58
+ }
59
+ /**
60
+ * Why an exposed port can't be hidden, or `null` when it can. Locked (the node
61
+ * type decides) comes before wired, which comes before published on the
62
+ * workflow interface. `wires` is {@link countPortWires} for the node.
63
+ */
64
+ export function hideBlock(node, workflow, direction, port, wires) {
65
+ if (isExposureLocked(node, direction, port))
66
+ return { kind: 'locked' };
67
+ const count = wires.get(`${direction}:${port.id}`) ?? 0;
68
+ if (count > 0)
69
+ return { kind: 'wired', count };
70
+ const dir = direction === 'inputs' ? 'input' : 'output';
71
+ if (entryAtPort(workflow, node.id, dir, port.id))
72
+ return { kind: 'published' };
73
+ return null;
39
74
  }
40
75
  /** Whether the node's config holds a value for a parameter (an empty string counts as none). */
41
76
  function hasConfigValue(node, key) {
@@ -45,23 +80,21 @@ function hasConfigValue(node, key) {
45
80
  /**
46
81
  * Exposed data ports with no edge on them, the ones worth hiding. Left out:
47
82
  * reserved ports (error output, trigger and tool types), control-flow ports
48
- * (loop-back), a trigger's event input (always exposed), ports published on
83
+ * (loop-back), locked ports (a trigger's event input), ports published on
49
84
  * the workflow interface (hiding them would break the binding), and a required
50
85
  * input with no config value (hiding it would only hide the missing value).
51
86
  */
52
87
  export function hideCandidates(node, workflow) {
53
88
  const ports = node.data?.config?.ports;
89
+ const wires = countPortWires(node, workflow);
54
90
  const result = [];
55
91
  for (const direction of ['inputs', 'outputs']) {
56
- const dir = direction === 'inputs' ? 'input' : 'output';
57
92
  for (const port of nodePortsFor(node, direction)) {
58
93
  if (!isPortExposed(port, ports?.[direction]))
59
94
  continue;
60
95
  if (!isBulkToggleable(node, direction, port))
61
96
  continue;
62
- if (hasEdgeOnPort(workflow, node.id, direction, port.id))
63
- continue;
64
- if (entryAtPort(workflow, node.id, dir, port.id))
97
+ if (hideBlock(node, workflow, direction, port, wires))
65
98
  continue;
66
99
  if (direction === 'inputs' && port.required && !hasConfigValue(node, port.id))
67
100
  continue;
@@ -75,7 +108,7 @@ function isBulkToggleable(node, direction, port) {
75
108
  const dir = direction === 'inputs' ? 'input' : 'output';
76
109
  if (isReservedPort(port) || isControlFlowPort(port, dir))
77
110
  return false;
78
- return !(direction === 'inputs' && isTriggerEventInput(node, port.id));
111
+ return !isExposureLocked(node, direction, port);
79
112
  }
80
113
  /**
81
114
  * Data ports currently hidden, in both directions. Reserved and control-flow
@@ -38,7 +38,8 @@ export declare function orderPortsFor(ports: NodePort[], entries: PortConfigEntr
38
38
  /**
39
39
  * Effective exposure for a port: the instance's explicit `exposed` override if
40
40
  * present, else the port's metadata `exposedByDefault` (which itself defaults to
41
- * exposed).
41
+ * exposed). A locked port ({@link NodePort.exposureLocked}) is always exposed:
42
+ * it ignores both.
42
43
  */
43
44
  export declare function isPortExposed(port: NodePort, entries: PortConfigEntry[] | undefined): boolean;
44
45
  /**
@@ -64,6 +65,9 @@ export type PortsDirection = 'inputs' | 'outputs';
64
65
  * is dropped when it equals the port's default, the whole direction is dropped
65
66
  * when it carries neither a reorder nor an exposure override, and the result
66
67
  * collapses to `undefined` when empty, so an untouched node stores nothing.
68
+ * Entries for ports the node doesn't have (a port of a newer node type, say)
69
+ * are kept as stored, after the others. The one writer of `config.ports`: the
70
+ * Ports tab, bulk Show/Hide and the layout reorder all go through it.
67
71
  *
68
72
  * @param current - the stored value; the other direction is carried over from it
69
73
  * @param direction - the direction being written
@@ -61,9 +61,12 @@ export function orderPortsFor(ports, entries) {
61
61
  /**
62
62
  * Effective exposure for a port: the instance's explicit `exposed` override if
63
63
  * present, else the port's metadata `exposedByDefault` (which itself defaults to
64
- * exposed).
64
+ * exposed). A locked port ({@link NodePort.exposureLocked}) is always exposed:
65
+ * it ignores both.
65
66
  */
66
67
  export function isPortExposed(port, entries) {
68
+ if (port.exposureLocked)
69
+ return true;
67
70
  const entry = entries?.find((candidate) => candidate.id === port.id);
68
71
  if (entry && entry.exposed !== undefined)
69
72
  return entry.exposed;
@@ -97,6 +100,9 @@ export function isPortVisible(port, direction, ports) {
97
100
  * is dropped when it equals the port's default, the whole direction is dropped
98
101
  * when it carries neither a reorder nor an exposure override, and the result
99
102
  * collapses to `undefined` when empty, so an untouched node stores nothing.
103
+ * Entries for ports the node doesn't have (a port of a newer node type, say)
104
+ * are kept as stored, after the others. The one writer of `config.ports`: the
105
+ * Ports tab, bulk Show/Hide and the layout reorder all go through it.
100
106
  *
101
107
  * @param current - the stored value; the other direction is carried over from it
102
108
  * @param direction - the direction being written
@@ -108,16 +114,21 @@ export function buildPortsConfig(current, direction, ordered, allPorts, exposure
108
114
  const entries = ordered.map((port) => {
109
115
  const entry = { id: port.id };
110
116
  const exposed = exposureOf(port);
111
- if (exposed !== (port.exposedByDefault ?? true))
117
+ // A locked port has no override to store: it is always exposed.
118
+ if (!port.exposureLocked && exposed !== (port.exposedByDefault ?? true)) {
112
119
  entry.exposed = exposed;
120
+ }
113
121
  return entry;
114
122
  });
123
+ const known = new Set(allPorts.map((p) => p.id));
124
+ const unknown = (current?.[direction] ?? []).filter((e) => !known.has(e.id));
115
125
  const defaultOrder = byDefaultOrder(allPorts).map((p) => p.id);
116
126
  const orderChanged = entries.some((e, i) => e.id !== defaultOrder[i]);
117
127
  const hasExposureOverride = entries.some((e) => e.exposed !== undefined);
118
128
  const next = { ...current };
119
- if (orderChanged || hasExposureOverride)
120
- next[direction] = entries;
129
+ if (orderChanged || hasExposureOverride || unknown.length > 0) {
130
+ next[direction] = [...entries, ...unknown.map((e) => ({ ...e }))];
131
+ }
121
132
  else
122
133
  delete next[direction];
123
134
  // The untouched direction is carried over verbatim, but an earlier edit may
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "A drop-in visual workflow editor for any web application. You own the backend. You own the data. You own the orchestration.",
4
4
  "license": "MIT",
5
5
  "private": false,
6
- "version": "2.13.0",
6
+ "version": "2.14.0",
7
7
  "author": "Shibin Das (D34dMan)",
8
8
  "bugs": {
9
9
  "url": "https://github.com/flowdrop-io/flowdrop/issues"
@@ -240,6 +240,7 @@
240
240
  "prettier": "^3.4.2",
241
241
  "prettier-plugin-svelte": "^3.3.3",
242
242
  "publint": "^0.3.2",
243
+ "remark-gfm": "^4.0.1",
243
244
  "storybook": "^10.2.15",
244
245
  "storybook-addon-tag-badges": "^3.0.6",
245
246
  "stylelint": "^17.16.0",
@@ -1,80 +0,0 @@
1
- <!--
2
- IconButton — typed wrapper over the `.flowdrop-btn--icon` system (base.css).
3
-
4
- The icon-only sibling of Button.svelte: a square button that holds a single
5
- glyph (Icon, inline SVG, or character). All geometry, variants, sizes and the
6
- centralized focus ring live in base.css; this component is the ergonomic,
7
- type-safe entry point so callers pick `variant`/`size` instead of hand-writing
8
- class strings and re-declaring widths/tints in scoped styles.
9
-
10
- Internal for now (not exported from any public entry) so the API isn't frozen
11
- before GA. Existing hand-rolled square buttons migrate onto it incrementally.
12
- Canvas-overlay buttons keep their bespoke components (CanvasIconButton,
13
- NodeConfigButton) — those add absolute positioning, shadows and backdrop blur
14
- this primitive deliberately stays out of.
15
- -->
16
-
17
- <script lang="ts">
18
- import type { Snippet } from 'svelte';
19
-
20
- interface Props {
21
- /**
22
- * Visual style. `ghost` (default) is transparent until hover; `default` is a
23
- * flat surface with a resting border; `primary`/`danger`/`success` are quiet
24
- * semantic tints (muted fill + coloured border) that go solid on press.
25
- */
26
- variant?: 'ghost' | 'default' | 'primary' | 'danger' | 'success';
27
- /** Square size — `md` (32px) is the base; `sm` (28px) / `lg` (36px) add a modifier */
28
- size?: 'sm' | 'md' | 'lg';
29
- /** Native button type */
30
- type?: 'button' | 'submit' | 'reset';
31
- /** Tooltip text */
32
- title?: string;
33
- /** Accessible label — required, since the button is icon-only */
34
- ariaLabel: string;
35
- /** Toggle/pressed state — applies the active tint and sets `aria-pressed` */
36
- active?: boolean;
37
- /** Disabled state */
38
- disabled?: boolean;
39
- /** Extra classes appended to the root button */
40
- class?: string;
41
- /** Click handler */
42
- onclick?: (event: MouseEvent) => void;
43
- /** The glyph (icon, svg, or character) */
44
- children: Snippet;
45
- }
46
-
47
- let {
48
- variant = 'ghost',
49
- size = 'md',
50
- type = 'button',
51
- title,
52
- ariaLabel,
53
- active = false,
54
- disabled = false,
55
- class: className = '',
56
- onclick,
57
- children
58
- }: Props = $props();
59
-
60
- // `ghost` reuses the shared `.flowdrop-btn--ghost`; the other variants have
61
- // icon-specific tint classes so they don't collide with the solid text buttons.
62
- const variantClass = $derived(
63
- variant === 'ghost' ? 'flowdrop-btn--ghost' : `flowdrop-btn--icon-${variant}`
64
- );
65
- // 'md' is the unmodified base size; only 'sm'/'lg' need a size modifier.
66
- const sizeClass = $derived(size === 'md' ? '' : `flowdrop-btn--${size}`);
67
- </script>
68
-
69
- <button
70
- class="flowdrop-btn flowdrop-btn--icon {variantClass} {sizeClass} {className}"
71
- class:is-active={active}
72
- {type}
73
- {title}
74
- {disabled}
75
- aria-label={ariaLabel}
76
- aria-pressed={active ? true : undefined}
77
- {onclick}
78
- >
79
- {@render children()}
80
- </button>
@@ -1,30 +0,0 @@
1
- import type { Snippet } from 'svelte';
2
- interface Props {
3
- /**
4
- * Visual style. `ghost` (default) is transparent until hover; `default` is a
5
- * flat surface with a resting border; `primary`/`danger`/`success` are quiet
6
- * semantic tints (muted fill + coloured border) that go solid on press.
7
- */
8
- variant?: 'ghost' | 'default' | 'primary' | 'danger' | 'success';
9
- /** Square size — `md` (32px) is the base; `sm` (28px) / `lg` (36px) add a modifier */
10
- size?: 'sm' | 'md' | 'lg';
11
- /** Native button type */
12
- type?: 'button' | 'submit' | 'reset';
13
- /** Tooltip text */
14
- title?: string;
15
- /** Accessible label — required, since the button is icon-only */
16
- ariaLabel: string;
17
- /** Toggle/pressed state — applies the active tint and sets `aria-pressed` */
18
- active?: boolean;
19
- /** Disabled state */
20
- disabled?: boolean;
21
- /** Extra classes appended to the root button */
22
- class?: string;
23
- /** Click handler */
24
- onclick?: (event: MouseEvent) => void;
25
- /** The glyph (icon, svg, or character) */
26
- children: Snippet;
27
- }
28
- declare const IconButton: import("svelte").Component<Props, {}, "">;
29
- type IconButton = ReturnType<typeof IconButton>;
30
- export default IconButton;
@@ -1,2 +0,0 @@
1
- import type { FlowDropTheme } from '../types/theme.js';
2
- export declare const defaultTheme: FlowDropTheme;
@@ -1,9 +0,0 @@
1
- export const defaultTheme = {
2
- name: 'default',
3
- config: {
4
- sidebar: {
5
- defaultOpen: true,
6
- categoriesDefaultOpen: false
7
- }
8
- }
9
- };