@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
package/README.md CHANGED
@@ -49,6 +49,8 @@ No vendor lock-in. No data leaving your walls. No surprise bills.
49
49
  npm install @d34dman/flowdrop
50
50
  ```
51
51
 
52
+ > **Note:** FlowDrop supports **one editor instance per page** (module-level singleton stores). See [Architecture Notes](#architecture-notes) for details.
53
+
52
54
  You get a production-ready workflow UI. You keep full control of everything else.
53
55
 
54
56
  ## Quickstart
@@ -13,46 +13,7 @@ import { getComponentTypeDefaults, extractComponentType, AGENTSPEC_NAMESPACE } f
13
13
  import { computeAutoLayout } from './autoLayout.js';
14
14
  import { v4 as uuidv4 } from 'uuid';
15
15
  import { logger } from '../../utils/logger.js';
16
- // ============================================================================
17
- // Handle ID Helpers
18
- // ============================================================================
19
- /**
20
- * Build a FlowDrop handle ID from node ID, direction, and port ID.
21
- * Format: `${nodeId}-${direction}-${portId}`
22
- */
23
- function buildHandleId(nodeId, direction, portId) {
24
- return `${nodeId}-${direction}-${portId}`;
25
- }
26
- /**
27
- * Extract port ID from a FlowDrop handle ID.
28
- * Handles format: `${nodeId}-output-${portId}` or `${nodeId}-input-${portId}`
29
- */
30
- function extractPortId(handleId) {
31
- if (!handleId)
32
- return null;
33
- const outputMatch = handleId.lastIndexOf('-output-');
34
- if (outputMatch !== -1) {
35
- return handleId.substring(outputMatch + '-output-'.length);
36
- }
37
- const inputMatch = handleId.lastIndexOf('-input-');
38
- if (inputMatch !== -1) {
39
- return handleId.substring(inputMatch + '-input-'.length);
40
- }
41
- // Short format: the handleId IS the port ID
42
- return handleId;
43
- }
44
- /**
45
- * Extract direction from a FlowDrop handle ID.
46
- */
47
- function extractDirection(handleId) {
48
- if (!handleId)
49
- return null;
50
- if (handleId.lastIndexOf('-output-') !== -1)
51
- return 'output';
52
- if (handleId.lastIndexOf('-input-') !== -1)
53
- return 'input';
54
- return null;
55
- }
16
+ import { buildHandleId, extractPortId, extractDirection } from '../../utils/handleIds.js';
56
17
  // ============================================================================
57
18
  // Property ↔ Port Conversion
58
19
  // ============================================================================
@@ -161,4 +161,23 @@ export declare class EnhancedFlowDropApiClient {
161
161
  version: string;
162
162
  build: string;
163
163
  }>;
164
+ /**
165
+ * Fetch pipeline data including job information and status
166
+ */
167
+ getPipelineData(pipelineId: string): Promise<{
168
+ status: string;
169
+ jobs: Array<Record<string, unknown>>;
170
+ node_statuses: Record<string, {
171
+ status: string;
172
+ [key: string]: unknown;
173
+ }>;
174
+ job_status_summary: {
175
+ total: number;
176
+ pending: number;
177
+ running: number;
178
+ completed: number;
179
+ failed: number;
180
+ cancelled: number;
181
+ };
182
+ }>;
164
183
  }
@@ -418,4 +418,13 @@ export class EnhancedFlowDropApiClient {
418
418
  }
419
419
  return response.data;
420
420
  }
421
+ // =========================================================================
422
+ // Pipeline API Methods
423
+ // =========================================================================
424
+ /**
425
+ * Fetch pipeline data including job information and status
426
+ */
427
+ async getPipelineData(pipelineId) {
428
+ return this.request('pipelines.get', this.config.endpoints.pipelines.get, { id: pipelineId }, {}, 'get pipeline data');
429
+ }
421
430
  }
@@ -113,7 +113,7 @@
113
113
  features: propFeatures
114
114
  }: Props = $props();
115
115
 
116
- // Merge features with defaults
116
+ // svelte-ignore state_referenced_locally feature flags don't change at runtime
117
117
  const features = mergeFeatures(propFeatures);
118
118
 
119
119
  // Create breadcrumb-style title - at top level to avoid store subscription issues
@@ -507,38 +507,42 @@
507
507
  // Load node types on mount
508
508
  onMount(() => {
509
509
  (async () => {
510
- await initializeApiEndpoints();
510
+ try {
511
+ await initializeApiEndpoints();
511
512
 
512
- // Ensure port compatibility checker is initialized (needed for proximity connect, etc.)
513
- // mountFlowDropApp initializes this before mounting, but SvelteKit routes need it here.
514
- initializePortCompatibility(DEFAULT_PORT_CONFIG);
513
+ // Ensure port compatibility checker is initialized (needed for proximity connect, etc.)
514
+ // mountFlowDropApp initializes this before mounting, but SvelteKit routes need it here.
515
+ initializePortCompatibility(DEFAULT_PORT_CONFIG);
515
516
 
516
- await fetchNodeTypes();
517
+ await fetchNodeTypes();
517
518
 
518
- // Initialize the workflow store
519
- if (initialWorkflow) {
520
- workflowActions.initialize(initialWorkflow);
519
+ // Initialize the workflow store
520
+ if (initialWorkflow) {
521
+ workflowActions.initialize(initialWorkflow);
521
522
 
522
- // Emit onWorkflowLoad event
523
- if (eventHandlers?.onWorkflowLoad) {
524
- eventHandlers.onWorkflowLoad(initialWorkflow);
525
- }
526
- } else {
527
- // Initialize with a default empty workflow so the editor is functional
528
- // (e.g., drag-and-drop requires a non-null workflow in the store)
529
- const defaultWorkflow: Workflow = {
530
- id: '',
531
- name: 'Untitled Workflow',
532
- nodes: [],
533
- edges: [],
534
- metadata: {
535
- version: '1.0.0',
536
- format: DEFAULT_WORKFLOW_FORMAT,
537
- createdAt: new Date().toISOString(),
538
- updatedAt: new Date().toISOString()
523
+ // Emit onWorkflowLoad event
524
+ if (eventHandlers?.onWorkflowLoad) {
525
+ eventHandlers.onWorkflowLoad(initialWorkflow);
539
526
  }
540
- };
541
- workflowActions.initialize(defaultWorkflow);
527
+ } else {
528
+ // Initialize with a default empty workflow so the editor is functional
529
+ // (e.g., drag-and-drop requires a non-null workflow in the store)
530
+ const defaultWorkflow: Workflow = {
531
+ id: '',
532
+ name: 'Untitled Workflow',
533
+ nodes: [],
534
+ edges: [],
535
+ metadata: {
536
+ version: '1.0.0',
537
+ format: DEFAULT_WORKFLOW_FORMAT,
538
+ createdAt: new Date().toISOString(),
539
+ updatedAt: new Date().toISOString()
540
+ }
541
+ };
542
+ workflowActions.initialize(defaultWorkflow);
543
+ }
544
+ } catch (error) {
545
+ logger.error('Failed to initialize editor:', error);
542
546
  }
543
547
  })();
544
548
 
@@ -569,14 +573,6 @@
569
573
  };
570
574
  });
571
575
 
572
- // Monitor workflow store changes for testing node drag updates
573
- $effect(() => {
574
- const currentWorkflow = getWorkflowStore();
575
- if (currentWorkflow) {
576
- // Workflow store updated
577
- }
578
- });
579
-
580
576
  /**
581
577
  * Derived value for showing the right config panel
582
578
  * Config panel always appears on the right side
@@ -1,20 +1,24 @@
1
1
  <script module>
2
- import { defineMeta } from "@storybook/addon-svelte-csf";
3
- import CanvasBanner from "./CanvasBanner.svelte";
4
- import CanvasDecorator from "../stories/CanvasDecorator.svelte";
2
+ import { defineMeta } from '@storybook/addon-svelte-csf';
3
+ import CanvasBanner from './CanvasBanner.svelte';
4
+ import CanvasDecorator from '../stories/CanvasDecorator.svelte';
5
5
 
6
6
  const { Story } = defineMeta({
7
- title: "Display/CanvasBanner",
8
- tags: ["autodocs"],
7
+ title: 'Display/CanvasBanner',
8
+ tags: ['autodocs'],
9
9
  parameters: {
10
- layout: "centered",
11
- },
10
+ layout: 'centered'
11
+ }
12
12
  });
13
13
  </script>
14
14
 
15
15
  <Story name="Default">
16
16
  <CanvasDecorator>
17
- <CanvasBanner title="Empty Canvas" description="Drag nodes from the sidebar to get started" iconName="heroicons:squares-plus" />
17
+ <CanvasBanner
18
+ title="Empty Canvas"
19
+ description="Drag nodes from the sidebar to get started"
20
+ iconName="heroicons:squares-plus"
21
+ />
18
22
  </CanvasDecorator>
19
23
  </Story>
20
24
 
@@ -11,7 +11,7 @@ declare const CanvasBanner: $$__sveltets_2_IsomorphicComponent<{
11
11
  }, {
12
12
  [evt: string]: CustomEvent<any>;
13
13
  }, {}, {}, string>;
14
- import CanvasBanner from "./CanvasBanner.svelte";
14
+ import CanvasBanner from './CanvasBanner.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,5 +1,4 @@
1
1
  <script lang="ts">
2
- import { createEventDispatcher } from 'svelte';
3
2
  import type { ConfigSchema, ConfigValues } from '../types';
4
3
  import ConfigForm from './ConfigForm.svelte';
5
4
 
@@ -8,23 +7,20 @@
8
7
  nodeLabel: string;
9
8
  configSchema: ConfigSchema;
10
9
  configValues: ConfigValues;
10
+ onClose?: () => void;
11
+ onSave?: (values: ConfigValues) => void;
12
+ onCancel?: () => void;
11
13
  }
12
14
 
13
- let props: Props = $props();
15
+ let { onClose, onSave, onCancel, ...props }: Props = $props();
14
16
  let localConfigValues = $derived.by(() => ({ ...props.configValues }));
15
17
 
16
- const dispatch = createEventDispatcher<{
17
- close: void;
18
- save: { values: ConfigValues };
19
- cancel: void;
20
- }>();
21
-
22
18
  function handleCancel() {
23
- dispatch('cancel');
19
+ onCancel?.();
24
20
  }
25
21
 
26
22
  function handleClose() {
27
- dispatch('close');
23
+ onClose?.();
28
24
  }
29
25
 
30
26
  // Close modal on escape key
@@ -77,7 +73,7 @@
77
73
  values={localConfigValues}
78
74
  showUIExtensions={false}
79
75
  onSave={(config) => {
80
- dispatch('save', { values: config });
76
+ onSave?.(config);
81
77
  }}
82
78
  onCancel={handleCancel}
83
79
  />
@@ -4,28 +4,10 @@ interface Props {
4
4
  nodeLabel: string;
5
5
  configSchema: ConfigSchema;
6
6
  configValues: ConfigValues;
7
+ onClose?: () => void;
8
+ onSave?: (values: ConfigValues) => void;
9
+ onCancel?: () => void;
7
10
  }
8
- 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> {
9
- new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
10
- $$bindings?: Bindings;
11
- } & Exports;
12
- (internal: unknown, props: Props & {
13
- $$events?: Events;
14
- $$slots?: Slots;
15
- }): Exports & {
16
- $set?: any;
17
- $on?: any;
18
- };
19
- z_$$bindings?: Bindings;
20
- }
21
- declare const ConfigModal: $$__sveltets_2_IsomorphicComponent<Props, {
22
- close: CustomEvent<void>;
23
- save: CustomEvent<{
24
- values: ConfigValues;
25
- }>;
26
- cancel: CustomEvent<void>;
27
- } & {
28
- [evt: string]: CustomEvent<any>;
29
- }, {}, {}, "">;
30
- type ConfigModal = InstanceType<typeof ConfigModal>;
11
+ declare const ConfigModal: import("svelte").Component<Props, {}, "">;
12
+ type ConfigModal = ReturnType<typeof ConfigModal>;
31
13
  export default ConfigModal;
@@ -1,38 +1,47 @@
1
1
  <script module>
2
- import { defineMeta } from "@storybook/addon-svelte-csf";
3
- import ConfigPanel from "./ConfigPanel.svelte";
4
- import { fn } from "storybook/test";
2
+ import { defineMeta } from '@storybook/addon-svelte-csf';
3
+ import ConfigPanel from './ConfigPanel.svelte';
4
+ import { fn } from 'storybook/test';
5
5
 
6
6
  const { Story } = defineMeta({
7
- title: "Editor/ConfigPanel",
7
+ title: 'Editor/ConfigPanel',
8
8
  component: ConfigPanel,
9
- tags: ["autodocs"],
9
+ tags: ['autodocs'],
10
10
  parameters: {
11
- layout: "padded",
11
+ layout: 'padded'
12
12
  },
13
13
  args: {
14
- onClose: fn(),
15
- },
14
+ onClose: fn()
15
+ }
16
16
  });
17
17
  </script>
18
18
 
19
- <Story name="Default" args={{
20
- title: "HTTP Request",
21
- id: "node-abc-123",
22
- description: "Send HTTP requests to external APIs",
23
- configTitle: "Configuration",
24
- }} />
19
+ <Story
20
+ name="Default"
21
+ args={{
22
+ title: 'HTTP Request',
23
+ id: 'node-abc-123',
24
+ description: 'Send HTTP requests to external APIs',
25
+ configTitle: 'Configuration'
26
+ }}
27
+ />
25
28
 
26
- <Story name="With Details" args={{
27
- title: "OpenAI Chat",
28
- id: "node-def-456",
29
- description: "Chat completion using OpenAI models",
30
- details: [
31
- { label: "Category", value: "AI" },
32
- { label: "Version", value: "1.2.0" },
33
- ],
34
- }} />
29
+ <Story
30
+ name="With Details"
31
+ args={{
32
+ title: 'OpenAI Chat',
33
+ id: 'node-def-456',
34
+ description: 'Chat completion using OpenAI models',
35
+ details: [
36
+ { label: 'Category', value: 'AI' },
37
+ { label: 'Version', value: '1.2.0' }
38
+ ]
39
+ }}
40
+ />
35
41
 
36
- <Story name="Minimal" args={{
37
- title: "Start Node",
38
- }} />
42
+ <Story
43
+ name="Minimal"
44
+ args={{
45
+ title: 'Start Node'
46
+ }}
47
+ />
@@ -11,7 +11,7 @@ declare const ConfigPanel: $$__sveltets_2_IsomorphicComponent<{
11
11
  }, {
12
12
  [evt: string]: CustomEvent<any>;
13
13
  }, {}, {}, string>;
14
- import ConfigPanel from "./ConfigPanel.svelte";
14
+ import ConfigPanel from './ConfigPanel.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 "@storybook/addon-svelte-csf";
3
- import LoadingSpinner from "./LoadingSpinner.svelte";
2
+ import { defineMeta } from '@storybook/addon-svelte-csf';
3
+ import LoadingSpinner from './LoadingSpinner.svelte';
4
4
 
5
5
  const { Story } = defineMeta({
6
- title: "Display/LoadingSpinner",
6
+ title: 'Display/LoadingSpinner',
7
7
  component: LoadingSpinner,
8
- tags: ["autodocs"],
8
+ tags: ['autodocs'],
9
9
  argTypes: {
10
10
  size: {
11
- control: { type: "select" },
12
- options: ["xs", "sm", "md", "lg"],
11
+ control: { type: 'select' },
12
+ options: ['xs', 'sm', 'md', 'lg']
13
13
  },
14
- text: { control: "text" },
15
- showText: { control: "boolean" },
16
- },
14
+ text: { control: 'text' },
15
+ showText: { control: 'boolean' }
16
+ }
17
17
  });
18
18
  </script>
19
19
 
20
20
  <Story name="Default" />
21
21
 
22
- <Story name="Extra Small" args={{ size: "xs" }} />
22
+ <Story name="Extra Small" args={{ size: 'xs' }} />
23
23
 
24
- <Story name="Small" args={{ size: "sm" }} />
24
+ <Story name="Small" args={{ size: 'sm' }} />
25
25
 
26
- <Story name="Large" args={{ size: "lg" }} />
26
+ <Story name="Large" args={{ size: 'lg' }} />
27
27
 
28
- <Story name="Custom Text" args={{ text: "Processing..." }} />
28
+ <Story name="Custom Text" args={{ text: 'Processing...' }} />
29
29
 
30
30
  <Story name="No Text" args={{ showText: false }} />
@@ -11,7 +11,7 @@ declare const LoadingSpinner: $$__sveltets_2_IsomorphicComponent<{
11
11
  }, {
12
12
  [evt: string]: CustomEvent<any>;
13
13
  }, {}, {}, string>;
14
- import LoadingSpinner from "./LoadingSpinner.svelte";
14
+ import LoadingSpinner from './LoadingSpinner.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,11 +1,11 @@
1
1
  <script module>
2
- import { defineMeta } from "@storybook/addon-svelte-csf";
3
- import Logo from "./Logo.svelte";
2
+ import { defineMeta } from '@storybook/addon-svelte-csf';
3
+ import Logo from './Logo.svelte';
4
4
 
5
5
  const { Story } = defineMeta({
6
- title: "Display/Logo",
6
+ title: 'Display/Logo',
7
7
  component: Logo,
8
- tags: ["autodocs"],
8
+ tags: ['autodocs']
9
9
  });
10
10
  </script>
11
11
 
@@ -11,7 +11,7 @@ declare const Logo: $$__sveltets_2_IsomorphicComponent<{
11
11
  }, {
12
12
  [evt: string]: CustomEvent<any>;
13
13
  }, {}, {}, string>;
14
- import Logo from "./Logo.svelte";
14
+ import Logo from './Logo.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;
@@ -7,11 +7,8 @@
7
7
 
8
8
  <script lang="ts">
9
9
  import Icon from '@iconify/svelte';
10
- import { createEventDispatcher } from 'svelte';
11
10
  import type { WorkflowNode as WorkflowNodeType } from '../types/index.js';
12
11
 
13
- const dispatch = createEventDispatcher();
14
-
15
12
  interface LogEntry {
16
13
  timestamp: string;
17
14
  level: string;
@@ -24,19 +21,19 @@
24
21
  logs: LogEntry[];
25
22
  selectedNode?: WorkflowNodeType | null;
26
23
  onClose?: () => void;
24
+ onClear?: () => void;
27
25
  }
28
26
 
29
27
  let props: Props = $props();
30
28
 
29
+ let sidebarRef: HTMLElement | undefined = $state();
30
+
31
31
  // Focus management and body scroll control
32
32
  $effect(() => {
33
33
  if (props.isOpen) {
34
34
  // Focus management - focus the sidebar when it opens
35
35
  setTimeout(() => {
36
- const sidebar = document.querySelector('.logs-sidebar--open');
37
- if (sidebar) {
38
- (sidebar as HTMLElement).focus();
39
- }
36
+ sidebarRef?.focus();
40
37
  }, 100);
41
38
 
42
39
  // Prevent body scroll
@@ -52,7 +49,6 @@
52
49
  */
53
50
  function handleClose(): void {
54
51
  props.onClose?.();
55
- dispatch('close');
56
52
  }
57
53
 
58
54
  /**
@@ -129,7 +125,7 @@
129
125
  * Clear logs
130
126
  */
131
127
  function clearLogs(): void {
132
- dispatch('clear');
128
+ props.onClear?.();
133
129
  }
134
130
 
135
131
  /**
@@ -163,6 +159,7 @@
163
159
 
164
160
  <!-- Sidebar -->
165
161
  <div
162
+ bind:this={sidebarRef}
166
163
  class="logs-sidebar"
167
164
  class:logs-sidebar--open={props.isOpen}
168
165
  role="dialog"
@@ -10,25 +10,8 @@ interface Props {
10
10
  logs: LogEntry[];
11
11
  selectedNode?: WorkflowNodeType | null;
12
12
  onClose?: () => void;
13
+ onClear?: () => void;
13
14
  }
14
- 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> {
15
- new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
16
- $$bindings?: Bindings;
17
- } & Exports;
18
- (internal: unknown, props: Props & {
19
- $$events?: Events;
20
- $$slots?: Slots;
21
- }): Exports & {
22
- $set?: any;
23
- $on?: any;
24
- };
25
- z_$$bindings?: Bindings;
26
- }
27
- declare const LogsSidebar: $$__sveltets_2_IsomorphicComponent<Props, {
28
- close: CustomEvent<any>;
29
- clear: CustomEvent<any>;
30
- } & {
31
- [evt: string]: CustomEvent<any>;
32
- }, {}, {}, "">;
33
- type LogsSidebar = InstanceType<typeof LogsSidebar>;
15
+ declare const LogsSidebar: import("svelte").Component<Props, {}, "">;
16
+ type LogsSidebar = ReturnType<typeof LogsSidebar>;
34
17
  export default LogsSidebar;
@@ -1,21 +1,36 @@
1
1
  <script module>
2
- import { defineMeta } from "@storybook/addon-svelte-csf";
3
- import MarkdownDisplay from "./MarkdownDisplay.svelte";
2
+ import { defineMeta } from '@storybook/addon-svelte-csf';
3
+ import MarkdownDisplay from './MarkdownDisplay.svelte';
4
4
 
5
5
  const { Story } = defineMeta({
6
- title: "Display/MarkdownDisplay",
6
+ title: 'Display/MarkdownDisplay',
7
7
  component: MarkdownDisplay,
8
- tags: ["autodocs"],
8
+ tags: ['autodocs'],
9
9
  argTypes: {
10
- content: { control: "text" },
11
- },
10
+ content: { control: 'text' }
11
+ }
12
12
  });
13
13
  </script>
14
14
 
15
- <Story name="Simple" args={{ content: "Hello **world**! This is *italic* and `inline code`." }} />
15
+ <Story name="Simple" args={{ content: 'Hello **world**! This is *italic* and `inline code`.' }} />
16
16
 
17
- <Story name="Headings" args={{ content: "# Heading 1\n## Heading 2\n### Heading 3\n\nParagraph text below headings." }} />
17
+ <Story
18
+ name="Headings"
19
+ args={{ content: '# Heading 1\n## Heading 2\n### Heading 3\n\nParagraph text below headings.' }}
20
+ />
18
21
 
19
- <Story name="Code Block" args={{ content: "Here is a code example:\n\n```javascript\nconst greeting = \"Hello\";\nconsole.log(greeting);\n```\n\nAnd some text after." }} />
22
+ <Story
23
+ name="Code Block"
24
+ args={{
25
+ content:
26
+ 'Here is a code example:\n\n```javascript\nconst greeting = "Hello";\nconsole.log(greeting);\n```\n\nAnd some text after.'
27
+ }}
28
+ />
20
29
 
21
- <Story name="Full Document" args={{ content: "# Workflow Guide\n\n## Getting Started\n\nFollow these steps:\n\n1. Create a new workflow\n2. Add nodes from the sidebar\n3. Connect nodes with edges\n\n> **Tip:** Use keyboard shortcuts for faster editing.\n\n### Supported Node Types\n\n| Type | Description |\n|------|-------------|\n| Start | Entry point |\n| End | Exit point |\n| Tool | Processing step |\n\nFor more info, visit [the docs](https://example.com)." }} />
30
+ <Story
31
+ name="Full Document"
32
+ args={{
33
+ content:
34
+ '# Workflow Guide\n\n## Getting Started\n\nFollow these steps:\n\n1. Create a new workflow\n2. Add nodes from the sidebar\n3. Connect nodes with edges\n\n> **Tip:** Use keyboard shortcuts for faster editing.\n\n### Supported Node Types\n\n| Type | Description |\n|------|-------------|\n| Start | Entry point |\n| End | Exit point |\n| Tool | Processing step |\n\nFor more info, visit [the docs](https://example.com).'
35
+ }}
36
+ />
@@ -11,7 +11,7 @@ declare const MarkdownDisplay: $$__sveltets_2_IsomorphicComponent<{
11
11
  }, {
12
12
  [evt: string]: CustomEvent<any>;
13
13
  }, {}, {}, string>;
14
- import MarkdownDisplay from "./MarkdownDisplay.svelte";
14
+ import MarkdownDisplay from './MarkdownDisplay.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;