@flowdrop/flowdrop 2.7.0 → 2.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +71 -1
- package/dist/api/enhanced-client.d.ts +29 -1
- package/dist/api/enhanced-client.js +83 -9
- package/dist/chat/index.d.ts +5 -1
- package/dist/chat/index.js +2 -0
- package/dist/chat/toolCatalogue.d.ts +27 -0
- package/dist/chat/toolCatalogue.js +35 -0
- package/dist/chat/turnDriver.d.ts +143 -0
- package/dist/chat/turnDriver.js +124 -0
- package/dist/components/App.svelte +47 -56
- package/dist/components/SettingsPanel.svelte +13 -0
- package/dist/components/WorkflowEditor.svelte +4 -2
- package/dist/components/WorkflowEditor.svelte.d.ts +2 -0
- package/dist/components/chat/AIChatPanel.svelte +410 -22
- package/dist/components/form/FieldFactory.svelte +478 -0
- package/dist/components/form/FieldFactory.svelte.d.ts +14 -0
- package/dist/components/form/FormField.svelte +19 -404
- package/dist/components/form/FormField.svelte.d.ts +2 -27
- package/dist/components/form/FormFieldLight.svelte +11 -424
- package/dist/components/form/FormFieldLight.svelte.d.ts +2 -28
- package/dist/components/form/FormMarkdownEditor.svelte +11 -4
- package/dist/components/form/FormTemplateEditor.svelte +12 -5
- package/dist/components/form/resolveFieldType.d.ts +18 -15
- package/dist/components/form/resolveFieldType.js +33 -12
- package/dist/components/form/types.d.ts +14 -2
- package/dist/components/toast/DismissibleToast.svelte +53 -0
- package/dist/components/toast/DismissibleToast.svelte.d.ts +24 -0
- package/dist/components/toast/WarningIcon.svelte +28 -0
- package/dist/components/toast/WarningIcon.svelte.d.ts +26 -0
- package/dist/config/constants.d.ts +7 -3
- package/dist/config/constants.js +7 -3
- package/dist/config/endpoints.d.ts +7 -0
- package/dist/config/endpoints.js +2 -1
- package/dist/editor/index.d.ts +1 -1
- package/dist/editor/index.js +1 -1
- package/dist/messages/defaults.d.ts +41 -0
- package/dist/messages/defaults.js +20 -0
- package/dist/services/chatService.d.ts +21 -3
- package/dist/services/chatService.js +33 -1
- package/dist/services/globalSave.js +3 -1
- package/dist/services/toastService.d.ts +23 -2
- package/dist/services/toastService.js +72 -28
- package/dist/stores/instanceContainer.svelte.d.ts +34 -0
- package/dist/stores/instanceContainer.svelte.js +30 -0
- package/dist/styles/toast.css +62 -0
- package/dist/svelte-app.d.ts +12 -2
- package/dist/svelte-app.js +29 -12
- package/dist/types/chat.d.ts +59 -0
- package/dist/types/events.d.ts +23 -0
- package/dist/types/events.js +3 -1
- package/dist/types/settings.d.ts +18 -1
- package/dist/types/settings.js +1 -0
- package/dist/webmcp/WebMCPConfirm.svelte +129 -68
- package/dist/webmcp/WebMCPConfirm.svelte.d.ts +2 -2
- package/dist/webmcp/descriptors.d.ts +7 -0
- package/dist/webmcp/descriptors.js +51 -0
- package/dist/webmcp/gate.d.ts +13 -7
- package/dist/webmcp/gate.js +8 -53
- package/dist/webmcp/index.d.ts +5 -2
- package/dist/webmcp/index.js +3 -1
- package/dist/webmcp/register.d.ts +11 -10
- package/dist/webmcp/register.js +59 -384
- package/dist/webmcp/runtime.d.ts +33 -0
- package/dist/webmcp/runtime.js +500 -0
- package/dist/webmcp/types.d.ts +92 -0
- package/package.json +1 -1
|
@@ -1,416 +1,31 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
FormField Component
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
-
|
|
11
|
-
|
|
12
|
-
Type Resolution Order:
|
|
13
|
-
1. format: 'hidden' -> skip rendering (return nothing)
|
|
14
|
-
2. format: 'autocomplete' with autocomplete.url -> FormAutocomplete
|
|
15
|
-
3. format: 'json' or 'code' -> FormCodeEditor (CodeMirror JSON editor)
|
|
16
|
-
4. format: 'markdown' -> FormMarkdownEditor (SimpleMDE Markdown editor)
|
|
17
|
-
5. format: 'template' -> FormTemplateEditor (CodeMirror with Twig/Liquid syntax)
|
|
18
|
-
6. enum with multiple: true -> FormCheckboxGroup
|
|
19
|
-
7. enum -> FormSelect (simple values without labels)
|
|
20
|
-
8. oneOf with const/title (labeled options) -> FormSelect
|
|
21
|
-
9. format: 'multiline' -> FormTextarea
|
|
22
|
-
10. format: 'range' (number/integer) -> FormRangeField
|
|
23
|
-
11. type: 'string' -> FormTextField
|
|
24
|
-
12. type: 'number' or 'integer' -> FormNumberField
|
|
25
|
-
13. type: 'boolean' -> FormToggle
|
|
26
|
-
14. type: 'object' (without format) -> FormCodeEditor (for JSON objects)
|
|
27
|
-
15. fallback -> FormTextField
|
|
2
|
+
FormField Component (exported as `FormFieldFull` from "@flowdrop/flowdrop/form/full")
|
|
3
|
+
|
|
4
|
+
The field factory with every heavy editor statically bundled, so code,
|
|
5
|
+
markdown and template fields work without registering anything. All field
|
|
6
|
+
resolution lives in FieldFactory; this file only hands it the editors. A component
|
|
7
|
+
registered on the instance's field registry still wins over these.
|
|
8
|
+
|
|
9
|
+
It used to be a second, parallel factory. The two drifted: the light one lost
|
|
10
|
+
the built-in autocomplete and readOnly handling, and since the config panel
|
|
11
|
+
renders the light one, those bugs were the ones users saw.
|
|
28
12
|
-->
|
|
29
13
|
|
|
30
14
|
<script lang="ts">
|
|
31
|
-
import
|
|
32
|
-
import FormTextField from './FormTextField.svelte';
|
|
33
|
-
import FormTextarea from './FormTextarea.svelte';
|
|
34
|
-
import FormNumberField from './FormNumberField.svelte';
|
|
35
|
-
import FormRangeField from './FormRangeField.svelte';
|
|
36
|
-
import FormToggle from './FormToggle.svelte';
|
|
37
|
-
import FormSelect from './FormSelect.svelte';
|
|
38
|
-
import FormCheckboxGroup from './FormCheckboxGroup.svelte';
|
|
39
|
-
import FormArray from './FormArray.svelte';
|
|
40
|
-
import FormPorts from './FormPorts.svelte';
|
|
15
|
+
import FieldFactory from './FieldFactory.svelte';
|
|
41
16
|
import FormCodeEditor from './FormCodeEditor.svelte';
|
|
42
17
|
import FormMarkdownEditor from './FormMarkdownEditor.svelte';
|
|
43
18
|
import FormTemplateEditor from './FormTemplateEditor.svelte';
|
|
44
|
-
import FormAutocomplete from './FormAutocomplete.svelte';
|
|
45
|
-
import type { FieldSchema } from './types.js';
|
|
46
|
-
import { getSchemaOptions } from './types.js';
|
|
47
|
-
import { resolveBaseFieldType } from './resolveFieldType.js';
|
|
48
|
-
import type { WorkflowNode, WorkflowEdge, AuthProvider } from '../../types/index.js';
|
|
49
|
-
import { getResolvedTheme } from '../../stores/settingsStore.svelte.js';
|
|
50
|
-
import { getInstance } from '../../stores/getInstance.svelte.js';
|
|
51
|
-
|
|
52
|
-
const fd = getInstance();
|
|
53
|
-
|
|
54
|
-
interface Props {
|
|
55
|
-
/** Unique key/id for the field */
|
|
56
|
-
fieldKey: string;
|
|
57
|
-
/** Field schema definition */
|
|
58
|
-
schema: FieldSchema;
|
|
59
|
-
/** Current field value */
|
|
60
|
-
value: unknown;
|
|
61
|
-
/** Whether the field is required */
|
|
62
|
-
required?: boolean;
|
|
63
|
-
/** Animation delay index for staggered animations */
|
|
64
|
-
animationIndex?: number;
|
|
65
|
-
/** Callback when the field value changes */
|
|
66
|
-
onChange: (value: unknown) => void;
|
|
67
|
-
/** Current workflow node (optional, used for template variable API mode) */
|
|
68
|
-
node?: WorkflowNode;
|
|
69
|
-
/** All workflow nodes (optional, used for port-derived variables) */
|
|
70
|
-
nodes?: WorkflowNode[];
|
|
71
|
-
/** All workflow edges (optional, used for port-derived variables) */
|
|
72
|
-
edges?: WorkflowEdge[];
|
|
73
|
-
/** Workflow ID (optional, used for template variable API mode) */
|
|
74
|
-
workflowId?: string;
|
|
75
|
-
/** Auth provider (optional, used for API requests) */
|
|
76
|
-
authProvider?: AuthProvider;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
let {
|
|
80
|
-
fieldKey,
|
|
81
|
-
schema,
|
|
82
|
-
value,
|
|
83
|
-
required = false,
|
|
84
|
-
animationIndex = 0,
|
|
85
|
-
onChange,
|
|
86
|
-
node,
|
|
87
|
-
nodes,
|
|
88
|
-
edges,
|
|
89
|
-
workflowId,
|
|
90
|
-
authProvider
|
|
91
|
-
}: Props = $props();
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* When schema.readOnly is true, disable all inputs (no editing).
|
|
95
|
-
*/
|
|
96
|
-
const isReadOnly = $derived(schema.readOnly === true);
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Computed description ID for ARIA association
|
|
100
|
-
*/
|
|
101
|
-
const descriptionId = $derived(
|
|
102
|
-
schema.description && schema.title ? `${fieldKey}-description` : undefined
|
|
103
|
-
);
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Animation delay based on index
|
|
107
|
-
*/
|
|
108
|
-
const animationDelay = $derived(animationIndex * 30);
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Field label - prefer title, fall back to description, then key
|
|
112
|
-
*/
|
|
113
|
-
const fieldLabel = $derived(String(schema.title ?? schema.description ?? fieldKey));
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Determine the field type to render
|
|
117
|
-
*/
|
|
118
|
-
const fieldType = $derived.by(() => {
|
|
119
|
-
// Hidden fields should not be rendered
|
|
120
|
-
if (schema.format === 'hidden') {
|
|
121
|
-
return 'hidden';
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// Autocomplete field for format: "autocomplete" with autocomplete.url
|
|
125
|
-
if (schema.format === 'autocomplete' && schema.autocomplete?.url) {
|
|
126
|
-
return 'autocomplete';
|
|
127
|
-
}
|
|
128
19
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
20
|
+
const editors = {
|
|
21
|
+
'code-editor': FormCodeEditor,
|
|
22
|
+
'markdown-editor': FormMarkdownEditor,
|
|
23
|
+
'template-editor': FormTemplateEditor
|
|
24
|
+
};
|
|
133
25
|
|
|
134
|
-
|
|
135
|
-
if (schema.format === 'markdown') {
|
|
136
|
-
return 'markdown-editor';
|
|
137
|
-
}
|
|
26
|
+
import type { FormFieldFactoryProps } from './types.js';
|
|
138
27
|
|
|
139
|
-
|
|
140
|
-
if (schema.format === 'template') {
|
|
141
|
-
return 'template-editor';
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
// Injected port order + exposure widget (the `ports` reserved config prop).
|
|
145
|
-
if (schema.format === 'ports') {
|
|
146
|
-
return 'ports';
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
// Shared basic field resolution (enum/oneOf/primitive types).
|
|
150
|
-
const base = resolveBaseFieldType(schema);
|
|
151
|
-
if (base) {
|
|
152
|
-
return base;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
// Object type without specific format -> CodeMirror JSON editor
|
|
156
|
-
if (schema.type === 'object') {
|
|
157
|
-
return 'code-editor';
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
// Fallback to text
|
|
161
|
-
return 'text';
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* Get enum options as string array for select/checkbox components
|
|
166
|
-
*/
|
|
167
|
-
const enumOptions = $derived.by((): string[] => {
|
|
168
|
-
if (!schema.enum) return [];
|
|
169
|
-
return schema.enum.map((opt) => String(opt));
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* Get select options for select-options type
|
|
174
|
-
* Handles both oneOf (standard) and options (legacy) patterns
|
|
175
|
-
*/
|
|
176
|
-
const selectOptions = $derived(getSchemaOptions(schema));
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* Get current value as the appropriate type
|
|
180
|
-
*/
|
|
181
|
-
const stringValue = $derived(String(value ?? ''));
|
|
182
|
-
const numberValue = $derived(value as number | string);
|
|
183
|
-
const booleanValue = $derived(Boolean(value ?? schema.default ?? false));
|
|
184
|
-
const arrayValue = $derived.by((): string[] => {
|
|
185
|
-
if (Array.isArray(value)) {
|
|
186
|
-
return value.map((v) => String(v));
|
|
187
|
-
}
|
|
188
|
-
return [];
|
|
189
|
-
});
|
|
190
|
-
const arrayItems = $derived.by((): unknown[] => {
|
|
191
|
-
if (Array.isArray(value)) {
|
|
192
|
-
return value;
|
|
193
|
-
}
|
|
194
|
-
return [];
|
|
195
|
-
});
|
|
196
|
-
|
|
197
|
-
const registeredAutocompleteComponent = $derived(
|
|
198
|
-
fieldType === 'autocomplete' ? fd.fields.resolveFieldComponent(schema) : null
|
|
199
|
-
);
|
|
200
|
-
|
|
201
|
-
/**
|
|
202
|
-
* Get autocomplete value - can be string or string[] based on multiple setting
|
|
203
|
-
*/
|
|
204
|
-
const autocompleteValue = $derived.by((): string | string[] => {
|
|
205
|
-
if (schema.autocomplete?.multiple) {
|
|
206
|
-
if (Array.isArray(value)) {
|
|
207
|
-
return value.map((v) => String(v));
|
|
208
|
-
}
|
|
209
|
-
return value ? [String(value)] : [];
|
|
210
|
-
}
|
|
211
|
-
return String(value ?? '');
|
|
212
|
-
});
|
|
28
|
+
let props: FormFieldFactoryProps = $props();
|
|
213
29
|
</script>
|
|
214
30
|
|
|
215
|
-
{
|
|
216
|
-
<FormFieldWrapper
|
|
217
|
-
id={fieldKey}
|
|
218
|
-
label={fieldLabel}
|
|
219
|
-
{required}
|
|
220
|
-
description={schema.title ? schema.description : undefined}
|
|
221
|
-
{animationDelay}
|
|
222
|
-
>
|
|
223
|
-
{#if fieldType === 'checkbox-group'}
|
|
224
|
-
<FormCheckboxGroup
|
|
225
|
-
id={fieldKey}
|
|
226
|
-
value={arrayValue}
|
|
227
|
-
options={enumOptions}
|
|
228
|
-
ariaDescribedBy={descriptionId}
|
|
229
|
-
disabled={isReadOnly}
|
|
230
|
-
onChange={(val) => onChange(val)}
|
|
231
|
-
/>
|
|
232
|
-
{:else if fieldType === 'select-enum'}
|
|
233
|
-
<FormSelect
|
|
234
|
-
id={fieldKey}
|
|
235
|
-
value={stringValue}
|
|
236
|
-
options={enumOptions}
|
|
237
|
-
{required}
|
|
238
|
-
ariaDescribedBy={descriptionId}
|
|
239
|
-
disabled={isReadOnly}
|
|
240
|
-
onChange={(val) => onChange(val)}
|
|
241
|
-
/>
|
|
242
|
-
{:else if fieldType === 'textarea'}
|
|
243
|
-
<FormTextarea
|
|
244
|
-
id={fieldKey}
|
|
245
|
-
value={stringValue}
|
|
246
|
-
placeholder={schema.placeholder ?? ''}
|
|
247
|
-
{required}
|
|
248
|
-
ariaDescribedBy={descriptionId}
|
|
249
|
-
disabled={isReadOnly}
|
|
250
|
-
onChange={(val) => onChange(val)}
|
|
251
|
-
/>
|
|
252
|
-
{:else if fieldType === 'text'}
|
|
253
|
-
<FormTextField
|
|
254
|
-
id={fieldKey}
|
|
255
|
-
value={stringValue}
|
|
256
|
-
placeholder={schema.placeholder ?? ''}
|
|
257
|
-
{required}
|
|
258
|
-
ariaDescribedBy={descriptionId}
|
|
259
|
-
disabled={isReadOnly}
|
|
260
|
-
onChange={(val) => onChange(val)}
|
|
261
|
-
/>
|
|
262
|
-
{:else if fieldType === 'number'}
|
|
263
|
-
<FormNumberField
|
|
264
|
-
id={fieldKey}
|
|
265
|
-
value={numberValue}
|
|
266
|
-
placeholder={schema.placeholder ?? ''}
|
|
267
|
-
min={schema.minimum}
|
|
268
|
-
max={schema.maximum}
|
|
269
|
-
step={schema.step}
|
|
270
|
-
{required}
|
|
271
|
-
ariaDescribedBy={descriptionId}
|
|
272
|
-
disabled={isReadOnly}
|
|
273
|
-
onChange={(val) => onChange(val)}
|
|
274
|
-
/>
|
|
275
|
-
{:else if fieldType === 'range'}
|
|
276
|
-
<FormRangeField
|
|
277
|
-
id={fieldKey}
|
|
278
|
-
value={numberValue}
|
|
279
|
-
min={schema.minimum}
|
|
280
|
-
max={schema.maximum}
|
|
281
|
-
step={schema.step}
|
|
282
|
-
{required}
|
|
283
|
-
ariaDescribedBy={descriptionId}
|
|
284
|
-
disabled={isReadOnly}
|
|
285
|
-
onChange={(val) => onChange(val)}
|
|
286
|
-
/>
|
|
287
|
-
{:else if fieldType === 'toggle'}
|
|
288
|
-
<FormToggle
|
|
289
|
-
id={fieldKey}
|
|
290
|
-
value={booleanValue}
|
|
291
|
-
ariaDescribedBy={descriptionId}
|
|
292
|
-
disabled={isReadOnly}
|
|
293
|
-
onChange={(val) => onChange(val)}
|
|
294
|
-
/>
|
|
295
|
-
{:else if fieldType === 'select-options'}
|
|
296
|
-
<FormSelect
|
|
297
|
-
id={fieldKey}
|
|
298
|
-
value={stringValue}
|
|
299
|
-
options={selectOptions}
|
|
300
|
-
{required}
|
|
301
|
-
ariaDescribedBy={descriptionId}
|
|
302
|
-
disabled={isReadOnly}
|
|
303
|
-
onChange={(val) => onChange(val)}
|
|
304
|
-
/>
|
|
305
|
-
{:else if fieldType === 'array' && schema.items}
|
|
306
|
-
<FormArray
|
|
307
|
-
id={fieldKey}
|
|
308
|
-
value={arrayItems}
|
|
309
|
-
itemSchema={schema.items}
|
|
310
|
-
minItems={schema.minItems}
|
|
311
|
-
maxItems={schema.maxItems}
|
|
312
|
-
addLabel={`Add ${schema.items.title ?? 'Item'}`}
|
|
313
|
-
disabled={isReadOnly}
|
|
314
|
-
onChange={(val) => onChange(val)}
|
|
315
|
-
/>
|
|
316
|
-
{:else if fieldType === 'ports'}
|
|
317
|
-
<FormPorts
|
|
318
|
-
id={fieldKey}
|
|
319
|
-
{value}
|
|
320
|
-
ariaDescribedBy={descriptionId}
|
|
321
|
-
disabled={isReadOnly}
|
|
322
|
-
{node}
|
|
323
|
-
onChange={(val) => onChange(val)}
|
|
324
|
-
/>
|
|
325
|
-
{:else if fieldType === 'code-editor'}
|
|
326
|
-
<FormCodeEditor
|
|
327
|
-
id={fieldKey}
|
|
328
|
-
{value}
|
|
329
|
-
placeholder={schema.placeholder ?? '{}'}
|
|
330
|
-
{required}
|
|
331
|
-
height={(schema.height as string | undefined) ?? '200px'}
|
|
332
|
-
darkTheme={(schema.darkTheme as boolean | undefined) ?? getResolvedTheme() === 'dark'}
|
|
333
|
-
autoFormat={(schema.autoFormat as boolean | undefined) ?? true}
|
|
334
|
-
ariaDescribedBy={descriptionId}
|
|
335
|
-
disabled={isReadOnly}
|
|
336
|
-
onChange={(val) => onChange(val)}
|
|
337
|
-
/>
|
|
338
|
-
{:else if fieldType === 'markdown-editor'}
|
|
339
|
-
<FormMarkdownEditor
|
|
340
|
-
id={fieldKey}
|
|
341
|
-
value={stringValue}
|
|
342
|
-
placeholder={schema.placeholder ?? 'Write your markdown here...'}
|
|
343
|
-
{required}
|
|
344
|
-
height={(schema.height as string | undefined) ?? '300px'}
|
|
345
|
-
showToolbar={(schema.showToolbar as boolean | undefined) ?? true}
|
|
346
|
-
showStatusBar={(schema.showStatusBar as boolean | undefined) ?? true}
|
|
347
|
-
spellChecker={(schema.spellChecker as boolean | undefined) ?? false}
|
|
348
|
-
ariaDescribedBy={descriptionId}
|
|
349
|
-
disabled={isReadOnly}
|
|
350
|
-
onChange={(val) => onChange(val)}
|
|
351
|
-
/>
|
|
352
|
-
{:else if fieldType === 'template-editor'}
|
|
353
|
-
<FormTemplateEditor
|
|
354
|
-
id={fieldKey}
|
|
355
|
-
value={stringValue}
|
|
356
|
-
placeholder={schema.placeholder ??
|
|
357
|
-
'Enter your template here...\nUse {{ variable }} for dynamic values.'}
|
|
358
|
-
{required}
|
|
359
|
-
height={(schema.height as string | undefined) ?? '250px'}
|
|
360
|
-
darkTheme={(schema.darkTheme as boolean | undefined) ?? getResolvedTheme() === 'dark'}
|
|
361
|
-
variables={schema.variables}
|
|
362
|
-
placeholderExample={(schema.placeholderExample as string | undefined) ??
|
|
363
|
-
'Hello {{ name }}, your order #{{ order_id }} is ready!'}
|
|
364
|
-
ariaDescribedBy={descriptionId}
|
|
365
|
-
disabled={isReadOnly}
|
|
366
|
-
{node}
|
|
367
|
-
{nodes}
|
|
368
|
-
{edges}
|
|
369
|
-
{workflowId}
|
|
370
|
-
{authProvider}
|
|
371
|
-
onChange={(val) => onChange(val)}
|
|
372
|
-
/>
|
|
373
|
-
{:else if fieldType === 'autocomplete' && schema.autocomplete && registeredAutocompleteComponent}
|
|
374
|
-
<registeredAutocompleteComponent.component
|
|
375
|
-
id={fieldKey}
|
|
376
|
-
value={autocompleteValue}
|
|
377
|
-
placeholder={schema.placeholder ?? ''}
|
|
378
|
-
{required}
|
|
379
|
-
{schema}
|
|
380
|
-
ariaDescribedBy={descriptionId}
|
|
381
|
-
disabled={isReadOnly}
|
|
382
|
-
{node}
|
|
383
|
-
{nodes}
|
|
384
|
-
{edges}
|
|
385
|
-
{workflowId}
|
|
386
|
-
{authProvider}
|
|
387
|
-
onChange={(val: unknown) => onChange(val)}
|
|
388
|
-
/>
|
|
389
|
-
{:else if fieldType === 'autocomplete' && schema.autocomplete}
|
|
390
|
-
<FormAutocomplete
|
|
391
|
-
id={fieldKey}
|
|
392
|
-
value={autocompleteValue}
|
|
393
|
-
autocomplete={schema.autocomplete}
|
|
394
|
-
placeholder={schema.placeholder ?? ''}
|
|
395
|
-
{required}
|
|
396
|
-
ariaDescribedBy={descriptionId}
|
|
397
|
-
disabled={isReadOnly}
|
|
398
|
-
onChange={(val) => onChange(val)}
|
|
399
|
-
/>
|
|
400
|
-
{:else}
|
|
401
|
-
<!-- Fallback to text input -->
|
|
402
|
-
<FormTextField
|
|
403
|
-
id={fieldKey}
|
|
404
|
-
value={stringValue}
|
|
405
|
-
placeholder={schema.placeholder ?? ''}
|
|
406
|
-
ariaDescribedBy={descriptionId}
|
|
407
|
-
disabled={isReadOnly}
|
|
408
|
-
onChange={(val) => onChange(val)}
|
|
409
|
-
/>
|
|
410
|
-
{/if}
|
|
411
|
-
</FormFieldWrapper>
|
|
412
|
-
{/if}
|
|
413
|
-
|
|
414
|
-
<style>
|
|
415
|
-
/* Styles moved to individual form components */
|
|
416
|
-
</style>
|
|
31
|
+
<FieldFactory {...props} {editors} />
|
|
@@ -1,29 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
interface Props {
|
|
4
|
-
/** Unique key/id for the field */
|
|
5
|
-
fieldKey: string;
|
|
6
|
-
/** Field schema definition */
|
|
7
|
-
schema: FieldSchema;
|
|
8
|
-
/** Current field value */
|
|
9
|
-
value: unknown;
|
|
10
|
-
/** Whether the field is required */
|
|
11
|
-
required?: boolean;
|
|
12
|
-
/** Animation delay index for staggered animations */
|
|
13
|
-
animationIndex?: number;
|
|
14
|
-
/** Callback when the field value changes */
|
|
15
|
-
onChange: (value: unknown) => void;
|
|
16
|
-
/** Current workflow node (optional, used for template variable API mode) */
|
|
17
|
-
node?: WorkflowNode;
|
|
18
|
-
/** All workflow nodes (optional, used for port-derived variables) */
|
|
19
|
-
nodes?: WorkflowNode[];
|
|
20
|
-
/** All workflow edges (optional, used for port-derived variables) */
|
|
21
|
-
edges?: WorkflowEdge[];
|
|
22
|
-
/** Workflow ID (optional, used for template variable API mode) */
|
|
23
|
-
workflowId?: string;
|
|
24
|
-
/** Auth provider (optional, used for API requests) */
|
|
25
|
-
authProvider?: AuthProvider;
|
|
26
|
-
}
|
|
27
|
-
declare const FormField: import("svelte").Component<Props, {}, "">;
|
|
1
|
+
import type { FormFieldFactoryProps } from './types.js';
|
|
2
|
+
declare const FormField: import("svelte").Component<FormFieldFactoryProps, {}, "">;
|
|
28
3
|
type FormField = ReturnType<typeof FormField>;
|
|
29
4
|
export default FormField;
|