@flowdrop/flowdrop 1.14.0 → 2.0.0-beta.1
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 +475 -0
- package/MIGRATION-2.0.md +472 -0
- package/README.md +23 -23
- package/dist/adapters/WorkflowAdapter.d.ts +1 -1
- package/dist/adapters/WorkflowAdapter.js +14 -8
- package/dist/adapters/agentspec/AgentSpecAdapter.js +7 -7
- package/dist/chat/batchFeedback.d.ts +39 -0
- package/dist/chat/batchFeedback.js +51 -0
- package/dist/commands/executor.js +15 -1
- package/dist/commands/storeIntegration.svelte.d.ts +4 -1
- package/dist/commands/storeIntegration.svelte.js +26 -21
- package/dist/commands/types.d.ts +2 -0
- package/dist/components/App.svelte +162 -192
- package/dist/components/App.svelte.d.ts +47 -8
- package/dist/components/ConfigForm.svelte +110 -66
- package/dist/components/ConfigModal.svelte +7 -2
- package/dist/components/ConnectionLine.svelte +4 -2
- package/dist/components/Navbar.svelte +61 -1
- package/dist/components/NodeSidebar.svelte +27 -45
- package/dist/components/NodeStatusOverlay.svelte +94 -6
- package/dist/components/NodeSwapPicker.svelte +10 -8
- package/dist/components/PipelineStatus.svelte +16 -67
- package/dist/components/PortCoordinateTracker.svelte +5 -6
- package/dist/components/SchemaForm.stories.svelte +1 -3
- package/dist/components/SchemaForm.svelte +45 -40
- package/dist/components/SchemaForm.svelte.d.ts +0 -8
- package/dist/components/SettingsModal.svelte +8 -3
- package/dist/components/SettingsPanel.svelte +20 -4
- package/dist/components/SwapMappingEditor.svelte +67 -49
- package/dist/components/SwapMappingEditor.svelte.d.ts +0 -2
- package/dist/components/UniversalNode.svelte +9 -7
- package/dist/components/WorkflowEditor.svelte +118 -111
- package/dist/components/WorkflowEditor.svelte.d.ts +18 -10
- package/dist/components/chat/AIChatPanel.svelte +93 -89
- package/dist/components/chat/AIChatPanel.svelte.d.ts +0 -4
- package/dist/components/chat/CommandPreview.svelte +2 -1
- package/dist/components/console/CommandConsole.svelte +7 -5
- package/dist/components/console/ConsoleAutocomplete.svelte +10 -11
- package/dist/components/console/ConsoleAutocomplete.svelte.d.ts +6 -0
- package/dist/components/console/ConsoleInput.svelte +15 -6
- package/dist/components/console/ConsoleOutput.svelte +2 -1
- package/dist/components/form/FormArray.svelte +5 -9
- package/dist/components/form/FormArray.svelte.d.ts +2 -1
- package/dist/components/form/FormAutocomplete.svelte +29 -13
- package/dist/components/form/FormField.svelte +4 -2
- package/dist/components/form/FormFieldLight.svelte +4 -2
- package/dist/components/form/FormMarkdownEditor.svelte +9 -4
- package/dist/components/form/FormRangeField.svelte +1 -0
- package/dist/components/form/FormTemplateEditor.svelte +11 -3
- package/dist/components/form/FormToggle.svelte +5 -12
- package/dist/components/form/FormToggle.svelte.d.ts +4 -2
- package/dist/components/form/templateAutocomplete.js +1 -5
- package/dist/components/form/types.d.ts +1 -14
- package/dist/components/interrupt/FormPrompt.svelte +3 -2
- package/dist/components/interrupt/InterruptBubble.svelte +16 -17
- package/dist/components/interrupt/ReviewPrompt.svelte +10 -3
- package/dist/components/interrupt/TextInputPrompt.svelte +2 -1
- package/dist/components/layouts/MainLayout.svelte +20 -13
- package/dist/components/layouts/MainLayout.svelte.d.ts +4 -0
- package/dist/components/nodes/AtomNode.svelte +292 -0
- package/dist/components/nodes/AtomNode.svelte.d.ts +26 -0
- package/dist/components/nodes/GatewayNode.svelte +19 -10
- package/dist/components/nodes/IdeaNode.svelte +7 -0
- package/dist/components/nodes/SimpleNode.svelte +11 -6
- package/dist/components/nodes/SquareNode.svelte +15 -8
- package/dist/components/nodes/TerminalNode.svelte +9 -4
- package/dist/components/nodes/ToolNode.svelte +7 -1
- package/dist/components/nodes/WorkflowNode.svelte +16 -7
- package/dist/components/playground/ChatInput.svelte +11 -14
- package/dist/components/playground/ChatPanel.svelte +6 -49
- package/dist/components/playground/ChatPanel.svelte.d.ts +0 -14
- package/dist/components/playground/ControlPanel.svelte +134 -123
- package/dist/components/playground/ControlPanel.svelte.d.ts +3 -0
- package/dist/components/playground/ExecutionLogs.svelte +11 -9
- package/dist/components/playground/InputCollector.svelte +11 -9
- package/dist/components/playground/MessageStream.svelte +17 -23
- package/dist/components/playground/PipelineKanbanView.svelte +65 -6
- package/dist/components/playground/PipelinePanel.svelte +11 -5
- package/dist/components/playground/PipelineTableView.svelte +186 -44
- package/dist/components/playground/Playground.svelte +95 -92
- package/dist/components/playground/Playground.svelte.d.ts +2 -0
- package/dist/components/playground/PlaygroundApp.svelte +6 -1
- package/dist/components/playground/PlaygroundApp.svelte.d.ts +3 -0
- package/dist/components/playground/PlaygroundModal.svelte +13 -3
- package/dist/components/playground/PlaygroundModal.svelte.d.ts +3 -0
- package/dist/components/playground/PlaygroundStudio.svelte +34 -32
- package/dist/components/playground/PlaygroundStudio.svelte.d.ts +3 -0
- package/dist/components/playground/SessionManager.svelte +9 -12
- package/dist/components/playground/pipelineViewUtils.svelte.d.ts +28 -0
- package/dist/components/playground/pipelineViewUtils.svelte.js +38 -1
- package/dist/config/endpoints.d.ts +0 -7
- package/dist/config/endpoints.js +2 -10
- package/dist/core/index.d.ts +4 -4
- package/dist/core/index.js +6 -6
- package/dist/display/index.d.ts +0 -2
- package/dist/display/index.js +0 -6
- package/dist/editor/index.d.ts +19 -20
- package/dist/editor/index.js +25 -35
- package/dist/form/code.d.ts +25 -15
- package/dist/form/code.js +44 -41
- package/dist/form/fieldRegistry.d.ts +17 -13
- package/dist/form/fieldRegistry.js +32 -12
- package/dist/form/full.d.ts +17 -13
- package/dist/form/full.js +22 -27
- package/dist/form/index.d.ts +3 -3
- package/dist/form/index.js +3 -3
- package/dist/form/markdown.d.ts +13 -8
- package/dist/form/markdown.js +22 -23
- package/dist/helpers/proximityConnect.d.ts +7 -3
- package/dist/helpers/proximityConnect.js +19 -6
- package/dist/helpers/workflowEditorHelper.d.ts +12 -5
- package/dist/helpers/workflowEditorHelper.js +27 -25
- package/dist/index.d.ts +28 -24
- package/dist/index.js +27 -50
- package/dist/messages/defaults.d.ts +2 -5
- package/dist/messages/defaults.js +3 -6
- package/dist/messages/index.d.ts +0 -1
- package/dist/messages/index.js +0 -1
- package/dist/mocks/app-forms.d.ts +6 -2
- package/dist/mocks/app-forms.js +11 -4
- package/dist/openapi/v1/openapi.yaml +227 -164
- package/dist/playground/index.d.ts +2 -3
- package/dist/playground/index.js +2 -30
- package/dist/playground/mount.d.ts +15 -0
- package/dist/playground/mount.js +46 -20
- package/dist/registry/{BaseRegistry.d.ts → BaseRegistry.svelte.d.ts} +22 -1
- package/dist/registry/{BaseRegistry.js → BaseRegistry.svelte.js} +37 -1
- package/dist/registry/builtinFormats.d.ts +9 -18
- package/dist/registry/builtinFormats.js +9 -39
- package/dist/registry/builtinNodes.d.ts +1 -26
- package/dist/registry/builtinNodes.js +14 -50
- package/dist/registry/index.d.ts +3 -4
- package/dist/registry/index.js +4 -6
- package/dist/registry/nodeComponentRegistry.d.ts +182 -15
- package/dist/registry/nodeComponentRegistry.js +235 -17
- package/dist/registry/workflowFormatRegistry.d.ts +14 -9
- package/dist/registry/workflowFormatRegistry.js +24 -8
- package/dist/{schema → schemas}/index.d.ts +2 -2
- package/dist/{schema → schemas}/index.js +2 -2
- package/dist/schemas/v1/workflow.schema.json +53 -6
- package/dist/services/agentSpecExecutionService.js +0 -1
- package/dist/services/apiVariableService.d.ts +2 -1
- package/dist/services/apiVariableService.js +5 -22
- package/dist/services/autoSaveService.d.ts +7 -0
- package/dist/services/autoSaveService.js +6 -4
- package/dist/services/chatService.d.ts +8 -4
- package/dist/services/chatService.js +15 -15
- package/dist/services/draftStorage.d.ts +129 -13
- package/dist/services/draftStorage.js +185 -37
- package/dist/services/dynamicSchemaService.d.ts +2 -1
- package/dist/services/dynamicSchemaService.js +5 -22
- package/dist/services/globalSave.d.ts +13 -12
- package/dist/services/globalSave.js +29 -51
- package/dist/services/historyService.d.ts +9 -3
- package/dist/services/historyService.js +9 -3
- package/dist/services/interruptService.d.ts +14 -9
- package/dist/services/interruptService.js +27 -27
- package/dist/services/nodeExecutionService.d.ts +18 -3
- package/dist/services/nodeExecutionService.js +71 -45
- package/dist/services/playgroundService.d.ts +14 -9
- package/dist/services/playgroundService.js +31 -30
- package/dist/services/variableService.d.ts +2 -1
- package/dist/services/variableService.js +2 -2
- package/dist/services/workflowStorage.js +6 -6
- package/dist/stores/apiContext.d.ts +45 -0
- package/dist/stores/apiContext.js +65 -0
- package/dist/stores/categoriesStore.svelte.d.ts +28 -23
- package/dist/stores/categoriesStore.svelte.js +70 -64
- package/dist/stores/getInstance.svelte.d.ts +39 -0
- package/dist/stores/getInstance.svelte.js +65 -0
- package/dist/stores/historyStore.svelte.d.ts +77 -93
- package/dist/stores/historyStore.svelte.js +134 -160
- package/dist/stores/instanceContainer.svelte.d.ts +111 -0
- package/dist/stores/instanceContainer.svelte.js +114 -0
- package/dist/stores/interruptStore.svelte.d.ts +112 -82
- package/dist/stores/interruptStore.svelte.js +253 -226
- package/dist/stores/pipelinePanelStore.svelte.d.ts +27 -3
- package/dist/stores/pipelinePanelStore.svelte.js +61 -14
- package/dist/stores/playgroundStore.svelte.d.ts +169 -216
- package/dist/stores/playgroundStore.svelte.js +515 -572
- package/dist/stores/portCoordinateStore.svelte.d.ts +57 -51
- package/dist/stores/portCoordinateStore.svelte.js +109 -98
- package/dist/stores/settingsStore.svelte.d.ts +4 -1
- package/dist/stores/settingsStore.svelte.js +47 -12
- package/dist/stores/workflowStore.svelte.d.ts +178 -213
- package/dist/stores/workflowStore.svelte.js +449 -501
- package/dist/stories/EdgeDecorator.svelte +5 -2
- package/dist/stories/NodeDecorator.svelte +5 -3
- package/dist/svelte-app.d.ts +60 -10
- package/dist/svelte-app.js +157 -53
- package/dist/types/events.d.ts +6 -3
- package/dist/types/index.d.ts +71 -6
- package/dist/types/navbar.d.ts +7 -0
- package/dist/types/playground.d.ts +18 -3
- package/dist/types/settings.d.ts +13 -0
- package/dist/types/settings.js +1 -0
- package/dist/utils/colors.d.ts +47 -21
- package/dist/utils/colors.js +69 -68
- package/dist/utils/connections.d.ts +9 -15
- package/dist/utils/connections.js +13 -32
- package/dist/utils/duration.d.ts +13 -0
- package/dist/utils/duration.js +45 -0
- package/dist/utils/formMerge.d.ts +36 -0
- package/dist/utils/formMerge.js +70 -0
- package/dist/utils/icons.d.ts +5 -2
- package/dist/utils/icons.js +6 -5
- package/dist/utils/nodeSwap.d.ts +6 -2
- package/dist/utils/nodeSwap.js +62 -126
- package/dist/utils/nodeTypes.d.ts +17 -8
- package/dist/utils/nodeTypes.js +27 -19
- package/dist/utils/performanceUtils.js +7 -0
- package/package.json +6 -5
- package/dist/messages/deprecation.d.ts +0 -20
- package/dist/messages/deprecation.js +0 -33
- package/dist/registry/plugin.d.ts +0 -215
- package/dist/registry/plugin.js +0 -249
- package/dist/services/api.d.ts +0 -129
- package/dist/services/api.js +0 -217
package/dist/types/index.d.ts
CHANGED
|
@@ -202,13 +202,13 @@ export declare function dynamicPortToNodePort(port: DynamicPort, portType: 'inpu
|
|
|
202
202
|
* Built-in node types for explicit component rendering.
|
|
203
203
|
* These are the node types that ship with FlowDrop.
|
|
204
204
|
*/
|
|
205
|
-
export type BuiltinNodeType = 'note' | 'simple' | 'square' | 'tool' | 'gateway' | 'terminal' | 'default';
|
|
205
|
+
export type BuiltinNodeType = 'note' | 'simple' | 'square' | 'atom' | 'tool' | 'gateway' | 'terminal' | 'default';
|
|
206
206
|
/**
|
|
207
207
|
* Node type for component rendering.
|
|
208
208
|
* Includes built-in types and allows custom registered types.
|
|
209
209
|
*
|
|
210
210
|
* Built-in types: note, simple, square, tool, gateway, terminal, default
|
|
211
|
-
* Custom types: Any string registered via
|
|
211
|
+
* Custom types: Any string registered via fd.nodes
|
|
212
212
|
*
|
|
213
213
|
* @example
|
|
214
214
|
* ```typescript
|
|
@@ -306,8 +306,13 @@ export interface AutocompleteConfig {
|
|
|
306
306
|
* If the "account" field currently holds "my-jira", the URL becomes:
|
|
307
307
|
* /api/jira/issue-types?account=my-jira&q=...
|
|
308
308
|
*
|
|
309
|
-
* When
|
|
310
|
-
*
|
|
309
|
+
* When a dependency field changes, the component invalidates its cached
|
|
310
|
+
* suggestions and aborts any in-flight fetch. The dependent field's own
|
|
311
|
+
* value is cleared by the parent form (`ConfigForm` / `SchemaForm`) on
|
|
312
|
+
* user-driven edits only — undo/redo, programmatic value replacement, and
|
|
313
|
+
* collaborative edits flow in via props and preserve dependent values.
|
|
314
|
+
* Standalone consumers of `FormAutocomplete` outside a FlowDrop form
|
|
315
|
+
* therefore need to clear dependents themselves.
|
|
311
316
|
*/
|
|
312
317
|
params?: Record<string, string>;
|
|
313
318
|
}
|
|
@@ -495,9 +500,39 @@ export interface ConfigEditOptions {
|
|
|
495
500
|
* UI-related extension settings for nodes
|
|
496
501
|
* Used to control visual behavior in the workflow editor
|
|
497
502
|
*/
|
|
503
|
+
/**
|
|
504
|
+
* Display/behavior config for minimalist "atom" nodes (Constant, Cast, …).
|
|
505
|
+
* Lives under `extensions.ui.atom`. The atom renderer reads it to decide what to
|
|
506
|
+
* show, and `getAllPorts` reads `valueTypeKey` to drive the bound output port's
|
|
507
|
+
* dataType from config so connection validation stays correct.
|
|
508
|
+
*/
|
|
509
|
+
export interface AtomUIConfig {
|
|
510
|
+
/** Config key whose value becomes the node body. Falls back to `data.label`. */
|
|
511
|
+
valueKey?: string;
|
|
512
|
+
/**
|
|
513
|
+
* Config key holding the selected value's type (a port dataType id).
|
|
514
|
+
* The bound output port adopts this dataType.
|
|
515
|
+
*/
|
|
516
|
+
valueTypeKey?: string;
|
|
517
|
+
/** Output port id driven by `valueTypeKey`. Defaults to the first output port. */
|
|
518
|
+
outputPortId?: string;
|
|
519
|
+
/** Body shape. `'pill'` (default) is fully rounded; `'rectangle'` is lightly rounded. */
|
|
520
|
+
shape?: 'pill' | 'rectangle';
|
|
521
|
+
/**
|
|
522
|
+
* Dimmed affordance rendered before the body (e.g. `'→ '` to mark a transform).
|
|
523
|
+
* Stays visible while the body value ellipsizes. Hidden in the empty state.
|
|
524
|
+
*/
|
|
525
|
+
prefix?: string;
|
|
526
|
+
/** Text shown (dimmed) when the resolved body value is empty/unset. */
|
|
527
|
+
placeholder?: string;
|
|
528
|
+
/** Max body width in px before the label ellipsizes. */
|
|
529
|
+
maxWidth?: number;
|
|
530
|
+
}
|
|
498
531
|
export interface NodeUIExtensions {
|
|
499
532
|
/** Show/hide unconnected handles (ports) to reduce visual noise */
|
|
500
533
|
hideUnconnectedHandles?: boolean;
|
|
534
|
+
/** Display/behavior config for minimalist atom nodes (Constant, Cast, …) */
|
|
535
|
+
atom?: AtomUIConfig;
|
|
501
536
|
/**
|
|
502
537
|
* Visual-only port display order (no effect on execution).
|
|
503
538
|
* Arrays of port IDs in the desired render order.
|
|
@@ -1153,8 +1188,9 @@ export interface Workflow {
|
|
|
1153
1188
|
description?: string;
|
|
1154
1189
|
nodes: WorkflowNode[];
|
|
1155
1190
|
edges: WorkflowEdge[];
|
|
1156
|
-
metadata
|
|
1157
|
-
version
|
|
1191
|
+
metadata: {
|
|
1192
|
+
/** Workflow schema format version — identifies the document format, not the workflow's own revision. */
|
|
1193
|
+
schemaVersion: string;
|
|
1158
1194
|
createdAt: string;
|
|
1159
1195
|
updatedAt: string;
|
|
1160
1196
|
author?: string;
|
|
@@ -1208,6 +1244,31 @@ export interface PipelineViewDef {
|
|
|
1208
1244
|
/** Svelte component that receives PipelineViewProps */
|
|
1209
1245
|
component: Component<PipelineViewProps>;
|
|
1210
1246
|
}
|
|
1247
|
+
/**
|
|
1248
|
+
* One job execution of a node within a pipeline run.
|
|
1249
|
+
*
|
|
1250
|
+
* Loop-orchestrated workflows create one job per iteration for the same
|
|
1251
|
+
* node (labels carry an iteration suffix, e.g. "Invoke tool #2"), so a node
|
|
1252
|
+
* can have several of these per run.
|
|
1253
|
+
*/
|
|
1254
|
+
export interface NodeJobExecution {
|
|
1255
|
+
/** Job entity ID */
|
|
1256
|
+
id?: string;
|
|
1257
|
+
/** Job label, carries the iteration suffix (e.g. "Invoke tool #2") */
|
|
1258
|
+
label?: string;
|
|
1259
|
+
/** Job status */
|
|
1260
|
+
status: NodeExecutionStatus;
|
|
1261
|
+
/** ISO timestamp the job started, if it ran */
|
|
1262
|
+
started?: string;
|
|
1263
|
+
/** ISO timestamp the job completed, if it finished */
|
|
1264
|
+
completed?: string;
|
|
1265
|
+
/** Execution duration in milliseconds, if the job ran to completion */
|
|
1266
|
+
executionTime?: number;
|
|
1267
|
+
/** Precise execution duration in microseconds, when the backend provides it */
|
|
1268
|
+
executionTimeUs?: number;
|
|
1269
|
+
/** Error message if the job failed */
|
|
1270
|
+
error?: string;
|
|
1271
|
+
}
|
|
1211
1272
|
/**
|
|
1212
1273
|
* Node execution tracking information
|
|
1213
1274
|
*/
|
|
@@ -1220,12 +1281,16 @@ export interface NodeExecutionInfo {
|
|
|
1220
1281
|
lastExecuted?: string;
|
|
1221
1282
|
/** Last execution duration in milliseconds */
|
|
1222
1283
|
lastExecutionDuration?: number;
|
|
1284
|
+
/** Precise last execution duration in microseconds, when the backend provides it */
|
|
1285
|
+
lastExecutionDurationUs?: number;
|
|
1223
1286
|
/** Last error message if execution failed */
|
|
1224
1287
|
lastError?: string;
|
|
1225
1288
|
/** Whether the node is currently being executed */
|
|
1226
1289
|
isExecuting: boolean;
|
|
1227
1290
|
/** Execution output data (e.g., active branches for gateway nodes) */
|
|
1228
1291
|
output?: Record<string, unknown>;
|
|
1292
|
+
/** Per-job execution history (loop iterations), in pipeline order */
|
|
1293
|
+
jobs?: NodeJobExecution[];
|
|
1229
1294
|
}
|
|
1230
1295
|
/**
|
|
1231
1296
|
* Workflow execution status
|
package/dist/types/navbar.d.ts
CHANGED
|
@@ -11,4 +11,11 @@ export interface NavbarAction {
|
|
|
11
11
|
onclick?: (event: Event) => void;
|
|
12
12
|
/** If true, opens link in new tab with `rel="noopener noreferrer"`. */
|
|
13
13
|
external?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Optional group label. Items sharing the same `group` cluster together
|
|
16
|
+
* under a header inside the flyout dropdown. Ungrouped items render first.
|
|
17
|
+
* Group order follows first occurrence in the array. Ignored when the
|
|
18
|
+
* navbar is in split mode (the inline row of buttons).
|
|
19
|
+
*/
|
|
20
|
+
group?: string;
|
|
14
21
|
}
|
|
@@ -376,11 +376,26 @@ export interface PlaygroundConfig {
|
|
|
376
376
|
*/
|
|
377
377
|
showSidebar?: boolean;
|
|
378
378
|
/**
|
|
379
|
-
* Whether to show the
|
|
380
|
-
* When false, the header
|
|
381
|
-
*
|
|
379
|
+
* Whether to show the ControlPanel header bar (default: true)
|
|
380
|
+
* When false, hides the entire header row: session label, session chip
|
|
381
|
+
* (with its New Session / session list popover) and the toolbar actions
|
|
382
|
+
* (Pipeline / Refresh / Logs). Use for a minimal, locked-down playground.
|
|
382
383
|
*/
|
|
383
384
|
showSessionHeader?: boolean;
|
|
385
|
+
/**
|
|
386
|
+
* Whether to show the "New Session" entry in the session chip popover
|
|
387
|
+
* (default: true). When false, users cannot create additional sessions
|
|
388
|
+
* from the UI — useful for single-session playground embeds.
|
|
389
|
+
* No effect when showSessionHeader is false.
|
|
390
|
+
*/
|
|
391
|
+
showNewSessionButton?: boolean;
|
|
392
|
+
/**
|
|
393
|
+
* Whether to show the session chip selector and its session list (default:
|
|
394
|
+
* true). When false, the chip dropdown is hidden entirely — users cannot
|
|
395
|
+
* switch sessions or see other sessions. Useful for locking a playground
|
|
396
|
+
* embed to a single session. No effect when showSessionHeader is false.
|
|
397
|
+
*/
|
|
398
|
+
showSessionList?: boolean;
|
|
384
399
|
/**
|
|
385
400
|
* Determines if polling should stop for a given session status.
|
|
386
401
|
* Override to customize which statuses pause polling.
|
package/dist/types/settings.d.ts
CHANGED
|
@@ -72,6 +72,19 @@ export interface BehaviorSettings {
|
|
|
72
72
|
autoSave: boolean;
|
|
73
73
|
/** Auto-save interval in milliseconds */
|
|
74
74
|
autoSaveInterval: number;
|
|
75
|
+
/**
|
|
76
|
+
* Persist workflow drafts in browser storage.
|
|
77
|
+
*
|
|
78
|
+
* When enabled (default), unsaved changes are written to browser storage
|
|
79
|
+
* so they survive page reloads. On the default `localStorage` backend,
|
|
80
|
+
* drafts remain stored on the device even after the tab or browser is
|
|
81
|
+
* closed, until they are saved or cleared. Turning this off stops draft
|
|
82
|
+
* writes and removes the current draft.
|
|
83
|
+
*
|
|
84
|
+
* Caveat: the toggle applies per tab. Other tabs that are already open
|
|
85
|
+
* read settings at load time and keep writing drafts until reloaded.
|
|
86
|
+
*/
|
|
87
|
+
storeDraftsInBrowser: boolean;
|
|
75
88
|
/** Maximum number of undo history entries */
|
|
76
89
|
undoHistoryLimit: number;
|
|
77
90
|
/** Show confirmation dialog before deleting nodes */
|
package/dist/types/settings.js
CHANGED
package/dist/utils/colors.d.ts
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* Uses BEM syntax for CSS classes
|
|
5
5
|
*/
|
|
6
6
|
import type { NodeCategory, PortDataTypeConfig } from '../types/index.js';
|
|
7
|
+
import type { PortCompatibilityChecker } from './connections.js';
|
|
8
|
+
import type { CategoriesStore } from '../stores/categoriesStore.svelte.js';
|
|
7
9
|
/**
|
|
8
10
|
* Category color mapping to design tokens (CSS variables)
|
|
9
11
|
* Uses --fd-node-* tokens from tokens.css
|
|
@@ -14,20 +16,27 @@ export declare const CATEGORY_COLOR_TOKENS: Record<string, string>;
|
|
|
14
16
|
* Get the design token for a category color.
|
|
15
17
|
* Checks the categories store first (which includes API overrides),
|
|
16
18
|
* then falls back to the static CATEGORY_COLOR_TOKENS map, then to slate.
|
|
19
|
+
* @param categories - The instance's categories store (e.g. `fd.categories`)
|
|
20
|
+
* @param category - The node category
|
|
17
21
|
*/
|
|
18
|
-
export declare function getCategoryColorToken(category: NodeCategory): string;
|
|
22
|
+
export declare function getCategoryColorToken(categories: CategoriesStore, category: NodeCategory): string;
|
|
19
23
|
/**
|
|
20
24
|
* Get the reference color token for a data type (configurable version)
|
|
25
|
+
* @param checker - The instance's port compatibility checker (provides data-type config)
|
|
26
|
+
* @param dataType - The data type
|
|
21
27
|
*/
|
|
22
|
-
export declare function getDataTypeColorToken(dataType: string): string;
|
|
28
|
+
export declare function getDataTypeColorToken(checker: PortCompatibilityChecker, dataType: string): string;
|
|
23
29
|
/**
|
|
24
30
|
* Get data type configuration from port config
|
|
31
|
+
* @param checker - The instance's port compatibility checker
|
|
32
|
+
* @param dataType - The data type
|
|
25
33
|
*/
|
|
26
|
-
export declare function getDataTypeConfig(dataType: string): PortDataTypeConfig | undefined;
|
|
34
|
+
export declare function getDataTypeConfig(checker: PortCompatibilityChecker, dataType: string): PortDataTypeConfig | undefined;
|
|
27
35
|
/**
|
|
28
36
|
* Get all available data types from port configuration
|
|
37
|
+
* @param checker - The instance's port compatibility checker
|
|
29
38
|
*/
|
|
30
|
-
export declare function getAvailableDataTypes(): PortDataTypeConfig[];
|
|
39
|
+
export declare function getAvailableDataTypes(checker: PortCompatibilityChecker): PortDataTypeConfig[];
|
|
31
40
|
/**
|
|
32
41
|
* Default colors for fallback cases
|
|
33
42
|
*/
|
|
@@ -39,43 +48,49 @@ export declare const DEFAULT_COLORS: {
|
|
|
39
48
|
};
|
|
40
49
|
/**
|
|
41
50
|
* Get category colors
|
|
51
|
+
* @param categories - The instance's categories store (e.g. `fd.categories`)
|
|
42
52
|
* @param category - The node category
|
|
43
53
|
* @returns The color configuration for the category
|
|
44
54
|
*/
|
|
45
|
-
export declare function getCategoryColors(category: NodeCategory): string;
|
|
55
|
+
export declare function getCategoryColors(categories: CategoriesStore, category: NodeCategory): string;
|
|
46
56
|
/**
|
|
47
57
|
* Get category background color
|
|
58
|
+
* @param categories - The instance's categories store (e.g. `fd.categories`)
|
|
48
59
|
* @param category - The node category
|
|
49
60
|
* @returns The background color class
|
|
50
61
|
*/
|
|
51
|
-
export declare function getCategoryBackground(category: NodeCategory): string;
|
|
62
|
+
export declare function getCategoryBackground(categories: CategoriesStore, category: NodeCategory): string;
|
|
52
63
|
/**
|
|
53
64
|
* Get category accent color
|
|
65
|
+
* @param categories - The instance's categories store (e.g. `fd.categories`)
|
|
54
66
|
* @param category - The node category
|
|
55
67
|
* @returns The accent color class
|
|
56
68
|
*/
|
|
57
|
-
export declare function getCategoryAccent(category: NodeCategory): string;
|
|
69
|
+
export declare function getCategoryAccent(categories: CategoriesStore, category: NodeCategory): string;
|
|
58
70
|
/**
|
|
59
71
|
* Get category text color
|
|
72
|
+
* @param categories - The instance's categories store (e.g. `fd.categories`)
|
|
60
73
|
* @param category - The node category
|
|
61
74
|
* @returns The text color class
|
|
62
75
|
*/
|
|
63
|
-
export declare function getCategoryText(category: NodeCategory): string;
|
|
76
|
+
export declare function getCategoryText(categories: CategoriesStore, category: NodeCategory): string;
|
|
64
77
|
/**
|
|
65
78
|
* Get category border color
|
|
79
|
+
* @param categories - The instance's categories store (e.g. `fd.categories`)
|
|
66
80
|
* @param category - The node category
|
|
67
81
|
* @returns The border color class
|
|
68
82
|
*/
|
|
69
|
-
export declare function getCategoryBorder(category: NodeCategory): string;
|
|
83
|
+
export declare function getCategoryBorder(categories: CategoriesStore, category: NodeCategory): string;
|
|
70
84
|
/**
|
|
71
85
|
* Get node colors based on category and state
|
|
86
|
+
* @param categories - The instance's categories store (e.g. `fd.categories`)
|
|
72
87
|
* @param category - The node category
|
|
73
88
|
* @param isError - Whether the node is in error state
|
|
74
89
|
* @param isProcessing - Whether the node is processing
|
|
75
90
|
* @param isSelected - Whether the node is selected
|
|
76
91
|
* @returns The color configuration object
|
|
77
92
|
*/
|
|
78
|
-
export declare function getNodeColors(category: NodeCategory, isError?: boolean, isProcessing?: boolean, isSelected?: boolean): {
|
|
93
|
+
export declare function getNodeColors(categories: CategoriesStore, category: NodeCategory, isError?: boolean, isProcessing?: boolean, isSelected?: boolean): {
|
|
79
94
|
background: string;
|
|
80
95
|
accent: string;
|
|
81
96
|
text: string;
|
|
@@ -83,52 +98,58 @@ export declare function getNodeColors(category: NodeCategory, isError?: boolean,
|
|
|
83
98
|
};
|
|
84
99
|
/**
|
|
85
100
|
* Get node background color
|
|
101
|
+
* @param categories - The instance's categories store (e.g. `fd.categories`)
|
|
86
102
|
* @param category - The node category
|
|
87
103
|
* @param isError - Whether the node is in error state
|
|
88
104
|
* @param isProcessing - Whether the node is processing
|
|
89
105
|
* @param isSelected - Whether the node is selected
|
|
90
106
|
* @returns The background color
|
|
91
107
|
*/
|
|
92
|
-
export declare function getNodeBackground(category: NodeCategory, isError?: boolean, isProcessing?: boolean, isSelected?: boolean): string;
|
|
108
|
+
export declare function getNodeBackground(categories: CategoriesStore, category: NodeCategory, isError?: boolean, isProcessing?: boolean, isSelected?: boolean): string;
|
|
93
109
|
/**
|
|
94
110
|
* Get node accent color
|
|
111
|
+
* @param categories - The instance's categories store (e.g. `fd.categories`)
|
|
95
112
|
* @param category - The node category
|
|
96
113
|
* @param isError - Whether the node is in error state
|
|
97
114
|
* @param isProcessing - Whether the node is processing
|
|
98
115
|
* @param isSelected - Whether the node is selected
|
|
99
116
|
* @returns The accent color
|
|
100
117
|
*/
|
|
101
|
-
export declare function getNodeAccent(category: NodeCategory, isError?: boolean, isProcessing?: boolean, isSelected?: boolean): string;
|
|
118
|
+
export declare function getNodeAccent(categories: CategoriesStore, category: NodeCategory, isError?: boolean, isProcessing?: boolean, isSelected?: boolean): string;
|
|
102
119
|
/**
|
|
103
120
|
* Get node text color
|
|
121
|
+
* @param categories - The instance's categories store (e.g. `fd.categories`)
|
|
104
122
|
* @param category - The node category
|
|
105
123
|
* @param isError - Whether the node is in error state
|
|
106
124
|
* @param isProcessing - Whether the node is processing
|
|
107
125
|
* @param isSelected - Whether the node is selected
|
|
108
126
|
* @returns The text color
|
|
109
127
|
*/
|
|
110
|
-
export declare function getNodeText(category: NodeCategory, isError?: boolean, isProcessing?: boolean, isSelected?: boolean): string;
|
|
128
|
+
export declare function getNodeText(categories: CategoriesStore, category: NodeCategory, isError?: boolean, isProcessing?: boolean, isSelected?: boolean): string;
|
|
111
129
|
/**
|
|
112
130
|
* Get node border color
|
|
131
|
+
* @param categories - The instance's categories store (e.g. `fd.categories`)
|
|
113
132
|
* @param category - The node category
|
|
114
133
|
* @param isError - Whether the node is in error state
|
|
115
134
|
* @param isProcessing - Whether the node is processing
|
|
116
135
|
* @param isSelected - Whether the node is selected
|
|
117
136
|
* @returns The border color
|
|
118
137
|
*/
|
|
119
|
-
export declare function getNodeBorder(category: NodeCategory, isError?: boolean, isProcessing?: boolean, isSelected?: boolean): string;
|
|
138
|
+
export declare function getNodeBorder(categories: CategoriesStore, category: NodeCategory, isError?: boolean, isProcessing?: boolean, isSelected?: boolean): string;
|
|
120
139
|
/**
|
|
121
140
|
* Get data type color
|
|
141
|
+
* @param checker - The instance's port compatibility checker
|
|
122
142
|
* @param dataType - The data type
|
|
123
143
|
* @returns The color for the data type
|
|
124
144
|
*/
|
|
125
|
-
export declare function getDataTypeColor(dataType: string): string;
|
|
145
|
+
export declare function getDataTypeColor(checker: PortCompatibilityChecker, dataType: string): string;
|
|
126
146
|
/**
|
|
127
147
|
* Parse typed array notation and get display information
|
|
148
|
+
* @param checker - The instance's port compatibility checker
|
|
128
149
|
* @param dataType - The data type (e.g., "string[]", "number", "object[]")
|
|
129
150
|
* @returns Object with display information
|
|
130
151
|
*/
|
|
131
|
-
export declare function parseDataTypeDisplay(dataType: string): {
|
|
152
|
+
export declare function parseDataTypeDisplay(checker: PortCompatibilityChecker, dataType: string): {
|
|
132
153
|
baseType: string;
|
|
133
154
|
isArray: boolean;
|
|
134
155
|
displayName: string;
|
|
@@ -136,10 +157,11 @@ export declare function parseDataTypeDisplay(dataType: string): {
|
|
|
136
157
|
};
|
|
137
158
|
/**
|
|
138
159
|
* Get formatted display text for a data type
|
|
160
|
+
* @param checker - The instance's port compatibility checker
|
|
139
161
|
* @param dataType - The data type
|
|
140
162
|
* @returns Formatted display text
|
|
141
163
|
*/
|
|
142
|
-
export declare function getDataTypeDisplayText(dataType: string): string;
|
|
164
|
+
export declare function getDataTypeDisplayText(checker: PortCompatibilityChecker, dataType: string): string;
|
|
143
165
|
/**
|
|
144
166
|
* Check if a data type represents an array
|
|
145
167
|
* @param dataType - The data type
|
|
@@ -191,30 +213,34 @@ export declare function getContrastTextColor(backgroundColor: string): string;
|
|
|
191
213
|
export declare function resolveColorToken(token: string): string;
|
|
192
214
|
/**
|
|
193
215
|
* Get the appropriate contrast text color for a data type badge
|
|
216
|
+
* @param checker - The instance's port compatibility checker
|
|
194
217
|
* @param dataType - The data type (e.g., "array", "string", "number")
|
|
195
218
|
* @returns CSS color value for text that provides good contrast on the data type's background
|
|
196
219
|
*/
|
|
197
|
-
export declare function getContrastTextColorForDataType(dataType: string): string;
|
|
220
|
+
export declare function getContrastTextColorForDataType(checker: PortCompatibilityChecker, dataType: string): string;
|
|
198
221
|
/**
|
|
199
222
|
* Get the appropriate contrast text color for a category badge
|
|
223
|
+
* @param categories - The instance's categories store (e.g. `fd.categories`)
|
|
200
224
|
* @param category - The node category
|
|
201
225
|
* @returns CSS color value for text that provides good contrast on the category's background
|
|
202
226
|
*/
|
|
203
|
-
export declare function getContrastTextColorForCategory(category: NodeCategory): string;
|
|
227
|
+
export declare function getContrastTextColorForCategory(categories: CategoriesStore, category: NodeCategory): string;
|
|
204
228
|
/**
|
|
205
229
|
* Get a semi-transparent tinted background color for ports
|
|
206
230
|
* Creates a cohesive look with the icon wrapper styling
|
|
231
|
+
* @param checker - The instance's port compatibility checker
|
|
207
232
|
* @param dataType - The data type
|
|
208
233
|
* @param opacity - Opacity percentage (default 25%)
|
|
209
234
|
* @returns CSS color-mix expression for the tinted background
|
|
210
235
|
*/
|
|
211
|
-
export declare function getPortBackgroundColor(dataType: string, opacity?: number): string;
|
|
236
|
+
export declare function getPortBackgroundColor(checker: PortCompatibilityChecker, dataType: string, opacity?: number): string;
|
|
212
237
|
/**
|
|
213
238
|
* Get the border color for ports (solid data type color)
|
|
239
|
+
* @param checker - The instance's port compatibility checker
|
|
214
240
|
* @param dataType - The data type
|
|
215
241
|
* @returns CSS color value for the port border
|
|
216
242
|
*/
|
|
217
|
-
export declare function getPortBorderColor(dataType: string): string;
|
|
243
|
+
export declare function getPortBorderColor(checker: PortCompatibilityChecker, dataType: string): string;
|
|
218
244
|
/**
|
|
219
245
|
* Convert RGB components to hex color string
|
|
220
246
|
* @param r - Red component (0-255)
|