@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
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import '@xyflow/svelte/dist/style.css';
|
|
2
2
|
import type { WorkflowNode as WorkflowNodeType } from '../types/index.js';
|
|
3
3
|
import { type ContextMenuOptions } from '../editor/contextMenu.js';
|
|
4
|
+
import type { NodeMetadata } from '../types/index.js';
|
|
4
5
|
import type { EndpointConfig } from '../config/endpoints.js';
|
|
5
6
|
import type { AuthProvider } from '../types/auth.js';
|
|
6
7
|
import type { FlowDropInstance } from '../stores/instanceContainer.svelte.js';
|
|
@@ -86,6 +87,10 @@ interface Props {
|
|
|
86
87
|
* while a run waits for them. Without it the button is not shown.
|
|
87
88
|
*/
|
|
88
89
|
onOpenTest?: () => void;
|
|
90
|
+
/** Start the workflow: the canvas toolbar's Run button (Edit mode). Without it the button is not shown. */
|
|
91
|
+
onRun?: () => void;
|
|
92
|
+
/** A run is being started: the Run button spins. */
|
|
93
|
+
runBusy?: boolean;
|
|
89
94
|
/** Current editor mode, shown in the canvas toolbar's Edit | Test switch. @default 'edit' */
|
|
90
95
|
editorMode?: 'edit' | 'test';
|
|
91
96
|
/** Switch the editor mode. The toolbar's Edit | Test switch is shown only when this is set. */
|
|
@@ -99,6 +104,7 @@ interface Props {
|
|
|
99
104
|
declare const WorkflowEditor: import("svelte").Component<Props, {
|
|
100
105
|
updateNodeData: (nodeId: string, dataUpdates: Partial<WorkflowNodeType["data"]>) => void;
|
|
101
106
|
refreshEdgePositions: (nodeId: string) => Promise<void>;
|
|
107
|
+
addNodeFromPalette: (metadata: NodeMetadata) => void;
|
|
102
108
|
canvasFitView: () => void;
|
|
103
109
|
canvasFocusNode: (nodeId: string) => void;
|
|
104
110
|
canvasZoomIn: () => void;
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
|
|
32
32
|
<script lang="ts">
|
|
33
33
|
import Icon from '@iconify/svelte';
|
|
34
|
+
import { SvelteSet } from 'svelte/reactivity';
|
|
34
35
|
import Button from './primitives/Button.svelte';
|
|
35
36
|
import { m } from '../messages/index.js';
|
|
36
37
|
import WorkflowInterfaceEntryCard from './WorkflowInterfaceEntryCard.svelte';
|
|
@@ -54,7 +55,8 @@
|
|
|
54
55
|
validateWorkflowInterface,
|
|
55
56
|
type InterfaceIssue,
|
|
56
57
|
type RankedBindablePort,
|
|
57
|
-
type ResolvedInterfaceEntry
|
|
58
|
+
type ResolvedInterfaceEntry,
|
|
59
|
+
nodeCanvasLabel
|
|
58
60
|
} from '../utils/workflowInterface.js';
|
|
59
61
|
|
|
60
62
|
interface Props {
|
|
@@ -166,7 +168,7 @@
|
|
|
166
168
|
const edge = workflow.edges.find((e) => e.targetHandle === handleId);
|
|
167
169
|
if (!edge) return undefined;
|
|
168
170
|
const source = workflow.nodes.find((n) => n.id === edge.source);
|
|
169
|
-
return source
|
|
171
|
+
return source ? nodeCanvasLabel(source) : edge.source;
|
|
170
172
|
}
|
|
171
173
|
|
|
172
174
|
/**
|
|
@@ -188,6 +190,9 @@
|
|
|
188
190
|
*/
|
|
189
191
|
let rowIdSeq = 0;
|
|
190
192
|
|
|
193
|
+
/** Row ids of entries appended this session; their cards start open. */
|
|
194
|
+
const addedRowIds = new SvelteSet<string>();
|
|
195
|
+
|
|
191
196
|
function mintRowId(): string {
|
|
192
197
|
rowIdSeq += 1;
|
|
193
198
|
return `row-${rowIdSeq}`;
|
|
@@ -282,7 +287,9 @@
|
|
|
282
287
|
function appendEntry(direction: Direction, entry: WorkflowInterfaceEntry): void {
|
|
283
288
|
// A row id of its own, so adding an entry leaves every other card — and
|
|
284
289
|
// every other card's disclosure — exactly as the author left it.
|
|
285
|
-
|
|
290
|
+
const addedId = mintRowId();
|
|
291
|
+
addedRowIds.add(addedId);
|
|
292
|
+
rowIds[direction] = [...rowIds[direction], addedId];
|
|
286
293
|
commit(direction, [...entriesFor(direction), entry]);
|
|
287
294
|
composerFor = null;
|
|
288
295
|
}
|
|
@@ -298,7 +305,9 @@
|
|
|
298
305
|
direction,
|
|
299
306
|
entryFromBindablePort(
|
|
300
307
|
candidate,
|
|
301
|
-
entriesFor(direction).map((entry) => entry.id)
|
|
308
|
+
entriesFor(direction).map((entry) => entry.id),
|
|
309
|
+
workflow,
|
|
310
|
+
entryDirectionOf(direction)
|
|
302
311
|
)
|
|
303
312
|
);
|
|
304
313
|
}
|
|
@@ -412,6 +421,7 @@
|
|
|
412
421
|
: undefined}
|
|
413
422
|
{onOpenPlaygroundSettings}
|
|
414
423
|
turnSelector={workflow.playground === undefined}
|
|
424
|
+
initiallyOpen={addedRowIds.has(rowIds[section.key][index] ?? '')}
|
|
415
425
|
isFirst={index === 0}
|
|
416
426
|
isLast={index === list.length - 1}
|
|
417
427
|
onPatch={(patch: Partial<WorkflowInterfaceEntry>) =>
|
|
@@ -47,7 +47,8 @@
|
|
|
47
47
|
turnsFor,
|
|
48
48
|
type RankedBindablePort,
|
|
49
49
|
type InterfaceIssue,
|
|
50
|
-
type ResolvedInterfaceEntry
|
|
50
|
+
type ResolvedInterfaceEntry,
|
|
51
|
+
nodeCanvasLabel
|
|
51
52
|
} from '../utils/workflowInterface.js';
|
|
52
53
|
|
|
53
54
|
interface Props {
|
|
@@ -81,6 +82,8 @@
|
|
|
81
82
|
* up. With settings, a stored `turn` shows as a deprecated chip instead.
|
|
82
83
|
*/
|
|
83
84
|
turnSelector?: boolean;
|
|
85
|
+
/** Open the secondary fields from the start (a row the author just added). */
|
|
86
|
+
initiallyOpen?: boolean;
|
|
84
87
|
isFirst: boolean;
|
|
85
88
|
isLast: boolean;
|
|
86
89
|
onPatch: (patch: Partial<WorkflowInterfaceEntry>) => void;
|
|
@@ -101,6 +104,7 @@
|
|
|
101
104
|
turnTakenBy,
|
|
102
105
|
onOpenPlaygroundSettings,
|
|
103
106
|
turnSelector = false,
|
|
107
|
+
initiallyOpen = false,
|
|
104
108
|
isFirst,
|
|
105
109
|
isLast,
|
|
106
110
|
onPatch,
|
|
@@ -116,7 +120,9 @@
|
|
|
116
120
|
*/
|
|
117
121
|
// The seed is meant to be read once.
|
|
118
122
|
// svelte-ignore state_referenced_locally
|
|
119
|
-
let fieldsOpen = $state(
|
|
123
|
+
let fieldsOpen = $state(
|
|
124
|
+
initiallyOpen || status?.status === 'type-mismatch' || turnTakenBy !== undefined
|
|
125
|
+
);
|
|
120
126
|
|
|
121
127
|
/** Statuses still explained in the footer (the rest render inline or as the dot). */
|
|
122
128
|
const FOOTER_STATUSES = new Set(['unbound', 'dangling', 'hidden', 'over-bound']);
|
|
@@ -345,7 +351,7 @@
|
|
|
345
351
|
></span>
|
|
346
352
|
<span class="wf-interface__binding-path">
|
|
347
353
|
<span class="wf-interface__binding-node">
|
|
348
|
-
{boundTarget.node
|
|
354
|
+
{nodeCanvasLabel(boundTarget.node)}
|
|
349
355
|
</span>
|
|
350
356
|
<Icon icon="heroicons:chevron-right" />
|
|
351
357
|
<span class="wf-interface__binding-port">{boundTarget.port.name}</span>
|
|
@@ -374,6 +380,11 @@
|
|
|
374
380
|
{turnLabel}
|
|
375
381
|
</span>
|
|
376
382
|
{/if}
|
|
383
|
+
{#if isInput && !entry.name && !fieldsOpen}
|
|
384
|
+
<span class="wf-interface__turn-chip" data-testid="wf-entry-no-title">
|
|
385
|
+
{m().workflowInterface.noTitle}
|
|
386
|
+
</span>
|
|
387
|
+
{/if}
|
|
377
388
|
<Menu
|
|
378
389
|
size="sm"
|
|
379
390
|
align="end"
|
|
@@ -521,6 +532,11 @@
|
|
|
521
532
|
<option value={option.id}>{option.name}</option>
|
|
522
533
|
{/each}
|
|
523
534
|
</Select>
|
|
535
|
+
{#if isInput && entry.dataType === 'mixed'}
|
|
536
|
+
<span class="wf-interface__inline wf-interface__inline--warning">
|
|
537
|
+
{m().workflowInterface.mixedInputHint}
|
|
538
|
+
</span>
|
|
539
|
+
{/if}
|
|
524
540
|
{#if status?.status === 'type-mismatch' && boundPortType}
|
|
525
541
|
<span class="wf-interface__inline wf-interface__inline--warning">
|
|
526
542
|
{m().workflowInterface.typeMismatchInline({ portType: boundPortType ?? '' })}
|
|
@@ -32,6 +32,8 @@ interface Props {
|
|
|
32
32
|
* up. With settings, a stored `turn` shows as a deprecated chip instead.
|
|
33
33
|
*/
|
|
34
34
|
turnSelector?: boolean;
|
|
35
|
+
/** Open the secondary fields from the start (a row the author just added). */
|
|
36
|
+
initiallyOpen?: boolean;
|
|
35
37
|
isFirst: boolean;
|
|
36
38
|
isLast: boolean;
|
|
37
39
|
onPatch: (patch: Partial<WorkflowInterfaceEntry>) => void;
|
|
@@ -26,6 +26,13 @@
|
|
|
26
26
|
<script lang="ts">
|
|
27
27
|
import { getContext, onMount, untrack } from 'svelte';
|
|
28
28
|
import { SvelteMap } from 'svelte/reactivity';
|
|
29
|
+
import {
|
|
30
|
+
isBaseRelative,
|
|
31
|
+
mayCarryInstanceAuth,
|
|
32
|
+
resolveAutocompleteUrl
|
|
33
|
+
} from '../../utils/apiUrl.js';
|
|
34
|
+
import { FLOWDROP_INSTANCE_KEY } from '../../stores/getInstance.svelte.js';
|
|
35
|
+
import type { FlowDropInstance } from '../../stores/instanceContainer.svelte.js';
|
|
29
36
|
import Icon from '@iconify/svelte';
|
|
30
37
|
import type { AutocompleteConfig, AuthProvider } from '../../types/index.js';
|
|
31
38
|
import type { FieldOption } from './types.js';
|
|
@@ -75,6 +82,15 @@
|
|
|
75
82
|
const getFormValues = getContext<(() => Record<string, unknown>) | undefined>(
|
|
76
83
|
'flowdrop:getFormValues'
|
|
77
84
|
);
|
|
85
|
+
// The API base comes from the instance, so it is the same in every form
|
|
86
|
+
// (config panel, SchemaForm, interrupt prompts). Read the context directly,
|
|
87
|
+
// not via getInstance(): this field is also exported on its own, and without
|
|
88
|
+
// an instance it should just have no base, not throw during SSR.
|
|
89
|
+
const fd = getContext<FlowDropInstance | undefined>(FLOWDROP_INSTANCE_KEY);
|
|
90
|
+
// The URL last logged as refused / as missing a base: a field whose
|
|
91
|
+
// `autocomplete.url` changes logs again for the new one.
|
|
92
|
+
let warnedNoApiBaseFor: string | null = null;
|
|
93
|
+
let loggedRefusedFor: string | null = null;
|
|
78
94
|
|
|
79
95
|
// Hoist the autocomplete branch — seven reads in the template, one inside
|
|
80
96
|
// an {#each tag} loop. One getter walk per render.
|
|
@@ -182,19 +198,58 @@
|
|
|
182
198
|
return labelCache.get(val) ?? val;
|
|
183
199
|
}
|
|
184
200
|
|
|
201
|
+
/**
|
|
202
|
+
* Auth for a request: the form's provider, or, where the form has none
|
|
203
|
+
* (interrupt forms), the instance's for requests to the site or under an
|
|
204
|
+
* absolute API base. Other hosts get no instance auth.
|
|
205
|
+
*/
|
|
206
|
+
function currentAuthProvider(requestUrl: string): AuthProvider | undefined {
|
|
207
|
+
const fromForm = getAuthProvider?.();
|
|
208
|
+
if (fromForm) return fromForm;
|
|
209
|
+
// Judge the URL that is actually fetched, resolved as the browser does, not
|
|
210
|
+
// the configured text: a no-slash URL can resolve against an absolute
|
|
211
|
+
// baseUrl prop.
|
|
212
|
+
const pageUrl = typeof location === 'undefined' ? undefined : location.href;
|
|
213
|
+
return mayCarryInstanceAuth(requestUrl, fd?.api.config?.baseUrl ?? '', pageUrl)
|
|
214
|
+
? fd?.api.authProvider
|
|
215
|
+
: undefined;
|
|
216
|
+
}
|
|
217
|
+
|
|
185
218
|
/**
|
|
186
219
|
* Build the full URL for fetching suggestions
|
|
187
220
|
* @param query - The search query
|
|
188
|
-
* @returns Full URL with query parameter
|
|
221
|
+
* @returns Full URL with query parameter, or null when the configured URL
|
|
222
|
+
* is refused (logged once per field)
|
|
189
223
|
*/
|
|
190
|
-
function buildUrl(query: string): string {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
224
|
+
function buildUrl(query: string): string | null {
|
|
225
|
+
// A URL without a leading slash resolves against SchemaForm's `baseUrl`
|
|
226
|
+
// prop when one is given, else the instance's API base. The prop also goes
|
|
227
|
+
// in front of `/path` URLs.
|
|
228
|
+
const apiBase = fd?.api.config?.baseUrl ?? '';
|
|
229
|
+
const prefix = getBaseUrl?.() ?? '';
|
|
230
|
+
const raw = autocomplete.url;
|
|
231
|
+
const url = resolveAutocompleteUrl(raw, apiBase, prefix);
|
|
232
|
+
if (url === null) {
|
|
233
|
+
if (loggedRefusedFor !== raw) {
|
|
234
|
+
loggedRefusedFor = raw;
|
|
235
|
+
logger.error(
|
|
236
|
+
`[FormAutocomplete] Refusing autocomplete URL "${raw}"; nothing is fetched. See "How url is resolved" in the config schema guide for the URL forms that are accepted.`
|
|
237
|
+
);
|
|
238
|
+
}
|
|
239
|
+
return null;
|
|
240
|
+
}
|
|
241
|
+
if (!apiBase && !prefix && warnedNoApiBaseFor !== raw && isBaseRelative(raw)) {
|
|
242
|
+
warnedNoApiBaseFor = raw;
|
|
243
|
+
logger.warn(
|
|
244
|
+
`[FormAutocomplete] "${raw}" is relative to the API base, but no endpointConfig.baseUrl is set; using it as given.`
|
|
245
|
+
);
|
|
246
|
+
}
|
|
195
247
|
|
|
196
|
-
|
|
197
|
-
|
|
248
|
+
// The parameters go before any `#fragment`, which the request never sends.
|
|
249
|
+
const hashAt = url.indexOf('#');
|
|
250
|
+
const path = hashAt === -1 ? url : url.slice(0, hashAt);
|
|
251
|
+
const separator = path.includes('?') ? '&' : '?';
|
|
252
|
+
let fullUrl = `${path}${separator}${encodeURIComponent(queryParam)}=${encodeURIComponent(query)}`;
|
|
198
253
|
|
|
199
254
|
for (const [paramName, val] of Object.entries(depParamValues)) {
|
|
200
255
|
fullUrl += `&${encodeURIComponent(paramName)}=${encodeURIComponent(val)}`;
|
|
@@ -244,6 +299,13 @@
|
|
|
244
299
|
return;
|
|
245
300
|
}
|
|
246
301
|
|
|
302
|
+
const requestUrl = buildUrl(query);
|
|
303
|
+
if (requestUrl === null) {
|
|
304
|
+
suggestions = [];
|
|
305
|
+
error = t.invalidUrl;
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
|
|
247
309
|
isLoading = true;
|
|
248
310
|
error = null;
|
|
249
311
|
// Capture in a local const so the timeout closure and fetch signal
|
|
@@ -259,9 +321,9 @@
|
|
|
259
321
|
// authenticatedFetch merges auth headers (call getter for current value)
|
|
260
322
|
// and applies the 401/403 lifecycle consistently with the rest of the lib.
|
|
261
323
|
const response = await authenticatedFetch(
|
|
262
|
-
|
|
324
|
+
requestUrl,
|
|
263
325
|
{ method: 'GET', signal: controller.signal },
|
|
264
|
-
{ authProvider:
|
|
326
|
+
{ authProvider: currentAuthProvider(requestUrl) }
|
|
265
327
|
);
|
|
266
328
|
|
|
267
329
|
if (!response.ok) {
|
|
@@ -637,15 +699,17 @@
|
|
|
637
699
|
*/
|
|
638
700
|
async function lookupLabels(): Promise<void> {
|
|
639
701
|
labelController?.abort();
|
|
702
|
+
const requestUrl = buildUrl('');
|
|
703
|
+
if (requestUrl === null) return;
|
|
640
704
|
const controller = new AbortController();
|
|
641
705
|
labelController = controller;
|
|
642
706
|
const fingerprint = depFingerprint;
|
|
643
707
|
const timeoutId = setTimeout(() => controller.abort(timeoutError()), 5000);
|
|
644
708
|
try {
|
|
645
709
|
const response = await authenticatedFetch(
|
|
646
|
-
|
|
710
|
+
requestUrl,
|
|
647
711
|
{ method: 'GET', signal: controller.signal },
|
|
648
|
-
{ authProvider:
|
|
712
|
+
{ authProvider: currentAuthProvider(requestUrl) }
|
|
649
713
|
);
|
|
650
714
|
if (!response.ok) {
|
|
651
715
|
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
@@ -315,7 +315,7 @@
|
|
|
315
315
|
data-fd-port-type={pin.port.dataType}
|
|
316
316
|
aria-label={pin.direction === 'input' ? graph.execIn : graph.execOut}
|
|
317
317
|
style="top: {pin.y}px; transform: translateY(-50%);"
|
|
318
|
-
tabindex={-1}
|
|
318
|
+
tabindex={selected ? 0 : -1}
|
|
319
319
|
onmouseenter={(e: Event) => showPortTip(e, pin.port, pin.direction, false, true)}
|
|
320
320
|
onmouseleave={hideTip}
|
|
321
321
|
onfocus={(e: Event) => showPortTip(e, pin.port, pin.direction, false, true)}
|
|
@@ -361,7 +361,7 @@
|
|
|
361
361
|
? graph.connectInputPort({ name: port.name })
|
|
362
362
|
: graph.connectOutputPort({ name: port.name })}
|
|
363
363
|
style="top: {item.y}px; transform: translateY(-50%); --_c: {portColor};"
|
|
364
|
-
tabindex={-1}
|
|
364
|
+
tabindex={selected ? 0 : -1}
|
|
365
365
|
onmouseenter={(e: Event) => showPortTip(e, port, item.direction, open, false)}
|
|
366
366
|
onmouseleave={hideTip}
|
|
367
367
|
onfocus={(e: Event) => showPortTip(e, port, item.direction, open, false)}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
**Not for** icon-only actions; use `IconButton`. For a list of actions behind one
|
|
11
11
|
trigger use `Menu`.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Exported from `@flowdrop/flowdrop/ui`. The wrapper `components/Button.svelte`
|
|
14
14
|
is the old API on top of this.
|
|
15
15
|
-->
|
|
16
16
|
|
|
@@ -40,7 +40,7 @@ interface Props extends Omit<HTMLButtonAttributes, 'children' | 'class' | 'type'
|
|
|
40
40
|
* **Not for** icon-only actions; use `IconButton`. For a list of actions behind one
|
|
41
41
|
* trigger use `Menu`.
|
|
42
42
|
*
|
|
43
|
-
*
|
|
43
|
+
* Exported from `@flowdrop/flowdrop/ui`. The wrapper `components/Button.svelte`
|
|
44
44
|
* is the old API on top of this.
|
|
45
45
|
*/
|
|
46
46
|
declare const Button: import("svelte").Component<Props, {}, "">;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
**Use it for** a bordered group of content, such as an input form or a prompt that waits for an answer.
|
|
9
9
|
**Not for** a whole panel; use `PanelHeader` for the top strip of a panel.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Exported from `@flowdrop/flowdrop/ui`.
|
|
12
12
|
-->
|
|
13
13
|
|
|
14
14
|
<script lang="ts">
|
|
@@ -24,7 +24,7 @@ interface Props {
|
|
|
24
24
|
* **Use it for** a bordered group of content, such as an input form or a prompt that waits for an answer.
|
|
25
25
|
* **Not for** a whole panel; use `PanelHeader` for the top strip of a panel.
|
|
26
26
|
*
|
|
27
|
-
*
|
|
27
|
+
* Exported from `@flowdrop/flowdrop/ui`.
|
|
28
28
|
*/
|
|
29
29
|
declare const Card: import("svelte").Component<Props, {}, "">;
|
|
30
30
|
type Card = ReturnType<typeof Card>;
|
|
@@ -19,7 +19,7 @@ interface Props extends Omit<HTMLInputAttributes, 'type' | 'checked' | 'onchange
|
|
|
19
19
|
* **Use it for** a yes/no option in a form or a list of choices.
|
|
20
20
|
* **Not for** an instant on/off setting; use `Switch`.
|
|
21
21
|
*
|
|
22
|
-
*
|
|
22
|
+
* Exported from `@flowdrop/flowdrop/ui`.
|
|
23
23
|
*/
|
|
24
24
|
declare const Checkbox: import("svelte").Component<Props, {}, "">;
|
|
25
25
|
type Checkbox = ReturnType<typeof Checkbox>;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
**Use it for** tags and short status words next to a title.
|
|
9
9
|
**Not for** run status; use `StatusPill`. Not used in the editor yet.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Exported from `@flowdrop/flowdrop/ui`.
|
|
12
12
|
-->
|
|
13
13
|
|
|
14
14
|
<script lang="ts">
|
|
@@ -26,7 +26,7 @@ interface Props {
|
|
|
26
26
|
* **Use it for** tags and short status words next to a title.
|
|
27
27
|
* **Not for** run status; use `StatusPill`. Not used in the editor yet.
|
|
28
28
|
*
|
|
29
|
-
*
|
|
29
|
+
* Exported from `@flowdrop/flowdrop/ui`.
|
|
30
30
|
*/
|
|
31
31
|
declare const Chip: import("svelte").Component<Props, {}, "">;
|
|
32
32
|
type Chip = ReturnType<typeof Chip>;
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
**Use it** through `Select`, which picks this rendering for long, grouped or described lists.
|
|
19
19
|
**Not for** a short flat list; use `Select`, which then renders the browser's own `<select>`.
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Exported from `@flowdrop/flowdrop/ui`.
|
|
22
22
|
-->
|
|
23
23
|
|
|
24
24
|
<script lang="ts">
|
|
@@ -48,7 +48,7 @@ interface Props {
|
|
|
48
48
|
* **Use it** through `Select`, which picks this rendering for long, grouped or described lists.
|
|
49
49
|
* **Not for** a short flat list; use `Select`, which then renders the browser's own `<select>`.
|
|
50
50
|
*
|
|
51
|
-
*
|
|
51
|
+
* Exported from `@flowdrop/flowdrop/ui`.
|
|
52
52
|
*/
|
|
53
53
|
declare const Combobox: import("svelte").Component<Props, {}, "">;
|
|
54
54
|
type Combobox = ReturnType<typeof Combobox>;
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
**Use it for** the Playground chat, the AI assistant and the Console prompt.
|
|
18
18
|
**Not for** a short single-line field; use a plain input inside `Field`.
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
Exported from `@flowdrop/flowdrop/ui`.
|
|
21
21
|
-->
|
|
22
22
|
|
|
23
23
|
<script lang="ts">
|
|
@@ -60,7 +60,7 @@ interface Props {
|
|
|
60
60
|
* **Use it for** the Playground chat, the AI assistant and the Console prompt.
|
|
61
61
|
* **Not for** a short single-line field; use a plain input inside `Field`.
|
|
62
62
|
*
|
|
63
|
-
*
|
|
63
|
+
* Exported from `@flowdrop/flowdrop/ui`.
|
|
64
64
|
*/
|
|
65
65
|
declare const Composer: import("svelte").Component<Props, {}, "value" | "element">;
|
|
66
66
|
type Composer = ReturnType<typeof Composer>;
|
|
@@ -22,7 +22,7 @@ interface Props {
|
|
|
22
22
|
* **Use it for** an empty list or panel, and say what the user can do next.
|
|
23
23
|
* **Not for** an error or a warning; use `Notice`.
|
|
24
24
|
*
|
|
25
|
-
*
|
|
25
|
+
* Exported from `@flowdrop/flowdrop/ui`.
|
|
26
26
|
*/
|
|
27
27
|
declare const EmptyState: import("svelte").Component<Props, {}, "">;
|
|
28
28
|
type EmptyState = ReturnType<typeof EmptyState>;
|
|
@@ -39,7 +39,7 @@ interface Props {
|
|
|
39
39
|
* **Use it for** every labelled input in a config form.
|
|
40
40
|
* **Not for** a checkbox or switch that carries its own label.
|
|
41
41
|
*
|
|
42
|
-
*
|
|
42
|
+
* Exported from `@flowdrop/flowdrop/ui`.
|
|
43
43
|
*/
|
|
44
44
|
declare const Field: import("svelte").Component<Props, {}, "">;
|
|
45
45
|
type Field = ReturnType<typeof Field>;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
**Use it for** close, delete, move up/down, show/hide and other single-glyph actions.
|
|
11
11
|
**Not for** an action that needs a text label; use `Button`.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Exported from `@flowdrop/flowdrop/ui`.
|
|
14
14
|
-->
|
|
15
15
|
|
|
16
16
|
<script lang="ts">
|
|
@@ -33,7 +33,7 @@ interface Props extends Omit<HTMLButtonAttributes, 'children' | 'class' | 'type'
|
|
|
33
33
|
* **Use it for** close, delete, move up/down, show/hide and other single-glyph actions.
|
|
34
34
|
* **Not for** an action that needs a text label; use `Button`.
|
|
35
35
|
*
|
|
36
|
-
*
|
|
36
|
+
* Exported from `@flowdrop/flowdrop/ui`.
|
|
37
37
|
*/
|
|
38
38
|
declare const IconButton: import("svelte").Component<Props, {}, "">;
|
|
39
39
|
type IconButton = ReturnType<typeof IconButton>;
|
|
@@ -74,7 +74,7 @@ interface Props {
|
|
|
74
74
|
* **Use it for** a list of actions behind one control.
|
|
75
75
|
* **Not for** choosing a value for a field; use `Select`.
|
|
76
76
|
*
|
|
77
|
-
*
|
|
77
|
+
* Exported from `@flowdrop/flowdrop/ui`.
|
|
78
78
|
*/
|
|
79
79
|
declare const Menu: import("svelte").Component<Props, {}, "open">;
|
|
80
80
|
type Menu = ReturnType<typeof Menu>;
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
**Use it for** a message that belongs to a part of the page: a failed save, a missing setting.
|
|
12
12
|
**Not for** an empty list; use `EmptyState`. Not for run status; use `StatusPill`.
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Exported from `@flowdrop/flowdrop/ui`.
|
|
15
15
|
-->
|
|
16
16
|
|
|
17
17
|
<script lang="ts">
|
|
@@ -29,7 +29,7 @@ interface Props {
|
|
|
29
29
|
* **Use it for** a message that belongs to a part of the page: a failed save, a missing setting.
|
|
30
30
|
* **Not for** an empty list; use `EmptyState`. Not for run status; use `StatusPill`.
|
|
31
31
|
*
|
|
32
|
-
*
|
|
32
|
+
* Exported from `@flowdrop/flowdrop/ui`.
|
|
33
33
|
*/
|
|
34
34
|
declare const Notice: import("svelte").Component<Props, {}, "">;
|
|
35
35
|
type Notice = ReturnType<typeof Notice>;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
**Use it for** the top of a docked panel or a sheet.
|
|
11
11
|
**Not for** a section title inside a form; use a heading or `Field`.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Exported from `@flowdrop/flowdrop/ui`.
|
|
14
14
|
-->
|
|
15
15
|
|
|
16
16
|
<script lang="ts">
|
|
@@ -29,7 +29,7 @@ interface Props extends Omit<HTMLAttributes<HTMLElement>, 'class' | 'title' | 'c
|
|
|
29
29
|
* **Use it for** the top of a docked panel or a sheet.
|
|
30
30
|
* **Not for** a section title inside a form; use a heading or `Field`.
|
|
31
31
|
*
|
|
32
|
-
*
|
|
32
|
+
* Exported from `@flowdrop/flowdrop/ui`.
|
|
33
33
|
*/
|
|
34
34
|
declare const PanelHeader: import("svelte").Component<Props, {}, "">;
|
|
35
35
|
type PanelHeader = ReturnType<typeof PanelHeader>;
|
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
|
|
12
12
|
`float` draws the switch as its own floating control, as in the canvas toolbar.
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Exported from `@flowdrop/flowdrop/ui`.
|
|
15
15
|
-->
|
|
16
16
|
|
|
17
17
|
<script lang="ts">
|
|
18
18
|
import Icon from '@iconify/svelte';
|
|
19
19
|
|
|
20
|
-
interface SegmentedOption {
|
|
20
|
+
export interface SegmentedOption {
|
|
21
21
|
/** Value written to `value` when chosen */
|
|
22
22
|
value: string;
|
|
23
23
|
/** Visible label */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
interface SegmentedOption {
|
|
1
|
+
export interface SegmentedOption {
|
|
2
2
|
/** Value written to `value` when chosen */
|
|
3
3
|
value: string;
|
|
4
4
|
/** Visible label */
|
|
@@ -39,7 +39,7 @@ interface Props {
|
|
|
39
39
|
*
|
|
40
40
|
* `float` draws the switch as its own floating control, as in the canvas toolbar.
|
|
41
41
|
*
|
|
42
|
-
*
|
|
42
|
+
* Exported from `@flowdrop/flowdrop/ui`.
|
|
43
43
|
*/
|
|
44
44
|
declare const Segmented: import("svelte").Component<Props, {}, "value">;
|
|
45
45
|
type Segmented = ReturnType<typeof Segmented>;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
**Use it for** choosing one value in a config form.
|
|
16
16
|
**Not for** a list of actions; use `Menu`. Not for a two or three way mode; use `Segmented`.
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
Exported from `@flowdrop/flowdrop/ui`.
|
|
19
19
|
-->
|
|
20
20
|
|
|
21
21
|
<script lang="ts">
|
|
@@ -37,7 +37,7 @@ interface Props extends Omit<HTMLSelectAttributes, 'size' | 'children' | 'value'
|
|
|
37
37
|
* **Use it for** choosing one value in a config form.
|
|
38
38
|
* **Not for** a list of actions; use `Menu`. Not for a two or three way mode; use `Segmented`.
|
|
39
39
|
*
|
|
40
|
-
*
|
|
40
|
+
* Exported from `@flowdrop/flowdrop/ui`.
|
|
41
41
|
*/
|
|
42
42
|
declare const Select: import("svelte").Component<Props, {}, "">;
|
|
43
43
|
type Select = ReturnType<typeof Select>;
|