@flowdrop/flowdrop 2.4.0 → 2.5.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.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,22 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.5.0] - 2026-08-23
9
+
10
+ ### Changed
11
+
12
+ - **Six port lanes change colour, and two hues become reserved.** The lane palette had grown by accretion and had stopped carrying information: `file`/`file[]` wore red alongside `error`, so a failed run and a PDF read the same on the canvas; `video` and `messages` sat in the same family; `trigger` was purple, shared with `boolean`, and matched neither its own wire nor the colour the server sent. `tool` needed no move — it was already amber, and is now reserved there. The re-cut: **`file`/`file[]` red → teal**, **`video` teal → fuchsia**, **`messages` fuchsia → orange**, **`array` amber → violet**, **`trigger` purple → ink**. **This is a visible change on every canvas** — handles, chips and shape glyphs on those lanes are a different colour — and it is a change to `DEFAULT_PORT_CONFIG` only, so an app serving its own port config is untouched.
13
+ - **`--fd-node-red` is reserved for `error` and `--fd-node-amber` for `tool`.** Point a data lane at either and you undo the one distinction the palette exists to carry. `amber` and the new `ink` must also track their wires — `--fd-edge-tool` and `--fd-edge-trigger` — or an edge changes colour halfway along its length.
14
+ - The rule behind the rest: **a complex lane wears the hue of the shape it is made of.** `messages` joins `json`/`json[]` on orange because a message list is an array of objects; a _typed_ array inherits its element's hue (`string[]` emerald, `file[]` teal), which is why only the untyped `array` needs a token of its own; and an unclear shape falls back to the sink's slate. `docs/theming.md` now lists which lanes wear which token and states all of this, instead of printing a bare hex table.
15
+ - Two new tokens, both `@public`: **`--fd-node-violet`** (`#7c3aed` light, `#a78bfa` dark) for the untyped `array`, and **`--fd-node-ink`** for `trigger` — deliberately not a hue, resolving to `--_gray-9` / `--_gray-3` exactly as `--fd-edge-trigger` does. A fixed `#18181c` here disappears against the dark canvas.
16
+ - `flowdrop` (the Drupal module) moves its served payload identically, so an editor running against library defaults and one running against that payload agree on **all 24 lanes** — verified pairwise.
17
+ - Also documented in `docs/theming.md`, because it is the trap under all of this: if you redeclare `--fd-node-*` in a stylesheet that loads **after** this library's, redeclare the dark block too. A bare `:root` override loading later wins in both themes at equal specificity and silently flattens dark mode to the light values.
18
+
19
+ - **`WorkflowInterfaceEntry.schema` is a property fragment, not an object schema.** It was typed `InputSchema | OutputSchema` — a whole `{properties: {…}}` object — while nothing in the library populated it, which would have been wrong the moment something did. It is now `WorkflowInterfaceSchema` (`Partial<InputProperty>`): one port's JSON Schema fragment, every key optional, derived from the existing property type rather than restated. No runtime behaviour changes; nothing read or wrote this key.
20
+
21
+ - **The server's `dataType` on an interface entry is now the port's lane.** This library has always typed `WorkflowInterfaceEntry.dataType` as `NodeDataType` and rendered it through the lane-vocabulary picker, but fddo filled it with the fragment's JSON Schema `type` — so an `error` port arrived as `object` and a `messages` port as `array`, and the panel's lane chip contradicted the port the entry was bound to. fddo now sends the lane there and the JSON Schema fragment in `schema`. Nothing changes on this side of the wire; the values simply stop lying. **Needs a backend that serves it** — an older fddo still sends the JSON Schema word.
22
+ - Unchanged, and worth knowing: the server derives both keys from the bound inner port and **ignores them on write**. An author picking a lane in the interface panel is choosing a value the next read replaces. Persisting an author-chosen lane needs a server column that does not exist yet.
23
+
8
24
  ## [2.4.0] - 2026-08-23
9
25
 
10
26
  ### Added
@@ -48,12 +48,17 @@ export const DEFAULT_PORT_CONFIG = {
48
48
  // The sink, not `string`: a port with no declared lane constrains nothing.
49
49
  defaultDataType: 'mixed',
50
50
  dataTypes: [
51
- // Control flow types
51
+ // Control flow types.
52
+ //
53
+ // Ink, not a hue: the handle must read as the same thing as the trigger
54
+ // WIRE, which is `--fd-edge-trigger` — ink that flips with the theme. It
55
+ // sat on purple, sharing that hue with `boolean`, and matched neither the
56
+ // wire nor the served payload's cyan.
52
57
  {
53
58
  id: 'trigger',
54
59
  name: 'Trigger',
55
60
  description: 'Control flow of the workflow',
56
- color: 'var(--fd-node-purple)',
61
+ color: 'var(--fd-node-ink)',
57
62
  category: 'basic',
58
63
  enabled: true
59
64
  },
@@ -99,12 +104,15 @@ export const DEFAULT_PORT_CONFIG = {
99
104
  category: 'logical',
100
105
  enabled: true
101
106
  },
102
- // Collection types
107
+ // Collection types.
108
+ //
109
+ // Violet: the untyped array is the one array with no element hue to
110
+ // inherit. It had amber until `tool` took that to match its wire.
103
111
  {
104
112
  id: 'array',
105
113
  name: 'Array',
106
114
  description: 'Ordered list of items',
107
- color: 'var(--fd-node-amber)',
115
+ color: 'var(--fd-node-violet)',
108
116
  category: 'collection',
109
117
  enabled: true
110
118
  },
@@ -145,7 +153,7 @@ export const DEFAULT_PORT_CONFIG = {
145
153
  id: 'file[]',
146
154
  name: 'File Array',
147
155
  description: 'Array of files',
148
- color: 'var(--fd-node-red)',
156
+ color: 'var(--fd-node-teal)',
149
157
  category: 'collection',
150
158
  enabled: true
151
159
  },
@@ -166,12 +174,15 @@ export const DEFAULT_PORT_CONFIG = {
166
174
  category: 'complex',
167
175
  enabled: true
168
176
  },
169
- // File types
177
+ // File types.
178
+ //
179
+ // Teal, vacated by `video`. Red is reserved for `error` alone — a failed
180
+ // run and a PDF are not the same kind of thing and must not share a hue.
170
181
  {
171
182
  id: 'file',
172
183
  name: 'File',
173
184
  description: 'File data',
174
- color: 'var(--fd-node-red)',
185
+ color: 'var(--fd-node-teal)',
175
186
  category: 'file',
176
187
  enabled: true
177
188
  },
@@ -192,11 +203,14 @@ export const DEFAULT_PORT_CONFIG = {
192
203
  category: 'media',
193
204
  enabled: true
194
205
  },
206
+ // Fuchsia, freed by `messages`. Landing beside `image`'s pink is wanted:
207
+ // the two are both visual media, so the near-adjacency reads as a family
208
+ // rather than as a collision.
195
209
  {
196
210
  id: 'video',
197
211
  name: 'Video',
198
212
  description: 'Video data',
199
- color: 'var(--fd-node-teal)',
213
+ color: 'var(--fd-node-fuchsia)',
200
214
  category: 'media',
201
215
  enabled: true
202
216
  },
@@ -253,11 +267,15 @@ export const DEFAULT_PORT_CONFIG = {
253
267
  // A list of provider-shaped chat messages. JSON-Schema `array`
254
268
  // underneath, but not an arbitrary array — which is the whole reason it
255
269
  // is its own lane.
270
+ //
271
+ // Orange, with `json` and `json[]`: a complex lane wears the hue of the
272
+ // shape it is made of, and a message list is an array of objects. It sat
273
+ // alone on fuchsia, which said nothing about what it carries.
256
274
  {
257
275
  id: 'messages',
258
276
  name: 'Messages',
259
277
  description: 'A conversation: a list of provider-shaped chat messages',
260
- color: 'var(--fd-node-fuchsia)',
278
+ color: 'var(--fd-node-orange)',
261
279
  category: 'complex',
262
280
  enabled: true
263
281
  }
@@ -4021,6 +4021,13 @@ components:
4021
4021
  description: Help text describing what this entry represents to external callers.
4022
4022
  dataType:
4023
4023
  $ref: '#/components/schemas/NodeDataType'
4024
+ description: |
4025
+ The port's LANE — what it is and what it may connect to — not the JSON
4026
+ Schema type of its value, which is `schema.type`. The two vocabularies
4027
+ overlap on `string`/`number`/`boolean`/`array` and diverge where it
4028
+ matters: a `messages` port is a JSON `array`, an `error` port a JSON
4029
+ `object`. Derived by the server from the bound inner port and ignored
4030
+ on write.
4024
4031
  required:
4025
4032
  type: boolean
4026
4033
  description: Whether callers must supply a value. Inputs only; ignored on outputs.
@@ -4035,7 +4042,13 @@ components:
4035
4042
  only; ignored on outputs. Never validated against `schema`.
4036
4043
  schema:
4037
4044
  $ref: '#/components/schemas/PortDataSchema'
4038
- description: JSON Schema describing the structure of data carried by this entry.
4045
+ description: |
4046
+ The JSON Schema fragment for this one port — a single property's
4047
+ schema (`{"type": "array"}`), not a whole object schema. Carries the
4048
+ structural contract only: whatever the entry states itself (the lane,
4049
+ `name`, `description`, `examples`, `required`) is not repeated inside
4050
+ it. Derived by the server from the bound inner port and ignored on
4051
+ write; absent when the bound port declares no structural contract.
4039
4052
  bindings:
4040
4053
  type: array
4041
4054
  items:
@@ -1122,7 +1122,14 @@
1122
1122
  "description": "Help text describing what this entry represents to external callers."
1123
1123
  },
1124
1124
  "dataType": {
1125
- "$ref": "#/$defs/NodeDataType"
1125
+ "allOf": [
1126
+ {
1127
+ "$ref": "#/$defs/NodeDataType"
1128
+ },
1129
+ {
1130
+ "description": "The port's LANE — what it is and what it may connect to — not the JSON\nSchema type of its value, which is `schema.type`. The two vocabularies\noverlap on `string`/`number`/`boolean`/`array` and diverge where it\nmatters: a `messages` port is a JSON `array`, an `error` port a JSON\n`object`. Derived by the server from the bound inner port and ignored\non write.\n"
1131
+ }
1132
+ ]
1126
1133
  },
1127
1134
  "required": {
1128
1135
  "type": "boolean",
@@ -1142,7 +1149,7 @@
1142
1149
  "$ref": "#/$defs/PortDataSchema"
1143
1150
  },
1144
1151
  {
1145
- "description": "JSON Schema describing the structure of data carried by this entry."
1152
+ "description": "The JSON Schema fragment for this one port — a single property's\nschema (`{\"type\": \"array\"}`), not a whole object schema. Carries the\nstructural contract only: whatever the entry states itself (the lane,\n`name`, `description`, `examples`, `required`) is not repeated inside\nit. Derived by the server from the bound inner port and ignored on\nwrite; absent when the bound port declares no structural contract.\n"
1146
1153
  }
1147
1154
  ]
1148
1155
  },
@@ -323,6 +323,22 @@
323
323
  --fd-node-purple: #9333ea; /* @public */
324
324
  --fd-node-fuchsia: #d946ef; /* @public */
325
325
 
326
+ /**
327
+ * The control lane's ink. Deliberately NOT a hue: a trigger handle must read
328
+ * as the same thing as the trigger WIRE, and `--fd-edge-trigger` is ink that
329
+ * flips with the theme rather than a fixed black. Keep the two in step — a
330
+ * literal #18181c handle disappears against the dark canvas.
331
+ */
332
+ --fd-node-ink: var(--_gray-9); /* @public */
333
+
334
+ /**
335
+ * Worn by the untyped `array` lane, and by nothing else. A TYPED array
336
+ * inherits its element's hue (`string[]` is emerald, `file[]` is teal), so
337
+ * the one array with no element shape needs a hue of its own. It had amber
338
+ * until `tool` took that to match `--fd-edge-tool`.
339
+ */
340
+ --fd-node-violet: #7c3aed; /* @public */
341
+
326
342
  /** Icon on node squircle: dark in light theme, white in dark theme */
327
343
  --fd-node-icon: var(--_gray-9); /* @public */
328
344
  /** Opacity of the icon squircle background (color-mix percentage). Light mode: 15% / 22% hover; dark mode uses higher values. */
@@ -469,6 +485,10 @@
469
485
  --fd-node-purple: #c084fc;
470
486
  --fd-node-fuchsia: #e879f9;
471
487
 
488
+ /* Mirrors --fd-edge-trigger's dark value, so handle and wire stay one colour. */
489
+ --fd-node-ink: var(--_gray-3);
490
+ --fd-node-violet: #a78bfa;
491
+
472
492
  /** Icon on node squircle: white in dark theme */
473
493
  --fd-node-icon: #ffffff;
474
494
  /** Icon squircle background opacity: higher in dark mode for visibility on dark surfaces */
@@ -1277,6 +1277,15 @@ export interface PortBinding {
1277
1277
  nodeId: string;
1278
1278
  portId: string;
1279
1279
  }
1280
+ /**
1281
+ * A single port's JSON Schema fragment as it rides a workflow's contract.
1282
+ *
1283
+ * Derived from {@link InputProperty} rather than restated, so the fragment
1284
+ * vocabulary has one definition; every key is optional because an interface
1285
+ * entry states its own annotations one level up and the server strips them
1286
+ * from the fragment on the way out.
1287
+ */
1288
+ export type WorkflowInterfaceSchema = Partial<InputProperty>;
1280
1289
  /**
1281
1290
  * One entry in a workflow's public contract. Owns its own identity: `id` is
1282
1291
  * stable and workflow-scoped, independent of whichever inner port it currently
@@ -1302,7 +1311,23 @@ export interface WorkflowInterfaceEntry {
1302
1311
  * outputs. Never validated against `schema`.
1303
1312
  */
1304
1313
  examples?: unknown[];
1305
- schema?: InputSchema | OutputSchema;
1314
+ /**
1315
+ * The port's JSON Schema fragment — the shape of the value, as opposed to
1316
+ * `dataType`, which is the lane it travels in. These are two vocabularies
1317
+ * that overlap on `string`/`number`/`boolean`/`array` and diverge exactly
1318
+ * where it matters: a `messages` port is an `array`, an `error` port is an
1319
+ * `object`, and a named shape is whatever its schema says.
1320
+ *
1321
+ * A single PROPERTY fragment, not an object schema — this was typed
1322
+ * `InputSchema | OutputSchema` (a whole `{properties: {...}}` object) while
1323
+ * nothing populated it, which would have been wrong the moment something
1324
+ * did. Every key is optional because the server strips what the entry
1325
+ * already states: no `title`/`description`/`examples`/`required`, and no
1326
+ * lane, since that is `dataType`.
1327
+ *
1328
+ * Absent when the bound port declares no structural contract at all.
1329
+ */
1330
+ schema?: WorkflowInterfaceSchema;
1306
1331
  /**
1307
1332
  * Inner ports this entry maps to. Every entry — input or output — must
1308
1333
  * resolve to exactly one binding; more than one is reported as `over-bound`.
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.4.0",
6
+ "version": "2.5.0",
7
7
  "author": "Shibin Das (D34dMan)",
8
8
  "bugs": {
9
9
  "url": "https://github.com/flowdrop-io/flowdrop/issues"