@flowdrop/flowdrop 2.0.0-beta.1 → 2.0.0-beta.11

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 (270) hide show
  1. package/CHANGELOG.md +210 -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/chat/batchFeedback.js +1 -1
  9. package/dist/chat/commandClassifier.d.ts +11 -0
  10. package/dist/chat/commandClassifier.js +20 -0
  11. package/dist/chat/historyBuilder.d.ts +39 -0
  12. package/dist/chat/historyBuilder.js +82 -0
  13. package/dist/chat/index.d.ts +2 -1
  14. package/dist/chat/index.js +2 -1
  15. package/dist/chat/responseParser.js +16 -12
  16. package/dist/commands/executor.js +51 -26
  17. package/dist/commands/parser.d.ts +12 -0
  18. package/dist/commands/parser.js +33 -6
  19. package/dist/commands/storeIntegration.svelte.js +11 -1
  20. package/dist/commands/types.js +5 -5
  21. package/dist/components/App.svelte +547 -386
  22. package/dist/components/App.svelte.d.ts +16 -8
  23. package/dist/components/Button.stories.svelte +65 -0
  24. package/dist/components/Button.stories.svelte.d.ts +19 -0
  25. package/dist/components/Button.svelte +62 -0
  26. package/dist/components/Button.svelte.d.ts +24 -0
  27. package/dist/components/CanvasIconButton.svelte +76 -0
  28. package/dist/components/CanvasIconButton.svelte.d.ts +18 -0
  29. package/dist/components/ConfigForm.svelte +194 -565
  30. package/dist/components/ConfigForm.svelte.d.ts +24 -7
  31. package/dist/components/ConfigModal.svelte +9 -1
  32. package/dist/components/ConfigPanel.svelte +234 -15
  33. package/dist/components/ConfigPanel.svelte.d.ts +6 -0
  34. package/dist/components/EditorStatusBar.stories.svelte +44 -0
  35. package/dist/components/EditorStatusBar.stories.svelte.d.ts +27 -0
  36. package/dist/components/EditorStatusBar.svelte +99 -0
  37. package/dist/components/EditorStatusBar.svelte.d.ts +15 -0
  38. package/dist/components/IconButton.svelte +80 -0
  39. package/dist/components/IconButton.svelte.d.ts +30 -0
  40. package/dist/components/Input.svelte +74 -0
  41. package/dist/components/Input.svelte.d.ts +17 -0
  42. package/dist/components/LogoWordmark.svelte +113 -0
  43. package/dist/components/LogoWordmark.svelte.d.ts +26 -0
  44. package/dist/components/Navbar.svelte +17 -63
  45. package/dist/components/Navbar.svelte.d.ts +3 -0
  46. package/dist/components/NodeSidebar.svelte +21 -126
  47. package/dist/components/NodeSwapPicker.svelte +12 -30
  48. package/dist/components/PipelineStatus.svelte +6 -1
  49. package/dist/components/PipelineStatus.svelte.d.ts +3 -0
  50. package/dist/components/PortMappingRow.svelte +0 -2
  51. package/dist/components/SchemaForm.svelte +4 -14
  52. package/dist/components/Select.svelte +53 -0
  53. package/dist/components/Select.svelte.d.ts +15 -0
  54. package/dist/components/SettingsModal.svelte +0 -5
  55. package/dist/components/SettingsPanel.svelte +33 -6
  56. package/dist/components/Textarea.svelte +39 -0
  57. package/dist/components/Textarea.svelte.d.ts +12 -0
  58. package/dist/components/ThemeToggle.svelte +15 -94
  59. package/dist/components/UniversalNode.svelte +36 -4
  60. package/dist/components/UniversalNode.svelte.d.ts +1 -1
  61. package/dist/components/WorkflowEditor.svelte +71 -54
  62. package/dist/components/WorkflowEditor.svelte.d.ts +21 -0
  63. package/dist/components/chat/AIChatPanel.svelte +49 -8
  64. package/dist/components/chat/CommandPreview.svelte +10 -1
  65. package/dist/components/console/ConsoleAutocomplete.svelte +1 -1
  66. package/dist/components/console/ConsoleInput.svelte +3 -3
  67. package/dist/components/console/ConsoleOutput.svelte +2 -2
  68. package/dist/components/form/FormArray.svelte +37 -173
  69. package/dist/components/form/FormAutocomplete.svelte +18 -15
  70. package/dist/components/form/FormCheckboxGroup.svelte +1 -5
  71. package/dist/components/form/FormCodeEditor.svelte +9 -7
  72. package/dist/components/form/FormField.svelte +18 -42
  73. package/dist/components/form/FormFieldLight.svelte +52 -48
  74. package/dist/components/form/FormFieldLight.svelte.d.ts +12 -0
  75. package/dist/components/form/FormFieldset.svelte +45 -11
  76. package/dist/components/form/FormMarkdownEditor.svelte +8 -5
  77. package/dist/components/form/FormNumberField.svelte +4 -36
  78. package/dist/components/form/FormPorts.svelte +280 -0
  79. package/dist/components/form/FormPorts.svelte.d.ts +13 -0
  80. package/dist/components/form/FormRangeField.svelte +63 -30
  81. package/dist/components/form/FormSelect.svelte +13 -75
  82. package/dist/components/form/FormTemplateEditor.svelte +6 -4
  83. package/dist/components/form/FormTextField.svelte +3 -35
  84. package/dist/components/form/FormTextarea.svelte +4 -39
  85. package/dist/components/form/FormToggle.svelte +27 -6
  86. package/dist/components/form/FormToggle.svelte.d.ts +5 -0
  87. package/dist/components/form/FormUISchemaRenderer.svelte +3 -1
  88. package/dist/components/form/resolveFieldType.d.ts +24 -0
  89. package/dist/components/form/resolveFieldType.js +55 -0
  90. package/dist/components/icons/CloseIcon.svelte +6 -0
  91. package/dist/components/icons/CloseIcon.svelte.d.ts +26 -0
  92. package/dist/components/icons/CommandLineIcon.svelte +15 -0
  93. package/dist/components/icons/CommandLineIcon.svelte.d.ts +26 -0
  94. package/dist/components/icons/MenuIcon.svelte +4 -0
  95. package/dist/components/icons/MenuIcon.svelte.d.ts +26 -0
  96. package/dist/components/icons/MenuOpenIcon.svelte +6 -0
  97. package/dist/components/icons/MenuOpenIcon.svelte.d.ts +26 -0
  98. package/dist/components/interrupt/ChoicePrompt.svelte +0 -10
  99. package/dist/components/interrupt/ConfirmationPrompt.svelte +0 -5
  100. package/dist/components/interrupt/InterruptBubble.svelte +11 -12
  101. package/dist/components/interrupt/ReviewPrompt.svelte +0 -20
  102. package/dist/components/interrupt/TextInputPrompt.svelte +0 -6
  103. package/dist/components/layouts/MainLayout.svelte +4 -5
  104. package/dist/components/nodes/AtomNode.svelte +62 -76
  105. package/dist/components/nodes/AtomNode.svelte.d.ts +1 -1
  106. package/dist/components/nodes/GatewayNode.svelte +117 -164
  107. package/dist/components/nodes/GatewayNode.svelte.d.ts +1 -1
  108. package/dist/components/nodes/IdeaNode.svelte +72 -98
  109. package/dist/components/nodes/IdeaNode.svelte.d.ts +8 -4
  110. package/dist/components/nodes/NodeConfigButton.svelte +86 -0
  111. package/dist/components/nodes/NodeConfigButton.svelte.d.ts +15 -0
  112. package/dist/components/nodes/NotesNode.svelte +76 -85
  113. package/dist/components/nodes/NotesNode.svelte.d.ts +8 -4
  114. package/dist/components/nodes/SimpleNode.svelte +59 -133
  115. package/dist/components/nodes/SimpleNode.svelte.d.ts +4 -4
  116. package/dist/components/nodes/SquareNode.svelte +110 -164
  117. package/dist/components/nodes/SquareNode.svelte.d.ts +4 -4
  118. package/dist/components/nodes/TerminalNode.svelte +62 -124
  119. package/dist/components/nodes/TerminalNode.svelte.d.ts +4 -4
  120. package/dist/components/nodes/ToolNode.svelte +92 -103
  121. package/dist/components/nodes/ToolNode.svelte.d.ts +6 -6
  122. package/dist/components/nodes/WorkflowNode.svelte +132 -191
  123. package/dist/components/nodes/WorkflowNode.svelte.d.ts +1 -1
  124. package/dist/components/playground/ChatInput.svelte +316 -27
  125. package/dist/components/playground/ChatInput.svelte.d.ts +31 -1
  126. package/dist/components/playground/ControlPanel.svelte +22 -0
  127. package/dist/components/playground/ControlPanel.svelte.d.ts +13 -0
  128. package/dist/components/playground/InputCollector.svelte +11 -48
  129. package/dist/components/playground/PipelineKanbanView.svelte +6 -4
  130. package/dist/components/playground/PipelineKanbanView.svelte.d.ts +2 -0
  131. package/dist/components/playground/PipelinePanel.svelte +20 -3
  132. package/dist/components/playground/PipelinePanel.svelte.d.ts +2 -0
  133. package/dist/components/playground/PipelineTableView.svelte +6 -4
  134. package/dist/components/playground/PipelineTableView.svelte.d.ts +2 -0
  135. package/dist/components/playground/Playground.svelte +292 -28
  136. package/dist/components/playground/Playground.svelte.d.ts +3 -0
  137. package/dist/components/playground/PlaygroundApp.svelte +6 -1
  138. package/dist/components/playground/PlaygroundApp.svelte.d.ts +3 -0
  139. package/dist/components/playground/PlaygroundModal.svelte +5 -0
  140. package/dist/components/playground/PlaygroundModal.svelte.d.ts +3 -0
  141. package/dist/components/playground/PlaygroundStudio.svelte +7 -6
  142. package/dist/components/playground/PlaygroundStudio.svelte.d.ts +3 -0
  143. package/dist/components/playground/pipelineViewUtils.svelte.d.ts +2 -1
  144. package/dist/components/playground/pipelineViewUtils.svelte.js +2 -2
  145. package/dist/components/surfaces/SurfaceOverlay.svelte +153 -0
  146. package/dist/components/surfaces/SurfaceOverlay.svelte.d.ts +14 -0
  147. package/dist/components/surfaces/TabbedSurface.svelte +133 -0
  148. package/dist/components/surfaces/TabbedSurface.svelte.d.ts +27 -0
  149. package/dist/config/endpoints.d.ts +71 -1
  150. package/dist/config/endpoints.js +46 -5
  151. package/dist/core/index.d.ts +2 -3
  152. package/dist/core/index.js +2 -6
  153. package/dist/display/index.d.ts +6 -1
  154. package/dist/display/index.js +9 -1
  155. package/dist/editor/index.d.ts +1 -1
  156. package/dist/editor/index.js +1 -1
  157. package/dist/form/full.d.ts +2 -1
  158. package/dist/form/full.js +4 -1
  159. package/dist/form/index.d.ts +0 -1
  160. package/dist/form/index.js +3 -2
  161. package/dist/helpers/workflowEditorHelper.d.ts +4 -2
  162. package/dist/helpers/workflowEditorHelper.js +8 -8
  163. package/dist/messages/defaults.d.ts +98 -0
  164. package/dist/messages/defaults.js +58 -1
  165. package/dist/messages/index.d.ts +1 -1
  166. package/dist/messages/index.js +1 -1
  167. package/dist/openapi/v1/openapi.yaml +35 -23
  168. package/dist/playground/commands/args.d.ts +32 -0
  169. package/dist/playground/commands/args.js +50 -0
  170. package/dist/playground/commands/dispatch.d.ts +143 -0
  171. package/dist/playground/commands/dispatch.js +162 -0
  172. package/dist/playground/commands/index.d.ts +14 -0
  173. package/dist/playground/commands/index.js +10 -0
  174. package/dist/playground/commands/parser.d.ts +38 -0
  175. package/dist/playground/commands/parser.js +163 -0
  176. package/dist/playground/commands/registry.d.ts +42 -0
  177. package/dist/playground/commands/registry.js +122 -0
  178. package/dist/playground/commands/suggest.d.ts +37 -0
  179. package/dist/playground/commands/suggest.js +46 -0
  180. package/dist/playground/commands/types.d.ts +111 -0
  181. package/dist/playground/commands/types.js +15 -0
  182. package/dist/playground/index.d.ts +21 -2
  183. package/dist/playground/index.js +27 -2
  184. package/dist/playground/mount.d.ts +19 -5
  185. package/dist/playground/mount.js +16 -8
  186. package/dist/playground/runAction.d.ts +48 -0
  187. package/dist/playground/runAction.js +31 -0
  188. package/dist/registry/builtinNodeTypes.d.ts +53 -0
  189. package/dist/registry/builtinNodeTypes.js +67 -0
  190. package/dist/registry/builtinNodes.d.ts +2 -39
  191. package/dist/registry/builtinNodes.js +6 -53
  192. package/dist/registry/nodeComponentRegistry.d.ts +2 -1
  193. package/dist/schemas/v1/workflow.schema.json +16 -14
  194. package/dist/services/agentSpecExecutionService.d.ts +0 -2
  195. package/dist/services/agentSpecExecutionService.js +0 -2
  196. package/dist/services/apiVariableService.js +12 -26
  197. package/dist/services/categoriesApi.js +3 -6
  198. package/dist/services/chatService.d.ts +4 -3
  199. package/dist/services/chatService.js +13 -18
  200. package/dist/services/dynamicSchemaService.d.ts +31 -4
  201. package/dist/services/dynamicSchemaService.js +62 -33
  202. package/dist/services/historyService.d.ts +30 -8
  203. package/dist/services/historyService.js +51 -15
  204. package/dist/services/interruptService.d.ts +7 -6
  205. package/dist/services/interruptService.js +19 -21
  206. package/dist/services/pipelineSignalService.d.ts +97 -0
  207. package/dist/services/pipelineSignalService.js +94 -0
  208. package/dist/services/playgroundService.d.ts +21 -8
  209. package/dist/services/playgroundService.js +45 -25
  210. package/dist/services/portConfigApi.js +3 -6
  211. package/dist/services/settingsService.d.ts +9 -4
  212. package/dist/services/settingsService.js +23 -12
  213. package/dist/services/workflowLaunchService.d.ts +74 -0
  214. package/dist/services/workflowLaunchService.js +74 -0
  215. package/dist/skins/drafter.d.ts +30 -0
  216. package/dist/skins/drafter.js +198 -0
  217. package/dist/skins/index.d.ts +2 -1
  218. package/dist/skins/index.js +4 -2
  219. package/dist/stores/apiContext.d.ts +11 -0
  220. package/dist/stores/apiContext.js +15 -0
  221. package/dist/stores/categoriesStore.svelte.js +0 -1
  222. package/dist/stores/historyStore.svelte.d.ts +17 -3
  223. package/dist/stores/historyStore.svelte.js +30 -3
  224. package/dist/stores/instanceContainer.svelte.js +5 -0
  225. package/dist/stores/playgroundStore.svelte.js +1 -3
  226. package/dist/stores/settingsStore.svelte.d.ts +13 -0
  227. package/dist/stores/settingsStore.svelte.js +32 -0
  228. package/dist/stores/workflowStore.svelte.d.ts +42 -5
  229. package/dist/stores/workflowStore.svelte.js +109 -32
  230. package/dist/styles/base.css +285 -14
  231. package/dist/styles/tokens.css +60 -2
  232. package/dist/svelte-app.d.ts +18 -1
  233. package/dist/svelte-app.js +75 -110
  234. package/dist/themes/drafter.d.ts +2 -0
  235. package/dist/themes/drafter.js +15 -0
  236. package/dist/themes/index.d.ts +2 -1
  237. package/dist/themes/index.js +8 -2
  238. package/dist/types/auth.d.ts +9 -51
  239. package/dist/types/auth.js +4 -54
  240. package/dist/types/chat.d.ts +5 -1
  241. package/dist/types/events.d.ts +18 -0
  242. package/dist/types/events.js +2 -1
  243. package/dist/types/index.d.ts +84 -29
  244. package/dist/types/index.js +0 -1
  245. package/dist/types/settings.d.ts +28 -1
  246. package/dist/types/settings.js +6 -3
  247. package/dist/types/skin.d.ts +1 -1
  248. package/dist/types/theme.d.ts +16 -2
  249. package/dist/types/uischema.d.ts +5 -0
  250. package/dist/utils/canvasSelection.d.ts +25 -0
  251. package/dist/utils/canvasSelection.js +37 -0
  252. package/dist/utils/colors.d.ts +27 -0
  253. package/dist/utils/colors.js +23 -0
  254. package/dist/utils/connections.js +20 -56
  255. package/dist/utils/edgeStyling.js +9 -5
  256. package/dist/utils/fetchWithAuth.d.ts +36 -15
  257. package/dist/utils/fetchWithAuth.js +53 -23
  258. package/dist/utils/nodeFormSchema.d.ts +51 -0
  259. package/dist/utils/nodeFormSchema.js +87 -0
  260. package/dist/utils/nodeIds.d.ts +1 -1
  261. package/dist/utils/nodeIds.js +1 -1
  262. package/dist/utils/nodeSwap.js +3 -6
  263. package/dist/utils/nodeTypes.js +1 -1
  264. package/dist/utils/portUtils.d.ts +47 -11
  265. package/dist/utils/portUtils.js +67 -14
  266. package/dist/utils/portal.d.ts +18 -0
  267. package/dist/utils/portal.js +34 -0
  268. package/dist/utils/schemaMerge.d.ts +25 -0
  269. package/dist/utils/schemaMerge.js +61 -0
  270. package/package.json +2 -1
@@ -11,6 +11,8 @@
11
11
  -->
12
12
 
13
13
  <script lang="ts">
14
+ import { untrack } from 'svelte';
15
+
14
16
  interface Props {
15
17
  /** Field identifier */
16
18
  id: string;
@@ -37,7 +39,7 @@
37
39
  value = 0,
38
40
  min = 0,
39
41
  max = 100,
40
- step = 1,
42
+ step,
41
43
  required = false,
42
44
  disabled = false,
43
45
  ariaDescribedBy,
@@ -56,6 +58,40 @@
56
58
  return isNaN(parsed) ? min : parsed;
57
59
  });
58
60
 
61
+ /** Count the decimal places of a finite number (e.g. 0.7 -> 1, 3 -> 0). */
62
+ function decimalPlaces(n: number): number {
63
+ if (!Number.isFinite(n)) return 0;
64
+ const text = String(n);
65
+ const dot = text.indexOf('.');
66
+ return dot === -1 ? 0 : text.length - dot - 1;
67
+ }
68
+
69
+ /**
70
+ * Resolve the step the native input should use.
71
+ *
72
+ * The backend often omits `step`, and a default of 1 makes the browser snap a
73
+ * fractional value (0.7) to the nearest integer (1) — the thumb jumps to that
74
+ * snapped position while our fill/label still show the raw value, so they
75
+ * disagree on load. When no step is given, infer one from the precision of the
76
+ * initial value/min/max so a value like 0.7 yields a step of 0.1.
77
+ *
78
+ * Granularity is a property of the field, not the live value, so it is captured
79
+ * ONCE. Recomputing from the live value would coarsen the step back to 1 the
80
+ * instant the user drags onto a whole number (e.g. 1.0), stranding the slider
81
+ * on integer increments.
82
+ */
83
+ const inferredStep = untrack((): number => {
84
+ const initialNumeric = typeof value === 'number' ? value : Number(value);
85
+ const places = Math.max(
86
+ decimalPlaces(Number.isNaN(initialNumeric) ? min : initialNumeric),
87
+ decimalPlaces(min),
88
+ decimalPlaces(max)
89
+ );
90
+ return places > 0 ? Math.pow(10, -places) : 1;
91
+ });
92
+
93
+ const effectiveStep = $derived(typeof step === 'number' && step > 0 ? step : inferredStep);
94
+
59
95
  /**
60
96
  * Compute the percentage position for the filled track
61
97
  * Used to show visual progress of the slider
@@ -79,14 +115,20 @@
79
115
 
80
116
  <div class="form-range-container">
81
117
  <div class="form-range-slider">
118
+ <!--
119
+ Order matters: min/max/step must be applied BEFORE value. A range input
120
+ defaults to step=1, so setting value=0.7 first snaps it to 1, and the later
121
+ step=0.1 does not re-validate the already-snapped value. Setting the bounds
122
+ and step first lets the value land truthfully.
123
+ -->
82
124
  <input
83
125
  {id}
84
126
  type="range"
85
127
  class="form-range-field"
86
- value={numericValue}
87
128
  {min}
88
129
  {max}
89
- {step}
130
+ step={effectiveStep}
131
+ value={numericValue}
90
132
  {disabled}
91
133
  {required}
92
134
  aria-describedby={ariaDescribedBy}
@@ -94,7 +136,7 @@
94
136
  aria-valuemax={max}
95
137
  aria-valuenow={numericValue}
96
138
  oninput={handleInput}
97
- style="--progress: {progressPercentage}%"
139
+ style="--progress: {progressPercentage}"
98
140
  />
99
141
  </div>
100
142
  <div class="form-range-values">
@@ -119,6 +161,16 @@
119
161
  }
120
162
 
121
163
  .form-range-field {
164
+ /* Thumb width; the fill edge is offset by half of this so it tracks the
165
+ thumb centre instead of the raw 0–100% of the track. */
166
+ --fd-range-thumb-size: 18px;
167
+ /* `--progress` is a unitless 0–100 set inline. The browser keeps the thumb
168
+ inside the track, so its centre travels from thumb/2 to (100% − thumb/2);
169
+ mirror that here so the colour fill lines up at every value, on load too. */
170
+ --fd-range-fill: calc(
171
+ var(--fd-range-thumb-size) / 2 + (100% - var(--fd-range-thumb-size)) * var(--progress, 0) /
172
+ 100
173
+ );
122
174
  width: 100%;
123
175
  height: 6px;
124
176
  border-radius: 3px;
@@ -127,8 +179,8 @@
127
179
  background: linear-gradient(
128
180
  to right,
129
181
  var(--fd-primary) 0%,
130
- var(--fd-primary) var(--progress, 0%),
131
- var(--fd-border) var(--progress, 0%),
182
+ var(--fd-primary) var(--fd-range-fill),
183
+ var(--fd-border) var(--fd-range-fill),
132
184
  var(--fd-border) 100%
133
185
  );
134
186
  cursor: pointer;
@@ -145,8 +197,8 @@
145
197
  .form-range-field::-webkit-slider-thumb {
146
198
  -webkit-appearance: none;
147
199
  appearance: none;
148
- width: 18px;
149
- height: 18px;
200
+ width: var(--fd-range-thumb-size);
201
+ height: var(--fd-range-thumb-size);
150
202
  border-radius: 50%;
151
203
  background: linear-gradient(135deg, var(--fd-background) 0%, var(--fd-muted) 100%);
152
204
  border: 2px solid var(--fd-primary);
@@ -165,12 +217,6 @@
165
217
  0 2px 4px rgba(0, 0, 0, 0.1);
166
218
  }
167
219
 
168
- .form-range-field:focus::-webkit-slider-thumb {
169
- box-shadow:
170
- 0 0 0 3px rgba(59, 130, 246, 0.2),
171
- 0 4px 12px rgba(59, 130, 246, 0.35);
172
- }
173
-
174
220
  /* Firefox - Track */
175
221
  .form-range-field::-moz-range-track {
176
222
  height: 6px;
@@ -186,8 +232,8 @@
186
232
 
187
233
  /* Firefox - Thumb */
188
234
  .form-range-field::-moz-range-thumb {
189
- width: 18px;
190
- height: 18px;
235
+ width: var(--fd-range-thumb-size);
236
+ height: var(--fd-range-thumb-size);
191
237
  border-radius: 50%;
192
238
  background: linear-gradient(135deg, var(--fd-background) 0%, var(--fd-muted) 100%);
193
239
  border: 2px solid var(--fd-primary);
@@ -205,20 +251,7 @@
205
251
  0 2px 4px rgba(0, 0, 0, 0.1);
206
252
  }
207
253
 
208
- .form-range-field:focus::-moz-range-thumb {
209
- box-shadow:
210
- 0 0 0 3px rgba(59, 130, 246, 0.2),
211
- 0 4px 12px rgba(59, 130, 246, 0.35);
212
- }
213
-
214
- /* Focus styles */
215
- .form-range-field:focus {
216
- outline: none;
217
- }
218
-
219
- .form-range-field:focus-visible {
220
- outline: none;
221
- }
254
+ /* Focus ring is centralized in base.css (outline on the range input). */
222
255
 
223
256
  /* Value display row */
224
257
  .form-range-values {
@@ -9,7 +9,7 @@
9
9
  -->
10
10
 
11
11
  <script lang="ts">
12
- import Icon from '@iconify/svelte';
12
+ import Select from '../Select.svelte';
13
13
  import { normalizeOptions, type FieldOption } from './types.js';
14
14
 
15
15
  interface Props {
@@ -53,77 +53,15 @@
53
53
  }
54
54
  </script>
55
55
 
56
- <div class="form-select-wrapper">
57
- <select
58
- {id}
59
- class="form-select"
60
- value={value ?? ''}
61
- {disabled}
62
- aria-describedby={ariaDescribedBy}
63
- aria-required={required}
64
- onchange={handleChange}
65
- >
66
- {#each normalizedOptions as option (option.value)}
67
- <option value={option.value}>{option.label}</option>
68
- {/each}
69
- </select>
70
- <span class="form-select__icon" aria-hidden="true">
71
- <Icon icon="heroicons:chevron-down" />
72
- </span>
73
- </div>
74
-
75
- <style>
76
- .form-select-wrapper {
77
- position: relative;
78
- }
79
-
80
- .form-select {
81
- width: 100%;
82
- padding: 0.625rem 2.5rem 0.625rem 0.875rem;
83
- border: 1px solid var(--fd-border);
84
- border-radius: var(--fd-radius-lg);
85
- font-size: var(--fd-text-sm);
86
- font-family: inherit;
87
- color: var(--fd-foreground);
88
- background-color: var(--fd-muted);
89
- transition: all var(--fd-transition-normal);
90
- box-shadow: var(--fd-shadow-sm);
91
- cursor: pointer;
92
- appearance: none;
93
- }
94
-
95
- .form-select:hover {
96
- border-color: var(--fd-border-strong);
97
- background-color: var(--fd-background);
98
- }
99
-
100
- .form-select:focus {
101
- outline: none;
102
- border-color: var(--fd-primary);
103
- background-color: var(--fd-background);
104
- box-shadow:
105
- 0 0 0 3px rgba(59, 130, 246, 0.12),
106
- var(--fd-shadow-sm);
107
- }
108
-
109
- .form-select__icon {
110
- position: absolute;
111
- right: 0.75rem;
112
- top: 50%;
113
- transform: translateY(-50%);
114
- pointer-events: none;
115
- color: var(--fd-muted-foreground);
116
- display: flex;
117
- align-items: center;
118
- transition: color var(--fd-transition-normal);
119
- }
120
-
121
- .form-select__icon :global(svg) {
122
- width: 1rem;
123
- height: 1rem;
124
- }
125
-
126
- .form-select:focus + .form-select__icon {
127
- color: var(--fd-primary);
128
- }
129
- </style>
56
+ <Select
57
+ {id}
58
+ value={value ?? ''}
59
+ {disabled}
60
+ aria-describedby={ariaDescribedBy}
61
+ aria-required={required}
62
+ onchange={handleChange}
63
+ >
64
+ {#each normalizedOptions as option (option.value)}
65
+ <option value={option.value}>{option.label}</option>
66
+ {/each}
67
+ </Select>
@@ -623,7 +623,8 @@
623
623
  border: 1px solid var(--fd-border);
624
624
  border-radius: var(--fd-radius-lg);
625
625
  overflow: hidden;
626
- background-color: var(--fd-muted);
626
+ /* Match plain form fields: rest on the input surface, not --fd-muted. */
627
+ background-color: var(--fd-background);
627
628
  transition: all var(--fd-transition-normal);
628
629
  box-shadow: var(--fd-shadow-sm);
629
630
  }
@@ -633,12 +634,13 @@
633
634
  background-color: var(--fd-background);
634
635
  }
635
636
 
637
+ /* Compound widget: ring drawn on the container via :focus-within, using the
638
+ standard --fd-ring tokens (outline isn't clipped by the container overflow). */
636
639
  .form-template-editor__container:focus-within {
637
640
  border-color: var(--fd-accent);
638
641
  background-color: var(--fd-background);
639
- box-shadow:
640
- 0 0 0 3px rgba(168, 85, 247, 0.12),
641
- var(--fd-shadow-sm);
642
+ outline: var(--fd-ring-width) solid var(--fd-ring);
643
+ outline-offset: var(--fd-ring-offset);
642
644
  }
643
645
 
644
646
  /* Dark theme overrides */
@@ -9,6 +9,8 @@
9
9
  -->
10
10
 
11
11
  <script lang="ts">
12
+ import Input from '../Input.svelte';
13
+
12
14
  interface Props {
13
15
  /** Field identifier */
14
16
  id: string;
@@ -45,10 +47,9 @@
45
47
  }
46
48
  </script>
47
49
 
48
- <input
50
+ <Input
49
51
  {id}
50
52
  type="text"
51
- class="form-text-field"
52
53
  value={value ?? ''}
53
54
  {placeholder}
54
55
  {disabled}
@@ -56,36 +57,3 @@
56
57
  aria-required={required}
57
58
  oninput={handleInput}
58
59
  />
59
-
60
- <style>
61
- .form-text-field {
62
- width: 100%;
63
- padding: 0.625rem 0.875rem;
64
- border: 1px solid var(--fd-border);
65
- border-radius: var(--fd-radius-lg);
66
- font-size: var(--fd-text-sm);
67
- font-family: inherit;
68
- color: var(--fd-foreground);
69
- background-color: var(--fd-muted);
70
- transition: all var(--fd-transition-normal);
71
- box-shadow: var(--fd-shadow-sm);
72
- }
73
-
74
- .form-text-field::placeholder {
75
- color: var(--fd-muted-foreground);
76
- }
77
-
78
- .form-text-field:hover {
79
- border-color: var(--fd-border-strong);
80
- background-color: var(--fd-background);
81
- }
82
-
83
- .form-text-field:focus {
84
- outline: none;
85
- border-color: var(--fd-primary);
86
- background-color: var(--fd-background);
87
- box-shadow:
88
- 0 0 0 3px rgba(59, 130, 246, 0.12),
89
- var(--fd-shadow-sm);
90
- }
91
- </style>
@@ -9,6 +9,8 @@
9
9
  -->
10
10
 
11
11
  <script lang="ts">
12
+ import Textarea from '../Textarea.svelte';
13
+
12
14
  interface Props {
13
15
  /** Field identifier */
14
16
  id: string;
@@ -48,9 +50,8 @@
48
50
  }
49
51
  </script>
50
52
 
51
- <textarea
53
+ <Textarea
52
54
  {id}
53
- class="form-textarea"
54
55
  value={value ?? ''}
55
56
  {placeholder}
56
57
  {rows}
@@ -58,40 +59,4 @@
58
59
  aria-describedby={ariaDescribedBy}
59
60
  aria-required={required}
60
61
  oninput={handleInput}
61
- ></textarea>
62
-
63
- <style>
64
- .form-textarea {
65
- width: 100%;
66
- padding: 0.625rem 0.875rem;
67
- border: 1px solid var(--fd-border);
68
- border-radius: var(--fd-radius-lg);
69
- font-size: var(--fd-text-sm);
70
- font-family: inherit;
71
- color: var(--fd-foreground);
72
- background-color: var(--fd-muted);
73
- transition: all var(--fd-transition-normal);
74
- box-shadow: var(--fd-shadow-sm);
75
- resize: vertical;
76
- min-height: 5rem;
77
- line-height: 1.5;
78
- }
79
-
80
- .form-textarea::placeholder {
81
- color: var(--fd-muted-foreground);
82
- }
83
-
84
- .form-textarea:hover {
85
- border-color: var(--fd-border-strong);
86
- background-color: var(--fd-background);
87
- }
88
-
89
- .form-textarea:focus {
90
- outline: none;
91
- border-color: var(--fd-primary);
92
- background-color: var(--fd-background);
93
- box-shadow:
94
- 0 0 0 3px rgba(59, 130, 246, 0.12),
95
- var(--fd-shadow-sm);
96
- }
97
- </style>
62
+ />
@@ -26,6 +26,11 @@
26
26
  * `messages.form.toggle.disabled`.
27
27
  */
28
28
  offLabel?: string;
29
+ /**
30
+ * Keep the state label as the switch's accessible name only, without
31
+ * rendering it. For dense rows where the switch alone carries the state.
32
+ */
33
+ hideLabel?: boolean;
29
34
  /** Whether the field is disabled (read-only) */
30
35
  disabled?: boolean;
31
36
  /** ARIA description ID */
@@ -39,6 +44,7 @@
39
44
  value = false,
40
45
  onLabel,
41
46
  offLabel,
47
+ hideLabel = false,
42
48
  disabled = false,
43
49
  ariaDescribedBy,
44
50
  onChange
@@ -56,7 +62,7 @@
56
62
  }
57
63
  </script>
58
64
 
59
- <label class="form-toggle">
65
+ <label class="form-toggle" class:form-toggle--compact={hideLabel}>
60
66
  <input
61
67
  {id}
62
68
  type="checkbox"
@@ -69,7 +75,7 @@
69
75
  <span class="form-toggle__track">
70
76
  <span class="form-toggle__thumb"></span>
71
77
  </span>
72
- <span class="form-toggle__label">
78
+ <span class="form-toggle__label" class:form-toggle__label--sr-only={hideLabel}>
73
79
  {value ? resolvedOnLabel : resolvedOffLabel}
74
80
  </span>
75
81
  </label>
@@ -120,10 +126,6 @@
120
126
  transform: translateX(1.25rem);
121
127
  }
122
128
 
123
- .form-toggle__input:focus-visible + .form-toggle__track {
124
- box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
125
- }
126
-
127
129
  .form-toggle__label {
128
130
  font-size: var(--fd-text-sm);
129
131
  color: var(--fd-muted-foreground);
@@ -134,4 +136,23 @@
134
136
  .form-toggle__input:checked ~ .form-toggle__label {
135
137
  color: var(--fd-primary-hover);
136
138
  }
139
+
140
+ /* Compact: switch only, no reserved label column and no vertical padding. */
141
+ .form-toggle--compact {
142
+ gap: 0;
143
+ padding: 0;
144
+ }
145
+
146
+ .form-toggle__label--sr-only {
147
+ position: absolute;
148
+ width: 1px;
149
+ height: 1px;
150
+ min-width: 0;
151
+ padding: 0;
152
+ margin: -1px;
153
+ overflow: hidden;
154
+ clip-path: inset(50%);
155
+ white-space: nowrap;
156
+ border: 0;
157
+ }
137
158
  </style>
@@ -13,6 +13,11 @@ interface Props {
13
13
  * `messages.form.toggle.disabled`.
14
14
  */
15
15
  offLabel?: string;
16
+ /**
17
+ * Keep the state label as the switch's accessible name only, without
18
+ * rendering it. For dense rows where the switch alone carries the state.
19
+ */
20
+ hideLabel?: boolean;
16
21
  /** Whether the field is disabled (read-only) */
17
22
  disabled?: boolean;
18
23
  /** ARIA description ID */
@@ -16,7 +16,9 @@
16
16
  import type { ConfigSchema, WorkflowNode, WorkflowEdge, AuthProvider } from '../../types/index.js';
17
17
  import type { FieldSchema } from './types.js';
18
18
  import { resolveScopeToKey } from '../../utils/uischema.js';
19
- import FormField from './FormField.svelte';
19
+ // Use the registry-based light field factory so the UISchema renderer (and
20
+ // SchemaForm/ConfigForm above it) never statically pull in CodeMirror.
21
+ import FormField from './FormFieldLight.svelte';
20
22
  import FormFieldset from './FormFieldset.svelte';
21
23
  import Self from './FormUISchemaRenderer.svelte';
22
24
 
@@ -0,0 +1,24 @@
1
+ import type { FieldSchema } from './types.js';
2
+ /**
3
+ * The dependency-free field kinds that {@link FormField} and
4
+ * {@link FormFieldLight} render identically — i.e. everything that does not
5
+ * pull in a heavy editor or depend on the field registry.
6
+ */
7
+ export type BaseFieldType = 'checkbox-group' | 'select-enum' | 'select-options' | 'textarea' | 'range' | 'text' | 'number' | 'toggle' | 'array';
8
+ /**
9
+ * Resolve the basic field type for a schema — the single source of truth for
10
+ * the decision both the full and light field factories share.
11
+ *
12
+ * Returns `null` when none of the basic cases match, so each caller can apply
13
+ * its OWN special-case handling and fallback in its own order. The heavy and
14
+ * entry-point-specific cases (hidden, autocomplete, code/markdown/template
15
+ * editors, `object` → editor, registry-resolved components) are deliberately
16
+ * NOT decided here: `FormField` and `FormFieldLight` route those differently
17
+ * (static imports vs. the lazy field registry that keeps the `/form` light
18
+ * entry free of heavy deps), and must keep doing so before delegating here.
19
+ *
20
+ * Order matters and mirrors the original in-component chains: `enum` and
21
+ * `oneOf` are checked before the primitive `type` branches because option
22
+ * schemas frequently carry `type: 'string'`.
23
+ */
24
+ export declare function resolveBaseFieldType(schema: FieldSchema): BaseFieldType | null;
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Resolve the basic field type for a schema — the single source of truth for
3
+ * the decision both the full and light field factories share.
4
+ *
5
+ * Returns `null` when none of the basic cases match, so each caller can apply
6
+ * its OWN special-case handling and fallback in its own order. The heavy and
7
+ * entry-point-specific cases (hidden, autocomplete, code/markdown/template
8
+ * editors, `object` → editor, registry-resolved components) are deliberately
9
+ * NOT decided here: `FormField` and `FormFieldLight` route those differently
10
+ * (static imports vs. the lazy field registry that keeps the `/form` light
11
+ * entry free of heavy deps), and must keep doing so before delegating here.
12
+ *
13
+ * Order matters and mirrors the original in-component chains: `enum` and
14
+ * `oneOf` are checked before the primitive `type` branches because option
15
+ * schemas frequently carry `type: 'string'`.
16
+ */
17
+ export function resolveBaseFieldType(schema) {
18
+ // Enum with multiple selection -> checkbox group
19
+ if (schema.enum && schema.multiple) {
20
+ return 'checkbox-group';
21
+ }
22
+ // Enum with single selection -> select
23
+ if (schema.enum) {
24
+ return 'select-enum';
25
+ }
26
+ // oneOf with labeled options (standard JSON Schema) -> select
27
+ if (schema.oneOf && schema.oneOf.length > 0) {
28
+ return 'select-options';
29
+ }
30
+ // Multiline string -> textarea
31
+ if (schema.type === 'string' && schema.format === 'multiline') {
32
+ return 'textarea';
33
+ }
34
+ // Range slider for number/integer with format: "range"
35
+ if ((schema.type === 'number' || schema.type === 'integer') && schema.format === 'range') {
36
+ return 'range';
37
+ }
38
+ // String -> text field
39
+ if (schema.type === 'string') {
40
+ return 'text';
41
+ }
42
+ // Number or integer -> number field
43
+ if (schema.type === 'number' || schema.type === 'integer') {
44
+ return 'number';
45
+ }
46
+ // Boolean -> toggle
47
+ if (schema.type === 'boolean') {
48
+ return 'toggle';
49
+ }
50
+ // Array -> array field
51
+ if (schema.type === 'array') {
52
+ return 'array';
53
+ }
54
+ return null;
55
+ }
@@ -0,0 +1,6 @@
1
+ <!-- Inline SVG equivalent of mdi:close (Material Design Icons) -->
2
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
3
+ <path
4
+ d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"
5
+ />
6
+ </svg>
@@ -0,0 +1,26 @@
1
+ export default CloseIcon;
2
+ type CloseIcon = SvelteComponent<{
3
+ [x: string]: never;
4
+ }, {
5
+ [evt: string]: CustomEvent<any>;
6
+ }, {}> & {
7
+ $$bindings?: string | undefined;
8
+ };
9
+ declare const CloseIcon: $$__sveltets_2_IsomorphicComponent<{
10
+ [x: string]: never;
11
+ }, {
12
+ [evt: string]: CustomEvent<any>;
13
+ }, {}, {}, string>;
14
+ 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> {
15
+ new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
16
+ $$bindings?: Bindings;
17
+ } & Exports;
18
+ (internal: unknown, props: {
19
+ $$events?: Events;
20
+ $$slots?: Slots;
21
+ }): Exports & {
22
+ $set?: any;
23
+ $on?: any;
24
+ };
25
+ z_$$bindings?: Bindings;
26
+ }
@@ -0,0 +1,15 @@
1
+ <!-- Inline SVG equivalent of heroicons:command-line (outline) -->
2
+ <svg
3
+ xmlns="http://www.w3.org/2000/svg"
4
+ viewBox="0 0 24 24"
5
+ fill="none"
6
+ stroke="currentColor"
7
+ stroke-width="1.5"
8
+ stroke-linecap="round"
9
+ stroke-linejoin="round"
10
+ aria-hidden="true"
11
+ >
12
+ <path
13
+ d="M6.75 7.5l3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0021 18V6a2.25 2.25 0 00-2.25-2.25H5.25A2.25 2.25 0 003 6v12a2.25 2.25 0 002.25 2.25z"
14
+ />
15
+ </svg>
@@ -0,0 +1,26 @@
1
+ export default CommandLineIcon;
2
+ type CommandLineIcon = SvelteComponent<{
3
+ [x: string]: never;
4
+ }, {
5
+ [evt: string]: CustomEvent<any>;
6
+ }, {}> & {
7
+ $$bindings?: string | undefined;
8
+ };
9
+ declare const CommandLineIcon: $$__sveltets_2_IsomorphicComponent<{
10
+ [x: string]: never;
11
+ }, {
12
+ [evt: string]: CustomEvent<any>;
13
+ }, {}, {}, string>;
14
+ 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> {
15
+ new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
16
+ $$bindings?: Bindings;
17
+ } & Exports;
18
+ (internal: unknown, props: {
19
+ $$events?: Events;
20
+ $$slots?: Slots;
21
+ }): Exports & {
22
+ $set?: any;
23
+ $on?: any;
24
+ };
25
+ z_$$bindings?: Bindings;
26
+ }
@@ -0,0 +1,4 @@
1
+ <!-- Inline SVG equivalent of mdi:menu (Material Design Icons) -->
2
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
3
+ <path d="M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z" />
4
+ </svg>