@flowdrop/flowdrop 2.0.0-beta.1 → 2.0.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +173 -0
- package/MIGRATION-2.0.md +173 -3
- package/README.md +5 -5
- package/dist/adapters/WorkflowAdapter.js +4 -5
- package/dist/adapters/agentspec/AgentSpecAdapter.js +3 -3
- package/dist/adapters/agentspec/defaultNodeTypes.js +9 -9
- package/dist/api/enhanced-client.js +6 -11
- package/dist/commands/executor.js +51 -26
- package/dist/commands/storeIntegration.svelte.js +11 -1
- package/dist/commands/types.js +5 -5
- package/dist/components/App.svelte +547 -386
- package/dist/components/App.svelte.d.ts +16 -8
- package/dist/components/Button.stories.svelte +65 -0
- package/dist/components/Button.stories.svelte.d.ts +19 -0
- package/dist/components/Button.svelte +62 -0
- package/dist/components/Button.svelte.d.ts +24 -0
- package/dist/components/CanvasIconButton.svelte +76 -0
- package/dist/components/CanvasIconButton.svelte.d.ts +18 -0
- package/dist/components/ConfigForm.svelte +167 -562
- package/dist/components/ConfigForm.svelte.d.ts +24 -7
- package/dist/components/ConfigModal.svelte +9 -1
- package/dist/components/ConfigPanel.svelte +234 -15
- package/dist/components/ConfigPanel.svelte.d.ts +6 -0
- package/dist/components/EditorStatusBar.stories.svelte +44 -0
- package/dist/components/EditorStatusBar.stories.svelte.d.ts +27 -0
- package/dist/components/EditorStatusBar.svelte +99 -0
- package/dist/components/EditorStatusBar.svelte.d.ts +15 -0
- package/dist/components/IconButton.svelte +80 -0
- package/dist/components/IconButton.svelte.d.ts +30 -0
- package/dist/components/Input.svelte +74 -0
- package/dist/components/Input.svelte.d.ts +17 -0
- package/dist/components/LogoWordmark.svelte +113 -0
- package/dist/components/LogoWordmark.svelte.d.ts +26 -0
- package/dist/components/Navbar.svelte +17 -63
- package/dist/components/Navbar.svelte.d.ts +3 -0
- package/dist/components/NodeSidebar.svelte +21 -126
- package/dist/components/NodeSwapPicker.svelte +12 -30
- package/dist/components/PipelineStatus.svelte +6 -1
- package/dist/components/PipelineStatus.svelte.d.ts +3 -0
- package/dist/components/PortMappingRow.svelte +0 -2
- package/dist/components/SchemaForm.svelte +4 -14
- package/dist/components/Select.svelte +53 -0
- package/dist/components/Select.svelte.d.ts +15 -0
- package/dist/components/SettingsModal.svelte +0 -5
- package/dist/components/SettingsPanel.svelte +24 -6
- package/dist/components/Textarea.svelte +39 -0
- package/dist/components/Textarea.svelte.d.ts +12 -0
- package/dist/components/ThemeToggle.svelte +15 -94
- package/dist/components/UniversalNode.svelte +36 -4
- package/dist/components/UniversalNode.svelte.d.ts +1 -1
- package/dist/components/WorkflowEditor.svelte +66 -52
- package/dist/components/WorkflowEditor.svelte.d.ts +21 -0
- package/dist/components/chat/AIChatPanel.svelte +7 -2
- package/dist/components/console/ConsoleAutocomplete.svelte +1 -1
- package/dist/components/console/ConsoleInput.svelte +3 -3
- package/dist/components/console/ConsoleOutput.svelte +2 -2
- package/dist/components/form/FormArray.svelte +37 -173
- package/dist/components/form/FormAutocomplete.svelte +18 -15
- package/dist/components/form/FormCheckboxGroup.svelte +1 -5
- package/dist/components/form/FormCodeEditor.svelte +9 -7
- package/dist/components/form/FormField.svelte +18 -42
- package/dist/components/form/FormFieldLight.svelte +52 -48
- package/dist/components/form/FormFieldLight.svelte.d.ts +12 -0
- package/dist/components/form/FormFieldset.svelte +45 -11
- package/dist/components/form/FormMarkdownEditor.svelte +8 -5
- package/dist/components/form/FormNumberField.svelte +4 -36
- package/dist/components/form/FormPorts.svelte +262 -0
- package/dist/components/form/FormPorts.svelte.d.ts +13 -0
- package/dist/components/form/FormRangeField.svelte +61 -30
- package/dist/components/form/FormSelect.svelte +13 -75
- package/dist/components/form/FormTemplateEditor.svelte +6 -4
- package/dist/components/form/FormTextField.svelte +3 -35
- package/dist/components/form/FormTextarea.svelte +4 -39
- package/dist/components/form/FormToggle.svelte +0 -4
- package/dist/components/form/FormUISchemaRenderer.svelte +3 -1
- package/dist/components/form/resolveFieldType.d.ts +24 -0
- package/dist/components/form/resolveFieldType.js +55 -0
- package/dist/components/icons/CloseIcon.svelte +6 -0
- package/dist/components/icons/CloseIcon.svelte.d.ts +26 -0
- package/dist/components/icons/CommandLineIcon.svelte +15 -0
- package/dist/components/icons/CommandLineIcon.svelte.d.ts +26 -0
- package/dist/components/icons/MenuIcon.svelte +4 -0
- package/dist/components/icons/MenuIcon.svelte.d.ts +26 -0
- package/dist/components/icons/MenuOpenIcon.svelte +6 -0
- package/dist/components/icons/MenuOpenIcon.svelte.d.ts +26 -0
- package/dist/components/interrupt/ChoicePrompt.svelte +0 -10
- package/dist/components/interrupt/ConfirmationPrompt.svelte +0 -5
- package/dist/components/interrupt/InterruptBubble.svelte +11 -12
- package/dist/components/interrupt/ReviewPrompt.svelte +0 -20
- package/dist/components/interrupt/TextInputPrompt.svelte +0 -6
- package/dist/components/layouts/MainLayout.svelte +4 -5
- package/dist/components/nodes/AtomNode.svelte +62 -76
- package/dist/components/nodes/AtomNode.svelte.d.ts +1 -1
- package/dist/components/nodes/GatewayNode.svelte +117 -164
- package/dist/components/nodes/GatewayNode.svelte.d.ts +1 -1
- package/dist/components/nodes/IdeaNode.svelte +72 -98
- package/dist/components/nodes/IdeaNode.svelte.d.ts +8 -4
- package/dist/components/nodes/NodeConfigButton.svelte +86 -0
- package/dist/components/nodes/NodeConfigButton.svelte.d.ts +15 -0
- package/dist/components/nodes/NotesNode.svelte +76 -85
- package/dist/components/nodes/NotesNode.svelte.d.ts +8 -4
- package/dist/components/nodes/SimpleNode.svelte +59 -133
- package/dist/components/nodes/SimpleNode.svelte.d.ts +4 -4
- package/dist/components/nodes/SquareNode.svelte +110 -164
- package/dist/components/nodes/SquareNode.svelte.d.ts +4 -4
- package/dist/components/nodes/TerminalNode.svelte +62 -124
- package/dist/components/nodes/TerminalNode.svelte.d.ts +4 -4
- package/dist/components/nodes/ToolNode.svelte +92 -103
- package/dist/components/nodes/ToolNode.svelte.d.ts +6 -6
- package/dist/components/nodes/WorkflowNode.svelte +132 -191
- package/dist/components/nodes/WorkflowNode.svelte.d.ts +1 -1
- package/dist/components/playground/ChatInput.svelte +0 -1
- package/dist/components/playground/InputCollector.svelte +11 -48
- package/dist/components/playground/PipelineKanbanView.svelte +6 -4
- package/dist/components/playground/PipelineKanbanView.svelte.d.ts +2 -0
- package/dist/components/playground/PipelinePanel.svelte +20 -3
- package/dist/components/playground/PipelinePanel.svelte.d.ts +2 -0
- package/dist/components/playground/PipelineTableView.svelte +6 -4
- package/dist/components/playground/PipelineTableView.svelte.d.ts +2 -0
- package/dist/components/playground/Playground.svelte +76 -25
- package/dist/components/playground/Playground.svelte.d.ts +3 -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 +5 -0
- package/dist/components/playground/PlaygroundModal.svelte.d.ts +3 -0
- package/dist/components/playground/PlaygroundStudio.svelte +7 -6
- package/dist/components/playground/PlaygroundStudio.svelte.d.ts +3 -0
- package/dist/components/playground/pipelineViewUtils.svelte.d.ts +2 -1
- package/dist/components/playground/pipelineViewUtils.svelte.js +2 -2
- package/dist/components/surfaces/SurfaceOverlay.svelte +153 -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/config/endpoints.d.ts +23 -0
- package/dist/config/endpoints.js +28 -0
- package/dist/core/index.d.ts +2 -3
- package/dist/core/index.js +2 -6
- package/dist/display/index.d.ts +6 -1
- package/dist/display/index.js +9 -1
- package/dist/editor/index.d.ts +1 -1
- package/dist/editor/index.js +1 -1
- package/dist/form/full.d.ts +2 -1
- package/dist/form/full.js +4 -1
- package/dist/form/index.d.ts +0 -1
- package/dist/form/index.js +3 -2
- package/dist/helpers/workflowEditorHelper.d.ts +4 -2
- package/dist/helpers/workflowEditorHelper.js +8 -8
- package/dist/messages/index.d.ts +1 -1
- package/dist/messages/index.js +1 -1
- package/dist/openapi/v1/openapi.yaml +35 -23
- package/dist/playground/index.d.ts +2 -2
- package/dist/playground/index.js +2 -2
- package/dist/playground/mount.d.ts +19 -5
- package/dist/playground/mount.js +16 -8
- package/dist/registry/builtinNodeTypes.d.ts +53 -0
- package/dist/registry/builtinNodeTypes.js +67 -0
- package/dist/registry/builtinNodes.d.ts +2 -39
- package/dist/registry/builtinNodes.js +6 -53
- package/dist/registry/nodeComponentRegistry.d.ts +2 -1
- package/dist/schemas/v1/workflow.schema.json +16 -14
- package/dist/services/agentSpecExecutionService.d.ts +0 -2
- package/dist/services/agentSpecExecutionService.js +0 -2
- package/dist/services/apiVariableService.js +12 -26
- package/dist/services/categoriesApi.js +3 -6
- package/dist/services/chatService.d.ts +4 -3
- package/dist/services/chatService.js +13 -18
- package/dist/services/dynamicSchemaService.d.ts +31 -4
- package/dist/services/dynamicSchemaService.js +62 -33
- package/dist/services/historyService.d.ts +30 -8
- package/dist/services/historyService.js +51 -15
- package/dist/services/interruptService.d.ts +7 -6
- package/dist/services/interruptService.js +19 -21
- package/dist/services/playgroundService.d.ts +9 -8
- package/dist/services/playgroundService.js +23 -25
- package/dist/services/portConfigApi.js +3 -6
- package/dist/services/settingsService.d.ts +9 -4
- package/dist/services/settingsService.js +23 -12
- package/dist/skins/drafter.d.ts +30 -0
- package/dist/skins/drafter.js +198 -0
- package/dist/skins/index.d.ts +2 -1
- package/dist/skins/index.js +4 -2
- package/dist/stores/apiContext.d.ts +11 -0
- package/dist/stores/apiContext.js +15 -0
- package/dist/stores/categoriesStore.svelte.js +0 -1
- package/dist/stores/historyStore.svelte.d.ts +17 -3
- package/dist/stores/historyStore.svelte.js +30 -3
- package/dist/stores/instanceContainer.svelte.js +5 -0
- package/dist/stores/playgroundStore.svelte.js +1 -3
- package/dist/stores/settingsStore.svelte.d.ts +13 -0
- package/dist/stores/settingsStore.svelte.js +32 -0
- package/dist/stores/workflowStore.svelte.d.ts +42 -5
- package/dist/stores/workflowStore.svelte.js +109 -32
- package/dist/styles/base.css +285 -14
- package/dist/styles/tokens.css +60 -2
- package/dist/svelte-app.d.ts +18 -1
- package/dist/svelte-app.js +75 -110
- package/dist/themes/drafter.d.ts +2 -0
- package/dist/themes/drafter.js +15 -0
- package/dist/themes/index.d.ts +2 -1
- package/dist/themes/index.js +8 -2
- package/dist/types/auth.d.ts +9 -51
- package/dist/types/auth.js +4 -54
- package/dist/types/events.d.ts +18 -0
- package/dist/types/events.js +2 -1
- package/dist/types/index.d.ts +84 -29
- package/dist/types/index.js +0 -1
- package/dist/types/settings.d.ts +17 -1
- package/dist/types/settings.js +4 -2
- package/dist/types/skin.d.ts +1 -1
- package/dist/types/theme.d.ts +16 -2
- package/dist/types/uischema.d.ts +5 -0
- package/dist/utils/colors.d.ts +27 -0
- package/dist/utils/colors.js +23 -0
- package/dist/utils/connections.js +20 -56
- package/dist/utils/edgeStyling.js +9 -5
- package/dist/utils/fetchWithAuth.d.ts +36 -15
- package/dist/utils/fetchWithAuth.js +53 -23
- package/dist/utils/nodeIds.d.ts +1 -1
- package/dist/utils/nodeIds.js +1 -1
- package/dist/utils/nodeSwap.js +3 -6
- package/dist/utils/nodeTypes.js +1 -1
- package/dist/utils/portUtils.d.ts +47 -11
- package/dist/utils/portUtils.js +67 -14
- 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 +2 -1
|
@@ -9,12 +9,15 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import type { FlowDropSettings, PartialSettings } from '../types/settings.js';
|
|
11
11
|
import type { EndpointConfig } from '../config/endpoints.js';
|
|
12
|
+
import type { AuthProvider } from '../types/auth.js';
|
|
12
13
|
/**
|
|
13
|
-
* Set the endpoint configuration for settings API
|
|
14
|
+
* Set the endpoint configuration (and optional auth provider) for settings API
|
|
15
|
+
* calls.
|
|
14
16
|
*
|
|
15
17
|
* @param config - Endpoint configuration
|
|
18
|
+
* @param provider - Optional auth provider supplying request auth headers
|
|
16
19
|
*/
|
|
17
|
-
export declare function setSettingsEndpointConfig(config: EndpointConfig): void;
|
|
20
|
+
export declare function setSettingsEndpointConfig(config: EndpointConfig, provider?: AuthProvider): void;
|
|
18
21
|
/**
|
|
19
22
|
* Get the current endpoint configuration
|
|
20
23
|
*
|
|
@@ -62,8 +65,9 @@ export declare class SettingsService {
|
|
|
62
65
|
* Create a new settings service instance
|
|
63
66
|
*
|
|
64
67
|
* @param config - Endpoint configuration
|
|
68
|
+
* @param authProvider - Optional auth provider applied to settings requests
|
|
65
69
|
*/
|
|
66
|
-
constructor(config: EndpointConfig);
|
|
70
|
+
constructor(config: EndpointConfig, authProvider?: AuthProvider);
|
|
67
71
|
/**
|
|
68
72
|
* Get user preferences from the backend
|
|
69
73
|
*
|
|
@@ -87,6 +91,7 @@ export declare class SettingsService {
|
|
|
87
91
|
* Create a settings service instance
|
|
88
92
|
*
|
|
89
93
|
* @param config - Endpoint configuration
|
|
94
|
+
* @param authProvider - Optional auth provider applied to settings requests
|
|
90
95
|
* @returns SettingsService instance
|
|
91
96
|
*/
|
|
92
|
-
export declare function createSettingsService(config: EndpointConfig): SettingsService;
|
|
97
|
+
export declare function createSettingsService(config: EndpointConfig, authProvider?: AuthProvider): SettingsService;
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @module services/settingsService
|
|
9
9
|
*/
|
|
10
|
-
import { buildEndpointUrl
|
|
10
|
+
import { buildEndpointUrl } from '../config/endpoints.js';
|
|
11
|
+
import { authenticatedFetch } from '../utils/fetchWithAuth.js';
|
|
11
12
|
// =========================================================================
|
|
12
13
|
// Configuration
|
|
13
14
|
// =========================================================================
|
|
@@ -16,12 +17,20 @@ import { buildEndpointUrl, getEndpointHeaders } from '../config/endpoints.js';
|
|
|
16
17
|
*/
|
|
17
18
|
let endpointConfig = null;
|
|
18
19
|
/**
|
|
19
|
-
*
|
|
20
|
+
* Auth provider reference, applied to every settings request so the backend
|
|
21
|
+
* sync path authenticates consistently with the rest of the library.
|
|
22
|
+
*/
|
|
23
|
+
let authProvider;
|
|
24
|
+
/**
|
|
25
|
+
* Set the endpoint configuration (and optional auth provider) for settings API
|
|
26
|
+
* calls.
|
|
20
27
|
*
|
|
21
28
|
* @param config - Endpoint configuration
|
|
29
|
+
* @param provider - Optional auth provider supplying request auth headers
|
|
22
30
|
*/
|
|
23
|
-
export function setSettingsEndpointConfig(config) {
|
|
31
|
+
export function setSettingsEndpointConfig(config, provider) {
|
|
24
32
|
endpointConfig = config;
|
|
33
|
+
authProvider = provider;
|
|
25
34
|
}
|
|
26
35
|
/**
|
|
27
36
|
* Get the current endpoint configuration
|
|
@@ -47,10 +56,10 @@ async function settingsRequest(endpointKey, endpointPath, options = {}) {
|
|
|
47
56
|
throw new Error('Endpoint configuration not set. Call setSettingsEndpointConfig() first.');
|
|
48
57
|
}
|
|
49
58
|
const url = buildEndpointUrl(endpointConfig, endpointPath);
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
59
|
+
const response = await authenticatedFetch(url, options, {
|
|
60
|
+
config: endpointConfig,
|
|
61
|
+
endpointKey,
|
|
62
|
+
authProvider
|
|
54
63
|
});
|
|
55
64
|
// Check if response is JSON
|
|
56
65
|
const contentType = response.headers.get('content-type');
|
|
@@ -151,11 +160,12 @@ export class SettingsService {
|
|
|
151
160
|
* Create a new settings service instance
|
|
152
161
|
*
|
|
153
162
|
* @param config - Endpoint configuration
|
|
163
|
+
* @param authProvider - Optional auth provider applied to settings requests
|
|
154
164
|
*/
|
|
155
|
-
constructor(config) {
|
|
165
|
+
constructor(config, authProvider) {
|
|
156
166
|
this.config = config;
|
|
157
|
-
// Also set the module-level config
|
|
158
|
-
setSettingsEndpointConfig(config);
|
|
167
|
+
// Also set the module-level config + auth provider
|
|
168
|
+
setSettingsEndpointConfig(config, authProvider);
|
|
159
169
|
}
|
|
160
170
|
/**
|
|
161
171
|
* Get user preferences from the backend
|
|
@@ -189,8 +199,9 @@ export class SettingsService {
|
|
|
189
199
|
* Create a settings service instance
|
|
190
200
|
*
|
|
191
201
|
* @param config - Endpoint configuration
|
|
202
|
+
* @param authProvider - Optional auth provider applied to settings requests
|
|
192
203
|
* @returns SettingsService instance
|
|
193
204
|
*/
|
|
194
|
-
export function createSettingsService(config) {
|
|
195
|
-
return new SettingsService(config);
|
|
205
|
+
export function createSettingsService(config, authProvider) {
|
|
206
|
+
return new SettingsService(config, authProvider);
|
|
196
207
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { FlowDropSkin } from '../types/skin';
|
|
2
|
+
/**
|
|
3
|
+
* Drafter — a fresh, modern "drafting workspace" skin for the whole editor
|
|
4
|
+
* environment (see ref-image.png): a fresh white shell around a mint/aqua
|
|
5
|
+
* canvas with soft cyan/teal technical grid lines, crisp engineering geometry
|
|
6
|
+
* and clean teal-ink text — not a neutral admin UI and not an all-cyan shell.
|
|
7
|
+
*
|
|
8
|
+
* Unlike a canvas-only skin, Drafter themes the entire shell so it reads as one
|
|
9
|
+
* designed environment:
|
|
10
|
+
* - App chrome (navbar, sidebars, inspector, status bars, form fields) stays
|
|
11
|
+
* white/near-white for a clean fresh product feel.
|
|
12
|
+
* - The mint/aqua personality lives in the canvas, node glass, focus rings,
|
|
13
|
+
* selected states and small technical accents.
|
|
14
|
+
* - Disabled/read-only surfaces use quiet light grey so state remains obvious.
|
|
15
|
+
* - Borders are mostly neutral hairlines; strong/focus borders + node outlines
|
|
16
|
+
* are teal/cyan ink (--fd-ring / --fd-border-strong / --fd-node-border).
|
|
17
|
+
* - Focus rings are cyan (--fd-ring), not the default blue.
|
|
18
|
+
* - Nodes are frosted glass with a faint inner highlight; the minimap + zoom
|
|
19
|
+
* controls share the same vocabulary.
|
|
20
|
+
* - Note/instruction cards read as cool annotations (translucent tint + slate
|
|
21
|
+
* ink border), never as a filled "success" card.
|
|
22
|
+
* - Emerald/green is reserved for primary actions, selection and live edges
|
|
23
|
+
* (--fd-primary) — it is not used for every outline.
|
|
24
|
+
*
|
|
25
|
+
* Data-type port colors and category icon colors are left untouched so they keep
|
|
26
|
+
* their full color against the draft surface. The square grid is rendered by
|
|
27
|
+
* WorkflowEditor via config.canvas.grid = 'lines'; --fd-grid-pattern-color
|
|
28
|
+
* colors it. Ships light + dark variants.
|
|
29
|
+
*/
|
|
30
|
+
export declare const drafterSkin: FlowDropSkin;
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Drafter — a fresh, modern "drafting workspace" skin for the whole editor
|
|
3
|
+
* environment (see ref-image.png): a fresh white shell around a mint/aqua
|
|
4
|
+
* canvas with soft cyan/teal technical grid lines, crisp engineering geometry
|
|
5
|
+
* and clean teal-ink text — not a neutral admin UI and not an all-cyan shell.
|
|
6
|
+
*
|
|
7
|
+
* Unlike a canvas-only skin, Drafter themes the entire shell so it reads as one
|
|
8
|
+
* designed environment:
|
|
9
|
+
* - App chrome (navbar, sidebars, inspector, status bars, form fields) stays
|
|
10
|
+
* white/near-white for a clean fresh product feel.
|
|
11
|
+
* - The mint/aqua personality lives in the canvas, node glass, focus rings,
|
|
12
|
+
* selected states and small technical accents.
|
|
13
|
+
* - Disabled/read-only surfaces use quiet light grey so state remains obvious.
|
|
14
|
+
* - Borders are mostly neutral hairlines; strong/focus borders + node outlines
|
|
15
|
+
* are teal/cyan ink (--fd-ring / --fd-border-strong / --fd-node-border).
|
|
16
|
+
* - Focus rings are cyan (--fd-ring), not the default blue.
|
|
17
|
+
* - Nodes are frosted glass with a faint inner highlight; the minimap + zoom
|
|
18
|
+
* controls share the same vocabulary.
|
|
19
|
+
* - Note/instruction cards read as cool annotations (translucent tint + slate
|
|
20
|
+
* ink border), never as a filled "success" card.
|
|
21
|
+
* - Emerald/green is reserved for primary actions, selection and live edges
|
|
22
|
+
* (--fd-primary) — it is not used for every outline.
|
|
23
|
+
*
|
|
24
|
+
* Data-type port colors and category icon colors are left untouched so they keep
|
|
25
|
+
* their full color against the draft surface. The square grid is rendered by
|
|
26
|
+
* WorkflowEditor via config.canvas.grid = 'lines'; --fd-grid-pattern-color
|
|
27
|
+
* colors it. Ships light + dark variants.
|
|
28
|
+
*/
|
|
29
|
+
export const drafterSkin = {
|
|
30
|
+
tokens: {
|
|
31
|
+
/* ----- Shell surfaces: fresh white shell + pale mint chrome ----- */
|
|
32
|
+
/* Neutral greys read as cold admin chrome and fight the mint canvas, so the
|
|
33
|
+
quiet surfaces carry a faint aqua-mint tint instead. muted-foreground is
|
|
34
|
+
a darker teal-slate (≈6.5:1 on white) so secondary/helper text clears
|
|
35
|
+
WCAG AA comfortably — grey body text was the accessibility problem. */
|
|
36
|
+
background: '#ffffff',
|
|
37
|
+
foreground: '#10201c',
|
|
38
|
+
muted: '#eaf5f0',
|
|
39
|
+
'muted-foreground': '#46635b',
|
|
40
|
+
subtle: '#e1f0ea',
|
|
41
|
+
card: '#ffffff',
|
|
42
|
+
'card-foreground': '#10201c',
|
|
43
|
+
header: '#ffffff',
|
|
44
|
+
'header-foreground': '#10201c',
|
|
45
|
+
'header-gradient': 'linear-gradient(180deg, #ffffff 0%, #fbfefd 100%)',
|
|
46
|
+
'surface-tint': 'rgba(20, 184, 166, 0.015)',
|
|
47
|
+
/* White sidebars/inspector with only a whisper of technical glass */
|
|
48
|
+
'panel-bg': 'rgba(255, 255, 255, 0.94)',
|
|
49
|
+
'panel-backdrop-filter': 'blur(10px) saturate(1.04)',
|
|
50
|
+
backdrop: 'rgba(255, 255, 255, 0.92)',
|
|
51
|
+
/* ----- Borders: soft mint hairlines; strong/focus = teal-cyan accent ----- */
|
|
52
|
+
border: '#d3e6df',
|
|
53
|
+
'border-muted': '#e4f0eb',
|
|
54
|
+
'border-strong': 'rgba(15, 118, 110, 0.42)',
|
|
55
|
+
ring: '#06b6d4',
|
|
56
|
+
/* ----- Canvas: fresh aqua-mint, soft cyan/teal square grid ----- */
|
|
57
|
+
'canvas-bg': '#fbfefd',
|
|
58
|
+
'grid-pattern-color': 'rgba(20, 184, 166, 0.08)',
|
|
59
|
+
/* ----- Nodes: frosted glass, faint inner highlight ----- */
|
|
60
|
+
'node-bg': 'rgba(247, 252, 250, 0.7)',
|
|
61
|
+
'node-header-bg': 'rgba(214, 245, 236, 0.6)',
|
|
62
|
+
'node-backdrop-filter': 'blur(10px) saturate(1.15)',
|
|
63
|
+
'node-radius': '2px',
|
|
64
|
+
'node-shadow': 'inset 0 1px 0 0 rgba(255, 255, 255, 0.6)',
|
|
65
|
+
'node-shadow-hover': 'inset 0 1px 0 0 rgba(255, 255, 255, 0.85)',
|
|
66
|
+
'node-border': '#0f766e',
|
|
67
|
+
'node-border-hover': '#0c5f59',
|
|
68
|
+
'node-border-width': '1.25px',
|
|
69
|
+
/* Header divider matches the node outline ink (tracks light/dark node-border) */
|
|
70
|
+
'node-header-divider-color': 'var(--fd-node-border)',
|
|
71
|
+
'handle-border': '#ffffff',
|
|
72
|
+
/* Notes read as cool annotations, not filled success cards */
|
|
73
|
+
'note-border': '#5b7891',
|
|
74
|
+
'note-border-hover': '#48617a',
|
|
75
|
+
/* Status hues tuned to the cool palette: danger = rose (teal's warm
|
|
76
|
+
complement, not a generic red), warning = golden amber. Success/info stay
|
|
77
|
+
on the emerald/cyan family so they read as part of the theme. */
|
|
78
|
+
success: '#0d9488',
|
|
79
|
+
'success-hover': '#0f766e',
|
|
80
|
+
info: '#0891b2',
|
|
81
|
+
'info-hover': '#0e7490',
|
|
82
|
+
warning: '#d97706',
|
|
83
|
+
'warning-hover': '#b45309',
|
|
84
|
+
error: '#e11d48',
|
|
85
|
+
'error-hover': '#be123c',
|
|
86
|
+
/* Status/accent tints are FLAT + OPAQUE (not alpha) so the action buttons
|
|
87
|
+
that use them as fills (form add/move/delete, canvas toggles, secondary)
|
|
88
|
+
read as solid chips, never see-through to the grid. Values are the opaque
|
|
89
|
+
equivalent of the former translucent tints over the white shell. */
|
|
90
|
+
'info-muted': '#e6f4f7',
|
|
91
|
+
'success-muted': '#e7f4f3',
|
|
92
|
+
'warning-muted': '#faefe1',
|
|
93
|
+
'error-muted': '#fce8ed',
|
|
94
|
+
/* ----- Crisp drafting geometry + flat chrome (2–6px radius, no soft shadow) ----- */
|
|
95
|
+
'radius-sm': '2px',
|
|
96
|
+
'radius-md': '3px',
|
|
97
|
+
'radius-lg': '4px',
|
|
98
|
+
'radius-xl': '6px',
|
|
99
|
+
/* Form controls + their group containers (fields, array item boxes,
|
|
100
|
+
fieldsets) get the sharpest 2px corner so the config panel reads as
|
|
101
|
+
crisp drafting geometry, not rounded admin chrome. */
|
|
102
|
+
'control-radius': '2px',
|
|
103
|
+
'scrollbar-radius': '0',
|
|
104
|
+
'shadow-sm': 'none',
|
|
105
|
+
'shadow-md': 'none',
|
|
106
|
+
/* ----- Canvas overlays: light, instrument-like ----- */
|
|
107
|
+
'minimap-bg': 'rgba(255, 255, 255, 0.72)',
|
|
108
|
+
'minimap-mask-bg': 'rgba(15, 118, 110, 0.08)',
|
|
109
|
+
'minimap-mask-stroke': 'rgba(15, 118, 110, 0.35)',
|
|
110
|
+
'minimap-node-bg': 'rgba(15, 118, 110, 0.3)',
|
|
111
|
+
'minimap-node-stroke': 'rgba(15, 118, 110, 0.45)',
|
|
112
|
+
'controls-button-bg': '#ffffff',
|
|
113
|
+
'controls-button-bg-hover': '#ccfbf1',
|
|
114
|
+
'controls-button-color': '#0f766e',
|
|
115
|
+
'controls-button-color-hover': '#0c5f59',
|
|
116
|
+
'controls-button-border': 'rgba(15, 118, 110, 0.25)',
|
|
117
|
+
/* ----- Secondary = mint, accent = cyan, primary = the one allowed green ----- */
|
|
118
|
+
secondary: '#e4f1ed',
|
|
119
|
+
'secondary-hover': '#cfe6e0',
|
|
120
|
+
'secondary-foreground': '#0f3d36',
|
|
121
|
+
accent: '#06b6d4',
|
|
122
|
+
'accent-hover': '#0891b2',
|
|
123
|
+
'accent-foreground': '#ffffff',
|
|
124
|
+
'accent-muted': '#e1f6fa',
|
|
125
|
+
primary: '#10b981',
|
|
126
|
+
'primary-hover': '#059669',
|
|
127
|
+
'primary-foreground': '#ffffff',
|
|
128
|
+
'primary-muted': '#def5ed'
|
|
129
|
+
},
|
|
130
|
+
darkTokens: {
|
|
131
|
+
/* ----- Shell surfaces: deep teal-slate glass ----- */
|
|
132
|
+
background: '#0e2421',
|
|
133
|
+
foreground: '#d8f0ea',
|
|
134
|
+
muted: 'rgba(20, 60, 54, 0.6)',
|
|
135
|
+
'muted-foreground': '#8fb3aa',
|
|
136
|
+
subtle: 'rgba(13, 47, 44, 0.7)',
|
|
137
|
+
card: 'rgba(18, 42, 38, 0.96)',
|
|
138
|
+
'card-foreground': '#d8f0ea',
|
|
139
|
+
header: 'rgba(13, 40, 37, 0.7)',
|
|
140
|
+
'header-foreground': '#d8f0ea',
|
|
141
|
+
'header-gradient': 'linear-gradient(180deg, rgba(17, 42, 38, 0.9) 0%, rgba(12, 33, 30, 0.9) 100%)',
|
|
142
|
+
'surface-tint': 'rgba(45, 212, 191, 0.04)',
|
|
143
|
+
'panel-bg': 'rgba(14, 36, 33, 0.8)',
|
|
144
|
+
'panel-backdrop-filter': 'blur(14px) saturate(1.2)',
|
|
145
|
+
backdrop: 'rgba(11, 31, 28, 0.8)',
|
|
146
|
+
border: 'rgba(45, 212, 191, 0.22)',
|
|
147
|
+
'border-muted': 'rgba(45, 212, 191, 0.12)',
|
|
148
|
+
'border-strong': 'rgba(45, 212, 191, 0.4)',
|
|
149
|
+
ring: '#22d3ee',
|
|
150
|
+
'canvas-bg': '#0b1f1c',
|
|
151
|
+
'grid-pattern-color': 'rgba(45, 212, 191, 0.16)',
|
|
152
|
+
'node-bg': 'rgba(17, 38, 35, 0.62)',
|
|
153
|
+
'node-header-bg': 'rgba(13, 47, 44, 0.6)',
|
|
154
|
+
'node-backdrop-filter': 'blur(10px) saturate(1.2)',
|
|
155
|
+
'node-shadow': 'inset 0 1px 0 0 rgba(255, 255, 255, 0.08)',
|
|
156
|
+
'node-shadow-hover': 'inset 0 1px 0 0 rgba(255, 255, 255, 0.14)',
|
|
157
|
+
'node-border': '#0d9488',
|
|
158
|
+
'node-border-hover': '#2dd4bf',
|
|
159
|
+
'handle-border': '#0b1f1c',
|
|
160
|
+
'note-border': '#7d96b0',
|
|
161
|
+
'note-border-hover': '#9fb4cb',
|
|
162
|
+
success: '#2dd4bf',
|
|
163
|
+
'success-hover': '#5eead4',
|
|
164
|
+
info: '#22d3ee',
|
|
165
|
+
'info-hover': '#67e8f9',
|
|
166
|
+
warning: '#fbbf24',
|
|
167
|
+
'warning-hover': '#fcd34d',
|
|
168
|
+
error: '#fb7185',
|
|
169
|
+
'error-hover': '#fda4af',
|
|
170
|
+
/* Flat + opaque tints (opaque equivalent of the former alpha tints over the
|
|
171
|
+
deep teal-slate shell) so button fills never go see-through. */
|
|
172
|
+
'info-muted': '#10393a',
|
|
173
|
+
'success-muted': '#123934',
|
|
174
|
+
'warning-muted': '#2f3a21',
|
|
175
|
+
'error-muted': '#2a2d2d',
|
|
176
|
+
'minimap-bg': 'rgba(11, 31, 28, 0.7)',
|
|
177
|
+
'minimap-mask-bg': 'rgba(45, 212, 191, 0.06)',
|
|
178
|
+
'minimap-mask-stroke': 'rgba(45, 212, 191, 0.3)',
|
|
179
|
+
'minimap-node-bg': 'rgba(45, 212, 191, 0.28)',
|
|
180
|
+
'minimap-node-stroke': 'rgba(45, 212, 191, 0.45)',
|
|
181
|
+
'controls-button-bg': '#102522',
|
|
182
|
+
'controls-button-bg-hover': '#0d2d2a',
|
|
183
|
+
'controls-button-color': '#2dd4bf',
|
|
184
|
+
'controls-button-color-hover': '#5eead4',
|
|
185
|
+
'controls-button-border': 'rgba(45, 212, 191, 0.3)',
|
|
186
|
+
secondary: '#0d2d2a',
|
|
187
|
+
'secondary-hover': '#133a34',
|
|
188
|
+
'secondary-foreground': '#d8f0ea',
|
|
189
|
+
accent: '#22d3ee',
|
|
190
|
+
'accent-hover': '#67e8f9',
|
|
191
|
+
'accent-foreground': '#03291c',
|
|
192
|
+
'accent-muted': '#113d3e',
|
|
193
|
+
primary: '#34d399',
|
|
194
|
+
'primary-hover': '#6ee7b7',
|
|
195
|
+
'primary-foreground': '#03291c',
|
|
196
|
+
'primary-muted': '#144034'
|
|
197
|
+
}
|
|
198
|
+
};
|
package/dist/skins/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { FlowDropSkin, FlowDropSkinName } from '../types/skin';
|
|
2
2
|
import { defaultSkin } from './default';
|
|
3
3
|
import { slateSkin } from './slate';
|
|
4
|
+
import { drafterSkin } from './drafter';
|
|
4
5
|
/**
|
|
5
6
|
* Resolve a skin prop to a complete FlowDropSkin object.
|
|
6
7
|
*
|
|
@@ -10,4 +11,4 @@ import { slateSkin } from './slate';
|
|
|
10
11
|
* → minimal skin tokens + { primary: '#e11d48' }
|
|
11
12
|
*/
|
|
12
13
|
export declare function resolveSkin(skin: FlowDropSkin | FlowDropSkinName | undefined): FlowDropSkin;
|
|
13
|
-
export { defaultSkin, slateSkin };
|
|
14
|
+
export { defaultSkin, slateSkin, drafterSkin };
|
package/dist/skins/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { defaultSkin } from './default';
|
|
2
2
|
import { slateSkin } from './slate';
|
|
3
|
+
import { drafterSkin } from './drafter';
|
|
3
4
|
const builtinSkins = {
|
|
4
5
|
default: defaultSkin,
|
|
5
|
-
slate: slateSkin
|
|
6
|
+
slate: slateSkin,
|
|
7
|
+
drafter: drafterSkin
|
|
6
8
|
};
|
|
7
9
|
/**
|
|
8
10
|
* Resolve a skin prop to a complete FlowDropSkin object.
|
|
@@ -27,4 +29,4 @@ export function resolveSkin(skin) {
|
|
|
27
29
|
}
|
|
28
30
|
return skin;
|
|
29
31
|
}
|
|
30
|
-
export { defaultSkin, slateSkin };
|
|
32
|
+
export { defaultSkin, slateSkin, drafterSkin };
|
|
@@ -40,6 +40,17 @@ export declare class ApiContext {
|
|
|
40
40
|
* Discards any previously built client so the next access rebuilds it.
|
|
41
41
|
*/
|
|
42
42
|
configure(config: EndpointConfig, authProvider?: AuthProvider): void;
|
|
43
|
+
/**
|
|
44
|
+
* Swap the auth provider at runtime — e.g. on login or logout — without
|
|
45
|
+
* reconfiguring endpoints or remounting. Propagates to the live client so
|
|
46
|
+
* in-flight components keep working against the same instance.
|
|
47
|
+
*
|
|
48
|
+
* Per-instance services read `fd.api.authProvider` per request, so they pick
|
|
49
|
+
* up the new provider on their next call automatically.
|
|
50
|
+
*
|
|
51
|
+
* @param authProvider - The new authentication provider
|
|
52
|
+
*/
|
|
53
|
+
setAuthProvider(authProvider: AuthProvider): void;
|
|
43
54
|
/** Whether {@link configure} has been called with a usable config. */
|
|
44
55
|
isConfigured(): boolean;
|
|
45
56
|
}
|
|
@@ -58,6 +58,21 @@ export class ApiContext {
|
|
|
58
58
|
// Drop the cached client so it picks up the new config/auth on next access.
|
|
59
59
|
this.#client = null;
|
|
60
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Swap the auth provider at runtime — e.g. on login or logout — without
|
|
63
|
+
* reconfiguring endpoints or remounting. Propagates to the live client so
|
|
64
|
+
* in-flight components keep working against the same instance.
|
|
65
|
+
*
|
|
66
|
+
* Per-instance services read `fd.api.authProvider` per request, so they pick
|
|
67
|
+
* up the new provider on their next call automatically.
|
|
68
|
+
*
|
|
69
|
+
* @param authProvider - The new authentication provider
|
|
70
|
+
*/
|
|
71
|
+
setAuthProvider(authProvider) {
|
|
72
|
+
this.#authProvider = authProvider;
|
|
73
|
+
// Keep the cached client (and its in-flight consumers) in sync.
|
|
74
|
+
this.#client?.setAuthProvider(authProvider);
|
|
75
|
+
}
|
|
61
76
|
/** Whether {@link configure} has been called with a usable config. */
|
|
62
77
|
isConfigured() {
|
|
63
78
|
return Boolean(this.#config);
|
|
@@ -28,7 +28,6 @@ export class CategoriesStore {
|
|
|
28
28
|
#categories = $state([...DEFAULT_CATEGORIES]);
|
|
29
29
|
/** Derived lookup map: category name → CategoryDefinition. */
|
|
30
30
|
#categoryMap = $derived((() => {
|
|
31
|
-
// eslint-disable-next-line svelte/prefer-svelte-reactivity -- rebuilt whole inside $derived, never mutated afterwards
|
|
32
31
|
const map = new Map();
|
|
33
32
|
for (const cat of this.#categories) {
|
|
34
33
|
map.set(cat.name, cat);
|
|
@@ -24,7 +24,7 @@ export interface HistoryStoreActions {
|
|
|
24
24
|
undo: () => boolean;
|
|
25
25
|
redo: () => boolean;
|
|
26
26
|
startTransaction: (workflow: Workflow, description?: string) => void;
|
|
27
|
-
commitTransaction: () => void;
|
|
27
|
+
commitTransaction: (finalWorkflow: Workflow) => void;
|
|
28
28
|
cancelTransaction: () => void;
|
|
29
29
|
clear: (currentWorkflow?: Workflow) => void;
|
|
30
30
|
canUndo: () => boolean;
|
|
@@ -71,6 +71,16 @@ export declare class HistoryStore {
|
|
|
71
71
|
* Use this to update the workflow store or other state management.
|
|
72
72
|
*/
|
|
73
73
|
setOnRestoreCallback(callback: ((workflow: Workflow) => void) | null): void;
|
|
74
|
+
/**
|
|
75
|
+
* Set the callback run just before every undo/redo.
|
|
76
|
+
*
|
|
77
|
+
* Use this to finalize an in-progress edit session (e.g. the workflow store's
|
|
78
|
+
* `finalizeNodeConfig`) so it is committed as one history step *before* being
|
|
79
|
+
* undone. The history service intentionally does not commit dangling
|
|
80
|
+
* transactions itself — it has no access to the live state — so this hook is
|
|
81
|
+
* how the owner of that state flushes it first.
|
|
82
|
+
*/
|
|
83
|
+
setBeforeNavigateCallback(callback: (() => void) | null): void;
|
|
74
84
|
/**
|
|
75
85
|
* Release the history service subscription.
|
|
76
86
|
* Called by the owning instance's destroy(); safe to call repeatedly.
|
|
@@ -106,8 +116,12 @@ export declare class HistoryStore {
|
|
|
106
116
|
* All changes during a transaction are combined into a single undo entry.
|
|
107
117
|
*/
|
|
108
118
|
startTransaction(workflow: Workflow, description?: string): void;
|
|
109
|
-
/**
|
|
110
|
-
|
|
119
|
+
/**
|
|
120
|
+
* Commit the current transaction with its final (post-change) state.
|
|
121
|
+
*
|
|
122
|
+
* @param finalWorkflow - The workflow state after the grouped change.
|
|
123
|
+
*/
|
|
124
|
+
commitTransaction(finalWorkflow: Workflow): void;
|
|
111
125
|
/** Cancel the current transaction without committing. */
|
|
112
126
|
cancelTransaction(): void;
|
|
113
127
|
/**
|
|
@@ -34,6 +34,11 @@ export class HistoryStore {
|
|
|
34
34
|
* Invoked when undo/redo operations return a workflow.
|
|
35
35
|
*/
|
|
36
36
|
#onRestore = null;
|
|
37
|
+
/**
|
|
38
|
+
* Callback run immediately before an undo/redo, to flush any pending edit
|
|
39
|
+
* session into a committed history step (see {@link setBeforeNavigateCallback}).
|
|
40
|
+
*/
|
|
41
|
+
#onBeforeNavigate = null;
|
|
37
42
|
/** Unsubscribe handle for the service subscription. */
|
|
38
43
|
#unsubscribe;
|
|
39
44
|
/** The underlying (non-reactive) history service. */
|
|
@@ -102,6 +107,18 @@ export class HistoryStore {
|
|
|
102
107
|
setOnRestoreCallback(callback) {
|
|
103
108
|
this.#onRestore = callback;
|
|
104
109
|
}
|
|
110
|
+
/**
|
|
111
|
+
* Set the callback run just before every undo/redo.
|
|
112
|
+
*
|
|
113
|
+
* Use this to finalize an in-progress edit session (e.g. the workflow store's
|
|
114
|
+
* `finalizeNodeConfig`) so it is committed as one history step *before* being
|
|
115
|
+
* undone. The history service intentionally does not commit dangling
|
|
116
|
+
* transactions itself — it has no access to the live state — so this hook is
|
|
117
|
+
* how the owner of that state flushes it first.
|
|
118
|
+
*/
|
|
119
|
+
setBeforeNavigateCallback(callback) {
|
|
120
|
+
this.#onBeforeNavigate = callback;
|
|
121
|
+
}
|
|
105
122
|
/**
|
|
106
123
|
* Release the history service subscription.
|
|
107
124
|
* Called by the owning instance's destroy(); safe to call repeatedly.
|
|
@@ -132,6 +149,9 @@ export class HistoryStore {
|
|
|
132
149
|
* @returns true if undo was successful, false if at beginning of history
|
|
133
150
|
*/
|
|
134
151
|
undo() {
|
|
152
|
+
// Flush any pending edit session into a committed step first, so undo reverts
|
|
153
|
+
// exactly that step rather than skipping over an uncommitted edit.
|
|
154
|
+
this.#onBeforeNavigate?.();
|
|
135
155
|
const previousState = this.#service.undo();
|
|
136
156
|
if (previousState && this.#onRestore) {
|
|
137
157
|
this.#onRestore(previousState);
|
|
@@ -147,6 +167,9 @@ export class HistoryStore {
|
|
|
147
167
|
* @returns true if redo was successful, false if at end of history
|
|
148
168
|
*/
|
|
149
169
|
redo() {
|
|
170
|
+
// A pending edit session invalidates the redo stack (it is a new change), so
|
|
171
|
+
// finalize it first; redo then correctly reports nothing to redo.
|
|
172
|
+
this.#onBeforeNavigate?.();
|
|
150
173
|
const nextState = this.#service.redo();
|
|
151
174
|
if (nextState && this.#onRestore) {
|
|
152
175
|
this.#onRestore(nextState);
|
|
@@ -162,9 +185,13 @@ export class HistoryStore {
|
|
|
162
185
|
startTransaction(workflow, description) {
|
|
163
186
|
this.#service.startTransaction(workflow, description);
|
|
164
187
|
}
|
|
165
|
-
/**
|
|
166
|
-
|
|
167
|
-
|
|
188
|
+
/**
|
|
189
|
+
* Commit the current transaction with its final (post-change) state.
|
|
190
|
+
*
|
|
191
|
+
* @param finalWorkflow - The workflow state after the grouped change.
|
|
192
|
+
*/
|
|
193
|
+
commitTransaction(finalWorkflow) {
|
|
194
|
+
this.#service.commitTransaction(finalWorkflow);
|
|
168
195
|
}
|
|
169
196
|
/** Cancel the current transaction without committing. */
|
|
170
197
|
cancelTransaction() {
|
|
@@ -55,10 +55,15 @@ export function createFlowDropInstance(options = {}) {
|
|
|
55
55
|
// Default wiring: undo/redo restores into this instance's workflow store.
|
|
56
56
|
// WorkflowEditor overrides this with a richer callback while mounted.
|
|
57
57
|
historyBindings.setOnRestoreCallback((restored) => workflow.restoreFromHistory(restored));
|
|
58
|
+
// Before any undo/redo, flush a pending config-edit session into a committed
|
|
59
|
+
// step so it can be undone atomically (the history service won't commit a
|
|
60
|
+
// dangling transaction itself — it has no access to the live state).
|
|
61
|
+
historyBindings.setBeforeNavigateCallback(() => workflow.finalizeNodeConfig());
|
|
58
62
|
const playground = new PlaygroundStore();
|
|
59
63
|
const cleanups = [
|
|
60
64
|
() => historyBindings.cleanup(),
|
|
61
65
|
() => historyBindings.setOnRestoreCallback(null),
|
|
66
|
+
() => historyBindings.setBeforeNavigateCallback(null),
|
|
62
67
|
() => workflow.setOnDirtyStateChange(null),
|
|
63
68
|
() => workflow.setOnWorkflowChange(null),
|
|
64
69
|
() => playground.dispose()
|
|
@@ -109,7 +109,6 @@ export class PlaygroundStore {
|
|
|
109
109
|
// acknowledged optimistic write, overwritten by the next server response.
|
|
110
110
|
#isExecuting = $derived(this.#currentSession?.status === 'running');
|
|
111
111
|
/** Cleanups for active subscribeToSessionStatus effect roots. */
|
|
112
|
-
// eslint-disable-next-line svelte/prefer-svelte-reactivity -- non-reactive bookkeeping registry; nothing renders from it
|
|
113
112
|
#statusSubscriptions = new Set();
|
|
114
113
|
/** Bound mutation facade — see {@link PlaygroundStoreActions}. */
|
|
115
114
|
actions;
|
|
@@ -213,7 +212,7 @@ export class PlaygroundStore {
|
|
|
213
212
|
// Find input nodes in the workflow
|
|
214
213
|
workflow.nodes.forEach((node) => {
|
|
215
214
|
const category = node.data.metadata?.category;
|
|
216
|
-
const nodeTypeId = node.data.metadata?.
|
|
215
|
+
const nodeTypeId = node.data.metadata?.node_type_id ?? node.type;
|
|
217
216
|
// Check if this is an input-type node
|
|
218
217
|
// The category can be "inputs" (standard) or variations like "input"
|
|
219
218
|
const categoryStr = String(category || '');
|
|
@@ -354,7 +353,6 @@ export class PlaygroundStore {
|
|
|
354
353
|
if (!this.#currentSession)
|
|
355
354
|
return;
|
|
356
355
|
const executions = [...(this.#currentSession.executions ?? [])];
|
|
357
|
-
// eslint-disable-next-line svelte/prefer-svelte-reactivity -- transient local for dedup within this call
|
|
358
356
|
const seenIds = new Set(executions.map((e) => e.id));
|
|
359
357
|
let added = false;
|
|
360
358
|
let gainedMainRun = false;
|
|
@@ -64,6 +64,19 @@ export declare function getSystemThemeState(): ResolvedTheme;
|
|
|
64
64
|
* @returns Cleanup function that removes the listener
|
|
65
65
|
*/
|
|
66
66
|
export declare function initThemeListener(): () => void;
|
|
67
|
+
/**
|
|
68
|
+
* Seed UI settings from host-provided defaults (e.g. mount props) without
|
|
69
|
+
* overriding a returning user's persisted choices.
|
|
70
|
+
*
|
|
71
|
+
* For each provided key, the value is applied only when that key is **absent**
|
|
72
|
+
* from the persisted snapshot — so a mount prop sets the initial behavior but a
|
|
73
|
+
* value the user has actually changed always wins. Seeded values are not
|
|
74
|
+
* written to storage (storage stays user-driven), matching the precedence used
|
|
75
|
+
* by {@link initializeSettings}: library default < host default < user snapshot.
|
|
76
|
+
*
|
|
77
|
+
* @param partial - UI defaults to seed
|
|
78
|
+
*/
|
|
79
|
+
export declare function seedUiDefaults(partial: Partial<UISettings>): void;
|
|
67
80
|
/**
|
|
68
81
|
* Update settings with partial values
|
|
69
82
|
*
|
|
@@ -268,6 +268,38 @@ function notifyChange(category, key, previousValue, newValue) {
|
|
|
268
268
|
function getCategoryAsRecord(settings, category) {
|
|
269
269
|
return Object.fromEntries(Object.entries(settings[category]));
|
|
270
270
|
}
|
|
271
|
+
/**
|
|
272
|
+
* Seed UI settings from host-provided defaults (e.g. mount props) without
|
|
273
|
+
* overriding a returning user's persisted choices.
|
|
274
|
+
*
|
|
275
|
+
* For each provided key, the value is applied only when that key is **absent**
|
|
276
|
+
* from the persisted snapshot — so a mount prop sets the initial behavior but a
|
|
277
|
+
* value the user has actually changed always wins. Seeded values are not
|
|
278
|
+
* written to storage (storage stays user-driven), matching the precedence used
|
|
279
|
+
* by {@link initializeSettings}: library default < host default < user snapshot.
|
|
280
|
+
*
|
|
281
|
+
* @param partial - UI defaults to seed
|
|
282
|
+
*/
|
|
283
|
+
export function seedUiDefaults(partial) {
|
|
284
|
+
const persistedUi = loadRawFromStorage()?.ui ?? {};
|
|
285
|
+
const seeded = {};
|
|
286
|
+
for (const key of Object.keys(partial)) {
|
|
287
|
+
if (partial[key] === undefined)
|
|
288
|
+
continue;
|
|
289
|
+
if (key in persistedUi)
|
|
290
|
+
continue;
|
|
291
|
+
seeded[key] = partial[key];
|
|
292
|
+
}
|
|
293
|
+
if (Object.keys(seeded).length === 0)
|
|
294
|
+
return;
|
|
295
|
+
storeState = {
|
|
296
|
+
...storeState,
|
|
297
|
+
settings: {
|
|
298
|
+
...storeState.settings,
|
|
299
|
+
ui: { ...storeState.settings.ui, ...seeded }
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
}
|
|
271
303
|
/**
|
|
272
304
|
* Update settings with partial values
|
|
273
305
|
*
|