@d34dman/flowdrop 0.0.21 → 0.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/App.svelte +69 -260
- package/dist/components/ConfigForm.svelte +357 -267
- package/dist/components/ConfigForm.svelte.d.ts +12 -3
- package/dist/components/ConfigPanel.svelte +160 -0
- package/dist/components/ConfigPanel.svelte.d.ts +32 -0
- package/dist/components/ReadOnlyDetails.svelte +168 -0
- package/dist/components/ReadOnlyDetails.svelte.d.ts +25 -0
- package/dist/components/WorkflowEditor.svelte +1 -1
- package/dist/components/form/FormArray.svelte +1049 -0
- package/dist/components/form/FormArray.svelte.d.ts +22 -0
- package/dist/components/form/FormCheckboxGroup.svelte +152 -0
- package/dist/components/form/FormCheckboxGroup.svelte.d.ts +15 -0
- package/dist/components/form/FormField.svelte +279 -0
- package/dist/components/form/FormField.svelte.d.ts +18 -0
- package/dist/components/form/FormFieldWrapper.svelte +133 -0
- package/dist/components/form/FormFieldWrapper.svelte.d.ts +18 -0
- package/dist/components/form/FormNumberField.svelte +109 -0
- package/dist/components/form/FormNumberField.svelte.d.ts +23 -0
- package/dist/components/form/FormSelect.svelte +126 -0
- package/dist/components/form/FormSelect.svelte.d.ts +18 -0
- package/dist/components/form/FormTextField.svelte +88 -0
- package/dist/components/form/FormTextField.svelte.d.ts +17 -0
- package/dist/components/form/FormTextarea.svelte +94 -0
- package/dist/components/form/FormTextarea.svelte.d.ts +19 -0
- package/dist/components/form/FormToggle.svelte +123 -0
- package/dist/components/form/FormToggle.svelte.d.ts +17 -0
- package/dist/components/form/index.d.ts +41 -0
- package/dist/components/form/index.js +45 -0
- package/dist/components/form/types.d.ts +208 -0
- package/dist/components/form/types.js +29 -0
- package/dist/components/nodes/GatewayNode.svelte +84 -12
- package/dist/components/nodes/NotesNode.svelte +89 -307
- package/dist/components/nodes/NotesNode.svelte.d.ts +3 -22
- package/dist/components/nodes/SimpleNode.svelte +41 -5
- package/dist/components/nodes/SimpleNode.svelte.d.ts +2 -1
- package/dist/components/nodes/SquareNode.svelte +41 -5
- package/dist/components/nodes/SquareNode.svelte.d.ts +2 -1
- package/dist/components/nodes/WorkflowNode.svelte +88 -5
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -4
- package/dist/stores/workflowStore.d.ts +15 -0
- package/dist/stores/workflowStore.js +28 -0
- package/dist/types/index.d.ts +77 -0
- package/dist/types/index.js +16 -0
- package/package.json +3 -3
- package/dist/components/ConfigSidebar.svelte +0 -916
- package/dist/components/ConfigSidebar.svelte.d.ts +0 -51
- package/dist/config/demo.d.ts +0 -58
- package/dist/config/demo.js +0 -142
- package/dist/data/samples.d.ts +0 -51
- package/dist/data/samples.js +0 -3245
|
@@ -10,12 +10,11 @@
|
|
|
10
10
|
import MainLayout from './layouts/MainLayout.svelte';
|
|
11
11
|
import WorkflowEditor from './WorkflowEditor.svelte';
|
|
12
12
|
import NodeSidebar from './NodeSidebar.svelte';
|
|
13
|
-
import ConfigSidebar from './ConfigSidebar.svelte';
|
|
14
13
|
import ConfigForm from './ConfigForm.svelte';
|
|
14
|
+
import ConfigPanel from './ConfigPanel.svelte';
|
|
15
15
|
import Navbar from './Navbar.svelte';
|
|
16
16
|
import { api, setEndpointConfig } from '../services/api.js';
|
|
17
|
-
import type { NodeMetadata, Workflow, WorkflowNode, ConfigSchema } from '../types/index.js';
|
|
18
|
-
import { sampleNodes } from '../data/samples.js';
|
|
17
|
+
import type { NodeMetadata, Workflow, WorkflowNode, ConfigSchema, NodeUIExtensions } from '../types/index.js';
|
|
19
18
|
import { createEndpointConfig } from '../config/endpoints.js';
|
|
20
19
|
import type { EndpointConfig } from '../config/endpoints.js';
|
|
21
20
|
import type { AuthProvider } from '../types/auth.js';
|
|
@@ -138,6 +137,7 @@
|
|
|
138
137
|
type: 'string',
|
|
139
138
|
title: 'Description',
|
|
140
139
|
description: 'A description of the workflow',
|
|
140
|
+
format: 'multiline',
|
|
141
141
|
default: ''
|
|
142
142
|
}
|
|
143
143
|
},
|
|
@@ -204,20 +204,20 @@
|
|
|
204
204
|
'fetchNodes'
|
|
205
205
|
);
|
|
206
206
|
if (suppressToast) {
|
|
207
|
-
// Parent handled the error,
|
|
208
|
-
nodes =
|
|
207
|
+
// Parent handled the error, keep nodes empty
|
|
208
|
+
nodes = [];
|
|
209
209
|
return;
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
212
|
|
|
213
|
-
// Show error
|
|
214
|
-
error = `API Error: ${errorMessage}.
|
|
213
|
+
// Show error and set empty nodes array (no fallback to sample data)
|
|
214
|
+
error = `API Error: ${errorMessage}. No node types available.`;
|
|
215
215
|
if (features.showToasts) {
|
|
216
216
|
apiToasts.error('Load node types', errorMessage);
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
-
//
|
|
220
|
-
nodes =
|
|
219
|
+
// Set empty nodes array instead of fallback data
|
|
220
|
+
nodes = [];
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
|
|
@@ -631,121 +631,69 @@
|
|
|
631
631
|
<!-- Right Sidebar: Configuration or Workflow Settings -->
|
|
632
632
|
{#snippet rightSidebar()}
|
|
633
633
|
{#if isWorkflowSettingsOpen}
|
|
634
|
-
<
|
|
635
|
-
isOpen={isWorkflowSettingsOpen}
|
|
634
|
+
<ConfigPanel
|
|
636
635
|
title="Workflow Settings"
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
636
|
+
id={$workflowStore?.id}
|
|
637
|
+
details={[
|
|
638
|
+
{ label: 'Nodes', value: String($workflowStore?.nodes?.length ?? 0) },
|
|
639
|
+
{ label: 'Connections', value: String($workflowStore?.edges?.length ?? 0) }
|
|
640
|
+
]}
|
|
641
|
+
configTitle="Settings"
|
|
640
642
|
onClose={() => (isWorkflowSettingsOpen = false)}
|
|
641
|
-
|
|
643
|
+
>
|
|
644
|
+
<ConfigForm
|
|
645
|
+
schema={workflowConfigSchema}
|
|
646
|
+
values={workflowConfigValues}
|
|
647
|
+
showUIExtensions={false}
|
|
648
|
+
onSave={handleWorkflowSave}
|
|
649
|
+
onCancel={() => (isWorkflowSettingsOpen = false)}
|
|
650
|
+
/>
|
|
651
|
+
</ConfigPanel>
|
|
642
652
|
{:else if selectedNodeForConfig()}
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
653
|
+
{@const currentNode = selectedNodeForConfig()}
|
|
654
|
+
<ConfigPanel
|
|
655
|
+
title={currentNode.data.label}
|
|
656
|
+
id={currentNode.id}
|
|
657
|
+
description={currentNode.data.metadata?.description || 'Node configuration'}
|
|
658
|
+
details={[
|
|
659
|
+
{ label: 'Type', value: currentNode.data.metadata?.type || currentNode.type },
|
|
660
|
+
{ label: 'Category', value: currentNode.data.metadata?.category || 'general' }
|
|
661
|
+
]}
|
|
662
|
+
onClose={closeConfigSidebar}
|
|
663
|
+
>
|
|
664
|
+
<ConfigForm
|
|
665
|
+
node={currentNode}
|
|
666
|
+
onSave={(updatedConfig, uiExtensions?: NodeUIExtensions) => {
|
|
667
|
+
if (selectedNodeId && currentNode) {
|
|
668
|
+
// Build the updated node data
|
|
669
|
+
const updatedData = {
|
|
670
|
+
...currentNode.data,
|
|
671
|
+
config: updatedConfig
|
|
672
|
+
};
|
|
673
|
+
|
|
674
|
+
// Include UI extensions if provided
|
|
675
|
+
if (uiExtensions) {
|
|
676
|
+
updatedData.extensions = {
|
|
677
|
+
...currentNode.data.extensions,
|
|
678
|
+
ui: uiExtensions
|
|
679
|
+
};
|
|
680
|
+
}
|
|
655
681
|
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
<button
|
|
672
|
-
class="flowdrop-config-sidebar__copy-btn"
|
|
673
|
-
onclick={() => {
|
|
674
|
-
navigator.clipboard.writeText(selectedNodeForConfig().id);
|
|
675
|
-
}}
|
|
676
|
-
title="Copy Node ID"
|
|
677
|
-
aria-label="Copy node ID to clipboard"
|
|
678
|
-
>
|
|
679
|
-
<svg
|
|
680
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
681
|
-
fill="none"
|
|
682
|
-
role="img"
|
|
683
|
-
width="1em"
|
|
684
|
-
height="1em"
|
|
685
|
-
viewBox="0 0 24 24"
|
|
686
|
-
stroke-width="1.5"
|
|
687
|
-
stroke="currentColor"
|
|
688
|
-
class="size-6"
|
|
689
|
-
>
|
|
690
|
-
<path
|
|
691
|
-
stroke-linecap="round"
|
|
692
|
-
stroke-linejoin="round"
|
|
693
|
-
d="M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75 2.25 2.25 0 0 0-.1-.664m-5.8 0A2.251 2.251 0 0 1 13.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25ZM6.75 12h.008v.008H6.75V12Zm0 3h.008v.008H6.75V15Zm0 3h.008v.008H6.75V18Z"
|
|
694
|
-
/>
|
|
695
|
-
</svg>
|
|
696
|
-
</button>
|
|
697
|
-
</div>
|
|
698
|
-
</div>
|
|
699
|
-
<div class="flowdrop-config-sidebar__detail">
|
|
700
|
-
<span class="flowdrop-config-sidebar__detail-label">Type:</span>
|
|
701
|
-
<span class="flowdrop-config-sidebar__detail-value"
|
|
702
|
-
>{selectedNodeForConfig().data.metadata?.type ||
|
|
703
|
-
selectedNodeForConfig().type}</span
|
|
704
|
-
>
|
|
705
|
-
</div>
|
|
706
|
-
<div class="flowdrop-config-sidebar__detail">
|
|
707
|
-
<span class="flowdrop-config-sidebar__detail-label">Category:</span>
|
|
708
|
-
<span class="flowdrop-config-sidebar__detail-value"
|
|
709
|
-
>{selectedNodeForConfig().data.metadata?.category || 'general'}</span
|
|
710
|
-
>
|
|
711
|
-
</div>
|
|
712
|
-
<div class="flowdrop-config-sidebar__detail">
|
|
713
|
-
<span class="flowdrop-config-sidebar__detail-label">Description:</span>
|
|
714
|
-
<p class="flowdrop-config-sidebar__detail-description">
|
|
715
|
-
{selectedNodeForConfig().data.metadata?.description || 'Node configuration'}
|
|
716
|
-
</p>
|
|
717
|
-
</div>
|
|
718
|
-
</div>
|
|
719
|
-
</div>
|
|
720
|
-
|
|
721
|
-
<!-- Configuration Form -->
|
|
722
|
-
<div class="flowdrop-config-sidebar__section">
|
|
723
|
-
<h3 class="flowdrop-config-sidebar__section-title">Configuration</h3>
|
|
724
|
-
<ConfigForm
|
|
725
|
-
node={selectedNodeForConfig()}
|
|
726
|
-
onSave={(updatedConfig) => {
|
|
727
|
-
const currentNode = selectedNodeForConfig();
|
|
728
|
-
if (selectedNodeId && currentNode) {
|
|
729
|
-
// Handle nodeType switching if nodeType is in the config
|
|
730
|
-
let nodeUpdates: Record<string, unknown> = {
|
|
731
|
-
data: {
|
|
732
|
-
...currentNode.data,
|
|
733
|
-
config: updatedConfig
|
|
734
|
-
}
|
|
735
|
-
};
|
|
736
|
-
|
|
737
|
-
// NOTE: We do NOT change the node's type field anymore
|
|
738
|
-
// All nodes use 'universalNode' and UniversalNode handles internal switching
|
|
739
|
-
workflowActions.updateNode(selectedNodeId, nodeUpdates);
|
|
740
|
-
}
|
|
741
|
-
|
|
742
|
-
closeConfigSidebar();
|
|
743
|
-
}}
|
|
744
|
-
onCancel={closeConfigSidebar}
|
|
745
|
-
/>
|
|
746
|
-
</div>
|
|
747
|
-
</div>
|
|
748
|
-
</div>
|
|
682
|
+
// Handle nodeType switching if nodeType is in the config
|
|
683
|
+
const nodeUpdates: Record<string, unknown> = {
|
|
684
|
+
data: updatedData
|
|
685
|
+
};
|
|
686
|
+
|
|
687
|
+
// NOTE: We do NOT change the node's type field anymore
|
|
688
|
+
// All nodes use 'universalNode' and UniversalNode handles internal switching
|
|
689
|
+
workflowActions.updateNode(selectedNodeId, nodeUpdates);
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
closeConfigSidebar();
|
|
693
|
+
}}
|
|
694
|
+
onCancel={closeConfigSidebar}
|
|
695
|
+
/>
|
|
696
|
+
</ConfigPanel>
|
|
749
697
|
{/if}
|
|
750
698
|
{/snippet}
|
|
751
699
|
|
|
@@ -760,22 +708,12 @@
|
|
|
760
708
|
</div>
|
|
761
709
|
<div class="flowdrop-flex flowdrop-gap--2">
|
|
762
710
|
<button
|
|
763
|
-
class="flowdrop-btn flowdrop-btn--sm flowdrop-btn--
|
|
711
|
+
class="flowdrop-btn flowdrop-btn--sm flowdrop-btn--primary"
|
|
764
712
|
onclick={retryLoad}
|
|
765
713
|
type="button"
|
|
766
714
|
>
|
|
767
715
|
Retry
|
|
768
716
|
</button>
|
|
769
|
-
<button
|
|
770
|
-
class="flowdrop-btn flowdrop-btn--sm flowdrop-btn--primary"
|
|
771
|
-
onclick={() => {
|
|
772
|
-
nodes = sampleNodes;
|
|
773
|
-
error = null;
|
|
774
|
-
}}
|
|
775
|
-
type="button"
|
|
776
|
-
>
|
|
777
|
-
Use Sample Data
|
|
778
|
-
</button>
|
|
779
717
|
<button
|
|
780
718
|
class="flowdrop-btn flowdrop-btn--sm flowdrop-btn--outline"
|
|
781
719
|
onclick={() => {
|
|
@@ -949,133 +887,4 @@
|
|
|
949
887
|
overflow: hidden;
|
|
950
888
|
background-color: #1f2937;
|
|
951
889
|
}
|
|
952
|
-
|
|
953
|
-
/* Configuration Sidebar Styles */
|
|
954
|
-
.flowdrop-config-sidebar {
|
|
955
|
-
height: 100%;
|
|
956
|
-
display: flex;
|
|
957
|
-
flex-direction: column;
|
|
958
|
-
background-color: #ffffff;
|
|
959
|
-
}
|
|
960
|
-
|
|
961
|
-
.flowdrop-config-sidebar__header {
|
|
962
|
-
display: flex;
|
|
963
|
-
justify-content: space-between;
|
|
964
|
-
align-items: center;
|
|
965
|
-
padding: 1rem;
|
|
966
|
-
border-bottom: 1px solid #e5e7eb;
|
|
967
|
-
background-color: #f9fafb;
|
|
968
|
-
}
|
|
969
|
-
|
|
970
|
-
.flowdrop-config-sidebar__title {
|
|
971
|
-
margin: 0;
|
|
972
|
-
font-size: 1.125rem;
|
|
973
|
-
font-weight: 600;
|
|
974
|
-
color: #111827;
|
|
975
|
-
}
|
|
976
|
-
|
|
977
|
-
.flowdrop-config-sidebar__close {
|
|
978
|
-
background: none;
|
|
979
|
-
border: none;
|
|
980
|
-
font-size: 1.5rem;
|
|
981
|
-
cursor: pointer;
|
|
982
|
-
color: #6b7280;
|
|
983
|
-
padding: 0.25rem;
|
|
984
|
-
border-radius: 0.25rem;
|
|
985
|
-
transition: color 0.2s;
|
|
986
|
-
}
|
|
987
|
-
|
|
988
|
-
.flowdrop-config-sidebar__close:hover {
|
|
989
|
-
color: #374151;
|
|
990
|
-
background-color: #f3f4f6;
|
|
991
|
-
}
|
|
992
|
-
|
|
993
|
-
.flowdrop-config-sidebar__content {
|
|
994
|
-
flex: 1;
|
|
995
|
-
overflow-y: auto;
|
|
996
|
-
padding: 1rem;
|
|
997
|
-
}
|
|
998
|
-
|
|
999
|
-
.flowdrop-config-sidebar__section {
|
|
1000
|
-
margin-bottom: 1.5rem;
|
|
1001
|
-
}
|
|
1002
|
-
|
|
1003
|
-
.flowdrop-config-sidebar__section-title {
|
|
1004
|
-
margin: 0 0 0.75rem 0;
|
|
1005
|
-
font-size: 0.875rem;
|
|
1006
|
-
font-weight: 600;
|
|
1007
|
-
color: #374151;
|
|
1008
|
-
text-transform: uppercase;
|
|
1009
|
-
letter-spacing: 0.05em;
|
|
1010
|
-
}
|
|
1011
|
-
|
|
1012
|
-
.flowdrop-config-sidebar__details {
|
|
1013
|
-
display: flex;
|
|
1014
|
-
flex-direction: column;
|
|
1015
|
-
gap: 0.5rem;
|
|
1016
|
-
}
|
|
1017
|
-
|
|
1018
|
-
.flowdrop-config-sidebar__detail {
|
|
1019
|
-
display: flex;
|
|
1020
|
-
flex-direction: column;
|
|
1021
|
-
gap: 0.25rem;
|
|
1022
|
-
}
|
|
1023
|
-
|
|
1024
|
-
.flowdrop-config-sidebar__detail-label {
|
|
1025
|
-
font-size: 0.75rem;
|
|
1026
|
-
font-weight: 500;
|
|
1027
|
-
color: #6b7280;
|
|
1028
|
-
text-transform: uppercase;
|
|
1029
|
-
letter-spacing: 0.05em;
|
|
1030
|
-
}
|
|
1031
|
-
|
|
1032
|
-
.flowdrop-config-sidebar__detail-value {
|
|
1033
|
-
font-size: 0.875rem;
|
|
1034
|
-
color: #111827;
|
|
1035
|
-
font-weight: 500;
|
|
1036
|
-
}
|
|
1037
|
-
|
|
1038
|
-
.flowdrop-config-sidebar__detail-value-with-copy {
|
|
1039
|
-
display: flex;
|
|
1040
|
-
align-items: center;
|
|
1041
|
-
gap: 0.5rem;
|
|
1042
|
-
background-color: #f3f4f6;
|
|
1043
|
-
padding: 0.5rem;
|
|
1044
|
-
border-radius: 0.375rem;
|
|
1045
|
-
border: 1px solid #e5e7eb;
|
|
1046
|
-
}
|
|
1047
|
-
|
|
1048
|
-
.flowdrop-config-sidebar__detail-value-with-copy .flowdrop-config-sidebar__detail-value {
|
|
1049
|
-
flex: 1;
|
|
1050
|
-
font-size: 0.8125rem;
|
|
1051
|
-
word-break: break-all;
|
|
1052
|
-
}
|
|
1053
|
-
|
|
1054
|
-
.flowdrop-config-sidebar__copy-btn {
|
|
1055
|
-
background: white;
|
|
1056
|
-
border: 1px solid #d1d5db;
|
|
1057
|
-
border-radius: 0.25rem;
|
|
1058
|
-
padding: 0.25rem 0.5rem;
|
|
1059
|
-
cursor: pointer;
|
|
1060
|
-
font-size: 1rem;
|
|
1061
|
-
transition: all 0.2s;
|
|
1062
|
-
flex-shrink: 0;
|
|
1063
|
-
}
|
|
1064
|
-
|
|
1065
|
-
.flowdrop-config-sidebar__copy-btn:hover {
|
|
1066
|
-
background-color: #f9fafb;
|
|
1067
|
-
border-color: #9ca3af;
|
|
1068
|
-
transform: scale(1.05);
|
|
1069
|
-
}
|
|
1070
|
-
|
|
1071
|
-
.flowdrop-config-sidebar__copy-btn:active {
|
|
1072
|
-
transform: scale(0.95);
|
|
1073
|
-
}
|
|
1074
|
-
|
|
1075
|
-
.flowdrop-config-sidebar__detail-description {
|
|
1076
|
-
margin: 0;
|
|
1077
|
-
font-size: 0.875rem;
|
|
1078
|
-
color: #6b7280;
|
|
1079
|
-
line-height: 1.4;
|
|
1080
|
-
}
|
|
1081
890
|
</style>
|