@d34dman/flowdrop 0.0.63 → 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 -5
- 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 +6 -2
- 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 +7 -26
- 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
|
@@ -16,7 +16,11 @@
|
|
|
16
16
|
type ColorMode
|
|
17
17
|
} from '@xyflow/svelte';
|
|
18
18
|
import '@xyflow/svelte/dist/style.css';
|
|
19
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
getResolvedTheme,
|
|
21
|
+
getEditorSettings,
|
|
22
|
+
getBehaviorSettings
|
|
23
|
+
} from '../stores/settingsStore.svelte.js';
|
|
20
24
|
import type {
|
|
21
25
|
WorkflowNode as WorkflowNodeType,
|
|
22
26
|
NodeMetadata,
|
|
@@ -40,7 +44,11 @@
|
|
|
40
44
|
} from '../helpers/workflowEditorHelper.js';
|
|
41
45
|
import type { NodeExecutionInfo } from '../types/index.js';
|
|
42
46
|
import { Toaster } from 'svelte-5-french-toast';
|
|
43
|
-
import {
|
|
47
|
+
import {
|
|
48
|
+
flowdropToastOptions,
|
|
49
|
+
FLOWDROP_TOASTER_CLASS,
|
|
50
|
+
apiToasts
|
|
51
|
+
} from '../services/toastService.js';
|
|
44
52
|
import {
|
|
45
53
|
ProximityConnectHelper,
|
|
46
54
|
type ProximityEdgeCandidate
|
|
@@ -351,7 +359,12 @@
|
|
|
351
359
|
nodes: WorkflowNodeType[];
|
|
352
360
|
event: MouseEvent | TouchEvent;
|
|
353
361
|
}): void {
|
|
354
|
-
if (
|
|
362
|
+
if (
|
|
363
|
+
!getEditorSettings().proximityConnect ||
|
|
364
|
+
!targetNode ||
|
|
365
|
+
props.readOnly ||
|
|
366
|
+
props.lockWorkflow
|
|
367
|
+
) {
|
|
355
368
|
if (currentProximityCandidates.length > 0) {
|
|
356
369
|
flowEdges = ProximityConnectHelper.removePreviewEdges(flowEdges);
|
|
357
370
|
currentProximityCandidates = [];
|
|
@@ -747,7 +760,13 @@
|
|
|
747
760
|
bind:edges={flowEdges}
|
|
748
761
|
{nodeTypes}
|
|
749
762
|
{defaultEdgeOptions}
|
|
750
|
-
onconnect={(connection) =>
|
|
763
|
+
onconnect={(connection) =>
|
|
764
|
+
void handleConnect({
|
|
765
|
+
source: connection.source,
|
|
766
|
+
target: connection.target,
|
|
767
|
+
sourceHandle: connection.sourceHandle ?? undefined,
|
|
768
|
+
targetHandle: connection.targetHandle ?? undefined
|
|
769
|
+
})}
|
|
751
770
|
onbeforedelete={handleBeforeDelete}
|
|
752
771
|
ondelete={handleNodesDelete}
|
|
753
772
|
onnodedragstart={handleNodeDragStart}
|
|
@@ -905,7 +924,6 @@
|
|
|
905
924
|
cursor: pointer;
|
|
906
925
|
}
|
|
907
926
|
|
|
908
|
-
|
|
909
927
|
/* Handle size/position only; colors come from inline --fd-handle-fill and base.css ::before */
|
|
910
928
|
:global(.flowdrop-workflow-editor .svelte-flow__handle) {
|
|
911
929
|
width: var(--fd-handle-size);
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
<script module>
|
|
2
|
-
import { defineMeta } from
|
|
3
|
-
import FormCheckboxGroup from
|
|
4
|
-
import { fn } from
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import FormCheckboxGroup from './FormCheckboxGroup.svelte';
|
|
4
|
+
import { fn } from 'storybook/test';
|
|
5
5
|
|
|
6
6
|
const { Story } = defineMeta({
|
|
7
|
-
title:
|
|
7
|
+
title: 'Form/FormCheckboxGroup',
|
|
8
8
|
component: FormCheckboxGroup,
|
|
9
|
-
tags: [
|
|
9
|
+
tags: ['autodocs'],
|
|
10
10
|
argTypes: {
|
|
11
|
-
disabled: { control:
|
|
11
|
+
disabled: { control: 'boolean' }
|
|
12
12
|
},
|
|
13
13
|
args: {
|
|
14
|
-
id:
|
|
15
|
-
options: [
|
|
14
|
+
id: 'demo-checkbox-group',
|
|
15
|
+
options: ['Email', 'SMS', 'Push Notification', 'Webhook'],
|
|
16
16
|
value: [],
|
|
17
|
-
onChange: fn()
|
|
18
|
-
}
|
|
17
|
+
onChange: fn()
|
|
18
|
+
}
|
|
19
19
|
});
|
|
20
20
|
</script>
|
|
21
21
|
|
|
22
22
|
<Story name="No Selection" args={{ value: [] }} />
|
|
23
23
|
|
|
24
|
-
<Story name="Pre-selected" args={{ value: [
|
|
24
|
+
<Story name="Pre-selected" args={{ value: ['Email', 'Push Notification'] }} />
|
|
25
25
|
|
|
26
|
-
<Story name="All Selected" args={{ value: [
|
|
26
|
+
<Story name="All Selected" args={{ value: ['Email', 'SMS', 'Push Notification', 'Webhook'] }} />
|
|
27
27
|
|
|
28
|
-
<Story name="Disabled" args={{ value: [
|
|
28
|
+
<Story name="Disabled" args={{ value: ['Email'], disabled: true }} />
|
|
@@ -11,7 +11,7 @@ declare const FormCheckboxGroup: $$__sveltets_2_IsomorphicComponent<{
|
|
|
11
11
|
}, {
|
|
12
12
|
[evt: string]: CustomEvent<any>;
|
|
13
13
|
}, {}, {}, string>;
|
|
14
|
-
import FormCheckboxGroup from
|
|
14
|
+
import FormCheckboxGroup from './FormCheckboxGroup.svelte';
|
|
15
15
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
16
16
|
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
17
17
|
$$bindings?: Bindings;
|
|
@@ -146,9 +146,9 @@
|
|
|
146
146
|
return 'select-enum';
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
// oneOf with labeled options (standard JSON Schema)
|
|
149
|
+
// oneOf with labeled options (standard JSON Schema) -> select
|
|
150
150
|
// Must be checked before basic type checks since oneOf schemas often have type: 'string'
|
|
151
|
-
if (
|
|
151
|
+
if (schema.oneOf && schema.oneOf.length > 0) {
|
|
152
152
|
return 'select-options';
|
|
153
153
|
}
|
|
154
154
|
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
import FormSelect from './FormSelect.svelte';
|
|
43
43
|
import FormCheckboxGroup from './FormCheckboxGroup.svelte';
|
|
44
44
|
import FormArray from './FormArray.svelte';
|
|
45
|
-
import {
|
|
45
|
+
import { fieldComponentRegistry } from '../../form/fieldRegistry.js';
|
|
46
46
|
import { getResolvedTheme } from '../../stores/settingsStore.svelte.js';
|
|
47
47
|
import type { FieldSchema } from './types.js';
|
|
48
48
|
import { getSchemaOptions } from './types.js';
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
/**
|
|
85
85
|
* Check if there's a registered custom component for this schema
|
|
86
86
|
*/
|
|
87
|
-
const registeredComponent = $derived(resolveFieldComponent(schema));
|
|
87
|
+
const registeredComponent = $derived(fieldComponentRegistry.resolveFieldComponent(schema));
|
|
88
88
|
|
|
89
89
|
/**
|
|
90
90
|
* Determine the field type to render (for non-registered components)
|
|
@@ -128,9 +128,9 @@
|
|
|
128
128
|
return 'select-enum';
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
// oneOf with labeled options (standard JSON Schema)
|
|
131
|
+
// oneOf with labeled options (standard JSON Schema) -> select
|
|
132
132
|
// Must be checked before basic type checks since oneOf schemas often have type: 'string'
|
|
133
|
-
if (
|
|
133
|
+
if (schema.oneOf && schema.oneOf.length > 0) {
|
|
134
134
|
return 'select-options';
|
|
135
135
|
}
|
|
136
136
|
|
|
@@ -1,31 +1,53 @@
|
|
|
1
1
|
<script module>
|
|
2
|
-
import { defineMeta } from
|
|
3
|
-
import FormFieldWrapper from
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import FormFieldWrapper from './FormFieldWrapper.svelte';
|
|
4
4
|
|
|
5
5
|
const { Story } = defineMeta({
|
|
6
|
-
title:
|
|
6
|
+
title: 'Form/FormFieldWrapper',
|
|
7
7
|
component: FormFieldWrapper,
|
|
8
|
-
tags: [
|
|
8
|
+
tags: ['autodocs'],
|
|
9
9
|
argTypes: {
|
|
10
|
-
label: { control:
|
|
11
|
-
required: { control:
|
|
12
|
-
description: { control:
|
|
10
|
+
label: { control: 'text' },
|
|
11
|
+
required: { control: 'boolean' },
|
|
12
|
+
description: { control: 'text' }
|
|
13
13
|
},
|
|
14
14
|
args: {
|
|
15
|
-
id:
|
|
16
|
-
label:
|
|
17
|
-
}
|
|
15
|
+
id: 'demo-wrapper',
|
|
16
|
+
label: 'Field Label'
|
|
17
|
+
}
|
|
18
18
|
});
|
|
19
19
|
</script>
|
|
20
20
|
|
|
21
|
-
<Story name="Default" args={{ label:
|
|
22
|
-
<input
|
|
21
|
+
<Story name="Default" args={{ label: 'Username' }}>
|
|
22
|
+
<input
|
|
23
|
+
type="text"
|
|
24
|
+
id="demo-wrapper"
|
|
25
|
+
placeholder="Enter username"
|
|
26
|
+
style="width: 100%; padding: 0.625rem 0.875rem; border: 1px solid var(--fd-border); border-radius: var(--fd-radius-lg); font-size: var(--fd-text-sm);"
|
|
27
|
+
/>
|
|
23
28
|
</Story>
|
|
24
29
|
|
|
25
|
-
<Story
|
|
26
|
-
|
|
30
|
+
<Story
|
|
31
|
+
name="With Description"
|
|
32
|
+
args={{
|
|
33
|
+
label: 'Email',
|
|
34
|
+
description: "We'll never share your email with anyone.",
|
|
35
|
+
required: true
|
|
36
|
+
}}
|
|
37
|
+
>
|
|
38
|
+
<input
|
|
39
|
+
type="email"
|
|
40
|
+
id="demo-wrapper"
|
|
41
|
+
placeholder="email@example.com"
|
|
42
|
+
style="width: 100%; padding: 0.625rem 0.875rem; border: 1px solid var(--fd-border); border-radius: var(--fd-radius-lg); font-size: var(--fd-text-sm);"
|
|
43
|
+
/>
|
|
27
44
|
</Story>
|
|
28
45
|
|
|
29
|
-
<Story name="Required" args={{ label:
|
|
30
|
-
<input
|
|
46
|
+
<Story name="Required" args={{ label: 'Password', required: true }}>
|
|
47
|
+
<input
|
|
48
|
+
type="password"
|
|
49
|
+
id="demo-wrapper"
|
|
50
|
+
placeholder="Enter password"
|
|
51
|
+
style="width: 100%; padding: 0.625rem 0.875rem; border: 1px solid var(--fd-border); border-radius: var(--fd-radius-lg); font-size: var(--fd-text-sm);"
|
|
52
|
+
/>
|
|
31
53
|
</Story>
|
|
@@ -11,7 +11,7 @@ declare const FormFieldWrapper: $$__sveltets_2_IsomorphicComponent<{
|
|
|
11
11
|
}, {
|
|
12
12
|
[evt: string]: CustomEvent<any>;
|
|
13
13
|
}, {}, {}, string>;
|
|
14
|
-
import FormFieldWrapper from
|
|
14
|
+
import FormFieldWrapper from './FormFieldWrapper.svelte';
|
|
15
15
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
16
16
|
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
17
17
|
$$bindings?: Bindings;
|
|
@@ -1,33 +1,36 @@
|
|
|
1
1
|
<script module>
|
|
2
|
-
import { defineMeta } from
|
|
3
|
-
import FormNumberField from
|
|
4
|
-
import { fn } from
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import FormNumberField from './FormNumberField.svelte';
|
|
4
|
+
import { fn } from 'storybook/test';
|
|
5
5
|
|
|
6
6
|
const { Story } = defineMeta({
|
|
7
|
-
title:
|
|
7
|
+
title: 'Form/FormNumberField',
|
|
8
8
|
component: FormNumberField,
|
|
9
|
-
tags: [
|
|
9
|
+
tags: ['autodocs'],
|
|
10
10
|
argTypes: {
|
|
11
|
-
value: { control:
|
|
12
|
-
placeholder: { control:
|
|
13
|
-
min: { control:
|
|
14
|
-
max: { control:
|
|
15
|
-
step: { control:
|
|
16
|
-
required: { control:
|
|
17
|
-
disabled: { control:
|
|
11
|
+
value: { control: 'number' },
|
|
12
|
+
placeholder: { control: 'text' },
|
|
13
|
+
min: { control: 'number' },
|
|
14
|
+
max: { control: 'number' },
|
|
15
|
+
step: { control: 'number' },
|
|
16
|
+
required: { control: 'boolean' },
|
|
17
|
+
disabled: { control: 'boolean' }
|
|
18
18
|
},
|
|
19
19
|
args: {
|
|
20
|
-
id:
|
|
21
|
-
value:
|
|
22
|
-
onChange: fn()
|
|
23
|
-
}
|
|
20
|
+
id: 'demo-number-field',
|
|
21
|
+
value: '',
|
|
22
|
+
onChange: fn()
|
|
23
|
+
}
|
|
24
24
|
});
|
|
25
25
|
</script>
|
|
26
26
|
|
|
27
|
-
<Story name="Default" args={{ placeholder:
|
|
27
|
+
<Story name="Default" args={{ placeholder: 'Enter a number...' }} />
|
|
28
28
|
|
|
29
29
|
<Story name="With Value" args={{ value: 42 }} />
|
|
30
30
|
|
|
31
|
-
<Story
|
|
31
|
+
<Story
|
|
32
|
+
name="With Constraints"
|
|
33
|
+
args={{ value: 50, min: 0, max: 100, step: 5, placeholder: '0-100, step 5' }}
|
|
34
|
+
/>
|
|
32
35
|
|
|
33
36
|
<Story name="Disabled" args={{ value: 10, disabled: true }} />
|
|
@@ -11,7 +11,7 @@ declare const FormNumberField: $$__sveltets_2_IsomorphicComponent<{
|
|
|
11
11
|
}, {
|
|
12
12
|
[evt: string]: CustomEvent<any>;
|
|
13
13
|
}, {}, {}, string>;
|
|
14
|
-
import FormNumberField from
|
|
14
|
+
import FormNumberField from './FormNumberField.svelte';
|
|
15
15
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
16
16
|
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
17
17
|
$$bindings?: Bindings;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
<script module>
|
|
2
|
-
import { defineMeta } from
|
|
3
|
-
import FormRangeField from
|
|
4
|
-
import { fn } from
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import FormRangeField from './FormRangeField.svelte';
|
|
4
|
+
import { fn } from 'storybook/test';
|
|
5
5
|
|
|
6
6
|
const { Story } = defineMeta({
|
|
7
|
-
title:
|
|
7
|
+
title: 'Form/FormRangeField',
|
|
8
8
|
component: FormRangeField,
|
|
9
|
-
tags: [
|
|
9
|
+
tags: ['autodocs'],
|
|
10
10
|
argTypes: {
|
|
11
|
-
value: { control: { type:
|
|
12
|
-
min: { control:
|
|
13
|
-
max: { control:
|
|
14
|
-
step: { control:
|
|
15
|
-
disabled: { control:
|
|
11
|
+
value: { control: { type: 'number' } },
|
|
12
|
+
min: { control: 'number' },
|
|
13
|
+
max: { control: 'number' },
|
|
14
|
+
step: { control: 'number' },
|
|
15
|
+
disabled: { control: 'boolean' }
|
|
16
16
|
},
|
|
17
17
|
args: {
|
|
18
|
-
id:
|
|
18
|
+
id: 'demo-range-field',
|
|
19
19
|
value: 50,
|
|
20
|
-
onChange: fn()
|
|
21
|
-
}
|
|
20
|
+
onChange: fn()
|
|
21
|
+
}
|
|
22
22
|
});
|
|
23
23
|
</script>
|
|
24
24
|
|
|
@@ -11,7 +11,7 @@ declare const FormRangeField: $$__sveltets_2_IsomorphicComponent<{
|
|
|
11
11
|
}, {
|
|
12
12
|
[evt: string]: CustomEvent<any>;
|
|
13
13
|
}, {}, {}, string>;
|
|
14
|
-
import FormRangeField from
|
|
14
|
+
import FormRangeField from './FormRangeField.svelte';
|
|
15
15
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
16
16
|
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
17
17
|
$$bindings?: Bindings;
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
<script module>
|
|
2
|
-
import { defineMeta } from
|
|
3
|
-
import FormSelect from
|
|
4
|
-
import { fn } from
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import FormSelect from './FormSelect.svelte';
|
|
4
|
+
import { fn } from 'storybook/test';
|
|
5
5
|
|
|
6
6
|
const { Story } = defineMeta({
|
|
7
|
-
title:
|
|
7
|
+
title: 'Form/FormSelect',
|
|
8
8
|
component: FormSelect,
|
|
9
|
-
tags: [
|
|
9
|
+
tags: ['autodocs'],
|
|
10
10
|
argTypes: {
|
|
11
|
-
value: { control:
|
|
12
|
-
required: { control:
|
|
13
|
-
disabled: { control:
|
|
11
|
+
value: { control: 'text' },
|
|
12
|
+
required: { control: 'boolean' },
|
|
13
|
+
disabled: { control: 'boolean' }
|
|
14
14
|
},
|
|
15
15
|
args: {
|
|
16
|
-
id:
|
|
17
|
-
value:
|
|
18
|
-
onChange: fn()
|
|
19
|
-
}
|
|
16
|
+
id: 'demo-select',
|
|
17
|
+
value: '',
|
|
18
|
+
onChange: fn()
|
|
19
|
+
}
|
|
20
20
|
});
|
|
21
21
|
</script>
|
|
22
22
|
|
|
23
23
|
<Story
|
|
24
24
|
name="String Options"
|
|
25
25
|
args={{
|
|
26
|
-
options: [
|
|
27
|
-
value:
|
|
26
|
+
options: ['Option A', 'Option B', 'Option C'],
|
|
27
|
+
value: 'Option A'
|
|
28
28
|
}}
|
|
29
29
|
/>
|
|
30
30
|
|
|
@@ -32,19 +32,19 @@
|
|
|
32
32
|
name="FieldOption Objects"
|
|
33
33
|
args={{
|
|
34
34
|
options: [
|
|
35
|
-
{ value:
|
|
36
|
-
{ value:
|
|
37
|
-
{ value:
|
|
35
|
+
{ value: 'gpt-4', label: 'GPT-4' },
|
|
36
|
+
{ value: 'gpt-3.5', label: 'GPT-3.5 Turbo' },
|
|
37
|
+
{ value: 'claude-3', label: 'Claude 3 Opus' }
|
|
38
38
|
],
|
|
39
|
-
value:
|
|
39
|
+
value: 'gpt-4'
|
|
40
40
|
}}
|
|
41
41
|
/>
|
|
42
42
|
|
|
43
43
|
<Story
|
|
44
44
|
name="Disabled"
|
|
45
45
|
args={{
|
|
46
|
-
options: [
|
|
47
|
-
value:
|
|
48
|
-
disabled: true
|
|
46
|
+
options: ['Read', 'Write', 'Admin'],
|
|
47
|
+
value: 'Read',
|
|
48
|
+
disabled: true
|
|
49
49
|
}}
|
|
50
50
|
/>
|
|
@@ -11,7 +11,7 @@ declare const FormSelect: $$__sveltets_2_IsomorphicComponent<{
|
|
|
11
11
|
}, {
|
|
12
12
|
[evt: string]: CustomEvent<any>;
|
|
13
13
|
}, {}, {}, string>;
|
|
14
|
-
import FormSelect from
|
|
14
|
+
import FormSelect from './FormSelect.svelte';
|
|
15
15
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
16
16
|
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
17
17
|
$$bindings?: Bindings;
|
|
@@ -65,12 +65,6 @@
|
|
|
65
65
|
* Controls which variables are available and how they are displayed.
|
|
66
66
|
*/
|
|
67
67
|
variables?: TemplateVariablesConfig;
|
|
68
|
-
/**
|
|
69
|
-
* Variable schema for advanced autocomplete with nested drilling.
|
|
70
|
-
* When provided, enables dot notation (user.name) and array access (items[0]).
|
|
71
|
-
* @deprecated Use `variables.schema` instead
|
|
72
|
-
*/
|
|
73
|
-
variableSchema?: VariableSchema;
|
|
74
68
|
/** Placeholder variable example for the hint */
|
|
75
69
|
placeholderExample?: string;
|
|
76
70
|
/** Whether the field is disabled (read-only) */
|
|
@@ -99,7 +93,6 @@
|
|
|
99
93
|
darkTheme = false,
|
|
100
94
|
height = '250px',
|
|
101
95
|
variables,
|
|
102
|
-
variableSchema,
|
|
103
96
|
placeholderExample = 'Hello {{ name }}, your order #{{ order_id }} is ready!',
|
|
104
97
|
disabled = false,
|
|
105
98
|
ariaDescribedBy,
|
|
@@ -128,12 +121,6 @@
|
|
|
128
121
|
// Reset error state
|
|
129
122
|
variableLoadError = null;
|
|
130
123
|
|
|
131
|
-
// If we have deprecated variableSchema prop, use it directly
|
|
132
|
-
if (variableSchema && Object.keys(variableSchema.variables).length > 0) {
|
|
133
|
-
effectiveVariableSchema = variableSchema;
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
124
|
// If no variables config, clear schema
|
|
138
125
|
if (!variables) {
|
|
139
126
|
effectiveVariableSchema = undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TemplateVariablesConfig, WorkflowNode, WorkflowEdge, AuthProvider } from '../../types/index.js';
|
|
2
2
|
interface Props {
|
|
3
3
|
/** Field identifier */
|
|
4
4
|
id: string;
|
|
@@ -17,12 +17,6 @@ interface Props {
|
|
|
17
17
|
* Controls which variables are available and how they are displayed.
|
|
18
18
|
*/
|
|
19
19
|
variables?: TemplateVariablesConfig;
|
|
20
|
-
/**
|
|
21
|
-
* Variable schema for advanced autocomplete with nested drilling.
|
|
22
|
-
* When provided, enables dot notation (user.name) and array access (items[0]).
|
|
23
|
-
* @deprecated Use `variables.schema` instead
|
|
24
|
-
*/
|
|
25
|
-
variableSchema?: VariableSchema;
|
|
26
20
|
/** Placeholder variable example for the hint */
|
|
27
21
|
placeholderExample?: string;
|
|
28
22
|
/** Whether the field is disabled (read-only) */
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
<script module>
|
|
2
|
-
import { defineMeta } from
|
|
3
|
-
import FormTextField from
|
|
4
|
-
import { fn } from
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import FormTextField from './FormTextField.svelte';
|
|
4
|
+
import { fn } from 'storybook/test';
|
|
5
5
|
|
|
6
6
|
const { Story } = defineMeta({
|
|
7
|
-
title:
|
|
7
|
+
title: 'Form/FormTextField',
|
|
8
8
|
component: FormTextField,
|
|
9
|
-
tags: [
|
|
9
|
+
tags: ['autodocs'],
|
|
10
10
|
argTypes: {
|
|
11
|
-
value: { control:
|
|
12
|
-
placeholder: { control:
|
|
13
|
-
required: { control:
|
|
14
|
-
disabled: { control:
|
|
11
|
+
value: { control: 'text' },
|
|
12
|
+
placeholder: { control: 'text' },
|
|
13
|
+
required: { control: 'boolean' },
|
|
14
|
+
disabled: { control: 'boolean' }
|
|
15
15
|
},
|
|
16
16
|
args: {
|
|
17
|
-
id:
|
|
18
|
-
value:
|
|
19
|
-
onChange: fn()
|
|
20
|
-
}
|
|
17
|
+
id: 'demo-text-field',
|
|
18
|
+
value: '',
|
|
19
|
+
onChange: fn()
|
|
20
|
+
}
|
|
21
21
|
});
|
|
22
22
|
</script>
|
|
23
23
|
|
|
24
|
-
<Story name="Default" args={{ placeholder:
|
|
24
|
+
<Story name="Default" args={{ placeholder: 'Enter text...' }} />
|
|
25
25
|
|
|
26
|
-
<Story name="With Value" args={{ value:
|
|
26
|
+
<Story name="With Value" args={{ value: 'Hello World', placeholder: 'Enter text...' }} />
|
|
27
27
|
|
|
28
|
-
<Story name="Required" args={{ required: true, placeholder:
|
|
28
|
+
<Story name="Required" args={{ required: true, placeholder: 'Required field' }} />
|
|
29
29
|
|
|
30
|
-
<Story name="Disabled" args={{ value:
|
|
30
|
+
<Story name="Disabled" args={{ value: 'Cannot edit this', disabled: true }} />
|
|
@@ -11,7 +11,7 @@ declare const FormTextField: $$__sveltets_2_IsomorphicComponent<{
|
|
|
11
11
|
}, {
|
|
12
12
|
[evt: string]: CustomEvent<any>;
|
|
13
13
|
}, {}, {}, string>;
|
|
14
|
-
import FormTextField from
|
|
14
|
+
import FormTextField from './FormTextField.svelte';
|
|
15
15
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
16
16
|
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
17
17
|
$$bindings?: Bindings;
|
|
@@ -1,31 +1,34 @@
|
|
|
1
1
|
<script module>
|
|
2
|
-
import { defineMeta } from
|
|
3
|
-
import FormTextarea from
|
|
4
|
-
import { fn } from
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import FormTextarea from './FormTextarea.svelte';
|
|
4
|
+
import { fn } from 'storybook/test';
|
|
5
5
|
|
|
6
6
|
const { Story } = defineMeta({
|
|
7
|
-
title:
|
|
7
|
+
title: 'Form/FormTextarea',
|
|
8
8
|
component: FormTextarea,
|
|
9
|
-
tags: [
|
|
9
|
+
tags: ['autodocs'],
|
|
10
10
|
argTypes: {
|
|
11
|
-
value: { control:
|
|
12
|
-
placeholder: { control:
|
|
13
|
-
rows: { control: { type:
|
|
14
|
-
required: { control:
|
|
15
|
-
disabled: { control:
|
|
11
|
+
value: { control: 'text' },
|
|
12
|
+
placeholder: { control: 'text' },
|
|
13
|
+
rows: { control: { type: 'number', min: 1, max: 20 } },
|
|
14
|
+
required: { control: 'boolean' },
|
|
15
|
+
disabled: { control: 'boolean' }
|
|
16
16
|
},
|
|
17
17
|
args: {
|
|
18
|
-
id:
|
|
19
|
-
value:
|
|
20
|
-
onChange: fn()
|
|
21
|
-
}
|
|
18
|
+
id: 'demo-textarea',
|
|
19
|
+
value: '',
|
|
20
|
+
onChange: fn()
|
|
21
|
+
}
|
|
22
22
|
});
|
|
23
23
|
</script>
|
|
24
24
|
|
|
25
|
-
<Story name="Default" args={{ placeholder:
|
|
25
|
+
<Story name="Default" args={{ placeholder: 'Enter your message...' }} />
|
|
26
26
|
|
|
27
|
-
<Story name="Custom Rows" args={{ rows: 8, placeholder:
|
|
27
|
+
<Story name="Custom Rows" args={{ rows: 8, placeholder: 'Larger text area...' }} />
|
|
28
28
|
|
|
29
|
-
<Story
|
|
29
|
+
<Story
|
|
30
|
+
name="With Value"
|
|
31
|
+
args={{ value: 'This is a multiline\ntext content\nwith several lines.' }}
|
|
32
|
+
/>
|
|
30
33
|
|
|
31
|
-
<Story name="Disabled" args={{ value:
|
|
34
|
+
<Story name="Disabled" args={{ value: 'Read-only content', disabled: true }} />
|
|
@@ -11,7 +11,7 @@ declare const FormTextarea: $$__sveltets_2_IsomorphicComponent<{
|
|
|
11
11
|
}, {
|
|
12
12
|
[evt: string]: CustomEvent<any>;
|
|
13
13
|
}, {}, {}, string>;
|
|
14
|
-
import FormTextarea from
|
|
14
|
+
import FormTextarea from './FormTextarea.svelte';
|
|
15
15
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
16
16
|
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
17
17
|
$$bindings?: Bindings;
|