@d34dman/flowdrop 0.0.61 → 0.0.62

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 (204) hide show
  1. package/README.md +6 -0
  2. package/dist/adapters/WorkflowAdapter.d.ts +1 -1
  3. package/dist/adapters/agentspec/AgentSpecAdapter.js +3 -1
  4. package/dist/api/client.d.ts +4 -0
  5. package/dist/api/client.js +6 -1
  6. package/dist/api/enhanced-client.js +7 -6
  7. package/dist/components/App.svelte +143 -219
  8. package/dist/components/CanvasBanner.stories.svelte +25 -0
  9. package/dist/components/CanvasBanner.stories.svelte.d.ts +27 -0
  10. package/dist/components/CanvasBanner.svelte +2 -2
  11. package/dist/components/ConfigForm.svelte +37 -36
  12. package/dist/components/ConfigPanel.stories.svelte +38 -0
  13. package/dist/components/ConfigPanel.stories.svelte.d.ts +27 -0
  14. package/dist/components/ConfigPanel.svelte +2 -2
  15. package/dist/components/ConnectionLine.svelte +2 -2
  16. package/dist/components/FlowDropZone.svelte +18 -2
  17. package/dist/components/FlowDropZone.svelte.d.ts +2 -0
  18. package/dist/components/LoadingSpinner.stories.svelte +30 -0
  19. package/dist/components/LoadingSpinner.stories.svelte.d.ts +27 -0
  20. package/dist/components/Logo.stories.svelte +22 -0
  21. package/dist/components/Logo.stories.svelte.d.ts +27 -0
  22. package/dist/components/Logo.svelte +33 -13
  23. package/dist/components/Logo.svelte.d.ts +1 -1
  24. package/dist/components/MarkdownDisplay.stories.svelte +21 -0
  25. package/dist/components/MarkdownDisplay.stories.svelte.d.ts +27 -0
  26. package/dist/components/MarkdownDisplay.svelte +4 -3
  27. package/dist/components/Navbar.stories.svelte +41 -0
  28. package/dist/components/Navbar.stories.svelte.d.ts +27 -0
  29. package/dist/components/Navbar.svelte +4 -4
  30. package/dist/components/NodeSidebar.svelte +12 -12
  31. package/dist/components/NodeStatusOverlay.stories.svelte +74 -0
  32. package/dist/components/NodeStatusOverlay.stories.svelte.d.ts +27 -0
  33. package/dist/components/PipelineStatus.svelte +11 -4
  34. package/dist/components/PortCoordinateTracker.svelte +1 -1
  35. package/dist/components/SchemaForm.stories.svelte +101 -0
  36. package/dist/components/SchemaForm.stories.svelte.d.ts +27 -0
  37. package/dist/components/SchemaForm.svelte +17 -12
  38. package/dist/components/SettingsModal.svelte +3 -3
  39. package/dist/components/SettingsPanel.svelte +23 -22
  40. package/dist/components/StatusIcon.stories.svelte +60 -0
  41. package/dist/components/StatusIcon.stories.svelte.d.ts +27 -0
  42. package/dist/components/StatusIcon.svelte +7 -0
  43. package/dist/components/StatusLabel.stories.svelte +17 -0
  44. package/dist/components/StatusLabel.stories.svelte.d.ts +27 -0
  45. package/dist/components/ThemeToggle.stories.svelte +25 -0
  46. package/dist/components/ThemeToggle.stories.svelte.d.ts +27 -0
  47. package/dist/components/ThemeToggle.svelte +8 -8
  48. package/dist/components/UniversalNode.svelte +1 -1
  49. package/dist/components/WorkflowEditor.svelte +298 -294
  50. package/dist/components/form/FormAutocomplete.svelte +20 -19
  51. package/dist/components/form/FormCheckboxGroup.stories.svelte +28 -0
  52. package/dist/components/form/FormCheckboxGroup.stories.svelte.d.ts +27 -0
  53. package/dist/components/form/FormField.svelte +3 -3
  54. package/dist/components/form/FormFieldLight.svelte +2 -2
  55. package/dist/components/form/FormFieldWrapper.stories.svelte +31 -0
  56. package/dist/components/form/FormFieldWrapper.stories.svelte.d.ts +27 -0
  57. package/dist/components/form/FormFieldset.svelte +7 -7
  58. package/dist/components/form/FormNumberField.stories.svelte +33 -0
  59. package/dist/components/form/FormNumberField.stories.svelte.d.ts +27 -0
  60. package/dist/components/form/FormRangeField.stories.svelte +31 -0
  61. package/dist/components/form/FormRangeField.stories.svelte.d.ts +27 -0
  62. package/dist/components/form/FormSelect.stories.svelte +50 -0
  63. package/dist/components/form/FormSelect.stories.svelte.d.ts +27 -0
  64. package/dist/components/form/FormTemplateEditor.svelte +2 -1
  65. package/dist/components/form/FormTextField.stories.svelte +30 -0
  66. package/dist/components/form/FormTextField.stories.svelte.d.ts +27 -0
  67. package/dist/components/form/FormTextarea.stories.svelte +31 -0
  68. package/dist/components/form/FormTextarea.stories.svelte.d.ts +27 -0
  69. package/dist/components/form/FormToggle.stories.svelte +30 -0
  70. package/dist/components/form/FormToggle.stories.svelte.d.ts +27 -0
  71. package/dist/components/form/FormUISchemaRenderer.svelte +1 -1
  72. package/dist/components/form/types.d.ts +15 -47
  73. package/dist/components/interrupt/ChoicePrompt.stories.svelte +43 -0
  74. package/dist/components/interrupt/ChoicePrompt.stories.svelte.d.ts +27 -0
  75. package/dist/components/interrupt/ChoicePrompt.svelte +24 -24
  76. package/dist/components/interrupt/ConfirmationPrompt.stories.svelte +49 -0
  77. package/dist/components/interrupt/ConfirmationPrompt.stories.svelte.d.ts +27 -0
  78. package/dist/components/interrupt/ConfirmationPrompt.svelte +19 -19
  79. package/dist/components/interrupt/FormPrompt.svelte +15 -15
  80. package/dist/components/interrupt/InterruptBubble.svelte +202 -236
  81. package/dist/components/interrupt/InterruptBubble.svelte.d.ts +1 -1
  82. package/dist/components/interrupt/ReviewPrompt.stories.svelte +46 -0
  83. package/dist/components/interrupt/ReviewPrompt.stories.svelte.d.ts +27 -0
  84. package/dist/components/interrupt/ReviewPrompt.svelte +842 -0
  85. package/dist/components/interrupt/ReviewPrompt.svelte.d.ts +23 -0
  86. package/dist/components/interrupt/TextInputPrompt.stories.svelte +34 -0
  87. package/dist/components/interrupt/TextInputPrompt.stories.svelte.d.ts +27 -0
  88. package/dist/components/interrupt/TextInputPrompt.svelte +21 -21
  89. package/dist/components/nodes/GatewayNode.stories.svelte +76 -0
  90. package/dist/components/nodes/GatewayNode.stories.svelte.d.ts +26 -0
  91. package/dist/components/nodes/GatewayNode.svelte +19 -17
  92. package/dist/components/nodes/IdeaNode.stories.svelte +48 -0
  93. package/dist/components/nodes/IdeaNode.stories.svelte.d.ts +26 -0
  94. package/dist/components/nodes/IdeaNode.svelte +10 -26
  95. package/dist/components/nodes/NotesNode.stories.svelte +69 -0
  96. package/dist/components/nodes/NotesNode.stories.svelte.d.ts +26 -0
  97. package/dist/components/nodes/NotesNode.svelte +8 -8
  98. package/dist/components/nodes/SimpleNode.stories.svelte +101 -0
  99. package/dist/components/nodes/SimpleNode.stories.svelte.d.ts +26 -0
  100. package/dist/components/nodes/SimpleNode.svelte +16 -24
  101. package/dist/components/nodes/SquareNode.stories.svelte +56 -0
  102. package/dist/components/nodes/SquareNode.stories.svelte.d.ts +26 -0
  103. package/dist/components/nodes/SquareNode.svelte +13 -21
  104. package/dist/components/nodes/TerminalNode.stories.svelte +25 -0
  105. package/dist/components/nodes/TerminalNode.stories.svelte.d.ts +26 -0
  106. package/dist/components/nodes/TerminalNode.svelte +6 -6
  107. package/dist/components/nodes/ToolNode.stories.svelte +71 -0
  108. package/dist/components/nodes/ToolNode.stories.svelte.d.ts +26 -0
  109. package/dist/components/nodes/ToolNode.svelte +7 -15
  110. package/dist/components/nodes/WorkflowNode.stories.svelte +50 -0
  111. package/dist/components/nodes/WorkflowNode.stories.svelte.d.ts +26 -0
  112. package/dist/components/nodes/WorkflowNode.svelte +13 -13
  113. package/dist/components/playground/ChatPanel.svelte +48 -48
  114. package/dist/components/playground/ExecutionLogs.svelte +23 -23
  115. package/dist/components/playground/InputCollector.svelte +24 -24
  116. package/dist/components/playground/MessageBubble.stories.svelte +49 -0
  117. package/dist/components/playground/MessageBubble.stories.svelte.d.ts +27 -0
  118. package/dist/components/playground/MessageBubble.svelte +49 -46
  119. package/dist/components/playground/Playground.svelte +194 -129
  120. package/dist/components/playground/PlaygroundModal.svelte +5 -5
  121. package/dist/components/playground/SessionManager.svelte +26 -26
  122. package/dist/config/constants.d.ts +22 -0
  123. package/dist/config/constants.js +22 -0
  124. package/dist/config/endpoints.d.ts +19 -0
  125. package/dist/config/runtimeConfig.js +2 -1
  126. package/dist/core/index.d.ts +5 -2
  127. package/dist/core/index.js +9 -1
  128. package/dist/editor/index.d.ts +13 -9
  129. package/dist/editor/index.js +15 -11
  130. package/dist/form/code.d.ts +2 -1
  131. package/dist/form/code.js +1 -3
  132. package/dist/form/markdown.d.ts +2 -1
  133. package/dist/form/markdown.js +1 -3
  134. package/dist/helpers/workflowEditorHelper.js +13 -9
  135. package/dist/mocks/app-forms.js +1 -0
  136. package/dist/mocks/app-navigation.js +3 -1
  137. package/dist/mocks/app-stores.d.ts +4 -4
  138. package/dist/playground/index.d.ts +4 -3
  139. package/dist/playground/index.js +12 -10
  140. package/dist/playground/mount.js +6 -13
  141. package/dist/services/agentSpecExecutionService.js +2 -1
  142. package/dist/services/api.js +10 -18
  143. package/dist/services/apiVariableService.js +2 -1
  144. package/dist/services/autoSaveService.d.ts +3 -3
  145. package/dist/services/autoSaveService.js +21 -17
  146. package/dist/services/categoriesApi.js +13 -5
  147. package/dist/services/draftStorage.js +5 -4
  148. package/dist/services/dynamicSchemaService.js +4 -4
  149. package/dist/services/globalSave.d.ts +60 -11
  150. package/dist/services/globalSave.js +160 -83
  151. package/dist/services/historyService.d.ts +2 -1
  152. package/dist/services/historyService.js +7 -3
  153. package/dist/services/interruptService.js +9 -8
  154. package/dist/services/nodeExecutionService.js +14 -6
  155. package/dist/services/playgroundService.js +2 -1
  156. package/dist/services/portConfigApi.js +11 -7
  157. package/dist/services/toastService.d.ts +1 -1
  158. package/dist/services/toastService.js +6 -5
  159. package/dist/services/variableService.js +3 -2
  160. package/dist/settings/index.d.ts +1 -1
  161. package/dist/settings/index.js +1 -1
  162. package/dist/stores/{categoriesStore.d.ts → categoriesStore.svelte.d.ts} +3 -3
  163. package/dist/stores/{categoriesStore.js → categoriesStore.svelte.js} +15 -18
  164. package/dist/stores/editorStateMachine.svelte.d.ts +42 -0
  165. package/dist/stores/editorStateMachine.svelte.js +132 -0
  166. package/dist/stores/{historyStore.d.ts → historyStore.svelte.d.ts} +18 -15
  167. package/dist/stores/{historyStore.js → historyStore.svelte.js} +40 -21
  168. package/dist/stores/{interruptStore.d.ts → interruptStore.svelte.d.ts} +16 -15
  169. package/dist/stores/{interruptStore.js → interruptStore.svelte.js} +85 -94
  170. package/dist/stores/{playgroundStore.d.ts → playgroundStore.svelte.d.ts} +41 -33
  171. package/dist/stores/{playgroundStore.js → playgroundStore.svelte.js} +164 -84
  172. package/dist/stores/{portCoordinateStore.d.ts → portCoordinateStore.svelte.d.ts} +10 -4
  173. package/dist/stores/{portCoordinateStore.js → portCoordinateStore.svelte.js} +38 -35
  174. package/dist/stores/{settingsStore.d.ts → settingsStore.svelte.d.ts} +45 -28
  175. package/dist/stores/{settingsStore.js → settingsStore.svelte.js} +169 -128
  176. package/dist/stores/{workflowStore.d.ts → workflowStore.svelte.d.ts} +101 -65
  177. package/dist/stores/{workflowStore.js → workflowStore.svelte.js} +285 -239
  178. package/dist/stories/CanvasDecorator.svelte +50 -0
  179. package/dist/stories/CanvasDecorator.svelte.d.ts +8 -0
  180. package/dist/stories/NodeDecorator.svelte +74 -0
  181. package/dist/stories/NodeDecorator.svelte.d.ts +8 -0
  182. package/dist/stories/utils.d.ts +93 -0
  183. package/dist/stories/utils.js +122 -0
  184. package/dist/styles/base.css +114 -61
  185. package/dist/styles/toast.css +2 -2
  186. package/dist/styles/tokens.css +250 -185
  187. package/dist/svelte-app.d.ts +0 -6
  188. package/dist/svelte-app.js +13 -31
  189. package/dist/types/index.d.ts +2 -0
  190. package/dist/types/interrupt.d.ts +89 -5
  191. package/dist/types/interrupt.js +13 -1
  192. package/dist/types/playground.d.ts +5 -0
  193. package/dist/types/settings.js +1 -1
  194. package/dist/utils/colors.js +4 -4
  195. package/dist/utils/connections.js +33 -8
  196. package/dist/utils/icons.js +1 -1
  197. package/dist/utils/logger.d.ts +47 -0
  198. package/dist/utils/logger.js +72 -0
  199. package/dist/utils/nodeWrapper.js +1 -1
  200. package/dist/utils/sanitize.d.ts +19 -0
  201. package/dist/utils/sanitize.js +31 -0
  202. package/dist/utils/validation.d.ts +29 -0
  203. package/dist/utils/validation.js +39 -0
  204. package/package.json +243 -232
@@ -41,6 +41,7 @@
41
41
  } from '../services/dynamicSchemaService.js';
42
42
  import { globalSaveWorkflow } from '../services/globalSave.js';
43
43
  import { getAvailableVariables } from '../services/variableService.js';
44
+ import { logger } from '../utils/logger.js';
44
45
 
45
46
  interface Props {
46
47
  /** Optional workflow node (if provided, schema and values are derived from it) */
@@ -404,7 +405,7 @@
404
405
  try {
405
406
  await globalSaveWorkflow();
406
407
  } catch (error) {
407
- console.error('Failed to save workflow after config save:', error);
408
+ logger.error('Failed to save workflow after config save:', error);
408
409
  } finally {
409
410
  isSavingWorkflow = false;
410
411
  }
@@ -702,13 +703,13 @@
702
703
  .config-form {
703
704
  display: flex;
704
705
  flex-direction: column;
705
- gap: var(--fd-space-6);
706
+ gap: var(--fd-space-3xl);
706
707
  }
707
708
 
708
709
  .config-form__fields {
709
710
  display: flex;
710
711
  flex-direction: column;
711
- gap: var(--fd-space-5);
712
+ gap: var(--fd-space-2xl);
712
713
  }
713
714
 
714
715
  /* ============================================
@@ -718,11 +719,11 @@
718
719
 
719
720
  .config-form__footer {
720
721
  display: flex;
721
- gap: var(--fd-space-3);
722
+ gap: var(--fd-space-md);
722
723
  justify-content: flex-end;
723
- padding-top: var(--fd-space-4);
724
+ padding-top: var(--fd-space-xl);
724
725
  border-top: 1px solid var(--fd-border-muted);
725
- margin-top: var(--fd-space-2);
726
+ margin-top: var(--fd-space-xs);
726
727
  }
727
728
 
728
729
  /* Button Spinner */
@@ -744,8 +745,8 @@
744
745
  display: inline-flex;
745
746
  align-items: center;
746
747
  justify-content: center;
747
- gap: var(--fd-space-2);
748
- padding: 0.625rem var(--fd-space-4);
748
+ gap: var(--fd-space-xs);
749
+ padding: 0.625rem var(--fd-space-xl);
749
750
  border-radius: var(--fd-radius-lg);
750
751
  font-size: var(--fd-text-sm);
751
752
  font-weight: 600;
@@ -816,14 +817,14 @@
816
817
  border: 1px solid var(--fd-border);
817
818
  border-radius: var(--fd-radius-lg);
818
819
  overflow: hidden;
819
- margin-top: var(--fd-space-2);
820
+ margin-top: var(--fd-space-xs);
820
821
  }
821
822
 
822
823
  .config-form__extensions-header {
823
824
  display: flex;
824
825
  align-items: center;
825
- gap: var(--fd-space-2);
826
- padding: var(--fd-space-3) var(--fd-space-4);
826
+ gap: var(--fd-space-xs);
827
+ padding: var(--fd-space-md) var(--fd-space-xl);
827
828
  background-color: var(--fd-subtle);
828
829
  border-bottom: 1px solid var(--fd-border);
829
830
  font-size: 0.8125rem;
@@ -838,10 +839,10 @@
838
839
  }
839
840
 
840
841
  .config-form__extensions-content {
841
- padding: var(--fd-space-4);
842
+ padding: var(--fd-space-xl);
842
843
  display: flex;
843
844
  flex-direction: column;
844
- gap: var(--fd-space-4);
845
+ gap: var(--fd-space-xl);
845
846
  }
846
847
 
847
848
  /* ============================================
@@ -858,8 +859,8 @@
858
859
  .config-form__debug-header {
859
860
  display: flex;
860
861
  align-items: center;
861
- gap: var(--fd-space-2);
862
- padding: var(--fd-space-3) var(--fd-space-4);
862
+ gap: var(--fd-space-xs);
863
+ padding: var(--fd-space-md) var(--fd-space-xl);
863
864
  background-color: var(--fd-warning-muted);
864
865
  border-bottom: 1px solid var(--fd-warning);
865
866
  font-size: 0.8125rem;
@@ -874,7 +875,7 @@
874
875
 
875
876
  .config-form__debug-content {
876
877
  margin: 0;
877
- padding: var(--fd-space-4);
878
+ padding: var(--fd-space-xl);
878
879
  font-size: var(--fd-text-xs);
879
880
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
880
881
  color: var(--fd-foreground);
@@ -892,14 +893,14 @@
892
893
  flex-direction: column;
893
894
  align-items: center;
894
895
  justify-content: center;
895
- padding: var(--fd-space-12) var(--fd-space-6);
896
+ padding: var(--fd-space-6xl) var(--fd-space-3xl);
896
897
  text-align: center;
897
898
  }
898
899
 
899
900
  .config-form__empty-icon {
900
901
  width: 3rem;
901
902
  height: 3rem;
902
- margin-bottom: var(--fd-space-4);
903
+ margin-bottom: var(--fd-space-xl);
903
904
  color: var(--fd-border);
904
905
  }
905
906
 
@@ -917,7 +918,7 @@
917
918
  }
918
919
 
919
920
  .config-form__empty-button {
920
- margin-top: var(--fd-space-4);
921
+ margin-top: var(--fd-space-xl);
921
922
  }
922
923
 
923
924
  /* ============================================
@@ -929,14 +930,14 @@
929
930
  border: 1px solid var(--fd-primary);
930
931
  border-radius: 0.625rem;
931
932
  overflow: hidden;
932
- margin-bottom: var(--fd-space-4);
933
+ margin-bottom: var(--fd-space-xl);
933
934
  }
934
935
 
935
936
  .config-form__admin-edit-header {
936
937
  display: flex;
937
938
  align-items: center;
938
- gap: var(--fd-space-2);
939
- padding: var(--fd-space-3) var(--fd-space-4);
939
+ gap: var(--fd-space-xs);
940
+ padding: var(--fd-space-md) var(--fd-space-xl);
940
941
  background: linear-gradient(135deg, var(--fd-primary-muted) 0%, var(--fd-primary-muted) 100%);
941
942
  border-bottom: 1px solid var(--fd-primary);
942
943
  font-size: 0.8125rem;
@@ -951,10 +952,10 @@
951
952
  }
952
953
 
953
954
  .config-form__admin-edit-content {
954
- padding: var(--fd-space-4);
955
+ padding: var(--fd-space-xl);
955
956
  display: flex;
956
957
  flex-direction: column;
957
- gap: var(--fd-space-3);
958
+ gap: var(--fd-space-md);
958
959
  }
959
960
 
960
961
  .config-form__admin-edit-description {
@@ -973,8 +974,8 @@
973
974
  flex-direction: column;
974
975
  align-items: center;
975
976
  justify-content: center;
976
- padding: var(--fd-space-12) var(--fd-space-6);
977
- gap: var(--fd-space-4);
977
+ padding: var(--fd-space-6xl) var(--fd-space-3xl);
978
+ gap: var(--fd-space-xl);
978
979
  }
979
980
 
980
981
  .config-form__loading-spinner {
@@ -1012,8 +1013,8 @@
1012
1013
  .config-form__error-header {
1013
1014
  display: flex;
1014
1015
  align-items: center;
1015
- gap: var(--fd-space-2);
1016
- padding: var(--fd-space-3) var(--fd-space-4);
1016
+ gap: var(--fd-space-xs);
1017
+ padding: var(--fd-space-md) var(--fd-space-xl);
1017
1018
  background-color: var(--fd-error-muted);
1018
1019
  border-bottom: 1px solid var(--fd-error);
1019
1020
  font-size: 0.8125rem;
@@ -1028,10 +1029,10 @@
1028
1029
  }
1029
1030
 
1030
1031
  .config-form__error-content {
1031
- padding: var(--fd-space-4);
1032
+ padding: var(--fd-space-xl);
1032
1033
  display: flex;
1033
1034
  flex-direction: column;
1034
- gap: var(--fd-space-3);
1035
+ gap: var(--fd-space-md);
1035
1036
  }
1036
1037
 
1037
1038
  .config-form__error-message {
@@ -1043,7 +1044,7 @@
1043
1044
 
1044
1045
  .config-form__error-actions {
1045
1046
  display: flex;
1046
- gap: var(--fd-space-2);
1047
+ gap: var(--fd-space-xs);
1047
1048
  flex-wrap: wrap;
1048
1049
  }
1049
1050
 
@@ -1053,9 +1054,9 @@
1053
1054
 
1054
1055
  .config-form__schema-actions {
1055
1056
  display: flex;
1056
- gap: var(--fd-space-2);
1057
- margin-bottom: var(--fd-space-4);
1058
- padding-bottom: var(--fd-space-3);
1057
+ gap: var(--fd-space-xs);
1058
+ margin-bottom: var(--fd-space-xl);
1059
+ padding-bottom: var(--fd-space-md);
1059
1060
  border-bottom: 1px solid var(--fd-border-muted);
1060
1061
  }
1061
1062
 
@@ -1063,8 +1064,8 @@
1063
1064
  .config-form__schema-external {
1064
1065
  display: inline-flex;
1065
1066
  align-items: center;
1066
- gap: var(--fd-space-1);
1067
- padding: var(--fd-space-1) var(--fd-space-2);
1067
+ gap: var(--fd-space-3xs);
1068
+ padding: var(--fd-space-3xs) var(--fd-space-xs);
1068
1069
  font-size: var(--fd-text-xs);
1069
1070
  font-weight: 500;
1070
1071
  font-family: inherit;
@@ -0,0 +1,38 @@
1
+ <script module>
2
+ import { defineMeta } from "@storybook/addon-svelte-csf";
3
+ import ConfigPanel from "./ConfigPanel.svelte";
4
+ import { fn } from "storybook/test";
5
+
6
+ const { Story } = defineMeta({
7
+ title: "Editor/ConfigPanel",
8
+ component: ConfigPanel,
9
+ tags: ["autodocs"],
10
+ parameters: {
11
+ layout: "padded",
12
+ },
13
+ args: {
14
+ onClose: fn(),
15
+ },
16
+ });
17
+ </script>
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
+ }} />
25
+
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
+ }} />
35
+
36
+ <Story name="Minimal" args={{
37
+ title: "Start Node",
38
+ }} />
@@ -0,0 +1,27 @@
1
+ export default ConfigPanel;
2
+ type ConfigPanel = SvelteComponent<{
3
+ [x: string]: never;
4
+ }, {
5
+ [evt: string]: CustomEvent<any>;
6
+ }, {}> & {
7
+ $$bindings?: string | undefined;
8
+ };
9
+ declare const ConfigPanel: $$__sveltets_2_IsomorphicComponent<{
10
+ [x: string]: never;
11
+ }, {
12
+ [evt: string]: CustomEvent<any>;
13
+ }, {}, {}, string>;
14
+ import ConfigPanel from "./ConfigPanel.svelte";
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
+ new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
17
+ $$bindings?: Bindings;
18
+ } & Exports;
19
+ (internal: unknown, props: {
20
+ $$events?: Events;
21
+ $$slots?: Slots;
22
+ }): Exports & {
23
+ $set?: any;
24
+ $on?: any;
25
+ };
26
+ z_$$bindings?: Bindings;
27
+ }
@@ -9,7 +9,7 @@
9
9
  <script lang="ts">
10
10
  import type { Snippet } from 'svelte';
11
11
  import ReadOnlyDetails from './ReadOnlyDetails.svelte';
12
- import { uiSettings } from '../stores/settingsStore.js';
12
+ import { getUiSettings } from '../stores/settingsStore.svelte.js';
13
13
 
14
14
  /**
15
15
  * A single detail item with label and value
@@ -57,7 +57,7 @@
57
57
  const hasDetails = $derived(id !== undefined || details.length > 0 || description !== undefined);
58
58
  </script>
59
59
 
60
- <div class="config-panel" class:config-panel--compact={$uiSettings.compactMode}>
60
+ <div class="config-panel" class:config-panel--compact={getUiSettings().compactMode}>
61
61
  <!-- Header -->
62
62
  <div class="config-panel__header">
63
63
  <h2 class="config-panel__title">{title}</h2>
@@ -18,7 +18,7 @@
18
18
  fill="none"
19
19
  stroke-width={1.5}
20
20
  class="animated"
21
- stroke={getDataTypeColor(connection.current.fromHandle.id)}
21
+ stroke={getDataTypeColor(connection.current.fromHandle.id ?? '')}
22
22
  d={path}
23
23
  />
24
24
  <circle
@@ -26,7 +26,7 @@
26
26
  cy={connection.current.to.y}
27
27
  fill="#fff"
28
28
  r={3}
29
- stroke={getDataTypeColor(connection.current.fromHandle.id)}
29
+ stroke={getDataTypeColor(connection.current.fromHandle.id ?? '')}
30
30
  stroke-width={1.5}
31
31
  />
32
32
  {/if}
@@ -10,6 +10,8 @@
10
10
 
11
11
  interface Props {
12
12
  ondrop: (nodeTypeData: string, position: { x: number; y: number }) => void;
13
+ /** Optional callback invoked when a JSON file is dropped onto the canvas. */
14
+ onfiledrop?: (file: File) => void;
13
15
  children: Snippet;
14
16
  }
15
17
 
@@ -29,12 +31,26 @@
29
31
  }
30
32
 
31
33
  /**
32
- * Handle drop event with proper coordinate transformation
34
+ * Handle drop event with proper coordinate transformation.
35
+ *
36
+ * If the drag event carries a JSON file (e.g. a workflow file dragged from the OS),
37
+ * the `onfiledrop` callback is invoked with the file.
38
+ * Otherwise the node-type drop path is used as before.
33
39
  */
34
40
  function handleDrop(e: DragEvent): void {
35
41
  e.preventDefault();
36
42
 
37
- // Get the data from the drag event
43
+ // Check if the drop contains files (e.g. a workflow JSON file from the OS)
44
+ const files = e.dataTransfer?.files;
45
+ if (files && files.length > 0) {
46
+ const file = files[0];
47
+ if (props.onfiledrop && (file.type === 'application/json' || file.name.endsWith('.json'))) {
48
+ props.onfiledrop(file);
49
+ }
50
+ return;
51
+ }
52
+
53
+ // Get the data from the drag event (node type dropped from sidebar)
38
54
  const nodeTypeData = e.dataTransfer?.getData('application/json');
39
55
  if (nodeTypeData) {
40
56
  // Convert screen coordinates to flow coordinates (accounts for zoom and pan)
@@ -4,6 +4,8 @@ interface Props {
4
4
  x: number;
5
5
  y: number;
6
6
  }) => void;
7
+ /** Optional callback invoked when a JSON file is dropped onto the canvas. */
8
+ onfiledrop?: (file: File) => void;
7
9
  children: Snippet;
8
10
  }
9
11
  declare const FlowDropZone: import("svelte").Component<Props, {}, "">;
@@ -0,0 +1,30 @@
1
+ <script module>
2
+ import { defineMeta } from "@storybook/addon-svelte-csf";
3
+ import LoadingSpinner from "./LoadingSpinner.svelte";
4
+
5
+ const { Story } = defineMeta({
6
+ title: "Display/LoadingSpinner",
7
+ component: LoadingSpinner,
8
+ tags: ["autodocs"],
9
+ argTypes: {
10
+ size: {
11
+ control: { type: "select" },
12
+ options: ["xs", "sm", "md", "lg"],
13
+ },
14
+ text: { control: "text" },
15
+ showText: { control: "boolean" },
16
+ },
17
+ });
18
+ </script>
19
+
20
+ <Story name="Default" />
21
+
22
+ <Story name="Extra Small" args={{ size: "xs" }} />
23
+
24
+ <Story name="Small" args={{ size: "sm" }} />
25
+
26
+ <Story name="Large" args={{ size: "lg" }} />
27
+
28
+ <Story name="Custom Text" args={{ text: "Processing..." }} />
29
+
30
+ <Story name="No Text" args={{ showText: false }} />
@@ -0,0 +1,27 @@
1
+ export default LoadingSpinner;
2
+ type LoadingSpinner = SvelteComponent<{
3
+ [x: string]: never;
4
+ }, {
5
+ [evt: string]: CustomEvent<any>;
6
+ }, {}> & {
7
+ $$bindings?: string | undefined;
8
+ };
9
+ declare const LoadingSpinner: $$__sveltets_2_IsomorphicComponent<{
10
+ [x: string]: never;
11
+ }, {
12
+ [evt: string]: CustomEvent<any>;
13
+ }, {}, {}, string>;
14
+ import LoadingSpinner from "./LoadingSpinner.svelte";
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
+ new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
17
+ $$bindings?: Bindings;
18
+ } & Exports;
19
+ (internal: unknown, props: {
20
+ $$events?: Events;
21
+ $$slots?: Slots;
22
+ }): Exports & {
23
+ $set?: any;
24
+ $on?: any;
25
+ };
26
+ z_$$bindings?: Bindings;
27
+ }
@@ -0,0 +1,22 @@
1
+ <script module>
2
+ import { defineMeta } from "@storybook/addon-svelte-csf";
3
+ import Logo from "./Logo.svelte";
4
+
5
+ const { Story } = defineMeta({
6
+ title: "Display/Logo",
7
+ component: Logo,
8
+ tags: ["autodocs"],
9
+ });
10
+ </script>
11
+
12
+ <Story name="Default">
13
+ <div style="width: 64px; height: 64px;">
14
+ <Logo />
15
+ </div>
16
+ </Story>
17
+
18
+ <Story name="Large">
19
+ <div style="width: 128px; height: 128px;">
20
+ <Logo />
21
+ </div>
22
+ </Story>
@@ -0,0 +1,27 @@
1
+ export default Logo;
2
+ type Logo = SvelteComponent<{
3
+ [x: string]: never;
4
+ }, {
5
+ [evt: string]: CustomEvent<any>;
6
+ }, {}> & {
7
+ $$bindings?: string | undefined;
8
+ };
9
+ declare const Logo: $$__sveltets_2_IsomorphicComponent<{
10
+ [x: string]: never;
11
+ }, {
12
+ [evt: string]: CustomEvent<any>;
13
+ }, {}, {}, string>;
14
+ import Logo from "./Logo.svelte";
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
+ new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
17
+ $$bindings?: Bindings;
18
+ } & Exports;
19
+ (internal: unknown, props: {
20
+ $$events?: Events;
21
+ $$slots?: Slots;
22
+ }): Exports & {
23
+ $set?: any;
24
+ $on?: any;
25
+ };
26
+ z_$$bindings?: Bindings;
27
+ }
@@ -10,7 +10,7 @@
10
10
  <defs id="defs2"></defs>
11
11
  <g id="g6669-7-7-3-3" transform="translate(472.2413,571.30469)">
12
12
  <rect
13
- style="fill:#f9f9f9;stroke:#000000;stroke-width:10px"
13
+ style="fill:var(--logo-bg);stroke:var(--logo-stroke);stroke-width:10px"
14
14
  x="-462.2413"
15
15
  y="-561.30469"
16
16
  width="480"
@@ -21,39 +21,39 @@
21
21
  />
22
22
  <g id="g6893-4-9-5-2" transform="matrix(1.2053353,0,0,1.2053353,-1246.7763,-599.46548)">
23
23
  <path
24
- style="fill:#000000;stroke-width:10;stroke-dasharray:none"
25
- d="M 850,120 V 310 Z"
24
+ style="fill:var(--logo-line-fill);stroke:var(--logo-stroke);stroke-width:10;stroke-dasharray:none;stroke-opacity:1"
25
+ d="M 849.61489,153.69711 850,298.31429 Z"
26
26
  id="path1152-1-7-1-4"
27
27
  />
28
28
  <path
29
- style="fill:#000000;stroke:#000000;stroke-width:8.29645;stroke-dasharray:none;stroke-opacity:1"
30
- d="M 850,110 V 310"
29
+ style="fill:var(--logo-line-fill);stroke:var(--logo-stroke);stroke-width:8.29645;stroke-dasharray:none;stroke-opacity:1"
30
+ d="m 849.08332,152.77665 0.82965,145.18782"
31
31
  id="path1160-08-5-7-1"
32
32
  />
33
33
  <path
34
- style="fill:none;stroke:#000000;stroke-width:7.49273;stroke-dasharray:none;stroke-opacity:1"
35
- d="m 850,158.973 v 36.70355 8.15635 c 0,0 1.19184,39.5038 -36.01255,65.25076 -29.46481,20.39086 -52.3819,16.31269 -55.65576,65.25076 v 44.8599"
34
+ style="fill:none;stroke:var(--logo-stroke);stroke-width:7.49273;stroke-dasharray:none;stroke-opacity:1"
35
+ d="m 850,158.973 v 36.70355 8.15635 c 0,0 1.19184,39.5038 -36.01255,65.25076 -29.46481,20.39086 -52.3819,16.31269 -55.65576,65.25076 l -0.50928,5.11228"
36
36
  id="path6610-14-5-4-8"
37
37
  />
38
38
  <path
39
- style="fill:none;stroke:#000000;stroke-width:7.5253;stroke-dasharray:none;stroke-opacity:1"
40
- d="m 850,158.973 v 37.02335 8.22741 c 0,0 -1.19184,39.84799 36.01255,65.81929 29.46481,20.56853 52.3819,16.45482 55.65576,65.81929 v 45.25076"
39
+ style="fill:none;stroke:var(--logo-stroke);stroke-width:7.5253;stroke-dasharray:none;stroke-opacity:1"
40
+ d="m 850,158.973 v 37.02335 8.22741 c 0,0 -1.19184,39.84799 36.01255,65.81929 29.46481,20.56853 52.3819,16.45482 55.65576,65.81929 l -0.49443,4.414"
41
41
  id="path6610-14-7-2-5-2"
42
42
  />
43
43
  <path
44
44
  d="m 849.41763,64.456369 25.36824,31.087262 c 6.23336,6.364119 10.06921,15.063569 10.06921,24.656839 0,19.50109 -15.85132,35.30988 -35.42373,35.30988 -19.57241,0 -35.43242,-15.80879 -35.43242,-35.30988 0,-9.49405 3.75813,-18.11351 9.87536,-24.458879 z"
45
- style="fill:#009cde;stroke:#000000;stroke-width:8.29645;stroke-dasharray:none;paint-order:fill"
45
+ style="fill:var(--logo-drop);stroke:var(--logo-stroke);stroke-width:8.29645;stroke-dasharray:none;paint-order:fill"
46
46
  id="path21-6-4-4-1-6"
47
47
  />
48
48
  <circle
49
- style="fill:#f46351;stroke:#000000;stroke-width:8.29645;stroke-dasharray:none"
49
+ style="fill:var(--logo-circle);stroke:var(--logo-stroke);stroke-width:8.29645;stroke-dasharray:none"
50
50
  cx="849.427"
51
51
  cy="326.5929"
52
52
  id="ellipse23-6-57-9-4-0"
53
53
  r="30"
54
54
  />
55
55
  <ellipse
56
- style="fill:#ccbaf4;stroke:#000000;stroke-width:8.29645;stroke-dasharray:none"
56
+ style="fill:var(--logo-left);stroke:var(--logo-stroke);stroke-width:8.29645;stroke-dasharray:none"
57
57
  cx="759.99994"
58
58
  cy="369.44669"
59
59
  id="ellipse25-7-9-4-6-3"
@@ -61,7 +61,7 @@
61
61
  ry="30.000004"
62
62
  />
63
63
  <ellipse
64
- style="fill:#ffc423;stroke:#000000;stroke-width:8.29645;stroke-dasharray:none"
64
+ style="fill:var(--logo-right);stroke:var(--logo-stroke);stroke-width:8.29645;stroke-dasharray:none"
65
65
  cx="939.99963"
66
66
  cy="369.44669"
67
67
  id="ellipse27-8-8-4-0-9"
@@ -75,6 +75,26 @@
75
75
  </div>
76
76
 
77
77
  <style>
78
+ .flowdrop-logo {
79
+ --logo-bg: #f9f9f9;
80
+ --logo-stroke: #000000;
81
+ --logo-line-fill: #000000;
82
+ --logo-drop: #009cde;
83
+ --logo-circle: #f46351;
84
+ --logo-left: #ccbaf4;
85
+ --logo-right: #ffc423;
86
+ }
87
+
88
+ :global([data-theme='dark']) .flowdrop-logo {
89
+ --logo-bg: none;
90
+ --logo-stroke: #ffffff;
91
+ --logo-line-fill: none;
92
+ --logo-drop: none;
93
+ --logo-circle: none;
94
+ --logo-left: none;
95
+ --logo-right: none;
96
+ }
97
+
78
98
  .flowdrop-logo :global(svg) {
79
99
  width: 100%;
80
100
  height: 100%;
@@ -4,7 +4,7 @@ type Logo = SvelteComponent<{
4
4
  }, {
5
5
  [evt: string]: CustomEvent<any>;
6
6
  }, {}> & {
7
- $$bindings?: string;
7
+ $$bindings?: string | undefined;
8
8
  };
9
9
  declare const Logo: $$__sveltets_2_IsomorphicComponent<{
10
10
  [x: string]: never;
@@ -0,0 +1,21 @@
1
+ <script module>
2
+ import { defineMeta } from "@storybook/addon-svelte-csf";
3
+ import MarkdownDisplay from "./MarkdownDisplay.svelte";
4
+
5
+ const { Story } = defineMeta({
6
+ title: "Display/MarkdownDisplay",
7
+ component: MarkdownDisplay,
8
+ tags: ["autodocs"],
9
+ argTypes: {
10
+ content: { control: "text" },
11
+ },
12
+ });
13
+ </script>
14
+
15
+ <Story name="Simple" args={{ content: "Hello **world**! This is *italic* and `inline code`." }} />
16
+
17
+ <Story name="Headings" args={{ content: "# Heading 1\n## Heading 2\n### Heading 3\n\nParagraph text below headings." }} />
18
+
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." }} />
20
+
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)." }} />
@@ -0,0 +1,27 @@
1
+ export default MarkdownDisplay;
2
+ type MarkdownDisplay = SvelteComponent<{
3
+ [x: string]: never;
4
+ }, {
5
+ [evt: string]: CustomEvent<any>;
6
+ }, {}> & {
7
+ $$bindings?: string | undefined;
8
+ };
9
+ declare const MarkdownDisplay: $$__sveltets_2_IsomorphicComponent<{
10
+ [x: string]: never;
11
+ }, {
12
+ [evt: string]: CustomEvent<any>;
13
+ }, {}, {}, string>;
14
+ import MarkdownDisplay from "./MarkdownDisplay.svelte";
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
+ new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
17
+ $$bindings?: Bindings;
18
+ } & Exports;
19
+ (internal: unknown, props: {
20
+ $$events?: Events;
21
+ $$slots?: Slots;
22
+ }): Exports & {
23
+ $set?: any;
24
+ $on?: any;
25
+ };
26
+ z_$$bindings?: Bindings;
27
+ }
@@ -6,6 +6,7 @@
6
6
 
7
7
  <script lang="ts">
8
8
  import { marked } from 'marked';
9
+ import { sanitizeHtml } from '../utils/sanitize.js';
9
10
 
10
11
  interface Props {
11
12
  content: string;
@@ -14,15 +15,15 @@
14
15
 
15
16
  let props: Props = $props();
16
17
 
17
- // Parse markdown content
18
- let renderedContent = $derived(marked.parse(props.content || ''));
18
+ // Parse markdown content and sanitize to prevent XSS
19
+ let renderedContent = $derived(sanitizeHtml(marked.parse(props.content || '') as string));
19
20
 
20
21
  // Default class name if none provided
21
22
  let displayClass = $derived(props.className || 'markdown-display');
22
23
  </script>
23
24
 
24
25
  <div class={displayClass}>
25
- <!-- marked.js sanitizes content by default to prevent XSS attacks -->
26
+ <!-- Content is sanitized with DOMPurify to prevent XSS -->
26
27
  <!-- eslint-disable-next-line svelte/no-at-html-tags -->
27
28
  {@html renderedContent}
28
29
  </div>