@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.
Files changed (125) hide show
  1. package/README.md +2 -0
  2. package/dist/adapters/agentspec/AgentSpecAdapter.js +1 -40
  3. package/dist/api/enhanced-client.d.ts +19 -0
  4. package/dist/api/enhanced-client.js +9 -0
  5. package/dist/components/App.svelte +32 -36
  6. package/dist/components/CanvasBanner.stories.svelte +12 -8
  7. package/dist/components/CanvasBanner.stories.svelte.d.ts +1 -1
  8. package/dist/components/ConfigModal.svelte +7 -11
  9. package/dist/components/ConfigModal.svelte.d.ts +5 -23
  10. package/dist/components/ConfigPanel.stories.svelte +35 -26
  11. package/dist/components/ConfigPanel.stories.svelte.d.ts +1 -1
  12. package/dist/components/LoadingSpinner.stories.svelte +13 -13
  13. package/dist/components/LoadingSpinner.stories.svelte.d.ts +1 -1
  14. package/dist/components/Logo.stories.svelte +4 -4
  15. package/dist/components/Logo.stories.svelte.d.ts +1 -1
  16. package/dist/components/LogsSidebar.svelte +6 -9
  17. package/dist/components/LogsSidebar.svelte.d.ts +3 -20
  18. package/dist/components/MarkdownDisplay.stories.svelte +25 -10
  19. package/dist/components/MarkdownDisplay.stories.svelte.d.ts +1 -1
  20. package/dist/components/Navbar.stories.svelte +42 -30
  21. package/dist/components/Navbar.stories.svelte.d.ts +1 -1
  22. package/dist/components/Navbar.svelte +6 -3
  23. package/dist/components/NodeSidebar.svelte +1 -0
  24. package/dist/components/NodeStatusOverlay.stories.svelte +61 -50
  25. package/dist/components/NodeStatusOverlay.stories.svelte.d.ts +1 -1
  26. package/dist/components/NodeStatusOverlay.svelte +4 -4
  27. package/dist/components/PipelineStatus.svelte +10 -12
  28. package/dist/components/PipelineStatus.svelte.d.ts +2 -2
  29. package/dist/components/SchemaForm.stories.svelte +97 -82
  30. package/dist/components/SchemaForm.stories.svelte.d.ts +1 -1
  31. package/dist/components/SchemaForm.svelte +6 -2
  32. package/dist/components/SettingsPanel.svelte +6 -1
  33. package/dist/components/StatusIcon.stories.svelte +15 -15
  34. package/dist/components/StatusIcon.stories.svelte.d.ts +1 -1
  35. package/dist/components/StatusIcon.svelte +1 -1
  36. package/dist/components/StatusLabel.stories.svelte +8 -8
  37. package/dist/components/StatusLabel.stories.svelte.d.ts +1 -1
  38. package/dist/components/ThemeToggle.stories.svelte +10 -10
  39. package/dist/components/ThemeToggle.stories.svelte.d.ts +1 -1
  40. package/dist/components/WorkflowEditor.svelte +23 -5
  41. package/dist/components/form/FormAutocomplete.svelte +2 -0
  42. package/dist/components/form/FormCheckboxGroup.stories.svelte +13 -13
  43. package/dist/components/form/FormCheckboxGroup.stories.svelte.d.ts +1 -1
  44. package/dist/components/form/FormField.svelte +2 -2
  45. package/dist/components/form/FormFieldLight.svelte +4 -4
  46. package/dist/components/form/FormFieldWrapper.stories.svelte +38 -16
  47. package/dist/components/form/FormFieldWrapper.stories.svelte.d.ts +1 -1
  48. package/dist/components/form/FormNumberField.stories.svelte +21 -18
  49. package/dist/components/form/FormNumberField.stories.svelte.d.ts +1 -1
  50. package/dist/components/form/FormRangeField.stories.svelte +13 -13
  51. package/dist/components/form/FormRangeField.stories.svelte.d.ts +1 -1
  52. package/dist/components/form/FormSelect.stories.svelte +21 -21
  53. package/dist/components/form/FormSelect.stories.svelte.d.ts +1 -1
  54. package/dist/components/form/FormTemplateEditor.svelte +0 -13
  55. package/dist/components/form/FormTemplateEditor.svelte.d.ts +1 -7
  56. package/dist/components/form/FormTextField.stories.svelte +17 -17
  57. package/dist/components/form/FormTextField.stories.svelte.d.ts +1 -1
  58. package/dist/components/form/FormTextarea.stories.svelte +21 -18
  59. package/dist/components/form/FormTextarea.stories.svelte.d.ts +1 -1
  60. package/dist/components/form/FormToggle.stories.svelte +13 -13
  61. package/dist/components/form/FormToggle.stories.svelte.d.ts +1 -1
  62. package/dist/components/form/index.d.ts +2 -1
  63. package/dist/components/form/index.js +1 -2
  64. package/dist/components/form/types.d.ts +8 -20
  65. package/dist/components/form/types.js +3 -8
  66. package/dist/components/interrupt/ChoicePrompt.stories.svelte +37 -28
  67. package/dist/components/interrupt/ChoicePrompt.stories.svelte.d.ts +1 -1
  68. package/dist/components/interrupt/ConfirmationPrompt.stories.svelte +57 -35
  69. package/dist/components/interrupt/ConfirmationPrompt.stories.svelte.d.ts +1 -1
  70. package/dist/components/interrupt/FormPrompt.svelte +1 -0
  71. package/dist/components/interrupt/ReviewPrompt.stories.svelte +52 -31
  72. package/dist/components/interrupt/ReviewPrompt.stories.svelte.d.ts +1 -1
  73. package/dist/components/interrupt/ReviewPrompt.svelte +44 -25
  74. package/dist/components/interrupt/TextInputPrompt.stories.svelte +32 -19
  75. package/dist/components/interrupt/TextInputPrompt.stories.svelte.d.ts +1 -1
  76. package/dist/components/interrupt/TextInputPrompt.svelte +1 -0
  77. package/dist/components/layouts/MainLayout.svelte +3 -0
  78. package/dist/components/nodes/GatewayNode.stories.svelte +96 -64
  79. package/dist/components/nodes/IdeaNode.stories.svelte +40 -36
  80. package/dist/components/nodes/NotesNode.stories.svelte +61 -54
  81. package/dist/components/nodes/SimpleNode.stories.svelte +141 -83
  82. package/dist/components/nodes/SquareNode.stories.svelte +70 -44
  83. package/dist/components/nodes/TerminalNode.stories.svelte +10 -10
  84. package/dist/components/nodes/TerminalNode.svelte +6 -2
  85. package/dist/components/nodes/ToolNode.stories.svelte +177 -59
  86. package/dist/components/nodes/WorkflowNode.stories.svelte +43 -38
  87. package/dist/components/playground/MessageBubble.stories.svelte +51 -38
  88. package/dist/components/playground/MessageBubble.stories.svelte.d.ts +1 -1
  89. package/dist/components/playground/Playground.svelte +2 -4
  90. package/dist/config/constants.d.ts +21 -0
  91. package/dist/config/constants.js +9 -0
  92. package/dist/core/index.d.ts +7 -5
  93. package/dist/core/index.js +5 -5
  94. package/dist/editor/index.d.ts +4 -4
  95. package/dist/editor/index.js +3 -4
  96. package/dist/form/code.js +16 -4
  97. package/dist/form/fieldRegistry.d.ts +8 -82
  98. package/dist/form/fieldRegistry.js +9 -101
  99. package/dist/form/full.d.ts +4 -1
  100. package/dist/form/full.js +6 -1
  101. package/dist/form/index.d.ts +1 -1
  102. package/dist/form/index.js +0 -2
  103. package/dist/form/markdown.js +11 -3
  104. package/dist/helpers/workflowEditorHelper.d.ts +0 -3
  105. package/dist/helpers/workflowEditorHelper.js +7 -26
  106. package/dist/index.js +3 -0
  107. package/dist/services/apiVariableService.d.ts +1 -3
  108. package/dist/services/apiVariableService.js +3 -4
  109. package/dist/services/dynamicSchemaService.js +3 -4
  110. package/dist/stories/CanvasDecorator.svelte +7 -8
  111. package/dist/stories/CanvasDecorator.svelte.d.ts +2 -2
  112. package/dist/stories/NodeDecorator.svelte +13 -14
  113. package/dist/stories/NodeDecorator.svelte.d.ts +1 -1
  114. package/dist/stories/utils.d.ts +2 -2
  115. package/dist/stories/utils.js +55 -55
  116. package/dist/styles/base.css +12 -4
  117. package/dist/styles/tokens.css +138 -130
  118. package/dist/types/interrupt.d.ts +1 -4
  119. package/dist/utils/errors.d.ts +28 -0
  120. package/dist/utils/errors.js +44 -0
  121. package/dist/utils/handleIds.d.ts +35 -0
  122. package/dist/utils/handleIds.js +58 -0
  123. package/package.json +53 -12
  124. package/dist/api/client.d.ts +0 -110
  125. package/dist/api/client.js +0 -240
@@ -1,41 +1,53 @@
1
1
  <script module>
2
- import { defineMeta } from "@storybook/addon-svelte-csf";
3
- import Navbar from "./Navbar.svelte";
2
+ import { defineMeta } from '@storybook/addon-svelte-csf';
3
+ import Navbar from './Navbar.svelte';
4
4
 
5
5
  const { Story } = defineMeta({
6
- title: "Editor/Navbar",
6
+ title: 'Editor/Navbar',
7
7
  component: Navbar,
8
- tags: ["autodocs"],
8
+ tags: ['autodocs'],
9
9
  parameters: {
10
- layout: "fullscreen",
11
- },
10
+ layout: 'fullscreen'
11
+ }
12
12
  });
13
13
  </script>
14
14
 
15
- <Story name="Default" args={{
16
- title: "My Workflow",
17
- showStatus: true,
18
- showSettings: true,
19
- }} />
15
+ <Story
16
+ name="Default"
17
+ args={{
18
+ title: 'My Workflow',
19
+ showStatus: true,
20
+ showSettings: true
21
+ }}
22
+ />
20
23
 
21
- <Story name="With Actions" args={{
22
- title: "Workflow Editor",
23
- primaryActions: [
24
- { label: "Save", href: "#", icon: "mdi:content-save", variant: "primary" },
25
- { label: "Export", href: "#", icon: "mdi:download", variant: "outline" },
26
- ],
27
- showStatus: true,
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 name="With Breadcrumbs" args={{
31
- breadcrumbs: [
32
- { label: "Workflows", href: "#", icon: "mdi:folder" },
33
- { label: "My Workflow", href: "#" },
34
- ],
35
- showSettings: true,
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 name="Minimal" args={{
39
- showStatus: false,
40
- showSettings: false,
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 "./Navbar.svelte";
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
- if (typeof window !== 'undefined') {
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">
@@ -22,6 +22,7 @@
22
22
 
23
23
  let props: Props = $props();
24
24
  let searchInput = $state('');
25
+ // svelte-ignore state_referenced_locally — initial default, user selects interactively
25
26
  let selectedCategory = $state(props.selectedCategory || 'all');
26
27
 
27
28
  /**
@@ -1,74 +1,85 @@
1
1
  <script module>
2
- import { defineMeta } from "@storybook/addon-svelte-csf";
3
- import NodeStatusOverlay from "./NodeStatusOverlay.svelte";
2
+ import { defineMeta } from '@storybook/addon-svelte-csf';
3
+ import NodeStatusOverlay from './NodeStatusOverlay.svelte';
4
4
 
5
5
  const { Story } = defineMeta({
6
- title: "Editor/NodeStatusOverlay",
7
- tags: ["autodocs"],
6
+ title: 'Editor/NodeStatusOverlay',
7
+ tags: ['autodocs'],
8
8
  parameters: {
9
- layout: "centered",
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 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);">
28
- <NodeStatusOverlay executionInfo={{
29
- status: "idle",
30
- executionCount: 3,
31
- isExecuting: false,
32
- lastExecuted: new Date().toISOString(),
33
- }} showDetails />
34
- <div style="padding: 1rem; text-align: center; color: var(--fd-text, #374151);">Node Content</div>
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 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);">
40
- <NodeStatusOverlay executionInfo={{
41
- status: "running",
42
- executionCount: 1,
43
- isExecuting: true,
44
- }} />
45
- <div style="padding: 1rem; text-align: center; color: var(--fd-text, #374151);">Processing...</div>
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 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);">
51
- <NodeStatusOverlay executionInfo={{
52
- status: "completed",
53
- executionCount: 5,
54
- isExecuting: false,
55
- lastExecuted: new Date().toISOString(),
56
- lastExecutionDuration: 1250,
57
- }} showDetails />
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 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);">
64
- <NodeStatusOverlay executionInfo={{
65
- status: "failed",
66
- executionCount: 2,
67
- isExecuting: false,
68
- lastError: "Connection timeout",
69
- lastExecuted: new Date().toISOString(),
70
- lastExecutionDuration: 30000,
71
- }} showDetails />
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 "./NodeStatusOverlay.svelte";
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 = $state(props.position || 'top-right');
33
- let size = $state(props.size || 'md');
34
- let showDetails = $state(props.showDetails || false);
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 { FlowDropApiClient } from '../api/client.js';
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?: FlowDropApiClient;
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 || new FlowDropApiClient(endpointConfig?.baseUrl || baseUrl || '/api/flowdrop');
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
- // Cleanup on unmount
273
- onMount(() => {
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 { FlowDropApiClient } from '../api/client.js';
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?: FlowDropApiClient;
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 "@storybook/addon-svelte-csf";
3
- import SchemaForm from "./SchemaForm.svelte";
4
- import { fn } from "storybook/test";
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: "Form/SchemaForm",
7
+ title: 'Form/SchemaForm',
8
8
  component: SchemaForm,
9
- tags: ["autodocs"],
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 name="Simple Form" args={{
19
- schema: {
20
- type: "object",
21
- properties: {
22
- name: { type: "string", title: "Name", description: "Enter your full name" },
23
- age: { type: "number", title: "Age", minimum: 0, maximum: 120 },
24
- active: { type: "boolean", title: "Active", default: true },
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
- required: ["name"],
27
- },
28
- values: { name: "Alice", age: 30, active: true },
29
- }} />
30
+ values: { name: 'Alice', age: 30, active: true }
31
+ }}
32
+ />
30
33
 
31
- <Story name="Select Fields" args={{
32
- schema: {
33
- type: "object",
34
- properties: {
35
- model: {
36
- type: "string",
37
- title: "AI Model",
38
- oneOf: [
39
- { const: "gpt-4", title: "GPT-4" },
40
- { const: "gpt-3.5", title: "GPT-3.5 Turbo" },
41
- { const: "claude-3", title: "Claude 3" },
42
- ],
43
- },
44
- temperature: {
45
- type: "number",
46
- title: "Temperature",
47
- format: "range",
48
- minimum: 0,
49
- maximum: 2,
50
- step: 0.1,
51
- default: 0.7,
52
- },
53
- prompt: {
54
- type: "string",
55
- title: "System Prompt",
56
- format: "multiline",
57
- description: "The system prompt for the AI model",
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
- values: { model: "gpt-4", temperature: 0.7, prompt: "You are a helpful assistant." },
62
- }} />
66
+ values: { model: 'gpt-4', temperature: 0.7, prompt: 'You are a helpful assistant.' }
67
+ }}
68
+ />
63
69
 
64
- <Story name="With Actions" args={{
65
- schema: {
66
- type: "object",
67
- properties: {
68
- email: { type: "string", title: "Email" },
69
- notifications: { type: "boolean", title: "Enable Notifications" },
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
- required: ["email"],
72
- },
73
- values: { email: "", notifications: true },
74
- showActions: true,
75
- saveLabel: "Save Settings",
76
- cancelLabel: "Reset",
77
- }} />
81
+ values: { email: '', notifications: true },
82
+ showActions: true,
83
+ saveLabel: 'Save Settings',
84
+ cancelLabel: 'Reset'
85
+ }}
86
+ />
78
87
 
79
- <Story name="Loading" args={{
80
- schema: {
81
- type: "object",
82
- properties: {
83
- name: { type: "string", title: "Name" },
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
- values: { name: "Test" },
87
- showActions: true,
88
- loading: true,
89
- }} />
97
+ values: { name: 'Test' },
98
+ showActions: true,
99
+ loading: true
100
+ }}
101
+ />
90
102
 
91
- <Story name="Disabled" args={{
92
- schema: {
93
- type: "object",
94
- properties: {
95
- name: { type: "string", title: "Name" },
96
- role: { type: "string", title: "Role" },
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
- values: { name: "Admin", role: "Super User" },
100
- disabled: true,
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 "./SchemaForm.svelte";
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
- console.log("Saved:", finalValues);
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={() => console.log("Cancelled")}
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={() => console.log("Closed")}
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
  /**