@flowdrop/flowdrop 2.0.0-beta.2 → 2.0.0-beta.4
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/CHANGELOG.md +59 -0
- package/MIGRATION-2.0.md +13 -0
- package/README.md +5 -5
- package/dist/components/App.svelte +36 -191
- package/dist/components/App.svelte.d.ts +2 -7
- package/dist/components/Button.stories.svelte +65 -0
- package/dist/components/Button.stories.svelte.d.ts +19 -0
- package/dist/components/Button.svelte +62 -0
- package/dist/components/Button.svelte.d.ts +24 -0
- package/dist/components/CanvasIconButton.svelte +76 -0
- package/dist/components/CanvasIconButton.svelte.d.ts +18 -0
- package/dist/components/ConfigForm.svelte +4 -23
- package/dist/components/ConfigPanel.svelte +4 -3
- package/dist/components/EditorStatusBar.stories.svelte +44 -0
- package/dist/components/EditorStatusBar.stories.svelte.d.ts +27 -0
- package/dist/components/EditorStatusBar.svelte +99 -0
- package/dist/components/EditorStatusBar.svelte.d.ts +15 -0
- package/dist/components/IconButton.svelte +80 -0
- package/dist/components/IconButton.svelte.d.ts +30 -0
- package/dist/components/Input.svelte +74 -0
- package/dist/components/Input.svelte.d.ts +17 -0
- package/dist/components/LogoWordmark.svelte +113 -0
- package/dist/components/LogoWordmark.svelte.d.ts +26 -0
- package/dist/components/Navbar.svelte +17 -63
- package/dist/components/Navbar.svelte.d.ts +3 -0
- package/dist/components/NodeSidebar.svelte +17 -122
- package/dist/components/NodeSwapPicker.svelte +10 -28
- package/dist/components/PortMappingRow.svelte +0 -2
- package/dist/components/SchemaForm.svelte +0 -12
- package/dist/components/Select.svelte +53 -0
- package/dist/components/Select.svelte.d.ts +15 -0
- package/dist/components/SettingsModal.svelte +0 -5
- package/dist/components/SettingsPanel.svelte +2 -6
- package/dist/components/Textarea.svelte +39 -0
- package/dist/components/Textarea.svelte.d.ts +12 -0
- package/dist/components/ThemeToggle.svelte +15 -94
- package/dist/components/UniversalNode.svelte +32 -1
- package/dist/components/WorkflowEditor.svelte +62 -51
- package/dist/components/WorkflowEditor.svelte.d.ts +18 -0
- package/dist/components/chat/AIChatPanel.svelte +1 -1
- package/dist/components/console/ConsoleAutocomplete.svelte +1 -1
- package/dist/components/console/ConsoleOutput.svelte +2 -2
- package/dist/components/form/FormArray.svelte +37 -173
- package/dist/components/form/FormAutocomplete.svelte +10 -6
- package/dist/components/form/FormCheckboxGroup.svelte +1 -5
- package/dist/components/form/FormCodeEditor.svelte +9 -7
- package/dist/components/form/FormField.svelte +5 -44
- package/dist/components/form/FormFieldLight.svelte +8 -47
- package/dist/components/form/FormFieldset.svelte +1 -1
- package/dist/components/form/FormMarkdownEditor.svelte +8 -5
- package/dist/components/form/FormNumberField.svelte +4 -36
- package/dist/components/form/FormRangeField.svelte +18 -27
- package/dist/components/form/FormSelect.svelte +13 -75
- package/dist/components/form/FormTemplateEditor.svelte +6 -4
- package/dist/components/form/FormTextField.svelte +3 -35
- package/dist/components/form/FormTextarea.svelte +4 -39
- package/dist/components/form/FormToggle.svelte +0 -4
- package/dist/components/form/resolveFieldType.d.ts +24 -0
- package/dist/components/form/resolveFieldType.js +55 -0
- package/dist/components/icons/CloseIcon.svelte +6 -0
- package/dist/components/icons/CloseIcon.svelte.d.ts +26 -0
- package/dist/components/icons/CommandLineIcon.svelte +15 -0
- package/dist/components/icons/CommandLineIcon.svelte.d.ts +26 -0
- package/dist/components/icons/MenuIcon.svelte +4 -0
- package/dist/components/icons/MenuIcon.svelte.d.ts +26 -0
- package/dist/components/icons/MenuOpenIcon.svelte +6 -0
- package/dist/components/icons/MenuOpenIcon.svelte.d.ts +26 -0
- package/dist/components/interrupt/ChoicePrompt.svelte +0 -10
- package/dist/components/interrupt/ConfirmationPrompt.svelte +0 -5
- package/dist/components/interrupt/InterruptBubble.svelte +0 -10
- package/dist/components/interrupt/ReviewPrompt.svelte +0 -20
- package/dist/components/interrupt/TextInputPrompt.svelte +0 -6
- package/dist/components/layouts/MainLayout.svelte +4 -5
- package/dist/components/nodes/AtomNode.svelte +46 -34
- package/dist/components/nodes/GatewayNode.svelte +91 -99
- package/dist/components/nodes/IdeaNode.svelte +62 -90
- package/dist/components/nodes/NodeConfigButton.svelte +86 -0
- package/dist/components/nodes/NodeConfigButton.svelte.d.ts +15 -0
- package/dist/components/nodes/NotesNode.svelte +70 -81
- package/dist/components/nodes/SimpleNode.svelte +28 -78
- package/dist/components/nodes/SquareNode.svelte +79 -109
- package/dist/components/nodes/TerminalNode.svelte +28 -86
- package/dist/components/nodes/ToolNode.svelte +82 -95
- package/dist/components/nodes/WorkflowNode.svelte +91 -100
- package/dist/components/playground/ChatInput.svelte +0 -1
- package/dist/components/playground/InputCollector.svelte +11 -48
- package/dist/components/playground/PlaygroundApp.svelte +1 -1
- package/dist/components/playground/PlaygroundStudio.svelte +0 -5
- package/dist/messages/index.d.ts +1 -1
- package/dist/messages/index.js +1 -1
- package/dist/openapi/v1/openapi.yaml +2 -2
- package/dist/playground/mount.d.ts +9 -5
- package/dist/playground/mount.js +9 -5
- package/dist/skins/drafter.d.ts +30 -0
- package/dist/skins/drafter.js +198 -0
- package/dist/skins/index.d.ts +2 -1
- package/dist/skins/index.js +4 -2
- package/dist/styles/base.css +285 -14
- package/dist/styles/tokens.css +60 -2
- package/dist/svelte-app.d.ts +6 -0
- package/dist/svelte-app.js +71 -109
- package/dist/themes/drafter.d.ts +2 -0
- package/dist/themes/drafter.js +15 -0
- package/dist/themes/index.d.ts +2 -1
- package/dist/themes/index.js +8 -2
- package/dist/types/events.d.ts +18 -0
- package/dist/types/events.js +2 -1
- package/dist/types/settings.d.ts +1 -1
- package/dist/types/settings.js +1 -1
- package/dist/types/skin.d.ts +1 -1
- package/dist/types/theme.d.ts +16 -2
- package/dist/utils/connections.js +14 -50
- package/package.json +1 -1
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
-->
|
|
10
10
|
|
|
11
11
|
<script lang="ts">
|
|
12
|
+
import Input from '../Input.svelte';
|
|
13
|
+
|
|
12
14
|
interface Props {
|
|
13
15
|
/** Field identifier */
|
|
14
16
|
id: string;
|
|
@@ -62,10 +64,10 @@
|
|
|
62
64
|
}
|
|
63
65
|
</script>
|
|
64
66
|
|
|
65
|
-
<
|
|
67
|
+
<Input
|
|
66
68
|
{id}
|
|
67
69
|
type="number"
|
|
68
|
-
class="
|
|
70
|
+
class="flowdrop-input--numeric"
|
|
69
71
|
value={value ?? ''}
|
|
70
72
|
{placeholder}
|
|
71
73
|
{min}
|
|
@@ -76,37 +78,3 @@
|
|
|
76
78
|
aria-required={required}
|
|
77
79
|
oninput={handleInput}
|
|
78
80
|
/>
|
|
79
|
-
|
|
80
|
-
<style>
|
|
81
|
-
.form-number-field {
|
|
82
|
-
width: 100%;
|
|
83
|
-
padding: 0.625rem 0.875rem;
|
|
84
|
-
border: 1px solid var(--fd-border);
|
|
85
|
-
border-radius: var(--fd-radius-lg);
|
|
86
|
-
font-size: var(--fd-text-sm);
|
|
87
|
-
font-family: inherit;
|
|
88
|
-
font-variant-numeric: tabular-nums;
|
|
89
|
-
color: var(--fd-foreground);
|
|
90
|
-
background-color: var(--fd-muted);
|
|
91
|
-
transition: all var(--fd-transition-normal);
|
|
92
|
-
box-shadow: var(--fd-shadow-sm);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.form-number-field::placeholder {
|
|
96
|
-
color: var(--fd-muted-foreground);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.form-number-field:hover {
|
|
100
|
-
border-color: var(--fd-border-strong);
|
|
101
|
-
background-color: var(--fd-background);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.form-number-field:focus {
|
|
105
|
-
outline: none;
|
|
106
|
-
border-color: var(--fd-primary);
|
|
107
|
-
background-color: var(--fd-background);
|
|
108
|
-
box-shadow:
|
|
109
|
-
0 0 0 3px rgba(59, 130, 246, 0.12),
|
|
110
|
-
var(--fd-shadow-sm);
|
|
111
|
-
}
|
|
112
|
-
</style>
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
aria-valuemax={max}
|
|
95
95
|
aria-valuenow={numericValue}
|
|
96
96
|
oninput={handleInput}
|
|
97
|
-
style="--progress: {progressPercentage}
|
|
97
|
+
style="--progress: {progressPercentage}"
|
|
98
98
|
/>
|
|
99
99
|
</div>
|
|
100
100
|
<div class="form-range-values">
|
|
@@ -119,6 +119,16 @@
|
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
.form-range-field {
|
|
122
|
+
/* Thumb width; the fill edge is offset by half of this so it tracks the
|
|
123
|
+
thumb centre instead of the raw 0–100% of the track. */
|
|
124
|
+
--fd-range-thumb-size: 18px;
|
|
125
|
+
/* `--progress` is a unitless 0–100 set inline. The browser keeps the thumb
|
|
126
|
+
inside the track, so its centre travels from thumb/2 to (100% − thumb/2);
|
|
127
|
+
mirror that here so the colour fill lines up at every value, on load too. */
|
|
128
|
+
--fd-range-fill: calc(
|
|
129
|
+
var(--fd-range-thumb-size) / 2 + (100% - var(--fd-range-thumb-size)) * var(--progress, 0) /
|
|
130
|
+
100
|
|
131
|
+
);
|
|
122
132
|
width: 100%;
|
|
123
133
|
height: 6px;
|
|
124
134
|
border-radius: 3px;
|
|
@@ -127,8 +137,8 @@
|
|
|
127
137
|
background: linear-gradient(
|
|
128
138
|
to right,
|
|
129
139
|
var(--fd-primary) 0%,
|
|
130
|
-
var(--fd-primary) var(--
|
|
131
|
-
var(--fd-border) var(--
|
|
140
|
+
var(--fd-primary) var(--fd-range-fill),
|
|
141
|
+
var(--fd-border) var(--fd-range-fill),
|
|
132
142
|
var(--fd-border) 100%
|
|
133
143
|
);
|
|
134
144
|
cursor: pointer;
|
|
@@ -145,8 +155,8 @@
|
|
|
145
155
|
.form-range-field::-webkit-slider-thumb {
|
|
146
156
|
-webkit-appearance: none;
|
|
147
157
|
appearance: none;
|
|
148
|
-
width:
|
|
149
|
-
height:
|
|
158
|
+
width: var(--fd-range-thumb-size);
|
|
159
|
+
height: var(--fd-range-thumb-size);
|
|
150
160
|
border-radius: 50%;
|
|
151
161
|
background: linear-gradient(135deg, var(--fd-background) 0%, var(--fd-muted) 100%);
|
|
152
162
|
border: 2px solid var(--fd-primary);
|
|
@@ -165,12 +175,6 @@
|
|
|
165
175
|
0 2px 4px rgba(0, 0, 0, 0.1);
|
|
166
176
|
}
|
|
167
177
|
|
|
168
|
-
.form-range-field:focus::-webkit-slider-thumb {
|
|
169
|
-
box-shadow:
|
|
170
|
-
0 0 0 3px rgba(59, 130, 246, 0.2),
|
|
171
|
-
0 4px 12px rgba(59, 130, 246, 0.35);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
178
|
/* Firefox - Track */
|
|
175
179
|
.form-range-field::-moz-range-track {
|
|
176
180
|
height: 6px;
|
|
@@ -186,8 +190,8 @@
|
|
|
186
190
|
|
|
187
191
|
/* Firefox - Thumb */
|
|
188
192
|
.form-range-field::-moz-range-thumb {
|
|
189
|
-
width:
|
|
190
|
-
height:
|
|
193
|
+
width: var(--fd-range-thumb-size);
|
|
194
|
+
height: var(--fd-range-thumb-size);
|
|
191
195
|
border-radius: 50%;
|
|
192
196
|
background: linear-gradient(135deg, var(--fd-background) 0%, var(--fd-muted) 100%);
|
|
193
197
|
border: 2px solid var(--fd-primary);
|
|
@@ -205,20 +209,7 @@
|
|
|
205
209
|
0 2px 4px rgba(0, 0, 0, 0.1);
|
|
206
210
|
}
|
|
207
211
|
|
|
208
|
-
.
|
|
209
|
-
box-shadow:
|
|
210
|
-
0 0 0 3px rgba(59, 130, 246, 0.2),
|
|
211
|
-
0 4px 12px rgba(59, 130, 246, 0.35);
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
/* Focus styles */
|
|
215
|
-
.form-range-field:focus {
|
|
216
|
-
outline: none;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
.form-range-field:focus-visible {
|
|
220
|
-
outline: none;
|
|
221
|
-
}
|
|
212
|
+
/* Focus ring is centralized in base.css (outline on the range input). */
|
|
222
213
|
|
|
223
214
|
/* Value display row */
|
|
224
215
|
.form-range-values {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
-->
|
|
10
10
|
|
|
11
11
|
<script lang="ts">
|
|
12
|
-
import
|
|
12
|
+
import Select from '../Select.svelte';
|
|
13
13
|
import { normalizeOptions, type FieldOption } from './types.js';
|
|
14
14
|
|
|
15
15
|
interface Props {
|
|
@@ -53,77 +53,15 @@
|
|
|
53
53
|
}
|
|
54
54
|
</script>
|
|
55
55
|
|
|
56
|
-
<
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
{/each}
|
|
69
|
-
</select>
|
|
70
|
-
<span class="form-select__icon" aria-hidden="true">
|
|
71
|
-
<Icon icon="heroicons:chevron-down" />
|
|
72
|
-
</span>
|
|
73
|
-
</div>
|
|
74
|
-
|
|
75
|
-
<style>
|
|
76
|
-
.form-select-wrapper {
|
|
77
|
-
position: relative;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.form-select {
|
|
81
|
-
width: 100%;
|
|
82
|
-
padding: 0.625rem 2.5rem 0.625rem 0.875rem;
|
|
83
|
-
border: 1px solid var(--fd-border);
|
|
84
|
-
border-radius: var(--fd-radius-lg);
|
|
85
|
-
font-size: var(--fd-text-sm);
|
|
86
|
-
font-family: inherit;
|
|
87
|
-
color: var(--fd-foreground);
|
|
88
|
-
background-color: var(--fd-muted);
|
|
89
|
-
transition: all var(--fd-transition-normal);
|
|
90
|
-
box-shadow: var(--fd-shadow-sm);
|
|
91
|
-
cursor: pointer;
|
|
92
|
-
appearance: none;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.form-select:hover {
|
|
96
|
-
border-color: var(--fd-border-strong);
|
|
97
|
-
background-color: var(--fd-background);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.form-select:focus {
|
|
101
|
-
outline: none;
|
|
102
|
-
border-color: var(--fd-primary);
|
|
103
|
-
background-color: var(--fd-background);
|
|
104
|
-
box-shadow:
|
|
105
|
-
0 0 0 3px rgba(59, 130, 246, 0.12),
|
|
106
|
-
var(--fd-shadow-sm);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.form-select__icon {
|
|
110
|
-
position: absolute;
|
|
111
|
-
right: 0.75rem;
|
|
112
|
-
top: 50%;
|
|
113
|
-
transform: translateY(-50%);
|
|
114
|
-
pointer-events: none;
|
|
115
|
-
color: var(--fd-muted-foreground);
|
|
116
|
-
display: flex;
|
|
117
|
-
align-items: center;
|
|
118
|
-
transition: color var(--fd-transition-normal);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.form-select__icon :global(svg) {
|
|
122
|
-
width: 1rem;
|
|
123
|
-
height: 1rem;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
.form-select:focus + .form-select__icon {
|
|
127
|
-
color: var(--fd-primary);
|
|
128
|
-
}
|
|
129
|
-
</style>
|
|
56
|
+
<Select
|
|
57
|
+
{id}
|
|
58
|
+
value={value ?? ''}
|
|
59
|
+
{disabled}
|
|
60
|
+
aria-describedby={ariaDescribedBy}
|
|
61
|
+
aria-required={required}
|
|
62
|
+
onchange={handleChange}
|
|
63
|
+
>
|
|
64
|
+
{#each normalizedOptions as option (option.value)}
|
|
65
|
+
<option value={option.value}>{option.label}</option>
|
|
66
|
+
{/each}
|
|
67
|
+
</Select>
|
|
@@ -623,7 +623,8 @@
|
|
|
623
623
|
border: 1px solid var(--fd-border);
|
|
624
624
|
border-radius: var(--fd-radius-lg);
|
|
625
625
|
overflow: hidden;
|
|
626
|
-
|
|
626
|
+
/* Match plain form fields: rest on the input surface, not --fd-muted. */
|
|
627
|
+
background-color: var(--fd-background);
|
|
627
628
|
transition: all var(--fd-transition-normal);
|
|
628
629
|
box-shadow: var(--fd-shadow-sm);
|
|
629
630
|
}
|
|
@@ -633,12 +634,13 @@
|
|
|
633
634
|
background-color: var(--fd-background);
|
|
634
635
|
}
|
|
635
636
|
|
|
637
|
+
/* Compound widget: ring drawn on the container via :focus-within, using the
|
|
638
|
+
standard --fd-ring tokens (outline isn't clipped by the container overflow). */
|
|
636
639
|
.form-template-editor__container:focus-within {
|
|
637
640
|
border-color: var(--fd-accent);
|
|
638
641
|
background-color: var(--fd-background);
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
var(--fd-shadow-sm);
|
|
642
|
+
outline: var(--fd-ring-width) solid var(--fd-ring);
|
|
643
|
+
outline-offset: var(--fd-ring-offset);
|
|
642
644
|
}
|
|
643
645
|
|
|
644
646
|
/* Dark theme overrides */
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
-->
|
|
10
10
|
|
|
11
11
|
<script lang="ts">
|
|
12
|
+
import Input from '../Input.svelte';
|
|
13
|
+
|
|
12
14
|
interface Props {
|
|
13
15
|
/** Field identifier */
|
|
14
16
|
id: string;
|
|
@@ -45,10 +47,9 @@
|
|
|
45
47
|
}
|
|
46
48
|
</script>
|
|
47
49
|
|
|
48
|
-
<
|
|
50
|
+
<Input
|
|
49
51
|
{id}
|
|
50
52
|
type="text"
|
|
51
|
-
class="form-text-field"
|
|
52
53
|
value={value ?? ''}
|
|
53
54
|
{placeholder}
|
|
54
55
|
{disabled}
|
|
@@ -56,36 +57,3 @@
|
|
|
56
57
|
aria-required={required}
|
|
57
58
|
oninput={handleInput}
|
|
58
59
|
/>
|
|
59
|
-
|
|
60
|
-
<style>
|
|
61
|
-
.form-text-field {
|
|
62
|
-
width: 100%;
|
|
63
|
-
padding: 0.625rem 0.875rem;
|
|
64
|
-
border: 1px solid var(--fd-border);
|
|
65
|
-
border-radius: var(--fd-radius-lg);
|
|
66
|
-
font-size: var(--fd-text-sm);
|
|
67
|
-
font-family: inherit;
|
|
68
|
-
color: var(--fd-foreground);
|
|
69
|
-
background-color: var(--fd-muted);
|
|
70
|
-
transition: all var(--fd-transition-normal);
|
|
71
|
-
box-shadow: var(--fd-shadow-sm);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.form-text-field::placeholder {
|
|
75
|
-
color: var(--fd-muted-foreground);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.form-text-field:hover {
|
|
79
|
-
border-color: var(--fd-border-strong);
|
|
80
|
-
background-color: var(--fd-background);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.form-text-field:focus {
|
|
84
|
-
outline: none;
|
|
85
|
-
border-color: var(--fd-primary);
|
|
86
|
-
background-color: var(--fd-background);
|
|
87
|
-
box-shadow:
|
|
88
|
-
0 0 0 3px rgba(59, 130, 246, 0.12),
|
|
89
|
-
var(--fd-shadow-sm);
|
|
90
|
-
}
|
|
91
|
-
</style>
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
-->
|
|
10
10
|
|
|
11
11
|
<script lang="ts">
|
|
12
|
+
import Textarea from '../Textarea.svelte';
|
|
13
|
+
|
|
12
14
|
interface Props {
|
|
13
15
|
/** Field identifier */
|
|
14
16
|
id: string;
|
|
@@ -48,9 +50,8 @@
|
|
|
48
50
|
}
|
|
49
51
|
</script>
|
|
50
52
|
|
|
51
|
-
<
|
|
53
|
+
<Textarea
|
|
52
54
|
{id}
|
|
53
|
-
class="form-textarea"
|
|
54
55
|
value={value ?? ''}
|
|
55
56
|
{placeholder}
|
|
56
57
|
{rows}
|
|
@@ -58,40 +59,4 @@
|
|
|
58
59
|
aria-describedby={ariaDescribedBy}
|
|
59
60
|
aria-required={required}
|
|
60
61
|
oninput={handleInput}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
<style>
|
|
64
|
-
.form-textarea {
|
|
65
|
-
width: 100%;
|
|
66
|
-
padding: 0.625rem 0.875rem;
|
|
67
|
-
border: 1px solid var(--fd-border);
|
|
68
|
-
border-radius: var(--fd-radius-lg);
|
|
69
|
-
font-size: var(--fd-text-sm);
|
|
70
|
-
font-family: inherit;
|
|
71
|
-
color: var(--fd-foreground);
|
|
72
|
-
background-color: var(--fd-muted);
|
|
73
|
-
transition: all var(--fd-transition-normal);
|
|
74
|
-
box-shadow: var(--fd-shadow-sm);
|
|
75
|
-
resize: vertical;
|
|
76
|
-
min-height: 5rem;
|
|
77
|
-
line-height: 1.5;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.form-textarea::placeholder {
|
|
81
|
-
color: var(--fd-muted-foreground);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.form-textarea:hover {
|
|
85
|
-
border-color: var(--fd-border-strong);
|
|
86
|
-
background-color: var(--fd-background);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.form-textarea:focus {
|
|
90
|
-
outline: none;
|
|
91
|
-
border-color: var(--fd-primary);
|
|
92
|
-
background-color: var(--fd-background);
|
|
93
|
-
box-shadow:
|
|
94
|
-
0 0 0 3px rgba(59, 130, 246, 0.12),
|
|
95
|
-
var(--fd-shadow-sm);
|
|
96
|
-
}
|
|
97
|
-
</style>
|
|
62
|
+
/>
|
|
@@ -120,10 +120,6 @@
|
|
|
120
120
|
transform: translateX(1.25rem);
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
.form-toggle__input:focus-visible + .form-toggle__track {
|
|
124
|
-
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
123
|
.form-toggle__label {
|
|
128
124
|
font-size: var(--fd-text-sm);
|
|
129
125
|
color: var(--fd-muted-foreground);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { FieldSchema } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* The dependency-free field kinds that {@link FormField} and
|
|
4
|
+
* {@link FormFieldLight} render identically — i.e. everything that does not
|
|
5
|
+
* pull in a heavy editor or depend on the field registry.
|
|
6
|
+
*/
|
|
7
|
+
export type BaseFieldType = 'checkbox-group' | 'select-enum' | 'select-options' | 'textarea' | 'range' | 'text' | 'number' | 'toggle' | 'array';
|
|
8
|
+
/**
|
|
9
|
+
* Resolve the basic field type for a schema — the single source of truth for
|
|
10
|
+
* the decision both the full and light field factories share.
|
|
11
|
+
*
|
|
12
|
+
* Returns `null` when none of the basic cases match, so each caller can apply
|
|
13
|
+
* its OWN special-case handling and fallback in its own order. The heavy and
|
|
14
|
+
* entry-point-specific cases (hidden, autocomplete, code/markdown/template
|
|
15
|
+
* editors, `object` → editor, registry-resolved components) are deliberately
|
|
16
|
+
* NOT decided here: `FormField` and `FormFieldLight` route those differently
|
|
17
|
+
* (static imports vs. the lazy field registry that keeps the `/form` light
|
|
18
|
+
* entry free of heavy deps), and must keep doing so before delegating here.
|
|
19
|
+
*
|
|
20
|
+
* Order matters and mirrors the original in-component chains: `enum` and
|
|
21
|
+
* `oneOf` are checked before the primitive `type` branches because option
|
|
22
|
+
* schemas frequently carry `type: 'string'`.
|
|
23
|
+
*/
|
|
24
|
+
export declare function resolveBaseFieldType(schema: FieldSchema): BaseFieldType | null;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve the basic field type for a schema — the single source of truth for
|
|
3
|
+
* the decision both the full and light field factories share.
|
|
4
|
+
*
|
|
5
|
+
* Returns `null` when none of the basic cases match, so each caller can apply
|
|
6
|
+
* its OWN special-case handling and fallback in its own order. The heavy and
|
|
7
|
+
* entry-point-specific cases (hidden, autocomplete, code/markdown/template
|
|
8
|
+
* editors, `object` → editor, registry-resolved components) are deliberately
|
|
9
|
+
* NOT decided here: `FormField` and `FormFieldLight` route those differently
|
|
10
|
+
* (static imports vs. the lazy field registry that keeps the `/form` light
|
|
11
|
+
* entry free of heavy deps), and must keep doing so before delegating here.
|
|
12
|
+
*
|
|
13
|
+
* Order matters and mirrors the original in-component chains: `enum` and
|
|
14
|
+
* `oneOf` are checked before the primitive `type` branches because option
|
|
15
|
+
* schemas frequently carry `type: 'string'`.
|
|
16
|
+
*/
|
|
17
|
+
export function resolveBaseFieldType(schema) {
|
|
18
|
+
// Enum with multiple selection -> checkbox group
|
|
19
|
+
if (schema.enum && schema.multiple) {
|
|
20
|
+
return 'checkbox-group';
|
|
21
|
+
}
|
|
22
|
+
// Enum with single selection -> select
|
|
23
|
+
if (schema.enum) {
|
|
24
|
+
return 'select-enum';
|
|
25
|
+
}
|
|
26
|
+
// oneOf with labeled options (standard JSON Schema) -> select
|
|
27
|
+
if (schema.oneOf && schema.oneOf.length > 0) {
|
|
28
|
+
return 'select-options';
|
|
29
|
+
}
|
|
30
|
+
// Multiline string -> textarea
|
|
31
|
+
if (schema.type === 'string' && schema.format === 'multiline') {
|
|
32
|
+
return 'textarea';
|
|
33
|
+
}
|
|
34
|
+
// Range slider for number/integer with format: "range"
|
|
35
|
+
if ((schema.type === 'number' || schema.type === 'integer') && schema.format === 'range') {
|
|
36
|
+
return 'range';
|
|
37
|
+
}
|
|
38
|
+
// String -> text field
|
|
39
|
+
if (schema.type === 'string') {
|
|
40
|
+
return 'text';
|
|
41
|
+
}
|
|
42
|
+
// Number or integer -> number field
|
|
43
|
+
if (schema.type === 'number' || schema.type === 'integer') {
|
|
44
|
+
return 'number';
|
|
45
|
+
}
|
|
46
|
+
// Boolean -> toggle
|
|
47
|
+
if (schema.type === 'boolean') {
|
|
48
|
+
return 'toggle';
|
|
49
|
+
}
|
|
50
|
+
// Array -> array field
|
|
51
|
+
if (schema.type === 'array') {
|
|
52
|
+
return 'array';
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<!-- Inline SVG equivalent of mdi:close (Material Design Icons) -->
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
|
|
3
|
+
<path
|
|
4
|
+
d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"
|
|
5
|
+
/>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default CloseIcon;
|
|
2
|
+
type CloseIcon = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
|
+
}, {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare const CloseIcon: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
+
[x: string]: never;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}, {}, string>;
|
|
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: {
|
|
19
|
+
$$events?: Events;
|
|
20
|
+
$$slots?: Slots;
|
|
21
|
+
}): Exports & {
|
|
22
|
+
$set?: any;
|
|
23
|
+
$on?: any;
|
|
24
|
+
};
|
|
25
|
+
z_$$bindings?: Bindings;
|
|
26
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<!-- Inline SVG equivalent of heroicons:command-line (outline) -->
|
|
2
|
+
<svg
|
|
3
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
4
|
+
viewBox="0 0 24 24"
|
|
5
|
+
fill="none"
|
|
6
|
+
stroke="currentColor"
|
|
7
|
+
stroke-width="1.5"
|
|
8
|
+
stroke-linecap="round"
|
|
9
|
+
stroke-linejoin="round"
|
|
10
|
+
aria-hidden="true"
|
|
11
|
+
>
|
|
12
|
+
<path
|
|
13
|
+
d="M6.75 7.5l3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0021 18V6a2.25 2.25 0 00-2.25-2.25H5.25A2.25 2.25 0 003 6v12a2.25 2.25 0 002.25 2.25z"
|
|
14
|
+
/>
|
|
15
|
+
</svg>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default CommandLineIcon;
|
|
2
|
+
type CommandLineIcon = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
|
+
}, {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare const CommandLineIcon: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
+
[x: string]: never;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}, {}, string>;
|
|
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: {
|
|
19
|
+
$$events?: Events;
|
|
20
|
+
$$slots?: Slots;
|
|
21
|
+
}): Exports & {
|
|
22
|
+
$set?: any;
|
|
23
|
+
$on?: any;
|
|
24
|
+
};
|
|
25
|
+
z_$$bindings?: Bindings;
|
|
26
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default MenuIcon;
|
|
2
|
+
type MenuIcon = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
|
+
}, {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare const MenuIcon: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
+
[x: string]: never;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}, {}, string>;
|
|
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: {
|
|
19
|
+
$$events?: Events;
|
|
20
|
+
$$slots?: Slots;
|
|
21
|
+
}): Exports & {
|
|
22
|
+
$set?: any;
|
|
23
|
+
$on?: any;
|
|
24
|
+
};
|
|
25
|
+
z_$$bindings?: Bindings;
|
|
26
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<!-- Inline SVG equivalent of mdi:menu-open (Material Design Icons) -->
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
|
|
3
|
+
<path
|
|
4
|
+
d="M21,15.61L19.59,17L14.58,12L19.59,7L21,8.39L17.44,12L21,15.61M3,6H16V8H3V6M3,13V11H13V13H3M3,18V16H16V18H3Z"
|
|
5
|
+
/>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default MenuOpenIcon;
|
|
2
|
+
type MenuOpenIcon = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
|
+
}, {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare const MenuOpenIcon: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
+
[x: string]: never;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}, {}, string>;
|
|
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: {
|
|
19
|
+
$$events?: Events;
|
|
20
|
+
$$slots?: Slots;
|
|
21
|
+
}): Exports & {
|
|
22
|
+
$set?: any;
|
|
23
|
+
$on?: any;
|
|
24
|
+
};
|
|
25
|
+
z_$$bindings?: Bindings;
|
|
26
|
+
}
|
|
@@ -313,11 +313,6 @@
|
|
|
313
313
|
border: 0;
|
|
314
314
|
}
|
|
315
315
|
|
|
316
|
-
.choice-prompt__option:focus-within {
|
|
317
|
-
outline: 2px solid var(--fd-ring);
|
|
318
|
-
outline-offset: 2px;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
316
|
.choice-prompt__checkmark {
|
|
322
317
|
flex-shrink: 0;
|
|
323
318
|
font-size: 1.25rem;
|
|
@@ -390,11 +385,6 @@
|
|
|
390
385
|
transform: translateY(-1px);
|
|
391
386
|
}
|
|
392
387
|
|
|
393
|
-
.choice-prompt__submit:focus-visible {
|
|
394
|
-
outline: 2px solid var(--fd-ring);
|
|
395
|
-
outline-offset: 2px;
|
|
396
|
-
}
|
|
397
|
-
|
|
398
388
|
.choice-prompt__submit:disabled {
|
|
399
389
|
opacity: 0.5;
|
|
400
390
|
cursor: not-allowed;
|