@d34dman/flowdrop 0.0.63 → 0.0.65
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 +32 -36
- package/dist/components/CanvasBanner.stories.svelte +12 -8
- package/dist/components/CanvasBanner.stories.svelte.d.ts +1 -1
- package/dist/components/ConfigModal.svelte +7 -11
- package/dist/components/ConfigModal.svelte.d.ts +5 -23
- 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/LogsSidebar.svelte +6 -9
- package/dist/components/LogsSidebar.svelte.d.ts +3 -20
- 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/NodeSidebar.svelte +1 -0
- package/dist/components/NodeStatusOverlay.stories.svelte +61 -50
- package/dist/components/NodeStatusOverlay.stories.svelte.d.ts +1 -1
- package/dist/components/NodeStatusOverlay.svelte +4 -4
- package/dist/components/PipelineStatus.svelte +10 -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 +6 -1
- package/dist/components/StatusIcon.stories.svelte +15 -15
- package/dist/components/StatusIcon.stories.svelte.d.ts +1 -1
- package/dist/components/StatusIcon.svelte +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/FormAutocomplete.svelte +2 -0
- 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/FormPrompt.svelte +1 -0
- 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 +44 -25
- package/dist/components/interrupt/TextInputPrompt.stories.svelte +32 -19
- package/dist/components/interrupt/TextInputPrompt.stories.svelte.d.ts +1 -1
- package/dist/components/interrupt/TextInputPrompt.svelte +1 -0
- package/dist/components/layouts/MainLayout.svelte +3 -0
- 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 +2 -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/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
|
@@ -1,41 +1,53 @@
|
|
|
1
1
|
<script module>
|
|
2
|
-
import { defineMeta } from
|
|
3
|
-
import Navbar from
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import Navbar from './Navbar.svelte';
|
|
4
4
|
|
|
5
5
|
const { Story } = defineMeta({
|
|
6
|
-
title:
|
|
6
|
+
title: 'Editor/Navbar',
|
|
7
7
|
component: Navbar,
|
|
8
|
-
tags: [
|
|
8
|
+
tags: ['autodocs'],
|
|
9
9
|
parameters: {
|
|
10
|
-
layout:
|
|
11
|
-
}
|
|
10
|
+
layout: 'fullscreen'
|
|
11
|
+
}
|
|
12
12
|
});
|
|
13
13
|
</script>
|
|
14
14
|
|
|
15
|
-
<Story
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
<Story
|
|
16
|
+
name="Default"
|
|
17
|
+
args={{
|
|
18
|
+
title: 'My Workflow',
|
|
19
|
+
showStatus: true,
|
|
20
|
+
showSettings: true
|
|
21
|
+
}}
|
|
22
|
+
/>
|
|
20
23
|
|
|
21
|
-
<Story
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
<Story
|
|
25
|
+
name="With Actions"
|
|
26
|
+
args={{
|
|
27
|
+
title: 'Workflow Editor',
|
|
28
|
+
primaryActions: [
|
|
29
|
+
{ label: 'Save', href: '#', icon: 'mdi:content-save', variant: 'primary' },
|
|
30
|
+
{ label: 'Export', href: '#', icon: 'mdi:download', variant: 'outline' }
|
|
31
|
+
],
|
|
32
|
+
showStatus: true
|
|
33
|
+
}}
|
|
34
|
+
/>
|
|
29
35
|
|
|
30
|
-
<Story
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
<Story
|
|
37
|
+
name="With Breadcrumbs"
|
|
38
|
+
args={{
|
|
39
|
+
breadcrumbs: [
|
|
40
|
+
{ label: 'Workflows', href: '#', icon: 'mdi:folder' },
|
|
41
|
+
{ label: 'My Workflow', href: '#' }
|
|
42
|
+
],
|
|
43
|
+
showSettings: true
|
|
44
|
+
}}
|
|
45
|
+
/>
|
|
37
46
|
|
|
38
|
-
<Story
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
47
|
+
<Story
|
|
48
|
+
name="Minimal"
|
|
49
|
+
args={{
|
|
50
|
+
showStatus: false,
|
|
51
|
+
showSettings: false
|
|
52
|
+
}}
|
|
53
|
+
/>
|
|
@@ -11,7 +11,7 @@ declare const Navbar: $$__sveltets_2_IsomorphicComponent<{
|
|
|
11
11
|
}, {
|
|
12
12
|
[evt: string]: CustomEvent<any>;
|
|
13
13
|
}, {}, {}, string>;
|
|
14
|
-
import Navbar from
|
|
14
|
+
import Navbar from './Navbar.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;
|
|
@@ -62,10 +62,13 @@
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
// Add event listener for click outside
|
|
66
|
-
|
|
65
|
+
// Add event listener for click outside with proper cleanup
|
|
66
|
+
$effect(() => {
|
|
67
67
|
document.addEventListener('click', handleClickOutside);
|
|
68
|
-
|
|
68
|
+
return () => {
|
|
69
|
+
document.removeEventListener('click', handleClickOutside);
|
|
70
|
+
};
|
|
71
|
+
});
|
|
69
72
|
</script>
|
|
70
73
|
|
|
71
74
|
<div class="flowdrop-navbar">
|
|
@@ -1,74 +1,85 @@
|
|
|
1
1
|
<script module>
|
|
2
|
-
import { defineMeta } from
|
|
3
|
-
import NodeStatusOverlay from
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import NodeStatusOverlay from './NodeStatusOverlay.svelte';
|
|
4
4
|
|
|
5
5
|
const { Story } = defineMeta({
|
|
6
|
-
title:
|
|
7
|
-
tags: [
|
|
6
|
+
title: 'Editor/NodeStatusOverlay',
|
|
7
|
+
tags: ['autodocs'],
|
|
8
8
|
parameters: {
|
|
9
|
-
layout:
|
|
10
|
-
}
|
|
9
|
+
layout: 'centered'
|
|
10
|
+
}
|
|
11
11
|
});
|
|
12
12
|
</script>
|
|
13
13
|
|
|
14
|
-
{#snippet nodeBox(label)}
|
|
15
|
-
<div style="position: relative; width: 220px; height: 100px; margin-top: 60px; border: 1px solid var(--fd-border, #e5e7eb); border-radius: 8px; background: var(--fd-card, white);">
|
|
16
|
-
<NodeStatusOverlay executionInfo={{
|
|
17
|
-
status: "idle",
|
|
18
|
-
executionCount: 3,
|
|
19
|
-
isExecuting: false,
|
|
20
|
-
lastExecuted: new Date().toISOString(),
|
|
21
|
-
}} />
|
|
22
|
-
<div style="padding: 1rem; text-align: center; color: var(--fd-text, #374151);">{label}</div>
|
|
23
|
-
</div>
|
|
24
|
-
{/snippet}
|
|
25
|
-
|
|
26
14
|
<Story name="Idle (with history)">
|
|
27
|
-
<div
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
15
|
+
<div
|
|
16
|
+
style="position: relative; width: 220px; height: 100px; margin-top: 60px; border: 1px solid var(--fd-border, #e5e7eb); border-radius: 8px; background: var(--fd-card, white);"
|
|
17
|
+
>
|
|
18
|
+
<NodeStatusOverlay
|
|
19
|
+
executionInfo={{
|
|
20
|
+
status: 'idle',
|
|
21
|
+
executionCount: 3,
|
|
22
|
+
isExecuting: false,
|
|
23
|
+
lastExecuted: new Date().toISOString()
|
|
24
|
+
}}
|
|
25
|
+
showDetails
|
|
26
|
+
/>
|
|
27
|
+
<div style="padding: 1rem; text-align: center; color: var(--fd-text, #374151);">
|
|
28
|
+
Node Content
|
|
29
|
+
</div>
|
|
35
30
|
</div>
|
|
36
31
|
</Story>
|
|
37
32
|
|
|
38
33
|
<Story name="Running">
|
|
39
|
-
<div
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
34
|
+
<div
|
|
35
|
+
style="position: relative; width: 220px; height: 100px; margin-top: 60px; border: 1px solid var(--fd-border, #e5e7eb); border-radius: 8px; background: var(--fd-card, white);"
|
|
36
|
+
>
|
|
37
|
+
<NodeStatusOverlay
|
|
38
|
+
executionInfo={{
|
|
39
|
+
status: 'running',
|
|
40
|
+
executionCount: 1,
|
|
41
|
+
isExecuting: true
|
|
42
|
+
}}
|
|
43
|
+
/>
|
|
44
|
+
<div style="padding: 1rem; text-align: center; color: var(--fd-text, #374151);">
|
|
45
|
+
Processing...
|
|
46
|
+
</div>
|
|
46
47
|
</div>
|
|
47
48
|
</Story>
|
|
48
49
|
|
|
49
50
|
<Story name="Completed">
|
|
50
|
-
<div
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
51
|
+
<div
|
|
52
|
+
style="position: relative; width: 220px; height: 100px; margin-top: 60px; border: 1px solid var(--fd-border, #e5e7eb); border-radius: 8px; background: var(--fd-card, white);"
|
|
53
|
+
>
|
|
54
|
+
<NodeStatusOverlay
|
|
55
|
+
executionInfo={{
|
|
56
|
+
status: 'completed',
|
|
57
|
+
executionCount: 5,
|
|
58
|
+
isExecuting: false,
|
|
59
|
+
lastExecuted: new Date().toISOString(),
|
|
60
|
+
lastExecutionDuration: 1250
|
|
61
|
+
}}
|
|
62
|
+
showDetails
|
|
63
|
+
/>
|
|
58
64
|
<div style="padding: 1rem; text-align: center; color: var(--fd-text, #374151);">Done!</div>
|
|
59
65
|
</div>
|
|
60
66
|
</Story>
|
|
61
67
|
|
|
62
68
|
<Story name="Failed">
|
|
63
|
-
<div
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
<div
|
|
70
|
+
style="position: relative; width: 220px; height: 100px; margin-top: 60px; border: 1px solid var(--fd-border, #e5e7eb); border-radius: 8px; background: var(--fd-card, white);"
|
|
71
|
+
>
|
|
72
|
+
<NodeStatusOverlay
|
|
73
|
+
executionInfo={{
|
|
74
|
+
status: 'failed',
|
|
75
|
+
executionCount: 2,
|
|
76
|
+
isExecuting: false,
|
|
77
|
+
lastError: 'Connection timeout',
|
|
78
|
+
lastExecuted: new Date().toISOString(),
|
|
79
|
+
lastExecutionDuration: 30000
|
|
80
|
+
}}
|
|
81
|
+
showDetails
|
|
82
|
+
/>
|
|
72
83
|
<div style="padding: 1rem; text-align: center; color: var(--fd-text, #374151);">Error</div>
|
|
73
84
|
</div>
|
|
74
85
|
</Story>
|
|
@@ -11,7 +11,7 @@ declare const NodeStatusOverlay: $$__sveltets_2_IsomorphicComponent<{
|
|
|
11
11
|
}, {
|
|
12
12
|
[evt: string]: CustomEvent<any>;
|
|
13
13
|
}, {}, {}, string>;
|
|
14
|
-
import NodeStatusOverlay from
|
|
14
|
+
import NodeStatusOverlay from './NodeStatusOverlay.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;
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
let props: Props = $props();
|
|
30
30
|
|
|
31
31
|
// Default values
|
|
32
|
-
let position = $
|
|
33
|
-
let size = $
|
|
34
|
-
let showDetails = $
|
|
32
|
+
let position = $derived(props.position || 'top-right');
|
|
33
|
+
let size = $derived(props.size || 'md');
|
|
34
|
+
let showDetails = $derived(props.showDetails || false);
|
|
35
35
|
let isHovered = $state(false);
|
|
36
36
|
|
|
37
37
|
// Size configurations - optimized for larger, centered overlay
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
-
const config = sizeConfig[size];
|
|
59
|
+
const config = $derived(sizeConfig[size]);
|
|
60
60
|
|
|
61
61
|
// Position styles - horizontal center aligned with top edge of node
|
|
62
62
|
const positionStyles = {
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
import { onMount } from 'svelte';
|
|
9
9
|
import App from './App.svelte';
|
|
10
10
|
import LogsSidebar from './LogsSidebar.svelte';
|
|
11
|
-
import {
|
|
11
|
+
import { EnhancedFlowDropApiClient } from '../api/enhanced-client.js';
|
|
12
|
+
import { createEndpointConfig } from '../config/endpoints.js';
|
|
12
13
|
import type { Workflow } from '../types/index.js';
|
|
13
14
|
import type { EndpointConfig } from '../config/endpoints.js';
|
|
14
15
|
import { logger } from '../utils/logger.js';
|
|
@@ -16,7 +17,7 @@
|
|
|
16
17
|
interface Props {
|
|
17
18
|
pipelineId: string;
|
|
18
19
|
workflow: Workflow;
|
|
19
|
-
apiClient?:
|
|
20
|
+
apiClient?: EnhancedFlowDropApiClient;
|
|
20
21
|
baseUrl?: string;
|
|
21
22
|
endpointConfig?: EndpointConfig;
|
|
22
23
|
onActionsReady?: (
|
|
@@ -34,8 +35,12 @@
|
|
|
34
35
|
$props();
|
|
35
36
|
|
|
36
37
|
// Initialize API client if not provided
|
|
38
|
+
// svelte-ignore state_referenced_locally — client created once from props
|
|
37
39
|
const client =
|
|
38
|
-
apiClient ||
|
|
40
|
+
apiClient ||
|
|
41
|
+
new EnhancedFlowDropApiClient(
|
|
42
|
+
endpointConfig ?? createEndpointConfig(baseUrl || '/api/flowdrop')
|
|
43
|
+
);
|
|
39
44
|
|
|
40
45
|
// Pipeline status and job data
|
|
41
46
|
let pipelineStatus = $state<string>('unknown');
|
|
@@ -269,15 +274,8 @@
|
|
|
269
274
|
}
|
|
270
275
|
});
|
|
271
276
|
|
|
272
|
-
//
|
|
273
|
-
|
|
274
|
-
return () => {
|
|
275
|
-
if (refreshInterval) {
|
|
276
|
-
clearInterval(refreshInterval);
|
|
277
|
-
refreshInterval = null;
|
|
278
|
-
}
|
|
279
|
-
};
|
|
280
|
-
});
|
|
277
|
+
// Note: Interval cleanup is handled by the $effect above.
|
|
278
|
+
// In Svelte 5, $effect cleanup runs both on re-execution and component destroy.
|
|
281
279
|
</script>
|
|
282
280
|
|
|
283
281
|
<div class="pipeline-status-container">
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EnhancedFlowDropApiClient } from '../api/enhanced-client.js';
|
|
2
2
|
import type { Workflow } from '../types/index.js';
|
|
3
3
|
import type { EndpointConfig } from '../config/endpoints.js';
|
|
4
4
|
interface Props {
|
|
5
5
|
pipelineId: string;
|
|
6
6
|
workflow: Workflow;
|
|
7
|
-
apiClient?:
|
|
7
|
+
apiClient?: EnhancedFlowDropApiClient;
|
|
8
8
|
baseUrl?: string;
|
|
9
9
|
endpointConfig?: EndpointConfig;
|
|
10
10
|
onActionsReady?: (actions: Array<{
|
|
@@ -1,101 +1,116 @@
|
|
|
1
1
|
<script module>
|
|
2
|
-
import { defineMeta } from
|
|
3
|
-
import SchemaForm from
|
|
4
|
-
import { fn } from
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import SchemaForm from './SchemaForm.svelte';
|
|
4
|
+
import { fn } from 'storybook/test';
|
|
5
5
|
|
|
6
6
|
const { Story } = defineMeta({
|
|
7
|
-
title:
|
|
7
|
+
title: 'Form/SchemaForm',
|
|
8
8
|
component: SchemaForm,
|
|
9
|
-
tags: [
|
|
9
|
+
tags: ['autodocs'],
|
|
10
10
|
args: {
|
|
11
11
|
onChange: fn(),
|
|
12
12
|
onSave: fn(),
|
|
13
|
-
onCancel: fn()
|
|
14
|
-
}
|
|
13
|
+
onCancel: fn()
|
|
14
|
+
}
|
|
15
15
|
});
|
|
16
16
|
</script>
|
|
17
17
|
|
|
18
|
-
<Story
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
<Story
|
|
19
|
+
name="Simple Form"
|
|
20
|
+
args={{
|
|
21
|
+
schema: {
|
|
22
|
+
type: 'object',
|
|
23
|
+
properties: {
|
|
24
|
+
name: { type: 'string', title: 'Name', description: 'Enter your full name' },
|
|
25
|
+
age: { type: 'number', title: 'Age', minimum: 0, maximum: 120 },
|
|
26
|
+
active: { type: 'boolean', title: 'Active', default: true }
|
|
27
|
+
},
|
|
28
|
+
required: ['name']
|
|
25
29
|
},
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
}} />
|
|
30
|
+
values: { name: 'Alice', age: 30, active: true }
|
|
31
|
+
}}
|
|
32
|
+
/>
|
|
30
33
|
|
|
31
|
-
<Story
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
34
|
+
<Story
|
|
35
|
+
name="Select Fields"
|
|
36
|
+
args={{
|
|
37
|
+
schema: {
|
|
38
|
+
type: 'object',
|
|
39
|
+
properties: {
|
|
40
|
+
model: {
|
|
41
|
+
type: 'string',
|
|
42
|
+
title: 'AI Model',
|
|
43
|
+
oneOf: [
|
|
44
|
+
{ const: 'gpt-4', title: 'GPT-4' },
|
|
45
|
+
{ const: 'gpt-3.5', title: 'GPT-3.5 Turbo' },
|
|
46
|
+
{ const: 'claude-3', title: 'Claude 3' }
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
temperature: {
|
|
50
|
+
type: 'number',
|
|
51
|
+
title: 'Temperature',
|
|
52
|
+
format: 'range',
|
|
53
|
+
minimum: 0,
|
|
54
|
+
maximum: 2,
|
|
55
|
+
step: 0.1,
|
|
56
|
+
default: 0.7
|
|
57
|
+
},
|
|
58
|
+
prompt: {
|
|
59
|
+
type: 'string',
|
|
60
|
+
title: 'System Prompt',
|
|
61
|
+
format: 'multiline',
|
|
62
|
+
description: 'The system prompt for the AI model'
|
|
63
|
+
}
|
|
64
|
+
}
|
|
59
65
|
},
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
66
|
+
values: { model: 'gpt-4', temperature: 0.7, prompt: 'You are a helpful assistant.' }
|
|
67
|
+
}}
|
|
68
|
+
/>
|
|
63
69
|
|
|
64
|
-
<Story
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
+
<Story
|
|
71
|
+
name="With Actions"
|
|
72
|
+
args={{
|
|
73
|
+
schema: {
|
|
74
|
+
type: 'object',
|
|
75
|
+
properties: {
|
|
76
|
+
email: { type: 'string', title: 'Email' },
|
|
77
|
+
notifications: { type: 'boolean', title: 'Enable Notifications' }
|
|
78
|
+
},
|
|
79
|
+
required: ['email']
|
|
70
80
|
},
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}} />
|
|
81
|
+
values: { email: '', notifications: true },
|
|
82
|
+
showActions: true,
|
|
83
|
+
saveLabel: 'Save Settings',
|
|
84
|
+
cancelLabel: 'Reset'
|
|
85
|
+
}}
|
|
86
|
+
/>
|
|
78
87
|
|
|
79
|
-
<Story
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
88
|
+
<Story
|
|
89
|
+
name="Loading"
|
|
90
|
+
args={{
|
|
91
|
+
schema: {
|
|
92
|
+
type: 'object',
|
|
93
|
+
properties: {
|
|
94
|
+
name: { type: 'string', title: 'Name' }
|
|
95
|
+
}
|
|
84
96
|
},
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
97
|
+
values: { name: 'Test' },
|
|
98
|
+
showActions: true,
|
|
99
|
+
loading: true
|
|
100
|
+
}}
|
|
101
|
+
/>
|
|
90
102
|
|
|
91
|
-
<Story
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
103
|
+
<Story
|
|
104
|
+
name="Disabled"
|
|
105
|
+
args={{
|
|
106
|
+
schema: {
|
|
107
|
+
type: 'object',
|
|
108
|
+
properties: {
|
|
109
|
+
name: { type: 'string', title: 'Name' },
|
|
110
|
+
role: { type: 'string', title: 'Role' }
|
|
111
|
+
}
|
|
97
112
|
},
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
113
|
+
values: { name: 'Admin', role: 'Super User' },
|
|
114
|
+
disabled: true
|
|
115
|
+
}}
|
|
116
|
+
/>
|
|
@@ -11,7 +11,7 @@ declare const SchemaForm: $$__sveltets_2_IsomorphicComponent<{
|
|
|
11
11
|
}, {
|
|
12
12
|
[evt: string]: CustomEvent<any>;
|
|
13
13
|
}, {}, {}, string>;
|
|
14
|
-
import SchemaForm from
|
|
14
|
+
import SchemaForm from './SchemaForm.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;
|
|
@@ -34,7 +34,11 @@
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
function handleSave(finalValues: Record<string, unknown>) {
|
|
37
|
-
|
|
37
|
+
// Process saved form values
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function handleCancel() {
|
|
41
|
+
// Handle form cancellation
|
|
38
42
|
}
|
|
39
43
|
</script>
|
|
40
44
|
|
|
@@ -44,7 +48,7 @@
|
|
|
44
48
|
onChange={handleChange}
|
|
45
49
|
showActions={true}
|
|
46
50
|
onSave={handleSave}
|
|
47
|
-
onCancel={
|
|
51
|
+
onCancel={handleCancel}
|
|
48
52
|
/>
|
|
49
53
|
```
|
|
50
54
|
-->
|
|
@@ -14,11 +14,15 @@
|
|
|
14
14
|
```svelte
|
|
15
15
|
<script>
|
|
16
16
|
import { SettingsPanel } from "@d34dman/flowdrop";
|
|
17
|
+
|
|
18
|
+
function handleClose() {
|
|
19
|
+
// Handle settings panel close
|
|
20
|
+
}
|
|
17
21
|
</script>
|
|
18
22
|
|
|
19
23
|
<SettingsPanel
|
|
20
24
|
showSyncButton={true}
|
|
21
|
-
onClose={
|
|
25
|
+
onClose={handleClose}
|
|
22
26
|
/>
|
|
23
27
|
```
|
|
24
28
|
-->
|
|
@@ -72,6 +76,7 @@
|
|
|
72
76
|
/**
|
|
73
77
|
* Currently active tab
|
|
74
78
|
*/
|
|
79
|
+
// svelte-ignore state_referenced_locally — initial default, user switches tabs
|
|
75
80
|
let activeTab = $state<SettingsCategory>(categories[0] ?? 'theme');
|
|
76
81
|
|
|
77
82
|
/**
|