@d34dman/flowdrop 0.0.62 → 0.0.64
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/README.md +2 -0
- package/dist/adapters/agentspec/AgentSpecAdapter.js +1 -40
- package/dist/api/enhanced-client.d.ts +19 -0
- package/dist/api/enhanced-client.js +9 -0
- package/dist/components/App.svelte +31 -35
- package/dist/components/CanvasBanner.stories.svelte +12 -8
- package/dist/components/CanvasBanner.stories.svelte.d.ts +1 -1
- package/dist/components/ConfigPanel.stories.svelte +35 -26
- package/dist/components/ConfigPanel.stories.svelte.d.ts +1 -1
- package/dist/components/LoadingSpinner.stories.svelte +13 -13
- package/dist/components/LoadingSpinner.stories.svelte.d.ts +1 -1
- package/dist/components/Logo.stories.svelte +4 -4
- package/dist/components/Logo.stories.svelte.d.ts +1 -1
- package/dist/components/MarkdownDisplay.stories.svelte +25 -10
- package/dist/components/MarkdownDisplay.stories.svelte.d.ts +1 -1
- package/dist/components/Navbar.stories.svelte +42 -30
- package/dist/components/Navbar.stories.svelte.d.ts +1 -1
- package/dist/components/Navbar.svelte +6 -3
- package/dist/components/NodeStatusOverlay.stories.svelte +61 -50
- package/dist/components/NodeStatusOverlay.stories.svelte.d.ts +1 -1
- package/dist/components/PipelineStatus.svelte +9 -12
- package/dist/components/PipelineStatus.svelte.d.ts +2 -2
- package/dist/components/SchemaForm.stories.svelte +97 -82
- package/dist/components/SchemaForm.stories.svelte.d.ts +1 -1
- package/dist/components/SchemaForm.svelte +6 -2
- package/dist/components/SettingsPanel.svelte +5 -1
- package/dist/components/StatusIcon.stories.svelte +15 -15
- package/dist/components/StatusIcon.stories.svelte.d.ts +1 -1
- package/dist/components/StatusLabel.stories.svelte +8 -8
- package/dist/components/StatusLabel.stories.svelte.d.ts +1 -1
- package/dist/components/ThemeToggle.stories.svelte +10 -10
- package/dist/components/ThemeToggle.stories.svelte.d.ts +1 -1
- package/dist/components/WorkflowEditor.svelte +23 -9
- package/dist/components/form/FormCheckboxGroup.stories.svelte +13 -13
- package/dist/components/form/FormCheckboxGroup.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormField.svelte +2 -2
- package/dist/components/form/FormFieldLight.svelte +4 -4
- package/dist/components/form/FormFieldWrapper.stories.svelte +38 -16
- package/dist/components/form/FormFieldWrapper.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormNumberField.stories.svelte +21 -18
- package/dist/components/form/FormNumberField.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormRangeField.stories.svelte +13 -13
- package/dist/components/form/FormRangeField.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormSelect.stories.svelte +21 -21
- package/dist/components/form/FormSelect.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormTemplateEditor.svelte +0 -13
- package/dist/components/form/FormTemplateEditor.svelte.d.ts +1 -7
- package/dist/components/form/FormTextField.stories.svelte +17 -17
- package/dist/components/form/FormTextField.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormTextarea.stories.svelte +21 -18
- package/dist/components/form/FormTextarea.stories.svelte.d.ts +1 -1
- package/dist/components/form/FormToggle.stories.svelte +13 -13
- package/dist/components/form/FormToggle.stories.svelte.d.ts +1 -1
- package/dist/components/form/index.d.ts +2 -1
- package/dist/components/form/index.js +1 -2
- package/dist/components/form/types.d.ts +8 -20
- package/dist/components/form/types.js +3 -8
- package/dist/components/interrupt/ChoicePrompt.stories.svelte +37 -28
- package/dist/components/interrupt/ChoicePrompt.stories.svelte.d.ts +1 -1
- package/dist/components/interrupt/ConfirmationPrompt.stories.svelte +57 -35
- package/dist/components/interrupt/ConfirmationPrompt.stories.svelte.d.ts +1 -1
- package/dist/components/interrupt/ReviewPrompt.stories.svelte +52 -31
- package/dist/components/interrupt/ReviewPrompt.stories.svelte.d.ts +1 -1
- package/dist/components/interrupt/ReviewPrompt.svelte +42 -25
- package/dist/components/interrupt/TextInputPrompt.stories.svelte +32 -19
- package/dist/components/interrupt/TextInputPrompt.stories.svelte.d.ts +1 -1
- package/dist/components/nodes/GatewayNode.stories.svelte +96 -64
- package/dist/components/nodes/IdeaNode.stories.svelte +40 -36
- package/dist/components/nodes/NotesNode.stories.svelte +61 -54
- package/dist/components/nodes/SimpleNode.stories.svelte +141 -83
- package/dist/components/nodes/SquareNode.stories.svelte +70 -44
- package/dist/components/nodes/TerminalNode.stories.svelte +10 -10
- package/dist/components/nodes/TerminalNode.svelte +7 -3
- package/dist/components/nodes/ToolNode.stories.svelte +177 -59
- package/dist/components/nodes/WorkflowNode.stories.svelte +43 -38
- package/dist/components/playground/MessageBubble.stories.svelte +51 -38
- package/dist/components/playground/MessageBubble.stories.svelte.d.ts +1 -1
- package/dist/components/playground/Playground.svelte +1 -4
- package/dist/config/constants.d.ts +21 -0
- package/dist/config/constants.js +9 -0
- package/dist/core/index.d.ts +7 -5
- package/dist/core/index.js +5 -5
- package/dist/editor/index.d.ts +4 -4
- package/dist/editor/index.js +3 -4
- package/dist/form/code.js +16 -4
- package/dist/form/fieldRegistry.d.ts +8 -82
- package/dist/form/fieldRegistry.js +9 -101
- package/dist/form/full.d.ts +4 -1
- package/dist/form/full.js +6 -1
- package/dist/form/index.d.ts +1 -1
- package/dist/form/index.js +0 -2
- package/dist/form/markdown.js +11 -3
- package/dist/helpers/workflowEditorHelper.d.ts +0 -3
- package/dist/helpers/workflowEditorHelper.js +12 -50
- package/dist/index.js +3 -0
- package/dist/schemas/v1/workflow.schema.json +950 -1076
- package/dist/services/apiVariableService.d.ts +1 -3
- package/dist/services/apiVariableService.js +3 -4
- package/dist/services/dynamicSchemaService.js +3 -4
- package/dist/stories/CanvasDecorator.svelte +7 -8
- package/dist/stories/CanvasDecorator.svelte.d.ts +2 -2
- package/dist/stories/NodeDecorator.svelte +13 -14
- package/dist/stories/NodeDecorator.svelte.d.ts +1 -1
- package/dist/stories/utils.d.ts +2 -2
- package/dist/stories/utils.js +55 -55
- package/dist/styles/base.css +12 -4
- package/dist/styles/tokens.css +138 -130
- package/dist/types/interrupt.d.ts +1 -4
- package/dist/utils/errors.d.ts +28 -0
- package/dist/utils/errors.js +44 -0
- package/dist/utils/handleIds.d.ts +35 -0
- package/dist/utils/handleIds.js +58 -0
- package/package.json +53 -12
- package/dist/api/client.d.ts +0 -110
- package/dist/api/client.js +0 -240
package/dist/form/code.js
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* // Now SchemaForm will render code editors for format: "json", "code", or "template"
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
23
|
-
import {
|
|
23
|
+
import { fieldComponentRegistry } from './fieldRegistry.js';
|
|
24
24
|
// Re-export the components for direct usage if needed
|
|
25
25
|
export { default as FormCodeEditor } from '../components/form/FormCodeEditor.svelte';
|
|
26
26
|
export { default as FormTemplateEditor } from '../components/form/FormTemplateEditor.svelte';
|
|
@@ -81,7 +81,11 @@ export function registerCodeEditorField(priority = 100) {
|
|
|
81
81
|
}
|
|
82
82
|
// Dynamic import to ensure proper code splitting
|
|
83
83
|
import('../components/form/FormCodeEditor.svelte').then((module) => {
|
|
84
|
-
|
|
84
|
+
fieldComponentRegistry.register('code-editor', {
|
|
85
|
+
component: module.default,
|
|
86
|
+
matcher: codeEditorFieldMatcher,
|
|
87
|
+
priority
|
|
88
|
+
});
|
|
85
89
|
codeEditorRegistered = true;
|
|
86
90
|
});
|
|
87
91
|
}
|
|
@@ -107,7 +111,11 @@ export function registerTemplateEditorField(priority = 100) {
|
|
|
107
111
|
}
|
|
108
112
|
// Dynamic import to ensure proper code splitting
|
|
109
113
|
import('../components/form/FormTemplateEditor.svelte').then((module) => {
|
|
110
|
-
|
|
114
|
+
fieldComponentRegistry.register('template-editor', {
|
|
115
|
+
component: module.default,
|
|
116
|
+
matcher: templateEditorFieldMatcher,
|
|
117
|
+
priority
|
|
118
|
+
});
|
|
111
119
|
templateEditorRegistered = true;
|
|
112
120
|
});
|
|
113
121
|
}
|
|
@@ -139,7 +147,11 @@ export function registerCodeEditorFieldWithComponent(component, priority = 100)
|
|
|
139
147
|
if (codeEditorRegistered) {
|
|
140
148
|
return;
|
|
141
149
|
}
|
|
142
|
-
|
|
150
|
+
fieldComponentRegistry.register('code-editor', {
|
|
151
|
+
component,
|
|
152
|
+
matcher: codeEditorFieldMatcher,
|
|
153
|
+
priority
|
|
154
|
+
});
|
|
143
155
|
codeEditorRegistered = true;
|
|
144
156
|
}
|
|
145
157
|
/**
|
|
@@ -18,10 +18,14 @@
|
|
|
18
18
|
*
|
|
19
19
|
* @example Adding code editor support:
|
|
20
20
|
* ```typescript
|
|
21
|
-
* import {
|
|
21
|
+
* import { fieldComponentRegistry } from "@d34dman/flowdrop/form";
|
|
22
22
|
* import { FormCodeEditor, codeEditorFieldMatcher } from "@d34dman/flowdrop/form/code";
|
|
23
23
|
*
|
|
24
|
-
*
|
|
24
|
+
* fieldComponentRegistry.register("code-editor", {
|
|
25
|
+
* component: FormCodeEditor,
|
|
26
|
+
* matcher: codeEditorFieldMatcher,
|
|
27
|
+
* priority: 100
|
|
28
|
+
* });
|
|
25
29
|
* ```
|
|
26
30
|
*/
|
|
27
31
|
import type { Component } from 'svelte';
|
|
@@ -112,78 +116,6 @@ declare class FieldComponentRegistry extends BaseRegistry<string, FieldComponent
|
|
|
112
116
|
}
|
|
113
117
|
/** Singleton instance of the field component registry */
|
|
114
118
|
export declare const fieldComponentRegistry: FieldComponentRegistry;
|
|
115
|
-
/**
|
|
116
|
-
* Register a field component for a specific field type.
|
|
117
|
-
*
|
|
118
|
-
* @deprecated Use `fieldComponentRegistry.register()` instead.
|
|
119
|
-
*
|
|
120
|
-
* @param type - Unique identifier for this field type
|
|
121
|
-
* @param component - Svelte component to render for matching fields
|
|
122
|
-
* @param matcher - Function to determine if a schema matches this type
|
|
123
|
-
* @param priority - Priority for matching (default: 0, higher = checked first)
|
|
124
|
-
*
|
|
125
|
-
* @example
|
|
126
|
-
* ```typescript
|
|
127
|
-
* registerFieldComponent(
|
|
128
|
-
* "code-editor",
|
|
129
|
-
* FormCodeEditor,
|
|
130
|
-
* (schema) => schema.format === "json" || schema.format === "code",
|
|
131
|
-
* 100 // High priority to override default
|
|
132
|
-
* );
|
|
133
|
-
* ```
|
|
134
|
-
*/
|
|
135
|
-
export declare function registerFieldComponent(type: string, component: FieldComponent, matcher: FieldMatcher, priority?: number): void;
|
|
136
|
-
/**
|
|
137
|
-
* Unregister a field component.
|
|
138
|
-
*
|
|
139
|
-
* @deprecated Use `fieldComponentRegistry.unregister()` instead.
|
|
140
|
-
*
|
|
141
|
-
* @param type - The field type to unregister
|
|
142
|
-
* @returns true if the component was registered and removed
|
|
143
|
-
*/
|
|
144
|
-
export declare function unregisterFieldComponent(type: string): boolean;
|
|
145
|
-
/**
|
|
146
|
-
* Get all registered field types.
|
|
147
|
-
*
|
|
148
|
-
* @deprecated Use `fieldComponentRegistry.getKeys()` instead.
|
|
149
|
-
*
|
|
150
|
-
* @returns Array of registered field type identifiers
|
|
151
|
-
*/
|
|
152
|
-
export declare function getRegisteredFieldTypes(): string[];
|
|
153
|
-
/**
|
|
154
|
-
* Check if a field type is registered.
|
|
155
|
-
*
|
|
156
|
-
* @deprecated Use `fieldComponentRegistry.has()` instead.
|
|
157
|
-
*
|
|
158
|
-
* @param type - Field type to check
|
|
159
|
-
* @returns true if the type is registered
|
|
160
|
-
*/
|
|
161
|
-
export declare function isFieldTypeRegistered(type: string): boolean;
|
|
162
|
-
/**
|
|
163
|
-
* Resolve which component should render a given field schema.
|
|
164
|
-
* Checks registered matchers in priority order.
|
|
165
|
-
*
|
|
166
|
-
* @deprecated Use `fieldComponentRegistry.resolveFieldComponent()` instead.
|
|
167
|
-
*
|
|
168
|
-
* @param schema - The field schema to resolve
|
|
169
|
-
* @returns The matching registration or null if no match
|
|
170
|
-
*/
|
|
171
|
-
export declare function resolveFieldComponent(schema: FieldSchema): FieldComponentRegistration | null;
|
|
172
|
-
/**
|
|
173
|
-
* Clear all registered field components.
|
|
174
|
-
* Useful for testing or reset scenarios.
|
|
175
|
-
*
|
|
176
|
-
* @deprecated Use `fieldComponentRegistry.clear()` instead.
|
|
177
|
-
*/
|
|
178
|
-
export declare function clearFieldRegistry(): void;
|
|
179
|
-
/**
|
|
180
|
-
* Get the registry size.
|
|
181
|
-
*
|
|
182
|
-
* @deprecated Use `fieldComponentRegistry.size` instead.
|
|
183
|
-
*
|
|
184
|
-
* @returns Number of registered field components
|
|
185
|
-
*/
|
|
186
|
-
export declare function getFieldRegistrySize(): number;
|
|
187
119
|
/**
|
|
188
120
|
* Matcher for hidden fields (should not render)
|
|
189
121
|
*/
|
|
@@ -217,18 +149,12 @@ export declare const numberFieldMatcher: FieldMatcher;
|
|
|
217
149
|
*/
|
|
218
150
|
export declare const toggleMatcher: FieldMatcher;
|
|
219
151
|
/**
|
|
220
|
-
* Matcher for select fields with labeled options
|
|
221
|
-
* Supports both standard JSON Schema oneOf pattern and legacy options property
|
|
152
|
+
* Matcher for select fields with labeled options (JSON Schema oneOf pattern)
|
|
222
153
|
*
|
|
223
|
-
*
|
|
154
|
+
* @example
|
|
224
155
|
* ```json
|
|
225
156
|
* { "type": "string", "oneOf": [{ "const": "a", "title": "Option A" }] }
|
|
226
157
|
* ```
|
|
227
|
-
*
|
|
228
|
-
* Legacy approach (deprecated):
|
|
229
|
-
* ```json
|
|
230
|
-
* { "type": "string", "options": [{ "value": "a", "label": "Option A" }] }
|
|
231
|
-
* ```
|
|
232
158
|
*/
|
|
233
159
|
export declare const selectOptionsMatcher: FieldMatcher;
|
|
234
160
|
/**
|
|
@@ -18,10 +18,14 @@
|
|
|
18
18
|
*
|
|
19
19
|
* @example Adding code editor support:
|
|
20
20
|
* ```typescript
|
|
21
|
-
* import {
|
|
21
|
+
* import { fieldComponentRegistry } from "@d34dman/flowdrop/form";
|
|
22
22
|
* import { FormCodeEditor, codeEditorFieldMatcher } from "@d34dman/flowdrop/form/code";
|
|
23
23
|
*
|
|
24
|
-
*
|
|
24
|
+
* fieldComponentRegistry.register("code-editor", {
|
|
25
|
+
* component: FormCodeEditor,
|
|
26
|
+
* matcher: codeEditorFieldMatcher,
|
|
27
|
+
* priority: 100
|
|
28
|
+
* });
|
|
25
29
|
* ```
|
|
26
30
|
*/
|
|
27
31
|
import { BaseRegistry } from '../registry/BaseRegistry.js';
|
|
@@ -93,96 +97,6 @@ class FieldComponentRegistry extends BaseRegistry {
|
|
|
93
97
|
/** Singleton instance of the field component registry */
|
|
94
98
|
export const fieldComponentRegistry = new FieldComponentRegistry();
|
|
95
99
|
// ============================================================================
|
|
96
|
-
// Backward-compatible function exports
|
|
97
|
-
// These delegate to the singleton and preserve the existing public API.
|
|
98
|
-
// ============================================================================
|
|
99
|
-
/**
|
|
100
|
-
* Register a field component for a specific field type.
|
|
101
|
-
*
|
|
102
|
-
* @deprecated Use `fieldComponentRegistry.register()` instead.
|
|
103
|
-
*
|
|
104
|
-
* @param type - Unique identifier for this field type
|
|
105
|
-
* @param component - Svelte component to render for matching fields
|
|
106
|
-
* @param matcher - Function to determine if a schema matches this type
|
|
107
|
-
* @param priority - Priority for matching (default: 0, higher = checked first)
|
|
108
|
-
*
|
|
109
|
-
* @example
|
|
110
|
-
* ```typescript
|
|
111
|
-
* registerFieldComponent(
|
|
112
|
-
* "code-editor",
|
|
113
|
-
* FormCodeEditor,
|
|
114
|
-
* (schema) => schema.format === "json" || schema.format === "code",
|
|
115
|
-
* 100 // High priority to override default
|
|
116
|
-
* );
|
|
117
|
-
* ```
|
|
118
|
-
*/
|
|
119
|
-
export function registerFieldComponent(type, component, matcher, priority = 0) {
|
|
120
|
-
fieldComponentRegistry.register(type, { component, matcher, priority });
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Unregister a field component.
|
|
124
|
-
*
|
|
125
|
-
* @deprecated Use `fieldComponentRegistry.unregister()` instead.
|
|
126
|
-
*
|
|
127
|
-
* @param type - The field type to unregister
|
|
128
|
-
* @returns true if the component was registered and removed
|
|
129
|
-
*/
|
|
130
|
-
export function unregisterFieldComponent(type) {
|
|
131
|
-
return fieldComponentRegistry.unregister(type);
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Get all registered field types.
|
|
135
|
-
*
|
|
136
|
-
* @deprecated Use `fieldComponentRegistry.getKeys()` instead.
|
|
137
|
-
*
|
|
138
|
-
* @returns Array of registered field type identifiers
|
|
139
|
-
*/
|
|
140
|
-
export function getRegisteredFieldTypes() {
|
|
141
|
-
return fieldComponentRegistry.getKeys();
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Check if a field type is registered.
|
|
145
|
-
*
|
|
146
|
-
* @deprecated Use `fieldComponentRegistry.has()` instead.
|
|
147
|
-
*
|
|
148
|
-
* @param type - Field type to check
|
|
149
|
-
* @returns true if the type is registered
|
|
150
|
-
*/
|
|
151
|
-
export function isFieldTypeRegistered(type) {
|
|
152
|
-
return fieldComponentRegistry.has(type);
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Resolve which component should render a given field schema.
|
|
156
|
-
* Checks registered matchers in priority order.
|
|
157
|
-
*
|
|
158
|
-
* @deprecated Use `fieldComponentRegistry.resolveFieldComponent()` instead.
|
|
159
|
-
*
|
|
160
|
-
* @param schema - The field schema to resolve
|
|
161
|
-
* @returns The matching registration or null if no match
|
|
162
|
-
*/
|
|
163
|
-
export function resolveFieldComponent(schema) {
|
|
164
|
-
return fieldComponentRegistry.resolveFieldComponent(schema);
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* Clear all registered field components.
|
|
168
|
-
* Useful for testing or reset scenarios.
|
|
169
|
-
*
|
|
170
|
-
* @deprecated Use `fieldComponentRegistry.clear()` instead.
|
|
171
|
-
*/
|
|
172
|
-
export function clearFieldRegistry() {
|
|
173
|
-
fieldComponentRegistry.clear();
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* Get the registry size.
|
|
177
|
-
*
|
|
178
|
-
* @deprecated Use `fieldComponentRegistry.size` instead.
|
|
179
|
-
*
|
|
180
|
-
* @returns Number of registered field components
|
|
181
|
-
*/
|
|
182
|
-
export function getFieldRegistrySize() {
|
|
183
|
-
return fieldComponentRegistry.size;
|
|
184
|
-
}
|
|
185
|
-
// ============================================================================
|
|
186
100
|
// Built-in Field Matchers (for light fields)
|
|
187
101
|
// These are always available and used by the base FormField component
|
|
188
102
|
// ============================================================================
|
|
@@ -219,20 +133,14 @@ export const numberFieldMatcher = (schema) => (schema.type === 'number' || schem
|
|
|
219
133
|
*/
|
|
220
134
|
export const toggleMatcher = (schema) => schema.type === 'boolean';
|
|
221
135
|
/**
|
|
222
|
-
* Matcher for select fields with labeled options
|
|
223
|
-
* Supports both standard JSON Schema oneOf pattern and legacy options property
|
|
136
|
+
* Matcher for select fields with labeled options (JSON Schema oneOf pattern)
|
|
224
137
|
*
|
|
225
|
-
*
|
|
138
|
+
* @example
|
|
226
139
|
* ```json
|
|
227
140
|
* { "type": "string", "oneOf": [{ "const": "a", "title": "Option A" }] }
|
|
228
141
|
* ```
|
|
229
|
-
*
|
|
230
|
-
* Legacy approach (deprecated):
|
|
231
|
-
* ```json
|
|
232
|
-
* { "type": "string", "options": [{ "value": "a", "label": "Option A" }] }
|
|
233
|
-
* ```
|
|
234
142
|
*/
|
|
235
|
-
export const selectOptionsMatcher = (schema) => Boolean(schema.oneOf && schema.oneOf.length > 0)
|
|
143
|
+
export const selectOptionsMatcher = (schema) => Boolean(schema.oneOf && schema.oneOf.length > 0);
|
|
236
144
|
/**
|
|
237
145
|
* Matcher for array fields
|
|
238
146
|
*/
|
package/dist/form/full.d.ts
CHANGED
|
@@ -20,7 +20,10 @@
|
|
|
20
20
|
* // Now all field types are available
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
23
|
-
export
|
|
23
|
+
export { SchemaForm, FormField, FormFieldFull, FormFieldWrapper, FormTextField, FormTextarea, FormNumberField, FormRangeField, FormToggle, FormSelect, FormCheckboxGroup, FormArray, FormFieldset, FormUISchemaRenderer } from './index.js';
|
|
24
|
+
export type { FieldSchema, FieldType, FieldFormat, FieldOption, OneOfItem, SchemaFormProps, BaseFieldProps, TextFieldProps, TextareaFieldProps, NumberFieldProps, ToggleFieldProps, RangeFieldProps, SelectFieldProps, CheckboxGroupFieldProps, ArrayFieldProps, FormFieldFactoryProps, FormFieldWrapperProps, FieldComponentProps, FieldMatcher, FieldMatcherRegistration, FieldComponent, FieldComponentRegistration } from './index.js';
|
|
25
|
+
export { isFieldOptionArray, isOneOfArray, normalizeOptions, oneOfToOptions, getSchemaOptions } from './index.js';
|
|
26
|
+
export { fieldComponentRegistry, hiddenFieldMatcher, checkboxGroupMatcher, enumSelectMatcher, textareaMatcher, rangeMatcher, textFieldMatcher, numberFieldMatcher, toggleMatcher, selectOptionsMatcher, arrayMatcher } from './index.js';
|
|
24
27
|
export { FormCodeEditor, FormTemplateEditor } from './code.js';
|
|
25
28
|
export { FormMarkdownEditor } from './markdown.js';
|
|
26
29
|
export { registerCodeEditorField, registerTemplateEditorField, registerAllCodeEditors, isCodeEditorRegistered, isTemplateEditorRegistered, codeEditorFieldMatcher, templateEditorFieldMatcher } from './code.js';
|
package/dist/form/full.js
CHANGED
|
@@ -21,7 +21,12 @@
|
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
23
23
|
// Re-export everything from the light form module
|
|
24
|
-
|
|
24
|
+
// Components
|
|
25
|
+
export { SchemaForm, FormField, FormFieldFull, FormFieldWrapper, FormTextField, FormTextarea, FormNumberField, FormRangeField, FormToggle, FormSelect, FormCheckboxGroup, FormArray, FormFieldset, FormUISchemaRenderer } from './index.js';
|
|
26
|
+
// Utility functions
|
|
27
|
+
export { isFieldOptionArray, isOneOfArray, normalizeOptions, oneOfToOptions, getSchemaOptions } from './index.js';
|
|
28
|
+
// Field Registry
|
|
29
|
+
export { fieldComponentRegistry, hiddenFieldMatcher, checkboxGroupMatcher, enumSelectMatcher, textareaMatcher, rangeMatcher, textFieldMatcher, numberFieldMatcher, toggleMatcher, selectOptionsMatcher, arrayMatcher } from './index.js';
|
|
25
30
|
// Import registration functions
|
|
26
31
|
import { registerCodeEditorField, registerTemplateEditorField } from './code.js';
|
|
27
32
|
import { registerMarkdownEditorField } from './markdown.js';
|
package/dist/form/index.d.ts
CHANGED
|
@@ -73,5 +73,5 @@ export { default as FormFieldset } from '../components/form/FormFieldset.svelte'
|
|
|
73
73
|
export { default as FormUISchemaRenderer } from '../components/form/FormUISchemaRenderer.svelte';
|
|
74
74
|
export type { FieldSchema, FieldType, FieldFormat, FieldOption, OneOfItem, SchemaFormProps, BaseFieldProps, TextFieldProps, TextareaFieldProps, NumberFieldProps, ToggleFieldProps, RangeFieldProps, SelectFieldProps, CheckboxGroupFieldProps, ArrayFieldProps, FormFieldFactoryProps, FormFieldWrapperProps } from '../components/form/types.js';
|
|
75
75
|
export { isFieldOptionArray, isOneOfArray, normalizeOptions, oneOfToOptions, getSchemaOptions } from '../components/form/types.js';
|
|
76
|
-
export { fieldComponentRegistry,
|
|
76
|
+
export { fieldComponentRegistry, hiddenFieldMatcher, checkboxGroupMatcher, enumSelectMatcher, textareaMatcher, rangeMatcher, textFieldMatcher, numberFieldMatcher, toggleMatcher, selectOptionsMatcher, arrayMatcher } from './fieldRegistry.js';
|
|
77
77
|
export type { FieldComponentProps, FieldMatcher, FieldMatcherRegistration, FieldComponent, FieldComponentRegistration } from './fieldRegistry.js';
|
package/dist/form/index.js
CHANGED
|
@@ -87,7 +87,5 @@ export { isFieldOptionArray, isOneOfArray, normalizeOptions, oneOfToOptions, get
|
|
|
87
87
|
export {
|
|
88
88
|
// Registry singleton
|
|
89
89
|
fieldComponentRegistry,
|
|
90
|
-
// Backward-compatible function wrappers
|
|
91
|
-
registerFieldComponent, unregisterFieldComponent, resolveFieldComponent, getRegisteredFieldTypes, isFieldTypeRegistered, clearFieldRegistry, getFieldRegistrySize,
|
|
92
90
|
// Built-in matchers for custom components
|
|
93
91
|
hiddenFieldMatcher, checkboxGroupMatcher, enumSelectMatcher, textareaMatcher, rangeMatcher, textFieldMatcher, numberFieldMatcher, toggleMatcher, selectOptionsMatcher, arrayMatcher } from './fieldRegistry.js';
|
package/dist/form/markdown.js
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
* };
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
|
-
import {
|
|
26
|
+
import { fieldComponentRegistry } from './fieldRegistry.js';
|
|
27
27
|
// Re-export the component for direct usage if needed
|
|
28
28
|
export { default as FormMarkdownEditor } from '../components/form/FormMarkdownEditor.svelte';
|
|
29
29
|
/**
|
|
@@ -63,7 +63,11 @@ export function registerMarkdownEditorField(priority = 100) {
|
|
|
63
63
|
}
|
|
64
64
|
// Dynamic import to ensure proper code splitting
|
|
65
65
|
import('../components/form/FormMarkdownEditor.svelte').then((module) => {
|
|
66
|
-
|
|
66
|
+
fieldComponentRegistry.register('markdown-editor', {
|
|
67
|
+
component: module.default,
|
|
68
|
+
matcher: markdownEditorFieldMatcher,
|
|
69
|
+
priority
|
|
70
|
+
});
|
|
67
71
|
markdownEditorRegistered = true;
|
|
68
72
|
});
|
|
69
73
|
}
|
|
@@ -84,7 +88,11 @@ export function registerMarkdownEditorFieldWithComponent(component, priority = 1
|
|
|
84
88
|
if (markdownEditorRegistered) {
|
|
85
89
|
return;
|
|
86
90
|
}
|
|
87
|
-
|
|
91
|
+
fieldComponentRegistry.register('markdown-editor', {
|
|
92
|
+
component,
|
|
93
|
+
matcher: markdownEditorFieldMatcher,
|
|
94
|
+
priority
|
|
95
|
+
});
|
|
88
96
|
markdownEditorRegistered = true;
|
|
89
97
|
}
|
|
90
98
|
/**
|
|
@@ -24,9 +24,6 @@ export type EdgeCategory = 'trigger' | 'tool' | 'loopback' | 'data';
|
|
|
24
24
|
export declare class EdgeStylingHelper {
|
|
25
25
|
/**
|
|
26
26
|
* Extract the port ID from a handle ID
|
|
27
|
-
* Supports two formats:
|
|
28
|
-
* 1. Standard format: "${nodeId}-output-${portId}" or "${nodeId}-input-${portId}"
|
|
29
|
-
* 2. Short format: just the portId (e.g., "text", "trigger")
|
|
30
27
|
* @param handleId - The handle ID string (e.g., "sample-node.1-output-trigger" or "trigger")
|
|
31
28
|
* @returns The port ID (e.g., "trigger") or the handleId itself for short format
|
|
32
29
|
*/
|
|
@@ -11,6 +11,8 @@ import { nodeExecutionService } from '../services/nodeExecutionService.js';
|
|
|
11
11
|
import { WorkflowAdapter } from '../adapters/WorkflowAdapter.js';
|
|
12
12
|
import { AgentSpecAdapter } from '../adapters/agentspec/AgentSpecAdapter.js';
|
|
13
13
|
import { validateForAgentSpecExport } from '../adapters/agentspec/validator.js';
|
|
14
|
+
import { extractPortId } from '../utils/handleIds.js';
|
|
15
|
+
import { EDGE_MARKER_SIZES } from '../config/constants.js';
|
|
14
16
|
import { logger } from '../utils/logger.js';
|
|
15
17
|
/**
|
|
16
18
|
* Generate a unique node ID based on node type and existing nodes
|
|
@@ -39,28 +41,11 @@ export function generateNodeId(nodeTypeId, existingNodes) {
|
|
|
39
41
|
export class EdgeStylingHelper {
|
|
40
42
|
/**
|
|
41
43
|
* Extract the port ID from a handle ID
|
|
42
|
-
* Supports two formats:
|
|
43
|
-
* 1. Standard format: "${nodeId}-output-${portId}" or "${nodeId}-input-${portId}"
|
|
44
|
-
* 2. Short format: just the portId (e.g., "text", "trigger")
|
|
45
44
|
* @param handleId - The handle ID string (e.g., "sample-node.1-output-trigger" or "trigger")
|
|
46
45
|
* @returns The port ID (e.g., "trigger") or the handleId itself for short format
|
|
47
46
|
*/
|
|
48
47
|
static extractPortIdFromHandle(handleId) {
|
|
49
|
-
|
|
50
|
-
return null;
|
|
51
|
-
}
|
|
52
|
-
// Try standard format: "${nodeId}-output-${portId}" or "${nodeId}-input-${portId}"
|
|
53
|
-
// We need to find the last occurrence of "-output-" or "-input-" and get what follows
|
|
54
|
-
const outputMatch = handleId.lastIndexOf('-output-');
|
|
55
|
-
const inputMatch = handleId.lastIndexOf('-input-');
|
|
56
|
-
if (outputMatch !== -1) {
|
|
57
|
-
return handleId.substring(outputMatch + '-output-'.length);
|
|
58
|
-
}
|
|
59
|
-
if (inputMatch !== -1) {
|
|
60
|
-
return handleId.substring(inputMatch + '-input-'.length);
|
|
61
|
-
}
|
|
62
|
-
// Short format: the handleId IS the port ID
|
|
63
|
-
return handleId;
|
|
48
|
+
return extractPortId(handleId);
|
|
64
49
|
}
|
|
65
50
|
/**
|
|
66
51
|
* Check if a port ID matches a dynamic branch in a Gateway node
|
|
@@ -166,27 +151,8 @@ export class EdgeStylingHelper {
|
|
|
166
151
|
: null;
|
|
167
152
|
// Determine edge category (loopback takes precedence)
|
|
168
153
|
const edgeCategory = this.getEdgeCategoryWithLoopback(edge, sourcePortDataType);
|
|
169
|
-
// Detect current theme for marker colors
|
|
170
|
-
// Marker colors are baked in at creation time, so we check the theme here
|
|
171
|
-
const isDarkMode = typeof document !== 'undefined' &&
|
|
172
|
-
document.documentElement.getAttribute('data-theme') === 'dark';
|
|
173
|
-
// Edge color constants for marker arrows - matched to CSS token values
|
|
174
|
-
// These match the --fd-edge-* tokens in tokens.css for consistency
|
|
175
|
-
const EDGE_COLORS = isDarkMode
|
|
176
|
-
? {
|
|
177
|
-
trigger: '#eaeaef', // --_gray-3 (light for dark mode visibility)
|
|
178
|
-
tool: '#fbbf24', // Brighter amber for dark mode
|
|
179
|
-
loopback: '#a3a3ad', // --_gray-5
|
|
180
|
-
data: '#a3a3ad' // --_gray-5
|
|
181
|
-
}
|
|
182
|
-
: {
|
|
183
|
-
trigger: '#18181c', // --_gray-9 (dark for light mode)
|
|
184
|
-
tool: '#f59e0b', // --_amber-2
|
|
185
|
-
loopback: '#71717b', // --_gray-6
|
|
186
|
-
data: '#a3a3ad' // --_gray-5
|
|
187
|
-
};
|
|
188
154
|
// Apply styling based on edge category
|
|
189
|
-
// CSS
|
|
155
|
+
// Marker colors use CSS custom properties so they respond to theme changes automatically
|
|
190
156
|
switch (edgeCategory) {
|
|
191
157
|
case 'loopback':
|
|
192
158
|
// Loopback edges: dashed gray line for loop iteration
|
|
@@ -195,9 +161,8 @@ export class EdgeStylingHelper {
|
|
|
195
161
|
edge.class = 'flowdrop--edge--loopback';
|
|
196
162
|
edge.markerEnd = {
|
|
197
163
|
type: MarkerType.ArrowClosed,
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
color: EDGE_COLORS.loopback
|
|
164
|
+
...EDGE_MARKER_SIZES.loopback,
|
|
165
|
+
color: 'var(--fd-edge-loopback)'
|
|
201
166
|
};
|
|
202
167
|
break;
|
|
203
168
|
case 'trigger':
|
|
@@ -206,9 +171,8 @@ export class EdgeStylingHelper {
|
|
|
206
171
|
edge.class = 'flowdrop--edge--trigger';
|
|
207
172
|
edge.markerEnd = {
|
|
208
173
|
type: MarkerType.ArrowClosed,
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
color: EDGE_COLORS.trigger
|
|
174
|
+
...EDGE_MARKER_SIZES.trigger,
|
|
175
|
+
color: 'var(--fd-edge-trigger)'
|
|
212
176
|
};
|
|
213
177
|
break;
|
|
214
178
|
case 'tool':
|
|
@@ -217,9 +181,8 @@ export class EdgeStylingHelper {
|
|
|
217
181
|
edge.class = 'flowdrop--edge--tool';
|
|
218
182
|
edge.markerEnd = {
|
|
219
183
|
type: MarkerType.ArrowClosed,
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
color: EDGE_COLORS.tool
|
|
184
|
+
...EDGE_MARKER_SIZES.tool,
|
|
185
|
+
color: 'var(--fd-edge-tool)'
|
|
223
186
|
};
|
|
224
187
|
break;
|
|
225
188
|
case 'data':
|
|
@@ -229,9 +192,8 @@ export class EdgeStylingHelper {
|
|
|
229
192
|
edge.class = 'flowdrop--edge--data';
|
|
230
193
|
edge.markerEnd = {
|
|
231
194
|
type: MarkerType.ArrowClosed,
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
color: EDGE_COLORS.data
|
|
195
|
+
...EDGE_MARKER_SIZES.data,
|
|
196
|
+
color: 'var(--fd-edge-data)'
|
|
235
197
|
};
|
|
236
198
|
break;
|
|
237
199
|
}
|
package/dist/index.js
CHANGED
|
@@ -32,6 +32,9 @@
|
|
|
32
32
|
// ============================================================================
|
|
33
33
|
// IMPORTANT: This module re-exports from sub-modules for backward compatibility.
|
|
34
34
|
// New code should import directly from sub-modules for better tree-shaking.
|
|
35
|
+
//
|
|
36
|
+
// The wildcard re-exports below are intentional: each sub-module barrel uses
|
|
37
|
+
// explicit named exports, so the public API surface is fully controlled there.
|
|
35
38
|
// ============================================================================
|
|
36
39
|
// ============================================================================
|
|
37
40
|
// Core Exports (Types & Utilities - No Heavy Dependencies)
|