@flowdrop/flowdrop 2.0.0-beta.6 → 2.0.0-beta.8
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.
- package/CHANGELOG.md +25 -0
- package/dist/commands/executor.js +46 -20
- package/dist/components/App.svelte +467 -182
- package/dist/components/App.svelte.d.ts +14 -1
- package/dist/components/ConfigForm.svelte +93 -25
- package/dist/components/ConfigPanel.svelte +223 -12
- package/dist/components/ConfigPanel.svelte.d.ts +6 -0
- package/dist/components/SettingsPanel.svelte +22 -0
- package/dist/components/form/FormFieldset.svelte +44 -10
- package/dist/components/form/FormRangeField.svelte +43 -3
- package/dist/components/surfaces/SurfaceOverlay.svelte +146 -0
- package/dist/components/surfaces/SurfaceOverlay.svelte.d.ts +14 -0
- package/dist/components/surfaces/TabbedSurface.svelte +133 -0
- package/dist/components/surfaces/TabbedSurface.svelte.d.ts +27 -0
- package/dist/services/dynamicSchemaService.d.ts +29 -2
- package/dist/services/dynamicSchemaService.js +54 -25
- package/dist/stores/settingsStore.svelte.d.ts +13 -0
- package/dist/stores/settingsStore.svelte.js +32 -0
- package/dist/stores/workflowStore.svelte.js +6 -1
- package/dist/svelte-app.d.ts +12 -1
- package/dist/svelte-app.js +3 -1
- package/dist/types/index.d.ts +29 -0
- package/dist/types/settings.d.ts +16 -0
- package/dist/types/settings.js +3 -1
- package/dist/types/uischema.d.ts +5 -0
- package/dist/utils/portal.d.ts +18 -0
- package/dist/utils/portal.js +34 -0
- package/dist/utils/schemaMerge.d.ts +25 -0
- package/dist/utils/schemaMerge.js +61 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,31 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [2.0.0-beta.8] - 2026-07-11
|
|
11
|
+
|
|
12
|
+
Eighth 2.0 beta, published under the npm `beta` dist-tag (`npm install @flowdrop/flowdrop@beta`). `latest` remains 1.15.0 until 2.0.0 GA. This release makes auxiliary surfaces relocatable: the config panel and the console/AI Assistant group are no longer pinned to fixed spots — each can be hosted in the **right sidebar**, a **centered modal overlay**, or the **bottom panel**, chosen independently per surface. Surfaces routed to the same host coexist as tabs. Defaults are unchanged (config in the sidebar, console/chat in the bottom panel), so existing embeds look and behave exactly as before.
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- **Configurable surface placement.** A new `SurfacePlacement` enum (`'sidebar' | 'modal' | 'below'`) with two UI settings — `configPlacement` (default `sidebar`) and `consolePlacement` (default `below`) — controls where the config panel and the console/AI Assistant group are hosted. Both are exposed in the Settings panel and as `configPlacement` / `consolePlacement` mount options; the mount options **seed** the setting on first load without overriding a returning user's persisted choice (library default < host default < user snapshot), via the new `seedUiDefaults` store helper. Modelled as one enum per surface so invalid combinations (two hosts at once, or none) are unrepresentable.
|
|
17
|
+
- **`TabbedSurface` component.** A reusable tabbed container that hosts one or more surfaces in the sidebar, bottom panel, or modal. All tab bodies stay mounted (toggled via `display`) so surface state — console scrollback, chat history, in-progress form edits — survives tab switches, and the tab bar hides itself when only a single surface is present so a lone surface reads as a plain panel.
|
|
18
|
+
- **`SurfaceOverlay` component + `portal` action.** A modal shell that hosts a surface (or a `TabbedSurface` of several) in the `modal` placement, closable via Esc, backdrop click, or the close button. It portals to `document.body` through a new `portal` Svelte action so its fixed backdrop escapes any ancestor that establishes a containing block (`transform`, `filter`, `backdrop-filter`, …); the action is a no-op during SSR.
|
|
19
|
+
|
|
20
|
+
## [2.0.0-beta.7] - 2026-07-09
|
|
21
|
+
|
|
22
|
+
Seventh 2.0 beta, published under the npm `beta` dist-tag (`npm install @flowdrop/flowdrop@beta`). `latest` remains 1.15.0 until 2.0.0 GA. Dynamic config schemas become composable and self-refreshing. A dynamic-schema endpoint can now **layer onto** a node's static schema instead of replacing the whole form — merging in the fields it owns, or targeting a single region — so an endpoint only returns what it actually drives and the rest of the form stays exactly as authored. The fetched form also **refetches on its own** when a config value its URL depends on changes (e.g. picking a different trigger `event_type`), rather than loading only once on mount. All additive: the historical whole-form `replace` behaviour is still the default, so existing dynamic-schema configs are unchanged.
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
|
|
26
|
+
- **Dynamic config schema can layer onto the static schema (`mergeStrategy` + `target`).** `DynamicSchemaEndpoint` gains two optional fields. `mergeStrategy: 'replace' | 'merge'` — `merge` combines the fetched schema with the node's static schema (`schema` prop / `metadata.configSchema`): properties are merged (fetched wins per key), `required` is unioned, so an endpoint only has to return the fields it drives. `target` — a dot-path of property keys (e.g. `"advanced"` or `"advanced.retry"`) that restricts the fetch to one region of the form, splicing the fetched schema in at that location and leaving every other field static; `mergeStrategy` then decides replace-vs-merge at that node. Both default to whole-form `replace`, matching prior behaviour. When `merge`/`target` is configured, the schema is now fetched even if a static schema is present (previously a static schema suppressed the fetch). New `applyFetchedSchema` util backs the combination.
|
|
27
|
+
- **Dynamic schema auto-refetches when its inputs change.** `ConfigForm` now watches the resolved endpoint URL — template variables substituted from the node context — as a reactive key and refetches whenever it changes, so choosing a different value that the endpoint depends on (e.g. a trigger's `event_type`) reloads the matching schema instead of showing the schema captured at mount. A fetch already in flight is left to settle before the next one runs, and the key only reflects what the URL actually references, so static endpoints never spuriously refetch. New `resolveDynamicSchemaKey` export.
|
|
28
|
+
- **Dynamic schema endpoints can return a companion `uiSchema`.** When the endpoint response includes a `uiSchema` (read from `uiSchema`, `data.uiSchema`, or `schema.uiSchema`), `ConfigForm` uses it to lay out the fetched schema and caches it alongside the schema. It takes precedence over the node's static-metadata `uiSchema` — which can only reference the static schema's fields and would mislay a server-hydrated form — while a directly-passed `uiSchema` prop still wins. `DynamicSchemaResult` and the cache entry gain an optional `uiSchema`.
|
|
29
|
+
|
|
30
|
+
### Fixed
|
|
31
|
+
|
|
32
|
+
- **Config values are no longer silently dropped on save.** `ConfigForm` rebuilt the saved config solely from the active schema's properties, so any stored config key the schema didn't render — for example after a dynamic schema returned a narrower field set — was lost on the next blur/save. The commit paths (`onChange` on blur, and explicit save) now preserve config keys the active schema doesn't own, with the rendered fields still taking precedence.
|
|
33
|
+
- **`invalidateSchemaCache` now matches the fetch cache key.** It built the node context without the `workflowId`, so for endpoints whose URL references `{workflowId}` it resolved a different cache key than `fetchDynamicSchema` and failed to evict the entry — a manual schema refresh then re-served the stale cached schema. It now accepts `workflowId` (matching the fetch context); the context-building for schema-URL, external-edit-URL, and cache-key resolution was consolidated so they can no longer drift apart.
|
|
34
|
+
|
|
10
35
|
## [2.0.0-beta.6] - 2026-06-22
|
|
11
36
|
|
|
12
37
|
Sixth 2.0 beta, published under the npm `beta` dist-tag (`npm install @flowdrop/flowdrop@beta`). `latest` remains 1.15.0 until 2.0.0 GA. This release unifies port **order** and **exposure** into a single per-instance `data.config.ports` value and makes exposure semantic — "what you see is what runs": a not-exposed port is hidden on the canvas, not wireable, and not runtime-overridable. The two older, separate mechanisms (`extensions.ui.portOrder` for order and `hideUnconnectedHandles` for visibility) are removed. A single combined "Ports" widget in the config panel now handles both reorder and expose/hide per port, and reserved ports (the `error` output and `trigger`/`tool` control ports) sort to the bottom automatically.
|
|
@@ -378,38 +378,49 @@ function executeInfo(command, context) {
|
|
|
378
378
|
*/
|
|
379
379
|
function findPort(node, portId, preferDirection) {
|
|
380
380
|
const metadata = node.data?.metadata;
|
|
381
|
-
|
|
381
|
+
const config = node.data?.config;
|
|
382
|
+
if (!metadata && !config)
|
|
382
383
|
return null;
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
if (
|
|
389
|
-
return
|
|
390
|
-
|
|
391
|
-
|
|
384
|
+
// Resolve an output port from static metadata or config-driven ports. The
|
|
385
|
+
// latter are not in metadata.outputs: gateway branches live in config.branches
|
|
386
|
+
// and user-defined handles live in config.dynamicOutputs (both keyed by name).
|
|
387
|
+
const resolveOutput = () => {
|
|
388
|
+
const meta = metadata?.outputs?.find((p) => p.id === portId);
|
|
389
|
+
if (meta)
|
|
390
|
+
return meta;
|
|
391
|
+
const branch = config?.branches?.find((b) => b.name === portId);
|
|
392
|
+
if (branch)
|
|
393
|
+
return { id: portId, name: branch.label ?? portId, dataType: 'trigger' };
|
|
394
|
+
const dynamic = config?.dynamicOutputs?.find((p) => p.name === portId);
|
|
395
|
+
if (dynamic)
|
|
396
|
+
return { id: portId, name: dynamic.label ?? portId, dataType: dynamic.dataType };
|
|
397
|
+
return null;
|
|
398
|
+
};
|
|
399
|
+
// Resolve an input port from static metadata or config.dynamicInputs.
|
|
400
|
+
const resolveInput = () => {
|
|
401
|
+
const meta = metadata?.inputs?.find((p) => p.id === portId);
|
|
402
|
+
if (meta)
|
|
403
|
+
return meta;
|
|
404
|
+
const dynamic = config?.dynamicInputs?.find((p) => p.name === portId);
|
|
405
|
+
if (dynamic)
|
|
406
|
+
return { id: portId, name: dynamic.label ?? portId, dataType: dynamic.dataType };
|
|
407
|
+
return null;
|
|
408
|
+
};
|
|
409
|
+
const outputPort = resolveOutput();
|
|
410
|
+
const inputPort = resolveInput();
|
|
411
|
+
if (preferDirection === 'input') {
|
|
392
412
|
if (inputPort)
|
|
393
413
|
return { port: inputPort, direction: 'input' };
|
|
394
414
|
if (outputPort)
|
|
395
415
|
return { port: outputPort, direction: 'output' };
|
|
396
416
|
}
|
|
397
417
|
else {
|
|
418
|
+
// Default and explicit 'output' both prefer the output port first.
|
|
398
419
|
if (outputPort)
|
|
399
420
|
return { port: outputPort, direction: 'output' };
|
|
400
421
|
if (inputPort)
|
|
401
422
|
return { port: inputPort, direction: 'input' };
|
|
402
423
|
}
|
|
403
|
-
// Gateway nodes have dynamic branch ports stored in config.branches, not metadata.outputs
|
|
404
|
-
if (metadata.type === 'gateway') {
|
|
405
|
-
const branches = node.data.config?.branches;
|
|
406
|
-
if (branches?.some((b) => b.name === portId)) {
|
|
407
|
-
return {
|
|
408
|
-
port: { id: portId, name: portId, dataType: 'trigger' },
|
|
409
|
-
direction: 'output'
|
|
410
|
-
};
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
424
|
return null;
|
|
414
425
|
}
|
|
415
426
|
function executeConnect(command, context) {
|
|
@@ -483,6 +494,21 @@ function executeConnect(command, context) {
|
|
|
483
494
|
const targetHandle = buildHandleId(targetNode.id, 'input', command.targetPort);
|
|
484
495
|
// Generate edge ID
|
|
485
496
|
const edgeId = `${sourceNode.id}-${sourceHandle}-${targetNode.id}-${targetHandle}`;
|
|
497
|
+
// Idempotency guard: re-applying the same connection (e.g. a second
|
|
498
|
+
// AI-assistant Apply that re-emits an existing edge) must not append a
|
|
499
|
+
// duplicate. Two edges sharing an id crash the canvas with Svelte's
|
|
500
|
+
// `each_key_duplicate`. Treat an existing identical connection as a no-op.
|
|
501
|
+
const alreadyConnected = workflow.edges.some((e) => e.id === edgeId ||
|
|
502
|
+
(e.source === sourceNode.id &&
|
|
503
|
+
e.target === targetNode.id &&
|
|
504
|
+
e.sourceHandle === sourceHandle &&
|
|
505
|
+
e.targetHandle === targetHandle));
|
|
506
|
+
if (alreadyConnected) {
|
|
507
|
+
return {
|
|
508
|
+
ok: true,
|
|
509
|
+
message: `Already connected ${toShortId(sourceNode.id)}:${command.sourcePort} → ${toShortId(targetNode.id)}:${command.targetPort}`
|
|
510
|
+
};
|
|
511
|
+
}
|
|
486
512
|
// Build edge
|
|
487
513
|
const edge = {
|
|
488
514
|
id: edgeId,
|