@flowdrop/flowdrop 2.15.2 → 2.17.0
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 +140 -0
- package/README.md +10 -1
- package/dist/components/App.svelte +219 -6
- package/dist/components/App.svelte.d.ts +8 -0
- package/dist/components/CanvasToolbar.svelte +40 -3
- package/dist/components/CanvasToolbar.svelte.d.ts +5 -1
- package/dist/components/ConnectPortPicker.svelte +8 -4
- package/dist/components/DoctorMenu.svelte +208 -126
- package/dist/components/ImpactConfirm.svelte +341 -0
- package/dist/components/ImpactConfirm.svelte.d.ts +12 -0
- package/dist/components/Input.svelte +2 -2
- package/dist/components/Navbar.svelte +48 -3
- package/dist/components/Navbar.svelte.d.ts +4 -0
- package/dist/components/NodeSidebar.svelte +36 -15
- package/dist/components/NodeSidebar.svelte.d.ts +2 -0
- package/dist/components/NodeSwapPicker.svelte +4 -14
- package/dist/components/RunBar.svelte +36 -1
- package/dist/components/RunBar.svelte.d.ts +5 -0
- package/dist/components/RunInputsDialog.svelte +198 -0
- package/dist/components/RunInputsDialog.svelte.d.ts +34 -0
- package/dist/components/SchemaForm.svelte +2 -1
- package/dist/components/SchemaForm.svelte.d.ts +2 -1
- package/dist/components/WorkflowCompareDialog.svelte +177 -0
- package/dist/components/WorkflowCompareDialog.svelte.d.ts +10 -0
- package/dist/components/WorkflowEditor.svelte +88 -6
- package/dist/components/WorkflowEditor.svelte.d.ts +6 -0
- package/dist/components/WorkflowInterfaceEditor.svelte +14 -4
- package/dist/components/WorkflowInterfaceEntryCard.svelte +19 -3
- package/dist/components/WorkflowInterfaceEntryCard.svelte.d.ts +2 -0
- package/dist/components/form/FormAutocomplete.svelte +76 -12
- package/dist/components/nodes/NodeCard.svelte +2 -2
- package/dist/components/primitives/Button.svelte +1 -1
- package/dist/components/primitives/Button.svelte.d.ts +1 -1
- package/dist/components/primitives/Card.svelte +1 -1
- package/dist/components/primitives/Card.svelte.d.ts +1 -1
- package/dist/components/primitives/Checkbox.svelte +1 -1
- package/dist/components/primitives/Checkbox.svelte.d.ts +1 -1
- package/dist/components/primitives/Chip.svelte +1 -1
- package/dist/components/primitives/Chip.svelte.d.ts +1 -1
- package/dist/components/primitives/Combobox.svelte +1 -1
- package/dist/components/primitives/Combobox.svelte.d.ts +1 -1
- package/dist/components/primitives/Composer.svelte +1 -1
- package/dist/components/primitives/Composer.svelte.d.ts +1 -1
- package/dist/components/primitives/EmptyState.svelte +1 -1
- package/dist/components/primitives/EmptyState.svelte.d.ts +1 -1
- package/dist/components/primitives/Field.svelte +1 -1
- package/dist/components/primitives/Field.svelte.d.ts +1 -1
- package/dist/components/primitives/IconButton.svelte +1 -1
- package/dist/components/primitives/IconButton.svelte.d.ts +1 -1
- package/dist/components/primitives/Menu.svelte +1 -1
- package/dist/components/primitives/Menu.svelte.d.ts +1 -1
- package/dist/components/primitives/Notice.svelte +1 -1
- package/dist/components/primitives/Notice.svelte.d.ts +1 -1
- package/dist/components/primitives/PanelHeader.svelte +1 -1
- package/dist/components/primitives/PanelHeader.svelte.d.ts +1 -1
- package/dist/components/primitives/Segmented.svelte +2 -2
- package/dist/components/primitives/Segmented.svelte.d.ts +2 -2
- package/dist/components/primitives/Select.svelte +1 -1
- package/dist/components/primitives/Select.svelte.d.ts +1 -1
- package/dist/components/primitives/StatusPill.svelte +1 -1
- package/dist/components/primitives/StatusPill.svelte.d.ts +1 -1
- package/dist/components/primitives/Switch.svelte +1 -1
- package/dist/components/primitives/Switch.svelte.d.ts +1 -1
- package/dist/components/primitives/Tabs.svelte +2 -2
- package/dist/components/primitives/Tabs.svelte.d.ts +2 -2
- package/dist/components/primitives/Toolbar.svelte +1 -1
- package/dist/components/primitives/Toolbar.svelte.d.ts +1 -1
- package/dist/components/primitives/ToolbarSeparator.svelte +1 -1
- package/dist/components/primitives/ToolbarSeparator.svelte.d.ts +1 -1
- package/dist/components/toast/DismissibleToast.svelte +25 -6
- package/dist/components/toast/DismissibleToast.svelte.d.ts +3 -0
- package/dist/config/endpoints.d.ts +7 -0
- package/dist/config/endpoints.js +2 -1
- package/dist/editor/connectCandidates.d.ts +3 -0
- package/dist/editor/connectCandidates.js +14 -5
- package/dist/editor/index.d.ts +1 -1
- package/dist/editor/index.js +1 -1
- package/dist/helpers/workflowEditorHelper.d.ts +15 -0
- package/dist/helpers/workflowEditorHelper.js +9 -0
- package/dist/index.d.ts +1 -0
- package/dist/messages/defaults.d.ts +101 -0
- package/dist/messages/defaults.js +92 -1
- package/dist/openapi/v1/openapi.yaml +10 -2
- package/dist/schemas/v1/workflow.schema.json +1 -1
- package/dist/services/draftStorage.d.ts +24 -10
- package/dist/services/draftStorage.js +60 -35
- package/dist/services/globalSave.d.ts +28 -10
- package/dist/services/globalSave.js +135 -31
- package/dist/services/impactGate.d.ts +34 -0
- package/dist/services/impactGate.js +70 -0
- package/dist/services/impactService.d.ts +28 -0
- package/dist/services/impactService.js +71 -0
- package/dist/services/toastQueue.d.ts +9 -0
- package/dist/services/toastService.d.ts +4 -0
- package/dist/services/toastService.js +9 -3
- package/dist/services/workflowLaunchService.js +3 -1
- package/dist/settings/index.d.ts +2 -2
- package/dist/settings/index.js +1 -1
- package/dist/stores/doctorStore.svelte.d.ts +24 -1
- package/dist/stores/doctorStore.svelte.js +105 -2
- package/dist/stores/instanceContainer.svelte.d.ts +16 -0
- package/dist/stores/instanceContainer.svelte.js +22 -2
- package/dist/stores/saveConflictStore.svelte.d.ts +62 -0
- package/dist/stores/saveConflictStore.svelte.js +169 -0
- package/dist/stores/workflowStore.svelte.d.ts +7 -3
- package/dist/stores/workflowStore.svelte.js +14 -5
- package/dist/styles/toast.css +10 -1
- package/dist/svelte-app.d.ts +23 -0
- package/dist/svelte-app.js +114 -3
- package/dist/themes/scopedSkinCss.d.ts +22 -0
- package/dist/themes/scopedSkinCss.js +27 -1
- package/dist/types/doctor.d.ts +3 -1
- package/dist/types/events.d.ts +20 -0
- package/dist/types/events.js +2 -0
- package/dist/types/impact.d.ts +25 -0
- package/dist/types/impact.js +7 -0
- package/dist/types/index.d.ts +11 -1
- package/dist/types/settings.d.ts +31 -0
- package/dist/types/settings.js +132 -0
- package/dist/ui/index.d.ts +76 -0
- package/dist/ui/index.js +81 -0
- package/dist/utils/apiUrl.d.ts +55 -0
- package/dist/utils/apiUrl.js +117 -0
- package/dist/utils/draftRestore.d.ts +27 -0
- package/dist/utils/draftRestore.js +36 -0
- package/dist/utils/interfaceTags.js +4 -1
- package/dist/utils/nodeSearch.d.ts +10 -0
- package/dist/utils/nodeSearch.js +37 -0
- package/dist/utils/portal.js +45 -3
- package/dist/utils/runOffer.d.ts +21 -0
- package/dist/utils/runOffer.js +13 -0
- package/dist/utils/workflowCompare.d.ts +35 -0
- package/dist/utils/workflowCompare.js +84 -0
- package/dist/utils/workflowInterface.d.ts +26 -1
- package/dist/utils/workflowInterface.js +91 -11
- package/dist/webmcp/index.d.ts +5 -0
- package/dist/webmcp/index.js +5 -0
- package/package.json +8 -2
|
@@ -8,6 +8,10 @@ interface Props {
|
|
|
8
8
|
onOpenTest?: () => void;
|
|
9
9
|
/** Take a failed run to the Assistant (the pill's "Ask the Assistant"). */
|
|
10
10
|
onAskAssistant?: (runId: string) => void;
|
|
11
|
+
/** Start the workflow. The Run button is drawn in Edit mode only, and only when this is set. */
|
|
12
|
+
onRun?: () => void;
|
|
13
|
+
/** A run is being started (saving, or waiting for the server): the button spins and blocks. */
|
|
14
|
+
runBusy?: boolean;
|
|
11
15
|
/** Show the run pill while a run exists. @default true */
|
|
12
16
|
showRun?: boolean;
|
|
13
17
|
/** Show the Runs list (Test mode's past runs). The host decides when. @default false */
|
|
@@ -19,7 +23,7 @@ interface Props {
|
|
|
19
23
|
};
|
|
20
24
|
}
|
|
21
25
|
/**
|
|
22
|
-
* The floating toolbar in the top-left corner of the canvas: the Edit | Test switch, the Runs list and the run pill.
|
|
26
|
+
* The floating toolbar in the top-left corner of the canvas: the Edit | Test switch, the Runs list, the Run button and the run pill.
|
|
23
27
|
*
|
|
24
28
|
* Each group draws only when its prop is given. The switch needs `onEditorModeChange`;
|
|
25
29
|
* the Runs list needs `showRuns` (the host turns it on in Test mode); the pill shows while the instance has a run.
|
|
@@ -37,8 +37,14 @@
|
|
|
37
37
|
|
|
38
38
|
const { portName, fromInput, groups, checker, x, y, onselect, onclose }: Props = $props();
|
|
39
39
|
|
|
40
|
-
/**
|
|
41
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Element that had focus when the picker opened; focus returns there when it closes.
|
|
42
|
+
* Read when the component is created: the list takes focus as it mounts, before the popover attachment runs.
|
|
43
|
+
*/
|
|
44
|
+
let previouslyFocused: HTMLElement | null =
|
|
45
|
+
typeof document !== 'undefined' && document.activeElement instanceof HTMLElement
|
|
46
|
+
? document.activeElement
|
|
47
|
+
: null;
|
|
42
48
|
|
|
43
49
|
function restoreFocus(): void {
|
|
44
50
|
if (previouslyFocused && previouslyFocused.isConnected) {
|
|
@@ -53,8 +59,6 @@
|
|
|
53
59
|
|
|
54
60
|
/** Opening, once: remember the focus, show the popover, wire the dismissals a manual popover does not do itself. */
|
|
55
61
|
const open: Attachment<HTMLDivElement> = (el) => {
|
|
56
|
-
previouslyFocused =
|
|
57
|
-
document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
58
62
|
// Optional: jsdom has no Popover API.
|
|
59
63
|
el.showPopover?.();
|
|
60
64
|
// The list asks for focus when it mounts, but a manual popover is not
|
|
@@ -35,7 +35,12 @@
|
|
|
35
35
|
const msgs = $derived(getMsgs().doctor);
|
|
36
36
|
|
|
37
37
|
const problems = $derived(fd.doctor.problems);
|
|
38
|
-
const
|
|
38
|
+
const status = $derived(fd.doctor.status);
|
|
39
|
+
/** A check that is still running after 600 ms: quick checks stay invisible. */
|
|
40
|
+
let showChecking = $state(false);
|
|
41
|
+
const hasProblems = $derived(problems.length > 0);
|
|
42
|
+
const failed = $derived(status === 'error');
|
|
43
|
+
const visible = $derived(fd.doctor.supported && (hasProblems || showChecking || failed));
|
|
39
44
|
const worst = $derived<DoctorSeverity>(
|
|
40
45
|
problems.some((p) => p.severity === 'error')
|
|
41
46
|
? 'error'
|
|
@@ -64,6 +69,15 @@
|
|
|
64
69
|
if (returnFocus) rootEl?.querySelector<HTMLElement>('.fd-doctor__trigger')?.focus();
|
|
65
70
|
}
|
|
66
71
|
|
|
72
|
+
$effect(() => {
|
|
73
|
+
if (status !== 'checking') {
|
|
74
|
+
showChecking = false;
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const timer = setTimeout(() => (showChecking = true), 600);
|
|
78
|
+
return () => clearTimeout(timer);
|
|
79
|
+
});
|
|
80
|
+
|
|
67
81
|
// The last problem was fixed: nothing left to show.
|
|
68
82
|
$effect(() => {
|
|
69
83
|
if (!visible && untrack(() => open)) close(false);
|
|
@@ -135,148 +149,187 @@
|
|
|
135
149
|
: msgs.notice[notice.kind];
|
|
136
150
|
}
|
|
137
151
|
|
|
152
|
+
const liveText = $derived(
|
|
153
|
+
!hasProblems && showChecking ? msgs.checking : !hasProblems && failed ? msgs.unavailable : ''
|
|
154
|
+
);
|
|
138
155
|
const notice = $derived(noticeText());
|
|
139
156
|
const busy = $derived(fd.doctor.applyingId !== null);
|
|
140
157
|
</script>
|
|
141
158
|
|
|
142
|
-
{#
|
|
143
|
-
<
|
|
159
|
+
{#snippet unavailableStatus()}
|
|
160
|
+
<span class="fd-doctor__status" data-testid="doctor-unavailable" title={msgs.unavailableTitle}>
|
|
161
|
+
{msgs.unavailable}
|
|
144
162
|
<Button
|
|
145
163
|
variant="ghost"
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
aria-expanded={open}
|
|
150
|
-
aria-controls={open ? popoverId : undefined}
|
|
151
|
-
title={msgs.triggerTitle}
|
|
152
|
-
data-testid="doctor-trigger"
|
|
153
|
-
data-severity={worst}
|
|
154
|
-
onclick={() => (open ? close(false) : (open = true))}
|
|
164
|
+
size="sm"
|
|
165
|
+
data-testid="doctor-retry"
|
|
166
|
+
onclick={() => void fd.doctor.diagnoseNow()}
|
|
155
167
|
>
|
|
156
|
-
{
|
|
157
|
-
{msgs.trigger({ count: problems.length })}
|
|
168
|
+
{msgs.retry}
|
|
158
169
|
</Button>
|
|
170
|
+
</span>
|
|
171
|
+
{/snippet}
|
|
172
|
+
|
|
173
|
+
<!-- Always mounted, so a change of its text is announced even when the indicator appears with it. -->
|
|
174
|
+
<span class="fd-doctor__live" role="status" aria-live="polite">{liveText}</span>
|
|
159
175
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
176
|
+
{#if visible}
|
|
177
|
+
<div class="fd-doctor" bind:this={rootEl} onkeydown={onKeydown} role="presentation">
|
|
178
|
+
{#if !hasProblems && showChecking}
|
|
179
|
+
<span class="fd-doctor__status" data-testid="doctor-checking" aria-hidden="true">
|
|
180
|
+
<Icon icon="mdi:loading" class="fd-doctor__spinner" />
|
|
181
|
+
{msgs.checking}
|
|
182
|
+
</span>
|
|
183
|
+
{:else if !hasProblems && failed}
|
|
184
|
+
{@render unavailableStatus()}
|
|
185
|
+
{/if}
|
|
186
|
+
{#if hasProblems}
|
|
187
|
+
<Button
|
|
188
|
+
variant="ghost"
|
|
189
|
+
class="fd-doctor__trigger fd-doctor__trigger--{worst} {open
|
|
190
|
+
? 'fd-doctor__trigger--open'
|
|
191
|
+
: ''}"
|
|
192
|
+
aria-expanded={open}
|
|
193
|
+
aria-controls={open ? popoverId : undefined}
|
|
194
|
+
title={msgs.triggerTitle}
|
|
195
|
+
data-testid="doctor-trigger"
|
|
196
|
+
data-severity={worst}
|
|
197
|
+
onclick={() => (open ? close(false) : (open = true))}
|
|
167
198
|
>
|
|
168
|
-
{#
|
|
169
|
-
|
|
170
|
-
<
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
{
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
{
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
variant="secondary"
|
|
223
|
-
size="sm"
|
|
224
|
-
disabled={busy}
|
|
225
|
-
loading={fd.doctor.applyingId === problem.id}
|
|
226
|
-
title={remedy.description}
|
|
227
|
-
data-testid="doctor-remedy"
|
|
228
|
-
data-remedy={remedy.id}
|
|
229
|
-
onclick={() => choose(problem, remedy)}
|
|
230
|
-
>
|
|
231
|
-
{remedy.label}
|
|
232
|
-
</Button>
|
|
233
|
-
{/each}
|
|
234
|
-
</div>
|
|
235
|
-
{/if}
|
|
236
|
-
{#if asking && askedRemedy}
|
|
237
|
-
{@const choices = choicesOf(askedRemedy)}
|
|
238
|
-
<div class="fd-doctor__ask" data-testid="doctor-ask">
|
|
239
|
-
{#if choices}
|
|
240
|
-
<Select
|
|
241
|
-
size="sm"
|
|
242
|
-
options={choices}
|
|
243
|
-
value={asking.choice}
|
|
244
|
-
placeholder={msgs.choosePlaceholder}
|
|
245
|
-
aria-label={msgs.chooseLabel}
|
|
246
|
-
data-testid="doctor-choice"
|
|
247
|
-
onValueChange={(value) => {
|
|
248
|
-
if (pending) pending = { ...pending, choice: value };
|
|
249
|
-
}}
|
|
250
|
-
/>
|
|
251
|
-
{/if}
|
|
252
|
-
{#if askedRemedy.destructive}
|
|
253
|
-
<span class="fd-doctor__confirm">{msgs.confirm}</span>
|
|
254
|
-
{/if}
|
|
255
|
-
<span class="fd-doctor__ask-actions">
|
|
256
|
-
<Button
|
|
257
|
-
variant={askedRemedy.destructive ? 'danger' : 'primary'}
|
|
258
|
-
size="sm"
|
|
259
|
-
disabled={busy || (!!choices && !asking.choice)}
|
|
260
|
-
data-testid="doctor-confirm"
|
|
261
|
-
onclick={() => void run(problem, askedRemedy, asking.choice)}
|
|
262
|
-
>
|
|
263
|
-
{msgs.confirmApply}
|
|
264
|
-
</Button>
|
|
199
|
+
{#snippet leadingIcon()}
|
|
200
|
+
{#if showChecking}
|
|
201
|
+
<Icon icon="mdi:loading" class="fd-doctor__spinner" />
|
|
202
|
+
{:else}
|
|
203
|
+
<Icon icon={ICONS[worst]} />
|
|
204
|
+
{/if}
|
|
205
|
+
{/snippet}
|
|
206
|
+
{msgs.trigger({ count: problems.length })}
|
|
207
|
+
</Button>
|
|
208
|
+
{#if failed}
|
|
209
|
+
{@render unavailableStatus()}
|
|
210
|
+
{/if}
|
|
211
|
+
|
|
212
|
+
{#if open}
|
|
213
|
+
<div
|
|
214
|
+
class="fd-doctor__popover"
|
|
215
|
+
id={popoverId}
|
|
216
|
+
role="region"
|
|
217
|
+
aria-label={msgs.title}
|
|
218
|
+
data-testid="doctor-popover"
|
|
219
|
+
>
|
|
220
|
+
{#if notice}
|
|
221
|
+
<div class="fd-doctor__notice" data-testid="doctor-notice">
|
|
222
|
+
<Notice
|
|
223
|
+
tone={fd.doctor.notice?.kind === 'failed' ? 'error' : 'info'}
|
|
224
|
+
ondismiss={() => fd.doctor.dismissNotice()}
|
|
225
|
+
dismissLabel={msgs.dismissNotice}
|
|
226
|
+
>
|
|
227
|
+
{notice}
|
|
228
|
+
</Notice>
|
|
229
|
+
</div>
|
|
230
|
+
{/if}
|
|
231
|
+
<ul class="fd-doctor__list" aria-label={msgs.listLabel}>
|
|
232
|
+
{#each problems as problem (problem.id)}
|
|
233
|
+
{@const name = nodeName(problem)}
|
|
234
|
+
{@const asking = pending?.problemId === problem.id ? pending : null}
|
|
235
|
+
{@const askedRemedy = asking
|
|
236
|
+
? problem.remedies.find((r) => r.id === asking.remedyId)
|
|
237
|
+
: undefined}
|
|
238
|
+
{@const single =
|
|
239
|
+
canApply &&
|
|
240
|
+
problem.remedies.length === 1 &&
|
|
241
|
+
!asking &&
|
|
242
|
+
!choicesOf(problem.remedies[0])}
|
|
243
|
+
<li
|
|
244
|
+
class="fd-doctor__row fd-doctor__row--{problem.severity}"
|
|
245
|
+
data-testid="doctor-problem"
|
|
246
|
+
data-code={problem.code}
|
|
247
|
+
data-severity={problem.severity}
|
|
248
|
+
>
|
|
249
|
+
<span class="fd-doctor__dot" role="img" aria-label={msgs.severity[problem.severity]}
|
|
250
|
+
></span>
|
|
251
|
+
<div class="fd-doctor__text">
|
|
252
|
+
{#if name && problem.node}
|
|
265
253
|
<Button
|
|
266
254
|
variant="ghost"
|
|
267
255
|
size="sm"
|
|
268
|
-
|
|
269
|
-
|
|
256
|
+
class="fd-doctor__node"
|
|
257
|
+
title={msgs.selectNode({ name })}
|
|
258
|
+
data-testid="doctor-node-link"
|
|
259
|
+
onclick={() => fd.doctor.focusNode(problem.node!)}
|
|
270
260
|
>
|
|
271
|
-
{
|
|
261
|
+
{name}
|
|
272
262
|
</Button>
|
|
263
|
+
{:else}
|
|
264
|
+
<span class="fd-doctor__node-plain">{msgs.workflowWide}</span>
|
|
265
|
+
{/if}
|
|
266
|
+
<span class="fd-doctor__message">
|
|
267
|
+
{problem.message}
|
|
273
268
|
</span>
|
|
274
269
|
</div>
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
270
|
+
{#if canApply && problem.remedies.length > 0 && !asking}
|
|
271
|
+
<div class="fd-doctor__actions" class:fd-doctor__actions--side={single}>
|
|
272
|
+
{#each problem.remedies as remedy (remedy.id)}
|
|
273
|
+
<Button
|
|
274
|
+
variant="secondary"
|
|
275
|
+
size="sm"
|
|
276
|
+
disabled={busy}
|
|
277
|
+
loading={fd.doctor.applyingId === problem.id}
|
|
278
|
+
title={remedy.description}
|
|
279
|
+
data-testid="doctor-remedy"
|
|
280
|
+
data-remedy={remedy.id}
|
|
281
|
+
onclick={() => choose(problem, remedy)}
|
|
282
|
+
>
|
|
283
|
+
{remedy.label}
|
|
284
|
+
</Button>
|
|
285
|
+
{/each}
|
|
286
|
+
</div>
|
|
287
|
+
{/if}
|
|
288
|
+
{#if asking && askedRemedy}
|
|
289
|
+
{@const choices = choicesOf(askedRemedy)}
|
|
290
|
+
<div class="fd-doctor__ask" data-testid="doctor-ask">
|
|
291
|
+
{#if choices}
|
|
292
|
+
<Select
|
|
293
|
+
size="sm"
|
|
294
|
+
options={choices}
|
|
295
|
+
value={asking.choice}
|
|
296
|
+
placeholder={msgs.choosePlaceholder}
|
|
297
|
+
aria-label={msgs.chooseLabel}
|
|
298
|
+
data-testid="doctor-choice"
|
|
299
|
+
onValueChange={(value) => {
|
|
300
|
+
if (pending) pending = { ...pending, choice: value };
|
|
301
|
+
}}
|
|
302
|
+
/>
|
|
303
|
+
{/if}
|
|
304
|
+
{#if askedRemedy.destructive}
|
|
305
|
+
<span class="fd-doctor__confirm">{msgs.confirm}</span>
|
|
306
|
+
{/if}
|
|
307
|
+
<span class="fd-doctor__ask-actions">
|
|
308
|
+
<Button
|
|
309
|
+
variant={askedRemedy.destructive ? 'danger' : 'primary'}
|
|
310
|
+
size="sm"
|
|
311
|
+
disabled={busy || (!!choices && !asking.choice)}
|
|
312
|
+
data-testid="doctor-confirm"
|
|
313
|
+
onclick={() => void run(problem, askedRemedy, asking.choice)}
|
|
314
|
+
>
|
|
315
|
+
{msgs.confirmApply}
|
|
316
|
+
</Button>
|
|
317
|
+
<Button
|
|
318
|
+
variant="ghost"
|
|
319
|
+
size="sm"
|
|
320
|
+
data-testid="doctor-cancel"
|
|
321
|
+
onclick={() => (pending = null)}
|
|
322
|
+
>
|
|
323
|
+
{msgs.confirmCancel}
|
|
324
|
+
</Button>
|
|
325
|
+
</span>
|
|
326
|
+
</div>
|
|
327
|
+
{/if}
|
|
328
|
+
</li>
|
|
329
|
+
{/each}
|
|
330
|
+
</ul>
|
|
331
|
+
</div>
|
|
332
|
+
{/if}
|
|
280
333
|
{/if}
|
|
281
334
|
</div>
|
|
282
335
|
{/if}
|
|
@@ -304,6 +357,35 @@
|
|
|
304
357
|
color: var(--_c);
|
|
305
358
|
}
|
|
306
359
|
|
|
360
|
+
.fd-doctor__live {
|
|
361
|
+
position: absolute;
|
|
362
|
+
width: 1px;
|
|
363
|
+
height: 1px;
|
|
364
|
+
overflow: hidden;
|
|
365
|
+
clip-path: inset(50%);
|
|
366
|
+
white-space: nowrap;
|
|
367
|
+
}
|
|
368
|
+
.fd-doctor__status {
|
|
369
|
+
display: inline-flex;
|
|
370
|
+
align-items: center;
|
|
371
|
+
gap: var(--fd-space-xs);
|
|
372
|
+
color: var(--fd-muted-foreground);
|
|
373
|
+
font-size: var(--fd-text-sm);
|
|
374
|
+
}
|
|
375
|
+
.fd-doctor :global(.fd-doctor__spinner) {
|
|
376
|
+
animation: fd-doctor-spin 1s linear infinite;
|
|
377
|
+
}
|
|
378
|
+
@keyframes fd-doctor-spin {
|
|
379
|
+
to {
|
|
380
|
+
transform: rotate(360deg);
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
@media (prefers-reduced-motion: reduce) {
|
|
384
|
+
.fd-doctor :global(.fd-doctor__spinner) {
|
|
385
|
+
animation: none;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
|
|
307
389
|
.fd-doctor__popover {
|
|
308
390
|
position: absolute;
|
|
309
391
|
top: calc(100% + var(--fd-space-xs));
|