@d34dman/flowdrop 0.0.25 → 0.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -62
- package/dist/components/App.svelte +15 -2
- package/dist/components/ConfigForm.svelte +4 -1
- package/dist/components/ConfigModal.svelte +4 -70
- package/dist/components/ConfigPanel.svelte +4 -9
- package/dist/components/EdgeRefresher.svelte +42 -0
- package/dist/components/EdgeRefresher.svelte.d.ts +9 -0
- package/dist/components/ReadOnlyDetails.svelte +3 -1
- package/dist/components/UniversalNode.svelte +6 -3
- package/dist/components/WorkflowEditor.svelte +33 -0
- package/dist/components/WorkflowEditor.svelte.d.ts +3 -1
- package/dist/components/form/FormCheckboxGroup.svelte +2 -9
- package/dist/components/form/FormCodeEditor.svelte +1 -0
- package/dist/components/form/FormField.svelte +1 -12
- package/dist/components/form/FormFieldWrapper.svelte +2 -10
- package/dist/components/form/FormFieldWrapper.svelte.d.ts +1 -1
- package/dist/components/form/FormNumberField.svelte +5 -6
- package/dist/components/form/FormRangeField.svelte +3 -13
- package/dist/components/form/FormSelect.svelte +4 -5
- package/dist/components/form/FormSelect.svelte.d.ts +1 -1
- package/dist/components/form/FormTextField.svelte +3 -4
- package/dist/components/form/FormTextarea.svelte +3 -4
- package/dist/components/form/FormToggle.svelte +2 -3
- package/dist/components/form/index.d.ts +14 -14
- package/dist/components/form/index.js +14 -14
- package/dist/components/form/types.d.ts +2 -2
- package/dist/components/form/types.js +1 -1
- package/dist/components/nodes/NotesNode.svelte +39 -45
- package/dist/components/nodes/NotesNode.svelte.d.ts +1 -1
- package/dist/components/nodes/WorkflowNode.svelte +1 -3
- package/dist/styles/base.css +1 -1
- package/package.json +162 -154
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
* Handles string values and defaults
|
|
47
47
|
*/
|
|
48
48
|
const numericValue = $derived.by((): number => {
|
|
49
|
-
if (typeof value ===
|
|
49
|
+
if (typeof value === 'number') {
|
|
50
50
|
return value;
|
|
51
51
|
}
|
|
52
52
|
const parsed = Number(value);
|
|
@@ -85,7 +85,6 @@
|
|
|
85
85
|
{max}
|
|
86
86
|
{step}
|
|
87
87
|
aria-describedby={ariaDescribedBy}
|
|
88
|
-
aria-required={required}
|
|
89
88
|
aria-valuemin={min}
|
|
90
89
|
aria-valuemax={max}
|
|
91
90
|
aria-valuenow={numericValue}
|
|
@@ -144,11 +143,7 @@
|
|
|
144
143
|
width: 18px;
|
|
145
144
|
height: 18px;
|
|
146
145
|
border-radius: 50%;
|
|
147
|
-
background: linear-gradient(
|
|
148
|
-
135deg,
|
|
149
|
-
#ffffff 0%,
|
|
150
|
-
var(--color-ref-gray-50, #f9fafb) 100%
|
|
151
|
-
);
|
|
146
|
+
background: linear-gradient(135deg, #ffffff 0%, var(--color-ref-gray-50, #f9fafb) 100%);
|
|
152
147
|
border: 2px solid var(--color-ref-blue-500, #3b82f6);
|
|
153
148
|
box-shadow:
|
|
154
149
|
0 2px 6px rgba(59, 130, 246, 0.25),
|
|
@@ -189,11 +184,7 @@
|
|
|
189
184
|
width: 18px;
|
|
190
185
|
height: 18px;
|
|
191
186
|
border-radius: 50%;
|
|
192
|
-
background: linear-gradient(
|
|
193
|
-
135deg,
|
|
194
|
-
#ffffff 0%,
|
|
195
|
-
var(--color-ref-gray-50, #f9fafb) 100%
|
|
196
|
-
);
|
|
187
|
+
background: linear-gradient(135deg, #ffffff 0%, var(--color-ref-gray-50, #f9fafb) 100%);
|
|
197
188
|
border: 2px solid var(--color-ref-blue-500, #3b82f6);
|
|
198
189
|
box-shadow:
|
|
199
190
|
0 2px 6px rgba(59, 130, 246, 0.25),
|
|
@@ -249,4 +240,3 @@
|
|
|
249
240
|
text-align: center;
|
|
250
241
|
}
|
|
251
242
|
</style>
|
|
252
|
-
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
-->
|
|
10
10
|
|
|
11
11
|
<script lang="ts">
|
|
12
|
-
import Icon from
|
|
13
|
-
import { normalizeOptions, type FieldOption } from
|
|
12
|
+
import Icon from '@iconify/svelte';
|
|
13
|
+
import { normalizeOptions, type FieldOption } from './types.js';
|
|
14
14
|
|
|
15
15
|
interface Props {
|
|
16
16
|
/** Field identifier */
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
|
|
30
30
|
let {
|
|
31
31
|
id,
|
|
32
|
-
value =
|
|
32
|
+
value = '',
|
|
33
33
|
options = [],
|
|
34
34
|
required = false,
|
|
35
35
|
ariaDescribedBy,
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
<select
|
|
55
55
|
{id}
|
|
56
56
|
class="form-select"
|
|
57
|
-
value={value ??
|
|
57
|
+
value={value ?? ''}
|
|
58
58
|
aria-describedby={ariaDescribedBy}
|
|
59
59
|
aria-required={required}
|
|
60
60
|
onchange={handleChange}
|
|
@@ -123,4 +123,3 @@
|
|
|
123
123
|
color: var(--color-ref-blue-500, #3b82f6);
|
|
124
124
|
}
|
|
125
125
|
</style>
|
|
126
|
-
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
|
|
27
27
|
let {
|
|
28
28
|
id,
|
|
29
|
-
value =
|
|
30
|
-
placeholder =
|
|
29
|
+
value = '',
|
|
30
|
+
placeholder = '',
|
|
31
31
|
required = false,
|
|
32
32
|
ariaDescribedBy,
|
|
33
33
|
onChange
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
{id}
|
|
47
47
|
type="text"
|
|
48
48
|
class="form-text-field"
|
|
49
|
-
value={value ??
|
|
49
|
+
value={value ?? ''}
|
|
50
50
|
{placeholder}
|
|
51
51
|
aria-describedby={ariaDescribedBy}
|
|
52
52
|
aria-required={required}
|
|
@@ -85,4 +85,3 @@
|
|
|
85
85
|
0 1px 2px rgba(0, 0, 0, 0.04);
|
|
86
86
|
}
|
|
87
87
|
</style>
|
|
88
|
-
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
|
|
29
29
|
let {
|
|
30
30
|
id,
|
|
31
|
-
value =
|
|
32
|
-
placeholder =
|
|
31
|
+
value = '',
|
|
32
|
+
placeholder = '',
|
|
33
33
|
rows = 4,
|
|
34
34
|
required = false,
|
|
35
35
|
ariaDescribedBy,
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
<textarea
|
|
49
49
|
{id}
|
|
50
50
|
class="form-textarea"
|
|
51
|
-
value={value ??
|
|
51
|
+
value={value ?? ''}
|
|
52
52
|
{placeholder}
|
|
53
53
|
{rows}
|
|
54
54
|
aria-describedby={ariaDescribedBy}
|
|
@@ -91,4 +91,3 @@
|
|
|
91
91
|
0 1px 2px rgba(0, 0, 0, 0.04);
|
|
92
92
|
}
|
|
93
93
|
</style>
|
|
94
|
-
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
let {
|
|
28
28
|
id,
|
|
29
29
|
value = false,
|
|
30
|
-
onLabel =
|
|
31
|
-
offLabel =
|
|
30
|
+
onLabel = 'Enabled',
|
|
31
|
+
offLabel = 'Disabled',
|
|
32
32
|
ariaDescribedBy,
|
|
33
33
|
onChange
|
|
34
34
|
}: Props = $props();
|
|
@@ -120,4 +120,3 @@
|
|
|
120
120
|
color: var(--color-ref-blue-600, #2563eb);
|
|
121
121
|
}
|
|
122
122
|
</style>
|
|
123
|
-
|
|
@@ -29,17 +29,17 @@
|
|
|
29
29
|
* />
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
32
|
-
export * from
|
|
33
|
-
export { default as FormField } from
|
|
34
|
-
export { default as FormFieldWrapper } from
|
|
35
|
-
export { default as FormTextField } from
|
|
36
|
-
export { default as FormTextarea } from
|
|
37
|
-
export { default as FormNumberField } from
|
|
38
|
-
export { default as FormRangeField } from
|
|
39
|
-
export { default as FormToggle } from
|
|
40
|
-
export { default as FormSelect } from
|
|
41
|
-
export { default as FormCheckboxGroup } from
|
|
42
|
-
export { default as FormArray } from
|
|
43
|
-
export { default as FormCodeEditor } from
|
|
44
|
-
export { default as FormMarkdownEditor } from
|
|
45
|
-
export { default as FormTemplateEditor } from
|
|
32
|
+
export * from './types.js';
|
|
33
|
+
export { default as FormField } from './FormField.svelte';
|
|
34
|
+
export { default as FormFieldWrapper } from './FormFieldWrapper.svelte';
|
|
35
|
+
export { default as FormTextField } from './FormTextField.svelte';
|
|
36
|
+
export { default as FormTextarea } from './FormTextarea.svelte';
|
|
37
|
+
export { default as FormNumberField } from './FormNumberField.svelte';
|
|
38
|
+
export { default as FormRangeField } from './FormRangeField.svelte';
|
|
39
|
+
export { default as FormToggle } from './FormToggle.svelte';
|
|
40
|
+
export { default as FormSelect } from './FormSelect.svelte';
|
|
41
|
+
export { default as FormCheckboxGroup } from './FormCheckboxGroup.svelte';
|
|
42
|
+
export { default as FormArray } from './FormArray.svelte';
|
|
43
|
+
export { default as FormCodeEditor } from './FormCodeEditor.svelte';
|
|
44
|
+
export { default as FormMarkdownEditor } from './FormMarkdownEditor.svelte';
|
|
45
|
+
export { default as FormTemplateEditor } from './FormTemplateEditor.svelte';
|
|
@@ -30,20 +30,20 @@
|
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
32
32
|
// Types
|
|
33
|
-
export * from
|
|
33
|
+
export * from './types.js';
|
|
34
34
|
// Main factory component
|
|
35
|
-
export { default as FormField } from
|
|
35
|
+
export { default as FormField } from './FormField.svelte';
|
|
36
36
|
// Wrapper component
|
|
37
|
-
export { default as FormFieldWrapper } from
|
|
37
|
+
export { default as FormFieldWrapper } from './FormFieldWrapper.svelte';
|
|
38
38
|
// Individual field components
|
|
39
|
-
export { default as FormTextField } from
|
|
40
|
-
export { default as FormTextarea } from
|
|
41
|
-
export { default as FormNumberField } from
|
|
42
|
-
export { default as FormRangeField } from
|
|
43
|
-
export { default as FormToggle } from
|
|
44
|
-
export { default as FormSelect } from
|
|
45
|
-
export { default as FormCheckboxGroup } from
|
|
46
|
-
export { default as FormArray } from
|
|
47
|
-
export { default as FormCodeEditor } from
|
|
48
|
-
export { default as FormMarkdownEditor } from
|
|
49
|
-
export { default as FormTemplateEditor } from
|
|
39
|
+
export { default as FormTextField } from './FormTextField.svelte';
|
|
40
|
+
export { default as FormTextarea } from './FormTextarea.svelte';
|
|
41
|
+
export { default as FormNumberField } from './FormNumberField.svelte';
|
|
42
|
+
export { default as FormRangeField } from './FormRangeField.svelte';
|
|
43
|
+
export { default as FormToggle } from './FormToggle.svelte';
|
|
44
|
+
export { default as FormSelect } from './FormSelect.svelte';
|
|
45
|
+
export { default as FormCheckboxGroup } from './FormCheckboxGroup.svelte';
|
|
46
|
+
export { default as FormArray } from './FormArray.svelte';
|
|
47
|
+
export { default as FormCodeEditor } from './FormCodeEditor.svelte';
|
|
48
|
+
export { default as FormMarkdownEditor } from './FormMarkdownEditor.svelte';
|
|
49
|
+
export { default as FormTemplateEditor } from './FormTemplateEditor.svelte';
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* Supported field types for form rendering
|
|
10
10
|
* Can be extended to support complex types like 'array' and 'object'
|
|
11
11
|
*/
|
|
12
|
-
export type FieldType =
|
|
12
|
+
export type FieldType = 'string' | 'number' | 'integer' | 'boolean' | 'select' | 'array' | 'object';
|
|
13
13
|
/**
|
|
14
14
|
* Field format for specialized rendering
|
|
15
15
|
* - multiline: Renders as textarea
|
|
@@ -20,7 +20,7 @@ export type FieldType = "string" | "number" | "integer" | "boolean" | "select" |
|
|
|
20
20
|
* - markdown: Renders as SimpleMDE Markdown editor
|
|
21
21
|
* - template: Renders as CodeMirror editor with Twig/Liquid syntax highlighting
|
|
22
22
|
*/
|
|
23
|
-
export type FieldFormat =
|
|
23
|
+
export type FieldFormat = 'multiline' | 'hidden' | 'range' | 'json' | 'code' | 'markdown' | 'template' | string;
|
|
24
24
|
/**
|
|
25
25
|
* Option type for select and checkbox group fields
|
|
26
26
|
*/
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* Type guard to check if options are FieldOption objects
|
|
10
10
|
*/
|
|
11
11
|
export function isFieldOptionArray(options) {
|
|
12
|
-
return options.length > 0 && typeof options[0] ===
|
|
12
|
+
return options.length > 0 && typeof options[0] === 'object' && 'value' in options[0];
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* Normalize options to FieldOption format
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type { ConfigValues, NodeMetadata } from
|
|
3
|
-
import Icon from
|
|
4
|
-
import MarkdownDisplay from
|
|
2
|
+
import type { ConfigValues, NodeMetadata } from '../../types/index.js';
|
|
3
|
+
import Icon from '@iconify/svelte';
|
|
4
|
+
import MarkdownDisplay from '../MarkdownDisplay.svelte';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* NotesNode component props
|
|
@@ -25,63 +25,57 @@
|
|
|
25
25
|
}>();
|
|
26
26
|
|
|
27
27
|
/** Note content derived from config */
|
|
28
|
-
const noteContent = $derived(
|
|
29
|
-
(props.data.config?.content as string) || "Add your notes here..."
|
|
30
|
-
);
|
|
28
|
+
const noteContent = $derived((props.data.config?.content as string) || 'Add your notes here...');
|
|
31
29
|
|
|
32
30
|
/** Note type derived from config */
|
|
33
|
-
const noteType = $derived(
|
|
34
|
-
(props.data.config?.noteType as string) || "info"
|
|
35
|
-
);
|
|
31
|
+
const noteType = $derived((props.data.config?.noteType as string) || 'info');
|
|
36
32
|
|
|
37
33
|
/** Note type configuration with styling for each type */
|
|
38
34
|
const noteTypes = {
|
|
39
35
|
info: {
|
|
40
|
-
name:
|
|
41
|
-
bgColor:
|
|
42
|
-
borderColor:
|
|
43
|
-
textColor:
|
|
44
|
-
iconColor:
|
|
45
|
-
icon:
|
|
36
|
+
name: 'Info',
|
|
37
|
+
bgColor: 'bg-blue-50',
|
|
38
|
+
borderColor: 'border-blue-200',
|
|
39
|
+
textColor: 'text-blue-800',
|
|
40
|
+
iconColor: 'text-blue-500',
|
|
41
|
+
icon: 'mdi:information'
|
|
46
42
|
},
|
|
47
43
|
warning: {
|
|
48
|
-
name:
|
|
49
|
-
bgColor:
|
|
50
|
-
borderColor:
|
|
51
|
-
textColor:
|
|
52
|
-
iconColor:
|
|
53
|
-
icon:
|
|
44
|
+
name: 'Warning',
|
|
45
|
+
bgColor: 'bg-yellow-50',
|
|
46
|
+
borderColor: 'border-yellow-200',
|
|
47
|
+
textColor: 'text-yellow-800',
|
|
48
|
+
iconColor: 'text-yellow-500',
|
|
49
|
+
icon: 'mdi:alert'
|
|
54
50
|
},
|
|
55
51
|
success: {
|
|
56
|
-
name:
|
|
57
|
-
bgColor:
|
|
58
|
-
borderColor:
|
|
59
|
-
textColor:
|
|
60
|
-
iconColor:
|
|
61
|
-
icon:
|
|
52
|
+
name: 'Success',
|
|
53
|
+
bgColor: 'bg-green-50',
|
|
54
|
+
borderColor: 'border-green-200',
|
|
55
|
+
textColor: 'text-green-800',
|
|
56
|
+
iconColor: 'text-green-500',
|
|
57
|
+
icon: 'mdi:check-circle'
|
|
62
58
|
},
|
|
63
59
|
error: {
|
|
64
|
-
name:
|
|
65
|
-
bgColor:
|
|
66
|
-
borderColor:
|
|
67
|
-
textColor:
|
|
68
|
-
iconColor:
|
|
69
|
-
icon:
|
|
60
|
+
name: 'Error',
|
|
61
|
+
bgColor: 'bg-red-50',
|
|
62
|
+
borderColor: 'border-red-200',
|
|
63
|
+
textColor: 'text-red-800',
|
|
64
|
+
iconColor: 'text-red-500',
|
|
65
|
+
icon: 'mdi:close-circle'
|
|
70
66
|
},
|
|
71
67
|
note: {
|
|
72
|
-
name:
|
|
73
|
-
bgColor:
|
|
74
|
-
borderColor:
|
|
75
|
-
textColor:
|
|
76
|
-
iconColor:
|
|
77
|
-
icon:
|
|
68
|
+
name: 'Note',
|
|
69
|
+
bgColor: 'bg-gray-50',
|
|
70
|
+
borderColor: 'border-gray-200',
|
|
71
|
+
textColor: 'text-gray-800',
|
|
72
|
+
iconColor: 'text-gray-500',
|
|
73
|
+
icon: 'mdi:note-text'
|
|
78
74
|
}
|
|
79
75
|
};
|
|
80
76
|
|
|
81
77
|
/** Current note type configuration based on selected type */
|
|
82
|
-
const currentType = $derived(
|
|
83
|
-
noteTypes[noteType as keyof typeof noteTypes] || noteTypes.info
|
|
84
|
-
);
|
|
78
|
+
const currentType = $derived(noteTypes[noteType as keyof typeof noteTypes] || noteTypes.info);
|
|
85
79
|
|
|
86
80
|
/**
|
|
87
81
|
* Opens the configuration sidebar for editing note properties
|
|
@@ -89,8 +83,8 @@
|
|
|
89
83
|
function openConfigSidebar(): void {
|
|
90
84
|
if (props.data.onConfigOpen) {
|
|
91
85
|
const nodeForConfig = {
|
|
92
|
-
id: props.data.nodeId ||
|
|
93
|
-
type:
|
|
86
|
+
id: props.data.nodeId || 'unknown',
|
|
87
|
+
type: 'note',
|
|
94
88
|
data: props.data
|
|
95
89
|
};
|
|
96
90
|
props.data.onConfigOpen(nodeForConfig);
|
|
@@ -109,7 +103,7 @@
|
|
|
109
103
|
* @param event - The keyboard event
|
|
110
104
|
*/
|
|
111
105
|
function handleKeydown(event: KeyboardEvent): void {
|
|
112
|
-
if (event.key ===
|
|
106
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
113
107
|
event.preventDefault();
|
|
114
108
|
handleDoubleClick();
|
|
115
109
|
}
|
|
@@ -94,9 +94,7 @@
|
|
|
94
94
|
* Derived list of visible input ports based on hideUnconnectedHandles setting
|
|
95
95
|
* Now includes both static and dynamic inputs
|
|
96
96
|
*/
|
|
97
|
-
const visibleInputPorts = $derived(
|
|
98
|
-
allInputPorts.filter((port) => isPortVisible(port, 'input'))
|
|
99
|
-
);
|
|
97
|
+
const visibleInputPorts = $derived(allInputPorts.filter((port) => isPortVisible(port, 'input')));
|
|
100
98
|
|
|
101
99
|
/**
|
|
102
100
|
* Derived list of visible output ports based on hideUnconnectedHandles setting
|
package/dist/styles/base.css
CHANGED