@flowdrop/flowdrop 2.0.0-beta.1 → 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 (228) hide show
  1. package/CHANGELOG.md +173 -0
  2. package/MIGRATION-2.0.md +173 -3
  3. package/README.md +5 -5
  4. package/dist/adapters/WorkflowAdapter.js +4 -5
  5. package/dist/adapters/agentspec/AgentSpecAdapter.js +3 -3
  6. package/dist/adapters/agentspec/defaultNodeTypes.js +9 -9
  7. package/dist/api/enhanced-client.js +6 -11
  8. package/dist/commands/executor.js +51 -26
  9. package/dist/commands/storeIntegration.svelte.js +11 -1
  10. package/dist/commands/types.js +5 -5
  11. package/dist/components/App.svelte +547 -386
  12. package/dist/components/App.svelte.d.ts +16 -8
  13. package/dist/components/Button.stories.svelte +65 -0
  14. package/dist/components/Button.stories.svelte.d.ts +19 -0
  15. package/dist/components/Button.svelte +62 -0
  16. package/dist/components/Button.svelte.d.ts +24 -0
  17. package/dist/components/CanvasIconButton.svelte +76 -0
  18. package/dist/components/CanvasIconButton.svelte.d.ts +18 -0
  19. package/dist/components/ConfigForm.svelte +167 -562
  20. package/dist/components/ConfigForm.svelte.d.ts +24 -7
  21. package/dist/components/ConfigModal.svelte +9 -1
  22. package/dist/components/ConfigPanel.svelte +234 -15
  23. package/dist/components/ConfigPanel.svelte.d.ts +6 -0
  24. package/dist/components/EditorStatusBar.stories.svelte +44 -0
  25. package/dist/components/EditorStatusBar.stories.svelte.d.ts +27 -0
  26. package/dist/components/EditorStatusBar.svelte +99 -0
  27. package/dist/components/EditorStatusBar.svelte.d.ts +15 -0
  28. package/dist/components/IconButton.svelte +80 -0
  29. package/dist/components/IconButton.svelte.d.ts +30 -0
  30. package/dist/components/Input.svelte +74 -0
  31. package/dist/components/Input.svelte.d.ts +17 -0
  32. package/dist/components/LogoWordmark.svelte +113 -0
  33. package/dist/components/LogoWordmark.svelte.d.ts +26 -0
  34. package/dist/components/Navbar.svelte +17 -63
  35. package/dist/components/Navbar.svelte.d.ts +3 -0
  36. package/dist/components/NodeSidebar.svelte +21 -126
  37. package/dist/components/NodeSwapPicker.svelte +12 -30
  38. package/dist/components/PipelineStatus.svelte +6 -1
  39. package/dist/components/PipelineStatus.svelte.d.ts +3 -0
  40. package/dist/components/PortMappingRow.svelte +0 -2
  41. package/dist/components/SchemaForm.svelte +4 -14
  42. package/dist/components/Select.svelte +53 -0
  43. package/dist/components/Select.svelte.d.ts +15 -0
  44. package/dist/components/SettingsModal.svelte +0 -5
  45. package/dist/components/SettingsPanel.svelte +24 -6
  46. package/dist/components/Textarea.svelte +39 -0
  47. package/dist/components/Textarea.svelte.d.ts +12 -0
  48. package/dist/components/ThemeToggle.svelte +15 -94
  49. package/dist/components/UniversalNode.svelte +36 -4
  50. package/dist/components/UniversalNode.svelte.d.ts +1 -1
  51. package/dist/components/WorkflowEditor.svelte +66 -52
  52. package/dist/components/WorkflowEditor.svelte.d.ts +21 -0
  53. package/dist/components/chat/AIChatPanel.svelte +7 -2
  54. package/dist/components/console/ConsoleAutocomplete.svelte +1 -1
  55. package/dist/components/console/ConsoleInput.svelte +3 -3
  56. package/dist/components/console/ConsoleOutput.svelte +2 -2
  57. package/dist/components/form/FormArray.svelte +37 -173
  58. package/dist/components/form/FormAutocomplete.svelte +18 -15
  59. package/dist/components/form/FormCheckboxGroup.svelte +1 -5
  60. package/dist/components/form/FormCodeEditor.svelte +9 -7
  61. package/dist/components/form/FormField.svelte +18 -42
  62. package/dist/components/form/FormFieldLight.svelte +52 -48
  63. package/dist/components/form/FormFieldLight.svelte.d.ts +12 -0
  64. package/dist/components/form/FormFieldset.svelte +45 -11
  65. package/dist/components/form/FormMarkdownEditor.svelte +8 -5
  66. package/dist/components/form/FormNumberField.svelte +4 -36
  67. package/dist/components/form/FormPorts.svelte +262 -0
  68. package/dist/components/form/FormPorts.svelte.d.ts +13 -0
  69. package/dist/components/form/FormRangeField.svelte +61 -30
  70. package/dist/components/form/FormSelect.svelte +13 -75
  71. package/dist/components/form/FormTemplateEditor.svelte +6 -4
  72. package/dist/components/form/FormTextField.svelte +3 -35
  73. package/dist/components/form/FormTextarea.svelte +4 -39
  74. package/dist/components/form/FormToggle.svelte +0 -4
  75. package/dist/components/form/FormUISchemaRenderer.svelte +3 -1
  76. package/dist/components/form/resolveFieldType.d.ts +24 -0
  77. package/dist/components/form/resolveFieldType.js +55 -0
  78. package/dist/components/icons/CloseIcon.svelte +6 -0
  79. package/dist/components/icons/CloseIcon.svelte.d.ts +26 -0
  80. package/dist/components/icons/CommandLineIcon.svelte +15 -0
  81. package/dist/components/icons/CommandLineIcon.svelte.d.ts +26 -0
  82. package/dist/components/icons/MenuIcon.svelte +4 -0
  83. package/dist/components/icons/MenuIcon.svelte.d.ts +26 -0
  84. package/dist/components/icons/MenuOpenIcon.svelte +6 -0
  85. package/dist/components/icons/MenuOpenIcon.svelte.d.ts +26 -0
  86. package/dist/components/interrupt/ChoicePrompt.svelte +0 -10
  87. package/dist/components/interrupt/ConfirmationPrompt.svelte +0 -5
  88. package/dist/components/interrupt/InterruptBubble.svelte +11 -12
  89. package/dist/components/interrupt/ReviewPrompt.svelte +0 -20
  90. package/dist/components/interrupt/TextInputPrompt.svelte +0 -6
  91. package/dist/components/layouts/MainLayout.svelte +4 -5
  92. package/dist/components/nodes/AtomNode.svelte +62 -76
  93. package/dist/components/nodes/AtomNode.svelte.d.ts +1 -1
  94. package/dist/components/nodes/GatewayNode.svelte +117 -164
  95. package/dist/components/nodes/GatewayNode.svelte.d.ts +1 -1
  96. package/dist/components/nodes/IdeaNode.svelte +72 -98
  97. package/dist/components/nodes/IdeaNode.svelte.d.ts +8 -4
  98. package/dist/components/nodes/NodeConfigButton.svelte +86 -0
  99. package/dist/components/nodes/NodeConfigButton.svelte.d.ts +15 -0
  100. package/dist/components/nodes/NotesNode.svelte +76 -85
  101. package/dist/components/nodes/NotesNode.svelte.d.ts +8 -4
  102. package/dist/components/nodes/SimpleNode.svelte +59 -133
  103. package/dist/components/nodes/SimpleNode.svelte.d.ts +4 -4
  104. package/dist/components/nodes/SquareNode.svelte +110 -164
  105. package/dist/components/nodes/SquareNode.svelte.d.ts +4 -4
  106. package/dist/components/nodes/TerminalNode.svelte +62 -124
  107. package/dist/components/nodes/TerminalNode.svelte.d.ts +4 -4
  108. package/dist/components/nodes/ToolNode.svelte +92 -103
  109. package/dist/components/nodes/ToolNode.svelte.d.ts +6 -6
  110. package/dist/components/nodes/WorkflowNode.svelte +132 -191
  111. package/dist/components/nodes/WorkflowNode.svelte.d.ts +1 -1
  112. package/dist/components/playground/ChatInput.svelte +0 -1
  113. package/dist/components/playground/InputCollector.svelte +11 -48
  114. package/dist/components/playground/PipelineKanbanView.svelte +6 -4
  115. package/dist/components/playground/PipelineKanbanView.svelte.d.ts +2 -0
  116. package/dist/components/playground/PipelinePanel.svelte +20 -3
  117. package/dist/components/playground/PipelinePanel.svelte.d.ts +2 -0
  118. package/dist/components/playground/PipelineTableView.svelte +6 -4
  119. package/dist/components/playground/PipelineTableView.svelte.d.ts +2 -0
  120. package/dist/components/playground/Playground.svelte +76 -25
  121. package/dist/components/playground/Playground.svelte.d.ts +3 -0
  122. package/dist/components/playground/PlaygroundApp.svelte +6 -1
  123. package/dist/components/playground/PlaygroundApp.svelte.d.ts +3 -0
  124. package/dist/components/playground/PlaygroundModal.svelte +5 -0
  125. package/dist/components/playground/PlaygroundModal.svelte.d.ts +3 -0
  126. package/dist/components/playground/PlaygroundStudio.svelte +7 -6
  127. package/dist/components/playground/PlaygroundStudio.svelte.d.ts +3 -0
  128. package/dist/components/playground/pipelineViewUtils.svelte.d.ts +2 -1
  129. package/dist/components/playground/pipelineViewUtils.svelte.js +2 -2
  130. package/dist/components/surfaces/SurfaceOverlay.svelte +153 -0
  131. package/dist/components/surfaces/SurfaceOverlay.svelte.d.ts +14 -0
  132. package/dist/components/surfaces/TabbedSurface.svelte +133 -0
  133. package/dist/components/surfaces/TabbedSurface.svelte.d.ts +27 -0
  134. package/dist/config/endpoints.d.ts +23 -0
  135. package/dist/config/endpoints.js +28 -0
  136. package/dist/core/index.d.ts +2 -3
  137. package/dist/core/index.js +2 -6
  138. package/dist/display/index.d.ts +6 -1
  139. package/dist/display/index.js +9 -1
  140. package/dist/editor/index.d.ts +1 -1
  141. package/dist/editor/index.js +1 -1
  142. package/dist/form/full.d.ts +2 -1
  143. package/dist/form/full.js +4 -1
  144. package/dist/form/index.d.ts +0 -1
  145. package/dist/form/index.js +3 -2
  146. package/dist/helpers/workflowEditorHelper.d.ts +4 -2
  147. package/dist/helpers/workflowEditorHelper.js +8 -8
  148. package/dist/messages/index.d.ts +1 -1
  149. package/dist/messages/index.js +1 -1
  150. package/dist/openapi/v1/openapi.yaml +35 -23
  151. package/dist/playground/index.d.ts +2 -2
  152. package/dist/playground/index.js +2 -2
  153. package/dist/playground/mount.d.ts +19 -5
  154. package/dist/playground/mount.js +16 -8
  155. package/dist/registry/builtinNodeTypes.d.ts +53 -0
  156. package/dist/registry/builtinNodeTypes.js +67 -0
  157. package/dist/registry/builtinNodes.d.ts +2 -39
  158. package/dist/registry/builtinNodes.js +6 -53
  159. package/dist/registry/nodeComponentRegistry.d.ts +2 -1
  160. package/dist/schemas/v1/workflow.schema.json +16 -14
  161. package/dist/services/agentSpecExecutionService.d.ts +0 -2
  162. package/dist/services/agentSpecExecutionService.js +0 -2
  163. package/dist/services/apiVariableService.js +12 -26
  164. package/dist/services/categoriesApi.js +3 -6
  165. package/dist/services/chatService.d.ts +4 -3
  166. package/dist/services/chatService.js +13 -18
  167. package/dist/services/dynamicSchemaService.d.ts +31 -4
  168. package/dist/services/dynamicSchemaService.js +62 -33
  169. package/dist/services/historyService.d.ts +30 -8
  170. package/dist/services/historyService.js +51 -15
  171. package/dist/services/interruptService.d.ts +7 -6
  172. package/dist/services/interruptService.js +19 -21
  173. package/dist/services/playgroundService.d.ts +9 -8
  174. package/dist/services/playgroundService.js +23 -25
  175. package/dist/services/portConfigApi.js +3 -6
  176. package/dist/services/settingsService.d.ts +9 -4
  177. package/dist/services/settingsService.js +23 -12
  178. package/dist/skins/drafter.d.ts +30 -0
  179. package/dist/skins/drafter.js +198 -0
  180. package/dist/skins/index.d.ts +2 -1
  181. package/dist/skins/index.js +4 -2
  182. package/dist/stores/apiContext.d.ts +11 -0
  183. package/dist/stores/apiContext.js +15 -0
  184. package/dist/stores/categoriesStore.svelte.js +0 -1
  185. package/dist/stores/historyStore.svelte.d.ts +17 -3
  186. package/dist/stores/historyStore.svelte.js +30 -3
  187. package/dist/stores/instanceContainer.svelte.js +5 -0
  188. package/dist/stores/playgroundStore.svelte.js +1 -3
  189. package/dist/stores/settingsStore.svelte.d.ts +13 -0
  190. package/dist/stores/settingsStore.svelte.js +32 -0
  191. package/dist/stores/workflowStore.svelte.d.ts +42 -5
  192. package/dist/stores/workflowStore.svelte.js +109 -32
  193. package/dist/styles/base.css +285 -14
  194. package/dist/styles/tokens.css +60 -2
  195. package/dist/svelte-app.d.ts +18 -1
  196. package/dist/svelte-app.js +75 -110
  197. package/dist/themes/drafter.d.ts +2 -0
  198. package/dist/themes/drafter.js +15 -0
  199. package/dist/themes/index.d.ts +2 -1
  200. package/dist/themes/index.js +8 -2
  201. package/dist/types/auth.d.ts +9 -51
  202. package/dist/types/auth.js +4 -54
  203. package/dist/types/events.d.ts +18 -0
  204. package/dist/types/events.js +2 -1
  205. package/dist/types/index.d.ts +84 -29
  206. package/dist/types/index.js +0 -1
  207. package/dist/types/settings.d.ts +17 -1
  208. package/dist/types/settings.js +4 -2
  209. package/dist/types/skin.d.ts +1 -1
  210. package/dist/types/theme.d.ts +16 -2
  211. package/dist/types/uischema.d.ts +5 -0
  212. package/dist/utils/colors.d.ts +27 -0
  213. package/dist/utils/colors.js +23 -0
  214. package/dist/utils/connections.js +20 -56
  215. package/dist/utils/edgeStyling.js +9 -5
  216. package/dist/utils/fetchWithAuth.d.ts +36 -15
  217. package/dist/utils/fetchWithAuth.js +53 -23
  218. package/dist/utils/nodeIds.d.ts +1 -1
  219. package/dist/utils/nodeIds.js +1 -1
  220. package/dist/utils/nodeSwap.js +3 -6
  221. package/dist/utils/nodeTypes.js +1 -1
  222. package/dist/utils/portUtils.d.ts +47 -11
  223. package/dist/utils/portUtils.js +67 -14
  224. package/dist/utils/portal.d.ts +18 -0
  225. package/dist/utils/portal.js +34 -0
  226. package/dist/utils/schemaMerge.d.ts +25 -0
  227. package/dist/utils/schemaMerge.js +61 -0
  228. package/package.json +2 -1
@@ -1,4 +1,4 @@
1
- import type { ConfigSchema, WorkflowNode, WorkflowEdge, NodeUIExtensions, AuthProvider } from '../types/index.js';
1
+ import type { ConfigSchema, WorkflowNode, WorkflowEdge, AuthProvider } from '../types/index.js';
2
2
  import type { UISchemaElement } from '../types/uischema.js';
3
3
  interface Props {
4
4
  /** Optional workflow node (if provided, schema and values are derived from it) */
@@ -14,8 +14,6 @@ interface Props {
14
14
  uiSchema?: UISchemaElement;
15
15
  /** Direct config values (used when node is not provided) */
16
16
  values?: Record<string, unknown>;
17
- /** Whether to show UI extension settings section */
18
- showUIExtensions?: boolean;
19
17
  /** Optional workflow ID for context in external links */
20
18
  workflowId?: string;
21
19
  /** Whether to also save the workflow when saving config */
@@ -32,10 +30,29 @@ interface Props {
32
30
  workflowEdges?: WorkflowEdge[];
33
31
  /** Auth provider for API requests (used for template variable API mode) */
34
32
  authProvider?: AuthProvider;
35
- /** Callback when any field value changes (fired on blur for immediate sync) */
36
- onChange?: (config: Record<string, unknown>, uiExtensions?: NodeUIExtensions) => void;
37
- /** Callback when form is saved (includes both config and extensions if enabled) */
38
- onSave?: (config: Record<string, unknown>, uiExtensions?: NodeUIExtensions) => void;
33
+ /**
34
+ * How edits are committed to the parent via `onChange`:
35
+ * - `'blur'` (default): committed on focus-out. Discrete controls
36
+ * (checkbox/enum) additionally commit immediately, because WebKit doesn't
37
+ * focus them on click so no focus-out fires (see handleFieldChange).
38
+ * - `'live'`: committed on every change, with the edited `fieldKey` in the
39
+ * `onChange` meta, plus a final `{ commit: true }` on focus-out. Lets the
40
+ * parent coalesce a field-editing session into one undo step without
41
+ * depending on focus events at all.
42
+ */
43
+ commitMode?: 'blur' | 'live';
44
+ /**
45
+ * Callback when field values change.
46
+ * @param config - The current merged config values.
47
+ * @param meta - `fieldKey` names the changed field (live mode); `commit`
48
+ * marks the end-of-session flush fired on focus-out (live mode).
49
+ */
50
+ onChange?: (config: Record<string, unknown>, meta?: {
51
+ fieldKey?: string;
52
+ commit?: boolean;
53
+ }) => void;
54
+ /** Callback when form is saved */
55
+ onSave?: (config: Record<string, unknown>) => void;
39
56
  /** Callback when form is cancelled */
40
57
  onCancel?: () => void;
41
58
  }
@@ -77,7 +77,6 @@
77
77
  <ConfigForm
78
78
  schema={props.configSchema}
79
79
  values={localConfigValues}
80
- showUIExtensions={false}
81
80
  onSave={(config) => {
82
81
  onSave?.(config);
83
82
  }}
@@ -95,6 +94,15 @@
95
94
  left: 0;
96
95
  right: 0;
97
96
  bottom: 0;
97
+ /*
98
+ This modal is exported (@flowdrop/flowdrop/editor) and embedders like fddo
99
+ mount it standalone, outside the editor container that carries the app
100
+ font. The library's text/inputs use `font-family: inherit`, so without
101
+ this they'd fall back to the host page's default (e.g. serif on a bare
102
+ Drupal page). Re-establish the font here, mirroring SurfaceOverlay /
103
+ ConfigPanel.
104
+ */
105
+ font-family: var(--fd-font-family, system-ui, -apple-system, sans-serif);
98
106
  background-color: rgba(0, 0, 0, 0.5);
99
107
  display: flex;
100
108
  align-items: center;
@@ -12,6 +12,7 @@
12
12
  import ReadOnlyDetails from './ReadOnlyDetails.svelte';
13
13
  import { getUiSettings } from '../stores/settingsStore.svelte.js';
14
14
  import { m } from '../messages/index.js';
15
+ import { portal } from '../utils/portal.js';
15
16
 
16
17
  /**
17
18
  * A single detail item with label and value
@@ -41,6 +42,12 @@
41
42
  onClose: () => void;
42
43
  /** Optional callback to initiate node swap — when provided, shows swap button */
43
44
  onSwap?: () => void;
45
+ /**
46
+ * Whether to show the "pop out" control that opens the panel content in a
47
+ * wide centered modal — useful when the narrow sidebar cramps fields such
48
+ * as prompts. Defaults to true.
49
+ */
50
+ expandable?: boolean;
44
51
  /** Slot content for the configuration form */
45
52
  children?: Snippet;
46
53
  }
@@ -53,15 +60,65 @@
53
60
  configTitle = 'Configuration',
54
61
  onClose,
55
62
  onSwap,
63
+ expandable = true,
56
64
  children
57
65
  }: Props = $props();
58
66
 
67
+ /** Whether the panel content is currently popped out into the modal. */
68
+ let expanded = $state(false);
69
+
70
+ // Unique per component instance so two FlowDrop editors on one page don't
71
+ // render colliding DOM ids (a11y).
72
+ const uid = $props.id();
73
+ const titleId = `${uid}-config-panel-title`;
74
+
59
75
  /**
60
76
  * Check if details section should be shown
61
77
  */
62
78
  const hasDetails = $derived(id !== undefined || details.length > 0 || description !== undefined);
79
+
80
+ /** Dock the popped-out content back into the sidebar (Esc / backdrop click). */
81
+ function dock() {
82
+ expanded = false;
83
+ }
84
+
85
+ function handleModalKeydown(event: KeyboardEvent) {
86
+ if (event.key === 'Escape') {
87
+ event.stopPropagation();
88
+ dock();
89
+ }
90
+ }
91
+
92
+ function handleBackdropClick(event: MouseEvent) {
93
+ if (event.target === event.currentTarget) {
94
+ dock();
95
+ }
96
+ }
63
97
  </script>
64
98
 
99
+ <!--
100
+ The details + configuration content is rendered as a snippet so it can live
101
+ in exactly one place at a time — the sidebar rail while docked, or the modal
102
+ while popped out — without duplicating the form (a Snippet can only be
103
+ rendered once).
104
+ -->
105
+ {#snippet panelContent()}
106
+ {#if hasDetails && id}
107
+ <div class="config-panel__details">
108
+ <ReadOnlyDetails {id} {description} {details} />
109
+ </div>
110
+ {/if}
111
+
112
+ <div class="config-panel__content">
113
+ {#if children}
114
+ <div class="config-panel__section">
115
+ <h3 class="config-panel__section-title">{configTitle}</h3>
116
+ {@render children()}
117
+ </div>
118
+ {/if}
119
+ </div>
120
+ {/snippet}
121
+
65
122
  <div class="config-panel" class:config-panel--compact={getUiSettings().compactMode}>
66
123
  <!-- Header -->
67
124
  <div class="config-panel__header">
@@ -77,6 +134,16 @@
77
134
  <Icon icon="heroicons:arrows-right-left" />
78
135
  </button>
79
136
  {/if}
137
+ {#if expandable && !expanded}
138
+ <button
139
+ class="config-panel__action-btn"
140
+ onclick={() => (expanded = true)}
141
+ aria-label="Pop out configuration"
142
+ title="Pop out to a larger window"
143
+ >
144
+ <Icon icon="heroicons:arrows-pointing-out" />
145
+ </button>
146
+ {/if}
80
147
  <button
81
148
  class="config-panel__close"
82
149
  onclick={onClose}
@@ -87,30 +154,69 @@
87
154
  </div>
88
155
  </div>
89
156
 
90
- <!-- Details Section (between header and content) -->
91
- {#if hasDetails && id}
92
- <div class="config-panel__details">
93
- <ReadOnlyDetails {id} {description} {details} />
157
+ {#if expanded}
158
+ <!-- Content is popped out into the modal; show a lightweight placeholder. -->
159
+ <div class="config-panel__popped">
160
+ <Icon icon="heroicons:window" class="config-panel__popped-icon" />
161
+ <p class="config-panel__popped-text">Configuration is open in a larger window.</p>
162
+ <button class="config-panel__popped-btn" onclick={dock}> Dock back to sidebar </button>
94
163
  </div>
164
+ {:else}
165
+ {@render panelContent()}
95
166
  {/if}
167
+ </div>
96
168
 
97
- <!-- Content -->
98
- <div class="config-panel__content">
99
- {#if children}
100
- <div class="config-panel__section">
101
- <h3 class="config-panel__section-title">{configTitle}</h3>
102
- {@render children()}
169
+ {#if expanded}
170
+ <!-- svelte-ignore a11y_click_events_have_key_events -->
171
+ <!-- svelte-ignore a11y_no_static_element_interactions -->
172
+ <div
173
+ class="config-panel-modal__backdrop"
174
+ use:portal
175
+ onclick={handleBackdropClick}
176
+ onkeydown={handleModalKeydown}
177
+ >
178
+ <div
179
+ class="config-panel-modal"
180
+ role="dialog"
181
+ aria-modal="true"
182
+ aria-labelledby={titleId}
183
+ tabindex="-1"
184
+ >
185
+ <div class="config-panel-modal__header">
186
+ <h2 id={titleId} class="config-panel-modal__title">{title}</h2>
187
+ <div class="config-panel__actions">
188
+ <button
189
+ class="config-panel__action-btn"
190
+ onclick={dock}
191
+ aria-label="Dock configuration back to sidebar"
192
+ title="Dock back to sidebar"
193
+ >
194
+ <Icon icon="heroicons:arrows-pointing-in" />
195
+ </button>
196
+ <button
197
+ class="config-panel__close"
198
+ onclick={onClose}
199
+ aria-label={m().layout.closeConfigPanel}
200
+ >
201
+ ×
202
+ </button>
203
+ </div>
103
204
  </div>
104
- {/if}
205
+
206
+ <div class="config-panel-modal__body">
207
+ {@render panelContent()}
208
+ </div>
209
+ </div>
105
210
  </div>
106
- </div>
211
+ {/if}
107
212
 
108
213
  <style>
109
214
  .config-panel {
110
215
  height: 100%;
111
216
  display: flex;
112
217
  flex-direction: column;
113
- background-color: var(--fd-background);
218
+ background-color: var(--fd-panel-bg);
219
+ backdrop-filter: var(--fd-panel-backdrop-filter);
114
220
  }
115
221
 
116
222
  .config-panel__header {
@@ -119,7 +225,7 @@
119
225
  align-items: center;
120
226
  padding: 0.875rem 1rem;
121
227
  border-bottom: 1px solid var(--fd-border);
122
- background-color: var(--fd-muted);
228
+ background-color: var(--fd-card);
123
229
  flex-shrink: 0;
124
230
  }
125
231
 
@@ -180,7 +286,7 @@
180
286
  .config-panel__details {
181
287
  padding: 0.75rem 1rem;
182
288
  border-bottom: 1px solid var(--fd-border-muted);
183
- background-color: var(--fd-muted);
289
+ background-color: var(--fd-card);
184
290
  flex-shrink: 0;
185
291
  }
186
292
 
@@ -235,4 +341,117 @@
235
341
  .config-panel--compact .config-panel__section {
236
342
  gap: 0.5rem;
237
343
  }
344
+
345
+ /* Popped-out placeholder (shown in the rail while the modal is open) */
346
+ .config-panel__popped {
347
+ flex: 1;
348
+ display: flex;
349
+ flex-direction: column;
350
+ align-items: center;
351
+ justify-content: center;
352
+ gap: 0.75rem;
353
+ padding: 2rem 1rem;
354
+ text-align: center;
355
+ color: var(--fd-muted-foreground);
356
+ }
357
+
358
+ .config-panel__popped :global(.config-panel__popped-icon) {
359
+ width: 2rem;
360
+ height: 2rem;
361
+ opacity: 0.6;
362
+ }
363
+
364
+ .config-panel__popped-text {
365
+ margin: 0;
366
+ font-size: var(--fd-text-sm);
367
+ }
368
+
369
+ .config-panel__popped-btn {
370
+ border: 1px solid var(--fd-border);
371
+ background-color: var(--fd-card);
372
+ color: var(--fd-foreground);
373
+ padding: 0.375rem 0.75rem;
374
+ border-radius: var(--fd-radius-sm);
375
+ font-size: var(--fd-text-sm);
376
+ cursor: pointer;
377
+ transition:
378
+ color var(--fd-transition-fast),
379
+ background-color var(--fd-transition-fast),
380
+ border-color var(--fd-transition-fast);
381
+ }
382
+
383
+ .config-panel__popped-btn:hover {
384
+ color: var(--fd-primary);
385
+ border-color: var(--fd-primary);
386
+ background-color: var(--fd-subtle);
387
+ }
388
+
389
+ /* Pop-out modal */
390
+ .config-panel-modal__backdrop {
391
+ position: fixed;
392
+ inset: 0;
393
+ /*
394
+ Portalled to document.body, this shell sits outside the editor container
395
+ that carries the app font, so it would otherwise inherit the host page's
396
+ default (e.g. serif on a bare Drupal page). Re-establish the font here,
397
+ mirroring the mount container's declaration.
398
+ */
399
+ font-family: var(--fd-font-family, system-ui, -apple-system, sans-serif);
400
+ background-color: var(--fd-backdrop, rgba(0, 0, 0, 0.5));
401
+ display: flex;
402
+ align-items: center;
403
+ justify-content: center;
404
+ z-index: 1000;
405
+ padding: 1rem;
406
+ }
407
+
408
+ .config-panel-modal {
409
+ display: flex;
410
+ flex-direction: column;
411
+ width: 100%;
412
+ max-width: 48rem;
413
+ max-height: 90vh;
414
+ background-color: var(--fd-panel-bg, var(--fd-card));
415
+ border: 1px solid var(--fd-border);
416
+ border-radius: var(--fd-radius-lg, 0.75rem);
417
+ box-shadow: var(--fd-shadow-lg, 0 20px 25px -5px rgba(0, 0, 0, 0.25));
418
+ overflow: hidden;
419
+ }
420
+
421
+ .config-panel-modal__header {
422
+ display: flex;
423
+ justify-content: space-between;
424
+ align-items: center;
425
+ padding: 0.875rem 1rem;
426
+ border-bottom: 1px solid var(--fd-border);
427
+ background-color: var(--fd-card);
428
+ flex-shrink: 0;
429
+ }
430
+
431
+ .config-panel-modal__title {
432
+ margin: 0;
433
+ font-size: 1rem;
434
+ font-weight: 600;
435
+ color: var(--fd-foreground);
436
+ }
437
+
438
+ .config-panel-modal__body {
439
+ flex: 1;
440
+ min-height: 0;
441
+ overflow-y: auto;
442
+ display: flex;
443
+ flex-direction: column;
444
+ }
445
+
446
+ /* Inside the modal the content area should breathe on a wider canvas. */
447
+ .config-panel-modal__body .config-panel__content {
448
+ padding: 1.25rem 1.5rem;
449
+ }
450
+
451
+ @media (max-width: 640px) {
452
+ .config-panel-modal {
453
+ max-width: 100%;
454
+ max-height: 95vh;
455
+ }
456
+ }
238
457
  </style>
@@ -26,6 +26,12 @@ interface Props {
26
26
  onClose: () => void;
27
27
  /** Optional callback to initiate node swap — when provided, shows swap button */
28
28
  onSwap?: () => void;
29
+ /**
30
+ * Whether to show the "pop out" control that opens the panel content in a
31
+ * wide centered modal — useful when the narrow sidebar cramps fields such
32
+ * as prompts. Defaults to true.
33
+ */
34
+ expandable?: boolean;
29
35
  /** Slot content for the configuration form */
30
36
  children?: Snippet;
31
37
  }
@@ -0,0 +1,44 @@
1
+ <script module>
2
+ import { defineMeta } from '@storybook/addon-svelte-csf';
3
+ import EditorStatusBar from './EditorStatusBar.svelte';
4
+ import { fn } from 'storybook/test';
5
+
6
+ const { Story } = defineMeta({
7
+ title: 'Editor/EditorStatusBar',
8
+ component: EditorStatusBar,
9
+ tags: ['autodocs'],
10
+ parameters: {
11
+ // The banner is full-width editor chrome — show it edge to edge.
12
+ layout: 'fullscreen'
13
+ },
14
+ args: {
15
+ onRetry: fn(),
16
+ onSetApiUrl: fn(),
17
+ onTestApi: fn(),
18
+ onDismiss: fn()
19
+ }
20
+ });
21
+ </script>
22
+
23
+ <Story
24
+ name="Default"
25
+ args={{
26
+ error: 'API Error: Failed to fetch. No node types available.'
27
+ }}
28
+ />
29
+
30
+ <!-- The real message when the endpoint serves HTML (e.g. a 404 page) instead of JSON. -->
31
+ <Story
32
+ name="Long Message"
33
+ args={{
34
+ error:
35
+ 'API Error: Unexpected token \'<\', "<!doctype "... is not valid JSON. No node types available.'
36
+ }}
37
+ />
38
+
39
+ <Story
40
+ name="Endpoint Unreachable"
41
+ args={{
42
+ error: 'API Error: NetworkError when attempting to fetch resource. No node types available.'
43
+ }}
44
+ />
@@ -0,0 +1,27 @@
1
+ export default EditorStatusBar;
2
+ type EditorStatusBar = SvelteComponent<{
3
+ [x: string]: never;
4
+ }, {
5
+ [evt: string]: CustomEvent<any>;
6
+ }, {}> & {
7
+ $$bindings?: string | undefined;
8
+ };
9
+ declare const EditorStatusBar: $$__sveltets_2_IsomorphicComponent<{
10
+ [x: string]: never;
11
+ }, {
12
+ [evt: string]: CustomEvent<any>;
13
+ }, {}, {}, string>;
14
+ import EditorStatusBar from './EditorStatusBar.svelte';
15
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
16
+ new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
17
+ $$bindings?: Bindings;
18
+ } & Exports;
19
+ (internal: unknown, props: {
20
+ $$events?: Events;
21
+ $$slots?: Slots;
22
+ }): Exports & {
23
+ $set?: any;
24
+ $on?: any;
25
+ };
26
+ z_$$bindings?: Bindings;
27
+ }
@@ -0,0 +1,99 @@
1
+ <!--
2
+ EditorStatusBar — the dismissible error banner shown above the editor canvas
3
+ when node types fail to load (endpoint missing or unreachable).
4
+
5
+ Extracted from App.svelte so it can be storied/tested in isolation. The action
6
+ buttons route through the shared Button primitive; all colours come from design
7
+ tokens, so the banner stays in sync with the rest of the editor chrome.
8
+ -->
9
+ <script lang="ts">
10
+ import Button from './Button.svelte';
11
+ import CloseIcon from './icons/CloseIcon.svelte';
12
+
13
+ interface Props {
14
+ /** The error message to display (rendered after an "Error:" prefix). */
15
+ error: string;
16
+ /** Retry loading node types. */
17
+ onRetry: () => void;
18
+ /** Prompt for / set a new backend API URL. */
19
+ onSetApiUrl: () => void;
20
+ /** Run a connectivity test against the configured endpoint. */
21
+ onTestApi: () => void;
22
+ /** Dismiss the banner. */
23
+ onDismiss: () => void;
24
+ }
25
+
26
+ let { error, onRetry, onSetApiUrl, onTestApi, onDismiss }: Props = $props();
27
+ </script>
28
+
29
+ <!-- aria-live announces the API error dynamically without requiring focus -->
30
+ <div class="flowdrop-status flowdrop-status--error" aria-live="polite" aria-atomic="true">
31
+ <div class="flowdrop-status__content">
32
+ <div class="flowdrop-status__message">
33
+ <div class="flowdrop-status__indicator"></div>
34
+ <span class="flowdrop-status__text">Error: {error}</span>
35
+ </div>
36
+ <div class="flowdrop-status__actions">
37
+ <Button variant="primary" size="sm" onclick={onRetry}>Retry</Button>
38
+ <Button variant="outline" size="sm" onclick={onSetApiUrl}>Set API URL</Button>
39
+ <Button variant="outline" size="sm" onclick={onTestApi}>Test API</Button>
40
+ <Button variant="ghost" size="sm" ariaLabel="Dismiss error" onclick={onDismiss}>
41
+ <span class="flowdrop-status__dismiss-icon"><CloseIcon /></span>
42
+ </Button>
43
+ </div>
44
+ </div>
45
+ </div>
46
+
47
+ <style>
48
+ .flowdrop-status {
49
+ padding: var(--fd-space-xl);
50
+ }
51
+
52
+ .flowdrop-status--error {
53
+ background-color: var(--fd-error-muted);
54
+ border-bottom: 1px solid var(--fd-error);
55
+ }
56
+
57
+ .flowdrop-status__content {
58
+ display: flex;
59
+ align-items: center;
60
+ justify-content: space-between;
61
+ gap: var(--fd-space-md);
62
+ }
63
+
64
+ .flowdrop-status__message {
65
+ display: flex;
66
+ align-items: center;
67
+ gap: var(--fd-space-md);
68
+ min-width: 0;
69
+ }
70
+
71
+ .flowdrop-status__indicator {
72
+ flex-shrink: 0;
73
+ width: 0.5rem;
74
+ height: 0.5rem;
75
+ border-radius: 50%;
76
+ background-color: var(--fd-error);
77
+ }
78
+
79
+ .flowdrop-status__text {
80
+ font-size: var(--fd-text-sm);
81
+ line-height: 1.25rem;
82
+ font-weight: 500;
83
+ }
84
+
85
+ .flowdrop-status__actions {
86
+ display: flex;
87
+ gap: var(--fd-space-xs);
88
+ flex-shrink: 0;
89
+ }
90
+
91
+ .flowdrop-status__dismiss-icon {
92
+ display: inline-flex;
93
+ }
94
+
95
+ .flowdrop-status__dismiss-icon :global(svg) {
96
+ width: 0.875rem;
97
+ height: 0.875rem;
98
+ }
99
+ </style>
@@ -0,0 +1,15 @@
1
+ interface Props {
2
+ /** The error message to display (rendered after an "Error:" prefix). */
3
+ error: string;
4
+ /** Retry loading node types. */
5
+ onRetry: () => void;
6
+ /** Prompt for / set a new backend API URL. */
7
+ onSetApiUrl: () => void;
8
+ /** Run a connectivity test against the configured endpoint. */
9
+ onTestApi: () => void;
10
+ /** Dismiss the banner. */
11
+ onDismiss: () => void;
12
+ }
13
+ declare const EditorStatusBar: import("svelte").Component<Props, {}, "">;
14
+ type EditorStatusBar = ReturnType<typeof EditorStatusBar>;
15
+ export default EditorStatusBar;
@@ -0,0 +1,80 @@
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>